Hi all,
I'm using the following hbm to define a class with entity-name "TestComponentNoPOJO" without actual POJO -
<hibernate-mapping> <class table="TestComponentNoPOJO" entity-name="TestComponentNoPOJO"> <id name="id" type="int"> <column name="id"/> <generator class="identity"/> </id> <property name="name" type="string" length="30" column="name" not-null="true"/> <one-to-one name="parent" class="TestWithPojo" property-ref="nopojoComponent"/> </class> </hibernate-mapping>
and using the following to specify an one-to-one mapping from another class "TestWithPojo" with an POJO class to above class -
<hibernate-mapping> <class table="TestWithPojo" name="TestWithPojo"> <id name="id" type="int"> <column name="id"/> <generator class="identity"/> </id> <property name="name" type="string" length="30" column="name" not-null="true"/> <many-to-one name="nopojoComponent" column="nopojoComponentId" entity-name="TestComponentNoPOJO" cascade="all"/> </class> </hibernate-mapping>
now, I'm stuck at how to define field nopojoComponent in TestWithPojo.java since there is no TestComponentNoPOJO.java, I tried to use Map but didn't work. Any suggestions are greatly appreciated.
Jon
|