ObjectDB Database Search

1-50 of 143 results

Retrieving JPA Entity Objects

retrieval by using a lazy fetch type: @Entity class Employee { : @ManyToOne ( fetch = FetchType . LAZY ) private Employee manager; : } The default for non collection and map references is FetchType . EAGER ... FetchType . LAZY in either @OneToOne or @ManyToOne annotations (currently ObjectDB does not distinguish

Problem with @Basic(fetch = FetchType.LAZY)

I have a class where two fields are annotated with  @Basic(fetch = FetchType .LAZY ... = FetchType .LAZY) private String description; @Basic(fetch = FetchType .LAZY) private String code ... and description properties must have been loaded on the query, ignoring the  fetch = FetchType .LAZY hint

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 ... am using in object declaration @OneToMany(fetch= FetchType .EAGER, cascade = CascadeType.ALL) private ... @OneToMany(fetch= FetchType .LAZY, cascade = CascadeType.ALL) private LinkedList referencedObj

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

Hello. @OneToMany(fetch = FetchType .LAZY) doesn't work when using EJB or something else related ... , generator = "b") private int id; @OneToMany(fetch = FetchType .LAZY, cascade = CascadeType ... Parent { // ...id @OneToOne(fetch = FetchType .LAZY, cascade = CascadeType.ALL) private ByteData bydaData

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

; @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? Vladiator Vlad Myachikov FetchType .LAZY is a hint that JPA implementations are allowed to ignore. Currently

EnumRef jakarta.persistence.FetchType

JPA Enum FetchType java.lang.Object ∟  java.lang.Enum ∟  jakarta.persistence. FetchType Defines strategies for fetching data from the database. The EAGER strategy is a requirement on the persistence provider runtime that data must be eagerly fetched. The LAZY strategy is a hint

EnumConstRef jakarta.persistence.FetchType.EAGER

JPA Enum Constant in jakarta.persistence. FetchType EAGER Data must be eagerly fetched. Since: JPA 1.0

EnumConstRef jakarta.persistence.FetchType.LAZY

JPA Enum Constant in jakarta.persistence. FetchType LAZY Data may be lazily fetched. Since: JPA 1.0

JPA Entity Fields

; @OneToMany ( fetch = FetchType . EAGER ) List field3; } The entity class declaration

General Performance Issues Illustrated with a Specific Method

.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence. FetchType ; import javax ... (cascade = CascadeType.ALL,fetch = FetchType .EAGER) private Person person; @Index private String phn; private String comments; /* Create Properties */ @ManyToOne(fetch = FetchType .LAZY) private WebUser

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 doppelrittberger

significant performance decrease

; @OneToMany(fetch= FetchType .LAZY) public List actions = new ArrayList (); @OneToMany(fetch= FetchType .LAZY) public List childNodes = new ArrayList (); @OneToMany(fetch= FetchType .LAZY) public List container = new ArrayList (); @OneToOne(fetch= FetchType .LAZY) public ObjectNode currentLocation; @OneToOne

persisting object with long[][] arrays of array

.persistence.Entity; import javax.persistence. FetchType ; import javax.persistence.Id; import javax ... ;  @OneToMany(fetch = FetchType .EAGER, cascade = CascadeType.ALL) public long[] time;     @OneToMany(fetch = FetchType .EAGER, cascade = CascadeType.ALL) private long[][] a1;   

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

.persistence.Entity; import javax.persistence.EntityManager; import javax.persistence. FetchType ; import ... ; @ManyToOne(fetch= FetchType .LAZY) @MapsId("cont") private EContainer container; public EContainer ... ; import javax.persistence. FetchType ; import javax.persistence.ManyToOne; import javax.persistence

InterfaceRef jakarta.persistence.spi.ProviderUtil

of all attributes for which FetchType .EAGER has been specified have been loaded, this method returns ... all attributes with FetchType .EAGER have been loaded, this method returns LoadState.NOT_LOADED ... with FetchType .EAGER have not been loaded or that the state of the specified attribute has not been loaded

Missing (null) elements in eager loaded references

= FetchType . EAGER ) private List costs ; etc... } Hierarchical entities: @Entity public class Element extends BaseCostElement { @OneToMany (mappedBy = "parent" , fetch = FetchType . EAGER ) private List ... extends BaseCostElement { @OneToMany (mappedBy = "parent" , fetch = FetchType . EAGER ) private List

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

public class TransportationEvent { ... @ManyToMany(fetch = FetchType .EAGER, cascade = CascadeType ... { .... @ManyToMany( fetch = FetchType .LAZY, cascade = CascadeType.PERSIST) private List transportationEvents ... .annotations.CascadeType.DELETE_ORPHAN) and i applied that as @ManyToMany(fetch = FetchType .EAGER, cascade

Performance issue in a query due to compareTo calls

) @ElementCollection private Map values = new HashMap (); @OneToOne (fetch = FetchType .LAZY, cascade ... ; @OneToOne (fetch = FetchType .EAGER) private TCStep step; //For performance reasons, we use a list ... @ElementCollection (fetch = FetchType .EAGER) private Map values = new HashMap (); } btc_es BTC

Multi threading on DMOs by lazy loading

It is possible to use lazy loading on fields of attached entities by several threads? Example: class EntityZ { @OneToOne(fetch = FetchType .LAZY) EntityX fieldX; @OneToOne(fetch = FetchType .LAZY) EntityY fieldY; @ElementCollection (fetch = FetchType .LAZY) List list; } We want to load the entity

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

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

Merge with Parent/Child entities not possible

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

Broken @ManyToOne reference

public abstract class A { @Id @ManyToOne(fetch = FetchType .EAGER, cascade=CascadeType.ALL, optional ... at ChildSuper : package testobjectdb; import javax.persistence. FetchType ; import javax.persistence.Id ... public abstract class ChildsSuper {   //  @Id   @ManyToOne(fetch = FetchType .EAGER

EntityManager JPA or JDO impl and different behavior

; @OneToMany(cascade=CascadeType.PERSIST, fetch= FetchType .EAGER)         ... ;   fetch= FetchType .EAGER, orphanRemoval=true)         //@ElementCollection(fetch= FetchType .EAGER)         public

Fetching Collections Puzzle

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 Eager

can't get HashMap out of the database

annotating the map with @OneToMany(fetch= FetchType .EAGER). Outside the DAO method only fields ... signingDate;     @OneToMany(fetch= FetchType .EAGER, cascade=CascadeType ... class GuestHolder { // Persistent Fields: @Id @GeneratedValue Long id; @OneToMany(fetch= FetchType

Annotate a Map field with @ElementCollection or @Basic

;ElementCollection , EAGER for Basic ). You may try using an @ElementCollection(fetch= FetchType .EAGER) and see if it is fast as @Basic support Support I tested it already with @ElementCollection(fetch= FetchType ... = FetchType .EAGER) , which may be more appropriate for maps that contain external relationships. support Support

AnnotationRef jakarta.persistence.ManyToMany

FetchType fetch default FetchType .LAZY (Optional) Whether the association should be lazily loaded or

AnnotationRef jakarta.persistence.ElementCollection

FetchType fetch default FetchType .LAZY (Optional) Whether the collection should be lazily loaded or

AnnotationRef jakarta.persistence.OneToOne

of the association. By default no operations are cascaded. Since: JPA 1.0 FetchType fetch default FetchType .EAGER (Optional) Whether the association should be lazily loaded or must be eagerly fetched

AnnotationAttrRef jakarta.persistence.OneToOne.fetch

JPA Annotation Attribute in jakarta.persistence.OneToOne FetchType fetch default FetchType .EAGER (Optional) Whether the association should be lazily loaded or must be eagerly fetched. The EAGER strategy is a requirement on the persistence provider runtime that the associated entity must be eagerly

AnnotationRef jakarta.persistence.OneToMany

to the map value. Since: JPA 1.0 FetchType fetch default FetchType .LAZY (Optional

AnnotationAttrRef jakarta.persistence.OneToMany.fetch

JPA Annotation Attribute in jakarta.persistence.OneToMany FetchType fetch default FetchType .LAZY (Optional) Whether the association should be lazily loaded or must be eagerly fetched. The EAGER strategy is a requirement on the persistence provider runtime that the associated entities

AnnotationAttrRef jakarta.persistence.ManyToMany.fetch

JPA Annotation Attribute in jakarta.persistence.ManyToMany FetchType fetch default FetchType .LAZY (Optional) Whether the association should be lazily loaded or must be eagerly fetched. The EAGER strategy is a requirement on the persistence provider runtime that the associated entity

AnnotationAttrRef jakarta.persistence.ManyToOne.fetch

JPA Annotation Attribute in jakarta.persistence.ManyToOne FetchType fetch default FetchType .EAGER (Optional) Whether the association should be lazily loaded or must be eagerly fetched. The EAGER strategy is a requirement on the persistence provider runtime that the associated entity

AnnotationRef jakarta.persistence.ManyToOne

of the association. By default no operations are cascaded. Since: JPA 1.0 FetchType fetch default FetchType .EAGER

AnnotationRef jakarta.persistence.Basic

Public Annotation Attributes FetchType fetch default FetchType .EAGER (Optional) Whether the value

AnnotationAttrRef jakarta.persistence.Basic.fetch

JPA Annotation Attribute in jakarta.persistence.Basic FetchType fetch default FetchType .EAGER (Optional) Whether the value of the field or property should be lazily loaded or must be eagerly fetched. The EAGER strategy is a requirement on the persistence provider runtime that the associated entity

ProviderUtil.isLoaded(entity) - JPA Method

of all attributes for which FetchType .EAGER has been specified have been loaded, this method returns ... all attributes with FetchType .EAGER have been loaded, this method returns LoadState.NOT_LOADED

AnnotationAttrRef jakarta.persistence.ElementCollection.fetch

JPA Annotation Attribute in jakarta.persistence.ElementCollection FetchType fetch default FetchType .LAZY (Optional) Whether the collection should be lazily loaded or must be eagerly fetched. The EAGER strategy is a requirement on the persistence provider runtime that the associated entity

InterfaceRef jakarta.persistence.PersistenceUtil

of an entity passed as a reference. An entity is considered loaded if all attributes for which FetchType .EAGER

PersistenceUtil.isLoaded(entity) - JPA Method

JPA Method in jakarta.persistence.PersistenceUtil boolean isLoaded (   Object entity ) Determine the load state of an entity. This method can be used to determine the load state of an entity passed as a reference. An entity is considered loaded if all attributes for which FetchType

PersistenceUnitUtil.isLoaded(entity) - JPA Method

if all attributes for which FetchType .EAGER has been specified have been loaded. The (Object, String

InterfaceRef jakarta.persistence.PersistenceUnitUtil

. An entity is considered loaded if all attributes for which FetchType .EAGER has been specified

ProviderUtil.isLoadedWithReference(entity,attributeName) - JPA Method

itself and that either the entity attributes with FetchType .EAGER have not been loaded or

ProviderUtil.isLoadedWithoutReference(entity,attributeName) - JPA Method

has been provided by itself and that either entity attributes with FetchType .EAGER have not been loaded or

Once served to JSF page via @EJB query bean, many list fields are null (but same query ok after fresh persist in @PostConstruct)

() { return ownedElements; } private Element owner; @ManyToOne(fetch = FetchType .LAZY) @JoinTable(name ... , but there are other cases without these that also exhibit the problem. Also, I don't think the FetchType ... is to set the fetch type to EAGER: @OneToMany(mappedBy = "owner", cascade = CascadeType.ALL, fetch= FetchType

New entity objects are duplicated on merge cascading

;       @OneToMany(cascade= CascadeType.ALL, fetch= FetchType .EAGER ... ;    @OneToOne(fetch = FetchType .LAZY, cascade = CascadeType.ALL)     ... ;       @ManyToOne(fetch= FetchType .LAZY)      

Best practise loading big data

.persistence . FetchType ; import javax.persistence . Id ; import javax.persistence . OneToMany ; import ... ; @OneToMany (cascade = CascadeType . ALL , targetEntity = MyStepBlock . class , fetch = FetchType ... (cascade = CascadeType . ALL , targetEntity = MyStep . class , fetch = FetchType . LAZY ) ArrayList steps

Tracking changes to new collections (in enhancement mode) after flush

= "uid") private String uid; @OneToOne (fetch = FetchType .EAGER, cascade = {CascadeType.REFRESH, CascadeType.DETACH }) private ModelElementImpl element; @OneToMany (fetch = FetchType .EAGER, cascade ... uid; @OneToOne (fetch = FetchType .EAGER, cascade = {CascadeType.REFRESH, CascadeType.DETACH }) private

ArrayIndexOutOfBoundException

{ @OneToOne(fetch = FetchType .EAGER) private CacheableJobInfo ji; @OneToOne(fetch = FetchType .EAGER) private ... . The problem dissapeared when removing the @OneToOne(fetch = FetchType .EAGER) annotation. I am not