private void addConstraint(String defaultName, String type, KeyRecord constraint, boolean addOptions) { append(COMMA).append(NEWLINE).append(TAB); boolean nameMatches = defaultName.equals(constraint.getName()); if (!nameMatches) { append(CONSTRAINT).append(SPACE).append(SQLStringVisitor.escapeSinglePart(constraint.getName())).append(SPACE); } append(type); addColumns(constraint.getColumns(), false); if (addOptions) { appendOptions(constraint); } }
private void addConstraint(String defaultName, String type, KeyRecord constraint, boolean addOptions) { append(COMMA).append(NEWLINE).append(TAB); boolean nameMatches = defaultName.equals(constraint.getName()); if (!nameMatches) { append(CONSTRAINT).append(SPACE).append(SQLStringVisitor.escapeSinglePart(constraint.getName())).append(SPACE); } append(type); addColumns(constraint.getColumns(), false); if (addOptions) { appendOptions(constraint); } }
private void addConstraint(String defaultName, String type, KeyRecord constraint, boolean addOptions) { append(COMMA).append(NEWLINE).append(TAB); boolean nameMatches = defaultName.equals(constraint.getName()); if (!nameMatches) { append(CONSTRAINT).append(SPACE).append(SQLStringVisitor.escapeSinglePart(constraint.getName())).append(SPACE); } append(type); addColumns(constraint.getColumns(), false); if (addOptions) { appendOptions(constraint); } }
private void visit(DataWrapper dw) { append(CREATE).append(SPACE).append(FOREIGN).append(SPACE).append(DATA).append(SPACE).append(WRAPPER) .append(SPACE); append(SQLStringVisitor.escapeSinglePart(dw.getName())); if (dw.getType() != null) { append(SPACE).append(TYPE).append(SPACE).append(SQLStringVisitor.escapeSinglePart(dw.getType())); } appendOptions(dw); append(SEMICOLON); }
private void visit(DataWrapper dw) { append(CREATE).append(SPACE).append(FOREIGN).append(SPACE).append(DATA).append(SPACE).append(WRAPPER) .append(SPACE); append(SQLStringVisitor.escapeSinglePart(dw.getName())); if (dw.getType() != null) { append(SPACE).append(TYPE).append(SPACE).append(SQLStringVisitor.escapeSinglePart(dw.getType())); } appendOptions(dw); append(SEMICOLON); }
private void visit(DataWrapper dw) { append(CREATE).append(SPACE).append(FOREIGN).append(SPACE).append(DATA).append(SPACE).append(WRAPPER) .append(SPACE); append(SQLStringVisitor.escapeSinglePart(dw.getName())); if (dw.getType() != null) { append(SPACE).append(TYPE).append(SPACE).append(SQLStringVisitor.escapeSinglePart(dw.getType())); } appendOptions(dw); append(SEMICOLON); }
appendOptions(function.getOutputParameter()); append(SPACE); append(function.getOutputParameter().getType());
private void buildContraints(Table table) { addConstraints(table.getAccessPatterns(), "AP", ACCESSPATTERN); //$NON-NLS-1$ KeyRecord pk = table.getPrimaryKey(); if (pk != null) { addConstraint("PK", PRIMARY_KEY, pk, true); //$NON-NLS-1$ } addConstraints(table.getUniqueKeys(), UNIQUE, UNIQUE); addConstraints(table.getIndexes(), INDEX, INDEX); addConstraints(table.getFunctionBasedIndexes(), INDEX, INDEX); for (int i = 0; i < table.getForeignKeys().size(); i++) { ForeignKey key = table.getForeignKeys().get(i); addConstraint("FK" + i, FOREIGN_KEY, key, false); //$NON-NLS-1$ append(SPACE).append(REFERENCES); if (key.getReferenceKey() != null) { if (key.getReferenceKey().getParent().getParent().equals(key.getParent().getParent())) { append(SPACE).append(new GroupSymbol(key.getReferenceKey().getParent().getName())); } else { append(SPACE).append(new GroupSymbol(key.getReferenceKey().getParent().getFullName())); } } else if (key.getReferenceTableName() != null) { append(SPACE).append(new GroupSymbol(key.getReferenceTableName())); } append(SPACE); addNames(key.getReferenceColumns()); appendOptions(key); } }
appendOptions(procedure.getResultSet()); append(SPACE).append(TABLE).append(SPACE); addColumns(procedure.getResultSet().getColumns(), true);
private void buildContraints(Table table) { addConstraints(table.getAccessPatterns(), "AP", ACCESSPATTERN); //$NON-NLS-1$ KeyRecord pk = table.getPrimaryKey(); if (pk != null) { addConstraint("PK", PRIMARY_KEY, pk, true); //$NON-NLS-1$ } addConstraints(table.getUniqueKeys(), UNIQUE, UNIQUE); addConstraints(table.getIndexes(), INDEX, INDEX); addConstraints(table.getFunctionBasedIndexes(), INDEX, INDEX); for (int i = 0; i < table.getForeignKeys().size(); i++) { ForeignKey key = table.getForeignKeys().get(i); addConstraint("FK" + i, FOREIGN_KEY, key, false); //$NON-NLS-1$ append(SPACE).append(REFERENCES); if (key.getReferenceKey() != null) { if (key.getReferenceKey().getParent().getParent().equals(key.getParent().getParent())) { append(SPACE).append(new GroupSymbol(key.getReferenceKey().getParent().getName())); } else { append(SPACE).append(new GroupSymbol(key.getReferenceKey().getParent().getFullName())); } } else if (key.getReferenceTableName() != null) { append(SPACE).append(new GroupSymbol(key.getReferenceTableName())); } append(SPACE); addNames(key.getReferenceColumns()); appendOptions(key); } }
private void buildContraints(Table table) { addConstraints(table.getAccessPatterns(), "AP", ACCESSPATTERN); //$NON-NLS-1$ KeyRecord pk = table.getPrimaryKey(); if (pk != null) { addConstraint("PK", PRIMARY_KEY, pk, true); //$NON-NLS-1$ } addConstraints(table.getUniqueKeys(), UNIQUE, UNIQUE); addConstraints(table.getIndexes(), INDEX, INDEX); addConstraints(table.getFunctionBasedIndexes(), INDEX, INDEX); for (int i = 0; i < table.getForeignKeys().size(); i++) { ForeignKey key = table.getForeignKeys().get(i); addConstraint("FK" + i, FOREIGN_KEY, key, false); //$NON-NLS-1$ append(SPACE).append(REFERENCES); if (key.getReferenceKey() != null) { if (key.getReferenceKey().getParent().getParent().equals(key.getParent().getParent())) { append(SPACE).append(new GroupSymbol(key.getReferenceKey().getParent().getName())); } else { append(SPACE).append(new GroupSymbol(key.getReferenceKey().getParent().getFullName())); } } else if (key.getReferenceTableName() != null) { append(SPACE).append(new GroupSymbol(key.getReferenceTableName())); } append(SPACE); addNames(key.getReferenceColumns()); appendOptions(key); } }
private void visit(Server server) { append(CREATE).append(SPACE).append(SERVER).append(SPACE) .append(SQLStringVisitor.escapeSinglePart(server.getName())); if (!server.isVirtual()) { append(SPACE).append(TYPE).append(SPACE).append(new Constant(server.getType())); } if (server.getVersion() != null) { append(SPACE).append(VERSION).append(SPACE).append(new Constant(server.getVersion())); } append(SPACE).append(FOREIGN).append(SPACE).append(DATA).append(SPACE).append(WRAPPER).append(SPACE); append(SQLStringVisitor.escapeSinglePart(server.getDataWrapper())); appendOptions(server); append(SEMICOLON); }
appendOptions(function.getOutputParameter()); append(SPACE); append(function.getOutputParameter().getType());
private void visit(Server server) { append(CREATE).append(SPACE).append(SERVER).append(SPACE) .append(SQLStringVisitor.escapeSinglePart(server.getName())); if (!server.isVirtual()) { append(SPACE).append(TYPE).append(SPACE).append(new Constant(server.getType())); } if (server.getVersion() != null) { append(SPACE).append(VERSION).append(SPACE).append(new Constant(server.getVersion())); } append(SPACE).append(FOREIGN).append(SPACE).append(DATA).append(SPACE).append(WRAPPER).append(SPACE); append(SQLStringVisitor.escapeSinglePart(server.getDataWrapper())); appendOptions(server); append(SEMICOLON); }
private void visit(Server server) { append(CREATE).append(SPACE).append(SERVER).append(SPACE) .append(SQLStringVisitor.escapeSinglePart(server.getName())); if (!server.isVirtual()) { append(SPACE).append(TYPE).append(SPACE).append(new Constant(server.getType())); } if (server.getVersion() != null) { append(SPACE).append(VERSION).append(SPACE).append(new Constant(server.getVersion())); } append(SPACE).append(FOREIGN).append(SPACE).append(DATA).append(SPACE).append(WRAPPER).append(SPACE); append(SQLStringVisitor.escapeSinglePart(server.getDataWrapper())); appendOptions(server); append(SEMICOLON); }
appendOptions(function.getOutputParameter()); append(SPACE); append(function.getOutputParameter().getType());
appendOptions(procedure.getResultSet()); append(SPACE).append(TABLE).append(SPACE); addColumns(procedure.getResultSet().getColumns(), true);
appendOptions(procedure.getResultSet()); append(SPACE).append(TABLE).append(SPACE); addColumns(procedure.getResultSet().getColumns(), true);
.append(SQLStringVisitor.escapeSinglePart(database.getName())).append(SPACE).append(VERSION) .append(SPACE).append(new Constant(database.getVersion())); appendOptions(database); append(SEMICOLON); append(NEWLINE); appendOptions(schema); append(SEMICOLON); append(NEWLINE);
.append(SQLStringVisitor.escapeSinglePart(database.getName())).append(SPACE).append(VERSION) .append(SPACE).append(new Constant(database.getVersion())); appendOptions(database); append(SEMICOLON); append(NEWLINE); appendOptions(schema); append(SEMICOLON); append(NEWLINE);