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

db.sql.api.cmd.struct.Joins Maven / Gradle / Ivy

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


import db.sql.api.Cmd;
import db.sql.api.SqlBuilderContext;
import db.sql.api.tookit.CmdUtils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Joins implements Cmd {

    private final List joins;

    public Joins() {
        this(new ArrayList<>());
    }

    public Joins(List joins) {
        this.joins = joins;
    }

    public void add(JOIN join) {
        this.joins.add(join);
    }

    @Override
    public StringBuilder sql(Cmd module, Cmd parent, SqlBuilderContext context, StringBuilder sqlBuilder) {
        return CmdUtils.join(module, this, context, sqlBuilder, this.joins);
    }

    @Override
    public boolean contain(Cmd cmd) {
        return CmdUtils.contain(cmd, this.joins);
    }

    public List getJoins() {
        return Collections.unmodifiableList(joins);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy