private void processContainsPredicate( final ContainsPredicate<?> predicate, StringBuilder builder ) { Object value = predicate.value(); String valueVariable = triples.addTriple( predicate.collectionProperty(), false ).value(); builder.append( this.createRegexStringForContaining( valueVariable, this.createAndEscapeJSONString( value ) ) ); }
/** * Create a new CONTAINS specification for a Collection Property. * * @param <T> Collection property type * @param collectionProperty a Collection Property * @param value the value * * @return a new CONTAINS specification for a Collection Property. */ public static <T> ContainsPredicate<T> contains( Property<? extends Collection<T>> collectionProperty, T value ) { Objects.requireNonNull( value, "Value" ); return new ContainsPredicate<>( property( collectionProperty ), value ); }
predicate.collectionProperty(), //
private void processContainsSpecification( BoolQueryBuilder queryBuilder, ContainsPredicate<?> spec, Map<String, Object> variables ) { LOGGER.trace( "Processing ContainsSpecification {}", spec ); String name = spec.collectionProperty().toString(); if( spec.value() instanceof ValueComposite ) { // Query by complex property "example value" throw new UnsupportedOperationException( "ElasticSearch Index/Query does not support complex " + "queries, ie. queries by 'example value'." ); } else if( COMPLEX_TYPE_SUPPORTS.get( spec.value().getClass() ) != null ) { ComplexTypeSupport support = COMPLEX_TYPE_SUPPORTS.get( spec.value().getClass() ); queryBuilder.must( support.contains( spec, variables ) ); } else { Object value = resolveVariable( spec.value(), variables ); queryBuilder.must( termQuery( name, value ) ); } }
/** * Create a new CONTAINS specification for a Collection Property. * * @param <T> Collection property type * @param collectionProperty a Collection Property * @param value the value * * @return a new CONTAINS specification for a Collection Property. */ public static <T> ContainsPredicate<T> contains( Property<? extends Collection<T>> collectionProperty, T value ) { Objects.requireNonNull( value, "Value" ); return new ContainsPredicate<>( property( collectionProperty ), value ); }
private void processContainsPredicate( final ContainsPredicate<?> predicate, StringBuilder builder ) { Object value = predicate.value(); String valueVariable = triples.addTriple( predicate.collectionProperty(), false ).value(); builder.append( this.createRegexStringForContaining( valueVariable, this.createAndEscapeJSONString( value ) ) ); }
/** * Create a new CONTAINS specification for a Collection Property using named Variables. * * @param <T> Collection property type * @param collectionProperty a Collection Property * @param variable named Variable * * @return a new CONTAINS specification for a Collection Property using named Variables. */ @SuppressWarnings( {"raw", "unchecked"} ) public static <T> ContainsPredicate<T> contains( Property<? extends Collection<T>> collectionProperty, Variable variable ) { Objects.requireNonNull( variable, "Variable" ); return new ContainsPredicate( property( collectionProperty ), variable ); }
.s( DBNames.QNAME_TABLE_COLLECTION_PATH_TOP_LEVEL_NAME + ".*{1,}" ) ) ); Object value = predicate.value(); if( value instanceof Collection<?> ) QualifiedName.fromAccessor( predicate.collectionProperty().accessor() ), value, predicate, false, lastTableIndex, new ModifiableInt( lastTableIndex ), DBNames.QNAME_TABLE_VALUE_COLUMN_NAME,
/** * Create a new CONTAINS specification for a Collection Property using named Variables. * * @param <T> Collection property type * @param collectionProperty a Collection Property * @param variable named Variable * * @return a new CONTAINS specification for a Collection Property using named Variables. */ @SuppressWarnings( {"raw", "unchecked"} ) public static <T> ContainsPredicate<T> contains( Property<? extends Collection<T>> collectionProperty, Variable variable ) { Objects.requireNonNull( variable, "Variable" ); return new ContainsPredicate( property( collectionProperty ), variable ); }