-->
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.  [ 2 posts ] 
Author Message
 Post subject: Foreign generator
PostPosted: Sat Feb 24, 2007 2:43 am 
Newbie

Joined: Sat Apr 01, 2006 1:23 am
Posts: 14
Running latest NHibernate version.

If an obect A has a one-to-one with object B, and a new instance of B is created, B cannot be persisted to the database unless it has A as a fully initialized proxy.

This makes no sense, since really all it should need is the primary key from A, which doesn't require the proxy init.

Is this a known general Hibernate issue?

Neil


Top
 Profile  
 
 Post subject: I forgot to mention...
PostPosted: Sat Feb 24, 2007 2:45 am 
Newbie

Joined: Sat Apr 01, 2006 1:23 am
Posts: 14
B has a foreign key generator:

<id name="Id" column="Id" type="Int64" unsaved-value="-1">
<generator class="foreign">
<param name="property">ARef</param>
</generator>
</id>

which is the source of the trouble. It appears that the foreign key generator can't operate without a fully instantiated proxy on ARef.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.