Repository: archiva-redback-core
Updated Branches:
  refs/heads/jpa 7482c06fc -> e55262c8c


Add schema changes for compatibility with JDO implementation


Project: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/archiva-redback-core/commit/e55262c8
Tree: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/tree/e55262c8
Diff: http://git-wip-us.apache.org/repos/asf/archiva-redback-core/diff/e55262c8

Branch: refs/heads/jpa
Commit: e55262c8cca26d2c838185a993f5c792a1863ea0
Parents: 7482c06
Author: Martin Stockhammer <marti...@apache.org>
Authored: Sat Nov 19 23:26:08 2016 +0100
Committer: Martin Stockhammer <marti...@apache.org>
Committed: Sat Nov 19 23:26:08 2016 +0100

----------------------------------------------------------------------
 .../src/main/resources/META-INF/persistence.xml   |  1 +
 .../redback/rbac/jpa/model/JpaOperation.java      |  2 +-
 .../redback/rbac/jpa/model/JpaPermission.java     |  2 +-
 .../redback/rbac/jpa/model/JpaResource.java       |  8 ++++----
 .../archiva/redback/rbac/jpa/model/JpaRole.java   |  4 ++--
 .../redback/rbac/jpa/model/JpaUserAssignment.java |  2 +-
 .../archiva/redback/users/jpa/model/JpaUser.java  | 18 +++++++++++-------
 7 files changed, 21 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/e55262c8/redback-common/redback-common-jpa/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git 
a/redback-common/redback-common-jpa/src/main/resources/META-INF/persistence.xml 
b/redback-common/redback-common-jpa/src/main/resources/META-INF/persistence.xml
index 6d9f1af..602cd97 100644
--- 
a/redback-common/redback-common-jpa/src/main/resources/META-INF/persistence.xml
+++ 
b/redback-common/redback-common-jpa/src/main/resources/META-INF/persistence.xml
@@ -34,6 +34,7 @@
             <property name="openjpa.jdbc.MappingDefaults"
                       
value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
             <property name="openjpa.Log" value="DefaultLevel=TRACE, 
Runtime=TRACE, Tool=INFO, SQL=TRACE"/>
+           <property name="openjpa.jdbc.DBDictionary" 
value="(disableSchemaFactoryColumnTypeErrors=true,BitTypeName=CHAR(1),BooleanTypeName=CHAR(1),BooleanRepresentation=STRING_YN)"/>
         </properties>
     </persistence-unit>
 </persistence>

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/e55262c8/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaOperation.java
----------------------------------------------------------------------
diff --git 
a/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaOperation.java
 
