Skip to main content
Version: 3.5

EntityProperty 实体属性

1. 结构声明

class EntityProperty extends BaseNode {
name: string = '';
uuid: uuid;
columnName: string;
label: string;
description: string;
typeAnnotation: TypeAnnotation;
databaseTypeAnnotation?: DatabaseTypeAnnotation;
required?: boolean;
defaultValue?: DefaultValue;
primaryKey?: boolean;
relationNamespace?: string;
relationEntity?: string;
relationProperty?: string;
deleteRule?: 'protect' | 'cascade';
display: Map<string, boolean> = ({
inDetail: true,
inFilter: true,
inForm: true,
inTable: true
} as any);
rules: Array<string>;
generationRule: 'auto' | 'autoIncrement' | 'manual' = 'auto';
sequence?: string;
}

2. 节点示例

(1) 示例

AST 如下:

{
"concept": "EntityProperty",
"name": "status",
"uuid": "b1a9e167277e4f73b6b218eb7ede43ad",
"label": "",
"description": "",
"columnName": "status",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "reference",
"typeNamespace": "app.enums",
"typeName": "ProductStatus",
"inferred": false,
"ruleMap": {}
},
"display": {
"inDetail": true,
"inFilter": true,
"inForm": true,
"inTable": true
},
"rules": [],
"generationRule": "manual"
}

(2) 带关联关系的

AST 如下:

{
"concept": "EntityProperty",
"name": "productId",
"uuid": "b1a9e167277e4f73b6b218eb7ede43ad",
"label": "",
"description": "",
"columnName": "productId",
"relationNamespace": "app.dataSources.defaultDS",
"relationEntity": "Product",
"relationProperty": "id",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Long",
"inferred": false,
"ruleMap": {}
},
"display": {
"inDetail": true,
"inFilter": true,
"inForm": true,
"inTable": true
},
"rules": [],
"generationRule": "manual"
}