About FetchType

41-50 of 132Refresh
Forum
3

Should derived fields of an EmbeddedId be manually maintained by app code?

javax.persistence.FetchType; import javax.persistence.ManyToOne; import javax.persistence.MapsId ... ; } } @EmbeddedId public ECompoundKeyMapItemId id; @ManyToOne(fetch=FetchType.LAZY) @MapsId("cont ... ; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence
Forum
2

find() cost unreasonable time!

="parent") protected Nodes parent; @OneToMany(mappedBy="parent",fetch=FetchType.EAGER) protected ... .persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import ... ; @OneToMany(mappedBy="parent",fetch=FetchType.EAGER) protected List Sons; public int getId
Forum
2

How to Remove records from many to many relationship tables in JPA

TransportationEvent { ... @ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.PERSIST) private ... Conclusion { .... @ManyToMany( fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) private List ... _ORPHAN) and i applied that as @ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType
Issue
2

Best practise loading big data

.FetchType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence ... .class, fetch = FetchType.LAZY) ArrayList stepBlocks = new ArrayList ... = MyStep.class, fetch = FetchType.LAZY) ArrayList steps = new ArrayList<>(); } @Entity
Forum
2

@ElementCollection of type enum

Hi! I have in an entity called User with the following field: @ElementCollection(fetch = FetchType ... and BASIC231. Conclusion: @ElementCollection(fetch = FetchType.EAGER) private Set permissions ... printing logs directly in the code. Desired case: @ElementCollection(fetch = FetchType.EAGER) containing
Issue
2

ArrayIndexOutOfBoundException

final class CacheableJobStat { @OneToOne(fetch = FetchType.EAGER) private CacheableJobInfo ji; @OneToOne(fetch = FetchType.EAGER) private CacheableJobLog jl; } Where CacheableJobInfo ... the @OneToOne(fetch = FetchType.EAGER) annotation. I am not sure wheather this annotation is allowed when not
Forum
2

Broken @ManyToOne reference

: @MappedSuperclass public abstract class A { @Id @ManyToOne(fetch = FetchType.EAGER, cascade=CascadeType ... javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.ManyToOne; import ... {   //  @Id   @ManyToOne(fetch = FetchType.EAGER)   public AbstractParent prn; } the output
Forum
2

can't get HashMap out of the database

(fetch=FetchType.EAGER). Outside the DAO method only fields that have already been loaded are available ... (fetch=FetchType.EAGER, cascade=CascadeType.ALL) private HashMap map = new HashMap ... =FetchType.EAGER, cascade=CascadeType.ALL)     private ArrayList guests = new ArrayList
Forum
2

EntityManager JPA or JDO impl and different behavior

;         }                 @OneToMany(cascade=CascadeType.PERSIST, fetch=FetchType.EAGER)         public List ... .ALL,                    fetch=FetchType.EAGER, orphanRemoval=true)         //@ElementCollection(fetch=FetchType.EAGER)         public Map getDisplayValues() {             return displayValues
Forum
2

Fetching Collections Puzzle

If I dont 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 zero When I declare the FetchType as