/** * Execute any statements required after the creation of the object * @param session * @param createSchemaWriter */ @Override public void postCreateObject(AbstractSession session, Writer createSchemaWriter, boolean createSQLFiles){ // create indices on table's primary and unique keys (if required) setCreateSQLFiles(createSQLFiles); createIndexes(session, createSchemaWriter); }
/** * Execute any statements required after the creation of the object * @param session * @param createSchemaWriter */ public void postCreateObject(AbstractSession session, Writer createSchemaWriter, boolean createSQLFiles){ // create indices on table's primary and unique keys (if required) setCreateSQLFiles(createSQLFiles); createIndexes(session, createSchemaWriter); }
/** * 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); dropIndexes(session, dropSchemaWriter); }
/** * Execute any statements required before the deletion of the object * @param session * @param dropSchemaWriter */ @Override public void preDropObject(AbstractSession session, Writer dropSchemaWriter, boolean createSQLFiles) { // drop indices on table's primary and unique keys (if required) setCreateSQLFiles(createSQLFiles); dropIndexes(session, dropSchemaWriter); }
/** * Execute any statements required after the creation of the object * @param session * @param createSchemaWriter */ public void postCreateObject(AbstractSession session, Writer createSchemaWriter, boolean createSQLFiles){ // create indices on table's primary and unique keys (if required) setCreateSQLFiles(createSQLFiles); createIndexOnPrimaryKey(session, createSchemaWriter); createIndicesOnUniqueKeys(session, createSchemaWriter); }
/** * 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); }
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); } }
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); } }
/** * Use the table definition to add the constraints to the database, this is normally done * in two steps to avoid dependencies. */ public void createConstraints(TableDefinition tableDefinition) throws EclipseLinkException { boolean usesBatchWriting = false; if (getSession().getPlatform().usesBatchWriting()) { usesBatchWriting = true; getSession().getPlatform().setUsesBatchWriting(false); } try { if (shouldWriteToDatabase()) { tableDefinition.createConstraintsOnDatabase(getSession()); } else { tableDefinition.setCreateSQLFiles(createSQLFiles); tableDefinition.createConstraints(getSession(), createSchemaWriter); } } finally { if (usesBatchWriting) { getSession().getPlatform().setUsesBatchWriting(true); } } }
/** * Use the table definition to drop the constraints from the table, this is normally done * in two steps to avoid dependencies. */ public void dropConstraints(TableDefinition tableDefinition) throws EclipseLinkException { boolean usesBatchWriting = false; if (getSession().getPlatform().usesBatchWriting()) { usesBatchWriting = true; getSession().getPlatform().setUsesBatchWriting(false); } try { if (shouldWriteToDatabase()) { tableDefinition.dropConstraintsOnDatabase(getSession()); } else { tableDefinition.setCreateSQLFiles(createSQLFiles); tableDefinition.dropConstraints(getSession(), getDropSchemaWriter()); } } finally { if (usesBatchWriting) { getSession().getPlatform().setUsesBatchWriting(true); } } }
/** * Use the table definition to add the constraints to the database, this is normally done * in two steps to avoid dependencies. */ public void createConstraints(TableDefinition tableDefinition) throws EclipseLinkException { boolean usesBatchWriting = false; if (getSession().getPlatform().usesBatchWriting()) { usesBatchWriting = true; getSession().getPlatform().setUsesBatchWriting(false); } try { if (shouldWriteToDatabase()) { tableDefinition.createConstraintsOnDatabase(getSession()); } else { tableDefinition.setCreateSQLFiles(createSQLFiles); tableDefinition.createConstraints(getSession(), createSchemaWriter); } } finally { if (usesBatchWriting) { getSession().getPlatform().setUsesBatchWriting(true); } } }
/** * Use the table definition to add the constraints to the database, this is normally done * in two steps to avoid dependencies. */ public void createConstraints(TableDefinition tableDefinition) throws EclipseLinkException { boolean usesBatchWriting = false; if (getSession().getPlatform().usesBatchWriting()) { usesBatchWriting = true; getSession().getPlatform().setUsesBatchWriting(false); } try { if (shouldWriteToDatabase()) { tableDefinition.createConstraintsOnDatabase(getSession()); } else { tableDefinition.setCreateSQLFiles(createSQLFiles); tableDefinition.createConstraints(getSession(), createSchemaWriter); } } finally { if (usesBatchWriting) { getSession().getPlatform().setUsesBatchWriting(true); } } }
/** * Use the table definition to drop the constraints from the table, this is normally done * in two steps to avoid dependencies. */ public void dropConstraints(TableDefinition tableDefinition) throws EclipseLinkException { boolean usesBatchWriting = false; if (getSession().getPlatform().usesBatchWriting()) { usesBatchWriting = true; getSession().getPlatform().setUsesBatchWriting(false); } try { if (shouldWriteToDatabase()) { tableDefinition.dropConstraintsOnDatabase(getSession()); } else { tableDefinition.setCreateSQLFiles(createSQLFiles); tableDefinition.dropConstraints(getSession(), getDropSchemaWriter()); } } finally { if (usesBatchWriting) { getSession().getPlatform().setUsesBatchWriting(true); } } }
/** * Use the table definition to drop the constraints from the table, this is normally done * in two steps to avoid dependencies. */ public void dropConstraints(TableDefinition tableDefinition) throws EclipseLinkException { boolean usesBatchWriting = false; if (getSession().getPlatform().usesBatchWriting()) { usesBatchWriting = true; getSession().getPlatform().setUsesBatchWriting(false); } try { if (shouldWriteToDatabase()) { tableDefinition.dropConstraintsOnDatabase(getSession()); } else { tableDefinition.setCreateSQLFiles(createSQLFiles); tableDefinition.dropConstraints(getSession(), getDropSchemaWriter()); } } finally { if (usesBatchWriting) { getSession().getPlatform().setUsesBatchWriting(true); } } }