private void initVariables() { if (variables == null) { variables = database.newStringMap(); } }
/** * Create a new schema object. * * @param database the database * @param id the object id * @param schemaName the schema name * @param owner the owner of the schema * @param system if this is a system schema (such a schema can not be * dropped) */ public Schema(Database database, String schemaName, User owner, boolean system) { tablesAndViews = database.newStringMap(); indexes = database.newStringMap(); sequences = database.newStringMap(); initDbObjectBase(database, schemaName); this.owner = owner; this.system = system; }
/** * Create a savepoint that is linked to the current log position. * * @param name the savepoint name */ public void addSavepoint(final String name) { if (savepoints == null) { savepoints = database.newStringMap(); } Savepoint sp = new Savepoint(); sp.savepointName = name; transaction.addSavepoint(name); savepoints.put(name, sp); }
public Table(Schema schema, String name) { columnMap = schema.getDatabase().newStringMap(); initSchemaObjectBase(schema, name); }
/** * Add a local temporary index to this session. * * @param index the index to add * @throws DbException if a index with this name already exists */ public void addLocalTempTableIndex(Index index) { if (localTempTableIndexes == null) { localTempTableIndexes = database.newStringMap(); } if (localTempTableIndexes.get(index.getName()) != null) { throw DbException.get(ErrorCode.INDEX_ALREADY_EXISTS_1, index.getSQL()); } localTempTableIndexes.put(index.getName(), index); }
/** * Add a local temporary table to this session. * * @param table the table to add * @throws DbException if a table with this name already exists */ public void addLocalTempTable(Table table) { if (localTempTables == null) { localTempTables = database.newStringMap(); } if (localTempTables.get(table.getName()) != null) { throw DbException.get(ErrorCode.TABLE_OR_VIEW_ALREADY_EXISTS_1, table.getSQL()); } localTempTables.put(table.getName(), table); }
@Override public void addSavepoint(final String name) { checkClosed(); if (savepoints == null) { savepoints = session.getDatabase().newStringMap(); } final Map<String, Savepoint> binds = New.hashMap(); connHolder.foreach(new Callback<String>() { @Override public String handle(String shardName, Connection connection) throws SQLException { Savepoint savepoint = connection.setSavepoint(name); binds.put(shardName, savepoint); return shardName; } }); CombinedSavepoint sp = new CombinedSavepoint(); sp.combined = binds; savepoints.put(name, sp); }