From 9ff5fafa99d0bc56fba0ea06ff59308022e0955c Mon Sep 17 00:00:00 2001 From: Gokul Prathin A Date: Sat, 23 Mar 2024 23:33:59 -0400 Subject: [PATCH 1/3] * cleanup Checkpoint.java --- pom.xml | 7 +++ src/main/java/com/gw/jpa/Checkpoint.java | 60 ++++-------------------- 2 files changed, 16 insertions(+), 51 deletions(-) diff --git a/pom.xml b/pom.xml index 1a8fda392..dd2cc51d3 100644 --- a/pom.xml +++ b/pom.xml @@ -78,6 +78,13 @@ spring-boot-starter-web + + + org.projectlombok + lombok + provided + + org.thymeleaf.extras thymeleaf-extras-springsecurity5 diff --git a/src/main/java/com/gw/jpa/Checkpoint.java b/src/main/java/com/gw/jpa/Checkpoint.java index 26956f710..ffb4586ed 100644 --- a/src/main/java/com/gw/jpa/Checkpoint.java +++ b/src/main/java/com/gw/jpa/Checkpoint.java @@ -12,6 +12,10 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; + +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Type; @@ -20,16 +24,19 @@ @Entity @Table(name = "WorkflowCheckpoint") +@Getter +@Setter +@NoArgsConstructor // Lombok annotations public class Checkpoint { @Id @GeneratedValue(generator = "uuid2") - @GenericGenerator(name="uuid2", strategy = "uuid2") + @GenericGenerator(name = "uuid2", strategy = "uuid2") @Type(type = "uuid-char") @Column(name = "id", columnDefinition = "VARCHAR(36)") private UUID id; - @Column(name="executionId") + @Column(name = "executionId") private String executionId; @Lob @@ -48,58 +55,9 @@ public class Checkpoint { @Temporal(TemporalType.TIMESTAMP) private Date createdAt; - - public String getExecutionId() { - return executionId; - } - - public void setExecutionId(String executionId) { - this.executionId = executionId; - } - - public Date getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(Date createdAt) { - this.createdAt = createdAt; - } - @PrePersist protected void onCreate() { createdAt = new Date(); } - public UUID getId() { - return id; - } - - public void setId(UUID id) { - this.id = id; - } - - public String getEdges() { - return edges; - } - - public void setEdges(String edges) { - this.edges = edges; - } - - public String getNodes() { - return nodes; - } - - public void setNodes(String nodes) { - this.nodes = nodes; - } - - public Workflow getWorkflow() { - return workflow; - } - - public void setWorkflow(Workflow workflow) { - this.workflow = workflow; - } - } From 5d2cc02b96020ab05af95e221267f38a1f37ee66 Mon Sep 17 00:00:00 2001 From: Gokul Prathin A Date: Sun, 24 Mar 2024 00:03:06 -0400 Subject: [PATCH 2/3] * cleanup lombok --- src/main/java/com/gw/jpa/Environment.java | 86 ++------------- src/main/java/com/gw/jpa/GWProcess.java | 88 ++++------------ src/main/java/com/gw/jpa/GWUser.java | 110 ++++---------------- src/main/java/com/gw/jpa/History.java | 121 ++++------------------ src/main/java/com/gw/jpa/Host.java | 115 ++++---------------- src/main/java/com/gw/jpa/LogActivity.java | 73 ++----------- src/main/java/com/gw/jpa/Workflow.java | 73 ++----------- 7 files changed, 108 insertions(+), 558 deletions(-) diff --git a/src/main/java/com/gw/jpa/Environment.java b/src/main/java/com/gw/jpa/Environment.java index 528f032ab..df5a020df 100644 --- a/src/main/java/com/gw/jpa/Environment.java +++ b/src/main/java/com/gw/jpa/Environment.java @@ -8,89 +8,25 @@ import javax.persistence.ManyToOne; import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; @Entity +@Getter +@Setter +@NoArgsConstructor public class Environment { @Id - String id; - - String name, type, bin, pyenv, basedir; + private String id; - // String host; + private String name, type, bin, pyenv, basedir; @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "hostid") + @JoinColumn(name = "hostid") @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) - private Host hostobj; + private Host hostobj; @Column(columnDefinition = "LONGTEXT") - String settings; - - - public Host getHostobj() { - return this.hostobj; - } - - public void setHostobj(Host hostobj) { - this.hostobj = hostobj; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getBin() { - return bin; - } - - public void setBin(String bin) { - this.bin = bin; - } - - public String getPyenv() { - return pyenv; - } - - public void setPyenv(String pyenv) { - this.pyenv = pyenv; - } - - public String getBasedir() { - return basedir; - } - - public void setBasedir(String basedir) { - this.basedir = basedir; - } - - public String getSettings() { - return settings; - } - - public void setSettings(String settings) { - this.settings = settings; - } - - - + private String settings; } diff --git a/src/main/java/com/gw/jpa/GWProcess.java b/src/main/java/com/gw/jpa/GWProcess.java index 7cd0054c4..55ef437c2 100644 --- a/src/main/java/com/gw/jpa/GWProcess.java +++ b/src/main/java/com/gw/jpa/GWProcess.java @@ -1,10 +1,12 @@ package com.gw.jpa; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + import javax.persistence.Column; import javax.persistence.Lob; import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; import javax.persistence.Id; /** @@ -13,83 +15,29 @@ * */ @Entity +@Getter +@Setter +@NoArgsConstructor public class GWProcess { @Id - String id; - - String name; - + private String id; + + private String name; + @Lob @Column(columnDefinition = "LONGTEXT") - String description; + private String description; @Lob @Column(columnDefinition = "LONGTEXT") - String code; - - String lang; - - String owner; - - //true: private; false: public - String confidential; - - - public String getOwner() { - return this.owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - public String getConfidential() { - return this.confidential; - } - - public void setConfidential(String confidential) { - this.confidential = confidential; - } - - public String getLang() { - return this.lang; - } + private String code; - public void setLang(String lang) { - this.lang = lang; - } + private String lang; + private String owner; - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - + //true: private; false: public + private String confidential; } + diff --git a/src/main/java/com/gw/jpa/GWUser.java b/src/main/java/com/gw/jpa/GWUser.java index 37492d098..7252d3a07 100644 --- a/src/main/java/com/gw/jpa/GWUser.java +++ b/src/main/java/com/gw/jpa/GWUser.java @@ -9,115 +9,47 @@ import javax.persistence.GenerationType; import javax.persistence.Id; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.RequiredArgsConstructor; +import lombok.Setter; import org.springframework.lang.NonNull; @Entity +@Getter +@Setter +@NoArgsConstructor +@RequiredArgsConstructor public class GWUser { @Id - String id; + private String id; @Column @NonNull - String username; - + private String username; + @Column @NonNull - String password; - + private String password; + @Column - String role; - + private String role; + @Column @NonNull - String email; + private String email; @Column - Boolean isactive; + private Boolean isactive; @Column - Date registration_date; - - @Column - Date last_login_date; + private Date registration_date; @Column - Boolean loggedIn; - - public String getId() { - return this.id; - } - - public void setId(String id) { - this.id = id; - } - - public String getUsername() { - return this.username; - } - - public void setUsername(String username) { - this.username = username; - } - - - public String getPassword() { - return this.password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getRole() { - return this.role; - } - - public void setRole(String role) { - this.role = role; - } - - public String getEmail() { - return this.email; - } - - public void setEmail(String email) { - this.email = email; - } - - public Boolean getIsactive() { - return this.isactive; - } - - public void setIsactive(Boolean isactive) { - this.isactive = isactive; - } - - public Date getRegistration_date() { - return this.registration_date; - } - - public void setRegistration_date(Date registration_date) { - this.registration_date = registration_date; - } - - public Date getLast_login_date() { - return this.last_login_date; - } - - public void setLast_login_date(Date last_login_date) { - this.last_login_date = last_login_date; - } - - public Boolean getLoggedIn() { - return this.loggedIn; - } - - public void setLoggedIn(Boolean loggedIn) { - this.loggedIn = loggedIn; - } - + private Date last_login_date; + @Column + private Boolean loggedIn; - } diff --git a/src/main/java/com/gw/jpa/History.java b/src/main/java/com/gw/jpa/History.java index 2e0d677cf..4e83d876c 100644 --- a/src/main/java/com/gw/jpa/History.java +++ b/src/main/java/com/gw/jpa/History.java @@ -1,6 +1,8 @@ package com.gw.jpa; +import lombok.Data; + import java.util.Date; import javax.persistence.Lob; @@ -11,116 +13,33 @@ import javax.persistence.TemporalType; @Entity +@Data public class History { - - /**********************************************/ - /** section of the geoweaver history records **/ - /**********************************************/ - + @Id -// @GeneratedValue(strategy=GenerationType.AUTO) - private String history_id; - + private String history_id; + @Lob @Column(columnDefinition = "LONGTEXT") - private String history_input; - - //maximum jupyter notebook 100mb - @Lob - @Column(columnDefinition = "LONGTEXT") - private String history_output; - - @Temporal(TemporalType.TIMESTAMP) - private Date history_begin_time; - - @Temporal(TemporalType.TIMESTAMP) - private Date history_end_time; - - @Column(columnDefinition = "TEXT") - private String history_notes; - - - private String history_process; - - private String host_id; - - private String indicator; - - /**********************************************/ - /** end of history section **/ - /**********************************************/ - - - public String getHistory_notes() { - return this.history_notes; - } - - public void setHistory_notes(String history_notes) { - this.history_notes = history_notes; - } - - - public String getIndicator() { - return indicator; - } - - public String getHost_id() { - return host_id; - } + private String history_input; - public void setHost_id(String host_id) { - this.host_id = host_id; - } - - public void setIndicator(String indicator) { - this.indicator = indicator; - } - - public String getHistory_input() { - return history_input; - } - - public void setHistory_input(String history_input) { - this.history_input = history_input; - } - - public String getHistory_output() { - return history_output; - } - - public void setHistory_output(String history_output) { - this.history_output = history_output; - } - - public Date getHistory_begin_time() { - return history_begin_time; - } - - public void setHistory_begin_time(Date history_begin_time) { - this.history_begin_time = history_begin_time; - } + @Lob + @Column(columnDefinition = "LONGTEXT") + private String history_output; - public Date getHistory_end_time() { - return history_end_time; - } + @Temporal(TemporalType.TIMESTAMP) + private Date history_begin_time; - public void setHistory_end_time(Date history_end_time) { - this.history_end_time = history_end_time; - } + @Temporal(TemporalType.TIMESTAMP) + private Date history_end_time; - public String getHistory_process() { - return history_process; - } + @Column(columnDefinition = "TEXT") + private String history_notes; - public void setHistory_process(String history_process) { - this.history_process = history_process; - } + private String history_process; - public String getHistory_id() { - return history_id; - } + private String host_id; - public void setHistory_id(String history_id) { - this.history_id = history_id; - } + private String indicator; } + diff --git a/src/main/java/com/gw/jpa/Host.java b/src/main/java/com/gw/jpa/Host.java index 4ccea9c0f..c0b5a756f 100644 --- a/src/main/java/com/gw/jpa/Host.java +++ b/src/main/java/com/gw/jpa/Host.java @@ -1,5 +1,9 @@ package com.gw.jpa; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + import java.util.Set; import javax.persistence.CascadeType; @@ -9,102 +13,23 @@ import javax.persistence.OneToMany; @Entity +@Getter +@Setter +@NoArgsConstructor public class Host { @Id - String id; - - String name, ip, port, username, owner, type, url; - - String confidential; - - @OneToMany(cascade = CascadeType.ALL, - fetch = FetchType.LAZY, - mappedBy="hostobj") - private Set envs; - - public Set getEnvs() { - return this.envs; - } - - public void setEnvs(Set envs) { - this.envs = envs; - } - - public String getConfidential() { - return this.confidential; - } - - public void setConfidential(String confidential) { - this.confidential = confidential; - } - - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getIp() { - return ip; - } - - public void setIp(String ip) { - this.ip = ip; - } - - public String getPort() { - return port; - } - - public void setPort(String port) { - this.port = port; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - - + private String id; + + private String name; + private String ip; + private String port; + private String username; + private String owner; + private String type; + private String url; + private String confidential; + + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "hostobj") + private Set envs; } diff --git a/src/main/java/com/gw/jpa/LogActivity.java b/src/main/java/com/gw/jpa/LogActivity.java index aca75ac1a..bbf5ed82f 100644 --- a/src/main/java/com/gw/jpa/LogActivity.java +++ b/src/main/java/com/gw/jpa/LogActivity.java @@ -1,72 +1,19 @@ package com.gw.jpa; +import lombok.Data; + import javax.persistence.Entity; import javax.persistence.Id; @Entity +@Data public class LogActivity { - - @Id - String id; - - String operator; - - String category; - - String objectid; - - String objname; - - String operation; - - public String getObjname() { - return this.objname; - } - - public void setObjname(String objname) { - this.objname = objname; - } - - public String getId() { - return this.id; - } - - public void setId(String id) { - this.id = id; - } - - public String getOperator() { - return this.operator; - } - - public void setOperator(String operator) { - this.operator = operator; - } - - public String getCategory() { - return this.category; - } - - public void setCategory(String category) { - this.category = category; - } - - public String getObjectid() { - return this.objectid; - } - - public void setObjectid(String objectid) { - this.objectid = objectid; - } - - public String getOperation() { - return this.operation; - } - - public void setOperation(String operation) { - this.operation = operation; - } - - + @Id + private String id; + private String operator; + private String category; + private String objectid; + private String objname; + private String operation; } diff --git a/src/main/java/com/gw/jpa/Workflow.java b/src/main/java/com/gw/jpa/Workflow.java index a4e590824..16e5b467c 100644 --- a/src/main/java/com/gw/jpa/Workflow.java +++ b/src/main/java/com/gw/jpa/Workflow.java @@ -1,20 +1,24 @@ package com.gw.jpa; +import lombok.Data; + import javax.persistence.Lob; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @Entity +@Data public class Workflow { - + @Id private String id; - - private String name, description, owner; + private String name; + private String description; + private String owner; private String confidential; - + @Lob @Column(columnDefinition = "LONGTEXT") private String edges; @@ -22,65 +26,4 @@ public class Workflow { @Lob @Column(columnDefinition = "LONGTEXT") private String nodes; - - - public String getConfidential() { - return this.confidential; - } - - public void setConfidential(String confidential) { - this.confidential = confidential; - } - - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getNodes() { - return nodes; - } - - public void setNodes(String nodes) { - this.nodes = nodes; - } - - public String getEdges() { - return edges; - } - - public void setEdges(String edges) { - this.edges = edges; - } - - - } From c6b93c9c1f29036a1a96f9c95275553913632cd1 Mon Sep 17 00:00:00 2001 From: Gokul Prathin A Date: Sun, 24 Mar 2024 02:10:25 -0400 Subject: [PATCH 3/3] merged master + resolved merge conflicts --- src/main/java/com/gw/jpa/GWProcess.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/gw/jpa/GWProcess.java b/src/main/java/com/gw/jpa/GWProcess.java index 9a01d01c3..55ef437c2 100644 --- a/src/main/java/com/gw/jpa/GWProcess.java +++ b/src/main/java/com/gw/jpa/GWProcess.java @@ -1,5 +1,9 @@ package com.gw.jpa; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + import javax.persistence.Column; import javax.persistence.Lob; import javax.persistence.Entity;