Hibernate ORM AggregateProjection - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM AggregateProjection class.

This code example shows how to use the following methods: toString
         * an aggregateProjection's toString returns 
         * min( ..., max( ..., sum( ..., or avg( ... 
         * we just care about the name of the function 
         * which happens to be before the first left parenthesis 
         */ 
        final String projectionAsString = projection.toString();
        final String aggregateName = projectionAsString.substring(0, projectionAsString.indexOf("("));
        this.fieldName = projectionAsString.substring(projectionAsString.indexOf("(") + 1, projectionAsString.indexOf(")"));
        try { 
            this.aggregate = SupportedAggregations.valueOf(aggregateName.toUpperCase());
        } catch (IllegalArgumentException e) {
            log.error("Use of unsupported aggregate: " + aggregateName);
            throw e;
        } 
    } 
 
    @Override 
    public List<Object> apply(final List<Object> results) {
 
        final List<Object> nonNullResults = ExitOperationUtils.getNonNullList(results);
Full Snippet Info
4
CodeRank
Experience pair programming with AI  Get Codota for Java