Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate not loading associated collection

 
surya sudhakar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two tables called proj and proj_team_member. The persistant classes for these two are Project and ProjectTeam. There is an association between the two tables. A project can have multiple team members.
The table proj_team_member has a composite primary key on columns proj_id, role_id and person_pin
This is how I have implemented the bi-directional navigation.


I have created a Set in the Project to hold the collection of ProjectTeam objects. And the ProjectTeam has a reference to Project


Here are the mappings of the persistance classes


When I am trying to get load a ProjectTeam using a person_pin I am able to load the ProjectTeam object, with this I am able to navigate to Project object also to see the project details.

The problem is with the loading the Project like below



I am able to get the project detail, but it is not loading the Set of ProjectTeam rows(object), though I have a team for the project. The list size is coming as zero.

Could somebody please let me know where the mistake is? I am seeing in the Hibernate log that the collection is being loaded

---------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------

Any help in resolving this will be greatly appreciated.

Thanks,
Sudhakar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic