我有一个用JHipster生成的实体。
myFile.json
{
"fluentMethods": true,
"relationships": [],
"fields": [
{
"fieldName": "fileName",
"fieldType": "String"
},
{
"fieldName": "file",
"fieldType": "byte[]",
"fieldTypeBlobContent": "any",
"fieldValidateRules": [
"required"
]
},
{
"fieldName": "size",
"fieldType": "String"
},
{
"fieldName": "dateCreated",
"fieldType": "ZonedDateTime",
"fieldValidateRules": []
},
{
"fieldName": "dateModified",
"fieldType": "ZonedDateTime"
},
{
"fieldName": "createdBy",
"fieldType": "String"
}
],
"dto": "mapstruct",
"service": "serviceClass",
"entityTableName": "my_file",
"jpaMetamodelFiltering": false,
"pagination": "pagination"
}
此时我想添加一些字段。我想添加一个 Option 字段,该字段是带有name和desc字段的Object []类型。这是正确的方法吗?我想在字段的末尾添加这段代码..
...
{
"fieldName": "myFileOption",
"fieldType": "Obejct[]",
"fields" : [{
"fieldName" : "name",
"fieldType" : "String"
},
{
"fieldName" : "desc",
"fieldType" : "String"
}
]
}