Search in sources :

Example 1 with DownloadDirnameDao

use of com.hippo.ehviewer.dao.DownloadDirnameDao in project EhViewer by seven332.

the class EhDB method getDownloadDirname.

@Nullable
public static synchronized String getDownloadDirname(long gid) {
    DownloadDirnameDao dao = sDaoSession.getDownloadDirnameDao();
    DownloadDirname raw = dao.load(gid);
    if (raw != null) {
        return raw.getDirname();
    } else {
        return null;
    }
}
Also used : DownloadDirname(com.hippo.ehviewer.dao.DownloadDirname) DownloadDirnameDao(com.hippo.ehviewer.dao.DownloadDirnameDao) Nullable(android.support.annotation.Nullable)

Example 2 with DownloadDirnameDao

use of com.hippo.ehviewer.dao.DownloadDirnameDao in project EhViewer by seven332.

the class EhDB method removeDownloadDirname.

public static synchronized void removeDownloadDirname(long gid) {
    DownloadDirnameDao dao = sDaoSession.getDownloadDirnameDao();
    dao.deleteByKey(gid);
}
Also used : DownloadDirnameDao(com.hippo.ehviewer.dao.DownloadDirnameDao)

Example 3 with DownloadDirnameDao

use of com.hippo.ehviewer.dao.DownloadDirnameDao in project EhViewer by seven332.

the class EhDB method clearDownloadDirname.

public static synchronized void clearDownloadDirname() {
    DownloadDirnameDao dao = sDaoSession.getDownloadDirnameDao();
    dao.deleteAll();
}
Also used : DownloadDirnameDao(com.hippo.ehviewer.dao.DownloadDirnameDao)

Example 4 with DownloadDirnameDao

use of com.hippo.ehviewer.dao.DownloadDirnameDao in project EhViewer by seven332.

the class EhDB method putDownloadDirname.

/**
 * Insert or update
 */
public static synchronized void putDownloadDirname(long gid, String dirname) {
    DownloadDirnameDao dao = sDaoSession.getDownloadDirnameDao();
    DownloadDirname raw = dao.load(gid);
    if (raw != null) {
        // Update
        raw.setDirname(dirname);
        dao.update(raw);
    } else {
        // Insert
        raw = new DownloadDirname();
        raw.setGid(gid);
        raw.setDirname(dirname);
        dao.insert(raw);
    }
}
Also used : DownloadDirname(com.hippo.ehviewer.dao.DownloadDirname) DownloadDirnameDao(com.hippo.ehviewer.dao.DownloadDirnameDao)

Aggregations

DownloadDirnameDao (com.hippo.ehviewer.dao.DownloadDirnameDao)4 DownloadDirname (com.hippo.ehviewer.dao.DownloadDirname)2 Nullable (android.support.annotation.Nullable)1