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.  [ 1 post ] 
Author Message
 Post subject: Providing a variable entity name in mapping file??
PostPosted: Fri Jun 01, 2007 7:21 am 
Newbie

Joined: Fri Apr 13, 2007 10:58 am
Posts: 10
I am using Hibernate 3.0

I have the following requirement:
In my mapping file i want to use formula element to get the value for a property.
E.g
<hibernate-mapping>
<class ...>

<id name="emp_id" type="long" column="emp_id">
<generator class="native" />
</id>

<property name="prop1">
<formula>
SELECT name FROM <variable_table_name> mytable,dept d WHERE (d.emp_id = mytable.emp_id)
<formula>
<property>
</class>
</hibernate-mapping>

As shown in the above sample mapping in the query i want to pass different values(which are table names) for <variable_table_name>.

So can you experts over there please let me know if it is possible and if yes then how this can be achieved.
If its not possible then please suggest some alternative to achieve this thing.

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.