About Entity

forum_thread

Primary key generation problem after changing entity package

Hi, I changed package name for some of my entities in database. I added info in <schema><package... /></schema> of my configuration file - and the changes have been succesfully made in database. Unfortunately, sequences have been probably lost for changed entity classes. After schema change I keep getting errors : Attempt to reuse an existing primary key value... My primary keys are annotated as shown below : ... sequences have been probably lost for changed entity classes. After schema change I keep getting errors : Attempt to ... ( ) ; }   @ Entity public static class A { @ Id ...

 
forum_thread

Entity Update - Is the documentation up to date?

I'm working on my first ObjectDB project, and I just went back and reviewed some of the documentation.  Turns out I've been doing two things that http://www.objectdb.com/java/jpa/persistence/update suggests should not work. First, I've been modifying managed entities from outside an active transaction.  If I subsequently begin and commit a transaction, all my changes seem to be merged automatically. ... Second, I'm using an array of entities inside another entity, and setting the elements of that array without calling ... > I'm using an array of entities inside another entity, and setting the elements of that array without calling ... these changes will not trigger making the containing entity object dirty, but if it is marked dirty because of another change, the ...

 
forum_thread

Does aggregate function "greatest" work on entity objects?

do not come to the function "compareTo" @Entity public class ChatHistoryItem extends AbstractObject implements Comparable {     private static final long serialVersionUID = 1L; ... Does aggregate function "greatest" work on entity objects? do not come to the function "compareTo" @ Entity public class ChatHistoryItem extends AbstractObject ...

 
forum_thread

Object DB vs EclipseLink/TopLink: Unloaded relationships in detached entities

This topic is for those considering migrating from EclipseLink JPA or TopLink to ObjectDB JPA. ... in not the transactional one and when you want to use the entity in a transaction it will have to be properly merged. From ... which is what you are encountering. As long as the Entity is not serialized, and the connections are still available, you should ...

 
forum_thread

Mapped By Fetch is very Slow

Well ! I think i pointed out a HUGE performance issue with mapped-by attribute (yeah again :( ). Here is the test case : 1- Create 100 000 entities with for each 1 entity with @OneToOne(mappedBy attribute) 2- Retrieve only 10 000 for testing 3- Wait ... On my AMD FX 8350, it took 60s Now, go the MyEntity class and remove "mapped-by". You obtain 1 second max of query fetch. ... case : 1- Create 100 000 entities with for each 1 entity with @OneToOne(mappedBy attribute) 2- Retrieve only 10 000 for ... latter ) So, the test case, enjoy : The entity : import javax. persistence . CascadeType ; ...

 
forum_thread

Removing an entity throws exception

Hi all, I'm testing ObjectDB for my project, but I have troubles with it. At this time I'm not able to remove customer entity, when it's read by a query (it's attached), it throws this exception: Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: com.objectdb.o._RollbackException: Failed to commit transaction: 51 ... ... with it. At this time I'm not able to remove customer entity, when it's read by a query (it's attached), it throws this ... 40 more   After this exception is the entity detached (why?). When I merge it, I can remove it without problems... ...

 
api-jpa

refresh(entity, lockMode)

Refresh the state of the instance from the database, overwriting changes made to the entity, if any, and lock it with respect to given lock mode type.(Method of javax.persistence.EntityManager)

 
forum_thread

openejb jpa jaas module

    hello , i've finished jpa jaas module. Here it is :   package com.bayner.auth; import com.bayner.jpa.Principals; import com.bayner.jpa.UserInfo; import com.bayner.jpa.UserPrincipal; ... | File Templates. */ @ Cacheable @ Entity @ SequenceGenerator ( name = "gen" ... Templates. */   @ Cacheable @ Entity @ SequenceGenerator ( name = "seq" , ...

 
api-jpa

javax.persistence.AssociationOverride

Used to override a mapping for an entity relationship.(Annotation of JPA)

 
forum_thread

Entity has be persistended,but query not fetched?

I create a new entity T newT and persistend it,then I create a query "select t from T t" to fetch all T entities.But  then the newT is not contain in the query result. Why? ... 01:51 I create a new entity T newT and persistend it,then I create a query "select t from T t" to ... ( ) ; }   @ Entity static final class User { } ...