cascade « Delete « JPA Q&A





1. Hibernate Delete Cascade    stackoverflow.com

I Have one entity [Project] that contains a collection of other entities [Questions]. I have mapped the relation with a cascade attribute of "all-delete-orphan". In my DB the relation is mapped with a ...

2. hibernate cascade deletion    stackoverflow.com

i have one class called course and one class called tutorials in class i hav set of tutorials .Wnen i delete course i want all tutorials associaed with that course to be ...

3. hibernate cascade deletion example    stackoverflow.com

can any one provide me full 2 mapping file which implements cascade delete. measn if A contasis a set of B then when A is deleted B shold automatically be deleted. ...

4. JPA: Reverse cascading delete    stackoverflow.com


@Entity
public class Parent {
    @Id
    @GeneratedValue(strategy=GenerationType.TABLE)
    int id;

@OneToMany(cascade=CascadeType.REMOVE)
List<Item> children = new ArrayList<Child>();
} @Entity public class Child { @Id ...

5. Hibernate cascade vs manual delete    stackoverflow.com

I am using Hibernate and a few times had to implement cascading DELETE operation from parent object to its children. I used the following two options. One option is to expose ...

6. JPA 2.0 orphanRemoval=true VS on delete Cascade    stackoverflow.com

I am a little confused about the JPA 2.0 orphanRemoval attribute. I think I can see its is needed when I use my JPA provider's DB generation tools to create the underlying ...

7. Hibernate:How to delete in cascade?    stackoverflow.com

i have the following classes:

//Product class
public class Product {
@Id
@GeneratedValue
private Long id;
private String name;

//Package Class
public class Package {
@Id
@GeneratedValue
private Long id;

@OneToOne(cascade=CascadeType.ALL)
private Product product;

private int quantity;
private char mode;
private String unity;
private String description;

@OneToOne(cascade=CascadeType.ALL)
private Usuario user;

public ...

8. many-to-many cascade delete    stackoverflow.com

I have many-to-many for tag <-> software, when i delete tag i want delete all softwares which are related to that tag BUT not which are related to another tag. The ...

9. Hibernate Cascading Delete Not working as expected    stackoverflow.com

I am using hibernate 3 and attempting to delete a record in the database, and the delete is not working as I would expect. The schema hibernate is working against ...





10. Problems with cascading deletion in Hibernate    stackoverflow.com

This question has been asked numerous times before, yet I haven't seen a satisfactory answer since, thus I am asking it again. Imagine the following situation:

public class User {
    ...

11. using hibernate to delete publisher with no books    stackoverflow.com

while writing a bookstore application ,I needed to put mappings for Book and Publisher classes. Book has n-to-1 relationship with Publisher.Also n-to-1 with Author . I wanted to give the admin user an ...

12. Hibernate: unified cascade delete    stackoverflow.com

I have a graph of objects accessible with Hibernate. I need to have a unified method of deleting any object in the graph. When any objects is deleted, any objects which ...

13. cacade delete operation not working as expected in hibernate    stackoverflow.com

i tried implementing cascaded="delete" as follows but only the employee row gets deleted and not the corresponding salary row. The Employee pojo class is :

public class Employee {
int empid;
String ename;
Salary sal;
//gettrs and ...

14. Cascade All not deleting    stackoverflow.com

Please check this Entity:

@Entity
@Table(name = "css_empresa")
public class Empresa extends EntidadContactable implements Serializable,
    Convert {
private static final long serialVersionUID = 1L;

@Id
@SequenceGenerator(name = "EMPRESA_ID_GENERATOR", sequenceName = ConstantesSecuencias.SEQ_EMPRESA, allocationSize = 1)
@GeneratedValue(strategy ...

15. Hibernate 2 deleting by cascade    coderanch.com

Hi, I have Persistent class A and persistent class B. Class B has a field that's the hibernate id (key) of A. What cascade do I need to set and where so that when I delete object of type A all the objects of type B that contain the id of of this A object are deleted.? it's cascade = "all-delete-orphan" ...

16. Hibernate cascade deletion is making me mad    forum.hibernate.org

Hello everybody ! I'm new and I'm here because I'm really out of solution on how to use hibernate for cascade deletion. First, I've got a CMS-like part in my application. But cascade deletion don't seem to work for my entities. I've tried everything I could think of but nothing's working as I want. I tried: - adding annotation "@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})" after ...





17. Not an another cascade deletion issue...    forum.hibernate.org

Hi all, I got an issue about a cascading deletion : I got a "Parent" table in which a column is a foreign key of a "child" table. There is a constraint on this foreign key : a value in the "child" table must match a value in the "parent" table. My goal is to delete rows from the "child" table ...

18. Set cascade="delete" question    forum.hibernate.org

When you set cascade="delete" you're going to delete the objects C, if no other object is holding a reference to C, but in your case A and B are both holding a reference to C so if you try to delete an object C from A and B is referencing that object C a exception will be thrown.

19. cascade causes double deletion?    forum.hibernate.org

class Person { @OneToMany(mappedBy = "personBackRef", cascade = { CascadeType.ALL }) // JPA annotation @Cascade( { SAVE_UPDATE }) // Hibernate annotation public List getDocuments() { } class Document { @OneToOne // JPA @Cascade( { SAVE_UPDATE, DELETE_ORPHAN }) // hibernate public DerivationPath getDerivationPath(); } class DerivationPath { ...

20. Cascade Delete Problem...    forum.hibernate.org

Newbie Joined: Mon Jun 28, 2010 2:26 am Posts: 1 May I know what I could have been doing wrong here. Whenever a Role is deleted, those Users under it should also be deleted (a typical parent-child relationship). However, I am getting these errors. Isn't it that @OnDelete(action=OnDeleteAction.CASCADE) should do that for me. Anyway, I am using Hibernate together with Spring ...

21. Problem deleting in cascade    forum.hibernate.org

22. Best way to implement delete cascade    forum.hibernate.org

23. Cascade delete issue    forum.hibernate.org

Hello, I have to manage the following classes through JPA API manage by org.hibernate.ejb.HibernatePersistence [ version 3.5.1]: Code: @Entity @Inheritance(strategy=InheritanceType.JOINED) @DiscriminatorColumn(name="disc",discriminatorType=DiscriminatorType.STRING) public abstract class Root { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Integer id; } [...] @Entity @DiscriminatorValue("A") public class A extends Root { @Entity public static class B ...

24. Question on cascading delete?    forum.hibernate.org

I am familiar with the "textbook" cascaded delete, where the parent record is deleted and then the delete action is "cascaded" to child records (which would otherwise be orphaned). My question is, how does Hibernate/JPA handle the delete of a child record when the parent record is saved? For example, the classic "invoice header/invoice detail" case: InvoiceHeader 1234 has three detail ...

25. Cascade delete not working    forum.hibernate.org

Hi, I have a problem with cascading delete. I have a set of tables that are linked with bidirectional many-to-one/one-to-many, like this: ... ... I would like any entry of B referenced by a certain ...

26. How to force hibernate to create on delete cascade    forum.hibernate.org

Hello, everybody! I have simple one to many relationship, something like this: class Movie { @OneToMany(cascade=CascadeType.ALL, mappedBy="movie") Set scenes; } class Scene{ @ManyToOne Movie movie; } everything looks good. But foreign key constraint in scene table looks like (mySQL) CONSTRAINT `FK4C0286C2A91EA63` FOREIGN KEY (`movie_id`) REFERENCES `movie` (`id`) how to force hibernate to create on delete cascade: CONSTRAINT `FK4C0286C2A91EA63` FOREIGN KEY (`movie_id`) ...

27. Many-to-Many: How to disable delete cascade?    forum.hibernate.org

Hi, When I issue an em.delete() on an entity with Many-to-Many, Hibernate is issuing an extra delete on the relational table. It normally makes sense, but how can I turn it off? I want an exception to be throw in my face. :) Is it possible? Thanks in advance, I'm using JPA2 with Hibernate 3.6

28. delete with cascade issue..    forum.hibernate.org

Hi all, I get this error: Flush during cascade is dangerous - this might occur if an object was deleted and then re-saved by cascade when I try to delete a child. The child and the parent are associated using a bi-directional association as follows: the child has ...

29. cascade delete    forum.hibernate.org

If you delete an object that has a 1-* relationship that is marked to cascade deletes, then all the child objects should be deleted. I'm not sure if I understand exactly what you want - are you wanting some sort of pre-delete callback/notification on an individual object basis (for auditing purposed say)? J

30. Cascading delete not complete    forum.hibernate.org

This is absolutely intended for a many to many. An object in a many-to-many relation is not just deleted because it is removed from the collection, in fact it may be part of yet another collection. Probably you rather have a many-to-one if you want to do that, please think about it.

31. Problem with cascading delete and NonUniqueObjectException    forum.hibernate.org

I am having a bit of trouble with cascading deletes. Here is an example bit of code: Code: public class MasterItem { String getMasterId(); SubItem getSubItem(); List getSharedItems(); void addSharedItem(SharedItem item); void removeSharedItem(SharedItem item); } public class SubItem { String getSubId(); ...

32. cascade deleting on many-to-many    forum.hibernate.org

Hi everyone! i'm facing a problem related to deleting a graph of objects: i have a many to many relation between classes A and B. B class knows about this relation, but A doesn't, i mean: A.hbm.xml Code: (nothing about this many-to-many relation) B.hbm.xml Code: ...

33. Conditonal Cascade delete    forum.hibernate.org

I want to build an object graph with following delete "Conditaional" Cascade delete relationship Person -> Order -> Item. However, the item is not "always" delete. It depends on another Table. For example, Item only be deleted only when the "TempItem" Table contains the Item's ItemId I would like to know where the code I shall put to do the above. ...

34. cascade delete question    forum.hibernate.org

Newbie Joined: Fri Apr 02, 2004 4:12 pm Posts: 12 Given the mapping below, how come a deleting a "parent", SupplierModel, doesn't cascade to deleting the "child", SupplierCarrierModel? It works if I make SupplierCarrierModel a composite-element of SupplierModel, but then other things didn't work. Is there any reason why this isn't working?? Code:

35. cascade delete help please    forum.hibernate.org

I'm sorry I don't understand what exactly you are suggesting I should do or why. Are you suggesting that I change the column name of the primay key in the infoset table? The key column attribute represents the foreign key in the related table (infoset_document_assn) right? So why would it matter if it has the same name as the primary key ...

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

37. Cascading delete not working    forum.hibernate.org

I have a Provider object which has child Facility objects: /** * @hibernate.set role="facilities" lazy="true" cascade="delete" * @hibernate.collection-key column="provider_id" * @hibernate.collection-one-to-many class="com.webify.hta.domain.Facility" */ public Set getFacilities() { return facilities; } Notice the cascade delete setting. I'm getting an error when I try to delete a Provider object: "Cannot add or update a child row: a foreign key constraint fails" Now the ...

38. cascading many-to-many delete    forum.hibernate.org

Hi all, I have a (user|group)-group relationship, which is many-to-many and of course one side is mapped reverse ( user|group side ) to prevent double inserts. respective mapping is: Code: ...

39. Cascading delete issue    forum.hibernate.org

Hi, I'm rather new to hibernate and I have the following problem: I have two tables: Actor and Profile. there's a one to many relationship between them. Cascading delete was set during database creation so that should be taken care by the DBMS. But, when I try to delete an actor, Hibernate tries to update the profile table to set the ...

40. Cascade delete and reinsert    forum.hibernate.org

Hi there, In may application I have 2 tables: parent and a child. At some point I delete some rows from the parent table. According with the settings, also the corresponding rows from the child table will be deleted. But, in the same transaction, I make some inserts in the parent table; it is possible, to have some data within this ...

41. many-to-many delete cascade    forum.hibernate.org

Hello, I have some problem that probably has a simple solution, but I am not able to come up with it. I implemented the "Category" and "Item" class, but with a "twist". 1) a Category is owned by 1 parentCategory and can have zero or more childCategories. 2) an Item is owned by 1 Category; a Category has an Item set ...

42.  cascade Problem in delete operation.    forum.hibernate.org

43. cascade Deleting How can I do it better?    forum.hibernate.org

I have a many-to-one Relationship between Team and Boss. So a Boss can manage several Teams and a Team has to have a Chief. A Team should know who its Boss is, but a Boss "don't care" how many Teams he has, if he ever has some. My Mapping Looks like: Code:

44. simple many-to-one and cascading delete    forum.hibernate.org

Hibernate version: 2.1.6 Mapping documents: parent.hbm.xml: child.hbm.xml:

45. many-to-many cascading delete problem    forum.hibernate.org

Beginner Joined: Thu Aug 19, 2004 2:33 pm Posts: 30 Location: CA, USA Hi, I have a many-to-many relationship set up. Two objects are involved. A "Category" contains many "Terms". "Terms" may belong to many "Categories". When I delete a category I want it to cascade and delete the term if and only if it does not belong to another category. ...

46. Problem with cascaded delete    forum.hibernate.org

Hibernate version: 2.1.6 Name and version of the database you are using: Mysql 4.0.20d Here is my setup: I have a User object that has a Set of CustomLayout objects mapped as a one-to-many. I am having trouble deleting one of the custom layouts from the Set. Here are my mapping files: User.hbm.xml ------------

47. Is this the expected behaviour for cascade="all-delete-    forum.hibernate.org

If I have a parent object A which has a list of children which contains child B. When I remove B from the child list of A and then add it to the list of children for parent object C I get the exception from Hibernate shown below. Is this the expected behaviour? net.sf.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade ...

48. one-to-many cascade delete optimalization problem    forum.hibernate.org

Introduction I was testing cascade delete option in one-to-many association. When parent that have many children is deleted its children are also deleted. Hibernate version: 2.1.6 Mapping documents:

49. cascade delete not very efficient..    forum.hibernate.org

Hibernate version: 2.1.6 Mapping documents: Parent: Child: Name and version of the database you are using: MySQL 4 I have a chain of parent-child relationships several levels deep.. they are all mapped as shown above.. when ...

50. Many-to-one and cascading deletes    forum.hibernate.org

I have a model with several many-to-one relationships. Essentially something like this: An example model might contain a Person, Role, and Participant relationshp where Participant is the combincation of a person, role and some relationship with some other entity. The scenario I want to support would be for a person to participate (in the same ...

51. Can I switch between cascade all and all-delete-orphon?    forum.hibernate.org

Can I switch between cascade all and all-delete-orphon at runtime? If so, how? If not, what is the workaround? The problem is that I have a many-to-one relationship (object A contains many B's) where I simply want to dissociate B from A (by setting the reference to null) while deleting B in other cases. In the cases where I say cascade="all", ...

52. On cascade-delete    forum.hibernate.org

53. Cascade delete - Hibernate is TOO good    forum.hibernate.org

Hi, I am using Hibernate 3.0b4 I have an author and a book class with a many-to-many association between them. In the author mapping file my 'books'-set has cascade=none. In the book mapping file my 'authors'-set has cascade=delete. With these settings I thought I would achieve the following: *) when I delete a book, the corresponding relation with author will be ...

54. Question about cascade delete    forum.hibernate.org

Hibernate version:2.1.7c Hi everybody, I have a question regarding cascade=all-delete-orphan I have a parent/child association that uses cascade=all-delete-orphan. The child has a column (different from the PK) that has a UNIQUE constraint. If I remove some children from the parent, add new ones, and save: all children are passed to saveOrUpdate, and the ones that were removed are deleted. This is ...

55. Delete cascade    forum.hibernate.org

Hibernate version: 2.1.6 Thanks for your interest in my topic! I have a simple one-to-many mapping which looks the following using xdoclet in my class PersistentReportDefinition: @hibernate.set inverse="true" table="time_span" lazy="false" name="timeSpans" cascade="all-delete-orphan" @hibernate.collection-key column="report_def_id" @hibernate.collection-one-to-many class="com.nexusatwork.nrs.collectable.persistence.mapped.PersistentTimeSpan" I first create a ReportDefinition which has three such PersistentTimeSpanS in a Set. This works very well, they are saved cascading. Later on I want ...

56. Cascade delete - Strange problem    forum.hibernate.org

57. cascading deletion    forum.hibernate.org

if i session.delete(aKitten) it doesn't seems like aCat.getKittens() is updated. even tho I use cascade=CascadeType.ALL on Kitten.getParent() How am I supposed to deal with this problem? I am deleting kittens in the same transaction as I am getting the Cats kittens. and some deleted kittens show up when i get he cats kittens.

58. cascade delete not working in one to one    forum.hibernate.org

Newbie Joined: Sat Apr 23, 2005 6:06 pm Posts: 6 I have the following two mapping files: attached below: I have implemented a one to one relationship between these two entites. The post relationship is a many to one relationship and is unidirectional where as the one to one is a bidirectional relationship. The problem I am having is that I ...

59. Cascade delete in hibernate    forum.hibernate.org

Newbie Joined: Mon Mar 13, 2006 9:46 pm Posts: 7 I am trying to delete the records from the database. I get 'SQLcould not execute update query' error. What am i doing wrong. Any help is appreciated public static final Timestamp TODAYS_RECORD_TIME =new Timestamp(System.currentTimeMillis()); String delSql = " delete from EcoCmdyDelete where lastUptdDt< :lastUpDt "; Query delQry = session.createQuery(delSql); delQry.setTime("lastUpDt", TODAYS_RECORD_TIME ...

60. cascading deletes    forum.hibernate.org

I am having issues with the cascading deletes with hibernate. I have changed the cascade from all, delete and save-update and whenever I just try and delete the Parent, I get a constraint error listed below. What am I doing wrong? I have a parent class that can have 1 to many children, the relationship between the two is listed below ...

61. Utilizing cascade delete in hibernate    forum.hibernate.org

I had a question about utilizing cascade delete in hibernate. I currently use the cascade delete functionality in hibernate. hibernate does not utilize the rdbms functionality to implement this feature. May I still specify my rdbms tables to use the cascade on delete functionality without screwing up hibernate or must I turn it off in my rdbms. Thanks in advance.

62. on-delete="cascade" vs cascade="delete"    forum.hibernate.org

Hibernate Version = 3.0.5 What is the difference between on-delete="cascade" in a key and cascade="delete" in a collection mapping? It seems that on-delete="cascade" generates a statement in the generated schema whereas cascade="delete" does, well, what, exactly? Where I am going with this is I have a one-to-one mapping which expresses a parent-child relationship. I would like a on-delete="cascade" behavior on this, ...

63. Automatic CASCADE Deleting    forum.hibernate.org

The problems is: I have a POJO Tabelacusta with three Itemtabelacusta on setItemtabelacustas() of Tabelacusta , OK i pass the Pojo to a client using EJB Session Bean... On client I call TabelacustaVo.getItemtabelacustas().remove(addr2); An put back to session bean , and call session.saveOrUpdate(TabelacustaVo).. The Address with key addr2 is not deleted, exists way to do that ? The hibernate not delete ...

64. Delete / cascade / many to many    forum.hibernate.org

Hello! I use NHibernate 1.02 Ive been struggling with this in a couple of days now. But its surely a simple question to answer..) I got two tables contact and group, a many to many connection. And a table between named groupcontact. When I add contacts to a group everything works fine, but how can i delete a contact from the ...

65. on-delete="cascade" not working for scalar collect    forum.hibernate.org

I have an entity class that contains (among other things) a Map of strings to strings, backed up by an Oracle database. My mapping for it looks something like this (paraphrased to eliminate application-specific information): Code: ...

66. Problem in cascade="all-delete-cascade"    forum.hibernate.org

cascade="all-delete-orphan" when i am using this property in set for delete child records,hibernate first execute update query for child table to update foriegnkey to null and then delete parent record and then delete child records. But in my case foriegn key in child table is not null field, so i am getting FK constraint error while tring to update null to ...

67. Cascade deletes somebody help    forum.hibernate.org

68. Cascade deletes somebody help    forum.hibernate.org

69. want on-delete="cascade" syntax     forum.hibernate.org

Hibernate version: 3.0.5 In Hibernate 3.0.5 is there any way to do a mapping between class A and B such that on-delete="cascade" functionality (in Oracle "ON DELETE CASCADE ENABLE") is generated in the DDL? It would not appear to be so, since on-delete is an attribute of a and is not legal for , unlike the situation with other ...

70. want on-delete="cascade" syntax for a one-to-one    forum.hibernate.org

Hibernate version: 3.0.5 In Hibernate 3.0.5 is there any way to do a mapping between class A and B such that on-delete="cascade" functionality (in Oracle "ON DELETE CASCADE ENABLE") is generated in the DDL? I want to handle deletion of graphs of objects in a stored procedure. It would not appear to be so, since on-delete is an attribute of a ...

71. Cascade delete.    forum.hibernate.org

Newbie Joined: Sat Oct 21, 2006 10:34 pm Posts: 1 I am having an issue with cascade delete operation. I am doing pretty complex delete operation - deleting PropertyInfo object which is related oneToOne to Property object, which has list of Ad objects, which have set of Image object in them. Everything works just fine. But I am noticing redundant select ...

72. cascade delete using Hibernate    forum.hibernate.org

73. Cascade delete overspill?    forum.hibernate.org

Hi all, I'm new to Hibernate and I have a question about cascade delete... In my application I'm using user/role relationship in the following way: Code: CREATE TABLE pb_user ( id INTEGER NOT NULL PRIMARY KEY, username VARCHAR(128) NOT NULL UNIQUE, password VARCHAR(128) NOT NULL, email_address VARCHAR(128) NOT NULL ...

74. Problem with cascade delete and many-to-one    forum.hibernate.org

I'm trying to set up a many-to-one relationship where I have one User and multiple Sailor instances. If I delete a User, all Sailors with matching userId's should be deleted. I don't want to have a relationship in the User class, as I don't want to populate the User object with lots of Sailor objects every time I fetch the ...

75. Cascade delete issue    forum.hibernate.org

Hi, I have three Domain Elements: Person PersonToPhone (Association table) Phone Person have a set of PersonToPhone objects. When I delete an element from a set I want to delete the corresponding row from association table PersonToPhone. So in Person.hbm.xml I have specified: Code:

76. ClassCastException on cascade delete    forum.hibernate.org

Hello, I've a class named Extensible that has a one-to-may association with a class named AdditionalField. AdditionalField is not abstract and has sublcasses: BooleanField, NumericField etc.. For the inheritance I use a strategy "one table per hierachy". Is use the "delete-orphan" tag on the association. But When I try to delete the Extensible, I get the following exception: org.hibernate.HibernateException: instance not ...

77. Cascading set to none, still tries to delete    forum.hibernate.org

I have three structures that I have to work with. An AgencyContact, OfficerContact and an Officer. AgencyContact has a one-to-many relationship with OfficerContact. OfficerContact has a many to one relationship with Officer. AgencyContact.hbm.xml part for officercontact is Code:

78. Problem with cascade delete in one-to-one    forum.hibernate.org

Hi all, Sorry for newbie question but I have a problem with cascade delete. See my mapping. There is "one to one" relation between CartItem and CartConten, but it seems that cascade delete does not work. It complains that CartContent still references from CartItem. Thanks in advance for help.

79. Delete cascade isn't working    forum.hibernate.org

80. Problem with cascade delete    forum.hibernate.org

I have read the book, the documentation and FAQ. Still not able to figure this one out pls help. I have two entity classes User and Patient. ... @OneToMany(mappedBy = "user", cascade = { CascadeType.ALL }, fetch = FetchType.EAGER) @org.hibernate.annotations.Cascade(value=org.hibernate.annotations.CascadeType.DELETE_ORPHAN) private Set patients = new HashSet(); ... In the controller layer I have this delete method which uses an id from ...

81. How to cascade a delete for a many-to-one or one-to-many    forum.hibernate.org

Hi everyone! The situation that I am encountering is that I need to remove a record associated with another record when that record is set to null. To be a bit more clear, here is an example. I have a Person object which contains a Phone object (PERSON table references PHONE_ID from the PHONE table). When the Phone object is set ...

82. Many to Many cascade delete problem    forum.hibernate.org

Hi, I have 3 tables User---->UserRoles<-----Roles in USER table mapping i have the following many to many mapping : when i try to delete the user by session.delete(user); it gives me oracle constraint violation error. how to map so that hibernate will automatically delete the child records from UserRoles table for ...

83. trouble with cascade delete    forum.hibernate.org

Hi, I'm pretty new to hibernate and i'm not really sure how the cascade works. I did some test on deleting a "Parent" with a collection of "ChildBag" however deletion is not happening in the "ParentBag" and the other records are deleted fine. The weird thing is I didn't get trouble when saving the "Parent" object since all data is saved ...

84. many-to-one and cascade delete    forum.hibernate.org

Hi forum, I need your help with many-to-one relation: I have many-to-one relation and I would like to force hibernate to create real database "on delete cascade" contraint. I know I can add cascade="delete" and hibernate will call extra delete command, but I would like yo have real database constraint because I thing it is more effective. How can I achive ...

85. Problems with performing cascade deletes    forum.hibernate.org

Newbie Joined: Tue Jul 31, 2007 10:32 am Posts: 17 Location: Amsterdam I am having a problem performing a delete operation using hibernate and was hoping someone could help me out here. I am using Hibernate and Spring and have a table in the database based on the following configurations: Spring-based tranaction manager: Code: ...

86. "Cascade" delete links in many-to-many rel.    forum.hibernate.org

Hibernate version: 3.3.0 CR1 Mapping documents: Code: ...

87. logical cascade delete    forum.hibernate.org

Hi, Did anyone get logical delete with cascade to work using hibernate. Instead of physically deleting the records when a delete is made, a column in the record should be set to false. The database schema has parent-child relationships. So if a parent is deleted, not only the record of the parent should be set to false, even the column of ...

88. many-to-many cascade delete does not work    forum.hibernate.org

Hibernate version: 3.2.1.ga Full stack trace of any exception that occurs: Name and version of the database you are using: hsqldb 1.8.0.7 Hello, I can't manage to have a cascade delete working for the following model. The model looks like: |Customer|----*|Order|----<**>-----|Product| i.e. Customer one-to-many Order, Order many-to-many Product The problem is that using the mapping below if I delete a Product ...

89. Please help me in on delete cascade    forum.hibernate.org

Hi all I am new in Hibernate. I have two classes, Question(id is question_id) and ExamQuestion(which contain an object of Question and id is exam_question_id) what I have to do to attain on delete cascade. ------------------------------------------------------------------------------------- Following is my ExamQuestion.hbm file

90. Question about Cascading Deletes    forum.hibernate.org

@Entity @NamedQueries({ @NamedQuery( name="CompanyByName", query="from Company l where l.name = :name") }) public class Company implements Serializable { @OneToMany(cascade=CascadeType.ALL) private List audits = new ArrayList();

91. hibernate cascade delete fails    forum.hibernate.org

Hello people, Having a problem with Hibernate, and i can't figure it out. Please help... Exception stack trace : Code: 04:54:54,093 ERROR [STDERR] org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [entities.Contacte#7] at org.hibernate.engine.StatefulPersistenceContext.checkUniqueness(StatefulPersistenceContext.java:590) at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:99) ...

92. Problem on cascading delete.    forum.hibernate.org

Newbie Joined: Fri Jun 12, 2009 1:53 am Posts: 1 I have a many to one association between a SocialEvent class and venue class. I want that when i delete a venue object then the corresponding socialevent object should be deleted, which contains the reference of this venue object. If it is possible using cascade attribute, let me know that. Hibernate ...

93. hibernate cascade deletion    forum.hibernate.org

i have one course class and one tutorials class. I couse class i hav a set of tutorials. When i delete course i want the set of tutorials associated with that course aslo to be deleted. when i try to delete couse only the foreign key cid in tutorial table become null but all othere fields of tutorials tabel r intact ...

94. Delete on cascade    forum.hibernate.org

Hi! I've a problem to delete on cascade child rows. I've two classes: Parent: Circuito Child: Firma

95. Cascading delete    forum.hibernate.org

Can someone help with a cascading delete problem? Code is below. I have a Team that contains a set of Games. A Game refers to a home and an away team. If i delete a Team, I want all its games to be deleted. This means it should remove the games from the other Team's list of games too. Right now, ...

96. Cascade Delete question    forum.hibernate.org

Hello, Scenario: I have a mapped class Foo with a reference to another mapped class Bar. ie, class Foo has getBar() and setBar() The cascade on Foo is set to "all". Question: If I have an instance of Foo with a reference to an instance of Bar, and then set this reference to null and save the Foo instance, will the ...

97. please help for cascade delete using hibernate    forum.hibernate.org