1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Nhibernate 3.3.1 OpenEdge dialect generates bad like statement from Linq

Discussão em 'StackOverflow' iniciado por fdantas, Janeiro 22, 2015.

  1. fdantas

    fdantas Administrator Moderador

    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?

    Continue reading...

Compartilhe esta Página