About eager

release

2.2.2

... 6.1 . Fixed several bugs in handling eager fetch. Fixed a pessimistic locking bug . ...

 
forum_thread

Merge on detached entities

Hello, it is possible to merge detached entities? There are some attached entities which load from the database. The transaction is finished and the entities become detached. In a new transaction the fields of the detached entities will be changed and a merge by em.merge(entity) will be saved the entities. Can this works correctly? How are the rules of the merge process? Do the changed fields of the detached entity overwrite the fields in the database? Also changed fields which are set to null? #1 2017-09-19 09:54 Hello, it is possible to merge detached entities? There are some attached entities which load fro ...

 
forum_thread

OrphanRemoval not working?

Dear all, I have entities Invoice and InvoiceItem, their relation is defined: public class Invoice implements Serializable { ..     @OneToMany(mappedBy = "invoice", fetch= FetchType.EAGER, orphanRemoval=true, cascade= CascadeType.ALL)     private List<InvoiceItem> invoiceItemList; .. } ... = "invoice" , fetch = FetchType . EAGER , orphanRemoval = true , cascade = ...

 
forum_thread

Using of Second Level Cache

In our use case we want to find some entity types always again very quickly by primary key or query in many short transactions. The entity MyEntity1 and its relationships to MyEntity2/MyEntity3 was load and the entity MyEntity1 is taken in the second level cache, the other entity types not. Are the relationships to MyEntity2/MyEntity3 still always referenced although the entity manager is closed, so that the memory for MyEntity2 and MyEntity3 can never be released by garbage collector? ... fields may be initialised as null / empty list, unless eager fetch is used. Anyway, when the MyEntity2 and MyEntity3 instances ...

 
issue

JPQL support for Maps (JPA 2.0)

JPQL 2.0 introduces the ability define FROM variables for map keys and values. Currently ObjectDB supports FROM variables for collection elements and FROM variables for map keys and values are expected to be supported in future versions. ... @ ElementCollection ( fetch = EAGER ) @ Column ( name = "DATA_VALUE" ...

 
forum_thread

Does ObjectDB support lazy loading?

I'm evaluating ObjectDB 2.0 RC1. Everything works fine except a lazy loading problem. I've a Parent class which contains List<Child>, marked with @OneToMany. After persisting a Parent object, (in the Explorer) I can see all the property values of the Child objects in the list. However, when the Parent object is read from EntityManager, all the properties except ID of the Child objects are null. The EntityManager is not yet closed when the getters are called.... I change the annotation to @OneToMany(fetch=FetchType.EAGER), the properties can be read. It seems to me that ObjectDB doesn't ... ObjectDB does support both lazy and eager loading. If you found a problem in a specific situation - please provide ...

 
forum_thread

TemporalType injection with Calendar using JPA

I have ObjectDB  JPA  comsummed by a RESTful web service deployed on Tomcat. I am using an embedded object as a primary key, which has time fields which I have annotated with TemporalType.TIMESTAMP When I use a java.util.Date as a field on this object there is no problem. However, if I use a java.util.Calendar it encounters an exception.   Calendar is what I need.  Is there something obvious here that I am failing to see?   ... , fetch = javax. persistence . FetchType . EAGER ) public List<Point> getPoints ( ) ...

 
forum_thread

com.objectdb.o.NLV cannot be cast to com.objectdb.o.RSV

Hello! This query is working fine SELECT DISTINCT $1 FROM ChatHistoryItem $1 JOIN $1.recipient $2 JOIN $1.sender $3 WHERE ($2.id='22afeafe-363f-4397-8553-cc5688ba142d') OR ($3.id='22afeafe-363f-4397-8553-cc5688ba142d')  ORDER BY MAX($1.createDate) DESC   but this query returns an exception "com.objectdb.o.NLV cannot be cast to com.objectdb.o.RSV" SELECT DISTINCT $1 FROM ChatHistoryItem $1 JOIN $1.recipient $2  ... class , fetch = FetchType . EAGER ) private List<ChatAttachment> attachments ; ...

 
forum_thread

Items in list are doubled, when the entity class is not enhanced

Dear all, I have a problem with adding items (entities) into other entity list. When the classes are not enhanced, added items are doubled. Here is an example: ... = "customer" , fetch = FetchType . EAGER , cascade = CascadeType . ALL , ...

 
forum_thread

@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 (but without loading content of the photos) I get java.lang.OutOfMemoryError: Java heap space (the server is started with -Xmx4096M). Heap dump shows that there are very much space is used by contents of the photos despite of using fetch = FetchType.LAZY. How can I fix this memory issue? #1 2014-06-10 22:52 Hello. I have a class Thing that contains OneToMany list of classes Photo. Photo contains  @ L ...