org.fluentjdbc.DbSelectContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fluent-jdbc Show documentation
Show all versions of fluent-jdbc Show documentation
A Java library used to execute JDBC statements and build SQL
package org.fluentjdbc;
import org.fluentjdbc.DatabaseTable.RowMapper;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.sql.Connection;
import java.time.Instant;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.util.stream.Stream;
public class DbSelectContext implements DbListableSelectContext {
private DbTableContext dbTableContext;
private DatabaseTableQueryBuilder queryBuilder;
public DbSelectContext(DbTableContext dbTableContext) {
this.dbTableContext = dbTableContext;
queryBuilder = new DatabaseTableQueryBuilder(dbTableContext.getTable());
}
@Override
public DbSelectContext query() {
return this;
}
@Override
public DbSelectContext whereOptional(String fieldName, @Nullable Object value) {
queryBuilder.whereOptional(fieldName, value);
return this;
}
@Override
public DbSelectContext whereExpression(String expression) {
queryBuilder.whereExpression(expression);
return this;
}
@Override
public DbSelectContext whereExpression(String expression, Object value) {
queryBuilder.whereExpression(expression, value);
return this;
}
@Override
public DbSelectContext whereIn(String fieldName, Collection> parameters) {
queryBuilder.whereIn(fieldName, parameters);
return this;
}
@Override
public DbSelectContext whereExpressionWithMultipleParameters(String expression, Collection> parameters) {
queryBuilder.whereExpressionWithMultipleParameters(expression, parameters);
return this;
}
@Override
public DbSelectContext whereAll(List fields, List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy