-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: question on composite id ans query
PostPosted: Fri Jul 22, 2005 8:43 pm 
Newbie

Joined: Fri May 06, 2005 5:11 pm
Posts: 14
Location: San Francisco
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.