/** * INTERNAL: * Return the alter table statement to add the constraints. * This is done separately from the create because of dependencies. */ public Writer buildConstraintCreationWriter(AbstractSession session, ForeignKeyConstraint foreignKey, Writer writer) throws ValidationException { try { writer.write("ALTER TABLE " + getFullName()); writer.write(" ADD CONSTRAINT "); if (!session.getPlatform().shouldPrintConstraintNameAfter()) { writer.write(foreignKey.getName() + " "); } foreignKey.appendDBString(writer, session); if (session.getPlatform().shouldPrintConstraintNameAfter()) { writer.write(" CONSTRAINT " + foreignKey.getName()); } } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * INTERNAL: * Return the alter table statement to add the constraints. * This is done separately from the create because of dependencies. */ public Writer buildConstraintCreationWriter(AbstractSession session, ForeignKeyConstraint foreignKey, Writer writer) throws ValidationException { try { writer.write("ALTER TABLE " + getFullName()); writer.write(" ADD CONSTRAINT "); if (!session.getPlatform().shouldPrintConstraintNameAfter()) { writer.write(foreignKey.getName() + " "); } foreignKey.appendDBString(writer, session); if (session.getPlatform().shouldPrintConstraintNameAfter()) { writer.write(" CONSTRAINT " + foreignKey.getName()); } } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * INTERNAL: * Return the alter table statement to add the constraints. * This is done separately from the create because of dependencies. */ public Writer buildConstraintCreationWriter(AbstractSession session, ForeignKeyConstraint foreignKey, Writer writer) throws ValidationException { try { writer.write("ALTER TABLE " + getFullName()); writer.write(" ADD CONSTRAINT "); if (!session.getPlatform().shouldPrintConstraintNameAfter()) { writer.write(foreignKey.getName() + " "); } foreignKey.appendDBString(writer, session); if (session.getPlatform().shouldPrintConstraintNameAfter()) { writer.write(" CONSTRAINT " + foreignKey.getName()); } } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }