This is an automated email from the ASF dual-hosted git repository.
lahirujayathilake pushed a commit to branch cybershuttle-staging
in repository https://gitbox.apache.org/repos/asf/airavata.git
The following commit(s) were added to refs/heads/cybershuttle-staging by this
push:
new 40f48c9906 session entity impl and entity modifications
40f48c9906 is described below
commit 40f48c990663ebe663083c7208b0ecb2bb99e31a
Author: lahiruj <[email protected]>
AuthorDate: Mon Mar 31 02:38:32 2025 -0400
session entity impl and entity modifications
---
.../service/model/entity/DatasetResource.java | 24 ++++-
.../service/model/entity/ModelResource.java | 21 ++++
.../service/model/entity/NotebookResource.java | 24 ++++-
.../research/service/model/entity/Project.java | 47 ++++++++-
.../service/model/entity/RepositoryResource.java | 26 ++++-
.../research/service/model/entity/Resource.java | 52 +++++++--
.../research/service/model/entity/Session.java | 116 +++++++++++++++++++++
.../research/service/model/entity/Tag.java | 35 +++++--
.../research/service/model/entity/User.java | 37 +++++--
.../resources/distribution/conf/application.yml | 19 +++-
10 files changed, 362 insertions(+), 39 deletions(-)
diff --git
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/DatasetResource.java
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/DatasetResource.java
index 050b286177..1d98ce808e 100644
---
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/DatasetResource.java
+++
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/DatasetResource.java
@@ -1,9 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.airavata.research.service.model.entity;
-import jakarta.persistence.Entity;
+
import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
@Entity
+@Table(name = "DATASET_RESOURCE")
public class DatasetResource extends Resource {
+
@Column(nullable = false)
private String datasetUrl;
diff --git
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/ModelResource.java
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/ModelResource.java
index 621b263400..15737795c7 100644
---
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/ModelResource.java
+++
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/ModelResource.java
@@ -1,10 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.airavata.research.service.model.entity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
@Entity
+@Table(name = "MODEL_RESOURCE")
public class ModelResource extends Resource {
+
@Column(nullable = false)
private String applicationInterfaceId;
diff --git
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/NotebookResource.java
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/NotebookResource.java
index f3db0a3382..5962b7c7de 100644
---
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/NotebookResource.java
+++
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/NotebookResource.java
@@ -1,9 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.airavata.research.service.model.entity;
-import jakarta.persistence.Entity;
+
import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
@Entity
+@Table(name = "NOTEBOOK_RESOURCE")
public class NotebookResource extends Resource {
+
@Column(nullable = false)
private String notebookPath;
diff --git
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/Project.java
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/Project.java
index 72a4d6b56a..a486fe03c1 100644
---
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/Project.java
+++
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/Project.java
@@ -18,21 +18,42 @@
*/
package org.apache.airavata.research.service.model.entity;
+import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
-import org.hibernate.annotations.GenericGenerator;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.ManyToMany;
+import jakarta.persistence.ManyToOne;
+import org.hibernate.annotations.UuidGenerator;
-@Entity(name = "RF_PROJECT")
+import java.util.HashSet;
+import java.util.Set;
+
+@Entity(name = "PROJECT")
public class Project {
@Id
- @GeneratedValue(generator = "uuid")
- @GenericGenerator(name = "uuid", strategy = "uuid2")
- @Column(name = "RF_PROJECT_ID")
+ @GeneratedValue
+ @UuidGenerator
+ @Column(nullable = false, updatable = false, length = 48)
private String id;
+ @ManyToOne(fetch = FetchType.EAGER, optional = false)
+ @JoinColumn(name = "repository_resource_id")
+ private RepositoryResource repositoryResource;
+
+ @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+ @JoinTable(
+ name = "project_dataset",
+ joinColumns = @JoinColumn(name = "project_id"),
+ inverseJoinColumns = @JoinColumn(name = "dataset_resource_id")
+ )
+ private Set<DatasetResource> datasetResources = new HashSet<>();
+
public String getId() {
return id;
}
@@ -40,4 +61,20 @@ public class Project {
public void setId(String id) {
this.id = id;
}
+
+ public RepositoryResource getRepositoryResource() {
+ return repositoryResource;
+ }
+
+ public void setRepositoryResource(RepositoryResource repositoryResource) {
+ this.repositoryResource = repositoryResource;
+ }
+
+ public Set<DatasetResource> getDatasetResources() {
+ return datasetResources;
+ }
+
+ public void setDatasetResources(Set<DatasetResource> datasetResources) {
+ this.datasetResources = datasetResources;
+ }
}
diff --git
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/RepositoryResource.java
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/RepositoryResource.java
index a40fd35e5c..bad9da20be 100644
---
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/RepositoryResource.java
+++
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/RepositoryResource.java
@@ -1,9 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.airavata.research.service.model.entity;
-import jakarta.persistence.Entity;
+
import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Table;
@Entity
-public class RepositoryResource extends Resource {
+@Table(name = "REPOSITORY_RESOURCE")
+public class RepositoryResource extends Resource {
+
@Column(nullable = false)
private String repositoryUrl;
diff --git
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/Resource.java
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/Resource.java
index d28d256403..2019605857 100644
---
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/Resource.java
+++
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/Resource.java
@@ -1,20 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.airavata.research.service.model.entity;
-import jakarta.persistence.*;
+
+import jakarta.persistence.CascadeType;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.Id;
+import jakarta.persistence.Inheritance;
+import jakarta.persistence.InheritanceType;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.JoinTable;
+import jakarta.persistence.ManyToMany;
+import jakarta.persistence.Table;
+import org.apache.airavata.research.service.enums.PrivacyEnum;
+import org.apache.airavata.research.service.enums.StatusEnum;
+import org.hibernate.annotations.UuidGenerator;
import java.util.HashSet;
import java.util.Set;
-import org.apache.airavata.research.service.enums.StatusEnum;
-import org.apache.airavata.research.service.enums.PrivacyEnum;
-import org.hibernate.annotations.GenericGenerator;
-
@Entity
+@Table(name = "RESOURCE")
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class Resource {
+
@Id
- @GeneratedValue(generator = "UUID")
- @GenericGenerator(name = "UUID", strategy =
"org.hibernate.id.UUIDGenerator")
- @Column(nullable = false, updatable = false)
+ @GeneratedValue
+ @UuidGenerator
+ @Column(nullable = false, updatable = false, length = 48)
private String id;
@Column(nullable = false)
@@ -40,7 +73,7 @@ public abstract class Resource {
joinColumns = @JoinColumn(name = "resource_id"),
inverseJoinColumns = @JoinColumn(name = "tag_id")
)
- private Set<Tag> tags = new HashSet<>();;
+ private Set<Tag> tags = new HashSet<>();
@Column(nullable = false)
@Enumerated(EnumType.STRING)
@@ -57,6 +90,7 @@ public abstract class Resource {
public void setHeaderImage(String headerImage) {
this.headerImage = headerImage;
}
+
public String getId() {
return id;
}
diff --git
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/Session.java
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/Session.java
new file mode 100644
index 0000000000..e5c8a86c3a
--- /dev/null
+++
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/Session.java
@@ -0,0 +1,116 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.airavata.research.service.model.entity;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.FetchType;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.Id;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Temporal;
+import jakarta.persistence.TemporalType;
+import org.hibernate.annotations.UuidGenerator;
+import org.springframework.data.annotation.CreatedDate;
+import org.springframework.data.annotation.LastModifiedDate;
+
+import java.util.Date;
+
+@Entity
+@Table(name = "SESSION")
+public class Session {
+
+ @Id
+ @GeneratedValue
+ @UuidGenerator
+ @Column(nullable = false, updatable = false, length = 48)
+ private String id;
+
+ @Column(nullable = false, unique = true)
+ private String sessionName;
+
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ @JoinColumn(name = "user_id")
+ private User user;
+
+ @ManyToOne(fetch = FetchType.LAZY, optional = false)
+ @JoinColumn(name = "project_id")
+ private Project project;
+
+ @Column(nullable = false)
+ @Temporal(TemporalType.TIMESTAMP)
+ @CreatedDate
+ private Date createdAt;
+
+ @Column(nullable = false)
+ @Temporal(TemporalType.TIMESTAMP)
+ @LastModifiedDate
+ private Date updatedAt;
+
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getSessionName() {
+ return sessionName;
+ }
+
+ public void setSessionName(String sessionName) {
+ this.sessionName = sessionName;
+ }
+
+ public User getUser() {
+ return user;
+ }
+
+ public void setUser(User user) {
+ this.user = user;
+ }
+
+ public Project getProject() {
+ return project;
+ }
+
+ public void setProject(Project project) {
+ this.project = project;
+ }
+
+ public java.util.Date getCreatedAt() {
+ return createdAt;
+ }
+
+ public void setCreatedAt(java.util.Date createdAt) {
+ this.createdAt = createdAt;
+ }
+
+ public java.util.Date getUpdatedAt() {
+ return updatedAt;
+ }
+
+ public void setUpdatedAt(java.util.Date updatedAt) {
+ this.updatedAt = updatedAt;
+ }
+}
diff --git
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/Tag.java
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/Tag.java
index 2736a6909e..cb94a8c021 100644
---
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/Tag.java
+++
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/Tag.java
@@ -1,23 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.airavata.research.service.model.entity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
-import jakarta.persistence.Id;
import jakarta.persistence.GeneratedValue;
-import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
import jakarta.persistence.Table;
-import jakarta.persistence.ManyToMany;
-import org.hibernate.annotations.GenericGenerator;
-
-import java.util.Set;
+import org.hibernate.annotations.UuidGenerator;
@Entity
-@Table(name = "tag")
+@Table(name = "TAG")
public class Tag {
+
@Id
- @GeneratedValue(generator = "UUID")
- @GenericGenerator(name = "UUID", strategy =
"org.hibernate.id.UUIDGenerator")
- @Column(nullable = false, updatable = false)
+ @GeneratedValue
+ @UuidGenerator
+ @Column(nullable = false, updatable = false, length = 48)
private String id;
@Column(nullable = false)
diff --git
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/User.java
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/User.java
index 6f0055a24f..d7c9f664f4 100644
---
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/User.java
+++
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/model/entity/User.java
@@ -1,23 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.airavata.research.service.model.entity;
+
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
-import jakarta.persistence.TemporalType;
-import java.util.Date;
import jakarta.persistence.Temporal;
-import org.hibernate.annotations.GenericGenerator;
+import jakarta.persistence.TemporalType;
+import org.hibernate.annotations.UuidGenerator;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
-import jakarta.persistence.GeneratedValue;
+
+import java.util.Date;
@Entity
-@Table(name = "user")
+@Table(name = "AUTHOR")
public class User {
+
@Id
- @GeneratedValue(generator = "UUID")
- @GenericGenerator(name = "UUID", strategy =
"org.hibernate.id.UUIDGenerator")
- @Column(nullable = false, updatable = false)
+ @GeneratedValue
+ @UuidGenerator
+ @Column(nullable = false, updatable = false, length = 48)
private String id;
@Column(nullable = false)
diff --git
a/modules/research-framework/research-service/src/main/resources/distribution/conf/application.yml
b/modules/research-framework/research-service/src/main/resources/distribution/conf/application.yml
index 63f612c08f..3595f2acb4 100644
---
a/modules/research-framework/research-service/src/main/resources/distribution/conf/application.yml
+++
b/modules/research-framework/research-service/src/main/resources/distribution/conf/application.yml
@@ -6,14 +6,18 @@ server:
port: 18889
address: 0.0.0.0
+cybershuttle:
+ hub:
+ url: https://hub.dev.cybershuttle.org
+
spring:
servlet:
multipart:
max-file-size: 200MB
max-request-size: 200MB
datasource:
- url: "jdbc:mariadb://airavata.host:13306/research_catalog"
- username: "root"
+ url: "jdbc:mariadb://localhost:13306/research_catalog"
+ username: "airavata"
password: "123456"
driver-class-name: org.mariadb.jdbc.Driver
hikari:
@@ -21,5 +25,14 @@ spring:
leak-detection-threshold: 20000
jpa:
hibernate:
- ddl-auto: create
+ ddl-auto: update
open-in-view: false
+
+springdoc:
+ api-docs:
+ enabled: true
+ swagger-ui:
+ path: /swagger-ui.html
+ operationsSorter: alpha
+ tagsSorter: alpha
+ doc-expansion: none
\ No newline at end of file