About FetchType

41-50 of 131Refresh
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
Forum
2

Is it possible to remove parent/child entities without refresh?

.persistence.FetchType; import javax.persistence.FlushModeType; import javax.persistence ...   private long id;   @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy ... {   @Id   @GeneratedValue   private long id;   @ManyToOne(fetch = FetchType.LAZY, cascade