當前位置: 首頁>>代碼示例>>Java>>正文


Java Dao類代碼示例

本文整理匯總了Java中com.hannesdorfmann.sqlbrite.dao.Dao的典型用法代碼示例。如果您正苦於以下問題:Java Dao類的具體用法?Java Dao怎麽用?Java Dao使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Dao類屬於com.hannesdorfmann.sqlbrite.dao包,在下文中一共展示了Dao類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: loadInstalledFileIndex

import com.hannesdorfmann.sqlbrite.dao.Dao; //導入依賴的package包/類
public static HashMap<String, ExpansionIndexItem> loadInstalledFileIndex(Context context, Dao dao) {

        ArrayList<ExpansionIndexItem> indexList = loadIndex(context, installedIndexName, dao);

        HashMap<String, ExpansionIndexItem> indexMap = new HashMap<String, ExpansionIndexItem>();

        for (ExpansionIndexItem item : indexList) {
            // construct names (index by main and patch file names)
            String mainName = buildFileName(item, Constants.MAIN);
            indexMap.put(mainName, item);
            String patchName = buildFileName(item, Constants.MAIN);
            indexMap.put(patchName, item);
        }

        return indexMap;
    }
 
開發者ID:StoryMaker,項目名稱:storypath,代碼行數:17,代碼來源:StorymakerIndexManager.java

示例2: loadAvailableFileIndex

import com.hannesdorfmann.sqlbrite.dao.Dao; //導入依賴的package包/類
public static HashMap<String, ExpansionIndexItem> loadAvailableFileIndex(Context context, Dao dao) {

        ArrayList<ExpansionIndexItem> indexList = loadIndex(context, getAvailableVersionName(), dao);

        HashMap<String, ExpansionIndexItem> indexMap = new HashMap<String, ExpansionIndexItem>();

        for (ExpansionIndexItem item : indexList) {
            // construct name (index by main file names)
            String fileName = buildFileName(item, Constants.MAIN);
            indexMap.put(fileName, item);
        }

        return indexMap;
    }
 
開發者ID:StoryMaker,項目名稱:storypath,代碼行數:15,代碼來源:StorymakerIndexManager.java

示例3: loadAvailableIdIndex

import com.hannesdorfmann.sqlbrite.dao.Dao; //導入依賴的package包/類
public static HashMap<String, ExpansionIndexItem> loadAvailableIdIndex(Context context, Dao dao) {
    ArrayList<ExpansionIndexItem> indexList = loadIndex(context, getAvailableVersionName(), dao);
    HashMap<String, ExpansionIndexItem> indexMap = new HashMap<String, ExpansionIndexItem>();
    for (ExpansionIndexItem item : indexList) {
        indexMap.put(item.getExpansionId(), item);
    }
    return indexMap;
}
 
開發者ID:StoryMaker,項目名稱:storypath,代碼行數:9,代碼來源:StorymakerIndexManager.java

示例4: loadInstalledIdIndex

import com.hannesdorfmann.sqlbrite.dao.Dao; //導入依賴的package包/類
public static HashMap<String, ExpansionIndexItem> loadInstalledIdIndex(Context context, Dao dao) {
    ArrayList<ExpansionIndexItem> indexList = loadIndex(context, installedIndexName, dao);
    HashMap<String, ExpansionIndexItem> indexMap = new HashMap<String, ExpansionIndexItem>();
    for (ExpansionIndexItem item : indexList) {
        indexMap.put(item.getExpansionId(), item);
    }
    return indexMap;
}
 
開發者ID:StoryMaker,項目名稱:storypath,代碼行數:9,代碼來源:StorymakerIndexManager.java

示例5: loadInstanceIndexAsList

import com.hannesdorfmann.sqlbrite.dao.Dao; //導入依賴的package包/類
public static ArrayList<InstanceIndexItem> loadInstanceIndexAsList(Context context, Dao dao) {

        // REPLACING FILE ACCESS WITH DB ACCESS

        if (dao instanceof InstanceIndexItemDao) {

            InstanceIndexItemDao instanceDao = (InstanceIndexItemDao) dao;

            instanceDao.getInstanceIndexItems().subscribe(new Action1<List<InstanceIndexItem>>() {

                @Override
                public void call(List<InstanceIndexItem> instanceIndexItems) {

                    cachedInstances = new ArrayList<InstanceIndexItem>();

                    for (InstanceIndexItem item : instanceIndexItems) {
                        cachedInstances.add(item);
                    }
                }
            });
        } else {
            //error
        }

        // code downstream is not expecting a null

        if (cachedInstances.size() > 0) {
            return cachedInstances;
        } else {
            return new ArrayList<InstanceIndexItem>();
        }
    }
 
