hi guys
this must be simple, but i am new to this filed.
This is my xml file in hibernate
<hibernate-mapping>
<class name="com.aoc.judiciary.framework.ValueObjects.TestVO" table="FMT_CASEADR">
<id name="userId" column="ATTYID">
<generator class="native"/>
</id>
<property name="ssn" column="ATTYCASESEQNO"/>
<property name="name" column="ATTYCASESTREET"/>
</class>
<sql-query name="getParties">
<return alias="ResultSet" class="com.aoc.judiciary.framework.ValueObjects.TestVO"/>
Select * from DBWD.FMT_CASEADR WHERE ATTYID = ?
</sql-query>
</hibernate-mapping>
+++++++++++++++++++++++
Now Inside TestVO , i have only the userId field like this
public class TestVO
{
private
String userId;
setuserId(), getuserId() methods
private TestReturnVO trvo; //i have another class in which i want to store the results
setTrvo() ; getTrvo() methods
}
+++++++++++++++++++++++++++++
Class TestReturnVO contains
private String ssn;
private String name;
and set() and get() for both the fields
+++++++++++++++++++++++++
Now based on the above scenario , can i modify my above xml like this:
<hibernate-mapping>
<class name="com.aoc.judiciary.framework.ValueObjects.TestVO" table="FMT_CASEADR">
<id name="userId" column="ATTYID">
<generator class="native"/>
</id>
<property name="trvo.ssn" column="ATTYCASESEQNO"/> // CHANGED to trvo.ssn
<property name="trvo.name" column="ATTYCASESTREET"/> // CHANGED to trvo.name
</class>
<sql-query name="getParties">
<return alias="ResultSet" class="com.aoc.judiciary.framework.ValueObjects.TestVO"/>
Select * from DBWD.FMT_CASEADR WHERE ATTYID = ?
</sql-query>
</hibernate-mapping>
Basically , i want to store the values from the table in a subclass object(TestReturnVO trvo)
the above code is not working and i have no idea why. any help would be greatly appreciated
thanks
Jay