update « Delete « JPA Q&A





1. Datanucleus JPA Update & Delete operation    stackoverflow.com

I am using Datanucleus as the JPA engine to perform CRUD on an entity in Force.com DB. Insert and Select are working fine, but while updating a new row is getting ...

2. Many-to-many update/delete    forum.hibernate.org

3. Reverse engineering w/ cascading updates/deletes    forum.hibernate.org

Hi, i am using the JBoss Hibernate plug in for eclipse and attempting to reverse engineer by hbm and pojo's from an existing mysql database. The database contains some tables with foreign key constraints that specify cascading updates and deletes. I noticed that the hbm files that are generated do not seem to be taking into consideration such tables and constraints. ...

4. Replace Delete with a Update    forum.hibernate.org

5. Many-to-many and update/delete    forum.hibernate.org

Hi, I would like to know how configure hibernate to update properly a collection list. I explain my simple case : I have 2 entities Journey and Segment. Entity Journey have a list of segment. But 2 Journey can share the same Segment, it's why i have a many to many. My problem is when i update Journey with a new ...

6. Update before Delete    forum.hibernate.org

We are getting an update when deleting an object. I can see it by turning the logging on for hibernate and there is always an update statement before the delete. Also seeing it from the database perspective. So, does anyone know how and why hibernate would perform an update before a delete? I completely isolated the code within a test, and ...

7. update an object containing sets with all-delete-orphan    forum.hibernate.org

Hi all, Why is exactly the reason for getting "You may not dereference a collection with cascade="all-delete-orphan" ? I need to get an object from the DB, casting that object to some GUI specific classes, changing some properties and then casting back to the original object. But when trying to update I get the above error. TIA, --steve p.

8. Delete and Update Questions for Future?    forum.hibernate.org

9. update or delete ?    forum.hibernate.org

Well,if I use cascade="all",and them try do session.delete in a child, it throws an HibernateException sayng i can'nt flush during deletion operation (that would be dangerous, etc...). Than, I could not use the cascade="all". In fact, it was cascade="all" in all my one to many relationships. When I started implementing the deletions requirements of my application, I got problems. Thanks anyway, ...





10. Create/Update/Delete Notification    forum.hibernate.org

11. Blind updates, deletes    forum.hibernate.org

12. Optimized update/delete    forum.hibernate.org

Hibernate version: 2.1 Hello, I would like to know how I can do the following with Hibernate: DELETE FROM T1 WHERE T1_FK=? - delete a bunch of objects w/o instantiating them. The session methods seem to all be based on first reading the objects. Is there any better way than writing this with plain JDBC, i.e can I still refer to ...

13. Trying to delete/update already deleted object.    forum.hibernate.org

98627 [main ] ERROR net.sf.hibernate.impl.SessionImpl - Could not synchronize database state with session net.sf.hibernate.HibernateException: SQL insert, update or delete failed (row not found) at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:25) at net.sf.hibernate.persister.EntityPersister.delete(EntityPersister.java:601) at net.sf.hibernate.impl.ScheduledDeletion.execute(ScheduledDeletion.java:29) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2385) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2343) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2207) ...

14. update performs update and delete    forum.hibernate.org

private Integer id; private String firstname; private String lastname; private String address; private String zipcode; private String city; private String telephone; private String email; private String username; private String password; private String old_password; private Date last_login; private String status; private Company company; private Set groups; private Set documents; // getters & setters..

15. DB2 7.2 - problem updating all-delete-orphans    forum.hibernate.org

Hello, I'm having a problem on DB2when deleting an object. It seems to be related to the fact the object in question has "all-delete-orphan" collections defined. The problem does not occur on MySql. The problem seems to arise when flushing the session\synchronizing the session with the db. More in particular it seems related to Hibernate trying to execute an update statement. ...

16. update operation performs a delete operation not wanted    forum.hibernate.org

Hi all, My problem: nombreRol and descripcionRol are attributes for a Rol that is in the database. When I do the update (inside modificar(..)), hibernate performs 2 'delete' operations after the 'update'. I don't want these operations to perform. Maybe I have to load, the complete Rol to update before change its attributes and update? I don't know. I suppose that ...





17. Problem with all-delete-orphan (in an update operation)    forum.hibernate.org

Newbie Joined: Tue Jan 04, 2005 9:22 am Posts: 8 Dears, I have a parent with two children objects in database. I try to update the parent and its children via creating new parent (with same id) and adding a new children to this parent. I expect that all old children should be removed when I persist this new parent object. ...

18. Update/Delete without instance of the object    forum.hibernate.org

19. Hibernate 3 unable to update or delete    forum.hibernate.org

Migrating from Hibernate 2 to Hibernate 3. I have almost completed the migration but after some testing I found out that I am unable to update or delete. Oddly enough I can save, but I don't seem to know why I cannot update or delete. I tried to see if any errors occured, but none that were visible. It seems to ...

20. Unable to update or delete    forum.hibernate.org

Migrating from Hibernate 2 to Hibernate 3. I have almost completed the migration but after some testing I found out that I am unable to update or delete. Oddly enough I can save, but I don't seem to know why I cannot update or delete. I tried to see if any errors occured, but none that were visible. It seems to ...

21. Update or Delete not working    forum.hibernate.org

Author Message dawuad Post subject: Update or Delete not working Posted: Thu May 12, 2005 11:05 am Regular Joined: Wed Sep 29, 2004 11:34 am Posts: 62 Location: Houston, TX Ok now I am completely lost. Please someone help me out. I can't figure this out. I migrated from Hibernate 2 to Hibernate 3. I am trying to do ...

22. Update or Delete NonUniqueObject    forum.hibernate.org

