From: Denis (JIRA) <nh...@gm...> - 2011-03-03 22:08:38
|
[ http://216.121.112.228/browse/NH-2546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20620#action_20620 ] Denis commented on NH-2546: --------------------------- There are more than 100 mappings in my project, so excluding the size is not an efficient solution. My workaround is to switch to nHibernate v2.1.2 which doesnt have this kind of a problem. IMHO, The solution is to pass additional parameter at the moment of IDbCommand parameter generation so it will be clear if this parameter is used for LIKE orperator or not. > MSSQL Like criteria doesn't work if expression length is more then column length > -------------------------------------------------------------------------------- > > Key: NH-2546 > URL: http://216.121.112.228/browse/NH-2546 > Project: NHibernate > Issue Type: Bug > Components: DataProviders / Dialects > Affects Versions: 3.0.0.GA > Reporter: Denis > Priority: Minor > > Consider the following situation: > mapping file contains the following property > <property name="PostalCode" column="postal_code" type="String(10)" > not-null="true"/> > When I apply the following restriction > Restrictions.Like("PostalCode", "%9108[ -]MC%") > it doesn't work as expected. > Generated query looks like this: > SELECT count(*) as y0_ FROM PostalCodes this_ WHERE this_.postal_code like @p0;@p0 = '%9108[ -]MC%' [Type: String (10)] > Parameter value length ('%9108[ -]MC%') is 12 symbols and it is correct expression but the value is cutted to '%9108[ -]M' which is not correct. -- 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 |