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

com.easy.query.api4j.select.abstraction.AbstractQueryable3 Maven / Gradle / Ivy

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

import com.easy.query.api4j.select.Queryable;
import com.easy.query.api4j.select.Queryable3;
import com.easy.query.api4j.select.Queryable4;
import com.easy.query.api4j.select.impl.EasyQueryable;
import com.easy.query.api4j.select.impl.EasyQueryable4;
import com.easy.query.api4j.sql.SQLColumnAsSelector;
import com.easy.query.api4j.sql.SQLGroupBySelector;
import com.easy.query.api4j.sql.SQLOrderBySelector;
import com.easy.query.api4j.sql.SQLWhereAggregatePredicate;
import com.easy.query.api4j.sql.SQLWherePredicate;
import com.easy.query.api4j.sql.impl.SQLColumnAsSelectorImpl;
import com.easy.query.api4j.sql.impl.SQLGroupBySelectorImpl;
import com.easy.query.api4j.sql.impl.SQLOrderByColumnSelectorImpl;
import com.easy.query.api4j.sql.impl.SQLWherePredicateImpl;
import com.easy.query.core.basic.api.select.ClientQueryable;
import com.easy.query.core.basic.api.select.ClientQueryable3;
import com.easy.query.core.basic.api.select.ClientQueryable4;
import com.easy.query.core.enums.sharding.ConnectionModeEnum;
import com.easy.query.core.expression.lambda.SQLExpression1;
import com.easy.query.core.expression.lambda.SQLExpression3;
import com.easy.query.core.expression.lambda.SQLExpression4;

import java.util.function.Function;

/**
 * @author xuejiaming
 * @FileName: AbstractQueryable3.java
 * @Description: 文件说明
 * @Date: 2023/2/6 23:43
 */
public abstract class AbstractQueryable3 extends AbstractQueryable implements Queryable3 {


    protected final ClientQueryable3 entityQueryable3;

    public AbstractQueryable3(ClientQueryable3 entityQueryable3) {
        super(entityQueryable3);
        this.entityQueryable3 = entityQueryable3;
    }

    @Override
    public ClientQueryable3 getClientQueryable3() {
        return entityQueryable3;
    }

    @Override
    public  Queryable4 leftJoin(Class joinClass, SQLExpression4, SQLWherePredicate, SQLWherePredicate, SQLWherePredicate> on) {
        ClientQueryable4 entityQueryable4 = entityQueryable3.leftJoin(joinClass, (where1, where2, where3, where4) -> {
            on.apply(new SQLWherePredicateImpl<>(where1), new SQLWherePredicateImpl<>(where2), new SQLWherePredicateImpl<>(where3), new SQLWherePredicateImpl<>(where4));
        });
        return new EasyQueryable4<>(entityQueryable4);
    }

    @Override
    public  Queryable4 leftJoin(Queryable joinQueryable, SQLExpression4, SQLWherePredicate, SQLWherePredicate, SQLWherePredicate> on) {
        ClientQueryable4 entityQueryable4 = entityQueryable3.leftJoin(joinQueryable.getEntityQueryable(), (where1, where2, where3, where4) -> {
            on.apply(new SQLWherePredicateImpl<>(where1), new SQLWherePredicateImpl<>(where2), new SQLWherePredicateImpl<>(where3), new SQLWherePredicateImpl<>(where4));
        });
        return new EasyQueryable4<>(entityQueryable4);
    }

    @Override
    public  Queryable4 rightJoin(Class joinClass, SQLExpression4, SQLWherePredicate, SQLWherePredicate, SQLWherePredicate> on) {
        ClientQueryable4 entityQueryable4 = entityQueryable3.rightJoin(joinClass, (where1, where2, where3, where4) -> {
            on.apply(new SQLWherePredicateImpl<>(where1), new SQLWherePredicateImpl<>(where2), new SQLWherePredicateImpl<>(where3), new SQLWherePredicateImpl<>(where4));
        });
        return new EasyQueryable4<>(entityQueryable4);
    }

    @Override
    public  Queryable4 rightJoin(Queryable joinQueryable, SQLExpression4, SQLWherePredicate, SQLWherePredicate, SQLWherePredicate> on) {
        ClientQueryable4 entityQueryable4 = entityQueryable3.rightJoin(joinQueryable.getEntityQueryable(), (where1, where2, where3, where4) -> {
            on.apply(new SQLWherePredicateImpl<>(where1), new SQLWherePredicateImpl<>(where2), new SQLWherePredicateImpl<>(where3), new SQLWherePredicateImpl<>(where4));
        });
        return new EasyQueryable4<>(entityQueryable4);
    }

    @Override
    public  Queryable4 innerJoin(Class joinClass, SQLExpression4, SQLWherePredicate, SQLWherePredicate, SQLWherePredicate> on) {
        ClientQueryable4 entityQueryable4 = entityQueryable3.innerJoin(joinClass, (where1, where2, where3, where4) -> {
            on.apply(new SQLWherePredicateImpl<>(where1), new SQLWherePredicateImpl<>(where2), new SQLWherePredicateImpl<>(where3), new SQLWherePredicateImpl<>(where4));
        });
        return new EasyQueryable4<>(entityQueryable4);
    }

    @Override
    public  Queryable4 innerJoin(Queryable joinQueryable, SQLExpression4, SQLWherePredicate, SQLWherePredicate, SQLWherePredicate> on) {
        ClientQueryable4 entityQueryable4 = entityQueryable3.innerJoin(joinQueryable.getEntityQueryable(), (where1, where2, where3, where4) -> {
            on.apply(new SQLWherePredicateImpl<>(where1), new SQLWherePredicateImpl<>(where2), new SQLWherePredicateImpl<>(where3), new SQLWherePredicateImpl<>(where4));
        });
        return new EasyQueryable4<>(entityQueryable4);
    }

    @Override
    public Queryable3 whereById(boolean condition, Object id) {
        super.whereById(condition, id);
        return this;
    }

    @Override
    public Queryable3 whereObject(boolean condition, Object object) {
        super.whereObject(condition, object);
        return this;
    }

    @Override
    public Queryable3 where(boolean condition, SQLExpression1> whereExpression) {
        super.where(condition, whereExpression);
        return this;
    }

    @Override
    public Queryable3 where(boolean condition, SQLExpression3, SQLWherePredicate, SQLWherePredicate> whereExpression) {
        if (condition) {
            entityQueryable3.where((where1, where2, where3) -> {
                whereExpression.apply(new SQLWherePredicateImpl<>(where1), new SQLWherePredicateImpl<>(where2), new SQLWherePredicateImpl<>(where3));
            });
        }
        return this;
    }

    @Override
    public  Queryable select(Class resultClass, SQLExpression3, SQLColumnAsSelector, SQLColumnAsSelector> selectExpression) {
        ClientQueryable select = entityQueryable3.select(resultClass, (selector1, selector2, selector3) -> {
            selectExpression.apply(new SQLColumnAsSelectorImpl<>(selector1), new SQLColumnAsSelectorImpl<>(selector2), new SQLColumnAsSelectorImpl<>(selector3));
        });
        return new EasyQueryable<>(select);
    }

    @Override
    public Queryable3 groupBy(boolean condition, SQLExpression1> selectExpression) {
        super.groupBy(condition, selectExpression);
        return this;
    }

    @Override
    public Queryable3 groupBy(boolean condition, SQLExpression3, SQLGroupBySelector, SQLGroupBySelector> selectExpression) {
        if (condition) {
            entityQueryable3.groupBy((selector1, selector2, selector3) -> {
                selectExpression.apply(new SQLGroupBySelectorImpl<>(selector1), new SQLGroupBySelectorImpl<>(selector2), new SQLGroupBySelectorImpl<>(selector3));
            });
        }
        return this;
    }

