Protocol Buffers
How ApiHug use protocol buffers to define Database Entity
Customization
Since Milestone of 2024-05-10
Project module {modile}-proto
src/resources/hope-wire.json
define:
{
"persistence": {
"identifyType": "LONG",
"tenantType": "LONG",
"format": "CAMEL",
"upper": "UPPER"
}
}
Format:
DEFAULT
: as old framework, convert to SNAKE
styleCAMEL
: myVariableName
SNAKE
: my_variable_name
Upper:
DEFAULT
:as old framework, convert to UPPER
styleUPPER
: name
-> NAME
LOWER
: NAME
-> name
CAPITALIZE
: userName
-> UserName
hope.common.persistence.plugin.NameMappingStrategy
client plugin to rename the column name.case 3, the column will always be MY_USER_NAME
as manually set as: name: "MY_USER_NAME"
;
string user_name = 1 [(hope.persistence.column) = {
name: "MY_USER_NAME",
description: "name of the account",
nullable: FALSE,
updatable: FALSE,
length: {
value: 32
},
type: VARCHAR
}];