-->
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.  [ 3 posts ] 
Author Message
 Post subject: discriminator on two diffrent columns
PostPosted: Wed Oct 29, 2008 7:42 am 
Newbie

Joined: Wed Oct 29, 2008 5:29 am
Posts: 2
hi all,
i have just gone through the discrimininator and implmented table per class model of inheritance. here i have used only one column as discrimininator.
but can we use discriminator on two diffrent columns??

i got situation like this. i have two columns as follows

col1 --- col2

fax --- in
fax --- out
scan --- done
scan --- notdone

i have to diffrentiate rows basing on these two columns.
so here i have to use col1 and col2 as descriminators.
how can i do this??


Top
 Profile  
 
 Post subject: any ideas??
PostPosted: Thu Oct 30, 2008 11:05 am 
Newbie

Joined: Wed Oct 29, 2008 5:29 am
Posts: 2
ANY Idea??


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2008 11:23 am 
Newbie

Joined: Thu Oct 30, 2008 5:52 am
Posts: 5
Location: Germany
You can register at most one column element-attribute to a discriminator but you can combine two columns using the power of formula.

Sample:

Code:
   <discriminator formula="col1||col2"/>


   <subclass name="Subclass1" discriminator-value="faxin">
      <property name="put your own here" column="put your own here" />
   </subclass>

   <subclass name="Subclass2" discriminator-value="faxout">
      <property name="put your own here" column="put your own here" />
   </subclass>

   <subclass name="Subclass3" discriminator-value="scandone">
      <property name="put your own here" column="put your own here" />
   </subclass>

   <subclass name="Subclass4" discriminator-value="scannotdone">
      <property name="put your own here" column="put your own here" />
   </subclass>


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