• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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

 
Ranch Hand
Posts: 177
Hibernate Python Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic