Hi,
I am trying to map a one-to-one relation between two classes, but i want to associate a id with a not id column.
these are my two classes:
<class
name="Text"
table="Text">
<id
name="chvp"
column="chvp"
type="integer">
<generator class="identity"/>
</id>
</class>
<class
name="TipoDeContentor"
table="TipoDeContentor">
<id
name="chvp"
column="chvp"
type="integer">
<generator class="foreign">
<param name="property">descricao</param>
</generator>
</id>
<one-to-one
name="descricao"
class="Text"
cascade="all"
constrained="true"/>
</class>
I am trying that TipoDeContentor.descricao (not id) be associated with Text.chvp (id). Is that possible?
When i store a TipoDeContentor object, there are no exceptions, and both classes are stored, but TipoDeContentor.descricao has no value and both IDs have the same key value.
What am i doing wrong?
Thanks in advance,
Joao Rangel
|