-->
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: @DiscriminatorFormula
PostPosted: Thu May 08, 2008 5:09 pm 
Beginner
Beginner

Joined: Mon Mar 31, 2008 10:05 am
Posts: 20
Hi,

Is there a native hibernate XML mapping equivalent for @DiscriminatorFormula annotation ?

I couldnt find any...

I am porting annotated classes to XML mappings to enable reuse of the java classes with different XML mappings.

Thanks,
-Guillaume


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 09, 2008 3:48 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi Guillaume,

something like this should work:

Code:
<entity class="Foobar">
   <inheritance strategy="SINGLE_TABLE"/>
   <discriminator formula="..." type="string"/>
   ...
</entity>


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 09, 2008 10:55 am 
Beginner
Beginner

Joined: Mon Mar 31, 2008 10:05 am
Posts: 20
Thanks for the tip!

I actually use native hibernate mapping so:

Code:
<class name="Foobar"><discriminator formula="bla" /></class>


did the trick!

-Guillaume


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.