airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata git commit: fixing the clob not getting set issue
Date Fri, 21 Oct 2016 16:23:01 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop fdb519155 -> 76c9eaf90


fixing the clob not getting set issue


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/76c9eaf9
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/76c9eaf9
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/76c9eaf9

Branch: refs/heads/develop
Commit: 76c9eaf908d3bafc32a588cf82b81e2c207ebd54
Parents: fdb5191
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Fri Oct 21 11:58:04 2016 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Fri Oct 21 12:22:54 2016 -0400

----------------------------------------------------------------------
 .../airavata/sharing/registry/db/entities/EntityEntity.java  | 2 +-
 .../sharing/registry/db/repositories/EntityRepository.java   | 8 +-------
 .../src/main/resources/sharing-registry-derby.sql            | 2 +-
 .../sharing/registry/SharingRegistryServiceTest.java         | 5 +++++
 4 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/76c9eaf9/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java
b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java
index 1fbf4f4..0827439 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/EntityEntity.java
@@ -124,7 +124,7 @@ public class EntityEntity {
         this.binaryData = binaryData;
     }
 
-    @Lob
+    @Basic
     @Column(name = "FULL_TEXT")
     public String getFullText() {
         return fullText;

http://git-wip-us.apache.org/repos/asf/airavata/blob/76c9eaf9/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
index 8c5c268..add80a8 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
+++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/EntityRepository.java
@@ -30,7 +30,6 @@ import org.apache.airavata.sharing.registry.models.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.sql.Clob;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -122,12 +121,7 @@ public class EntityRepository extends AbstractRepository<Entity, EntityEntity,
E
             entity.setName((String) (rs[5]));
             entity.setDescription((String)(rs[6]));
             entity.setBinaryData((byte[]) (rs[7]));
-            if(rs[8] instanceof Clob){
-                Clob clob = (Clob)rs[8];
-                if(clob != null)
-                    entity.setFullText(clob.toString());
-            }else
-                entity.setFullText((String) (rs[8]));
+            entity.setFullText((String) (rs[8]));
             entity.setOriginalEntityCreationTime((long)(rs[9]));
             entity.setCreatedTime((long)(rs[10]));
             entity.setUpdatedTime((long)(rs[11]));

http://git-wip-us.apache.org/repos/asf/airavata/blob/76c9eaf9/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-derby.sql
b/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-derby.sql
index 19389c9..dca567b 100644
--- a/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-derby.sql
+++ b/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-derby.sql
@@ -100,7 +100,7 @@ CREATE TABLE ENTITY (
   NAME VARCHAR(255) NOT NULL,
   DESCRIPTION VARCHAR(255),
   BINARY_DATA BLOB,
-  FULL_TEXT CLOB,
+  FULL_TEXT VARCHAR(8192),
   ORIGINAL_ENTITY_CREATION_TIME BIGINT NOT NULL,
   CREATED_TIME BIGINT NOT NULL,
   UPDATED_TIME BIGINT NOT NULL,

http://git-wip-us.apache.org/repos/asf/airavata/blob/76c9eaf9/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServiceTest.java
----------------------------------------------------------------------
diff --git a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServiceTest.java
b/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServiceTest.java
index 9802113..47c3001 100644
--- a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServiceTest.java
+++ b/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServiceTest.java
@@ -305,5 +305,10 @@ public class SharingRegistryServiceTest {
         filters.add(searchCriteria);
 
         Assert.assertTrue(sharingServiceClient.searchEntities(domainId, "test-user-2", "EXPERIMENT",
filters, 0, -1).size()==1);
+        Entity persistedEntity = sharingServiceClient.searchEntities(
+                domainId, "test-user-2", "EXPERIMENT", filters, 0, -1).get(0);
+        Assert.assertEquals(entity3.getName(), persistedEntity.getName());
+        Assert.assertEquals(entity3.getDescription(), persistedEntity.getDescription());
+        Assert.assertEquals(entity3.getFullText(), persistedEntity.getFullText());
     }
 }
\ No newline at end of file


Mime
View raw message