package com.ibtp.kontor.tradingcards.entity;

import javax.persistence.*;

@NamedQueries({
		@NamedQuery(name="Position.findAll", query="SELECT m from PositionEntity as m"),
		@NamedQuery(name="Position.findByName", query="SELECT m from PositionEntity as m WHERE m.name = :name")
})

@Entity
@Table(name="POSITION")
public class PositionEntity {
	
	private Long id;
	private String name;
	private String shortName;
	private SportEntity sport;

	public PositionEntity() {}

	public PositionEntity(String name) { setName(name); }

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public Long getId() { return id; }
	
	@SuppressWarnings("unused")
	private void setId(Long id) { this.id = id; }

	@Column
	public String getName() {
		return name;
	}

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

	@Column
	public String getShortName() {
		return shortName;
	}

	public void setShortName(String shortName) {
		this.shortName = shortName;
	}

	@ManyToOne
	public SportEntity getSport() {
		return sport;
	}

	public void setSport(SportEntity sport) {
		this.sport = sport;
	}
}
