Hi,
Thanks for the reply. This is actually a legacy system that I cannot change the database or the java source. I will have to sort this out with mappings. I am a bit fuzy on how to use a one-to-one to map to a string and not a custom class.
I would do this:
Code:
<hibernate-mapping>
<class name="Person" table="tbl_Person">
<id name="id"
type="java.lang.Integer"
column="id"
unsaved-value="0">
<generator class="identity" />
</id>
<property name="name"
type="java.lang.String"
column="name"
not-null="true"
length="30"/>
<one-to-one
name="ADDRESS"
foreign-key="ADDRESS_ID"
cascade="save-update"/>
</class>
</hibernate-mapping>
This doesnt work. How would hibernate know what column I want to put in that ADDRESS field? How would hibernate know what ID column it should match? Am I missing something huge here?