102 lines
2.1 KiB
Java
102 lines
2.1 KiB
Java
package com.eactive.testmaster.socket.entity;
|
|
|
|
import java.time.LocalDateTime;
|
|
import javax.persistence.Column;
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.GeneratedValue;
|
|
import javax.persistence.GenerationType;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.Lob;
|
|
import javax.persistence.PreUpdate;
|
|
import javax.persistence.Table;
|
|
import org.hibernate.annotations.Type;
|
|
|
|
@Entity
|
|
@Table(name = "netty_servers")
|
|
public class NettyServerEntity {
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private Long id;
|
|
|
|
private String name;
|
|
|
|
@Column(unique = true, nullable = false)
|
|
private Integer port;
|
|
|
|
@Column(nullable = false)
|
|
private Boolean active = true;
|
|
|
|
@Lob
|
|
private String script;
|
|
|
|
@Type(type = "org.hibernate.type.LocalDateTimeType")
|
|
private LocalDateTime createdAt = LocalDateTime.now();
|
|
|
|
|
|
@Type(type = "org.hibernate.type.LocalDateTimeType")
|
|
private LocalDateTime lastModified = LocalDateTime.now();
|
|
|
|
// Standard getters and setters
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(Long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public Integer getPort() {
|
|
return port;
|
|
}
|
|
|
|
public void setPort(Integer port) {
|
|
this.port = port;
|
|
}
|
|
|
|
public Boolean getActive() {
|
|
return active;
|
|
}
|
|
|
|
public void setActive(Boolean active) {
|
|
this.active = active;
|
|
}
|
|
|
|
public LocalDateTime getCreatedAt() {
|
|
return createdAt;
|
|
}
|
|
|
|
public void setCreatedAt(LocalDateTime createdAt) {
|
|
this.createdAt = createdAt;
|
|
}
|
|
|
|
public LocalDateTime getLastModified() {
|
|
return lastModified;
|
|
}
|
|
|
|
public void setLastModified(LocalDateTime lastModified) {
|
|
this.lastModified = lastModified;
|
|
}
|
|
|
|
@PreUpdate
|
|
protected void onUpdate() {
|
|
lastModified = LocalDateTime.now();
|
|
}
|
|
|
|
public String getScript() {
|
|
return script;
|
|
}
|
|
|
|
public void setScript(String script) {
|
|
this.script = script;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
}
|