br.com.objectos.sql.AbstractSimpleSelectWhere5 Maven / Gradle / Ivy
package br.com.objectos.sql;
import br.com.objectos.db.Condition;
import br.com.objectos.db.Dialect;
import br.com.objectos.db.IntTypeColumn;
import br.com.objectos.db.LocalDateTypeColumn;
import br.com.objectos.db.Order;
import br.com.objectos.db.Orderable;
import br.com.objectos.db.ParameterBinder;
import br.com.objectos.db.SelectBuilder;
import br.com.objectos.db.Selectable;
import br.com.objectos.db.StringTypeColumn;
import javax.annotation.Generated;
@Generated("br.com.objectos.sql.BootProcessor")
abstract class AbstractSimpleSelectWhere5 extends SelectNode> implements SimpleSelectWhere> {
private Condition condition;
public AbstractSimpleSelectWhere5(SelectNode> previous) {
super(previous);
}
@Override
public SimpleSelectWhere5Int and(X column) {
setCondition();
return new SimpleSelectWhere5Int<>(this, Keyword.AND, column);
}
@Override
public SimpleSelectWhere5LocalDate and(X column) {
setCondition();
return new SimpleSelectWhere5LocalDate<>(this, Keyword.AND, column);
}
@Override
public SimpleSelectWhere5String and(X column) {
setCondition();
return new SimpleSelectWhere5String<>(this, Keyword.AND, column);
}
@Override
public SimpleSelectQuery5 compile(Dialect dialect) {
setCondition();
return new SimpleSelectQuery5<>(dialect, this);
}
@Override
public SimpleSelectOrderBy5 orderBy(Orderable o1) {
return orderBy(o1.asc());
}
@Override
public SimpleSelectOrderBy5 orderBy(Order o1) {
return orderBy0(o1);
}
@Override
ParameterBinder bind0(ParameterBinder binder) {
if (condition != null) {
condition.bind(binder);
}
return binder;
}
abstract Condition condition();
@Override
SelectBuilder write0(SelectBuilder sql) {
return condition != null ? sql.where(condition) : sql;
}
private SimpleSelectOrderBy5 orderBy0(Order... columns) {
setCondition();
return new SimpleSelectOrderBy5<>(this, columns);
}
private void setCondition() {
condition = condition();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy