So... a nullable field is part of your key??

    Diego


On Mon, Aug 16, 2010 at 12:20, Mujahid Ali <[email protected]> wrote:

> This sql is generated when doing a Session Load  or Session.Update; I
> have simplified the generated query so that we can focus on the where
> clause;
>
> Here is the mapping for the class:
>
> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="XXXX"
> namespace="XXXX">
>    <class name="CurrencyMapping" table="CURRENCY_TBL">
>        <cache usage="read-write" region="default_write"/>
>        <composite-id>
>            <key-property name="FromCurrencyCode" column="FROM_CUR" />
>            <key-property name="ToCurrencyCode" column="TO_CUR" />
>            <key-property name="EffectiveDate" column="EFFDT"
> type="timestamp"/>
>        </composite-id>
>        <property name="Status" column="EFF_STATUS"/>
>    </class>
> </hibernate-mapping>
>
>
> -Mujahid
>
>
> On Aug 16, 10:45 am, Diego Mijelshon <[email protected]> wrote:
> > How are you doing the query? HQL, Criteria...?
> >
> >     Diego
> >
> >
> >
> > On Mon, Aug 16, 2010 at 10:28, Mujahid Ali <[email protected]>
> wrote:
> > > I am using nHibernate 2.1.2 with SQL Server 2008.
> >
> > > ANSI_NULLS setting is turned on. I have a table with a 3 part
> > > composite key. If a part of this key is null, nHibernate does the null
> > > check using "=" instead of  "IS NULL".
> >
> > > As an example:
> >
> > > SELECT * from CURRENCY_TBL  WHERE  FROM_CUR = 'USD'  AND TO_CUR =
> > > 'EUR'  AND EFFDT = NULL
> >
> > > which doesn't return any results where EFFDT is null;
> >
> > > Instead, this query correctly returns results:
> >
> > > SELECT * from CURRENCY_TBL  WHERE  FROM_CUR = 'USD'  AND TO_CUR =
> > > 'EUR'  AND EFFDT  IS NULL
> >
> > > So, knowing that ANSI_NULLS is turned ON, how can I configure
> > > nHibernate to generate the null check using "IS NULL" vs  " = NULL" ?
> >
> > > Thanks,
> > > Mujahid
> >
> > > --
> > > 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]<nhusers%[email protected]>
> <nhusers%[email protected]<nhusers%[email protected]>>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/nhusers?hl=en.
>
> --
> 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]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>

-- 
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