From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-30 17:29:41
|
[ http://216.121.112.228/browse/NH-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo reopened NH-2700: ----------------------------- Ups!!! Sorry, it is not fixed for Criteria > SqlFunctionProjection does not honor parameter order > ---------------------------------------------------- > > Key: NH-2700 > URL: http://216.121.112.228/browse/NH-2700 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0 > Reporter: Andrei Alecu > Assignee: Patrick Earl > Priority: Minor > Fix For: 3.2.0Beta2 > > Attachments: nh2700 failing test.patch > > > If you define a function in a custom dialect that does not have the parameters in order and use SqlFunctionProjection, the generated sql is wrong, and does not honor parameter order. > For example: > RegisterFunction( > "AddDays", > new SQLFunctionTemplate( > NHibernateUtil.DateTime, > "dateadd(day,?2,?1)" > > ) > ); > var proj = new SqlFunctionProjection("AddDays", NHibernateUtil.DateTime, > new IProjection[] > { > Projections.Property<ModelClass>(p=>p.Date1), > Projections.Property<ModelClass>(p=>p.Value1) > }); > Generated SQL (buggy): > SELECT dateadd(day,this_.Date1,this_.Value1) > Expected SQL: > SELECT dateadd(day,this_.Value1,this_.Date1) > Using an HQL query honors parameter order properly > I will attach a failing unit test. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |