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

db.sql.api.cmd.executor.method.IJoinMethod Maven / Gradle / Ivy

There is a newer version: 1.7.6-RC2
Show newest version
package db.sql.api.cmd.executor.method;

import db.sql.api.cmd.JoinMode;
import db.sql.api.cmd.basic.IDataset;
import db.sql.api.cmd.basic.IDatasetField;

import java.util.function.Consumer;

public interface IJoinMethod {

    default , DATASET_FIELD extends IDatasetField> SELF join(DATASET mainTable, DATASET secondTable, Consumer consumer) {
        return this.join(JoinMode.INNER, mainTable, secondTable, consumer);
    }

    , DATASET_FIELD extends IDatasetField, DATASET2 extends IDataset, DATASET_FIELD2 extends IDatasetField> SELF join(JoinMode mode, DATASET mainTable, DATASET2 secondTable, Consumer consumer);

    default SELF join(JoinMode mode, Class mainTable, Class secondTable) {
        return join(mode, mainTable, secondTable, null);
    }

    default SELF join(Class mainTable, Class secondTable) {
        return join(JoinMode.INNER, mainTable, secondTable);
    }

    default SELF join(Class mainTable, Class secondTable, Consumer consumer) {
        return join(JoinMode.INNER, mainTable, secondTable, consumer);
    }

    default SELF join(JoinMode mode, Class mainTable, Class secondTable, Consumer consumer) {
        return join(mode, mainTable, 1, secondTable, 1, consumer);
    }

    default SELF join(Class mainTable, int mainTableStorey, Class secondTable, int secondTableStorey) {
        return join(JoinMode.INNER, mainTable, mainTableStorey, secondTable, secondTableStorey);
    }

    default SELF join(JoinMode mode, Class mainTable, int mainTableStorey, Class secondTable, int secondTableStorey) {
        return join(mode, mainTable, mainTableStorey, secondTable, secondTableStorey, null);
    }

    default SELF join(Class mainTable, int mainTableStorey, Class secondTable, int secondTableStorey, Consumer consumer) {
        return join(JoinMode.INNER, mainTable, mainTableStorey, secondTable, secondTableStorey, consumer);
    }

    SELF join(JoinMode mode, Class mainTable, int mainTableStorey, Class secondTable, int secondTableStorey, Consumer consumer);


    default , DATASET_FIELD extends IDatasetField> SELF join(Class mainTable, DATASET secondTable, Consumer consumer) {
        return join(JoinMode.INNER, mainTable, secondTable, consumer);
    }

    default , DATASET_FIELD extends IDatasetField> SELF join(JoinMode mode, Class mainTable, DATASET secondTable, Consumer consumer) {
        return join(mode, mainTable, 1, secondTable, consumer);
    }

    default , DATASET_FIELD extends IDatasetField> SELF join(Class mainTable, int mainTableStorey, DATASET secondTable, Consumer consumer) {
        return join(JoinMode.INNER, mainTable, mainTableStorey, secondTable, consumer);
    }

    , DATASET_FIELD extends IDatasetField> SELF join(JoinMode mode, Class mainTable, int mainTableStorey, DATASET secondTable, Consumer consumer);

    /**
     * 实体类拦截
     *
     * @param mainTable
     * @param mainTableStorey
     * @param secondTable
     * @param consumer
     * @return
     */
    default Consumer joinEntityIntercept(Class mainTable, int mainTableStorey, Class secondTable, int secondTableStorey, Consumer consumer) {
        return consumer;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy