-->
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: association from the table refers to an unmapped class:Int32
PostPosted: Thu Apr 19, 2007 7:49 pm 
Newbie

Joined: Thu Apr 19, 2007 7:37 pm
Posts: 2
Hi, I have a problem...

Version: Nhibernate 1.2.0.CR2


"An association from the table Oficio refers to an unmapped class: Int32"

oficio.hbm.xml


<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Agenda" namespace="Agenda">
<class name="Oficio" table="Oficio">
<id name="IdOficio" column="IdOficio" type="Int32" unsaved-value="0">
<generator class="identity"/>
</id>
<property name="Oficio" column="Oficio" type="String" length="50"/>
<property name="Fecha" column="Fecha" type="DateTime"/>
<property name="Importe" column="Importe" type="Decimal"/>
<property name="Juzgado" column="Juzgado" type="String" length="50"/>
<property name="Abogado" column="Abogado" type="String" length="50"/>
<property name="Obs" column="Obs" type="String" length="255"/>
<many-to-one name="IdMovimiento" column="IdMovimiento" cascade="all"/>
</class>
</hibernate-mapping>

Movimiento.hbm.xml

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Agenda" namespace="Agenda">
<class name="Movimiento" table="Movimiento">
<id name="IdMovimiento" column="IdMovimiento" type="Int32" unsaved-value="0">
<generator class="identity"/>
</id>
<property name="Numero" column="Numero" type="String" length="10"/>
<many-to-one name="IdCliente" column="IdCliente" cascade="all"/>
</class>
</hibernate-mapping>


Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 20, 2007 2:46 am 
Senior
Senior

Joined: Mon Aug 21, 2006 9:18 am
Posts: 179
Change this bit within your Oficio mapping:
Code:
<many-to-one name="IdMovimiento" column="IdMovimiento" cascade="all"/>


To this:
Code:
<many-to-one name="IdMovimiento" class="Movimiento"
column="IdMovimiento" cascade="all"/>


NHib will try to find a class with the type you specify in the 'name' attribute if you don't explicitly specify the 'class' attribute. Since you don't have a type of IdMovimiento, NHib can't figiure out what you are trying to do.

Hope this helps
MIKE

_________________
If this helped...please remember to rate it!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 20, 2007 5:45 pm 
Newbie

Joined: Thu Apr 19, 2007 7:37 pm
Posts: 2
Thanks Mike, is working...


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.