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: discriminator-value
PostPosted: Fri Apr 04, 2008 8:02 am 
Newbie

Joined: Fri Apr 04, 2008 7:56 am
Posts: 1
Hi - is it possible to specify an "else" as a discrimantor value?

So for example, say I have a table with a "code" attribute, is it possible to resolve this to:

A -> typeof(CodeA)
B -> typeof(CodeB)
NULL | string.Empty | Any other string -> typeof(CodeC)?

I'm fully aware that this isn't good DB design. I didn't make the DB, or the legacy system that this is built on top of...

I can't see anything in the documents - but then that's assuming some form of consistent design...!

Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 04, 2008 1:20 pm 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
I'm not quite sure, but a filter might work. Define a filter for class C , which restricts the results to rows that contain anything except A or B in the code column.
If A,B and C build a class hierarchie (e.G. B : A, C : B, you will loose some functionality, because you can't query on A and get all B's and C's. But if C has nothing to do with A or B or you don't need polymorphic queries, that approach might work.

_________________
--Wolfgang


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.