This milestone for the eventually SDK 1.0.0 release preparation;
Since 2024-05-10
, this upgrade may introduce code broken!
Remove the support for cn_message
use the message2
instead for the constant option;
message Meta {
//this is the code of this constant, without the offset
//the framework will hand this stuff
int32 code = 1;
// this is the description of this constant
// this should be primary language supported(for example english)
string message = 2;
// Deprecated since 2024-05-08 from logic
// Then will be removed before 1.0.0 official version
// eventually use the i18n to solve this issue
string cn_message = 3 [deprecated = true];
// this is another description of this constant
// This will be the second language supported(for example chinese)
string message2 = 4;
// those for the error extension
// if this set then this will
Error error = 5;
}
- upgrade the IDEA plugin to
0.4.0
+ - upgrade the SDK to
0.9.8-RELEASE
+- open file:
{PROJECT}/gradle/libs.versions.toml
- find and update:
apihug = "OLD_VERSION"
->0.9.8-RELEASE
+
- open file:
- reload the gradle
- exist-enum wire class will report error
descriptionZhCN
overwrite illegal; - try to find all the
setDescriptionZhCN
of the enum replace them withsetDescription2
; (for error description upgrade) - try to find all the
descriptionZhCN
of the enum replace them withdescription2
; (for enum description upgrade) - change all the
cn_message
inproto
tomessage2
, as thecn_message
will be removed soon.
after all the error gone, then rebuild, everything goes well again!
in the hope-wire.json
define:
{
"persistence": {
"identifyType": "LONG",
"tenantType": "LONG",
"format": "CAMEL",
"upper": "UPPER"
}
}
- Format
DEFAULT
: as old framework, convert toSNAKE
styleCAMEL
:myVariableName
SNAKE
:my_variable_name
- Upper
DEFAULT
:as old framework, convert toUPPER
styleUPPER
:name
->NAME
LOWER
:NAME
->name
CAPITALIZE
:userName
->UserName
- Exception: if you set column name manually in the proto already, this will always be the highest priority!
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
}];
Latest Plugin(since 0.4.0), project template will introduce build proto modules only flag.
But if your project already exist please follow this to update to support, as this only some gradle tricky.
open: {PROJECT}/settings.gradle
:
- replace
YOUR_PROTO_MODULE
with your proto module; - replace
YOUR_APP_MODULE
with your app module;
def onlyProto = System.getProperty("onlyProto")?.toString();
if(onlyProto ==null){
onlyProto = System.getenv('onlyProto')?.toString();
}
// If onlyProto property is not set or is not a valid boolean, default to false
// `-DonlyProto=true` to enable this
onlyProto = onlyProto != null ? onlyProto.toBoolean() : false
// Include
include('YOUR_PROTO_MODULE')
if(!onlyProto) {
include('YOUR_APP_MODULE')
}else{
logger.quiet "-DonlyProto=true so no app modules will be included"
}
Then you can use this shell: gradlew clean build -x test -x wireTest -DonlyProto=true
,
to build your proto modules quickly, especially when you has broken update in the proto!