Sorry, it was late when I made the last post. I was thinking about the Fetch 
Joins. 



anonymous wrote : 4.4.5.3 Fetch Joins
  | An important use case for LEFT JOIN is in enabling the prefetching of 
related data items as a side effect
  | of a query. This is accomplished by specifying the LEFT JOIN as a FETCH 
JOIN.
  | A FETCH JOIN enables the fetching of an association as a side effect of the 
execution of a query. A
  | FETCH JOIN is specified over an entity and its related entities.
  | The syntax for a fetch join is
  | fetch_join ::= [ LEFT [OUTER] | INNER ] JOIN FETCH 
join_association_path_expression
  | The association referenced by the right side of the FETCH JOIN clause must 
be an association that
  | belongs to an entity that is returned as a result of the query. It is not 
permitted to specify an identification
  | variable for the entities referenced by the right side of the FETCH JOIN 
clause, and hence references
  | to the implicitly fetched entities cannot appear elsewhere in the query.
  | The following query returns a set of departments. As a side effect, the 
associated employees for those
  | departments are also retrieved, even though they are not part of the 
explicit query result. The persistent
  | fields or properties of the employees that are eagerly fetched are fully 
initialized. The initialization of
  | the relationship properties of the employees that are retrieved is 
determined by the metadata for the
  | Employee entity class.
  | 

SELECT d
  | FROM Department d LEFT JOIN FETCH d.employees
  | WHERE d.deptno = 1

anonymous wrote : 
  | A fetch join has the same join semantics as a left outer join, except that 
the related objects specified on
  | the right-hand side of the join operation are not returned in the query 
result or otherwise referenced in
  | the query. Hence, for example, if department 1 has five employees, the 
above query returns five references
  | to the department 1 entity.
  | 

Extract from ejb-3_0-pfd-spec-persistence.pdf


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3923603#3923603

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3923603


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to