Win a 3 month subscription to Marco Behler Videos this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

many-to-many with additional columns in join table and composite keys  RSS feed

 
Petar Petrovic
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have the following problem.
Before an offer for a client is made, some checks should be done first. For one offer, the same check type can be done many times. I have the code book for the check type that consists of id and name.
I've made the following entities, but this is not good enough because when I get offer from the repository I get all the client checks for that offer, but I only want the client checks for a particular time stamp. What should I change? I probably need to add the time stamp to the offer entity also, but I don't know how to connect all that.





 
Petar Petrovic
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've added timestamp to the Offer and connected it with ClientCheck's timestamp but hibernate doesn't allow foreign keys on non-primary keys like timestamp in Offer. Although, foreign keys are allowed to reference unique columns, but hibernate doesn't allow that
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!