/** * INTERNAL: * Iterate over the schemas that need to be dropped. */ public void dropDatabaseSchemas() { for (String databaseSchema : dropDatabaseSchemas.keySet()) { if (shouldWriteToDatabase()) { dropDatabaseSchemas.get(databaseSchema).dropDatabaseSchemaOnDatabase(getSession()); } else { dropDatabaseSchemas.get(databaseSchema).dropDatabaseSchema(getSession(), getDropSchemaWriter()); appendToDDLWriter(getDropSchemaWriter(), "\n"); } } }
/** * INTERNAL: * Iterate over the schemas that need to be dropped. */ public void dropDatabaseSchemas() { for (DatabaseObjectDefinition dod : dropDatabaseSchemas.values()) { if (shouldWriteToDatabase()) { dod.dropDatabaseSchemaOnDatabase(getSession()); } else { dod.dropDatabaseSchema(getSession(), getDropSchemaWriter()); appendToDDLWriter(getDropSchemaWriter(), "\n"); } } }
databaseObjectDefinition.preDropObject(getSession(), getDropSchemaWriter(), this.createSQLFiles); if (shouldWriteToDatabase()) { Writer dropSchemaWriter = getDropSchemaWriter();
databaseObjectDefinition.preDropObject(getSession(), getDropSchemaWriter(), this.createSQLFiles); if (shouldWriteToDatabase()) { Writer dropSchemaWriter = getDropSchemaWriter();
/** * Use the table definition to drop the constraints from the table, this is normally done * in two steps to avoid dependencies. */ public void dropConstraints(TableDefinition tableDefinition) throws EclipseLinkException { boolean usesBatchWriting = false; if (getSession().getPlatform().usesBatchWriting()) { usesBatchWriting = true; getSession().getPlatform().setUsesBatchWriting(false); } try { if (shouldWriteToDatabase()) { tableDefinition.dropConstraintsOnDatabase(getSession()); } else { tableDefinition.setCreateSQLFiles(createSQLFiles); tableDefinition.dropConstraints(getSession(), getDropSchemaWriter()); } } finally { if (usesBatchWriting) { getSession().getPlatform().setUsesBatchWriting(true); } } }
/** * Use the table definition to drop the constraints from the table, this is normally done * in two steps to avoid dependencies. */ public void dropConstraints(TableDefinition tableDefinition) throws EclipseLinkException { boolean usesBatchWriting = false; if (getSession().getPlatform().usesBatchWriting()) { usesBatchWriting = true; getSession().getPlatform().setUsesBatchWriting(false); } try { if (shouldWriteToDatabase()) { tableDefinition.dropConstraintsOnDatabase(getSession()); } else { tableDefinition.setCreateSQLFiles(createSQLFiles); tableDefinition.dropConstraints(getSession(), getDropSchemaWriter()); } } finally { if (usesBatchWriting) { getSession().getPlatform().setUsesBatchWriting(true); } } }
/** * Use the table definition to drop the constraints from the table, this is normally done * in two steps to avoid dependencies. */ public void dropConstraints(TableDefinition tableDefinition) throws EclipseLinkException { boolean usesBatchWriting = false; if (getSession().getPlatform().usesBatchWriting()) { usesBatchWriting = true; getSession().getPlatform().setUsesBatchWriting(false); } try { if (shouldWriteToDatabase()) { tableDefinition.dropConstraintsOnDatabase(getSession()); } else { tableDefinition.setCreateSQLFiles(createSQLFiles); tableDefinition.dropConstraints(getSession(), getDropSchemaWriter()); } } finally { if (usesBatchWriting) { getSession().getPlatform().setUsesBatchWriting(true); } } }
/** * Use the definition object to drop the schema entity from the database. * This is used for dropping tables, views, procedures ... etc ... */ public void dropObject(DatabaseObjectDefinition databaseObjectDefinition) throws EclipseLinkException { boolean usesBatchWriting = false; if (getSession().getPlatform().usesBatchWriting()) { usesBatchWriting = true; getSession().getPlatform().setUsesBatchWriting(false); } try { if (shouldWriteToDatabase()) { // drop actual object databaseObjectDefinition.dropFromDatabase(getSession()); } else { Writer dropSchemaWriter = getDropSchemaWriter(); // drop actual object databaseObjectDefinition.dropObject(getSession(), dropSchemaWriter, createSQLFiles); if (createSQLFiles){ this.appendToDDLWriter(dropSchemaWriter, getSession().getPlatform().getStoredProcedureTerminationToken()); } this.appendToDDLWriter(dropSchemaWriter, "\n"); } } finally { if (usesBatchWriting) { getSession().getPlatform().setUsesBatchWriting(true); } } }