-->
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: Many-to-One issues
PostPosted: Wed Nov 10, 2004 3:13 pm 
Newbie

Joined: Fri Nov 05, 2004 11:09 am
Posts: 6
Hi

I have 2 tables in the schema, say User and Address, where User has addessID in the table.
The user can have none or multiple addessess.
I am using many-to-one relation in the Address class as follows:
<many-to-one
name="user"
class="User"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="ADDRESSID"
unique="true"
/>

But when I am running the test, it runs successfully if there is a corresponding addressID in the User table, but throws the following error if there is no corresponding addressID in the User table:

[junit] No row with the given identifier exists: 0, of class: User; nested exception is net.sf.hibernate.UnresolvableObjectException: No row with the given identifier exists: 0, of class: User

[junit] org.springframework.orm.hibernate.HibernateObjectRetrievalFailureException: No row with the given identifier exists: 0, of class: User; nested exception is net.sf.hibernate.UnresolvableObjectException: No row with the given identifier exists: 0, of class: User

Any suggestions on what may be the solution for this, would appreciate ay help.

Thank you


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.