Hello all,
i have one rootclass, let's call it PersistentObjectIF, which is doing some protection stuff. I do not want this class to be persistent.
My second class, let's call it Person, is inherited from PersistentObjectIF.
When I add the ID to Person or PersistentObjectIF like
Code:
@Id
private long objId = 0
everything works.
But when I try to add this:
Code:
@Id(generate=GeneratorType.AUTO)
private long objId = 0;
I will get an exception:
Caused by: org.hibernate.InstantiationException: could not instantiate test objectcom....
at org.hibernate.engine.UnsavedValueFactory.instantiate(UnsavedValueFactory.java:25)
at org.hibernate.engine.UnsavedValueFactory.getUnsavedIdentifierValue(UnsavedValueFactory.java:44)
at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:41)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:104)
...
This only works, if I add the @Id(generate=GeneratorType.AUTO) to Person and if Person is NOT inherited from my PersistentObjectIF class.
Any ideas?
Thanks a lot,
jens