• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Id problem in annotation based mapping when using xml based id.

 
Manuel Petermann
Ranch Hand
Posts: 177
Hibernate Linux Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok first the xml:

Now the annotated classes:


What I need is to switch between the ids but it doesn't work as i figured.
if I run this i got the exception:
org.hibernate.AnnotationException: No identifier specified for entity: eu.gdimbh.cardea.database.entity.DataCategory

I read somewhere that it is possible to mix annotation and xml. But either that is not true or I am doing something wrong.
I hope i am doing something wrong cause i got no other idea how to switch through ids.

Thanks in advance.

EDIT: Got it solved.
Mapping was wrong.
I used:


and it seems to work.

Edit 2: For future reference. Dump this approach and use uuids. If anyone won't get a better idea.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic