• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate one-to-many question  RSS feed

 
Kid Wonder
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!