Android 数据存储

来源:互联网 发布:江门网络推广公司 编辑:程序博客网 时间:2024/06/07 14:09

这里写图片描述
//朋友圈-个人动态-

        public ArrayList<BlogInfo> getBlogMymatesInfosList() {            ArrayList<BlogInfo> list = new ArrayList<BlogInfo>();            try {                list = (ArrayList<BlogInfo>) db.findAll(BlogInfo.class);                System.out.println("list: "+list.size());                for (BlogInfo myclassmateInfo : list) {                    System.out.println("where:"+myclassmateInfo.getId());                    String strWhere = String.format("Id = '%s' ", myclassmateInfo.getId());                    myclassmateInfo.setCommentList((ArrayList<BlogComments>) db.findAllByWhere(BlogComments.class, strWhere));                    for (BlogComments mBlogComments: myclassmateInfo.getCommentList()) {                        String strWhere1 = String.format("Id = '%s' ", mBlogComments.getId());                        mBlogComments.setFilePathList((ArrayList<BlogFilePath>) db.findAllByWhere(BlogFilePath.class, strWhere1));                    }                    System.out.println("list in commonCourses: "+myclassmateInfo.getCommentList().size());                          }            } catch (Exception e) {                e.printStackTrace();                list = null;            }            return list;        }
0 0
原创粉丝点击