com.socks.greendao.VideoCacheDao Java Examples

The following examples show how to use com.socks.greendao.VideoCacheDao. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: JianDan_OkHttpWithVolley   Author: ZhaoKaiQiang   File: VideoCache.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public ArrayList<Video> getCacheByPage(int page) {

    QueryBuilder<com.socks.greendao.VideoCache> query = mVideoCacheDao.queryBuilder().where(VideoCacheDao.Properties.Page.eq("" + page));
    if (query.list().size() > 0) {
        return (ArrayList<Video>) JSONParser.toObject(query.list().get(0).getResult(),
                new TypeToken<ArrayList<Video>>() {
                }.getType());
    } else {
        return new ArrayList<>();
    }

}
 
Example #2
Source Project: JianDan_OkHttpWithVolley   Author: ZhaoKaiQiang   File: DaoMaster.java    License: Apache License 2.0 5 votes vote down vote up
/** Creates underlying database table using DAOs. */
public static void createAllTables(SQLiteDatabase db, boolean ifNotExists) {
    JokeCacheDao.createTable(db, ifNotExists);
    FreshNewsCacheDao.createTable(db, ifNotExists);
    PictureCacheDao.createTable(db, ifNotExists);
    SisterCacheDao.createTable(db, ifNotExists);
    VideoCacheDao.createTable(db, ifNotExists);
}
 
Example #3
Source Project: JianDan_OkHttpWithVolley   Author: ZhaoKaiQiang   File: DaoMaster.java    License: Apache License 2.0 5 votes vote down vote up
/** Drops underlying database table using DAOs. */
public static void dropAllTables(SQLiteDatabase db, boolean ifExists) {
    JokeCacheDao.dropTable(db, ifExists);
    FreshNewsCacheDao.dropTable(db, ifExists);
    PictureCacheDao.dropTable(db, ifExists);
    SisterCacheDao.dropTable(db, ifExists);
    VideoCacheDao.dropTable(db, ifExists);
}
 
Example #4
Source Project: JianDan_OkHttpWithVolley   Author: ZhaoKaiQiang   File: DaoMaster.java    License: Apache License 2.0 5 votes vote down vote up
public DaoMaster(SQLiteDatabase db) {
    super(db, SCHEMA_VERSION);
    registerDaoClass(JokeCacheDao.class);
    registerDaoClass(FreshNewsCacheDao.class);
    registerDaoClass(PictureCacheDao.class);
    registerDaoClass(SisterCacheDao.class);
    registerDaoClass(VideoCacheDao.class);
}
 
Example #5
Source Project: JianDan_OkHttpWithVolley   Author: ZhaoKaiQiang   File: DaoSession.java    License: Apache License 2.0 5 votes vote down vote up
public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
        daoConfigMap) {
    super(db);

    jokeCacheDaoConfig = daoConfigMap.get(JokeCacheDao.class).clone();
    jokeCacheDaoConfig.initIdentityScope(type);

    freshNewsCacheDaoConfig = daoConfigMap.get(FreshNewsCacheDao.class).clone();
    freshNewsCacheDaoConfig.initIdentityScope(type);

    pictureCacheDaoConfig = daoConfigMap.get(PictureCacheDao.class).clone();
    pictureCacheDaoConfig.initIdentityScope(type);

    sisterCacheDaoConfig = daoConfigMap.get(SisterCacheDao.class).clone();
    sisterCacheDaoConfig.initIdentityScope(type);

    videoCacheDaoConfig = daoConfigMap.get(VideoCacheDao.class).clone();
    videoCacheDaoConfig.initIdentityScope(type);

    jokeCacheDao = new JokeCacheDao(jokeCacheDaoConfig, this);
    freshNewsCacheDao = new FreshNewsCacheDao(freshNewsCacheDaoConfig, this);
    pictureCacheDao = new PictureCacheDao(pictureCacheDaoConfig, this);
    sisterCacheDao = new SisterCacheDao(sisterCacheDaoConfig, this);
    videoCacheDao = new VideoCacheDao(videoCacheDaoConfig, this);

    registerDao(JokeCache.class, jokeCacheDao);
    registerDao(FreshNewsCache.class, freshNewsCacheDao);
    registerDao(PictureCache.class, pictureCacheDao);
    registerDao(SisterCache.class, sisterCacheDao);
    registerDao(VideoCache.class, videoCacheDao);
}
 
