syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [2/6] syncope git commit: [SYNCOPE-638] Now using sequence generator for MAttrTemplate / RAttrTemplate
Date Fri, 13 Feb 2015 14:21:21 GMT
[SYNCOPE-638] Now using sequence generator for MAttrTemplate / RAttrTemplate


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

Branch: refs/heads/master
Commit: 4e35b35f484b126b55cf1c2a703969d0a6544fbf
Parents: 197e939
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Fri Feb 13 15:20:19 2015 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Fri Feb 13 15:20:19 2015 +0100

----------------------------------------------------------------------
 .../persistence/beans/AbstractAttrTemplate.java    | 11 -----------
 .../beans/membership/MAttrTemplate.java            |  8 ++++++++
 .../core/persistence/beans/role/RAttrTemplate.java |  8 ++++++++
 core/src/main/resources/META-INF/orm.xml           | 17 +++++++++++++++++
 core/src/main/resources/META-INF/orm.xml.oracle    | 17 +++++++++++++++++
 core/src/main/resources/META-INF/orm.xml.sqlserver | 17 +++++++++++++++++
 6 files changed, 67 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/4e35b35f/core/src/main/java/org/apache/syncope/core/persistence/beans/AbstractAttrTemplate.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/syncope/core/persistence/beans/AbstractAttrTemplate.java
b/core/src/main/java/org/apache/syncope/core/persistence/beans/AbstractAttrTemplate.java
index 8786cce..1b2621f 100644
--- a/core/src/main/java/org/apache/syncope/core/persistence/beans/AbstractAttrTemplate.java
+++ b/core/src/main/java/org/apache/syncope/core/persistence/beans/AbstractAttrTemplate.java
@@ -18,9 +18,6 @@
  */
 package org.apache.syncope.core.persistence.beans;
 
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
 import javax.persistence.MappedSuperclass;
 import org.apache.syncope.core.persistence.beans.role.SyncopeRole;
 
@@ -29,14 +26,6 @@ public abstract class AbstractAttrTemplate<T extends AbstractSchema>
extends Abs
 
     private static final long serialVersionUID = 4829112252713766666L;
 
-    @Id
-    @GeneratedValue(strategy = GenerationType.AUTO)
-    protected Long id;
-
-    public Long getId() {
-        return id;
-    }
-
     public abstract SyncopeRole getOwner();
 
     public abstract void setOwner(SyncopeRole role);

http://git-wip-us.apache.org/repos/asf/syncope/blob/4e35b35f/core/src/main/java/org/apache/syncope/core/persistence/beans/membership/MAttrTemplate.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/syncope/core/persistence/beans/membership/MAttrTemplate.java
b/core/src/main/java/org/apache/syncope/core/persistence/beans/membership/MAttrTemplate.java
index a727eed..be92ad3 100644
--- a/core/src/main/java/org/apache/syncope/core/persistence/beans/membership/MAttrTemplate.java
+++ b/core/src/main/java/org/apache/syncope/core/persistence/beans/membership/MAttrTemplate.java
@@ -19,6 +19,7 @@
 package org.apache.syncope.core.persistence.beans.membership;
 
 import javax.persistence.Entity;
+import javax.persistence.Id;
 import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
 import org.apache.syncope.core.persistence.beans.AbstractAttrTemplate;
