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
|
|