Error: Could not find a getter for property 'id_operacion' in class 'OperCapacMantenedoresApp.Operacion'
Hola!
He buscado en la documentación pero no he encontrado la solución. Creo que tengo todos los archivos bien definidos.
Operacion.hbm.xml y hibernate.cfg.xml tienen Build Action =
"Embedded Resource".
¡Muchas gracias por sus sugerencias y comentarios!
NHibernate version: 1.2
Mapping documents:
Code:
hibernate.cfg.xml
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory name="OperCapacMantenedoresAppConfiguration">
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="connection.connection_string">server=srv;database=desarrollo;uid=sa;pwd=**</property>
<property name="show_sql">true</property>
<mapping assembly=
"OperCapacMantenedoresApp"/>
</session-factory>
</hibernate-configuration>
Code:
Operacion.hbm.xml
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns=
"urn:nhibernate-mapping-2.2" assembly=
"OperCapacMantenedoresApp" namespace=
"OperCapacMantenedoresApp">
<class name=
"Operacion" table=
"[desarrollo].[dbo].[OperCapac_Operaciones]">
<id name="id_operacion" column="id_operacion" type="int">
<generator class="assigned"/>
</id>
<property name="d_operacion" column="operacion" type="string"/>
</class>
</hibernate-mapping>
Code:
Operacion.cs
using...
namespace OperCapacMantenedoresApp {
public class Operacion {
private int id_operacion;
private string d_operacion;
public Operacion() { }
public
virtual int Id_operacion {
get { return id_operacion; }
set { id_operacion = value; }
}
public
virtual string D_Operacion {
get { return d_operacion; }
set { d_operacion = value; }
}
}
}
Full stack trace of any exception that occurs:
Could not find a getter for property 'id_operacion' in class 'OperCapacMantenedoresApp.Operacion'
at NHibernate.Property.BasicPropertyAccessor.GetGetter(Type type, String propertyName) at NHibernate.Tuple.PropertyFactory.GetGetter(Property mappingProperty) at NHibernate.Tuple.PropertyFactory.BuildIdentifierProperty(PersistentClass mappedEntity, IIdentifierGenerator generator) at NHibernate.Tuple.EntityMetamodel..ctor(PersistentClass persistentClass, ISessionFactoryImplementor sessionFactory) at NHibernate.Persister.Entity.AbstractEntityPersister..ctor(PersistentClass persistentClass, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory) at NHibernate.Persister.Entity.SingleTableEntityPersister..ctor(PersistentClass model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping mapping) at NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass model, ICacheConcurrencyStrategy cache, ISessionFactoryImplementor factory, IMapping cfg) at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings) at NHibernate.Cfg.Configuration.BuildSessionFactory() at OperCapacMantenedoresApp.ManOperaciones.Configuracion() in C:\Programas\NET\OperCapacDesktopApp\OperCapacMantenedoresApp\OperCapacMantenedoresApp\ManOperaciones.cs:line 40
Name and version of the database you are using:
SQL Sever 2005
(Pudieran estar relacionados:
http://jira.nhibernate.org/browse/NH-251
http://jira.nhibernate.org/browse/NH-134 )