Hi, All,
I am new to hibernate. Please help with my problem and I will appreciate it a lot. Thanks.
I have 3 tables in database, property, address and loan. In property table, there are 3 columns: propertyID, addressID and loanID; In address table, there are 3 columns: AddressID, street, citystatezip; In loan table, there are 3 columns: loanID, propertyID, and currentBalance.
in my class loan, i have datamembers as follow: loanID, currentBalance, street, citystatezip.I can simply map currentBalance from the database like following: <hibernate-mapping package="mytest.package"> <class name="loan" table="loan"> <cache usage="read-only"/> <id name="loanID" type="long" unsaved-value="-1"> <column name="loanID" sql-type="long" not-null="true"/> <generator class="assigned"/> </id> <property column="currentBalance" name="currentBalance" not-null="false" type="long"/> </class> </hibernate-mapping> However, i can not get the property address info like street and citystatezip since they are in different tables.
Could anyone please give me some suggestion? Thank you very much!!
|