当前位置: 首页>>代码示例>>Java>>正文


Java RuntimeExceptionDao.queryBuilder方法代码示例

本文整理汇总了Java中com.j256.ormlite.dao.RuntimeExceptionDao.queryBuilder方法的典型用法代码示例。如果您正苦于以下问题:Java RuntimeExceptionDao.queryBuilder方法的具体用法?Java RuntimeExceptionDao.queryBuilder怎么用?Java RuntimeExceptionDao.queryBuilder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.j256.ormlite.dao.RuntimeExceptionDao的用法示例。


在下文中一共展示了RuntimeExceptionDao.queryBuilder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getByFaceSync

import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
private static List<Long> getByFaceSync(final long faceId) {
    final RuntimeExceptionDao<MyFacePhoto, Long> daoFacePhoto = DatabaseHelper.getInstance().getCachedRuntimeExceptionDao(MyFacePhoto.class);
    try {
        QueryBuilder<MyFacePhoto, Long> facePhotoQb = daoFacePhoto.queryBuilder();
        facePhotoQb.where().eq("faceId", faceId);
        List<MyFacePhoto> facePhotos = facePhotoQb.query();
        List<Long> photoIds = new ArrayList<>();
        for (MyFacePhoto fp : facePhotos) {
            photoIds.add(fp.photoId);
        }

        return photoIds;
    } catch (Exception e) {
        Log.w(TAG, e.getMessage());
        return null;
    }
}
 
开发者ID:aliyun,项目名称:aliyun-cloudphotos-android-demo,代码行数:18,代码来源:MyFacePhoto.java

示例2: getByMomentSync

import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
private static List<Long> getByMomentSync(final long momentId) {
    final RuntimeExceptionDao<MyMomentPhoto, Long> daoMomentPhoto = DatabaseHelper.getInstance().getCachedRuntimeExceptionDao(MyMomentPhoto.class);
    try {
        QueryBuilder<MyMomentPhoto, Long> momentPhotoQb = daoMomentPhoto.queryBuilder();
        momentPhotoQb.where().eq("momentId", momentId);
        List<MyMomentPhoto> momentPhotos = momentPhotoQb.query();
        List<Long> photoIds = new ArrayList<>();
        for (MyMomentPhoto mp : momentPhotos) {
            photoIds.add(mp.photoId);
        }

        return photoIds;
    } catch (Exception e) {
        Log.w(TAG, e.getMessage());
        return null;
    }
}
 
开发者ID:aliyun,项目名称:aliyun-cloudphotos-android-demo,代码行数:18,代码来源:MyMomentPhoto.java

示例3: getByTagSync

import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
private static List<Long> getByTagSync(final long tagId) {
    final RuntimeExceptionDao<MyTagPhoto, Long> daoTagPhoto = DatabaseHelper.getInstance().getCachedRuntimeExceptionDao(MyTagPhoto.class);
    try {
        QueryBuilder<MyTagPhoto, Long> tagPhotoQb = daoTagPhoto.queryBuilder();
        tagPhotoQb.where().eq("tagId", tagId);
        List<MyTagPhoto> tagPhotos = tagPhotoQb.query();
        List<Long> photoIds = new ArrayList<>();
        for (MyTagPhoto tp : tagPhotos) {
            photoIds.add(tp.photoId);
        }

        return photoIds;
    } catch (Exception e) {
        Log.w(TAG, e.getMessage());
        return null;
    }
}
 
开发者ID:aliyun,项目名称:aliyun-cloudphotos-android-demo,代码行数:18,代码来源:MyTagPhoto.java

示例4: getByAlbumSync

import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
private static List<Long> getByAlbumSync(final long albumId) {
    final RuntimeExceptionDao<MyAlbumPhoto, Long> daoAlbumPhoto = DatabaseHelper.getInstance().getCachedRuntimeExceptionDao(MyAlbumPhoto.class);
    try {
        QueryBuilder<MyAlbumPhoto, Long> albumPhotoQb = daoAlbumPhoto.queryBuilder();
        albumPhotoQb.where().eq("albumId", albumId);
        List<MyAlbumPhoto> albumPhotos = albumPhotoQb.query();
        List<Long> photoIds = new ArrayList<>();
        for (MyAlbumPhoto mp : albumPhotos) {
            photoIds.add(mp.photoId);
        }

        return photoIds;
    } catch (Exception e) {
        Log.w(TAG, e.getMessage());
        return null;
    }
}
 
