Java Code Examples for org.springframework.data.mapping.PersistentPropertyPath#getRequiredLeafProperty()
The following examples show how to use
org.springframework.data.mapping.PersistentPropertyPath#getRequiredLeafProperty() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CypherQueryCreator.java From sdn-rx with Apache License 2.0 | 4 votes |
PropertyPathWrapper(int index, PersistentPropertyPath<?> propertyPath) { this.index = index; propertyPathList = (List<PersistentProperty<?>>) propertyPath.toList(); this.leafProperty = (Neo4jPersistentProperty) propertyPath.getRequiredLeafProperty(); }
Example 2
Source File: CypherQueryCreator.java From sdn-rx with Apache License 2.0 | 4 votes |
private Condition createImpl(Part part, Iterator<Object> actualParameters) { PersistentPropertyPath<Neo4jPersistentProperty> path = mappingContext .getPersistentPropertyPath(part.getProperty()); Neo4jPersistentProperty persistentProperty = path.getRequiredLeafProperty(); boolean ignoreCase = ignoreCase(part); switch (part.getType()) { case AFTER: case GREATER_THAN: return toCypherProperty(persistentProperty, ignoreCase) .gt(toCypherParameter(nextRequiredParameter(actualParameters), ignoreCase)); case BEFORE: case LESS_THAN: return toCypherProperty(persistentProperty, ignoreCase) .lt(toCypherParameter(nextRequiredParameter(actualParameters), ignoreCase)); case BETWEEN: return betweenCondition(persistentProperty, actualParameters, ignoreCase); case CONTAINING: return toCypherProperty(persistentProperty, ignoreCase) .contains(toCypherParameter(nextRequiredParameter(actualParameters), ignoreCase)); case ENDING_WITH: return toCypherProperty(persistentProperty, ignoreCase) .endsWith(toCypherParameter(nextRequiredParameter(actualParameters), ignoreCase)); case EXISTS: return Predicates.exists(toCypherProperty(persistentProperty)); case FALSE: return toCypherProperty(persistentProperty, ignoreCase).isFalse(); case GREATER_THAN_EQUAL: return toCypherProperty(persistentProperty, ignoreCase) .gte(toCypherParameter(nextRequiredParameter(actualParameters), ignoreCase)); case IN: return toCypherProperty(persistentProperty, ignoreCase) .in(toCypherParameter(nextRequiredParameter(actualParameters), ignoreCase)); case IS_EMPTY: return toCypherProperty(persistentProperty, ignoreCase).isEmpty(); case IS_NOT_EMPTY: return toCypherProperty(persistentProperty, ignoreCase).isEmpty().not(); case IS_NOT_NULL: return toCypherProperty(persistentProperty, ignoreCase).isNotNull(); case IS_NULL: return toCypherProperty(persistentProperty, ignoreCase).isNull(); case LESS_THAN_EQUAL: return toCypherProperty(persistentProperty, ignoreCase) .lte(toCypherParameter(nextRequiredParameter(actualParameters), ignoreCase)); case LIKE: return likeCondition(persistentProperty, nextRequiredParameter(actualParameters).nameOrIndex, ignoreCase); case NEAR: return createNearCondition(persistentProperty, actualParameters); case NEGATING_SIMPLE_PROPERTY: return toCypherProperty(persistentProperty, ignoreCase) .isNotEqualTo(toCypherParameter(nextRequiredParameter(actualParameters), ignoreCase)); case NOT_CONTAINING: return toCypherProperty(persistentProperty, ignoreCase) .contains(toCypherParameter(nextRequiredParameter(actualParameters), ignoreCase)).not(); case NOT_IN: return toCypherProperty(persistentProperty, ignoreCase) .in(toCypherParameter(nextRequiredParameter(actualParameters), ignoreCase)) .not(); case NOT_LIKE: return likeCondition(persistentProperty, nextRequiredParameter(actualParameters).nameOrIndex, ignoreCase).not(); case SIMPLE_PROPERTY: return toCypherProperty(persistentProperty, ignoreCase) .isEqualTo(toCypherParameter(nextRequiredParameter(actualParameters), ignoreCase)); case STARTING_WITH: return toCypherProperty(persistentProperty, ignoreCase) .startsWith(toCypherParameter(nextRequiredParameter(actualParameters), ignoreCase)); case REGEX: return toCypherProperty(persistentProperty, ignoreCase) .matches(toCypherParameter(nextRequiredParameter(actualParameters), ignoreCase)); case TRUE: return toCypherProperty(persistentProperty, ignoreCase).isTrue(); case WITHIN: return createWithinCondition(persistentProperty, actualParameters); default: throw new IllegalArgumentException("Unsupported part type: " + part.getType()); } }