国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁技術文章
文章詳情頁

Android GreenDao 條件查詢問題

瀏覽:69日期:2024-08-21 13:47:36

問題描述

使用GreenDao保存了全國城市的屬性(名字,代碼,省份等等),保存可以成功,無條件查詢全部數據時可以成功:

private List<CityInfo> queryCitiesInfo(){List<CityInfo> cityInfos = mCityQUery.list();for (int i = 0; i < cityInfos.size(); i++) { Log.d(TAG,'所有的城市CountryEn'+cityInfos.get(i).getCountryEn());}return cityInfos; }

但是使用條件查詢,時數據為0,不知道哪里出錯了,對了下屬性,沒知道原因:

//這個方法查詢的數據為0private void queryCitiesByLeader(){mCityInfoDao = nDaoSession.getCityInfoDao();mCityQUery = mCityInfoDao.queryBuilder().orderAsc(CityInfoDao.Properties.Id).build();List<CityInfo> cityInfos = mCityInfoDao.queryBuilder().where(CityInfoDao.Properties.CountryEn.eq('China')).orderAsc(CityInfoDao.Properties.Id).list();for (int i = 0; i < cityInfos.size(); i++) { Log.d(TAG,'條件查詢城市名稱' + cityInfos.get(i).getCityEn());} }

@Entitypublic class CityInfo {@Id private Long id; private String cityEn; private String cityZh; private String countryCode; private String countryEn; private String countryZh; private String provinceEn; private String provinceZh; private String leaderEn; private String leaderZh; private String lat; private String lon; @Generated(hash = 69148619) public CityInfo(Long id, String cityEn, String cityZh, String countryCode, String countryEn, String countryZh, String provinceEn, String provinceZh, String leaderEn, String leaderZh, String lat, String lon) {this.id = id;this.cityEn = cityEn;this.cityZh = cityZh;this.countryCode = countryCode;this.countryEn = countryEn;this.countryZh = countryZh;this.provinceEn = provinceEn;this.provinceZh = provinceZh;this.leaderEn = leaderEn;this.leaderZh = leaderZh;this.lat = lat;this.lon = lon; } @Generated(hash = 300452937) public CityInfo() { } public Long getId() {return this.id; } public void setId(Long id) {this.id = id; } public String getCityEn() {return this.cityEn; } public void setCityEn(String cityEn) {this.cityEn = cityEn; } public String getCityZh() {return this.cityZh; } public void setCityZh(String cityZh) {this.cityZh = cityZh; } public String getCountryCode() {return this.countryCode; } public void setCountryCode(String countryCode) {this.countryCode = countryCode; } public String getCountryEn() {return this.countryEn; } public void setCountryEn(String countryEn) {this.countryEn = countryEn; } public String getCountryZh() {return this.countryZh; } public void setCountryZh(String countryZh) {this.countryZh = countryZh; } public String getProvinceEn() {return this.provinceEn; } public void setProvinceEn(String provinceEn) {this.provinceEn = provinceEn; } public String getProvinceZh() {return this.provinceZh; } public void setProvinceZh(String provinceZh) {this.provinceZh = provinceZh; } public String getLeaderEn() {return this.leaderEn; } public void setLeaderEn(String leaderEn) {this.leaderEn = leaderEn; } public String getLeaderZh() {return this.leaderZh; } public void setLeaderZh(String leaderZh) {this.leaderZh = leaderZh; } public String getLat() {return this.lat; } public void setLat(String lat) {this.lat = lat; } public String getLon() {return this.lon; } public void setLon(String lon) {this.lon = lon; }}

下面是部分日志,打印出CountryEn:Android GreenDao 條件查詢問題

第一次用GreenDao, 找了很久沒發現問題,望解答,感謝。

問題解答

回答1:

沒有看到你的表結構及數據字段結構組成,沒法準確判斷你的問題了,我對你的“China”條件存疑,你檢查你的條件是否正確。

相關文章:
主站蜘蛛池模板: 久久精品成人 | 国产系列在线 | 国产手机国产手机在线 | 亚洲国产精品区 | www.色午夜| 三级理论手机在线观看视频 | 欧美午夜不卡在线观看最新 | 波多野结衣视频免费 | 岛国午夜精品视频在线观看 | 亚洲免费精品 | 国产又粗又黄又湿又大 | 中文字幕无线码中文字幕网站 | 日本九六视频 | 中文字幕在线观看91 | 白嫩美女一级毛片免费看 | 欧美国产精品 | 亚洲一区二区三区四区 | 久久视频精品线视频在线网站 | 91精品网站 | 欧美亚洲网站 | 久久艹在线 | 亚洲美女视频网站 | 在线看免费观看韩国特黄一级 | 91精品国产91久久 | 手机在线免费毛片 | 久久久久国产一级毛片高清板 | 国产精品二区三区 | 欧美综合图片一区二区三区 | 亚洲厕拍| 国产亚洲精品久久久久久无 | 日本一在线中文字幕天堂 | 亚洲国产日韩女人aaaaaa毛片在线 | 国产高清视频免费最新在线 | 欧美13一14周岁a在线播放 | 手机看片自拍自自拍日韩免费 | 精品国产成人 | 免费看欧美xxx片 | 成人在线播放 | 亚洲综合片 | 日本精品一区二区三区视频 | 久久精品系列 |