diff --git a/.github/workflows/example-gate.yml b/.github/workflows/example-gate.yml
index da97f1ba..37499131 100644
--- a/.github/workflows/example-gate.yml
+++ b/.github/workflows/example-gate.yml
@@ -9,6 +9,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
+ - name: Install example verification tools
+ run: sudo apt-get update && sudo apt-get install -y ripgrep
- uses: actions/setup-java@v4
with:
distribution: temurin
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8dcdada1..112c6149 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [1.555-RELEASE] - 2026-10-13
+
+Tracking: [Java #209](https://github.com/teaql/teaql-java/issues/209) and
+[conformance #109](https://github.com/teaql/teaql-conformance/issues/109).
+
+- Add the optional `teaql-opentelemetry` standard module with trusted environment
+ activation, startup guidance and full safe traces, metrics and logs.
+- Preserve expanded masked SQL, carried physical execution identity, request-tree
+ comments and independent graph mutation audit. No per-method SDK setup is needed.
+- Bound queued/exporting work, acknowledge receiver rejection separately from
+ failed batches, and preserve business outcomes during finite shutdown/export failure.
+- Retire the separate page terminal; regenerate libraries and use ordinary list
+ execution with offset/limit and explicit count where needed.
+
+Source and internal-candidate evidence is retained in the conformance
+`2026-10-13-standard-telemetry-onboarding` report. Signed-tag and final public
+artifact verification remain separate release gates.
+
## [1.526-RELEASE] - 2025-07-25
### Added
diff --git a/examples/business-id-runtime/pom.xml b/examples/business-id-runtime/pom.xml
index 59b8df27..a2196101 100644
--- a/examples/business-id-runtime/pom.xml
+++ b/examples/business-id-runtime/pom.xml
@@ -6,7 +6,7 @@
io.teaql
teaql-java-parent
- 1.554-RELEASE
+ 1.555-RELEASE
../../pom.xml
teaql-business-id-example
diff --git a/examples/conformance/lib/pom.xml b/examples/conformance/lib/pom.xml
index 134ccf0b..7e2df1b4 100644
--- a/examples/conformance/lib/pom.xml
+++ b/examples/conformance/lib/pom.xml
@@ -12,7 +12,7 @@
21
4.1.1
- 1.554-RELEASE
+ 1.555-RELEASE
UTF-8
true
diff --git a/examples/conformance/pom.xml b/examples/conformance/pom.xml
index 71ab3830..492d0b69 100644
--- a/examples/conformance/pom.xml
+++ b/examples/conformance/pom.xml
@@ -16,7 +16,7 @@
1.0.0
UTF-8
true
- 1.554-RELEASE
+ 1.555-RELEASE
diff --git a/examples/order-management/java-app-console/pom.xml b/examples/order-management/java-app-console/pom.xml
index d78ee861..05ec378c 100644
--- a/examples/order-management/java-app-console/pom.xml
+++ b/examples/order-management/java-app-console/pom.xml
@@ -11,7 +11,7 @@
21
UTF-8
- 1.554-RELEASE
+ 1.555-RELEASE
diff --git a/examples/order-management/java-lib-core/lib/pom.xml b/examples/order-management/java-lib-core/lib/pom.xml
index 7d83f2d3..b8fe9739 100644
--- a/examples/order-management/java-lib-core/lib/pom.xml
+++ b/examples/order-management/java-lib-core/lib/pom.xml
@@ -12,7 +12,7 @@
21
4.1.1
- 1.554-RELEASE
+ 1.555-RELEASE
UTF-8
true
diff --git a/examples/round-trip-reference-runtime/pom.xml b/examples/round-trip-reference-runtime/pom.xml
index f8746316..635f65c9 100644
--- a/examples/round-trip-reference-runtime/pom.xml
+++ b/examples/round-trip-reference-runtime/pom.xml
@@ -6,7 +6,7 @@
io.teaql
teaql-java-parent
- 1.554-RELEASE
+ 1.555-RELEASE
../../pom.xml
teaql-round-trip-reference-example
diff --git a/examples/school-management/lib/pom.xml b/examples/school-management/lib/pom.xml
index 721bdeda..b59d0e19 100644
--- a/examples/school-management/lib/pom.xml
+++ b/examples/school-management/lib/pom.xml
@@ -12,7 +12,7 @@
21
4.1.1
- 1.554-RELEASE
+ 1.555-RELEASE
UTF-8
true
diff --git a/examples/school-management/pom.xml b/examples/school-management/pom.xml
index 4af77b4f..df27e567 100644
--- a/examples/school-management/pom.xml
+++ b/examples/school-management/pom.xml
@@ -16,7 +16,7 @@
0.0.1-SNAPSHOT
UTF-8
true
- 1.554-RELEASE
+ 1.555-RELEASE
diff --git a/examples/school-management/src/main/java/com/example/schoolmanagementservice/RequestIntentVerifier.java b/examples/school-management/src/main/java/com/example/schoolmanagementservice/RequestIntentVerifier.java
index 4fdfece6..402fb890 100644
--- a/examples/school-management/src/main/java/com/example/schoolmanagementservice/RequestIntentVerifier.java
+++ b/examples/school-management/src/main/java/com/example/schoolmanagementservice/RequestIntentVerifier.java
@@ -41,7 +41,7 @@ static void verify(TeaQLRuntime original) {
required("REQUEST_COMMENT_REQUIRED", () -> runtime.executeForList(context, Q.schools()));
required("REQUEST_COMMENT_REQUIRED", () -> runtime.executeForStream(context, Q.schools()));
required("REQUEST_COMMENT_REQUIRED", () -> runtime.aggregation(context, Q.schools()));
- required("REQUEST_COMMENT_REQUIRED", () -> runtime.executeForPage(context, Q.schools(), 0, 10));
+ required("REQUEST_COMMENT_REQUIRED", () -> runtime.executeForList(context, Q.schools().offset(0, 10).count()));
required("QUERY_PURPOSE_REQUIRED", () -> runtime.executeForList(context, Q.schools().comment("load schools")));
require(queryPolicyCalls.get() == 0 && statements.isEmpty(), "Invalid query reached policy or SQL");
for (String blank : new String[]{"", " \t\r\n", "\u2003", "\u00a0"}) {
diff --git a/examples/security-foundations/pom.xml b/examples/security-foundations/pom.xml
index d9c1d45d..76356218 100644
--- a/examples/security-foundations/pom.xml
+++ b/examples/security-foundations/pom.xml
@@ -6,7 +6,7 @@
io.teaql
teaql-java-parent
- 1.554-RELEASE
+ 1.555-RELEASE
../../pom.xml
teaql-security-foundations-example
diff --git a/examples/shared-load-state/pom.xml b/examples/shared-load-state/pom.xml
index dfafaa26..4044e81d 100644
--- a/examples/shared-load-state/pom.xml
+++ b/examples/shared-load-state/pom.xml
@@ -3,7 +3,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
- io.teaqlteaql-java-parent1.554-RELEASE
+ io.teaqlteaql-java-parent1.555-RELEASE
../../pom.xml
shared-load-state-example
diff --git a/examples/shared-load-state/src/test/java/com/example/schoolmanagementservice/GeneratedPageStreamAcceptance.java b/examples/shared-load-state/src/test/java/com/example/schoolmanagementservice/GeneratedPageStreamAcceptance.java
index 2bdcb55f..2936f57c 100644
--- a/examples/shared-load-state/src/test/java/com/example/schoolmanagementservice/GeneratedPageStreamAcceptance.java
+++ b/examples/shared-load-state/src/test/java/com/example/schoolmanagementservice/GeneratedPageStreamAcceptance.java
@@ -9,11 +9,13 @@
final class GeneratedPageStreamAcceptance {
static void verify(UserContext context, String first, String second) {
var left = Q.schoolsWithMinimalFields().withNameIn(first,second).selectName().orderByIdAscending()
+ .offset(0,1).count()
.comment("what: load the first matching School page").purpose("why: qualify sparse page hydration")
- .executeForPage(context,0,1);
+ .executeForList(context);
var right = Q.schoolsWithMinimalFields().withNameIn(first,second).selectName().orderByIdAscending()
+ .offset(1,1).count()
.comment("what: load the second matching School page").purpose("why: qualify adjacent pages and filtered total")
- .executeForPage(context,1,1);
+ .executeForList(context);
assertEquals(2,left.getTotalCount());assertEquals(2,right.getTotalCount());
assertEquals(1,left.size());assertEquals(1,right.size());
assertNotEquals(left.first().getId(),right.first().getId());
diff --git a/examples/standard-order/AGENTS.md b/examples/standard-order/AGENTS.md
new file mode 100644
index 00000000..3ff1537c
--- /dev/null
+++ b/examples/standard-order/AGENTS.md
@@ -0,0 +1,27 @@
+# Java Standard Order Example Rules
+
+Implement only application-owned code. The files under `generated/lib` are
+read-only. Discover generated APIs using progressive model-aware Assist with
+`models/model.xml`; never read generated source to discover methods.
+
+```bash
+cargo teaql --input models/model.xml java-assist-query/customer_order
+cargo teaql --input models/model.xml java-assist-query/customer_order.order_item_list
+```
+
+Use bounded Q queries through one trusted UserContext, with non-empty comment
+and purpose. Configure offset/limit on the request and execute through
+`executeForList(context)`. Do not introduce a separate `executeForPage` entry.
+Requested count, facet and relationship metadata belong to the returned
+SmartList. Use generated E for loaded-value traversal and preserve NotLoaded
+as an error.
+
+Use generated audited mutation APIs for seed data; do not handwrite INSERTs.
+Runtime, providers and policy are assembled once. Standard telemetry is selected
+by trusted environment settings; business methods contain no SDK initialization
+or manually created spans. Ordinary SQL output and telemetry are independent.
+
+Verify against repository-local Maven reactor modules. Run `bash verify.sh` and
+retain startup messages, results and generated-library hashes. Backend delivery
+is verified separately by conformance's controlled capture. Do not claim export
+success merely because the application exits successfully.
diff --git a/examples/standard-order/README.md b/examples/standard-order/README.md
new file mode 100644
index 00000000..57bb9e86
--- /dev/null
+++ b/examples/standard-order/README.md
@@ -0,0 +1,43 @@
+# Java Standard Telemetry Order Example
+
+This example uses generated Q/E and the ordinary `executeForList(context)`
+entry point to load a filtered order list with bounded pagination, status
+details, child previews, child counts and status facets. No business method
+initializes an SDK or creates a span.
+
+The five-object model seeds one Platform and three status constants through
+generated audited mutations. Repeated ensureSchema does not produce duplicate
+writes or audits. Four orders and twenty items are created through the same
+mutation API. The filtered result contains three orders; the selected one-row
+slice has three item previews and an independent count of five items. Status
+facets have counts `1, 2, 0` and amount totals `100, 500, 0`. The deliberately
+omitted order amount remains NotLoaded.
+
+The local runtime handles a declared ungrouped count alongside rows under one
+logical list invocation. Grouped and mixed aggregate requests keep their
+existing aggregate semantics. All generated library files are produced from
+the checked model; do not patch them to change query behavior.
+
+Run the local application acceptance twice, with startup guidance and unchanged
+generated-library hashes:
+
+```bash
+bash examples/standard-order/verify.sh
+```
+
+The optional standard module enables all supported signals with these trusted
+process settings:
+
+```bash
+TEAQL_TELEMETRY_ENABLED=true \
+TEAQL_TELEMETRY_SERVICE_NAME=order-example \
+TEAQL_TELEMETRY_OTLP_ENDPOINT=http://127.0.0.1:4318 \
+ mvn -q -Pruntime-examples -pl examples/standard-order -am \
+ -Dtest=StandardOrderTelemetryTest -Dsurefire.failIfNoSpecifiedTests=false test
+```
+
+Ordinary SQL logs are disabled in the example. The checked model marks order
+numbers and customer names for masking; telemetry must still export safe
+expanded SQL. Conformance's `telemetry/capture-java-standard-order.cjs` checks
+actual backend delivery and parentage. A successful application run alone does
+not establish that all SQL diagnostics reached the collector.
diff --git a/examples/standard-order/generated/lib/pom.xml b/examples/standard-order/generated/lib/pom.xml
new file mode 100644
index 00000000..3696cf80
--- /dev/null
+++ b/examples/standard-order/generated/lib/pom.xml
@@ -0,0 +1,142 @@
+
+
+ 4.0.0
+
+ com.example
+ request-tree-order-service-core
+ 0.0.1-SNAPSHOT
+ jar
+
+
+ 21
+ 4.1.1
+ 1.555-RELEASE
+ UTF-8
+ true
+
+
+
+
+ teaql
+ https://maven.teaql.io/repository/maven-releases/
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-dependencies
+ ${spring-boot.version}
+ pom
+ import
+
+
+ org.apache.tomcat.embed
+ tomcat-embed-core
+ 11.0.26
+
+
+ org.apache.tomcat.embed
+ tomcat-embed-el
+ 11.0.26
+
+
+ org.apache.tomcat.embed
+ tomcat-embed-websocket
+ 11.0.26
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-autoconfigure
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework
+ spring-tx
+
+
+ io.teaql
+ teaql-sqlite
+ 1.555-RELEASE
+
+
+ io.teaql
+ teaql-core
+ ${teaql.version}
+
+
+ io.teaql
+ teaql-runtime
+ ${teaql.version}
+
+
+ cn.hutool
+ hutool-all
+ 5.8.20
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.12.1
+
+ ${java.version}
+ ${maven.compiler.parameters}
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ 3.5.0
+
+
+ enforce-java-version
+
+ enforce
+
+
+
+
+ [${java.version},)
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 3.3.0
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+
+
+
+
+ target-repo
+ https://maven.teaql.io/repository/maven-releases/
+
+
+
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/BaseServiceConfiguration.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/BaseServiceConfiguration.java
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/Checkers.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/Checkers.java
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/Constants.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/Constants.java
new file mode 100644
index 00000000..bdd12b2e
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/Constants.java
@@ -0,0 +1,14 @@
+
+package com.example.requesttreeorderservice;
+
+import com.example.requesttreeorderservice.orderstatus.OrderStatus;
+import com.example.requesttreeorderservice.platform.Platform;
+
+public interface Constants {
+ public static final long PLATFORM_ID = 1l;
+ public static final Platform PLATFORM = Platform.refer(PLATFORM_ID);
+ public static final long ORDER_STATUS_NEW_ID = 1001l ;
+ public static final OrderStatus ORDER_STATUS_NEW = OrderStatus.refer(ORDER_STATUS_NEW_ID);public static final long ORDER_STATUS_PAID_ID = 1002l ;
+ public static final OrderStatus ORDER_STATUS_PAID = OrderStatus.refer(ORDER_STATUS_PAID_ID);public static final long ORDER_STATUS_CANCELLED_ID = 1003l ;
+ public static final OrderStatus ORDER_STATUS_CANCELLED = OrderStatus.refer(ORDER_STATUS_CANCELLED_ID);
+}
\ No newline at end of file
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/E.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/E.java
new file mode 100644
index 00000000..84a3bdae
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/E.java
@@ -0,0 +1,32 @@
+
+package com.example.requesttreeorderservice;
+
+import com.example.requesttreeorderservice.customer.Customer;
+import com.example.requesttreeorderservice.customer.CustomerExpression;
+import com.example.requesttreeorderservice.customerorder.CustomerOrder;
+import com.example.requesttreeorderservice.customerorder.CustomerOrderExpression;
+import com.example.requesttreeorderservice.orderitem.OrderItem;
+import com.example.requesttreeorderservice.orderitem.OrderItemExpression;
+import com.example.requesttreeorderservice.orderstatus.OrderStatus;
+import com.example.requesttreeorderservice.orderstatus.OrderStatusExpression;
+import com.example.requesttreeorderservice.platform.Platform;
+import com.example.requesttreeorderservice.platform.PlatformExpression;
+import io.teaql.core.value.ValueExpression;
+
+public class E {
+ public static PlatformExpression platform(Platform platform){
+ return new PlatformExpression(new ValueExpression(platform));
+ }
+ public static OrderStatusExpression orderStatus(OrderStatus orderStatus){
+ return new OrderStatusExpression(new ValueExpression(orderStatus));
+ }
+ public static CustomerExpression customer(Customer customer){
+ return new CustomerExpression(new ValueExpression(customer));
+ }
+ public static CustomerOrderExpression customerOrder(CustomerOrder customerOrder){
+ return new CustomerOrderExpression(new ValueExpression(customerOrder));
+ }
+ public static OrderItemExpression orderItem(OrderItem orderItem){
+ return new OrderItemExpression(new ValueExpression(orderItem));
+ }
+}
\ No newline at end of file
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/EntityMetaRegistry.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/EntityMetaRegistry.java
new file mode 100644
index 00000000..2d33ef16
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/EntityMetaRegistry.java
@@ -0,0 +1,558 @@
+
+package com.example.requesttreeorderservice;
+
+import io.teaql.core.FieldLayout;
+import io.teaql.core.meta.EntityDescriptor;
+import io.teaql.core.meta.EntityMetaAssembler;
+import io.teaql.core.meta.EntityMetaFactory;
+import io.teaql.core.meta.PropertyDescriptor;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+
+public class EntityMetaRegistry implements EntityMetaAssembler {
+ private EntityMetaFactory $factory;
+
+ @Override
+ public void assemble(EntityMetaFactory factory) {
+ this.$factory = factory;
+ registerPlatform();
+ registerOrderStatus();
+ registerCustomer();
+ registerCustomerOrder();
+ registerOrderItem();
+ }
+ private void registerPlatform() {
+ FieldLayout.installGenerated(com.example.requesttreeorderservice.platform.Platform.__TEAQL_FIELD_LAYOUT);
+ EntityDescriptor entityDescriptor = new EntityDescriptor();
+ entityDescriptor.setType(com.example.requesttreeorderservice.platform.Platform.INTERNAL_TYPE);
+ entityDescriptor.setTargetType(com.example.requesttreeorderservice.platform.Platform.class);
+ entityDescriptor.setEntitySupplier(com.example.requesttreeorderservice.platform.Platform::new);
+ entityDescriptor.with("name", "Commerce Platform")
+ .with("module", "Commerce")
+ .with("module_key", "commerce");
+
+ entityDescriptor.setAuditMaskFields(java.util.List.of());
+ PropertyDescriptor id =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.platform.Platform.ID_PROPERTY, Long.class)
+ ;
+ PropertyDescriptor name =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.platform.Platform.NAME_PROPERTY, String.class)
+ ;
+ PropertyDescriptor version =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.platform.Platform.VERSION_PROPERTY, Long.class)
+ ;
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.platform.Platform.ID_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.platform.Platform.ID_PROPERTY).with("isPassword", "false")
+ .with("isVersion", "false")
+ .with("oracle_sqlType", "number(11)")
+ .with("javaType", "java.lang.Long")
+ .with("sqlType", "BIGINT")
+ .with("isId", "true")
+ .with("isBaseEntityField", "true")
+ .with("isBool", "false")
+ .with("isNumber", "false")
+ .with("isString", "false")
+ .with("isDate", "false")
+ .with("snowflake_sqlType", "number")
+ .with("graphqlType", "Long")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.platform.Platform.NAME_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.platform.Platform.NAME_PROPERTY).with("isPassword", "false")
+ .with("max", "100")
+ .with("isVersion", "false")
+ .with("javaType", "java.lang.String")
+ .with("candidates", "Commerce Test Platform")
+ .with("sqlType", "VARCHAR()")
+ .with("isId", "false")
+ .with("isBool", "false")
+ .with("isBaseEntityField", "false")
+ .with("isNumber", "false")
+ .with("isString", "true")
+ .with("isDate", "false")
+ .with("graphqlType", "String")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.platform.Platform.VERSION_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.platform.Platform.VERSION_PROPERTY).with("isPassword", "false")
+ .with("isVersion", "true")
+ .with("oracle_sqlType", "number(11)")
+ .with("javaType", "java.lang.Long")
+ .with("sqlType", "BIGINT")
+ .with("isId", "false")
+ .with("isBaseEntityField", "true")
+ .with("isBool", "false")
+ .with("isNumber", "false")
+ .with("isString", "false")
+ .with("isDate", "false")
+ .with("snowflake_sqlType", "number")
+ .with("graphqlType", "Long")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ $factory.register(entityDescriptor);
+ }
+ private void registerOrderStatus() {
+ FieldLayout.installGenerated(com.example.requesttreeorderservice.orderstatus.OrderStatus.__TEAQL_FIELD_LAYOUT);
+ EntityDescriptor entityDescriptor = new EntityDescriptor();
+ entityDescriptor.setType(com.example.requesttreeorderservice.orderstatus.OrderStatus.INTERNAL_TYPE);
+ entityDescriptor.setTargetType(com.example.requesttreeorderservice.orderstatus.OrderStatus.class);
+ entityDescriptor.setEntitySupplier(com.example.requesttreeorderservice.orderstatus.OrderStatus::new);
+ entityDescriptor.with("name", "Order Status")
+ .with("module", "Commerce")
+ .with("module_key", "commerce")
+ .with("constant", "true")
+ .with("identifier", "code");
+
+ entityDescriptor.setAuditMaskFields(java.util.List.of());
+ PropertyDescriptor platform =
+ entityDescriptor.addObjectProperty($factory, com.example.requesttreeorderservice.orderstatus.OrderStatus.PLATFORM_PROPERTY, com.example.requesttreeorderservice.platform.Platform.INTERNAL_TYPE, com.example.requesttreeorderservice.platform.Platform.ORDER_STATUS_LIST_PROPERTY, com.example.requesttreeorderservice.platform.Platform.class)
+ ;
+ PropertyDescriptor id =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.ID_PROPERTY, Long.class)
+ ;
+ PropertyDescriptor name =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.NAME_PROPERTY, String.class)
+ ;
+ PropertyDescriptor code =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.CODE_PROPERTY, String.class)
+ ;
+ PropertyDescriptor color =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.COLOR_PROPERTY, String.class)
+ ;
+ PropertyDescriptor displayOrder =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.DISPLAY_ORDER_PROPERTY, BigDecimal.class)
+ ;
+ PropertyDescriptor version =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.VERSION_PROPERTY, Long.class)
+ ;
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.PLATFORM_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.PLATFORM_PROPERTY).with("candidates", "platform()");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.ID_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.ID_PROPERTY).with("isPassword", "false")
+ .with("isVersion", "false")
+ .with("oracle_sqlType", "number(11)")
+ .with("javaType", "java.lang.Long")
+ .with("candidates", "1001,1002,1003")
+ .with("sqlType", "BIGINT")
+ .with("isId", "true")
+ .with("isBaseEntityField", "true")
+ .with("isBool", "false")
+ .with("isNumber", "false")
+ .with("isString", "false")
+ .with("isDate", "false")
+ .with("snowflake_sqlType", "number")
+ .with("graphqlType", "Long")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.NAME_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.NAME_PROPERTY).with("isPassword", "false")
+ .with("max", "100")
+ .with("isVersion", "false")
+ .with("javaType", "java.lang.String")
+ .with("candidates", "New,Paid,Cancelled")
+ .with("sqlType", "VARCHAR()")
+ .with("isId", "false")
+ .with("isBool", "false")
+ .with("isBaseEntityField", "false")
+ .with("isNumber", "false")
+ .with("isString", "true")
+ .with("isDate", "false")
+ .with("graphqlType", "String")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.CODE_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.CODE_PROPERTY).with("identifier", "true")
+ .with("isPassword", "false")
+ .with("max", "100")
+ .with("isVersion", "false")
+ .with("javaType", "java.lang.String")
+ .with("candidates", "NEW,PAID,CANCELLED")
+ .with("sqlType", "VARCHAR()")
+ .with("isId", "false")
+ .with("isBool", "false")
+ .with("isBaseEntityField", "false")
+ .with("isNumber", "false")
+ .with("isString", "true")
+ .with("isDate", "false")
+ .with("graphqlType", "String")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.COLOR_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.COLOR_PROPERTY).with("isPassword", "false")
+ .with("max", "100")
+ .with("isVersion", "false")
+ .with("javaType", "java.lang.String")
+ .with("candidates", "#94A3B8,#22C55E,#EF4444")
+ .with("sqlType", "VARCHAR()")
+ .with("isId", "false")
+ .with("isBool", "false")
+ .with("isBaseEntityField", "false")
+ .with("isNumber", "false")
+ .with("isString", "true")
+ .with("isDate", "false")
+ .with("graphqlType", "String")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.DISPLAY_ORDER_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.DISPLAY_ORDER_PROPERTY).with("isPassword", "false")
+ .with("db2_sqlType", "decimal(19,7)")
+ .with("isVersion", "false")
+ .with("oracle_sqlType", "number(19,7)")
+ .with("javaType", "java.math.BigDecimal")
+ .with("candidates", "1,2,3")
+ .with("sqlType", "NUMERIC(19,7)")
+ .with("isId", "false")
+ .with("isBool", "false")
+ .with("isBaseEntityField", "false")
+ .with("isNumber", "true")
+ .with("isString", "false")
+ .with("isDate", "false")
+ .with("graphqlType", "BigDecimal")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.VERSION_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderstatus.OrderStatus.VERSION_PROPERTY).with("isPassword", "false")
+ .with("isVersion", "true")
+ .with("oracle_sqlType", "number(11)")
+ .with("javaType", "java.lang.Long")
+ .with("sqlType", "BIGINT")
+ .with("isId", "false")
+ .with("isBaseEntityField", "true")
+ .with("isBool", "false")
+ .with("isNumber", "false")
+ .with("isString", "false")
+ .with("isDate", "false")
+ .with("snowflake_sqlType", "number")
+ .with("graphqlType", "Long")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ $factory.register(entityDescriptor);
+ }
+ private void registerCustomer() {
+ FieldLayout.installGenerated(com.example.requesttreeorderservice.customer.Customer.__TEAQL_FIELD_LAYOUT);
+ EntityDescriptor entityDescriptor = new EntityDescriptor();
+ entityDescriptor.setType(com.example.requesttreeorderservice.customer.Customer.INTERNAL_TYPE);
+ entityDescriptor.setTargetType(com.example.requesttreeorderservice.customer.Customer.class);
+ entityDescriptor.setEntitySupplier(com.example.requesttreeorderservice.customer.Customer::new);
+ entityDescriptor.with("name", "Customer")
+ .with("module", "Commerce")
+ .with("module_key", "commerce")
+ .with("audit_mask_fields", "name");
+
+ entityDescriptor.setAuditMaskFields(java.util.List.of(com.example.requesttreeorderservice.customer.Customer.NAME_PROPERTY));
+ PropertyDescriptor id =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.customer.Customer.ID_PROPERTY, Long.class)
+ ;
+ PropertyDescriptor platform =
+ entityDescriptor.addObjectProperty($factory, com.example.requesttreeorderservice.customer.Customer.PLATFORM_PROPERTY, com.example.requesttreeorderservice.platform.Platform.INTERNAL_TYPE, com.example.requesttreeorderservice.platform.Platform.CUSTOMER_LIST_PROPERTY, com.example.requesttreeorderservice.platform.Platform.class)
+ ;
+ PropertyDescriptor name =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.customer.Customer.NAME_PROPERTY, String.class)
+ ;
+ PropertyDescriptor version =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.customer.Customer.VERSION_PROPERTY, Long.class)
+ ;
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customer.Customer.ID_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customer.Customer.ID_PROPERTY).with("isPassword", "false")
+ .with("isVersion", "false")
+ .with("oracle_sqlType", "number(11)")
+ .with("javaType", "java.lang.Long")
+ .with("sqlType", "BIGINT")
+ .with("isId", "true")
+ .with("isBaseEntityField", "true")
+ .with("isBool", "false")
+ .with("isNumber", "false")
+ .with("isString", "false")
+ .with("isDate", "false")
+ .with("snowflake_sqlType", "number")
+ .with("graphqlType", "Long")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customer.Customer.PLATFORM_PROPERTY).with("required", "true");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customer.Customer.NAME_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customer.Customer.NAME_PROPERTY).with("isPassword", "false")
+ .with("max", "100")
+ .with("isVersion", "false")
+ .with("javaType", "java.lang.String")
+ .with("sqlType", "VARCHAR()")
+ .with("isId", "false")
+ .with("isBool", "false")
+ .with("isBaseEntityField", "false")
+ .with("isNumber", "false")
+ .with("isString", "true")
+ .with("isDate", "false")
+ .with("graphqlType", "String")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customer.Customer.VERSION_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customer.Customer.VERSION_PROPERTY).with("isPassword", "false")
+ .with("isVersion", "true")
+ .with("oracle_sqlType", "number(11)")
+ .with("javaType", "java.lang.Long")
+ .with("sqlType", "BIGINT")
+ .with("isId", "false")
+ .with("isBaseEntityField", "true")
+ .with("isBool", "false")
+ .with("isNumber", "false")
+ .with("isString", "false")
+ .with("isDate", "false")
+ .with("snowflake_sqlType", "number")
+ .with("graphqlType", "Long")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ $factory.register(entityDescriptor);
+ }
+ private void registerCustomerOrder() {
+ FieldLayout.installGenerated(com.example.requesttreeorderservice.customerorder.CustomerOrder.__TEAQL_FIELD_LAYOUT);
+ EntityDescriptor entityDescriptor = new EntityDescriptor();
+ entityDescriptor.setType(com.example.requesttreeorderservice.customerorder.CustomerOrder.INTERNAL_TYPE);
+ entityDescriptor.setTargetType(com.example.requesttreeorderservice.customerorder.CustomerOrder.class);
+ entityDescriptor.setEntitySupplier(com.example.requesttreeorderservice.customerorder.CustomerOrder::new);
+ entityDescriptor.with("name", "Customer Order")
+ .with("module", "Commerce")
+ .with("module_key", "commerce")
+ .with("audit_mask_fields", "order_number");
+
+ entityDescriptor.setAuditMaskFields(java.util.List.of(com.example.requesttreeorderservice.customerorder.CustomerOrder.ORDER_NUMBER_PROPERTY));
+ PropertyDescriptor id =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.ID_PROPERTY, Long.class)
+ ;
+ PropertyDescriptor customer =
+ entityDescriptor.addObjectProperty($factory, com.example.requesttreeorderservice.customerorder.CustomerOrder.CUSTOMER_PROPERTY, com.example.requesttreeorderservice.customer.Customer.INTERNAL_TYPE, com.example.requesttreeorderservice.customer.Customer.CUSTOMER_ORDER_LIST_PROPERTY, com.example.requesttreeorderservice.customer.Customer.class)
+ ;
+ PropertyDescriptor status =
+ entityDescriptor.addObjectProperty($factory, com.example.requesttreeorderservice.customerorder.CustomerOrder.STATUS_PROPERTY, com.example.requesttreeorderservice.orderstatus.OrderStatus.INTERNAL_TYPE, com.example.requesttreeorderservice.orderstatus.OrderStatus.CUSTOMER_ORDER_LIST_PROPERTY, com.example.requesttreeorderservice.orderstatus.OrderStatus.class)
+ ;
+ PropertyDescriptor orderNumber =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.ORDER_NUMBER_PROPERTY, String.class)
+ ;
+ PropertyDescriptor orderDate =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.ORDER_DATE_PROPERTY, LocalDate.class)
+ ;
+ PropertyDescriptor totalAmount =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.TOTAL_AMOUNT_PROPERTY, BigDecimal.class)
+ ;
+ PropertyDescriptor version =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.VERSION_PROPERTY, Long.class)
+ ;
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.ID_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.ID_PROPERTY).with("isPassword", "false")
+ .with("isVersion", "false")
+ .with("oracle_sqlType", "number(11)")
+ .with("javaType", "java.lang.Long")
+ .with("sqlType", "BIGINT")
+ .with("isId", "true")
+ .with("isBaseEntityField", "true")
+ .with("isBool", "false")
+ .with("isNumber", "false")
+ .with("isString", "false")
+ .with("isDate", "false")
+ .with("snowflake_sqlType", "number")
+ .with("graphqlType", "Long")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.CUSTOMER_PROPERTY).with("required", "true");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.STATUS_PROPERTY).with("required", "true");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.ORDER_NUMBER_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.ORDER_NUMBER_PROPERTY).with("isPassword", "false")
+ .with("max", "100")
+ .with("isVersion", "false")
+ .with("javaType", "java.lang.String")
+ .with("sqlType", "VARCHAR()")
+ .with("isId", "false")
+ .with("isBool", "false")
+ .with("isBaseEntityField", "false")
+ .with("isNumber", "false")
+ .with("isString", "true")
+ .with("isDate", "false")
+ .with("graphqlType", "String")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.ORDER_DATE_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.ORDER_DATE_PROPERTY).with("isPassword", "false")
+ .with("isVersion", "false")
+ .with("javaType", "java.time.LocalDate")
+ .with("sqlType", "DATE")
+ .with("isId", "false")
+ .with("isBool", "false")
+ .with("isBaseEntityField", "false")
+ .with("isNumber", "false")
+ .with("isDate", "true")
+ .with("isString", "false")
+ .with("graphqlType", "Date")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.TOTAL_AMOUNT_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.TOTAL_AMOUNT_PROPERTY).with("isPassword", "false")
+ .with("db2_sqlType", "decimal(19,7)")
+ .with("isVersion", "false")
+ .with("oracle_sqlType", "number(19,7)")
+ .with("javaType", "java.math.BigDecimal")
+ .with("sqlType", "NUMERIC(19,7)")
+ .with("isId", "false")
+ .with("isBool", "false")
+ .with("isBaseEntityField", "false")
+ .with("isNumber", "true")
+ .with("isString", "false")
+ .with("isDate", "false")
+ .with("graphqlType", "BigDecimal")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.VERSION_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.customerorder.CustomerOrder.VERSION_PROPERTY).with("isPassword", "false")
+ .with("isVersion", "true")
+ .with("oracle_sqlType", "number(11)")
+ .with("javaType", "java.lang.Long")
+ .with("sqlType", "BIGINT")
+ .with("isId", "false")
+ .with("isBaseEntityField", "true")
+ .with("isBool", "false")
+ .with("isNumber", "false")
+ .with("isString", "false")
+ .with("isDate", "false")
+ .with("snowflake_sqlType", "number")
+ .with("graphqlType", "Long")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ $factory.register(entityDescriptor);
+ }
+ private void registerOrderItem() {
+ FieldLayout.installGenerated(com.example.requesttreeorderservice.orderitem.OrderItem.__TEAQL_FIELD_LAYOUT);
+ EntityDescriptor entityDescriptor = new EntityDescriptor();
+ entityDescriptor.setType(com.example.requesttreeorderservice.orderitem.OrderItem.INTERNAL_TYPE);
+ entityDescriptor.setTargetType(com.example.requesttreeorderservice.orderitem.OrderItem.class);
+ entityDescriptor.setEntitySupplier(com.example.requesttreeorderservice.orderitem.OrderItem::new);
+ entityDescriptor.with("name", "Order Item")
+ .with("module", "Commerce")
+ .with("module_key", "commerce");
+
+ entityDescriptor.setAuditMaskFields(java.util.List.of());
+ PropertyDescriptor id =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.orderitem.OrderItem.ID_PROPERTY, Long.class)
+ ;
+ PropertyDescriptor customerOrder =
+ entityDescriptor.addObjectProperty($factory, com.example.requesttreeorderservice.orderitem.OrderItem.CUSTOMER_ORDER_PROPERTY, com.example.requesttreeorderservice.customerorder.CustomerOrder.INTERNAL_TYPE, com.example.requesttreeorderservice.customerorder.CustomerOrder.ORDER_ITEM_LIST_PROPERTY, com.example.requesttreeorderservice.customerorder.CustomerOrder.class)
+ ;
+ PropertyDescriptor productName =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.orderitem.OrderItem.PRODUCT_NAME_PROPERTY, String.class)
+ ;
+ PropertyDescriptor quantity =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.orderitem.OrderItem.QUANTITY_PROPERTY, Integer.class)
+ ;
+ PropertyDescriptor unitPrice =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.orderitem.OrderItem.UNIT_PRICE_PROPERTY, BigDecimal.class)
+ ;
+ PropertyDescriptor version =
+ entityDescriptor.addSimpleProperty(com.example.requesttreeorderservice.orderitem.OrderItem.VERSION_PROPERTY, Long.class)
+ ;
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderitem.OrderItem.ID_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderitem.OrderItem.ID_PROPERTY).with("isPassword", "false")
+ .with("isVersion", "false")
+ .with("oracle_sqlType", "number(11)")
+ .with("javaType", "java.lang.Long")
+ .with("sqlType", "BIGINT")
+ .with("isId", "true")
+ .with("isBaseEntityField", "true")
+ .with("isBool", "false")
+ .with("isNumber", "false")
+ .with("isString", "false")
+ .with("isDate", "false")
+ .with("snowflake_sqlType", "number")
+ .with("graphqlType", "Long")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderitem.OrderItem.CUSTOMER_ORDER_PROPERTY).with("required", "true");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderitem.OrderItem.PRODUCT_NAME_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderitem.OrderItem.PRODUCT_NAME_PROPERTY).with("isPassword", "false")
+ .with("max", "100")
+ .with("isVersion", "false")
+ .with("javaType", "java.lang.String")
+ .with("sqlType", "VARCHAR()")
+ .with("isId", "false")
+ .with("isBool", "false")
+ .with("isBaseEntityField", "false")
+ .with("isNumber", "false")
+ .with("isString", "true")
+ .with("isDate", "false")
+ .with("graphqlType", "String")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderitem.OrderItem.QUANTITY_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderitem.OrderItem.QUANTITY_PROPERTY).with("isPassword", "false")
+ .with("db2_sqlType", "decimal(19,7)")
+ .with("isVersion", "false")
+ .with("oracle_sqlType", "number(19,7)")
+ .with("javaType", "java.lang.Integer")
+ .with("sqlType", "INTEGER")
+ .with("isId", "false")
+ .with("isBool", "false")
+ .with("isBaseEntityField", "false")
+ .with("isNumber", "true")
+ .with("isInt", "true")
+ .with("isString", "false")
+ .with("isDate", "false")
+ .with("graphqlType", "Int")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderitem.OrderItem.UNIT_PRICE_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderitem.OrderItem.UNIT_PRICE_PROPERTY).with("isPassword", "false")
+ .with("db2_sqlType", "decimal(19,7)")
+ .with("isVersion", "false")
+ .with("oracle_sqlType", "number(19,7)")
+ .with("javaType", "java.math.BigDecimal")
+ .with("sqlType", "NUMERIC(19,7)")
+ .with("isId", "false")
+ .with("isBool", "false")
+ .with("isBaseEntityField", "false")
+ .with("isNumber", "true")
+ .with("isString", "false")
+ .with("isDate", "false")
+ .with("graphqlType", "BigDecimal")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderitem.OrderItem.VERSION_PROPERTY).with("required", "true");
+ entityDescriptor.findProperty(com.example.requesttreeorderservice.orderitem.OrderItem.VERSION_PROPERTY).with("isPassword", "false")
+ .with("isVersion", "true")
+ .with("oracle_sqlType", "number(11)")
+ .with("javaType", "java.lang.Long")
+ .with("sqlType", "BIGINT")
+ .with("isId", "false")
+ .with("isBaseEntityField", "true")
+ .with("isBool", "false")
+ .with("isNumber", "false")
+ .with("isString", "false")
+ .with("isDate", "false")
+ .with("snowflake_sqlType", "number")
+ .with("graphqlType", "Long")
+ .with("isTime", "false")
+ .with("isText", "false");
+
+ $factory.register(entityDescriptor);
+ }
+}
\ No newline at end of file
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/GeneratedRuntimeModule.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/GeneratedRuntimeModule.java
new file mode 100644
index 00000000..b1c117f0
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/GeneratedRuntimeModule.java
@@ -0,0 +1,99 @@
+package com.example.requesttreeorderservice;
+
+/** Passive generated manifest. Database changes require context.ensureSchema(). */
+public final class GeneratedRuntimeModule {
+ private static final io.teaql.core.RuntimeModule MODULE = io.teaql.core.RuntimeModule.of(new EntityMetaRegistry())
+ .withCheckers(new com.example.requesttreeorderservice.platform.PlatformChecker(), new com.example.requesttreeorderservice.orderstatus.OrderStatusChecker(), new com.example.requesttreeorderservice.customer.CustomerChecker(), new com.example.requesttreeorderservice.customerorder.CustomerOrderChecker(), new com.example.requesttreeorderservice.orderitem.OrderItemChecker())
+ .withBootstrap(GeneratedRuntimeModule::ensureGeneratedBootstrap);
+
+ private GeneratedRuntimeModule() {}
+ public static io.teaql.core.RuntimeModule module() { return MODULE; }
+
+ /** Canonical KSML field to selected JSON wire name, consumed by HTTP/TFP adapters. */
+ public static java.util.Map> wireFieldMappings() {
+ return java.util.Map.ofEntries(
+ java.util.Map.entry("Platform", java.util.Map.ofEntries(java.util.Map.entry("id", "id"), java.util.Map.entry("name", "name"), java.util.Map.entry("version", "version"))),
+ java.util.Map.entry("OrderStatus", java.util.Map.ofEntries(java.util.Map.entry("platform", "platform"), java.util.Map.entry("id", "id"), java.util.Map.entry("name", "name"), java.util.Map.entry("code", "code"), java.util.Map.entry("color", "color"), java.util.Map.entry("display_order", "displayOrder"), java.util.Map.entry("version", "version"))),
+ java.util.Map.entry("Customer", java.util.Map.ofEntries(java.util.Map.entry("id", "id"), java.util.Map.entry("platform", "platform"), java.util.Map.entry("name", "name"), java.util.Map.entry("version", "version"))),
+ java.util.Map.entry("CustomerOrder", java.util.Map.ofEntries(java.util.Map.entry("id", "id"), java.util.Map.entry("customer", "customer"), java.util.Map.entry("status", "status"), java.util.Map.entry("order_number", "orderNumber"), java.util.Map.entry("order_date", "orderDate"), java.util.Map.entry("total_amount", "totalAmount"), java.util.Map.entry("version", "version"))),
+ java.util.Map.entry("OrderItem", java.util.Map.ofEntries(java.util.Map.entry("id", "id"), java.util.Map.entry("customer_order", "customerOrder"), java.util.Map.entry("product_name", "productName"), java.util.Map.entry("quantity", "quantity"), java.util.Map.entry("unit_price", "unitPrice"), java.util.Map.entry("version", "version")))
+ );
+ }
+
+ /** Accepted legacy aliases; empty until explicitly declared by the model. */
+ public static java.util.Map> wireFieldAliases() {
+ return java.util.Map.of();
+ }
+
+ private static void ensureGeneratedBootstrap(io.teaql.core.UserContext context) {
+ var domainRoots = Q.platforms().withIdIs(1L).comment("what: locate generated Domain Root").purpose("why: idempotent runtime bootstrap").executeForList(context);
+ com.example.requesttreeorderservice.platform.Platform domainRoot;
+ if (domainRoots.isEmpty()) {
+ domainRoot = new com.example.requesttreeorderservice.platform.Platform();
+ io.teaql.core.GeneratedSchemaBootstrap.initializeFixedId(context, domainRoot, 1L);
+ domainRoot.updateName("Commerce Test Platform");
+ domainRoot.auditAs("create generated Domain Root Platform").save(context);
+ } else { domainRoot = domainRoots.get(0); }
+ context.withActiveRoot(new io.teaql.core.ContextEntityRef("Platform", domainRoot.getId()));
+ var constantOrderStatus1001Rows = Q.orderStatuses().withIdIs(1001L).comment("what: locate generated constant").purpose("why: idempotent runtime bootstrap").executeForList(context);
+ if (constantOrderStatus1001Rows.isEmpty()) {
+ com.example.requesttreeorderservice.orderstatus.OrderStatus constantOrderStatus1001 = new com.example.requesttreeorderservice.orderstatus.OrderStatus();
+ constantOrderStatus1001 = io.teaql.core.GeneratedSchemaBootstrap.initializeFixedId(context, constantOrderStatus1001, 1001L);
+ constantOrderStatus1001.updatePlatform(domainRoot);
+ constantOrderStatus1001.updateName("New");
+ constantOrderStatus1001.updateCode("NEW");
+ constantOrderStatus1001.updateColor("#94A3B8");
+ constantOrderStatus1001.updateDisplayOrder(new java.math.BigDecimal("1"));
+ constantOrderStatus1001.auditAs("create model constant OrderStatus(1001)").save(context);
+ } else {
+ com.example.requesttreeorderservice.orderstatus.OrderStatus constantOrderStatus1001 = constantOrderStatus1001Rows.get(0);
+ boolean changed = false;
+ if (!(java.util.Objects.equals(constantOrderStatus1001.getPlatform().getId(), domainRoot.getId()))) { constantOrderStatus1001.updatePlatform(domainRoot); changed = true; }
+ if (!(java.util.Objects.equals(constantOrderStatus1001.getName(), "New"))) { constantOrderStatus1001.updateName("New"); changed = true; }
+ if (!(java.util.Objects.equals(constantOrderStatus1001.getCode(), "NEW"))) { constantOrderStatus1001.updateCode("NEW"); changed = true; }
+ if (!(java.util.Objects.equals(constantOrderStatus1001.getColor(), "#94A3B8"))) { constantOrderStatus1001.updateColor("#94A3B8"); changed = true; }
+ if (!((constantOrderStatus1001.getDisplayOrder() != null && constantOrderStatus1001.getDisplayOrder().compareTo(new java.math.BigDecimal("1")) == 0))) { constantOrderStatus1001.updateDisplayOrder(new java.math.BigDecimal("1")); changed = true; }
+ if (changed) constantOrderStatus1001.auditAs("reconcile model constant OrderStatus(1001)").save(context);
+ }
+ var constantOrderStatus1002Rows = Q.orderStatuses().withIdIs(1002L).comment("what: locate generated constant").purpose("why: idempotent runtime bootstrap").executeForList(context);
+ if (constantOrderStatus1002Rows.isEmpty()) {
+ com.example.requesttreeorderservice.orderstatus.OrderStatus constantOrderStatus1002 = new com.example.requesttreeorderservice.orderstatus.OrderStatus();
+ constantOrderStatus1002 = io.teaql.core.GeneratedSchemaBootstrap.initializeFixedId(context, constantOrderStatus1002, 1002L);
+ constantOrderStatus1002.updatePlatform(domainRoot);
+ constantOrderStatus1002.updateName("Paid");
+ constantOrderStatus1002.updateCode("PAID");
+ constantOrderStatus1002.updateColor("#22C55E");
+ constantOrderStatus1002.updateDisplayOrder(new java.math.BigDecimal("2"));
+ constantOrderStatus1002.auditAs("create model constant OrderStatus(1002)").save(context);
+ } else {
+ com.example.requesttreeorderservice.orderstatus.OrderStatus constantOrderStatus1002 = constantOrderStatus1002Rows.get(0);
+ boolean changed = false;
+ if (!(java.util.Objects.equals(constantOrderStatus1002.getPlatform().getId(), domainRoot.getId()))) { constantOrderStatus1002.updatePlatform(domainRoot); changed = true; }
+ if (!(java.util.Objects.equals(constantOrderStatus1002.getName(), "Paid"))) { constantOrderStatus1002.updateName("Paid"); changed = true; }
+ if (!(java.util.Objects.equals(constantOrderStatus1002.getCode(), "PAID"))) { constantOrderStatus1002.updateCode("PAID"); changed = true; }
+ if (!(java.util.Objects.equals(constantOrderStatus1002.getColor(), "#22C55E"))) { constantOrderStatus1002.updateColor("#22C55E"); changed = true; }
+ if (!((constantOrderStatus1002.getDisplayOrder() != null && constantOrderStatus1002.getDisplayOrder().compareTo(new java.math.BigDecimal("2")) == 0))) { constantOrderStatus1002.updateDisplayOrder(new java.math.BigDecimal("2")); changed = true; }
+ if (changed) constantOrderStatus1002.auditAs("reconcile model constant OrderStatus(1002)").save(context);
+ }
+ var constantOrderStatus1003Rows = Q.orderStatuses().withIdIs(1003L).comment("what: locate generated constant").purpose("why: idempotent runtime bootstrap").executeForList(context);
+ if (constantOrderStatus1003Rows.isEmpty()) {
+ com.example.requesttreeorderservice.orderstatus.OrderStatus constantOrderStatus1003 = new com.example.requesttreeorderservice.orderstatus.OrderStatus();
+ constantOrderStatus1003 = io.teaql.core.GeneratedSchemaBootstrap.initializeFixedId(context, constantOrderStatus1003, 1003L);
+ constantOrderStatus1003.updatePlatform(domainRoot);
+ constantOrderStatus1003.updateName("Cancelled");
+ constantOrderStatus1003.updateCode("CANCELLED");
+ constantOrderStatus1003.updateColor("#EF4444");
+ constantOrderStatus1003.updateDisplayOrder(new java.math.BigDecimal("3"));
+ constantOrderStatus1003.auditAs("create model constant OrderStatus(1003)").save(context);
+ } else {
+ com.example.requesttreeorderservice.orderstatus.OrderStatus constantOrderStatus1003 = constantOrderStatus1003Rows.get(0);
+ boolean changed = false;
+ if (!(java.util.Objects.equals(constantOrderStatus1003.getPlatform().getId(), domainRoot.getId()))) { constantOrderStatus1003.updatePlatform(domainRoot); changed = true; }
+ if (!(java.util.Objects.equals(constantOrderStatus1003.getName(), "Cancelled"))) { constantOrderStatus1003.updateName("Cancelled"); changed = true; }
+ if (!(java.util.Objects.equals(constantOrderStatus1003.getCode(), "CANCELLED"))) { constantOrderStatus1003.updateCode("CANCELLED"); changed = true; }
+ if (!(java.util.Objects.equals(constantOrderStatus1003.getColor(), "#EF4444"))) { constantOrderStatus1003.updateColor("#EF4444"); changed = true; }
+ if (!((constantOrderStatus1003.getDisplayOrder() != null && constantOrderStatus1003.getDisplayOrder().compareTo(new java.math.BigDecimal("3")) == 0))) { constantOrderStatus1003.updateDisplayOrder(new java.math.BigDecimal("3")); changed = true; }
+ if (changed) constantOrderStatus1003.auditAs("reconcile model constant OrderStatus(1003)").save(context);
+ }
+ }
+}
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/Q.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/Q.java
new file mode 100644
index 00000000..d170581a
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/Q.java
@@ -0,0 +1,52 @@
+
+package com.example.requesttreeorderservice;
+
+import io.teaql.core.criteria.Operator;
+
+public class Q {
+ public static com.example.requesttreeorderservice.platform.PlatformRequest platforms(){
+ return new com.example.requesttreeorderservice.platform.PlatformRequest(com.example.requesttreeorderservice.platform.Platform.class).selectSelf().withVersion(Operator.GREATER_THAN, 0l);
+ }
+ public static com.example.requesttreeorderservice.platform.PlatformRequest platformsWithMinimalFields(){
+ return new com.example.requesttreeorderservice.platform.PlatformRequest(com.example.requesttreeorderservice.platform.Platform.class).withVersion(Operator.GREATER_THAN, 0l);
+ }
+
+
+
+ public static com.example.requesttreeorderservice.orderstatus.OrderStatusRequest orderStatuses(){
+ return new com.example.requesttreeorderservice.orderstatus.OrderStatusRequest(com.example.requesttreeorderservice.orderstatus.OrderStatus.class).selectSelf().withVersion(Operator.GREATER_THAN, 0l);
+ }
+ public static com.example.requesttreeorderservice.orderstatus.OrderStatusRequest orderStatusesWithMinimalFields(){
+ return new com.example.requesttreeorderservice.orderstatus.OrderStatusRequest(com.example.requesttreeorderservice.orderstatus.OrderStatus.class).withVersion(Operator.GREATER_THAN, 0l);
+ }
+
+
+
+ public static com.example.requesttreeorderservice.customer.CustomerRequest customers(){
+ return new com.example.requesttreeorderservice.customer.CustomerRequest(com.example.requesttreeorderservice.customer.Customer.class).selectSelf().withVersion(Operator.GREATER_THAN, 0l);
+ }
+ public static com.example.requesttreeorderservice.customer.CustomerRequest customersWithMinimalFields(){
+ return new com.example.requesttreeorderservice.customer.CustomerRequest(com.example.requesttreeorderservice.customer.Customer.class).withVersion(Operator.GREATER_THAN, 0l);
+ }
+
+
+
+ public static com.example.requesttreeorderservice.customerorder.CustomerOrderRequest customerOrders(){
+ return new com.example.requesttreeorderservice.customerorder.CustomerOrderRequest(com.example.requesttreeorderservice.customerorder.CustomerOrder.class).selectSelf().withVersion(Operator.GREATER_THAN, 0l);
+ }
+ public static com.example.requesttreeorderservice.customerorder.CustomerOrderRequest customerOrdersWithMinimalFields(){
+ return new com.example.requesttreeorderservice.customerorder.CustomerOrderRequest(com.example.requesttreeorderservice.customerorder.CustomerOrder.class).withVersion(Operator.GREATER_THAN, 0l);
+ }
+
+
+
+ public static com.example.requesttreeorderservice.orderitem.OrderItemRequest orderItems(){
+ return new com.example.requesttreeorderservice.orderitem.OrderItemRequest(com.example.requesttreeorderservice.orderitem.OrderItem.class).selectSelf().withVersion(Operator.GREATER_THAN, 0l);
+ }
+ public static com.example.requesttreeorderservice.orderitem.OrderItemRequest orderItemsWithMinimalFields(){
+ return new com.example.requesttreeorderservice.orderitem.OrderItemRequest(com.example.requesttreeorderservice.orderitem.OrderItem.class).withVersion(Operator.GREATER_THAN, 0l);
+ }
+
+
+
+}
\ No newline at end of file
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/Repositories.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/Repositories.java
new file mode 100644
index 00000000..e69de29b
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/RequestTreeOrderServiceUserContext.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/RequestTreeOrderServiceUserContext.java
new file mode 100644
index 00000000..673d21a5
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/RequestTreeOrderServiceUserContext.java
@@ -0,0 +1,10 @@
+
+package com.example.requesttreeorderservice;
+
+import io.teaql.core.UserContext;
+public interface RequestTreeOrderServiceUserContext extends UserContext{
+
+
+
+
+}
\ No newline at end of file
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customer/Customer.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customer/Customer.java
new file mode 100644
index 00000000..5019c241
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customer/Customer.java
@@ -0,0 +1,141 @@
+
+package com.example.requesttreeorderservice.customer;
+
+import com.example.requesttreeorderservice.customerorder.CustomerOrder;
+import com.example.requesttreeorderservice.platform.Platform;
+import io.teaql.core.Audited;
+import io.teaql.core.BaseEntity;
+import io.teaql.core.EntityStatus;
+import io.teaql.core.FieldLayout;
+import io.teaql.core.FrameworkInternal;
+import io.teaql.core.RemoteInput;
+import io.teaql.core.SmartList;
+import java.util.Objects;
+
+/**
+ * [TEAQL AI WARNING]
+ * TeaQL was explicitly designed to PREVENT AI hallucinations and random guessing.
+ * DO NOT GUESS METHOD NAMES!
+ * The methods listed below are the ONLY valid ways to interact with this entity.
+ * If you encounter compilation errors (e.g., method not found), DO NOT guess another method name.
+ * Read the method signatures in this file before proceeding.
+ */
+public class Customer extends BaseEntity implements RemoteInput {
+ public static String INTERNAL_TYPE = "Customer";
+
+ // Framework metadata: complete fixed layout, independent of SQL/projection order.
+ public static final String __TEAQL_FIELD_LAYOUT_REVISION = "52190974dcef386c9676cd86cd564677c6cb5bb058e7e13bfea8b26db14f86a2";
+ public static final java.util.Map __TEAQL_FIXED_FIELD_INDEXES =
+ java.util.Map.ofEntries(java.util.Map.entry("id", 0), java.util.Map.entry("platform", 1), java.util.Map.entry("name", 2), java.util.Map.entry("version", 3));
+ public static final java.util.Map> __TEAQL_FIXED_FIELD_MAPPINGS =
+ java.util.Map.ofEntries(java.util.Map.entry("id", java.util.List.of("id", "id")), java.util.Map.entry("platform", java.util.List.of("platform", "platform")), java.util.Map.entry("name", java.util.List.of("name", "name")), java.util.Map.entry("version", java.util.List.of("version", "version")));
+ public static final java.util.Set __TEAQL_FIXED_RELATION_NAMES = java.util.Set.of(
+ "customerOrderList");
+ public static final FieldLayout __TEAQL_FIELD_LAYOUT =
+ FieldLayout.installGenerated(FieldLayout.generated(
+ Customer.class, __TEAQL_FIELD_LAYOUT_REVISION,
+ __TEAQL_FIXED_FIELD_INDEXES, __TEAQL_FIXED_FIELD_MAPPINGS, __TEAQL_FIXED_RELATION_NAMES));
+
+
+ public static final String PLATFORM_PROPERTY = "platform";
+ public static final String NAME_PROPERTY = "name";
+ public static final String CUSTOMER_ORDER_LIST_PROPERTY = "customerOrderList";
+ private Platform platform;
+
+ private String name;
+
+ private SmartList customerOrderList;
+
+ public Platform getPlatform(){
+ return this.platform;
+ }
+
+ public String getName(){
+ return this.name;
+ }
+
+ public SmartList getCustomerOrderList(){
+ return this.customerOrderList;
+ }
+ public Customer updatePlatform(Platform platform){
+ if(Objects.equals(this.platform, platform)){
+ return this;
+ }
+ handleUpdate(PLATFORM_PROPERTY, getPlatform(), platform);
+ this.platform = platform;
+ return this;
+ }
+
+ public Customer updateName(String name){
+ name = (name == null ? null : name.trim());
+ if(Objects.equals(this.name, name)){
+ return this;
+ }
+ handleUpdate(NAME_PROPERTY, getName(), name);
+ this.name = name;
+ return this;
+ }
+
+ public Customer addCustomerOrder(CustomerOrder customerOrder){
+ if (customerOrder == null){
+ return this;
+ }
+
+ if(null == this.customerOrderList){
+ this.customerOrderList = new SmartList<>();
+ }
+
+ this.customerOrderList.add(customerOrder);
+ customerOrder.updateCustomer(this);
+ return this;
+ }
+
+ public static Customer refer(Long id){
+ Customer refer = new Customer();
+ refer.__internalSet("id", id);
+ refer.set$status(EntityStatus.REFER);
+ return refer;
+ }
+ @Override
+ public String typeName(){
+ return INTERNAL_TYPE;
+ }
+
+ public Customer comment(String comment){
+ this.setComment(comment);
+ return this;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public Audited auditAs(String action) {
+ return new Audited<>(this, action);
+ }
+
+ // ===== Framework Internal: generated switch dispatch =====
+ @Override
+ @FrameworkInternal
+ public void __internalSet(String property, Object value) {
+ markPropertyLoaded(property);
+ switch (property) {
+ case "platform": this.platform = (Platform) value; break;
+
+ case "name": this.name = (value == null ? null : ((String)value).trim()); break;
+
+ case "customerOrderList": this.customerOrderList = (SmartList) value; break;
+ default: super.__internalSet(property, value);
+ }
+ }
+
+ @Override
+ @FrameworkInternal
+ public Object __internalGet(String property) {
+ switch (property) {
+ case "platform": return this.platform;
+ case "name": return this.name;
+ case "customerOrderList": return this.customerOrderList;
+ default: return super.__internalGet(property);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customer/CustomerChecker.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customer/CustomerChecker.java
new file mode 100644
index 00000000..ffb923c6
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customer/CustomerChecker.java
@@ -0,0 +1,62 @@
+
+package com.example.requesttreeorderservice.customer;
+
+import com.example.requesttreeorderservice.customerorder.CustomerOrder;
+import com.example.requesttreeorderservice.customerorder.CustomerOrderChecker;
+import com.example.requesttreeorderservice.platform.Platform;
+import com.example.requesttreeorderservice.platform.PlatformChecker;
+import io.teaql.core.UserContext;
+import io.teaql.core.checker.Checker;
+import io.teaql.core.checker.ObjectLocation;
+
+public class CustomerChecker implements Checker{
+
+ public String type(){
+ return Customer.INTERNAL_TYPE;
+ }
+
+ public void checkAndFix(UserContext _context, Customer customer, ObjectLocation _parentLocation){
+ if(needCheck(_context, customer)){
+ markAsChecked(_context, customer);
+ doCheck(_context, customer, _parentLocation);
+ }
+ }
+
+ public void doCheck(UserContext _context, Customer customer, ObjectLocation _parentLocation){
+ if((customer == null)){
+ return;
+ }
+ if(customer.newItem()){
+ }else if(customer.updateItem()){
+ if(!customer.isPropertyLoaded("platform")){
+ invalidTypeCheck(_context, newLocation(_parentLocation, "platform"), "Mutation requires a fully loaded entity");
+ }
+ if(!customer.isPropertyLoaded("name")){
+ invalidTypeCheck(_context, newLocation(_parentLocation, "name"), "Mutation requires a fully loaded entity");
+ }
+
+ }
+ checkPlatform(_context, customer.getProperty(Customer.PLATFORM_PROPERTY), newLocation(_parentLocation, "platform"));
+ checkName(_context, customer.getProperty(Customer.NAME_PROPERTY), newLocation(_parentLocation, "name"));
+ for(int i = 0; customer.getCustomerOrderList() != null && i < customer.getCustomerOrderList().size(); i++){
+ CustomerOrder customerOrder = customer.getCustomerOrderList().get(i);
+ new CustomerOrderChecker().checkAndFix(_context, customerOrder, newLocation(_parentLocation, "customer_order_list", i));
+ }
+ }
+
+ public void checkPlatform(UserContext _context, Platform platform, ObjectLocation _parentLocation){
+ requiredCheck(_context, _parentLocation, platform);
+ if((platform == null)){
+ return;
+ }
+ new PlatformChecker().checkAndFix(_context, platform, _parentLocation);
+ }
+ public void checkName(UserContext _context, String name, ObjectLocation _parentLocation){
+ requiredCheck(_context, _parentLocation, name);
+ if((name == null)){
+ return;
+ }
+ maxStringCheck(_context, _parentLocation, 100, name);
+
+ }
+}
\ No newline at end of file
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customer/CustomerExpression.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customer/CustomerExpression.java
new file mode 100644
index 00000000..5cbee509
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customer/CustomerExpression.java
@@ -0,0 +1,61 @@
+
+package com.example.requesttreeorderservice.customer;
+
+import com.example.requesttreeorderservice.customerorder.CustomerOrder;
+import com.example.requesttreeorderservice.customerorder.CustomerOrderListExpression;
+import com.example.requesttreeorderservice.platform.Platform;
+import com.example.requesttreeorderservice.platform.PlatformExpression;
+import io.teaql.core.UserContext;
+import io.teaql.core.value.BaseEntityExpression;
+import io.teaql.core.value.Expression;
+import io.teaql.core.value.ExpressionAdaptor;
+import java.util.function.Function;
+
+public class CustomerExpression extends ExpressionAdaptor implements BaseEntityExpression {
+ public CustomerExpression(Expression expression){
+ super(expression);
+ }
+
+ public CustomerExpression(Expression expression, Function function){
+ super(expression, function);
+ }
+
+ public CustomerExpression updateId(Long id){
+ return new CustomerExpression(this, $it -> {((Customer)$it).__internalSet("id", id); return this;});
+ }
+
+ public CustomerExpression save(UserContext userContext){
+ return new CustomerExpression(this, $it -> ((Customer)$it).auditAs("Saved by Expression").save(userContext));
+ }
+
+ public CustomerExpression save(String intent, UserContext userContext){
+ return new CustomerExpression(this, $it -> ((Customer)$it).auditAs(intent).save(userContext));
+ }
+
+ public boolean isNull() {
+ return resolve() == null;
+ }
+
+
+ public PlatformExpression getPlatform(){
+ return new PlatformExpression(loaded("platform", Customer::getPlatform));
+ }
+
+ public CustomerExpression updatePlatform(Platform platform){
+ return new CustomerExpression(this, $it -> ((Customer)$it).updatePlatform(platform));
+ }
+
+ public Expression getName(){
+ return loaded("name", Customer::getName);
+ }
+ public CustomerExpression updateName(String name){
+ return new CustomerExpression(this, $it -> ((Customer)$it).updateName(name));
+ }
+
+ public CustomerOrderListExpression getCustomerOrderList(){
+ return new CustomerOrderListExpression(loaded("customerOrderList", Customer::getCustomerOrderList));
+ }
+ public CustomerExpression addCustomerOrder(CustomerOrder customerOrder){
+ return new CustomerExpression(this, $it -> ((Customer)$it).addCustomerOrder(customerOrder));
+ }
+}
\ No newline at end of file
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customer/CustomerListExpression.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customer/CustomerListExpression.java
new file mode 100644
index 00000000..7c856e19
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customer/CustomerListExpression.java
@@ -0,0 +1,25 @@
+
+package com.example.requesttreeorderservice.customer;
+
+import io.teaql.core.SmartList;
+import io.teaql.core.value.Expression;
+import io.teaql.core.value.SmartListExpression;
+import java.util.function.Function;
+
+public class CustomerListExpression extends SmartListExpression {
+ public CustomerListExpression(Expression> expression){
+ super(expression);
+ }
+
+ public CustomerListExpression(Expression expression, Function> function){
+ super(expression, function);
+ }
+
+ public CustomerExpression first() {
+ return new CustomerExpression(super.first());
+ }
+
+ public CustomerExpression get(int index) {
+ return new CustomerExpression(super.get(index));
+ }
+}
\ No newline at end of file
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customer/CustomerRequest.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customer/CustomerRequest.java
new file mode 100644
index 00000000..95238396
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customer/CustomerRequest.java
@@ -0,0 +1,849 @@
+
+package com.example.requesttreeorderservice.customer;
+
+import com.example.requesttreeorderservice.Q;
+import com.example.requesttreeorderservice.customerorder.CustomerOrder;
+import com.example.requesttreeorderservice.customerorder.CustomerOrderRequest;
+import com.example.requesttreeorderservice.platform.Platform;
+import com.example.requesttreeorderservice.platform.PlatformRequest;
+import io.teaql.core.AggrFunction;
+import io.teaql.core.BaseRequest;
+import io.teaql.core.PropertyReference;
+import io.teaql.core.SearchCriteria;
+import io.teaql.core.SubQuerySearchCriteria;
+import io.teaql.core.criteria.Operator;
+import io.teaql.core.criteria.TwoOperatorCriteria;
+
+public class CustomerRequest extends BaseRequest {
+
+ /**
+ * @deprecated AI agents and business code must use the generated Q facade
+ * instead of constructing request builders directly.
+ */
+ @Deprecated
+ @SuppressWarnings("unchecked")
+ public CustomerRequest(Class returnType){
+ this(returnType, () -> (T) new Customer());
+ }
+
+ protected CustomerRequest(Class returnType, java.util.function.Supplier extends T> factory){
+ super(returnType, factory);
+ selectId();
+ selectVersion();
+ }
+
+ public CustomerRequest comment(String comment){
+ super.internalComment(comment);
+ return this;
+ }
+
+ // purpose() 继承自 BaseRequest,返回 ExecutableRequest(终结方法)
+
+ public CustomerRequest returnType(Class extends T> returnType){
+ super.setReturnType(returnType);
+ return this;
+ }
+
+ public CustomerRequest enableAggregationCache(long cacheExpiredMillis){
+ super.enableAggregationCache();
+ super.aggregateCacheTime(cacheExpiredMillis);
+ return this;
+ }
+
+ public CustomerRequest enableAggregationCache(){
+ return enableAggregationCache(0l);
+ }
+
+
+ public CustomerRequest propagateAggregationCache(long cacheExpiredMillis){
+ super.propagateAggregationCache(cacheExpiredMillis);
+ return this;
+ }
+
+ /**
+ * Accept best-effort stateful seek optimization for browsing consecutive pages.
+ * Do not use this for business processing that must visit every row exactly once.
+ */
+ public CustomerRequest optimizeForContinuousPageFetch(){
+ super.optimizeForContinuousPageFetch();
+ return this;
+ }
+
+ public CustomerRequest optimizeForContinuousPageFetch(String namespace, int ttlSeconds){
+ super.optimizeForContinuousPageFetch(namespace, ttlSeconds);
+ return this;
+ }
+
+ public CustomerRequest optimizePaginationWithIdSet(){
+ super.optimizePaginationWithIdSet();
+ return this;
+ }
+
+ public CustomerRequest optimizePaginationWithIdSet(
+ String namespace, int ttlSeconds, int maxIds){
+ super.optimizePaginationWithIdSet(namespace, ttlSeconds, maxIds);
+ return this;
+ }
+
+ public CustomerRequest topNProbeParentThreshold(int threshold){
+ super.topNProbeParentThreshold(threshold);
+ return this;
+ }
+
+ public CustomerRequest appendSearchCriteria(SearchCriteria searchCriteria){
+ return (CustomerRequest)super.appendSearchCriteria(searchCriteria);
+ }
+
+ public CustomerRequest filter(String property1, Operator operator, String property2){
+ return appendSearchCriteria(new TwoOperatorCriteria(operator, new PropertyReference(property1), new PropertyReference(property2)));
+ }
+
+
+ public CustomerRequest matchingAnyOf(CustomerRequest customer){
+ super.internalMatchAny(customer);
+ return this;
+ }
+
+ public CustomerRequest enhanceChildrenIfNeeded(){
+ return this;
+ }
+
+ public CustomerRequest withDeletedRows(){
+ super.withDeletedRows();
+ return this;
+ }
+
+ public CustomerRequest deletedRowsOnly(){
+ super.deletedRowsOnly();
+ return this;
+ }
+
+ public CustomerRequest selectSelf(){
+ super.selectSelf();
+ return selectId().selectPlatformIdOnly().selectName().selectVersion();
+ }
+
+ public CustomerRequest selectSelfFields(){
+ return selectSelf();
+ }
+
+ public CustomerRequest selectSelfWithoutParent(){
+ selectId();
+ selectVersion();
+ selectProperty(Customer.ID_PROPERTY);
+ selectProperty(Customer.PLATFORM_PROPERTY);
+ selectProperty(Customer.NAME_PROPERTY);
+ selectProperty(Customer.VERSION_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest selectAll(){
+ super.selectAll();
+ return selectId().selectPlatform().selectName().selectVersion();
+ }
+
+ public CustomerRequest selectChildren(){
+ super.selectAny();
+ selectCustomerOrderList();
+ return selectId().selectPlatform().selectName().selectVersion();
+ }
+
+
+ public CustomerRequest selectId(){
+ selectProperty(Customer.ID_PROPERTY);
+ return this;
+ }
+
+ /**
+ * fill the id with customized rawSqlSegment, TEAQL uses ({rawSqlSegment} AS id) to fetch id property.
+ * @param rawSqlSegment customized rawSqlSegment
+ */
+
+
+
+
+ public CustomerRequest unselectId(){
+ unselectProperty(Customer.ID_PROPERTY);
+ return this;
+ }
+ public CustomerRequest selectPlatformIdOnly(){
+ selectProperty(Customer.PLATFORM_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest selectPlatform(){
+ return selectPlatformWith(Q.platforms().unlimited().selectSelf());
+ }
+
+ public CustomerRequest selectPlatformWith(PlatformRequest platform){
+ selectProperty(Customer.PLATFORM_PROPERTY);
+ enhanceRelation(Customer.PLATFORM_PROPERTY, platform,
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.RELATION_SELECT, "selectPlatformWith", null, Customer.PLATFORM_PROPERTY));
+ return this;
+ }
+
+ public CustomerRequest unselectPlatform(){
+ unselectProperty(Customer.PLATFORM_PROPERTY);
+ return this;
+ }
+ public CustomerRequest selectName(){
+ selectProperty(Customer.NAME_PROPERTY);
+ return this;
+ }
+
+ /**
+ * fill the name with customized rawSqlSegment, TEAQL uses ({rawSqlSegment} AS name) to fetch name property.
+ * @param rawSqlSegment customized rawSqlSegment
+ */
+
+
+
+
+ public CustomerRequest unselectName(){
+ unselectProperty(Customer.NAME_PROPERTY);
+ return this;
+ }
+ public CustomerRequest selectVersion(){
+ selectProperty(Customer.VERSION_PROPERTY);
+ return this;
+ }
+
+ /**
+ * fill the version with customized rawSqlSegment, TEAQL uses ({rawSqlSegment} AS version) to fetch version property.
+ * @param rawSqlSegment customized rawSqlSegment
+ */
+
+
+
+
+ public CustomerRequest unselectVersion(){
+ unselectProperty(Customer.VERSION_PROPERTY);
+ return this;
+ }
+ public CustomerRequest selectCustomerOrderList(){
+ return selectCustomerOrderListWith(Q.customerOrders().selectSelf());
+ }
+
+ public CustomerRequest selectCustomerOrderListWith(CustomerOrderRequest customerOrderList){
+ enhanceRelation(Customer.CUSTOMER_ORDER_LIST_PROPERTY, customerOrderList,
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.RELATION_SELECT, "selectCustomerOrderListWith", null, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+
+ public CustomerRequest withId(Operator operator, Object... values){
+ return appendSearchCriteria(createIdCriteria(operator, values));
+ }
+
+ public SearchCriteria createIdCriteria(Operator operator, Object... values) {
+ return createBasicSearchCriteria(Customer.ID_PROPERTY, operator, values);
+ }
+
+ public CustomerRequest withIdIsNot(Long id){
+ return withId(Operator.NOT_EQUAL, id);
+ }
+
+ public CustomerRequest withIdIn(Long... id){
+ return withId(Operator.IN, (Object[])id);
+ }
+
+ public CustomerRequest withIdNotIn(Long... id){
+ return withId(Operator.NOT_IN, (Object[])id);
+ }
+ public CustomerRequest withIdIs(Long id){
+ return withId(Operator.EQUAL, id);
+ }
+
+
+
+ public CustomerRequest filterByPlatform(Platform... platform){
+ if (platform == null || platform.length == 0) {
+ throw new IllegalArgumentException("filterByPlatform parameter platform cannot be empty");
+ }
+ return appendSearchCriteria(createPlatformCriteria(Operator.EQUAL, (Object[])platform));
+ }
+
+ public CustomerRequest withPlatform(Operator operator, Object... values){
+ return appendSearchCriteria(createPlatformCriteria(operator, values));
+ }
+
+ public CustomerRequest withPlatformIsUnknown(){
+ return withPlatform(Operator.IS_NULL);
+ }
+
+ public CustomerRequest withPlatformIsKnown(){
+ return withPlatform(Operator.IS_NOT_NULL);
+ }
+
+ public SearchCriteria createPlatformCriteria(Operator operator, Object... values) {
+ return createBasicSearchCriteria(Customer.PLATFORM_PROPERTY, operator, values);
+ }
+
+ public CustomerRequest filterByPlatform(Long platform){
+ if(platform == null){
+ return this;
+ }
+ return withPlatform(Operator.EQUAL, platform);
+ }
+ public CustomerRequest withPlatformMatching(PlatformRequest platform){
+ return appendSearchCriteria(new SubQuerySearchCriteria(Customer.PLATFORM_PROPERTY, platform, Platform.ID_PROPERTY));
+ }
+
+ public CustomerRequest withoutPlatformMatching(PlatformRequest platform){
+ return appendSearchCriteria(SearchCriteria.not(
+ new SubQuerySearchCriteria(Customer.PLATFORM_PROPERTY, platform, Platform.ID_PROPERTY)));
+ }
+
+ public CustomerRequest filterByName(String... name){
+ if (name == null || name.length == 0) {
+ throw new IllegalArgumentException("filterByName parameter name cannot be empty");
+ }
+ return appendSearchCriteria(createNameCriteria(Operator.EQUAL, (Object[])name));
+ }
+
+ public CustomerRequest withName(Operator operator, Object... values){
+ return appendSearchCriteria(createNameCriteria(operator, values));
+ }
+
+ public CustomerRequest withNameIsUnknown(){
+ return withName(Operator.IS_NULL);
+ }
+
+ public CustomerRequest withNameIsKnown(){
+ return withName(Operator.IS_NOT_NULL);
+ }
+
+ public SearchCriteria createNameCriteria(Operator operator, Object... values) {
+ return createBasicSearchCriteria(Customer.NAME_PROPERTY, operator, values);
+ }
+
+ public CustomerRequest withNameIsNot(String name){
+ return withName(Operator.NOT_EQUAL, name);
+ }
+
+ public CustomerRequest withNameIn(String... name){
+ return withName(Operator.IN, (Object[])name);
+ }
+
+ public CustomerRequest withNameNotIn(String... name){
+ return withName(Operator.NOT_IN, (Object[])name);
+ }
+ public CustomerRequest withNameGreaterThan(String name){
+ return withName(Operator.GREATER_THAN, name);
+ }
+
+ public CustomerRequest withNameGreaterThanOrEqualTo(String name){
+ return withName(Operator.GREATER_THAN_OR_EQUAL, name);
+ }
+
+ public CustomerRequest withNameLessThan(String name){
+ return withName(Operator.LESS_THAN, name);
+ }
+
+ public CustomerRequest withNameLessThanOrEqualTo(String name){
+ return withName(Operator.LESS_THAN_OR_EQUAL, name);
+ }
+
+ public CustomerRequest withNameBetween(String startOfName, String endOfName){
+ return withName(Operator.BETWEEN, startOfName, endOfName);
+ }
+ public CustomerRequest withNameStartingWith(String name){
+ return withName(Operator.BEGIN_WITH, name);
+ }
+ public CustomerRequest withNameContaining(String name){
+ return withName(Operator.CONTAIN, name);
+ }
+
+ public CustomerRequest withNameNotContaining(String name){
+ return withName(Operator.NOT_CONTAIN, name);
+ }
+
+ public CustomerRequest withNameNotStartingWith(String name){
+ return withName(Operator.NOT_BEGIN_WITH, name);
+ }
+
+ public CustomerRequest withNameEndingWith(String name){
+ return withName(Operator.END_WITH, name);
+ }
+
+ public CustomerRequest withNameNotEndingWith(String name){
+ return withName(Operator.NOT_END_WITH, name);
+ }
+
+ public CustomerRequest withNameIs(String name){
+ return withName(Operator.EQUAL, name);
+ }
+
+ public CustomerRequest withNameSoundingLike(String name){
+ return withName(Operator.SOUNDS_LIKE, name);
+ }
+
+
+
+ public CustomerRequest filterByVersion(Long... version){
+ if (version == null || version.length == 0) {
+ throw new IllegalArgumentException("filterByVersion parameter version cannot be empty");
+ }
+ return appendSearchCriteria(createVersionCriteria(Operator.EQUAL, (Object[])version));
+ }
+
+ public CustomerRequest withVersion(Operator operator, Object... values){
+ return appendSearchCriteria(createVersionCriteria(operator, values));
+ }
+
+ public CustomerRequest withVersionIsUnknown(){
+ return withVersion(Operator.IS_NULL);
+ }
+
+ public CustomerRequest withVersionIsKnown(){
+ return withVersion(Operator.IS_NOT_NULL);
+ }
+
+ public SearchCriteria createVersionCriteria(Operator operator, Object... values) {
+ return createBasicSearchCriteria(Customer.VERSION_PROPERTY, operator, values);
+ }
+
+ public CustomerRequest withVersionIs(Long version){
+ return withVersion(Operator.EQUAL, version);
+ }
+
+ public CustomerRequest withVersionIsNot(Long version){
+ return withVersion(Operator.NOT_EQUAL, version);
+ }
+
+ public CustomerRequest withVersionIn(Long... version){
+ return withVersion(Operator.IN, (Object[])version);
+ }
+
+ public CustomerRequest withVersionNotIn(Long... version){
+ return withVersion(Operator.NOT_IN, (Object[])version);
+ }
+ public CustomerRequest withVersionGreaterThan(Long version){
+ return withVersion(Operator.GREATER_THAN, version);
+ }
+
+ public CustomerRequest withVersionGreaterThanOrEqualTo(Long version){
+ return withVersion(Operator.GREATER_THAN_OR_EQUAL, version);
+ }
+
+ public CustomerRequest withVersionLessThan(Long version){
+ return withVersion(Operator.LESS_THAN, version);
+ }
+
+ public CustomerRequest withVersionLessThanOrEqualTo(Long version){
+ return withVersion(Operator.LESS_THAN_OR_EQUAL, version);
+ }
+
+ public CustomerRequest withVersionBetween(Long startOfVersion, Long endOfVersion){
+ return withVersion(Operator.BETWEEN, startOfVersion, endOfVersion);
+ }
+
+
+ public CustomerRequest withCustomerOrderListMatching(CustomerOrderRequest customerOrderRequest){
+ return appendSearchCriteria(new SubQuerySearchCriteria(Customer.ID_PROPERTY, customerOrderRequest, CustomerOrder.CUSTOMER_PROPERTY));
+ }
+
+ public CustomerRequest withoutCustomerOrderListMatching(CustomerOrderRequest customerOrderRequest){
+ return appendSearchCriteria(SearchCriteria.not(new SubQuerySearchCriteria(Customer.ID_PROPERTY, customerOrderRequest, CustomerOrder.CUSTOMER_PROPERTY)));
+ }
+
+ public CustomerRequest haveCustomerOrders(){
+ return withCustomerOrderListMatching(Q.customerOrders().unlimited());
+ }
+
+ public CustomerRequest haveNoCustomerOrders(){
+ return withoutCustomerOrderListMatching(Q.customerOrders().unlimited());
+ }
+
+ public CustomerRequest count(){
+ super.count();
+ setPageCountOperation(io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.NAMED_COUNT, "count", null, null));
+ return this;
+ }
+ public CustomerRequest countAs(String retName){
+ super.count(retName);
+ setPageCountOperation(io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.NAMED_COUNT, "countAs", retName, null));
+ return this;
+ }
+ public CustomerRequest groupByPlatformWithDetails(){
+ return groupByPlatformWithDetails(Q.platforms().unlimited());
+ }
+
+ public CustomerRequest groupByPlatformWithDetails(PlatformRequest subRequest){
+ aggregate(Customer.PLATFORM_PROPERTY, subRequest);
+ return this;
+ }
+
+
+
+ public CustomerRequest groupByCustomerOrdersWithDetails(CustomerOrderRequest subRequest){
+ aggregate(Customer.CUSTOMER_ORDER_LIST_PROPERTY, subRequest);
+ return this;
+ }
+
+ public CustomerRequest groupById(){
+ groupBy(Customer.ID_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest groupByIdAs(String retName){
+ groupBy(retName, Customer.ID_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest groupByIdWithFunction(String retName, AggrFunction function){
+ groupBy(retName, Customer.ID_PROPERTY, function);
+ return this;
+ }
+ public CustomerRequest groupByPlatformWith(PlatformRequest subRequest){
+ groupBy(Customer.PLATFORM_PROPERTY, subRequest);
+ return this;
+ }
+ public CustomerRequest groupByPlatform(){
+ groupBy(Customer.PLATFORM_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest groupByPlatformAs(String retName){
+ groupBy(retName, Customer.PLATFORM_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest groupByPlatformWithFunction(String retName, AggrFunction function){
+ groupBy(retName, Customer.PLATFORM_PROPERTY, function);
+ return this;
+ }
+
+ public CustomerRequest groupByName(){
+ groupBy(Customer.NAME_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest groupByNameAs(String retName){
+ groupBy(retName, Customer.NAME_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest groupByNameWithFunction(String retName, AggrFunction function){
+ groupBy(retName, Customer.NAME_PROPERTY, function);
+ return this;
+ }
+
+ public CustomerRequest groupByVersion(){
+ groupBy(Customer.VERSION_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest groupByVersionAs(String retName){
+ groupBy(retName, Customer.VERSION_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest groupByVersionWithFunction(String retName, AggrFunction function){
+ groupBy(retName, Customer.VERSION_PROPERTY, function);
+ return this;
+ }
+
+
+
+ public CustomerRequest orderByIdAscending(){
+ addOrderByAscending(Customer.ID_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest orderByIdDescending(){
+ addOrderByDescending(Customer.ID_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest orderByPlatformAscending(){
+ addOrderByAscending(Customer.PLATFORM_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest orderByPlatformDescending(){
+ addOrderByDescending(Customer.PLATFORM_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest orderByNameAscending(){
+ addOrderByAscending(Customer.NAME_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest orderByNameDescending(){
+ addOrderByDescending(Customer.NAME_PROPERTY);
+ return this;
+ }
+ public CustomerRequest orderByNameAscendingUsingGBK(){
+ addOrderByAscendingUsingGBK(Customer.NAME_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest orderByNameDescendingUsingGBK(){
+ addOrderByDescendingUsingGBK(Customer.NAME_PROPERTY);
+ return this;
+ }
+ public CustomerRequest orderByVersionAscending(){
+ addOrderByAscending(Customer.VERSION_PROPERTY);
+ return this;
+ }
+
+ public CustomerRequest orderByVersionDescending(){
+ addOrderByDescending(Customer.VERSION_PROPERTY);
+ return this;
+ }
+
+
+ public CustomerRequest statsFromCustomerOrdersAs(String name, CustomerOrderRequest subRequest){
+ return statsFromCustomerOrdersAs(name, subRequest, false);
+ }
+
+ public CustomerRequest statsFromCustomerOrdersAs(String name, CustomerOrderRequest subRequest, boolean singleResult){
+ addRelationAggregate(name, subRequest, CustomerOrder.CUSTOMER_PROPERTY, singleResult,
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "statsFromCustomerOrdersAs", name, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+
+ public CustomerRequest statsFromCustomerOrders(CustomerOrderRequest subRequest){
+ return statsFromCustomerOrdersAs(REFINEMENTS, subRequest);
+ }
+ public PlatformRequest rollUpToPlatform(){
+ PlatformRequest platform = Q.platforms().unlimited();
+ this.withPlatformMatching(platform)
+ .groupByPlatformWith(platform);
+ return platform;
+ }
+
+
+
+ public CustomerRequest countCustomerOrders(){
+ addRelationCount("Count", Q.customerOrders().unlimited(), CustomerOrder.CUSTOMER_PROPERTY,
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.RELATION_COUNT, "countCustomerOrders", null, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+
+ public CustomerRequest countCustomerOrdersAs(String name){
+ addRelationCount(name, Q.customerOrders().unlimited(), CustomerOrder.CUSTOMER_PROPERTY,
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.RELATION_COUNT, "countCustomerOrdersAs", name, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+
+ public CustomerRequest countCustomerOrdersWith(String name, CustomerOrderRequest subRequest){
+ addRelationCount(name, subRequest, CustomerOrder.CUSTOMER_PROPERTY,
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.RELATION_COUNT, "countCustomerOrdersWith", name, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+ public CustomerRequest minTotalAmountOfCustomerOrders(){
+ addRelationScalarAggregate("minTotalAmountOfCustomerOrders", Q.customerOrders().unlimited(),
+ CustomerOrder.CUSTOMER_PROPERTY, CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("min".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "minTotalAmountOfCustomerOrders", null, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+
+ public CustomerRequest minTotalAmountOfCustomerOrdersAs(String name){
+ return minTotalAmountOfCustomerOrdersAs(name, Q.customerOrders().unlimited());
+ }
+
+ public CustomerRequest minTotalAmountOfCustomerOrdersAs(String name, CustomerOrderRequest subRequest){
+ addRelationScalarAggregate(name, subRequest, CustomerOrder.CUSTOMER_PROPERTY,
+ CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("min".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "minTotalAmountOfCustomerOrdersAs", name, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+ public CustomerRequest maxTotalAmountOfCustomerOrders(){
+ addRelationScalarAggregate("maxTotalAmountOfCustomerOrders", Q.customerOrders().unlimited(),
+ CustomerOrder.CUSTOMER_PROPERTY, CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("max".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "maxTotalAmountOfCustomerOrders", null, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+
+ public CustomerRequest maxTotalAmountOfCustomerOrdersAs(String name){
+ return maxTotalAmountOfCustomerOrdersAs(name, Q.customerOrders().unlimited());
+ }
+
+ public CustomerRequest maxTotalAmountOfCustomerOrdersAs(String name, CustomerOrderRequest subRequest){
+ addRelationScalarAggregate(name, subRequest, CustomerOrder.CUSTOMER_PROPERTY,
+ CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("max".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "maxTotalAmountOfCustomerOrdersAs", name, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+ public CustomerRequest sumTotalAmountOfCustomerOrders(){
+ addRelationScalarAggregate("sumTotalAmountOfCustomerOrders", Q.customerOrders().unlimited(),
+ CustomerOrder.CUSTOMER_PROPERTY, CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("sum".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "sumTotalAmountOfCustomerOrders", null, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+
+ public CustomerRequest sumTotalAmountOfCustomerOrdersAs(String name){
+ return sumTotalAmountOfCustomerOrdersAs(name, Q.customerOrders().unlimited());
+ }
+
+ public CustomerRequest sumTotalAmountOfCustomerOrdersAs(String name, CustomerOrderRequest subRequest){
+ addRelationScalarAggregate(name, subRequest, CustomerOrder.CUSTOMER_PROPERTY,
+ CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("sum".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "sumTotalAmountOfCustomerOrdersAs", name, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+ public CustomerRequest avgTotalAmountOfCustomerOrders(){
+ addRelationScalarAggregate("avgTotalAmountOfCustomerOrders", Q.customerOrders().unlimited(),
+ CustomerOrder.CUSTOMER_PROPERTY, CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("avg".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "avgTotalAmountOfCustomerOrders", null, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+
+ public CustomerRequest avgTotalAmountOfCustomerOrdersAs(String name){
+ return avgTotalAmountOfCustomerOrdersAs(name, Q.customerOrders().unlimited());
+ }
+
+ public CustomerRequest avgTotalAmountOfCustomerOrdersAs(String name, CustomerOrderRequest subRequest){
+ addRelationScalarAggregate(name, subRequest, CustomerOrder.CUSTOMER_PROPERTY,
+ CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("avg".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "avgTotalAmountOfCustomerOrdersAs", name, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+ public CustomerRequest standardDeviationTotalAmountOfCustomerOrders(){
+ addRelationScalarAggregate("stdDevTotalAmountOfCustomerOrders", Q.customerOrders().unlimited(),
+ CustomerOrder.CUSTOMER_PROPERTY, CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("stddev".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "standardDeviationTotalAmountOfCustomerOrders", null, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+
+ public CustomerRequest standardDeviationTotalAmountOfCustomerOrdersAs(String name){
+ return standardDeviationTotalAmountOfCustomerOrdersAs(name, Q.customerOrders().unlimited());
+ }
+
+ public CustomerRequest standardDeviationTotalAmountOfCustomerOrdersAs(String name, CustomerOrderRequest subRequest){
+ addRelationScalarAggregate(name, subRequest, CustomerOrder.CUSTOMER_PROPERTY,
+ CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("stddev".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "standardDeviationTotalAmountOfCustomerOrdersAs", name, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+ public CustomerRequest squareRootOfPopulationStandardDeviationTotalAmountOfCustomerOrders(){
+ addRelationScalarAggregate("stdDevPopTotalAmountOfCustomerOrders", Q.customerOrders().unlimited(),
+ CustomerOrder.CUSTOMER_PROPERTY, CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("stddev_pop".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "squareRootOfPopulationStandardDeviationTotalAmountOfCustomerOrders", null, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+
+ public CustomerRequest squareRootOfPopulationStandardDeviationTotalAmountOfCustomerOrdersAs(String name){
+ return squareRootOfPopulationStandardDeviationTotalAmountOfCustomerOrdersAs(name, Q.customerOrders().unlimited());
+ }
+
+ public CustomerRequest squareRootOfPopulationStandardDeviationTotalAmountOfCustomerOrdersAs(String name, CustomerOrderRequest subRequest){
+ addRelationScalarAggregate(name, subRequest, CustomerOrder.CUSTOMER_PROPERTY,
+ CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("stddev_pop".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "squareRootOfPopulationStandardDeviationTotalAmountOfCustomerOrdersAs", name, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+ public CustomerRequest sampleVarianceTotalAmountOfCustomerOrders(){
+ addRelationScalarAggregate("varSampTotalAmountOfCustomerOrders", Q.customerOrders().unlimited(),
+ CustomerOrder.CUSTOMER_PROPERTY, CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("var_samp".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "sampleVarianceTotalAmountOfCustomerOrders", null, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+
+ public CustomerRequest sampleVarianceTotalAmountOfCustomerOrdersAs(String name){
+ return sampleVarianceTotalAmountOfCustomerOrdersAs(name, Q.customerOrders().unlimited());
+ }
+
+ public CustomerRequest sampleVarianceTotalAmountOfCustomerOrdersAs(String name, CustomerOrderRequest subRequest){
+ addRelationScalarAggregate(name, subRequest, CustomerOrder.CUSTOMER_PROPERTY,
+ CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("var_samp".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "sampleVarianceTotalAmountOfCustomerOrdersAs", name, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+ public CustomerRequest samplePopulationVarianceTotalAmountOfCustomerOrders(){
+ addRelationScalarAggregate("varPopTotalAmountOfCustomerOrders", Q.customerOrders().unlimited(),
+ CustomerOrder.CUSTOMER_PROPERTY, CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("var_pop".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "samplePopulationVarianceTotalAmountOfCustomerOrders", null, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+
+ public CustomerRequest samplePopulationVarianceTotalAmountOfCustomerOrdersAs(String name){
+ return samplePopulationVarianceTotalAmountOfCustomerOrdersAs(name, Q.customerOrders().unlimited());
+ }
+
+ public CustomerRequest samplePopulationVarianceTotalAmountOfCustomerOrdersAs(String name, CustomerOrderRequest subRequest){
+ addRelationScalarAggregate(name, subRequest, CustomerOrder.CUSTOMER_PROPERTY,
+ CustomerOrder.TOTAL_AMOUNT_PROPERTY,
+ io.teaql.core.AggrFunction.valueOf("var_pop".toUpperCase(java.util.Locale.ROOT)),
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.AGGREGATE, "samplePopulationVarianceTotalAmountOfCustomerOrdersAs", name, Customer.CUSTOMER_ORDER_LIST_PROPERTY));
+ return this;
+ }
+
+ public CustomerRequest facetByPlatformAs(String facetName, PlatformRequest platform){
+ return facetByPlatformAs(facetName, platform, true);
+ }
+
+ public CustomerRequest facetByPlatformAs(String facetName, PlatformRequest platform, boolean includeAllFacets){
+ addFacet(facetName, Customer.PLATFORM_PROPERTY, platform, includeAllFacets,
+ io.teaql.core.QueryOperation.nativeMethod(io.teaql.core.QueryOperation.Kind.FACET, "facetByPlatformAs", facetName, Customer.PLATFORM_PROPERTY));
+ return this;
+ }
+
+
+ /**
+ * get topN records
+ * @param topN records number
+ */
+ public CustomerRequest top(int topN) {
+ super.top(topN);
+ return this;
+ }
+
+ /** Cross-runtime bounded-query alias. */
+ public CustomerRequest limit(int limit) {
+ return top(limit);
+ }
+
+ /**
+ * get records from offset(inclusive) to offset+size(exclusive)
+ * @param offset record offset
+ * @param size records number
+ */
+ public CustomerRequest offset(int offset, int size) {
+ super.offset(offset, size);
+ return this;
+ }
+
+ /**
+ * retrieve all records
+ */
+ public CustomerRequest unlimited() {
+ super.unlimited();
+ return this;
+ }
+
+ /**
+ * get records of one page
+ * @param pageNumber page number(1-based)
+ * @param pageSize page size
+ */
+ public CustomerRequest page(int pageNumber, int pageSize) {
+ int offset = (pageNumber - 1) * pageSize;
+ return offset(offset, pageSize);
+ }
+
+ /**
+ * get records of one page, default page size is 10
+ * @param pageNumber page number(1-based)
+ */
+ public CustomerRequest page(int pageNumber) {
+ return page(pageNumber, 10);
+ }
+}
\ No newline at end of file
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customerorder/CustomerOrder.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customerorder/CustomerOrder.java
new file mode 100644
index 00000000..98201887
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customerorder/CustomerOrder.java
@@ -0,0 +1,223 @@
+
+package com.example.requesttreeorderservice.customerorder;
+
+import com.example.requesttreeorderservice.Constants;
+import com.example.requesttreeorderservice.customer.Customer;
+import com.example.requesttreeorderservice.orderitem.OrderItem;
+import com.example.requesttreeorderservice.orderstatus.OrderStatus;
+import io.teaql.core.Audited;
+import io.teaql.core.BaseEntity;
+import io.teaql.core.EntityStatus;
+import io.teaql.core.FieldLayout;
+import io.teaql.core.FrameworkInternal;
+import io.teaql.core.RemoteInput;
+import io.teaql.core.SmartList;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.util.Objects;
+
+/**
+ * [TEAQL AI WARNING]
+ * TeaQL was explicitly designed to PREVENT AI hallucinations and random guessing.
+ * DO NOT GUESS METHOD NAMES!
+ * The methods listed below are the ONLY valid ways to interact with this entity.
+ * If you encounter compilation errors (e.g., method not found), DO NOT guess another method name.
+ * Read the method signatures in this file before proceeding.
+ */
+public class CustomerOrder extends BaseEntity implements RemoteInput {
+ public static String INTERNAL_TYPE = "CustomerOrder";
+
+ // Framework metadata: complete fixed layout, independent of SQL/projection order.
+ public static final String __TEAQL_FIELD_LAYOUT_REVISION = "835b87e26813b0d288c20fbcd3ab52649d0d32277d4f1740fac610ad0b9432bb";
+ public static final java.util.Map __TEAQL_FIXED_FIELD_INDEXES =
+ java.util.Map.ofEntries(java.util.Map.entry("id", 0), java.util.Map.entry("customer", 1), java.util.Map.entry("status", 2), java.util.Map.entry("order_number", 3), java.util.Map.entry("order_date", 4), java.util.Map.entry("total_amount", 5), java.util.Map.entry("version", 6));
+ public static final java.util.Map> __TEAQL_FIXED_FIELD_MAPPINGS =
+ java.util.Map.ofEntries(java.util.Map.entry("id", java.util.List.of("id", "id")), java.util.Map.entry("customer", java.util.List.of("customer", "customer")), java.util.Map.entry("status", java.util.List.of("status", "status")), java.util.Map.entry("order_number", java.util.List.of("orderNumber", "order_number")), java.util.Map.entry("order_date", java.util.List.of("orderDate", "order_date")), java.util.Map.entry("total_amount", java.util.List.of("totalAmount", "total_amount")), java.util.Map.entry("version", java.util.List.of("version", "version")));
+ public static final java.util.Set __TEAQL_FIXED_RELATION_NAMES = java.util.Set.of(
+ "orderItemList");
+ public static final FieldLayout __TEAQL_FIELD_LAYOUT =
+ FieldLayout.installGenerated(FieldLayout.generated(
+ CustomerOrder.class, __TEAQL_FIELD_LAYOUT_REVISION,
+ __TEAQL_FIXED_FIELD_INDEXES, __TEAQL_FIXED_FIELD_MAPPINGS, __TEAQL_FIXED_RELATION_NAMES));
+
+
+ public static final String CUSTOMER_PROPERTY = "customer";
+ public static final String STATUS_PROPERTY = "status";
+ public static final String ORDER_NUMBER_PROPERTY = "orderNumber";
+ public static final String ORDER_DATE_PROPERTY = "orderDate";
+ public static final String TOTAL_AMOUNT_PROPERTY = "totalAmount";
+ public static final String ORDER_ITEM_LIST_PROPERTY = "orderItemList";
+ private Customer customer;
+
+ private OrderStatus status;
+
+ private String orderNumber;
+
+ private LocalDate orderDate;
+
+ private BigDecimal totalAmount;
+
+ private SmartList orderItemList;
+
+ public Customer getCustomer(){
+ return this.customer;
+ }
+
+ public OrderStatus getStatus(){
+ return this.status;
+ }
+
+ public String getOrderNumber(){
+ return this.orderNumber;
+ }
+
+ public LocalDate getOrderDate(){
+ return this.orderDate;
+ }
+
+ public BigDecimal getTotalAmount(){
+ return this.totalAmount;
+ }
+
+ public SmartList getOrderItemList(){
+ return this.orderItemList;
+ }
+ public CustomerOrder updateCustomer(Customer customer){
+ if(Objects.equals(this.customer, customer)){
+ return this;
+ }
+ handleUpdate(CUSTOMER_PROPERTY, getCustomer(), customer);
+ this.customer = customer;
+ return this;
+ }
+
+ protected CustomerOrder updateStatus(OrderStatus status){
+ if(Objects.equals(this.status, status)){
+ return this;
+ }
+ handleUpdate(STATUS_PROPERTY, getStatus(), status);
+ this.status = status;
+ return this;
+ }
+
+ public CustomerOrder updateOrderNumber(String orderNumber){
+ orderNumber = (orderNumber == null ? null : orderNumber.trim());
+ if(Objects.equals(this.orderNumber, orderNumber)){
+ return this;
+ }
+ handleUpdate(ORDER_NUMBER_PROPERTY, getOrderNumber(), orderNumber);
+ this.orderNumber = orderNumber;
+ return this;
+ }
+
+ public CustomerOrder updateOrderDate(LocalDate orderDate){
+ if(Objects.equals(this.orderDate, orderDate)){
+ return this;
+ }
+ handleUpdate(ORDER_DATE_PROPERTY, getOrderDate(), orderDate);
+ this.orderDate = orderDate;
+ return this;
+ }
+
+ public CustomerOrder updateTotalAmount(BigDecimal totalAmount){
+ if(Objects.equals(this.totalAmount, totalAmount)){
+ return this;
+ }
+ handleUpdate(TOTAL_AMOUNT_PROPERTY, getTotalAmount(), totalAmount);
+ this.totalAmount = totalAmount;
+ return this;
+ }
+
+ public CustomerOrder addOrderItem(OrderItem orderItem){
+ if (orderItem == null){
+ return this;
+ }
+
+ if(null == this.orderItemList){
+ this.orderItemList = new SmartList<>();
+ }
+
+ this.orderItemList.add(orderItem);
+ orderItem.updateCustomerOrder(this);
+ return this;
+ }
+ public boolean isStatusNew(){
+ return Objects.equals(getStatus(), Constants.ORDER_STATUS_NEW);
+ }
+
+ public CustomerOrder updateStatusToNew(){
+ return updateStatus(Constants.ORDER_STATUS_NEW);
+ }
+ public boolean isStatusPaid(){
+ return Objects.equals(getStatus(), Constants.ORDER_STATUS_PAID);
+ }
+
+ public CustomerOrder updateStatusToPaid(){
+ return updateStatus(Constants.ORDER_STATUS_PAID);
+ }
+ public boolean isStatusCancelled(){
+ return Objects.equals(getStatus(), Constants.ORDER_STATUS_CANCELLED);
+ }
+
+ public CustomerOrder updateStatusToCancelled(){
+ return updateStatus(Constants.ORDER_STATUS_CANCELLED);
+ }
+
+ public static CustomerOrder refer(Long id){
+ CustomerOrder refer = new CustomerOrder();
+ refer.__internalSet("id", id);
+ refer.set$status(EntityStatus.REFER);
+ return refer;
+ }
+ @Override
+ public String typeName(){
+ return INTERNAL_TYPE;
+ }
+
+ public CustomerOrder comment(String comment){
+ this.setComment(comment);
+ return this;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public Audited auditAs(String action) {
+ return new Audited<>(this, action);
+ }
+
+ // ===== Framework Internal: generated switch dispatch =====
+ @Override
+ @FrameworkInternal
+ public void __internalSet(String property, Object value) {
+ markPropertyLoaded(property);
+ switch (property) {
+ case "customer": this.customer = (Customer) value; break;
+
+ case "status": this.status = (OrderStatus) value; break;
+
+ case "orderNumber": this.orderNumber = (value == null ? null : ((String)value).trim()); break;
+
+ case "orderDate": this.orderDate = (LocalDate) value; break;
+
+ case "totalAmount": this.totalAmount = (BigDecimal) value; break;
+
+ case "orderItemList": this.orderItemList = (SmartList) value; break;
+ default: super.__internalSet(property, value);
+ }
+ }
+
+ @Override
+ @FrameworkInternal
+ public Object __internalGet(String property) {
+ switch (property) {
+ case "customer": return this.customer;
+ case "status": return this.status;
+ case "orderNumber": return this.orderNumber;
+ case "orderDate": return this.orderDate;
+ case "totalAmount": return this.totalAmount;
+ case "orderItemList": return this.orderItemList;
+ default: return super.__internalGet(property);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customerorder/CustomerOrderChecker.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customerorder/CustomerOrderChecker.java
new file mode 100644
index 00000000..21a40f68
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customerorder/CustomerOrderChecker.java
@@ -0,0 +1,97 @@
+
+package com.example.requesttreeorderservice.customerorder;
+
+import com.example.requesttreeorderservice.customer.Customer;
+import com.example.requesttreeorderservice.customer.CustomerChecker;
+import com.example.requesttreeorderservice.orderitem.OrderItem;
+import com.example.requesttreeorderservice.orderitem.OrderItemChecker;
+import com.example.requesttreeorderservice.orderstatus.OrderStatus;
+import com.example.requesttreeorderservice.orderstatus.OrderStatusChecker;
+import io.teaql.core.UserContext;
+import io.teaql.core.checker.Checker;
+import io.teaql.core.checker.ObjectLocation;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+
+public class CustomerOrderChecker implements Checker{
+
+ public String type(){
+ return CustomerOrder.INTERNAL_TYPE;
+ }
+
+ public void checkAndFix(UserContext _context, CustomerOrder customerOrder, ObjectLocation _parentLocation){
+ if(needCheck(_context, customerOrder)){
+ markAsChecked(_context, customerOrder);
+ doCheck(_context, customerOrder, _parentLocation);
+ }
+ }
+
+ public void doCheck(UserContext _context, CustomerOrder customerOrder, ObjectLocation _parentLocation){
+ if((customerOrder == null)){
+ return;
+ }
+ if(customerOrder.newItem()){
+ }else if(customerOrder.updateItem()){
+ if(!customerOrder.isPropertyLoaded("customer")){
+ invalidTypeCheck(_context, newLocation(_parentLocation, "customer"), "Mutation requires a fully loaded entity");
+ }
+ if(!customerOrder.isPropertyLoaded("status")){
+ invalidTypeCheck(_context, newLocation(_parentLocation, "status"), "Mutation requires a fully loaded entity");
+ }
+ if(!customerOrder.isPropertyLoaded("orderNumber")){
+ invalidTypeCheck(_context, newLocation(_parentLocation, "order_number"), "Mutation requires a fully loaded entity");
+ }
+ if(!customerOrder.isPropertyLoaded("orderDate")){
+ invalidTypeCheck(_context, newLocation(_parentLocation, "order_date"), "Mutation requires a fully loaded entity");
+ }
+ if(!customerOrder.isPropertyLoaded("totalAmount")){
+ invalidTypeCheck(_context, newLocation(_parentLocation, "total_amount"), "Mutation requires a fully loaded entity");
+ }
+
+ }
+ checkCustomer(_context, customerOrder.getProperty(CustomerOrder.CUSTOMER_PROPERTY), newLocation(_parentLocation, "customer"));
+ checkStatus(_context, customerOrder.getProperty(CustomerOrder.STATUS_PROPERTY), newLocation(_parentLocation, "status"));
+ checkOrderNumber(_context, customerOrder.getProperty(CustomerOrder.ORDER_NUMBER_PROPERTY), newLocation(_parentLocation, "order_number"));
+ checkOrderDate(_context, customerOrder.getProperty(CustomerOrder.ORDER_DATE_PROPERTY), newLocation(_parentLocation, "order_date"));
+ checkTotalAmount(_context, customerOrder.getProperty(CustomerOrder.TOTAL_AMOUNT_PROPERTY), newLocation(_parentLocation, "total_amount"));
+ for(int i = 0; customerOrder.getOrderItemList() != null && i < customerOrder.getOrderItemList().size(); i++){
+ OrderItem orderItem = customerOrder.getOrderItemList().get(i);
+ new OrderItemChecker().checkAndFix(_context, orderItem, newLocation(_parentLocation, "order_item_list", i));
+ }
+ }
+
+ public void checkCustomer(UserContext _context, Customer customer, ObjectLocation _parentLocation){
+ requiredCheck(_context, _parentLocation, customer);
+ if((customer == null)){
+ return;
+ }
+ new CustomerChecker().checkAndFix(_context, customer, _parentLocation);
+ }
+ public void checkStatus(UserContext _context, OrderStatus status, ObjectLocation _parentLocation){
+ requiredCheck(_context, _parentLocation, status);
+ if((status == null)){
+ return;
+ }
+ new OrderStatusChecker().checkAndFix(_context, status, _parentLocation);
+ }
+ public void checkOrderNumber(UserContext _context, String orderNumber, ObjectLocation _parentLocation){
+ requiredCheck(_context, _parentLocation, orderNumber);
+ if((orderNumber == null)){
+ return;
+ }
+ maxStringCheck(_context, _parentLocation, 100, orderNumber);
+
+ }
+ public void checkOrderDate(UserContext _context, LocalDate orderDate, ObjectLocation _parentLocation){
+ requiredCheck(_context, _parentLocation, orderDate);
+ if((orderDate == null)){
+ return;
+ }
+ }
+ public void checkTotalAmount(UserContext _context, BigDecimal totalAmount, ObjectLocation _parentLocation){
+ requiredCheck(_context, _parentLocation, totalAmount);
+ if((totalAmount == null)){
+ return;
+ }
+ }
+}
\ No newline at end of file
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customerorder/CustomerOrderExpression.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customerorder/CustomerOrderExpression.java
new file mode 100644
index 00000000..b75e95a4
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customerorder/CustomerOrderExpression.java
@@ -0,0 +1,93 @@
+
+package com.example.requesttreeorderservice.customerorder;
+
+import com.example.requesttreeorderservice.customer.Customer;
+import com.example.requesttreeorderservice.customer.CustomerExpression;
+import com.example.requesttreeorderservice.orderitem.OrderItem;
+import com.example.requesttreeorderservice.orderitem.OrderItemListExpression;
+import com.example.requesttreeorderservice.orderstatus.OrderStatus;
+import com.example.requesttreeorderservice.orderstatus.OrderStatusExpression;
+import io.teaql.core.UserContext;
+import io.teaql.core.value.BaseEntityExpression;
+import io.teaql.core.value.Expression;
+import io.teaql.core.value.ExpressionAdaptor;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.util.function.Function;
+
+public class CustomerOrderExpression extends ExpressionAdaptor implements BaseEntityExpression {
+ public CustomerOrderExpression(Expression expression){
+ super(expression);
+ }
+
+ public CustomerOrderExpression(Expression expression, Function function){
+ super(expression, function);
+ }
+
+ public CustomerOrderExpression updateId(Long id){
+ return new CustomerOrderExpression(this, $it -> {((CustomerOrder)$it).__internalSet("id", id); return this;});
+ }
+
+ public CustomerOrderExpression save(UserContext userContext){
+ return new CustomerOrderExpression(this, $it -> ((CustomerOrder)$it).auditAs("Saved by Expression").save(userContext));
+ }
+
+ public CustomerOrderExpression save(String intent, UserContext userContext){
+ return new CustomerOrderExpression(this, $it -> ((CustomerOrder)$it).auditAs(intent).save(userContext));
+ }
+
+ public boolean isNull() {
+ return resolve() == null;
+ }
+
+
+ public CustomerExpression getCustomer(){
+ return new CustomerExpression(loaded("customer", CustomerOrder::getCustomer));
+ }
+
+ public CustomerOrderExpression updateCustomer(Customer customer){
+ return new CustomerOrderExpression(this, $it -> ((CustomerOrder)$it).updateCustomer(customer));
+ }
+
+ public OrderStatusExpression getStatus(){
+ return new OrderStatusExpression(loaded("status", CustomerOrder::getStatus));
+ }
+
+ public CustomerOrderExpression updateStatusToNew(){
+ return new CustomerOrderExpression(this, $it -> ((CustomerOrder)$it).updateStatusToNew());
+ }
+ public CustomerOrderExpression updateStatusToPaid(){
+ return new CustomerOrderExpression(this, $it -> ((CustomerOrder)$it).updateStatusToPaid());
+ }
+ public CustomerOrderExpression updateStatusToCancelled(){
+ return new CustomerOrderExpression(this, $it -> ((CustomerOrder)$it).updateStatusToCancelled());
+ }
+
+ public Expression getOrderNumber(){
+ return loaded("orderNumber", CustomerOrder::getOrderNumber);
+ }
+ public CustomerOrderExpression updateOrderNumber(String orderNumber){
+ return new CustomerOrderExpression(this, $it -> ((CustomerOrder)$it).updateOrderNumber(orderNumber));
+ }
+
+ public Expression getOrderDate(){
+ return loaded("orderDate", CustomerOrder::getOrderDate);
+ }
+ public CustomerOrderExpression updateOrderDate(LocalDate orderDate){
+ return new CustomerOrderExpression(this, $it -> ((CustomerOrder)$it).updateOrderDate(orderDate));
+ }
+
+ public Expression getTotalAmount(){
+ return loaded("totalAmount", CustomerOrder::getTotalAmount);
+ }
+ public CustomerOrderExpression updateTotalAmount(BigDecimal totalAmount){
+ return new CustomerOrderExpression(this, $it -> ((CustomerOrder)$it).updateTotalAmount(totalAmount));
+ }
+
+ public OrderItemListExpression getOrderItemList(){
+ return new OrderItemListExpression(loaded("orderItemList", CustomerOrder::getOrderItemList));
+ }
+ public CustomerOrderExpression addOrderItem(OrderItem orderItem){
+ return new CustomerOrderExpression(this, $it -> ((CustomerOrder)$it).addOrderItem(orderItem));
+ }
+}
\ No newline at end of file
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customerorder/CustomerOrderListExpression.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customerorder/CustomerOrderListExpression.java
new file mode 100644
index 00000000..959f5259
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customerorder/CustomerOrderListExpression.java
@@ -0,0 +1,25 @@
+
+package com.example.requesttreeorderservice.customerorder;
+
+import io.teaql.core.SmartList;
+import io.teaql.core.value.Expression;
+import io.teaql.core.value.SmartListExpression;
+import java.util.function.Function;
+
+public class CustomerOrderListExpression extends SmartListExpression {
+ public CustomerOrderListExpression(Expression> expression){
+ super(expression);
+ }
+
+ public CustomerOrderListExpression(Expression expression, Function> function){
+ super(expression, function);
+ }
+
+ public CustomerOrderExpression first() {
+ return new CustomerOrderExpression(super.first());
+ }
+
+ public CustomerOrderExpression get(int index) {
+ return new CustomerOrderExpression(super.get(index));
+ }
+}
\ No newline at end of file
diff --git a/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customerorder/CustomerOrderRequest.java b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customerorder/CustomerOrderRequest.java
new file mode 100644
index 00000000..1f0b6485
--- /dev/null
+++ b/examples/standard-order/generated/lib/src/main/java/com/example/requesttreeorderservice/customerorder/CustomerOrderRequest.java
@@ -0,0 +1,1438 @@
+
+package com.example.requesttreeorderservice.customerorder;
+
+import com.example.requesttreeorderservice.Q;
+import com.example.requesttreeorderservice.customer.Customer;
+import com.example.requesttreeorderservice.customer.CustomerRequest;
+import com.example.requesttreeorderservice.orderitem.OrderItem;
+import com.example.requesttreeorderservice.orderitem.OrderItemRequest;
+import com.example.requesttreeorderservice.orderstatus.OrderStatus;
+import com.example.requesttreeorderservice.orderstatus.OrderStatusRequest;
+import io.teaql.core.AggrFunction;
+import io.teaql.core.BaseRequest;
+import io.teaql.core.PropertyReference;
+import io.teaql.core.SearchCriteria;
+import io.teaql.core.SubQuerySearchCriteria;
+import io.teaql.core.criteria.Operator;
+import io.teaql.core.criteria.TwoOperatorCriteria;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.util.Date;
+
+public class CustomerOrderRequest extends BaseRequest {
+
+ /**
+ * @deprecated AI agents and business code must use the generated Q facade
+ * instead of constructing request builders directly.
+ */
+ @Deprecated
+ @SuppressWarnings("unchecked")
+ public CustomerOrderRequest(Class returnType){
+ this(returnType, () -> (T) new CustomerOrder());
+ }
+
+ protected CustomerOrderRequest(Class returnType, java.util.function.Supplier extends T> factory){
+ super(returnType, factory);
+ selectId();
+ selectVersion();
+ }
+
+ public CustomerOrderRequest comment(String comment){
+ super.internalComment(comment);
+ return this;
+ }
+
+ // purpose() 继承自 BaseRequest,返回 ExecutableRequest(终结方法)
+
+ public CustomerOrderRequest