Hibernate version:3.0.5
I have an object that I map to different databases with different hbm mapping files.
I have a field in that object that I want to populate with a constant string value for all objects returned from a particular database with a different value depending on which database it comes from.
I was thinking I could use a <property.../> mapping in the hbm.xml and tried
Code:
<property name="propertyName" type="string" formula="'PARTY'"/>
and
<property name="propertyName" type="string" formula="(select 'PARTY' from TinySurvey)"/>
If formula isn't the right way to do this, any suggestions would be appreciated.
I know I could do this in Java, but I wanted to be loosely coupled and let the hbm.xml do the job.