delete « Insert « JPA Q&A





1. Why does Hibernate try to delete when I try to update/insert?    stackoverflow.com

In my app I have these Hibernate-mapped types (general case):

class RoleRule {
  private Role role;
  private PermissionAwareEntity entity; // hibernate-mapped entity for which permission is granted
  private PermissionType ...

2. Hibernate: sql-insert sql-updat sql-delete    coderanch.com

Hi: I want to used sql-delete in my classes, but I don't know how to set the input parameter. From Hibernate documentation {call createPerson (?, ?)} {? = call deletePerson (?)} {? = call updatePerson (?, ?)} How can I set the input parameters? Thanks

3. Hibernate: How to prevent insert and delete?    coderanch.com

1- How can I prevent insert and delete functions on a specific table/class? 2- How can I instruct hibernate not to persist the changes in an entity without call 'Update' explicitly? I ran into a situation where a property of an entity is changed, but no the update function was not called. When the transaction is committed, hibernate persisted the changes ...

4. all-delete-orphan does insert first and delete later    forum.hibernate.org

Hi, I have two entities A and B (names changed). A has Set of B objects. A is mapped to B with . I want to delete the old Bs and reinsert the new ones. When I do A.getBs().clear() and A.getBs().addAll(setOfNewBs) , it first INSERTs the new B in DB and then fires DELETE queries. I know this ...

5. Hibernate deletes after insert    forum.hibernate.org

I am going to explain what I am doing so maybe that way somebody can see my mistake... this has been driving me crazy the last couple of days. I am getting a list of GRAFICS so the user can choose one. With this GRAFIC I get all its parameters again, including a HashSet of GRAFICS_ATRIBUTES and a HashSet of NODES. ...

6. Delete and Insert - NonUniqueObjectException    forum.hibernate.org

Hi guys, We're trying to do something pretty simple which is essentially DELETE all entries given an ID. And then Inserting new values with the same ID. However when we are doing this we get the following exception: javax.persistence.PersistenceException: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: How we are doing it is as ...

7. SQL API for insert, update and delete    forum.hibernate.org

Yes - I see your point! Perhaps I should elaborate on the problem my team is trying to solve, and see if there is a way Hibernate can accomodate. From a seperation of concerns and application maintenence standpoint, it would be desirable for my project team to seperate the relational language from our java code and, optionally, externalize that language ( ...

8. DELETE + INSERT in stead of UPDATE on Hypersonic    forum.hibernate.org

Hi I am observing interesting behaviour while using Hibernate 2.1.1 within JBoss with a Hypersonic DB - I scanned the FAQ, so apologies if I missed it. This might also be expected behaviour for HsqlDB, in which case I'll rest my case :) When performing a Session.saveOrUpdate() on a simple object (I tried plain objects, even bi-directional many-to-many which all work!), ...

9. Inserts and Deletes work, but Updates don't    forum.hibernate.org

public void testDirectionsInsert() { drData.setDirectionsName("Destin"); drData.setDirections("Go to 77 Seascape Boulevard."); drData.setUserId(new Integer(2)); drDAO.insert(drData); } public void testDirectionsUpdate() { DirectionsData tmp = drDAO.findDirectionsByDirectionsId(new Long(4)); drData.setDirectionsName("Destin - Majestic Sun"); drDAO.update(tmp); } public void testDirectionsDelete() ...





10. delete/insert instead of update    forum.hibernate.org

11. SQL insert, update or delete failed occuring sporadically    forum.hibernate.org

Author Message timon_o Post subject: SQL insert, update or delete failed occuring sporadically Posted: Thu Sep 09, 2004 7:20 am Newbie Joined: Thu Sep 09, 2004 5:46 am Posts: 2 Hi there, we are using Hibernate in a stateless Session EJB which is called the DBConnector. Each DB activity is wrapped in a business method of this EJB. For ...

13. SQL insert, update or delete failed    forum.hibernate.org

Hibernate version: 2.1.6 Mapping documents:

14. insert-update-delete with one-to-many    forum.hibernate.org

15. It's possible disables DELETE before insert in many-to-many?    forum.hibernate.org

//Initializes persistency p = PersistenciaFactory.getInstance(ServiceLocator.SERVIDOR_LOCAL).getPersistenciaRemota(GapeHibernateHome.class); //Load Atividade 15 and initializes bag of Instituicao (many-to-many) Atividade a = (Atividade) p.load(Atividade.class, new Long(15), new String[] {Atividade.CHILD_INSTITUICOES_PARCEIRAS}); ...

16. Hibernate issues DELETE and INSERT statemets independently    forum.hibernate.org

My code is completly used for quering of data, without any "save" or "update" calls. However- I have 1 mapping that generates delete and insert statements which I can spot in the log file. Why is it ? I can see from the delete/insert statments that it is related with my special "set" mappings. I.E. this set mapping :





17. Insert Before Delete causes Contraint Violation in Database    forum.hibernate.org

I am using the long session model, where I open a session query my data, disconnect the session, let the user make a bunch of changes, then reconnect the session and session.update(object). The problem i have is that if a user removes one of the rows for the Defaultfactories collection and then adds a new row, Hiberate will Insert the new ...

18. Hibernate makes delete before Insert in Many-to-Many    forum.hibernate.org

Regular Joined: Sat Sep 03, 2005 9:07 am Posts: 87 Location: Graz, AUSTRIA I have a problem with a Many-To-Many Insert. The Problem is, that Hibernate makes a delete before he inserts the new IDs. I don't know why this is. Perhaps you could help me. The user in my application can add contacts to a partner via a Popup. When ...

19. Delete before insert/update    forum.hibernate.org

20. delete and insert to asame table(1st delete then insert)    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp hibernate 3.1.2 hi, i want to delete some records from 1 table and then i have to insert new one.I write the HQL for this like the method below.in this i wrote delete first and then insert(look at last section DELETE and SAVE operations only).but when committed it tries to perform ...

21. Extran Update before Delete and after Insert    forum.hibernate.org

Newbie Joined: Tue Feb 06, 2007 11:42 pm Posts: 6 I have pretty simple model with User object having a map of IdentityAttributes. (see mapping below). When I create a User and add an IdentityAttribute then save User. I first see Insert for IdentityAttribute and then when transaction commited Update for the same IdentityAttribute. Update actually "establishes" relationship with User (updates ...

22. Show the insert/update/delete sql on log?    forum.hibernate.org

23. Question on hibernate of ,,    forums.oracle.com

hi i am using Hibernate in my project how can i use the custom sql of dynamic inserts and updates , deletes i mean , , .Suppose i am using this is configured in hbm file how can i pass the values for that query of valus how ? You have any idea on this query please help me ...