I am coming from .NET to Java Spring Boot.
In .NET, I prefer to use ADO and stored procedures for my data access layers.
The closest Java equivalent I have found so far seems to be SimpleJdbcCall.
In .NET I can declare my params AND values going to the stored procedure all in one easy line:
cmd.Parameters.Add(new SqlParameter("@ParamName", ParamValue));
However, I am hard pressed to find an equivalent of this in Java Spring Boot.
I am forced to maintain 2 separate "lists" of params, and then their values, like this:
.declareParameters
(
new SqlParameter("@ParamName", Types.INTEGER)
)
MapSqlParameterSource inParams = new MapSqlParameterSource();
inParams.addValue("@ParamName", 1);
Does anyone have a way to simplify this into one line like in .NET?