From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-12 19:48:59
|
[ http://216.121.112.228/browse/NH-2546?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo closed NH-2546. --------------------------- Resolution: Won't Fix You can use Restrictions.Like("StringTypeWithLengthDefined", "[a-z][a-z][a-z]ian%", MatchMode.Exact, null) to ensure that the field length will be ignored. > 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 > Attachments: NH-2546.patch > > > 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 |