About fetch

21-30 of 200Refresh
Manual
32

Retrieving JPA Entity Objects

Fetch Retrieval of an entity object from the database might cause automatic retrieval of additional ... using a lazy fetch type: @Entity class Employee { : @ManyToOne(fetch=FetchType.LAZY ... with the FetchType.LAZY fetch policy is initialized to reference a new managed hollow object (unless
Forum
31

How do I achieve a Deep Fetch using JOIN FETCH?

know that I can express one level of eager fetch in JPQL as follows: SELECT c FROM C JOIN FETCH c.bList WHERE c.id=:id But when I attempt to take it to the 2nd level: SELECT c FROM C JOIN FETCH c.bList JOIN FETCH c.bList.aList WHERE c.id=:id I get an error along the lines of: Invalid fetch path
Forum
25

JPQL JOIN FETCH Error

fetch doi.metadata metadata left join fetch metadata.titles titles left join fetch metadata.creators creators left join fetch metadata.descriptions descriptions left join fetch metadata.publishers publishers left join fetch metadata.contributors contributors left join fetch metadata.dates
Forum
25

Left join fetch behaviour doesn't retrieve children?

Hello, I'm a little bit confused about a left join fetch behaviour. In this test case, i try to fetch my 3 children using a left join fetch. But my collection is null after closing the em. It was expected to be fetched before closing the em, no ? In fact, that is the objective of the fetch purpose
Forum
23

Lazy Init / Eager / Join Fetch collection strategy ? What to choose ?

Hello, I'm doing some tests to choose the best collection fetch strategy. I have entities with many ... ,join fetch seems to be the right choice. What about ObjectDb ? The implementation is totally different. Is an "All eager strategy" more efficient that many join fetch ( cartesian product + distinct
Forum
23

LEFT JOIN FETCH over empty embedded collection returns no results

First of all, thank you for promptly implementing JOIN FETCH over nested paths in response ... , but I attempt to LEFT JOIN FETCH all the members of a collection within a (non-existent) member ... FETCH c.bList WHERE id=:id; But if I include the full nested fetch, it fails, returning an empty result
Forum
22

How to use JOIN FETCH?

JOIN FETCH to avoid excessive round trips to the database: SELECT c FROM Country c JOIN FETCH c ... addresses (obviously fetched lazily), but still 2 results.  What should I be doing to get what I want out of this query? Note that I need to get the fetch mode specified in the query, not in
Forum
22

Problem with @Basic(fetch = FetchType.LAZY)

I have a class where two fields are annotated with @Basic(fetch = FetchType.LAZY ... app). Yet they don't seem to be fetched lazily. This class should hopefully demonstrate the problem ... ; @Basic(fetch = FetchType.LAZY) private String description; @Basic(fetch = FetchType.LAZY
Forum
22

Fetching Collections Puzzle

If I dont declare explicitly the fetch strategy for "children" as FetchType.Eager, then how can I ... default JPA spec says that  colletions are to be lazy fetched. You can try this in a query.  "select n from Node n left outer join fetch n.children where ....." this will also fetch your collection
Forum
22

Query with FETCH JOIN returns multiple results instead of one.

jpqlResult = em.createQuery( "SELECT d FROM Demand d JOIN FETCH d.services WHERE d=:demand ... and fetch its services. Demand object is identified and found correctly, but as it is associated ... should return only one result, with fetched service sub-elements, shouldn't it? I am almost sure