Home » Search

About FetchType

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

Merge with Parent/Child entities not possible

.EntityManagerFactory; import javax.persistence.FetchType; import javax.persistence.FlushModeType; import ... = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "parent", orphanRemoval = true)   @MapKey ... long id;   @ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE
Forum
2

Transaction isolation support?

, and each User have a list of books which the user own defined as @OneToMany(fetch=FetchType.LAZY) ListFetchType.LAZY changes to FetchType.EAGER? In a SQL database, A and B would run in
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

LAZY @ManyToOne field functions as EAGER

as @ManyToOne(fetch=FetchType.LAZY) ?   package com.greensoft.objectdb.test.console; import ... );         }         @ManyToOne(fetch=FetchType.LAZY, cascade= CascadeType.ALL)         C cLazy;                 @ManyToOne(fetch=FetchType.EAGER, cascade= CascadeType.ALL)         C cEager
Forum
2

Merge Issue: Attempt to reuse an existing primary key value

();     }     @Entity     static class A {         //@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "parent")         @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType ... {         @ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.ALL })         private A parent