DaoSession.java 5.24 KB
package com.lijinji.scan.wmsgreendao;

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.lijinji.scan.bean.ActivityIslandBean;
import com.lijinji.scan.bean.LineBean;
import com.lijinji.scan.bean.MenuOperationBean;
import com.lijinji.scan.bean.ProductBean;
import com.lijinji.scan.bean.ProductTransBean;
import com.lijinji.scan.bean.WorkProcessBean;
import com.lijinji.scan.bean.WorkProcessDetailBean;

import com.lijinji.scan.wmsgreendao.ActivityIslandBeanDao;
import com.lijinji.scan.wmsgreendao.LineBeanDao;
import com.lijinji.scan.wmsgreendao.MenuOperationBeanDao;
import com.lijinji.scan.wmsgreendao.ProductBeanDao;
import com.lijinji.scan.wmsgreendao.ProductTransBeanDao;
import com.lijinji.scan.wmsgreendao.WorkProcessBeanDao;
import com.lijinji.scan.wmsgreendao.WorkProcessDetailBeanDao;

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

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

    private final DaoConfig activityIslandBeanDaoConfig;
    private final DaoConfig lineBeanDaoConfig;
    private final DaoConfig menuOperationBeanDaoConfig;
    private final DaoConfig productBeanDaoConfig;
    private final DaoConfig productTransBeanDaoConfig;
    private final DaoConfig workProcessBeanDaoConfig;
    private final DaoConfig workProcessDetailBeanDaoConfig;

    private final ActivityIslandBeanDao activityIslandBeanDao;
    private final LineBeanDao lineBeanDao;
    private final MenuOperationBeanDao menuOperationBeanDao;
    private final ProductBeanDao productBeanDao;
    private final ProductTransBeanDao productTransBeanDao;
    private final WorkProcessBeanDao workProcessBeanDao;
    private final WorkProcessDetailBeanDao workProcessDetailBeanDao;

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

        activityIslandBeanDaoConfig = daoConfigMap.get(ActivityIslandBeanDao.class).clone();
        activityIslandBeanDaoConfig.initIdentityScope(type);

        lineBeanDaoConfig = daoConfigMap.get(LineBeanDao.class).clone();
        lineBeanDaoConfig.initIdentityScope(type);

        menuOperationBeanDaoConfig = daoConfigMap.get(MenuOperationBeanDao.class).clone();
        menuOperationBeanDaoConfig.initIdentityScope(type);

        productBeanDaoConfig = daoConfigMap.get(ProductBeanDao.class).clone();
        productBeanDaoConfig.initIdentityScope(type);

        productTransBeanDaoConfig = daoConfigMap.get(ProductTransBeanDao.class).clone();
        productTransBeanDaoConfig.initIdentityScope(type);

        workProcessBeanDaoConfig = daoConfigMap.get(WorkProcessBeanDao.class).clone();
        workProcessBeanDaoConfig.initIdentityScope(type);

        workProcessDetailBeanDaoConfig = daoConfigMap.get(WorkProcessDetailBeanDao.class).clone();
        workProcessDetailBeanDaoConfig.initIdentityScope(type);

        activityIslandBeanDao = new ActivityIslandBeanDao(activityIslandBeanDaoConfig, this);
        lineBeanDao = new LineBeanDao(lineBeanDaoConfig, this);
        menuOperationBeanDao = new MenuOperationBeanDao(menuOperationBeanDaoConfig, this);
        productBeanDao = new ProductBeanDao(productBeanDaoConfig, this);
        productTransBeanDao = new ProductTransBeanDao(productTransBeanDaoConfig, this);
        workProcessBeanDao = new WorkProcessBeanDao(workProcessBeanDaoConfig, this);
        workProcessDetailBeanDao = new WorkProcessDetailBeanDao(workProcessDetailBeanDaoConfig, this);

        registerDao(ActivityIslandBean.class, activityIslandBeanDao);
        registerDao(LineBean.class, lineBeanDao);
        registerDao(MenuOperationBean.class, menuOperationBeanDao);
        registerDao(ProductBean.class, productBeanDao);
        registerDao(ProductTransBean.class, productTransBeanDao);
        registerDao(WorkProcessBean.class, workProcessBeanDao);
        registerDao(WorkProcessDetailBean.class, workProcessDetailBeanDao);
    }
    
    public void clear() {
        activityIslandBeanDaoConfig.clearIdentityScope();
        lineBeanDaoConfig.clearIdentityScope();
        menuOperationBeanDaoConfig.clearIdentityScope();
        productBeanDaoConfig.clearIdentityScope();
        productTransBeanDaoConfig.clearIdentityScope();
        workProcessBeanDaoConfig.clearIdentityScope();
        workProcessDetailBeanDaoConfig.clearIdentityScope();
    }

    public ActivityIslandBeanDao getActivityIslandBeanDao() {
        return activityIslandBeanDao;
    }

    public LineBeanDao getLineBeanDao() {
        return lineBeanDao;
    }

    public MenuOperationBeanDao getMenuOperationBeanDao() {
        return menuOperationBeanDao;
    }

    public ProductBeanDao getProductBeanDao() {
        return productBeanDao;
    }

    public ProductTransBeanDao getProductTransBeanDao() {
        return productTransBeanDao;
    }

    public WorkProcessBeanDao getWorkProcessBeanDao() {
        return workProcessBeanDao;
    }

    public WorkProcessDetailBeanDao getWorkProcessDetailBeanDao() {
        return workProcessDetailBeanDao;
    }

}