• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

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

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Is that a spider in your hair? Here, threaten it with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic