• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate: How to set multiple values for <subclass discriminator-value...

 
Bimal Patel
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My requirement is to use a specific class type when the value is one in an integer value range or of the set of values. I tried finding out if discriminator-value allows to have an integer range or list of values but haven't got any success in it. Here is my hbm.xml mapping file:

<discriminator column="<db_column_name>" type="integer" />


<subclass name="somepackage.someclassA" discriminator-value="1">
...
</subclass>

<subclass name="somepackage.someclassB" discriminator-value="2-8">
...
</subclass>

<subclass name="somepackage.someclassC" discriminator-value="9,10">
...
</subclass>

Last two classes should be interpreted as either or. I felt that the solution is available but I don't exactly know how to implement it. Here is the link to the "solution" http://opensource.atlassian.com/projects/hibernate/browse/HB-809. Any help is appreciated.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic