/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.validation.constraints.NotNull;

/**
 *
 * @author install1
 */
@Entity
public class MapValues implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE)
    @Basic(optional = false)
    @NotNull
    private Integer id;
    @Basic(optional = false)
    @NotNull
    private int position;
    @Basic(optional = false)
    @NotNull
    private String playerSteamID;
    @Basic(optional = false)
    @NotNull
    private Float time;
    @Basic(optional = false)
    @NotNull
    private int mapPoints;
    @ManyToOne()
    @JoinTable(name = "mapboard_mapvalues")
    private MapBoard mapboards;

    public MapBoard getMapBoards() {
        return mapboards;
    }

    public void setMapBoards(MapBoard mapBoards) {
        this.mapboards = mapBoards;
    }

    public MapValues() {
    }

    public int getPosition() {
        return position;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    public String getPlayerSteamID() {
        return playerSteamID;
    }

    public void setPlayerSteamID(String steamID) {
        this.playerSteamID = steamID;
    }

    public Float getTime() {
        return time;
    }
    
    public void setTime(Float specificTime) {
        this.time = specificTime;
    }

    public int getMapPoints() {
        return mapPoints;
    }

    public void setMapPoints(int mapPoints) {
        this.mapPoints = mapPoints;
    }

    public Integer getId() {
        return id;
    }

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

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MapValues)) {
            return false;
        }
        MapValues other = (MapValues) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.MapValues[ id=" + id + " ]";
    }
    

}
