@Override public BooleanExpression exists() { if (queryMixin.getMetadata().getJoins().isEmpty()) { throw new IllegalArgumentException("No sources given"); } return unique(queryMixin.getMetadata().getJoins().get(0).getTarget()).exists(); }
private QueryMetadata projection(Expression<?>... projection) { QueryMetadata metadata = queryMixin.getMetadata().clone(); for (Expression<?> expr : projection) { metadata.addProjection(nullAsTemplate(expr)); } return metadata; }
private QueryMetadata projection( Expression<?> first, Expression<?> second, Expression<?>[] rest) { QueryMetadata metadata = queryMixin.getMetadata().clone(); metadata.addProjection(nullAsTemplate(first)); metadata.addProjection(nullAsTemplate(second)); for (Expression<?> expr : rest) { metadata.addProjection(nullAsTemplate(expr)); } return metadata; }