Hibernate version:
hibernate-3.0.5
Hello,
I am looking for best practices when joining multiple tables in hibernate.
For instance, I would like to covert the following sql into a pojo called ProductInfo which takes the x.Data and x.ID as args.
Code:
select new x.DATA, x.ID from CONTENTINSTANCE ci, CONTENTTYPE ct, CONTENTINSTANCEREVISION cir, XMLDATA x WHERE ci.CONTENTTYPEID = ct.ID AND cir.CONTENTINSTANCEID = ci.ID AND cir.ID = x.ID AND ct.NAME = 'product'
My high level questions are:
Do I implement pojos for each table?
Is joining the optimal (least round trips to db) way to approach this?
Can I just make a pojo ProductInfo with Data and Id and do all the other join tables under the covers in my mapping doc?
Thanks in Advance.
C:\>