-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: ID-generate param only in persistent root class?
PostPosted: Wed Mar 30, 2005 5:53 am 
Newbie

Joined: Wed Mar 30, 2005 5:41 am
Posts: 6
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 7:09 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Can you clarify this case for me. Even better send a proper working test case in JIRA?
Thanks

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.