-->
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: Problem with association criteria and key-many-to-one
PostPosted: Mon Oct 03, 2005 1:38 pm 
Newbie

Joined: Thu Jun 30, 2005 6:36 am
Posts: 4
Hi everybody,
I have the following mapping files:

<class name="Sucursal" table="Sucursales" lazy="true" >
<composite-id>
<key-property name="Oficina" column="codigo" />
<key-many-to-one name="Banco" column="entidad" class="Banco" />
</composite-id>
....
</class>

<class name="Banco" table="Entidades" lazy="true" >
<id name="Codigo" column="codigo" >
<generator class="native"/>
</id>
<property name="Nombre" column="entidad" />

<set name="Oficinas" lazy="true" inverse="true" outer-join="false">
<key column="entidad" />
<one-to-many class="Sucursal" />
</set>

</class>


When I try to use association criteria i have this exception:

[ADOException: Unable to perform find]
NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria) in E:\Proyectos\NHibernate-0.99-rc2\Impl\SessionImpl.cs:4768
NHibernate.Impl.CriteriaImpl.List() in E:\Proyectos\NHibernate-0.99-rc2\Impl\CriteriaImpl.cs:262
trozosarco.IntroducirVisita.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\trozosarco\comerciales\IntroducirVisita.aspx.vb:71
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750


The code is this:


criterio = nhSession.CreateCriteria(GetType(Sucursal))
criterio.CreateCriteria("Banco").Add(Expression.Eq("Codigo", banco))
criterio.List()


Thanks !!!


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.