Get all updates of Java4s
Follow Us: Email Newsletter

Hibernate One to Many Mapping Delete Query Example

Hibernate »on Jul 22, 2011 { 6 Comments } By Sivateja

Let us see the logic for hibernate one to many mapping delete query, Actually every thing is same like Hibernate One-to-Many Mapping Insert  but only change is in file.

But mates, ensure you came through these sessions for better understand

Files required..

  • [pojo class]
  • [pojo class]
  • Customer.hbm.xml
  • hibernate.cfg.xml
  • Vendor.hbm.xml




Deleting Single Parent Object With All Child

If we want to delete all the parent objects will all its corresponding child objects., then the logic will be like..

Deleting All Parent Objects With All Childs

You Might Also Like

  ♦ About Author ♦

Full Stack( Java/J2EE & UI/UX ) Developer and founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog. Sign-up for the Email Newsletter for your daily dose of Java tutorials.


6 Responses to “Hibernate One to Many Mapping Delete Query Example”
  1. chandra says:

    can you please give detailed tables on other relations also .

  2. thayeef says:

    Very nice tutorial .Thanks alot.

  3. karthick says:

    shall we use …..
    createQuery(“delete from Vendor v”); instead of above query…

    pls reply… :)

  4. Gourav Bohra says:

    Shall we use …..
    createQuery(“delete from Vendor v”); instead of above query…

    pls reply… :)


By posting your answer, you agree to our comments policy.
What would you like to learn today?
Browse these popular technologies
Hibernate spring struts Servlets ajax Log4j jQuery Json Core Java Web Services AngularJs
Most Recent Tutorials
Hibernate_Logo Hibernate Recent Posts Spring_Logo Spring Recent Posts Struts_Logo Struts Recent Posts
Useful LinksCurrent & UpComing Tutorials
  Web Services [ SOAP ], JSP
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2017 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.