AIRAVATA-2316 Fixing loading user profile, eager fetch emails

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

Branch: refs/heads/develop
Commit: e34206394de573f718a7fb3e8b0b4ebdc8938dbc
Parents: bce873c
Author: Marcus Christie <[email protected]>
Authored: Fri Feb 17 16:29:20 2017 -0500
Committer: Anuj Bhandar <[email protected]>
Committed: Tue Feb 28 13:07:18 2017 -0500

----------------------------------------------------------------------
 .../airavata/user/registry/core/entities/UserProfileEntity.java    | 2 +-
 .../user/registry/core/repositories/UserProfileRepository.java     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/e3420639/modules/user-profile/user-profile-core/src/main/java/org/apache/airavata/user/registry/core/entities/UserProfileEntity.java
----------------------------------------------------------------------
diff --git 
a/modules/user-profile/user-profile-core/src/main/java/org/apache/airavata/user/registry/core/entities/UserProfileEntity.java
 
b/modules/user-profile/user-profile-core/src/main/java/org/apache/airavata/user/registry/core/entities/UserProfileEntity.java
index 6fe0700..1285efd 100644
--- 
a/modules/user-profile/user-profile-core/src/main/java/org/apache/airavata/user/registry/core/entities/UserProfileEntity.java
+++ 
b/modules/user-profile/user-profile-core/src/main/java/org/apache/airavata/user/registry/core/entities/UserProfileEntity.java
@@ -86,7 +86,7 @@ public class UserProfileEntity {
         this.userModelVersion = userModelVersion;
     }
 
-    @ElementCollection
+    @ElementCollection(fetch = FetchType.EAGER)
     @CollectionTable(name="USER_PROFILE_EMAIL", joinColumns = 
@JoinColumn(name="AIRAVATA_INTERNAL_USER_ID"))
     public List<String> getEmails() {
         return emails;

http://git-wip-us.apache.org/repos/asf/airavata/blob/e3420639/modules/user-profile/user-profile-core/src/main/java/org/apache/airavata/user/registry/core/repositories/UserProfileRepository.java
----------------------------------------------------------------------
diff --git 
a/modules/user-profile/user-profile-core/src/main/java/org/apache/airavata/user/registry/core/repositories/UserProfileRepository.java
 
b/modules/user-profile/user-profile-core/src/main/java/org/apache/airavata/user/registry/core/repositories/UserProfileRepository.java
index 07965e5..eee5963 100644
--- 
a/modules/user-profile/user-profile-core/src/main/java/org/apache/airavata/user/registry/core/repositories/UserProfileRepository.java
+++ 
b/modules/user-profile/user-profile-core/src/main/java/org/apache/airavata/user/registry/core/repositories/UserProfileRepository.java
@@ -50,7 +50,7 @@ public class UserProfileRepository extends 
AbstractRepository<UserProfile, UserP
         Map<String, Object> queryParam = new HashMap<String, Object>();
         queryParam.put(UserProfile._Fields.USER_ID.getFieldName(), userId);
         queryParam.put(UserProfile._Fields.GATEWAY_ID.getFieldName(), 
gatewayId);
-        List<UserProfile> resultList = 
select(QueryConstants.FIND_USER_PROFILE_BY_USER_ID, 0, 1, queryParam);
+        List<UserProfile> resultList = 
select(QueryConstants.FIND_USER_PROFILE_BY_USER_ID, 1, 0, queryParam);
 
         if (resultList != null && resultList.size() > 0)
             userProfile =  resultList.get(0);

Reply via email to