public AbstractSession getSession() { return schemaManager.getSession(); }
public AbstractSession getSession() { return schemaManager.getSession(); }
public AbstractSession getSession() { return schemaManager.getSession(); }
/** * INTERNAL: * builds the field names based on the type read in from the builder */ public void buildFieldTypes(TableDefinition tableDef) { tableDef.buildFieldTypes(getSession()); }
/** * INTERNAL: * builds the field names based on the type read in from the builder */ public void buildFieldTypes(TableDefinition tableDef) { tableDef.buildFieldTypes(getSession()); }
/** * Return the appropriate accessor. * Assume we are dealing with a JDBC accessor. */ protected DatabaseAccessor getAccessor() { return (DatabaseAccessor) getSession().getAccessor(); }
/** * INTERNAL: * builds the field names based on the type read in from the builder */ public void buildFieldTypes(TableDefinition tableDef) { tableDef.buildFieldTypes(getSession()); }
/** * Return the appropriate accessor. * Assume we are dealing with a JDBC accessor. */ protected DatabaseAccessor getAccessor() { return (DatabaseAccessor) getSession().getAccessor(); }
/** * Return the appropriate accessor. * Assume we are dealing with a JDBC accessor. */ protected DatabaseAccessor getAccessor() { return (DatabaseAccessor) getSession().getAccessor(); }
void createUniqueConstraints(TableDefinition tableDefinition) throws EclipseLinkException { if (shouldWriteToDatabase()) { tableDefinition.createUniqueConstraintsOnDatabase(getSession()); } else { tableDefinition.setCreateSQLFiles(createSQLFiles); tableDefinition.createUniqueConstraints(getSession(), createSchemaWriter); } }
void createForeignConstraints(TableDefinition tableDefinition) throws EclipseLinkException { if (shouldWriteToDatabase()) { tableDefinition.createForeignConstraintsOnDatabase(getSession()); } else { tableDefinition.setCreateSQLFiles(createSQLFiles); tableDefinition.createForeignConstraints(getSession(), createSchemaWriter); } }
void createForeignConstraints(TableDefinition tableDefinition) throws EclipseLinkException { if (shouldWriteToDatabase()) { tableDefinition.createForeignConstraintsOnDatabase(getSession()); } else { tableDefinition.setCreateSQLFiles(createSQLFiles); tableDefinition.createForeignConstraints(getSession(), createSchemaWriter); } }
void createForeignConstraints(TableDefinition tableDefinition) throws EclipseLinkException { if (shouldWriteToDatabase()) { tableDefinition.createForeignConstraintsOnDatabase(getSession()); } else { tableDefinition.setCreateSQLFiles(createSQLFiles); tableDefinition.createForeignConstraints(getSession(), createSchemaWriter); } }
void createUniqueConstraints(TableDefinition tableDefinition) throws EclipseLinkException { if (shouldWriteToDatabase()) { tableDefinition.createUniqueConstraintsOnDatabase(getSession()); } else { tableDefinition.setCreateSQLFiles(createSQLFiles); tableDefinition.createUniqueConstraints(getSession(), createSchemaWriter); } }
void createUniqueConstraints(TableDefinition tableDefinition) throws EclipseLinkException { if (shouldWriteToDatabase()) { tableDefinition.createUniqueConstraintsOnDatabase(getSession()); } else { tableDefinition.setCreateSQLFiles(createSQLFiles); tableDefinition.createUniqueConstraints(getSession(), createSchemaWriter); } }
/** * INTERNAL: * Iterate over the schemas that need to be dropped. */ public void dropDatabaseSchemas() { for (String databaseSchema : dropDatabaseSchemas.keySet()) { if (shouldWriteToDatabase()) { dropDatabaseSchemas.get(databaseSchema).dropDatabaseSchemaOnDatabase(getSession()); } else { dropDatabaseSchemas.get(databaseSchema).dropDatabaseSchema(getSession(), getDropSchemaWriter()); appendToDDLWriter(getDropSchemaWriter(), "\n"); } } }
/** * INTERNAL: * Iterate over the schemas that need to be dropped. */ public void dropDatabaseSchemas() { for (DatabaseObjectDefinition dod : dropDatabaseSchemas.values()) { if (shouldWriteToDatabase()) { dod.dropDatabaseSchemaOnDatabase(getSession()); } else { dod.dropDatabaseSchema(getSession(), getDropSchemaWriter()); appendToDDLWriter(getDropSchemaWriter(), "\n"); } } }
/** * 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); } }
/** * 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); } }
/** * 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); } }