• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mapping Collection in Hibernate.

 
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am starting to learn how to map collection in Hibernate. I saw various examples in net but I am finding it too confusing and unable to understand how to implement it practically. Please could anyone point me to a place where it is explained in a very simple and lucid manner so that I can get the basic concepts?. Moreover I am reading from the book "Java Persistance with Hibernate" by Christian Bauer and Gavin King.


Thanks and Regards,
Sid.
 
Ranch Hand
Posts: 43
Android Hibernate jQuery
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the book from Christian Bauer is the best on yet on hibernate..

you can visit hibernate support documentation for a more examples hibernate docs (3.3)

if that doesen't help please revert with the actual mapping you are trying to create & i'm sure we can help you with it.
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have tried the same thing with hibernate!

Here i will take an example of Employee object.

An Employee can be associated with multiple departments.

So now our Employee can have a collection of Dept objects.

So now i can map this Dept Collection in Hibernate using <one-to-many> tag specified in Employees.hbm.xml

Where, for Dept i will have seperate Dept.hbm.xml describing Dept object properties.

If you want i can share the code with you!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic