-->
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: Getting the discriminator value
PostPosted: Wed Jan 26, 2005 4:11 am 
Newbie

Joined: Thu Dec 23, 2004 7:03 am
Posts: 5
Location: Brasov, Romania
Hibernate version: 2.1.7c

Mapping documents:
Code:
<class name="common.backend.vo.FieldVO" table="FIELD" discriminator-value="field">
...
  <discriminator column="LAYOUTTYPE" type="string"/>
...
</class>


I am using the table-per-class-hierarchy strategy and FieldVO is the base class in my inheritance hierarchy. What I need in my application is to obtain all the objects from table FIELD but, because the column LAYOUTTYPE is mapped as discriminator I can't get its value. I need to know what "layout type" each object has. How can I get the discriminator value in class FieldVO?
This bean's method getLayoutType() returns null so it is unusable. I think the solution might be in using some metadata classes or something like PersistentClass but I don't know how. Can you tell me how to obtain the discriminator value? Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 5:50 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
why don't you test the type of the object?

you can also map the discriminator as a (read only) property

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 5:55 am 
Newbie

Joined: Thu Dec 23, 2004 7:03 am
Posts: 5
Location: Brasov, Romania
it works. thanks anthony. i think i was to close to the problem to see the solution :)


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.