-->
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: Orphan Child relationship causes UnresolvableObjectException
PostPosted: Mon Dec 12, 2005 12:20 pm 
Newbie

Joined: Mon Dec 12, 2005 11:41 am
Posts: 1
Hi,

I realize an equivalent topic to what I will ask has already been created here

http://forum.hibernate.org/viewtopic.ph ... texception

I also found some links this has perhaps been addressed, but this is in the context of JIRA so I do not understand whether this was addressed in JIRA or Hibernate:

http://jira.codehaus.org/browse/XPR-93; ... ge=history

Having said that, here is my problem - it is in data where other applications can remove parent from parent-child without nullifying the child foreign key, I cannot control that.

1) If parent row is deleted without nullifying child forein key to parent table (or deleting the child row), accessing the child causes exception:

Caused by: org.hibernate.UnresolvableObjectException: No row with the given identifier exists: [com.acompany.notifications.RecipientVO#34079]
at org.hibernate.UnresolvableObjectException.throwIfNull(UnresolvableObjectException.java:42)
at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:601)

2) In the hbm.xml, there is many-to-one defined

<many-to-one name="recipient" class="com.acompany.notifications.RecipientVO" column="ALRUS2MG_USERS_KEY" />

3) I realize this situation does represent "broken mapping".

My Question) I wonder if there is any way in the hbm.xml to define the parent "optional" in the mapping.

As a note, I thought lazy=false may help but there is an unrelated issue with it in the context of this application.

Thanks Milan


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.