-->
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.  [ 2 posts ] 
Author Message
 Post subject: discriminator value with a query
PostPosted: Sat Mar 28, 2009 11:30 pm 
Newbie

Joined: Wed Dec 17, 2008 12:17 pm
Posts: 11
I it possible to specify the discriminator value with sql query ?

I want to implement hibernate inheritace with table per class hirearchy for this i have to create a discriminator colum and the examples i saw all show a hard coded value , instead i want to get the discriminator value with a query is it possible?



mine is a workflow application , i start the workflow for several entities , i need a table which ,maps the workflow PK to entity PK , i can do this with multiple mapping tables but i want to have just one mapping table , for this i want to create a tbale called entity_type

(PK)Entity_type_id, (String)entiy_name

next i need a worklfow mapping table
(PK)worklfow_mapping _id,(FK)entity_type_id, (Number)entity_id



with this data model i want to achieve table per class hierarchy for workflow mapping table and here i need a query to get the entity_type_id the discriminator value I want to provide is select entity_type_id from entity_types where entity_name="Student"


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 30, 2009 5:37 am 
Expert
Expert

Joined: Fri Jan 30, 2009 1:47 am
Posts: 292
Location: Bangalore, India
Plz see this post:

http://forum.hibernate.org/viewtopic.php?t=995942

_________________
Regards,
Litty Preeth


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