snake068 wrote:
Unfortunately that doesn't seem to work for me. I tried a formula like you suggested but I get the following MappingException when my application tries to load the mappings:
ERROR com.bearingpoint.orderlog.struts.HibernatePlugin - mapping error
org.hibernate.MappingException: Could not determine type for: String, for columns: [org.hibernate.mapping.Formula( (select location from tbl_Dfas_Location o where o.pk_dfas_location_id=fk_dfas_location_id) )]
My mapping file looks like this:
<class name="com.bearingpoint.orderlog.data.Order" table="tbl_Order">
....
<property name="DfasLocation" formula = "(select location from tbl_Dfas_Location o where o.pk_dfas_location_id=fk_dfas_location_id)" type = "String" />
...
</class>
It says that it cannot determine the type but I explicitly give the type as String so I don't know what to say. I think the formula approach is not going to work, sadly. Let me know if you got it to work.
Try type="string" (lower case) or fully qualified type="java.lang.String"