package org.zstack.header.host; import org.zstack.header.cluster.ClusterEO; import org.zstack.header.vo.ForeignKey; import org.zstack.header.vo.ForeignKey.ReferenceOption; import org.zstack.header.vo.Index; import org.zstack.header.vo.ResourceVO; import org.zstack.header.zone.ZoneEO; import javax.persistence.*; import java.sql.Timestamp; /** */ @MappedSuperclass public class HostAO extends ResourceVO { @Column @ForeignKey(parentEntityClass = ZoneEO.class, onDeleteAction = ReferenceOption.RESTRICT) private String zoneUuid; @Column private String name; @Column @ForeignKey(parentEntityClass = ClusterEO.class, onDeleteAction = ReferenceOption.RESTRICT) private String clusterUuid; @Column private String description; @Column private String managementIp; @Column private String hypervisorType; @Column @Enumerated(EnumType.STRING) private HostState state; @Column @Enumerated(EnumType.STRING) private HostStatus status; @Column private Timestamp createDate; @Column private Timestamp lastOpDate; @PreUpdate private void preUpdate() { lastOpDate = null; } public HostAO() { } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getZoneUuid() { return zoneUuid; } public void setZoneUuid(String zoneUuid) { this.zoneUuid = zoneUuid; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getManagementIp() { return managementIp; } public void setManagementIp(String managementIp) { this.managementIp = managementIp; } public String getHypervisorType() { return hypervisorType; } public void setHypervisorType(String hypervisorType) { this.hypervisorType = hypervisorType; } public HostState getState() { return state; } public void setState(HostState state) { this.state = state; } public HostStatus getStatus() { return status; } public void setStatus(HostStatus connectionState) { this.status = connectionState; } public Timestamp getCreateDate() { return createDate; } public void setCreateDate(Timestamp createDate) { this.createDate = createDate; } public Timestamp getLastOpDate() { return lastOpDate; } public void setLastOpDate(Timestamp lastOpDate) { this.lastOpDate = lastOpDate; } public String getClusterUuid() { return clusterUuid; } public void setClusterUuid(String clusterUuid) { this.clusterUuid = clusterUuid; } }