• 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

Hibernate one-to-many question

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a Form class which contains a set of Controls. A Control has a reference back to its Form.

For simplicity I will remove all the other attributes of the classes:


So I am trying to map this properly in my HBM files, but can't get it to create the mapping properly.

My first question is: Is this even possible. I have no problem doing one-way one-to-many mappings, but as soon as I want that Form field in Control I get confused as how to proceed.

Here are my HBMS:

Form:


Here is the Control HBM


Basically, what I want to allow is to have code that can do the following:


At this point I have tried a variety of different things and am out of ideas
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Kid Wonder"

Welcome to JavaRanch!

Please can you change your display name so it matches our Naming Policy. You can do this here.

Thanks!
reply
    Bookmark Topic Watch Topic
  • New Topic