1. JPA merge does not appear to work stackoverflow.comI'm running the following code to update the database according to the data I read from CSV file. I've tried to debug, and check the console and it's running through the ... |
2. jpa hibernate merge performs insert instead of update stackoverflow.comI have a simple test, where I am trying to update the object. but merge seems to be performing an insert instead of update.
|
3. Hibernate merge cascading a collection's insert stackoverflow.comHave a setup with Hibernate 3 whereby inserting collections through an inverse many-to-one relationship doesn't automatically set the parent's foreign key in the child when merging. For example, in the Element class ... |
4. [JPA] merge() is inserting instead of updating coderanch.comhi, can anyone enlighten me regarding the mecanism of persistence in EJB 3.0 ? I am trying to update an entity in the database from a web client that calls a method in a stateful session bean. That method looks like this : @Stateful public class TestOneAction implements TestOneLocal { @PersistenceContext(unitName="unitTest") private EntityManager em; public void updateEntity(Entity entity) { em.merge(entity); } ... |
5. merge() generated a "insert" SQL for managed Entity, why? forum.hibernate.orghihi, When I using EntityManager.merge() method to update a Entity (team.class) that contained a list of Child Entities (member.class). Before call EntityManager.merge() method, I uses entityManager.contains() method to ensure the Child Entities are managed. The method returns "true". but when I call EntityManager.merge(team) to update the parent entity, hibernate generated the "insert" SQL to update child entity and display "unique constraint" ... |
6. Session.merge also inserts data forum.hibernate.org |
7. Bug? Duplicate insert: @OneToMay with cascade "all" & merge forum.hibernate.orgPage 1 of 1 [ 1 post ] Previous topic | Next topic Author Message bfreis Post subject: Bug? Duplicate insert: @OneToMay with cascade "all" & merge Posted: Fri Dec 17, 2010 10:21 am Newbie Joined: Wed Sep 09, 2009 6:05 am Posts: 2 I have encountered a strange behavior of ... |
8. EnitityManager merge cause two inserts for collection forum.hibernate.orgI have an entity MainEntity MainEntity has a collection of ChildEntity. I do the following: 1. ChildEntity ch = new ChildEntity(); 2. MainEntity me = getMainEntity(mainEntity ID); // this will retrieve the MainEntity from database 3. ch.setMainEntity(me); 4. me.getChildEntityCollection().add(ch); 5. EnittyManager.merge(me). This cause 2 inserts for Child entity. The primary key for the entity is auto generated. The child entity is ... |
9. The session.merge(obj) is inserting one extra record forum.hibernate.orgI am using merge to save the data in the database, but I am getting and extra record. Somebody can give me an idea to fix this problem. I believe that the problem is in the mapping file but I do not know what to do to resolve this problem. Hibernate version: 3.0.2 Mapping documents: |
10. merge(parent). 2 inserts and one update forum.hibernate.orgI have the following code that according to hibernate logging sql results in 1. insert parent 2. insert child 3. update parent(why is this happening?) Here is the transaction code.... Code: mgr.getTransaction().begin(); ParentDBO parent = new ParentDBO(); ... |
11. Session.merge uses insert instead of update forum.hibernate.orgNewbie Joined: Fri Jul 21, 2006 6:27 am Posts: 10 hi all! Problem Description: im using hibernate together with EMF 2.2.0 and elver. when calling Session.merge with an object already present in the dbtable(meaning: there's another object of the same type and id in the db - but with different details/values) - merge tries to do an insert instead of an ... |