public DropView(Session session, Schema schema) { super(session, schema); dropAction = session.getDatabase().getSettings().dropRestrict ? AlterTableAddConstraint.RESTRICT : AlterTableAddConstraint.CASCADE; }
/** * Construct a new row list for this session. * * @param session the session */ public RowList(Session session) { this.session = session; maxMemory = session.getDatabase().getMaxOperationMemory(); }
@Override public int compare(Value o1, Value o2) { return session.getDatabase().compare(o1, o2); } });
public void setAutoCommit(boolean b) { if (autoCommit == b) { return; } if (!getAutoCommit()) { commit(); } autoCommit = b; }
/** * Begin a transaction. */ public void begin() { setAutoCommit(false); }
public Comparison(Session session, int compareType, Expression left, Expression right) { this.database = session.getDatabase(); this.left = left; this.right = right; this.compareType = compareType; }
/** * Immediately close the database. */ public void shutdownImmediately() { close(); }
/** * INTERNAL. * Get the settings for the given properties (may not be null). * * @param s the settings * @return the settings */ public static DbSettings getInstance(HashMap<String, String> s) { return new DbSettings(s); }
@Override public Value getValue(Session session) { lastValue = session.getVariable(name); return lastValue; }
/** * Parse and prepare the given SQL statement. This method also checks the * rights. * * @param sql the SQL statement * @return the prepared statement */ public Prepared prepare(String sql) { return prepare(sql, false); }
public SessionFactoryBuilder dbCluster(List<Shard> cluster) { vaildateCluster(cluster); configuration.cluster = cluster; return this; }
public void setQueryStatisticsMaxEntries(int n) { queryStatisticsMaxEntries = n; if (queryStatisticsData != null) { synchronized (this) { if (queryStatisticsData != null) { queryStatisticsData.setMaxQueryEntries(queryStatisticsMaxEntries); } } } }
@Override public void cancel() { this.cancel = true; this.session.doCancel(); }
/** * Get the complete version number of this database, consisting of * the major version, the minor version, the build id, and the build date. * * @return the complete version */ public static String getFullVersion() { return getVersion() + " (" + BUILD_DATE + ")"; }
private void initVariables() { if (variables == null) { variables = database.newStringMap(); } }
/** * Prepare an command. This will parse the SQL statement. * * @param sql the SQL statement * @param fetchSize the fetch size (used in remote connections) * @return the command */ CommandInterface prepareCommand(String sql, int fetchSize) { return session.prepareCommand(sql, fetchSize); }
/** * @return */ public boolean isClosed() { return dbSession.isClosed(); }
public Parser(Session session) { this.database = session.getDatabase(); this.identifiersToUpper = database.getSettings().databaseToUpper; this.session = session; }
@Override public void run() { if (database != null) { database.close(); } } }
public DropTable(Session session, Schema schema) { super(session, schema); dropAction = session.getDatabase().getSettings().dropRestrict ? AlterTableAddConstraint.RESTRICT : AlterTableAddConstraint.CASCADE; }