Skip to main content
Version: 3.2

EntityProperty 实体属性

结构声明

interface EntityProperty {
"concept": "EntityProperty", // 产品概念
"name": string, // 实体属性名称
"uuid": string, // 唯一标识
"columnName": string, // 数据库列名
"label": string, // 实体属性标题
"description": string, // 实体属性描述
"typeAnnotation": TypeAnnotation, // 类型
"databaseTypeAnnotation": DatabaseTypeAnnotation, // 数据库存储类型
"required": boolean, // 是否必填
"defaultValue": string, // 默认值,JSON 字符串
"primaryKey": boolean, // 当前属性是否为主键
"relationNamespace": string, // 关联实体的命名空间
"relationEntity": string, // 关联实体
"relationProperty": string, // 关联属性
"deleteRule": "protect" | "cascade", // 关联属性实体记录删除规则
"display": { [name: string]: boolean }, // 显示方式
"rules": Array<string>, // 验证规则
"generationRule": "auto" | "autoIncrement" | "manual", // 生成规则
"sequence": string, // 表示 Oracle 主键自增时的序列名称
}

示例

简单示例

{
"concept": "EntityProperty",
"name": "schoolId",
"columnName": "schoolId",
"label": "所在学校 Id",
"description": "关联所在学校 Id 的属性",
"typeAnnotation": null,
"databaseTypeAnnotation": null,
"required": true,
"defaultValue": null,
"primaryKey": false,
"relationNamespace": null,
"relationEntity": null,
"relationProperty": null,
"deleteRule": "protect",
"display": {
"inDetail": true,
"inFilter": true,
"inForm": true,
"inTable": true
},
"rules": [
"maxLength(256)"
],
"generationRule": "auto",
"sequence": null
}