package it.enea.cruise.model.user;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MapsId;
import javax.persistence.Table;

import org.springframework.stereotype.Component;

import com.fasterxml.jackson.annotation.JsonInclude;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

@Entity (name="device")
@Table (name= "devices")
@JsonInclude(JsonInclude.Include.NON_NULL)
@Getter
@Setter
@NoArgsConstructor
@ToString
@Component
public class Device implements Serializable {
		
	@Id
	private String deviceid;
	
	private int supplierid;
		
	@ManyToOne
	@JoinColumn(name="userid", nullable=false)
	@MapsId("userid")
	private User user;
	
	private Integer userid;
	
	private Integer identificationmethod;
	
	private String altdeviceid;
	
	private String devicename;
	
	private String description;
	
	private String note;
	
	private String devicetype;
	
	private Integer devicestatus;
	
	private Integer usetype;
	
	private String georeferenceformat;
	
	private Double georeferencex;
	
	private Double georeferencey;
	
	private Double georeferencez;
	
	private String activationdate;
	
	private Date deactivationdate;

}
