O'Reilly logo

Java EE 7 Developer Handbook by Peter A. Pilgrim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Entity graphs

JPA fundamentally permits field and properties for persistence capable objects, mapped superclasses and embedded classes, to be retrieved as FetchType.EAGER or FetchType.LAZY. Just for the purposes of revision we shall note that FetchType.LAZY is the default for @OneToMany and @ManyToMany associations; FetchType.EAGER is the default for @OneToOne and @ManyToOne associations.

An entity graph is a template that is defined in the form of metadata or an object created by the dynamic Entity Graph API, which captures the path and boundaries for a query or operation. Another way of stating the definition is that an entity graph is an application configurable fetch plan that instructs the JPA provider on how to retrieve entities from the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required