Thanks for these explanation....
For allowMultiUpdate, the system allows blank criteria (affecting all rows), because that can be what's intended. It also makes no attempt to verify that the values in the criteria are correct in any way, because again the system has no way of knowing what you intend.
-> if criteria is "where user=5", the system can sure know that field "user" exists or not in datasource. He can know something is wrong, even if not knowing what I fully intend
Therefore when using allowMultiUpdate, if you intend the criteria to be constrained in some way, you *must* write code to check it - there is no possible way the framework could do it for you. And if you write appropriate code to make sure expected criteria values are present, then your code will also catch a typo in a criteria field name.
-> I found a way to check if the criteriaColumnName exists in dataSource:
dataSource.getFieldNames().contains("user")
-> why is it so complicated for you to do this in the framework? And to return an appropriate exception instead of replacing my "where user=5" with a " where 1=1"?
Best regards
For allowMultiUpdate, the system allows blank criteria (affecting all rows), because that can be what's intended. It also makes no attempt to verify that the values in the criteria are correct in any way, because again the system has no way of knowing what you intend.
-> if criteria is "where user=5", the system can sure know that field "user" exists or not in datasource. He can know something is wrong, even if not knowing what I fully intend
Therefore when using allowMultiUpdate, if you intend the criteria to be constrained in some way, you *must* write code to check it - there is no possible way the framework could do it for you. And if you write appropriate code to make sure expected criteria values are present, then your code will also catch a typo in a criteria field name.
-> I found a way to check if the criteriaColumnName exists in dataSource:
dataSource.getFieldNames().contains("user")
-> why is it so complicated for you to do this in the framework? And to return an appropriate exception instead of replacing my "where user=5" with a " where 1=1"?
Best regards
Comment