Get all updates of Java4s

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 the Author .::

- Full Stack Java/J2EE & UI Web Developer
Founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog, Love Java and UI frameworks.
You can 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
Spring-Boot-tutorials Hibernate tutorials Spring tutorials Struts tutorials Servlets tutorials Ajax tutorials Log4j tutorials jQuery tutorials Json tutorials Core Java tutorials Web Services tutorials AngularJs tutorials
Most Recent Tutorials
Hibernate_Logo Hibernate Recent Posts Spring_Logo Spring Recent Posts Struts_Logo Struts Recent Posts
Contact | About Us | Privacy Policy | Advertise With Us

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