Thanks a lot for your reply.But the problem was solved the same day i posted it.
But i am now facing some different challenge.
It will be really nice if you can help with that.
I want to know how can we map 3 tables (with many-to-many relationship) in hibernate.
I have 3 tables :
AssignedMarketStrategy having productId as well as MarketStrategyId but also some extra columns.
Which means i need to have a separate class for the AssignedMarketStrategy table and a mapping file too.
I am not getting what changes i need to make to my product.hbm.xml.
Also how to proceed further with 3 classes having many-to-many relationship.
I searched the net but was unable to find useful content.
Can you ( or anyone) please suggest me a link which may have tutorial of this kind?
If your many-to-many relation table (AssignedMarketStrategy) also contains extra columns then you need to treat your AssigneMarketStrategy as a separate object that it will have a Product and a MarketStrategy. Also each Product and Market_strategy will have a list of AssignedMarketStrategy:
What made you solved the ClassCastException. Did you tried to cast query.list() to ArrayList or something ? If you have asked some question here and it got solved plese tell us how you did it. It would be helpful for many.
where Product is my class having product details and custSet is a HashSet in that class.
I did this because i had was supposed to show all products for logged in customer.
In database i had a third table having primary keys of both Product and Customer.
Same was mapped in my .hbm file.