• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Who knew that furniture could be so violent? Put this tiny ad out there to see what happens:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic