public String createSQL() throws SQLException {
    String returnValue = "select ";
    String where = "";

    boolean first = true;

    for (Field field : getXmlline().getFields()) {
      if (!field.isUse())
        continue;

      if (first) {
        first = false;
        returnValue += field.getName();
      } else {
        returnValue += (", " + field.getName());
      }
    }

    returnValue += (" from " + getSQLSchemaName() + getXmlline().getTableName());

    if (first) {
      LOGGER.severe("Error no field");

      return null;
    }

    first = true;

    for (Field field : getXmlline().getFields()) {
      if (!field.isUse())
        continue;

      if (getPrimaries().contains(field.getName())) {
        if (first) {
          first = false;
          where += (field.getName() + "=?");
        } else {
          where += (" and " + field.getName() + "=?");
        }
      }
    }

    if (!where.equals("")) {
      returnValue += (" where " + where);
    }

    return returnValue;
  }