    @Override
    public Queryable3 having(boolean condition, SQLExpression1> predicateExpression) {
        super.having(condition, predicateExpression);
        return this;
    }

    @Override
    public Queryable3 orderByAsc(boolean condition, SQLExpression1> selectExpression) {
        super.orderByAsc(condition, selectExpression);
        return this;
    }

    @Override
    public Queryable3 orderByAsc(boolean condition, SQLExpression3, SQLOrderBySelector, SQLOrderBySelector> selectExpression) {
        if (condition) {
            entityQueryable3.orderByAsc((selector1, selector2, selector3) -> {
                selectExpression.apply(new SQLOrderByColumnSelectorImpl<>(selector1), new SQLOrderByColumnSelectorImpl<>(selector2), new SQLOrderByColumnSelectorImpl<>(selector3));
            });
        }
        return this;
    }

    @Override
    public Queryable3 orderByDesc(boolean condition, SQLExpression1> selectExpression) {
        super.orderByDesc(condition, selectExpression);
        return this;
    }

    @Override
    public Queryable3 orderByDesc(boolean condition, SQLExpression3, SQLOrderBySelector, SQLOrderBySelector> selectExpression) {
        if (condition) {
            entityQueryable3.orderByDesc((selector1, selector2, selector3) -> {
                selectExpression.apply(new SQLOrderByColumnSelectorImpl<>(selector1), new SQLOrderByColumnSelectorImpl<>(selector2), new SQLOrderByColumnSelectorImpl<>(selector3));
            });
        }
        return this;
    }

    @Override
    public Queryable3 limit(boolean condition, long offset, long rows) {
        super.limit(condition, offset, rows);
        return this;
    }

    @Override
    public Queryable3 distinct(boolean condition) {
        super.distinct(condition);
        return this;
    }

    @Override
    public Queryable3 disableLogicDelete() {
        super.disableLogicDelete();
        return this;
    }

    @Override
    public Queryable3 enableLogicDelete() {
        super.enableLogicDelete();
        return this;
    }

    @Override
    public Queryable3 useLogicDelete(boolean enable) {
        super.useLogicDelete(enable);
        return this;
    }

    @Override
    public Queryable3 noInterceptor() {
        super.noInterceptor();
        return this;
    }

    @Override
    public Queryable3 useInterceptor(String name) {
        super.useInterceptor(name);
        return this;
    }

    @Override
    public Queryable3 noInterceptor(String name) {
        super.noInterceptor(name);
        return this;
    }

    @Override
    public Queryable3 useInterceptor() {
        super.useInterceptor();
        return this;
    }

    @Override
    public Queryable3 asTracking() {
        super.asTracking();
        return this;
    }

    @Override
    public Queryable3 asNoTracking() {
        super.asNoTracking();
        return this;
    }

    @Override
    public Queryable3 queryLargeColumn(boolean queryLarge) {
        super.queryLargeColumn(queryLarge);
        return this;
    }

    @Override
    public Queryable3 useShardingConfigure(int maxShardingQueryLimit, ConnectionModeEnum connectionMode) {
        super.useShardingConfigure(maxShardingQueryLimit, connectionMode);
        return this;
    }

    @Override
    public Queryable3 useMaxShardingQueryLimit(int maxShardingQueryLimit) {
        super.useMaxShardingQueryLimit(maxShardingQueryLimit);
        return this;
    }

    @Override
    public Queryable3 useConnectionMode(ConnectionModeEnum connectionMode) {
        super.useConnectionMode(connectionMode);
        return this;
    }

    @Override
    public Queryable3 asTable(Function tableNameAs) {
        super.asTable(tableNameAs);
        return this;
    }

    @Override
    public Queryable3 asSchema(Function schemaAs) {
        super.asSchema(schemaAs);
        return this;
    }


    @Override
    public Queryable3 asAlias(String alias) {
        super.asAlias(alias);
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy