If you are defining your own custom persister, then chances are you should extend {@link BaseDataType}. See {@link DatabaseField#persisterClass()}.
366367368369370371372373
*/ public Where<T, ID> or(Where<T, ID> left, Where<T, ID> right, Where<T, ID>... others) { Clause[] clauses = buildClauseArray(others, "OR"); Clause secondClause = pop("OR"); Clause firstClause = pop("OR"); addClause(new ManyClause(firstClause, secondClause, clauses, ManyClause.OR_OPERATION)); return this; }
387388389390391392393394
} Clause[] clauses = new Clause[numClauses]; for (int i = numClauses - 1; i >= 0; i--) { clauses[i] = pop("OR"); } addClause(new ManyClause(clauses, ManyClause.OR_OPERATION)); return this; }
332333334335336337338339
/** * Used to NOT the next clause specified. */ public Where<T, ID> not() { addNeedsFuture(new Not()); return this; }
340341342343344345346347
/** * Used to NOT the argument clause specified. */ public Where<T, ID> not(Where<T, ID> comparison) { addClause(new Not(pop("NOT"))); return this; }
141142143144145146147148
throw new IllegalArgumentException("Can't orderBy foreign colletion field: " + columnName); } if (orderByList == null) { orderByList = new ArrayList<OrderBy>(); } orderByList.add(new OrderBy(columnName, ascending)); return this; }
420421422423424425426427
* Add a raw statement as part of the where that can be anything that the database supports. Using more structured * methods is recommended but this gives more control over the query and allows you to utilize database specific * features. */ public Where<T, ID> raw(String rawStatement) { addClause(new Raw(rawStatement)); return this; }
6465666768697071
public StatementBuilder<T, ID> updateColumnExpression(String columnName, String expression) throws SQLException { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new SQLException("Can't update foreign colletion field: " + columnName); } addUpdateColumnToList(columnName, new SetExpression(columnName, fieldType, expression)); return this; }
4546474849505152
public StatementBuilder<T, ID> updateColumnValue(String columnName, Object value) throws SQLException { FieldType fieldType = verifyColumnName(columnName); if (fieldType.isForeignCollection()) { throw new SQLException("Can't update foreign colletion field: " + columnName); } addUpdateColumnToList(columnName, new SetValue(columnName, fieldType, value)); return this; }
198199200201202203204205206
/** * Add a '=' clause so the column must be equal to the value. */ public Where<T, ID> eq(String columnName, Object value) throws SQLException { addClause(new SimpleComparison(columnName, findColumnFieldType(columnName), value, SimpleComparison.EQUAL_TO_OPERATION)); return this; }
207208209210211212213214215
/** * Add a '>=' clause so the column must be greater-than or equals-to the value. */ public Where<T, ID> ge(String columnName, Object value) throws SQLException { addClause(new SimpleComparison(columnName, findColumnFieldType(columnName), value, SimpleComparison.GREATER_THAN_EQUAL_TO_OPERATION)); return this; }