package com.company.professor;

import com.company.professor.DaoSession;
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 "pokemon_evolution".
 */
public class PokemonEvolution {

    private long Id;
    private long EvolvedSpeciesId;
    private long EvolutionTriggerId;
    private Long TriggerItemId;
    private Long MinimumLevel;
    private Long GenderId;
    private Long LocationId;
    private Long HeldItemId;
    private String TimeOfDay;
    private Long KnownMoveId;
    private Long KnownMoveTypeId;
    private Long MinimumHappiness;
    private Long MinimumBeauty;
    private Long MinimumAffection;
    private Long RelativePhysicalStats;
    private Long PartySpeciesId;
    private Long PartyTypeId;
    private Long TradeSpeciesId;
    private boolean NeedsOverworldRain;
    private boolean TurnUpsideDown;

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

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

    private PokemonSpecies EvolvedSpecies;
    private Long EvolvedSpecies__resolvedKey;

    private EvolutionTriggers EvolutionTriggers;
    private Long EvolutionTriggers__resolvedKey;

    private Items TriggerItem;
    private Long TriggerItem__resolvedKey;

    private Genders Genders;
    private Long Genders__resolvedKey;

    private Locations Locations;
    private Long Locations__resolvedKey;

    private Items HeldItem;
    private Long HeldItem__resolvedKey;

    private Moves Moves;
    private Long Moves__resolvedKey;

    private Types KnownMoveType;
    private Long KnownMoveType__resolvedKey;

    private PokemonSpecies PartySpecies;
    private Long PartySpecies__resolvedKey;

    private Types PartyType;
    private Long PartyType__resolvedKey;

    private PokemonSpecies TradeSpecies;
    private Long TradeSpecies__resolvedKey;


    public PokemonEvolution() {
    }

    public PokemonEvolution(long Id) {
        this.Id = Id;
    }

    public PokemonEvolution(long Id, long EvolvedSpeciesId, long EvolutionTriggerId, Long TriggerItemId, Long MinimumLevel, Long GenderId, Long LocationId, Long HeldItemId, String TimeOfDay, Long KnownMoveId, Long KnownMoveTypeId, Long MinimumHappiness, Long MinimumBeauty, Long MinimumAffection, Long RelativePhysicalStats, Long PartySpeciesId, Long PartyTypeId, Long TradeSpeciesId, boolean NeedsOverworldRain, boolean TurnUpsideDown) {
        this.Id = Id;
        this.EvolvedSpeciesId = EvolvedSpeciesId;
        this.EvolutionTriggerId = EvolutionTriggerId;
        this.TriggerItemId = TriggerItemId;
        this.MinimumLevel = MinimumLevel;
        this.GenderId = GenderId;
        this.LocationId = LocationId;
        this.HeldItemId = HeldItemId;
        this.TimeOfDay = TimeOfDay;
        this.KnownMoveId = KnownMoveId;
        this.KnownMoveTypeId = KnownMoveTypeId;
        this.MinimumHappiness = MinimumHappiness;
        this.MinimumBeauty = MinimumBeauty;
        this.MinimumAffection = MinimumAffection;
        this.RelativePhysicalStats = RelativePhysicalStats;
        this.PartySpeciesId = PartySpeciesId;
        this.PartyTypeId = PartyTypeId;
        this.TradeSpeciesId = TradeSpeciesId;
        this.NeedsOverworldRain = NeedsOverworldRain;
        this.TurnUpsideDown = TurnUpsideDown;
    }

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

    public long getId() {
        return Id;
    }

    public void setId(long Id) {
        this.Id = Id;
    }

    public long getEvolvedSpeciesId() {
        return EvolvedSpeciesId;
    }

    public void setEvolvedSpeciesId(long EvolvedSpeciesId) {
        this.EvolvedSpeciesId = EvolvedSpeciesId;
    }

    public long getEvolutionTriggerId() {
        return EvolutionTriggerId;
    }

    public void setEvolutionTriggerId(long EvolutionTriggerId) {
        this.EvolutionTriggerId = EvolutionTriggerId;
    }

    public Long getTriggerItemId() {
        return TriggerItemId;
    }

    public void setTriggerItemId(Long TriggerItemId) {
        this.TriggerItemId = TriggerItemId;
    }

    public Long getMinimumLevel() {
        return MinimumLevel;
    }

    public void setMinimumLevel(Long MinimumLevel) {
        this.MinimumLevel = MinimumLevel;
    }

    public Long getGenderId() {
        return GenderId;
    }

    public void setGenderId(Long GenderId) {
        this.GenderId = GenderId;
    }

    public Long getLocationId() {
        return LocationId;
    }

    public void setLocationId(Long LocationId) {
        this.LocationId = LocationId;
    }

    public Long getHeldItemId() {
        return HeldItemId;
    }

    public void setHeldItemId(Long HeldItemId) {
        this.HeldItemId = HeldItemId;
    }

    public String getTimeOfDay() {
        return TimeOfDay;
    }

    public void setTimeOfDay(String TimeOfDay) {
        this.TimeOfDay = TimeOfDay;
    }

    public Long getKnownMoveId() {
        return KnownMoveId;
    }

    public void setKnownMoveId(Long KnownMoveId) {
        this.KnownMoveId = KnownMoveId;
    }

    public Long getKnownMoveTypeId() {
        return KnownMoveTypeId;
    }

    public void setKnownMoveTypeId(Long KnownMoveTypeId) {
        this.KnownMoveTypeId = KnownMoveTypeId;
    }

    public Long getMinimumHappiness() {
        return MinimumHappiness;
    }

    public void setMinimumHappiness(Long MinimumHappiness) {
        this.MinimumHappiness = MinimumHappiness;
    }

    public Long getMinimumBeauty() {
        return MinimumBeauty;
    }

    public void setMinimumBeauty(Long MinimumBeauty) {
        this.MinimumBeauty = MinimumBeauty;
    }

    public Long getMinimumAffection() {
        return MinimumAffection;
    }

    public void setMinimumAffection(Long MinimumAffection) {
        this.MinimumAffection = MinimumAffection;
    }

    public Long getRelativePhysicalStats() {
        return RelativePhysicalStats;
    }

    public void setRelativePhysicalStats(Long RelativePhysicalStats) {
        this.RelativePhysicalStats = RelativePhysicalStats;
    }

    public Long getPartySpeciesId() {
        return PartySpeciesId;
    }

    public void setPartySpeciesId(Long PartySpeciesId) {
        this.PartySpeciesId = PartySpeciesId;
    }

    public Long getPartyTypeId() {
        return PartyTypeId;
    }

    public void setPartyTypeId(Long PartyTypeId) {
        this.PartyTypeId = PartyTypeId;
    }

    public Long getTradeSpeciesId() {
        return TradeSpeciesId;
    }

    public void setTradeSpeciesId(Long TradeSpeciesId) {
        this.TradeSpeciesId = TradeSpeciesId;
    }

    public boolean getNeedsOverworldRain() {
        return NeedsOverworldRain;
    }

    public void setNeedsOverworldRain(boolean NeedsOverworldRain) {
        this.NeedsOverworldRain = NeedsOverworldRain;
    }

    public boolean getTurnUpsideDown() {
        return TurnUpsideDown;
    }

    public void setTurnUpsideDown(boolean TurnUpsideDown) {
        this.TurnUpsideDown = TurnUpsideDown;
    }

