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: Multiple or Not-null discriminators? Subclass with WHERE?
PostPosted: Wed Jul 05, 2006 7:38 am 
Newbie

Joined: Thu Jun 29, 2006 11:49 am
Posts: 13
Hello.

I have different questions but somewhat related.

a) First, I have seen examples of the use of discriminator, specifying different "string" values for each sub-class. But how can I set it for a subclass to be selected if the field is NULL and the other subclass for not being NULL?

b) Can I have a subclass split system by the use of multiple discriminators? For example:

- If fieldX == "true" and fieldY == "true", subclass A.
- If fieldX == "true" and fieldY == "false", subclass B.
- If fieldX == "false", subclass C.

c) Supposing the last question has no solution (no multiple discriminators), could I have a class ClassA that associates to TABLE1, and a subclass ClassB (that inherits from ClassA) that associates to TABLE1 with a WHERE clause?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 05, 2006 8:33 am 
Senior
Senior

Joined: Thu Aug 25, 2005 3:35 am
Posts: 160
I have the same problems as you. But in the current nh you can only have a single column as a discriminator. Therefor, you could create a view that calculates the discriminator value.


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.