EntityProperty 实体属性
结构声明
- TS Declaration
- Java Class
- JSON Schema
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 主键自增时的序列名称
}
class EntityPropertyTreeNode {
ConceptEnum concept; // 产品概念
String name; // 实体属性名称
String uuid; // 唯一标识
String columnName; // 数据库列名
String label; // 实体属性标题
String description; // 实体属性描述
TypeAnnotationTreeNode typeAnnotation; // 类型
DatabaseTypeAnnotationTreeNode databaseTypeAnnotation; // 数据库存储类型
boolean required; // 是否必填
String defaultValue; // 默认值,JSON 字符串
boolean primaryKey; // 当前属性是否为主键
String relationNamespace; // 关联实体的命名空间
String relationEntity; // 关联实体
String relationProperty; // 关联属性
DeleteRuleEnum deleteRule; // 关联属性实体记录删除规则
Object display; // 显示方式
List<String> rules; // 验证规则
GenerationRuleEnum generationRule; // 生成规则
String sequence; // 表示 Oracle 主键自增时的序列名称
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/EntityProperty",
"definitions": {
"EntityProperty": {
"type": "object",
"properties": {
"concept": {
"type": "string",
"const": "EntityProperty"
},
"name": {
"type": "string"
},
"uuid": {
"type": "string"
},
"columnName": {
"type": "string"
},
"label": {
"type": "string"
},
"description": {
"type": "string"
},
"typeAnnotation": {
"$ref": "#/definitions/TypeAnnotation"
},
"databaseTypeAnnotation": {
"$ref": "#/definitions/DatabaseTypeAnnotation"
},
"required": {
"type": "boolean"
},
"defaultValue": {
"type": "string"
},
"primaryKey": {
"type": "boolean"
},
"relationNamespace": {
"type": "string"
},
"relationEntity": {
"type": "string"
},
"relationProperty": {
"type": "string"
},
"deleteRule": {
"type": "string",
"enum": [
"protect",
"cascade"
]
},
"display": {
"type": "object",
"additionalProperties": {
"type": "boolean"
}
},
"rules": {
"type": "array",
"items": {
"type": "string"
}
},
"generationRule": {
"type": "string",
"enum": [
"auto",
"autoIncrement",
"manual"
]
},
"sequence": {
"type": "string"
}
},
"required": [
"concept",
"name",
"uuid",
"columnName",
"label",
"description",
"typeAnnotation",
"databaseTypeAnnotation",
"required",
"defaultValue",
"primaryKey",
"relationNamespace",
"relationEntity",
"relationProperty",
"deleteRule",
"display",
"rules",
"generationRule",
"sequence"
],
"additionalProperties": false
}
}
}
示例
简单示例
- JSON
- YAML
{
"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
}
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