/** * Add an attribute represented by the given attribute name to the list of joins for this query. * Note: Mapping level joins are represented separately from query level joins. */ public void addJoinedMapping(String attributeName) { addJoinedMappingExpression(this.baseExpressionBuilder.get(attributeName)); }
/** * PUBLIC: * Add the attribute from the reference class to be included in the result. * EXAMPLE: reportQuery.addAttribute("firstName"); */ public void addAttribute(String itemName) { addItem(itemName, getExpressionBuilder().get(itemName)); }
/** * PUBLIC: * Add the attribute to the group by expressions. * This will group the result set on that attribute and is normally used in conjunction with aggregation functions. * Example: reportQuery.addGrouping("lastName") */ public void addGrouping(String attributeName) { addGrouping(getExpressionBuilder().get(attributeName)); }
/** * PUBLIC: * Add the sum value of the attribute to be included in the result and * return it as the specified resultType. * Aggregation functions can be used with a group by, or on the entire result set. * EXAMPLE: reportQuery.addSum("salary", Float.class); */ public void addSum(String itemName, Class resultType) { addSum(itemName, getExpressionBuilder().get(itemName), resultType); }
/** * PUBLIC: * Add the sum value of the attribute to be included in the result and * return it as the specified resultType. * Aggregation functions can be used with a group by, or on the entire result set. * EXAMPLE: reportQuery.addSum("salary", Float.class); */ public void addSum(String itemName, Class resultType) { addSum(itemName, getExpressionBuilder().get(itemName), resultType); }
/** * PUBLIC: * Add the variance value of the attribute to be included in the result. * Aggregation functions can be used with a group by, or on the entire result set. * EXAMPLE: reportQuery.addVariance("salary"); */ public void addVariance(String itemName) { addVariance(itemName, getExpressionBuilder().get(itemName)); }
OneToManyMapping mapping = (OneToManyMapping) descriptor.getMappingForAttributeName( "someRelationship" ); Expression origExp = mapping.buildSelectionCriteria(); ExpressionBuilder expBuilder = origExp.getBuilder(); Expression constantExp = expBuilder.get( "someAttribute" ).in( new String[] { "V", "W", "U" } ); Expression newExp = origExp.and( constantExp ); mapping.setSelectionCriteria( newExp );
/** * PUBLIC: * Add the sum value of the attribute to be included in the result. * Aggregation functions can be used with a group by, or on the entire result set. * EXAMPLE: reportQuery.addSum("salary"); */ public void addSum(String itemName) { addSum(itemName, getExpressionBuilder().get(itemName)); }
/** * PUBLIC: * Add the variance value of the attribute to be included in the result. * Aggregation functions can be used with a group by, or on the entire result set. * EXAMPLE: reportQuery.addVariance("salary"); */ public void addVariance(String itemName) { addVariance(itemName, getExpressionBuilder().get(itemName)); }
/** * PUBLIC: * Add the average value of the attribute to be included in the result. * Aggregation functions can be used with a group by, or on the entire result set. * EXAMPLE: reportQuery.addAverage("salary"); */ public void addAverage(String itemName) { addAverage(itemName, getExpressionBuilder().get(itemName)); }
/** * PUBLIC: * Add the average value of the attribute to be included in the result and * return it as the specified resultType. * Aggregation functions can be used with a group by, or on the entire result set. * EXAMPLE: reportQuery.addAverage("salary", Float.class); */ public void addAverage(String itemName, Class resultType) { addAverage(itemName, getExpressionBuilder().get(itemName), resultType); }
/** * PUBLIC: * Add the sum value of the attribute to be included in the result. * Aggregation functions can be used with a group by, or on the entire result set. * EXAMPLE: reportQuery.addSum("salary"); */ public void addSum(String itemName) { addSum(itemName, getExpressionBuilder().get(itemName)); }
/** * PUBLIC: * Add the maximum value of the attribute to be included in the result. * Aggregation functions can be used with a group by, or on the entire result set. * EXAMPLE: reportQuery.addMaximum("salary"); */ public void addMaximum(String itemName) { addMaximum(itemName, getExpressionBuilder().get(itemName)); }
/** * PUBLIC: * Add the standard deviation value of the attribute to be included in the result. * Aggregation functions can be used with a group by, or on the entire result set. * EXAMPLE: reportQuery.addStandardDeviation("salary"); */ public void addStandardDeviation(String itemName) { addStandardDeviation(itemName, getExpressionBuilder().get(itemName)); }
/** * PUBLIC: * Add the attribute from the reference class to be included in the result. * EXAMPLE: reportQuery.addAttribute("firstName"); */ public void addAttribute(String itemName) { addItem(itemName, getExpressionBuilder().get(itemName)); }
/** * PUBLIC: * Add the maximum value of the attribute to be included in the result. * Aggregation functions can be used with a group by, or on the entire result set. * EXAMPLE: reportQuery.addMaximum("salary"); */ public void addMaximum(String itemName) { addMaximum(itemName, getExpressionBuilder().get(itemName)); }
/** * PUBLIC: * Add the minimum value of the attribute to be included in the result. * Aggregation functions can be used with a group by, or on the entire result set. * EXAMPLE: reportQuery.addMinimum("salary"); */ public void addMinimum(String itemName) { addMinimum(itemName, getExpressionBuilder().get(itemName)); }
/** * PUBLIC: * Order the query results by the object's attribute or query key name. */ public void addDescendingOrdering(String queryKeyName) { addOrdering(getExpressionBuilder().get(queryKeyName).descending()); }
/** * PUBLIC: * Order the query results by the object's attribute or query key name. */ public void addAscendingOrdering(String queryKeyName) { addOrdering(getExpressionBuilder().get(queryKeyName).ascending()); }
/** * PUBLIC: * Order the query results by the object's attribute or query key name. */ public void addDescendingOrdering(String queryKeyName) { addOrdering(getExpressionBuilder().get(queryKeyName).descending()); }