/** * Drop (delete) the table named tableName from the database. */ public void dropTable(String tableName) throws EclipseLinkException { TableDefinition tableDefinition; tableDefinition = new TableDefinition(); tableDefinition.setName(tableName); dropObject(tableDefinition); }
/** * Drop (delete) the table named tableName from the database. */ public void dropTable(String tableName) throws EclipseLinkException { TableDefinition tableDefinition; tableDefinition = new TableDefinition(); tableDefinition.setName(tableName); dropObject(tableDefinition); }
/** * Drop (delete) the table named tableName from the database. */ public void dropTable(String tableName) throws EclipseLinkException { TableDefinition tableDefinition; tableDefinition = new TableDefinition(); tableDefinition.setName(tableName); dropObject(tableDefinition); }
/** * Drop the tables from the database. */ public void dropTables(org.eclipse.persistence.sessions.DatabaseSession session, SchemaManager schemaManager) { for (Enumeration enumtr = getTableDefinitions().elements(); enumtr.hasMoreElements();) { schemaManager.buildFieldTypes((TableDefinition)enumtr.nextElement()); } for (Enumeration enumtr = getTableDefinitions().elements(); enumtr.hasMoreElements();) { try { schemaManager.dropConstraints((TableDefinition)enumtr.nextElement()); } catch (org.eclipse.persistence.exceptions.DatabaseException dbE) { //ignore } } String sequenceTableName = getSequenceTableName(session); for (Enumeration enumtr = getTableDefinitions().elements(); enumtr.hasMoreElements();) { // Must not create sequence table as done in createSequences. TableDefinition table = (TableDefinition)enumtr.nextElement(); if (!table.getName().equals(sequenceTableName)) { try { schemaManager.dropObject(table); } catch (DatabaseException ex) { if (!shouldIgnoreDatabaseException()) { throw ex; } } } } }
dropObject(tableDefinition); createObject(tableDefinition); dropObject(definition); } catch (DatabaseException exception) {
dropObject(tableDefinition); createObject(tableDefinition); dropObject(definition); } catch (DatabaseException exception) {
schemaManager.dropObject(table); } catch (DatabaseException exception) { failed.add(table);
schemaManager.dropObject(table); } catch (DatabaseException exception) { failed.add(table);
dropObject(definition); } catch (DatabaseException exception) {
/** * Use the definition object to drop and recreate the schema entity on the database. * This is used for dropping tables, views, procedures ... etc ... * This handles and ignore any database error while dropping in case the object did not previously exist. */ public void replaceObject(DatabaseObjectDefinition databaseDefinition) throws EclipseLinkException { // PERF: Allow a special "fast" flag to be set on the session causes a delete from the table instead of a replace. boolean fast = FAST_TABLE_CREATOR; if (fast && (databaseDefinition instanceof TableDefinition)) { session.executeNonSelectingSQL("DELETE FROM " + databaseDefinition.getName()); } else if (fast && (databaseDefinition instanceof StoredProcedureDefinition)) { // do nothing } else { // CR 3870467, do not log stack boolean shouldLogExceptionStackTrace = getSession().getSessionLog().shouldLogExceptionStackTrace(); if (shouldLogExceptionStackTrace) { getSession().getSessionLog().setShouldLogExceptionStackTrace(false); } try { dropObject(databaseDefinition); } catch (DatabaseException exception) { // Ignore error } finally { if (shouldLogExceptionStackTrace) { getSession().getSessionLog().setShouldLogExceptionStackTrace(true); } } createObject(databaseDefinition); } }
/** * Use the definition object to drop and recreate the schema entity on the database. * This is used for dropping tables, views, procedures ... etc ... * This handles and ignore any database error while droping incase the object did not previously exist. */ public void replaceObject(DatabaseObjectDefinition databaseDefinition) throws EclipseLinkException { // PERF: Allow a special "fast" flag to be set on the session causes a delete from the table instead of a replace. boolean fast = FAST_TABLE_CREATOR; if (fast && (databaseDefinition instanceof TableDefinition)) { session.executeNonSelectingSQL("DELETE FROM " + databaseDefinition.getName()); } else { // CR 3870467, do not log stack boolean shouldLogExceptionStackTrace = getSession().getSessionLog().shouldLogExceptionStackTrace(); if (shouldLogExceptionStackTrace) { getSession().getSessionLog().setShouldLogExceptionStackTrace(false); } try { dropObject(databaseDefinition); } catch (DatabaseException exception) { // Ignore error } finally { if (shouldLogExceptionStackTrace) { getSession().getSessionLog().setShouldLogExceptionStackTrace(true); } } createObject(databaseDefinition); } }
dropObject(databaseDefinition); } catch (DatabaseException exception) {