Beispiel #1
0
 private void visit(ProcedureParameter param) {
   Type type = param.getType();
   String typeStr = null;
   switch (type) {
     case InOut:
       typeStr = INOUT;
       break;
     case ReturnValue:
     case Out:
       typeStr = OUT;
       break;
     case In:
       if (param.isVarArg()) {
         typeStr = NonReserved.VARIADIC;
       } else {
         typeStr = IN;
       }
       break;
   }
   append(typeStr).append(SPACE);
   appendColumn(param, true, true);
   if (type == Type.ReturnValue) {
     append(SPACE).append(NonReserved.RESULT);
   }
   appendDefault(param);
   appendColumnOptions(param);
 }
Beispiel #2
0
 private void addColumns(List<Column> columns, boolean includeType) {
   append(LPAREN);
   boolean first = true;
   for (Column c : columns) {
     if (first) {
       first = false;
     } else {
       append(COMMA).append(SPACE);
     }
     if (includeType) {
       appendColumn(c, true, includeType);
       appendColumnOptions(c);
     } else if (c.getParent() instanceof KeyRecord) {
       // function based column
       append(c.getNameInSource());
     } else {
       append(SQLStringVisitor.escapeSinglePart(c.getName()));
     }
   }
   append(RPAREN);
 }
Beispiel #3
0
  private void visit(Table table, Column column) {
    append(NEWLINE).append(TAB);
    if (table.getTableType() == Table.Type.TemporaryTable
        && column.isAutoIncremented()
        && column.getNullType() == NullType.No_Nulls
        && column.getJavaType() == DataTypeManager.DefaultDataClasses.INTEGER) {
      append(SQLStringVisitor.escapeSinglePart(column.getName()));
      append(SPACE);
      append(SERIAL);
    } else {
      appendColumn(column, true, true);

      if (column.isAutoIncremented()) {
        append(SPACE).append(AUTO_INCREMENT);
      }
    }

    appendDefault(column);

    // options
    appendColumnOptions(column);
  }