b/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaOperation.java
index aaf0af7..bf9e747 100644
--- 
a/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaOperation.java
+++ 
b/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaOperation.java
@@ -40,7 +40,7 @@ public class JpaOperation implements Operation, Serializable {
     @Column(name="DESCRIPTION")
     private String description;
     @Column(name="PERMANENT", nullable = false)
-    private boolean permanent;
+    private Boolean permanent = false;
 
 
     @Override

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/e55262c8/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaPermission.java
----------------------------------------------------------------------
diff --git 
a/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaPermission.java
 
b/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaPermission.java
index 218cbc7..ed3928a 100644
--- 
a/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaPermission.java
+++ 
b/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaPermission.java
@@ -40,7 +40,7 @@ public class JpaPermission implements Permission,Serializable 
{
     @Column(name="DESCRIPTION")
     private String description;
     @Column(name="PERMANENT", nullable = false)
-    private boolean permanent;
+    private Boolean permanent = false;
     @ManyToOne(cascade = CascadeType.ALL)
     @JoinColumn(
             name="OPERATION_NAME_OID",

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/e55262c8/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaResource.java
----------------------------------------------------------------------
diff --git 
a/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaResource.java
 
b/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaResource.java
index dd2f3f4..19da451 100644
--- 
a/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaResource.java
+++ 
b/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaResource.java
@@ -37,10 +37,10 @@ public class JpaResource implements Resource, Serializable {
     @Id
     @Column(name="IDENTIFIER")
     private String identifier;
-    @Column(name="PATTERN", nullable = false)
-    private boolean pattern;
-    @Column(name="PERMANENT", nullable = false)
-    private boolean permanent;
+    @Column(name="PATTERN", nullable = false, columnDefinition = "CHAR(1)")
+    private Boolean pattern = false;
+    @Column(name="PERMANENT", nullable = false, columnDefinition = "CHAR(1)")
+    private Boolean permanent = false;
 
 
     @Override

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/e55262c8/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaRole.java
----------------------------------------------------------------------
diff --git 
a/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaRole.java
 
b/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaRole.java
index 425fa35..565409b 100644
--- 
a/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaRole.java
+++ 
b/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaRole.java
@@ -43,9 +43,9 @@ public class JpaRole extends AbstractRole implements 
Serializable {
     @Column(name="DESCRIPTION")
     private String description;
     @Column(name="ASSIGNABLE",nullable = false)
-    private boolean assignable;
+    private Boolean assignable = false;
     @Column(name="PERMANENT", nullable = false)
-    private boolean permanent;
+    private Boolean permanent = false;
     @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
     @OrderColumn(name="INTEGER_IDX", nullable = false)
     @JoinTable(

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/e55262c8/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaUserAssignment.java
----------------------------------------------------------------------
diff --git 
a/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaUserAssignment.java
 
b/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaUserAssignment.java
index 3b6853c..7e64bdd 100644
--- 
a/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaUserAssignment.java
+++ 
b/redback-rbac/redback-rbac-providers/redback-rbac-jpa/src/main/java/org/apache/archiva/redback/rbac/jpa/model/JpaUserAssignment.java
@@ -58,7 +58,7 @@ public class JpaUserAssignment extends AbstractUserAssignment 
implements UserAss
     )
     private List<String> roleNames = new ArrayList<String>();
     @Column(name="PERMANENT", nullable = false)
-    private boolean permanent = false;
+    private Boolean permanent = false;
 
     @Column(name="LAST_UPDATED")
     private Date timestamp;

http://git-wip-us.apache.org/repos/asf/archiva-redback-core/blob/e55262c8/redback-users/redback-users-providers/redback-users-jpa/src/main/java/org/apache/archiva/redback/users/jpa/model/JpaUser.java
----------------------------------------------------------------------
diff --git 
a/redback-users/redback-users-providers/redback-users-jpa/src/main/java/org/apache/archiva/redback/users/jpa/model/JpaUser.java
 
b/redback-users/redback-users-providers/redback-users-jpa/src/main/java/org/apache/archiva/redback/users/jpa/model/JpaUser.java
index cf45ba3..e5ee5eb 100644
--- 
a/redback-users/redback-users-providers/redback-users-jpa/src/main/java/org/apache/archiva/redback/users/jpa/model/JpaUser.java
+++ 
b/redback-users/redback-users-providers/redback-users-jpa/src/main/java/org/apache/archiva/redback/users/jpa/model/JpaUser.java
@@ -19,6 +19,9 @@ package org.apache.archiva.redback.users.jpa.model;
  * under the License.
  */
 
+import org.apache.openjpa.persistence.ExternalValues;
+import org.apache.openjpa.persistence.Type;
+
 import javax.persistence.CollectionTable;
 import javax.persistence.Column;
 import javax.persistence.ElementCollection;
@@ -26,6 +29,7 @@ import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
 import javax.persistence.OrderColumn;
 import javax.persistence.Table;
 import java.util.ArrayList;
@@ -52,26 +56,26 @@ public class JpaUser implements 
org.apache.archiva.redback.users.User {
     private Date lastPasswordChange;
     @ElementCollection(fetch = FetchType.EAGER)
     @OrderColumn(name="INTEGER_IDX", nullable = false)
-    @Column(name="STRING_ELE")
+    @Column(name="STRING_ELE", nullable = false)
     @CollectionTable(name="JDOUSER_PREVIOUSENCODEDPASSWORDS",
             joinColumns = @JoinColumn(name = "USERNAME_OID", nullable = false, 
referencedColumnName = "USERNAME")
     )
     private List<String> previousEncodedPasswords = new ArrayList<String>();
     @Column(name="PERMANENT", nullable = false)
-    private boolean permanent;
+    private Boolean permanent = false;
     @Column(name="LOCKED", nullable = false)
-    private boolean locked;
+    private Boolean locked = false;
     @Column(name="PASSWORD_CHANGE_REQUIRED", nullable = false)
-    private boolean passwordChangeRequired;
+    private Boolean passwordChangeRequired = false;
     @Column(name="VALIDATED", nullable = false)
-    private boolean validated;
+    private Boolean validated = false;
     @Column(name="COUNT_FAILED_LOGIN_ATTEMPTS",nullable = false)
-    private int countFailedLoginAttempts;
+    private int countFailedLoginAttempts = 0;
     @Column(name="ACCOUNT_CREATION_DATE")
     private Date accountCreationDate;
     @Column(name="LAST_LOGIN_DATE")
     private Date lastLoginDate;
-    @Column(name="USER_PASSSWORD")
+    @Column(name="USER_PASSWORD")
     private String rawPassword;
 
 

Reply via email to