delete 2 « Delete « JPA Q&A





1. delete many-to-many    forum.hibernate.org

Hi, i've got a question about a many-to-many relation. I mapped a Person to an institute. So one Person can work in many institutes and in one institute works a lot of people. The Hibernate creates 3 tables. One for the persons, one fpr the institutes and on for the relation. Now my problem: When I delete an institute. I also ...

2. Please delete    forum.hibernate.org

3. cascad delete issues    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp [b]Hibernate version:[/b] [b]Mapping documents:[/b] [b]Code between sessionFactory.openSession() and session.close():[/b] [b]Full stack trace of any exception that occurs:[/b] [b]Name and version of the database you are using:[/b] [b]The generated SQL (show_sql=true):[/b] [b]Debug level Hibernate log excerpt:[/b] Problems with Session and transaction handling? Read this: http://hibernate.org/42.html I am trying to do some cascade ...

4. Many-to-one delete problem    forum.hibernate.org

I'm having problems with a many-to-one relationship. I have an organization object that is associated with many resources. The association is bidirectional. Here is the mapping: Organization: Code: /** * @hibernate.set lazy="false" * cascade="none" * ...

5. Many-to-one delete problem    forum.hibernate.org

I'm having problems with a many-to-one relationship. I have an organization object that is associated with many resources. The association is bidirectional. Here is the mapping: Organization: Code: /** * @hibernate.set lazy="false" * cascade="none" * ...

6. Please delete    forum.hibernate.org

7. 2x many-to-one = many-to-many .. then delete that    forum.hibernate.org

Hi We have several many-to-many relationships, but with additional data on the mapping table. For whatever (historical) reasons, our many-to-many relationships are mapped as 2 one-to-may like this: Code:

8. logical delete revisited    forum.hibernate.org

I'm trying to implement a logical delete for one of my objects managed by Hibernate. For a deletion of my object type "Item", I want to set isActive=false and modifiedDate=currentDate, and not delete the record from the db. I also want any associated objects to be deleted (true delete, not logical) as setup by the cascade parameters on the associations. There ...

9. Best way to delete a member variable    forum.hibernate.org





10.     forum.hibernate.org

11. dynamic-delete    forum.hibernate.org

jonigkeit Post subject: Posted: Fri Dec 22, 2006 3:04 am Newbie Joined: Thu Dec 21, 2006 7:30 am Posts: 11 First of all I use dynamic-update="true" dynamic-insert="true" then I have made sure that references cascade on deletion. My problem was actually a bit more complicated than I actually described in my simplified code example. I have a more complex ...

12. Many to Many delete problem    forum.hibernate.org

Hi! I have two tables (Table A and B) with a many to many relationship and an intermediate table (Table C). The problem is that when I take a reference of table A and call it's delete method, it deletes data from Table C and Table A, but not from Table B. Can anyone tell me a way to delete data ...

14. LockAcquisitionException on delete    forum.hibernate.org

