Gracias José

En nombre de nuestro compañero nuevo, estuve googleando el fin de semana en
busca del error

Message="Association references unmapped class:
SAI.NH.BL.Contabilidad"

y todo apuntaba a la solución que diste, bueno todos los días se aprende una
cosa


Saludos

Edgar

El 31 de enero de 2011 11:36, José F. Romaniello
<[email protected]>escribió:

> Viejo, dos cosas; lo primero es que te dije que respondieras en el foro no
> a mi mail privado.
>
> Lo segundo como diría mi jermu... "a seguro se lo llevaron preso"
>
> [image: 2011-01-31_1333.png]
>
>
> Qué dije yo?
>
> Puede que el mapeo de contabilidad no este como embedded resource, o
>
> que la extension no termine en ".hbm.xml"?
>
>
> Qué respondiste vos?
>
>  pues aunque no lo creas... si esta en embedded *y terminan todos con*
>
> *hbm.xml*
>
>
> Próxima vez, revisar dos veces las cosas que parezcan mas obvias.
>
>
>
>
> El 31 de enero de 2011 13:29, xhino <[email protected]> escribió:
>
>> Viejo te mando compartir por medio de google docs
>>
>> saludos
>>
>>
>> On 29 ene, 05:08, José F. Romaniello <[email protected]> wrote:
>> > se me quemaron los libros.... me parece que esta todo bien.
>> > Si pudieras poner un zip en algún lado no tengo problemas de verlo y
>> decirte
>> > que esta mal.
>> >
>> > 2011/1/29 xhino <[email protected]>
>>
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > > Oka ahi te mando todo el codigo que tengo
>> >
>> > > Entidad.cs
>> > > =======================
>> > > using System;
>> > > using System.Collections.Generic;
>> > > using System.Linq;
>> > > using System.Text;
>> >
>> > > namespace SAI.NH.BL
>> > > {
>> > >    public abstract class Entidad<TId>
>> > >    {
>> > >        public virtual TId Id { get; protected set; }
>> > >    }
>> > > }
>> >
>> > > Alumno.cs
>> > > ==================================
>> > > using System;
>> > > using System.Collections.Generic;
>> > > using System.Linq;
>> > > using System.Text;
>> >
>> > > namespace SAI.NH.BL
>> > > {
>> > >    public class Alumno : Entidad
>> > >    {
>> > >        public virtual string Matricula { get; set; }
>> > >        public virtual string Paterno { get; set; }
>> > >        public virtual string Materno { get; set; }
>> > >        public virtual string Nombre { get; set; }
>> > >        public virtual IList<Contabilidad> Cuenta { get; set; }
>> > >    }
>> > > }
>> >
>> > > Alumno.hbm.xml
>> > > ================================================
>> > > <?xml version="1.0" encoding="utf-8" ?>
>> > > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
>> > > assembly="SAI.NH.BL" namespace="SAI.NH.BL">
>> > >   <class name="Alumno">
>> > >    <id name="Id">
>> > >      <generator class="guid.comb" />
>> > >    </id>
>> > >    <natural-id mutable="true">
>> > >      <property name="Matricula" not-null="true" />
>> > >    </natural-id>
>> > >    <property name="Paterno" />
>> > >    <property name="Materno" />
>> > >    <property name="Nombre" />
>> > >    <bag name="Cuenta" cascade="all-delete-orphan>
>> > >        <key column="AlumnoId" />
>> > >       <one-to-may class="Contabilidad" />
>> > >    </bag>
>> > >  </class>
>> > > </hibernate-mapping>
>> >
>> > > Contabilidad.cs
>> > > =====================================
>> > > using System;
>> > > using System.Collections.Generic;
>> > > using System.Linq;
>> > > using System.Text;
>> >
>> > > namespace SAI.NH.BL
>> > > {
>> > >     public class Contabilidad : Entidad
>> > >    {
>> > >        public int NoCuenta { get; set; }
>> > >        public int JDE { get; set; }
>> > >        public int Hora { get; set; }
>> > >        public int Importe { get; set; }
>> > >    }
>> > > }
>> >
>> > > Contabilidad.hbm.xml
>> > > ==========================================
>> > > <?xml version="1.0" encoding="utf-8" ?>
>> > > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
>> > > assembly="SAI.NH.BL" namespace="SAI.NH.BL">
>> > >   <class name="Contabilidad">
>> > >    <id name="Id">
>> > >      <generator class="guid.comb" />
>> > >    </id>
>> > >    <natural-id mutable="true">
>> > >      <property name="NoCuenta" not-null="true" />
>> > >    </natural-id>
>> > >    <property name="JDE" />
>> > >    <property name="Hora" />
>> > >    <property name="Importe" />
>> > >  </class>
>> > > </hibernate-mapping>
>> >
>> > > App.config
>> > > ==================================================================
>> > > <configuration>
>> > >  <connectionStrings>
>> > >    <add name="db" connectionString="Data Source="servidor";Initial
>> > > Catalog=SAI;Integrated Security=SSPI;"/>
>> > >  </connectionStrings>
>> > > </configuration>
>> >
>> > > hibernate.cfg.xml
>> > > =================================================================
>> > > <?xml version="1.0" encoding="utf-8" ?>
>> > > <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
>> > >  <session-factory>
>> > >    <property name="proxyfactory.factory_class">
>> > >      NHibernate.ByteCode.Castle.ProxyFactoryFactory,
>> > > NHibernate.ByteCode.Castle
>> > >    </property>
>> > >    <property name="dialect">NHibernate.Dialect.MsSql2005Dialect,
>> > > NHibernate</property>
>> > >    <property name="connection.connection_string_name">db</property>
>> > >    <property name="adonet.batch_size">100</property>
>> > >    <mapping assembly="SAI.NH.BL" />
>> > >   </session-factory>
>> > > </hibernate-configuration>
>> >
>> > > Form1
>> > > =========================================================
>> > > using System;
>> > > using System.Collections.Generic;
>> > > using System.ComponentModel;
>> > > using System.Data;
>> > > using System.Drawing;
>> > > using System.Linq;
>> > > using System.Text;
>> > > using System.Windows.Forms;
>> > > using NHibernate.Cfg;
>> >
>> > > namespace SystemSAI
>> > > {
>> > >    public partial class Form1 : Form
>> > >    {
>> > >        public Form1()
>> > >        {
>> > >            InitializeComponent();
>> > >            var nhConfig = new Configuration().Configure();
>> > >            var sessionFactory = nhConfig.BuildSessionFactory();
>> > >            MessageBox.Show("NHibernate ON");
>> > >        }
>> > >    }
>> > > }
>> >
>> > > saludos
>> >
>> > > --
>> > > Para escribir al Grupo, hágalo a esta dirección:
>> > > [email protected]
>> > > Para más, visite:http://groups.google.com/group/NHibernate-Hispano
>>
>
>  --
> Para escribir al Grupo, hágalo a esta dirección:
> [email protected]
> Para más, visite: http://groups.google.com/group/NHibernate-Hispano
>

-- 
Para escribir al Grupo, hágalo a esta dirección: 
[email protected]
Para más, visite: http://groups.google.com/group/NHibernate-Hispano

Responder a