[java-opensaml COMMIT] in /trunk: opensaml-parent/pom.xml opensaml-storage-api/src/main/java/org/opensaml/storage/Sto...
noreply at shibboleth.net
noreply at shibboleth.net
Thu May 15 23:47:17 EDT 2014
Author: dfisher
Date: Thu May 15 23:47:16 2014
New Revision: 3880
URL: http://svn.shibboleth.net/view/java-opensaml?rev=3880&view=rev
Log:
Add hibernate jpa dependencies.
Add setVersion to StorageRecord to satisfy JPA spec.
Add JPA annotated StorageRecord that uses Composite key for context and key.
Add JPA storage service implementation.
See IDP-238.
Added:
trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/JPAStorageRecord.java
trunk/opensaml-storage-impl/src/main/java/org/opensaml/storage/impl/JPAStorageService.java
trunk/opensaml-storage-impl/src/test/java/org/opensaml/storage/impl/JPAStorageServiceTest.java
trunk/opensaml-storage-impl/src/test/resources/META-INF/
trunk/opensaml-storage-impl/src/test/resources/META-INF/persistence.xml
Modified:
trunk/opensaml-parent/pom.xml
trunk/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageRecord.java
trunk/opensaml-storage-impl/pom.xml
Modified: trunk/opensaml-parent/pom.xml
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-parent/pom.xml?rev=3880&r1=3879&r2=3880&view=diff
==============================================================================
--- trunk/opensaml-parent/pom.xml (original)
+++ trunk/opensaml-parent/pom.xml Thu May 15 23:47:16 2014
@@ -101,12 +101,28 @@
<dependencyManagement>
<dependencies>
<!-- Compile Dependencies -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>4.3.5.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <version>1.0.1.Final</version>
+ </dependency>
<!-- Provided Dependencies -->
<!-- Runtime Dependencies -->
<!-- Test Dependencies -->
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>2.2.9</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</dependencyManagement>
Modified: trunk/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageRecord.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageRecord.java?rev=3880&r1=3879&r2=3880&view=diff
==============================================================================
--- trunk/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageRecord.java (original)
+++ trunk/opensaml-storage-api/src/main/java/org/opensaml/storage/StorageRecord.java Thu May 15 23:47:16 2014
@@ -24,6 +24,7 @@
import javax.annotation.concurrent.NotThreadSafe;
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
+import net.shibboleth.utilities.java.support.logic.Constraint;
/**
* Represents a versioned record in a {@link StorageService}.
@@ -96,6 +97,15 @@
}
/**
+ * Set the record version.
+ *
+ * @param ver the new record version, must be > 0
+ */
+ protected void setVersion(final int ver) {
+ version = (int) Constraint.isGreaterThan(0, ver, "Version must be greater than zero");
+ }
+
+ /**
* Set the record value.
*
* @param val the new record value
@@ -133,5 +143,4 @@
protected int incrementVersion() {
return ++version;
}
-
}
Modified: trunk/opensaml-storage-impl/pom.xml
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-storage-impl/pom.xml?rev=3880&r1=3879&r2=3880&view=diff
==============================================================================
--- trunk/opensaml-storage-impl/pom.xml (original)
+++ trunk/opensaml-storage-impl/pom.xml Thu May 15 23:47:16 2014
@@ -30,6 +30,14 @@
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ </dependency>
<!-- Provided Dependencies -->
<dependency>
@@ -59,6 +67,12 @@
</dependency>
<dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>${spring.groupId}</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
More information about the commits
mailing list