All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.easy.query.api4j.select.extension.queryable4.SQLHavingable4 Maven / Gradle / Ivy

There is a newer version: 2.3.3
Show newest version
package com.easy.query.api4j.select.extension.queryable4;

import com.easy.query.api4j.select.Queryable4;
import com.easy.query.api4j.sql.SQLWhereAggregatePredicate;
import com.easy.query.api4j.sql.impl.SQLWhereAggregatePredicateImpl;
import com.easy.query.core.common.tuple.Tuple4;
import com.easy.query.core.expression.lambda.SQLExpression1;
import com.easy.query.core.expression.lambda.SQLExpression4;

/**
 * create time 2023/8/16 08:49
 * 文件说明
 *
 * @author xuejiaming
 */
public interface SQLHavingable4 extends ClientQueryable4Available, Queryable4Available {

    default Queryable4 having(SQLExpression4, SQLWhereAggregatePredicate, SQLWhereAggregatePredicate, SQLWhereAggregatePredicate> predicateExpression) {
        getClientQueryable4().having((predicate1, predicate2, predicate3, predicate4) -> {
            predicateExpression.apply(new SQLWhereAggregatePredicateImpl<>(predicate1), new SQLWhereAggregatePredicateImpl<>(predicate2), new SQLWhereAggregatePredicateImpl<>(predicate3), new SQLWhereAggregatePredicateImpl<>(predicate4));
        });
        return getQueryable4();
    }

    default Queryable4 having(boolean condition, SQLExpression4, SQLWhereAggregatePredicate, SQLWhereAggregatePredicate, SQLWhereAggregatePredicate> predicateExpression) {
        getClientQueryable4().having(condition, (predicate1, predicate2, predicate3, predicate4) -> {
            predicateExpression.apply(new SQLWhereAggregatePredicateImpl<>(predicate1), new SQLWhereAggregatePredicateImpl<>(predicate2), new SQLWhereAggregatePredicateImpl<>(predicate3), new SQLWhereAggregatePredicateImpl<>(predicate4));
        });
        return getQueryable4();
    }

    default Queryable4 havingMerge(SQLExpression1, SQLWhereAggregatePredicate, SQLWhereAggregatePredicate, SQLWhereAggregatePredicate>> predicateExpression) {
        return havingMerge(true, predicateExpression);
    }

    default Queryable4 havingMerge(boolean condition, SQLExpression1, SQLWhereAggregatePredicate, SQLWhereAggregatePredicate, SQLWhereAggregatePredicate>> predicateExpression) {
        return having(condition, (t1, t2,t3, t4) -> {
            predicateExpression.apply(new Tuple4<>(t1, t2, t3, t4));
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy