docs(data): detached reads, null-id refusal, conditional update and delete() count, as of v6.3.0 - #104
docs(data): detached reads, null-id refusal, conditional update and delete() count, as of v6.3.0#104wisdommen wants to merge 5 commits into
Conversation
…elete() count, as of v6.3.0 Companion to the UltiTools-Reborn data-layer pull request (#520, #522, #521, #546, #543, #515). Prose and inline code only; no new examples/ reference. - data-storage: reads return copies; null-id update/delete throws; SQLite NULL-id backfill; new Conditional Update section (updateIf) - query-dsl: delete() returns the rows removed and refuses a null-id match Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…dateIf refusals Follows the framework pull request's gate-1 review round. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Deploying ultitools-dev-doc with
|
| Latest commit: |
4f960b2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://08be52c1.ultitools-dev-doc.pages.dev |
| Branch Preview URL: | https://docs-p17-fu-data.ultitools-dev-doc.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd3cc8312c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ```java | ||
| Account read = dataOperator.getById(accountId); | ||
| double seen = read.getBalance(); | ||
| read.setBalance(seen + amount); | ||
| boolean written = dataOperator.updateIf(read, |
There was a problem hiding this comment.
Do not duplicate the unreleased Java example
This adds an inline Java sample and a separately maintained Chinese copy, while repository guidance requires both locales to reference the same .java file with <<<. The duplicated snippets can drift and are not covered by the examples compilation check; because updateIf is still unreleased, keep this explanation prose-only until a shared example can compile against the released API.
AGENTS.md reference: AGENTS.md:L81-L85
Useful? React with 👍 / 👎.
Follows the framework pull request's first Codex round. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…eCounted, as of v6.3.0 Follows UltiKits/UltiTools-Reborn#559 (#558). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9edf2343bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| As of v6.3.0, an update by an id that no row has writes nothing and logs one warning naming the table and the id, on every backend, and returns normally. To learn whether the update wrote, call `updateCounted(entity)`, which returns `1` for a written row and `0` when no row has the id: | ||
|
|
||
| ```java | ||
| if (dataOperator.updateCounted(entity) == 0) { |
There was a problem hiding this comment.
Remove the second duplicated Java example
This later updateCounted addition creates a second inline Java example in both locales, separate from the updateIf snippet already called out. Repository guidance requires Java examples to be pulled from one shared .java file with <<<; because the examples project still targets 6.2.x, these two uncompiled copies can drift. Keep this example prose-only until a shared example can compile against 6.3.0.
AGENTS.md reference: AGENTS.md:L81-L85
Useful? React with 👍 / 👎.
The page still said no operator calls onCreate/onUpdate/onDelete/onLoad and that the audit columns stay NULL, which is 6.2.5 behaviour. Replaced both warnings (en + zh) with what UltiTools-Reborn at 7bc4ab68 (PR #559 head) does: which operation calls which hook on every backend, and how the audit columns and the command executor's current user are filled. #194 is closed; its links removed. Closes #103 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This pull request targets
alphadeliberately: it documents unreleased 6.3.0 behaviour, andalphapublishes tomastertogether with the framework release. Companion to UltiKits/UltiTools-Reborn#559 (data layer: #520, #522, #521, #546, #543, #515, #558).本 PR 有意指向
alpha(记录尚未发布的 6.3.0 行为);配套框架 PR UltiKits/UltiTools-Reborn#559。What changes
docs/src/guide/essentials/data-storage.mdand itszhmirror, section CRUD Operations:insertstores a copy: a change reaches the store only throughupdate(...), on every backend (as of v6.3.0; before, the JSON backend saved it at the next flush).update(T),update(column, value, id),delByIdandupdateAllthrowDataAccessExceptionfor anullid; rows 6.2.0 stored on SQLite without an id are given one at table initialisation (the id the entity reports, or a new UUID), and every write storesgetId()in theidcolumn.updateCounted(entity)returns1/0so the caller can tell (as of v6.3.0, #558).updateIf, v6.3.0+): what it returns, how the check and write stay together on MySQL/SQLite and on JSON, and when it throws.docs/src/guide/essentials/query-dsl.mdand itszhmirror:delete()returns the number of rows removed and refuses a matchednull-id row before deleting anything (as of v6.3.0).Constraints kept
<<< @/../examples/...reference (theexamples/project compiles against the released 6.2.x, which has noupdateIf).versionsConfig.currentorexamples/pom.xml.scripts/check-container-length.shclean on all four pages;npm run buildandnpm run check:paritypass locally.Issue closure
Closing keywords act only on pull requests merged into the default branch (
master); this one targetsalpha, so #103 is closed by hand after the merge.Closes #103
Lifecycle hooks (#103)
The same page said no operator calls
onCreate/onUpdate/onDelete/onLoadand that the audit columns stay NULL, which is 6.2.5 behaviour. Both warnings (en + zh) are replaced with what the framework at UltiTools-Reborn#559's head does, marked as of v6.3.0: which operation calls which hook, and how the audit columns and the command executor's current user are filled.🤖 Generated with Claude Code