    /** To-one relationship, resolved on first access. */
    public PokemonSpecies getEvolvedSpecies() {
        long __key = this.EvolvedSpeciesId;
        if (EvolvedSpecies__resolvedKey == null || !EvolvedSpecies__resolvedKey.equals(__key)) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            PokemonSpeciesDao targetDao = daoSession.getPokemonSpeciesDao();
            PokemonSpecies EvolvedSpeciesNew = targetDao.load(__key);
            synchronized (this) {
                EvolvedSpecies = EvolvedSpeciesNew;
            	EvolvedSpecies__resolvedKey = __key;
            }
        }
        return EvolvedSpecies;
    }

    public void setEvolvedSpecies(PokemonSpecies EvolvedSpecies) {
        if (EvolvedSpecies == null) {
            throw new DaoException("To-one property 'EvolvedSpeciesId' has not-null constraint; cannot set to-one to null");
        }
        synchronized (this) {
            this.EvolvedSpecies = EvolvedSpecies;
            EvolvedSpeciesId = EvolvedSpecies.getId();
            EvolvedSpecies__resolvedKey = EvolvedSpeciesId;
        }
    }

    /** To-one relationship, resolved on first access. */
    public EvolutionTriggers getEvolutionTriggers() {
        long __key = this.EvolutionTriggerId;
        if (EvolutionTriggers__resolvedKey == null || !EvolutionTriggers__resolvedKey.equals(__key)) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            EvolutionTriggersDao targetDao = daoSession.getEvolutionTriggersDao();
            EvolutionTriggers EvolutionTriggersNew = targetDao.load(__key);
            synchronized (this) {
                EvolutionTriggers = EvolutionTriggersNew;
            	EvolutionTriggers__resolvedKey = __key;
            }
        }
        return EvolutionTriggers;
    }

    public void setEvolutionTriggers(EvolutionTriggers EvolutionTriggers) {
        if (EvolutionTriggers == null) {
            throw new DaoException("To-one property 'EvolutionTriggerId' has not-null constraint; cannot set to-one to null");
        }
        synchronized (this) {
            this.EvolutionTriggers = EvolutionTriggers;
            EvolutionTriggerId = EvolutionTriggers.getId();
            EvolutionTriggers__resolvedKey = EvolutionTriggerId;
        }
    }

    /** To-one relationship, resolved on first access. */
    public Items getTriggerItem() {
        Long __key = this.TriggerItemId;
        if (TriggerItem__resolvedKey == null || !TriggerItem__resolvedKey.equals(__key)) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            ItemsDao targetDao = daoSession.getItemsDao();
            Items TriggerItemNew = targetDao.load(__key);
            synchronized (this) {
                TriggerItem = TriggerItemNew;
            	TriggerItem__resolvedKey = __key;
            }
        }
        return TriggerItem;
    }

    public void setTriggerItem(Items TriggerItem) {
        synchronized (this) {
            this.TriggerItem = TriggerItem;
            TriggerItemId = TriggerItem == null ? null : TriggerItem.getId();
            TriggerItem__resolvedKey = TriggerItemId;
        }
    }

    /** To-one relationship, resolved on first access. */
    public Genders getGenders() {
        Long __key = this.GenderId;
        if (Genders__resolvedKey == null || !Genders__resolvedKey.equals(__key)) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            GendersDao targetDao = daoSession.getGendersDao();
            Genders GendersNew = targetDao.load(__key);
            synchronized (this) {
                Genders = GendersNew;
            	Genders__resolvedKey = __key;
            }
        }
        return Genders;
    }

    public void setGenders(Genders Genders) {
        synchronized (this) {
            this.Genders = Genders;
            GenderId = Genders == null ? null : Genders.getId();
            Genders__resolvedKey = GenderId;
        }
    }

    /** To-one relationship, resolved on first access. */
    public Locations getLocations() {
        Long __key = this.LocationId;
        if (Locations__resolvedKey == null || !Locations__resolvedKey.equals(__key)) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            LocationsDao targetDao = daoSession.getLocationsDao();
            Locations LocationsNew = targetDao.load(__key);
            synchronized (this) {
                Locations = LocationsNew;
            	Locations__resolvedKey = __key;
            }
        }
        return Locations;
    }

    public void setLocations(Locations Locations) {
        synchronized (this) {
            this.Locations = Locations;
            LocationId = Locations == null ? null : Locations.getId();
            Locations__resolvedKey = LocationId;
        }
    }

    /** To-one relationship, resolved on first access. */
    public Items getHeldItem() {
        Long __key = this.HeldItemId;
        if (HeldItem__resolvedKey == null || !HeldItem__resolvedKey.equals(__key)) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            ItemsDao targetDao = daoSession.getItemsDao();
            Items HeldItemNew = targetDao.load(__key);
            synchronized (this) {
                HeldItem = HeldItemNew;
            	HeldItem__resolvedKey = __key;
            }
        }
        return HeldItem;
    }

    public void setHeldItem(Items HeldItem) {
        synchronized (this) {
            this.HeldItem = HeldItem;
            HeldItemId = HeldItem == null ? null : HeldItem.getId();
            HeldItem__resolvedKey = HeldItemId;
        }
    }

    /** To-one relationship, resolved on first access. */
    public Moves getMoves() {
        Long __key = this.KnownMoveId;
        if (Moves__resolvedKey == null || !Moves__resolvedKey.equals(__key)) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            MovesDao targetDao = daoSession.getMovesDao();
            Moves MovesNew = targetDao.load(__key);
            synchronized (this) {
                Moves = MovesNew;
            	Moves__resolvedKey = __key;
            }
        }
        return Moves;
    }

    public void setMoves(Moves Moves) {
        synchronized (this) {
            this.Moves = Moves;
            KnownMoveId = Moves == null ? null : Moves.getId();
            Moves__resolvedKey = KnownMoveId;
        }
    }

    /** To-one relationship, resolved on first access. */
    public Types getKnownMoveType() {
        Long __key = this.KnownMoveTypeId;
        if (KnownMoveType__resolvedKey == null || !KnownMoveType__resolvedKey.equals(__key)) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            TypesDao targetDao = daoSession.getTypesDao();
            Types KnownMoveTypeNew = targetDao.load(__key);
            synchronized (this) {
                KnownMoveType = KnownMoveTypeNew;
            	KnownMoveType__resolvedKey = __key;
            }
        }
        return KnownMoveType;
    }

    public void setKnownMoveType(Types KnownMoveType) {
        synchronized (this) {
            this.KnownMoveType = KnownMoveType;
            KnownMoveTypeId = KnownMoveType == null ? null : KnownMoveType.getId();
            KnownMoveType__resolvedKey = KnownMoveTypeId;
        }
    }

    /** To-one relationship, resolved on first access. */
    public PokemonSpecies getPartySpecies() {
        Long __key = this.PartySpeciesId;
        if (PartySpecies__resolvedKey == null || !PartySpecies__resolvedKey.equals(__key)) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            PokemonSpeciesDao targetDao = daoSession.getPokemonSpeciesDao();
            PokemonSpecies PartySpeciesNew = targetDao.load(__key);
            synchronized (this) {
                PartySpecies = PartySpeciesNew;
            	PartySpecies__resolvedKey = __key;
            }
        }
        return PartySpecies;
    }

    public void setPartySpecies(PokemonSpecies PartySpecies) {
        synchronized (this) {
            this.PartySpecies = PartySpecies;
            PartySpeciesId = PartySpecies == null ? null : PartySpecies.getId();
            PartySpecies__resolvedKey = PartySpeciesId;
        }
    }

    /** To-one relationship, resolved on first access. */
    public Types getPartyType() {
        Long __key = this.PartyTypeId;
        if (PartyType__resolvedKey == null || !PartyType__resolvedKey.equals(__key)) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            TypesDao targetDao = daoSession.getTypesDao();
            Types PartyTypeNew = targetDao.load(__key);
            synchronized (this) {
                PartyType = PartyTypeNew;
            	PartyType__resolvedKey = __key;
            }
        }
        return PartyType;
    }

    public void setPartyType(Types PartyType) {
        synchronized (this) {
            this.PartyType = PartyType;
            PartyTypeId = PartyType == null ? null : PartyType.getId();
            PartyType__resolvedKey = PartyTypeId;
        }
    }

    /** To-one relationship, resolved on first access. */
    public PokemonSpecies getTradeSpecies() {
        Long __key = this.TradeSpeciesId;
        if (TradeSpecies__resolvedKey == null || !TradeSpecies__resolvedKey.equals(__key)) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            PokemonSpeciesDao targetDao = daoSession.getPokemonSpeciesDao();
            PokemonSpecies TradeSpeciesNew = targetDao.load(__key);
            synchronized (this) {
                TradeSpecies = TradeSpeciesNew;
            	TradeSpecies__resolvedKey = __key;
            }
        }
        return TradeSpecies;
    }

    public void setTradeSpecies(PokemonSpecies TradeSpecies) {
        synchronized (this) {
            this.TradeSpecies = TradeSpecies;
            TradeSpeciesId = TradeSpecies == null ? null : TradeSpecies.getId();
            TradeSpecies__resolvedKey = TradeSpeciesId;
        }
    }

    /** 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);
    }

}
