package com.crunii.micro.ds.uid.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;

@Entity
@Table(name = "t_worker_node")
@NamedQuery(name = "TWorkerNode.findAll", query="SELECT t FROM TWorkerNode t")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of= {"id"})
@ApiModel(description = "db workerid assigner for com.crunii.micro.ds.uid generator")
public class TWorkerNode  implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "id")
	@ApiModelProperty(value = "auto increment id")
	private long id;

	@Column(name = "host_name")
	@ApiModelProperty(value = "host name")
	private String hostName;

	@Column(name = "port")
	@ApiModelProperty(value = "port")
	private String port;

	@Column(name = "node_type")
	@ApiModelProperty(value = "node type: actual or container")
	private int nodeType;

	@Column(name = "launch_date")
	@ApiModelProperty(value = "launch date")
	private java.util.Date launchDate;

	@Column(name = "modify_time")
	@ApiModelProperty(value = "modified time")
	private java.util.Date modifyTime;

	@Column(name = "create_time")
	@ApiModelProperty(value = "created time")
	private java.util.Date createTime;

}