@@ -29,6 +30,9 @@ public class MAttrTemplate extends AbstractAttrTemplate<MSchema> {
 
     private static final long serialVersionUID = -3424574558427502145L;
 
+    @Id
+    private Long id;
+
     @ManyToOne
     private SyncopeRole owner;
 
@@ -36,6 +40,10 @@ public class MAttrTemplate extends AbstractAttrTemplate<MSchema>
{
     @JoinColumn(name = "schema_name")
     private MSchema schema;
 
+    public Long getId() {
+        return id;
+    }
+
     @Override
     public MSchema getSchema() {
         return schema;

http://git-wip-us.apache.org/repos/asf/syncope/blob/4e35b35f/core/src/main/java/org/apache/syncope/core/persistence/beans/role/RAttrTemplate.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/syncope/core/persistence/beans/role/RAttrTemplate.java
b/core/src/main/java/org/apache/syncope/core/persistence/beans/role/RAttrTemplate.java
index 4b5653e..2a0f915 100644
--- a/core/src/main/java/org/apache/syncope/core/persistence/beans/role/RAttrTemplate.java
+++ b/core/src/main/java/org/apache/syncope/core/persistence/beans/role/RAttrTemplate.java
@@ -19,6 +19,7 @@
 package org.apache.syncope.core.persistence.beans.role;
 
 import javax.persistence.Entity;
+import javax.persistence.Id;
 import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
 import org.apache.syncope.core.persistence.beans.AbstractAttrTemplate;
@@ -28,6 +29,9 @@ public class RAttrTemplate extends AbstractAttrTemplate<RSchema> {
 
     private static final long serialVersionUID = -3424574558427502145L;
 
+    @Id
+    private Long id;
+
     @ManyToOne
     private SyncopeRole owner;
 
@@ -35,6 +39,10 @@ public class RAttrTemplate extends AbstractAttrTemplate<RSchema>
{
     @JoinColumn(name = "schema_name")
     private RSchema schema;
 
+    public Long getId() {
+        return id;
+    }
+
     @Override
     public RSchema getSchema() {
         return schema;

http://git-wip-us.apache.org/repos/asf/syncope/blob/4e35b35f/core/src/main/resources/META-INF/orm.xml
----------------------------------------------------------------------
diff --git a/core/src/main/resources/META-INF/orm.xml b/core/src/main/resources/META-INF/orm.xml
index 3dad2b5..f3e9f63 100644
--- a/core/src/main/resources/META-INF/orm.xml
+++ b/core/src/main/resources/META-INF/orm.xml
@@ -108,6 +108,23 @@ under the License.
     </attributes>
   </entity>
 
+  <entity class="org.apache.syncope.core.persistence.beans.role.RAttrTemplate">
+    <attributes>
+      <id name="id">
+        <generated-value generator="SEQ_RAttrTemplate" strategy="TABLE"/>
+        <table-generator name="SEQ_RAttrTemplate" pk-column-value="SEQ_RAttrTemplate"
initial-value="1000"/>
+      </id>
+    </attributes>
+  </entity>
+  <entity class="org.apache.syncope.core.persistence.beans.membership.MAttrTemplate">
+    <attributes>
+      <id name="id">
+        <generated-value generator="SEQ_MAttrTemplate" strategy="TABLE"/>
+        <table-generator name="SEQ_MAttrTemplate" pk-column-value="SEQ_MAttrTemplate"
initial-value="1000"/>
+      </id>
+    </attributes>
+  </entity>
+
   <entity class="org.apache.syncope.core.persistence.beans.user.UAttr">
     <attributes>
       <id name="id">

http://git-wip-us.apache.org/repos/asf/syncope/blob/4e35b35f/core/src/main/resources/META-INF/orm.xml.oracle
----------------------------------------------------------------------
diff --git a/core/src/main/resources/META-INF/orm.xml.oracle b/core/src/main/resources/META-INF/orm.xml.oracle
index e0bf118..b19fa0e 100644
--- a/core/src/main/resources/META-INF/orm.xml.oracle
+++ b/core/src/main/resources/META-INF/orm.xml.oracle
@@ -109,6 +109,23 @@ under the License.
     </attributes>
   </entity>
 
+  <entity class="org.apache.syncope.core.persistence.beans.role.RAttrTemplate">
+    <attributes>
+      <id name="id">
+        <generated-value generator="SEQ_RAttrTemplate" strategy="TABLE"/>
+        <table-generator name="SEQ_RAttrTemplate" pk-column-value="SEQ_RAttrTemplate"
initial-value="1000"/>
+      </id>
+    </attributes>
+  </entity>
+  <entity class="org.apache.syncope.core.persistence.beans.membership.MAttrTemplate">
+    <attributes>
+      <id name="id">
+        <generated-value generator="SEQ_MAttrTemplate" strategy="TABLE"/>
+        <table-generator name="SEQ_MAttrTemplate" pk-column-value="SEQ_MAttrTemplate"
initial-value="1000"/>
+      </id>
+    </attributes>
+  </entity>
+
   <entity class="org.apache.syncope.core.persistence.beans.user.UAttr">
     <attributes>
       <id name="id">

http://git-wip-us.apache.org/repos/asf/syncope/blob/4e35b35f/core/src/main/resources/META-INF/orm.xml.sqlserver
----------------------------------------------------------------------
diff --git a/core/src/main/resources/META-INF/orm.xml.sqlserver b/core/src/main/resources/META-INF/orm.xml.sqlserver
index 0844963..4b66e01 100644
--- a/core/src/main/resources/META-INF/orm.xml.sqlserver
+++ b/core/src/main/resources/META-INF/orm.xml.sqlserver
@@ -109,6 +109,23 @@ under the License.
     </attributes>
   </entity>
 
+  <entity class="org.apache.syncope.core.persistence.beans.role.RAttrTemplate">
+    <attributes>
+      <id name="id">
+        <generated-value generator="SEQ_RAttrTemplate" strategy="TABLE"/>
+        <table-generator name="SEQ_RAttrTemplate" pk-column-value="SEQ_RAttrTemplate"
initial-value="1000"/>
+      </id>
+    </attributes>
+  </entity>
+  <entity class="org.apache.syncope.core.persistence.beans.membership.MAttrTemplate">
+    <attributes>
+      <id name="id">
+        <generated-value generator="SEQ_MAttrTemplate" strategy="TABLE"/>
+        <table-generator name="SEQ_MAttrTemplate" pk-column-value="SEQ_MAttrTemplate"
initial-value="1000"/>
+      </id>
+    </attributes>
+  </entity>
+  
   <entity class="org.apache.syncope.core.persistence.beans.user.UAttr">
     <attributes>
       <id name="id">


Mime
View raw message