com.github.alittlehuang.data.query.specification.WhereClause Maven / Gradle / Ivy
package com.github.alittlehuang.data.query.specification;
import javax.persistence.criteria.Predicate;
import java.util.List;
/**
* @author ALittleHuang
*/
public interface WhereClause {
List extends WhereClause> getCompoundItems();
Expression getExpression();
Object getParameter();
Predicate.BooleanOperator getBooleanOperator();
boolean isCompound();
ConditionalOperator getConditionalOperator();
boolean isNegate();
static boolean isEmpty(WhereClause> whereClause) {
if ( whereClause.isCompound() ) {
List extends WhereClause>> compoundItems = whereClause.getCompoundItems();
if ( compoundItems != null ) {
for ( WhereClause> item : compoundItems ) {
if ( !isEmpty(item) ) {
return false;
}
}
}
return true;
} else {
return whereClause.getExpression() == null;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy