Hello Ravindra,
Person -> Telephone , it is one to many relation ship. I am assuming you have 2 tables. Persons & Telephones. Now for the given person you need to display the telephone numbers. So it needs to be a collection in Person entity . (<set> can be used.)
Also the hql query needs correction.
person.phno-> phone.id
so from the record phone.id , you need to display phone.phno.
select p.id,p.name,ph.no from person p inner join phone ph where p.id=ph.pd and p.id=1;
Also 3578 is the phone number of the identifier 1 of phone. So table design is important.
_________________
Cheers! Shynate mailto:shynate26@gmail.com www.CSSCORP.com
|