• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Null populated in parent entity

 
nitin pai
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Hibernate3 and Spring 2. There are 2 entities Employee and Dept as follows:







My Dao contains:




When the createEmployee() is called from my Test class, a new record gets created in Employee as well as Dept table, but however the composite foreign key inside Employee is populated with NULL (i.e proj_cd and dept_name). I am sure some mapping needs to be done but could not figure out where.

Should we also put in foreign keys inside our mapped POJO's?
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the mapping files and the entity creation code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic