Hi, Can anybody please explain me how data can be obtained using Hibernate3 if I have 2 tables mapped to 2 separate DTOs. I am already making queries to these two tables separately. But now I have a query that joins these 2 tables.
Probably, use of Collection object will help you. Suppose, you have two DTO ProductDTO and OrderDTO. Then in DAO, after database query, populate the data for these two DTO and store them in Collection Object and return one Collection object(may be ArrayList/HashSet) which have both DTOs to the caller and caller will extract the data from collection->DTO.
Hi guys, May be I was not clear on my question. If I have a query like ' from OneDTO as one, TwoDTO as two where one.id=two.key(+) i.e.,an outer join with + sign, is not working in HIbernate3. It used to work in Hibernate 2.1. It says unexpected token '+'. How do I replace this (+). Thanks, Sai
I tried the following way by avoiding + sign: ' from OneDTO as one left outer join TwoDTO as two where one.id=two.key'. But it gave the Exception as 'Path expected for join!'. I found that my two tables do not have exact PK-FK relationship. Is there a way out. Thanks, Sai
Hi Rashid, I am not using any composite id, but one.id is not a PK in one table and two.key is not a PK in two table. I am trying to fetch name of a person which is in the second table against loginId which is there in both tables.