Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with one to many relationship  RSS feed

Prem Jain
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am implementing JPA hibernate simple application using one to many relationship.

Relation ship is Comapny (1)----------- Department(*) is as follow : is as follow : is follow

What I am doing is , I am adding new department to existing company. After execution above code

Table created are :
1. Company table with id and name
2. Department table with deptId , deptName , compId.

so at the time adding department , it does not threw any exception but updates records in department as
1(Id),Development(DeptName),null(compId) .

I am not getting why it is not updating compId column. Please help.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!