package com.jingpu.android.apersistance.greendao.model;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.jingpu.android.apersistance.greendao.model.C;
import com.jingpu.android.apersistance.greendao.model.Warehouse;
import com.jingpu.android.apersistance.greendao.model.District;
import com.jingpu.android.apersistance.greendao.model.Customer;
import com.jingpu.android.apersistance.greendao.model.History;
import com.jingpu.android.apersistance.greendao.model.NewOrders;
import com.jingpu.android.apersistance.greendao.model.Orders;
import com.jingpu.android.apersistance.greendao.model.OrderLine;
import com.jingpu.android.apersistance.greendao.model.Item;
import com.jingpu.android.apersistance.greendao.model.Stock;
import com.jingpu.android.apersistance.greendao.model.DeliveryRequest;
import com.jingpu.android.apersistance.greendao.model.DeliveryOrders;
import com.jingpu.android.apersistance.greendao.model.Category;
import com.jingpu.android.apersistance.greendao.model.CItem;

import com.jingpu.android.apersistance.greendao.model.CDao;
import com.jingpu.android.apersistance.greendao.model.WarehouseDao;
import com.jingpu.android.apersistance.greendao.model.DistrictDao;
import com.jingpu.android.apersistance.greendao.model.CustomerDao;
import com.jingpu.android.apersistance.greendao.model.HistoryDao;
import com.jingpu.android.apersistance.greendao.model.NewOrdersDao;
import com.jingpu.android.apersistance.greendao.model.OrdersDao;
import com.jingpu.android.apersistance.greendao.model.OrderLineDao;
import com.jingpu.android.apersistance.greendao.model.ItemDao;
import com.jingpu.android.apersistance.greendao.model.StockDao;
import com.jingpu.android.apersistance.greendao.model.DeliveryRequestDao;
import com.jingpu.android.apersistance.greendao.model.DeliveryOrdersDao;
import com.jingpu.android.apersistance.greendao.model.CategoryDao;
import com.jingpu.android.apersistance.greendao.model.CItemDao;

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

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig cDaoConfig;
    private final DaoConfig warehouseDaoConfig;
    private final DaoConfig districtDaoConfig;
    private final DaoConfig customerDaoConfig;
    private final DaoConfig historyDaoConfig;
    private final DaoConfig newOrdersDaoConfig;
    private final DaoConfig ordersDaoConfig;
    private final DaoConfig orderLineDaoConfig;
    private final DaoConfig itemDaoConfig;
    private final DaoConfig stockDaoConfig;
    private final DaoConfig deliveryRequestDaoConfig;
    private final DaoConfig deliveryOrdersDaoConfig;
    private final DaoConfig categoryDaoConfig;
    private final DaoConfig cItemDaoConfig;

    private final CDao cDao;
    private final WarehouseDao warehouseDao;
    private final DistrictDao districtDao;
    private final CustomerDao customerDao;
    private final HistoryDao historyDao;
    private final NewOrdersDao newOrdersDao;
    private final OrdersDao ordersDao;
    private final OrderLineDao orderLineDao;
    private final ItemDao itemDao;
    private final StockDao stockDao;
    private final DeliveryRequestDao deliveryRequestDao;
    private final DeliveryOrdersDao deliveryOrdersDao;
    private final CategoryDao categoryDao;
    private final CItemDao cItemDao;

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

        cDaoConfig = daoConfigMap.get(CDao.class).clone();
        cDaoConfig.initIdentityScope(type);

        warehouseDaoConfig = daoConfigMap.get(WarehouseDao.class).clone();
        warehouseDaoConfig.initIdentityScope(type);

        districtDaoConfig = daoConfigMap.get(DistrictDao.class).clone();
        districtDaoConfig.initIdentityScope(type);

        customerDaoConfig = daoConfigMap.get(CustomerDao.class).clone();
        customerDaoConfig.initIdentityScope(type);

        historyDaoConfig = daoConfigMap.get(HistoryDao.class).clone();
        historyDaoConfig.initIdentityScope(type);

        newOrdersDaoConfig = daoConfigMap.get(NewOrdersDao.class).clone();
        newOrdersDaoConfig.initIdentityScope(type);

        ordersDaoConfig = daoConfigMap.get(OrdersDao.class).clone();
        ordersDaoConfig.initIdentityScope(type);

        orderLineDaoConfig = daoConfigMap.get(OrderLineDao.class).clone();
        orderLineDaoConfig.initIdentityScope(type);

        itemDaoConfig = daoConfigMap.get(ItemDao.class).clone();
        itemDaoConfig.initIdentityScope(type);

        stockDaoConfig = daoConfigMap.get(StockDao.class).clone();
        stockDaoConfig.initIdentityScope(type);

        deliveryRequestDaoConfig = daoConfigMap.get(DeliveryRequestDao.class).clone();
        deliveryRequestDaoConfig.initIdentityScope(type);

        deliveryOrdersDaoConfig = daoConfigMap.get(DeliveryOrdersDao.class).clone();
        deliveryOrdersDaoConfig.initIdentityScope(type);

        categoryDaoConfig = daoConfigMap.get(CategoryDao.class).clone();
        categoryDaoConfig.initIdentityScope(type);

        cItemDaoConfig = daoConfigMap.get(CItemDao.class).clone();
        cItemDaoConfig.initIdentityScope(type);

        cDao = new CDao(cDaoConfig, this);
        warehouseDao = new WarehouseDao(warehouseDaoConfig, this);
        districtDao = new DistrictDao(districtDaoConfig, this);
        customerDao = new CustomerDao(customerDaoConfig, this);
        historyDao = new HistoryDao(historyDaoConfig, this);
        newOrdersDao = new NewOrdersDao(newOrdersDaoConfig, this);
        ordersDao = new OrdersDao(ordersDaoConfig, this);
        orderLineDao = new OrderLineDao(orderLineDaoConfig, this);
        itemDao = new ItemDao(itemDaoConfig, this);
        stockDao = new StockDao(stockDaoConfig, this);
        deliveryRequestDao = new DeliveryRequestDao(deliveryRequestDaoConfig, this);
        deliveryOrdersDao = new DeliveryOrdersDao(deliveryOrdersDaoConfig, this);
        categoryDao = new CategoryDao(categoryDaoConfig, this);
        cItemDao = new CItemDao(cItemDaoConfig, this);

        registerDao(C.class, cDao);
        registerDao(Warehouse.class, warehouseDao);
        registerDao(District.class, districtDao);
        registerDao(Customer.class, customerDao);
        registerDao(History.class, historyDao);
        registerDao(NewOrders.class, newOrdersDao);
        registerDao(Orders.class, ordersDao);
        registerDao(OrderLine.class, orderLineDao);
        registerDao(Item.class, itemDao);
        registerDao(Stock.class, stockDao);
        registerDao(DeliveryRequest.class, deliveryRequestDao);
        registerDao(DeliveryOrders.class, deliveryOrdersDao);
        registerDao(Category.class, categoryDao);
        registerDao(CItem.class, cItemDao);
    }
    
    public void clear() {
        cDaoConfig.getIdentityScope().clear();
        warehouseDaoConfig.getIdentityScope().clear();
        districtDaoConfig.getIdentityScope().clear();
        customerDaoConfig.getIdentityScope().clear();
        historyDaoConfig.getIdentityScope().clear();
        newOrdersDaoConfig.getIdentityScope().clear();
        ordersDaoConfig.getIdentityScope().clear();
        orderLineDaoConfig.getIdentityScope().clear();
        itemDaoConfig.getIdentityScope().clear();
        stockDaoConfig.getIdentityScope().clear();
        deliveryRequestDaoConfig.getIdentityScope().clear();
        deliveryOrdersDaoConfig.getIdentityScope().clear();
        categoryDaoConfig.getIdentityScope().clear();
        cItemDaoConfig.getIdentityScope().clear();
    }

    public CDao getCDao() {
        return cDao;
    }

    public WarehouseDao getWarehouseDao() {
        return warehouseDao;
    }

    public DistrictDao getDistrictDao() {
        return districtDao;
    }

    public CustomerDao getCustomerDao() {
        return customerDao;
    }

    public HistoryDao getHistoryDao() {
        return historyDao;
    }

    public NewOrdersDao getNewOrdersDao() {
        return newOrdersDao;
    }

    public OrdersDao getOrdersDao() {
        return ordersDao;
    }

    public OrderLineDao getOrderLineDao() {
        return orderLineDao;
    }

    public ItemDao getItemDao() {
        return itemDao;
    }

    public StockDao getStockDao() {
        return stockDao;
    }

    public DeliveryRequestDao getDeliveryRequestDao() {
        return deliveryRequestDao;
    }

    public DeliveryOrdersDao getDeliveryOrdersDao() {
        return deliveryOrdersDao;
    }

    public CategoryDao getCategoryDao() {
        return categoryDao;
    }

    public CItemDao getCItemDao() {
        return cItemDao;
    }

}
