/*
 * 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 java.util.ArrayList;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author install1
 */
@Entity
@Table(name = "mapboard")
public class MapBoard implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    private String mapName;

    public MapBoard() {
    }

    @OneToMany(cascade = CascadeType.PERSIST)
    private List<MapValues> mapvalues = new ArrayList();

    public List<MapValues> getMapvalues() {
        return mapvalues;
    }

    public void setMapName(String mapName) {
        this.mapName = mapName;
    }
    
    public void addMapvalues(MapValues mapvalue){
        this.mapvalues.add(mapvalue);
    }

    public void setMapvalues(List<MapValues> mapvalues) {
        this.mapvalues = mapvalues;
    }

    public MapBoard(String mapName) {
        this.mapName = mapName;
    }

    public String getMapName() {
        return mapName;
    }

}
