package com.peetz.kontor.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@NamedQueries({
	@NamedQuery(name="findAll", query="SELECT u from KontorUser as u"),
	@NamedQuery(name="findById", query="SELECT u from KontorUser as u WHERE u.id = :id"),
	@NamedQuery(name="findByLogin", query="SELECT u from KontorUser as u WHERE u.login = :login")
})

@Entity
@Table(name="KONTORUSER")
public class KontorUserEntity {
	private Long id;
	
	private String login;
	
	private String password;
	
	private String name;

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

	@Column
	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	@Column
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

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

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