/** * It returns a {@link ColumnQueryParser} from {@link java.util.ServiceLoader} * * @return {@link ColumnQueryParser} instance * @throws IllegalStateException when there isn't ColumnQueryParser from service loader. */ static ColumnQueryParser getParser() { return ColumnQueryParserServiceLoader.getInstance(); }
/** * It returns a {@link ColumnQueryParserAsync} from {@link java.util.ServiceLoader} * * @return {@link ColumnQueryParserAsync} instance * @throws IllegalStateException when there isn't ColumnQueryParser from service loader. */ static ColumnQueryParserAsync getParser() { return ColumnQueryParserServiceAsyncLoader.getInstance(); }
@Override public PreparedStatementAsync bind(String name, Object value) { preparedStatementAsync.bind(name, value); return this; }
@Override public ColumnCondition negate() { if (NOT.equals(this.condition)) { return this.column.get(ColumnCondition.class); } else { Column column = Column.of(NOT.getNameField(), this); return new DefaultColumnCondition(column, NOT); } }
static DefaultColumnCondition between(Column column) { Objects.requireNonNull(column, "column is required"); checkBetweenClause(column.get()); return new DefaultColumnCondition(column, BETWEEN); }
static DefaultColumnCondition in(Column column) { Objects.requireNonNull(column, "column is required"); checkInClause(column.get()); return new DefaultColumnCondition(column, IN); }
static DefaultColumnEntity of(String name, List<Column> columns) { DefaultColumnEntity columnEntity = new DefaultColumnEntity(name); columnEntity.addAll(columns); return columnEntity; }
/** * Creates a {@link ColumnCondition} that has a {@link Condition#LESSER_THAN}, it means a select will scanning to a * column family that has the same name and the value lesser than informed in this column. * * @param column a column instance * @return a {@link ColumnCondition} with {@link Condition#LESSER_THAN} * @throws NullPointerException when column is null */ static ColumnCondition lt(Column column) { return DefaultColumnCondition.of(column, LESSER_THAN); }
/** * Creates a column family instance * * @param name a name to column family * @return a ColumnEntity instance */ static ColumnEntity of(String name) { return new DefaultColumnEntity(name); }
/** * Creates a column instance * * @param name - column's name * @param value - column's value * @return a column instance * @see Columns */ static Column of(String name, Value value) { return new DefaultColumn(name, value); }
@Override public PreparedStatement bind(String name, Object value) { preparedStatement.bind(name, value); return this; }
/** * Creates a {@link ColumnCondition} that has a {@link Condition#IN}, it means a select will scanning to a * column family that has the same name and the value is within informed in this column. * * @param column a column instance * @return a {@link ColumnCondition} with {@link Condition#IN} * @throws NullPointerException when column is null * @throws IllegalArgumentException when the {@link Column#get()} in not an iterable implementation */ static ColumnCondition in(Column column) { return DefaultColumnCondition.in(column); }
@Override public Condition getCondition() { return condition.getCondition(); }
/** * Creates a {@link ColumnCondition} that has a {@link Condition#GREATER_THAN}, it means a select will scanning to a * column family that has the same name and the value greater than informed in this column. * * @param column a column instance * @return a {@link ColumnCondition} with {@link Condition#GREATER_THAN} * @throws NullPointerException when column is null */ static ColumnCondition gt(Column column) { return DefaultColumnCondition.of(column, GREATER_THAN); }
/** * Creates a {@link ColumnCondition} that has a {@link Condition#LESSER_EQUALS_THAN}, * it means a select will scanning to a column family that has the same name and the value * lesser or equals than informed in this column. * * @param column a column instance * @return a {@link ColumnCondition} with {@link Condition#LESSER_EQUALS_THAN} * @throws NullPointerException when column is null */ static ColumnCondition lte(Column column) { return DefaultColumnCondition.of(column, LESSER_EQUALS_THAN); }
/** * Creates a {@link ColumnCondition} that has a {@link Condition#GREATER_EQUALS_THAN}, * it means a select will scanning to a column family that has the same name and the value * greater or equals than informed in this column. * * @param column a column instance * @return a {@link ColumnCondition} with {@link Condition#GREATER_EQUALS_THAN} * @throws NullPointerException when column is null */ static ColumnCondition gte(Column column) { return DefaultColumnCondition.of(column, GREATER_EQUALS_THAN); }
/** * Creates a {@link ColumnCondition} that has a {@link Condition#EQUALS}, it means a select will scanning to a * column family that has the same name and equals value informed in this column. * * @param column a column instance * @return a {@link ColumnCondition} with {@link Condition#EQUALS} * @throws NullPointerException when column is null */ static ColumnCondition eq(Column column) { return DefaultColumnCondition.of(column, EQUALS); }
/** * Creates a {@link ColumnCondition} that has a {@link Condition#LIKE}, it means a select will scanning to a * column family that has the same name and the value is like than informed in this column. * * @param column a column instance * @return a {@link ColumnCondition} with {@link Condition#LIKE} * @throws NullPointerException when column is null */ static ColumnCondition like(Column column) { return DefaultColumnCondition.of(column, LIKE); }