Iam having problem in joining two tables in hibernate using hbm.xml file.
When Iam joining result are appearing but the values are wrong for eg:
I have a table abc and xyz in the database
abc contains three
column
id userid date
1 1 20/01/2007
2 1 17/01/2007
3 2 20/01/2007
4 1 18/01/2007
5 3 20/01/2007
xyz contains three column
userid name
1 Liju
2 Thomas
following is the code i have written:
Following is result Iam getting:Code:<hibernate-mapping> <class name="com.abc" table="xyz" dynamic-insert="false" dynamic-update="false" > <id name="userid" column="USERID" type="long"> <generator class="sequence"> <param name="sequence">ABC_SEQ</param> </generator> </id> <property name="name" column="NAME" /> <join table="ABC" > <key> <column name="USERID" not-null="true"/> </key> <property name="id" column="ID" type="long" /> <property name="date" column="DATE" type="java.util.Date" /> </join> </class> </hibernate-mapping>
1 Liju 20/01/2007
2 Liju 20/01/2007
3 Thomas 20/01/2007
4 Liju 20/01/2007
Which is wrong (Look Dates which are same)


Reply With Quote
