Query Cache will not always be invalidated (#1717)

* provide failing test, that shows missing cache invalidation

* FIX: proper cache invalidation when dependent table will be modified
This commit is contained in:
Roland Praml authored and Rob Bygrave committed 2019-05-20 20:25:18 +12:00
1 parent c6ba4d8155
commit 0cac723eac
5 files changed
+162

No files matched your search

@@ -0,0 +1,52 @@
package org.tests.model.basic.cache;
import java.util.UUID;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import io.ebean.annotation.Cache;
@Entity
@Cache(enableQueryCache = true)
public class ECacheChild {
@Id
@GeneratedValue
protected UUID id;
@Size(max = 100)
private String name;
@NotNull
@ManyToOne
private ECacheRoot root;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ECacheRoot getRoot() {
return root;
}
public void setRoot(ECacheRoot root) {
this.root = root;
}
}
@@ -0,0 +1,38 @@
package org.tests.model.basic.cache;
import java.util.UUID;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.constraints.Size;
import io.ebean.annotation.Cache;
@Entity
@Cache(enableQueryCache = true)
public class ECacheRoot {
@Id
@GeneratedValue
protected UUID id;
@Size(max = 100)
private String name;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}