/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package hibernate;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author Ani
 */
@Entity
@Table(name= "userstatistic")
public class Userstatistic implements Serializable{
    @OneToOne
    @JoinColumn(name="username")
    private Userdata userdata;
    @Id
    @Column(name="username", nullable=false, length=50)
    private String username;
    @Column(name="allgame", nullable=false)
    private Integer allGame;
    @Column(name="winned", nullable=false)
    private Integer winned;
    @Column(name="lost", nullable=false)
    private Integer lost;
    @Column(name="gamerestarted", nullable=false)
    private Integer gamerestarted;


    public Userstatistic(Userdata user, Integer allGame, Integer winned, Integer lost, Integer gamerestarted) {
        this.userdata = user;
        this.username = user.getUsername();
        this.allGame = allGame;
        this.winned = winned;
        this.lost = lost;
        this.gamerestarted = gamerestarted;
    }

    public Userstatistic() {
    }

    public Integer getAllGame() {
        return allGame;
    }

    public Integer getGamerestarted() {
        return gamerestarted;
    }

    public String getUsername() {
        return username;
    }

    public Integer getWinned() {
        return winned;
    }

    public void setAllGame(Integer allGame) {
        this.allGame = allGame;
    }

    public void setGamerestarted(Integer gamerestarted) {
        this.gamerestarted = gamerestarted;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setWinned(Integer winned) {
        this.winned = winned;
    }

    public Userdata getUserdata() {
        return userdata;
    }

    public void setUserdata(Userdata userdata) {
        this.userdata = userdata;
    }

    public Integer getLost() {
        return lost;
    }

    public void setLost(Integer lost) {
        this.lost = lost;
    }

    



}
