package com.jiang.android.rxjavaapp.database;

import de.greenrobot.dao.DaoException;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit. 
/**
 * Entity mapped to table "ALLOPERATORS".
 */
public class alloperators {

    private Long id;
    /** Not-null value. */
    private String name;
    /** Not-null value. */
    private String thread;
    /** Not-null value. */
    private String desc;
    /** Not-null value. */
    private String img;
    /** Not-null value. */
    private String url;
    private Long operators_id;

    /** Used to resolve relations */
    private transient DaoSession daoSession;

    /** Used for active entity operations. */
    private transient alloperatorsDao myDao;

    private operators operators;
    private Long operators__resolvedKey;


    public alloperators() {
    }

    public alloperators(Long id) {
        this.id = id;
    }

    public alloperators(Long id, String name, String thread, String desc, String img, String url, Long operators_id) {
        this.id = id;
        this.name = name;
        this.thread = thread;
        this.desc = desc;
        this.img = img;
        this.url = url;
        this.operators_id = operators_id;
    }

    /** called by internal mechanisms, do not call yourself. */
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getAlloperatorsDao() : null;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /** Not-null value. */
    public String getName() {
        return name;
    }

    /** Not-null value; ensure this value is available before it is saved to the database. */
    public void setName(String name) {
        this.name = name;
    }

    /** Not-null value. */
    public String getThread() {
        return thread;
    }

    /** Not-null value; ensure this value is available before it is saved to the database. */
    public void setThread(String thread) {
        this.thread = thread;
    }

    /** Not-null value. */
    public String getDesc() {
        return desc;
    }

    /** Not-null value; ensure this value is available before it is saved to the database. */
    public void setDesc(String desc) {
        this.desc = desc;
    }

    /** Not-null value. */
    public String getImg() {
        return img;
    }

    /** Not-null value; ensure this value is available before it is saved to the database. */
    public void setImg(String img) {
        this.img = img;
    }

    /** Not-null value. */
    public String getUrl() {
        return url;
    }

    /** Not-null value; ensure this value is available before it is saved to the database. */
    public void setUrl(String url) {
        this.url = url;
    }

    public Long getOperators_id() {
        return operators_id;
    }

    public void setOperators_id(Long operators_id) {
        this.operators_id = operators_id;
    }

    /** To-one relationship, resolved on first access. */
    public operators getOperators() {
        Long __key = this.operators_id;
        if (operators__resolvedKey == null || !operators__resolvedKey.equals(__key)) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            operatorsDao targetDao = daoSession.getOperatorsDao();
            operators operatorsNew = targetDao.load(__key);
            synchronized (this) {
                operators = operatorsNew;
            	operators__resolvedKey = __key;
            }
        }
        return operators;
    }

    public void setOperators(operators operators) {
        synchronized (this) {
            this.operators = operators;
            operators_id = operators == null ? null : operators.getId();
            operators__resolvedKey = operators_id;
        }
    }

    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }    
        myDao.delete(this);
    }

    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }    
        myDao.update(this);
    }

    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }    
        myDao.refresh(this);
    }

}
