-->
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.  [ 3 posts ] 
Author Message
 Post subject: Avoid error (casc)"No row with the given identifier exi
PostPosted: Thu Nov 09, 2006 6:00 am 
Beginner
Beginner

Joined: Thu Oct 19, 2006 1:03 pm
Posts: 29
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
1.2 Beta

Mapping documents:
Multiple persistent classes mapped together with ISet (C#) and the set-tag in the mapping xml files over multiple relational database tables with foreign key constraints.

Code between sessionFactory.openSession() and session.close():
Getting a unique user.

Any exception that occurs:
No row with the given identifier exists: 28f24a04-35b5-4e11-a3de-64dfdb791c18, of class: Profile

Profile is a property of the User class.

Anyhow... I want to know how to effectively deal with databases where you got multiple objects in 'table one', each row representing one object, but you also got multiple other tables representing other functionality and/or properties for the objects in table one.

Now... Not all tables' foreign key columns will be populated with the key of the object in 'table one', because I choose not to implement all the extensions/properties to the objects in table one. This means that if NHibernate is asked to delete an object from table one, like such:
Code:
orpSession.Delete(tableOneObject);
, it cascades and NHibernate starts looking for the object's primary key as foreign keys in the other tables, even though there is no data in these tables.

So how do I make NHibernate understand, that even if there are no matching foreign keys in the other tables of the object I am deleting from table one, it should throw no exception and shouldn't expect to actually find the keys of the object in the other database tables?

Also, I'd rather let the database take care of the cascading work, but when the database is generated from NHibernate.Tool.hbm2ddl.SchemaExport, the foreign key constraints necessary for the database's cascading should be generated. How do I accomplish this?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 09, 2006 6:03 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Your problem may be related to this one:
http://forum.hibernate.org/viewtopic.php?t=967030&start=0&postdays=0&postorder=asc&highlight=


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 09, 2006 6:08 am 
Beginner
Beginner

Joined: Thu Oct 19, 2006 1:03 pm
Posts: 29
sergey wrote:


Yes, probably. My collections are also lazy-loaded and may be one-to-none as he describes... So I have to wait a couple of days then?

Nothing else to do?


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

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.