package hf.lskj.com.carstockcount.db;

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 hf.lskj.com.carstockcount.db.CarInfo;
import hf.lskj.com.carstockcount.db.Record;
import hf.lskj.com.carstockcount.db.User;

import hf.lskj.com.carstockcount.db.CarInfoDao;
import hf.lskj.com.carstockcount.db.RecordDao;
import hf.lskj.com.carstockcount.db.UserDao;

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

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

    private final DaoConfig carInfoDaoConfig;
    private final DaoConfig recordDaoConfig;
    private final DaoConfig userDaoConfig;

    private final CarInfoDao carInfoDao;
    private final RecordDao recordDao;
    private final UserDao userDao;

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

        carInfoDaoConfig = daoConfigMap.get(CarInfoDao.class).clone();
        carInfoDaoConfig.initIdentityScope(type);

        recordDaoConfig = daoConfigMap.get(RecordDao.class).clone();
        recordDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        carInfoDao = new CarInfoDao(carInfoDaoConfig, this);
        recordDao = new RecordDao(recordDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);

        registerDao(CarInfo.class, carInfoDao);
        registerDao(Record.class, recordDao);
        registerDao(User.class, userDao);
    }
    
    public void clear() {
        carInfoDaoConfig.clearIdentityScope();
        recordDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
    }

    public CarInfoDao getCarInfoDao() {
        return carInfoDao;
    }

    public RecordDao getRecordDao() {
        return recordDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

}