開發者ID:StoryMaker,項目名稱:storypath,代碼行數:33,代碼來源:StorymakerIndexManager.java

示例6: installedIndexAdd

import com.hannesdorfmann.sqlbrite.dao.Dao; //導入依賴的package包/類
public static void installedIndexAdd(Context context, InstalledIndexItem indexItem, Dao dao) {

        HashMap<String, ExpansionIndexItem> indexMap = loadInstalledIdIndex(context, dao);

        indexMap.put(indexItem.getExpansionId(), indexItem);
        ArrayList<ExpansionIndexItem> indexList = new ArrayList<ExpansionIndexItem>();
        for (ExpansionIndexItem eii : indexMap.values()) {
            indexList.add(eii);
        }
        saveIndex(context, indexList, installedIndexName, dao);
        return;
    }
 
開發者ID:StoryMaker,項目名稱:storypath,代碼行數:13,代碼來源:StorymakerIndexManager.java

示例7: installedIndexRemove

import com.hannesdorfmann.sqlbrite.dao.Dao; //導入依賴的package包/類
public static void installedIndexRemove(Context context, InstalledIndexItem indexItem, Dao dao) {

        HashMap<String, ExpansionIndexItem> indexMap = loadInstalledIdIndex(context, dao);

        if (indexMap.keySet().contains(indexItem.getExpansionId())) {
            indexMap.remove(indexItem.getExpansionId());
            ArrayList<ExpansionIndexItem> indexList = new ArrayList<ExpansionIndexItem>();
            for (ExpansionIndexItem eii : indexMap.values()) {
                indexList.add(eii);
            }

            // need to actually delete item from db (saving updated list will not remove it)
            if (dao instanceof InstalledIndexItemDao) {

                InstalledIndexItemDao installedDao = (InstalledIndexItemDao) dao;
                installedDao.removeInstalledIndexItem(indexItem);

                Timber.d("UN-INSTALLED " + indexItem.getExpansionId() + " FROM INDEX");

            } else {

                Timber.e("FAILED TO UN-INSTALL " + indexItem.getExpansionId() + " (DAO CASTING ISSUE)");

            }

            saveIndex(context, indexList, installedIndexName, dao);
            return;
        }
    }
 
開發者ID:StoryMaker,項目名稱:storypath,代碼行數:30,代碼來源:StorymakerIndexManager.java

示例8: instanceIndexRemoveFromDB

import com.hannesdorfmann.sqlbrite.dao.Dao; //導入依賴的package包/類
public static void instanceIndexRemoveFromDB(Context context, InstanceIndexItem removeItem, Dao dao) {
    // need to actually delete item from db (saving updated list will not remove it)
    if (dao instanceof InstanceIndexItemDao) {
        InstanceIndexItemDao instanceDao = (InstanceIndexItemDao) dao;
        instanceDao.removeInstanceIndexItem(removeItem);
        Timber.d("UN-INSTALLED INSTANCE " + removeItem.getInstanceFilePath() + " FROM INDEX");
    }
}
 
開發者ID:StoryMaker,項目名稱:storypath,代碼行數:9,代碼來源:StorymakerIndexManager.java

示例9: saveInstanceIndex

import com.hannesdorfmann.sqlbrite.dao.Dao; //導入依賴的package包/類
public static void saveInstanceIndex(Context context, ArrayList<InstanceIndexItem> indexList, String jsonFileName, Dao dao) {

        // REPLACING FILE ACCESS WITH DB ACCESS

        if (dao instanceof InstanceIndexItemDao) {

            InstanceIndexItemDao instanceDao = (InstanceIndexItemDao) dao;

            for (InstanceIndexItem item : indexList) {
                instanceDao.addInstanceIndexItem(item, true);
            }
        } else {
            //error
        }
    }
 
開發者ID:StoryMaker,項目名稱:storypath,代碼行數:16,代碼來源:StorymakerIndexManager.java

示例10: loadAvailableIdIndexKeyMap

import com.hannesdorfmann.sqlbrite.dao.Dao; //導入依賴的package包/類
public static IndexKeyMap loadAvailableIdIndexKeyMap(Context context, Dao dao) {

        final IndexKeyMap indexKeyMap = new IndexKeyMap();

        ArrayList<ExpansionIndexItem> indexList = loadIndex(context, getAvailableVersionName(), dao);

        HashMap<String, ExpansionIndexItem> indexMap = new HashMap<String, ExpansionIndexItem>();
        ArrayList<String> indexKeys = new ArrayList<String>();

        for (ExpansionIndexItem item : indexList) {
            indexMap.put(item.getExpansionId(), item);
            indexKeys.add(item.getExpansionId());
        }

        indexKeyMap.indexKeys = indexKeys;
        indexKeyMap.indexMap = indexMap;

        return indexKeyMap;
    }
 
