Hi,<br>first of all please excuse me for my poor english.<br>i am a java developer, and i'm using hibernate to implement persistence.<br>Using Expression.ilike method i had some compatibility problem becouse of the fixed behaviour of converting fields to lowercase.<br>
So i modified org.hibernate.Criteria.LikeExpression and also org.hibernate.Criteria.LikeExpressionIlikeExpression classes, to implement the possibility of choosing the preferred converting mode:<br>either uppercase or lowercase.<br>
So what i obtained is something like this:<br><br><br>CLASS: org.hibernate.Criteria.IlikeExpression<br>....<br><br>@Deprecated<br> protected IlikeExpression(String propertyName, String value, MatchMode matchMode) {<br>
this( propertyName, matchMode.toMatchString(value), CONVERT_MODE_LOWER_CASE);<br> }<br><br> protected IlikeExpression(String propertyName, String value, MatchMode matchMode, int CONVERT_MODE) {<br> this( propertyName, matchMode.toMatchString(value), CONVERT_MODE);<br>
}<br>....<br><br><br><br>CLASS: org.hibernate.Criteria.LikeExpression <br><br><br>protected LikeExpression(String propertyName, String value,<br> MatchMode matchMode, Character escapeChar, boolean ignoreCase,<br>
int CONVERT_MODE) {<br> this(propertyName, matchMode.toMatchString(value), escapeChar,<br> ignoreCase, CONVERT_MODE);<br> }<br> @Deprecated<br> protected LikeExpression(String propertyName, String value,<br>
MatchMode matchMode, Character escapeChar, boolean ignoreCase) {<br> this(propertyName, matchMode.toMatchString(value), escapeChar,<br> ignoreCase, LikeExpression.CONVERT_MODE_LOWER_CASE);<br>
}<br><br><br>
both solutions are compatible with the old behaviour, but now i can choose between uppercase or lowercse convertion.<br>If you think this could be a correct approach to this problem, please answer me and i will give you the whole source code reguarding the modify.<br>
<font size="-1">Thanks for your attention.<br>Best Regards<br><br></font>-- <br>Andrea Tomassi