Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Annotation limitation with two IDs(one per Configuration)

 
Manuel Petermann
Ranch Hand
Posts: 177
Hibernate Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hallo,
I have to write a Hibernate application on a semi-standalone client with a postgresql database on it.
If you want you may sync the database with the server site.
Problem which occured is:
Client one creates a new entity, client two creates a new entity of the same class. Both have the same ID when uploading to the server.
My sollution now was to use a master Id field for the server side id and a id field for the clients.
Problem now: How to tell hibernate with annotations which Id field to use for which connection?
If its not possible, is it good practice to use xml based mapping mixed with annotations?

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic