/** * Populate filter clause. * * @param conditionalExpression * the conditional expression * @return the filter clause */ private FilterClause populateFilterClause(ComparisonExpression conditionalExpression) { String property = ((StateFieldPathExpression) conditionalExpression.getLeftExpression()).getPath(1); String condition = conditionalExpression.getComparisonOperator(); Expression rightExpression = conditionalExpression.getRightExpression(); Object value = (rightExpression instanceof InputParameter) ? kunderaQuery.getParametersMap().get( (rightExpression).toParsedText()) : rightExpression.toParsedText(); return (condition != null && property != null) ? kunderaQuery.new FilterClause(property, condition, value, property) : null; }
/** * {@inheritDoc} */ @Override public void visit(StateFieldPathExpression expression) { // Temporarily change the null allowed flag if the state field is a foreign reference mapping Expression queryExpression = queryContext.buildModifiedPathExpression(expression); // Register the EclipseLink Expression with the state field name String name = expression.getPath(expression.pathSize() - 1); addAttribute(name, queryExpression); query.dontRetrievePrimaryKeys(); }
/** * {@inheritDoc} */ @Override public void visit(StateFieldPathExpression expression) { // Temporarily change the null allowed flag if the state field is a foreign reference mapping Expression queryExpression = queryContext.buildModifiedPathExpression(expression); // Register the EclipseLink Expression with the state field name String name = expression.getPath(expression.pathSize() - 1); addAttribute(name, queryExpression); query.dontRetrievePrimaryKeys(); }
/** * Populate filter clause. * * @param conditionalExpression * the conditional expression * @return the filter clause */ private FilterClause populateFilterClause(ComparisonExpression conditionalExpression) { String property = ((StateFieldPathExpression) conditionalExpression.getLeftExpression()).getPath(1); String condition = conditionalExpression.getComparisonOperator(); Expression rightExpression = conditionalExpression.getRightExpression(); Object value = (rightExpression instanceof InputParameter) ? kunderaQuery.getParametersMap().get( (rightExpression).toParsedText()) : rightExpression.toParsedText(); return (condition != null && property != null) ? kunderaQuery.new FilterClause(property, condition, value, property) : null; }
/** * {@inheritDoc} */ public void visit(StateFieldPathExpression expression) { // If the path ends with '.', then the path is incomplete // so we can't resolve the type if (!expression.endsWithDot()) { // Check first to see if it's an enum type String path = expression.toActualText(); IType type = queryContext.getTypeRepository().getEnumType(path); if (type != null) { resolver = buildEnumResolver(expression, type, path); } else { expression.getIdentificationVariable().accept(this); for (int index = expression.hasVirtualIdentificationVariable() ? 0 : 1, count = expression.pathSize(); index < count; index++) { path = expression.getPath(index); resolver = buildStateFieldResolver(expression.getPath(index)); } } } else { resolver = buildNullResolver(); } }
String columnName = expression.getPath(1);
String columnName = expression.getPath(1);
String enumConstant = expression.getPath(expression.pathSize() - 1); boolean found = false;
String enumConstant = expression.getPath(expression.pathSize() - 1); boolean found = false;
String path = pathExpression.getPath(index); Object mapping = helper.getMappingNamed(managedType, path);
String path = pathExpression.getPath(index); Object mapping = helper.getMappingNamed(managedType, path);