Search in sources :

Example 1 with ComputedAttributeRegistryImpl

use of io.crnk.jpa.internal.query.ComputedAttributeRegistryImpl in project crnk-framework by crnk-project.

the class QuerydslQueryBackend method getAttribute.

@Override
public Expression<?> getAttribute(final Expression<?> expression, MetaAttribute pathElement) {
    if (pathElement instanceof MetaComputedAttribute) {
        ComputedAttributeRegistryImpl virtualAttrs = queryImpl.getComputedAttrs();
        QuerydslExpressionFactory expressionFactory = (QuerydslExpressionFactory) virtualAttrs.get((MetaComputedAttribute) pathElement);
        return expressionFactory.getExpression(expression, getQuery());
    } else {
        return QuerydslUtils.get(expression, pathElement.getName());
    }
}
Also used : QuerydslExpressionFactory(io.crnk.jpa.query.querydsl.QuerydslExpressionFactory) ComputedAttributeRegistryImpl(io.crnk.jpa.internal.query.ComputedAttributeRegistryImpl) MetaComputedAttribute(io.crnk.jpa.internal.query.MetaComputedAttribute)

Aggregations

ComputedAttributeRegistryImpl (io.crnk.jpa.internal.query.ComputedAttributeRegistryImpl)1 MetaComputedAttribute (io.crnk.jpa.internal.query.MetaComputedAttribute)1 QuerydslExpressionFactory (io.crnk.jpa.query.querydsl.QuerydslExpressionFactory)1