diff --git a/README.md b/README.md
index 576559f6e..9e13d9f8c 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,10 @@
**Nop is nOt Programming(非编程)**
Nop Platform 2.0 is a next-generation low-code development platform built from scratch based on the principles of reversible computation, adopting a language-oriented programming paradigm. It includes a suite of fully designed engines such as a GraphQL engine, ORM engine, workflow engine, reporting engine, rule engine, and batch processing engine, all developed from scratch based on new principles. It automatically generates GraphQL/REST/gRPC services according to Excel data models, allowing for customized development without modifying the source code of the basic product. It supports native compilation with GraalVM, and is free for commercial use by small and medium-sized enterprises.
-Nop Platform 2.0基于可逆计算原理从零开始构建的采用面向语言编程范式的下一代低代码开发平台。包含基于全新原理从零开始研发的GraphQL引擎、ORM引擎、工作流引擎、报表引擎、规则引擎、批处理引引擎等完整设计,根据Excel数据模型自动生成GraphQL/REST/gRPC服务,定制化开发无需修改基础产品源码,支持GraalVM原生编译,中小企业可以免费商用。
+
+Nop Platform 2.0是基于可逆计算原理从零开始构建的采用面向语言编程范式的下一代低代码开发平台。包含基于全新原理从零开始研发的GraphQL引擎、ORM引擎、工作流引擎、报表引擎、规则引擎、批处理引引擎等完整设计,根据Excel数据模型自动生成GraphQL/REST/gRPC服务,定制化开发无需修改基础产品源码,支持GraalVM原生编译,中小企业可以免费商用。
+
+**Nop平台的底层没有使用Spring等第三方框架,而是基于新的软件构造原理重新设计并实现,极大降低了框架内在结构的复杂性,同时大幅提升框架的灵活性、可扩展性和性能。它的设计目标是探索下一代软件生产技术,为AI时代的软件智能生产奠定技术基础**
- nop-entropy是Nop平台的后端部分。它采用Java语言实现,不依赖第三方框架,可以和Quarkus、Spring或者Solon框架集成在一起使用。
@@ -21,15 +24,15 @@ Nop Platform 2.0基于可逆计算原理从零开始构建的采用面向语言
框架编译为原生可执行程序,运行时不需要安装JDK,且启动速度提升数十倍。
- **nop-entropy的设计目标是成为简单易用的领域语言工作台(Domain Language Workbench)**
- 。通过增加简单的元数据定义,就可以自动得到对应的解析器、验证器、IDE插件、调试工具等,并自动为DSL领域语言增加模块分解、差量定制、元编程等通用语言特性。在这一点上,它类似于Jetbrains公司的[MPS产品](https://www.jetbrains.com/mps/)
+ 。在Nop平台中,我们一般并不直接使用通用的程序语言如Java来表达业务逻辑,而是先设计一个DSL语言,然后再用DSL来表达业务。通过增加简单的元数据定义,就可以自动得到对应的解析器、验证器、IDE插件、调试工具等,并自动为DSL领域语言增加模块分解、差量定制、元编程等通用语言特性。 在这一点上,它类似于Jetbrains公司的[MPS产品](https://www.jetbrains.com/mps/)
,只是它的设计原理和技术实现路径与MPS有着本质性差别。
- nop-entropy采用云原生设计,内置分布式事务和多租户支持,可以单机运行,也可以作为分布式集群运行,可以提供在线的API服务,也可以将针对单个业务对象的在线服务自动包装为针对批处理文件的批处理任务。对于大多数业务应用场景均提供相应的模型支持,只需少量配置即可完成主要功能,大大降低对手工编码的需求。
- nop-entropy在开发期可以作为**支持增量式开发的低代码平台**,自动生成各类代码以及相关文档,在运行期可以作为*
- *面向最终用户的无代码平台的支撑技术**,允许客户在线调整业务模块功能,以所见即所得的方式进行产品迭代。
+ *面向最终用户的无代码平台的支撑技术**,允许客户在线调整业务模块功能,以所见即所得的方式进行产品迭代。**Nop平台可以作为一个非常精巧的通用SAAS平台底座**,基于它只需要做少量包装即可实现一个完善的针对特定领域的SAAS平台。
-目前开源的部分主要包含XLang语言的实现,以及ORM、依赖注入容器(IoC)、分布式配置(Config)、GraphQLEngine、报表引擎(Report
+目前Nop平台开源的部分主要包含XLang语言的实现,以及ORM、依赖注入容器(IoC)、分布式配置(Config)、GraphQLEngine、报表引擎(Report
Engine)、任务调度引擎(Job Scheduler)、批处理引擎(Batch Prcessing Engine)、规则引擎(Rule Engine)等基础框架,
后续规划包括工作流引擎(Workflow Engine)、商业智能(BI)、流处理引擎等业务开发常用部分。
diff --git a/nop-cli/demo/codegen.sh b/nop-cli/demo/codegen.sh
new file mode 100644
index 000000000..221c9f1f4
--- /dev/null
+++ b/nop-cli/demo/codegen.sh
@@ -0,0 +1 @@
+java -Dfile.encoding=UTF8 -jar ../target/nop-cli-2.0.0-BETA.1.jar gen -t=v:/nop/templates/orm ../../nop-demo/nop-ddd-demo/model/demo-ddd.orm.xlsx -o=target
\ No newline at end of file
diff --git a/nop-cli/demo/reverse-db.sh b/nop-cli/demo/reverse-db.sh
new file mode 100644
index 000000000..dcf995248
--- /dev/null
+++ b/nop-cli/demo/reverse-db.sh
@@ -0,0 +1 @@
+java -Dfile.encoding=UTF8 -Dnop.orm.check-entity-loop-dependency=false -jar ../target/nop-cli-2.0.0-BETA.1.jar reverse-db ddd -c=com.mysql.cj.jdbc.Driver --username=nop --password=nop-test --jdbcUrl="jdbc:mysql://127.0.0.1:3306/ddd?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC"
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/.dockerignore b/nop-demo/nop-ddd-demo/.dockerignore
new file mode 100644
index 000000000..94810d006
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/.dockerignore
@@ -0,0 +1,5 @@
+*
+!target/*-runner
+!target/*-runner.jar
+!target/lib/*
+!target/quarkus-app/*
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/.gitattributes b/nop-demo/nop-ddd-demo/.gitattributes
new file mode 100644
index 000000000..0de2f1602
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/.gitattributes
@@ -0,0 +1,19 @@
+*.xml text eol=lf
+*.yaml text eol=lf
+*.xlib text eol=lf
+*.xdef text eol=lf
+*.xmeta text eol=lf
+*.java text eol=lf
+*.xwf text eol=lf
+*.xgen text eol=lf
+*.xrun text eol=lf
+*.xtask text eol=lf
+*.sql text eol=lf
+*.json text eol=lf
+*.json5 text eol=lf
+*.xbiz text eol=lf
+*.interp text eol=lf
+*.tokens text eol=lf
+*.xpl text eol=lf
+*.md text eol=lf
+*.csv text eol=lf
diff --git a/nop-demo/nop-ddd-demo/.gitignore b/nop-demo/nop-ddd-demo/.gitignore
new file mode 100644
index 000000000..31d046f4e
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/.gitignore
@@ -0,0 +1,43 @@
+#Maven
+target/
+pom.xml.tag
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+release.properties
+.flattened-pom.xml
+
+# Eclipse
+.project
+.classpath
+.settings/
+bin/
+
+# IntelliJ
+.idea
+*.ipr
+*.iml
+*.iws
+
+# NetBeans
+nb-configuration.xml
+
+# Visual Studio Code
+.vscode
+.factorypath
+
+# OSX
+.DS_Store
+
+# Vim
+*.swp
+*.swo
+
+# patch
+*.orig
+*.rej
+
+# Plugin directory
+/.quarkus/cli/plugins/
+
+_dump
+/db
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/README.md b/nop-demo/nop-ddd-demo/README.md
new file mode 100644
index 000000000..cf56e9978
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/README.md
@@ -0,0 +1,10 @@
+# 说明
+
+dddsample项目由DDD原书作者Eric Evans的公司Domain Language与瑞典软件咨询公司Citerus共同合作完成的DDD原理演示项目。
+
+github地址:[https://github.com/citerus/dddsample-core](https://github.com/citerus/dddsample-core)
+
+该项目模拟了一个货运管理系统,用于处理货物(Cargo)的预订、路线安排、跟踪等活动。详细介绍可以参见[解读DDD原书配套的项目示例(一): 代码结构](https://zhuanlan.zhihu.com/p/721441909)
+
+`nop-ddd-demo`基于Nop平台的基础设施实现了同样的业务功能,可以和dddsample的实现对比来感受Nop平台的不同之处。
+
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-api/pom.xml b/nop-demo/nop-ddd-demo/demo-ddd-api/pom.xml
new file mode 100644
index 000000000..019fc0299
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-api/pom.xml
@@ -0,0 +1,45 @@
+
+
+
+ 4.0.0
+
+ app.demo
+
+ demo-ddd-api
+
+ 1.0.0-SNAPSHOT
+
+
+ 2.0.0-SNAPSHOT
+ 11
+ UTF-8
+ UTF-8
+ ${java.version}
+ ${java.version}
+ ${java.version}
+
+
+
+
+ io.github.entropy-cloud
+ nop-api-core
+ ${nop-entropy.version}
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-site-plugin
+ 4.0.0-M2
+
+
+ org.apache.maven.plugins
+ maven-project-info-reports-plugin
+ 3.3.0
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-app/pom.xml b/nop-demo/nop-ddd-demo/demo-ddd-app/pom.xml
new file mode 100644
index 000000000..9becfeb80
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-app/pom.xml
@@ -0,0 +1,105 @@
+
+
+
+
+ demo-ddd
+ app.demo
+ 1.0.0-SNAPSHOT
+
+
+ 4.0.0
+
+ demo-ddd-app
+
+
+ true
+ true
+
+
+
+
+ io.github.entropy-cloud
+ nop-quarkus-web-orm-starter
+
+
+ demo-ddd-service
+ app.demo
+ 1.0.0-SNAPSHOT
+
+
+ demo-ddd-web
+ app.demo
+ 1.0.0-SNAPSHOT
+
+
+ io.github.entropy-cloud
+ nop-auth-web
+
+
+ io.github.entropy-cloud
+ nop-auth-service
+
+
+ io.github.entropy-cloud
+ nop-web-amis-editor
+
+
+ io.github.entropy-cloud
+ nop-web-site
+
+
+ io.quarkus
+ quarkus-jdbc-mysql
+
+
+ io.quarkus
+ quarkus-jdbc-h2
+
+
+
+
+
+
+ maven-surefire-plugin
+ ${surefire-plugin.version}
+
+
+ org.jboss.logmanager.LogManager
+ ${maven.home}
+
+
+
+
+ io.quarkus
+ quarkus-maven-plugin
+ ${quarkus.platform.version}
+
+
+
+ build
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+
+
+
+
+
+
+ native
+
+
+ native
+
+
+
+ native
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/docker/Dockerfile.jvm b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/docker/Dockerfile.jvm
new file mode 100644
index 000000000..4a84a6678
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/docker/Dockerfile.jvm
@@ -0,0 +1,97 @@
+####
+# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
+#
+# Before building the container image run:
+#
+# ./mvnw package
+#
+# Then, build the image with:
+#
+# docker build . -f=src/main/docker/Dockerfile.jvm -t=nop/demo-ddd-app
+#
+# Then run the container using:
+#
+# docker run -i --rm -p 8080:8080 nop/demo-ddd-app
+#
+# If you want to include the debug port into your docker image
+# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005.
+# Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005
+# when running the container
+#
+# Then run the container using :
+#
+# docker run -i --rm -p 8080:8080 nop/demo-ddd-app
+#
+# This image uses the `run-java.sh` script to run the application.
+# This scripts computes the command line to execute your Java application, and
+# includes memory/GC tuning.
+# You can configure the behavior using the following environment properties:
+# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class")
+# - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options
+# in JAVA_OPTS (example: "-Dsome.property=foo")
+# - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is
+# used to calculate a default maximal heap memory based on a containers restriction.
+# If used in a container without any memory constraints for the container then this
+# option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio
+# of the container available memory as set here. The default is `50` which means 50%
+# of the available memory is used as an upper boundary. You can skip this mechanism by
+# setting this value to `0` in which case no `-Xmx` option is added.
+# - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This
+# is used to calculate a default initial heap memory based on the maximum heap memory.
+# If used in a container without any memory constraints for the container then this
+# option has no effect. If there is a memory constraint then `-Xms` is set to a ratio
+# of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx`
+# is used as the initial heap size. You can skip this mechanism by setting this value
+# to `0` in which case no `-Xms` option is added (example: "25")
+# - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS.
+# This is used to calculate the maximum value of the initial heap memory. If used in
+# a container without any memory constraints for the container then this option has
+# no effect. If there is a memory constraint then `-Xms` is limited to the value set
+# here. The default is 4096MB which means the calculated value of `-Xms` never will
+# be greater than 4096MB. The value of this variable is expressed in MB (example: "4096")
+# - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output
+# when things are happening. This option, if set to true, will set
+# `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true").
+# - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example:
+# true").
+# - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787").
+# - CONTAINER_CORE_LIMIT: A calculated core limit as described in
+# https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2")
+# - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024").
+# - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion.
+# (example: "20")
+# - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking.
+# (example: "40")
+# - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection.
+# (example: "4")
+# - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus
+# previous GC times. (example: "90")
+# - GC_METASPACE_SIZE: The initial metaspace size. (example: "20")
+# - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100")
+# - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should
+# contain the necessary JRE command-line options to specify the required GC, which
+# will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC).
+# - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080")
+# - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080")
+# - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be
+# accessed directly. (example: "foo.example.com,bar.example.com")
+#
+###
+FROM registry.access.redhat.com/ubi8/openjdk-17:1.16
+
+ENV LANGUAGE='en_US:en'
+
+
+# We make four distinct layers so if there are application changes the library layers can be re-used
+COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/
+COPY --chown=185 target/quarkus-app/*.jar /deployments/
+COPY --chown=185 target/quarkus-app/app/ /deployments/app/
+COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/
+
+EXPOSE 8080
+USER 185
+ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
+ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
+
+ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]
+
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/docker/Dockerfile.legacy-jar b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/docker/Dockerfile.legacy-jar
new file mode 100644
index 000000000..19cef39e6
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/docker/Dockerfile.legacy-jar
@@ -0,0 +1,93 @@
+####
+# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
+#
+# Before building the container image run:
+#
+# ./mvnw package -Dquarkus.package.type=legacy-jar
+#
+# Then, build the image with:
+#
+# docker build . -f=src/main/docker/Dockerfile.legacy-jar -t=nop/demo-ddd-app .
+#
+# Then run the container using:
+#
+# docker run -i --rm -p 8080:8080 nop/demo-ddd-app
+#
+# If you want to include the debug port into your docker image
+# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005.
+# Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005
+# when running the container
+#
+# Then run the container using :
+#
+# docker run -i --rm -p 8080:8080 nop/demo-ddd-app
+#
+# This image uses the `run-java.sh` script to run the application.
+# This scripts computes the command line to execute your Java application, and
+# includes memory/GC tuning.
+# You can configure the behavior using the following environment properties:
+# - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class")
+# - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options
+# in JAVA_OPTS (example: "-Dsome.property=foo")
+# - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is
+# used to calculate a default maximal heap memory based on a containers restriction.
+# If used in a container without any memory constraints for the container then this
+# option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio
+# of the container available memory as set here. The default is `50` which means 50%
+# of the available memory is used as an upper boundary. You can skip this mechanism by
+# setting this value to `0` in which case no `-Xmx` option is added.
+# - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This
+# is used to calculate a default initial heap memory based on the maximum heap memory.
+# If used in a container without any memory constraints for the container then this
+# option has no effect. If there is a memory constraint then `-Xms` is set to a ratio
+# of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx`
+# is used as the initial heap size. You can skip this mechanism by setting this value
+# to `0` in which case no `-Xms` option is added (example: "25")
+# - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS.
+# This is used to calculate the maximum value of the initial heap memory. If used in
+# a container without any memory constraints for the container then this option has
+# no effect. If there is a memory constraint then `-Xms` is limited to the value set
+# here. The default is 4096MB which means the calculated value of `-Xms` never will
+# be greater than 4096MB. The value of this variable is expressed in MB (example: "4096")
+# - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output
+# when things are happening. This option, if set to true, will set
+# `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true").
+# - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example:
+# true").
+# - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787").
+# - CONTAINER_CORE_LIMIT: A calculated core limit as described in
+# https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2")
+# - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024").
+# - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion.
+# (example: "20")
+# - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking.
+# (example: "40")
+# - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection.
+# (example: "4")
+# - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus
+# previous GC times. (example: "90")
+# - GC_METASPACE_SIZE: The initial metaspace size. (example: "20")
+# - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100")
+# - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should
+# contain the necessary JRE command-line options to specify the required GC, which
+# will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC).
+# - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080")
+# - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080")
+# - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be
+# accessed directly. (example: "foo.example.com,bar.example.com")
+#
+###
+FROM registry.access.redhat.com/ubi8/openjdk-17:1.16
+
+ENV LANGUAGE='en_US:en'
+
+
+COPY target/lib/* /deployments/lib/
+COPY target/*-runner.jar /deployments/quarkus-run.jar
+
+EXPOSE 8080
+USER 185
+ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
+ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
+
+ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/docker/Dockerfile.native b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/docker/Dockerfile.native
new file mode 100644
index 000000000..7afd48965
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/docker/Dockerfile.native
@@ -0,0 +1,27 @@
+####
+# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode.
+#
+# Before building the container image run:
+#
+# ./mvnw package -Dnative
+#
+# Then, build the image with:
+#
+# docker build . -f=src/main/docker/Dockerfile.native -t=nop/demo-ddd-app .
+#
+# Then run the container using:
+#
+# docker run -i --rm -p 8080:8080 nop/demo-ddd-app
+#
+###
+FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8
+WORKDIR /work/
+RUN chown 1001 /work \
+ && chmod "g+rwX" /work \
+ && chown 1001:root /work
+COPY --chown=1001:root target/*-runner /work/application
+
+EXPOSE 8080
+USER 1001
+
+ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"]
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/docker/Dockerfile.native-micro b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/docker/Dockerfile.native-micro
new file mode 100644
index 000000000..21f87f988
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/docker/Dockerfile.native-micro
@@ -0,0 +1,30 @@
+####
+# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode.
+# It uses a micro base image, tuned for Quarkus native executables.
+# It reduces the size of the resulting container image.
+# Check https://quarkus.io/guides/quarkus-runtime-base-image for further information about this image.
+#
+# Before building the container image run:
+#
+# ./mvnw package -Dnative
+#
+# Then, build the image with:
+#
+# docker build . -f=src/main/docker/Dockerfile.native-micro -t=nop/demo-ddd-app .
+#
+# Then run the container using:
+#
+# docker run -i --rm -p 8080:8080 nop/demo-ddd-app
+#
+###
+FROM quay.io/quarkus/quarkus-micro-image:2.0
+WORKDIR /work/
+RUN chown 1001 /work \
+ && chmod "g+rwX" /work \
+ && chown 1001:root /work
+COPY --chown=1001:root target/*-runner /work/application
+
+EXPOSE 8080
+USER 1001
+
+ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"]
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/java/app/demo/app/DemoDddApplication.java b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/java/app/demo/app/DemoDddApplication.java
new file mode 100644
index 000000000..82e37c03b
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/java/app/demo/app/DemoDddApplication.java
@@ -0,0 +1,32 @@
+
+package app.demo.app;
+
+import io.nop.boot.NopApplication;
+import io.nop.core.initialize.CoreInitialization;
+import io.nop.quarkus.core.QuarkusIntegration;
+import io.quarkus.runtime.Quarkus;
+import io.quarkus.runtime.ShutdownEvent;
+import io.quarkus.runtime.StartupEvent;
+import io.quarkus.runtime.annotations.QuarkusMain;
+
+import jakarta.enterprise.event.Observes;
+
+@QuarkusMain
+public class DemoDddApplication {
+ static String[] globalArgs;
+
+ public void start(@Observes StartupEvent event) {
+ QuarkusIntegration.start();
+
+ new NopApplication().run(globalArgs);
+ }
+
+ public void stop(@Observes ShutdownEvent event) {
+ CoreInitialization.destroy();
+ }
+
+ public static void main(String... args) {
+ globalArgs = args;
+ Quarkus.run(args);
+ }
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/META-INF/native-image/app.demo/demo-ddd-app/jni-config.json b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/META-INF/native-image/app.demo/demo-ddd-app/jni-config.json
new file mode 100644
index 000000000..dd55f5bac
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/META-INF/native-image/app.demo/demo-ddd-app/jni-config.json
@@ -0,0 +1,43 @@
+[
+ {
+ "name": "java.lang.ClassLoader",
+ "methods": [
+ {
+ "name": "getPlatformClassLoader",
+ "parameterTypes": []
+ }
+ ]
+ },
+ {
+ "name": "java.lang.NoSuchMethodError"
+ },
+ {
+ "name": "sun.management.VMManagementImpl",
+ "fields": [
+ {
+ "name": "compTimeMonitoringSupport"
+ },
+ {
+ "name": "currentThreadCpuTimeSupport"
+ },
+ {
+ "name": "objectMonitorUsageSupport"
+ },
+ {
+ "name": "otherThreadCpuTimeSupport"
+ },
+ {
+ "name": "remoteDiagnosticCommandsSupport"
+ },
+ {
+ "name": "synchronizerUsageSupport"
+ },
+ {
+ "name": "threadAllocatedMemorySupport"
+ },
+ {
+ "name": "threadContentionMonitoringSupport"
+ }
+ ]
+ }
+]
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/META-INF/native-image/app.demo/demo-ddd-app/native-image.properties b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/META-INF/native-image/app.demo/demo-ddd-app/native-image.properties
new file mode 100644
index 000000000..6e2247d47
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/META-INF/native-image/app.demo/demo-ddd-app/native-image.properties
@@ -0,0 +1,10 @@
+Args=--enable-http \
+--enable-https \
+--enable-all-security-services \
+-H:-CheckToolchain \
+-H:+AllowDeprecatedBuilderClassesOnImageClasspath \
+-H:EnableURLProtocols=http,https \
+-H:ReflectionConfigurationResources=${.}/reflect-config.json \
+-H:JNIConfigurationResources=${.}/jni-config.json \
+-H:ResourceConfigurationResources=${.}/resource-config.json \
+--trace-object-instantiation=java.security.SecureRandom
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/META-INF/native-image/app.demo/demo-ddd-app/resource-config.json b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/META-INF/native-image/app.demo/demo-ddd-app/resource-config.json
new file mode 100644
index 000000000..faa24b86b
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/META-INF/native-image/app.demo/demo-ddd-app/resource-config.json
@@ -0,0 +1,34 @@
+{
+ "resources": [
+ {
+ "pattern": ".*\\.xml$"
+ },
+ {
+ "pattern": ".*\\.yaml$"
+ },
+ {
+ "pattern": ".*\\.json5$"
+ },
+ {
+ "pattern": ".*\\.json$"
+ },
+ {
+ "pattern": ".*\\.properties$"
+ },
+ {
+ "pattern": ".*\\.xdef$"
+ },
+ {
+ "pattern": ".*\\.txt$"
+ },
+ {
+ "pattern": "META-INF/services/*.*"
+ },
+ {
+ "pattern": "_vfs/*.*"
+ },
+ {
+ "pattern": "_conf/*.*"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/_vfs/demo/ddd/auth/app.action-auth.xml b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/_vfs/demo/ddd/auth/app.action-auth.xml
new file mode 100644
index 000000000..67504a6e7
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/_vfs/demo/ddd/auth/app.action-auth.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/_vfs/demo/ddd/auth/app.data-auth.xml b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/_vfs/demo/ddd/auth/app.data-auth.xml
new file mode 100644
index 000000000..62fb082f4
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/_vfs/demo/ddd/auth/app.data-auth.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/application.yaml b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/application.yaml
new file mode 100644
index 000000000..2221854b4
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/application.yaml
@@ -0,0 +1,57 @@
+
+nop:
+ debug: true
+ auth:
+ jwt:
+ enc-key: 5fc5e7a3604e47d281e63813dca9e5a5
+
+ login:
+ allow-create-default-user: true # 如果用户表为空,则自动创建缺省账户nop, 密码nop-test
+
+ site-map:
+ static-config-path: /demo/ddd/auth/app.action-auth.xml
+ cache-timeout: 1s
+ support-debug: true
+
+ data-auth-config-path: /demo/ddd/auth/app.data-auth.xml
+
+ web:
+ validate-page-model: true
+
+ orm:
+ init-database-schema: true
+
+ datasource:
+ driver-class-name: org.h2.Driver
+ jdbc-url: jdbc:h2:./db/test
+ username: sa
+ password:
+# driver-class-name: com.mysql.cj.jdbc.Driver
+# jdbc-url: jdbc:mysql://127.0.0.1:3306/dev?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
+# username: nop
+# password: nop-test
+
+# 支持graphql __schema查询,
+ graphql:
+ schema-introspection:
+ enabled: true
+
+# devservices 会启用testcontainers来管理测试数据库
+quarkus:
+ devservices:
+ enabled: false
+
+ datasource:
+ devservices:
+ enabled: false
+
+ http:
+ host: 0.0.0.0
+ cors: true
+
+ log:
+ level: INFO
+
+ category:
+ "io.nop":
+ level: INFO
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/bootstrap.yaml b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/bootstrap.yaml
new file mode 100644
index 000000000..372452436
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-app/src/main/resources/bootstrap.yaml
@@ -0,0 +1,2 @@
+"%dev":
+ nop.codegen.trace.enabled: true
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-codegen/pom.xml b/nop-demo/nop-ddd-demo/demo-ddd-codegen/pom.xml
new file mode 100644
index 000000000..32fa11c8c
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-codegen/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ demo-ddd
+ app.demo
+ 1.0.0-SNAPSHOT
+
+
+ 4.0.0
+
+ demo-ddd-codegen
+
+ jar
+
+
+
+ io.github.entropy-cloud
+ nop-ooxml-xlsx
+
+
+ io.github.entropy-cloud
+ nop-orm
+
+
+ io.github.entropy-cloud
+ nop-graphql-core
+
+
+ io.github.entropy-cloud
+ nop-xlang-debugger
+
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-codegen/postcompile/gen-orm.xgen b/nop-demo/nop-ddd-demo/demo-ddd-codegen/postcompile/gen-orm.xgen
new file mode 100644
index 000000000..aec95ded2
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-codegen/postcompile/gen-orm.xgen
@@ -0,0 +1,7 @@
+
+
+// 根据ORM模型生成dao/entity/xbiz
+codeGenerator.withTargetDir("../").renderModel('../../model/demo-ddd.orm.xlsx','/nop/templates/orm', '/',$scope);
+codeGenerator.withTargetDir("../demo-ddd-dao/src/main/java").renderModel('../../demo-ddd-dao/src/main/resources/_vfs/demo/ddd/orm/app.orm.xml',
+ '/nop/templates/orm-entity','/',$scope);
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-codegen/src/test/java/app/demo/codegen/DemoDddCodeGen.java b/nop-demo/nop-ddd-demo/demo-ddd-codegen/src/test/java/app/demo/codegen/DemoDddCodeGen.java
new file mode 100644
index 000000000..e73d9525d
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-codegen/src/test/java/app/demo/codegen/DemoDddCodeGen.java
@@ -0,0 +1,26 @@
+
+package app.demo.codegen;
+
+import io.nop.api.core.config.AppConfig;
+import io.nop.codegen.XCodeGenerator;
+import io.nop.commons.util.MavenDirHelper;
+import io.nop.core.CoreConfigs;
+import io.nop.core.CoreConstants;
+import io.nop.core.initialize.CoreInitialization;
+
+import java.io.File;
+
+// 辅助调试所生成的临时代码
+public class DemoDddCodeGen {
+ public static void main(String[] args) {
+ AppConfig.getConfigProvider().updateConfigValue(CoreConfigs.CFG_CORE_MAX_INITIALIZE_LEVEL, CoreConstants.INITIALIZER_PRIORITY_ANALYZE);
+
+ CoreInitialization.initialize();
+ try {
+ File projectDir = MavenDirHelper.projectDir(DemoDddCodeGen.class);
+ XCodeGenerator.runPostcompile(projectDir, "/", false);
+ } finally {
+ CoreInitialization.destroy();
+ }
+ }
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/pom.xml b/nop-demo/nop-ddd-demo/demo-ddd-dao/pom.xml
new file mode 100644
index 000000000..2d213c134
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/pom.xml
@@ -0,0 +1,31 @@
+
+
+
+
+ demo-ddd
+ app.demo
+ 1.0.0-SNAPSHOT
+
+
+ 4.0.0
+
+ demo-ddd-dao
+
+
+
+ io.github.entropy-cloud
+ nop-api-core
+
+
+ io.github.entropy-cloud
+ nop-orm
+
+
+ demo-ddd-codegen
+ app.demo
+ 1.0.0-SNAPSHOT
+ test
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/dao/DemoDddDaoConstants.java b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/dao/DemoDddDaoConstants.java
new file mode 100644
index 000000000..743e24cdc
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/dao/DemoDddDaoConstants.java
@@ -0,0 +1,5 @@
+package app.demo.dao;
+
+public interface DemoDddDaoConstants extends _DemoDddDaoConstants{
+
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/dao/_DemoDddDaoConstants.java b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/dao/_DemoDddDaoConstants.java
new file mode 100644
index 000000000..3257afba1
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/dao/_DemoDddDaoConstants.java
@@ -0,0 +1,46 @@
+package app.demo.dao;
+
+@SuppressWarnings({"PMD","java:S116"})
+public interface _DemoDddDaoConstants {
+
+ /**
+ * 路由状态: 未路由
+ */
+ String ROUTING_STATUS_NOT_ROUTED = "NOT_ROUTED";
+
+ /**
+ * 路由状态: 已路由
+ */
+ String ROUTING_STATUS_ROUTED = "ROUTED";
+
+ /**
+ * 路由状态: 错误路由
+ */
+ String ROUTING_STATUS_MISROUTED = "MISROUTED";
+
+ /**
+ * 运输状态: 未接收
+ */
+ String TRANSPORT_STATUS_NOT_RECEIVED = "NOT_RECEIVED";
+
+ /**
+ * 运输状态: 已到港
+ */
+ String TRANSPORT_STATUS_IN_PORT = "IN_PORT";
+
+ /**
+ * 运输状态: 已装货
+ */
+ String TRANSPORT_STATUS_ONBOARD_CARRIER = "ONBOARD_CARRIER";
+
+ /**
+ * 运输状态: 已认领
+ */
+ String TRANSPORT_STATUS_CLAIMED = "CLAIMED";
+
+ /**
+ * 运输状态: 未知
+ */
+ String TRANSPORT_STATUS_UNKNOWN = "UNKNOWN";
+
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/Cargo.java b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/Cargo.java
new file mode 100644
index 000000000..b78dd92fb
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/Cargo.java
@@ -0,0 +1,11 @@
+package app.demo.ddd.entity;
+
+import io.nop.api.core.annotations.biz.BizObjName;
+import app.demo.ddd.entity._gen._Cargo;
+
+
+@BizObjName("Cargo")
+public class Cargo extends _Cargo{
+
+
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/CarrierMovement.java b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/CarrierMovement.java
new file mode 100644
index 000000000..f657eeba0
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/CarrierMovement.java
@@ -0,0 +1,11 @@
+package app.demo.ddd.entity;
+
+import io.nop.api.core.annotations.biz.BizObjName;
+import app.demo.ddd.entity._gen._CarrierMovement;
+
+
+@BizObjName("CarrierMovement")
+public class CarrierMovement extends _CarrierMovement{
+
+
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/HandlingEvent.java b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/HandlingEvent.java
new file mode 100644
index 000000000..b5ffb56d3
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/HandlingEvent.java
@@ -0,0 +1,11 @@
+package app.demo.ddd.entity;
+
+import io.nop.api.core.annotations.biz.BizObjName;
+import app.demo.ddd.entity._gen._HandlingEvent;
+
+
+@BizObjName("HandlingEvent")
+public class HandlingEvent extends _HandlingEvent{
+
+
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/Leg.java b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/Leg.java
new file mode 100644
index 000000000..48a2ca10b
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/Leg.java
@@ -0,0 +1,11 @@
+package app.demo.ddd.entity;
+
+import io.nop.api.core.annotations.biz.BizObjName;
+import app.demo.ddd.entity._gen._Leg;
+
+
+@BizObjName("Leg")
+public class Leg extends _Leg{
+
+
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/Location.java b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/Location.java
new file mode 100644
index 000000000..0a16b8507
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/Location.java
@@ -0,0 +1,11 @@
+package app.demo.ddd.entity;
+
+import io.nop.api.core.annotations.biz.BizObjName;
+import app.demo.ddd.entity._gen._Location;
+
+
+@BizObjName("Location")
+public class Location extends _Location{
+
+
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/Voyage.java b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/Voyage.java
new file mode 100644
index 000000000..15b7eea7f
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/Voyage.java
@@ -0,0 +1,11 @@
+package app.demo.ddd.entity;
+
+import io.nop.api.core.annotations.biz.BizObjName;
+import app.demo.ddd.entity._gen._Voyage;
+
+
+@BizObjName("Voyage")
+public class Voyage extends _Voyage{
+
+
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_Cargo.java b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_Cargo.java
new file mode 100644
index 000000000..48399db3e
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_Cargo.java
@@ -0,0 +1,1229 @@
+package app.demo.ddd.entity._gen;
+
+import io.nop.orm.model.IEntityModel;
+import io.nop.orm.support.DynamicOrmEntity;
+import io.nop.orm.support.OrmEntitySet; //NOPMD - suppressed UnusedImports - Auto Gen Code
+import io.nop.orm.IOrmEntitySet; //NOPMD - suppressed UnusedImports - Auto Gen Code
+import io.nop.api.core.convert.ConvertHelper;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Arrays;
+import java.util.List;
+
+import app.demo.ddd.entity.Cargo;
+
+// tell cpd to start ignoring code - CPD-OFF
+/**
+ * 货物: cargo
+ */
+@SuppressWarnings({"PMD.UselessOverridingMethod","PMD.UnusedLocalVariable","java:S3008","java:S1602","java:S1128","java:S1161",
+ "PMD.UnnecessaryFullyQualifiedName","PMD.EmptyControlStatement","java:S116","java:S115","java:S101","java:S3776"})
+public class _Cargo extends DynamicOrmEntity{
+
+ /* Id: ID BIGINT */
+ public static final String PROP_NAME_id = "id";
+ public static final int PROP_ID_id = 1;
+
+ /* 计算时间: CALCULATED_AT DATETIME */
+ public static final String PROP_NAME_calculatedAt = "calculatedAt";
+ public static final int PROP_ID_calculatedAt = 2;
+
+ /* 预计到达时间: ETA DATETIME */
+ public static final String PROP_NAME_eta = "eta";
+ public static final int PROP_ID_eta = 3;
+
+ /* 目的地卸载时间: UNLOADED_AT_DEST BOOLEAN */
+ public static final String PROP_NAME_unloadedAtDest = "unloadedAtDest";
+ public static final int PROP_ID_unloadedAtDest = 4;
+
+ /* 路线错误: MISDIRECTED BOOLEAN */
+ public static final String PROP_NAME_misdirected = "misdirected";
+ public static final int PROP_ID_misdirected = 5;
+
+ /* 下一步预期处理事件类型: NEXT_EXPECTED_HANDLING_EVENT_TYPE VARCHAR */
+ public static final String PROP_NAME_nextExpectedHandlingEventType = "nextExpectedHandlingEventType";
+ public static final int PROP_ID_nextExpectedHandlingEventType = 6;
+
+ /* 路由状态: ROUTING_STATUS VARCHAR */
+ public static final String PROP_NAME_routingStatus = "routingStatus";
+ public static final int PROP_ID_routingStatus = 7;
+
+ /* 运输状态: TRANSPORT_STATUS VARCHAR */
+ public static final String PROP_NAME_transportStatus = "transportStatus";
+ public static final int PROP_ID_transportStatus = 8;
+
+ /* 指定到达期限: SPEC_ARRIVAL_DEADLINE DATETIME */
+ public static final String PROP_NAME_specArrivalDeadline = "specArrivalDeadline";
+ public static final int PROP_ID_specArrivalDeadline = 9;
+
+ /* 跟踪ID: TRACKING_ID VARCHAR */
+ public static final String PROP_NAME_trackingId = "trackingId";
+ public static final int PROP_ID_trackingId = 10;
+
+ /* 当前航程ID: CURRENT_VOYAGE_ID BIGINT */
+ public static final String PROP_NAME_currentVoyageId = "currentVoyageId";
+ public static final int PROP_ID_currentVoyageId = 11;
+
+ /* 最后事件ID: LAST_EVENT_ID BIGINT */
+ public static final String PROP_NAME_lastEventId = "lastEventId";
+ public static final int PROP_ID_lastEventId = 12;
+
+ /* 最后已知位置ID: LAST_KNOWN_LOCATION_ID BIGINT */
+ public static final String PROP_NAME_lastKnownLocationId = "lastKnownLocationId";
+ public static final int PROP_ID_lastKnownLocationId = 13;
+
+ /* 下一个预期位置ID: NEXT_EXPECTED_LOCATION_ID BIGINT */
+ public static final String PROP_NAME_nextExpectedLocationId = "nextExpectedLocationId";
+ public static final int PROP_ID_nextExpectedLocationId = 14;
+
+ /* 下一个预期航程ID: NEXT_EXPECTED_VOYAGE_ID BIGINT */
+ public static final String PROP_NAME_nextExpectedVoyageId = "nextExpectedVoyageId";
+ public static final int PROP_ID_nextExpectedVoyageId = 15;
+
+ /* 出发地ID: ORIGIN_ID BIGINT */
+ public static final String PROP_NAME_originId = "originId";
+ public static final int PROP_ID_originId = 16;
+
+ /* 指定目的地ID: SPEC_DESTINATION_ID BIGINT */
+ public static final String PROP_NAME_specDestinationId = "specDestinationId";
+ public static final int PROP_ID_specDestinationId = 17;
+
+ /* 指定出发地ID: SPEC_ORIGIN_ID BIGINT */
+ public static final String PROP_NAME_specOriginId = "specOriginId";
+ public static final int PROP_ID_specOriginId = 18;
+
+
+ private static int _PROP_ID_BOUND = 19;
+
+
+ /* relation: 下一个预期航程 */
+ public static final String PROP_NAME_nextExpectedVoyage = "nextExpectedVoyage";
+
+ /* relation: 指定目的地 */
+ public static final String PROP_NAME_specDestination = "specDestination";
+
+ /* relation: 出发地 */
+ public static final String PROP_NAME_origin = "origin";
+
+ /* relation: 最后事件 */
+ public static final String PROP_NAME_lastEvent = "lastEvent";
+
+ /* relation: 最后已知位置 */
+ public static final String PROP_NAME_lastKnownLocation = "lastKnownLocation";
+
+ /* relation: 当前航程 */
+ public static final String PROP_NAME_currentVoyage = "currentVoyage";
+
+ /* relation: 下一个预期位置 */
+ public static final String PROP_NAME_nextExpectedLocation = "nextExpectedLocation";
+
+ /* relation: 指定出发地 */
+ public static final String PROP_NAME_specOrigin = "specOrigin";
+
+
+ protected static final List PK_PROP_NAMES = Arrays.asList(PROP_NAME_id);
+ protected static final int[] PK_PROP_IDS = new int[]{PROP_ID_id};
+
+ private static final String[] PROP_ID_TO_NAME = new String[19];
+ private static final Map PROP_NAME_TO_ID = new HashMap<>();
+ static{
+
+ PROP_ID_TO_NAME[PROP_ID_id] = PROP_NAME_id;
+ PROP_NAME_TO_ID.put(PROP_NAME_id, PROP_ID_id);
+
+ PROP_ID_TO_NAME[PROP_ID_calculatedAt] = PROP_NAME_calculatedAt;
+ PROP_NAME_TO_ID.put(PROP_NAME_calculatedAt, PROP_ID_calculatedAt);
+
+ PROP_ID_TO_NAME[PROP_ID_eta] = PROP_NAME_eta;
+ PROP_NAME_TO_ID.put(PROP_NAME_eta, PROP_ID_eta);
+
+ PROP_ID_TO_NAME[PROP_ID_unloadedAtDest] = PROP_NAME_unloadedAtDest;
+ PROP_NAME_TO_ID.put(PROP_NAME_unloadedAtDest, PROP_ID_unloadedAtDest);
+
+ PROP_ID_TO_NAME[PROP_ID_misdirected] = PROP_NAME_misdirected;
+ PROP_NAME_TO_ID.put(PROP_NAME_misdirected, PROP_ID_misdirected);
+
+ PROP_ID_TO_NAME[PROP_ID_nextExpectedHandlingEventType] = PROP_NAME_nextExpectedHandlingEventType;
+ PROP_NAME_TO_ID.put(PROP_NAME_nextExpectedHandlingEventType, PROP_ID_nextExpectedHandlingEventType);
+
+ PROP_ID_TO_NAME[PROP_ID_routingStatus] = PROP_NAME_routingStatus;
+ PROP_NAME_TO_ID.put(PROP_NAME_routingStatus, PROP_ID_routingStatus);
+
+ PROP_ID_TO_NAME[PROP_ID_transportStatus] = PROP_NAME_transportStatus;
+ PROP_NAME_TO_ID.put(PROP_NAME_transportStatus, PROP_ID_transportStatus);
+
+ PROP_ID_TO_NAME[PROP_ID_specArrivalDeadline] = PROP_NAME_specArrivalDeadline;
+ PROP_NAME_TO_ID.put(PROP_NAME_specArrivalDeadline, PROP_ID_specArrivalDeadline);
+
+ PROP_ID_TO_NAME[PROP_ID_trackingId] = PROP_NAME_trackingId;
+ PROP_NAME_TO_ID.put(PROP_NAME_trackingId, PROP_ID_trackingId);
+
+ PROP_ID_TO_NAME[PROP_ID_currentVoyageId] = PROP_NAME_currentVoyageId;
+ PROP_NAME_TO_ID.put(PROP_NAME_currentVoyageId, PROP_ID_currentVoyageId);
+
+ PROP_ID_TO_NAME[PROP_ID_lastEventId] = PROP_NAME_lastEventId;
+ PROP_NAME_TO_ID.put(PROP_NAME_lastEventId, PROP_ID_lastEventId);
+
+ PROP_ID_TO_NAME[PROP_ID_lastKnownLocationId] = PROP_NAME_lastKnownLocationId;
+ PROP_NAME_TO_ID.put(PROP_NAME_lastKnownLocationId, PROP_ID_lastKnownLocationId);
+
+ PROP_ID_TO_NAME[PROP_ID_nextExpectedLocationId] = PROP_NAME_nextExpectedLocationId;
+ PROP_NAME_TO_ID.put(PROP_NAME_nextExpectedLocationId, PROP_ID_nextExpectedLocationId);
+
+ PROP_ID_TO_NAME[PROP_ID_nextExpectedVoyageId] = PROP_NAME_nextExpectedVoyageId;
+ PROP_NAME_TO_ID.put(PROP_NAME_nextExpectedVoyageId, PROP_ID_nextExpectedVoyageId);
+
+ PROP_ID_TO_NAME[PROP_ID_originId] = PROP_NAME_originId;
+ PROP_NAME_TO_ID.put(PROP_NAME_originId, PROP_ID_originId);
+
+ PROP_ID_TO_NAME[PROP_ID_specDestinationId] = PROP_NAME_specDestinationId;
+ PROP_NAME_TO_ID.put(PROP_NAME_specDestinationId, PROP_ID_specDestinationId);
+
+ PROP_ID_TO_NAME[PROP_ID_specOriginId] = PROP_NAME_specOriginId;
+ PROP_NAME_TO_ID.put(PROP_NAME_specOriginId, PROP_ID_specOriginId);
+
+ }
+
+
+ /* Id: ID */
+ private java.lang.Long _id;
+
+ /* 计算时间: CALCULATED_AT */
+ private java.time.LocalDateTime _calculatedAt;
+
+ /* 预计到达时间: ETA */
+ private java.time.LocalDateTime _eta;
+
+ /* 目的地卸载时间: UNLOADED_AT_DEST */
+ private java.lang.Boolean _unloadedAtDest;
+
+ /* 路线错误: MISDIRECTED */
+ private java.lang.Boolean _misdirected;
+
+ /* 下一步预期处理事件类型: NEXT_EXPECTED_HANDLING_EVENT_TYPE */
+ private java.lang.String _nextExpectedHandlingEventType;
+
+ /* 路由状态: ROUTING_STATUS */
+ private java.lang.String _routingStatus;
+
+ /* 运输状态: TRANSPORT_STATUS */
+ private java.lang.String _transportStatus;
+
+ /* 指定到达期限: SPEC_ARRIVAL_DEADLINE */
+ private java.time.LocalDateTime _specArrivalDeadline;
+
+ /* 跟踪ID: TRACKING_ID */
+ private java.lang.String _trackingId;
+
+ /* 当前航程ID: CURRENT_VOYAGE_ID */
+ private java.lang.Long _currentVoyageId;
+
+ /* 最后事件ID: LAST_EVENT_ID */
+ private java.lang.Long _lastEventId;
+
+ /* 最后已知位置ID: LAST_KNOWN_LOCATION_ID */
+ private java.lang.Long _lastKnownLocationId;
+
+ /* 下一个预期位置ID: NEXT_EXPECTED_LOCATION_ID */
+ private java.lang.Long _nextExpectedLocationId;
+
+ /* 下一个预期航程ID: NEXT_EXPECTED_VOYAGE_ID */
+ private java.lang.Long _nextExpectedVoyageId;
+
+ /* 出发地ID: ORIGIN_ID */
+ private java.lang.Long _originId;
+
+ /* 指定目的地ID: SPEC_DESTINATION_ID */
+ private java.lang.Long _specDestinationId;
+
+ /* 指定出发地ID: SPEC_ORIGIN_ID */
+ private java.lang.Long _specOriginId;
+
+
+ public _Cargo(){
+ // for debug
+ }
+
+ protected Cargo newInstance(){
+ Cargo entity = new Cargo();
+ entity.orm_attach(orm_enhancer());
+ entity.orm_entityModel(orm_entityModel());
+ return entity;
+ }
+
+ @Override
+ public Cargo cloneInstance() {
+ Cargo entity = newInstance();
+ orm_forEachInitedProp((value, propId) -> {
+ entity.orm_propValue(propId,value);
+ });
+ return entity;
+ }
+
+ @Override
+ public String orm_entityName() {
+ // 如果存在实体模型对象,则以模型对象上的设置为准
+ IEntityModel entityModel = orm_entityModel();
+ if(entityModel != null)
+ return entityModel.getName();
+ return "app.demo.ddd.entity.Cargo";
+ }
+
+ @Override
+ public int orm_propIdBound(){
+ IEntityModel entityModel = orm_entityModel();
+ if(entityModel != null)
+ return entityModel.getPropIdBound();
+ return _PROP_ID_BOUND;
+ }
+
+ @Override
+ public Object orm_id() {
+
+ return buildSimpleId(PROP_ID_id);
+
+ }
+
+ @Override
+ public boolean orm_isPrimary(int propId) {
+
+ return propId == PROP_ID_id;
+
+ }
+
+ @Override
+ public String orm_propName(int propId) {
+ if(propId >= PROP_ID_TO_NAME.length)
+ return super.orm_propName(propId);
+ String propName = PROP_ID_TO_NAME[propId];
+ if(propName == null)
+ return super.orm_propName(propId);
+ return propName;
+ }
+
+ @Override
+ public int orm_propId(String propName) {
+ Integer propId = PROP_NAME_TO_ID.get(propName);
+ if(propId == null)
+ return super.orm_propId(propName);
+ return propId;
+ }
+
+ @Override
+ public Object orm_propValue(int propId) {
+ switch(propId){
+
+ case PROP_ID_id:
+ return getId();
+
+ case PROP_ID_calculatedAt:
+ return getCalculatedAt();
+
+ case PROP_ID_eta:
+ return getEta();
+
+ case PROP_ID_unloadedAtDest:
+ return getUnloadedAtDest();
+
+ case PROP_ID_misdirected:
+ return getMisdirected();
+
+ case PROP_ID_nextExpectedHandlingEventType:
+ return getNextExpectedHandlingEventType();
+
+ case PROP_ID_routingStatus:
+ return getRoutingStatus();
+
+ case PROP_ID_transportStatus:
+ return getTransportStatus();
+
+ case PROP_ID_specArrivalDeadline:
+ return getSpecArrivalDeadline();
+
+ case PROP_ID_trackingId:
+ return getTrackingId();
+
+ case PROP_ID_currentVoyageId:
+ return getCurrentVoyageId();
+
+ case PROP_ID_lastEventId:
+ return getLastEventId();
+
+ case PROP_ID_lastKnownLocationId:
+ return getLastKnownLocationId();
+
+ case PROP_ID_nextExpectedLocationId:
+ return getNextExpectedLocationId();
+
+ case PROP_ID_nextExpectedVoyageId:
+ return getNextExpectedVoyageId();
+
+ case PROP_ID_originId:
+ return getOriginId();
+
+ case PROP_ID_specDestinationId:
+ return getSpecDestinationId();
+
+ case PROP_ID_specOriginId:
+ return getSpecOriginId();
+
+ default:
+ return super.orm_propValue(propId);
+ }
+ }
+
+
+
+ @Override
+ public void orm_propValue(int propId, Object value){
+ switch(propId){
+
+ case PROP_ID_id:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_id));
+ }
+ setId(typedValue);
+ break;
+ }
+
+ case PROP_ID_calculatedAt:{
+ java.time.LocalDateTime typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLocalDateTime(value,
+ err-> newTypeConversionError(PROP_NAME_calculatedAt));
+ }
+ setCalculatedAt(typedValue);
+ break;
+ }
+
+ case PROP_ID_eta:{
+ java.time.LocalDateTime typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLocalDateTime(value,
+ err-> newTypeConversionError(PROP_NAME_eta));
+ }
+ setEta(typedValue);
+ break;
+ }
+
+ case PROP_ID_unloadedAtDest:{
+ java.lang.Boolean typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toBoolean(value,
+ err-> newTypeConversionError(PROP_NAME_unloadedAtDest));
+ }
+ setUnloadedAtDest(typedValue);
+ break;
+ }
+
+ case PROP_ID_misdirected:{
+ java.lang.Boolean typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toBoolean(value,
+ err-> newTypeConversionError(PROP_NAME_misdirected));
+ }
+ setMisdirected(typedValue);
+ break;
+ }
+
+ case PROP_ID_nextExpectedHandlingEventType:{
+ java.lang.String typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toString(value,
+ err-> newTypeConversionError(PROP_NAME_nextExpectedHandlingEventType));
+ }
+ setNextExpectedHandlingEventType(typedValue);
+ break;
+ }
+
+ case PROP_ID_routingStatus:{
+ java.lang.String typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toString(value,
+ err-> newTypeConversionError(PROP_NAME_routingStatus));
+ }
+ setRoutingStatus(typedValue);
+ break;
+ }
+
+ case PROP_ID_transportStatus:{
+ java.lang.String typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toString(value,
+ err-> newTypeConversionError(PROP_NAME_transportStatus));
+ }
+ setTransportStatus(typedValue);
+ break;
+ }
+
+ case PROP_ID_specArrivalDeadline:{
+ java.time.LocalDateTime typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLocalDateTime(value,
+ err-> newTypeConversionError(PROP_NAME_specArrivalDeadline));
+ }
+ setSpecArrivalDeadline(typedValue);
+ break;
+ }
+
+ case PROP_ID_trackingId:{
+ java.lang.String typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toString(value,
+ err-> newTypeConversionError(PROP_NAME_trackingId));
+ }
+ setTrackingId(typedValue);
+ break;
+ }
+
+ case PROP_ID_currentVoyageId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_currentVoyageId));
+ }
+ setCurrentVoyageId(typedValue);
+ break;
+ }
+
+ case PROP_ID_lastEventId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_lastEventId));
+ }
+ setLastEventId(typedValue);
+ break;
+ }
+
+ case PROP_ID_lastKnownLocationId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_lastKnownLocationId));
+ }
+ setLastKnownLocationId(typedValue);
+ break;
+ }
+
+ case PROP_ID_nextExpectedLocationId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_nextExpectedLocationId));
+ }
+ setNextExpectedLocationId(typedValue);
+ break;
+ }
+
+ case PROP_ID_nextExpectedVoyageId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_nextExpectedVoyageId));
+ }
+ setNextExpectedVoyageId(typedValue);
+ break;
+ }
+
+ case PROP_ID_originId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_originId));
+ }
+ setOriginId(typedValue);
+ break;
+ }
+
+ case PROP_ID_specDestinationId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_specDestinationId));
+ }
+ setSpecDestinationId(typedValue);
+ break;
+ }
+
+ case PROP_ID_specOriginId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_specOriginId));
+ }
+ setSpecOriginId(typedValue);
+ break;
+ }
+
+ default:
+ super.orm_propValue(propId,value);
+ }
+ }
+
+ @Override
+ public void orm_internalSet(int propId, Object value) {
+ switch(propId){
+
+ case PROP_ID_id:{
+ onInitProp(propId);
+ this._id = (java.lang.Long)value;
+ orm_id(); // 如果是设置主键字段,则触发watcher
+ break;
+ }
+
+ case PROP_ID_calculatedAt:{
+ onInitProp(propId);
+ this._calculatedAt = (java.time.LocalDateTime)value;
+
+ break;
+ }
+
+ case PROP_ID_eta:{
+ onInitProp(propId);
+ this._eta = (java.time.LocalDateTime)value;
+
+ break;
+ }
+
+ case PROP_ID_unloadedAtDest:{
+ onInitProp(propId);
+ this._unloadedAtDest = (java.lang.Boolean)value;
+
+ break;
+ }
+
+ case PROP_ID_misdirected:{
+ onInitProp(propId);
+ this._misdirected = (java.lang.Boolean)value;
+
+ break;
+ }
+
+ case PROP_ID_nextExpectedHandlingEventType:{
+ onInitProp(propId);
+ this._nextExpectedHandlingEventType = (java.lang.String)value;
+
+ break;
+ }
+
+ case PROP_ID_routingStatus:{
+ onInitProp(propId);
+ this._routingStatus = (java.lang.String)value;
+
+ break;
+ }
+
+ case PROP_ID_transportStatus:{
+ onInitProp(propId);
+ this._transportStatus = (java.lang.String)value;
+
+ break;
+ }
+
+ case PROP_ID_specArrivalDeadline:{
+ onInitProp(propId);
+ this._specArrivalDeadline = (java.time.LocalDateTime)value;
+
+ break;
+ }
+
+ case PROP_ID_trackingId:{
+ onInitProp(propId);
+ this._trackingId = (java.lang.String)value;
+
+ break;
+ }
+
+ case PROP_ID_currentVoyageId:{
+ onInitProp(propId);
+ this._currentVoyageId = (java.lang.Long)value;
+
+ break;
+ }
+
+ case PROP_ID_lastEventId:{
+ onInitProp(propId);
+ this._lastEventId = (java.lang.Long)value;
+
+ break;
+ }
+
+ case PROP_ID_lastKnownLocationId:{
+ onInitProp(propId);
+ this._lastKnownLocationId = (java.lang.Long)value;
+
+ break;
+ }
+
+ case PROP_ID_nextExpectedLocationId:{
+ onInitProp(propId);
+ this._nextExpectedLocationId = (java.lang.Long)value;
+
+ break;
+ }
+
+ case PROP_ID_nextExpectedVoyageId:{
+ onInitProp(propId);
+ this._nextExpectedVoyageId = (java.lang.Long)value;
+
+ break;
+ }
+
+ case PROP_ID_originId:{
+ onInitProp(propId);
+ this._originId = (java.lang.Long)value;
+
+ break;
+ }
+
+ case PROP_ID_specDestinationId:{
+ onInitProp(propId);
+ this._specDestinationId = (java.lang.Long)value;
+
+ break;
+ }
+
+ case PROP_ID_specOriginId:{
+ onInitProp(propId);
+ this._specOriginId = (java.lang.Long)value;
+
+ break;
+ }
+
+ default:
+ super.orm_internalSet(propId,value);
+ }
+ }
+
+
+ /**
+ * Id: ID
+ */
+ public java.lang.Long getId(){
+ onPropGet(PROP_ID_id);
+ return _id;
+ }
+
+ /**
+ * Id: ID
+ */
+ public void setId(java.lang.Long value){
+ if(onPropSet(PROP_ID_id,value)){
+ this._id = value;
+ internalClearRefs(PROP_ID_id);
+ orm_id();
+ }
+ }
+
+ /**
+ * 计算时间: CALCULATED_AT
+ */
+ public java.time.LocalDateTime getCalculatedAt(){
+ onPropGet(PROP_ID_calculatedAt);
+ return _calculatedAt;
+ }
+
+ /**
+ * 计算时间: CALCULATED_AT
+ */
+ public void setCalculatedAt(java.time.LocalDateTime value){
+ if(onPropSet(PROP_ID_calculatedAt,value)){
+ this._calculatedAt = value;
+ internalClearRefs(PROP_ID_calculatedAt);
+
+ }
+ }
+
+ /**
+ * 预计到达时间: ETA
+ */
+ public java.time.LocalDateTime getEta(){
+ onPropGet(PROP_ID_eta);
+ return _eta;
+ }
+
+ /**
+ * 预计到达时间: ETA
+ */
+ public void setEta(java.time.LocalDateTime value){
+ if(onPropSet(PROP_ID_eta,value)){
+ this._eta = value;
+ internalClearRefs(PROP_ID_eta);
+
+ }
+ }
+
+ /**
+ * 目的地卸载时间: UNLOADED_AT_DEST
+ */
+ public java.lang.Boolean getUnloadedAtDest(){
+ onPropGet(PROP_ID_unloadedAtDest);
+ return _unloadedAtDest;
+ }
+
+ /**
+ * 目的地卸载时间: UNLOADED_AT_DEST
+ */
+ public void setUnloadedAtDest(java.lang.Boolean value){
+ if(onPropSet(PROP_ID_unloadedAtDest,value)){
+ this._unloadedAtDest = value;
+ internalClearRefs(PROP_ID_unloadedAtDest);
+
+ }
+ }
+
+ /**
+ * 路线错误: MISDIRECTED
+ */
+ public java.lang.Boolean getMisdirected(){
+ onPropGet(PROP_ID_misdirected);
+ return _misdirected;
+ }
+
+ /**
+ * 路线错误: MISDIRECTED
+ */
+ public void setMisdirected(java.lang.Boolean value){
+ if(onPropSet(PROP_ID_misdirected,value)){
+ this._misdirected = value;
+ internalClearRefs(PROP_ID_misdirected);
+
+ }
+ }
+
+ /**
+ * 下一步预期处理事件类型: NEXT_EXPECTED_HANDLING_EVENT_TYPE
+ */
+ public java.lang.String getNextExpectedHandlingEventType(){
+ onPropGet(PROP_ID_nextExpectedHandlingEventType);
+ return _nextExpectedHandlingEventType;
+ }
+
+ /**
+ * 下一步预期处理事件类型: NEXT_EXPECTED_HANDLING_EVENT_TYPE
+ */
+ public void setNextExpectedHandlingEventType(java.lang.String value){
+ if(onPropSet(PROP_ID_nextExpectedHandlingEventType,value)){
+ this._nextExpectedHandlingEventType = value;
+ internalClearRefs(PROP_ID_nextExpectedHandlingEventType);
+
+ }
+ }
+
+ /**
+ * 路由状态: ROUTING_STATUS
+ */
+ public java.lang.String getRoutingStatus(){
+ onPropGet(PROP_ID_routingStatus);
+ return _routingStatus;
+ }
+
+ /**
+ * 路由状态: ROUTING_STATUS
+ */
+ public void setRoutingStatus(java.lang.String value){
+ if(onPropSet(PROP_ID_routingStatus,value)){
+ this._routingStatus = value;
+ internalClearRefs(PROP_ID_routingStatus);
+
+ }
+ }
+
+ /**
+ * 运输状态: TRANSPORT_STATUS
+ */
+ public java.lang.String getTransportStatus(){
+ onPropGet(PROP_ID_transportStatus);
+ return _transportStatus;
+ }
+
+ /**
+ * 运输状态: TRANSPORT_STATUS
+ */
+ public void setTransportStatus(java.lang.String value){
+ if(onPropSet(PROP_ID_transportStatus,value)){
+ this._transportStatus = value;
+ internalClearRefs(PROP_ID_transportStatus);
+
+ }
+ }
+
+ /**
+ * 指定到达期限: SPEC_ARRIVAL_DEADLINE
+ */
+ public java.time.LocalDateTime getSpecArrivalDeadline(){
+ onPropGet(PROP_ID_specArrivalDeadline);
+ return _specArrivalDeadline;
+ }
+
+ /**
+ * 指定到达期限: SPEC_ARRIVAL_DEADLINE
+ */
+ public void setSpecArrivalDeadline(java.time.LocalDateTime value){
+ if(onPropSet(PROP_ID_specArrivalDeadline,value)){
+ this._specArrivalDeadline = value;
+ internalClearRefs(PROP_ID_specArrivalDeadline);
+
+ }
+ }
+
+ /**
+ * 跟踪ID: TRACKING_ID
+ */
+ public java.lang.String getTrackingId(){
+ onPropGet(PROP_ID_trackingId);
+ return _trackingId;
+ }
+
+ /**
+ * 跟踪ID: TRACKING_ID
+ */
+ public void setTrackingId(java.lang.String value){
+ if(onPropSet(PROP_ID_trackingId,value)){
+ this._trackingId = value;
+ internalClearRefs(PROP_ID_trackingId);
+
+ }
+ }
+
+ /**
+ * 当前航程ID: CURRENT_VOYAGE_ID
+ */
+ public java.lang.Long getCurrentVoyageId(){
+ onPropGet(PROP_ID_currentVoyageId);
+ return _currentVoyageId;
+ }
+
+ /**
+ * 当前航程ID: CURRENT_VOYAGE_ID
+ */
+ public void setCurrentVoyageId(java.lang.Long value){
+ if(onPropSet(PROP_ID_currentVoyageId,value)){
+ this._currentVoyageId = value;
+ internalClearRefs(PROP_ID_currentVoyageId);
+
+ }
+ }
+
+ /**
+ * 最后事件ID: LAST_EVENT_ID
+ */
+ public java.lang.Long getLastEventId(){
+ onPropGet(PROP_ID_lastEventId);
+ return _lastEventId;
+ }
+
+ /**
+ * 最后事件ID: LAST_EVENT_ID
+ */
+ public void setLastEventId(java.lang.Long value){
+ if(onPropSet(PROP_ID_lastEventId,value)){
+ this._lastEventId = value;
+ internalClearRefs(PROP_ID_lastEventId);
+
+ }
+ }
+
+ /**
+ * 最后已知位置ID: LAST_KNOWN_LOCATION_ID
+ */
+ public java.lang.Long getLastKnownLocationId(){
+ onPropGet(PROP_ID_lastKnownLocationId);
+ return _lastKnownLocationId;
+ }
+
+ /**
+ * 最后已知位置ID: LAST_KNOWN_LOCATION_ID
+ */
+ public void setLastKnownLocationId(java.lang.Long value){
+ if(onPropSet(PROP_ID_lastKnownLocationId,value)){
+ this._lastKnownLocationId = value;
+ internalClearRefs(PROP_ID_lastKnownLocationId);
+
+ }
+ }
+
+ /**
+ * 下一个预期位置ID: NEXT_EXPECTED_LOCATION_ID
+ */
+ public java.lang.Long getNextExpectedLocationId(){
+ onPropGet(PROP_ID_nextExpectedLocationId);
+ return _nextExpectedLocationId;
+ }
+
+ /**
+ * 下一个预期位置ID: NEXT_EXPECTED_LOCATION_ID
+ */
+ public void setNextExpectedLocationId(java.lang.Long value){
+ if(onPropSet(PROP_ID_nextExpectedLocationId,value)){
+ this._nextExpectedLocationId = value;
+ internalClearRefs(PROP_ID_nextExpectedLocationId);
+
+ }
+ }
+
+ /**
+ * 下一个预期航程ID: NEXT_EXPECTED_VOYAGE_ID
+ */
+ public java.lang.Long getNextExpectedVoyageId(){
+ onPropGet(PROP_ID_nextExpectedVoyageId);
+ return _nextExpectedVoyageId;
+ }
+
+ /**
+ * 下一个预期航程ID: NEXT_EXPECTED_VOYAGE_ID
+ */
+ public void setNextExpectedVoyageId(java.lang.Long value){
+ if(onPropSet(PROP_ID_nextExpectedVoyageId,value)){
+ this._nextExpectedVoyageId = value;
+ internalClearRefs(PROP_ID_nextExpectedVoyageId);
+
+ }
+ }
+
+ /**
+ * 出发地ID: ORIGIN_ID
+ */
+ public java.lang.Long getOriginId(){
+ onPropGet(PROP_ID_originId);
+ return _originId;
+ }
+
+ /**
+ * 出发地ID: ORIGIN_ID
+ */
+ public void setOriginId(java.lang.Long value){
+ if(onPropSet(PROP_ID_originId,value)){
+ this._originId = value;
+ internalClearRefs(PROP_ID_originId);
+
+ }
+ }
+
+ /**
+ * 指定目的地ID: SPEC_DESTINATION_ID
+ */
+ public java.lang.Long getSpecDestinationId(){
+ onPropGet(PROP_ID_specDestinationId);
+ return _specDestinationId;
+ }
+
+ /**
+ * 指定目的地ID: SPEC_DESTINATION_ID
+ */
+ public void setSpecDestinationId(java.lang.Long value){
+ if(onPropSet(PROP_ID_specDestinationId,value)){
+ this._specDestinationId = value;
+ internalClearRefs(PROP_ID_specDestinationId);
+
+ }
+ }
+
+ /**
+ * 指定出发地ID: SPEC_ORIGIN_ID
+ */
+ public java.lang.Long getSpecOriginId(){
+ onPropGet(PROP_ID_specOriginId);
+ return _specOriginId;
+ }
+
+ /**
+ * 指定出发地ID: SPEC_ORIGIN_ID
+ */
+ public void setSpecOriginId(java.lang.Long value){
+ if(onPropSet(PROP_ID_specOriginId,value)){
+ this._specOriginId = value;
+ internalClearRefs(PROP_ID_specOriginId);
+
+ }
+ }
+
+ /**
+ * 下一个预期航程
+ */
+ public app.demo.ddd.entity.Voyage getNextExpectedVoyage(){
+ return (app.demo.ddd.entity.Voyage)internalGetRefEntity(PROP_NAME_nextExpectedVoyage);
+ }
+
+ public void setNextExpectedVoyage(app.demo.ddd.entity.Voyage refEntity){
+
+ if(refEntity == null){
+
+ this.setNextExpectedVoyageId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_nextExpectedVoyage, refEntity,()->{
+
+ this.setNextExpectedVoyageId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+ /**
+ * 指定目的地
+ */
+ public app.demo.ddd.entity.Location getSpecDestination(){
+ return (app.demo.ddd.entity.Location)internalGetRefEntity(PROP_NAME_specDestination);
+ }
+
+ public void setSpecDestination(app.demo.ddd.entity.Location refEntity){
+
+ if(refEntity == null){
+
+ this.setSpecDestinationId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_specDestination, refEntity,()->{
+
+ this.setSpecDestinationId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+ /**
+ * 出发地
+ */
+ public app.demo.ddd.entity.Location getOrigin(){
+ return (app.demo.ddd.entity.Location)internalGetRefEntity(PROP_NAME_origin);
+ }
+
+ public void setOrigin(app.demo.ddd.entity.Location refEntity){
+
+ if(refEntity == null){
+
+ this.setOriginId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_origin, refEntity,()->{
+
+ this.setOriginId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+ /**
+ * 最后事件
+ */
+ public app.demo.ddd.entity.HandlingEvent getLastEvent(){
+ return (app.demo.ddd.entity.HandlingEvent)internalGetRefEntity(PROP_NAME_lastEvent);
+ }
+
+ public void setLastEvent(app.demo.ddd.entity.HandlingEvent refEntity){
+
+ if(refEntity == null){
+
+ this.setLastEventId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_lastEvent, refEntity,()->{
+
+ this.setLastEventId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+ /**
+ * 最后已知位置
+ */
+ public app.demo.ddd.entity.Location getLastKnownLocation(){
+ return (app.demo.ddd.entity.Location)internalGetRefEntity(PROP_NAME_lastKnownLocation);
+ }
+
+ public void setLastKnownLocation(app.demo.ddd.entity.Location refEntity){
+
+ if(refEntity == null){
+
+ this.setLastKnownLocationId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_lastKnownLocation, refEntity,()->{
+
+ this.setLastKnownLocationId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+ /**
+ * 当前航程
+ */
+ public app.demo.ddd.entity.Voyage getCurrentVoyage(){
+ return (app.demo.ddd.entity.Voyage)internalGetRefEntity(PROP_NAME_currentVoyage);
+ }
+
+ public void setCurrentVoyage(app.demo.ddd.entity.Voyage refEntity){
+
+ if(refEntity == null){
+
+ this.setCurrentVoyageId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_currentVoyage, refEntity,()->{
+
+ this.setCurrentVoyageId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+ /**
+ * 下一个预期位置
+ */
+ public app.demo.ddd.entity.Location getNextExpectedLocation(){
+ return (app.demo.ddd.entity.Location)internalGetRefEntity(PROP_NAME_nextExpectedLocation);
+ }
+
+ public void setNextExpectedLocation(app.demo.ddd.entity.Location refEntity){
+
+ if(refEntity == null){
+
+ this.setNextExpectedLocationId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_nextExpectedLocation, refEntity,()->{
+
+ this.setNextExpectedLocationId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+ /**
+ * 指定出发地
+ */
+ public app.demo.ddd.entity.Location getSpecOrigin(){
+ return (app.demo.ddd.entity.Location)internalGetRefEntity(PROP_NAME_specOrigin);
+ }
+
+ public void setSpecOrigin(app.demo.ddd.entity.Location refEntity){
+
+ if(refEntity == null){
+
+ this.setSpecOriginId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_specOrigin, refEntity,()->{
+
+ this.setSpecOriginId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+}
+// resume CPD analysis - CPD-ON
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_CarrierMovement.java b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_CarrierMovement.java
new file mode 100644
index 000000000..916140292
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_CarrierMovement.java
@@ -0,0 +1,511 @@
+package app.demo.ddd.entity._gen;
+
+import io.nop.orm.model.IEntityModel;
+import io.nop.orm.support.DynamicOrmEntity;
+import io.nop.orm.support.OrmEntitySet; //NOPMD - suppressed UnusedImports - Auto Gen Code
+import io.nop.orm.IOrmEntitySet; //NOPMD - suppressed UnusedImports - Auto Gen Code
+import io.nop.api.core.convert.ConvertHelper;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Arrays;
+import java.util.List;
+
+import app.demo.ddd.entity.CarrierMovement;
+
+// tell cpd to start ignoring code - CPD-OFF
+/**
+ * 运输动作: carrier_movement
+ */
+@SuppressWarnings({"PMD.UselessOverridingMethod","PMD.UnusedLocalVariable","java:S3008","java:S1602","java:S1128","java:S1161",
+ "PMD.UnnecessaryFullyQualifiedName","PMD.EmptyControlStatement","java:S116","java:S115","java:S101","java:S3776"})
+public class _CarrierMovement extends DynamicOrmEntity{
+
+ /* Id: ID BIGINT */
+ public static final String PROP_NAME_id = "id";
+ public static final int PROP_ID_id = 1;
+
+ /* 到达时间: ARRIVAL_TIME DATETIME */
+ public static final String PROP_NAME_arrivalTime = "arrivalTime";
+ public static final int PROP_ID_arrivalTime = 2;
+
+ /* 出发时间: DEPARTURE_TIME DATETIME */
+ public static final String PROP_NAME_departureTime = "departureTime";
+ public static final int PROP_ID_departureTime = 3;
+
+ /* 到达地点ID: ARRIVAL_LOCATION_ID BIGINT */
+ public static final String PROP_NAME_arrivalLocationId = "arrivalLocationId";
+ public static final int PROP_ID_arrivalLocationId = 4;
+
+ /* 出发地点ID: DEPARTURE_LOCATION_ID BIGINT */
+ public static final String PROP_NAME_departureLocationId = "departureLocationId";
+ public static final int PROP_ID_departureLocationId = 5;
+
+ /* 航程ID: VOYAGE_ID BIGINT */
+ public static final String PROP_NAME_voyageId = "voyageId";
+ public static final int PROP_ID_voyageId = 6;
+
+
+ private static int _PROP_ID_BOUND = 7;
+
+
+ /* relation: 航程 */
+ public static final String PROP_NAME_voyage = "voyage";
+
+ /* relation: 出发地点 */
+ public static final String PROP_NAME_departureLocation = "departureLocation";
+
+ /* relation: 到达地点 */
+ public static final String PROP_NAME_arrivalLocation = "arrivalLocation";
+
+
+ protected static final List PK_PROP_NAMES = Arrays.asList(PROP_NAME_id);
+ protected static final int[] PK_PROP_IDS = new int[]{PROP_ID_id};
+
+ private static final String[] PROP_ID_TO_NAME = new String[7];
+ private static final Map PROP_NAME_TO_ID = new HashMap<>();
+ static{
+
+ PROP_ID_TO_NAME[PROP_ID_id] = PROP_NAME_id;
+ PROP_NAME_TO_ID.put(PROP_NAME_id, PROP_ID_id);
+
+ PROP_ID_TO_NAME[PROP_ID_arrivalTime] = PROP_NAME_arrivalTime;
+ PROP_NAME_TO_ID.put(PROP_NAME_arrivalTime, PROP_ID_arrivalTime);
+
+ PROP_ID_TO_NAME[PROP_ID_departureTime] = PROP_NAME_departureTime;
+ PROP_NAME_TO_ID.put(PROP_NAME_departureTime, PROP_ID_departureTime);
+
+ PROP_ID_TO_NAME[PROP_ID_arrivalLocationId] = PROP_NAME_arrivalLocationId;
+ PROP_NAME_TO_ID.put(PROP_NAME_arrivalLocationId, PROP_ID_arrivalLocationId);
+
+ PROP_ID_TO_NAME[PROP_ID_departureLocationId] = PROP_NAME_departureLocationId;
+ PROP_NAME_TO_ID.put(PROP_NAME_departureLocationId, PROP_ID_departureLocationId);
+
+ PROP_ID_TO_NAME[PROP_ID_voyageId] = PROP_NAME_voyageId;
+ PROP_NAME_TO_ID.put(PROP_NAME_voyageId, PROP_ID_voyageId);
+
+ }
+
+
+ /* Id: ID */
+ private java.lang.Long _id;
+
+ /* 到达时间: ARRIVAL_TIME */
+ private java.time.LocalDateTime _arrivalTime;
+
+ /* 出发时间: DEPARTURE_TIME */
+ private java.time.LocalDateTime _departureTime;
+
+ /* 到达地点ID: ARRIVAL_LOCATION_ID */
+ private java.lang.Long _arrivalLocationId;
+
+ /* 出发地点ID: DEPARTURE_LOCATION_ID */
+ private java.lang.Long _departureLocationId;
+
+ /* 航程ID: VOYAGE_ID */
+ private java.lang.Long _voyageId;
+
+
+ public _CarrierMovement(){
+ // for debug
+ }
+
+ protected CarrierMovement newInstance(){
+ CarrierMovement entity = new CarrierMovement();
+ entity.orm_attach(orm_enhancer());
+ entity.orm_entityModel(orm_entityModel());
+ return entity;
+ }
+
+ @Override
+ public CarrierMovement cloneInstance() {
+ CarrierMovement entity = newInstance();
+ orm_forEachInitedProp((value, propId) -> {
+ entity.orm_propValue(propId,value);
+ });
+ return entity;
+ }
+
+ @Override
+ public String orm_entityName() {
+ // 如果存在实体模型对象,则以模型对象上的设置为准
+ IEntityModel entityModel = orm_entityModel();
+ if(entityModel != null)
+ return entityModel.getName();
+ return "app.demo.ddd.entity.CarrierMovement";
+ }
+
+ @Override
+ public int orm_propIdBound(){
+ IEntityModel entityModel = orm_entityModel();
+ if(entityModel != null)
+ return entityModel.getPropIdBound();
+ return _PROP_ID_BOUND;
+ }
+
+ @Override
+ public Object orm_id() {
+
+ return buildSimpleId(PROP_ID_id);
+
+ }
+
+ @Override
+ public boolean orm_isPrimary(int propId) {
+
+ return propId == PROP_ID_id;
+
+ }
+
+ @Override
+ public String orm_propName(int propId) {
+ if(propId >= PROP_ID_TO_NAME.length)
+ return super.orm_propName(propId);
+ String propName = PROP_ID_TO_NAME[propId];
+ if(propName == null)
+ return super.orm_propName(propId);
+ return propName;
+ }
+
+ @Override
+ public int orm_propId(String propName) {
+ Integer propId = PROP_NAME_TO_ID.get(propName);
+ if(propId == null)
+ return super.orm_propId(propName);
+ return propId;
+ }
+
+ @Override
+ public Object orm_propValue(int propId) {
+ switch(propId){
+
+ case PROP_ID_id:
+ return getId();
+
+ case PROP_ID_arrivalTime:
+ return getArrivalTime();
+
+ case PROP_ID_departureTime:
+ return getDepartureTime();
+
+ case PROP_ID_arrivalLocationId:
+ return getArrivalLocationId();
+
+ case PROP_ID_departureLocationId:
+ return getDepartureLocationId();
+
+ case PROP_ID_voyageId:
+ return getVoyageId();
+
+ default:
+ return super.orm_propValue(propId);
+ }
+ }
+
+
+
+ @Override
+ public void orm_propValue(int propId, Object value){
+ switch(propId){
+
+ case PROP_ID_id:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_id));
+ }
+ setId(typedValue);
+ break;
+ }
+
+ case PROP_ID_arrivalTime:{
+ java.time.LocalDateTime typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLocalDateTime(value,
+ err-> newTypeConversionError(PROP_NAME_arrivalTime));
+ }
+ setArrivalTime(typedValue);
+ break;
+ }
+
+ case PROP_ID_departureTime:{
+ java.time.LocalDateTime typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLocalDateTime(value,
+ err-> newTypeConversionError(PROP_NAME_departureTime));
+ }
+ setDepartureTime(typedValue);
+ break;
+ }
+
+ case PROP_ID_arrivalLocationId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_arrivalLocationId));
+ }
+ setArrivalLocationId(typedValue);
+ break;
+ }
+
+ case PROP_ID_departureLocationId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_departureLocationId));
+ }
+ setDepartureLocationId(typedValue);
+ break;
+ }
+
+ case PROP_ID_voyageId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_voyageId));
+ }
+ setVoyageId(typedValue);
+ break;
+ }
+
+ default:
+ super.orm_propValue(propId,value);
+ }
+ }
+
+ @Override
+ public void orm_internalSet(int propId, Object value) {
+ switch(propId){
+
+ case PROP_ID_id:{
+ onInitProp(propId);
+ this._id = (java.lang.Long)value;
+ orm_id(); // 如果是设置主键字段,则触发watcher
+ break;
+ }
+
+ case PROP_ID_arrivalTime:{
+ onInitProp(propId);
+ this._arrivalTime = (java.time.LocalDateTime)value;
+
+ break;
+ }
+
+ case PROP_ID_departureTime:{
+ onInitProp(propId);
+ this._departureTime = (java.time.LocalDateTime)value;
+
+ break;
+ }
+
+ case PROP_ID_arrivalLocationId:{
+ onInitProp(propId);
+ this._arrivalLocationId = (java.lang.Long)value;
+
+ break;
+ }
+
+ case PROP_ID_departureLocationId:{
+ onInitProp(propId);
+ this._departureLocationId = (java.lang.Long)value;
+
+ break;
+ }
+
+ case PROP_ID_voyageId:{
+ onInitProp(propId);
+ this._voyageId = (java.lang.Long)value;
+
+ break;
+ }
+
+ default:
+ super.orm_internalSet(propId,value);
+ }
+ }
+
+
+ /**
+ * Id: ID
+ */
+ public java.lang.Long getId(){
+ onPropGet(PROP_ID_id);
+ return _id;
+ }
+
+ /**
+ * Id: ID
+ */
+ public void setId(java.lang.Long value){
+ if(onPropSet(PROP_ID_id,value)){
+ this._id = value;
+ internalClearRefs(PROP_ID_id);
+ orm_id();
+ }
+ }
+
+ /**
+ * 到达时间: ARRIVAL_TIME
+ */
+ public java.time.LocalDateTime getArrivalTime(){
+ onPropGet(PROP_ID_arrivalTime);
+ return _arrivalTime;
+ }
+
+ /**
+ * 到达时间: ARRIVAL_TIME
+ */
+ public void setArrivalTime(java.time.LocalDateTime value){
+ if(onPropSet(PROP_ID_arrivalTime,value)){
+ this._arrivalTime = value;
+ internalClearRefs(PROP_ID_arrivalTime);
+
+ }
+ }
+
+ /**
+ * 出发时间: DEPARTURE_TIME
+ */
+ public java.time.LocalDateTime getDepartureTime(){
+ onPropGet(PROP_ID_departureTime);
+ return _departureTime;
+ }
+
+ /**
+ * 出发时间: DEPARTURE_TIME
+ */
+ public void setDepartureTime(java.time.LocalDateTime value){
+ if(onPropSet(PROP_ID_departureTime,value)){
+ this._departureTime = value;
+ internalClearRefs(PROP_ID_departureTime);
+
+ }
+ }
+
+ /**
+ * 到达地点ID: ARRIVAL_LOCATION_ID
+ */
+ public java.lang.Long getArrivalLocationId(){
+ onPropGet(PROP_ID_arrivalLocationId);
+ return _arrivalLocationId;
+ }
+
+ /**
+ * 到达地点ID: ARRIVAL_LOCATION_ID
+ */
+ public void setArrivalLocationId(java.lang.Long value){
+ if(onPropSet(PROP_ID_arrivalLocationId,value)){
+ this._arrivalLocationId = value;
+ internalClearRefs(PROP_ID_arrivalLocationId);
+
+ }
+ }
+
+ /**
+ * 出发地点ID: DEPARTURE_LOCATION_ID
+ */
+ public java.lang.Long getDepartureLocationId(){
+ onPropGet(PROP_ID_departureLocationId);
+ return _departureLocationId;
+ }
+
+ /**
+ * 出发地点ID: DEPARTURE_LOCATION_ID
+ */
+ public void setDepartureLocationId(java.lang.Long value){
+ if(onPropSet(PROP_ID_departureLocationId,value)){
+ this._departureLocationId = value;
+ internalClearRefs(PROP_ID_departureLocationId);
+
+ }
+ }
+
+ /**
+ * 航程ID: VOYAGE_ID
+ */
+ public java.lang.Long getVoyageId(){
+ onPropGet(PROP_ID_voyageId);
+ return _voyageId;
+ }
+
+ /**
+ * 航程ID: VOYAGE_ID
+ */
+ public void setVoyageId(java.lang.Long value){
+ if(onPropSet(PROP_ID_voyageId,value)){
+ this._voyageId = value;
+ internalClearRefs(PROP_ID_voyageId);
+
+ }
+ }
+
+ /**
+ * 航程
+ */
+ public app.demo.ddd.entity.Voyage getVoyage(){
+ return (app.demo.ddd.entity.Voyage)internalGetRefEntity(PROP_NAME_voyage);
+ }
+
+ public void setVoyage(app.demo.ddd.entity.Voyage refEntity){
+
+ if(refEntity == null){
+
+ this.setVoyageId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_voyage, refEntity,()->{
+
+ this.setVoyageId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+ /**
+ * 出发地点
+ */
+ public app.demo.ddd.entity.Location getDepartureLocation(){
+ return (app.demo.ddd.entity.Location)internalGetRefEntity(PROP_NAME_departureLocation);
+ }
+
+ public void setDepartureLocation(app.demo.ddd.entity.Location refEntity){
+
+ if(refEntity == null){
+
+ this.setDepartureLocationId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_departureLocation, refEntity,()->{
+
+ this.setDepartureLocationId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+ /**
+ * 到达地点
+ */
+ public app.demo.ddd.entity.Location getArrivalLocation(){
+ return (app.demo.ddd.entity.Location)internalGetRefEntity(PROP_NAME_arrivalLocation);
+ }
+
+ public void setArrivalLocation(app.demo.ddd.entity.Location refEntity){
+
+ if(refEntity == null){
+
+ this.setArrivalLocationId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_arrivalLocation, refEntity,()->{
+
+ this.setArrivalLocationId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+}
+// resume CPD analysis - CPD-ON
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_HandlingEvent.java b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_HandlingEvent.java
new file mode 100644
index 000000000..44c23a7f8
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_HandlingEvent.java
@@ -0,0 +1,560 @@
+package app.demo.ddd.entity._gen;
+
+import io.nop.orm.model.IEntityModel;
+import io.nop.orm.support.DynamicOrmEntity;
+import io.nop.orm.support.OrmEntitySet; //NOPMD - suppressed UnusedImports - Auto Gen Code
+import io.nop.orm.IOrmEntitySet; //NOPMD - suppressed UnusedImports - Auto Gen Code
+import io.nop.api.core.convert.ConvertHelper;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Arrays;
+import java.util.List;
+
+import app.demo.ddd.entity.HandlingEvent;
+
+// tell cpd to start ignoring code - CPD-OFF
+/**
+ * 业务时间: handling_event
+ */
+@SuppressWarnings({"PMD.UselessOverridingMethod","PMD.UnusedLocalVariable","java:S3008","java:S1602","java:S1128","java:S1161",
+ "PMD.UnnecessaryFullyQualifiedName","PMD.EmptyControlStatement","java:S116","java:S115","java:S101","java:S3776"})
+public class _HandlingEvent extends DynamicOrmEntity{
+
+ /* Id: ID BIGINT */
+ public static final String PROP_NAME_id = "id";
+ public static final int PROP_ID_id = 1;
+
+ /* 完成时间: COMPLETION_TIME DATETIME */
+ public static final String PROP_NAME_completionTime = "completionTime";
+ public static final int PROP_ID_completionTime = 2;
+
+ /* 注册时间: REGISTRATION_TIME DATETIME */
+ public static final String PROP_NAME_registrationTime = "registrationTime";
+ public static final int PROP_ID_registrationTime = 3;
+
+ /* 类型: TYPE VARCHAR */
+ public static final String PROP_NAME_type = "type";
+ public static final int PROP_ID_type = 4;
+
+ /* 货物ID: CARGO_ID BIGINT */
+ public static final String PROP_NAME_cargoId = "cargoId";
+ public static final int PROP_ID_cargoId = 5;
+
+ /* 位置ID: LOCATION_ID BIGINT */
+ public static final String PROP_NAME_locationId = "locationId";
+ public static final int PROP_ID_locationId = 6;
+
+ /* 航程ID: VOYAGE_ID BIGINT */
+ public static final String PROP_NAME_voyageId = "voyageId";
+ public static final int PROP_ID_voyageId = 7;
+
+
+ private static int _PROP_ID_BOUND = 8;
+
+
+ /* relation: 货物 */
+ public static final String PROP_NAME_cargo = "cargo";
+
+ /* relation: 航程 */
+ public static final String PROP_NAME_voyage = "voyage";
+
+ /* relation: 位置 */
+ public static final String PROP_NAME_location = "location";
+
+
+ protected static final List PK_PROP_NAMES = Arrays.asList(PROP_NAME_id);
+ protected static final int[] PK_PROP_IDS = new int[]{PROP_ID_id};
+
+ private static final String[] PROP_ID_TO_NAME = new String[8];
+ private static final Map PROP_NAME_TO_ID = new HashMap<>();
+ static{
+
+ PROP_ID_TO_NAME[PROP_ID_id] = PROP_NAME_id;
+ PROP_NAME_TO_ID.put(PROP_NAME_id, PROP_ID_id);
+
+ PROP_ID_TO_NAME[PROP_ID_completionTime] = PROP_NAME_completionTime;
+ PROP_NAME_TO_ID.put(PROP_NAME_completionTime, PROP_ID_completionTime);
+
+ PROP_ID_TO_NAME[PROP_ID_registrationTime] = PROP_NAME_registrationTime;
+ PROP_NAME_TO_ID.put(PROP_NAME_registrationTime, PROP_ID_registrationTime);
+
+ PROP_ID_TO_NAME[PROP_ID_type] = PROP_NAME_type;
+ PROP_NAME_TO_ID.put(PROP_NAME_type, PROP_ID_type);
+
+ PROP_ID_TO_NAME[PROP_ID_cargoId] = PROP_NAME_cargoId;
+ PROP_NAME_TO_ID.put(PROP_NAME_cargoId, PROP_ID_cargoId);
+
+ PROP_ID_TO_NAME[PROP_ID_locationId] = PROP_NAME_locationId;
+ PROP_NAME_TO_ID.put(PROP_NAME_locationId, PROP_ID_locationId);
+
+ PROP_ID_TO_NAME[PROP_ID_voyageId] = PROP_NAME_voyageId;
+ PROP_NAME_TO_ID.put(PROP_NAME_voyageId, PROP_ID_voyageId);
+
+ }
+
+
+ /* Id: ID */
+ private java.lang.Long _id;
+
+ /* 完成时间: COMPLETION_TIME */
+ private java.time.LocalDateTime _completionTime;
+
+ /* 注册时间: REGISTRATION_TIME */
+ private java.time.LocalDateTime _registrationTime;
+
+ /* 类型: TYPE */
+ private java.lang.String _type;
+
+ /* 货物ID: CARGO_ID */
+ private java.lang.Long _cargoId;
+
+ /* 位置ID: LOCATION_ID */
+ private java.lang.Long _locationId;
+
+ /* 航程ID: VOYAGE_ID */
+ private java.lang.Long _voyageId;
+
+
+ public _HandlingEvent(){
+ // for debug
+ }
+
+ protected HandlingEvent newInstance(){
+ HandlingEvent entity = new HandlingEvent();
+ entity.orm_attach(orm_enhancer());
+ entity.orm_entityModel(orm_entityModel());
+ return entity;
+ }
+
+ @Override
+ public HandlingEvent cloneInstance() {
+ HandlingEvent entity = newInstance();
+ orm_forEachInitedProp((value, propId) -> {
+ entity.orm_propValue(propId,value);
+ });
+ return entity;
+ }
+
+ @Override
+ public String orm_entityName() {
+ // 如果存在实体模型对象,则以模型对象上的设置为准
+ IEntityModel entityModel = orm_entityModel();
+ if(entityModel != null)
+ return entityModel.getName();
+ return "app.demo.ddd.entity.HandlingEvent";
+ }
+
+ @Override
+ public int orm_propIdBound(){
+ IEntityModel entityModel = orm_entityModel();
+ if(entityModel != null)
+ return entityModel.getPropIdBound();
+ return _PROP_ID_BOUND;
+ }
+
+ @Override
+ public Object orm_id() {
+
+ return buildSimpleId(PROP_ID_id);
+
+ }
+
+ @Override
+ public boolean orm_isPrimary(int propId) {
+
+ return propId == PROP_ID_id;
+
+ }
+
+ @Override
+ public String orm_propName(int propId) {
+ if(propId >= PROP_ID_TO_NAME.length)
+ return super.orm_propName(propId);
+ String propName = PROP_ID_TO_NAME[propId];
+ if(propName == null)
+ return super.orm_propName(propId);
+ return propName;
+ }
+
+ @Override
+ public int orm_propId(String propName) {
+ Integer propId = PROP_NAME_TO_ID.get(propName);
+ if(propId == null)
+ return super.orm_propId(propName);
+ return propId;
+ }
+
+ @Override
+ public Object orm_propValue(int propId) {
+ switch(propId){
+
+ case PROP_ID_id:
+ return getId();
+
+ case PROP_ID_completionTime:
+ return getCompletionTime();
+
+ case PROP_ID_registrationTime:
+ return getRegistrationTime();
+
+ case PROP_ID_type:
+ return getType();
+
+ case PROP_ID_cargoId:
+ return getCargoId();
+
+ case PROP_ID_locationId:
+ return getLocationId();
+
+ case PROP_ID_voyageId:
+ return getVoyageId();
+
+ default:
+ return super.orm_propValue(propId);
+ }
+ }
+
+
+
+ @Override
+ public void orm_propValue(int propId, Object value){
+ switch(propId){
+
+ case PROP_ID_id:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_id));
+ }
+ setId(typedValue);
+ break;
+ }
+
+ case PROP_ID_completionTime:{
+ java.time.LocalDateTime typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLocalDateTime(value,
+ err-> newTypeConversionError(PROP_NAME_completionTime));
+ }
+ setCompletionTime(typedValue);
+ break;
+ }
+
+ case PROP_ID_registrationTime:{
+ java.time.LocalDateTime typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLocalDateTime(value,
+ err-> newTypeConversionError(PROP_NAME_registrationTime));
+ }
+ setRegistrationTime(typedValue);
+ break;
+ }
+
+ case PROP_ID_type:{
+ java.lang.String typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toString(value,
+ err-> newTypeConversionError(PROP_NAME_type));
+ }
+ setType(typedValue);
+ break;
+ }
+
+ case PROP_ID_cargoId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_cargoId));
+ }
+ setCargoId(typedValue);
+ break;
+ }
+
+ case PROP_ID_locationId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_locationId));
+ }
+ setLocationId(typedValue);
+ break;
+ }
+
+ case PROP_ID_voyageId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_voyageId));
+ }
+ setVoyageId(typedValue);
+ break;
+ }
+
+ default:
+ super.orm_propValue(propId,value);
+ }
+ }
+
+ @Override
+ public void orm_internalSet(int propId, Object value) {
+ switch(propId){
+
+ case PROP_ID_id:{
+ onInitProp(propId);
+ this._id = (java.lang.Long)value;
+ orm_id(); // 如果是设置主键字段,则触发watcher
+ break;
+ }
+
+ case PROP_ID_completionTime:{
+ onInitProp(propId);
+ this._completionTime = (java.time.LocalDateTime)value;
+
+ break;
+ }
+
+ case PROP_ID_registrationTime:{
+ onInitProp(propId);
+ this._registrationTime = (java.time.LocalDateTime)value;
+
+ break;
+ }
+
+ case PROP_ID_type:{
+ onInitProp(propId);
+ this._type = (java.lang.String)value;
+
+ break;
+ }
+
+ case PROP_ID_cargoId:{
+ onInitProp(propId);
+ this._cargoId = (java.lang.Long)value;
+
+ break;
+ }
+
+ case PROP_ID_locationId:{
+ onInitProp(propId);
+ this._locationId = (java.lang.Long)value;
+
+ break;
+ }
+
+ case PROP_ID_voyageId:{
+ onInitProp(propId);
+ this._voyageId = (java.lang.Long)value;
+
+ break;
+ }
+
+ default:
+ super.orm_internalSet(propId,value);
+ }
+ }
+
+
+ /**
+ * Id: ID
+ */
+ public java.lang.Long getId(){
+ onPropGet(PROP_ID_id);
+ return _id;
+ }
+
+ /**
+ * Id: ID
+ */
+ public void setId(java.lang.Long value){
+ if(onPropSet(PROP_ID_id,value)){
+ this._id = value;
+ internalClearRefs(PROP_ID_id);
+ orm_id();
+ }
+ }
+
+ /**
+ * 完成时间: COMPLETION_TIME
+ */
+ public java.time.LocalDateTime getCompletionTime(){
+ onPropGet(PROP_ID_completionTime);
+ return _completionTime;
+ }
+
+ /**
+ * 完成时间: COMPLETION_TIME
+ */
+ public void setCompletionTime(java.time.LocalDateTime value){
+ if(onPropSet(PROP_ID_completionTime,value)){
+ this._completionTime = value;
+ internalClearRefs(PROP_ID_completionTime);
+
+ }
+ }
+
+ /**
+ * 注册时间: REGISTRATION_TIME
+ */
+ public java.time.LocalDateTime getRegistrationTime(){
+ onPropGet(PROP_ID_registrationTime);
+ return _registrationTime;
+ }
+
+ /**
+ * 注册时间: REGISTRATION_TIME
+ */
+ public void setRegistrationTime(java.time.LocalDateTime value){
+ if(onPropSet(PROP_ID_registrationTime,value)){
+ this._registrationTime = value;
+ internalClearRefs(PROP_ID_registrationTime);
+
+ }
+ }
+
+ /**
+ * 类型: TYPE
+ */
+ public java.lang.String getType(){
+ onPropGet(PROP_ID_type);
+ return _type;
+ }
+
+ /**
+ * 类型: TYPE
+ */
+ public void setType(java.lang.String value){
+ if(onPropSet(PROP_ID_type,value)){
+ this._type = value;
+ internalClearRefs(PROP_ID_type);
+
+ }
+ }
+
+ /**
+ * 货物ID: CARGO_ID
+ */
+ public java.lang.Long getCargoId(){
+ onPropGet(PROP_ID_cargoId);
+ return _cargoId;
+ }
+
+ /**
+ * 货物ID: CARGO_ID
+ */
+ public void setCargoId(java.lang.Long value){
+ if(onPropSet(PROP_ID_cargoId,value)){
+ this._cargoId = value;
+ internalClearRefs(PROP_ID_cargoId);
+
+ }
+ }
+
+ /**
+ * 位置ID: LOCATION_ID
+ */
+ public java.lang.Long getLocationId(){
+ onPropGet(PROP_ID_locationId);
+ return _locationId;
+ }
+
+ /**
+ * 位置ID: LOCATION_ID
+ */
+ public void setLocationId(java.lang.Long value){
+ if(onPropSet(PROP_ID_locationId,value)){
+ this._locationId = value;
+ internalClearRefs(PROP_ID_locationId);
+
+ }
+ }
+
+ /**
+ * 航程ID: VOYAGE_ID
+ */
+ public java.lang.Long getVoyageId(){
+ onPropGet(PROP_ID_voyageId);
+ return _voyageId;
+ }
+
+ /**
+ * 航程ID: VOYAGE_ID
+ */
+ public void setVoyageId(java.lang.Long value){
+ if(onPropSet(PROP_ID_voyageId,value)){
+ this._voyageId = value;
+ internalClearRefs(PROP_ID_voyageId);
+
+ }
+ }
+
+ /**
+ * 货物
+ */
+ public app.demo.ddd.entity.Cargo getCargo(){
+ return (app.demo.ddd.entity.Cargo)internalGetRefEntity(PROP_NAME_cargo);
+ }
+
+ public void setCargo(app.demo.ddd.entity.Cargo refEntity){
+
+ if(refEntity == null){
+
+ this.setCargoId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_cargo, refEntity,()->{
+
+ this.setCargoId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+ /**
+ * 航程
+ */
+ public app.demo.ddd.entity.Voyage getVoyage(){
+ return (app.demo.ddd.entity.Voyage)internalGetRefEntity(PROP_NAME_voyage);
+ }
+
+ public void setVoyage(app.demo.ddd.entity.Voyage refEntity){
+
+ if(refEntity == null){
+
+ this.setVoyageId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_voyage, refEntity,()->{
+
+ this.setVoyageId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+ /**
+ * 位置
+ */
+ public app.demo.ddd.entity.Location getLocation(){
+ return (app.demo.ddd.entity.Location)internalGetRefEntity(PROP_NAME_location);
+ }
+
+ public void setLocation(app.demo.ddd.entity.Location refEntity){
+
+ if(refEntity == null){
+
+ this.setLocationId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_location, refEntity,()->{
+
+ this.setLocationId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+}
+// resume CPD analysis - CPD-ON
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_Leg.java b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_Leg.java
new file mode 100644
index 000000000..471958e66
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_Leg.java
@@ -0,0 +1,586 @@
+package app.demo.ddd.entity._gen;
+
+import io.nop.orm.model.IEntityModel;
+import io.nop.orm.support.DynamicOrmEntity;
+import io.nop.orm.support.OrmEntitySet; //NOPMD - suppressed UnusedImports - Auto Gen Code
+import io.nop.orm.IOrmEntitySet; //NOPMD - suppressed UnusedImports - Auto Gen Code
+import io.nop.api.core.convert.ConvertHelper;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Arrays;
+import java.util.List;
+
+import app.demo.ddd.entity.Leg;
+
+// tell cpd to start ignoring code - CPD-OFF
+/**
+ * 航段: leg
+ */
+@SuppressWarnings({"PMD.UselessOverridingMethod","PMD.UnusedLocalVariable","java:S3008","java:S1602","java:S1128","java:S1161",
+ "PMD.UnnecessaryFullyQualifiedName","PMD.EmptyControlStatement","java:S116","java:S115","java:S101","java:S3776"})
+public class _Leg extends DynamicOrmEntity{
+
+ /* Id: ID BIGINT */
+ public static final String PROP_NAME_id = "id";
+ public static final int PROP_ID_id = 1;
+
+ /* 装货时间: LOAD_TIME DATETIME */
+ public static final String PROP_NAME_loadTime = "loadTime";
+ public static final int PROP_ID_loadTime = 2;
+
+ /* 卸货时间: UNLOAD_TIME DATETIME */
+ public static final String PROP_NAME_unloadTime = "unloadTime";
+ public static final int PROP_ID_unloadTime = 3;
+
+ /* 装货地点: LOAD_LOCATION_ID BIGINT */
+ public static final String PROP_NAME_loadLocationId = "loadLocationId";
+ public static final int PROP_ID_loadLocationId = 4;
+
+ /* 卸货地点: UNLOAD_LOCATION_ID BIGINT */
+ public static final String PROP_NAME_unloadLocationId = "unloadLocationId";
+ public static final int PROP_ID_unloadLocationId = 5;
+
+ /* 航程ID: VOYAGE_ID BIGINT */
+ public static final String PROP_NAME_voyageId = "voyageId";
+ public static final int PROP_ID_voyageId = 6;
+
+ /* 货物ID: CARGO_ID BIGINT */
+ public static final String PROP_NAME_cargoId = "cargoId";
+ public static final int PROP_ID_cargoId = 7;
+
+
+ private static int _PROP_ID_BOUND = 8;
+
+
+ /* relation: 装货地点 */
+ public static final String PROP_NAME_loadLocation = "loadLocation";
+
+ /* relation: 货物 */
+ public static final String PROP_NAME_cargo = "cargo";
+
+ /* relation: 航程 */
+ public static final String PROP_NAME_voyage = "voyage";
+
+ /* relation: 卸载地点 */
+ public static final String PROP_NAME_unloadLocation = "unloadLocation";
+
+
+ protected static final List PK_PROP_NAMES = Arrays.asList(PROP_NAME_id);
+ protected static final int[] PK_PROP_IDS = new int[]{PROP_ID_id};
+
+ private static final String[] PROP_ID_TO_NAME = new String[8];
+ private static final Map PROP_NAME_TO_ID = new HashMap<>();
+ static{
+
+ PROP_ID_TO_NAME[PROP_ID_id] = PROP_NAME_id;
+ PROP_NAME_TO_ID.put(PROP_NAME_id, PROP_ID_id);
+
+ PROP_ID_TO_NAME[PROP_ID_loadTime] = PROP_NAME_loadTime;
+ PROP_NAME_TO_ID.put(PROP_NAME_loadTime, PROP_ID_loadTime);
+
+ PROP_ID_TO_NAME[PROP_ID_unloadTime] = PROP_NAME_unloadTime;
+ PROP_NAME_TO_ID.put(PROP_NAME_unloadTime, PROP_ID_unloadTime);
+
+ PROP_ID_TO_NAME[PROP_ID_loadLocationId] = PROP_NAME_loadLocationId;
+ PROP_NAME_TO_ID.put(PROP_NAME_loadLocationId, PROP_ID_loadLocationId);
+
+ PROP_ID_TO_NAME[PROP_ID_unloadLocationId] = PROP_NAME_unloadLocationId;
+ PROP_NAME_TO_ID.put(PROP_NAME_unloadLocationId, PROP_ID_unloadLocationId);
+
+ PROP_ID_TO_NAME[PROP_ID_voyageId] = PROP_NAME_voyageId;
+ PROP_NAME_TO_ID.put(PROP_NAME_voyageId, PROP_ID_voyageId);
+
+ PROP_ID_TO_NAME[PROP_ID_cargoId] = PROP_NAME_cargoId;
+ PROP_NAME_TO_ID.put(PROP_NAME_cargoId, PROP_ID_cargoId);
+
+ }
+
+
+ /* Id: ID */
+ private java.lang.Long _id;
+
+ /* 装货时间: LOAD_TIME */
+ private java.time.LocalDateTime _loadTime;
+
+ /* 卸货时间: UNLOAD_TIME */
+ private java.time.LocalDateTime _unloadTime;
+
+ /* 装货地点: LOAD_LOCATION_ID */
+ private java.lang.Long _loadLocationId;
+
+ /* 卸货地点: UNLOAD_LOCATION_ID */
+ private java.lang.Long _unloadLocationId;
+
+ /* 航程ID: VOYAGE_ID */
+ private java.lang.Long _voyageId;
+
+ /* 货物ID: CARGO_ID */
+ private java.lang.Long _cargoId;
+
+
+ public _Leg(){
+ // for debug
+ }
+
+ protected Leg newInstance(){
+ Leg entity = new Leg();
+ entity.orm_attach(orm_enhancer());
+ entity.orm_entityModel(orm_entityModel());
+ return entity;
+ }
+
+ @Override
+ public Leg cloneInstance() {
+ Leg entity = newInstance();
+ orm_forEachInitedProp((value, propId) -> {
+ entity.orm_propValue(propId,value);
+ });
+ return entity;
+ }
+
+ @Override
+ public String orm_entityName() {
+ // 如果存在实体模型对象,则以模型对象上的设置为准
+ IEntityModel entityModel = orm_entityModel();
+ if(entityModel != null)
+ return entityModel.getName();
+ return "app.demo.ddd.entity.Leg";
+ }
+
+ @Override
+ public int orm_propIdBound(){
+ IEntityModel entityModel = orm_entityModel();
+ if(entityModel != null)
+ return entityModel.getPropIdBound();
+ return _PROP_ID_BOUND;
+ }
+
+ @Override
+ public Object orm_id() {
+
+ return buildSimpleId(PROP_ID_id);
+
+ }
+
+ @Override
+ public boolean orm_isPrimary(int propId) {
+
+ return propId == PROP_ID_id;
+
+ }
+
+ @Override
+ public String orm_propName(int propId) {
+ if(propId >= PROP_ID_TO_NAME.length)
+ return super.orm_propName(propId);
+ String propName = PROP_ID_TO_NAME[propId];
+ if(propName == null)
+ return super.orm_propName(propId);
+ return propName;
+ }
+
+ @Override
+ public int orm_propId(String propName) {
+ Integer propId = PROP_NAME_TO_ID.get(propName);
+ if(propId == null)
+ return super.orm_propId(propName);
+ return propId;
+ }
+
+ @Override
+ public Object orm_propValue(int propId) {
+ switch(propId){
+
+ case PROP_ID_id:
+ return getId();
+
+ case PROP_ID_loadTime:
+ return getLoadTime();
+
+ case PROP_ID_unloadTime:
+ return getUnloadTime();
+
+ case PROP_ID_loadLocationId:
+ return getLoadLocationId();
+
+ case PROP_ID_unloadLocationId:
+ return getUnloadLocationId();
+
+ case PROP_ID_voyageId:
+ return getVoyageId();
+
+ case PROP_ID_cargoId:
+ return getCargoId();
+
+ default:
+ return super.orm_propValue(propId);
+ }
+ }
+
+
+
+ @Override
+ public void orm_propValue(int propId, Object value){
+ switch(propId){
+
+ case PROP_ID_id:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_id));
+ }
+ setId(typedValue);
+ break;
+ }
+
+ case PROP_ID_loadTime:{
+ java.time.LocalDateTime typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLocalDateTime(value,
+ err-> newTypeConversionError(PROP_NAME_loadTime));
+ }
+ setLoadTime(typedValue);
+ break;
+ }
+
+ case PROP_ID_unloadTime:{
+ java.time.LocalDateTime typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLocalDateTime(value,
+ err-> newTypeConversionError(PROP_NAME_unloadTime));
+ }
+ setUnloadTime(typedValue);
+ break;
+ }
+
+ case PROP_ID_loadLocationId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_loadLocationId));
+ }
+ setLoadLocationId(typedValue);
+ break;
+ }
+
+ case PROP_ID_unloadLocationId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_unloadLocationId));
+ }
+ setUnloadLocationId(typedValue);
+ break;
+ }
+
+ case PROP_ID_voyageId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_voyageId));
+ }
+ setVoyageId(typedValue);
+ break;
+ }
+
+ case PROP_ID_cargoId:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_cargoId));
+ }
+ setCargoId(typedValue);
+ break;
+ }
+
+ default:
+ super.orm_propValue(propId,value);
+ }
+ }
+
+ @Override
+ public void orm_internalSet(int propId, Object value) {
+ switch(propId){
+
+ case PROP_ID_id:{
+ onInitProp(propId);
+ this._id = (java.lang.Long)value;
+ orm_id(); // 如果是设置主键字段,则触发watcher
+ break;
+ }
+
+ case PROP_ID_loadTime:{
+ onInitProp(propId);
+ this._loadTime = (java.time.LocalDateTime)value;
+
+ break;
+ }
+
+ case PROP_ID_unloadTime:{
+ onInitProp(propId);
+ this._unloadTime = (java.time.LocalDateTime)value;
+
+ break;
+ }
+
+ case PROP_ID_loadLocationId:{
+ onInitProp(propId);
+ this._loadLocationId = (java.lang.Long)value;
+
+ break;
+ }
+
+ case PROP_ID_unloadLocationId:{
+ onInitProp(propId);
+ this._unloadLocationId = (java.lang.Long)value;
+
+ break;
+ }
+
+ case PROP_ID_voyageId:{
+ onInitProp(propId);
+ this._voyageId = (java.lang.Long)value;
+
+ break;
+ }
+
+ case PROP_ID_cargoId:{
+ onInitProp(propId);
+ this._cargoId = (java.lang.Long)value;
+
+ break;
+ }
+
+ default:
+ super.orm_internalSet(propId,value);
+ }
+ }
+
+
+ /**
+ * Id: ID
+ */
+ public java.lang.Long getId(){
+ onPropGet(PROP_ID_id);
+ return _id;
+ }
+
+ /**
+ * Id: ID
+ */
+ public void setId(java.lang.Long value){
+ if(onPropSet(PROP_ID_id,value)){
+ this._id = value;
+ internalClearRefs(PROP_ID_id);
+ orm_id();
+ }
+ }
+
+ /**
+ * 装货时间: LOAD_TIME
+ */
+ public java.time.LocalDateTime getLoadTime(){
+ onPropGet(PROP_ID_loadTime);
+ return _loadTime;
+ }
+
+ /**
+ * 装货时间: LOAD_TIME
+ */
+ public void setLoadTime(java.time.LocalDateTime value){
+ if(onPropSet(PROP_ID_loadTime,value)){
+ this._loadTime = value;
+ internalClearRefs(PROP_ID_loadTime);
+
+ }
+ }
+
+ /**
+ * 卸货时间: UNLOAD_TIME
+ */
+ public java.time.LocalDateTime getUnloadTime(){
+ onPropGet(PROP_ID_unloadTime);
+ return _unloadTime;
+ }
+
+ /**
+ * 卸货时间: UNLOAD_TIME
+ */
+ public void setUnloadTime(java.time.LocalDateTime value){
+ if(onPropSet(PROP_ID_unloadTime,value)){
+ this._unloadTime = value;
+ internalClearRefs(PROP_ID_unloadTime);
+
+ }
+ }
+
+ /**
+ * 装货地点: LOAD_LOCATION_ID
+ */
+ public java.lang.Long getLoadLocationId(){
+ onPropGet(PROP_ID_loadLocationId);
+ return _loadLocationId;
+ }
+
+ /**
+ * 装货地点: LOAD_LOCATION_ID
+ */
+ public void setLoadLocationId(java.lang.Long value){
+ if(onPropSet(PROP_ID_loadLocationId,value)){
+ this._loadLocationId = value;
+ internalClearRefs(PROP_ID_loadLocationId);
+
+ }
+ }
+
+ /**
+ * 卸货地点: UNLOAD_LOCATION_ID
+ */
+ public java.lang.Long getUnloadLocationId(){
+ onPropGet(PROP_ID_unloadLocationId);
+ return _unloadLocationId;
+ }
+
+ /**
+ * 卸货地点: UNLOAD_LOCATION_ID
+ */
+ public void setUnloadLocationId(java.lang.Long value){
+ if(onPropSet(PROP_ID_unloadLocationId,value)){
+ this._unloadLocationId = value;
+ internalClearRefs(PROP_ID_unloadLocationId);
+
+ }
+ }
+
+ /**
+ * 航程ID: VOYAGE_ID
+ */
+ public java.lang.Long getVoyageId(){
+ onPropGet(PROP_ID_voyageId);
+ return _voyageId;
+ }
+
+ /**
+ * 航程ID: VOYAGE_ID
+ */
+ public void setVoyageId(java.lang.Long value){
+ if(onPropSet(PROP_ID_voyageId,value)){
+ this._voyageId = value;
+ internalClearRefs(PROP_ID_voyageId);
+
+ }
+ }
+
+ /**
+ * 货物ID: CARGO_ID
+ */
+ public java.lang.Long getCargoId(){
+ onPropGet(PROP_ID_cargoId);
+ return _cargoId;
+ }
+
+ /**
+ * 货物ID: CARGO_ID
+ */
+ public void setCargoId(java.lang.Long value){
+ if(onPropSet(PROP_ID_cargoId,value)){
+ this._cargoId = value;
+ internalClearRefs(PROP_ID_cargoId);
+
+ }
+ }
+
+ /**
+ * 装货地点
+ */
+ public app.demo.ddd.entity.Location getLoadLocation(){
+ return (app.demo.ddd.entity.Location)internalGetRefEntity(PROP_NAME_loadLocation);
+ }
+
+ public void setLoadLocation(app.demo.ddd.entity.Location refEntity){
+
+ if(refEntity == null){
+
+ this.setLoadLocationId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_loadLocation, refEntity,()->{
+
+ this.setLoadLocationId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+ /**
+ * 货物
+ */
+ public app.demo.ddd.entity.Cargo getCargo(){
+ return (app.demo.ddd.entity.Cargo)internalGetRefEntity(PROP_NAME_cargo);
+ }
+
+ public void setCargo(app.demo.ddd.entity.Cargo refEntity){
+
+ if(refEntity == null){
+
+ this.setCargoId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_cargo, refEntity,()->{
+
+ this.setCargoId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+ /**
+ * 航程
+ */
+ public app.demo.ddd.entity.Voyage getVoyage(){
+ return (app.demo.ddd.entity.Voyage)internalGetRefEntity(PROP_NAME_voyage);
+ }
+
+ public void setVoyage(app.demo.ddd.entity.Voyage refEntity){
+
+ if(refEntity == null){
+
+ this.setVoyageId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_voyage, refEntity,()->{
+
+ this.setVoyageId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+ /**
+ * 卸载地点
+ */
+ public app.demo.ddd.entity.Location getUnloadLocation(){
+ return (app.demo.ddd.entity.Location)internalGetRefEntity(PROP_NAME_unloadLocation);
+ }
+
+ public void setUnloadLocation(app.demo.ddd.entity.Location refEntity){
+
+ if(refEntity == null){
+
+ this.setUnloadLocationId(null);
+
+ }else{
+ internalSetRefEntity(PROP_NAME_unloadLocation, refEntity,()->{
+
+ this.setUnloadLocationId(refEntity.getId());
+
+ });
+ }
+
+ }
+
+}
+// resume CPD analysis - CPD-ON
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_Location.java b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_Location.java
new file mode 100644
index 000000000..b960a2c75
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_Location.java
@@ -0,0 +1,286 @@
+package app.demo.ddd.entity._gen;
+
+import io.nop.orm.model.IEntityModel;
+import io.nop.orm.support.DynamicOrmEntity;
+import io.nop.orm.support.OrmEntitySet; //NOPMD - suppressed UnusedImports - Auto Gen Code
+import io.nop.orm.IOrmEntitySet; //NOPMD - suppressed UnusedImports - Auto Gen Code
+import io.nop.api.core.convert.ConvertHelper;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Arrays;
+import java.util.List;
+
+import app.demo.ddd.entity.Location;
+
+// tell cpd to start ignoring code - CPD-OFF
+/**
+ * 位置: location
+ */
+@SuppressWarnings({"PMD.UselessOverridingMethod","PMD.UnusedLocalVariable","java:S3008","java:S1602","java:S1128","java:S1161",
+ "PMD.UnnecessaryFullyQualifiedName","PMD.EmptyControlStatement","java:S116","java:S115","java:S101","java:S3776"})
+public class _Location extends DynamicOrmEntity{
+
+ /* Id: ID BIGINT */
+ public static final String PROP_NAME_id = "id";
+ public static final int PROP_ID_id = 1;
+
+ /* 名称: NAME VARCHAR */
+ public static final String PROP_NAME_name = "name";
+ public static final int PROP_ID_name = 2;
+
+ /* UN编码: UNLOCODE VARCHAR */
+ public static final String PROP_NAME_unlocode = "unlocode";
+ public static final int PROP_ID_unlocode = 3;
+
+
+ private static int _PROP_ID_BOUND = 4;
+
+
+
+ protected static final List PK_PROP_NAMES = Arrays.asList(PROP_NAME_id);
+ protected static final int[] PK_PROP_IDS = new int[]{PROP_ID_id};
+
+ private static final String[] PROP_ID_TO_NAME = new String[4];
+ private static final Map PROP_NAME_TO_ID = new HashMap<>();
+ static{
+
+ PROP_ID_TO_NAME[PROP_ID_id] = PROP_NAME_id;
+ PROP_NAME_TO_ID.put(PROP_NAME_id, PROP_ID_id);
+
+ PROP_ID_TO_NAME[PROP_ID_name] = PROP_NAME_name;
+ PROP_NAME_TO_ID.put(PROP_NAME_name, PROP_ID_name);
+
+ PROP_ID_TO_NAME[PROP_ID_unlocode] = PROP_NAME_unlocode;
+ PROP_NAME_TO_ID.put(PROP_NAME_unlocode, PROP_ID_unlocode);
+
+ }
+
+
+ /* Id: ID */
+ private java.lang.Long _id;
+
+ /* 名称: NAME */
+ private java.lang.String _name;
+
+ /* UN编码: UNLOCODE */
+ private java.lang.String _unlocode;
+
+
+ public _Location(){
+ // for debug
+ }
+
+ protected Location newInstance(){
+ Location entity = new Location();
+ entity.orm_attach(orm_enhancer());
+ entity.orm_entityModel(orm_entityModel());
+ return entity;
+ }
+
+ @Override
+ public Location cloneInstance() {
+ Location entity = newInstance();
+ orm_forEachInitedProp((value, propId) -> {
+ entity.orm_propValue(propId,value);
+ });
+ return entity;
+ }
+
+ @Override
+ public String orm_entityName() {
+ // 如果存在实体模型对象,则以模型对象上的设置为准
+ IEntityModel entityModel = orm_entityModel();
+ if(entityModel != null)
+ return entityModel.getName();
+ return "app.demo.ddd.entity.Location";
+ }
+
+ @Override
+ public int orm_propIdBound(){
+ IEntityModel entityModel = orm_entityModel();
+ if(entityModel != null)
+ return entityModel.getPropIdBound();
+ return _PROP_ID_BOUND;
+ }
+
+ @Override
+ public Object orm_id() {
+
+ return buildSimpleId(PROP_ID_id);
+
+ }
+
+ @Override
+ public boolean orm_isPrimary(int propId) {
+
+ return propId == PROP_ID_id;
+
+ }
+
+ @Override
+ public String orm_propName(int propId) {
+ if(propId >= PROP_ID_TO_NAME.length)
+ return super.orm_propName(propId);
+ String propName = PROP_ID_TO_NAME[propId];
+ if(propName == null)
+ return super.orm_propName(propId);
+ return propName;
+ }
+
+ @Override
+ public int orm_propId(String propName) {
+ Integer propId = PROP_NAME_TO_ID.get(propName);
+ if(propId == null)
+ return super.orm_propId(propName);
+ return propId;
+ }
+
+ @Override
+ public Object orm_propValue(int propId) {
+ switch(propId){
+
+ case PROP_ID_id:
+ return getId();
+
+ case PROP_ID_name:
+ return getName();
+
+ case PROP_ID_unlocode:
+ return getUnlocode();
+
+ default:
+ return super.orm_propValue(propId);
+ }
+ }
+
+
+
+ @Override
+ public void orm_propValue(int propId, Object value){
+ switch(propId){
+
+ case PROP_ID_id:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_id));
+ }
+ setId(typedValue);
+ break;
+ }
+
+ case PROP_ID_name:{
+ java.lang.String typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toString(value,
+ err-> newTypeConversionError(PROP_NAME_name));
+ }
+ setName(typedValue);
+ break;
+ }
+
+ case PROP_ID_unlocode:{
+ java.lang.String typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toString(value,
+ err-> newTypeConversionError(PROP_NAME_unlocode));
+ }
+ setUnlocode(typedValue);
+ break;
+ }
+
+ default:
+ super.orm_propValue(propId,value);
+ }
+ }
+
+ @Override
+ public void orm_internalSet(int propId, Object value) {
+ switch(propId){
+
+ case PROP_ID_id:{
+ onInitProp(propId);
+ this._id = (java.lang.Long)value;
+ orm_id(); // 如果是设置主键字段,则触发watcher
+ break;
+ }
+
+ case PROP_ID_name:{
+ onInitProp(propId);
+ this._name = (java.lang.String)value;
+
+ break;
+ }
+
+ case PROP_ID_unlocode:{
+ onInitProp(propId);
+ this._unlocode = (java.lang.String)value;
+
+ break;
+ }
+
+ default:
+ super.orm_internalSet(propId,value);
+ }
+ }
+
+
+ /**
+ * Id: ID
+ */
+ public java.lang.Long getId(){
+ onPropGet(PROP_ID_id);
+ return _id;
+ }
+
+ /**
+ * Id: ID
+ */
+ public void setId(java.lang.Long value){
+ if(onPropSet(PROP_ID_id,value)){
+ this._id = value;
+ internalClearRefs(PROP_ID_id);
+ orm_id();
+ }
+ }
+
+ /**
+ * 名称: NAME
+ */
+ public java.lang.String getName(){
+ onPropGet(PROP_ID_name);
+ return _name;
+ }
+
+ /**
+ * 名称: NAME
+ */
+ public void setName(java.lang.String value){
+ if(onPropSet(PROP_ID_name,value)){
+ this._name = value;
+ internalClearRefs(PROP_ID_name);
+
+ }
+ }
+
+ /**
+ * UN编码: UNLOCODE
+ */
+ public java.lang.String getUnlocode(){
+ onPropGet(PROP_ID_unlocode);
+ return _unlocode;
+ }
+
+ /**
+ * UN编码: UNLOCODE
+ */
+ public void setUnlocode(java.lang.String value){
+ if(onPropSet(PROP_ID_unlocode,value)){
+ this._unlocode = value;
+ internalClearRefs(PROP_ID_unlocode);
+
+ }
+ }
+
+}
+// resume CPD analysis - CPD-ON
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_Voyage.java b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_Voyage.java
new file mode 100644
index 000000000..7cd0cf47d
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/java/app/demo/ddd/entity/_gen/_Voyage.java
@@ -0,0 +1,237 @@
+package app.demo.ddd.entity._gen;
+
+import io.nop.orm.model.IEntityModel;
+import io.nop.orm.support.DynamicOrmEntity;
+import io.nop.orm.support.OrmEntitySet; //NOPMD - suppressed UnusedImports - Auto Gen Code
+import io.nop.orm.IOrmEntitySet; //NOPMD - suppressed UnusedImports - Auto Gen Code
+import io.nop.api.core.convert.ConvertHelper;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Arrays;
+import java.util.List;
+
+import app.demo.ddd.entity.Voyage;
+
+// tell cpd to start ignoring code - CPD-OFF
+/**
+ * 航程: voyage
+ */
+@SuppressWarnings({"PMD.UselessOverridingMethod","PMD.UnusedLocalVariable","java:S3008","java:S1602","java:S1128","java:S1161",
+ "PMD.UnnecessaryFullyQualifiedName","PMD.EmptyControlStatement","java:S116","java:S115","java:S101","java:S3776"})
+public class _Voyage extends DynamicOrmEntity{
+
+ /* Id: ID BIGINT */
+ public static final String PROP_NAME_id = "id";
+ public static final int PROP_ID_id = 1;
+
+ /* 航程号: VOYAGE_NUMBER VARCHAR */
+ public static final String PROP_NAME_voyageNumber = "voyageNumber";
+ public static final int PROP_ID_voyageNumber = 2;
+
+
+ private static int _PROP_ID_BOUND = 3;
+
+
+
+ protected static final List PK_PROP_NAMES = Arrays.asList(PROP_NAME_id);
+ protected static final int[] PK_PROP_IDS = new int[]{PROP_ID_id};
+
+ private static final String[] PROP_ID_TO_NAME = new String[3];
+ private static final Map PROP_NAME_TO_ID = new HashMap<>();
+ static{
+
+ PROP_ID_TO_NAME[PROP_ID_id] = PROP_NAME_id;
+ PROP_NAME_TO_ID.put(PROP_NAME_id, PROP_ID_id);
+
+ PROP_ID_TO_NAME[PROP_ID_voyageNumber] = PROP_NAME_voyageNumber;
+ PROP_NAME_TO_ID.put(PROP_NAME_voyageNumber, PROP_ID_voyageNumber);
+
+ }
+
+
+ /* Id: ID */
+ private java.lang.Long _id;
+
+ /* 航程号: VOYAGE_NUMBER */
+ private java.lang.String _voyageNumber;
+
+
+ public _Voyage(){
+ // for debug
+ }
+
+ protected Voyage newInstance(){
+ Voyage entity = new Voyage();
+ entity.orm_attach(orm_enhancer());
+ entity.orm_entityModel(orm_entityModel());
+ return entity;
+ }
+
+ @Override
+ public Voyage cloneInstance() {
+ Voyage entity = newInstance();
+ orm_forEachInitedProp((value, propId) -> {
+ entity.orm_propValue(propId,value);
+ });
+ return entity;
+ }
+
+ @Override
+ public String orm_entityName() {
+ // 如果存在实体模型对象,则以模型对象上的设置为准
+ IEntityModel entityModel = orm_entityModel();
+ if(entityModel != null)
+ return entityModel.getName();
+ return "app.demo.ddd.entity.Voyage";
+ }
+
+ @Override
+ public int orm_propIdBound(){
+ IEntityModel entityModel = orm_entityModel();
+ if(entityModel != null)
+ return entityModel.getPropIdBound();
+ return _PROP_ID_BOUND;
+ }
+
+ @Override
+ public Object orm_id() {
+
+ return buildSimpleId(PROP_ID_id);
+
+ }
+
+ @Override
+ public boolean orm_isPrimary(int propId) {
+
+ return propId == PROP_ID_id;
+
+ }
+
+ @Override
+ public String orm_propName(int propId) {
+ if(propId >= PROP_ID_TO_NAME.length)
+ return super.orm_propName(propId);
+ String propName = PROP_ID_TO_NAME[propId];
+ if(propName == null)
+ return super.orm_propName(propId);
+ return propName;
+ }
+
+ @Override
+ public int orm_propId(String propName) {
+ Integer propId = PROP_NAME_TO_ID.get(propName);
+ if(propId == null)
+ return super.orm_propId(propName);
+ return propId;
+ }
+
+ @Override
+ public Object orm_propValue(int propId) {
+ switch(propId){
+
+ case PROP_ID_id:
+ return getId();
+
+ case PROP_ID_voyageNumber:
+ return getVoyageNumber();
+
+ default:
+ return super.orm_propValue(propId);
+ }
+ }
+
+
+
+ @Override
+ public void orm_propValue(int propId, Object value){
+ switch(propId){
+
+ case PROP_ID_id:{
+ java.lang.Long typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toLong(value,
+ err-> newTypeConversionError(PROP_NAME_id));
+ }
+ setId(typedValue);
+ break;
+ }
+
+ case PROP_ID_voyageNumber:{
+ java.lang.String typedValue = null;
+ if(value != null){
+ typedValue = ConvertHelper.toString(value,
+ err-> newTypeConversionError(PROP_NAME_voyageNumber));
+ }
+ setVoyageNumber(typedValue);
+ break;
+ }
+
+ default:
+ super.orm_propValue(propId,value);
+ }
+ }
+
+ @Override
+ public void orm_internalSet(int propId, Object value) {
+ switch(propId){
+
+ case PROP_ID_id:{
+ onInitProp(propId);
+ this._id = (java.lang.Long)value;
+ orm_id(); // 如果是设置主键字段,则触发watcher
+ break;
+ }
+
+ case PROP_ID_voyageNumber:{
+ onInitProp(propId);
+ this._voyageNumber = (java.lang.String)value;
+
+ break;
+ }
+
+ default:
+ super.orm_internalSet(propId,value);
+ }
+ }
+
+
+ /**
+ * Id: ID
+ */
+ public java.lang.Long getId(){
+ onPropGet(PROP_ID_id);
+ return _id;
+ }
+
+ /**
+ * Id: ID
+ */
+ public void setId(java.lang.Long value){
+ if(onPropSet(PROP_ID_id,value)){
+ this._id = value;
+ internalClearRefs(PROP_ID_id);
+ orm_id();
+ }
+ }
+
+ /**
+ * 航程号: VOYAGE_NUMBER
+ */
+ public java.lang.String getVoyageNumber(){
+ onPropGet(PROP_ID_voyageNumber);
+ return _voyageNumber;
+ }
+
+ /**
+ * 航程号: VOYAGE_NUMBER
+ */
+ public void setVoyageNumber(java.lang.String value){
+ if(onPropSet(PROP_ID_voyageNumber,value)){
+ this._voyageNumber = value;
+ internalClearRefs(PROP_ID_voyageNumber);
+
+ }
+ }
+
+}
+// resume CPD analysis - CPD-ON
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/resources/_vfs/demo/ddd/_module b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/resources/_vfs/demo/ddd/_module
new file mode 100644
index 000000000..e69de29bb
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/resources/_vfs/demo/ddd/beans/_dao.beans.xml b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/resources/_vfs/demo/ddd/beans/_dao.beans.xml
new file mode 100644
index 000000000..7a7508945
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/resources/_vfs/demo/ddd/beans/_dao.beans.xml
@@ -0,0 +1,5 @@
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/resources/_vfs/demo/ddd/orm/_app.orm.xml b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/resources/_vfs/demo/ddd/orm/_app.orm.xml
new file mode 100644
index 000000000..24409211c
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/resources/_vfs/demo/ddd/orm/_app.orm.xml
@@ -0,0 +1,294 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/resources/_vfs/demo/ddd/orm/app.orm.xml b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/resources/_vfs/demo/ddd/orm/app.orm.xml
new file mode 100644
index 000000000..61e029294
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-dao/src/main/resources/_vfs/demo/ddd/orm/app.orm.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_Cargo.json b/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_Cargo.json
new file mode 100644
index 000000000..2936243fa
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_Cargo.json
@@ -0,0 +1,28 @@
+{
+ "id": 0,
+ "calculatedAt": "2000-01-01 14:00:00",
+ "eta": "2000-01-01 14:00:00",
+ "unloadedAtDest": false,
+ "misdirected": false,
+ "nextExpectedHandlingEventType": "",
+ "routingStatus": "",
+ "transportStatus": "",
+ "specArrivalDeadline": "2000-01-01 14:00:00",
+ "trackingId": "",
+ "currentVoyageId": 0,
+ "lastEventId": 0,
+ "lastKnownLocationId": 0,
+ "nextExpectedLocationId": 0,
+ "nextExpectedVoyageId": 0,
+ "originId": 0,
+ "specDestinationId": 0,
+ "specOriginId": 0,
+ "nextExpectedVoyage": null,
+ "specDestination": null,
+ "origin": null,
+ "lastEvent": null,
+ "lastKnownLocation": null,
+ "currentVoyage": null,
+ "nextExpectedLocation": null,
+ "specOrigin": null
+}
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_CarrierMovement.json b/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_CarrierMovement.json
new file mode 100644
index 000000000..f120bd8c1
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_CarrierMovement.json
@@ -0,0 +1,11 @@
+{
+ "id": 0,
+ "arrivalTime": "2000-01-01 14:00:00",
+ "departureTime": "2000-01-01 14:00:00",
+ "arrivalLocationId": 0,
+ "departureLocationId": 0,
+ "voyageId": 0,
+ "voyage": null,
+ "departureLocation": null,
+ "arrivalLocation": null
+}
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_HandlingEvent.json b/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_HandlingEvent.json
new file mode 100644
index 000000000..63fdfeb03
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_HandlingEvent.json
@@ -0,0 +1,12 @@
+{
+ "id": 0,
+ "completionTime": "2000-01-01 14:00:00",
+ "registrationTime": "2000-01-01 14:00:00",
+ "type": "",
+ "cargoId": 0,
+ "locationId": 0,
+ "voyageId": 0,
+ "cargo": null,
+ "voyage": null,
+ "location": null
+}
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_Leg.json b/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_Leg.json
new file mode 100644
index 000000000..6da5c4cf8
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_Leg.json
@@ -0,0 +1,13 @@
+{
+ "id": 0,
+ "loadTime": "2000-01-01 14:00:00",
+ "unloadTime": "2000-01-01 14:00:00",
+ "loadLocationId": 0,
+ "unloadLocationId": 0,
+ "voyageId": 0,
+ "cargoId": 0,
+ "loadLocation": null,
+ "cargo": null,
+ "voyage": null,
+ "unloadLocation": null
+}
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_Location.json b/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_Location.json
new file mode 100644
index 000000000..5a3efbd01
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_Location.json
@@ -0,0 +1,5 @@
+{
+ "id": 0,
+ "name": "",
+ "unlocode": ""
+}
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_Voyage.json b/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_Voyage.json
new file mode 100644
index 000000000..c093f89b9
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/_templates/_Voyage.json
@@ -0,0 +1,4 @@
+{
+ "id": 0,
+ "voyageNumber": ""
+}
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/pom.xml b/nop-demo/nop-ddd-demo/demo-ddd-meta/pom.xml
new file mode 100644
index 000000000..4c9e8200d
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/pom.xml
@@ -0,0 +1,41 @@
+
+
+
+
+ demo-ddd
+ app.demo
+ 1.0.0-SNAPSHOT
+
+
+ 4.0.0
+
+ demo-ddd-meta
+
+
+
+ demo-ddd-codegen
+ app.demo
+ 1.0.0-SNAPSHOT
+ test
+
+
+ demo-ddd-dao
+ app.demo
+ 1.0.0-SNAPSHOT
+ test
+
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+
+ test
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/postcompile/gen-i18n.xgen b/nop-demo/nop-ddd-demo/demo-ddd-meta/postcompile/gen-i18n.xgen
new file mode 100644
index 000000000..c6b420ba8
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/postcompile/gen-i18n.xgen
@@ -0,0 +1,4 @@
+
+
+codeGenerator.withTplDir('/nop/templates/i18n').execute("/",{ moduleId: "demo/ddd" },$scope);
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/precompile/gen-meta.xgen b/nop-demo/nop-ddd-demo/demo-ddd-meta/precompile/gen-meta.xgen
new file mode 100644
index 000000000..2f01820d9
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/precompile/gen-meta.xgen
@@ -0,0 +1,4 @@
+
+
+codeGenerator.renderModel('/demo/ddd/orm/app.orm.xml','/nop/templates/meta', '/',$scope);
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/_module b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/_module
new file mode 100644
index 000000000..e69de29bb
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Cargo/Cargo.xmeta b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Cargo/Cargo.xmeta
new file mode 100644
index 000000000..7176525d2
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Cargo/Cargo.xmeta
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Cargo/_Cargo.xmeta b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Cargo/_Cargo.xmeta
new file mode 100644
index 000000000..ca8cddf67
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Cargo/_Cargo.xmeta
@@ -0,0 +1,138 @@
+
+
+
+ app.demo.ddd.entity.Cargo
+
+ id
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/CarrierMovement/CarrierMovement.xmeta b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/CarrierMovement/CarrierMovement.xmeta
new file mode 100644
index 000000000..96751609f
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/CarrierMovement/CarrierMovement.xmeta
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/CarrierMovement/_CarrierMovement.xmeta b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/CarrierMovement/_CarrierMovement.xmeta
new file mode 100644
index 000000000..1a7ec0412
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/CarrierMovement/_CarrierMovement.xmeta
@@ -0,0 +1,63 @@
+
+
+
+ app.demo.ddd.entity.CarrierMovement
+
+ id
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/HandlingEvent/HandlingEvent.xmeta b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/HandlingEvent/HandlingEvent.xmeta
new file mode 100644
index 000000000..d095ed231
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/HandlingEvent/HandlingEvent.xmeta
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/HandlingEvent/_HandlingEvent.xmeta b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/HandlingEvent/_HandlingEvent.xmeta
new file mode 100644
index 000000000..265883005
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/HandlingEvent/_HandlingEvent.xmeta
@@ -0,0 +1,65 @@
+
+
+
+ app.demo.ddd.entity.HandlingEvent
+
+ id
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Leg/Leg.xmeta b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Leg/Leg.xmeta
new file mode 100644
index 000000000..ee8e0a47e
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Leg/Leg.xmeta
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Leg/_Leg.xmeta b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Leg/_Leg.xmeta
new file mode 100644
index 000000000..418305e56
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Leg/_Leg.xmeta
@@ -0,0 +1,70 @@
+
+
+
+ app.demo.ddd.entity.Leg
+
+ id
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Location/Location.xmeta b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Location/Location.xmeta
new file mode 100644
index 000000000..5c61b09ef
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Location/Location.xmeta
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Location/_Location.xmeta b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Location/_Location.xmeta
new file mode 100644
index 000000000..b09079b26
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Location/_Location.xmeta
@@ -0,0 +1,36 @@
+
+
+
+ app.demo.ddd.entity.Location
+
+ id
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Voyage/Voyage.xmeta b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Voyage/Voyage.xmeta
new file mode 100644
index 000000000..65cefceda
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Voyage/Voyage.xmeta
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Voyage/_Voyage.xmeta b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Voyage/_Voyage.xmeta
new file mode 100644
index 000000000..e5e1a1892
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/demo/ddd/model/Voyage/_Voyage.xmeta
@@ -0,0 +1,32 @@
+
+
+
+ app.demo.ddd.entity.Voyage
+
+ id
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/dict/ddd/routing-status.dict.yaml b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/dict/ddd/routing-status.dict.yaml
new file mode 100644
index 000000000..6d43fa4aa
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/dict/ddd/routing-status.dict.yaml
@@ -0,0 +1,19 @@
+# __XGEN_FORCE_OVERRIDE__
+label: 路由状态
+locale: zh-CN
+valueType: string
+description:
+options:
+
+ - label: 未路由
+ value: NOT_ROUTED
+ description:
+
+ - label: 已路由
+ value: ROUTED
+ description:
+
+ - label: 错误路由
+ value: MISROUTED
+ description:
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/dict/ddd/transport-status.dict.yaml b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/dict/ddd/transport-status.dict.yaml
new file mode 100644
index 000000000..7f081c08a
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/dict/ddd/transport-status.dict.yaml
@@ -0,0 +1,27 @@
+# __XGEN_FORCE_OVERRIDE__
+label: 运输状态
+locale: zh-CN
+valueType: string
+description:
+options:
+
+ - label: 未接收
+ value: NOT_RECEIVED
+ description:
+
+ - label: 已到港
+ value: IN_PORT
+ description:
+
+ - label: 已装货
+ value: ONBOARD_CARRIER
+ description:
+
+ - label: 已认领
+ value: CLAIMED
+ description:
+
+ - label: 未知
+ value: UNKNOWN
+ description:
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/i18n/en/_demo-ddd.i18n.yaml b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/i18n/en/_demo-ddd.i18n.yaml
new file mode 100644
index 000000000..a5cd18f98
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/i18n/en/_demo-ddd.i18n.yaml
@@ -0,0 +1,77 @@
+entity:
+ label:
+ Cargo: Cargo
+ CarrierMovement: Carrier Movement
+ HandlingEvent: Handling Event
+ Leg: Leg
+ Location: Location
+ Voyage: Voyage
+prop:
+ label:
+ Cargo:
+ id: Id
+ calculatedAt: CalculatedAt
+ eta: Eta
+ unloadedAtDest: UnloadedAtDest
+ misdirected: Misdirected
+ nextExpectedHandlingEventType: NextExpectedHandlingEventType
+ routingStatus: RoutingStatus
+ transportStatus: TransportStatus
+ specArrivalDeadline: SpecArrivalDeadline
+ trackingId: TrackingId
+ currentVoyageId: CurrentVoyageId
+ lastEventId: LastEventId
+ lastKnownLocationId: LastKnownLocationId
+ nextExpectedLocationId: NextExpectedLocationId
+ nextExpectedVoyageId: NextExpectedVoyageId
+ originId: OriginId
+ specDestinationId: SpecDestinationId
+ specOriginId: SpecOriginId
+ nextExpectedVoyage: Next Expected Voyage
+ specDestination: Spec Destination
+ origin: Origin
+ lastEvent: Last Event
+ lastKnownLocation: Last Known Location
+ currentVoyage: Current Voyage
+ nextExpectedLocation: Next Expected Location
+ specOrigin: Spec Origin
+ CarrierMovement:
+ id: Id
+ arrivalTime: ArrivalTime
+ departureTime: DepartureTime
+ arrivalLocationId: ArrivalLocationId
+ departureLocationId: DepartureLocationId
+ voyageId: VoyageId
+ voyage: Voyage
+ departureLocation: Departure Location
+ arrivalLocation: Arrival Location
+ HandlingEvent:
+ id: Id
+ completionTime: CompletionTime
+ registrationTime: RegistrationTime
+ type: Type
+ cargoId: CargoId
+ locationId: LocationId
+ voyageId: VoyageId
+ cargo: Cargo
+ voyage: Voyage
+ location: Location
+ Leg:
+ id: Id
+ loadTime: LoadTime
+ unloadTime: UnloadTime
+ loadLocationId: LoadLocationId
+ unloadLocationId: UnloadLocationId
+ voyageId: VoyageId
+ cargoId: CargoId
+ loadLocation: Load Location
+ cargo: Cargo
+ voyage: Voyage
+ unloadLocation: Unload Location
+ Location:
+ id: Id
+ name: Name
+ unlocode: Unlocode
+ Voyage:
+ id: Id
+ voyageNumber: VoyageNumber
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/i18n/en/demo-ddd.i18n.yaml b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/i18n/en/demo-ddd.i18n.yaml
new file mode 100644
index 000000000..fc849ffca
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/i18n/en/demo-ddd.i18n.yaml
@@ -0,0 +1,4 @@
+
+"x:extends": _demo-ddd.i18n.yaml
+
+# key: "value"
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/i18n/zh-CN/_demo-ddd.i18n.yaml b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/i18n/zh-CN/_demo-ddd.i18n.yaml
new file mode 100644
index 000000000..2c5abc655
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/i18n/zh-CN/_demo-ddd.i18n.yaml
@@ -0,0 +1,77 @@
+entity:
+ label:
+ Cargo: 货物
+ CarrierMovement: 运输动作
+ HandlingEvent: 业务时间
+ Leg: 航段
+ Location: 位置
+ Voyage: 航程
+prop:
+ label:
+ Cargo:
+ calculatedAt: 计算时间
+ currentVoyage: 当前航程
+ currentVoyageId: 当前航程ID
+ eta: 预计到达时间
+ id: Id
+ lastEvent: 最后事件
+ lastEventId: 最后事件ID
+ lastKnownLocation: 最后已知位置
+ lastKnownLocationId: 最后已知位置ID
+ misdirected: 路线错误
+ nextExpectedHandlingEventType: 下一步预期处理事件类型
+ nextExpectedLocation: 下一个预期位置
+ nextExpectedLocationId: 下一个预期位置ID
+ nextExpectedVoyage: 下一个预期航程
+ nextExpectedVoyageId: 下一个预期航程ID
+ origin: 出发地
+ originId: 出发地ID
+ routingStatus: 路由状态
+ specArrivalDeadline: 指定到达期限
+ specDestination: 指定目的地
+ specDestinationId: 指定目的地ID
+ specOrigin: 指定出发地
+ specOriginId: 指定出发地ID
+ trackingId: 跟踪ID
+ transportStatus: 运输状态
+ unloadedAtDest: 目的地卸载时间
+ CarrierMovement:
+ arrivalLocation: 到达地点
+ arrivalLocationId: 到达地点ID
+ arrivalTime: 到达时间
+ departureLocation: 出发地点
+ departureLocationId: 出发地点ID
+ departureTime: 出发时间
+ id: Id
+ voyage: 航程
+ voyageId: 航程ID
+ HandlingEvent:
+ cargo: 货物
+ cargoId: 货物ID
+ completionTime: 完成时间
+ id: Id
+ location: 位置
+ locationId: 位置ID
+ registrationTime: 注册时间
+ type: 类型
+ voyage: 航程
+ voyageId: 航程ID
+ Leg:
+ cargo: 货物
+ cargoId: 货物ID
+ id: Id
+ loadLocation: 装货地点
+ loadLocationId: 装货地点
+ loadTime: 装货时间
+ unloadLocation: 卸载地点
+ unloadLocationId: 卸货地点
+ unloadTime: 卸货时间
+ voyage: 航程
+ voyageId: 航程ID
+ Location:
+ id: Id
+ name: 名称
+ unlocode: UN编码
+ Voyage:
+ id: Id
+ voyageNumber: 航程号
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/i18n/zh-CN/demo-ddd.i18n.yaml b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/i18n/zh-CN/demo-ddd.i18n.yaml
new file mode 100644
index 000000000..3dc208400
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-meta/src/main/resources/_vfs/i18n/zh-CN/demo-ddd.i18n.yaml
@@ -0,0 +1,3 @@
+
+"x:extends": _demo-ddd.i18n.yaml
+# key: "value"
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/pom.xml b/nop-demo/nop-ddd-demo/demo-ddd-service/pom.xml
new file mode 100644
index 000000000..4da274b2c
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/pom.xml
@@ -0,0 +1,87 @@
+
+
+
+
+ demo-ddd
+ app.demo
+ 1.0.0-SNAPSHOT
+
+
+ 4.0.0
+
+ demo-ddd-service
+
+
+
+ demo-ddd-dao
+ app.demo
+ 1.0.0-SNAPSHOT
+
+
+ demo-ddd-codegen
+ app.demo
+ 1.0.0-SNAPSHOT
+ test
+
+
+ demo-ddd-meta
+ app.demo
+ 1.0.0-SNAPSHOT
+
+
+ io.github.entropy-cloud
+ nop-biz
+
+
+ io.github.entropy-cloud
+ nop-file-core
+
+
+ io.github.entropy-cloud
+ nop-config
+
+
+ io.github.entropy-cloud
+ nop-ioc
+
+
+ io.github.entropy-cloud
+ nop-sys-dao
+
+
+ io.github.entropy-cloud
+ nop-autotest-junit
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-params
+ test
+
+
+ com.h2database
+ h2
+ test
+
+
+ com.mysql
+ mysql-connector-j
+ test
+
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/DemoDddConfigs.java b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/DemoDddConfigs.java
new file mode 100644
index 000000000..4680a3b8d
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/DemoDddConfigs.java
@@ -0,0 +1,5 @@
+package app.demo.service;
+
+public interface DemoDddConfigs{
+
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/DemoDddConstants.java b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/DemoDddConstants.java
new file mode 100644
index 000000000..ba644e488
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/DemoDddConstants.java
@@ -0,0 +1,5 @@
+package app.demo.service;
+
+public interface DemoDddConstants{
+
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/DemoDddErrors.java b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/DemoDddErrors.java
new file mode 100644
index 000000000..66e837033
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/DemoDddErrors.java
@@ -0,0 +1,5 @@
+package app.demo.service;
+
+public interface DemoDddErrors{
+
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/CargoBizModel.java b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/CargoBizModel.java
new file mode 100644
index 000000000..2b86e3365
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/CargoBizModel.java
@@ -0,0 +1,14 @@
+
+package app.demo.service.entity;
+
+import io.nop.api.core.annotations.biz.BizModel;
+import io.nop.biz.crud.CrudBizModel;
+
+import app.demo.ddd.entity.Cargo;
+
+@BizModel("Cargo")
+public class CargoBizModel extends CrudBizModel{
+ public CargoBizModel(){
+ setEntityName(Cargo.class.getName());
+ }
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/CarrierMovementBizModel.java b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/CarrierMovementBizModel.java
new file mode 100644
index 000000000..a075ca03c
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/CarrierMovementBizModel.java
@@ -0,0 +1,14 @@
+
+package app.demo.service.entity;
+
+import io.nop.api.core.annotations.biz.BizModel;
+import io.nop.biz.crud.CrudBizModel;
+
+import app.demo.ddd.entity.CarrierMovement;
+
+@BizModel("CarrierMovement")
+public class CarrierMovementBizModel extends CrudBizModel{
+ public CarrierMovementBizModel(){
+ setEntityName(CarrierMovement.class.getName());
+ }
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/HandlingEventBizModel.java b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/HandlingEventBizModel.java
new file mode 100644
index 000000000..e628ec5de
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/HandlingEventBizModel.java
@@ -0,0 +1,14 @@
+
+package app.demo.service.entity;
+
+import io.nop.api.core.annotations.biz.BizModel;
+import io.nop.biz.crud.CrudBizModel;
+
+import app.demo.ddd.entity.HandlingEvent;
+
+@BizModel("HandlingEvent")
+public class HandlingEventBizModel extends CrudBizModel{
+ public HandlingEventBizModel(){
+ setEntityName(HandlingEvent.class.getName());
+ }
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/LegBizModel.java b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/LegBizModel.java
new file mode 100644
index 000000000..9506d0e5c
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/LegBizModel.java
@@ -0,0 +1,14 @@
+
+package app.demo.service.entity;
+
+import io.nop.api.core.annotations.biz.BizModel;
+import io.nop.biz.crud.CrudBizModel;
+
+import app.demo.ddd.entity.Leg;
+
+@BizModel("Leg")
+public class LegBizModel extends CrudBizModel{
+ public LegBizModel(){
+ setEntityName(Leg.class.getName());
+ }
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/LocationBizModel.java b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/LocationBizModel.java
new file mode 100644
index 000000000..50cf33560
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/LocationBizModel.java
@@ -0,0 +1,14 @@
+
+package app.demo.service.entity;
+
+import io.nop.api.core.annotations.biz.BizModel;
+import io.nop.biz.crud.CrudBizModel;
+
+import app.demo.ddd.entity.Location;
+
+@BizModel("Location")
+public class LocationBizModel extends CrudBizModel{
+ public LocationBizModel(){
+ setEntityName(Location.class.getName());
+ }
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/VoyageBizModel.java b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/VoyageBizModel.java
new file mode 100644
index 000000000..6dc3ffe48
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/java/app/demo/service/entity/VoyageBizModel.java
@@ -0,0 +1,14 @@
+
+package app.demo.service.entity;
+
+import io.nop.api.core.annotations.biz.BizModel;
+import io.nop.biz.crud.CrudBizModel;
+
+import app.demo.ddd.entity.Voyage;
+
+@BizModel("Voyage")
+public class VoyageBizModel extends CrudBizModel{
+ public VoyageBizModel(){
+ setEntityName(Voyage.class.getName());
+ }
+}
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/_module b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/_module
new file mode 100644
index 000000000..e69de29bb
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/auth/demo-ddd.data-auth.xml b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/auth/demo-ddd.data-auth.xml
new file mode 100644
index 000000000..c8c2f1665
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/auth/demo-ddd.data-auth.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/beans/_service.beans.xml b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/beans/_service.beans.xml
new file mode 100644
index 000000000..ab4e49da5
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/beans/_service.beans.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/beans/app-service.beans.xml b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/beans/app-service.beans.xml
new file mode 100644
index 000000000..3b62d42ad
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/beans/app-service.beans.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Cargo/Cargo.xbiz b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Cargo/Cargo.xbiz
new file mode 100644
index 000000000..a67ed5548
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Cargo/Cargo.xbiz
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Cargo/_Cargo.xbiz b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Cargo/_Cargo.xbiz
new file mode 100644
index 000000000..e3e479061
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Cargo/_Cargo.xbiz
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/CarrierMovement/CarrierMovement.xbiz b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/CarrierMovement/CarrierMovement.xbiz
new file mode 100644
index 000000000..3b0a62539
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/CarrierMovement/CarrierMovement.xbiz
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/CarrierMovement/_CarrierMovement.xbiz b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/CarrierMovement/_CarrierMovement.xbiz
new file mode 100644
index 000000000..5512ff3a7
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/CarrierMovement/_CarrierMovement.xbiz
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/HandlingEvent/HandlingEvent.xbiz b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/HandlingEvent/HandlingEvent.xbiz
new file mode 100644
index 000000000..7ff531cec
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/HandlingEvent/HandlingEvent.xbiz
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/HandlingEvent/_HandlingEvent.xbiz b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/HandlingEvent/_HandlingEvent.xbiz
new file mode 100644
index 000000000..9d0ccce75
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/HandlingEvent/_HandlingEvent.xbiz
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Leg/Leg.xbiz b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Leg/Leg.xbiz
new file mode 100644
index 000000000..b5f8d4ae2
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Leg/Leg.xbiz
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Leg/_Leg.xbiz b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Leg/_Leg.xbiz
new file mode 100644
index 000000000..27aacf745
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Leg/_Leg.xbiz
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Location/Location.xbiz b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Location/Location.xbiz
new file mode 100644
index 000000000..137c8a124
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Location/Location.xbiz
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Location/_Location.xbiz b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Location/_Location.xbiz
new file mode 100644
index 000000000..188639116
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Location/_Location.xbiz
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Voyage/Voyage.xbiz b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Voyage/Voyage.xbiz
new file mode 100644
index 000000000..b75ed4df0
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Voyage/Voyage.xbiz
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Voyage/_Voyage.xbiz b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Voyage/_Voyage.xbiz
new file mode 100644
index 000000000..eb8df651e
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-service/src/main/resources/_vfs/demo/ddd/model/Voyage/_Voyage.xbiz
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/pom.xml b/nop-demo/nop-ddd-demo/demo-ddd-web/pom.xml
new file mode 100644
index 000000000..ed2751bed
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/pom.xml
@@ -0,0 +1,70 @@
+
+
+
+
+ demo-ddd
+ app.demo
+ 1.0.0-SNAPSHOT
+
+
+ 4.0.0
+
+ demo-ddd-web
+
+
+
+ demo-ddd-meta
+ app.demo
+ 1.0.0-SNAPSHOT
+
+
+ demo-ddd-codegen
+ app.demo
+ 1.0.0-SNAPSHOT
+ test
+
+
+ demo-ddd-service
+ app.demo
+ 1.0.0-SNAPSHOT
+ test
+
+
+ io.github.entropy-cloud
+ nop-web
+
+
+ io.github.entropy-cloud
+ nop-ooxml-xlsx
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter
+ test
+
+
+ io.github.entropy-cloud
+ nop-autotest-junit
+ test
+
+
+ io.github.entropy-cloud
+ nop-xlang-debugger
+ test
+
+
+
+
+
+
+ org.codehaus.mojo
+ exec-maven-plugin
+
+ test
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/precompile/gen-page.xgen b/nop-demo/nop-ddd-demo/demo-ddd-web/precompile/gen-page.xgen
new file mode 100644
index 000000000..0a3ac647f
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/precompile/gen-page.xgen
@@ -0,0 +1,5 @@
+
+
+// 根据xmeta生成页面文件view.xml/page.yaml
+codeGenerator.withTplDir('/nop/templates/orm-web').execute("/",{ moduleId: "demo/ddd" },$scope);
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/_module b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/_module
new file mode 100644
index 000000000..e69de29bb
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/auth/_demo-ddd.action-auth.xml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/auth/_demo-ddd.action-auth.xml
new file mode 100644
index 000000000..3321a3ec9
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/auth/_demo-ddd.action-auth.xml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+ Cargo:query
+
+
+ Cargo:mutation
+
+
+
+
+
+
+ CarrierMovement:query
+
+
+ CarrierMovement:mutation
+
+
+
+
+
+
+ HandlingEvent:query
+
+
+ HandlingEvent:mutation
+
+
+
+
+
+
+ Leg:query
+
+
+ Leg:mutation
+
+
+
+
+
+
+ Location:query
+
+
+ Location:mutation
+
+
+
+
+
+
+ Voyage:query
+
+
+ Voyage:mutation
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/auth/demo-ddd.action-auth.xml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/auth/demo-ddd.action-auth.xml
new file mode 100644
index 000000000..7370bd66c
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/auth/demo-ddd.action-auth.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Cargo/Cargo.lib.xjs b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Cargo/Cargo.lib.xjs
new file mode 100644
index 000000000..6bb977c92
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Cargo/Cargo.lib.xjs
@@ -0,0 +1,10 @@
+// x:gen-extends用于动态生成代码
+/* @x:gen-extends:
+*/
+
+/*
+// @action:name 触发这里的函数,options为ajax请求参数
+export function myAction(options, page,scoped){
+ return page.env.fetcher(options)
+}
+*/
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Cargo/Cargo.view.xml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Cargo/Cargo.view.xml
new file mode 100644
index 000000000..44c2f5665
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Cargo/Cargo.view.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Cargo/_gen/_Cargo.view.xml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Cargo/_gen/_Cargo.view.xml
new file mode 100644
index 000000000..48b7e88ef
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Cargo/_gen/_Cargo.view.xml
@@ -0,0 +1,169 @@
+
+
+
+ /demo/ddd/model/Cargo/Cargo.xmeta
+
+ /nop/web/xlib/control.xlib
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @i18n:common.confirmBatchDelete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @i18n:common.confirmDelete
+
+
+
+
+
+
+
+ @i18n:common.confirmDelete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Cargo/main.page.yaml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Cargo/main.page.yaml
new file mode 100644
index 000000000..1bfd0690f
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Cargo/main.page.yaml
@@ -0,0 +1,3 @@
+
+x:gen-extends: |
+
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Cargo/picker.page.yaml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Cargo/picker.page.yaml
new file mode 100644
index 000000000..76e1a86ae
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Cargo/picker.page.yaml
@@ -0,0 +1,3 @@
+
+x:gen-extends: |
+
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/CarrierMovement/CarrierMovement.lib.xjs b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/CarrierMovement/CarrierMovement.lib.xjs
new file mode 100644
index 000000000..6bb977c92
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/CarrierMovement/CarrierMovement.lib.xjs
@@ -0,0 +1,10 @@
+// x:gen-extends用于动态生成代码
+/* @x:gen-extends:
+*/
+
+/*
+// @action:name 触发这里的函数,options为ajax请求参数
+export function myAction(options, page,scoped){
+ return page.env.fetcher(options)
+}
+*/
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/CarrierMovement/CarrierMovement.view.xml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/CarrierMovement/CarrierMovement.view.xml
new file mode 100644
index 000000000..0fef43039
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/CarrierMovement/CarrierMovement.view.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/CarrierMovement/_gen/_CarrierMovement.view.xml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/CarrierMovement/_gen/_CarrierMovement.view.xml
new file mode 100644
index 000000000..45bc11e84
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/CarrierMovement/_gen/_CarrierMovement.view.xml
@@ -0,0 +1,127 @@
+
+
+
+ /demo/ddd/model/CarrierMovement/CarrierMovement.xmeta
+
+ /nop/web/xlib/control.xlib
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @i18n:common.confirmBatchDelete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @i18n:common.confirmDelete
+
+
+
+
+
+
+
+ @i18n:common.confirmDelete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/CarrierMovement/main.page.yaml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/CarrierMovement/main.page.yaml
new file mode 100644
index 000000000..7e69a5388
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/CarrierMovement/main.page.yaml
@@ -0,0 +1,3 @@
+
+x:gen-extends: |
+
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/CarrierMovement/picker.page.yaml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/CarrierMovement/picker.page.yaml
new file mode 100644
index 000000000..4093113b1
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/CarrierMovement/picker.page.yaml
@@ -0,0 +1,3 @@
+
+x:gen-extends: |
+
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/HandlingEvent/HandlingEvent.lib.xjs b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/HandlingEvent/HandlingEvent.lib.xjs
new file mode 100644
index 000000000..6bb977c92
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/HandlingEvent/HandlingEvent.lib.xjs
@@ -0,0 +1,10 @@
+// x:gen-extends用于动态生成代码
+/* @x:gen-extends:
+*/
+
+/*
+// @action:name 触发这里的函数,options为ajax请求参数
+export function myAction(options, page,scoped){
+ return page.env.fetcher(options)
+}
+*/
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/HandlingEvent/HandlingEvent.view.xml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/HandlingEvent/HandlingEvent.view.xml
new file mode 100644
index 000000000..926473283
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/HandlingEvent/HandlingEvent.view.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/HandlingEvent/_gen/_HandlingEvent.view.xml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/HandlingEvent/_gen/_HandlingEvent.view.xml
new file mode 100644
index 000000000..9da89f4fd
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/HandlingEvent/_gen/_HandlingEvent.view.xml
@@ -0,0 +1,132 @@
+
+
+
+ /demo/ddd/model/HandlingEvent/HandlingEvent.xmeta
+
+ /nop/web/xlib/control.xlib
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @i18n:common.confirmBatchDelete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @i18n:common.confirmDelete
+
+
+
+
+
+
+
+ @i18n:common.confirmDelete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/HandlingEvent/main.page.yaml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/HandlingEvent/main.page.yaml
new file mode 100644
index 000000000..b90854668
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/HandlingEvent/main.page.yaml
@@ -0,0 +1,3 @@
+
+x:gen-extends: |
+
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/HandlingEvent/picker.page.yaml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/HandlingEvent/picker.page.yaml
new file mode 100644
index 000000000..2128c6ec1
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/HandlingEvent/picker.page.yaml
@@ -0,0 +1,3 @@
+
+x:gen-extends: |
+
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Leg/Leg.lib.xjs b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Leg/Leg.lib.xjs
new file mode 100644
index 000000000..6bb977c92
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Leg/Leg.lib.xjs
@@ -0,0 +1,10 @@
+// x:gen-extends用于动态生成代码
+/* @x:gen-extends:
+*/
+
+/*
+// @action:name 触发这里的函数,options为ajax请求参数
+export function myAction(options, page,scoped){
+ return page.env.fetcher(options)
+}
+*/
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Leg/Leg.view.xml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Leg/Leg.view.xml
new file mode 100644
index 000000000..b31c039b5
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Leg/Leg.view.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Leg/_gen/_Leg.view.xml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Leg/_gen/_Leg.view.xml
new file mode 100644
index 000000000..ed395cac7
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Leg/_gen/_Leg.view.xml
@@ -0,0 +1,132 @@
+
+
+
+ /demo/ddd/model/Leg/Leg.xmeta
+
+ /nop/web/xlib/control.xlib
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @i18n:common.confirmBatchDelete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @i18n:common.confirmDelete
+
+
+
+
+
+
+
+ @i18n:common.confirmDelete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Leg/main.page.yaml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Leg/main.page.yaml
new file mode 100644
index 000000000..7f9165d2a
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Leg/main.page.yaml
@@ -0,0 +1,3 @@
+
+x:gen-extends: |
+
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Leg/picker.page.yaml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Leg/picker.page.yaml
new file mode 100644
index 000000000..6bfbe76ca
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Leg/picker.page.yaml
@@ -0,0 +1,3 @@
+
+x:gen-extends: |
+
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Location/Location.lib.xjs b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Location/Location.lib.xjs
new file mode 100644
index 000000000..6bb977c92
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Location/Location.lib.xjs
@@ -0,0 +1,10 @@
+// x:gen-extends用于动态生成代码
+/* @x:gen-extends:
+*/
+
+/*
+// @action:name 触发这里的函数,options为ajax请求参数
+export function myAction(options, page,scoped){
+ return page.env.fetcher(options)
+}
+*/
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Location/Location.view.xml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Location/Location.view.xml
new file mode 100644
index 000000000..7ff42ed6a
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Location/Location.view.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Location/_gen/_Location.view.xml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Location/_gen/_Location.view.xml
new file mode 100644
index 000000000..cc45afe0f
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Location/_gen/_Location.view.xml
@@ -0,0 +1,112 @@
+
+
+
+ /demo/ddd/model/Location/Location.xmeta
+
+ /nop/web/xlib/control.xlib
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @i18n:common.confirmBatchDelete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @i18n:common.confirmDelete
+
+
+
+
+
+
+
+ @i18n:common.confirmDelete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Location/main.page.yaml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Location/main.page.yaml
new file mode 100644
index 000000000..73c61fc29
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Location/main.page.yaml
@@ -0,0 +1,3 @@
+
+x:gen-extends: |
+
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Location/picker.page.yaml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Location/picker.page.yaml
new file mode 100644
index 000000000..58cb869f9
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Location/picker.page.yaml
@@ -0,0 +1,3 @@
+
+x:gen-extends: |
+
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Voyage/Voyage.lib.xjs b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Voyage/Voyage.lib.xjs
new file mode 100644
index 000000000..6bb977c92
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Voyage/Voyage.lib.xjs
@@ -0,0 +1,10 @@
+// x:gen-extends用于动态生成代码
+/* @x:gen-extends:
+*/
+
+/*
+// @action:name 触发这里的函数,options为ajax请求参数
+export function myAction(options, page,scoped){
+ return page.env.fetcher(options)
+}
+*/
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Voyage/Voyage.view.xml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Voyage/Voyage.view.xml
new file mode 100644
index 000000000..bcd66cdf4
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Voyage/Voyage.view.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Voyage/_gen/_Voyage.view.xml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Voyage/_gen/_Voyage.view.xml
new file mode 100644
index 000000000..58684b790
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Voyage/_gen/_Voyage.view.xml
@@ -0,0 +1,107 @@
+
+
+
+ /demo/ddd/model/Voyage/Voyage.xmeta
+
+ /nop/web/xlib/control.xlib
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @i18n:common.confirmBatchDelete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @i18n:common.confirmDelete
+
+
+
+
+
+
+
+ @i18n:common.confirmDelete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Voyage/main.page.yaml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Voyage/main.page.yaml
new file mode 100644
index 000000000..501c14b02
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Voyage/main.page.yaml
@@ -0,0 +1,3 @@
+
+x:gen-extends: |
+
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Voyage/picker.page.yaml b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Voyage/picker.page.yaml
new file mode 100644
index 000000000..6996845c8
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/main/resources/_vfs/demo/ddd/pages/Voyage/picker.page.yaml
@@ -0,0 +1,3 @@
+
+x:gen-extends: |
+
diff --git a/nop-demo/nop-ddd-demo/demo-ddd-web/src/test/java/app/demo/web/DemoDddWebCodeGen.java b/nop-demo/nop-ddd-demo/demo-ddd-web/src/test/java/app/demo/web/DemoDddWebCodeGen.java
new file mode 100644
index 000000000..7df719d74
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/demo-ddd-web/src/test/java/app/demo/web/DemoDddWebCodeGen.java
@@ -0,0 +1,29 @@
+
+package app.demo.web;
+
+import io.nop.api.core.config.AppConfig;
+import io.nop.codegen.XCodeGenerator;
+import io.nop.commons.util.MavenDirHelper;
+import io.nop.core.CoreConfigs;
+import io.nop.core.CoreConstants;
+import io.nop.core.initialize.CoreInitialization;
+
+import java.io.File;
+
+public class DemoDddWebCodeGen {
+ public static void main(String[] args) {
+ AppConfig.getConfigProvider().updateConfigValue(CoreConfigs.CFG_CORE_MAX_INITIALIZE_LEVEL,
+ CoreConstants.INITIALIZER_PRIORITY_ANALYZE);
+
+ CoreInitialization.initialize();
+ try {
+ File projectDir = MavenDirHelper.projectDir(DemoDddWebCodeGen.class);
+ XCodeGenerator.runPostcompile(new File(projectDir, "../demo-ddd-codegen"), "/", false);
+ XCodeGenerator.runPrecompile(new File(projectDir, "../demo-ddd-meta"), "/", false);
+ XCodeGenerator.runPostcompile(new File(projectDir, "../demo-ddd-meta"), "/", false);
+ XCodeGenerator.runPrecompile(projectDir, "/", false);
+ } finally {
+ CoreInitialization.destroy();
+ }
+ }
+}
diff --git a/nop-demo/nop-ddd-demo/deploy/sql/mysql/_add_tenant_demo-ddd.sql b/nop-demo/nop-ddd-demo/deploy/sql/mysql/_add_tenant_demo-ddd.sql
new file mode 100644
index 000000000..f2fbcd2b5
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/deploy/sql/mysql/_add_tenant_demo-ddd.sql
@@ -0,0 +1,32 @@
+
+ alter table cargo add NOP_TENANT_ID VARCHAR(32) DEFAULT '0' NOT NULL;
+
+alter table carrier_movement add NOP_TENANT_ID VARCHAR(32) DEFAULT '0' NOT NULL;
+
+alter table handling_event add NOP_TENANT_ID VARCHAR(32) DEFAULT '0' NOT NULL;
+
+alter table leg add NOP_TENANT_ID VARCHAR(32) DEFAULT '0' NOT NULL;
+
+alter table location add NOP_TENANT_ID VARCHAR(32) DEFAULT '0' NOT NULL;
+
+alter table voyage add NOP_TENANT_ID VARCHAR(32) DEFAULT '0' NOT NULL;
+
+alter table cargo drop primary key;
+alter table cargo add primary key (NOP_TENANT_ID, ID);
+
+alter table carrier_movement drop primary key;
+alter table carrier_movement add primary key (NOP_TENANT_ID, ID);
+
+alter table handling_event drop primary key;
+alter table handling_event add primary key (NOP_TENANT_ID, ID);
+
+alter table leg drop primary key;
+alter table leg add primary key (NOP_TENANT_ID, ID);
+
+alter table location drop primary key;
+alter table location add primary key (NOP_TENANT_ID, ID);
+
+alter table voyage drop primary key;
+alter table voyage add primary key (NOP_TENANT_ID, ID);
+
+
diff --git a/nop-demo/nop-ddd-demo/deploy/sql/mysql/_create_demo-ddd.sql b/nop-demo/nop-ddd-demo/deploy/sql/mysql/_create_demo-ddd.sql
new file mode 100644
index 000000000..97181810e
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/deploy/sql/mysql/_create_demo-ddd.sql
@@ -0,0 +1,81 @@
+
+CREATE TABLE voyage(
+ ID BIGINT NOT NULL COMMENT 'Id',
+ VOYAGE_NUMBER VARCHAR(255) NULL COMMENT '航程号',
+ constraint PK_voyage primary key (ID)
+);
+
+CREATE TABLE location(
+ ID BIGINT NOT NULL COMMENT 'Id',
+ NAME VARCHAR(255) NOT NULL COMMENT '名称',
+ UNLOCODE VARCHAR(255) NOT NULL COMMENT 'UN编码',
+ constraint PK_location primary key (ID)
+);
+
+CREATE TABLE cargo(
+ ID BIGINT NOT NULL COMMENT 'Id',
+ CALCULATED_AT DATETIME NULL COMMENT '计算时间',
+ ETA DATETIME NULL COMMENT '预计到达时间',
+ UNLOADED_AT_DEST BOOLEAN NULL COMMENT '目的地卸载时间',
+ MISDIRECTED BOOLEAN NULL COMMENT '路线错误',
+ NEXT_EXPECTED_HANDLING_EVENT_TYPE VARCHAR(255) NULL COMMENT '下一步预期处理事件类型',
+ ROUTING_STATUS VARCHAR(255) NULL COMMENT '路由状态',
+ TRANSPORT_STATUS VARCHAR(255) NULL COMMENT '运输状态',
+ SPEC_ARRIVAL_DEADLINE DATETIME NOT NULL COMMENT '指定到达期限',
+ TRACKING_ID VARCHAR(255) NULL COMMENT '跟踪ID',
+ CURRENT_VOYAGE_ID BIGINT NULL COMMENT '当前航程ID',
+ LAST_EVENT_ID BIGINT NULL COMMENT '最后事件ID',
+ LAST_KNOWN_LOCATION_ID BIGINT NULL COMMENT '最后已知位置ID',
+ NEXT_EXPECTED_LOCATION_ID BIGINT NULL COMMENT '下一个预期位置ID',
+ NEXT_EXPECTED_VOYAGE_ID BIGINT NULL COMMENT '下一个预期航程ID',
+ ORIGIN_ID BIGINT NULL COMMENT '出发地ID',
+ SPEC_DESTINATION_ID BIGINT NULL COMMENT '指定目的地ID',
+ SPEC_ORIGIN_ID BIGINT NULL COMMENT '指定出发地ID',
+ constraint PK_cargo primary key (ID)
+);
+
+CREATE TABLE carrier_movement(
+ ID BIGINT NOT NULL COMMENT 'Id',
+ ARRIVAL_TIME DATETIME NOT NULL COMMENT '到达时间',
+ DEPARTURE_TIME DATETIME NOT NULL COMMENT '出发时间',
+ ARRIVAL_LOCATION_ID BIGINT NOT NULL COMMENT '到达地点ID',
+ DEPARTURE_LOCATION_ID BIGINT NOT NULL COMMENT '出发地点ID',
+ VOYAGE_ID BIGINT NULL COMMENT '航程ID',
+ constraint PK_carrier_movement primary key (ID)
+);
+
+CREATE TABLE handling_event(
+ ID BIGINT NOT NULL COMMENT 'Id',
+ COMPLETION_TIME DATETIME NULL COMMENT '完成时间',
+ REGISTRATION_TIME DATETIME NULL COMMENT '注册时间',
+ TYPE VARCHAR(255) NULL COMMENT '类型',
+ CARGO_ID BIGINT NULL COMMENT '货物ID',
+ LOCATION_ID BIGINT NULL COMMENT '位置ID',
+ VOYAGE_ID BIGINT NULL COMMENT '航程ID',
+ constraint PK_handling_event primary key (ID)
+);
+
+CREATE TABLE leg(
+ ID BIGINT NOT NULL COMMENT 'Id',
+ LOAD_TIME DATETIME NULL COMMENT '装货时间',
+ UNLOAD_TIME DATETIME NULL COMMENT '卸货时间',
+ LOAD_LOCATION_ID BIGINT NULL COMMENT '装货地点',
+ UNLOAD_LOCATION_ID BIGINT NULL COMMENT '卸货地点',
+ VOYAGE_ID BIGINT NULL COMMENT '航程ID',
+ CARGO_ID BIGINT NULL COMMENT '货物ID',
+ constraint PK_leg primary key (ID)
+);
+
+
+ ALTER TABLE voyage COMMENT '航程';
+
+ ALTER TABLE location COMMENT '位置';
+
+ ALTER TABLE cargo COMMENT '货物';
+
+ ALTER TABLE carrier_movement COMMENT '运输动作';
+
+ ALTER TABLE handling_event COMMENT '业务时间';
+
+ ALTER TABLE leg COMMENT '航段';
+
diff --git a/nop-demo/nop-ddd-demo/deploy/sql/mysql/_drop_demo-ddd.sql b/nop-demo/nop-ddd-demo/deploy/sql/mysql/_drop_demo-ddd.sql
new file mode 100644
index 000000000..1aae49944
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/deploy/sql/mysql/_drop_demo-ddd.sql
@@ -0,0 +1,8 @@
+
+drop table if exists voyage;
+drop table if exists location;
+drop table if exists cargo;
+drop table if exists carrier_movement;
+drop table if exists handling_event;
+drop table if exists leg;
+
diff --git a/nop-demo/nop-ddd-demo/deploy/sql/oracle/_add_tenant_demo-ddd.sql b/nop-demo/nop-ddd-demo/deploy/sql/oracle/_add_tenant_demo-ddd.sql
new file mode 100644
index 000000000..f945623c9
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/deploy/sql/oracle/_add_tenant_demo-ddd.sql
@@ -0,0 +1,32 @@
+
+ alter table cargo add NOP_TENANT_ID VARCHAR2(32) DEFAULT '0' NOT NULL;
+
+alter table carrier_movement add NOP_TENANT_ID VARCHAR2(32) DEFAULT '0' NOT NULL;
+
+alter table handling_event add NOP_TENANT_ID VARCHAR2(32) DEFAULT '0' NOT NULL;
+
+alter table leg add NOP_TENANT_ID VARCHAR2(32) DEFAULT '0' NOT NULL;
+
+alter table location add NOP_TENANT_ID VARCHAR2(32) DEFAULT '0' NOT NULL;
+
+alter table voyage add NOP_TENANT_ID VARCHAR2(32) DEFAULT '0' NOT NULL;
+
+alter table cargo drop constraint PK_cargo;
+alter table cargo add constraint PK_cargo primary key (NOP_TENANT_ID, ID);
+
+alter table carrier_movement drop constraint PK_carrier_movement;
+alter table carrier_movement add constraint PK_carrier_movement primary key (NOP_TENANT_ID, ID);
+
+alter table handling_event drop constraint PK_handling_event;
+alter table handling_event add constraint PK_handling_event primary key (NOP_TENANT_ID, ID);
+
+alter table leg drop constraint PK_leg;
+alter table leg add constraint PK_leg primary key (NOP_TENANT_ID, ID);
+
+alter table location drop constraint PK_location;
+alter table location add constraint PK_location primary key (NOP_TENANT_ID, ID);
+
+alter table voyage drop constraint PK_voyage;
+alter table voyage add constraint PK_voyage primary key (NOP_TENANT_ID, ID);
+
+
diff --git a/nop-demo/nop-ddd-demo/deploy/sql/oracle/_create_demo-ddd.sql b/nop-demo/nop-ddd-demo/deploy/sql/oracle/_create_demo-ddd.sql
new file mode 100644
index 000000000..319ff641e
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/deploy/sql/oracle/_create_demo-ddd.sql
@@ -0,0 +1,167 @@
+
+CREATE TABLE voyage(
+ ID NUMBER(20) NOT NULL ,
+ VOYAGE_NUMBER VARCHAR2(255) ,
+ constraint PK_voyage primary key (ID)
+);
+
+CREATE TABLE location(
+ ID NUMBER(20) NOT NULL ,
+ NAME VARCHAR2(255) NOT NULL ,
+ UNLOCODE VARCHAR2(255) NOT NULL ,
+ constraint PK_location primary key (ID)
+);
+
+CREATE TABLE cargo(
+ ID NUMBER(20) NOT NULL ,
+ CALCULATED_AT DATE ,
+ ETA DATE ,
+ UNLOADED_AT_DEST CHAR(1) ,
+ MISDIRECTED CHAR(1) ,
+ NEXT_EXPECTED_HANDLING_EVENT_TYPE VARCHAR2(255) ,
+ ROUTING_STATUS VARCHAR2(255) ,
+ TRANSPORT_STATUS VARCHAR2(255) ,
+ SPEC_ARRIVAL_DEADLINE DATE NOT NULL ,
+ TRACKING_ID VARCHAR2(255) ,
+ CURRENT_VOYAGE_ID NUMBER(20) ,
+ LAST_EVENT_ID NUMBER(20) ,
+ LAST_KNOWN_LOCATION_ID NUMBER(20) ,
+ NEXT_EXPECTED_LOCATION_ID NUMBER(20) ,
+ NEXT_EXPECTED_VOYAGE_ID NUMBER(20) ,
+ ORIGIN_ID NUMBER(20) ,
+ SPEC_DESTINATION_ID NUMBER(20) ,
+ SPEC_ORIGIN_ID NUMBER(20) ,
+ constraint PK_cargo primary key (ID)
+);
+
+CREATE TABLE carrier_movement(
+ ID NUMBER(20) NOT NULL ,
+ ARRIVAL_TIME DATE NOT NULL ,
+ DEPARTURE_TIME DATE NOT NULL ,
+ ARRIVAL_LOCATION_ID NUMBER(20) NOT NULL ,
+ DEPARTURE_LOCATION_ID NUMBER(20) NOT NULL ,
+ VOYAGE_ID NUMBER(20) ,
+ constraint PK_carrier_movement primary key (ID)
+);
+
+CREATE TABLE handling_event(
+ ID NUMBER(20) NOT NULL ,
+ COMPLETION_TIME DATE ,
+ REGISTRATION_TIME DATE ,
+ TYPE VARCHAR2(255) ,
+ CARGO_ID NUMBER(20) ,
+ LOCATION_ID NUMBER(20) ,
+ VOYAGE_ID NUMBER(20) ,
+ constraint PK_handling_event primary key (ID)
+);
+
+CREATE TABLE leg(
+ ID NUMBER(20) NOT NULL ,
+ LOAD_TIME DATE ,
+ UNLOAD_TIME DATE ,
+ LOAD_LOCATION_ID NUMBER(20) ,
+ UNLOAD_LOCATION_ID NUMBER(20) ,
+ VOYAGE_ID NUMBER(20) ,
+ CARGO_ID NUMBER(20) ,
+ constraint PK_leg primary key (ID)
+);
+
+
+ COMMENT ON TABLE voyage IS '航程';
+
+ COMMENT ON COLUMN voyage.ID IS 'Id';
+
+ COMMENT ON COLUMN voyage.VOYAGE_NUMBER IS '航程号';
+
+ COMMENT ON TABLE location IS '位置';
+
+ COMMENT ON COLUMN location.ID IS 'Id';
+
+ COMMENT ON COLUMN location.NAME IS '名称';
+
+ COMMENT ON COLUMN location.UNLOCODE IS 'UN编码';
+
+ COMMENT ON TABLE cargo IS '货物';
+
+ COMMENT ON COLUMN cargo.ID IS 'Id';
+
+ COMMENT ON COLUMN cargo.CALCULATED_AT IS '计算时间';
+
+ COMMENT ON COLUMN cargo.ETA IS '预计到达时间';
+
+ COMMENT ON COLUMN cargo.UNLOADED_AT_DEST IS '目的地卸载时间';
+
+ COMMENT ON COLUMN cargo.MISDIRECTED IS '路线错误';
+
+ COMMENT ON COLUMN cargo.NEXT_EXPECTED_HANDLING_EVENT_TYPE IS '下一步预期处理事件类型';
+
+ COMMENT ON COLUMN cargo.ROUTING_STATUS IS '路由状态';
+
+ COMMENT ON COLUMN cargo.TRANSPORT_STATUS IS '运输状态';
+
+ COMMENT ON COLUMN cargo.SPEC_ARRIVAL_DEADLINE IS '指定到达期限';
+
+ COMMENT ON COLUMN cargo.TRACKING_ID IS '跟踪ID';
+
+ COMMENT ON COLUMN cargo.CURRENT_VOYAGE_ID IS '当前航程ID';
+
+ COMMENT ON COLUMN cargo.LAST_EVENT_ID IS '最后事件ID';
+
+ COMMENT ON COLUMN cargo.LAST_KNOWN_LOCATION_ID IS '最后已知位置ID';
+
+ COMMENT ON COLUMN cargo.NEXT_EXPECTED_LOCATION_ID IS '下一个预期位置ID';
+
+ COMMENT ON COLUMN cargo.NEXT_EXPECTED_VOYAGE_ID IS '下一个预期航程ID';
+
+ COMMENT ON COLUMN cargo.ORIGIN_ID IS '出发地ID';
+
+ COMMENT ON COLUMN cargo.SPEC_DESTINATION_ID IS '指定目的地ID';
+
+ COMMENT ON COLUMN cargo.SPEC_ORIGIN_ID IS '指定出发地ID';
+
+ COMMENT ON TABLE carrier_movement IS '运输动作';
+
+ COMMENT ON COLUMN carrier_movement.ID IS 'Id';
+
+ COMMENT ON COLUMN carrier_movement.ARRIVAL_TIME IS '到达时间';
+
+ COMMENT ON COLUMN carrier_movement.DEPARTURE_TIME IS '出发时间';
+
+ COMMENT ON COLUMN carrier_movement.ARRIVAL_LOCATION_ID IS '到达地点ID';
+
+ COMMENT ON COLUMN carrier_movement.DEPARTURE_LOCATION_ID IS '出发地点ID';
+
+ COMMENT ON COLUMN carrier_movement.VOYAGE_ID IS '航程ID';
+
+ COMMENT ON TABLE handling_event IS '业务时间';
+
+ COMMENT ON COLUMN handling_event.ID IS 'Id';
+
+ COMMENT ON COLUMN handling_event.COMPLETION_TIME IS '完成时间';
+
+ COMMENT ON COLUMN handling_event.REGISTRATION_TIME IS '注册时间';
+
+ COMMENT ON COLUMN handling_event.TYPE IS '类型';
+
+ COMMENT ON COLUMN handling_event.CARGO_ID IS '货物ID';
+
+ COMMENT ON COLUMN handling_event.LOCATION_ID IS '位置ID';
+
+ COMMENT ON COLUMN handling_event.VOYAGE_ID IS '航程ID';
+
+ COMMENT ON TABLE leg IS '航段';
+
+ COMMENT ON COLUMN leg.ID IS 'Id';
+
+ COMMENT ON COLUMN leg.LOAD_TIME IS '装货时间';
+
+ COMMENT ON COLUMN leg.UNLOAD_TIME IS '卸货时间';
+
+ COMMENT ON COLUMN leg.LOAD_LOCATION_ID IS '装货地点';
+
+ COMMENT ON COLUMN leg.UNLOAD_LOCATION_ID IS '卸货地点';
+
+ COMMENT ON COLUMN leg.VOYAGE_ID IS '航程ID';
+
+ COMMENT ON COLUMN leg.CARGO_ID IS '货物ID';
+
diff --git a/nop-demo/nop-ddd-demo/deploy/sql/oracle/_drop_demo-ddd.sql b/nop-demo/nop-ddd-demo/deploy/sql/oracle/_drop_demo-ddd.sql
new file mode 100644
index 000000000..90fa931f7
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/deploy/sql/oracle/_drop_demo-ddd.sql
@@ -0,0 +1,8 @@
+
+drop table voyage;
+drop table location;
+drop table cargo;
+drop table carrier_movement;
+drop table handling_event;
+drop table leg;
+
diff --git a/nop-demo/nop-ddd-demo/deploy/sql/postgresql/_add_tenant_demo-ddd.sql b/nop-demo/nop-ddd-demo/deploy/sql/postgresql/_add_tenant_demo-ddd.sql
new file mode 100644
index 000000000..5ffb565b4
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/deploy/sql/postgresql/_add_tenant_demo-ddd.sql
@@ -0,0 +1,32 @@
+
+ alter table cargo add NOP_TENANT_ID VARCHAR(32) DEFAULT '0' NOT NULL;
+
+alter table carrier_movement add NOP_TENANT_ID VARCHAR(32) DEFAULT '0' NOT NULL;
+
+alter table handling_event add NOP_TENANT_ID VARCHAR(32) DEFAULT '0' NOT NULL;
+
+alter table leg add NOP_TENANT_ID VARCHAR(32) DEFAULT '0' NOT NULL;
+
+alter table location add NOP_TENANT_ID VARCHAR(32) DEFAULT '0' NOT NULL;
+
+alter table voyage add NOP_TENANT_ID VARCHAR(32) DEFAULT '0' NOT NULL;
+
+alter table cargo drop constraint PK_cargo;
+alter table cargo add constraint PK_cargo primary key (NOP_TENANT_ID, ID);
+
+alter table carrier_movement drop constraint PK_carrier_movement;
+alter table carrier_movement add constraint PK_carrier_movement primary key (NOP_TENANT_ID, ID);
+
+alter table handling_event drop constraint PK_handling_event;
+alter table handling_event add constraint PK_handling_event primary key (NOP_TENANT_ID, ID);
+
+alter table leg drop constraint PK_leg;
+alter table leg add constraint PK_leg primary key (NOP_TENANT_ID, ID);
+
+alter table location drop constraint PK_location;
+alter table location add constraint PK_location primary key (NOP_TENANT_ID, ID);
+
+alter table voyage drop constraint PK_voyage;
+alter table voyage add constraint PK_voyage primary key (NOP_TENANT_ID, ID);
+
+
diff --git a/nop-demo/nop-ddd-demo/deploy/sql/postgresql/_create_demo-ddd.sql b/nop-demo/nop-ddd-demo/deploy/sql/postgresql/_create_demo-ddd.sql
new file mode 100644
index 000000000..3fa81c6ad
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/deploy/sql/postgresql/_create_demo-ddd.sql
@@ -0,0 +1,167 @@
+
+CREATE TABLE voyage(
+ ID INT8 NOT NULL ,
+ VOYAGE_NUMBER VARCHAR(255) ,
+ constraint PK_voyage primary key (ID)
+);
+
+CREATE TABLE location(
+ ID INT8 NOT NULL ,
+ NAME VARCHAR(255) NOT NULL ,
+ UNLOCODE VARCHAR(255) NOT NULL ,
+ constraint PK_location primary key (ID)
+);
+
+CREATE TABLE cargo(
+ ID INT8 NOT NULL ,
+ CALCULATED_AT TIMESTAMP ,
+ ETA TIMESTAMP ,
+ UNLOADED_AT_DEST BOOLEAN ,
+ MISDIRECTED BOOLEAN ,
+ NEXT_EXPECTED_HANDLING_EVENT_TYPE VARCHAR(255) ,
+ ROUTING_STATUS VARCHAR(255) ,
+ TRANSPORT_STATUS VARCHAR(255) ,
+ SPEC_ARRIVAL_DEADLINE TIMESTAMP NOT NULL ,
+ TRACKING_ID VARCHAR(255) ,
+ CURRENT_VOYAGE_ID INT8 ,
+ LAST_EVENT_ID INT8 ,
+ LAST_KNOWN_LOCATION_ID INT8 ,
+ NEXT_EXPECTED_LOCATION_ID INT8 ,
+ NEXT_EXPECTED_VOYAGE_ID INT8 ,
+ ORIGIN_ID INT8 ,
+ SPEC_DESTINATION_ID INT8 ,
+ SPEC_ORIGIN_ID INT8 ,
+ constraint PK_cargo primary key (ID)
+);
+
+CREATE TABLE carrier_movement(
+ ID INT8 NOT NULL ,
+ ARRIVAL_TIME TIMESTAMP NOT NULL ,
+ DEPARTURE_TIME TIMESTAMP NOT NULL ,
+ ARRIVAL_LOCATION_ID INT8 NOT NULL ,
+ DEPARTURE_LOCATION_ID INT8 NOT NULL ,
+ VOYAGE_ID INT8 ,
+ constraint PK_carrier_movement primary key (ID)
+);
+
+CREATE TABLE handling_event(
+ ID INT8 NOT NULL ,
+ COMPLETION_TIME TIMESTAMP ,
+ REGISTRATION_TIME TIMESTAMP ,
+ TYPE VARCHAR(255) ,
+ CARGO_ID INT8 ,
+ LOCATION_ID INT8 ,
+ VOYAGE_ID INT8 ,
+ constraint PK_handling_event primary key (ID)
+);
+
+CREATE TABLE leg(
+ ID INT8 NOT NULL ,
+ LOAD_TIME TIMESTAMP ,
+ UNLOAD_TIME TIMESTAMP ,
+ LOAD_LOCATION_ID INT8 ,
+ UNLOAD_LOCATION_ID INT8 ,
+ VOYAGE_ID INT8 ,
+ CARGO_ID INT8 ,
+ constraint PK_leg primary key (ID)
+);
+
+
+ COMMENT ON TABLE voyage IS '航程';
+
+ COMMENT ON COLUMN voyage.ID IS 'Id';
+
+ COMMENT ON COLUMN voyage.VOYAGE_NUMBER IS '航程号';
+
+ COMMENT ON TABLE location IS '位置';
+
+ COMMENT ON COLUMN location.ID IS 'Id';
+
+ COMMENT ON COLUMN location.NAME IS '名称';
+
+ COMMENT ON COLUMN location.UNLOCODE IS 'UN编码';
+
+ COMMENT ON TABLE cargo IS '货物';
+
+ COMMENT ON COLUMN cargo.ID IS 'Id';
+
+ COMMENT ON COLUMN cargo.CALCULATED_AT IS '计算时间';
+
+ COMMENT ON COLUMN cargo.ETA IS '预计到达时间';
+
+ COMMENT ON COLUMN cargo.UNLOADED_AT_DEST IS '目的地卸载时间';
+
+ COMMENT ON COLUMN cargo.MISDIRECTED IS '路线错误';
+
+ COMMENT ON COLUMN cargo.NEXT_EXPECTED_HANDLING_EVENT_TYPE IS '下一步预期处理事件类型';
+
+ COMMENT ON COLUMN cargo.ROUTING_STATUS IS '路由状态';
+
+ COMMENT ON COLUMN cargo.TRANSPORT_STATUS IS '运输状态';
+
+ COMMENT ON COLUMN cargo.SPEC_ARRIVAL_DEADLINE IS '指定到达期限';
+
+ COMMENT ON COLUMN cargo.TRACKING_ID IS '跟踪ID';
+
+ COMMENT ON COLUMN cargo.CURRENT_VOYAGE_ID IS '当前航程ID';
+
+ COMMENT ON COLUMN cargo.LAST_EVENT_ID IS '最后事件ID';
+
+ COMMENT ON COLUMN cargo.LAST_KNOWN_LOCATION_ID IS '最后已知位置ID';
+
+ COMMENT ON COLUMN cargo.NEXT_EXPECTED_LOCATION_ID IS '下一个预期位置ID';
+
+ COMMENT ON COLUMN cargo.NEXT_EXPECTED_VOYAGE_ID IS '下一个预期航程ID';
+
+ COMMENT ON COLUMN cargo.ORIGIN_ID IS '出发地ID';
+
+ COMMENT ON COLUMN cargo.SPEC_DESTINATION_ID IS '指定目的地ID';
+
+ COMMENT ON COLUMN cargo.SPEC_ORIGIN_ID IS '指定出发地ID';
+
+ COMMENT ON TABLE carrier_movement IS '运输动作';
+
+ COMMENT ON COLUMN carrier_movement.ID IS 'Id';
+
+ COMMENT ON COLUMN carrier_movement.ARRIVAL_TIME IS '到达时间';
+
+ COMMENT ON COLUMN carrier_movement.DEPARTURE_TIME IS '出发时间';
+
+ COMMENT ON COLUMN carrier_movement.ARRIVAL_LOCATION_ID IS '到达地点ID';
+
+ COMMENT ON COLUMN carrier_movement.DEPARTURE_LOCATION_ID IS '出发地点ID';
+
+ COMMENT ON COLUMN carrier_movement.VOYAGE_ID IS '航程ID';
+
+ COMMENT ON TABLE handling_event IS '业务时间';
+
+ COMMENT ON COLUMN handling_event.ID IS 'Id';
+
+ COMMENT ON COLUMN handling_event.COMPLETION_TIME IS '完成时间';
+
+ COMMENT ON COLUMN handling_event.REGISTRATION_TIME IS '注册时间';
+
+ COMMENT ON COLUMN handling_event.TYPE IS '类型';
+
+ COMMENT ON COLUMN handling_event.CARGO_ID IS '货物ID';
+
+ COMMENT ON COLUMN handling_event.LOCATION_ID IS '位置ID';
+
+ COMMENT ON COLUMN handling_event.VOYAGE_ID IS '航程ID';
+
+ COMMENT ON TABLE leg IS '航段';
+
+ COMMENT ON COLUMN leg.ID IS 'Id';
+
+ COMMENT ON COLUMN leg.LOAD_TIME IS '装货时间';
+
+ COMMENT ON COLUMN leg.UNLOAD_TIME IS '卸货时间';
+
+ COMMENT ON COLUMN leg.LOAD_LOCATION_ID IS '装货地点';
+
+ COMMENT ON COLUMN leg.UNLOAD_LOCATION_ID IS '卸货地点';
+
+ COMMENT ON COLUMN leg.VOYAGE_ID IS '航程ID';
+
+ COMMENT ON COLUMN leg.CARGO_ID IS '货物ID';
+
diff --git a/nop-demo/nop-ddd-demo/deploy/sql/postgresql/_drop_demo-ddd.sql b/nop-demo/nop-ddd-demo/deploy/sql/postgresql/_drop_demo-ddd.sql
new file mode 100644
index 000000000..1aae49944
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/deploy/sql/postgresql/_drop_demo-ddd.sql
@@ -0,0 +1,8 @@
+
+drop table if exists voyage;
+drop table if exists location;
+drop table if exists cargo;
+drop table if exists carrier_movement;
+drop table if exists handling_event;
+drop table if exists leg;
+
diff --git a/nop-demo/nop-ddd-demo/model/demo-ddd.orm.xlsx b/nop-demo/nop-ddd-demo/model/demo-ddd.orm.xlsx
new file mode 100644
index 000000000..a3a369cef
Binary files /dev/null and b/nop-demo/nop-ddd-demo/model/demo-ddd.orm.xlsx differ
diff --git a/nop-demo/nop-ddd-demo/pom.xml b/nop-demo/nop-ddd-demo/pom.xml
new file mode 100644
index 000000000..8c1ba23a8
--- /dev/null
+++ b/nop-demo/nop-ddd-demo/pom.xml
@@ -0,0 +1,30 @@
+
+
+
+
+ nop-demo
+ io.github.entropy-cloud
+ 2.0.0-SNAPSHOT
+
+
+ 4.0.0
+
+ app.demo
+
+ demo-ddd
+
+ 1.0.0-SNAPSHOT
+
+ pom
+
+
+ demo-ddd-codegen
+ demo-ddd-api
+ demo-ddd-dao
+ demo-ddd-meta
+ demo-ddd-service
+ demo-ddd-web
+ demo-ddd-app
+
+
\ No newline at end of file
diff --git a/nop-demo/pom.xml b/nop-demo/pom.xml
index 849d7c866..ae06f3860 100644
--- a/nop-demo/pom.xml
+++ b/nop-demo/pom.xml
@@ -34,6 +34,7 @@
nop-delta-demo
nop-delta-lib
nop-jdk17-demo
+ nop-ddd-demo
diff --git a/pom.xml b/pom.xml
index 200dfe377..ed9158f5b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -468,6 +468,6 @@
nop-ofbiz-migration
nop-netty-ext
nop-hazelcast
-
+
\ No newline at end of file