About FetchType

1-10 of 133Refresh
JPA Doc
129

javax.persistence.FetchType

javax.persistence Enum FetchType java.lang.Object java.lang.EnumFetchType> javax.persistence.FetchType Implemented Interfaces: Serializable, Comparable<FetchType ... See Also: Basic ElementCollection ManyToMany OneToMany ManyToOne OneToOne FetchType EAGER Defines that data
JPA Doc
124

values()

Static Method javax.persistence.FetchType FetchType[] values() Returns an array containing the constants of this enum type. This method may be used to iterate over the constants as follows: for (FetchType c : FetchType.values()) System.out.println(c) Returns: an array containing the constants of this enum type, in the order they are declared
JPA Doc
122

valueOf(name)

Static Method javax.persistence.FetchType FetchType valueOf(   String name ) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. Parameters: name - the name of the enum constant to be returned
JPA Doc
120

FetchType.EAGER

Enum Constant javax.persistence.FetchType EAGER Defines that data must be eagerly fetched. Since: JPA 1.0
JPA Doc
120

FetchType.LAZY

Enum Constant javax.persistence.FetchType LAZY Defines that data can be lazily fetched. Since: JPA 1.0
Forum
42

Problem with @Basic(fetch = FetchType.LAZY)

I have a class where two fields are annotated with @Basic(fetch = FetchType.LAZY ... ; @Basic(fetch = FetchType.LAZY) private String description; @Basic(fetch = FetchType.LAZY ... = FetchType.LAZY hint. Am I doing something wrong? (I am using objectdb-2.3.6_10)   tia, Wim   LAZY in JPA
Forum
41

@OneToMany(fetch = FetchType.LAZY) list is always null

Hello. @OneToMany(fetch = FetchType.LAZY) doesn't work when using EJB or something else related ... ") private int id; @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) private List ... = FetchType.LAZY, cascade = CascadeType.ALL) private ByteData bydaData; public Parent
Forum
41

Is there any restriction when using fetch=FetchType.LAZY ?

Hi, I came across a weird behavior when using fetch=FetchType.LAZY in a complex code. However I ... in object declaration @OneToMany(fetch=FetchType.EAGER, cascade = CascadeType.ALL) private ... @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL) private LinkedList
Forum
41

@Lob @Basic(fetch = FetchType.LAZY) is loaded when it's not needed

Hello. I have a class Thing that contains OneToMany list of classes Photo. Photo contains  @Lob @Basic(fetch = FetchType.LAZY) private byte[] content; And after some queries with Thing ... of the photos despite of using fetch = FetchType.LAZY. How can I fix this memory issue? FetchType.LAZY
Issue
40

Cascade.ALL with LAZY fetchtype does not clean up all references on remove

Hello, I have a tree of entity classes that reference others using Cascade.ALL in combination with FetchType.LAZY. If I now delete a root entity using EntityManager.remove all leaf nodes will not ... the database. If you remove the FetchType everything works. Best regards Markus Thank you for this report. Please try build 2.7.2_09. doppelrittberger