Have you tried?
<update id="updateFactory"
parameterType="WorkOrder">
UPDATE wo
SET factory = '#{factory}'
WHERE work_order = '#{work_order}'
</update>
Pregunta
I am having a mybatis issue with a update call. For some reason I am getting a index out of bounds exception:
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException:
The index 1 is out of range.
This makes me think that parameter is a map or collection of some sort. However I pass it a single object which i use the #{}
syntax to get the proporties of. I then make a direct update call.
<update id="updateFactory" statementType="CALLABLE"
parameterType="WorkOrder">
UPDATE wo
SET factory = '#{factory}'
WHERE work_order = '#{work_order}'
</update>
I know that the parameters match with the getters and setters but it still seems to be an issue with it treating the type alias WorkOrder as a collection. (it seems it gets the first index (0) but fails on the next (1st index).
Any ideas on why this might be happening?
Solución
Have you tried?
<update id="updateFactory"
parameterType="WorkOrder">
UPDATE wo
SET factory = '#{factory}'
WHERE work_order = '#{work_order}'
</update>