Hi, I have a small program which is persisting an object in database then delete it just after (ok, it makes no sense but it's just for testing purpose!). Here is the code : public void run() { // create alarm Alarm alarm = new Alarm(); alarm.setName("new"); Alarm created = service.create(null, null, alarm); // get primary key of created alarm Long ...

15. Delete strategy    forum.hibernate.org

What is the best solution in hibernate to mark a relation as deleted? The behavior I would like to achieve is to call remove on some collection to delete an assocation, but for hiberante in the background to not actually delete the join relationship, but instead to mark a status field as DELETED. Are triggers/interceptors the best solution ? Is there ...

16. problem with deleting item from set    forum.hibernate.org

Newbie Joined: Mon Mar 26, 2007 2:59 am Posts: 1 Hello. i have two classes with many-to-many relationship, with bidirectional link. the problem is, that in one class i cannot remove elements from a set that makes one part of that link, using remove() Code: stuff[i].getCategories().remove(currentCategory); //works currentCategory.getStuff().remove(stuff[i]); //does not remove element from collection; returns false both objects are in transient ...





17. Why did that delete fail?    forum.hibernate.org

I'm written a deleteContact(Contact) method, but I would like to improve its error handling. Currently, I just catch the exception that is thrown and wrap it in a new exception with the message "Could not delete contact" which is then displayed to the user. I would like to give the user a more specific error message e.g. "Could not delete contact ...

18. PLS HELP with cassade delete many-to-many    forum.hibernate.org

Hi, pls help me. For example: I have 2 processes. When Proces1 have WSDLs1, WSDLs2 WSDLs3 and process2 WSDLs4 WSDLs5 WSDLs6, deleting process1 is OK. But, when process1 : WSDLs1 WSDLs2 WSDLs3 and proces2: !! WSDLs3 !! WSDLs4 WSDLs5 and i want deleting process1, recieve error :(( Pls help me.Thnx. update and save works ok. Sorry for bad english ;) Mapping ...

19. Requesting help concering delete function    forum.hibernate.org

Hello, I have a short problem concerning the delete function on a webbased application. Example code: Code: ... User user = new User( 1); Machine machine = new Machine( 5); UserMachine userMachine = new UserMachine( user, machine); deleteObject( userMachine) ... function deleteObject( Object object) { // Simplified Session session = InitSessionFactory.getSessionFactory().getCurrentSession(); ...

20. Hibernate does not delete everything    forum.hibernate.org

class Contact { ... @ManyToMany(cascade={CascadeType.ALL}, fetch=FetchType.EAGER) @JoinTable(name = "contact_email", joinColumns = { @JoinColumn(name = "contact") }, inverseJoinColumns = { @JoinColumn(name = "email") }) public Set getEmails() { return this.emails; } public void setEmails(Set emails) { this.emails = ...

21. Cascasde Delete Does not work    forum.hibernate.org

Hello, I have a one to many relationship and the cascade delete feature is not working. Looking at the generated sql, the problem seems to be that the sql to delete child objects is not be generated. Any thoughts on how I can resolve this? Hibernate version:3.2 [b]Mapping documents: ...

22. Using Delete Command    forum.hibernate.org

Hi, I am fairly new to hibernate,I have a query, i am trying to delete records. Can i directly use Delete command and use executeUpdate(), as I am trying to do Code: StringBuffer queryString = new StringBuffer(); queryString.append("Delete from TableDO table "); queryString.append(" where table.createdDate < '"); queryString.append(currentDate); queryString.append("'"); then for executing this query.. I am using this function Code: public ...

23. please delete    forum.hibernate.org

24. Hibernate deletes Entries at startup    forum.hibernate.org

Hello, I've just started using Hibernate and it looks really awesome, just wonderful :) 1.) However I've problems with making objects persistent. When I execute the following code hibernate inserts as expectedone entry into my hsql-database. I can see that one row has been inserted using HSQLDB's Database manager. When re-running the piece of code with commenting the persitence-stuff out (so ...

25. delete one-to-many    forum.hibernate.org

HI Friends, I am using one-to-many relationship, I have Tow table table1 and table2 and table data is as, table1 ID LAST FIRST AGE 1 Kumar Nagendra 26 2 Rao Komal 24 table2 ID parent_ID test result 1 1 blood A+ 2 1 Pulse 75 =============================================== And I want to delete all data of parent_ID 1 from table2 and my code ...

26. Hibernate/JPA - soft delete    forum.hibernate.org

27. Problems when deleting elements from one-to-many set    forum.hibernate.org

Hi, I have a two classes in one-to-many relation with the following mappings: true ... If I want to delete a feature from prodo's set hibernate executes the following sql: update ...

28. multiple item delete problem    forum.hibernate.org

29. Why hibernate execute deletion at last?    forum.hibernate.org

30. Problem while deletion    forum.hibernate.org

We are facing a strange issue while deleting a row in a table. We have 3 tables. Parent and child 1 and child 2 Child 1 & 2 have multiple entries of parents. Here parent table - game table. child 1 - clips (audio and video) belong to the game child 2 - discussion related to the game table. So the ...

31. delete me    forum.hibernate.org

32. Soft delete    forum.hibernate.org

Hi all, I am trying to use logical deletion in my database with hibernate. I am using annotations to apply a certain cascade strategy and I will like to use these annotations for softdelete as well. The problem is that if I use soft delete by adding a new flag true Hibernate does not know that this is my new deletion ...

33. deleted    forum.hibernate.org

34. Delete this please    forum.hibernate.org

35. deleted    forum.hibernate.org

36. many-to-many delete    forum.hibernate.org

37. DupPost- Please delete    forum.hibernate.org

38. Delete problem in multi-user environment    forum.hibernate.org

I am new to Hibernate and want to use it in a Swing application. My problem is that I don't know how to deal with changes made by other users properly. For example, consider a parent-child relationship and that another user has added (or deleted) a child since I loaded the objects from the database. If I now try to delete ...

39. A and B delete challenge    forum.hibernate.org

Hibernate version:3.2 I have two classes with many-to-many A with aid as primary key B with bid as primary key The join table(A_B) is not explicitly defined(it does not have its own mapping file). And has the foreign keys as the only two columns coming from their respective tables. Task at hand is to delete a relationship between a specific A ...

40. Multiple posts can be deleted    forum.hibernate.org

41. Creating and Deleting DBs    forum.hibernate.org

I need to write Java code for a CommonUtils class that will have methods like ResetDB() , CreateDB() and DeleteDB(). The hbm.xml files (that specify the properties/columns of all the classes/tables of the DB- say, TestDB) are available in the Folder "Resources". How do I load/delete the DB by calling java methods?

42. Soft Delete    forum.hibernate.org

If you use a timestamp instead of a simple flag you can easily have a unique constraint as you describe. This has the added advantage of letting you know when something was 'deleted' and simplifies housekeeping tasks such as physically deleting all records that were soft deleted over X months ago - which may be useful if your database is going ...

43. Deleting only non referenced ...    forum.hibernate.org

Hibernate version: last version Name and version of the database you are using: hsql How to do this ... I have Movie and Actor entity, and many to many relation, that is, Movie has list of actors, and actor has list of movies. When I delete (EntityManager.delete(someMovie)) a movie, I want it to delete also all actors from this movie except ...

44. Application Hang when Delete method execute    forum.hibernate.org

I tried to delete table row using the delete() method(in side session object) when execute delete method and commit() method application hang i couldn't understand what is the happening. But i tried my sample Data Base In that time working fine.When i change to original Data Base this will happen. This is my code : session = dbc.DBConnector(); Transaction tra=session.beginTransaction(); session.delete(works); ...

45. delete method that does not delete    forum.hibernate.org

Author Message chady Post subject: delete method that does not delete Posted: Mon Feb 09, 2009 7:09 pm Regular Joined: Wed Jan 28, 2009 8:31 pm Posts: 54 hi everyone this is my class Code: package pojo; import java.io.Serializable; import java.util.List; import net.sf.hibernate.HibernateException; import ca.canassistance.model.Avinfoge; import ca.canassistance.model.base.BaseAvinfogeDAO; /** * This class has been automatically generated by Hibernate Synchronizer. For ...

46. Can I perform a "Pre-Delete"?    forum.hibernate.org

If you association mapping is bidirectional you can see the size of the collection and see if the entity you are going to delete is referenced by any other entities. Otherwise you ll have to make DB queries to see if any entity is referencing the entity you are about to delete.

47. plz delete this thread    forum.hibernate.org

48. deleted    forum.hibernate.org

50. NPE within Hibernate delete listener?    forum.hibernate.org

51. Implicitly deleting aggregate root    forum.hibernate.org

Hi guys, Using Hibernate Core 3.3, Hibernate Annotations 3.4 and Hibernate EntityManager 3.4. We have a WorkOrder entity which has a @OneToMany association with a WorkOrderDetail entity. WorkOrder is the root of this aggregate, no other entities reference WorkOrders. Throughout its life, a WorkOrder will own a variable number of WorkOrderDetails. When a WorkOrder owns no more WorkOrderDetails, it should be ...

52. many-to-many:hibernate deletes too much    forum.hibernate.org

Newbie Joined: Fri Jul 10, 2009 1:19 pm Posts: 2 So here's the deal, I have a 3 tables, test, test2, and test_test2_join (the association table between test and test2) hibernate is doing its thing and when I have objects from test and test2 that are related, it automatically puts a row in the association table. Its great. The problem is ...

53. slowness when delete recs    forum.hibernate.org

Hi My Next question is , when i try to delete records in my oracle database ( via hibernate ) , it takes long time to delete . as i monitored , for a single record it takes 2 min of time. to delete , i have 20 000 records in my database. please help me to solve my basic issues ...