About FetchType

api-jpa

Basic.fetch

(Optional) Defines whether the value of the field or property should be lazily loaded or must be eagerly fetched.(Annotation Element of javax.persistence.Basic)

 
api-jpa

OneToOne.fetch

(Optional) Whether the association should be lazily loaded or must be eagerly fetched.(Annotation Element of javax.persistence.OneToOne)

 
api-jpa

javax.persistence.ManyToOne

Defines a single-valued association to another entity class that has many-to-one multiplicity.(Annotation of JPA)

 
api-jpa

javax.persistence.ManyToMany

Defines a many-valued association with many-to-many multiplicity.(Annotation of JPA)

 
doc

java.lang.Comparable

(Interface of java.langInterface Comparable)

 
doc

java.io.Serializable

(Interface of java.ioInterface Serializable)

 
api-jpa

javax.persistence.Basic

The simplest type of mapping to a database column.(Annotation of JPA)

 
api-jpa

javax.persistence.OneToMany

Defines a many-valued association with one-to-many multiplicity.(Annotation of JPA)

 
api-jpa

javax.persistence.ElementCollection

Defines a collection of instances of a basic type or embeddable class.(Annotation of JPA)

 
forum_thread

Fetching Collections Puzzle

I am working on a project where I need to travel through a massive graph of objects. One of the main entity is the Node which is shown below. class Node { Node parent List<Node> children Node rightSibling Node leftSibling int rank } I have the following issues/doubts ... declare explicitly the fetch strategy for "children" as FetchType.Eager, then how can I retrieve the Nodes stored in this list. Because no matter what I try, if I dont declare the FetchType to Eager, the children field of all my retrieved nodes are of size ...