Forward Email to jdo-dev.

Regards Michael


-------- Original-Nachricht --------
Betreff:        JPA 2.1's fetch plan support
Datum:  Thu, 13 Jun 2013 15:57:18 -0500
Von:    Matthew Adams <[email protected]>
Antwort an:     <[email protected]>
An:     <[email protected]>



I've reviewed JPA 2.1's fetch plan support (I happen to be writing a JPA
course right now).  Quick synopsis (I'm pressed for time):

* Terminology:  JPA "EntityGraph" (EG) ~= JDO "FetchPlan"

* JPA EGs define graphs only

* They only apply to em.find(..) operations and queries, being given as hint

* Two kinds of hints:
  * "javax.persistence.fetchgraph" => *only* the attributes identified in
EG loaded; overrides any other fetching policies
  * "javax.persistence.loadgraph" =>guarantees that *at least* the
attributes identified in the EG; all other fetching policies apply
according to their user-specified values or JPA defaults

* EG definitions contain all attributes within the definition itself;
presents maintenance issue if you remove an attribute that was used in an EG

* Annotations are quite verbose:
@NamedEntityGraph(attributeNodes={@NamedAttributeNode("projects")})

* Can be specified in XML metadata (less verbosely)

* Can't specify graph depth, recursion or otherwise

* API form:  interface EntityGraph, etc

See JPA 2.1 specification, section 3.7, p.109 for more info.  I need to
review JDO's fetch plan support for comparison, as I don't remember some of
the details.

-matthew

--
mailto:[email protected] <[email protected]>
skype:matthewadams12
googletalk:[email protected]
http://matthewadams.me
http://www.linkedin.com/in/matthewadams



Reply via email to