@Override public void reset(boolean beforeQuery) { if (resultSize != 0 && !resetAfterFind()) { // find was not called, need to just clear runners for (int i = 0; i < resultSize; i++) { queryRunner(i).clear(); } resultSize = 0; } }
/** * Get or generate a default value for the given column. * * @param session the session * @param column the column * @return the value */ public Value getDefaultValue(Session session, Column column) { return getGeneratedValue(session, column, column.getDefaultExpression()); }
boolean isOk(boolean ignoreJoinCondition) { boolean filterOk = filter.isOk(filter.getFilterCondition()); boolean joinOk = filter.isOk(filter.getJoinCondition()); return filterOk && (ignoreJoinCondition || joinOk); }
/** * Set all missing indexes to scan indexes recursively. */ private void setScanIndexes() { if (index == null) { setIndex(table.getScanIndex(session)); } if (join != null) { join.setScanIndexes(); } if (nestedJoin != null) { nestedJoin.setScanIndexes(); } }
/** * Lock the table. This will also lock joined tables. * * @param s the session * @param exclusive true if an exclusive lock is required * @param forceLockEvenInMvcc lock even in the MVCC mode */ public void lock(Session s, boolean exclusive, boolean forceLockEvenInMvcc) { table.lock(s, exclusive, forceLockEvenInMvcc); if (join != null) { join.lock(s, exclusive, forceLockEvenInMvcc); } }
Row getNullRow() { return filter.getTable().getNullRow(); }
@Override public Index getScanIndex(Session session) { return getBestPlanItem(session, null, null, -1, null, null).getIndex(); }
protected final boolean resetAfterFind() { if (!findCalled) { return false; } findCalled = false; // method find was called, we need to reset futures to initial state // for reuse for (int i = 0; i < resultSize; i++) { queryRunner(i).reset(); } resultSize = 0; return true; }
/** * Remove the given view from the list. * * @param synonym the synonym to remove */ public void removeSynonym(TableSynonym synonym) { remove(synonyms, synonym); }
@Override public int getColumnIndex(Column col) { for (int i = 0, len = columns.length; i < len; i++) { if (columns[i].equals(col)) { return i; } } return -1; }
/** * Get a row from the main index. * * @param session the session * @param key the row key * @return the row */ @Override public Row getRow(Session session, long key) { return tableData.getRow(session, key); }
/** * Add a subquery info on top of the subquery info stack. * * @param masks the mask * @param filters the filters * @param filter the filter index * @param sortOrder the sort order */ public void pushSubQueryInfo(int[] masks, TableFilter[] filters, int filter, SortOrder sortOrder) { subQueryInfo = new SubQueryInfo(subQueryInfo, masks, filters, filter, sortOrder); }
/** * Register the table filter and lookup batch. * * @param filter table filter * @param lookupBatch lookup batch */ public void register(TableFilter filter, IndexLookupBatch lookupBatch) { assert filter != null; top = new JoinFilter(lookupBatch, filter, top); filters[top.id] = top; }
public TableView(Schema schema, int id, String name, String querySQL, ArrayList<Parameter> params, Column[] columnTemplates, Session session, boolean allowRecursive, boolean literalsChecked, boolean isTableExpression, boolean isPersistent) { super(schema, id, name, false, true); init(querySQL, params, columnTemplates, session, allowRecursive, literalsChecked, isTableExpression, isPersistent); }
/** * Generates on update value for the given column. * * @param session the session * @param column the column * @return the value */ public Value getOnUpdateValue(Session session, Column column) { return getGeneratedValue(session, column, column.getOnUpdateExpression()); }
/** * Remove the given constraint from the list. * * @param constraint the constraint to remove */ public void removeConstraint(Constraint constraint) { remove(constraints, constraint); }
/** * Get the complete row from the data index. * * @param key the key * @return the row */ SearchRow readRow(long key) { return tableData.getRow(null, key); }