Hello,
I have a question about composite id. I used middlegen to generate the hbm and java file.
I have three tables with below relationship:
profile_skill: profile_skill_id_no, skill_skill_id_no (both primary keys)
skill: skill_id_no (prim key)
lob_skill: lob_lob_id_no, skill_skill_id_no (both prim keys)
profile_skill.skill_skill_id_no references to skill.skill_id_no
lob_skill.skill_skill_id_no references to skill.skill_id_no
profile_skill: has composite id as lob_profile_id_no and skill_skill_id_no
lob_skill : has composite id as lob_lob_id_no and skill_skill_id_no
I need to write a query to get row value back from profile_skill and here is my query:
from ProfileSkillEntity as profileSkill
where profileSkill.comp_id.lobProfileIdNo = ? and profileSkill.comp_id.skillSkillIdNo = ?
I get below error:
org.springframework.orm.hibernate.HibernateSystemException: More than one row with the given identifier was found: 1365, for class: com.rhi.domain.common.data.hibernate.web.LobSkillEntity; nested exception is net.sf.hibernate.HibernateException: More than one row with the given identifier was found: 1365, for class: com.rhi.domain.common.data.hibernate.web.LobSkillEntity
net.sf.hibernate.HibernateException: More than one row with the given identifier was found: 1365, for class: com.rhi.domain.common.data.hibernate.web.LobSkillEntity
I spent all day trying to resolve the problem and couldn't. Could anyone please kindly help?
Thank you very much.
Best regards,
Sahra
|