Hibernate Many To One Annotation Example

Hibernate » on Aug 30, 2011 { 4 Comments } By Sivateja

Will find the example on hibernate many to one mapping using annotations
Files required…

  • hibernate.cfg.xml




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.


4 Responses to “Hibernate Many To One Annotation Example”
  1. ramana says:

    can you post how can we maintain the trasactions in hibernate with explaination?

  2. sandhya says:

    In program on line 49 it must be… please correct it.. thankyou

  3. manjesh says:

    I learn Spring and hibernate from this website. now I am working spring with hibernate very comfortably..

    Thank you

  4. While executing the above example, I am getting error, Kindly please have a look…

    Exception in thread "main" org.hibernate.MappingException: Unknown entity: org.hibernate_1.Customers
    at org.hibernate.internal.SessionFactoryImpl.getEntityPersister(
    at org.hibernate.internal.SessionImpl.getEntityPersister(
    at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(
    at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(
    at org.hibernate.event.internal.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(
    at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(
    at org.hibernate.event.internal.DefaultSaveEventListener.performSaveOrUpdate(
    at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(
    at org.hibernate.internal.SessionImpl.fireSave(
    at org.hibernate_1.ForOurLogic.main(


By posting your answer, you agree to our comments policy.
Most Recent Posts from Top Categories
Hibernate Spring Struts
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.