Hi
I am having two tables. 1) Person (personid varchar2(10), name varchar2(10), contact number(2)) 2) Address (addressid number(2), description varchar2(10))
Java Pojo Objects
Person { String personId; String name; Address contactInfo (this is for contact column)
public getContactInfo() {} }
Address { int addressId; String description; }
Note: Person(contact) and Address(addressid) are foreignkey relation Note: Please notice those column names are different.
How to make ONE to ONE annotation for these tables and How to fetch Address object row when we get Person object like
person.getContactInfo().getAddressId();
Please suggest proper annotation and a java example.
Thanks Rao
|