Example #6
Source Project: JianDan   Author: ZhaoKaiQiang   File: VideoCache.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public ArrayList<Video> getCacheByPage(int page) {

    QueryBuilder<com.socks.greendao.VideoCache> query = mVideoCacheDao.queryBuilder().where(VideoCacheDao.Properties.Page.eq("" + page));
    if (query.list().size() > 0) {
        return (ArrayList<Video>) JSONParser.toObject(query.list().get(0).getResult(),
                new TypeToken<ArrayList<Video>>() {
                }.getType());
    } else {
        return new ArrayList<>();
    }

}
 
Example #7
Source Project: JianDan   Author: ZhaoKaiQiang   File: DaoMaster.java    License: Apache License 2.0 5 votes vote down vote up
/** Creates underlying database table using DAOs. */
public static void createAllTables(SQLiteDatabase db, boolean ifNotExists) {
    JokeCacheDao.createTable(db, ifNotExists);
    FreshNewsCacheDao.createTable(db, ifNotExists);
    PictureCacheDao.createTable(db, ifNotExists);
    SisterCacheDao.createTable(db, ifNotExists);
    VideoCacheDao.createTable(db, ifNotExists);
}
 
Example #8
Source Project: JianDan   Author: ZhaoKaiQiang   File: DaoMaster.java    License: Apache License 2.0 5 votes vote down vote up
/** Drops underlying database table using DAOs. */
public static void dropAllTables(SQLiteDatabase db, boolean ifExists) {
    JokeCacheDao.dropTable(db, ifExists);
    FreshNewsCacheDao.dropTable(db, ifExists);
    PictureCacheDao.dropTable(db, ifExists);
    SisterCacheDao.dropTable(db, ifExists);
    VideoCacheDao.dropTable(db, ifExists);
}
 
Example #9
Source Project: JianDan   Author: ZhaoKaiQiang   File: DaoMaster.java    License: Apache License 2.0 5 votes vote down vote up
public DaoMaster(SQLiteDatabase db) {
    super(db, SCHEMA_VERSION);
    registerDaoClass(JokeCacheDao.class);
    registerDaoClass(FreshNewsCacheDao.class);
    registerDaoClass(PictureCacheDao.class);
    registerDaoClass(SisterCacheDao.class);
    registerDaoClass(VideoCacheDao.class);
}
 
Example #10
Source Project: JianDan   Author: ZhaoKaiQiang   File: DaoSession.java    License: Apache License 2.0 5 votes vote down vote up
public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
        daoConfigMap) {
    super(db);

    jokeCacheDaoConfig = daoConfigMap.get(JokeCacheDao.class).clone();
    jokeCacheDaoConfig.initIdentityScope(type);

    freshNewsCacheDaoConfig = daoConfigMap.get(FreshNewsCacheDao.class).clone();
    freshNewsCacheDaoConfig.initIdentityScope(type);

    pictureCacheDaoConfig = daoConfigMap.get(PictureCacheDao.class).clone();
    pictureCacheDaoConfig.initIdentityScope(type);

    sisterCacheDaoConfig = daoConfigMap.get(SisterCacheDao.class).clone();
    sisterCacheDaoConfig.initIdentityScope(type);

    videoCacheDaoConfig = daoConfigMap.get(VideoCacheDao.class).clone();
    videoCacheDaoConfig.initIdentityScope(type);

    jokeCacheDao = new JokeCacheDao(jokeCacheDaoConfig, this);
    freshNewsCacheDao = new FreshNewsCacheDao(freshNewsCacheDaoConfig, this);
    pictureCacheDao = new PictureCacheDao(pictureCacheDaoConfig, this);
    sisterCacheDao = new SisterCacheDao(sisterCacheDaoConfig, this);
    videoCacheDao = new VideoCacheDao(videoCacheDaoConfig, this);

    registerDao(JokeCache.class, jokeCacheDao);
    registerDao(FreshNewsCache.class, freshNewsCacheDao);
    registerDao(PictureCache.class, pictureCacheDao);
    registerDao(SisterCache.class, sisterCacheDao);
    registerDao(VideoCache.class, videoCacheDao);
}
 
Example #11
Source Project: JianDanRxJava   Author: ZhaoKaiQiang   File: VideoCache.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public ArrayList<Video> getCacheByPage(int page) {

    QueryBuilder<com.socks.greendao.VideoCache> query = mVideoCacheDao.queryBuilder().where(VideoCacheDao.Properties.Page.eq("" + page));
    if (query.list().size() > 0) {
        return (ArrayList<Video>) JSONParser.toObject(query.list().get(0).getResult(),
                new TypeToken<ArrayList<Video>>() {
                }.getType());
    } else {
        return new ArrayList<>();
    }

}
 
