Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 171687 Details for
Bug 316563
Fix for the creation of DDL for Index
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Better way for creation and deletion of Index
BetterFixForIndexCreate.patch (text/plain), 4.41 KB, created by
zhao jianyong
on 2010-06-10 21:42:58 EDT
(
hide
)
Description:
Better way for creation and deletion of Index
Filename:
MIME Type:
Creator:
zhao jianyong
Created:
2010-06-10 21:42:58 EDT
Size:
4.41 KB
patch
obsolete
>Index: DatabaseObjectDefinition.java >=================================================================== >--- DatabaseObjectDefinition.java (revision 7577) >+++ DatabaseObjectDefinition.java (working copy) >@@ -143,6 +143,14 @@ > } > > /** >+ * Execute any statements required before the deletion of the object >+ * @param session >+ * @param dropSchemaWriter >+ */ >+ public void preDropObject(AbstractSession session, Writer dropSchemaWriter, boolean createSQLFiles){ >+ } >+ >+ /** > * PUBLIC: > * Set the name of the object. > * i.e. the table name or the sequence name. >Index: SchemaManager.java >=================================================================== >--- SchemaManager.java (revision 7577) >+++ SchemaManager.java (working copy) >@@ -192,8 +192,8 @@ > this.appendToDDLWriter(createSchemaWriter, getSession().getPlatform().getStoredProcedureTerminationToken()); > } > this.appendToDDLWriter(createSchemaWriter, "\n"); >- databaseObjectDefinition.postCreateObject(getSession(), createSchemaWriter, createSQLFiles); > } >+ databaseObjectDefinition.postCreateObject(getSession(), createSchemaWriter, createSQLFiles); > } finally { > if (usesBatchWriting) { > getSession().getPlatform().setUsesBatchWriting(true); >@@ -444,6 +444,7 @@ > } > > try { >+ databaseObjectDefinition.preDropObject(getSession(), getDropSchemaWriter(), createSQLFiles); > if (shouldWriteToDatabase()) { > // drop actual object > databaseObjectDefinition.dropFromDatabase(getSession()); >Index: TableDefinition.java >=================================================================== >--- TableDefinition.java (revision 7577) >+++ TableDefinition.java (working copy) >@@ -898,16 +898,6 @@ > > /** > * INTERNAL: >- * Execute the DDL to create this table. >- */ >- public void createOnDatabase(AbstractSession session) throws EclipseLinkException { >- super.createOnDatabase(session); >- createIndexOnPrimaryKeyOnDatabase(session); >- createIndicesOnUniqueKeysOnDatabase(session); >- } >- >- /** >- * INTERNAL: > * Return the delete SQL string. > */ > public String deletionStringFor(DatabaseAccessor accessor) { >@@ -995,17 +985,6 @@ > } > > /** >- * INTERNAL: >- * Execute the DDL to drop the table. >- */ >- public void dropFromDatabase(AbstractSession session) throws EclipseLinkException { >- // first drop indices on table's primary and unique keys (if required) >- dropIndicesOnUniqueKeysOnDatabase(session); >- dropIndexOnPrimaryKeyOnDatabase(session); >- super.dropFromDatabase(session); >- } >- >- /** > * INTERNAL:<br/> > * Write the SQL drop index string to drop index on PK if passed a writer, > * else delegate to a method that executes the string on the database. >@@ -1146,20 +1125,7 @@ > > /** > * 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); >- } >- >- /** >- * INTERNAL: >- */ > HashMap<String, ForeignKeyConstraint> getForeignKeyMap() { > return foreignKeyMap; > } >@@ -1222,6 +1188,18 @@ > } > > /** >+ * Execute any statements required before the deletion of the object >+ * @param session >+ * @param dropSchemaWriter >+ */ >+ public void preDropObject(AbstractSession session, Writer dropSchemaWriter, boolean createSQLFiles){ >+ // drop indices on table's primary and unique keys (if required) >+ setCreateSQLFiles(createSQLFiles); >+ dropIndicesOnUniqueKeys(session, dropSchemaWriter); >+ dropIndexOnPrimaryKey(session, dropSchemaWriter); >+ } >+ >+ /** > * PUBLIC: > */ > public void setFields(Vector<FieldDefinition> fields) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 316563
:
171686
|
171687
|
172124