About merge


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; .. } ... setted to null. When saving the entity, I'm using merge and flush. The entity object is managed, so I think this has no ...


Working with JPA Entity Objects

Explains the entity object lifecycle and the persistence context. Entity objects are in-memory instances of entity classes (persistable user defined classes), which can represent physical objects in the database. Managing an ObjectDB Object Database using JPA requires using entity objects for many oper ...


Lazy loading does not work - crud takes long

tomee7.0.0SNAPSHOT,objectdb 2.6.4 The OneToMany Entities are filled with 40.000 Records and they have between 20-40 Columns. It takes over 50s to load all Project Enities that contains the OneToMany Relationships. It should be load lazy but i didnt know why the query fetch all the Data. ... d : list ) { em. remove ( em. merge ( d ) ) }   ...


Best practice: Database update/migration of embedded databases in products

Hello Support, what experience do you have for data migration within a product? An example: There are three versions of a product (v1.0; v1.1, v2.0). In each version, the entities have been modified. Attributes added, removed and renamed. If attributes were removed, then only because the data is now held otherwise. #1 2015-01-14 12:09 Hello Support, what experience do you have for data migration within a product? An example: ...


Help understanding Entity behavior with JPA

Hi Support,   We have a entity with an @Id entity which we then put into a list and store in an different entity inside a field defined as:   @OneToOne(orphanRemoval=true, cascade=CascadeType.ALL, fetch=FetchType.EAGER) private Object payload; ... single managed entity of that ID by using find or merge . Non managed objects with the same ID may be replaced by the ...


persists and update together ?

hello on mysql i've seen;   INSERT INTO table (a,b,c) VALUES (1,2,3),(4,5,6) ON DUPLICATE KEY UPDATE c=VALUES(a)+VALUES(b);   This query , inserts data or updates if its already available and this will reduce finding same object again. On jpa : User obj2 = ...; ... 15:30 Maybe merge instead of persist is what you are looking for. ...


Package name for persisted entities

Hi, I have a question about package name and searching for entities. As for now we were using two different databases for two different parts of our system. But we want to make a 'common' model for both systems. After merging entities from two different projects, we get single jar with all entities. Unfortunately some of the names are the same for entities: - homplex.model.dbobject.Inspiration - pl.hplxtool.model.Inspiration #1 2011-10-31 11:59 Hi, I have a question about package name and searching for entities. As for now we were using two differe ...



Specifies the version field or property of an entity class that serves as its optimistic lock value.(Annotation of JPA)


JPA Composite Key make Object Db throws "Unexpected exception (Error 990)"

Hello Object Db community :) I am using this wonderful library and I caught a strange exception while testing the "composite key" feature in JPA. Let's see what I am doing : @Entity public class Book {     @EmbeddedId BookId id; } @Embeddable Class BookId {     Integer bookIdCountry;     ECountry country; } My BookId contains 2 attributes: One Integer and one enum. Bug Version: 2.4.0 Priority: Normal Status: Fixed Replies: 3 Type:  Bug ...


Performance and memory usage of queries

Hello, we can't understand why the performance of queries is not the best and the execution requires so much memory. In the implementation of our UnitTests we have used "DELETE FROM Object" to delete the database. That did not work because we often get an "out of memory" exception. What's all done in the execution of queries? Why is so much memory is required, although from the application point of view, no object is loaded. ... MyEntity ( ) ; myEntity = em. merge ( myEntity ) ;   for ( int m = ...