EL Expression should read (forgot to format)
Actually, forget about this question as the elements in the foo are contained in a Set (i.e. unordered this would never work.
To avoid an extra roundtrip to the db you can also have a separate query with join fetch that is used for that particular case.
Yes. What you will need to do is us use fetch. Fetch will eagerly fetch the join. So in your foo.bars you will in your entityManager.createQuery(
select foo from Foo foo where join fetch foo.bar)