The problem is that the NHibernate is returning YesNoType when it have
to return BooleanType on the NHibernateUtil...

If you look at the static constructor, you will see these lines:

FieldInfo[] fields = typeof(NHibernateUtil).GetFields();

foreach (FieldInfo info in fields)
{
        if (typeof(IType).IsAssignableFrom(info.FieldType) == false)
                continue;

        IType type = (IType)info.GetValue(null);

        clrTypeToNHibernateType[type.ReturnedClass] = type;
}

And if you execute this code with debug, you will see that the
BooleanType is overwrited by the YesNoType because these two classes
return the same value on ReturnClass that is
System.Boolean, so or there is a problem with the nhibernate or just
the BooleanType need to get removed from the NHUtils... :)

If anyone has some solution just give me a shout... :D


On 17 dez, 21:56, Daniel Alves <[email protected]> wrote:
> The table of the database...
>
> CREATE TABLE pessoa
> (
>   id bigserial NOT NULL,
>   data_registro timestamp without time zone NOT NULL,
>   deletado boolean NOT NULL,
>   documento character varying(14) NOT NULL,
>   nome character varying(80) NOT NULL,
>   homepage character varying(120),
>   email character varying(100),
>   end_logradouro character varying(80) NOT NULL,
>   end_lote character varying(10) NOT NULL,
>   end_quadra character varying(10) NOT NULL,
>   end_numero character varying(10),
>   end_edificio character varying(80),
>   end_sala_apto character varying(10),
>   end_complemento character varying(80),
>   end_setor character varying(80) NOT NULL,
>   end_cidade character varying(80) NOT NULL,
>   end_estado character varying(2) NOT NULL,
>   end_cep character varying(9) NOT NULL,
>   end_referencia character varying(255),
>   CONSTRAINT pessoa_pkey PRIMARY KEY (id),
>   CONSTRAINT pessoa_documento_key UNIQUE (documento)
> )
> WITH (OIDS=FALSE);
> ALTER TABLE pessoa OWNER TO sisimob;
>
> On 17 dez, 21:54, Daniel Alves <[email protected]> wrote:
>
> > Someone already had this error when executing a query using the
> > DetachedCriteria API?
>
> > I think that all configuration is right... but for some weird reason
> > when I had needed to convert my hql to a more flexible way, using a
> > detached query it just doesn't work anymore...
>
> > The mapping property:
>
> >                 <property name="Deleted" access="nosetter.camelcase"
> > column="deletado" not-null="true"  insert="true" update="true" />
>
> > The property:
> >                 /// <summary>
> >                 /// Gets or sets a value indicating whether this <see 
> > cref="Pessoa"/> is deleted.
>
> >                 /// </summary>
> >                 /// <value><c>true</c> if deleted; otherwise, 
> > <c>false</c>.</value>
> >                 public virtual bool Deleted
> >                 {
> >                         get { return deleted; }
> >                 }
>
> > My server is a postgres 8.3 using the 8.2 dialect with nhibernate
> > 2.0...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to