Hi all, I am busy developing the user and role admin use-cases for my application and have come across a conundrum that I am not quite sure how to solve. I am trying to update roles available to users of the system. The conundrum comes in when I try to update a Role that the current user is a part of. ...

23. Update and Delete are not working    forum.hibernate.org

Hibernate version: 3.0.2 Mapping documents: Code between sessionFactory.openSession() and session.close(): Full stack trace of any exception that occurs: 16:20:11,233 ERROR AbstractFlushingEventListener:277 - Could not synchronize database state with session org.hibernate.HibernateException: Unexpected row count: -1 expected: 1 at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:32) at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:1972) at org.hibernate.persister.entity.BasicEntityPersister.updateOrInsert(BasicEntityPersister.java:1899) at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:2139) at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:75) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:137) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:27 4) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:678) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:309) ...

24. update() Does not delete cascade.    forum.hibernate.org

Newbie Joined: Wed Oct 12, 2005 9:43 am Posts: 8 Code: ....... ...

25. Update for Delete?    forum.hibernate.org

I was deleting objects, so how come I am seeing a delete SQL in the stack trace? Thanks... 2005-11-22 23:25:45,113 DEBUG [ROOT] (AbstractCollectionPersister.java:947) - Deleting collection: [Store.items#b0ce5583ffffffccffffaa7f] 2005-11-22 23:25:45,113 DEBUG [ROOT] (AbstractBatcher.java:173) - reusing prepared statement 2005-11-22 23:25:45,113 DEBUG [ROOT] (AbstractBatcher.java:344) - update Item set partyOid=null where partyOid=? 2005-11-22 23:25:45,113 DEBUG [ROOT] (NullableType.java:79) - binding 'b0ce5583ffffffccffffaa7f' to parameter: 1 2005-11-22 23:25:45,113 ...

26. updating instead of deleting    forum.hibernate.org

Hy, guys! I got the following problem:when I try to do a delete on a table Telefones, which is linked with a endereco table using a one-to-many association, where the telefones table is the many side, and the endereco table is linked with a contact table in a one-to-one association , and instead of deleting the row on telefones, he try's ...

27. update before delete    forum.hibernate.org

Author Message drzoidbergh Post subject: update before delete Posted: Thu Apr 27, 2006 6:18 am Newbie Joined: Thu Apr 27, 2006 5:51 am Posts: 5 Hi everybody, we got the following problem: we have a parent-child-grandchild object graph. In a case without any grandchild, when we delete a child we get a stale object exception. We traced this behaviour ...

28. How to disable cascade delete or update programmatically    forum.hibernate.org

Hi all, I am working with a entity graph. My A entity class contains sets of B which contains sets of C. Mapping : All of this is mapped birectionnally ( in the parent with cascade="all,delete-orphan", in each child). I modified a property of B. So I call Code: Session.update(myInstance); to update the B class. The thing is ...

29. why update, not delete when I use cascade    forum.hibernate.org

my table for example is fellowed: table:student id name table:course id name studid (id -----studid) I am crazy for this problem, I tried many way , but i failed. The following is the segment of my student.hbm.xml: I deeped into hibernate source, I find the boolean marking whether the collection ...

30. Update operation is being translated as Delete    forum.hibernate.org

Author Message suneetshah Post subject: Update operation is being translated as Delete Posted: Sat Jun 23, 2007 12:38 am Beginner Joined: Mon May 07, 2007 11:12 pm Posts: 20 Hello, I have a parent child relationship between two objects User and UserAttribute. There is a test below where I try to update an attribute that is associated with a ...

31. lines aren't deleted when document is updated?    forum.hibernate.org

32. Cascade operations (Update/Delete) in RDBMS or in code?    forum.hibernate.org

Is best to define cascade operations (delete and update) when maintaining referential integrity or is it better to manually cascade deletes and updates in code? I initially thought it would be best to define cascade operations in the RDBMS, but I believe I may have read somewhere otherwise. I just want to hear the best approach so I know how to ...

33. Help! update stmt trigerred instead of delete    forum.hibernate.org

Author Message anand82_r Post subject: Help! update stmt trigerred instead of delete Posted: Tue Nov 06, 2007 1:41 am Newbie Joined: Mon Nov 05, 2007 11:57 pm Posts: 2 Hi, I have two entities, Parent and Child. The Parent has a collection of Child entities (a OneToMany relationship). The Child in-turn has a collection of Child entities (a OneToMany ...

34. Update and delete not working    forum.hibernate.org

@Entity @Table(name = "LIBRARYITEM") @SuppressWarnings("serial") public class Libraryitem implements Serializable { //all the attributes... @Basic @Id @GeneratedValue @Column(name = "ITEMRECNUMBER") public Integer getItemrecnumber() { return itemrecnumber; } //Rest of getters and setters...

35. update before delete    forum.hibernate.org

Newbie Joined: Thu May 21, 2009 1:34 pm Posts: 2 Code: session.delete(video); When I try to execute this code I get the following error: 781 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1048, SQLState: 23000 781 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Column 'ownerId' cannot be null 781 [main] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session I get the error because ...

36. problem with cascade update/delete once again    forum.hibernate.org

37. problem after update/delete object    forum.hibernate.org

Newbie Joined: Mon Mar 23, 2009 5:47 am Posts: 5 I do not find any topics on my problem. After I change some field (i.e. "address"),and then update it to db. then content in db are changed. For example ,original:address = "room" ,current :address="room2". After I press update,the value displayed in webpage and database are correct. then I go to another ...

38. Positioned updates and deletes are not supported    forum.hibernate.org

I'm using annotations and I'm getting this strange error, when triggering following function: Code: Session session = HibernateCoreUtil.getSession(); String reportFormId = request.getParameter("id"); if (reportFormId==null && !reportFormId.equals("")) ...