syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [2/2] syncope git commit: Better views, then indexes and finally default content
Date Thu, 15 Mar 2018 15:46:54 GMT
Better views, then indexes and finally default content


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

Branch: refs/heads/2_0_X
Commit: 7283109e30f7ae32c2f101dffda99e20f9b9772e
Parents: 7132d3d
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Thu Mar 15 16:46:28 2018 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Thu Mar 15 16:46:28 2018 +0100

----------------------------------------------------------------------
 .../jpa/content/XMLContentLoader.java           | 10 ++--
 .../src/main/resources/sqlserver/views.xml      | 48 +++++++++++---------
 2 files changed, 31 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/7283109e/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/content/XMLContentLoader.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/content/XMLContentLoader.java
b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/content/XMLContentLoader.java
index bbbe38d..18247fe 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/content/XMLContentLoader.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/content/XMLContentLoader.java
@@ -80,17 +80,17 @@ public class XMLContentLoader extends AbstractContentDealer implements
ContentLo
                     LOG.error("[{}] While creating indexes", entry.getKey(), e);
                 }
                 try {
+                    createViews(entry.getKey(), entry.getValue());
+                } catch (IOException e) {
+                    LOG.error("[{}] While creating views", entry.getKey(), e);
+                }
+                try {
                     ResourceWithFallbackLoader contentXML = ApplicationContextProvider.getBeanFactory().
                             getBean(entry.getKey() + "ContentXML", ResourceWithFallbackLoader.class);
                     loadDefaultContent(entry.getKey(), contentXML, entry.getValue());
                 } catch (Exception e) {
                     LOG.error("[{}] While loading default content", entry.getKey(), e);
                 }
-                try {
-                    createViews(entry.getKey(), entry.getValue());
-                } catch (IOException e) {
-                    LOG.error("[{}] While creating views", entry.getKey(), e);
-                }
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/7283109e/fit/core-reference/src/main/resources/sqlserver/views.xml
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/resources/sqlserver/views.xml b/fit/core-reference/src/main/resources/sqlserver/views.xml
index ef6c666..32d48df 100644
--- a/fit/core-reference/src/main/resources/sqlserver/views.xml
+++ b/fit/core-reference/src/main/resources/sqlserver/views.xml
@@ -19,8 +19,33 @@ under the License.
 -->
 <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
 <properties>
-  <comment>Views</comment>
   
+  <entry key="UDynGroupMembers">
+    CREATE TABLE UDynGroupMembers(
+    any_id CHAR(36),
+    group_id CHAR(36),
+    UNIQUE(any_id, group_id))
+  </entry>
+  <entry key="ADynGroupMembers">
+    CREATE TABLE ADynGroupMembers(
+    anyType_id VARCHAR(255),
+    any_id CHAR(36),
+    group_id CHAR(36),
+    UNIQUE(anyType_id, any_id, group_id))
+  </entry>
+  <entry key="DynRoleMembers">
+    CREATE TABLE DynRoleMembers(
+    any_id CHAR(36),
+    role_id VARCHAR(255),
+    UNIQUE(any_id, role_id))
+  </entry>
+  <entry key="DynRealmMembers">
+    CREATE TABLE DynRealmMembers(
+    any_id CHAR(36),
+    dynRealm_id VARCHAR(255),
+    UNIQUE(any_id, dynRealm_id))
+  </entry>
+
   <!-- user -->
   <entry key="user_search">
     CREATE VIEW user_search AS
@@ -80,26 +105,12 @@ under the License.
     FROM UMembership m, SyncopeGroup g
     WHERE m.group_id = g.id
   </entry>
-  <entry key="user_search_udyngmemb">
-    CREATE VIEW user_search_udyngmemb AS
-
-    SELECT ds.user_id AS any_id, d.group_id AS group_id
-    FROM UDynGroupMembership d, UDynGroupMembership_User ds
-    WHERE d.id = ds.uDynGroupMembership_id
-  </entry>
   <entry key="user_search_role">
     CREATE VIEW user_search_role AS
 
     SELECT ss.user_id AS any_id, ss.role_id AS role_id
     FROM SyncopeUser_SyncopeRole ss
   </entry>
-  <entry key="user_search_dynrmemb">
-    CREATE VIEW user_search_dynrmemb AS
-
-    SELECT ds.user_id AS any_id, d.role_id AS role_id
-    FROM DynRoleMembership d, DynRoleMembership_User ds
-    WHERE d.id = ds.dynRoleMembership_id
-  </entry>
   <entry key="user_search_resource">
     CREATE VIEW user_search_resource AS
 
@@ -173,13 +184,6 @@ under the License.
     FROM AMembership m, SyncopeGroup g
     WHERE m.group_id = g.id
   </entry>
-  <entry key="anyObject_search_adyngmemb">
-    CREATE VIEW anyObject_search_adyngmemb AS
-
-    SELECT ds.anyObject_id AS any_id, d.group_id AS group_id
-    FROM ADynGroupMembership d, ADynGroupMembership_AnyObject ds
-    WHERE d.id = ds.aDynGroupMembership_id
-  </entry>
   <entry key="anyObject_search_resource">
     CREATE VIEW anyObject_search_resource AS
 


Mime
View raw message