private Index createIndex(Table t, IndexColumn[] cols, boolean unique) { int indexId = getObjectId(); IndexType indexType; if (unique) { // for unique constraints indexType = IndexType.createUnique(t.isPersistIndexes(), false); } else { // constraints indexType = IndexType.createNonUnique(t.isPersistIndexes()); } indexType.setBelongsToConstraint(true); String prefix = constraintName == null ? "CONSTRAINT" : constraintName; String indexName = t.getSchema().getUniqueIndexName(session, t, prefix + "_INDEX_"); try { Index index = t.addIndex(session, indexName, indexId, cols, indexType, true, null); createdIndexes.add(index); return index; } finally { getSchema().freeUniqueName(indexName); } }
String indexName = table.getSchema().getUniqueIndexName( session, table, Constants.PREFIX_PRIMARY_KEY); int id = getObjectId(); try { index = table.addIndex(session, indexName, id, int constraintId = getObjectId(); String name = generateConstraintName(table); ConstraintUnique pk = new ConstraintUnique(getSchema(), int id = getObjectId(); String name = generateConstraintName(table); ConstraintUnique unique = new ConstraintUnique(getSchema(), id, int id = getObjectId(); String name = generateConstraintName(table); ConstraintCheck check = new ConstraintCheck(getSchema(), id, name, table); int id = getObjectId(); String name = generateConstraintName(table); ConstraintReferential refConstraint = new ConstraintReferential(getSchema(),
private Index createIndex(Table t, IndexColumn[] cols, boolean unique) { int indexId = getObjectId(); IndexType indexType; if (unique) { // for unique constraints indexType = IndexType.createUnique(t.isPersistIndexes(), false); } else { // constraints indexType = IndexType.createNonUnique(t.isPersistIndexes()); } indexType.setBelongsToConstraint(true); String prefix = constraintName == null ? "CONSTRAINT" : constraintName; String indexName = t.getSchema().getUniqueIndexName(session, t, prefix + "_INDEX_"); try { Index index = t.addIndex(session, indexName, indexId, cols, indexType, true, null); createdIndexes.add(index); return index; } finally { getSchema().freeUniqueName(indexName); } }
private Index createIndex(Table t, IndexColumn[] cols, boolean unique) { int indexId = getObjectId(); IndexType indexType; if (unique) { // for unique constraints indexType = IndexType.createUnique(t.isPersistIndexes(), false); } else { // constraints indexType = IndexType.createNonUnique(t.isPersistIndexes()); } indexType.setBelongsToConstraint(true); String prefix = constraintName == null ? "CONSTRAINT" : constraintName; String indexName = t.getSchema().getUniqueIndexName(session, t, prefix + "_INDEX_"); try { Index index = t.addIndex(session, indexName, indexId, cols, indexType, true, null); createdIndexes.add(index); return index; } finally { getSchema().freeUniqueName(indexName); } }
private Index createIndex(Table t, IndexColumn[] cols, boolean unique) throws SQLException { int indexId = getObjectId(true, false); IndexType indexType; if (unique) { // TODO default index (hash or not; memory or not or same as table) // for unique constraints indexType = IndexType.createUnique(t.isPersistent(), false); } else { // TODO default index (memory or not or same as table) for unique // constraints indexType = IndexType.createNonUnique(t.isPersistent()); } indexType.setBelongsToConstraint(true); String prefix = constraintName == null ? "CONSTRAINT" : constraintName; String indexName = t.getSchema().getUniqueIndexName(t, prefix + "_INDEX_"); Index idx; try { idx = t.addIndex(session, indexName, indexId, cols, indexType, Index.EMPTY_HEAD, null); } finally { getSchema().freeUniqueName(indexName); } return idx; }
String indexName = table.getSchema().getUniqueIndexName( session, table, Constants.PREFIX_PRIMARY_KEY); int id = getObjectId(); try { index = table.addIndex(session, indexName, id, int constraintId = getObjectId(); String name = generateConstraintName(table); ConstraintUnique pk = new ConstraintUnique(getSchema(), int id = getObjectId(); String name = generateConstraintName(table); ConstraintUnique unique = new ConstraintUnique(getSchema(), id, int id = getObjectId(); String name = generateConstraintName(table); ConstraintCheck check = new ConstraintCheck(getSchema(), id, name, table); int id = getObjectId(); String name = generateConstraintName(table); ConstraintReferential ref = new ConstraintReferential(getSchema(),
String indexName = table.getSchema().getUniqueIndexName( session, table, Constants.PREFIX_PRIMARY_KEY); int id = getObjectId(); try { index = table.addIndex(session, indexName, id, int constraintId = getObjectId(); String name = generateConstraintName(table); ConstraintUnique pk = new ConstraintUnique(getSchema(), int id = getObjectId(); String name = generateConstraintName(table); ConstraintUnique unique = new ConstraintUnique(getSchema(), id, int id = getObjectId(); String name = generateConstraintName(table); ConstraintCheck check = new ConstraintCheck(getSchema(), id, name, table); int id = getObjectId(); String name = generateConstraintName(table); ConstraintReferential ref = new ConstraintReferential(getSchema(),
IndexType indexType = IndexType.createPrimaryKey(table.isPersistent(), primaryKeyHash); String indexName = table.getSchema().getUniqueIndexName(table, Constants.PREFIX_PRIMARY_KEY); int id = getObjectId(true, false); try { index = table.addIndex(session, indexName, id, indexColumns, indexType, Index.EMPTY_HEAD, null); int constraintId = getObjectId(true, true); String name = generateConstraintName(table, constraintId); ConstraintUnique pk = new ConstraintUnique(getSchema(), constraintId, name, table, true); int id = getObjectId(true, true); String name = generateConstraintName(table, id); ConstraintUnique unique = new ConstraintUnique(getSchema(), id, name, table, false); int id = getObjectId(true, true); String name = generateConstraintName(table, id); ConstraintCheck check = new ConstraintCheck(getSchema(), id, name, table); int id = getObjectId(true, true); String name = generateConstraintName(table, id); ConstraintReferential ref = new ConstraintReferential(getSchema(), id, name, table);