開發者ID:StoryMaker,項目名稱:storypath,代碼行數:20,代碼來源:StorymakerIndexManager.java

示例11: loadInstalledIdIndexKeyMap

import com.hannesdorfmann.sqlbrite.dao.Dao; //導入依賴的package包/類
public static IndexKeyMap loadInstalledIdIndexKeyMap(Context context, Dao dao) {

        final IndexKeyMap indexKeyMap = new IndexKeyMap();

        ArrayList<ExpansionIndexItem> indexList = loadIndex(context, installedIndexName, dao);

        HashMap<String, ExpansionIndexItem> indexMap = new HashMap<String, ExpansionIndexItem>();
        ArrayList<String> indexKeys = new ArrayList<String>();

        for (ExpansionIndexItem item : indexList) {
            indexMap.put(item.getExpansionId(), item);
            indexKeys.add(item.getExpansionId());
        }

        indexKeyMap.indexKeys = indexKeys;
        indexKeyMap.indexMap = indexMap;

        return indexKeyMap;
    }
 
開發者ID:StoryMaker,項目名稱:storypath,代碼行數:20,代碼來源:StorymakerIndexManager.java

示例12: loadAvailableOrderIndex

import com.hannesdorfmann.sqlbrite.dao.Dao; //導入依賴的package包/類
public static HashMap<String, ExpansionIndexItem> loadAvailableOrderIndex(Context context, Dao dao) {

        ArrayList<ExpansionIndexItem> indexList = loadIndex(context, getAvailableVersionName(), dao);

        HashMap<String, ExpansionIndexItem> indexMap = new HashMap<String, ExpansionIndexItem>();

        for (ExpansionIndexItem item : indexList) {
            indexMap.put(item.getPatchOrder(), item);
        }

        return indexMap;
    }
 
開發者ID:StoryMaker,項目名稱:storypath,代碼行數:13,代碼來源:StorymakerIndexManager.java

示例13: loadInstalledOrderIndex

import com.hannesdorfmann.sqlbrite.dao.Dao; //導入依賴的package包/類
public static HashMap<String, ExpansionIndexItem> loadInstalledOrderIndex(Context context, Dao dao) {

        ArrayList<ExpansionIndexItem> indexList = loadIndex(context, installedIndexName, dao);

        HashMap<String, ExpansionIndexItem> indexMap = new HashMap<String, ExpansionIndexItem>();

        for (ExpansionIndexItem item : indexList) {
            indexMap.put(item.getPatchOrder(), item);
        }

        return indexMap;
    }
 
開發者ID:StoryMaker,項目名稱:storypath,代碼行數:13,代碼來源:StorymakerIndexManager.java

示例14: instanceIndexAdd

import com.hannesdorfmann.sqlbrite.dao.Dao; //導入依賴的package包/類
public static void instanceIndexAdd(Context context, InstanceIndexItem addItem, HashMap<String, InstanceIndexItem> indexList, Dao dao) {

        indexList.put(addItem.getInstanceFilePath(), addItem);

        ArrayList<InstanceIndexItem> indexArray = new ArrayList<InstanceIndexItem>(indexList.values());

        saveInstanceIndex(context, indexArray, instanceIndexName, dao);

    }
 
開發者ID:StoryMaker,項目名稱:storypath,代碼行數:10,代碼來源:StorymakerIndexManager.java

示例15: instanceIndexRemove

import com.hannesdorfmann.sqlbrite.dao.Dao; //導入依賴的package包/類
public static void instanceIndexRemove(Context context, InstanceIndexItem removeItem, HashMap<String, InstanceIndexItem> indexList, boolean deleteFiles, boolean deleteMedia, Dao dao) {

        indexList.remove(removeItem.getInstanceFilePath());

        ArrayList<InstanceIndexItem> indexArray = new ArrayList<InstanceIndexItem>(indexList.values());

        saveInstanceIndex(context, indexArray, instanceIndexName, dao);

        if (deleteFiles) {
            removeItem.deleteAssociatedFiles(context, deleteMedia);
        }
    }
 
開發者ID:StoryMaker,項目名稱:storypath,代碼行數:13,代碼來源:StorymakerIndexManager.java


注:本文中的com.hannesdorfmann.sqlbrite.dao.Dao類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。