You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 17, 2019. It is now read-only.
Case sensitive mapping of id key in row unmapper lead to update and probably delete errors.
Because value of primary key to run update or delete queries assigned incorrectly.
Example
public Map<String, Object> mapColumns(final Person person) {
Map<String, Object> mapping = new LinkedHashMap<String, Object>();
mapping.put("ID", person.getId());
mapping.put("NAME", person.getName());
return mapping;
}
Provided below unmapper will be used to generate following sql sentence
UPDATE person set ID=?, NAME=? where Id =?
To get value of primary key used Id field from map, which has null value, so real sentence
UPDATE person set ID=10, NAME="Jonh Dou" where Id = null
will never update record.
The text was updated successfully, but these errors were encountered:
Which database engine are you using? Not sure if it's related, but some databases are case-sensitive while others aren't (most notably MySQL). Also TableDescription declares names of ID columns. Where does Id come from in your example? In your database it's ID, right?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Case sensitive mapping of id key
Case sensitive mapping of id key in row unmapper lead to update and probably delete errors.
Because value of primary key to run update or delete queries assigned incorrectly.
Example
Provided below unmapper will be used to generate following sql sentence
To get value of primary key used Id field from map, which has null value, so real sentence
will never update record.
The text was updated successfully, but these errors were encountered: