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

com.github.schlak.universalQB.Definition.StatementBoxes.BasicSelectBox Maven / Gradle / Ivy

Go to download

The java lib universalQB can be used to access different databases using formalized objects. These objects got converted into a query matching to the syntactical rules of the database management system

There is a newer version: 0.6.4
Show newest version
package com.github.schlak.universalQB.Definition.StatementBoxes;

import com.github.schlak.universalQB.Definition.GeneralObjects.ConditionStack;
import com.github.schlak.universalQB.ObjectRecycler;

/**
 * Created by Jonas Schlak on 24.01.17.
 */
public abstract class BasicSelectBox extends StatementBox {

    protected String tableName;
    protected String shownColumnList;
    protected String orderAOderByColumnList;
    protected String groupingColumnList;
    protected String tableJoinInformationList;
    protected ConditionStack whereConditionStack;
    protected ConditionStack havingConditionStack;

    /**
     * Instantiates a new Select box.
     */
    public BasicSelectBox() {
        clean();
    }

    public void init(String tableName, String shownColumnList,
                     String orderAOderByColumnList, String groupingColumnList,
                     String tableJoinInformationList,
                     ConditionStack whereConditionStack,
                     ConditionStack havingConditionStack) {
        this.tableName = tableName;
        this.shownColumnList = shownColumnList;
        this.orderAOderByColumnList = orderAOderByColumnList;
        this.groupingColumnList = groupingColumnList;
        this.tableJoinInformationList = tableJoinInformationList;
        this.whereConditionStack = whereConditionStack;
        this.havingConditionStack = havingConditionStack;
    }

    @Override
    public Class getType() {
        return BasicSelectBox.class;
    }

    @Override
    public void clean() {

        if (whereConditionStack != null)
            ObjectRecycler.returnInstance(whereConditionStack);
        if (havingConditionStack != null)
            ObjectRecycler.returnInstance(havingConditionStack);

        this.tableName = "";
        this.shownColumnList = "";
        this.orderAOderByColumnList = "";
        this.groupingColumnList = "";
        this.tableJoinInformationList = "";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy