
io.requery.query.element.WhereElement Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of requery Show documentation
Show all versions of requery Show documentation
A light but powerful object mapper and SQL generator for Java/Android
/*
* Copyright 2016 requery.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.requery.query.element;
import io.requery.query.Condition;
import io.requery.query.Expression;
import io.requery.query.Limit;
import io.requery.query.Offset;
import io.requery.query.Return;
import io.requery.query.Selectable;
import io.requery.query.SetHavingOrderByLimit;
import io.requery.query.WhereAndOr;
import java.util.Set;
/**
* Represents the where clause in a sql statement.
*
* @param result type
* @author Nikhil Purushe
*/
public class WhereElement extends BaseLogicalElement, WhereAndOr>
implements WhereAndOr, QueryWrapper, LogicalElement {
private final QueryElement query;
WhereElement(QueryElement query,
Set> where,
Condition,?> condition,
LogicalOperator operator) {
super(where, condition, operator);
this.query = query;
}
@Override
WhereElement newElement(Set> elements, Condition,?> condition,
LogicalOperator operator) {
return new WhereElement<>(query, elements, condition, operator);
}
@Override
public SetHavingOrderByLimit groupBy(Expression>... expressions) {
return query.groupBy(expressions);
}
@Override
public SetHavingOrderByLimit groupBy(Expression expression) {
return query.groupBy(expression);
}
@Override
public Offset limit(int limit) {
return query.limit(limit);
}
@Override
public E get() {
return query.get();
}
@Override
public Limit orderBy(Expression expression) {
return query.orderBy(expression);
}
@Override
public Limit orderBy(Expression>... expressions) {
return query.orderBy(expressions);
}
@Override
public QueryElement unwrapQuery() {
return query;
}
@Override
public Selectable union() {
return query.union();
}
@Override
public Selectable unionAll() {
return query.unionAll();
}
@Override
public Selectable intersect() {
return query.intersect();
}
@Override
public Selectable except() {
return query.except();
}
@Override
public Return as(String alias) {
return query.as(alias);
}
@Override
public String aliasName() {
return query.aliasName();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy