/** * INTERNAL: * Return the delete SQL string. */ public String deletionStringFor(DatabaseAccessor accessor) { return "DROP TABLE " + this.getName(); }
/** * INTERNAL: * Return the delete SQL string. */ public String deletionStringFor(DatabaseAccessor accessor) { return "DROP TABLE " + this.getName(); }
/** * INTERNAL: * Return the delete SQL string. */ public String deletionStringFor(DatabaseAccessor accessor) { return "DROP TABLE " + this.getName(); }
/** * INTERNAL: */ @Override public Writer buildVPDDeletionWriter(AbstractSession session, Writer writer) { try { writer.write(session.getPlatform().getVPDDeletionString(getName(), session)); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * INTERNAL: */ @Override public Writer buildVPDCreationFunctionWriter(AbstractSession session, Writer writer) { try { writer.write(session.getPlatform().getVPDCreationFunctionString(getName(), tenantFieldName)); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * INTERNAL: */ @Override public Writer buildVPDDeletionWriter(AbstractSession session, Writer writer) { try { writer.write(session.getPlatform().getVPDDeletionString(getName(), session)); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * INTERNAL: */ @Override public Writer buildVPDCreationPolicyWriter(AbstractSession session, Writer writer) { try { writer.write(session.getPlatform().getVPDCreationPolicyString(getName(), session)); return writer; } catch (IOException ioException) { throw ValidationException.fileError(ioException); } }
/** * INTERNAL: */ @Override public Writer buildVPDCreationPolicyWriter(AbstractSession session, Writer writer) { try { writer.write(session.getPlatform().getVPDCreationPolicyString(getName(), session)); return writer; } catch (IOException ioException) { throw ValidationException.fileError(ioException); } }
/** * INTERNAL: */ @Override public Writer buildVPDCreationFunctionWriter(AbstractSession session, Writer writer) { try { writer.write(session.getPlatform().getVPDCreationFunctionString(getName(), tenantFieldName)); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * Build a foreign key constraint. */ protected ForeignKeyConstraint buildForeignKeyConstraint(List<String> fkFieldNames, List<String> pkFieldNames, TableDefinition targetTable, DatabasePlatform platform) { assert fkFieldNames.size() > 0 && fkFieldNames.size() == pkFieldNames.size(); ForeignKeyConstraint fkConstraint = new ForeignKeyConstraint(); for(int i=0; i<fkFieldNames.size(); i++) { fkConstraint.getSourceFields().add(fkFieldNames.get(i)); fkConstraint.getTargetFields().add(pkFieldNames.get(i)); } fkConstraint.setTargetTable(targetTable.getFullName()); String fkFieldName = fkFieldNames.get(0); String name = buildForeignKeyConstraintName(this.getName(), fkFieldName, platform.getMaxForeignKeyNameSize(), platform); fkConstraint.setName(name); return fkConstraint; }
/** * Build a foreign key constraint. */ protected ForeignKeyConstraint buildForeignKeyConstraint(Vector fkFieldNames, Vector pkFieldNames, TableDefinition targetTable, DatabasePlatform platform) { assert fkFieldNames.size() > 0 && fkFieldNames.size() == pkFieldNames.size(); ForeignKeyConstraint fkConstraint = new ForeignKeyConstraint(); for(int i=0; i<fkFieldNames.size(); i++) { fkConstraint.getSourceFields().add(fkFieldNames.get(i)); fkConstraint.getTargetFields().add(pkFieldNames.get(i)); } fkConstraint.setTargetTable(targetTable.getFullName()); String fkFieldName = (String)fkFieldNames.get(0); String name = buildForeignKeyConstraintName(this.getName(), fkFieldName, platform.getMaxForeignKeyNameSize(), platform); fkConstraint.setName(name); return fkConstraint; }
/** * Build a foreign key constraint. */ protected ForeignKeyConstraint buildForeignKeyConstraint(List<String> fkFieldNames, List<String> pkFieldNames, TableDefinition targetTable, DatabasePlatform platform) { assert fkFieldNames.size() > 0 && fkFieldNames.size() == pkFieldNames.size(); ForeignKeyConstraint fkConstraint = new ForeignKeyConstraint(); for(int i=0; i<fkFieldNames.size(); i++) { fkConstraint.getSourceFields().add(fkFieldNames.get(i)); fkConstraint.getTargetFields().add(pkFieldNames.get(i)); } fkConstraint.setTargetTable(targetTable.getFullName()); String fkFieldName = fkFieldNames.get(0); String name = buildForeignKeyConstraintName(this.getName(), fkFieldName, platform.getMaxForeignKeyNameSize(), platform); fkConstraint.setName(name); return fkConstraint; }
protected NonreflectiveMethodDefinition buildConstructor() { NonreflectiveMethodDefinition methodDefinition = new NonreflectiveMethodDefinition(); methodDefinition.setName(getClassName()); methodDefinition.setIsConstructor(true); methodDefinition.addLine("setName(\"" + getTableCreator().getName() + "\");"); methodDefinition.addLine(""); for (Enumeration tablesEnum = getTableCreator().getTableDefinitions().elements(); tablesEnum.hasMoreElements();) { TableDefinition table = (TableDefinition)tablesEnum.nextElement(); methodDefinition.addLine("addTableDefinition(build" + table.getName() + "Table());"); } return methodDefinition; }
/** * INTERNAL: * Return the index drop statement. */ public Writer buildIndexDeletionWriter(AbstractSession session, String key, Writer writer) throws ValidationException { try { String indexName = buildIndexName(getName(), key, session.getPlatform().getMaxIndexNameSize(), session.getPlatform()); writer.write(session.getPlatform().buildDropIndex(getFullName(), indexName)); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } return writer; }
/** * INTERNAL: * Return the index creation statement. */ public IndexDefinition buildIndex(AbstractSession session, String key, List<String> columnNames, boolean isUniqueSetOnField) { String indexName = buildIndexName(getName(), key, session.getPlatform().getIndexNamePrefix(isUniqueSetOnField), session.getPlatform().getMaxIndexNameSize(), session.getPlatform()); IndexDefinition index = new IndexDefinition(); index.setName(indexName); index.setTargetTable(getFullName()); index.getFields().addAll(columnNames); return index; }
/** * INTERNAL: * Return the index creation statement. */ public IndexDefinition buildIndex(AbstractSession session, String key, List<String> columnNames, boolean isUniqueSetOnField) { String indexName = buildIndexName(getName(), key, session.getPlatform().getIndexNamePrefix(isUniqueSetOnField), session.getPlatform().getMaxIndexNameSize(), session.getPlatform()); IndexDefinition index = new IndexDefinition(); index.setName(indexName); index.setTargetTable(getFullName()); index.getFields().addAll(columnNames); return index; }
protected NonreflectiveMethodDefinition buildConstructor() { NonreflectiveMethodDefinition methodDefinition = new NonreflectiveMethodDefinition(); methodDefinition.setName(getClassName()); methodDefinition.setIsConstructor(true); methodDefinition.addLine("setName(\"" + getTableCreator().getName() + "\");"); methodDefinition.addLine(""); for (TableDefinition table : getTableCreator().getTableDefinitions()) { methodDefinition.addLine("addTableDefinition(build" + table.getName() + "Table());"); } return methodDefinition; }
protected NonreflectiveMethodDefinition buildConstructor() { NonreflectiveMethodDefinition methodDefinition = new NonreflectiveMethodDefinition(); methodDefinition.setName(getClassName()); methodDefinition.setIsConstructor(true); methodDefinition.addLine("setName(\"" + getTableCreator().getName() + "\");"); methodDefinition.addLine(""); for (TableDefinition table : getTableCreator().getTableDefinitions()) { methodDefinition.addLine("addTableDefinition(build" + table.getName() + "Table());"); } return methodDefinition; }
/** * INTERNAL: * Return the index drop statement. */ public Writer buildIndexDeletionWriter(AbstractSession session, String key, Writer writer, boolean isUniqueSetOnField) { String indexName = buildIndexName(getName(), key, session.getPlatform().getIndexNamePrefix(isUniqueSetOnField), session.getPlatform().getMaxIndexNameSize(), session.getPlatform()); IndexDefinition index = new IndexDefinition(); index.setName(indexName); index.setTargetTable(getFullName()); index.buildDeletionWriter(session, writer); return writer; }
/** * INTERNAL: * Return the index drop statement. */ public Writer buildIndexDeletionWriter(AbstractSession session, String key, Writer writer, boolean isUniqueSetOnField) { String indexName = buildIndexName(getName(), key, session.getPlatform().getIndexNamePrefix(isUniqueSetOnField), session.getPlatform().getMaxIndexNameSize(), session.getPlatform()); IndexDefinition index = new IndexDefinition(); index.setName(indexName); index.setTargetTable(getFullName()); index.buildDeletionWriter(session, writer); return writer; }