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

com.easy.query.api4j.sql.SQLWherePredicate Maven / Gradle / Ivy

package com.easy.query.api4j.sql;

import com.easy.query.api4j.select.Queryable;
import com.easy.query.api4j.sql.core.SQLLambdaNative;
import com.easy.query.api4j.sql.core.filter.SQLAssertPredicate;
import com.easy.query.api4j.sql.core.filter.SQLLikePredicate;
import com.easy.query.api4j.sql.core.filter.SQLRangePredicate;
import com.easy.query.api4j.sql.core.filter.SQLSelfPredicate;
import com.easy.query.api4j.sql.core.filter.SQLSubQueryPredicate;
import com.easy.query.api4j.sql.core.filter.SQLValuePredicate;
import com.easy.query.api4j.sql.core.filter.SQLValuesPredicate;
import com.easy.query.api4j.util.EasyLambdaUtil;
import com.easy.query.core.enums.SQLPredicateCompare;
import com.easy.query.core.expression.func.ColumnPropertyFunction;
import com.easy.query.core.expression.lambda.Property;
import com.easy.query.core.expression.lambda.SQLExpression1;
import com.easy.query.core.expression.lambda.SQLExpression2;
import com.easy.query.core.expression.parser.core.EntitySQLTableOwner;
import com.easy.query.core.expression.parser.core.available.TableAvailable;
import com.easy.query.core.expression.parser.core.base.WherePredicate;

/**
 * @author xuejiaming
 * @FileName: WherePredicate.java
 * @Description: 文件说明
 * @Date: 2023/2/5 09:09
 */
public interface SQLWherePredicate extends EntitySQLTableOwner, SQLLambdaNative>
        , SQLLikePredicate>
        , SQLRangePredicate>
        , SQLSelfPredicate>
        , SQLValuePredicate>
        , SQLValuesPredicate>
        , SQLSubQueryPredicate>
        , SQLAssertPredicate> {
    WherePredicate getWherePredicate();

    default TableAvailable getTable() {
        return getWherePredicate().getTable();
    }



    default  SQLWherePredicate columnFunc(ColumnPropertyFunction columnPropertyFunction, SQLPredicateCompare sqlPredicateCompare, TProperty val) {
        return columnFunc(true, columnPropertyFunction, sqlPredicateCompare, val);
    }

    default  SQLWherePredicate columnFunc(boolean condition, ColumnPropertyFunction columnPropertyFunction, SQLPredicateCompare sqlPredicateCompare, TProperty val) {
        getWherePredicate().columnFunc(condition, columnPropertyFunction, sqlPredicateCompare, val);
        return this;
    }


    default  SQLWherePredicate then(SQLWherePredicate sub) {
        getWherePredicate().then(sub.getWherePredicate());
        return sub;
    }

    default SQLWherePredicate and() {
        return and(true);
    }

    default SQLWherePredicate and(boolean condition) {
        getWherePredicate().and(condition);
        return this;
    }

    default SQLWherePredicate and(SQLExpression1> sqlWherePredicateSQLExpression) {
        return and(true, sqlWherePredicateSQLExpression);
    }

    SQLWherePredicate and(boolean condition, SQLExpression1> sqlWherePredicateSQLExpression);

    default  SQLWherePredicate and(SQLWherePredicate t2SQLWherePredicate, SQLExpression2, SQLWherePredicate> sqlWherePredicateSQLExpression) {
        return and(true, t2SQLWherePredicate, sqlWherePredicateSQLExpression);
    }

     SQLWherePredicate and(boolean condition, SQLWherePredicate t2SQLWherePredicate, SQLExpression2, SQLWherePredicate> sqlWherePredicateSQLExpression);

    default SQLWherePredicate or() {
        return or(true);
    }

    default SQLWherePredicate or(boolean condition) {
        getWherePredicate().or(condition);
        return this;
    }

    default SQLWherePredicate or(SQLExpression1> sqlWherePredicateSQLExpression) {
        return or(true, sqlWherePredicateSQLExpression);
    }

    SQLWherePredicate or(boolean condition, SQLExpression1> sqlWherePredicateSQLExpression);

    default  SQLWherePredicate or(SQLWherePredicate t2SQLWherePredicate, SQLExpression2, SQLWherePredicate> sqlWherePredicateSQLExpression) {
        return or(true, t2SQLWherePredicate, sqlWherePredicateSQLExpression);
    }

     SQLWherePredicate or(boolean condition, SQLWherePredicate t2SQLWherePredicate, SQLExpression2, SQLWherePredicate> sqlWherePredicateSQLExpression);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy