Field[] declaredFields = BimCloudtProjectInfoExtFiedlsDetail.class.getDeclaredFields(); for (Field field : declaredFields) { boolean present = field.isAnnotationPresent(TableField.class); if (present){ TableField annotation = field.getAnnotation(TableField.class); System.out.println(annotation.value()); } else { System.out.println(field.getName()); } }
public class BimCloudtProjectInfoExtFiedlsDetail { @TableField("ext_id") private Long extId; @TableField("tenant_id") private Long tenantId; @TableField("project_id") private Long projectId; @TableField("ext_tenant_Id") private Long extTenantId; @TableField("caption") private String caption; @TableField("entity_id") private Long entityId; @TableField("entity_type") private String entityType; @TableField("gmt_modified") private Date gmtModified; @TableField("value") private String value;
}