use of io.crnk.jpa.internal.query.MetaComputedAttribute in project crnk-framework by crnk-project.
the class JpaCriteriaQueryBackend method getAttribute.
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public Expression<?> getAttribute(Expression<?> currentCriteriaPath, MetaAttribute pathElement) {
if (pathElement instanceof MetaComputedAttribute) {
MetaComputedAttribute projAttr = (MetaComputedAttribute) pathElement;
JpaCriteriaExpressionFactory expressionFactory = (JpaCriteriaExpressionFactory<?>) queryImpl.getComputedAttrs().get(projAttr);
From from = (From) currentCriteriaPath;
return expressionFactory.getExpression(from, getCriteriaQuery());
} else {
return ((Path<?>) currentCriteriaPath).get(pathElement.getName());
}
}
Aggregations