大佬教程收集整理的这篇文章主要介绍了android – 查询id需要整数参数,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
Account account = accountDao.queryForId("John Smith"); if (account == null) { // the name "John Smith" does not match any rows }
但在Eclipse(android)中我只看到传递整数作为参数的选项?
任何帮助?
Dao<Account,Integer> accountDao = getDao(Account.class);
第一个泛型参数指定实体的类型,第二个泛型参数指定该实体中的ID字段的类型.使用Integer,您将调用accountDao.queryForId(Integer).
Dao<Account,String> accountDao = getDao(Account.class);
然后,您可以通过字符串ID查询帐户:
Account account = accountDao.queryForId("John Smith");
以上是大佬教程为你收集整理的android – 查询id需要整数参数全部内容,希望文章能够帮你解决android – 查询id需要整数参数所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。