Example #12
Source Project: JianDanRxJava   Author: ZhaoKaiQiang   File: DaoMaster.java    License: Apache License 2.0 5 votes vote down vote up
/** Creates underlying database table using DAOs. */
public static void createAllTables(SQLiteDatabase db, boolean ifNotExists) {
    JokeCacheDao.createTable(db, ifNotExists);
    FreshNewsCacheDao.createTable(db, ifNotExists);
    PictureCacheDao.createTable(db, ifNotExists);
    SisterCacheDao.createTable(db, ifNotExists);
    VideoCacheDao.createTable(db, ifNotExists);
}
 
Example #13
Source Project: JianDanRxJava   Author: ZhaoKaiQiang   File: DaoMaster.java    License: Apache License 2.0 5 votes vote down vote up
/** Drops underlying database table using DAOs. */
public static void dropAllTables(SQLiteDatabase db, boolean ifExists) {
    JokeCacheDao.dropTable(db, ifExists);
    FreshNewsCacheDao.dropTable(db, ifExists);
    PictureCacheDao.dropTable(db, ifExists);
    SisterCacheDao.dropTable(db, ifExists);
    VideoCacheDao.dropTable(db, ifExists);
}
 
Example #14
Source Project: JianDanRxJava   Author: ZhaoKaiQiang   File: DaoMaster.java    License: Apache License 2.0 5 votes vote down vote up
public DaoMaster(SQLiteDatabase db) {
    super(db, SCHEMA_VERSION);
    registerDaoClass(JokeCacheDao.class);
    registerDaoClass(FreshNewsCacheDao.class);
    registerDaoClass(PictureCacheDao.class);
    registerDaoClass(SisterCacheDao.class);
    registerDaoClass(VideoCacheDao.class);
}
 
Example #15
Source Project: JianDanRxJava   Author: ZhaoKaiQiang   File: DaoSession.java    License: Apache License 2.0 5 votes vote down vote up
public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
        daoConfigMap) {
    super(db);

    jokeCacheDaoConfig = daoConfigMap.get(JokeCacheDao.class).clone();
    jokeCacheDaoConfig.initIdentityScope(type);

    freshNewsCacheDaoConfig = daoConfigMap.get(FreshNewsCacheDao.class).clone();
    freshNewsCacheDaoConfig.initIdentityScope(type);

    pictureCacheDaoConfig = daoConfigMap.get(PictureCacheDao.class).clone();
    pictureCacheDaoConfig.initIdentityScope(type);

    sisterCacheDaoConfig = daoConfigMap.get(SisterCacheDao.class).clone();
    sisterCacheDaoConfig.initIdentityScope(type);

    videoCacheDaoConfig = daoConfigMap.get(VideoCacheDao.class).clone();
    videoCacheDaoConfig.initIdentityScope(type);

    jokeCacheDao = new JokeCacheDao(jokeCacheDaoConfig, this);
    freshNewsCacheDao = new FreshNewsCacheDao(freshNewsCacheDaoConfig, this);
    pictureCacheDao = new PictureCacheDao(pictureCacheDaoConfig, this);
    sisterCacheDao = new SisterCacheDao(sisterCacheDaoConfig, this);
    videoCacheDao = new VideoCacheDao(videoCacheDaoConfig, this);

    registerDao(JokeCache.class, jokeCacheDao);
    registerDao(FreshNewsCache.class, freshNewsCacheDao);
    registerDao(PictureCache.class, pictureCacheDao);
    registerDao(SisterCache.class, sisterCacheDao);
    registerDao(VideoCache.class, videoCacheDao);
}
 
Example #16
Source Project: JianDan_OkHttp   Author: ZhaoKaiQiang   File: VideoCache.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public ArrayList<Video> getCacheByPage(int page) {

    QueryBuilder<com.socks.greendao.VideoCache> query = mVideoCacheDao.queryBuilder().where(VideoCacheDao.Properties.Page.eq("" + page));
    if (query.list().size() > 0) {
        return (ArrayList<Video>) JSONParser.toObject(query.list().get(0).getResult(),
                new TypeToken<ArrayList<Video>>() {
                }.getType());
    } else {
        return new ArrayList<>();
    }

}
 
