|[eclipselink-users] Fetching with Eclipselink|
Hello I have an object Product with a @ManyToOne relation to a Category Object.Default the fetch type of this relation is EAGER (Category is loaded, when Product is loaded). But when I load a Product by Id, I see there is a second select that loads the Category object.
This is not what I want. Why doesn't eclipselink translates thisautomatically in one single query?
I temporary solved this by defining a named query: select p from Product p inner join fetch p.category where p.id = :productId.
Now a product and its category are loaded in one select statement.Is there a way to let eclipselink automatically load the objects in one select or do I always have to use a named query for this?
Back to the top