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: session.load and one-to-many list
PostPosted: Wed Apr 02, 2008 4:15 pm 
Newbie

Joined: Wed Apr 02, 2008 4:09 pm
Posts: 1
I need help, please!!!

When I use session.load, the nhibernate don“t give me the list of relationship of object, see:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Model.Area, Model" table="TAB_X_AREA">
<id name="Codigo" column="AREA_COD" type="String" length="5">
<generator class="assigned" />
</id>
<property name="Descricao" column= "AREA_DESCRICAO" type="String" length="50"/>
<property name="Ativa" column="AREA_ATIVA" type="String" length="1"/>

<set
name="ListaEquipamentos"
inverse="false"
lazy="false">
<key column="AREA_COD"/>
<one-to-many class="Model.Equipamento.Equipamento, Model"/>
</set>

</class>
</hibernate-mapping>


<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Model.Equipamento.Equipamento, Model" table="TAB_X_EQUIPAMENTO">
<id name="Codigo" column="EQUIPAMENTO_COD" type="String" length="5">
<generator class="assigned" />
</id>
<property name="Preco" column="EQUIPAMENTO_PRECO" type="double" length="20"/>
<property name="DataCompra" column="EQUIPAMENTO_DATA_COMPRA" type="datetime" length="20"/>
<property name="Quantidade" column="EQUIPAMENTO_QUANTIDADE" type="int" length="20"/>

<many-to-one
name="Area"
lazy="false"
column="AREA_COD"
class="Model.Area, Model"/>

</class>
</hibernate-mapping>

Area a = new Area();
gSessao.Load(a, asCodigoChavePrimaria);

The list of Equipamento in object a, its not fill!!!

_________________
brazil!!!mg!!contagem!


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.