/** * Drop and recreate the default table schema for the TopLink project this session associated with. */ public void replaceDefaultTables() throws EclipseLinkException { boolean shouldLogExceptionStackTrace = getSession().getSessionLog().shouldLogExceptionStackTrace(); getSession().getSessionLog().setShouldLogExceptionStackTrace(false); try { TableCreator tableCreator = getDefaultTableCreator(true); tableCreator.replaceTables(session, this); } catch (DatabaseException exception) { // Ignore error } finally { getSession().getSessionLog().setShouldLogExceptionStackTrace(shouldLogExceptionStackTrace); } }
/** * Drop and recreate the default table schema for the TopLink project this session associated with. */ public void replaceDefaultTables(boolean keepSequenceTables, boolean generateFKConstraints) throws EclipseLinkException { boolean shouldLogExceptionStackTrace = getSession().getSessionLog().shouldLogExceptionStackTrace(); getSession().getSessionLog().setShouldLogExceptionStackTrace(false); try { TableCreator tableCreator = getDefaultTableCreator(generateFKConstraints); tableCreator.replaceTables(session, this, keepSequenceTables); } catch (DatabaseException exception) { // Ignore error } finally { getSession().getSessionLog().setShouldLogExceptionStackTrace(shouldLogExceptionStackTrace); } }
/** * Create the default table schema for the TopLink project this session associated with. */ public void createDefaultTables(boolean generateFKConstraints) { //Create each table w/o throwing exception and/or exit if some of them are already existed in the db. //If a table is already existed, skip the creation. boolean shouldLogExceptionStackTrace = getSession().getSessionLog().shouldLogExceptionStackTrace(); getSession().getSessionLog().setShouldLogExceptionStackTrace(false); try { TableCreator tableCreator = getDefaultTableCreator(generateFKConstraints); tableCreator.createTables(session, this); } catch (DatabaseException ex) { // Ignore error } finally { getSession().getSessionLog().setShouldLogExceptionStackTrace(shouldLogExceptionStackTrace); } }
/** * Create or extend the default table schema for the project this session associated with. */ public void extendDefaultTables(boolean generateFKConstraints) throws EclipseLinkException { boolean shouldLogExceptionStackTrace = getSession().getSessionLog().shouldLogExceptionStackTrace(); this.session.getSessionLog().setShouldLogExceptionStackTrace(false); try { TableCreator tableCreator = getDefaultTableCreator(generateFKConstraints); tableCreator.extendTables(this.session, this); } catch (DatabaseException exception) { // Ignore error } finally { this.session.getSessionLog().setShouldLogExceptionStackTrace(shouldLogExceptionStackTrace); } // Reset database change events to new tables. if (this.session.getDatabaseEventListener() != null) { this.session.getDatabaseEventListener().remove(this.session); this.session.getDatabaseEventListener().register(this.session); } }
/** * Create or extend the default table schema for the project this session associated with. */ public void extendDefaultTables(boolean generateFKConstraints) throws EclipseLinkException { boolean shouldLogExceptionStackTrace = getSession().getSessionLog().shouldLogExceptionStackTrace(); this.session.getSessionLog().setShouldLogExceptionStackTrace(false); try { TableCreator tableCreator = getDefaultTableCreator(generateFKConstraints); tableCreator.extendTables(this.session, this); } catch (DatabaseException exception) { // Ignore error } finally { this.session.getSessionLog().setShouldLogExceptionStackTrace(shouldLogExceptionStackTrace); } // Reset database change events to new tables. if (this.session.getDatabaseEventListener() != null) { this.session.getDatabaseEventListener().remove(this.session); this.session.getDatabaseEventListener().register(this.session); } }
/** * Drop and recreate the default table schema for the project this session associated with. */ public void replaceDefaultTables(boolean createSequenceTables, boolean createSequences, boolean generateFKConstraints) throws EclipseLinkException { boolean shouldLogExceptionStackTrace = getSession().getSessionLog().shouldLogExceptionStackTrace(); this.session.getSessionLog().setShouldLogExceptionStackTrace(false); try { TableCreator tableCreator = getDefaultTableCreator(generateFKConstraints); tableCreator.replaceTables(this.session, this, createSequenceTables, createSequences); // Drop all the database schemas now if set to do so. This must be // called after all the constraints, tables etc. are dropped. dropDatabaseSchemas(); } catch (DatabaseException exception) { // Ignore error } finally { this.session.getSessionLog().setShouldLogExceptionStackTrace(shouldLogExceptionStackTrace); } // Reset database change events to new tables. if (this.session.getDatabaseEventListener() != null) { this.session.getDatabaseEventListener().remove(this.session); this.session.getDatabaseEventListener().register(this.session); } }
/** * Drop and recreate the default table schema for the project this session associated with. */ public void replaceDefaultTables(boolean createSequenceTables, boolean createSequences, boolean generateFKConstraints) throws EclipseLinkException { boolean shouldLogExceptionStackTrace = getSession().getSessionLog().shouldLogExceptionStackTrace(); this.session.getSessionLog().setShouldLogExceptionStackTrace(false); try { TableCreator tableCreator = getDefaultTableCreator(generateFKConstraints); tableCreator.replaceTables(this.session, this, createSequenceTables, createSequences); // Drop all the database schemas now if set to do so. This must be // called after all the constraints, tables etc. are dropped. dropDatabaseSchemas(); } catch (DatabaseException exception) { // Ignore error } finally { this.session.getSessionLog().setShouldLogExceptionStackTrace(shouldLogExceptionStackTrace); } // Reset database change events to new tables. if (this.session.getDatabaseEventListener() != null) { this.session.getDatabaseEventListener().remove(this.session); this.session.getDatabaseEventListener().register(this.session); } }
/** * Create the default table schema for the project this session associated with. */ public void createDefaultTables(boolean generateFKConstraints) { //Create each table w/o throwing exception and/or exit if some of them are already existed in the db. //If a table is already existed, skip the creation. boolean shouldLogExceptionStackTrace = getSession().getSessionLog().shouldLogExceptionStackTrace(); getSession().getSessionLog().setShouldLogExceptionStackTrace(false); try { TableCreator tableCreator = getDefaultTableCreator(generateFKConstraints); tableCreator.createTables(this.session, this); } catch (DatabaseException ex) { // Ignore error } finally { getSession().getSessionLog().setShouldLogExceptionStackTrace(shouldLogExceptionStackTrace); } // Reset database change events to new tables. if (this.session.getDatabaseEventListener() != null) { this.session.getDatabaseEventListener().remove(this.session); this.session.getDatabaseEventListener().register(this.session); } }
/** * Create the default table schema for the project this session associated with. */ public void createDefaultTables(boolean generateFKConstraints) { //Create each table w/o throwing exception and/or exit if some of them are already existed in the db. //If a table is already existed, skip the creation. boolean shouldLogExceptionStackTrace = getSession().getSessionLog().shouldLogExceptionStackTrace(); getSession().getSessionLog().setShouldLogExceptionStackTrace(false); try { TableCreator tableCreator = getDefaultTableCreator(generateFKConstraints); tableCreator.createTables(this.session, this); } catch (DatabaseException ex) { // Ignore error } finally { getSession().getSessionLog().setShouldLogExceptionStackTrace(shouldLogExceptionStackTrace); } // Reset database change events to new tables. if (this.session.getDatabaseEventListener() != null) { this.session.getDatabaseEventListener().remove(this.session); this.session.getDatabaseEventListener().register(this.session); } }
/** * Create the default table schema for the project this session associated with. */ public void dropDefaultTables() { // Drop each table w/o throwing exception and/or exit if some don't exist. boolean shouldLogExceptionStackTrace = getSession().getSessionLog().shouldLogExceptionStackTrace(); getSession().getSessionLog().setShouldLogExceptionStackTrace(false); try { // Drop the tables. TableCreator tableCreator = getDefaultTableCreator(true); tableCreator.dropTables(this.session, this); // Drop the sequences. dropSequences(); // Drop all the database schemas now if set to do so. This must be // called after all the constraints, tables etc. are dropped. dropDatabaseSchemas(); } catch (DatabaseException ex) { // Ignore error } finally { getSession().getSessionLog().setShouldLogExceptionStackTrace(shouldLogExceptionStackTrace); } // Reset database change events to new tables. if (this.session.getDatabaseEventListener() != null) { this.session.getDatabaseEventListener().remove(this.session); this.session.getDatabaseEventListener().register(this.session); } }
/** * Create the default table schema for the project this session associated with. */ public void dropDefaultTables() { // Drop each table w/o throwing exception and/or exit if some don't exist. boolean shouldLogExceptionStackTrace = getSession().getSessionLog().shouldLogExceptionStackTrace(); getSession().getSessionLog().setShouldLogExceptionStackTrace(false); try { // Drop the tables. TableCreator tableCreator = getDefaultTableCreator(true); tableCreator.dropTables(this.session, this); // Drop the sequences. dropSequences(); // Drop all the database schemas now if set to do so. This must be // called after all the constraints, tables etc. are dropped. dropDatabaseSchemas(); } catch (DatabaseException ex) { // Ignore error } finally { getSession().getSessionLog().setShouldLogExceptionStackTrace(shouldLogExceptionStackTrace); } // Reset database change events to new tables. if (this.session.getDatabaseEventListener() != null) { this.session.getDatabaseEventListener().remove(this.session); this.session.getDatabaseEventListener().register(this.session); } }