protected LikeExpression( String propertyName, String value, MatchMode matchMode, Character escapeChar, boolean ignoreCase) { this( propertyName, matchMode.toMatchString( value ), escapeChar, ignoreCase ); }
private MatchMode getMatchMode() { String matchMode = Context.getAdministrationService().getGlobalProperty( OpenmrsConstants.GLOBAL_PROPERTY_PROVIDER_SEARCH_MATCH_MODE); if (MatchMode.START.toString().equalsIgnoreCase(matchMode)) { return MatchMode.START; } if (MatchMode.ANYWHERE.toString().equalsIgnoreCase(matchMode)) { return MatchMode.ANYWHERE; } if (MatchMode.END.toString().equalsIgnoreCase(matchMode)) { return MatchMode.END; } return MatchMode.EXACT; }
protected IlikeExpression(String propertyName, String value, MatchMode matchMode) { this( propertyName, matchMode.toMatchString( value ) ); }
/** * Apply an "ilike" constraint * * @deprecated since 5.2, use {@link #ilike(String, MatchMode)}. */ @Deprecated public AuditCriterion ilike(String value, org.hibernate.criterion.MatchMode matchMode) { return new IlikeAuditExpression( alias, propertyNameGetter, matchMode.toMatchString( value ) ); }
/** * Apply a "like" constraint * * @deprecated since 5.2, use {@link #like(String, MatchMode)}. */ @Deprecated public AuditCriterion like(String value, org.hibernate.criterion.MatchMode matchMode) { return new SimpleAuditExpression( alias, propertyNameGetter, matchMode.toMatchString( value ), " like" ); }
/** * Apply a "like" constraint to the named property using the provided match mode * * @param propertyName The name of the property * @param value The value to use in comparison * @param matchMode The match mode to use in comparison * * @return The Criterion * * @see SimpleExpression */ public static SimpleExpression like(String propertyName, String value, MatchMode matchMode) { // todo : update this to use LikeExpression return new SimpleExpression( propertyName, matchMode.toMatchString( value ), " like " ); }
protected void addPropertyTypedValue(Object value, Type type, List<TypedValue> list) { if ( value != null ) { if ( value instanceof String ) { String string = (String) value; if ( isIgnoreCaseEnabled ) { string = string.toLowerCase(Locale.ROOT); } if ( isLikeEnabled ) { string = matchMode.toMatchString( string ); } value = string; } list.add( new TypedValue( type, value ) ); } }
protected LikeExpression( String propertyName, String value, MatchMode matchMode, Character escapeChar, boolean ignoreCase) { this( propertyName, matchMode.toMatchString( value ), escapeChar, ignoreCase ); }
protected LikeExpression( String propertyName, String value, MatchMode matchMode) { this( propertyName, matchMode.toMatchString( value ) ); }
protected LikeExpression( String propertyName, String value, MatchMode matchMode, Character escapeChar, boolean ignoreCase) { this( propertyName, matchMode.toMatchString( value ), escapeChar, ignoreCase ); }
protected LikeExpression( String propertyName, String value, MatchMode matchMode) { this( propertyName, matchMode.toMatchString( value ) ); }
protected IlikeExpression(String propertyName, String value, MatchMode matchMode) { this( propertyName, matchMode.toMatchString(value) ); }
protected IlikeExpression(String propertyName, String value, MatchMode matchMode) { this( propertyName, matchMode.toMatchString( value ) ); }
protected IlikeExpression(String propertyName, String value, MatchMode matchMode) { this( propertyName, matchMode.toMatchString(value) ); }
public RlikeExpression(String propertyName, String value, MatchMode matchMode) { this(propertyName, matchMode.toMatchString(value)); }
protected IlikeExpression(String propertyName, String value, MatchMode matchMode) { this( propertyName, matchMode.toMatchString( value ) ); }
protected void addPropertyTypedValue(Object value, Type type, List list) { if ( value!=null ) { if ( value instanceof String ) { String string = (String) value; if (isIgnoreCaseEnabled) string = string.toLowerCase(); if (isLikeEnabled) string = matchMode.toMatchString(string); value = string; } list.add( new TypedValue(type, value, null) ); } }
/** * Apply a "like" constraint to the named property * @param propertyName * @param value * @return Criterion */ public static SimpleExpression like(String propertyName, String value, MatchMode matchMode) { return new SimpleExpression(propertyName, matchMode.toMatchString(value), " like " ); } /**
/** * Apply a "like" constraint to the named property * @param propertyName * @param value * @return Criterion */ public static SimpleExpression like(String propertyName, String value, MatchMode matchMode) { return new SimpleExpression(propertyName, matchMode.toMatchString(value), " like " ); } /**
protected void addPropertyTypedValue(Object value, Type type, List list) { if ( value!=null ) { if ( value instanceof String ) { String string = (String) value; if (isIgnoreCaseEnabled) string = string.toLowerCase(); if (isLikeEnabled) string = matchMode.toMatchString(string); value = string; } list.add( new TypedValue(type, value, null) ); } }