Ejemplo n.º 1
0
  public void inlineField(JClass currentClass, JCompositeField jcf, HashSet fieldNames)
      throws IOException, SchemaException {

    JClass fieldClass = jcf.getJClass();
    Vector fields = new Vector(fieldClass.getAllFields().values());
    String primaryKey = fieldClass.getPrimaryKey();
    String prefix = jcf.getPrefix();
    for (int i = 0; i < fields.size(); i++) {
      JField jf = (JField) fields.elementAt(i);
      String sqlName = jf.getSqlName();

      if (!jf.isDbColumn() || sqlName.equals(primaryKey)) {
        // do nothing ..
      } else if (jf instanceof JCompositeField) {
        throw new SchemaException(
            "Composite Fields not allowed in inline objects", currentClass.getSchemaFileName());
      } else
        schemaFile.write(",\n\t" + prefix + "_" + sqlName + " " + getSqlOutType(currentClass, jf));
      fieldNames.add(prefix + "_" + sqlName);
    }
  }