I can't seem to get insert or update DML queries to work. I have a simple
cache that I put one object in. I try to update it, the result says 1 row
was updated, but nothing was actually updated in the object.
Pojo:
public class ACLStatus {
@QuerySqlField(index = true, name = "user_id")
private Long userId;
@QuerySqlField(index = true, name = "last_modified")
private Date lastModified;
public ACLStatus(Long userId, Date lastModified) {
this.userId = userId;
this.lastModified = lastModified;
}
public Long getUserId() {
return userId;
}
public Date getLastModified() {
return lastModified;
}
public void setLastModified(Date lastModified) {
this.lastModified = lastModified;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ACLStatus aclStatus = (ACLStatus) o;
if (userId != null ? !userId.equals(aclStatus.userId) :
aclStatus.userId != null) return false;
return lastModified != null ?
lastModified.equals(aclStatus.lastModified) : aclStatus.lastModified ==
null;
}
@Override
public int hashCode() {
int result = userId != null ? userId.hashCode() : 0;
result = 31 * result + (lastModified != null ?
lastModified.hashCode() : 0);
return result;
}
}
Code:
cache.put(1L, new ACLStatus(123L, new Date()));
Execute query: update "aclsource".ACLStatus set last_modified = date
'2016-12-12' where _key = 1
Do a getAll on that query: list(list(1))
Get object from cache and date has not changed
--
View this message in context:
http://apache-ignite-users.70518.x6.nabble.com/insert-and-update-dml-issues-tp10456.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.