/** * Packages can contain sets of procedures. */ public void addProcedures(StoredProcedureDefinition procedure) { getProcedures().addElement(procedure); }
/** * The statements are the SQL lines of code. */ public void addStatement(String statement) { getStatements().addElement(statement); }
/** * INTERNAL: * Return the create table statement. */ public Writer buildCreationWriter(AbstractSession session, Writer writer) throws ValidationException { try { DatabasePlatform platform = session.getPlatform(); writer.write("CREATE PACKAGE " + getFullName()); writer.write(" AS"); writer.write("\n"); for (Enumeration statementsEnum = getStatements().elements(); statementsEnum.hasMoreElements();) { writer.write((String)statementsEnum.nextElement()); writer.write(platform.getBatchDelimiterString()); writer.write("\n"); } for (Enumeration proceduresEnum = getProcedures().elements(); proceduresEnum.hasMoreElements();) { writer.write("\n"); String procedureString = ((StoredProcedureDefinition)proceduresEnum.nextElement()).buildCreationWriter(session, writer).toString(); writer.write(procedureString.substring(7, procedureString.length())); writer.write("\n"); } writer.write(platform.getBatchEndString()); writer.write("\n" + session.getPlatform().getStoredProcedureTerminationToken()); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * INTERNAL: * Return the drop table statement. */ public Writer buildDeletionWriter(AbstractSession session, Writer writer) throws ValidationException { try { writer.write("DROP PACKAGE " + getFullName()); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * INTERNAL: * Return the create table statement. */ public Writer buildCreationWriter(AbstractSession session, Writer writer) throws ValidationException { try { DatabasePlatform platform = session.getPlatform(); writer.write("CREATE PACKAGE " + getFullName()); writer.write(" AS"); writer.write("\n"); for (Enumeration statementsEnum = getStatements().elements(); statementsEnum.hasMoreElements();) { writer.write((String)statementsEnum.nextElement()); writer.write(platform.getBatchDelimiterString()); writer.write("\n"); } for (Enumeration proceduresEnum = getProcedures().elements(); proceduresEnum.hasMoreElements();) { writer.write("\n"); String procedureString = ((StoredProcedureDefinition)proceduresEnum.nextElement()).buildCreationWriter(session, writer).toString(); writer.write(procedureString.substring(7, procedureString.length())); writer.write("\n"); } writer.write(platform.getBatchEndString()); writer.write("\n" + session.getPlatform().getStoredProcedureTerminationToken()); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * INTERNAL: * Return the drop table statement. */ public Writer buildDeletionWriter(AbstractSession session, Writer writer) throws ValidationException { try { writer.write("DROP PACKAGE " + getFullName()); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * INTERNAL: * Return the create table statement. */ public Writer buildCreationWriter(AbstractSession session, Writer writer) throws ValidationException { try { DatabasePlatform platform = session.getPlatform(); writer.write("CREATE PACKAGE " + getFullName()); writer.write(" AS"); writer.write("\n"); for (Enumeration statementsEnum = getStatements().elements(); statementsEnum.hasMoreElements();) { writer.write((String)statementsEnum.nextElement()); writer.write(platform.getBatchDelimiterString()); writer.write("\n"); } for (Enumeration proceduresEnum = getProcedures().elements(); proceduresEnum.hasMoreElements();) { writer.write("\n"); String procedureString = ((StoredProcedureDefinition)proceduresEnum.nextElement()).buildCreationWriter(session, writer).toString(); writer.write(procedureString.substring(7, procedureString.length())); writer.write("\n"); } writer.write(platform.getBatchEndString()); writer.write("\n" + session.getPlatform().getStoredProcedureTerminationToken()); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * The statements are the SQL lines of code. */ public void addStatement(String statement) { getStatements().addElement(statement); }
/** * INTERNAL: * Return the drop table statement. */ public Writer buildDeletionWriter(AbstractSession session, Writer writer) throws ValidationException { try { writer.write("DROP PACKAGE " + getFullName()); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * Packages can contain sets of procedures. */ public void addProcedures(StoredProcedureDefinition procedure) { getProcedures().addElement(procedure); }
/** * The statements are the SQL lines of code. */ public void addStatement(String statement) { getStatements().addElement(statement); }
/** * Packages can contain sets of procedures. */ public void addProcedures(StoredProcedureDefinition procedure) { getProcedures().addElement(procedure); }