I just started using NHibernate and Fluent NHibernate using ODP.NET
instant client for Oracle 11g.
The problem is that my connection to the database is case sensitive
and the sql generated for some Linq queries are using different case
when comparing a "constant" expression.
This is my Linq query:
_session.Query<T>().Where(x =>
(String.IsNullOrEmpty(myObject.MyStringColumn) || x.MyStringColumn ==
myObject.MyStringColumn)).Select(x => x.MyStringColumn).Distinct();
where String.IsNullOrEmpty(myObject.MyStringColumn) is always
constant, either true or false, this to be able to exclude some of the
properties I am filtering on (the original query contains several
properties).
NHProfiler displays:
select distinct conversion0_.MyStringColumn as col_0_0_
from Conversion conversion0_
where ('True' /* :p0 */ = 'true'
or conversion0_.MyStringColumn is null)
this query will always return 0 rows.
As I see it there are some options.
!. Configure NHibernate so that it gets 'True' = 'True' or 'true' =
'true' (or preferably fix the bug it it is considered one?)
2. Make the connection case insensitive (configuration? how?)
3. Use some other method of querying (raw sql or similar)
Here is some additional info:
NHibernate version 3.0.0.4000
FluentNHibernate version 1.2.0.694
IPersistenceConfigurer database =
OracleDataClientConfiguration.Oracle10
.ConnectionString(connectionString)
.Driver<OracleDataClientDriver>()
.Provider<DriverConnectionProvider>()
.Dialect<Oracle10gDialect>()
.QuerySubstitutions("true 1, false 0, yes 'Y', no
'N'");
I would be greatful for any help on this. Thank you!
--
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.