package com.itrycn.myeasywol.db.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.itrycn.myeasywol.db.entity.PCInfo;
import com.itrycn.myeasywol.db.entity.ServerInfo;

import com.itrycn.myeasywol.db.dao.PCInfoDao;
import com.itrycn.myeasywol.db.dao.ServerInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig pCInfoDaoConfig;
    private final DaoConfig serverInfoDaoConfig;

    private final PCInfoDao pCInfoDao;
    private final ServerInfoDao serverInfoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        pCInfoDaoConfig = daoConfigMap.get(PCInfoDao.class).clone();
        pCInfoDaoConfig.initIdentityScope(type);

        serverInfoDaoConfig = daoConfigMap.get(ServerInfoDao.class).clone();
        serverInfoDaoConfig.initIdentityScope(type);

        pCInfoDao = new PCInfoDao(pCInfoDaoConfig, this);
        serverInfoDao = new ServerInfoDao(serverInfoDaoConfig, this);

        registerDao(PCInfo.class, pCInfoDao);
        registerDao(ServerInfo.class, serverInfoDao);
    }
    
    public void clear() {
        pCInfoDaoConfig.clearIdentityScope();
        serverInfoDaoConfig.clearIdentityScope();
    }

    public PCInfoDao getPCInfoDao() {
        return pCInfoDao;
    }

    public ServerInfoDao getServerInfoDao() {
        return serverInfoDao;
    }

}
