Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate: 2 Object can refer to same record in database and 1 object can refer to 2 records in db

 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which is possible above and why ?

please let me know.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do both.

One Class and Two Tables
One Table and Two Classes

 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes you are correct but i am saying that not for table it is for records in table..
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps I'm missing a nuance of your question.

The class maps to a table, but an instance maps to a record. So with these, two instances are mapping to one record in a table, or one instance is mapping to a single record spanned across two tables.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic