package com.fit.klinika.client.doVr;

import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import net.sf.gilead.annotations.ReadOnly;

import org.hibernate.annotations.Cascade;

import com.fit.klinika.client.radnik.Radnik;
import com.google.gwt.user.client.rpc.GwtTransient;

@Entity
@Table(name = "vrsta_radnika")
public class VrstaRadnika implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue
	@Column(name = "idvr")
	private int idvr;
	@Column(nullable = false , name="naziv")
	private String naziv;
	@OneToMany(targetEntity = Radnik.class ,mappedBy ="vrstaRadnika")
	@Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE})
	@GwtTransient
	@ReadOnly
	private List<Radnik> radnici = new LinkedList<Radnik>();
	
	
	
	
	public int getIdvr() {
		return idvr;
	}
	public void setIdvr(int idvr) {
		this.idvr = idvr;
	}
	public String getNaziv() {
		return naziv;
	}
	public void setNaziv(String naziv) {
		this.naziv = naziv;
	}
	public List<Radnik> getRadnici() {
		return radnici;
	}
	public void setRadnici(List<Radnik> radnici) {
		this.radnici = radnici;
	}
	
	
	
}
