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.  [ 1 post ] 
Author Message
 Post subject: Suggestion: default discriminator for simple subclasses
PostPosted: Wed Aug 09, 2006 4:19 pm 
Newbie

Joined: Mon Aug 07, 2006 6:40 pm
Posts: 12
Location: Atlanta, GA
Using the May-28 Alpha 1.2.0.1001, I have a subclass that I am using with a named query for a special purpose under the table-per-class hierarchy strategy. I will not be creating lists where subclasses will coexist.

Unless I add a <discriminator /> element to the parent class mapping, an exception is thrown. Since I am allowing the discriminator-value on the subclass to default to the class name, I can eliminate the exception by placing an empty discriminator element in the parent mapping.

I would like to implement this pattern without having to modify the parent class mapping, since it is a generated file. I could default to create one all the time, but the IsPolimorphic test will return true and I expect this could affect performance if it is im mappings for classes not needing it quite yet.

I would like to see NH tolerate a subclass with a parent class that does not specify a discriminator if the subclass uses the default discriminator-value of the class name.


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

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.