开发者ID:aliyun,项目名称:aliyun-cloudphotos-android-demo,代码行数:18,代码来源:MyAlbumPhoto.java

示例5: CartModel

import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
public CartModel(RuntimeExceptionDao<Cart, Long> cartDao) {
    mCartDao = cartDao;

    QueryBuilder<Cart, Long> queryBuilder = cartDao.queryBuilder();
    try {
        queryBuilder.where().eq("status", CartStatus.SHOPPING);
        mCart = cartDao.queryForFirst(queryBuilder.prepare());
    } catch (SQLException e) {
        Log.e(LOG_TAG, "Failed to load cart from database", e);
    }

    mCartEntries = new ObservableArrayList<>();
    if (mCart != null) {
        mCartEntries.addAll(mCart.getEntries());
    } else {
        createNewCart();
    }

    EventBus.getDefault().register(this);
}
 
开发者ID:FAU-Inf2,项目名称:fablab-android,代码行数:21,代码来源:CartModel.java

示例6: createIfNotExists

import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
private void createIfNotExists(RuntimeExceptionDao<ICal, Long> iCalDao, ICal iCal)
{
    List<ICal> retrievedICals = new ArrayList<>();
    QueryBuilder<ICal, Long> queryBuilder = iCalDao.queryBuilder();
    try {
        queryBuilder.where().eq("summery", iCal.getSummery()).and().eq("start", iCal.getStart())
        .and().eq("end", iCal.getEnd());
    } catch (SQLException e) {
        e.printStackTrace();
    }

    if(retrievedICals.size() == 0)
    {
        iCalDao.create(iCal);
    }
}
 
开发者ID:FAU-Inf2,项目名称:fablab-android,代码行数:17,代码来源:ICalModel.java

示例7: getAllSync

import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
public static List<MyFace> getAllSync() {
    final RuntimeExceptionDao<MyFace, Long> dao = DatabaseHelper.getInstance().getCachedRuntimeExceptionDao(MyFace.class);
    QueryBuilder<MyFace, Long> qb = dao.queryBuilder();
    try {
        qb.orderBy("name", false);
        List<MyFace> result = qb.query();
        return result;
    } catch (Exception e) {
        Log.w(TAG, e.getMessage());
        return null;
    }
}
 
开发者ID:aliyun,项目名称:aliyun-cloudphotos-android-demo,代码行数:13,代码来源:MyFace.java

示例8: getAllExceptIdsSync

import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
public static List<MyFace> getAllExceptIdsSync(List<Long> ids) {
    final RuntimeExceptionDao<MyFace, Long> dao = DatabaseHelper.getInstance().getCachedRuntimeExceptionDao(MyFace.class);
    QueryBuilder<MyFace, Long> qb = dao.queryBuilder();
    try {
        qb.orderBy("name", false);
        qb.where().notIn("id", ids);
        List<MyFace> result = qb.query();
        return result;
    } catch (Exception e) {
        Log.w(TAG, e.getMessage());
        return null;
    }
}
 
开发者ID:aliyun,项目名称:aliyun-cloudphotos-android-demo,代码行数:14,代码来源:MyFace.java

示例9: getAllSync

import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
public static List<MyMoment> getAllSync() {
    final RuntimeExceptionDao<MyMoment, Long> dao = DatabaseHelper.getInstance().getCachedRuntimeExceptionDao(MyMoment.class);
    QueryBuilder<MyMoment, Long> qb = dao.queryBuilder();
    try {
        qb.orderBy("takenAt", false);
        List<MyMoment> result = qb.query();
        return result;
    } catch (Exception e) {
        Log.w(TAG, e.getMessage());
        return null;
    }
}
 
开发者ID:aliyun,项目名称:aliyun-cloudphotos-android-demo,代码行数:13,代码来源:MyMoment.java

示例10: getAllSyncExceptSubTag

