/** * INTERNAL: * Execute the DDL to drop the table. Either directly from the database * of write out the statement to a file. */ public void dropObject(AbstractSession session, Writer schemaWriter, boolean createSQLFiles) throws EclipseLinkException { // first drop indices on table's primary and unique keys (if required) setCreateSQLFiles(createSQLFiles); dropIndicesOnUniqueKeys(session, schemaWriter); dropIndexOnPrimaryKey(session, schemaWriter); super.dropObject(session, schemaWriter, createSQLFiles); }
/** * 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); } } }
databaseObjectDefinition.dropObject(getSession(), dropSchemaWriter, createSQLFiles); if (this.createSQLFiles){ this.appendToDDLWriter(dropSchemaWriter, getSession().getPlatform().getStoredProcedureTerminationToken());
databaseObjectDefinition.dropObject(getSession(), dropSchemaWriter, createSQLFiles); if (this.createSQLFiles){ this.appendToDDLWriter(dropSchemaWriter, getSession().getPlatform().getStoredProcedureTerminationToken());