package com.oo.eye.gen;

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.oo.eye.bean.ClassBean;
import com.oo.eye.bean.StudentBean;

import com.oo.eye.gen.ClassBeanDao;
import com.oo.eye.gen.StudentBeanDao;

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

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

    private final DaoConfig classBeanDaoConfig;
    private final DaoConfig studentBeanDaoConfig;

    private final ClassBeanDao classBeanDao;
    private final StudentBeanDao studentBeanDao;

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

        classBeanDaoConfig = daoConfigMap.get(ClassBeanDao.class).clone();
        classBeanDaoConfig.initIdentityScope(type);

        studentBeanDaoConfig = daoConfigMap.get(StudentBeanDao.class).clone();
        studentBeanDaoConfig.initIdentityScope(type);

        classBeanDao = new ClassBeanDao(classBeanDaoConfig, this);
        studentBeanDao = new StudentBeanDao(studentBeanDaoConfig, this);

        registerDao(ClassBean.class, classBeanDao);
        registerDao(StudentBean.class, studentBeanDao);
    }
    
    public void clear() {
        classBeanDaoConfig.clearIdentityScope();
        studentBeanDaoConfig.clearIdentityScope();
    }

    public ClassBeanDao getClassBeanDao() {
        return classBeanDao;
    }

    public StudentBeanDao getStudentBeanDao() {
        return studentBeanDao;
    }

}
