public Comparison(Session session, int compareType, Expression left, Expression right) { this.database = session.getDatabase(); this.left = left; this.right = right; this.compareType = compareType; }
/** * Create a new object. * * @param session the session */ public Prepared(Session session) { this.session = session; modificationMetaId = session.getDatabase().getModificationMetaId(); }
/** * Notifies query progress via the DatabaseEventListener */ private void setProgress() { if ((currentRowNumber & 127) == 0) { session.getDatabase().setProgress( DatabaseEventListener.STATE_STATEMENT_PROGRESS, sqlStatement, currentRowNumber, 0); } }
public Parser(Session session) { this.database = session.getDatabase(); this.identifiersToUpper = database.getSettings().databaseToUpper; this.session = session; }
public DropTable(Session session, Schema schema) { super(session, schema); dropAction = session.getDatabase().getSettings().dropRestrict ? ConstraintActionType.RESTRICT : ConstraintActionType.CASCADE; }
public DropView(Session session, Schema schema) { super(session, schema); dropAction = session.getDatabase().getSettings().dropRestrict ? ConstraintActionType.RESTRICT : ConstraintActionType.CASCADE; }
public DropSchema(Session session) { super(session); dropAction = session.getDatabase().getSettings().dropRestrict ? ConstraintActionType.RESTRICT : ConstraintActionType.CASCADE; }
/** * Create a new undo log for the given session. * * @param session the session */ UndoLog(Session session) { this.database = session.getDatabase(); largeTransactions = database.getSettings().largeTransactions; }
@Override public int compare(Value o1, Value o2) { return session.getDatabase().compare(o1, o2); } });
private SortOrder initOrder(ArrayList<SelectOrderBy> orderList, Session session) { int size = orderList.size(); int[] index = new int[size]; int[] sortType = new int[size]; for (int i = 0; i < size; i++) { SelectOrderBy o = orderList.get(i); index[i] = i + 1; int order = o.descending ? SortOrder.DESCENDING : SortOrder.ASCENDING; sortType[i] = order; } return new SortOrder(session.getDatabase(), index, sortType, null); }
private void revokeRole(Role grantedRole) { Right right = grantee.getRightForRole(grantedRole); if (right == null) { return; } Database db = session.getDatabase(); db.removeDatabaseObject(session, right); }
@Override public Column getRowIdColumn() { if (session.getDatabase().getSettings().rowId) { return table.getRowIdColumn(); } return null; }
Command(Parser parser, String sql) { this.session = parser.getSession(); this.sql = sql; trace = session.getDatabase().getTrace(Trace.COMMAND); }
@Override public int update() { if (dropAllObjects) { dropAllObjects(); } if (deleteFiles) { session.getDatabase().setDeleteFilesOnDisconnect(true); } return 0; }
private void checkClustering(Column c) { if (!Constants.CLUSTERING_DISABLED .equals(session.getDatabase().getCluster()) && c.isAutoIncrement()) { throw DbException.getUnsupportedException( "CLUSTERING && auto-increment columns"); } }
@Override public Expression optimize(Session session) { if (session.getDatabase().getMode().treatEmptyStringsAsNull) { if (value instanceof ValueString) { value = ValueString.get(value.getString(), true); } } return this; }
public void setGranteeName(String granteeName) { Database db = session.getDatabase(); grantee = db.findUser(granteeName); if (grantee == null) { grantee = db.findRole(granteeName); if (grantee == null) { throw DbException.get(ErrorCode.USER_OR_ROLE_NOT_FOUND_1, granteeName); } } }
private void removeSequence(Table table, Sequence sequence) { if (sequence != null) { table.removeSequence(sequence); sequence.setBelongsToTable(false); Database db = session.getDatabase(); db.removeSchemaObject(session, sequence); } }
/** * Initialize the table. * * @param session the session */ void init(Session session) { primaryIndex = new MVPrimaryIndex(session.getDatabase(), this, getId(), IndexColumn.wrap(getColumns()), IndexType.createScan(true)); indexes.add(primaryIndex); }
@Override public Expression[] getExpressionColumns(Session session) { ExpressionColumn[] expr = new ExpressionColumn[list.length]; for (int i = 0; i < list.length; i++) { Expression e = list[i]; Column col = new Column("C" + (i + 1), e.getType(), e.getPrecision(), e.getScale(), e.getDisplaySize()); expr[i] = new ExpressionColumn(session.getDatabase(), col); } return expr; }