use of io.crnk.jpa.meta.MetaEntity in project crnk-framework by crnk-project.
the class JpaCriteriaQueryBackend method getParentIdExpression.
private Expression<?> getParentIdExpression(MetaAttribute parentAttr) {
MetaEntity parentEntity = (MetaEntity) parentAttr.getParent();
MetaKey primaryKey = parentEntity.getPrimaryKey();
List<MetaAttribute> elements = primaryKey.getElements();
PreconditionUtil.assertFalse("composite primary keys not supported yet", elements.size() != 1);
MetaAttribute primaryKeyAttr = elements.get(0);
return parentFrom.get(primaryKeyAttr.getName());
}
Aggregations