package zmo.technology.lite.core;

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

public class ZeroQuery<T> {

	public static class ZeroCondition {

		private String symbol;
		private String column;
		private String value;
		private List<ZeroCondition> relation;

		public ZeroCondition() {
			super();
			this.symbol = "";
			this.column = "";
			this.value = "";
			this.relation = new ArrayList<>();
		}

		public String getSymbol() {
			return symbol;
		}

		public void setSymbol(String symbol) {
			this.symbol = symbol;
		}

		public String getColumn() {
			return column;
		}

		public void setColumn(String column) {
			this.column = column;
		}

		public String getValue() {
			return value;
		}

		public void setValue(String value) {
			this.value = value;
		}

		public List<ZeroCondition> getRelation() {
			return relation;
		}

		public void setRelation(List<ZeroCondition> relation) {
			this.relation = relation;
		}

	}

	public static class ZeroOrderBy {

		private List<String> columns;
		private String seq;

		public ZeroOrderBy() {
			super();
			this.columns = new ArrayList<>();
			this.seq = "";
		}

		public List<String> getColumns() {
			return columns;
		}

		public void setColumns(List<String> columns) {
			this.columns = columns;
		}

		public String getSeq() {
			return seq;
		}

		public void setSeq(String seq) {
			this.seq = seq;
		}

	}

	public static class ZeroLimit {

		private int start;
		private int length;

		public int getStart() {
			return start;
		}

		public void setStart(int start) {
			this.start = start;
		}

		public int getLength() {
			return length;
		}

		public void setLength(int length) {
			this.length = length;
		}

	}

	private List<String> columns;
	private ZeroCondition condition;
	private ZeroOrderBy orderby;
	private ZeroLimit limit;
	private String tableName;
	private List<T> targets;

	public ZeroQuery() {
		super();
		this.columns = new ArrayList<>();
		this.condition = new ZeroCondition();
		this.orderby = new ZeroOrderBy();
		this.limit = new ZeroLimit();
		this.targets = new ArrayList<>();
	}

	public List<String> getColumns() {
		return columns;
	}

	public void setColumns(List<String> columns) {
		this.columns = columns;
	}

	public ZeroCondition getCondition() {
		return condition;
	}

	public void setCondition(ZeroCondition condition) {
		this.condition = condition;
	}

	public ZeroOrderBy getOrderby() {
		return orderby;
	}

	public void setOrderby(ZeroOrderBy orderby) {
		this.orderby = orderby;
	}

	public ZeroLimit getLimit() {
		return limit;
	}

	public void setLimit(ZeroLimit limit) {
		this.limit = limit;
	}

	public String getTableName() {
		return tableName;
	}

	public ZeroQuery<T> setTableName(String tableName) {
		this.tableName = tableName;
		return this;
	}

	public List<T> getTargets() {
		return targets;
	}

	public void setTargets(List<T> targets) {
		this.targets = targets;
	}

}
