Reimer
unread,Jun 14, 2012, 8:33:03 AM6/14/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhusers
I am creating a new NHibernate dialect to work with an OpenEdge 10.2a
database over ODBC. I have been using the dialect in NHibernate 2.1
with no problems, but when porting it to NHibernate 3.3.1 I'm having
problems with the generated querys Like statement.
When using the dialect on NHibernate 3.3.1, like statements are
generated like below for a linq query using startswith("sometest").
select test from tests
where testname like (?||'%');
p0 = 'sometest' [Type: String (8)]
This has changed since NHibernate 2.1, and the OpenEdge database does
not support this. The same query in NHibernate 2.1 looks like:
select test from tests
where testname like ?;
p0 = 'sometest%'
I have tried using the MsSql2005Dialect, and this changes the
generated SQL a little to:
select test from tests
where testname like (?+'%');
p0 = 'sometest' [Type: String (8)]
Notice the pipes that became a plus.
What causes these changes, and how can I affect it so I can can make
my dialect work on NH 3.3.1?
I would like to generate the statement like before, or using a concat
function to join the parameter with the percent character.