public class LikeExpressionToRegExpConverter extends Object
Pattern
objects equivalent to given HQL/JPQL LIKE
expressions. Used by
LikePredicate
implementations to emulate LIKE
predicates via a native regexp 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 breaksConstructor 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-2015 Red Hat, Inc., Emmanuel Bernard and various contributors. All Rights Reserved.