public class LikeExpressionToRegExpConverter extends Object
Pattern objects equivalent to given HQL/JPQL LIKE expressions.
Used by MongoDBLikePredicate to run LIKE
queries against MongoDB, using the $regex operator.
The following rules apply for creating regular expressions:
_ wildcard is replaced by . (unless it is escaped)% wildcard is replaced by .* (unless it is escaped)\\Q...\\E) to match them as is^...$ to make sure the entire string is matched. matches line breaks| Constructor and Description |
|---|
LikeExpressionToRegExpConverter() |
LikeExpressionToRegExpConverter(Character escapeCharacter) |
| Modifier and Type | Method and Description |
|---|---|
Pattern |
getRegExpFromLikeExpression(String likeExpression)
Creates a regular expression pattern object equivalent to the given
LIKE expression. |
public LikeExpressionToRegExpConverter()
public LikeExpressionToRegExpConverter(Character escapeCharacter)
public Pattern getRegExpFromLikeExpression(String likeExpression)
LIKE expression.likeExpression - the HQL/JPQL LIKE expression to convertLIKE expressionCopyright © 2010-2013 Hibernate. All Rights Reserved.