this.dropConstraintsOnDatabase(session); } else { if (session.getPlatform().supportsForeignKeyConstraints()){
/** * INTERNAL: * Execute the SQL alter table constraint creation string. */ public void dropConstraints(AbstractSession session, Writer schemaWriter) throws EclipseLinkException { if (schemaWriter == null) { dropConstraintsOnDatabase(session); } else { if (session.getPlatform().supportsForeignKeyConstraints()){ for (ForeignKeyConstraint foreignKey : getForeignKeyMap().values()) { buildConstraintDeletionWriter(session, foreignKey, schemaWriter); writeLineSeperator(session, schemaWriter); } } if (session.getPlatform().supportsUniqueKeyConstraints() && (!session.getPlatform().requiresUniqueConstraintCreationOnTableCreate())) { for (UniqueKeyConstraint uniqueKey : getUniqueKeys()) { buildUniqueConstraintDeletionWriter(session, uniqueKey, schemaWriter); writeLineSeperator(session, schemaWriter); } } } }
/** * INTERNAL: * Execute the SQL alter table constraint creation string. */ public void dropConstraints(AbstractSession session, Writer schemaWriter) throws EclipseLinkException { if (schemaWriter == null) { dropConstraintsOnDatabase(session); } else { if (session.getPlatform().supportsForeignKeyConstraints()){ for (ForeignKeyConstraint foreignKey : getForeignKeyMap().values()) { buildConstraintDeletionWriter(session, foreignKey, schemaWriter); writeLineSeperator(session, schemaWriter); } } if (session.getPlatform().supportsUniqueKeyConstraints() && (!session.getPlatform().requiresUniqueConstraintCreationOnTableCreate())) { for (UniqueKeyConstraint uniqueKey : getUniqueKeys()) { buildUniqueConstraintDeletionWriter(session, uniqueKey, schemaWriter); writeLineSeperator(session, schemaWriter); } } } }
/** * 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); } } }