Add scalar function call methods to SQLExpressions#1656
Open
zio0911 wants to merge 5 commits intoOpenFeign:masterfrom
Open
Add scalar function call methods to SQLExpressions#1656zio0911 wants to merge 5 commits intoOpenFeign:masterfrom
zio0911 wants to merge 5 commits intoOpenFeign:masterfrom
Conversation
added 5 commits
March 25, 2026 12:34
Add convenience methods for creating scalar function call expressions that support fully qualified (multi-part) function names such as schema.function, database.schema.function, or linked_server.database.schema.function. New methods: - function(Class, String, Object...) - generic scalar function call - stringFunction(String, Object...) - String-returning function call - numberFunction(Class, String, Object...) - Number-returning function call These complement the existing relationalFunctionCall() which is designed for table-valued functions in FROM/JOIN clauses.
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.
Closes #1657
Summary
Add convenience methods to
SQLExpressionsfor creating scalar function call expressions that support fully qualified (multi-part) function names.Problem
RelationalFunctionCallonly supports table-valued functions in FROM/JOIN clausesother_db.dbo.my_function(arg)) requires manually constructing template strings with{0},{1}placeholdersSQLExpressionsfor scalar function callsSolution
Added three new factory methods to
SQLExpressions:function(Class<T>, String, Object...)- generic scalar function callstringFunction(String, Object...)- String-returning function callnumberFunction(Class<T>, String, Object...)- Number-returning function callSupports any naming convention:
my_function(...)- simpleschema.my_function(...)- 2-partdatabase.schema.my_function(...)- 3-part (cross-database)server.database.schema.my_function(...)- 4-part (linked server)Changes
SQLExpressions.java- Addedfunction(),stringFunction(),numberFunction()methods and privatecreateFunctionCallTemplate()helperSQLExpressionsFunctionTest.java- New test class with 9 test cases covering naming patterns, return types, and SQL contexts (SELECT, WHERE, INSERT VALUES)SerializationTest.java- Added 2 scalar function serialization tests with SQLServerTemplates