Setting default values on ComputeResourceEntity fields
*/
package org.apache.airavata.registry.core.entities.appcatalog;
-import javax.persistence.*;
+import javax.persistence.CascadeType;
+import javax.persistence.CollectionTable;
+import javax.persistence.Column;
+import javax.persistence.ElementCollection;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
import java.io.Serializable;
import java.sql.Timestamp;
+import java.time.Instant;
import java.util.List;
-import java.util.Map;
/**
* The persistent class for the compute_resource database table.
@@ -39,7 +48,7 @@ public class ComputeResourceEntity implements Serializable {
private String computeResourceId;
@Column(name = "CREATION_TIME")
- private Timestamp creationTime;
+ private Timestamp creationTime = Timestamp.from(Instant.now());
@Column(name = "ENABLED")
private short enabled;
@@ -63,19 +72,19 @@ public class ComputeResourceEntity implements Serializable {
private String resourceDescription;
@Column(name = "UPDATE_TIME")
- private Timestamp updateTime;
+ private Timestamp updateTime = Timestamp.from(Instant.now());
@Column(name = "CPUS_PER_NODE")
- private Integer cpusPerNode;
+ private Integer cpusPerNode = 0;
@Column(name = "DEFAULT_NODE_COUNT")
- private Integer defaultNodeCount;
+ private Integer defaultNodeCount = 0;
@Column(name = "DEFAULT_CPU_COUNT")
- private Integer defaultCPUCount;
+ private Integer defaultCPUCount = 0;
@Column(name = "DEFAULT_WALLTIME")
- private Integer defaultWalltime;
+ private Integer defaultWalltime = 0;
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name="HOST_ALIAS", joinColumns = @JoinColumn(name="RESOURCE_ID"))