Example #17
Source Project: JianDan_OkHttp   Author: ZhaoKaiQiang   File: DaoMaster.java    License: Apache License 2.0 5 votes vote down vote up
/** Creates underlying database table using DAOs. */
public static void createAllTables(SQLiteDatabase db, boolean ifNotExists) {
    JokeCacheDao.createTable(db, ifNotExists);
    FreshNewsCacheDao.createTable(db, ifNotExists);
    PictureCacheDao.createTable(db, ifNotExists);
    SisterCacheDao.createTable(db, ifNotExists);
    VideoCacheDao.createTable(db, ifNotExists);
}
 
Example #18
Source Project: JianDan_OkHttp   Author: ZhaoKaiQiang   File: DaoMaster.java    License: Apache License 2.0 5 votes vote down vote up
/** Drops underlying database table using DAOs. */
public static void dropAllTables(SQLiteDatabase db, boolean ifExists) {
    JokeCacheDao.dropTable(db, ifExists);
    FreshNewsCacheDao.dropTable(db, ifExists);
    PictureCacheDao.dropTable(db, ifExists);
    SisterCacheDao.dropTable(db, ifExists);
    VideoCacheDao.dropTable(db, ifExists);
}
 
Example #19
Source Project: JianDan_OkHttp   Author: ZhaoKaiQiang   File: DaoMaster.java    License: Apache License 2.0 5 votes vote down vote up
public DaoMaster(SQLiteDatabase db) {
    super(db, SCHEMA_VERSION);
    registerDaoClass(JokeCacheDao.class);
    registerDaoClass(FreshNewsCacheDao.class);
    registerDaoClass(PictureCacheDao.class);
    registerDaoClass(SisterCacheDao.class);
    registerDaoClass(VideoCacheDao.class);
}
 
Example #20
Source Project: JianDan_OkHttp   Author: ZhaoKaiQiang   File: DaoSession.java    License: Apache License 2.0 5 votes vote down vote up
public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
        daoConfigMap) {
    super(db);

    jokeCacheDaoConfig = daoConfigMap.get(JokeCacheDao.class).clone();
    jokeCacheDaoConfig.initIdentityScope(type);

    freshNewsCacheDaoConfig = daoConfigMap.get(FreshNewsCacheDao.class).clone();
    freshNewsCacheDaoConfig.initIdentityScope(type);

    pictureCacheDaoConfig = daoConfigMap.get(PictureCacheDao.class).clone();
    pictureCacheDaoConfig.initIdentityScope(type);

    sisterCacheDaoConfig = daoConfigMap.get(SisterCacheDao.class).clone();
    sisterCacheDaoConfig.initIdentityScope(type);

    videoCacheDaoConfig = daoConfigMap.get(VideoCacheDao.class).clone();
    videoCacheDaoConfig.initIdentityScope(type);

    jokeCacheDao = new JokeCacheDao(jokeCacheDaoConfig, this);
    freshNewsCacheDao = new FreshNewsCacheDao(freshNewsCacheDaoConfig, this);
    pictureCacheDao = new PictureCacheDao(pictureCacheDaoConfig, this);
    sisterCacheDao = new SisterCacheDao(sisterCacheDaoConfig, this);
    videoCacheDao = new VideoCacheDao(videoCacheDaoConfig, this);

    registerDao(JokeCache.class, jokeCacheDao);
    registerDao(FreshNewsCache.class, freshNewsCacheDao);
    registerDao(PictureCache.class, pictureCacheDao);
    registerDao(SisterCache.class, sisterCacheDao);
    registerDao(VideoCache.class, videoCacheDao);
}
 
Example #21
Source Project: JianDan_OkHttpWithVolley   Author: ZhaoKaiQiang   File: DaoSession.java    License: Apache License 2.0 4 votes vote down vote up
public VideoCacheDao getVideoCacheDao() {
    return videoCacheDao;
}
 
Example #22
Source Project: JianDan   Author: ZhaoKaiQiang   File: DaoSession.java    License: Apache License 2.0 4 votes vote down vote up
public VideoCacheDao getVideoCacheDao() {
    return videoCacheDao;
}
 
Example #23
Source Project: JianDanRxJava   Author: ZhaoKaiQiang   File: DaoSession.java    License: Apache License 2.0 4 votes vote down vote up
public VideoCacheDao getVideoCacheDao() {
    return videoCacheDao;
}
 
Example #24
Source Project: JianDan_OkHttp   Author: ZhaoKaiQiang   File: DaoSession.java    License: Apache License 2.0 4 votes vote down vote up
public VideoCacheDao getVideoCacheDao() {
    return videoCacheDao;
}