• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate and MySQL Views

 
Pandian Ramaiah
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have a view that contains the following data.




I want to map this to Hibernate entity. The first column 'Team_id' is not unique. Hence how can I write the mapping entries for this?
Any idea?

Thanks in advance
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that you could use a composed key Tutorial JPA Composite Primary-Key

I never mapped a view, I do not know if this will work for you.
 
Pandian Ramaiah
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Hebert,
But I have not used a composite primary key here.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!