Add ExecuteDMLStatement Java action to the OQL module#24
Open
passalaqua wants to merge 12 commits intomasterfrom
Open
Add ExecuteDMLStatement Java action to the OQL module#24passalaqua wants to merge 12 commits intomasterfrom
passalaqua wants to merge 12 commits intomasterfrom
Conversation
* Still without any custom user code.
* Expose a new `executeDML` method in the OQL class that accepts a query string and returns the number of affected rows. * Introduce a new `OQLParameterBinder` class that iterates over the provided parameters and invokes the appropriate overloaded `setVariable` method on the OQL statement. * Adjust modeler version to `11.6.0` in `environment.gradle` configuration file. * Introduce OQLParameterBinder to rout the request to the correct overloading SetVariable method that sets the query parameter.
* To cover the DML exection with and without parameter.
pijuskri
reviewed
Mar 12, 2026
pijuskri
requested changes
Mar 12, 2026
| private static boolean fitsInInt(Number n) { | ||
| // Only meaningful when n is integral; for non-integral types this returns false | ||
| if (n instanceof Byte || n instanceof Short || n instanceof Integer) return true; | ||
| if (n instanceof Long) { |
Contributor
There was a problem hiding this comment.
Like discussed, in this case we should just bind as double
| } | ||
|
|
||
| // Exact types first (to avoid accidental widening) | ||
| if (value instanceof BigDecimal) { |
Contributor
There was a problem hiding this comment.
It would be a lot better to make this into a switch statement
Thats possible since java 21. Since this will be for exclusively for mendix 11+, i think we change our target language level and use java 21 features instead of only 11. Community commons module also already targets 21.
src/test/java/com/mendix/oqlmodule/test/ExecuteDMLStatementTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/mendix/oqlmodule/test/ExecuteDMLStatementWithParametersTest.java
Show resolved
Hide resolved
…binding with only the supported data types
772a0f7 to
d67c6dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose a new executeDML method in the OQL class that accepts a query string and returns the number
of affected rows.
Introduce a new OQLParameterBinder class that iterates over the provided parameters and invokes
the appropriate overloaded setVariable method on the OQL statement.
See #22, but now rebased and in a non-fork branch.