package com.adins.mss.dao;

import com.adins.mss.dao.DaoSession;
import de.greenrobot.dao.DaoException;

import com.adins.mss.base.util.ExcludeFromGson;
import com.google.gson.annotations.SerializedName;

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

    /** Not-null value. */
     @SerializedName("uuid_kompetisi")
    private String uuid_kompetisi;
     @SerializedName("MEMBERSHIP_PROGRAM_CODE")
    private String membershipProgramCode;
     @SerializedName("MEMBERSHIP_PROGRAM_NAME")
    private String membershipProgramName;
     @SerializedName("MEMBERSHIP_PROGRAM_PRIORITY")
    private String membershipProgramPriorityCode;
     @SerializedName("MEMBERSHIP_PROGRAM_STATUS")
    private String membershipProgramStatus;
     @SerializedName("MEMBERSHIP_PROGRAM_EXPIRED_DATE")
    private String membershipProgramExpiredDate;
     @SerializedName("MEMBERSHIP_PROGRAM_START_DATE")
    private String membershipProgramStartDate;
     @SerializedName("GRACE_PERIODE")
    private String gracePeriode;
     @SerializedName("LOGO")
    private String membershipProgramLogo;
     @SerializedName("uuid_user")
    private String uuid_user;

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

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

    private User user;
    private String user__resolvedKey;


    public Kompetisi() {
    }

    public Kompetisi(String uuid_kompetisi) {
        this.uuid_kompetisi = uuid_kompetisi;
    }

    public Kompetisi(String uuid_kompetisi, String membershipProgramCode, String membershipProgramName, String membershipProgramPriorityCode, String membershipProgramStatus, String membershipProgramExpiredDate, String membershipProgramStartDate, String gracePeriode, String membershipProgramLogo, String uuid_user) {
        this.uuid_kompetisi = uuid_kompetisi;
        this.membershipProgramCode = membershipProgramCode;
        this.membershipProgramName = membershipProgramName;
        this.membershipProgramPriorityCode = membershipProgramPriorityCode;
        this.membershipProgramStatus = membershipProgramStatus;
        this.membershipProgramExpiredDate = membershipProgramExpiredDate;
        this.membershipProgramStartDate = membershipProgramStartDate;
        this.gracePeriode = gracePeriode;
        this.membershipProgramLogo = membershipProgramLogo;
        this.uuid_user = uuid_user;
    }

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

    /** Not-null value. */
    public String getUuid_kompetisi() {
        return uuid_kompetisi;
    }

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

    public String getMembershipProgramCode() {
        return membershipProgramCode;
    }

    public void setMembershipProgramCode(String membershipProgramCode) {
        this.membershipProgramCode = membershipProgramCode;
    }

    public String getMembershipProgramName() {
        return membershipProgramName;
    }

    public void setMembershipProgramName(String membershipProgramName) {
        this.membershipProgramName = membershipProgramName;
    }

    public String getMembershipProgramPriorityCode() {
        return membershipProgramPriorityCode;
    }

    public void setMembershipProgramPriorityCode(String membershipProgramPriorityCode) {
        this.membershipProgramPriorityCode = membershipProgramPriorityCode;
    }

    public String getMembershipProgramStatus() {
        return membershipProgramStatus;
    }

    public void setMembershipProgramStatus(String membershipProgramStatus) {
        this.membershipProgramStatus = membershipProgramStatus;
    }

    public String getMembershipProgramExpiredDate() {
        return membershipProgramExpiredDate;
    }

    public void setMembershipProgramExpiredDate(String membershipProgramExpiredDate) {
        this.membershipProgramExpiredDate = membershipProgramExpiredDate;
    }

    public String getMembershipProgramStartDate() {
        return membershipProgramStartDate;
    }

    public void setMembershipProgramStartDate(String membershipProgramStartDate) {
        this.membershipProgramStartDate = membershipProgramStartDate;
    }

    public String getGracePeriode() {
        return gracePeriode;
    }

    public void setGracePeriode(String gracePeriode) {
        this.gracePeriode = gracePeriode;
    }

    public String getMembershipProgramLogo() {
        return membershipProgramLogo;
    }

    public void setMembershipProgramLogo(String membershipProgramLogo) {
        this.membershipProgramLogo = membershipProgramLogo;
    }

    public String getUuid_user() {
        return uuid_user;
    }

    public void setUuid_user(String uuid_user) {
        this.uuid_user = uuid_user;
    }

    /** To-one relationship, resolved on first access. */
    public User getUser() {
        String __key = this.uuid_user;
        if (user__resolvedKey == null || user__resolvedKey != __key) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            UserDao targetDao = daoSession.getUserDao();
            User userNew = targetDao.load(__key);
            synchronized (this) {
                user = userNew;
            	user__resolvedKey = __key;
            }
        }
        return user;
    }

    public void setUser(User user) {
        synchronized (this) {
            this.user = user;
            uuid_user = user == null ? null : user.getUuid_user();
            user__resolvedKey = uuid_user;
        }
    }

    /** Convenient call for {@link AbstractDao#delete(Object)}. Entity must attached to an entity context. */
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }    
        myDao.delete(this);
    }

    /** Convenient call for {@link AbstractDao#update(Object)}. Entity must attached to an entity context. */
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }    
        myDao.update(this);
    }

    /** Convenient call for {@link AbstractDao#refresh(Object)}. Entity must attached to an entity context. */
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }    
        myDao.refresh(this);
    }

}
