org.datanucleus.store.rdbms.sql.method
Class StringSimilarPostgresqlMethod

java.lang.Object
  extended by org.datanucleus.store.rdbms.sql.method.AbstractSQLMethod
      extended by org.datanucleus.store.rdbms.sql.method.StringMatchesMethod
          extended by org.datanucleus.store.rdbms.sql.method.StringSimilarPostgresqlMethod
All Implemented Interfaces:
SQLMethod

public class StringSimilarPostgresqlMethod
extends StringMatchesMethod

Support for a String.matches like functionality but using Postgresql's "SIMILAR TO" operator. This is mapped to the Java function "String.similarTo" as an extension so it is available for use. A unit test fails if trying to use it as String.matches.


Field Summary
static org.datanucleus.query.expression.Expression.DyadicOperator OP_SIMILAR_TO
           
 
Fields inherited from class org.datanucleus.store.rdbms.sql.method.AbstractSQLMethod
clr, exprFactory, LOCALISER, stmt
 
Constructor Summary
StringSimilarPostgresqlMethod()
           
 
Method Summary
protected  BooleanExpression getBooleanLikeExpression(SQLExpression expr, SQLExpression regExpr, SQLExpression escapeExpr)
           
protected  BooleanExpression getExpressionForStringExpressionInput(SQLExpression expr, SQLExpression regExpr, SQLExpression escapeExpr)
           
 
Methods inherited from class org.datanucleus.store.rdbms.sql.method.StringMatchesMethod
getExpression
 
Methods inherited from class org.datanucleus.store.rdbms.sql.method.AbstractSQLMethod
getMappingForClass, setStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OP_SIMILAR_TO

public static final org.datanucleus.query.expression.Expression.DyadicOperator OP_SIMILAR_TO
Constructor Detail

StringSimilarPostgresqlMethod

public StringSimilarPostgresqlMethod()
Method Detail

getExpressionForStringExpressionInput

protected BooleanExpression getExpressionForStringExpressionInput(SQLExpression expr,
                                                                  SQLExpression regExpr,
                                                                  SQLExpression escapeExpr)
Overrides:
getExpressionForStringExpressionInput in class StringMatchesMethod

getBooleanLikeExpression

protected BooleanExpression getBooleanLikeExpression(SQLExpression expr,
                                                     SQLExpression regExpr,
                                                     SQLExpression escapeExpr)
Overrides:
getBooleanLikeExpression in class StringMatchesMethod


Copyright © 2012. All Rights Reserved.