Issue Basics
- ObjectBox version >1.5.0
- Reproducibility: [always]
Reproducing the bug
Description
Insert a piece of data into an empty table, then read the data, delete it, and then read the data from the table and find that the number of data is still one.
Code
store.boxFor(ServerConfig.class).removeAll();
List<ServerConfig> all11 = store.boxFor(ServerConfig.class).getAll();
assertEquals(0,all11.size());
ServerConfig cfg=new ServerConfig();
cfg.setPort(10);
cfg.setName("test");
cfg.setIpOrDomain("11111");
cfg.setHttpsEnable(true);
store.boxFor(ServerConfig.class).put(cfg);
List<ServerConfig> all = store.boxFor(ServerConfig.class).getAll();
assertEquals(1,all.size());
ServerConfig serverConfig = store.boxFor(ServerConfig.class).get(all.get(0).getId());
assertNotNull(serverConfig);
store.boxFor(ServerConfig.class).remove(all.get(0));
List<ServerConfig> all1 = store.boxFor(ServerConfig.class).getAll();
assertEquals(0,all1.size());
Entities
@Entity
public class ServerConfig {
@Id
Long id;
String name;
boolean httpsEnable;
String ipOrDomain;
int port;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isHttpsEnable() {
return httpsEnable;
}
public void setHttpsEnable(boolean httpsEnable) {
this.httpsEnable = httpsEnable;
}
public String getIpOrDomain() {
return ipOrDomain;
}
public void setIpOrDomain(String ipOrDomain) {
this.ipOrDomain = ipOrDomain;
}
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
}
Issue Basics
Reproducing the bug
Description
Insert a piece of data into an empty table, then read the data, delete it, and then read the data from the table and find that the number of data is still one.
Code
Entities