我正在使用 Modelio 创建一个与 jhipster-uml 一起使用的 xmi。
有没有办法为 Modelio 中的属性添加验证规则,以便在导入 xmi 时,验证规则(必需、最小长度、最大长度等)将在实体中?
例如,当前生成的 json 是这样的:
{
"relationships": [],
"fields": [
{
"fieldId": 1,
"fieldName": "name",
"fieldType": "String"
},
],
"changelogDate": "20160118185613",
"dto": "no",
"pagination": "no"
}
但我想让它看起来像这样(这是使用生成的yo jhipster:entity
):
{
"relationships": [],
"fields": [
{
"fieldId": 1,
"fieldName": "name",
"fieldType": "String",
"fieldValidateRules": [
"required",
"minlength",
"maxlength",
"pattern"
],
"fieldValidateRulesMinlength": "10",
"fieldValidateRulesMaxlength": "100",
"fieldValidateRulesPattern": "^[a-zA-Z0-9]*$",
"fieldValidateRulesPatternJava": "^[a-zA-Z0-9]*$"
},
],
"changelogDate": "20160118184133",
"dto": "no",
"service": "no",
"pagination": "no"
}