Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 316563 | Differences between
and this patch

Collapse All | Expand All

(-)DatabaseObjectDefinition.java (+8 lines)
Lines 143-148 Link Here
143
    }
143
    }
144
    
144
    
145
    /**
145
    /**
146
     * Execute any statements required before the deletion of the object
147
     * @param session
148
     * @param dropSchemaWriter
149
     */
150
    public void preDropObject(AbstractSession session, Writer dropSchemaWriter, boolean createSQLFiles){
151
    }
152
    
153
    /**
146
     * PUBLIC:
154
     * PUBLIC:
147
     * Set the name of the object.
155
     * Set the name of the object.
148
     * i.e. the table name or the sequence name.
156
     * i.e. the table name or the sequence name.
(-)SchemaManager.java (-1 / +2 lines)
Lines 192-199 Link Here
192
                    this.appendToDDLWriter(createSchemaWriter, getSession().getPlatform().getStoredProcedureTerminationToken());
192
                    this.appendToDDLWriter(createSchemaWriter, getSession().getPlatform().getStoredProcedureTerminationToken());
193
                }
193
                }
194
                this.appendToDDLWriter(createSchemaWriter, "\n");
194
                this.appendToDDLWriter(createSchemaWriter, "\n");
195
                databaseObjectDefinition.postCreateObject(getSession(), createSchemaWriter, createSQLFiles);
196
            }
195
            }
196
            databaseObjectDefinition.postCreateObject(getSession(), createSchemaWriter, createSQLFiles);
197
        } finally {
197
        } finally {
198
            if (usesBatchWriting) {
198
            if (usesBatchWriting) {
199
                getSession().getPlatform().setUsesBatchWriting(true);
199
                getSession().getPlatform().setUsesBatchWriting(true);
Lines 444-449 Link Here
444
        }
444
        }
445
445
446
        try {
446
        try {
447
            databaseObjectDefinition.preDropObject(getSession(), getDropSchemaWriter(), createSQLFiles);
447
            if (shouldWriteToDatabase()) {
448
            if (shouldWriteToDatabase()) {
448
                // drop actual object
449
                // drop actual object
449
                databaseObjectDefinition.dropFromDatabase(getSession());
450
                databaseObjectDefinition.dropFromDatabase(getSession());
(-)TableDefinition.java (-34 / +12 lines)
Lines 898-913 Link Here
898
898
899
    /**
899
    /**
900
     * INTERNAL:
900
     * INTERNAL:
901
     * Execute the DDL to create this table.
902
     */
903
    public void createOnDatabase(AbstractSession session) throws EclipseLinkException {
904
        super.createOnDatabase(session);
905
        createIndexOnPrimaryKeyOnDatabase(session);
906
        createIndicesOnUniqueKeysOnDatabase(session);
907
    }
908
    
909
    /**
910
     * INTERNAL:
911
     * Return the delete SQL string.
901
     * Return the delete SQL string.
912
     */
902
     */
913
    public String deletionStringFor(DatabaseAccessor accessor) {
903
    public String deletionStringFor(DatabaseAccessor accessor) {
Lines 995-1011 Link Here
995
    }
985
    }
996
986
997
    /**
987
    /**
998
     * INTERNAL:
999
     * Execute the DDL to drop the table.
1000
     */
1001
    public void dropFromDatabase(AbstractSession session) throws EclipseLinkException {
1002
        // first drop indices on table's primary and unique keys (if required)
1003
        dropIndicesOnUniqueKeysOnDatabase(session);
1004
        dropIndexOnPrimaryKeyOnDatabase(session);
1005
        super.dropFromDatabase(session);
1006
    }
1007
    
1008
    /**
1009
     * INTERNAL:<br/>
988
     * INTERNAL:<br/>
1010
     * Write the SQL drop index string to drop index on PK if passed a writer,
989
     * Write the SQL drop index string to drop index on PK if passed a writer,
1011
     * else delegate to a method that executes the string on the database.
990
     * else delegate to a method that executes the string on the database.
Lines 1146-1165 Link Here
1146
1125
1147
    /**
1126
    /**
1148
     * INTERNAL:
1127
     * INTERNAL:
1149
     * Execute the DDL to drop the table.  Either directly from the database
1150
     * of write out the statement to a file.
1151
     */
1128
     */
1152
    public void dropObject(AbstractSession session, Writer schemaWriter, boolean createSQLFiles) throws EclipseLinkException {
1153
        // first drop indices on table's primary and unique keys (if required)
1154
        setCreateSQLFiles(createSQLFiles);
1155
        dropIndicesOnUniqueKeys(session, schemaWriter);
1156
        dropIndexOnPrimaryKey(session, schemaWriter);
1157
        super.dropObject(session, schemaWriter, createSQLFiles);
1158
    }
1159
    
1160
    /**
1161
     * INTERNAL:
1162
     */
1163
    HashMap<String, ForeignKeyConstraint> getForeignKeyMap() {
1129
    HashMap<String, ForeignKeyConstraint> getForeignKeyMap() {
1164
        return foreignKeyMap;
1130
        return foreignKeyMap;
1165
    }
1131
    }
Lines 1222-1227 Link Here
1222
    }
1188
    }
1223
    
1189
    
1224
    /**
1190
    /**
1191
     * Execute any statements required before the deletion of the object
1192
     * @param session
1193
     * @param dropSchemaWriter
1194
     */
1195
    public void preDropObject(AbstractSession session, Writer dropSchemaWriter, boolean createSQLFiles){
1196
        // drop indices on table's primary and unique keys (if required)
1197
        setCreateSQLFiles(createSQLFiles);
1198
        dropIndicesOnUniqueKeys(session, dropSchemaWriter);
1199
        dropIndexOnPrimaryKey(session, dropSchemaWriter);
1200
    }
1201
    
1202
    /**
1225
     * PUBLIC:
1203
     * PUBLIC:
1226
     */
1204
     */
1227
    public void setFields(Vector<FieldDefinition> fields) {
1205
    public void setFields(Vector<FieldDefinition> fields) {

Return to bug 316563