Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
NamedParameterJdbcTemplate: add methods to simplify usage when no parameter is needed [SPR-10256] #14889
When working with NamedParameterJdbcTemplate, we typically inject an instance of it in a DAO/Repository and use it in 10-20 methods that require accessing the database.
In that case, the syntax could be improved.
We currently do:
Inside NamedParameterJdbcTemplate, we could create some methods that do not take a HashMap as a parameter. We would then do instead:
Note: in the first code sample, replacing the empty HashMap with null is not an option because the method call then becomes ambiguous as 2 methods could be selected.
Referenced from: commits 3fa6723