Home Discussion Discuss: Hibernate 4 Many to Many Mapping using Xml

  • Delete is not working properlyRodrigo October 4, 2012 at 8:56 AM

    Hello I just wanted to know how I can have this many-to-many relation but I need to delete a course and NOT delete the related students. Also delete an student and NOT delete the related courses. For example: student = (id=1). student_course= (id_student=1, id_course=1); (id_student=1, id_course=2); (id_student=1, id_course=3). course (id=1)(id=2)(id=3) Now I delete the student (id=1) student (empty) student_course (empty) course (1) course (2) course (3) With this mapping, hibernet delete all tables! student (empty) student_course (empty) course (empty) Thanks! Rodrigo

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
Hibernate-Tutorials

Hibernate 4 One to Many mapping using XML
In this section, you will learn how to do one to many mapping of tables in Hibernate using Xml 

Hibernate-Tutorials

Hibernate 4 Many to Many Mapping using Xml
In this section, you will learn how to do many to many mapping of tables in Hibernate using Xml 

Hibernate-Tutorials

Hibernate 4 Many to Many Mapping using Annotation
In this section, you will learn how to do Many to Many Mapping using Annotation 

Hibernate-Tutorials

Hibernate 4 Many to Many Mapping using Annotation
In this section, you will learn how to do Many to Many Mapping of table in Hibernate using Annotation 

Hibernate-Tutorials

Hibernate 4 One to Many mapping using Annotation
In this section, you will learn how to do one to many mapping in Hibernate using Annotation 

Hibernate-Tutorials

Hibernate 4 One to Many mapping using Annotation
In this section, you will learn how to do one to many mapping in Hibernate using Annotation 

Hibernate Questions

Hibernate Mapping Many-to-Many Example
Hibernate Mapping Many-to-Many Example  How does many to many relationship work in Hibernate?   In many to mant relationship each row... : hibernate.cfg.xml <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate 

Hibernate-Tutorials

Hibernate One to many XML mapping array Example
In this section, you will learn how to do one to many mapping using array to retain mapping order in Hibernate 

Hibernate-Tutorials

Hibernate One to Many XML Mapping list Example
In this section, you will learn how to do one to many mapping using List to retain mapping order in Hibernate 

Hibernate-Tutorials

Hibernate Many One One Mapping
Hibernate Mapping And Join Using hibernate we can easily create relationship between two tables. The relationship may be One-To-One, One-To-Many, Many-To-One and Many-To-Many. An Example of One To Many mapping is given below Address 

JDBC Questions

Result Set one to many mapping
I populate my bean classes from resultset without using hibernate, so...Result Set one to many mapping  Suppose there are 5 tables in database named A,B,C,D and E. A has one to many relationship with B,C,D and D has one 

Hibernate Questions

Hibernate Many To Many Annotation Mapping
Hibernate Many To Many Annotation Mapping  How to use Many To Many Annotation Mapping in Hibernate?   Hibernate requires metadata like... to another.Hibernate annotation provides annotation-based mapping. Click here 

Hibernate Tutorial Example

Hibernate Many-to-many Relationships
Hibernate Many-to-many Relationships       Hibernate Many-to-many Relationships - Many to many example in Hibernate. In this example we have used xml 

Hibernate Tutorial Example

Hibernate Many-to-one Relationships
Relationships - Many to one relationships example using xml meta-data This current... of Hibernate mapping: The following mapping is used to define the many-to-one... Hibernate Many-to-one Relationships 

Hibernate Tutorial Example

Hibernate One-to-many Relationships
- One to many example code in Hibernate using the xml file as metadata. Here... mapping in Hibernate. Many to many relationships is interesting as one... Hibernate One-to-many Relationships 

Hibernate-Tutorials

Hibernate One to many XML Mapping bag example
In this section, you will learn how to use element instead of or element in mapping XML file in Hibernate 

EJB Questions

Many To Many annotation in ejb
Many To Many annotation in ejb   how to define primary key in the third & resulting table obtained from ManyToMany mapping.I tried the mapping but the resulting table is showing only foreign key with the two fields which 

JPA

JPA Retrieve Data By Using Many-to-Many Relation
JPA Retrieve Data By Using Many-to-Many Relation... will learn how to retrieve data to database table by using the JPA many-to-many relation... Book: Enterprise Applications Integration with XML and Java Hibernate 

Hibernate-Tutorials

Hibernate One to Many Indexed Mapping
In this section, you will learn to one to many indexed mapping in Hibernate to preserve mapping order 

Java Technology Tutorials

JPA Many-to-Many Relationship
JPA Many-to-Many Relationship     ... the many-to-many relationship and how to develop a many-to-many relation in your JPA Application. Many-to-many: In this relationship each record in Table-A may 

Hibernate Tutorial Example

Hibernate 4 Tutorial
application much easier. In this Hibernate 4 Tutorial series you will find many... to download Hibernate 4. Using hibernate in console based...Hibernate 4 Tutorial The latest version of Hibernate 4 Tutorial comes 

Hibernate-Tutorials

Hibernate One to Many Bi-directional Mapping
In this section, you will learn how to do One to Many Bi-Directional Mapping in Hibernate 

Hibernate-Tutorials

Hibernate Many to Many Self Join using Annotations
In this section, you will learn how to do many to many self join using Annotations in Hibernate 

JSP Servlet Questions

how to send mail to many recipients using jsp,apache
how to send mail to many recipients using jsp,apache  hello i am reading and displaying the excel sheet with the help of jsp,apache(poi).now i want... in ms access database...... Hoping 4 early replies....thanks in advance 

JDBC Questions

Resultset with one to many relationship
populate my bean classes from resultset without using hibernate, so...Resultset with one to many relationship   Suppose there are 5 tables in database named A,B,C,D and E. A has one to many relationship with B,C,D and D 

Hibernate-Tutorials

Hibernate 4 One to One Mapping using Annotation
Hibernate One to One Mapping using Annotation 

Hibernate-Tutorials

Hibernate 4 One to One Mapping using Annotation
Hibernate One to One Mapping using Annotation 

Spring Framework Questions

Mapping objects in XML - Spring
Mapping objects in XML   Hello, I´ve read that you can define an object in the configuration XML as follows: tom... the object... How can I define the XML? I don´t understand the utility about 

Hibernate Tutorial Example

Hibernate 4 Annotations Tutorial
in Hibernate 4. Hibernate 4 is popular ORM framework and comes with many new...Video Tutorial: Hibernate 4 Annotations Tutorial In this video tutorial I... database and table in MySQL database Here is the video of Hibernate 4 

Hibernate-Tutorials

Hibernate Collection Mapping
;Hibernate Collection Mapping Example Using XML "); Session session... System.out.println("**********Hibernate Collection Mapping Example using Xml... : Hibernate Collection Mapping Example Using XML **********Hibernate Collection 

DMCA.com