No one to help :( :(
i was working with it... and then used the follwoing HQL:
select distinct prod from Trade trade inner join trade.product prod inner join prod.voyage voy where voy.resShipId=:resShipId and voy.resDepartDate >= sysdate and prod.resType=:resType and trade.resTradeId=:tradeId
Ofcourse it is returning me what i wanted, but in Product object I am getting the map of the entire voyage list and condition voy.resDepartDate >= sysdate is not satisfied.
sanjib wrote:
I am using bidirectional mapping. Each Trade object has a Map of product and each Product object has a Map of voyage. Product has a many to one association with Trade and Voyage has many to one with Product.
I am looking forward to change the following SQL query to HQL:
select * from trade t,product p,voyage v where t.trade_id=p.trade_id and p.itinerary_code=v.itinerary_code and t.trade_id='T1' and p.type='P1' and v.ship_id='SP'
Pls help.