package org.carlson.hockeystats.domain;

import org.hibernate.annotations.Type;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import java.util.UUID;

/**
 * Created by ryancarlson on 5/4/15.
 */
@Entity
@Table(name="players")
public class Player
{

	@Id
	@Type(type="pg_uuid")
	UUID id;

	String name;

	String number;

	@ManyToOne(fetch= FetchType.LAZY)
	@JoinColumn(name="team_id")
	Team team;

	public UUID getId()
	{
		return id;
	}

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

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getNumber()
	{
		return number;
	}

	public void setNumber(String number)
	{
		this.number = number;
	}
}

@@ -471,16 +471,35 @@
 umber;%0A%0A
+%09String position;%0A%0A
 %09@ManyTo
@@ -885,11 +885,247 @@
 mber;%0A%09%7D
+%0A%0A%09public String getPosition()%0A%09%7B%0A%09%09return position;%0A%09%7D%0A%0A%09public void setPosition(String position)%0A%09%7B%0A%09%09this.position = position;%0A%09%7D%0A%0A%09public Team getTeam()%0A%09%7B%0A%09%09return team;%0A%09%7D%0A%0A%09public void setTeam(Team team)%0A%09%7B%0A%09%09this.team = team;%0A%09%7D
 %0A%7D%0A

add position field to player object