时间:2021-07-01 10:21:17 帮助过:13人阅读
@Service public class CouchDBServiceImpl implements CouchDBService { @Autowired private CouchDBTemplate couchDBTemplate; @Override public void test() throws MalformedURLException { CouchDbConnector db = couchDBTemplate.getCouchDbConnector(); Sofa sofa = db.get(Sofa.class, "0x789456123"); System.out.println(JSONObject.toJSON(sofa)); } @Override public Long getEvidenceSum() throws MalformedURLException { CouchDbConnector db = couchDBTemplate.getCouchDbConnector(); Long cc =db.getDbInfo().getDocCount(); return cc; } }
public class Sofa { @JsonProperty(value = "_id") private String id; @JsonProperty(value = "_rev") private String rev; private String address; private String createTime; private String hash; private String name; private String recordNumber; private String source; private String user; @JsonProperty(value = "~version") private String version; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getRev() { return rev; } public void setRev(String rev) { this.rev = rev; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getCreateTime() { return createTime; } public void setCreateTime(String createTime) { this.createTime = createTime; } public String getHash() { return hash; } public void setHash(String hash) { this.hash = hash; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getRecordNumber() { return recordNumber; } public void setRecordNumber(String recordNumber) { this.recordNumber = recordNumber; } public String getSource() { return source; } public void setSource(String source) { this.source = source; } public String getUser() { return user; } public void setUser(String user) { this.user = user; } public String getVersion() { return version; } public void setVersion(String version) { this.version = version; } }
参考 https://www.xuebuyuan.com/2222739.html
CouchDB客户端开发—Java版
标签:开机 jar ide ber ESS add style 整理 getname