• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate mapping with database

 
amol skulkarni
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Today I cam accross following scenario
We have a publication house and are in requirement of building a rating system for books.
The requirement is like :-

Title Author Subject Critic/Rating
ABC Aaaaa Sssssss John-2,Jack-3
DEF Bbbbb S11111 John-4
GHI Ccccc S22222 John-3,Jack-5





Here John and jack are the critics for the books with title ABC,DEF,GHI what would be the best
possible implementation for such a table . Note priority would be obtaining ratings easily and connecting them to critic and books easily , also critic may or may not provide rating to the book. XML mapping would help in clarifying better as currently we use that instead of annotations. Also show many pojo's would be needed or are preferred to create
 
Salil Vverma
Ranch Hand
Posts: 257
Hibernate Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey amol,

Rather than asking for complete solution. Can you please suggest what have you tried and where exactly are you stuck ?
This will help us helping you in a better way.


 
amol skulkarni
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for suggestion Salil, ok so this looks like a ternary relationship where we see that there could be three objects in Java
Book, Critic and Rating. So questions turns out to be what is the best way to implement ternary relations in Hibernate
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic