Joined: Thu Oct 25, 2007 3:17 pm Posts: 8
|
Using Hibernate 3.2
DB2390
I am trying to map a one-to-many from a column zip_code in a table ZIPCODES to another table SALES with a column key_field_val. The join here is something like key_field_val=zip_code||'%' the column is a weird composite column. I can may the key_field_val to a zipcode property in SALES using a formula and substring however I can not use a "foreign" property ref in the key of my one-to-many nor can I use a formula. I've tried subselects and custom queries but they all seem to want a key that I can not supply since the key is unnatural. My xml is basically:
<bag name="salesCollection" lazy="false">
<key column="zipCode" />
<one-to-many class="Sales"/>
</bag>
I cannot seem to find away around using the key that does not exist, is this not possible? Should I perhaps approach this a different way?
Thanks
|
|