/** * Create a new REGULAR EXPRESSION specification for a Property. * * @param property a Property * @param regexp its value * * @return a new REGULAR EXPRESSION specification for a Property. */ public static MatchesPredicate matches( Property<String> property, String regexp ) { return new MatchesPredicate( property( property ), regexp ); }
predicate.property(), null, null,
@Override public void processWhereClause( QuerySpecificationBuilder builder, BooleanBuilder afterWhere, JoinType joinStyle, Integer firstTableIndex, Integer lastTableIndex ) { LiteralFactory l = vendor.getLiteralFactory(); ColumnsFactory c = vendor.getColumnsFactory(); builder.getWhere().reset( vendor.getBooleanFactory().regexp( c.colName( TABLE_NAME_PREFIX + lastTableIndex, DBNames.QNAME_TABLE_VALUE_COLUMN_NAME ), l.param() ) ); Object value = predicate.value(); if( value instanceof Variable ) { value = variables.get( ( (Variable) value ).variableName() ); } values.add( translateJavaRegexpToPGSQLRegexp( value.toString() ) ); valueSQLTypes.add( Types.VARCHAR ); } } //
/** * Create a new REGULAR EXPRESSION specification for a Property. * * @param property a Property * @param regexp its value * * @return a new REGULAR EXPRESSION specification for a Property. */ public static MatchesPredicate matches( Property<String> property, String regexp ) { return new MatchesPredicate( property( property ), regexp ); }
private void processMatchesSpecification( BoolQueryBuilder queryBuilder, MatchesPredicate spec, Map<String, Object> variables ) { LOGGER.trace( "Processing MatchesSpecification {}", spec ); String name = spec.property().toString(); String regexp = resolveVariable( spec.regexp(), variables ).toString(); queryBuilder.must( regexpQuery( name, regexp ) ); }
/** * Create a new REGULAR EXPRESSION specification for a Property using a named Variable. * * @param property a Property * @param variable a Query Variable * * @return a new REGULAR EXPRESSION specification for a Property using a named Variable. */ public static MatchesPredicate matches( Property<String> property, Variable variable ) { return new MatchesPredicate( property( property ), variable ); }
/** * Create a new REGULAR EXPRESSION specification for a Property using a named Variable. * * @param property a Property * @param variable a Query Variable * * @return a new REGULAR EXPRESSION specification for a Property using a named Variable. */ public static MatchesPredicate matches( Property<String> property, Variable variable ) { return new MatchesPredicate( property( property ), variable ); }