• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to write hibernate mapping file without <id> tag?

 
Tusshar Fasate
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I dont have primary key in my table.
So How can I write mapping file without <id> tag?
I think Its compulsory to use <id>.Is there any other way to resolve this issue?
Please do reply.
Thanks
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tusshar Fasate wrote:Hi ,
I dont have primary key in my table.
So How can I write mapping file without <id> tag?
I think Its compulsory to use <id>.Is there any other way to resolve this issue?
Please do reply.
Thanks


No primary key at all? No composite primary key where a few fields can be used to determine uniqueness. There needs to be something that you can say will uniquely identify a row in that table. If no combination of fields can be used, then it would mean you can have duplicate rows in your database, which is bad. And also would mean that you can't map it at all in an ORM tool, because it is required.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic