2011/3/2 Gustavo Garcia <[email protected]> > Hola Lista, > > A ver si me pueden ayudar con este error, que llevo ya un par de horas > analizandolo... > > Tengo una clase muy normal llamada "AdServer", que tiene varias > propiedades, entre ellas una llamada "SyncAt" (Nullable<DateTime>). > > Quiero ejecutar el siguiente código: > session.CreateQuery("from AdServer where Id = :id").SetInt32("id", > id).List<AdServer>(); > > Y me arroja el siguiente error: > > System.Data.SqlClient.SqlException: El nombre de columna 'SyncAt' no es > válido. > > Si le borro la propiedad, la consulta se ejecuta sin problemas. > > > La clase es la siguiente: > > public class AdServer > { > public virtual int Id { get; private set; } > public virtual string Name { get; set; } > public virtual string ContactName { get; set; } > public virtual string ContactEmail { get; set; } > public virtual string Platform { get; set; } > public virtual string ApiUrl { get; set; } > public virtual int SyncPeriod { get; set; } // in minutes > public virtual Nullable<DateTime> SyncAt { get; set; } > public virtual int Status { get; set; } > } > > Y el mapping es el siguiente: > > <?xml version="1.0" encoding="utf-8" ?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Model" > namespace="Model"> > > <class name="AdServer" table="[AdServer]"> > <id name="Id" column="Id" type="Int32" unsaved-value="0"> > <generator class="native"></generator> > </id> > <property name="Name" column="Name" type="string" length="100" > not-null="false"></property> > <property name="ContactName" column="ContactName" type="string" > length="100" not-null="false"></property> > <property name="ContactEmail" column="ContactEmail" type="string" > length="100" not-null="false"></property> > <property name="Platform" column="Platform" type="string" length="100" > not-null="false"></property> > <property name="ApiUrl" column="ApiUrl" type="string" length="255" > not-null="false"></property> > <property name="SyncPeriod" column="SyncPeriod" type="Int32" > not-null="false"></property> > <property name="SyncAt" column="SyncAt" type="datetime" > not-null="false"></property> > <property name="Status" column="Status" type="Int32" > not-null="false"></property> > </class> > </hibernate-mapping> > > > Gracias de antemano > > -- > Para escribir al Grupo, hágalo a esta dirección: > [email protected] > Para más, visite: http://groups.google.com/group/NHibernate-Hispano
-- Fabio Maulo -- Para escribir al Grupo, hágalo a esta dirección: [email protected] Para más, visite: http://groups.google.com/group/NHibernate-Hispano
