Hi everyone,

I got stuck on my implementation using composite user type Instant:

public class InstantUserType : ICompositeUserType
{
    public override string[] PropertyNames
    {
        get
        {
            return new string[2] { "Utc", "Local" };
        }
    }

    public override IType[] PropertyTypes
    {
        get
        {
            return new IType[2] { NHibernateUtil.UtcDateTime, 
NHibernateUtil.DateTime };
        }
    }

    public override Type ReturnedClass
    {
        get
        {
            return typeof(Instant);
        }
    }
}

This it strange because when I use comparison like:

var dueDate = new Instant(DateTime.UtcNow);
var result = ((IQueryable)myRepository).Where(x => x.DueDate <= dueDate
).ToList();

the generated query looks like:

select * from SomeTable where DueDateUtc <= @p0 and DueDateLocal <= @p0

Does anyone know what can I do to prevent NHibernate from searching by the 
second parameter. It must be like:

select * from SomeTable where DueDateUtc <= @p0


Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to