public SchemaVersionBuilder versionOf(ISchema schema) { this.catName = schema.getCatName(); this.dbName = schema.getDbName(); this.schemaName = schema.getName(); return this; }
public Object getFieldValue(_Fields field) { switch (field) { case SCHEMA_TYPE: return getSchemaType(); case NAME: return getName(); case CAT_NAME: return getCatName(); case DB_NAME: return getDbName(); case COMPATIBILITY: return getCompatibility(); case VALIDATION_LEVEL: return getValidationLevel(); case CAN_EVOLVE: return isCanEvolve(); case SCHEMA_GROUP: return getSchemaGroup(); case DESCRIPTION: return getDescription(); } throw new IllegalStateException(); }
@Override public void createISchema(ISchema schema) throws AlreadyExistsException, MetaException, NoSuchObjectException { boolean committed = false; MISchema mSchema = convertToMISchema(schema); try { openTransaction(); if (getMISchema(schema.getCatName(), schema.getDbName(), schema.getName()) != null) { throw new AlreadyExistsException("Schema with name " + schema.getDbName() + "." + schema.getName() + " already exists"); } pm.makePersistent(mSchema); committed = commitTransaction(); } finally { if (!committed) { rollbackTransaction(); } } }
private MISchema convertToMISchema(ISchema schema) throws NoSuchObjectException { return new MISchema(schema.getSchemaType().getValue(), normalizeIdentifier(schema.getName()), getMDatabase(schema.getCatName(), schema.getDbName()), schema.getCompatibility().getValue(), schema.getValidationLevel().getValue(), schema.isCanEvolve(), schema.isSetSchemaGroup() ? schema.getSchemaGroup() : null, schema.isSetDescription() ? schema.getDescription() : null); }
Assert.assertEquals(DEFAULT_CATALOG_NAME, schema.getCatName()); Assert.assertEquals(DEFAULT_DATABASE_NAME, schema.getDbName()); Assert.assertEquals(SchemaCompatibility.FORWARD, schema.getCompatibility());
Assert.assertEquals(catName, schema.getCatName()); Assert.assertEquals(dbName, schema.getDbName()); Assert.assertEquals(SchemaCompatibility.FORWARD, schema.getCompatibility()); Assert.assertEquals(catName, schema.getCatName()); Assert.assertEquals(dbName, schema.getDbName()); Assert.assertEquals(SchemaCompatibility.BOTH, schema.getCompatibility());
public SchemaVersionBuilder versionOf(ISchema schema) { this.catName = schema.getCatName(); this.dbName = schema.getDbName(); this.schemaName = schema.getName(); return this; }
@Override public void createISchema(ISchema schema) throws AlreadyExistsException, MetaException, NoSuchObjectException { boolean committed = false; MISchema mSchema = convertToMISchema(schema); try { openTransaction(); if (getMISchema(schema.getCatName(), schema.getDbName(), schema.getName()) != null) { throw new AlreadyExistsException("Schema with name " + schema.getDbName() + "." + schema.getName() + " already exists"); } pm.makePersistent(mSchema); committed = commitTransaction(); } finally { if (!committed) { rollbackTransaction(); } } }
private MISchema convertToMISchema(ISchema schema) throws NoSuchObjectException { return new MISchema(schema.getSchemaType().getValue(), normalizeIdentifier(schema.getName()), getMDatabase(schema.getCatName(), schema.getDbName()), schema.getCompatibility().getValue(), schema.getValidationLevel().getValue(), schema.isCanEvolve(), schema.isSetSchemaGroup() ? schema.getSchemaGroup() : null, schema.isSetDescription() ? schema.getDescription() : null); }