亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁技術(shù)文章
文章詳情頁

Android GreenDao 條件查詢問題

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

問題描述

使用GreenDao保存了全國城市的屬性(名字,代碼,省份等等),保存可以成功,無條件查詢?nèi)繑?shù)據(jù)時(shí)可以成功:

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; }

但是使用條件查詢,時(shí)數(shù)據(jù)為0,不知道哪里出錯(cuò)了,對了下屬性,沒知道原因:

//這個(gè)方法查詢的數(shù)據(jù)為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, 找了很久沒發(fā)現(xiàn)問題,望解答,感謝。

問題解答

回答1:

沒有看到你的表結(jié)構(gòu)及數(shù)據(jù)字段結(jié)構(gòu)組成,沒法準(zhǔn)確判斷你的問題了,我對你的“China”條件存疑,你檢查你的條件是否正確。

相關(guān)文章:
主站蜘蛛池模板: 国产秦先生大战白丝97在线 | 国产免费一区二区三区免费视频 | 成人免费观看视频久爱网 | 免费一级毛片正在播放 | 青青视频免费 | 韩国十八禁毛片无遮挡 | 99久久精品6在线播放 | 91在线入口 | 中国一级黄色毛片 | yellow中文字幕视频在线 | 农村寡妇一级毛片免费播放 | 亚洲色图3p | 欧美伦理三级在线播放影院 | 天堂激情网 | 在线播放黄色网址 | 国产精品亚洲欧美一级久久精品 | 国产成人美女福利在线观看 | 日本一区毛片免费观看 | 三级毛片在线免费观看 | 中国大陆高清aⅴ毛片 | 国产成人h片视频在线观看 国产成人lu在线视频 | 国产一级黄色片子 | 啪啪永久免费网 | 色老99久久九九爱精品69堂 | 亚洲欧美日韩不卡一区二区三区 | 午夜精品影院 | 国产精品久久久99 | 亚洲第一成年免费网站 | 国产专区在线视频 | 免费亚洲一区 | 国产vvv在线观看 | 妇女自拍偷自拍亚洲精品 | 国产精品一区二区av | 色综合久久中文 | 天天影视色香欲综合网天天录日日录 | 四虎91| 日韩中文字幕推理片 | 成年人xxxx| 美国a级黄色片 | 高清精品 | 色综色天天综合网 |