• Post Reply Bookmark Topic Watch Topic
  • New Topic

One to Many mappings in separate table help with mapping creation  RSS feed

 
Justin Howard
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have 2 tables in a relation of one to many mapping. but the mapping is in a separate table.
How can I create the hibernate mapping for this.

<table border="1">
<tr><td>username</td><td>password</td><td>person ID</td><tr>
<tr><td>ABC</td><td>abc</td><td>1</td><tr>
</table>


<table border="1">
<tr><td>Person ID</td><td>Principal ID</td><tr>
<tr><td>1</td><td>1</td><tr>
<tr><td>1</td><td>2</td><tr>
</table>



<table border="1">
<tr><td>Principal Name</td><td>Principal ID</td><tr>
<tr><td>Admin</td><td>1</td><tr>
<tr><td>Sales</td><td>2</td><tr>
</table>
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!