Java Code Examples for com.socks.greendao.SisterCache

The following examples show how to use com.socks.greendao.SisterCache. These examples are extracted from open source projects. 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: SisterCacheDao.java    License: Apache License 2.0 6 votes vote down vote up
/** @inheritdoc */
@Override
protected void bindValues(SQLiteStatement stmt, SisterCache entity) {
    stmt.clearBindings();
 
    Long id = entity.getId();
    if (id != null) {
        stmt.bindLong(1, id);
    }
 
    String result = entity.getResult();
    if (result != null) {
        stmt.bindString(2, result);
    }
 
    Integer page = entity.getPage();
    if (page != null) {
        stmt.bindLong(3, page);
    }
 
    Long time = entity.getTime();
    if (time != null) {
        stmt.bindLong(4, time);
    }
}
 
Example #2
Source Project: JianDan   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 6 votes vote down vote up
/** @inheritdoc */
@Override
protected void bindValues(SQLiteStatement stmt, SisterCache entity) {
    stmt.clearBindings();
 
    Long id = entity.getId();
    if (id != null) {
        stmt.bindLong(1, id);
    }
 
    String result = entity.getResult();
    if (result != null) {
        stmt.bindString(2, result);
    }
 
    Integer page = entity.getPage();
    if (page != null) {
        stmt.bindLong(3, page);
    }
 
    Long time = entity.getTime();
    if (time != null) {
        stmt.bindLong(4, time);
    }
}
 
Example #3
Source Project: JianDanRxJava   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 6 votes vote down vote up
/** @inheritdoc */
@Override
protected void bindValues(SQLiteStatement stmt, SisterCache entity) {
    stmt.clearBindings();
 
    Long id = entity.getId();
    if (id != null) {
        stmt.bindLong(1, id);
    }
 
    String result = entity.getResult();
    if (result != null) {
        stmt.bindString(2, result);
    }
 
    Integer page = entity.getPage();
    if (page != null) {
        stmt.bindLong(3, page);
    }
 
    Long time = entity.getTime();
    if (time != null) {
        stmt.bindLong(4, time);
    }
}
 
Example #4
Source Project: JianDan_OkHttp   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 6 votes vote down vote up
/** @inheritdoc */
@Override
protected void bindValues(SQLiteStatement stmt, SisterCache entity) {
    stmt.clearBindings();
 
    Long id = entity.getId();
    if (id != null) {
        stmt.bindLong(1, id);
    }
 
    String result = entity.getResult();
    if (result != null) {
        stmt.bindString(2, result);
    }
 
    Integer page = entity.getPage();
    if (page != null) {
        stmt.bindLong(3, page);
    }
 
    Long time = entity.getTime();
    if (time != null) {
        stmt.bindLong(4, time);
    }
}
 
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_OkHttpWithVolley   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 5 votes vote down vote up
/** @inheritdoc */
@Override
public SisterCache readEntity(Cursor cursor, int offset) {
    SisterCache entity = new SisterCache( //
        cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
        cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // result
        cursor.isNull(offset + 2) ? null : cursor.getInt(offset + 2), // page
        cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3) // time
    );
    return entity;
}
 
Example #7
Source Project: JianDan_OkHttpWithVolley   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 5 votes vote down vote up
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, SisterCache entity, int offset) {
    entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
    entity.setResult(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
    entity.setPage(cursor.isNull(offset + 2) ? null : cursor.getInt(offset + 2));
    entity.setTime(cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3));
 }
 
Example #8
Source Project: JianDan_OkHttpWithVolley   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 5 votes vote down vote up
/** @inheritdoc */
@Override
public Long getKey(SisterCache entity) {
    if(entity != null) {
        return entity.getId();
    } else {
        return null;
    }
}
 
Example #9
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 #10
Source Project: JianDan   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 5 votes vote down vote up
/** @inheritdoc */
@Override
public SisterCache readEntity(Cursor cursor, int offset) {
    SisterCache entity = new SisterCache( //
        cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
        cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // result
        cursor.isNull(offset + 2) ? null : cursor.getInt(offset + 2), // page
        cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3) // time
    );
    return entity;
}
 
Example #11
Source Project: JianDan   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 5 votes vote down vote up
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, SisterCache entity, int offset) {
    entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
    entity.setResult(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
    entity.setPage(cursor.isNull(offset + 2) ? null : cursor.getInt(offset + 2));
    entity.setTime(cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3));
 }
 
Example #12
Source Project: JianDan   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 5 votes vote down vote up
/** @inheritdoc */
@Override
public Long getKey(SisterCache entity) {
    if(entity != null) {
        return entity.getId();
    } else {
        return null;
    }
}
 
Example #13
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 #14
Source Project: JianDanRxJava   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 5 votes vote down vote up
/** @inheritdoc */
@Override
public SisterCache readEntity(Cursor cursor, int offset) {
    SisterCache entity = new SisterCache( //
        cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
        cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // result
        cursor.isNull(offset + 2) ? null : cursor.getInt(offset + 2), // page
        cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3) // time
    );
    return entity;
}
 
Example #15
Source Project: JianDanRxJava   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 5 votes vote down vote up
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, SisterCache entity, int offset) {
    entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
    entity.setResult(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
    entity.setPage(cursor.isNull(offset + 2) ? null : cursor.getInt(offset + 2));
    entity.setTime(cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3));
 }
 
Example #16
Source Project: JianDanRxJava   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 5 votes vote down vote up
/** @inheritdoc */
@Override
public Long getKey(SisterCache entity) {
    if(entity != null) {
        return entity.getId();
    } else {
        return null;
    }
}
 
Example #17
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 #18
Source Project: JianDan_OkHttp   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 5 votes vote down vote up
/** @inheritdoc */
@Override
public SisterCache readEntity(Cursor cursor, int offset) {
    SisterCache entity = new SisterCache( //
        cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
        cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // result
        cursor.isNull(offset + 2) ? null : cursor.getInt(offset + 2), // page
        cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3) // time
    );
    return entity;
}
 
Example #19
Source Project: JianDan_OkHttp   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 5 votes vote down vote up
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, SisterCache entity, int offset) {
    entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
    entity.setResult(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
    entity.setPage(cursor.isNull(offset + 2) ? null : cursor.getInt(offset + 2));
    entity.setTime(cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3));
 }
 
Example #20
Source Project: JianDan_OkHttp   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 5 votes vote down vote up
/** @inheritdoc */
@Override
public Long getKey(SisterCache entity) {
    if(entity != null) {
        return entity.getId();
    } else {
        return null;
    }
}
 
Example #21
Source Project: JianDan_OkHttpWithVolley   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 4 votes vote down vote up
/** @inheritdoc */
@Override
protected Long updateKeyAfterInsert(SisterCache entity, long rowId) {
    entity.setId(rowId);
    return rowId;
}
 
Example #22
Source Project: JianDan   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 4 votes vote down vote up
/** @inheritdoc */
@Override
protected Long updateKeyAfterInsert(SisterCache entity, long rowId) {
    entity.setId(rowId);
    return rowId;
}
 
Example #23
Source Project: JianDanRxJava   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 4 votes vote down vote up
/** @inheritdoc */
@Override
protected Long updateKeyAfterInsert(SisterCache entity, long rowId) {
    entity.setId(rowId);
    return rowId;
}
 
Example #24
Source Project: JianDan_OkHttp   Author: ZhaoKaiQiang   File: SisterCacheDao.java    License: Apache License 2.0 4 votes vote down vote up
/** @inheritdoc */
@Override
protected Long updateKeyAfterInsert(SisterCache entity, long rowId) {
    entity.setId(rowId);
    return rowId;
}