transactions

This commit is contained in:
2025-10-24 00:48:19 +02:00
parent f6cae99d59
commit 988706c996
6 changed files with 34 additions and 1 deletions

View File

@@ -0,0 +1,4 @@
#Command
@Extends(Command)
CommandRollback {
}

View File

@@ -0,0 +1,4 @@
#Command
@Extends(Command)
CommandRollbackResponse {
}

View File

@@ -1,6 +1,8 @@
#Command #Command
CommandWrapper { CommandWrapper {
transaction: string { } ; // Random Transaction ID transaction: string { } ; // Random Transaction ID
commit: boolean { @PrimitiveType } ;
request: string {} ; // Random Request ID request: string {} ; // Random Request ID
type: string {} ; // Command Type type: string {} ; // Command Type
payload: binary {} ; payload: binary {} ;

View File

@@ -22,7 +22,7 @@ ENTITY_PKG=de.infinimotion.model.bean
ProjectVariable.MAVEN_ARTIFACT_ID=model ProjectVariable.MAVEN_ARTIFACT_ID=model
ProjectVariable.MAVEN_GROUP_ID=de.infinimotion ProjectVariable.MAVEN_GROUP_ID=de.infinimotion
ProjectVariable.PROJECT_NAME=infinimodel ProjectVariable.PROJECT_NAME=infinimodel
ProjectVariable.PROJECT_VERSION=0.0.44 ProjectVariable.PROJECT_VERSION=0.0.54
ProjectVariable.REST_SERVER_PORT=3000 ProjectVariable.REST_SERVER_PORT=3000
ProjectVariable.REST_API_ROOT=/api/v1 ProjectVariable.REST_API_ROOT=/api/v1
ProjectVariable.REST_URL_ROOT=http://localhost:3000 ProjectVariable.REST_URL_ROOT=http://localhost:3000

View File

@@ -139,6 +139,17 @@ public#if( $entity.isAbstract() ) abstract#end class ${entity.name}#if( $entity.
return this; return this;
} }
public $entity.name tx(CommandWrapper wrapper) {
setTransaction(wrapper.getTransaction());
setRequest(java.util.UUID.randomUUID().toString());
return this;
}
public $entity.name commit() {
setCommit(true);
return this;
}
public ${entity.name}(CommandWrapper wrapper) { public ${entity.name}(CommandWrapper wrapper) {
this(); this();
copyIds(wrapper); copyIds(wrapper);

View File

@@ -146,6 +146,18 @@ public#if( $entity.isAbstract() ) abstract#end class ${entity.name}#if( $entity.
return this; return this;
} }
public $entity.name tx(CommandWrapper wrapper) {
setTransaction(wrapper.getTransaction());
setRequest(java.util.UUID.randomUUID().toString());
return this;
}
public $entity.name commit() {
setCommit(true);
return this;
}
public ${entity.name}(CommandWrapper wrapper) { public ${entity.name}(CommandWrapper wrapper) {
this(); this();
copyIds(wrapper); copyIds(wrapper);