buf.append(", host varchar(128)");
buf.append(", pid int(10) NOT NULL");
buf.append(", collectTime datetime NOT NULL");
List<FieldInfo> fields = beanInfo.getFields();
for (int i = 0; i < fields.size(); ++i) {
FieldInfo field = fields.get(i);
buf.append(", ");
buf.append(field.getColumnName());
if (field.getFieldType().equals(int.class) || field.getFieldType().equals(Integer.class)) {
buf.append(" int(10)");
} else if (field.getFieldType().equals(long.class) || field.getFieldType().equals(Long.class)) {
buf.append(" bigint(20)");
} else if (field.getFieldType().equals(String.class)) {
buf.append(" varchar(256)");
} else if (field.getFieldType().equals(Date.class)) {
buf.append(" datetime");
} else if (field.getFieldType().equals(boolean.class) || field.getFieldType().equals(Boolean.class)) {
buf.append(" int(1)");
}
}
buf.append(", PRIMARY KEY(id)");
buf.append(");");