-->
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.  [ 4 posts ] 
Author Message
 Post subject: Base class instantiation
PostPosted: Mon Jan 26, 2004 12:17 pm 
Regular
Regular

Joined: Wed Sep 03, 2003 9:56 pm
Posts: 58
I have a base class and two sub-classes mapped using the table-per-class strategy. The table is being loaded from an external (i.e. non-Hibernate) loader, and I then instantiate the classes using Hibernate.

My question is, in the external loader, what do I set the discriminator value to if I want to specify instances of the base class?

Each subclass has it's own discriminator value. Will NULL indicate an instance of the base class?

-Mitch


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 26, 2004 12:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can set discriminator-value for your class element.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 26, 2004 12:27 pm 
Regular
Regular

Joined: Wed Sep 03, 2003 9:56 pm
Posts: 58
Do you mean set a discriminator value within my base class definition, but outside of any <subclass/> elements? (i.e. at the same level as the <descriminator/> tag itself?)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 26, 2004 12:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
No, set the discriminator-value of your class element. http://www.hibernate.org/hib_docs/reference/html/or-mapping.html#or-mapping-s1-3


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.