import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
private static List<MyTag> getAllSyncExceptSubTag() {
    final RuntimeExceptionDao<MyTag, Long> dao = DatabaseHelper.getInstance().getCachedRuntimeExceptionDao(MyTag.class);
    QueryBuilder<MyTag, Long> qb = dao.queryBuilder();
    try {
        qb.where().eq("isSubTag", false);
        List<MyTag> result = qb.query();
        return result;
    } catch (Exception e) {
        Log.w(TAG, e.getMessage());
        return null;
    }
}
 
开发者ID:aliyun,项目名称:aliyun-cloudphotos-android-demo,代码行数:13,代码来源:MyTag.java

示例11: getAllSync

import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
public static List<MyAlbum> getAllSync() {
    final RuntimeExceptionDao<MyAlbum, Long> dao = DatabaseHelper.getInstance().getCachedRuntimeExceptionDao(MyAlbum.class);
    QueryBuilder<MyAlbum, Long> qb = dao.queryBuilder();
    try {
        qb.where().eq("state", "active");
        qb.orderBy("ctime", false);
        List<MyAlbum> result = qb.query();
        return result;
    } catch (Exception e) {
        Log.w(TAG, e.getMessage());
        return null;
    }
}
 
开发者ID:aliyun,项目名称:aliyun-cloudphotos-android-demo,代码行数:14,代码来源:MyAlbum.java

示例12: getAllExceptIdsSync

import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
public static List<MyAlbum> getAllExceptIdsSync(List<Long> ids) {
    final RuntimeExceptionDao<MyAlbum, Long> dao = DatabaseHelper.getInstance().getCachedRuntimeExceptionDao(MyAlbum.class);
    QueryBuilder<MyAlbum, Long> qb = dao.queryBuilder();
    try {
        qb.where().eq("state", "active");
        qb.where().notIn("id", ids);
        qb.orderBy("ctime", false);
        List<MyAlbum> result = qb.query();
        return result;
    } catch (Exception e) {
        Log.w(TAG, e.getMessage());
        return null;
    }
}
 
开发者ID:aliyun,项目名称:aliyun-cloudphotos-android-demo,代码行数:15,代码来源:MyAlbum.java

示例13: getByIdsSync

import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
public static List<MyPhoto> getByIdsSync(final List<Long> ids) {
    final RuntimeExceptionDao<MyPhoto, Long> dao = DatabaseHelper.getInstance().getCachedRuntimeExceptionDao(MyPhoto.class);
    QueryBuilder<MyPhoto, Long> qb = dao.queryBuilder();
    try {
        qb.where().in("id", ids);
        qb.orderBy("ctime", false);
        return qb.query();
    } catch (Exception e) {
        Log.w(TAG, e.getMessage());
    }
    return null;
}
 
开发者ID:aliyun,项目名称:aliyun-cloudphotos-android-demo,代码行数:13,代码来源:MyPhoto.java

示例14: getAllSync

import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
public static List<MyPhoto> getAllSync() {
    final RuntimeExceptionDao<MyPhoto, Long> dao = DatabaseHelper.getInstance().getCachedRuntimeExceptionDao(MyPhoto.class);
    QueryBuilder<MyPhoto, Long> qb = dao.queryBuilder();
    try {
        qb.where().eq("state", "active");
        qb.orderBy("ctime", false);
        List<MyPhoto> result = qb.query();
        return result;
    } catch (Exception e) {
        Log.w(TAG, e.getMessage());
        return null;
    }
}
 
开发者ID:aliyun,项目名称:aliyun-cloudphotos-android-demo,代码行数:14,代码来源:MyPhoto.java

示例15: loadInBackground

import com.j256.ormlite.dao.RuntimeExceptionDao; //导入方法依赖的package包/类
@Override
public List<BlackList> loadInBackground() {

    RuntimeExceptionDao<BlackList, Integer> dao = mDBHelper.getBlackListDao();
    QueryBuilder<BlackList, Integer> builder = dao.queryBuilder();
    try {
        return builder.orderBy(BlackList.CREATE_TIME, false).query();
    } catch (SQLException e) {
        e.printStackTrace();
    }
    return null;
}
 
开发者ID:facetome,项目名称:Interceptor,代码行数:13,代码来源:BlackListLoader.java


注:本文中的com.j256.ormlite.dao.RuntimeExceptionDao.queryBuilder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。