Incorrect insertion while One to many mapping in hibernate?

Up vote 0 down vote favorite share g+ share fb share tw.

I am creating a job portal. I have two one to many relationship from job to city and from job to qualification table. I have following tables: Job (It is for saving job information) City (For saving job information) Qual (For saving qualifivation) JobQual (For saving one to many relationship from Job to Qualification table.

It has Job_kid column and Qual_kid column in it). JobCity (For saving one to many relationship from Job to City table. It has job_kid column and City_kid).

My job.hbm. Xml is : job_sequence While inserting any job, data in JobQual table is inserted successfully but insertion in JobCity table is not correct. My sequence is called two times while inserting job , means if I am inserting a single job in the database it is firstly calling job_sequence and get a number and insert it into JobCity table , after that again it is calling job_sequence and saves job data with the next id which is not same as in JobCity table.

Means job_kid in JobCity is one less then the kid of Job table, that's why it is not mapping properly. Why this is happening. Why my job_sequence is called two times?

Please help me hibernate link|improve this question asked Feb 15 at 15:47Durga Dutt347211 53% accept rate.

1 add to persistence. Xml property for more information. Need more information – user1143825 Feb 15 at 20:30.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions