Merge pull request #76 from seanf/futureable-void

List 'void' as valid Futureable return
diff --git a/README.md b/README.md
index 1fa667d..410a0b7 100644
--- a/README.md
+++ b/README.md
@@ -37,7 +37,7 @@
 ## Requirements to Build
 
 - Git
-- JDK 6
+- JDK 8
 - Maven
 
 Just run `mvn clean install` from the top level directory, `deltaspike` to build the source code.
\ No newline at end of file
diff --git a/deltaspike/cdictrl/api/pom.xml b/deltaspike/cdictrl/api/pom.xml
index 1fde779..1daa4cd 100644
--- a/deltaspike/cdictrl/api/pom.xml
+++ b/deltaspike/cdictrl/api/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.cdictrl</groupId>
         <artifactId>cdictrl-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/deltaspike/cdictrl/impl-openejb/pom.xml b/deltaspike/cdictrl/impl-openejb/pom.xml
index 9ed1348..b2dd9e0 100644
--- a/deltaspike/cdictrl/impl-openejb/pom.xml
+++ b/deltaspike/cdictrl/impl-openejb/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.cdictrl</groupId>
         <artifactId>cdictrl-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/deltaspike/cdictrl/impl-owb/pom.xml b/deltaspike/cdictrl/impl-owb/pom.xml
index d35961d..d1a0773 100644
--- a/deltaspike/cdictrl/impl-owb/pom.xml
+++ b/deltaspike/cdictrl/impl-owb/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.cdictrl</groupId>
         <artifactId>cdictrl-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/deltaspike/cdictrl/impl-weld/pom.xml b/deltaspike/cdictrl/impl-weld/pom.xml
index 8dd2c23..110ad1a 100644
--- a/deltaspike/cdictrl/impl-weld/pom.xml
+++ b/deltaspike/cdictrl/impl-weld/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.cdictrl</groupId>
         <artifactId>cdictrl-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
@@ -62,6 +62,7 @@
         <dependency>
             <groupId>org.jboss.weld</groupId>
             <artifactId>weld-api</artifactId>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
diff --git a/deltaspike/cdictrl/pom.xml b/deltaspike/cdictrl/pom.xml
index d32c4c6..4bb86b0 100644
--- a/deltaspike/cdictrl/pom.xml
+++ b/deltaspike/cdictrl/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike</groupId>
         <artifactId>parent-code</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../parent/code/pom.xml</relativePath>
     </parent>
 
diff --git a/deltaspike/cdictrl/servlet/pom.xml b/deltaspike/cdictrl/servlet/pom.xml
index 258a90b..9ca5ba0 100644
--- a/deltaspike/cdictrl/servlet/pom.xml
+++ b/deltaspike/cdictrl/servlet/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.deltaspike.cdictrl</groupId>
         <artifactId>cdictrl-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/deltaspike/cdictrl/tck/pom.xml b/deltaspike/cdictrl/tck/pom.xml
index 06a795a..6d482f3 100644
--- a/deltaspike/cdictrl/tck/pom.xml
+++ b/deltaspike/cdictrl/tck/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.apache.deltaspike.cdictrl</groupId>
         <artifactId>cdictrl-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/deltaspike/checkstyle-rules/pom.xml b/deltaspike/checkstyle-rules/pom.xml
index 22227af..4126cda 100644
--- a/deltaspike/checkstyle-rules/pom.xml
+++ b/deltaspike/checkstyle-rules/pom.xml
@@ -42,7 +42,7 @@
     <parent>
         <groupId>org.apache.deltaspike</groupId>
         <artifactId>deltaspike-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/deltaspike/core/api/pom.xml b/deltaspike/core/api/pom.xml
index 1de2eaa..83b7736 100644
--- a/deltaspike/core/api/pom.xml
+++ b/deltaspike/core/api/pom.xml
@@ -42,7 +42,7 @@
     <parent>
         <groupId>org.apache.deltaspike.core</groupId>
         <artifactId>core-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java
index 56986da..ee16477 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java
@@ -135,7 +135,7 @@
      */
     public static boolean isActive()
     {
-        return bmpSingleton != null;
+        return bmpSingleton != null && bmpSingleton.bmInfos.containsKey(ClassUtils.getClassLoader(null));
     }
 
     /**
diff --git a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/resourceloader/InjectableResource.java b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/resourceloader/InjectableResource.java
index aaffc27..4b40788 100644
--- a/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/resourceloader/InjectableResource.java
+++ b/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/resourceloader/InjectableResource.java
@@ -37,11 +37,11 @@
  * <b>Example:</b>
  * <pre>
  * &#064;Inject
- * &#064;InjectableResource("myfile.properties")
+ * &#064;InjectableResource(location="myfile.properties")
  * private Properties props;
  *
  * &#064;Inject
- * &#064;InjectableResource("config.xml")
+ * &#064;InjectableResource(location="config.xml")
  * private InputStream inputStream;
  * </pre>
  *
diff --git a/deltaspike/core/impl/pom.xml b/deltaspike/core/impl/pom.xml
index e4bcb90..6a8535c 100644
--- a/deltaspike/core/impl/pom.xml
+++ b/deltaspike/core/impl/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.core</groupId>
         <artifactId>core-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/deltaspike/core/pom.xml b/deltaspike/core/pom.xml
index f1876d1..f3bc08d 100644
--- a/deltaspike/core/pom.xml
+++ b/deltaspike/core/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike</groupId>
         <artifactId>parent-code</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../parent/code/pom.xml</relativePath>
     </parent>
 
diff --git a/deltaspike/dist/bom/pom.xml b/deltaspike/dist/bom/pom.xml
index a85a362..fd9b7ab 100644
--- a/deltaspike/dist/bom/pom.xml
+++ b/deltaspike/dist/bom/pom.xml
@@ -23,12 +23,12 @@
     <parent>
         <groupId>org.apache.deltaspike.distribution</groupId>
         <artifactId>distributions-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.distribution</groupId>
     <artifactId>distributions-bom</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike Distribution Bill of Materials</name>
diff --git a/deltaspike/dist/full/pom.xml b/deltaspike/dist/full/pom.xml
index b07503e..c2b0596 100644
--- a/deltaspike/dist/full/pom.xml
+++ b/deltaspike/dist/full/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.distribution</groupId>
         <artifactId>distributions-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>distribution-full</artifactId>
@@ -38,77 +38,90 @@
         <dependency>
             <groupId>org.apache.deltaspike.core</groupId>
             <artifactId>deltaspike-core-api</artifactId>
+            <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.core</groupId>
             <artifactId>deltaspike-core-impl</artifactId>
+            <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-security-module-api</artifactId>
+            <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-security-module-impl</artifactId>
+            <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-jpa-module-api</artifactId>
+            <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-jpa-module-impl</artifactId>
+            <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-servlet-module-api</artifactId>
+            <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-servlet-module-impl</artifactId>
+            <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-jsf-module-api</artifactId>
+            <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-jsf-module-impl</artifactId>
+            <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-jsf-module-impl-ee6</artifactId>
+            <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-data-module-api</artifactId>
+            <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-data-module-impl</artifactId>
+            <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
 
@@ -116,89 +129,104 @@
         <dependency>
             <groupId>org.apache.deltaspike.cdictrl</groupId>
             <artifactId>deltaspike-cdictrl-api</artifactId>
+            <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.cdictrl</groupId>
             <artifactId>deltaspike-cdictrl-owb</artifactId>
+            <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.cdictrl</groupId>
             <artifactId>deltaspike-cdictrl-weld</artifactId>
+            <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.cdictrl</groupId>
             <artifactId>deltaspike-cdictrl-openejb</artifactId>
+            <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.cdictrl</groupId>
             <artifactId>deltaspike-cdictrl-servlet</artifactId>
+            <version>${project.version}</version>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-partial-bean-module-api</artifactId>
+            <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-partial-bean-module-impl</artifactId>
+            <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-test-control-module-api</artifactId>
+            <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-test-control-module-impl</artifactId>
+            <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-bean-validation-module-api</artifactId>
+            <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-bean-validation-module-impl</artifactId>
+            <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-scheduler-module-api</artifactId>
+            <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-scheduler-module-impl</artifactId>
+            <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-proxy-module-api</artifactId>
+            <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
 
         <dependency>
             <groupId>org.apache.deltaspike.modules</groupId>
             <artifactId>deltaspike-proxy-module-impl-asm</artifactId>
+            <version>${project.version}</version>
             <scope>runtime</scope>
         </dependency>
     </dependencies>
diff --git a/deltaspike/dist/pom.xml b/deltaspike/dist/pom.xml
index 0d80506..d5d5ee9 100644
--- a/deltaspike/dist/pom.xml
+++ b/deltaspike/dist/pom.xml
@@ -22,14 +22,14 @@
 
     <parent>
         <groupId>org.apache.deltaspike</groupId>
-        <artifactId>parent-code</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
-        <relativePath>../parent/code/pom.xml</relativePath>
+        <artifactId>deltaspike-project</artifactId>
+        <version>1.9.1-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
     </parent>
 
     <groupId>org.apache.deltaspike.distribution</groupId>
     <artifactId>distributions-project</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike Distribution</name>
diff --git a/deltaspike/examples/data-examples/pom.xml b/deltaspike/examples/data-examples/pom.xml
index df62d3f..ffc6bcb 100644
--- a/deltaspike/examples/data-examples/pom.xml
+++ b/deltaspike/examples/data-examples/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.deltaspike.examples</groupId>
         <artifactId>examples-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>deltaspike-data-examples</artifactId>
diff --git a/deltaspike/examples/jpa-examples/pom.xml b/deltaspike/examples/jpa-examples/pom.xml
index cbc9bfa..0ac279b 100644
--- a/deltaspike/examples/jpa-examples/pom.xml
+++ b/deltaspike/examples/jpa-examples/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.apache.deltaspike.examples</groupId>
         <artifactId>examples-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>deltaspike-jpa-examples</artifactId>
diff --git a/deltaspike/examples/jse-examples/pom.xml b/deltaspike/examples/jse-examples/pom.xml
index 6aeb943..898a181 100644
--- a/deltaspike/examples/jse-examples/pom.xml
+++ b/deltaspike/examples/jse-examples/pom.xml
@@ -42,7 +42,7 @@
     <parent>
         <groupId>org.apache.deltaspike.examples</groupId>
         <artifactId>examples-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.examples</groupId>
diff --git a/deltaspike/examples/jsf-examples/pom.xml b/deltaspike/examples/jsf-examples/pom.xml
index 402bd0e..3c189a0 100644
--- a/deltaspike/examples/jsf-examples/pom.xml
+++ b/deltaspike/examples/jsf-examples/pom.xml
@@ -42,7 +42,7 @@
     <parent>
         <groupId>org.apache.deltaspike.examples</groupId>
         <artifactId>examples-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>deltaspike-jsf-example</artifactId>
diff --git a/deltaspike/examples/jsf-playground/pom.xml b/deltaspike/examples/jsf-playground/pom.xml
index 64fbb31..1727e04 100644
--- a/deltaspike/examples/jsf-playground/pom.xml
+++ b/deltaspike/examples/jsf-playground/pom.xml
@@ -42,7 +42,7 @@
     <parent>
         <groupId>org.apache.deltaspike.examples</groupId>
         <artifactId>examples-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>deltaspike-jsf-playground</artifactId>
diff --git a/deltaspike/examples/pom.xml b/deltaspike/examples/pom.xml
index 81e37e0..ae2ec0a 100644
--- a/deltaspike/examples/pom.xml
+++ b/deltaspike/examples/pom.xml
@@ -42,7 +42,7 @@
     <parent>
         <groupId>org.apache.deltaspike</groupId>
         <artifactId>parent</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../parent/pom.xml</relativePath>
     </parent>
 
diff --git a/deltaspike/examples/scheduler-playground/pom.xml b/deltaspike/examples/scheduler-playground/pom.xml
index 194a2dc..2886432 100644
--- a/deltaspike/examples/scheduler-playground/pom.xml
+++ b/deltaspike/examples/scheduler-playground/pom.xml
@@ -42,7 +42,7 @@
     <parent>
         <groupId>org.apache.deltaspike.examples</groupId>
         <artifactId>examples-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.examples</groupId>
diff --git a/deltaspike/examples/security-requested-page-after-login-cdi/pom.xml b/deltaspike/examples/security-requested-page-after-login-cdi/pom.xml
index 75a2117..75a9617 100644
--- a/deltaspike/examples/security-requested-page-after-login-cdi/pom.xml
+++ b/deltaspike/examples/security-requested-page-after-login-cdi/pom.xml
@@ -41,7 +41,7 @@
     <parent>
         <groupId>org.apache.deltaspike.examples</groupId>
         <artifactId>examples-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
     
     <artifactId>deltaspike-security-requested-page-after-login-cdi</artifactId>
diff --git a/deltaspike/examples/security-requested-page-after-login-picketlink/pom.xml b/deltaspike/examples/security-requested-page-after-login-picketlink/pom.xml
index e710611..d620877 100644
--- a/deltaspike/examples/security-requested-page-after-login-picketlink/pom.xml
+++ b/deltaspike/examples/security-requested-page-after-login-picketlink/pom.xml
@@ -41,7 +41,7 @@
     <parent>
         <groupId>org.apache.deltaspike.examples</groupId>
         <artifactId>examples-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>deltaspike-security-requested-page-after-login-picketlink</artifactId>
diff --git a/deltaspike/modules/bean-validation/api/pom.xml b/deltaspike/modules/bean-validation/api/pom.xml
index 8ca5785..6cd7461 100644
--- a/deltaspike/modules/bean-validation/api/pom.xml
+++ b/deltaspike/modules/bean-validation/api/pom.xml
@@ -23,7 +23,7 @@
 	<parent>
 		<groupId>org.apache.deltaspike.modules</groupId>
 		<artifactId>bean-validation-module-project</artifactId>
-		<version>1.9.0-SNAPSHOT</version>
+		<version>1.9.1-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>deltaspike-bean-validation-module-api</artifactId>
diff --git a/deltaspike/modules/bean-validation/impl/pom.xml b/deltaspike/modules/bean-validation/impl/pom.xml
index 45942ec..fba613c 100644
--- a/deltaspike/modules/bean-validation/impl/pom.xml
+++ b/deltaspike/modules/bean-validation/impl/pom.xml
@@ -23,7 +23,7 @@
 	<parent>
 		<groupId>org.apache.deltaspike.modules</groupId>
 		<artifactId>bean-validation-module-project</artifactId>
-		<version>1.9.0-SNAPSHOT</version>
+		<version>1.9.1-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>deltaspike-bean-validation-module-impl</artifactId>
diff --git a/deltaspike/modules/bean-validation/pom.xml b/deltaspike/modules/bean-validation/pom.xml
index 8ecc5b1..3cf252a 100644
--- a/deltaspike/modules/bean-validation/pom.xml
+++ b/deltaspike/modules/bean-validation/pom.xml
@@ -23,12 +23,12 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>modules-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
     <artifactId>bean-validation-module-project</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike BeanValidation-Module</name>
diff --git a/deltaspike/modules/data/api/pom.xml b/deltaspike/modules/data/api/pom.xml
index d3eafe5..9542848 100755
--- a/deltaspike/modules/data/api/pom.xml
+++ b/deltaspike/modules/data/api/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>data-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>deltaspike-data-module-api</artifactId>
diff --git a/deltaspike/modules/data/impl/pom.xml b/deltaspike/modules/data/impl/pom.xml
index 5f7b82a..264a9df 100755
--- a/deltaspike/modules/data/impl/pom.xml
+++ b/deltaspike/modules/data/impl/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>data-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>deltaspike-data-module-impl</artifactId>
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/QueryOperator.java b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/QueryOperator.java
index 2c84eb9..c032ace 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/QueryOperator.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/builder/QueryOperator.java
@@ -1,90 +1,98 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.deltaspike.data.impl.builder;
-
-/**
- * Comparison options for queries.
- */
-public enum QueryOperator
-{
-
-    LessThan("LessThan", "{0} < {1}"),
-    LessThanEquals("LessThanEquals", "{0} <= {1}"),
-    GreaterThan("GreaterThan", "{0} > {1}"),
-    GreaterThanEquals("GreaterThanEquals", "{0} >= {1}"),
-    Like("Like", "{0} like {1}"),
-    LikeIgnoreCase("LikeIgnoreCase", "upper({0}) like {1}", true),
-    NotEqual("NotEqual", "{0} <> {1}"),
-    NotEqualIgnoreCase("NotEqualIgnoreCase", "upper({0}) <> upper({1})"),
-    Equal("Equal", "{0} = {1}"),
-    EqualIgnoreCase("EqualIgnoreCase", "upper({0}) = upper({1})"),
-    IgnoreCase("IgnoreCase", "upper({0}) = upper({1})"),
-    Between("Between", "{0} between {1} and {2}", 2),
-    IsNotNull("IsNotNull", "{0} IS NOT NULL", 0),
-    IsNull("IsNull", "{0} IS NULL", 0);
-
-    private final String expression;
-    private final String jpql;
-    private final int paramNum;
-    private final boolean caseInsensitive;
-
-    private QueryOperator(String expression, String jpql)
-    {
-        this(expression, jpql, 1);
-    }
-
-    private QueryOperator(String expression, String jpql, boolean caseInsensitive)
-    {
-        this(expression, jpql, 1, caseInsensitive);
-    }
-
-    private QueryOperator(String expression, String jpql, int paramNum)
-    {
-        this(expression, jpql, paramNum, false);
-    }
-
-    private QueryOperator(String expression, String jpql, int paramNum, boolean caseInsensitive)
-    {
-        this.expression = expression;
-        this.jpql = jpql;
-        this.paramNum = paramNum;
-        this.caseInsensitive = caseInsensitive;
-    }
-
-    public String getExpression()
-    {
-        return expression;
-    }
-
-    public String getJpql()
-    {
-        return jpql;
-    }
-
-    public int getParamNum()
-    {
-        return paramNum;
-    }
-
-    public boolean isCaseInsensitive()
-    {
-        return caseInsensitive;
-    }
-
-}
+/*

+ * Licensed to the Apache Software Foundation (ASF) under one

+ * or more contributor license agreements. See the NOTICE file

+ * distributed with this work for additional information

+ * regarding copyright ownership. The ASF licenses this file

+ * to you under the Apache License, Version 2.0 (the

+ * "License"); you may not use this file except in compliance

+ * with the License. You may obtain a copy of the License at

+ *

+ * http://www.apache.org/licenses/LICENSE-2.0

+ *

+ * Unless required by applicable law or agreed to in writing,

+ * software distributed under the License is distributed on an

+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

+ * KIND, either express or implied. See the License for the

+ * specific language governing permissions and limitations

+ * under the License.

+ */

+package org.apache.deltaspike.data.impl.builder;

+

+/**

+ * Comparison options for queries.

+ */

+public enum QueryOperator

+{

+

+    LessThan("LessThan", "{0} < {1}"),

+    LessThanEquals("LessThanEquals", "{0} <= {1}"),

+    GreaterThan("GreaterThan", "{0} > {1}"),

+    GreaterThanEquals("GreaterThanEquals", "{0} >= {1}"),

+    NotLike("NotLike", "{0} not like {1}"),

+    Like("Like", "{0} like {1}"),

+    LikeIgnoreCase("LikeIgnoreCase", "upper({0}) like {1}", true),

+    NotEqual("NotEqual", "{0} <> {1}"),

+    NotEqualIgnoreCase("NotEqualIgnoreCase", "upper({0}) <> upper({1})"),

+    Equal("Equal", "{0} = {1}"),

+    EqualIgnoreCase("EqualIgnoreCase", "upper({0}) = upper({1})"),

+    IgnoreCase("IgnoreCase", "upper({0}) = upper({1})"),

+    Between("Between", "{0} between {1} and {2}", 2),

+    IsNotNull("IsNotNull", "{0} IS NOT NULL", 0),

+    IsNull("IsNull", "{0} IS NULL", 0),

+    NotIn("NotIn", "{0} NOT IN {1}"),

+    In("In", "{0} IN {1}"),

+    True("True", "{0} IS TRUE", 0),

+    False("False", "{0} IS FALSE", 0),

+    Containing("Containing", "{0} like CONCAT(''%'', CONCAT({1}, ''%''))"),

+    StartingWith("StartingWith", "{0} like CONCAT({1}, ''%'')"),

+    EndingWith("EndingWith", "{0} like CONCAT(''%'', {1})");

+

+    private final String expression;

+    private final String jpql;

+    private final int paramNum;

+    private final boolean caseInsensitive;

+

+    private QueryOperator(String expression, String jpql)

+    {

+        this(expression, jpql, 1);

+    }

+

+    private QueryOperator(String expression, String jpql, boolean caseInsensitive)

+    {

+        this(expression, jpql, 1, caseInsensitive);

+    }

+

+    private QueryOperator(String expression, String jpql, int paramNum)

+    {

+        this(expression, jpql, paramNum, false);

+    }

+

+    private QueryOperator(String expression, String jpql, int paramNum, boolean caseInsensitive)

+    {

+        this.expression = expression;

+        this.jpql = jpql;

+        this.paramNum = paramNum;

+        this.caseInsensitive = caseInsensitive;

+    }

+

+    public String getExpression()

+    {

+        return expression;

+    }

+

+    public String getJpql()

+    {

+        return jpql;

+    }

+

+    public int getParamNum()

+    {

+        return paramNum;

+    }

+

+    public boolean isCaseInsensitive()

+    {

+        return caseInsensitive;

+    }

+

+}

diff --git a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/builder/part/QueryRootTest.java b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/builder/part/QueryRootTest.java
index 9312203..c65aa0a 100644
--- a/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/builder/part/QueryRootTest.java
+++ b/deltaspike/modules/data/impl/src/test/java/org/apache/deltaspike/data/impl/builder/part/QueryRootTest.java
@@ -1,191 +1,543 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.deltaspike.data.impl.builder.part;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.deltaspike.data.impl.builder.MethodExpressionException;
-import org.apache.deltaspike.data.impl.meta.RepositoryMethodPrefix;
-import org.apache.deltaspike.data.impl.meta.EntityMetadata;
-import org.apache.deltaspike.data.impl.meta.RepositoryMetadata;
-import org.apache.deltaspike.data.test.domain.Simple;
-import org.apache.deltaspike.data.test.service.SimpleFetchRepository;
-import org.apache.deltaspike.data.test.service.SimpleRepository;
-import org.junit.Test;
-
-public class QueryRootTest
-{
-    private final RepositoryMetadata repo = new RepositoryMetadata(SimpleRepository.class, new EntityMetadata(Simple.class, "Simple", Long.class));
-    private final RepositoryMetadata repoFetchBy = new RepositoryMetadata(SimpleFetchRepository.class, new EntityMetadata(Simple.class, "Simple", Long.class));
-
-    @Test
-    public void should_create_simple_query()
-    {
-        // given
-        final String name = "findByName";
-        final String expected =
-                "select e from Simple e " +
-                        "where e.name = ?1";
-
-        // when
-        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();
-
-        // then
-        assertEquals(expected, result);
-    }
-
-    @Test
-    public void should_create_complex_query()
-    {
-        // given
-        final String name = "findByNameAndTemporalBetweenOrEnabledIsNull" +
-                "AndCamelCaseLikeIgnoreCaseAndEmbedded_embeddNotEqualIgnoreCase" +
-                "OrderByEmbedded_embeddDesc";
-        final String expected =
-                "select e from Simple e " +
-                        "where e.name = ?1 " +
-                        "and e.temporal between ?2 and ?3 " +
-                        "or e.enabled IS NULL " +
-                        "and upper(e.camelCase) like ?4 " +
-                        "and upper(e.embedded.embedd) <> upper(?5) " +
-                        "order by e.embedded.embedd desc";
-
-        // when
-        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();
-
-        // then
-        assertEquals(expected, result);
-    }
-
-    @Test
-    public void should_create_query_with_order_by_only()
-    {
-        // given
-        final String name = "findByOrderByIdAsc";
-        final String expected =
-                "select e from Simple e " +
-                        "order by e.id asc";
-
-        // when
-        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();
-
-        // then
-        assertEquals(expected, result);
-    }
-
-    @Test(expected = MethodExpressionException.class)
-    public void should_fail_in_where()
-    {
-        // given
-        final String name = "findByInvalid";
-
-        // when
-        QueryRoot.create(name, repo, prefix(name));
-    }
-
-    @Test(expected = MethodExpressionException.class)
-    public void should_fail_with_prefix_only()
-    {
-        // given
-        final String name = "findBy";
-
-        // when
-        QueryRoot.create(name, repo, prefix(name));
-    }
-
-    @Test(expected = MethodExpressionException.class)
-    public void should_fail_in_order_by()
-    {
-        // given
-        final String name = "findByNameOrderByInvalidDesc";
-
-        // when
-        QueryRoot.create(name, repo, prefix(name));
-    }
-
-    @Test
-    public void should_use_alternative_prefix()
-    {
-        // given
-        final String name = "fetchByName";
-        final String expected =
-                "select e from Simple e " +
-                        "where e.name = ?1";
-
-        // when
-        String result = QueryRoot.create(name, repoFetchBy, new RepositoryMethodPrefix("fetchBy", name)).getJpqlQuery().trim();
-
-        // then
-        assertEquals(expected, result);
-    }
-
-    @Test
-    public void should_create_delete_query_by_name()
-    {
-        // given
-        final String name = "deleteByName";
-        final String expected =
-                "delete from Simple e " +
-                        "where e.name = ?1";
-
-        // when
-        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();
-
-        // then
-        assertEquals(expected, result);
-    }
-
-    @Test
-    public void should_create_delete_query_by_name_and_enabled()
-    {
-        // given
-        final String name = "deleteByNameAndEnabled";
-        final String expected =
-                "delete from Simple e " +
-                        "where e.name = ?1 and e.enabled = ?2";
-
-        // when
-        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();
-
-        // then
-        assertEquals(expected, result);
-    }
-
-    @Test
-    public void should_apply_order_by_in_order()
-    {
-        // given
-        final String name = "findAllOrderByNameDescIdAsc";
-        final String expected =
-                "select e from Simple e " +
-                        "order by e.name desc, e.id asc";
-
-        // when
-        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();
-
-        // then
-        assertEquals(expected, result);
-    }
-
-    private RepositoryMethodPrefix prefix(final String name)
-    {
-        return new RepositoryMethodPrefix("", name);
-    }
-
-}
+/*

+ * Licensed to the Apache Software Foundation (ASF) under one

+ * or more contributor license agreements. See the NOTICE file

+ * distributed with this work for additional information

+ * regarding copyright ownership. The ASF licenses this file

+ * to you under the Apache License, Version 2.0 (the

+ * "License"); you may not use this file except in compliance

+ * with the License. You may obtain a copy of the License at

+ *

+ * http://www.apache.org/licenses/LICENSE-2.0

+ *

+ * Unless required by applicable law or agreed to in writing,

+ * software distributed under the License is distributed on an

+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

+ * KIND, either express or implied. See the License for the

+ * specific language governing permissions and limitations

+ * under the License.

+ */

+package org.apache.deltaspike.data.impl.builder.part;

+

+import org.apache.deltaspike.data.impl.builder.MethodExpressionException;

+import org.apache.deltaspike.data.impl.meta.EntityMetadata;

+import org.apache.deltaspike.data.impl.meta.RepositoryMetadata;

+import org.apache.deltaspike.data.impl.meta.RepositoryMethodPrefix;

+import org.apache.deltaspike.data.test.domain.Simple;

+import org.apache.deltaspike.data.test.service.SimpleFetchRepository;

+import org.apache.deltaspike.data.test.service.SimpleRepository;

+import org.junit.Test;

+

+import static org.junit.Assert.assertEquals;

+

+public class QueryRootTest

+{

+    private final RepositoryMetadata repo = new RepositoryMetadata(SimpleRepository.class, new EntityMetadata(Simple.class, "Simple", Long.class));

+    private final RepositoryMetadata repoFetchBy = new RepositoryMetadata(SimpleFetchRepository.class, new EntityMetadata(Simple.class, "Simple", Long.class));

+

+    @Test

+    public void should_create_simple_query()

+    {

+        // given

+        final String name = "findByName";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name = ?1";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_create_complex_query()

+    {

+        // given

+        final String name = "findByNameAndTemporalBetweenOrEnabledIsNull" +

+                "AndCamelCaseLikeIgnoreCaseAndEmbedded_embeddNotEqualIgnoreCase" +

+                "OrderByEmbedded_embeddDesc";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name = ?1 " +

+                        "and e.temporal between ?2 and ?3 " +

+                        "or e.enabled IS NULL " +

+                        "and upper(e.camelCase) like ?4 " +

+                        "and upper(e.embedded.embedd) <> upper(?5) " +

+                        "order by e.embedded.embedd desc";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_create_query_with_order_by_only()

+    {

+        // given

+        final String name = "findByOrderByIdAsc";

+        final String expected =

+                "select e from Simple e " +

+                        "order by e.id asc";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test(expected = MethodExpressionException.class)

+    public void should_fail_in_where()

+    {

+        // given

+        final String name = "findByInvalid";

+

+        // when

+        QueryRoot.create(name, repo, prefix(name));

+    }

+

+    @Test(expected = MethodExpressionException.class)

+    public void should_fail_with_prefix_only()

+    {

+        // given

+        final String name = "findBy";

+

+        // when

+        QueryRoot.create(name, repo, prefix(name));

+    }

+

+    @Test(expected = MethodExpressionException.class)

+    public void should_fail_in_order_by()

+    {

+        // given

+        final String name = "findByNameOrderByInvalidDesc";

+

+        // when

+        QueryRoot.create(name, repo, prefix(name));

+    }

+

+    @Test

+    public void should_use_alternative_prefix()

+    {

+        // given

+        final String name = "fetchByName";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name = ?1";

+

+        // when

+        String result = QueryRoot.create(name, repoFetchBy, new RepositoryMethodPrefix("fetchBy", name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_create_delete_query_by_name()

+    {

+        // given

+        final String name = "deleteByName";

+        final String expected =

+                "delete from Simple e " +

+                        "where e.name = ?1";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_create_delete_query_by_name_and_enabled()

+    {

+        // given

+        final String name = "deleteByNameAndEnabled";

+        final String expected =

+                "delete from Simple e " +

+                        "where e.name = ?1 and e.enabled = ?2";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_order_by_in_order()

+    {

+        // given

+        final String name = "findAllOrderByNameDescIdAsc";

+        final String expected =

+                "select e from Simple e " +

+                        "order by e.name desc, e.id asc";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_LessThan()

+    {

+        // given

+        final String name = "findByNameLessThan";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name < ?1";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_LessThanEquals()

+    {

+        // given

+        final String name = "findByNameLessThanEquals";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name <= ?1";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_GreaterThan()

+    {

+        // given

+        final String name = "findByNameGreaterThan";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name > ?1";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_GreaterThanEquals()

+    {

+        // given

+        final String name = "findByNameGreaterThanEquals";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name >= ?1";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_Like()

+    {

+        // given

+        final String name = "findByNameLike";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name like ?1";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_NotLike()

+    {

+        // given

+        final String name = "findByNameNotLike";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name not like ?1";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_LikeIgnoreCase()

+    {

+        // given

+        final String name = "findByNameLikeIgnoreCase";

+        final String expected =

+                "select e from Simple e " +

+                        "where upper(e.name) like ?1";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_NotEqual()

+    {

+        // given

+        final String name = "findByNameNotEqual";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name <> ?1";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_NotEqualIgnoreCase()

+    {

+        // given

+        final String name = "findByNameNotEqualIgnoreCase";

+        final String expected =

+                "select e from Simple e " +

+                        "where upper(e.name) <> upper(?1)";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_Equal()

+    {

+        // given

+        final String name = "findByNameEqual";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name = ?1";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_EqualIgnoreCase()

+    {

+        // given

+        final String name = "findByNameEqualIgnoreCase";

+        final String expected =

+                "select e from Simple e " +

+                        "where upper(e.name) = upper(?1)";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_IgnoreCase()

+    {

+        // given

+        final String name = "findByNameIgnoreCase";

+        final String expected =

+                "select e from Simple e " +

+                        "where upper(e.name) = upper(?1)";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_In()

+    {

+        // given

+        final String name = "findByNameIn";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name IN ?1";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_Between()

+    {

+        // given

+        final String name = "findByNameBetween";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name between ?1 and ?2";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_IsNotNull()

+    {

+        // given

+        final String name = "findByNameIsNotNull";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name IS NOT NULL";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_IsNull()

+    {

+        // given

+        final String name = "findByNameIsNull";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name IS NULL";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_NotIn()

+    {

+        // given

+        final String name = "findByNameNotIn";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name NOT IN ?1";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_True()

+    {

+        // given

+        final String name = "findByNameTrue";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name IS TRUE";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_False()

+    {

+        // given

+        final String name = "findByNameFalse";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name IS FALSE";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_Containing()

+    {

+        // given

+        final String name = "findByNameContaining";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name like CONCAT('%', CONCAT(?1, '%'))";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_StartingWith()

+    {

+        // given

+        final String name = "findByNameStartingWith";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name like CONCAT(?1, '%')";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    @Test

+    public void should_apply_comparator_EndingWith()

+    {

+        // given

+        final String name = "findByNameEndingWith";

+        final String expected =

+                "select e from Simple e " +

+                        "where e.name like CONCAT('%', ?1)";

+

+        // when

+        String result = QueryRoot.create(name, repo, prefix(name)).getJpqlQuery().trim();

+

+        // then

+        assertEquals(expected, result);

+    }

+

+    private RepositoryMethodPrefix prefix(final String name)

+    {

+        return new RepositoryMethodPrefix("", name);

+    }

+

+}

diff --git a/deltaspike/modules/data/pom.xml b/deltaspike/modules/data/pom.xml
index 08e6323..067ae14 100755
--- a/deltaspike/modules/data/pom.xml
+++ b/deltaspike/modules/data/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>modules-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>data-module-project</artifactId>
diff --git a/deltaspike/modules/data/test-ee7/pom.xml b/deltaspike/modules/data/test-ee7/pom.xml
index f89b099..db751a8 100644
--- a/deltaspike/modules/data/test-ee7/pom.xml
+++ b/deltaspike/modules/data/test-ee7/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>data-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>deltaspike-data-module-test-ee7</artifactId>
diff --git a/deltaspike/modules/jpa/api/pom.xml b/deltaspike/modules/jpa/api/pom.xml
index 74bbb5e..95b4669 100644
--- a/deltaspike/modules/jpa/api/pom.xml
+++ b/deltaspike/modules/jpa/api/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>jpa-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
diff --git a/deltaspike/modules/jpa/api/src/main/java/org/apache/deltaspike/jpa/api/entitymanager/PersistenceUnitName.java b/deltaspike/modules/jpa/api/src/main/java/org/apache/deltaspike/jpa/api/entitymanager/PersistenceUnitName.java
index 60d6625..dfcf0c9 100644
--- a/deltaspike/modules/jpa/api/src/main/java/org/apache/deltaspike/jpa/api/entitymanager/PersistenceUnitName.java
+++ b/deltaspike/modules/jpa/api/src/main/java/org/apache/deltaspike/jpa/api/entitymanager/PersistenceUnitName.java
@@ -33,6 +33,10 @@
 /**
  * The name of the PersistenceUnit to get picked up by the
  * EntityManagerFactoryProducer.
+ *
+ * The EntityManagerFactoryProducer will in turn use the
+ * {@link org.apache.deltaspike.jpa.spi.entitymanager.PersistenceConfigurationProvider}
+ * to pick up the properties to be used for creating the {@code }EntityManagerFactory}.
  */
 @Target( { TYPE, METHOD, PARAMETER, FIELD })
 @Retention(value = RetentionPolicy.RUNTIME)
diff --git a/deltaspike/modules/jpa/impl/pom.xml b/deltaspike/modules/jpa/impl/pom.xml
index 2326ccd..8846e13 100644
--- a/deltaspike/modules/jpa/impl/pom.xml
+++ b/deltaspike/modules/jpa/impl/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>jpa-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
diff --git a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/ManagedUserTransactionResolver.java b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/ManagedUserTransactionResolver.java
index d6657c0..9e55ad0 100644
--- a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/ManagedUserTransactionResolver.java
+++ b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/ManagedUserTransactionResolver.java
@@ -19,10 +19,12 @@
 package org.apache.deltaspike.jpa.impl.transaction;
 
 import javax.annotation.Resource;
+import javax.enterprise.context.Dependent;
 import javax.transaction.UserTransaction;
 
 //we need to keep it separated,
 //because the injection of UserTransaction might fail with an exception (see DELTASPIKE-986)
+@Dependent
 public class ManagedUserTransactionResolver
 {
     @Resource
diff --git a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/ResourceLocalTransactionStrategy.java b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/ResourceLocalTransactionStrategy.java
index 4c9cb7b..f21bd8c 100644
--- a/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/ResourceLocalTransactionStrategy.java
+++ b/deltaspike/modules/jpa/impl/src/main/java/org/apache/deltaspike/jpa/impl/transaction/ResourceLocalTransactionStrategy.java
@@ -92,7 +92,7 @@
         TransactionBeanStorage transactionBeanStorage = TransactionBeanStorage.getInstance();
 
         boolean isOutermostInterceptor = transactionBeanStorage.isEmpty();
-        boolean outermostTransactionAlreadyExisted = false;
+        boolean startedTransaction = false;
 
         if (isOutermostInterceptor)
         {
@@ -111,7 +111,6 @@
             for (Class<? extends Annotation> emQualifier : emQualifiers)
             {
                 EntityManager entityManager = resolveEntityManagerForQualifier(emQualifier);
-
                 EntityManagerEntry entityManagerEntry = createEntityManagerEntry(entityManager, emQualifier);
                 transactionBeanStorage.storeUsedEntityManager(entityManagerEntry);
 
@@ -121,10 +120,7 @@
                 {
                     beforeBegin(invocationContext, entityManagerEntry, transaction);
                     transaction.begin();
-                }
-                else if (isOutermostInterceptor)
-                {
-                    outermostTransactionAlreadyExisted = true;
+                    startedTransaction = true;
                 }
 
                 //don't move it before EntityTransaction#begin() and invoke it in any case
@@ -144,7 +140,7 @@
                 Set<EntityManagerEntry> entityManagerEntryList =
                     transactionBeanStorage.getUsedEntityManagerEntries();
 
-                if (!outermostTransactionAlreadyExisted)
+                if (startedTransaction)
                 {
                     // We only commit transactions we opened ourselfs.
                     // If the transaction got opened outside of our interceptor chain
@@ -177,7 +173,7 @@
             // In case of JTA we will just commit the UserTransaction.
             if (isOutermostInterceptor)
             {
-                if (!outermostTransactionAlreadyExisted)
+                if (startedTransaction)
                 {
                     // We only commit transactions we opened ourselfs.
                     // If the transaction got opened outside of our interceptor chain
diff --git a/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/shared/TestEntityManager.java b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/shared/TestEntityManager.java
index 343624b..aec822b 100644
--- a/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/shared/TestEntityManager.java
+++ b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/shared/TestEntityManager.java
@@ -243,7 +243,7 @@
     @Override
     public void joinTransaction()
     {
-        throw new IllegalStateException("not implemented");
+        // all fine, nothing to do
     }
 
     @Override
diff --git a/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/multipleinjection/manual/BeanManagedlTransactionTest.java b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/multipleinjection/manual/BeanManagedlTransactionTest.java
new file mode 100644
index 0000000..b6af93e
--- /dev/null
+++ b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/multipleinjection/manual/BeanManagedlTransactionTest.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.test.jpa.api.transactional.multipleinjection.manual;
+
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+import org.apache.deltaspike.core.util.ProjectStageProducer;
+import org.apache.deltaspike.jpa.impl.transaction.context.TransactionContextExtension;
+import org.apache.deltaspike.test.category.SeCategory;
+import org.apache.deltaspike.test.util.ArchiveUtils;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.Asset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+import javax.enterprise.inject.spi.Extension;
+import javax.inject.Inject;
+
+
+/**
+ * Same test as {@link ManualTransactionTest} but now with a UserTransaction instead
+ * of manual EM Tx.
+ */
+@RunWith(Arquillian.class)
+@Category(SeCategory.class)
+public class BeanManagedlTransactionTest
+{
+    private static Asset beansXml = new StringAsset(
+            "<beans>" +
+            "<alternatives>" +
+            "<class>org.apache.deltaspike.jpa.impl.transaction.BeanManagedUserTransactionStrategy</class>" +
+            "</alternatives>" +
+            "</beans>"
+    );
+
+
+    @Inject
+    private ManualTransactionBean manualTransactionBean;
+
+    @Inject
+    private MockUserTransactionResolver mockTxResolver;
+
+    @Deployment
+    public static WebArchive deploy()
+    {
+        JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "manualTransactionTest.jar")
+                .addPackage(ArchiveUtils.SHARED_PACKAGE)
+                .addPackage(BeanManagedlTransactionTest.class.getPackage().getName())
+                .addAsManifestResource(beansXml, "beans.xml");
+
+        return ShrinkWrap.create(WebArchive.class)
+                .addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndJpaArchive())
+                .addAsLibraries(testJar)
+                .addAsServiceProvider(Extension.class, TransactionContextExtension.class)
+                .addAsWebInfResource(ArchiveUtils.getBeansXml(), "beans.xml");
+    }
+
+    @Before
+    public void init()
+    {
+        ProjectStageProducer.setProjectStage(ProjectStage.UnitTest);
+    }
+
+    @Test
+    public void manualTransactionTest()
+    {
+
+        mockTxResolver.resetTx();
+        MockUserTransactionResolver.MockUserTransaction mockTx = mockTxResolver.resolveUserTransaction();
+        manualTransactionBean.executeInTransaction();
+
+        Assert.assertEquals(false, mockTx.isActive());
+        Assert.assertEquals(true, mockTx.isBegin());
+        Assert.assertEquals(true, mockTx.isCommit());
+        Assert.assertEquals(false, mockTx.isRollback());
+        Assert.assertEquals(false, mockTx.isRollBackOnly());
+    }
+}
diff --git a/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/multipleinjection/manual/ManualTransactionBean.java b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/multipleinjection/manual/ManualTransactionBean.java
index d88e095..85b0cb0 100644
--- a/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/multipleinjection/manual/ManualTransactionBean.java
+++ b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/multipleinjection/manual/ManualTransactionBean.java
@@ -53,4 +53,9 @@
     public void executeInSecondTransaction()
     {
     }
+
+    @Transactional
+    public void executeInTransaction()
+    {
+    }
 }
diff --git a/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/multipleinjection/manual/MockUserTransactionResolver.java b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/multipleinjection/manual/MockUserTransactionResolver.java
new file mode 100644
index 0000000..675c10e
--- /dev/null
+++ b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/multipleinjection/manual/MockUserTransactionResolver.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.test.jpa.api.transactional.multipleinjection.manual;
+
+import org.apache.deltaspike.jpa.impl.transaction.ManagedUserTransactionResolver;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Specializes;
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.NotSupportedException;
+import javax.transaction.RollbackException;
+import javax.transaction.Status;
+import javax.transaction.SystemException;
+import javax.transaction.UserTransaction;
+
+@Specializes
+@ApplicationScoped
+public class MockUserTransactionResolver extends ManagedUserTransactionResolver {
+
+    private MockUserTransaction mockTx;
+
+    @PostConstruct
+    public void resetTx() {
+        mockTx = new MockUserTransaction();
+    }
+
+    @Override
+    public MockUserTransaction resolveUserTransaction() {
+        return mockTx;
+    }
+
+    public static class MockUserTransaction implements UserTransaction {
+        private boolean begin = false;
+        private boolean commit = false;
+        private boolean rollback = false;
+        private boolean rollBackOnly =false;
+
+        private int status = Status.STATUS_NO_TRANSACTION;
+
+
+        @Override
+        public void begin() throws NotSupportedException, SystemException {
+            this.begin = true;
+            this.status = Status.STATUS_ACTIVE;
+        }
+
+        @Override
+        public void commit() throws HeuristicMixedException, HeuristicRollbackException, IllegalStateException, RollbackException, SecurityException, SystemException {
+            this.commit = true;
+            this.status = Status.STATUS_COMMITTED;
+        }
+
+        @Override
+        public int getStatus() throws SystemException {
+            return status;
+        }
+
+        @Override
+        public void rollback() throws IllegalStateException, SecurityException, SystemException {
+            this.rollback = true;
+            this.status = Status.STATUS_ROLLEDBACK;
+        }
+
+        @Override
+        public void setRollbackOnly() throws IllegalStateException, SystemException {
+            this.rollBackOnly = true;
+            this.status = Status.STATUS_MARKED_ROLLBACK;
+        }
+
+        @Override
+        public void setTransactionTimeout(int i) throws SystemException {
+            // do nothing
+        }
+
+        public boolean isActive()
+        {
+            return begin && !(commit || rollback);
+        }
+
+        public boolean isBegin() {
+            return begin;
+        }
+
+        public boolean isCommit() {
+            return commit;
+        }
+
+        public boolean isRollback() {
+            return rollback;
+        }
+
+        public boolean isRollBackOnly() {
+            return rollBackOnly;
+        }
+    }
+}
diff --git a/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/multipleinjection/manual/TestEntityManagerProducer.java b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/multipleinjection/manual/TestEntityManagerProducer.java
index 2328091..b88111f 100644
--- a/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/multipleinjection/manual/TestEntityManagerProducer.java
+++ b/deltaspike/modules/jpa/impl/src/test/java/org/apache/deltaspike/test/jpa/api/transactional/multipleinjection/manual/TestEntityManagerProducer.java
@@ -22,11 +22,12 @@
 import org.apache.deltaspike.test.jpa.api.shared.Second;
 import org.apache.deltaspike.test.jpa.api.shared.TestEntityManager;
 
+import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.inject.Produces;
 import javax.persistence.EntityManager;
 
-@RequestScoped
+@ApplicationScoped
 public class TestEntityManagerProducer
 {
     private TestEntityManager defaultEntityManager = new TestEntityManager();
@@ -36,12 +37,14 @@
     private TestEntityManager secondEntityManager = new TestEntityManager();
 
     @Produces
+    @RequestScoped
     protected EntityManager defaultEntityManager()
     {
         return defaultEntityManager;
     }
 
     @Produces
+    @RequestScoped
     @First
     protected EntityManager firstEntityManager()
     {
@@ -49,6 +52,7 @@
     }
 
     @Produces
+    @RequestScoped
     @Second
     protected EntityManager secondEntityManager()
     {
diff --git a/deltaspike/modules/jpa/pom.xml b/deltaspike/modules/jpa/pom.xml
index dacf77a..fa3b55c 100644
--- a/deltaspike/modules/jpa/pom.xml
+++ b/deltaspike/modules/jpa/pom.xml
@@ -23,12 +23,12 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>modules-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
     <artifactId>jpa-module-project</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike JPA-Module</name>
diff --git a/deltaspike/modules/jsf/api/pom.xml b/deltaspike/modules/jsf/api/pom.xml
index 5823489..501a77d 100644
--- a/deltaspike/modules/jsf/api/pom.xml
+++ b/deltaspike/modules/jsf/api/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>jsf-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
diff --git a/deltaspike/modules/jsf/impl-ee6/pom.xml b/deltaspike/modules/jsf/impl-ee6/pom.xml
index 27daaa2..c49c0d5 100644
--- a/deltaspike/modules/jsf/impl-ee6/pom.xml
+++ b/deltaspike/modules/jsf/impl-ee6/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>jsf-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>deltaspike-jsf-module-impl-ee6</artifactId>
diff --git a/deltaspike/modules/jsf/impl/pom.xml b/deltaspike/modules/jsf/impl/pom.xml
index 3bd24f2..61a3e5b 100644
--- a/deltaspike/modules/jsf/impl/pom.xml
+++ b/deltaspike/modules/jsf/impl/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>jsf-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/scope/mapped/MappedJsf2ScopeExtension.java b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/scope/mapped/MappedJsf2ScopeExtension.java
index 2f92d4c..854fb2a 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/scope/mapped/MappedJsf2ScopeExtension.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/scope/mapped/MappedJsf2ScopeExtension.java
@@ -53,17 +53,21 @@
      */
     public MappedJsf2ScopeExtension()
     {
-        this.mappedJsfScopes.put(javax.faces.bean.ApplicationScoped.class,
-                javax.enterprise.context.ApplicationScoped.class);
-        this.mappedJsfScopes.put(javax.faces.bean.SessionScoped.class,
-                javax.enterprise.context.SessionScoped.class);
-        this.mappedJsfScopes.put(javax.faces.bean.RequestScoped.class,
-                javax.enterprise.context.RequestScoped.class);
-
-        if (JsfUtils.isViewScopeDelegationEnabled())
+        // skip on JSF3.x
+        if (ClassUtils.tryToLoadClassForName("javax.faces.bean.ApplicationScoped") != null)
         {
-            this.mappedJsfScopes.put(javax.faces.bean.ViewScoped.class,
-                ClassUtils.tryToLoadClassForName("javax.faces.view.ViewScoped"));
+            this.mappedJsfScopes.put(javax.faces.bean.ApplicationScoped.class,
+                    javax.enterprise.context.ApplicationScoped.class);
+            this.mappedJsfScopes.put(javax.faces.bean.SessionScoped.class,
+                    javax.enterprise.context.SessionScoped.class);
+            this.mappedJsfScopes.put(javax.faces.bean.RequestScoped.class,
+                    javax.enterprise.context.RequestScoped.class);
+
+            if (JsfUtils.isViewScopeDelegationEnabled())
+            {
+                this.mappedJsfScopes.put(javax.faces.bean.ViewScoped.class,
+                    ClassUtils.tryToLoadClassForName("javax.faces.view.ViewScoped"));
+            }
         }
     }
 
diff --git a/deltaspike/modules/jsf/pom.xml b/deltaspike/modules/jsf/pom.xml
index e7c4f55..bdf54f7 100644
--- a/deltaspike/modules/jsf/pom.xml
+++ b/deltaspike/modules/jsf/pom.xml
@@ -23,12 +23,12 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>modules-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
     <artifactId>jsf-module-project</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike JSF-Module</name>
diff --git a/deltaspike/modules/partial-bean/api/pom.xml b/deltaspike/modules/partial-bean/api/pom.xml
index 0f7f7cc..7f9cd67 100644
--- a/deltaspike/modules/partial-bean/api/pom.xml
+++ b/deltaspike/modules/partial-bean/api/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>partial-bean-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
diff --git a/deltaspike/modules/partial-bean/impl/pom.xml b/deltaspike/modules/partial-bean/impl/pom.xml
index e0f8e88..9d91a8e 100644
--- a/deltaspike/modules/partial-bean/impl/pom.xml
+++ b/deltaspike/modules/partial-bean/impl/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>partial-bean-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
@@ -78,19 +78,19 @@
         <dependency>
             <groupId>org.ow2.asm</groupId>
             <artifactId>asm</artifactId>
-            <version>6.2</version>
+            <version>${asm.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.ow2.asm</groupId>
             <artifactId>asm-commons</artifactId>
-            <version>6.2</version>
+            <version>${asm.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.ow2.asm</groupId>
             <artifactId>asm-tree</artifactId>
-            <version>6.2</version>
+            <version>${asm.version}</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
diff --git a/deltaspike/modules/partial-bean/pom.xml b/deltaspike/modules/partial-bean/pom.xml
index f4fe547..c47d30e 100644
--- a/deltaspike/modules/partial-bean/pom.xml
+++ b/deltaspike/modules/partial-bean/pom.xml
@@ -23,12 +23,12 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>modules-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
     <artifactId>partial-bean-module-project</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike Partial-Bean-Module</name>
diff --git a/deltaspike/modules/pom.xml b/deltaspike/modules/pom.xml
index b275c00..45b27c6 100644
--- a/deltaspike/modules/pom.xml
+++ b/deltaspike/modules/pom.xml
@@ -23,13 +23,13 @@
     <parent>
         <groupId>org.apache.deltaspike</groupId>
         <artifactId>parent-code</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../parent/code/pom.xml</relativePath>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
     <artifactId>modules-project</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike Modules</name>
diff --git a/deltaspike/modules/proxy/api/pom.xml b/deltaspike/modules/proxy/api/pom.xml
index 4752056..6cd2e1e 100644
--- a/deltaspike/modules/proxy/api/pom.xml
+++ b/deltaspike/modules/proxy/api/pom.xml
@@ -23,7 +23,7 @@
 	<parent>
 		<groupId>org.apache.deltaspike.modules</groupId>
 		<artifactId>proxy-module-project</artifactId>
-		<version>1.9.0-SNAPSHOT</version>
+		<version>1.9.1-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>deltaspike-proxy-module-api</artifactId>
diff --git a/deltaspike/modules/proxy/impl-asm/pom.xml b/deltaspike/modules/proxy/impl-asm/pom.xml
index b204fce..c3df29e 100644
--- a/deltaspike/modules/proxy/impl-asm/pom.xml
+++ b/deltaspike/modules/proxy/impl-asm/pom.xml
@@ -23,7 +23,8 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>proxy-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
     </parent>
 
     <artifactId>deltaspike-proxy-module-impl-asm</artifactId>
@@ -104,19 +105,19 @@
         <dependency>
             <groupId>org.ow2.asm</groupId>
             <artifactId>asm</artifactId>
-            <version>6.2</version>
+            <version>${asm.version}</version>
             <optional>true</optional>
         </dependency>
         <dependency>
             <groupId>org.ow2.asm</groupId>
             <artifactId>asm-commons</artifactId>
-            <version>6.2</version>
+            <version>${asm.version}</version>
             <optional>true</optional>
         </dependency>
         <dependency>
             <groupId>org.ow2.asm</groupId>
             <artifactId>asm-tree</artifactId>
-            <version>6.2</version>
+            <version>${asm.version}</version>
             <optional>true</optional>
         </dependency>
 
diff --git a/deltaspike/modules/proxy/pom.xml b/deltaspike/modules/proxy/pom.xml
index 68645c1..29ba0eb 100644
--- a/deltaspike/modules/proxy/pom.xml
+++ b/deltaspike/modules/proxy/pom.xml
@@ -23,12 +23,12 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>modules-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
     <artifactId>proxy-module-project</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike Proxy-Module</name>
diff --git a/deltaspike/modules/scheduler/api/pom.xml b/deltaspike/modules/scheduler/api/pom.xml
index 2b9a0ec..eb3961a 100644
--- a/deltaspike/modules/scheduler/api/pom.xml
+++ b/deltaspike/modules/scheduler/api/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>scheduler-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
diff --git a/deltaspike/modules/scheduler/api/src/main/java/org/apache/deltaspike/scheduler/spi/SchedulerControl.java b/deltaspike/modules/scheduler/api/src/main/java/org/apache/deltaspike/scheduler/spi/SchedulerControl.java
new file mode 100644
index 0000000..1c6f0a0
--- /dev/null
+++ b/deltaspike/modules/scheduler/api/src/main/java/org/apache/deltaspike/scheduler/spi/SchedulerControl.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.scheduler.spi;
+
+/**
+ * This interface provides high-level controls for the scheduler.
+ *
+ * It allows to control the scheduler as a whole ({@link #isSchedulerEnabled()}()) and on a per-job basis
+ * ({@link #vetoJobExecution(Class)}.
+ *
+ * The interface is meant to be implemented by a CDI bean.
+ */
+public interface SchedulerControl
+{
+    /**
+     * Control whether or not the scheduler should be started.
+     *
+     * @return if {@code true} the scheduler will be started, else not.
+     */
+    default boolean isSchedulerEnabled()
+    {
+        return true;
+    }
+
+    /**
+     * Invoked each time a job is triggered, this controls whether the given job shall be started or not.
+     *
+     * NOTE: This only applies if the scheduler is actually running (see {@link #isSchedulerEnabled()}).
+     *
+     *  @param jobClass the job which was triggered
+     * @return if {@code false} the job will be executed, else not.
+     */
+    default boolean vetoJobExecution(Class<?> jobClass)
+    {
+        return false;
+    }
+}
diff --git a/deltaspike/modules/scheduler/impl/pom.xml b/deltaspike/modules/scheduler/impl/pom.xml
index 1fa8c0b..7a0cbce 100644
--- a/deltaspike/modules/scheduler/impl/pom.xml
+++ b/deltaspike/modules/scheduler/impl/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>scheduler-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
diff --git a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/AbstractJobAdapter.java b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/AbstractJobAdapter.java
new file mode 100644
index 0000000..7180c1c
--- /dev/null
+++ b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/AbstractJobAdapter.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.scheduler.impl;
+
+import org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent;
+import org.apache.deltaspike.core.api.provider.BeanProvider;
+import org.apache.deltaspike.core.util.ClassUtils;
+import org.apache.deltaspike.core.util.ProxyUtils;
+import org.apache.deltaspike.scheduler.spi.SchedulerControl;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.inject.Inject;
+import java.util.logging.Logger;
+
+public abstract class AbstractJobAdapter<T> implements Job
+{
+    private static final Logger LOG = Logger.getLogger(AbstractJobAdapter.class.getName());
+
+    @Inject
+    private BeanManager beanManager;
+
+    @Override
+    public void execute(JobExecutionContext context)
+    {
+        Class<? extends T> jobClass =
+                ClassUtils.tryToLoadClassForName(context.getJobDetail().getKey().getName(), getJobBaseClass());
+
+        SchedulerControl schedulerControl = BeanProvider.getContextualReference(SchedulerControl.class, true);
+        if (schedulerControl != null && schedulerControl.vetoJobExecution(jobClass))
+        {
+            LOG.info("Execution of job " + jobClass + " has been vetoed by " +
+                    ProxyUtils.getUnproxiedClass(schedulerControl.getClass()));
+            return;
+        }
+
+        T job = BeanProvider.getContextualReference(jobClass);
+
+        try
+        {
+            execute(job, context);
+        }
+        catch (Throwable t)
+        {
+            //just in this case to reduce the implementation(s) of runnable (annotated with @Scheduled)
+            //to an absolute minimum.
+            //(custom implementations of org.quartz.Job need to do it on their own)
+            this.beanManager.fireEvent(new ExceptionToCatchEvent(t));
+        }
+    }
+
+    protected abstract Class<T> getJobBaseClass();
+
+    public abstract void execute(T job, JobExecutionContext context) throws JobExecutionException;
+}
diff --git a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/JobAdapter.java b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/JobAdapter.java
new file mode 100644
index 0000000..5cc8be7
--- /dev/null
+++ b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/JobAdapter.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.deltaspike.scheduler.impl;
+
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+
+import javax.enterprise.inject.Typed;
+
+//configured via SchedulerBaseConfig
+@Typed()
+public class JobAdapter extends AbstractJobAdapter<Job>
+{
+    @Override
+    protected Class<Job> getJobBaseClass()
+    {
+        return Job.class;
+    }
+
+    @Override
+    public void execute(Job job, JobExecutionContext context) throws JobExecutionException
+    {
+        job.execute(context);
+    }
+}
diff --git a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/JobQuartzScheduler.java b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/JobQuartzScheduler.java
index 785026e..bb88295 100644
--- a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/JobQuartzScheduler.java
+++ b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/JobQuartzScheduler.java
@@ -24,8 +24,14 @@
 public class JobQuartzScheduler extends AbstractQuartzScheduler<Job>
 {
     @Override
+    protected String getJobName(Class<?> jobClass)
+    {
+        return jobClass.getName();
+    }
+
+    @Override
     protected Class<? extends Job> createFinalJobClass(Class<? extends Job> jobClass)
     {
-        return jobClass;
+        return JobAdapter.class;
     }
 }
diff --git a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/JobRunnableAdapter.java b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/JobRunnableAdapter.java
index 7891fb2..4c75bef 100644
--- a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/JobRunnableAdapter.java
+++ b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/JobRunnableAdapter.java
@@ -18,42 +18,23 @@
  */
 package org.apache.deltaspike.scheduler.impl;
 
-import org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent;
-import org.apache.deltaspike.core.api.provider.BeanProvider;
-import org.apache.deltaspike.core.util.ClassUtils;
-import org.quartz.Job;
 import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
 
 import javax.enterprise.inject.Typed;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.inject.Inject;
 
 //configured via SchedulerBaseConfig
 @Typed()
-public class JobRunnableAdapter implements Job
+public class JobRunnableAdapter extends AbstractJobAdapter<Runnable>
 {
-    @Inject
-    private BeanManager beanManager;
+    @Override
+    protected Class<Runnable> getJobBaseClass()
+    {
+        return Runnable.class;
+    }
 
     @Override
-    public void execute(JobExecutionContext context) throws JobExecutionException
+    public void execute(Runnable job, JobExecutionContext context)
     {
-        Class<? extends Runnable> jobClass =
-            ClassUtils.tryToLoadClassForName(context.getJobDetail().getKey().getName(), Runnable.class);
-
-        Runnable runnableBean = BeanProvider.getContextualReference(jobClass);
-
-        try
-        {
-            runnableBean.run();
-        }
-        catch (Throwable t)
-        {
-            //just in this case to reduce the implementation(s) of runnable (annotated with @Scheduled)
-            //to an absolute minimum.
-            //(custom implementations of org.quartz.Job need to do it on their own)
-            this.beanManager.fireEvent(new ExceptionToCatchEvent(t));
-        }
+        job.run();
     }
 }
diff --git a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/SchedulerExtension.java b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/SchedulerExtension.java
index 6bb5790..f96b665 100644
--- a/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/SchedulerExtension.java
+++ b/deltaspike/modules/scheduler/impl/src/main/java/org/apache/deltaspike/scheduler/impl/SchedulerExtension.java
@@ -18,20 +18,18 @@
  */
 package org.apache.deltaspike.scheduler.impl;
 
+import org.apache.deltaspike.core.api.provider.BeanProvider;
 import org.apache.deltaspike.core.spi.activation.Deactivatable;
 import org.apache.deltaspike.core.util.ClassDeactivationUtils;
 import org.apache.deltaspike.core.util.ClassUtils;
+import org.apache.deltaspike.core.util.ProxyUtils;
 import org.apache.deltaspike.core.util.ServiceUtils;
 import org.apache.deltaspike.scheduler.api.Scheduled;
+import org.apache.deltaspike.scheduler.spi.SchedulerControl;
 import org.apache.deltaspike.scheduler.spi.Scheduler;
 
 import javax.enterprise.event.Observes;
-import javax.enterprise.inject.spi.AfterBeanDiscovery;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.BeforeBeanDiscovery;
-import javax.enterprise.inject.spi.BeforeShutdown;
-import javax.enterprise.inject.spi.Extension;
-import javax.enterprise.inject.spi.ProcessAnnotatedType;
+import javax.enterprise.inject.spi.*;
 
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
@@ -111,7 +109,7 @@
         return classNamesToVeto.contains(beanClass.getName());
     }
 
-    public <X> void scheduleJobs(@Observes AfterBeanDiscovery afterBeanDiscovery, BeanManager beanManager)
+    public <X> void validateJobs(@Observes AfterBeanDiscovery afterBeanDiscovery, BeanManager beanManager)
     {
         if (!this.isActivated)
         {
@@ -130,7 +128,23 @@
             return;
         }
 
-        initScheduler(afterBeanDiscovery);
+    }
+
+    public <X> void scheduleJobs(@Observes AfterDeploymentValidation afterDeploymentValidation, BeanManager beanManager)
+    {
+        if (!this.isActivated)
+        {
+            return;
+        }
+
+        SchedulerControl schedulerControl = BeanProvider.getContextualReference(SchedulerControl.class, true);
+        if (schedulerControl != null && !schedulerControl.isSchedulerEnabled())
+        {
+            LOG.info("Scheduler has been disabled by " + ProxyUtils.getUnproxiedClass(schedulerControl.getClass()));
+            return;
+        }
+
+        initScheduler(afterDeploymentValidation);
 
         if (this.scheduler == null)
         {
@@ -144,7 +158,7 @@
         {
             if (foundJobNames.contains(jobClass.getSimpleName()))
             {
-                afterBeanDiscovery.addDefinitionError(
+                afterDeploymentValidation.addDeploymentProblem(
                     new IllegalStateException("Multiple Job-Classes found with name " + jobClass.getSimpleName()));
             }
 
@@ -204,7 +218,7 @@
         }
     }
 
-    private void initScheduler(AfterBeanDiscovery afterBeanDiscovery)
+    private void initScheduler(AfterDeploymentValidation afterDeploymentValidation)
     {
         List<Scheduler> availableSchedulers = ServiceUtils.loadServiceImplementations(Scheduler.class, true);
 
@@ -218,7 +232,7 @@
             }
             catch (Throwable t)
             {
-                afterBeanDiscovery.addDefinitionError(t);
+                afterDeploymentValidation.addDeploymentProblem(t);
             }
         }
         else if (!this.foundManagedJobClasses.isEmpty())
diff --git a/deltaspike/modules/scheduler/pom.xml b/deltaspike/modules/scheduler/pom.xml
index 0ba4f2a..5b67f5d 100644
--- a/deltaspike/modules/scheduler/pom.xml
+++ b/deltaspike/modules/scheduler/pom.xml
@@ -23,12 +23,12 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>modules-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
     <artifactId>scheduler-module-project</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike Scheduler-Module</name>
diff --git a/deltaspike/modules/security/api/pom.xml b/deltaspike/modules/security/api/pom.xml
index 5881a34..de16a54 100644
--- a/deltaspike/modules/security/api/pom.xml
+++ b/deltaspike/modules/security/api/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>security-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
diff --git a/deltaspike/modules/security/impl/pom.xml b/deltaspike/modules/security/impl/pom.xml
index 2366197..247eb36 100644
--- a/deltaspike/modules/security/impl/pom.xml
+++ b/deltaspike/modules/security/impl/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>security-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
diff --git a/deltaspike/modules/security/pom.xml b/deltaspike/modules/security/pom.xml
index 324c8a3..b2f1c5e 100644
--- a/deltaspike/modules/security/pom.xml
+++ b/deltaspike/modules/security/pom.xml
@@ -23,12 +23,12 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>modules-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
     <artifactId>security-module-project</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike Security-Module</name>
diff --git a/deltaspike/modules/servlet/api/pom.xml b/deltaspike/modules/servlet/api/pom.xml
index 6f94b00..12255db 100644
--- a/deltaspike/modules/servlet/api/pom.xml
+++ b/deltaspike/modules/servlet/api/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>servlet-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>deltaspike-servlet-module-api</artifactId>
diff --git a/deltaspike/modules/servlet/impl/pom.xml b/deltaspike/modules/servlet/impl/pom.xml
index a778d20..05692d2 100644
--- a/deltaspike/modules/servlet/impl/pom.xml
+++ b/deltaspike/modules/servlet/impl/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>servlet-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <artifactId>deltaspike-servlet-module-impl</artifactId>
diff --git a/deltaspike/modules/servlet/pom.xml b/deltaspike/modules/servlet/pom.xml
index 20a4741..3a7dc12 100644
--- a/deltaspike/modules/servlet/pom.xml
+++ b/deltaspike/modules/servlet/pom.xml
@@ -23,12 +23,12 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>modules-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
     <artifactId>servlet-module-project</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike Servlet-Module</name>
diff --git a/deltaspike/modules/test-control/api/pom.xml b/deltaspike/modules/test-control/api/pom.xml
index b1aa250..5dd5711 100644
--- a/deltaspike/modules/test-control/api/pom.xml
+++ b/deltaspike/modules/test-control/api/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>test-control-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
diff --git a/deltaspike/modules/test-control/api/src/main/java/org/apache/deltaspike/testcontrol/api/junit/CdiTestRunner.java b/deltaspike/modules/test-control/api/src/main/java/org/apache/deltaspike/testcontrol/api/junit/CdiTestRunner.java
index 11be0d4..70ec6e5 100644
--- a/deltaspike/modules/test-control/api/src/main/java/org/apache/deltaspike/testcontrol/api/junit/CdiTestRunner.java
+++ b/deltaspike/modules/test-control/api/src/main/java/org/apache/deltaspike/testcontrol/api/junit/CdiTestRunner.java
@@ -64,6 +64,8 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import static java.lang.Boolean.TRUE;
+
 /**
  * A JUnit test runner to start up with a CDI or embedded JavaEE container.
  *
@@ -132,16 +134,27 @@
     @Override
     public void run(RunNotifier runNotifier)
     {
-        if (!CdiTestSuiteRunner.isContainerStarted()) //not called as a part of a test-suite
+        try
         {
-            int identityHashCode = System.identityHashCode(runNotifier);
-            if (!notifierIdentities.contains(identityHashCode))
-            {
-                addLogRunListener(runNotifier, identityHashCode);
-            }
-        }
+            CdiTestSuiteRunner.getCdiTestRunnerExecutionRef().set(TRUE);
 
-        super.run(runNotifier);
+            if (!CdiTestSuiteRunner.isContainerStarted()) //not called as a part of a test-suite
+            {
+                int identityHashCode = System.identityHashCode(runNotifier);
+                if (!notifierIdentities.contains(identityHashCode))
+                {
+                    addLogRunListener(runNotifier, identityHashCode);
+                }
+            }
+
+            super.run(runNotifier);
+
+        }
+        finally
+        {
+            CdiTestSuiteRunner.getCdiTestRunnerExecutionRef().set(null);
+            CdiTestSuiteRunner.getCdiTestRunnerExecutionRef().remove();
+        }
     }
 
     private static synchronized void addLogRunListener(RunNotifier notifier, int identityHashCode)
@@ -608,8 +621,8 @@
                 setCurrentTestMethod(null);
                 ProjectStageProducer.setProjectStage(previousProjectStage);
                 previousProjectStage = null;
-                currentTestRunner.remove();
                 currentTestRunner.set(null);
+                currentTestRunner.remove();
             }
         }
 
@@ -626,7 +639,7 @@
         {
             try
             {
-                automaticScopeHandlingActive.set(Boolean.TRUE);
+                automaticScopeHandlingActive.set(TRUE);
 
                 ContextControl contextControl = container.getContextControl();
 
@@ -700,8 +713,8 @@
             }
             finally
             {
-                automaticScopeHandlingActive.remove();
                 automaticScopeHandlingActive.set(null);
+                automaticScopeHandlingActive.remove();
             }
         }
 
@@ -745,7 +758,7 @@
         {
             try
             {
-                automaticScopeHandlingActive.set(Boolean.TRUE);
+                automaticScopeHandlingActive.set(TRUE);
 
                 while (!this.startedScopes.empty())
                 {
diff --git a/deltaspike/modules/test-control/api/src/main/java/org/apache/deltaspike/testcontrol/api/junit/CdiTestSuiteRunner.java b/deltaspike/modules/test-control/api/src/main/java/org/apache/deltaspike/testcontrol/api/junit/CdiTestSuiteRunner.java
index 5a31765..40fdbc4 100644
--- a/deltaspike/modules/test-control/api/src/main/java/org/apache/deltaspike/testcontrol/api/junit/CdiTestSuiteRunner.java
+++ b/deltaspike/modules/test-control/api/src/main/java/org/apache/deltaspike/testcontrol/api/junit/CdiTestSuiteRunner.java
@@ -45,6 +45,8 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import static java.lang.Boolean.TRUE;
+
 @SuppressWarnings("UnusedDeclaration")
 public class CdiTestSuiteRunner extends Suite
 {
@@ -66,6 +68,8 @@
 
     private static final boolean STOP_CONTAINER;
 
+    private static final ThreadLocal<Boolean> IS_CDI_TEST_RUNNER_EXECUTION = new ThreadLocal<Boolean>();
+
     private static volatile boolean containerStarted; //TODO
 
     private final Class<?> testSuiteClass;
@@ -145,6 +149,11 @@
         return STOP_CONTAINER;
     }
 
+    static ThreadLocal<Boolean> getCdiTestRunnerExecutionRef()
+    {
+        return IS_CDI_TEST_RUNNER_EXECUTION;
+    }
+
     static void setContainerStarted(boolean containerStarted)
     {
         CdiTestSuiteRunner.containerStarted = containerStarted;
@@ -164,7 +173,11 @@
             Level level = this.logger.getLevel();
 
             this.logger.setLevel(Level.INFO);
-            this.logger.info("[run] " + description.getClassName() + "#" + description.getMethodName());
+            if (TRUE.equals(IS_CDI_TEST_RUNNER_EXECUTION.get()))
+            {
+                this.logger.info("[run] " + description.getClassName() + "#" + description.getMethodName());
+            }
+
             try
             {
                 super.testRunStarted(description);
@@ -181,7 +194,12 @@
             Level level = this.logger.getLevel();
 
             this.logger.setLevel(Level.INFO);
-            this.logger.info("[finished] " + description.getClassName() + "#" + description.getMethodName());
+
+            if (TRUE.equals(IS_CDI_TEST_RUNNER_EXECUTION.get()))
+            {
+                this.logger.info("[finished] " + description.getClassName() + "#" + description.getMethodName());
+            }
+
             try
             {
                 super.testFinished(description);
@@ -198,9 +216,14 @@
             Level level = this.logger.getLevel();
 
             this.logger.setLevel(Level.INFO);
-            Description description = failure.getDescription();
-            this.logger.info("[failed] " + description.getClassName() + "#" + description.getMethodName() +
+
+            if (TRUE.equals(IS_CDI_TEST_RUNNER_EXECUTION.get()))
+            {
+                Description description = failure.getDescription();
+                this.logger.info("[failed] " + description.getClassName() + "#" + description.getMethodName() +
                     " message: " + failure.getMessage());
+            }
+
             try
             {
                 super.testFailure(failure);
diff --git a/deltaspike/modules/test-control/impl/pom.xml b/deltaspike/modules/test-control/impl/pom.xml
index a8b7c55..b040940 100644
--- a/deltaspike/modules/test-control/impl/pom.xml
+++ b/deltaspike/modules/test-control/impl/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>test-control-module-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
@@ -116,7 +116,7 @@
         <dependency>
             <groupId>org.apache.deltaspike.core</groupId>
             <artifactId>deltaspike-core-impl</artifactId>
-            <scope>test</scope>
+            <scope>runtime</scope>
         </dependency>
     </dependencies>
 
diff --git a/deltaspike/modules/test-control/pom.xml b/deltaspike/modules/test-control/pom.xml
index 99a9419..2e53699 100644
--- a/deltaspike/modules/test-control/pom.xml
+++ b/deltaspike/modules/test-control/pom.xml
@@ -23,12 +23,12 @@
     <parent>
         <groupId>org.apache.deltaspike.modules</groupId>
         <artifactId>modules-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.deltaspike.modules</groupId>
     <artifactId>test-control-module-project</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike Test-Control-Module</name>
diff --git a/deltaspike/parent/code/pom.xml b/deltaspike/parent/code/pom.xml
index 64fd24a..9d7e9b5 100644
--- a/deltaspike/parent/code/pom.xml
+++ b/deltaspike/parent/code/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike</groupId>
         <artifactId>parent</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
diff --git a/deltaspike/parent/pom.xml b/deltaspike/parent/pom.xml
index 0f20d42..2c110d0 100644
--- a/deltaspike/parent/pom.xml
+++ b/deltaspike/parent/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike</groupId>
         <artifactId>deltaspike-project</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
@@ -72,6 +72,9 @@
         <myfaces1.version>1.2.8</myfaces1.version>
         <mojarra1.version>1.2_14</mojarra1.version>
 
+        <!-- used for some bytecode proxy stuff. Shaded in -->
+        <asm.version>7.0</asm.version>
+
         <!-- Geronimo specs -->
         <geronimo-annotation_1.2_spec.version>1.0</geronimo-annotation_1.2_spec.version>
         <geronimo-annotation_1.3_spec.version>1.0</geronimo-annotation_1.3_spec.version>
@@ -138,7 +141,7 @@
         <!-- validator related -->
         <hibernate.validator.version>4.3.1.Final</hibernate.validator.version>
         <bval.version>0.5</bval.version>
-        
+
         <!-- Versions of common dependencies within Weld profiles -->
         <weld.el.api>2.2</weld.el.api>
         <weld.sfl4j>1.7.2</weld.sfl4j>
diff --git a/deltaspike/pom.xml b/deltaspike/pom.xml
index e3ddf55..956e5e2 100644
--- a/deltaspike/pom.xml
+++ b/deltaspike/pom.xml
@@ -42,7 +42,7 @@
     <parent>
         <groupId>org.apache.deltaspike</groupId>
         <artifactId>deltaspike</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
@@ -56,7 +56,7 @@
     -->
     <groupId>org.apache.deltaspike</groupId>
     <artifactId>deltaspike-project</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike Sources</name>
@@ -172,30 +172,25 @@
                 </plugin>
             </plugins>
         </pluginManagement>
+
+        <plugins>
+            <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
     </build>
 
     <profiles>
         <profile>
-            <id>rat</id>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.apache.rat</groupId>
-                        <artifactId>apache-rat-plugin</artifactId>
-                        <executions>
-                            <execution>
-                                <phase>validate</phase>
-                                <goals>
-                                    <goal>check</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-
-        <profile>
             <!-- It disables javadoc doclint for JDK > 8 -->
             <id>javadoc-xdoclint-disable-jdk8+</id>
             <activation>
diff --git a/deltaspike/test-utils/pom.xml b/deltaspike/test-utils/pom.xml
index 27d5d8b..f3c9afe 100644
--- a/deltaspike/test-utils/pom.xml
+++ b/deltaspike/test-utils/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.deltaspike</groupId>
         <artifactId>parent</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../parent/pom.xml</relativePath>
     </parent>
 
diff --git a/documentation/pom.xml b/documentation/pom.xml
index c39bc0a..d7fb4dd 100644
--- a/documentation/pom.xml
+++ b/documentation/pom.xml
@@ -24,13 +24,13 @@
     <parent>
         <groupId>org.apache.deltaspike</groupId>
         <artifactId>deltaspike</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
     <groupId>org.apache.deltaspike</groupId>
     <artifactId>deltaspike-documentation</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike Documentation</name>
diff --git a/documentation/src/main/asciidoc/core.adoc b/documentation/src/main/asciidoc/core.adoc
index 9fd5dce..94fc16d 100644
--- a/documentation/src/main/asciidoc/core.adoc
+++ b/documentation/src/main/asciidoc/core.adoc
@@ -639,7 +639,7 @@
 [source,java]
 ----------------------------------------
 @Inject
-@InjectableResource("myfile.properties")
+@InjectableResource(location="myfile.properties")
 private InputStream inputStream;
 ----------------------------------------
 
diff --git a/documentation/src/main/asciidoc/data.adoc b/documentation/src/main/asciidoc/data.adoc
index dd3d0e2..5ea0ed5 100644
--- a/documentation/src/main/asciidoc/data.adoc
+++ b/documentation/src/main/asciidoc/data.adoc
@@ -1,1536 +1,1550 @@
-:moduledeps: core, jpa, partial-bean
-
-= Data Module
-
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
-== Overview
-The Data module provides capabilities for implementing repository patterns and thereby simplifying the repository layer. Repository patterns are ideal for simple queries that require boilerplate code, enabling centralization of query logic and consequently reducing code duplication and improving testability.
-
-The code sample below gives you a quick overview on the common usage
-scenarios of the data module:
-
-[source,java]
-----------------------------------------------------------------------------------
-@Repository
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    List<Person> findByAgeBetweenAndGender(int minAge, int maxAge, Gender gender);
-
-    @Query("select p from Person p where p.ssn = ?1")
-    Person findBySSN(String ssn);
-
-    @Query(named=Person.BY_FULL_NAME)
-    Person findByFullName(String firstName, String lastName);
-
-}
-----------------------------------------------------------------------------------
-
-As you see in the sample, there are several usage scenarios outlined
-here:
-
-* Declare a method which executes a query by simply translating its name
-and parameters into a query.
-* Declare a method which automatically executes a given JPQL query
-string with parameters.
-* Declare a method which automatically executes a named query with
-parameters.
-
-The implementation of the method is done automatically by the CDI
-extension. A client can declare a dependency to the interface only. The
-details on how to use those features are outlined in the following
-chapters.
-
-== Project Setup
-
-The configuration information provided here is for Maven-based projects and it assumes that you have already declared the DeltaSpike version and DeltaSpike Core module for your projects, as detailed in <<configure#, Configure DeltaSpike in Your Projects>>. For Maven-independent projects, see <<configure#config-maven-indep,Configure DeltaSpike in Maven-independent Projects>>.
-
-=== 1. Declare Data Module Dependencies
-
-Add the Data module to the list of dependencies in the project `pom.xml` file using this code snippet:
-
-[source,xml]
-----
-<dependency>
-    <groupId>org.apache.deltaspike.modules</groupId>
-    <artifactId>deltaspike-data-module-api</artifactId>
-    <version>${deltaspike.version}</version>
-    <scope>compile</scope>
-</dependency>
-
-<dependency>
-    <groupId>org.apache.deltaspike.modules</groupId>
-    <artifactId>deltaspike-data-module-impl</artifactId>
-    <version>${deltaspike.version}</version>
-    <scope>runtime</scope>
-</dependency>
-----
-
-Or if you're using Gradle, add these dependencies to your `build.gradle`:
-
-[source]
-----
-     runtime 'org.apache.deltaspike.modules:deltaspike-data-module-impl'
-     compile 'org.apache.deltaspike.modules:deltaspike-data-module-api'
-----
-
-=== 2. Complete Additional Java Environment Configuration
-
-The Data module requires a JPA implementation to be available in the Java environment where your projects are deployed.
-
-The simplest way using the DeltaSpike Data module is to run your
-application in a Java EE container supporting at least the Java EE6 Web
-Profile. Other configurations like running it inside Tomcat or even a
-Java SE application should be possible - you need to include a JPA
-provider as well as a CDI container to your application manually.
-
-As of DeltaSpike v1.4.0, the Data module internally leverages the Proxy module, which wraps ASM 5.  No external
-dependencies required, and now we have full support for interceptors on partial beans.
-
-=== 3. Complete Additional Project Configuration
-
-DeltaSpike Data requires an `EntityManager` exposed via a CDI producer -
-which is common practice in Java EE6 applications.
-
-[source,java]
-------------------------------------------------------
-public class EntityManagerProducer
-{
-    @PersistenceUnit
-    private EntityManagerFactory emf;
-
-    @Produces // you can also make this @RequestScoped
-    public EntityManager create()
-    {
-        return emf.createEntityManager();
-    }
-
-    public void close(@Disposes EntityManager em)
-    {
-        if (em.isOpen())
-        {
-            em.close();
-        }
-    }
-}
-------------------------------------------------------
-
-This allows the `EntityManager` to be injected over CDI instead of only
-being used with a `@PersistenceContext` annotation. Using multiple
-`EntityManager` is explored in more detail in a following section.
-
-If you use a JTA DataSource with your `EntityManager`, you also have to
-configure the `TransactionStrategy` your repositories use. Adapt your
-`beans.xml` for this:
-
-[source,xml]
-----
-<beans>
-    <alternatives>
-        <class>org.apache.deltaspike.jpa.impl.transaction.BeanManagedUserTransactionStrategy</class>
-    </alternatives>
-</beans>
-----
-
-IMPORTANT: Using the DeltaSpike Data module in an EAR deployment is currently restricted to
-annotation-based entities.
-
-== Core Concepts
-
-=== Repositories
-
-With the DeltaSpike Data module, it is possible to make a repository out
-of basically any abstract class or interface (using a concrete class
-will work too, but you will not be able to use most of the CDI extension
-features). All that is required is to mark the type as such with a
-simple annotation:
-
-[source,java]
-----------------------------------------
-@Repository(forEntity = Person.class)
-public abstract class PersonRepository {
-    ...
-}
-
-@Repository(forEntity = Person.class)
-public interface PersonRepository {
-    ...
-}
-----------------------------------------
-
-The `@Repository` annotation tells the extension that this is a
-repository for the `Person` entity. Any method defined on the repository
-will be processed by the framework. The annotation does not require to
-set the entity class (we'll see later why) but if there are just plain
-classes or interfaces this is the only way to tell the framework what
-entity the repository relates to. In order to simplify this, DeltaSpike
-Data provides several base types.
-
-==== The `EntityRepository` Interface
-
-Although mainly intended to hold complex query logic, working with both
-a repository and an `EntityManager` in the service layer might
-unnecessarily clutter code. In order to avoid this for the most common
-cases, DeltaSpike Data provides base types which can be used to replace
-the entity manager.
-
-The top base type is the `EntityRepository` interface, providing common
-methods used with an `EntityManager`. The following code shows the most
-important methods of the interface:
-
-[source,java]
--------------------------------------------------------------------------
-public interface EntityRepository<E, PK extends Serializable>
-{
-
-    E save(E entity);
-
-    void remove(E entity);
-
-    void refresh(E entity);
-
-    void flush();
-
-    E findBy(PK primaryKey);
-
-    List<E> findAll();
-
-    List<E> findBy(E example, SingularAttribute<E, ?>... attributes);
-
-    List<E> findByLike(E example, SingularAttribute<E, ?>... attributes);
-
-    Long count();
-
-    Long count(E example, SingularAttribute<E, ?>... attributes);
-
-    Long countLike(E example, SingularAttribute<E, ?>... attributes);
-
-}
--------------------------------------------------------------------------
-
-The concrete repository can then extend this basic interface. For our
-Person repository, this might look like the following:
-
-[source,java]
-------------------------------------------------------------------------
-@Repository
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    Person findBySsn(String ssn);
-
-}
-------------------------------------------------------------------------
-
-TIP: Annotations on interfaces do not inherit. If the `EntityRepository`
-interface is extended by another interface adding some more common
-methods, it is not possible to simply add the annotation there. It needs
-to go on each concrete repository. The same is not true if a base class
-is introduced, as we see in the next chapter.
-
-===== The AbstractEntityRepository Class
-
-This class is an implementation of the `EntityRepository` interface and
-provides additional functionality when custom query logic needs also to
-be implemented in the repository.
-
-[source,java]
--------------------------------------------------------------------------------------
-public abstract class PersonRepository extends AbstractEntityRepository<Person, Long>
-{
-
-    public List<Person> findBySSN(String ssn)
-    {
-        return typedQuery("select p from Person p where p.ssn = ?1")
-                .setParameter(1, ssn)
-                .getResultList();
-    }
-
-}
--------------------------------------------------------------------------------------
-
-=== Deactivating Repositories
-
-Repositories can be deactivated creating a <<spi.adoc#_classdeactivator,ClassDeactivator>>.
-
-The `EntityRepository` interface implements the <<core.adoc#_deactivatable,Deactivatable>> interface allowing it to be used in the ClassDeactivator.
-
-If your repository does not implement `EntityRepository` and you want to deactivate it, you will need to implement the <<core.adoc#_deactivatable,Deactivatable>>  interface yourself.
-
-[source,java]
-----------------------------------------
-@Repository(forEntity = Person.class)
-public abstract class PersonRepository implements Deactivatable {
-    ...
-}
-
-@Repository(forEntity = Person.class)
-public interface PersonRepository extends Deactivatable {
-    ...
-}
-----------------------------------------
-
-=== Support of @TransactionScoped EntityManagers
-
-For using `@TransactionScoped` beans like a `@TransactionScoped`-`EntityManager`,
-you need to annotate the Data-repository with @Transactional explicitly or one of the beans in the call-hierarchy.
-That's needed, because the context bound to `@TransactionScoped` needs to be active,
-before the `@TransactionScoped`-`EntityManager` gets resolved (internally).
-
-The following examples illustrate the described usages:
-
-.@TransactionScoped EntityManager combined with a simple repository
-[source,java]
----------------------------------------------------------------------------------------
-public class EntityManagerProducer
-{
-    @Produces
-    @TransactionScoped
-    public EntityManager create() { ... }
-
-    public void close(@Disposes EntityManager em)  { ... }
-}
-
-@ApplicationScoped
-public class MyService
-{
-    @Inject
-    private MyRepository myRepository;
-
-    public void create()
-    {
-        //...
-        this.myRepository.save(...); //executed in a transaction
-        //...
-    }
-}
-
-@Transactional
-@Repository
-public interface MyRepository extends EntityRepository<MyEntity, String>
-{
-  //...
-}
----------------------------------------------------------------------------------------
-
-.@TransactionScoped EntityManager combined with a simple repository called by a transactional bean
-[source,java]
----------------------------------------------------------------------------------------
-public class EntityManagerProducer
-{
-    @Produces
-    @TransactionScoped
-    public EntityManager create() { ... }
-
-    public void close(@Disposes EntityManager em)  { ... }
-}
-
-@Transactional
-@ApplicationScoped
-public class MyService
-{
-    @Inject
-    private MyRepository myRepository;
-
-    public void create() //executed in a transaction
-    {
-        //...
-        this.myRepository.save(...);
-        //...
-    }
-}
-
-@Repository
-public interface MyRepository extends EntityRepository<MyEntity, String>
-{
-  //...
-}
----------------------------------------------------------------------------------------
-
-=== Using Multiple EntityManagers
-
-While most applications will run just fine with a single
-`EntityManager`, there might be setups where multiple data sources are
-used. This can be configured with the `EntityManagerConfig` annotation:
-
-[source,java]
---------------------------------------------------------------------------------------------------------------
-@Repository
-@EntityManagerConfig(entityManagerResolver = CrmEntityManagerResolver.class, flushMode = FlushModeType.COMMIT)
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-    ...
-}
-
-public class CrmEntityManagerResolver implements EntityManagerResolver
-{
-    @Inject @CustomerData // Qualifier - assumes a producer is around...
-    private EntityManager em;
-
-    @Override
-    public EntityManager resolveEntityManager()
-    {
-        return em;
-    }
-}
---------------------------------------------------------------------------------------------------------------
-
-Again, note that annotations on interfaces do not inherit, so it is not
-possible to create something like a base `CrmRepository` interface with
-the `@EntityManagerConfig` and then extending / implementing this
-interface.
-
-=== Other EntityManager Methods
-
-While the `EntityRepository` methods should cover most interactions
-normally done with an `EntityManager`, for some specific cases it might
-still be useful to have one or the other method available. For this
-case, it is possible to extend / implement the `EntityManagerDelegate`
-interface for repositories, which offers most other methods available in
-a JPA 2.0 `EntityManager`:
-
-[source,java]
--------------------------------------------------------------------------------------------------------
-@Repository
-public interface PersonRepository extends EntityRepository<Person, Long>, EntityManagerDelegate<Person>
-{
-    ...
-}
--------------------------------------------------------------------------------------------------------
-
-Alternatively, you can extend the `FullEntityRepository` interface which is a short-hand for extending
-all of `EntityRepository`, `EntityManagerDelegate` and `CriteriaSupport`.
-
-[source,java]
--------------------------------------------------------------------------------------------------------
-@Repository
-public interface PersonRepository extends FullEntityRepository<Person, Long>
-{
-    ...
-}
--------------------------------------------------------------------------------------------------------
-
-For abstract classes, there is a convenience base class `AbstractFullEntityRepository` which also
-implements `EntityManagerDelegate` and `CriteriaSupport` and thus exposes most `EntityManager` methods:
-
-[source,java]
--------------------------------------------------------------------------------------------------------
-@Repository
-public abstract PersonRepository extends AbstractFullEntityRepository<Person, Long>
-{
-    ...
-}
--------------------------------------------------------------------------------------------------------
-
-== Query Method Expressions
-
-Good naming is a difficult aspects in software engineering. A good
-method name usually makes comments unnecessary and states exactly what
-the method does. And with method expressions, the method name is
-actually the implementation!
-
-=== Using Method Expressions
-
-Let's start by looking at a (simplified for readability) example:
-
-[source,java]
-------------------------------------------------------------------------
-@Entity
-public class Person
-{
-
-    @Id @GeneratedValue
-    private Long id;
-    private String name;
-    private Integer age;
-    private Gender gender;
-
-}
-
-@Repository
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    List<Person> findByNameLikeAndAgeBetweenAndGender(String name,
-                              int minAge, int maxAge, Gender gender);
-
-    long countByName(String name);
-
-    void removeByName(String name);
-}
-------------------------------------------------------------------------
-
-Looking at the method name, this can easily be read as query all Persons
-which have a name like the given name parameter, their age is between a
-min and a max age and having a specific gender. The DeltaSpike Data
-module can translate method names following a given format and directly
-generate the query implementation out of it (in EBNF-like form):
-
-----------------------------------------------------------------------------------
-(Entity|Optional<Entity>|List<Entity>|Stream<Entity>) (prefix)(Property[Comparator]){Operator Property [Comparator]}
-----------------------------------------------------------------------------------
-
-Or in more concrete words:
-
-* The query method must return an entity, an `Optional` of an entity, a list of entities or a stream of entities.
-* It must start with the `findBy` prefix (or related `findOptionalBy`, `findAnyBy`, `findAll`, `findFirst` or `findTop`).
-* Followed by a property of the Repository entity and an optional comparator (we'll define this later). The property will be used in the query together with the comparator. Note that the number of arguments passed to the method depend on the comparator.
-* You can add more blocks of property-comparator which have to be concatenated by a boolean operator. This is either an `And` or `Or`.
-
-You can also use the same way for delete an entity:
-* It must start with the `removeBy` keyword (or related `deleteBy`).
-
-or for counting:
-* It must start with the `countBy` keyword.
-* It must return a int or long.
-
-Other assumptions taken by the expression evaluator:
-
-* The property name starts lower cased while the property in the expression has an upper cases first character.
-
-Following comparators are currently supported to be used in method
-expressions:
-
-[options="header, autowidth"]
-|===
-| Name              |# of Arguments     |Description
-| Equal             |1 | Property must be equal to argument value. If the operator is omitted in the expression, this is assumed as default.
-| NotEqual          |1 | Property must be not equal to argument value.
-| Like              |1 | Property must be like the argument value. Use the %-wildcard in the argument.
-| GreaterThan       |1 | Property must be greater than argument value.
-| GreaterThanEquals |1 | Property must be greater than or equal to argument value.
-| LessThan          |1 | Property must be less than argument value.
-| LessThanEquals    |1 | Property must be less than or equal to argument value.
-| Between           |2 | Property must be between the two argument values.
-| IsNull            |0 | Property must be null.
-| IsNotNull         |0 | Property must be non-null.
-|===
-
-Note that DeltaSpike will validate those expressions during startup, so
-you will notice early in case you have a typo in those expressions.
-
-Also note that as of 1.7, the Entity type returned can either by the
-entity defined in this repository, or any other entity in your persistence
-unit, or any primitive type supported by your JPA implementation.
-
-=== Query Ordering
-
-Beside comparators it is also possible to sort queries by using the
-`OrderBy` keyword, followed by the attribute name and the direction
-(`Asc` or `Desc`).
-
-[source,java]
-------------------------------------------------------------------------------
-@Repository
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    List<Person> findByLastNameLikeOrderByAgeAscLastNameDesc(String lastName);
-
-}
-------------------------------------------------------------------------------
-
-=== Query Limits
-
-Starting with Apache DeltaSpike 1.6.2, you can apply query limits using method
-expressions.  They can be applied using `findFirst` or `findTop` prefixes in a
-method like this:
-
-[source,java]
-------------------------------------------------------------------------------
-@Repository
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    List<Person> findFirst2ByLastNameOrderByAgeAscLastNameDesc(String lastName);
-
-    List<Person> findTop2ByLastNameOrderByAgeAscLastNameDesc(String lastName);
-
-}
-------------------------------------------------------------------------------
-
-The number following the prefix indicates how many to limit by, when setting
-the `maxResults` attribute of the underlying query.  You can pair this with
-a `@FirstResult` parameter to give consistent paging.
-
-Query Limits can be applied even when there is no where clause defined by your
-query.
-
-[source,java]
-------------------------------------------------------------------------------
-@Repository
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    List<Person> findAllOrderByAgeAsc();
-
-    List<Person> findTop20OrderByLastNameDesc();
-
-}
-------------------------------------------------------------------------------
-
-The first query finding all entries ordered by age, and the second only 20
-ordered by last name.
-
-=== Nested Properties
-
-To create a comparison on a nested property, the traversal parts can be
-separated by a `_`:
-
-[source,java]
-------------------------------------------------------------------------
-@Repository
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    List<Person> findByCompany_companyName(String companyName);
-
-}
-------------------------------------------------------------------------
-
-=== Query Options
-
-
-DeltaSpike supports query options on method expressions. If you want to
-page a query, you can change the first result as well as the maximum
-number of results returned:
-
-[source,java]
------------------------------------------------------------------------------------------------
-@Repository
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    List<Person> findByNameLike(String name, @FirstResult int start, @MaxResults int pageSize);
-
-}
------------------------------------------------------------------------------------------------
-
-=== Method Prefix
-
-In case the `findBy` prefix does not comply with your team conventions,
-this can be adapted:
-
-[source,java]
---------------------------------------------------------------------------------------------------
-@Repository(methodPrefix = "fetchWith")
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    List<Person> fetchWithNameLike(String name, @FirstResult int start, @MaxResults int pageSize);
-
-}
---------------------------------------------------------------------------------------------------
-
-== Query Annotations
-
-While method expressions are fine for simple queries, they will often
-reach their limit once things get slightly more complex. Another aspect
-is the way you want to use JPA: The recommended approach using JPA for
-best performance is over named queries. To help incorporate those use
-cases, the DeltaSpike Data module supports also annotating methods for
-more control on the generated query.
-
-
-=== Using Query Annotations
-
-The simplest way to define a specific query is by annotating a method and
-providing the JPQL query string which has to be executed. In code, this
-looks like the following sample:
-
-[source,java]
-------------------------------------------------------------------------
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    @Query("select count(p) from Person p where p.age > ?1")
-    Long countAllOlderThan(int minAge);
-
-}
-------------------------------------------------------------------------
-
-The parameter binding in the query corresponds to the argument index in
-the method.
-
-You can also refer to a named query which is constructed and executed
-automatically. The `@Query` annotation has a named attribute which
-corresponds to the query name:
-
-[source,java]
---------------------------------------------------------------------------------------------
-@Entity
-@NamedQueries({
-    @NamedQuery(name = Person.BY_MIN_AGE,
-                query = "select count(p) from Person p where p.age > ?1 order by p.age asc")
-})
-public class Person
-{
-
-    public static final String BY_MIN_AGE = "person.byMinAge";
-    ...
-
-}
-
-@Repository
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    @Query(named = Person.BY_MIN_AGE)
-    Long countAllOlderThan(int minAge);
-
-}
---------------------------------------------------------------------------------------------
-
-Same as before, the parameter binding corresponds to the argument index
-in the method. If the named query requires named parameters to be used,
-this can be done by annotating the arguments with the `@QueryParam`
-annotation.
-
-TIP: Java does not preserve method parameter names (yet), that's why the
-annotation is needed.
-
-[source,java]
----------------------------------------------------------------------------------------------
-@NamedQuery(name = Person.BY_MIN_AGE,
-            query = "select count(p) from Person p where p.age > :minAge order by p.age asc")
-
-...
-
-@Repository
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    @Query(named = Person.BY_MIN_AGE)
-    Long countAllOlderThan(@QueryParam("minAge") int minAge);
-
-}
----------------------------------------------------------------------------------------------
-
-It is also possible to set a native SQL query in the annotation. The
-`@Query` annotation has a native attribute which flags that the query is
-not JPQL but plain SQL:
-
-[source,java]
-------------------------------------------------------------------------------------
-@Entity
-@Table(name = "PERSON_TABLE")
-public class Person
-{
-    ...
-}
-
-@Repository
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    @Query(value = "SELECT * FROM PERSON_TABLE p WHERE p.AGE > ?1", isNative = true)
-    List<Person> findAllOlderThan(int minAge);
-
-}
-------------------------------------------------------------------------------------
-
-=== Annotation Options
-
-Beside providing a query string or reference, the `@Query` annotation
-provides also two more attributes:
-
-[source,java]
---------------------------------------------------------------------------------------
-@Repository
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    @Query(named = Person.BY_MIN_AGE, max = 10, lock = LockModeType.PESSIMISTIC_WRITE)
-    List<Person> findAllForUpdate(int minAge);
-
-}
---------------------------------------------------------------------------------------
-
-[options="header, autowidth"]
-|===
-| Name | Description
-| max  | Limits the number of results.
-| lock | Use a specific LockModeType to execute the query.
-|===
-
-Note that these options can also be applied to method expressions.
-
-=== Query Options
-
-All the query options you have seen so far are more or less static. But
-sometimes you might want to apply certain query options dynamically. For
-example, sorting criteria could come from a user selection so they
-cannot be known beforehand. DeltaSpike allows you to apply query options
-at runtime by using the `QueryResult` result type:
-
-[source,java]
-------------------------------------------------------------------------
-@Repository
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    @Query("select p from Person p where p.age between ?1 and ?2")
-    QueryResult<Person> findAllByAge(int minAge, int maxAge);
-
-}
-------------------------------------------------------------------------
-
-Once you have obtained a `QueryResult`, you can apply further options to
-the query:
-
-[source,java]
------------------------------------------------------------
-List<Person> result = personRepository.findAllByAge(18, 65)
-    .orderAsc("p.lastName", false)
-    .orderDesc("p.age", false)
-    .lockMode(LockModeType.WRITE)
-    .hint("org.hibernate.timeout", Integer.valueOf(10))
-    .getResultList();
------------------------------------------------------------
-
-IMPORTANT: Note that sorting is only applicable to method expressions or non-named
-queries. For named queries it might be possible, but is currently only
-supported for Hibernate, EclipseLink and OpenJPA.
-
-Note that the `QueryResult` return type can also be used with method
-expressions.
-
-IMPORTANT: `QueryResult` is based on our internal understanding of your query.
-DeltaSpike expects the alias used in your queries to refer to the entity as `e`
-You can disable this behavior by passing in false with your attribute, `.orderDesc("p.age", false)`
-which would add descending ordering to your existing query `select p from Person p`
-
-=== Pagination
-
-We introduced the `QueryResult` type in the last chapter, which can also
-be used for pagination:
-
-[source,java]
------------------------------------------------------------
-// Query API style
-QueryResult<Person> paged = personRepository.findByAge(age)
-    .maxResults(10)
-    .firstResult(50);
-
-// or paging style
-QueryResult<Person> paged = personRepository.findByAge(age)
-    .withPageSize(10) // equivalent to maxResults
-    .toPage(5);
-
-int totalPages = paged.countPages();
------------------------------------------------------------
-
-=== Bulk Operations
-
-While reading entities and updating them one by one might be fine for
-many use cases, applying bulk updates or deletes is also a common usage
-scenario for repositories. DeltaSpike supports this with a special
-marking annotation `@Modifying`:
-
-[source,java]
-------------------------------------------------------------------------------
-@Repository
-public interface PersonRepository extends EntityRepository<Person, Long>
-{
-
-    @Modifying
-    @Query("update Person as p set p.classifier = ?1 where p.classifier = ?2")
-    int updateClassifier(Classifier current, Classifier next);
-
-}
-------------------------------------------------------------------------------
-
-Bulk operation query methods can either return void or int, which counts
-the number of entities affected by the bulk operation.
-
-=== Optional Query Results
-
-The JPA spec requires to throw exceptions in case the
-`getSingleResult()` method does either return no or more than one
-result. This can result in tedious handling with try-catch blocks or
-have potential impact on your transaction (as the `RuntimeException`
-might roll it back).
-
-DeltaSpike Data gives the option to change this to the way it makes most
-sense for the current usecase. While the default behavior is still fully
-aligned with JPA, it is also possible to request optional query results.
-
-=== Zero or One Result
-
-With this option, the query returns `null` instead of throwing a
-`NoResultException` when there is no result returned. It is usable with
-method expressions, `Query` annotations and `QueryResult<E>` calls.
-
-[source,java]
-----------------------------------------------------------------------------
-@Repository(forEntity = Person.class)
-public interface PersonRepository
-{
-
-    Person findOptionalBySsn(String ssn);
-
-    @Query(named = Person.BY_NAME, singleResult = SingleResultType.OPTIONAL)
-    Person findByName(String firstName, String lastName);
-
-}
-----------------------------------------------------------------------------
-
-For method expressions, the `findOptionalBy` prefix can be used. For
-`@Query` annotations, the `singleResult` attribute can be overridden
-with the `SingleResultType.OPTIONAL` enum.
-
-In case the query returns more than one result, a
-`NonUniqueResultException` is still thrown.
-
-=== Any Result
-
-If the caller does not really mind what kind if result is returned, it is
-also possible to request any result from the query. If there is no
-result, same as for optional queries `null` is returned. In case there
-is more than one result, any result is returned, or more concretely the
-first result out of the result list.
-
-[source,java]
------------------------------------------------------------------------
-@Repository(forEntity = Person.class)
-public interface PersonRepository
-{
-
-    Person findAnyByLastName(String lastName);
-
-    @Query(named = Person.BY_NAME, singleResult = SingleResultType.ANY)
-    Person findByName(String firstName, String lastName);
-
-}
------------------------------------------------------------------------
-
-For method expressions, the `findAnyBy` prefix can be used. For `@Query`
-annotations, the `singleResult` attribute can be overridden with the
-`SingleResultType.ANY` enum.
-
-This option will not throw an exception.
-
-=== Java 8 Semantics
-
-Repositories support returning instances of `java.util.Optional` and `java.util.stream.Stream` for any method.
-
-[source,java]
------------------------------------------------------------------------
-@Repository(forEntity = Person.class)
-public interface PersonRepository
-{
-
-    Optional<Person> findBySsn(String ssn);
-
-    Stream<Person> findByLocation(String location);
-
-}
------------------------------------------------------------------------
-
-Queries returning `Optional<T>` will behave like `SingleResultType.OPTIONAL`, if the data is present, return the single
-result, otherwise return `Optional.empty()`.  You can override this by using `SingleResultType.ANY` which takes the first
-result of the list, or else `empty()`.
-
-Queries returning `Stream<T>` act as a simple wrapper for `query.getResultList().stream()` to give back the results.
-
-=== Entity Graphs
-
-EntityGraphs are a feature added in JPA 2.1.  The Data module supports entity graphs for query operations, where the results
-will be limited based on a defined graph.  This feature is only available if you are using a JPA 2.1 implementation.
-
-`@EntityGraph` can be used for either `fetch` or `load` operations, depending on the `EntityGraphType` used in the annotation.  Most queries should use the `FETCH` option.
-
-==== Named Graphs
-
-Entity graphs can be selected by name.  A `@NamedEntityGraph` should be defined already within your persistence context to leverage this.  When this graph is referenced on a repository method, it will be applied to the query.
-
-==== Dyanmically built graphs
-
-If you want to dynamically build a graph, you can do that via the `paths` attribute of the annotation.  The paths specified will be added as graph nodes.  Each graph node will be used in the select.  The format is the full path to the property, based on the property names.
-
-== Transactions
-
-If you call any method expression, `@Query`-annotated method or a method
-from the `EntityRepository`, the repository will figure out if a
-transaction is needed or not, and if so, if there is already one
-ongoing. The Data module uses the `TransactionStrategy` provided by the
-http://deltaspike.apache.org/documentation/jpa.html[JPA Module] for this. See the JPA
-module documentation for more details.
-
-IMPORTANT: Some containers do not support `BeanManagedUserTransactionStrategy`! As
-JTA has still some portability issues even in Java EE 7, it might be
-required that you implement your own `TransactionStrategy`. We will
-think about providing an acceptable solution for this.
-
-
-If you need to open a transaction on a concrete repository method, we
-currently recommend creating an extension (see next chapter) which uses
-`@Transactional` and might look like the following sample.
-
-[source,java]
----------------------------------------------------------------------------------------
-public class TxExtension<E> implements DelegateQueryHandler, TxRepository // this is your extension interface
-{
-    @Inject
-    private EntityManager em;
-
-    @Override @Transactional
-    public List<E> transactional(ListResultCallback callback)
-    {
-        return callback.execute();
-    }
-
-}
----------------------------------------------------------------------------------------
-
-Repositories can then implement the `TxRepository` interface and call
-their queries in the `transactional` method (where the callback
-implementation can be, for example, in an anonymous class).
-
-== Extensions
-
-=== Query Delegates
-
-While several base interfaces are defined for repositories, there might still be
-the odd convenience method that is missing. This is actually intentional
-- things should not get overloaded for each and every use case. That's
-why in DeltaSpike you can define your own reusable methods.
-
-For example, you might want to use the QueryDsl library in your
-repositories:
-
-[source,java]
----------------------------------------------------------
-import com.mysema.query.jpa.impl.JPAQuery;
-
-public interface QueryDslSupport
-{
-    JPAQuery jpaQuery();
-}
-
-@Repository(forEntity = Person.class)
-public interface PersonRepository extends QueryDslSupport
-{
-   ...
-}
----------------------------------------------------------
-
-=== Implementing the Query Delegate
-
-The first step is to define an interface which contains the extra
-methods for your repositories (as shown above):
-
-[source,java]
---------------------------------
-public interface QueryDslSupport
-{
-    JPAQuery jpaQuery();
-}
---------------------------------
-
-As a next step, you need to provide an implementation for this interface
-once. It is also important that this implementation implements the
-`DelegateQueryHandler` interface (do not worry, this is just an empty
-marker interface):
-
-[source,java]
---------------------------------------------------------------------------------------------
-public class QueryDslRepositoryExtension<E> implements QueryDslSupport, DelegateQueryHandler
-{
-
-    @Inject
-    private QueryInvocationContext context;
-
-    @Override
-    public JPAQuery jpaQuery()
-    {
-        return new JPAQuery(context.getEntityManager());
-    }
-
-}
---------------------------------------------------------------------------------------------
-
-As you see in the sample, you can inject a `QueryInvocationContext`
-which contains utility methods like accessing the current
-`EntityManager` and entity class.
-
-Note that, if you define multiple extensions with equivalent method
-signatures, there is no specific order in which the implementation is
-selected.
-
-== Mapping
-
-While repositories are primarily intended to work with Entities, it
-might be preferable in some cases to have an additional mapping layer on
-top of them, for example because the Entities are quite complex but the service
-layer needs only a limited view on it, or because the Entities are
-exposed over a remote interface and there should not be a 1:1 view on
-the domain model.
-
-DeltaSpike Data allows to directly plugin in such a mapping mechanism
-without the need to specify additional mapping methods:
-
-[source,java]
-----------------------------------------------------
-@Repository(forEntity = Person.class)
-@MappingConfig(PersonDtoMapper.class)
-public interface PersonRepository
-{
-
-    PersonDto findBySsn(String ssn);
-
-    List<PersonDto> findByLastName(String lastName);
-
-}
-----------------------------------------------------
-
-The `PersonDtoMapper` class has to implement the `QueryInOutMapper`
-interface:
-
-[source,java]
----------------------------------------------------------------------------------
-public class PersonDtoMapper implements QueryInOutMapper<Person>
-{
-
-    @Override
-    public Object mapResult(Person result)
-    {
-        ... // converts Person into a PersonDto
-    }
-    ...
-
-    @Override
-    public Object mapResultList(List<Person> result)
-    {
-        ... // result lists can also be mapped into something different
-            // than a collection.
-    }
-
-    @Override
-    public boolean mapsParameter(Object parameter)
-    {
-        return parameter != null && (
-                parameter instanceof PersonDto || parameter instanceof PersonId);
-    }
-
-    @Override
-    public Object mapParameter(Object parameter)
-    {
-        ... // converts query parameters if required
-    }
-}
----------------------------------------------------------------------------------
-
-The mapper can also be used to transform query parameters. Parameters
-are converted before executing queries and calling repository
-extensions.
-
-Note that those mapper classes are treated as CDI Beans, so it is
-possible to use injection in those beans (e.g. you might inject an
-`EntityManager` or other mappers). As the `@MappingConfig` refers to the
-mapper class directly, the mapper must be uniquely identifiable by its
-class.
-
-It is also possible to combine mappings with the base Repository classes:
-
-[source,java]
--------------------------------------------------------------------------------
-@Repository(forEntity = Person.class)
-@MappingConfig(PersonDtoMapper.class)
-public interface PersonRepository extends EntityRepository<PersonDto, PersonId>
-{
-    ...
-}
--------------------------------------------------------------------------------
-
-In this case, the `forEntity` attribute in the `@Repository` annotation
-is mandatory. Also it is up to the mapper to convert parameters
-correctly (in this example, a conversion from a `PersonDto` parameter to
-`Person` entity and from `PersonId` to `Long` is necessary).
-
-=== Simple Mappings
-
-In many cases it is just required to map a DTO object back and forth. For
-this case, the `SimpleQueryInOutMapperBase` class can be subclassed,
-which only requires to override three methods:
-
-[source,java]
--------------------------------------------------------------------------------
-public class PersonMapper extends SimpleQueryInOutMapperBase<Person, PersonDto>
-{
-
-    @Override
-    protected Object getPrimaryKey(PersonDto dto)
-    {
-        return dto.getId();
-    }
-
-    @Override
-    protected PersonDto toDto(Person entity)
-    {
-        ...
-    }
-
-    @Override
-    protected Person toEntity(Person entity, PersonDto dto) {
-        ...
-        return entity;
-    }
-}
--------------------------------------------------------------------------------
-
-The first method, `getPrimaryKey`, identifies the primary key of an
-incoming DTO (this might need mapping too). If there is a primary key in
-the DTO, Data tries to retrieve the Entity and feed it to the `toEntity`
-method, so the entity to be mapped is **attached to the persistence
-context**. If there is no primary key, a new instance of the Entity is
-created. In any case, there is no need to map the primary key to the
-entity (it either does not exist or is already populated for an existing
-entity).
-
-== JPA Criteria API Support
-
-Besides automatic query generation, the DeltaSpike Data module also
-provides a DSL-like API to create JPA 2 Criteria queries. It takes
-advantage of the JPA 2 meta model, which helps creating type safe
-queries.
-
-TIP: The JPA meta model can easily be generated with an annotation processor.
-Hibernate or EclipseLink provide such a processor, which can be
-integrated into your compile and build cycle.
-
-Note that this criteria API is not intended to replace the standard
-criteria API - it is rather a utility API that should make life easier on
-the most common cases for a custom query. The JPA criteria API's
-strongest point is certainly its type safety - which comes at the cost
-of readability. We're trying to provide a middle way here. A less
-powerful API, but still type safe and readable.
-
-=== API Usage
-
-The API is centered around the Criteria class and is targeted to provide
-a fluent interface to write criteria queries:
-
-[source,java]
----------------------------------------------------------------------------
-@Repository(forEntity = Person.class)
-public abstract class PersonRepository implements CriteriaSupport<Person>
-{
-
-    public List<Person> findAdultFamilyMembers(String name, Integer minAge)
-    {
-        return criteria()
-                .like(Person_.name, "%" + name + "%")
-                .gtOrEq(Person_.age, minAge)
-                .eq(Person_.validated, Boolean.TRUE)
-                .orderDesc(Person_.age)
-                .getResultList();
-    }
-
-}
----------------------------------------------------------------------------
-
-Following comparators are supported by the API:
-
-[options="header,autowidth"]
-|===
-| Name                    | Description
-| .eq(..., ...)           | Property value must be equal to the given value
-| .in(..., ..., ..., ...) | Property value must be in one of the given values.
-| .notEq(..., ...)        | Negates equality
-| .like(..., ...)         | A SQL `like` equivalent comparator. Use % on the value.
-| .notLike(..., ...)      | Negates the like value
-| .lt(..., ...)           | Property value must be less than the given value.
-| .ltOrEq(..., ...)       | Property value must be less than or equal to the given value.
-| .gt(..., ...)           | Property value must be greater than the given value.
-| .ltOrEq(..., ...)       | Property value must be greater than or equal to the given value.
-| .between(..., ..., ...) | Property value must be between the two given values.
-| .isNull(...)            | Property must be `null`
-| .isNotNull(...)         | Property must be non-`null`
-| .isEmpty(...)           | Collection property must be empty
-| .isNotEmpty(...)        |Collection property must be non-empty
-|===
-
-The query result can be modified with the following settings:
-
-[options="header,autowidth"]
-|===
-| Name                     | Description
-| .orderAsc(...)           | Sorts the result ascending by the given property. Note that this can be applied to several properties
-| .orderDesc(...)          | Sorts the result descending by the given property. Note that this can be applied to several properties
-| .distinct()              | Sets distinct to true on the query.
-|===
-
-Once all comparators and query options are applied, the `createQuery()`
-method is called. This creates a JPA TypedQuery object for the
-repository entity. If required, further processing can be applied here.
-
-=== Joins
-
-For simple cases, restricting on the repository entity only works out
-fine, but once the Data model gets more complicated, the query will have
-to consider relations to other entities. The module's criteria API
-therefore supports joins as shown in the sample below:
-
-[source,java]
--------------------------------------------------------------------------------------
-@Repository
-public abstract class PersonRepository extends AbstractEntityRepository<Person, Long>
-{
-
-    public List<Person> findByCompanyName(String companyName)
-    {
-        return criteria()
-                .join(Person_.company,
-                    where(Company.class)
-                        .eq(Company_.name, companyName)
-                )
-                .eq(Person_.validated, Boolean.TRUE)
-                .getResultList();
-    }
-
-}
--------------------------------------------------------------------------------------
-
-Beside the inner and outer joins, also fetch joins are supported. Those
-are slighly simpler as seen in the next sample:
-
-[source,java]
--------------------------------------------------------------------------------------
-public abstract class PersonRepository extends AbstractEntityRepository<Person, Long>
-{
-
-    public Person findBySSN(String ssn)
-    {
-        return criteria()
-                .fetch(Person_.familyMembers)
-                .eq(Person_.ssn, ssn)
-                .distinct()
-                .getSingleResult();
-    }
-
-}
--------------------------------------------------------------------------------------
-
-=== Boolean Operators
-
-By default, all query operators are concatenated as an and conjunction
-to the query. The DeltaSpike criteria API also allows to add groups of
-disjunctions.
-
-[source,java]
--------------------------------------------------------------------------------------
-public abstract class PersonRepository extends AbstractEntityRepository<Person, Long>
-{
-
-    public List<Person> findAdults()
-    {
-        return criteria()
-                .or(
-                    criteria().
-                        .gtOrEq(Person_.age, 18)
-                        .eq(Person_.origin, Country.SWITZERLAND),
-                    criteria().
-                        .gtOrEq(Person_.age, 21)
-                        .eq(Person_.origin, Country.USA)
-                )
-                .getResultList();
-    }
-
-}
--------------------------------------------------------------------------------------
-
-=== Selections
-
-It might not always be appropriate to retrieve full entities - you might
-also be interested in scalar values or by modified entity attributes.
-The Criteria interface allows this with the selection method:
-
-[source,java]
-------------------------------------------------------------------------------------------------------
-public abstract class PersonRepository extends AbstractEntityRepository<Person, Long>
-{
-
-    public Statistics ageStatsFor(Segment segment)
-    {
-        return criteria()
-                 .select(Statistics.class, avg(Person_.age), min(Person_.age), max(Person_.age))
-                 .eq(Person_.segment, segment)
-                 .getSingleResult();
-    }
-
-    public List<Object[]> personViewForFamily(String name)
-    {
-        return criteria()
-                 .select(upper(Person_.name), attribute(Person_.age), substring(Person_.firstname, 1))
-                 .like(Person_.name, name)
-                 .getResultList();
-    }
-
-}
-------------------------------------------------------------------------------------------------------
-
-There are also several functions supported which can be used in the
-selection clause:
-
-[options="header,autowidth"]
-|===
-|Name                              | Description
-| abs(...)                         | Absolute value. Applicable to Number attributes.
-| avg(...)                         | Average value. Applicable to Number attributes.
-| count(...)                       | Count function. Applicable to Number attributes.
-| max(...)                         | Max value. Applicable to Number attributes.
-| min(...)                         | Min value. Applicable to Number attributes.
-| modulo(...)                      | Modulo function. Applicable to Integer attributes.
-| neg(...)                         | Negative value. Applicable to Number attributes.
-| sum(...)                         | Sum function. Applicable to Number attributes.
-| lower(...)                       | String to lowercase. Applicable to String attributes.
-| substring(int from, ...)         | Substring starting from. Applicable to String attributes.
-| substring(int from, int to, ...) | Substring starting from ending to. Applicable to String attributes.
-| upper(...)                       | String to uppercase. Applicable to String attributes.
-| currDate()                       | The DB sysdate. Returns a Date object.
-| currTime()                       | The DB sysdate. Returns a Time object.
-| currTStamp()                     | The DB sysdate. Returns a Timestamp object.
-|===
-
-
-== Auditing
-
-A common requirement for entities is tracking what is being done with
-them. DeltaSpike provides a convenient way to support this requirement.
-
-NOTE: DeltaSpike does not support creating revisions of entities. If this is a
-requirement for your audits, have a look at Hibernate Envers.
-
-=== Activating Auditing
-
-DeltaSpike uses an entity listener to update auditing data before
-entities get created or update. The entity listener must be activated
-before it can be used. This can either be done globally for all entities
-of a persistent unit or per entity.
-
-Activation per persistence unit in `orm.xml`:
-
-[source,xml]
------------------------------------------------------------------------------------------------------------------------------------------
-<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd" version="2.0">
-    <persistence-unit-metadata>
-        <persistence-unit-defaults>
-            <entity-listeners>
-                <entity-listener class="org.apache.deltaspike.data.impl.audit.AuditEntityListener" />
-            </entity-listeners>
-        </persistence-unit-defaults>
-    </persistence-unit-metadata>
-</entity-mappings>
------------------------------------------------------------------------------------------------------------------------------------------
-
-Activation per entity:
-
-[source,java]
--------------------------------------------
-@Entity
-@EntityListeners(AuditEntityListener.class)
-public class AuditedEntity
-{
-
-    ...
-
-}
--------------------------------------------
-
-Note that for this variant, you need a compile dependency on the impl
-module. Alternatively, also the per entity listener can be configured by
-XML.
-
-=== Using Auditing Annotations
-
-All that has to be done now is annotating the entity properties which
-are used to audit the entity.
-
-====  Updating Timestamps
-
-To keep track on creation and modification times, following annotations
-can be used:
-
-[source,java]
--------------------------------------
-@Entity
-public class AuditedEntity
-{
-
-    ...
-
-    @Temporal(TemporalType.TIMESTAMP)
-    @CreatedOn
-    private Date created;
-
-    @Temporal(TemporalType.TIMESTAMP)
-    @ModifiedOn
-    private Date updated;
-
-    ...
-
-}
--------------------------------------
-
-In case the modification date should also be set during entity creation,
-the annotation can be customized:
-
------------------------------
-@ModifiedOn(setOnCreate=true)
------------------------------
-
-====  Who's Changing My Entities?
-
-Beside keeping track of when a change has happened, it is also often
-critical to track who's responsible for the change. Annotate a user
-tracking field with the following annotation:
-
-[source,java]
------------------------------
-@Entity
-public class AuditedEntity
-{
-
-    ...
-
-    @ModifiedBy
-    private String auditUser;
-
-    ...
-
-}
------------------------------
-
-Now a little help is needed. The entity listener needs to be able to
-resolve the current user - there must be a bean available of the
-matching type for the annotation property, exposed over a special CDI
-qualifier:
-
-[source,java]
-----------------------------------
-public class UserProvider
-{
-
-    @Inject
-    private User user;
-
-    @Produces @CurrentUser
-    public String currentUser() {
-        return user.getUsername();
-    }
-
-    ...
-
-}
-----------------------------------
-
-TIP: The JPA Spec does not recommend to modify entity relations from within a
-lifecycle callback. If you expose another entity here, make sure that
-your persistence provider supports this. Also you should ensure that the
-entity is attached to a persistent context. Also, be aware that the CDI
-container will proxy a scoped bean, which might confuse the persistence
-provider when persisting / updating the target entity.
+:moduledeps: core, jpa, partial-bean

+

+= Data Module

+

+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

+

+== Overview

+The Data module provides capabilities for implementing repository patterns and thereby simplifying the repository layer. Repository patterns are ideal for simple queries that require boilerplate code, enabling centralization of query logic and consequently reducing code duplication and improving testability.

+

+The code sample below gives you a quick overview on the common usage

+scenarios of the data module:

+

+[source,java]

+----------------------------------------------------------------------------------

+@Repository

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    List<Person> findByAgeBetweenAndGender(int minAge, int maxAge, Gender gender);

+

+    @Query("select p from Person p where p.ssn = ?1")

+    Person findBySSN(String ssn);

+

+    @Query(named=Person.BY_FULL_NAME)

+    Person findByFullName(String firstName, String lastName);

+

+}

+----------------------------------------------------------------------------------

+

+As you see in the sample, there are several usage scenarios outlined

+here:

+

+* Declare a method which executes a query by simply translating its name

+and parameters into a query.

+* Declare a method which automatically executes a given JPQL query

+string with parameters.

+* Declare a method which automatically executes a named query with

+parameters.

+

+The implementation of the method is done automatically by the CDI

+extension. A client can declare a dependency to the interface only. The

+details on how to use those features are outlined in the following

+chapters.

+

+== Project Setup

+

+The configuration information provided here is for Maven-based projects and it assumes that you have already declared the DeltaSpike version and DeltaSpike Core module for your projects, as detailed in <<configure#, Configure DeltaSpike in Your Projects>>. For Maven-independent projects, see <<configure#config-maven-indep,Configure DeltaSpike in Maven-independent Projects>>.

+

+=== 1. Declare Data Module Dependencies

+

+Add the Data module to the list of dependencies in the project `pom.xml` file using this code snippet:

+

+[source,xml]

+----

+<dependency>

+    <groupId>org.apache.deltaspike.modules</groupId>

+    <artifactId>deltaspike-data-module-api</artifactId>

+    <version>${deltaspike.version}</version>

+    <scope>compile</scope>

+</dependency>

+

+<dependency>

+    <groupId>org.apache.deltaspike.modules</groupId>

+    <artifactId>deltaspike-data-module-impl</artifactId>

+    <version>${deltaspike.version}</version>

+    <scope>runtime</scope>

+</dependency>

+----

+

+Or if you're using Gradle, add these dependencies to your `build.gradle`:

+

+[source]

+----

+     runtime 'org.apache.deltaspike.modules:deltaspike-data-module-impl'

+     compile 'org.apache.deltaspike.modules:deltaspike-data-module-api'

+----

+

+=== 2. Complete Additional Java Environment Configuration

+

+The Data module requires a JPA implementation to be available in the Java environment where your projects are deployed.

+

+The simplest way using the DeltaSpike Data module is to run your

+application in a Java EE container supporting at least the Java EE6 Web

+Profile. Other configurations like running it inside Tomcat or even a

+Java SE application should be possible - you need to include a JPA

+provider as well as a CDI container to your application manually.

+

+As of DeltaSpike v1.4.0, the Data module internally leverages the Proxy module, which wraps ASM 5.  No external

+dependencies required, and now we have full support for interceptors on partial beans.

+

+=== 3. Complete Additional Project Configuration

+

+DeltaSpike Data requires an `EntityManager` exposed via a CDI producer -

+which is common practice in Java EE6 applications.

+

+[source,java]

+------------------------------------------------------

+public class EntityManagerProducer

+{

+    @PersistenceUnit

+    private EntityManagerFactory emf;

+

+    @Produces // you can also make this @RequestScoped

+    public EntityManager create()

+    {

+        return emf.createEntityManager();

+    }

+

+    public void close(@Disposes EntityManager em)

+    {

+        if (em.isOpen())

+        {

+            em.close();

+        }

+    }

+}

+------------------------------------------------------

+

+This allows the `EntityManager` to be injected over CDI instead of only

+being used with a `@PersistenceContext` annotation. Using multiple

+`EntityManager` is explored in more detail in a following section.

+

+If you use a JTA DataSource with your `EntityManager`, you also have to

+configure the `TransactionStrategy` your repositories use. Adapt your

+`beans.xml` for this:

+

+[source,xml]

+----

+<beans>

+    <alternatives>

+        <class>org.apache.deltaspike.jpa.impl.transaction.BeanManagedUserTransactionStrategy</class>

+    </alternatives>

+</beans>

+----

+

+IMPORTANT: Using the DeltaSpike Data module in an EAR deployment is currently restricted to

+annotation-based entities.

+

+== Core Concepts

+

+=== Repositories

+

+With the DeltaSpike Data module, it is possible to make a repository out

+of basically any abstract class or interface (using a concrete class

+will work too, but you will not be able to use most of the CDI extension

+features). All that is required is to mark the type as such with a

+simple annotation:

+

+[source,java]

+----------------------------------------

+@Repository(forEntity = Person.class)

+public abstract class PersonRepository {

+    ...

+}

+

+@Repository(forEntity = Person.class)

+public interface PersonRepository {

+    ...

+}

+----------------------------------------

+

+The `@Repository` annotation tells the extension that this is a

+repository for the `Person` entity. Any method defined on the repository

+will be processed by the framework. The annotation does not require to

+set the entity class (we'll see later why) but if there are just plain

+classes or interfaces this is the only way to tell the framework what

+entity the repository relates to. In order to simplify this, DeltaSpike

+Data provides several base types.

+

+==== The `EntityRepository` Interface

+

+Although mainly intended to hold complex query logic, working with both

+a repository and an `EntityManager` in the service layer might

+unnecessarily clutter code. In order to avoid this for the most common

+cases, DeltaSpike Data provides base types which can be used to replace

+the entity manager.

+

+The top base type is the `EntityRepository` interface, providing common

+methods used with an `EntityManager`. The following code shows the most

+important methods of the interface:

+

+[source,java]

+-------------------------------------------------------------------------

+public interface EntityRepository<E, PK extends Serializable>

+{

+

+    E save(E entity);

+

+    void remove(E entity);

+

+    void refresh(E entity);

+

+    void flush();

+

+    E findBy(PK primaryKey);

+

+    List<E> findAll();

+

+    List<E> findBy(E example, SingularAttribute<E, ?>... attributes);

+

+    List<E> findByLike(E example, SingularAttribute<E, ?>... attributes);

+

+    Long count();

+

+    Long count(E example, SingularAttribute<E, ?>... attributes);

+

+    Long countLike(E example, SingularAttribute<E, ?>... attributes);

+

+}

+-------------------------------------------------------------------------

+

+The concrete repository can then extend this basic interface. For our

+Person repository, this might look like the following:

+

+[source,java]

+------------------------------------------------------------------------

+@Repository

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    Person findBySsn(String ssn);

+

+}

+------------------------------------------------------------------------

+

+TIP: Annotations on interfaces do not inherit. If the `EntityRepository`

+interface is extended by another interface adding some more common

+methods, it is not possible to simply add the annotation there. It needs

+to go on each concrete repository. The same is not true if a base class

+is introduced, as we see in the next chapter.

+

+===== The AbstractEntityRepository Class

+

+This class is an implementation of the `EntityRepository` interface and

+provides additional functionality when custom query logic needs also to

+be implemented in the repository.

+

+[source,java]

+-------------------------------------------------------------------------------------

+public abstract class PersonRepository extends AbstractEntityRepository<Person, Long>

+{

+

+    public List<Person> findBySSN(String ssn)

+    {

+        return typedQuery("select p from Person p where p.ssn = ?1")

+                .setParameter(1, ssn)

+                .getResultList();

+    }

+

+}

+-------------------------------------------------------------------------------------

+

+=== Deactivating Repositories

+

+Repositories can be deactivated creating a <<spi.adoc#_classdeactivator,ClassDeactivator>>.

+

+The `EntityRepository` interface implements the <<core.adoc#_deactivatable,Deactivatable>> interface allowing it to be used in the ClassDeactivator.

+

+If your repository does not implement `EntityRepository` and you want to deactivate it, you will need to implement the <<core.adoc#_deactivatable,Deactivatable>>  interface yourself.

+

+[source,java]

+----------------------------------------

+@Repository(forEntity = Person.class)

+public abstract class PersonRepository implements Deactivatable {

+    ...

+}

+

+@Repository(forEntity = Person.class)

+public interface PersonRepository extends Deactivatable {

+    ...

+}

+----------------------------------------

+

+=== Support of @TransactionScoped EntityManagers

+

+For using `@TransactionScoped` beans like a `@TransactionScoped`-`EntityManager`,

+you need to annotate the Data-repository with @Transactional explicitly or one of the beans in the call-hierarchy.

+That's needed, because the context bound to `@TransactionScoped` needs to be active,

+before the `@TransactionScoped`-`EntityManager` gets resolved (internally).

+

+The following examples illustrate the described usages:

+

+.@TransactionScoped EntityManager combined with a simple repository

+[source,java]

+---------------------------------------------------------------------------------------

+public class EntityManagerProducer

+{

+    @Produces

+    @TransactionScoped

+    public EntityManager create() { ... }

+

+    public void close(@Disposes EntityManager em)  { ... }

+}

+

+@ApplicationScoped

+public class MyService

+{

+    @Inject

+    private MyRepository myRepository;

+

+    public void create()

+    {

+        //...

+        this.myRepository.save(...); //executed in a transaction

+        //...

+    }

+}

+

+@Transactional

+@Repository

+public interface MyRepository extends EntityRepository<MyEntity, String>

+{

+  //...

+}

+---------------------------------------------------------------------------------------

+

+.@TransactionScoped EntityManager combined with a simple repository called by a transactional bean

+[source,java]

+---------------------------------------------------------------------------------------

+public class EntityManagerProducer

+{

+    @Produces

+    @TransactionScoped

+    public EntityManager create() { ... }

+

+    public void close(@Disposes EntityManager em)  { ... }

+}

+

+@Transactional

+@ApplicationScoped

+public class MyService

+{

+    @Inject

+    private MyRepository myRepository;

+

+    public void create() //executed in a transaction

+    {

+        //...

+        this.myRepository.save(...);

+        //...

+    }

+}

+

+@Repository

+public interface MyRepository extends EntityRepository<MyEntity, String>

+{

+  //...

+}

+---------------------------------------------------------------------------------------

+

+=== Using Multiple EntityManagers

+

+While most applications will run just fine with a single

+`EntityManager`, there might be setups where multiple data sources are

+used. This can be configured with the `EntityManagerConfig` annotation:

+

+[source,java]

+--------------------------------------------------------------------------------------------------------------

+@Repository

+@EntityManagerConfig(entityManagerResolver = CrmEntityManagerResolver.class, flushMode = FlushModeType.COMMIT)

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+    ...

+}

+

+public class CrmEntityManagerResolver implements EntityManagerResolver

+{

+    @Inject @CustomerData // Qualifier - assumes a producer is around...

+    private EntityManager em;

+

+    @Override

+    public EntityManager resolveEntityManager()

+    {

+        return em;

+    }

+}

+--------------------------------------------------------------------------------------------------------------

+

+Again, note that annotations on interfaces do not inherit, so it is not

+possible to create something like a base `CrmRepository` interface with

+the `@EntityManagerConfig` and then extending / implementing this

+interface.

+

+=== Other EntityManager Methods

+

+While the `EntityRepository` methods should cover most interactions

+normally done with an `EntityManager`, for some specific cases it might

+still be useful to have one or the other method available. For this

+case, it is possible to extend / implement the `EntityManagerDelegate`

+interface for repositories, which offers most other methods available in

+a JPA 2.0 `EntityManager`:

+

+[source,java]

+-------------------------------------------------------------------------------------------------------

+@Repository

+public interface PersonRepository extends EntityRepository<Person, Long>, EntityManagerDelegate<Person>

+{

+    ...

+}

+-------------------------------------------------------------------------------------------------------

+

+Alternatively, you can extend the `FullEntityRepository` interface which is a short-hand for extending

+all of `EntityRepository`, `EntityManagerDelegate` and `CriteriaSupport`.

+

+[source,java]

+-------------------------------------------------------------------------------------------------------

+@Repository

+public interface PersonRepository extends FullEntityRepository<Person, Long>

+{

+    ...

+}

+-------------------------------------------------------------------------------------------------------

+

+For abstract classes, there is a convenience base class `AbstractFullEntityRepository` which also

+implements `EntityManagerDelegate` and `CriteriaSupport` and thus exposes most `EntityManager` methods:

+

+[source,java]

+-------------------------------------------------------------------------------------------------------

+@Repository

+public abstract PersonRepository extends AbstractFullEntityRepository<Person, Long>

+{

+    ...

+}

+-------------------------------------------------------------------------------------------------------

+

+== Query Method Expressions

+

+Good naming is a difficult aspects in software engineering. A good

+method name usually makes comments unnecessary and states exactly what

+the method does. And with method expressions, the method name is

+actually the implementation!

+

+=== Using Method Expressions

+

+Let's start by looking at a (simplified for readability) example:

+

+[source,java]

+------------------------------------------------------------------------

+@Entity

+public class Person

+{

+

+    @Id @GeneratedValue

+    private Long id;

+    private String name;

+    private Integer age;

+    private Gender gender;

+

+}

+

+@Repository

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    List<Person> findByNameLikeAndAgeBetweenAndGender(String name,

+                              int minAge, int maxAge, Gender gender);

+

+    long countByName(String name);

+

+    void removeByName(String name);

+}

+------------------------------------------------------------------------

+

+Looking at the method name, this can easily be read as query all Persons

+which have a name like the given name parameter, their age is between a

+min and a max age and having a specific gender. The DeltaSpike Data

+module can translate method names following a given format and directly

+generate the query implementation out of it (in EBNF-like form):

+

+----------------------------------------------------------------------------------

+(Entity|Optional<Entity>|List<Entity>|Stream<Entity>) (prefix)(Property[Comparator]){Operator Property [Comparator]}

+----------------------------------------------------------------------------------

+

+Or in more concrete words:

+

+* The query method must return an entity, an `Optional` of an entity, a list of entities or a stream of entities.

+* It must start with the `findBy` prefix (or related `findOptionalBy`, `findAnyBy`, `findAll`, `findFirst` or `findTop`).

+* Followed by a property of the Repository entity and an optional comparator (we'll define this later). The property will be used in the query together with the comparator. Note that the number of arguments passed to the method depend on the comparator.

+* You can add more blocks of property-comparator which have to be concatenated by a boolean operator. This is either an `And` or `Or`.

+

+You can also use the same way for delete an entity:

+* It must start with the `removeBy` keyword (or related `deleteBy`).

+

+or for counting:

+* It must start with the `countBy` keyword.

+* It must return a int or long.

+

+Other assumptions taken by the expression evaluator:

+

+* The property name starts lower cased while the property in the expression has an upper cases first character.

+

+Following comparators are currently supported to be used in method

+expressions:

+

+[options="header, autowidth"]

+|===

+| Name                |# of Arguments     |Description

+| Equal               |1 | Property must be equal to argument value. If the operator is omitted in the expression, this is assumed as default.

+| EqualIgnoreCase     |1 | Property must be equal to argument value (case insensitive).

+| IgnoreCase          |1 | Property must be equal to argument value (case insensitive).

+| NotEqual            |1 | Property must be not equal to argument value.

+| NotEqualIgnoreCase  |1 | Property must be not equal to argument value (case insensitive).

+| Like                |1 | Property must be like the argument value. Use the %-wildcard in the argument.

+| LikeIgnoreCase      |1 | Property must be like the argument value (case insensitive). Use the %-wildcard in the argument.

+| NotLike `*`         |1 | Property must be not like the argument value. Use the %-wildcard in the argument.

+| GreaterThan         |1 | Property must be greater than argument value.

+| GreaterThanEquals   |1 | Property must be greater than or equal to argument value.

+| LessThan            |1 | Property must be less than argument value.

+| LessThanEquals      |1 | Property must be less than or equal to argument value.

+| Between             |2 | Property must be between the two argument values.

+| IsNull              |0 | Property must be null.

+| IsNotNull           |0 | Property must be non-null.

+| In `*`              |1 | Property must be in the list of values given as a single argument. The argument should be of Collection type (e.g. List, Set, etc.).

+| NotIn `*`           |1 | Property must be not in the list of values given as a single argument. The argument should be of Collection type (e.g. List, Set, etc.).

+| True  `*`           |0 | Property must be true.

+| False `*`           |0 | Property must be false.

+| Containing `*`      |1 | Property must be like the argument value. Don't use the %-wildcard in the argument. The argument value would be automatically wrapped in a pair of %-wildcard.

+| StartingWith `*`    |1 | Property must begin with the argument value. Don't use the %-wildcard in the argument. A %-wildcard would be added automatically to the end of the argument value.

+| EndingWith `*`      |1 | Property must end with the argument value. Don't use the %-wildcard in the argument. A %-wildcard would be added automatically to the start of the argument value.

+|===

+

+`*` Comparator available since 1.9.1

+

+Note that DeltaSpike will validate those expressions during startup, so

+you will notice early in case you have a typo in those expressions.

+

+Also note that as of 1.7, the Entity type returned can either by the

+entity defined in this repository, or any other entity in your persistence

+unit, or any primitive type supported by your JPA implementation.

+

+=== Query Ordering

+

+Beside comparators it is also possible to sort queries by using the

+`OrderBy` keyword, followed by the attribute name and the direction

+(`Asc` or `Desc`).

+

+[source,java]

+------------------------------------------------------------------------------

+@Repository

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    List<Person> findByLastNameLikeOrderByAgeAscLastNameDesc(String lastName);

+

+}

+------------------------------------------------------------------------------

+

+=== Query Limits

+

+Starting with Apache DeltaSpike 1.6.2, you can apply query limits using method

+expressions.  They can be applied using `findFirst` or `findTop` prefixes in a

+method like this:

+

+[source,java]

+------------------------------------------------------------------------------

+@Repository

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    List<Person> findFirst2ByLastNameOrderByAgeAscLastNameDesc(String lastName);

+

+    List<Person> findTop2ByLastNameOrderByAgeAscLastNameDesc(String lastName);

+

+}

+------------------------------------------------------------------------------

+

+The number following the prefix indicates how many to limit by, when setting

+the `maxResults` attribute of the underlying query.  You can pair this with

+a `@FirstResult` parameter to give consistent paging.

+

+Query Limits can be applied even when there is no where clause defined by your

+query.

+

+[source,java]

+------------------------------------------------------------------------------

+@Repository

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    List<Person> findAllOrderByAgeAsc();

+

+    List<Person> findTop20OrderByLastNameDesc();

+

+}

+------------------------------------------------------------------------------

+

+The first query finding all entries ordered by age, and the second only 20

+ordered by last name.

+

+=== Nested Properties

+

+To create a comparison on a nested property, the traversal parts can be

+separated by a `_`:

+

+[source,java]

+------------------------------------------------------------------------

+@Repository

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    List<Person> findByCompany_companyName(String companyName);

+

+}

+------------------------------------------------------------------------

+

+=== Query Options

+

+

+DeltaSpike supports query options on method expressions. If you want to

+page a query, you can change the first result as well as the maximum

+number of results returned:

+

+[source,java]

+-----------------------------------------------------------------------------------------------

+@Repository

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    List<Person> findByNameLike(String name, @FirstResult int start, @MaxResults int pageSize);

+

+}

+-----------------------------------------------------------------------------------------------

+

+=== Method Prefix

+

+In case the `findBy` prefix does not comply with your team conventions,

+this can be adapted:

+

+[source,java]

+--------------------------------------------------------------------------------------------------

+@Repository(methodPrefix = "fetchWith")

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    List<Person> fetchWithNameLike(String name, @FirstResult int start, @MaxResults int pageSize);

+

+}

+--------------------------------------------------------------------------------------------------

+

+== Query Annotations

+

+While method expressions are fine for simple queries, they will often

+reach their limit once things get slightly more complex. Another aspect

+is the way you want to use JPA: The recommended approach using JPA for

+best performance is over named queries. To help incorporate those use

+cases, the DeltaSpike Data module supports also annotating methods for

+more control on the generated query.

+

+

+=== Using Query Annotations

+

+The simplest way to define a specific query is by annotating a method and

+providing the JPQL query string which has to be executed. In code, this

+looks like the following sample:

+

+[source,java]

+------------------------------------------------------------------------

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    @Query("select count(p) from Person p where p.age > ?1")

+    Long countAllOlderThan(int minAge);

+

+}

+------------------------------------------------------------------------

+

+The parameter binding in the query corresponds to the argument index in

+the method.

+

+You can also refer to a named query which is constructed and executed

+automatically. The `@Query` annotation has a named attribute which

+corresponds to the query name:

+

+[source,java]

+--------------------------------------------------------------------------------------------

+@Entity

+@NamedQueries({

+    @NamedQuery(name = Person.BY_MIN_AGE,

+                query = "select count(p) from Person p where p.age > ?1 order by p.age asc")

+})

+public class Person

+{

+

+    public static final String BY_MIN_AGE = "person.byMinAge";

+    ...

+

+}

+

+@Repository

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    @Query(named = Person.BY_MIN_AGE)

+    Long countAllOlderThan(int minAge);

+

+}

+--------------------------------------------------------------------------------------------

+

+Same as before, the parameter binding corresponds to the argument index

+in the method. If the named query requires named parameters to be used,

+this can be done by annotating the arguments with the `@QueryParam`

+annotation.

+

+TIP: Java does not preserve method parameter names (yet), that's why the

+annotation is needed.

+

+[source,java]

+---------------------------------------------------------------------------------------------

+@NamedQuery(name = Person.BY_MIN_AGE,

+            query = "select count(p) from Person p where p.age > :minAge order by p.age asc")

+

+...

+

+@Repository

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    @Query(named = Person.BY_MIN_AGE)

+    Long countAllOlderThan(@QueryParam("minAge") int minAge);

+

+}

+---------------------------------------------------------------------------------------------

+

+It is also possible to set a native SQL query in the annotation. The

+`@Query` annotation has a native attribute which flags that the query is

+not JPQL but plain SQL:

+

+[source,java]

+------------------------------------------------------------------------------------

+@Entity

+@Table(name = "PERSON_TABLE")

+public class Person

+{

+    ...

+}

+

+@Repository

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    @Query(value = "SELECT * FROM PERSON_TABLE p WHERE p.AGE > ?1", isNative = true)

+    List<Person> findAllOlderThan(int minAge);

+

+}

+------------------------------------------------------------------------------------

+

+=== Annotation Options

+

+Beside providing a query string or reference, the `@Query` annotation

+provides also two more attributes:

+

+[source,java]

+--------------------------------------------------------------------------------------

+@Repository

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    @Query(named = Person.BY_MIN_AGE, max = 10, lock = LockModeType.PESSIMISTIC_WRITE)

+    List<Person> findAllForUpdate(int minAge);

+

+}

+--------------------------------------------------------------------------------------

+

+[options="header, autowidth"]

+|===

+| Name | Description

+| max  | Limits the number of results.

+| lock | Use a specific LockModeType to execute the query.

+|===

+

+Note that these options can also be applied to method expressions.

+

+=== Query Options

+

+All the query options you have seen so far are more or less static. But

+sometimes you might want to apply certain query options dynamically. For

+example, sorting criteria could come from a user selection so they

+cannot be known beforehand. DeltaSpike allows you to apply query options

+at runtime by using the `QueryResult` result type:

+

+[source,java]

+------------------------------------------------------------------------

+@Repository

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    @Query("select p from Person p where p.age between ?1 and ?2")

+    QueryResult<Person> findAllByAge(int minAge, int maxAge);

+

+}

+------------------------------------------------------------------------

+

+Once you have obtained a `QueryResult`, you can apply further options to

+the query:

+

+[source,java]

+-----------------------------------------------------------

+List<Person> result = personRepository.findAllByAge(18, 65)

+    .orderAsc("p.lastName", false)

+    .orderDesc("p.age", false)

+    .lockMode(LockModeType.WRITE)

+    .hint("org.hibernate.timeout", Integer.valueOf(10))

+    .getResultList();

+-----------------------------------------------------------

+

+IMPORTANT: Note that sorting is only applicable to method expressions or non-named

+queries. For named queries it might be possible, but is currently only

+supported for Hibernate, EclipseLink and OpenJPA.

+

+Note that the `QueryResult` return type can also be used with method

+expressions.

+

+IMPORTANT: `QueryResult` is based on our internal understanding of your query.

+DeltaSpike expects the alias used in your queries to refer to the entity as `e`

+You can disable this behavior by passing in false with your attribute, `.orderDesc("p.age", false)`

+which would add descending ordering to your existing query `select p from Person p`

+

+=== Pagination

+

+We introduced the `QueryResult` type in the last chapter, which can also

+be used for pagination:

+

+[source,java]

+-----------------------------------------------------------

+// Query API style

+QueryResult<Person> paged = personRepository.findByAge(age)

+    .maxResults(10)

+    .firstResult(50);

+

+// or paging style

+QueryResult<Person> paged = personRepository.findByAge(age)

+    .withPageSize(10) // equivalent to maxResults

+    .toPage(5);

+

+int totalPages = paged.countPages();

+-----------------------------------------------------------

+

+=== Bulk Operations

+

+While reading entities and updating them one by one might be fine for

+many use cases, applying bulk updates or deletes is also a common usage

+scenario for repositories. DeltaSpike supports this with a special

+marking annotation `@Modifying`:

+

+[source,java]

+------------------------------------------------------------------------------

+@Repository

+public interface PersonRepository extends EntityRepository<Person, Long>

+{

+

+    @Modifying

+    @Query("update Person as p set p.classifier = ?1 where p.classifier = ?2")

+    int updateClassifier(Classifier current, Classifier next);

+

+}

+------------------------------------------------------------------------------

+

+Bulk operation query methods can either return void or int, which counts

+the number of entities affected by the bulk operation.

+

+=== Optional Query Results

+

+The JPA spec requires to throw exceptions in case the

+`getSingleResult()` method does either return no or more than one

+result. This can result in tedious handling with try-catch blocks or

+have potential impact on your transaction (as the `RuntimeException`

+might roll it back).

+

+DeltaSpike Data gives the option to change this to the way it makes most

+sense for the current usecase. While the default behavior is still fully

+aligned with JPA, it is also possible to request optional query results.

+

+=== Zero or One Result

+

+With this option, the query returns `null` instead of throwing a

+`NoResultException` when there is no result returned. It is usable with

+method expressions, `Query` annotations and `QueryResult<E>` calls.

+

+[source,java]

+----------------------------------------------------------------------------

+@Repository(forEntity = Person.class)

+public interface PersonRepository

+{

+

+    Person findOptionalBySsn(String ssn);

+

+    @Query(named = Person.BY_NAME, singleResult = SingleResultType.OPTIONAL)

+    Person findByName(String firstName, String lastName);

+

+}

+----------------------------------------------------------------------------

+

+For method expressions, the `findOptionalBy` prefix can be used. For

+`@Query` annotations, the `singleResult` attribute can be overridden

+with the `SingleResultType.OPTIONAL` enum.

+

+In case the query returns more than one result, a

+`NonUniqueResultException` is still thrown.

+

+=== Any Result

+

+If the caller does not really mind what kind if result is returned, it is

+also possible to request any result from the query. If there is no

+result, same as for optional queries `null` is returned. In case there

+is more than one result, any result is returned, or more concretely the

+first result out of the result list.

+

+[source,java]

+-----------------------------------------------------------------------

+@Repository(forEntity = Person.class)

+public interface PersonRepository

+{

+

+    Person findAnyByLastName(String lastName);

+

+    @Query(named = Person.BY_NAME, singleResult = SingleResultType.ANY)

+    Person findByName(String firstName, String lastName);

+

+}

+-----------------------------------------------------------------------

+

+For method expressions, the `findAnyBy` prefix can be used. For `@Query`

+annotations, the `singleResult` attribute can be overridden with the

+`SingleResultType.ANY` enum.

+

+This option will not throw an exception.

+

+=== Java 8 Semantics

+

+Repositories support returning instances of `java.util.Optional` and `java.util.stream.Stream` for any method.

+

+[source,java]

+-----------------------------------------------------------------------

+@Repository(forEntity = Person.class)

+public interface PersonRepository

+{

+

+    Optional<Person> findBySsn(String ssn);

+

+    Stream<Person> findByLocation(String location);

+

+}

+-----------------------------------------------------------------------

+

+Queries returning `Optional<T>` will behave like `SingleResultType.OPTIONAL`, if the data is present, return the single

+result, otherwise return `Optional.empty()`.  You can override this by using `SingleResultType.ANY` which takes the first

+result of the list, or else `empty()`.

+

+Queries returning `Stream<T>` act as a simple wrapper for `query.getResultList().stream()` to give back the results.

+

+=== Entity Graphs

+

+EntityGraphs are a feature added in JPA 2.1.  The Data module supports entity graphs for query operations, where the results

+will be limited based on a defined graph.  This feature is only available if you are using a JPA 2.1 implementation.

+

+`@EntityGraph` can be used for either `fetch` or `load` operations, depending on the `EntityGraphType` used in the annotation.  Most queries should use the `FETCH` option.

+

+==== Named Graphs

+

+Entity graphs can be selected by name.  A `@NamedEntityGraph` should be defined already within your persistence context to leverage this.  When this graph is referenced on a repository method, it will be applied to the query.

+

+==== Dyanmically built graphs

+

+If you want to dynamically build a graph, you can do that via the `paths` attribute of the annotation.  The paths specified will be added as graph nodes.  Each graph node will be used in the select.  The format is the full path to the property, based on the property names.

+

+== Transactions

+

+If you call any method expression, `@Query`-annotated method or a method

+from the `EntityRepository`, the repository will figure out if a

+transaction is needed or not, and if so, if there is already one

+ongoing. The Data module uses the `TransactionStrategy` provided by the

+http://deltaspike.apache.org/documentation/jpa.html[JPA Module] for this. See the JPA

+module documentation for more details.

+

+IMPORTANT: Some containers do not support `BeanManagedUserTransactionStrategy`! As

+JTA has still some portability issues even in Java EE 7, it might be

+required that you implement your own `TransactionStrategy`. We will

+think about providing an acceptable solution for this.

+

+

+If you need to open a transaction on a concrete repository method, we

+currently recommend creating an extension (see next chapter) which uses

+`@Transactional` and might look like the following sample.

+

+[source,java]

+---------------------------------------------------------------------------------------

+public class TxExtension<E> implements DelegateQueryHandler, TxRepository // this is your extension interface

+{

+    @Inject

+    private EntityManager em;

+

+    @Override @Transactional

+    public List<E> transactional(ListResultCallback callback)

+    {

+        return callback.execute();

+    }

+

+}

+---------------------------------------------------------------------------------------

+

+Repositories can then implement the `TxRepository` interface and call

+their queries in the `transactional` method (where the callback

+implementation can be, for example, in an anonymous class).

+

+== Extensions

+

+=== Query Delegates

+

+While several base interfaces are defined for repositories, there might still be

+the odd convenience method that is missing. This is actually intentional

+- things should not get overloaded for each and every use case. That's

+why in DeltaSpike you can define your own reusable methods.

+

+For example, you might want to use the QueryDsl library in your

+repositories:

+

+[source,java]

+---------------------------------------------------------

+import com.mysema.query.jpa.impl.JPAQuery;

+

+public interface QueryDslSupport

+{

+    JPAQuery jpaQuery();

+}

+

+@Repository(forEntity = Person.class)

+public interface PersonRepository extends QueryDslSupport

+{

+   ...

+}

+---------------------------------------------------------

+

+=== Implementing the Query Delegate

+

+The first step is to define an interface which contains the extra

+methods for your repositories (as shown above):

+

+[source,java]

+--------------------------------

+public interface QueryDslSupport

+{

+    JPAQuery jpaQuery();

+}

+--------------------------------

+

+As a next step, you need to provide an implementation for this interface

+once. It is also important that this implementation implements the

+`DelegateQueryHandler` interface (do not worry, this is just an empty

+marker interface):

+

+[source,java]

+--------------------------------------------------------------------------------------------

+public class QueryDslRepositoryExtension<E> implements QueryDslSupport, DelegateQueryHandler

+{

+

+    @Inject

+    private QueryInvocationContext context;

+

+    @Override

+    public JPAQuery jpaQuery()

+    {

+        return new JPAQuery(context.getEntityManager());

+    }

+

+}

+--------------------------------------------------------------------------------------------

+

+As you see in the sample, you can inject a `QueryInvocationContext`

+which contains utility methods like accessing the current

+`EntityManager` and entity class.

+

+Note that, if you define multiple extensions with equivalent method

+signatures, there is no specific order in which the implementation is

+selected.

+

+== Mapping

+

+While repositories are primarily intended to work with Entities, it

+might be preferable in some cases to have an additional mapping layer on

+top of them, for example because the Entities are quite complex but the service

+layer needs only a limited view on it, or because the Entities are

+exposed over a remote interface and there should not be a 1:1 view on

+the domain model.

+

+DeltaSpike Data allows to directly plugin in such a mapping mechanism

+without the need to specify additional mapping methods:

+

+[source,java]

+----------------------------------------------------

+@Repository(forEntity = Person.class)

+@MappingConfig(PersonDtoMapper.class)

+public interface PersonRepository

+{

+

+    PersonDto findBySsn(String ssn);

+

+    List<PersonDto> findByLastName(String lastName);

+

+}

+----------------------------------------------------

+

+The `PersonDtoMapper` class has to implement the `QueryInOutMapper`

+interface:

+

+[source,java]

+---------------------------------------------------------------------------------

+public class PersonDtoMapper implements QueryInOutMapper<Person>

+{

+

+    @Override

+    public Object mapResult(Person result)

+    {

+        ... // converts Person into a PersonDto

+    }

+    ...

+

+    @Override

+    public Object mapResultList(List<Person> result)

+    {

+        ... // result lists can also be mapped into something different

+            // than a collection.

+    }

+

+    @Override

+    public boolean mapsParameter(Object parameter)

+    {

+        return parameter != null && (

+                parameter instanceof PersonDto || parameter instanceof PersonId);

+    }

+

+    @Override

+    public Object mapParameter(Object parameter)

+    {

+        ... // converts query parameters if required

+    }

+}

+---------------------------------------------------------------------------------

+

+The mapper can also be used to transform query parameters. Parameters

+are converted before executing queries and calling repository

+extensions.

+

+Note that those mapper classes are treated as CDI Beans, so it is

+possible to use injection in those beans (e.g. you might inject an

+`EntityManager` or other mappers). As the `@MappingConfig` refers to the

+mapper class directly, the mapper must be uniquely identifiable by its

+class.

+

+It is also possible to combine mappings with the base Repository classes:

+

+[source,java]

+-------------------------------------------------------------------------------

+@Repository(forEntity = Person.class)

+@MappingConfig(PersonDtoMapper.class)

+public interface PersonRepository extends EntityRepository<PersonDto, PersonId>

+{

+    ...

+}

+-------------------------------------------------------------------------------

+

+In this case, the `forEntity` attribute in the `@Repository` annotation

+is mandatory. Also it is up to the mapper to convert parameters

+correctly (in this example, a conversion from a `PersonDto` parameter to

+`Person` entity and from `PersonId` to `Long` is necessary).

+

+=== Simple Mappings

+

+In many cases it is just required to map a DTO object back and forth. For

+this case, the `SimpleQueryInOutMapperBase` class can be subclassed,

+which only requires to override three methods:

+

+[source,java]

+-------------------------------------------------------------------------------

+public class PersonMapper extends SimpleQueryInOutMapperBase<Person, PersonDto>

+{

+

+    @Override

+    protected Object getPrimaryKey(PersonDto dto)

+    {

+        return dto.getId();

+    }

+

+    @Override

+    protected PersonDto toDto(Person entity)

+    {

+        ...

+    }

+

+    @Override

+    protected Person toEntity(Person entity, PersonDto dto) {

+        ...

+        return entity;

+    }

+}

+-------------------------------------------------------------------------------

+

+The first method, `getPrimaryKey`, identifies the primary key of an

+incoming DTO (this might need mapping too). If there is a primary key in

+the DTO, Data tries to retrieve the Entity and feed it to the `toEntity`

+method, so the entity to be mapped is **attached to the persistence

+context**. If there is no primary key, a new instance of the Entity is

+created. In any case, there is no need to map the primary key to the

+entity (it either does not exist or is already populated for an existing

+entity).

+

+== JPA Criteria API Support

+

+Besides automatic query generation, the DeltaSpike Data module also

+provides a DSL-like API to create JPA 2 Criteria queries. It takes

+advantage of the JPA 2 meta model, which helps creating type safe

+queries.

+

+TIP: The JPA meta model can easily be generated with an annotation processor.

+Hibernate or EclipseLink provide such a processor, which can be

+integrated into your compile and build cycle.

+

+Note that this criteria API is not intended to replace the standard

+criteria API - it is rather a utility API that should make life easier on

+the most common cases for a custom query. The JPA criteria API's

+strongest point is certainly its type safety - which comes at the cost

+of readability. We're trying to provide a middle way here. A less

+powerful API, but still type safe and readable.

+

+=== API Usage

+

+The API is centered around the Criteria class and is targeted to provide

+a fluent interface to write criteria queries:

+

+[source,java]

+---------------------------------------------------------------------------

+@Repository(forEntity = Person.class)

+public abstract class PersonRepository implements CriteriaSupport<Person>

+{

+

+    public List<Person> findAdultFamilyMembers(String name, Integer minAge)

+    {

+        return criteria()

+                .like(Person_.name, "%" + name + "%")

+                .gtOrEq(Person_.age, minAge)

+                .eq(Person_.validated, Boolean.TRUE)

+                .orderDesc(Person_.age)

+                .getResultList();

+    }

+

+}

+---------------------------------------------------------------------------

+

+Following comparators are supported by the API:

+

+[options="header,autowidth"]

+|===

+| Name                    | Description

+| .eq(..., ...)           | Property value must be equal to the given value

+| .in(..., ..., ..., ...) | Property value must be in one of the given values.

+| .notEq(..., ...)        | Negates equality

+| .like(..., ...)         | A SQL `like` equivalent comparator. Use % on the value.

+| .notLike(..., ...)      | Negates the like value

+| .lt(..., ...)           | Property value must be less than the given value.

+| .ltOrEq(..., ...)       | Property value must be less than or equal to the given value.

+| .gt(..., ...)           | Property value must be greater than the given value.

+| .ltOrEq(..., ...)       | Property value must be greater than or equal to the given value.

+| .between(..., ..., ...) | Property value must be between the two given values.

+| .isNull(...)            | Property must be `null`

+| .isNotNull(...)         | Property must be non-`null`

+| .isEmpty(...)           | Collection property must be empty

+| .isNotEmpty(...)        |Collection property must be non-empty

+|===

+

+The query result can be modified with the following settings:

+

+[options="header,autowidth"]

+|===

+| Name                     | Description

+| .orderAsc(...)           | Sorts the result ascending by the given property. Note that this can be applied to several properties

+| .orderDesc(...)          | Sorts the result descending by the given property. Note that this can be applied to several properties

+| .distinct()              | Sets distinct to true on the query.

+|===

+

+Once all comparators and query options are applied, the `createQuery()`

+method is called. This creates a JPA TypedQuery object for the

+repository entity. If required, further processing can be applied here.

+

+=== Joins

+

+For simple cases, restricting on the repository entity only works out

+fine, but once the Data model gets more complicated, the query will have

+to consider relations to other entities. The module's criteria API

+therefore supports joins as shown in the sample below:

+

+[source,java]

+-------------------------------------------------------------------------------------

+@Repository

+public abstract class PersonRepository extends AbstractFullEntityRepository<Person, Long>

+{

+

+    public List<Person> findByCompanyName(String companyName)

+    {

+        return criteria()

+                .join(Person_.company,

+                    where(Company.class)

+                        .eq(Company_.name, companyName)

+                )

+                .eq(Person_.validated, Boolean.TRUE)

+                .getResultList();

+    }

+

+}

+-------------------------------------------------------------------------------------

+

+Beside the inner and outer joins, also fetch joins are supported. Those

+are slighly simpler as seen in the next sample:

+

+[source,java]

+-------------------------------------------------------------------------------------

+public abstract class PersonRepository extends AbstractFullEntityRepository<Person, Long>

+{

+

+    public Person findBySSN(String ssn)

+    {

+        return criteria()

+                .fetch(Person_.familyMembers)

+                .eq(Person_.ssn, ssn)

+                .distinct()

+                .getSingleResult();

+    }

+

+}

+-------------------------------------------------------------------------------------

+

+=== Boolean Operators

+

+By default, all query operators are concatenated as an and conjunction

+to the query. The DeltaSpike criteria API also allows to add groups of

+disjunctions.

+

+[source,java]

+-------------------------------------------------------------------------------------

+public abstract class PersonRepository extends AbstractFullEntityRepository<Person, Long>

+{

+

+    public List<Person> findAdults()

+    {

+        return criteria()

+                .or(

+                    criteria().

+                        .gtOrEq(Person_.age, 18)

+                        .eq(Person_.origin, Country.SWITZERLAND),

+                    criteria().

+                        .gtOrEq(Person_.age, 21)

+                        .eq(Person_.origin, Country.USA)

+                )

+                .getResultList();

+    }

+

+}

+-------------------------------------------------------------------------------------

+

+=== Selections

+

+It might not always be appropriate to retrieve full entities - you might

+also be interested in scalar values or by modified entity attributes.

+The Criteria interface allows this with the selection method:

+

+[source,java]

+------------------------------------------------------------------------------------------------------

+public abstract class PersonRepository extends AbstractFullEntityRepository<Person, Long>

+{

+

+    public Statistics ageStatsFor(Segment segment)

+    {

+        return criteria()

+                 .select(Statistics.class, avg(Person_.age), min(Person_.age), max(Person_.age))

+                 .eq(Person_.segment, segment)

+                 .getSingleResult();

+    }

+

+    public List<Object[]> personViewForFamily(String name)

+    {

+        return criteria()

+                 .select(upper(Person_.name), attribute(Person_.age), substring(Person_.firstname, 1))

+                 .like(Person_.name, name)

+                 .getResultList();

+    }

+

+}

+------------------------------------------------------------------------------------------------------

+

+There are also several functions supported which can be used in the

+selection clause:

+

+[options="header,autowidth"]

+|===

+|Name                              | Description

+| abs(...)                         | Absolute value. Applicable to Number attributes.

+| avg(...)                         | Average value. Applicable to Number attributes.

+| count(...)                       | Count function. Applicable to Number attributes.

+| max(...)                         | Max value. Applicable to Number attributes.

+| min(...)                         | Min value. Applicable to Number attributes.

+| modulo(...)                      | Modulo function. Applicable to Integer attributes.

+| neg(...)                         | Negative value. Applicable to Number attributes.

+| sum(...)                         | Sum function. Applicable to Number attributes.

+| lower(...)                       | String to lowercase. Applicable to String attributes.

+| substring(int from, ...)         | Substring starting from. Applicable to String attributes.

+| substring(int from, int to, ...) | Substring starting from ending to. Applicable to String attributes.

+| upper(...)                       | String to uppercase. Applicable to String attributes.

+| currDate()                       | The DB sysdate. Returns a Date object.

+| currTime()                       | The DB sysdate. Returns a Time object.

+| currTStamp()                     | The DB sysdate. Returns a Timestamp object.

+|===

+

+

+== Auditing

+

+A common requirement for entities is tracking what is being done with

+them. DeltaSpike provides a convenient way to support this requirement.

+

+NOTE: DeltaSpike does not support creating revisions of entities. If this is a

+requirement for your audits, have a look at Hibernate Envers.

+

+=== Activating Auditing

+

+DeltaSpike uses an entity listener to update auditing data before

+entities get created or update. The entity listener must be activated

+before it can be used. This can either be done globally for all entities

+of a persistent unit or per entity.

+

+Activation per persistence unit in `orm.xml`:

+

+[source,xml]

+-----------------------------------------------------------------------------------------------------------------------------------------

+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"

+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

+        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd" version="2.0">

+    <persistence-unit-metadata>

+        <persistence-unit-defaults>

+            <entity-listeners>

+                <entity-listener class="org.apache.deltaspike.data.impl.audit.AuditEntityListener" />

+            </entity-listeners>

+        </persistence-unit-defaults>

+    </persistence-unit-metadata>

+</entity-mappings>

+-----------------------------------------------------------------------------------------------------------------------------------------

+

+Activation per entity:

+

+[source,java]

+-------------------------------------------

+@Entity

+@EntityListeners(AuditEntityListener.class)

+public class AuditedEntity

+{

+

+    ...

+

+}

+-------------------------------------------

+

+Note that for this variant, you need a compile dependency on the impl

+module. Alternatively, also the per entity listener can be configured by

+XML.

+

+=== Using Auditing Annotations

+

+All that has to be done now is annotating the entity properties which

+are used to audit the entity.

+

+====  Updating Timestamps

+

+To keep track on creation and modification times, following annotations

+can be used:

+

+[source,java]

+-------------------------------------

+@Entity

+public class AuditedEntity

+{

+

+    ...

+

+    @Temporal(TemporalType.TIMESTAMP)

+    @CreatedOn

+    private Date created;

+

+    @Temporal(TemporalType.TIMESTAMP)

+    @ModifiedOn

+    private Date updated;

+

+    ...

+

+}

+-------------------------------------

+

+In case the modification date should also be set during entity creation,

+the annotation can be customized:

+

+-----------------------------

+@ModifiedOn(setOnCreate=true)

+-----------------------------

+

+====  Who's Changing My Entities?

+

+Beside keeping track of when a change has happened, it is also often

+critical to track who's responsible for the change. Annotate a user

+tracking field with the following annotation:

+

+[source,java]

+-----------------------------

+@Entity

+public class AuditedEntity

+{

+

+    ...

+

+    @ModifiedBy

+    private String auditUser;

+

+    ...

+

+}

+-----------------------------

+

+Now a little help is needed. The entity listener needs to be able to

+resolve the current user - there must be a bean available of the

+matching type for the annotation property, exposed over a special CDI

+qualifier:

+

+[source,java]

+----------------------------------

+public class UserProvider

+{

+

+    @Inject

+    private User user;

+

+    @Produces @CurrentUser

+    public String currentUser() {

+        return user.getUsername();

+    }

+

+    ...

+

+}

+----------------------------------

+

+TIP: The JPA Spec does not recommend to modify entity relations from within a

+lifecycle callback. If you expose another entity here, make sure that

+your persistence provider supports this. Also you should ensure that the

+entity is attached to a persistent context. Also, be aware that the CDI

+container will proxy a scoped bean, which might confuse the persistence

+provider when persisting / updating the target entity.

diff --git a/pom.xml b/pom.xml
index 9862f8b..52c5c44 100644
--- a/pom.xml
+++ b/pom.xml
@@ -37,7 +37,7 @@
     -->
     <groupId>org.apache.deltaspike</groupId>
     <artifactId>deltaspike</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike</name>
@@ -48,8 +48,8 @@
 
     <properties>
         <asciidoctor.version>1.5.2</asciidoctor.version>
-        <version.deltaspike.latest.stable>1.8.2</version.deltaspike.latest.stable>
-        <version.deltaspike.latest.snapshot>1.9.0-SNAPSHOT</version.deltaspike.latest.snapshot>
+        <version.deltaspike.latest.stable>1.9.0</version.deltaspike.latest.stable>
+        <version.deltaspike.latest.snapshot>1.9.1-SNAPSHOT</version.deltaspike.latest.snapshot>
         <svn.scmPubCheckoutDirectory>${project.build.directory}/co-site</svn.scmPubCheckoutDirectory>
     </properties>
 
diff --git a/site/pom.xml b/site/pom.xml
index 56513c9..3300d3a 100644
--- a/site/pom.xml
+++ b/site/pom.xml
@@ -24,13 +24,13 @@
     <parent>
         <groupId>org.apache.deltaspike</groupId>
         <artifactId>deltaspike</artifactId>
-        <version>1.9.0-SNAPSHOT</version>
+        <version>1.9.1-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
 
     <groupId>org.apache.deltaspike</groupId>
     <artifactId>deltaspike-site</artifactId>
-    <version>1.9.0-SNAPSHOT</version>
+    <version>1.9.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>Apache DeltaSpike Site</name>
diff --git a/site/src/main/asciidoc/external.adoc b/site/src/main/asciidoc/external.adoc
index ea7d08d..150bae0 100644
--- a/site/src/main/asciidoc/external.adoc
+++ b/site/src/main/asciidoc/external.adoc
@@ -1,183 +1,210 @@
-= External Examples and Templates
-
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
-A number of DeltaSpike examples and templates have been developed external to the DeltaSpike project. These extend the DeltaSpike resources from which you can see DeltaSpike in action. Brief information is given here about the examples and templates, with details of where they can be obtained from.
-
-== Books (free/online)
-
-**CDI@Work (chapter about DeltaSpike):** http://cdiatwork.irian.at/
-
-CDI@Work is a free online book about CDI as well as Apache DeltaSpike.
-It covers basic information about CDI and DeltaSpike up to more advanced use-cases.
-An example for the latter is a type-safe configuration (interface-only)
-which allows you to resolve the configured values even from dynamic config-sources like a database and
-store them in a custom Config-Scoped cache which can be refreshed via CDI-events or a CRON based task or manually via JMX.
-
-The https://github.com/CDIatWork/[GitHub account] contains repositories e.g. for the sample application called IdeaFork.
-The commit-history follows the steps in the book. In most cases every commit translates to one step in the book.
-(Chapters are released once they are ready.)
-
-== Presentations
-
-=== Apache DeltaSpike: The CDI toolbox
-CDI portable extensions are one of greatest features of Java EE allowing the platform to be extended in a clean and portable way. But allowing extension is just part of the story. CDI opens the door to a whole new eco-system for Java EE, but it’s not the role of the specification to create these extensions. 
-Apache DeltaSpike is the project that leads this brand new eco-system by providing useful extension modules for CDI applications as well as tools to ease the creation of new ones.
-In this session, we’ll start by presenting the DeltaSpike toolbox and show how it helps you to develop for CDI. Then we’ll describe the major extensions included in Deltaspike, including  'configuration', 'scheduling' and 'data'.
-
-
-**Slides:** http://www.slideshare.net/antoinesd/apache-deltaspike-the-cdi-toolbox
-
-**Video:** https://www.youtube.com/watch?v=QbNdFvNPvVU
-
-**Event:** http://www.meetup.com/JBoss-User-Group-Worldwide/events/218755922/
-
-=== DeltaSpike: CDI extensions of the world, unite!
-Several popular CDI extension frameworks like Seam 3 and MyFaces CODI have faded out over the years. But not to worry - their functionality is taken over by projects like Picketlink, Agorava, and mainly DeltaSpike, a new Apache project that wants CDI extension authors to unite in an effort to make the life of web application developers easier. Even without a five year plan! 
-
-**Slides:** http://devconf.cz/filebrowser/download/414
-
-**Video:** https://www.youtube.com/watch?v=2FUNpzd1Nb8
-
-=== Apache DeltaSpike
-Presentation about Apache DeltaSpike
-
-**Slides:** http://www.slideshare.net/os890/apache-deltaspike
-
-=== MyFaces CODI and JBoss Seam3 become Apache DeltaSpike
-These slides show how to use type-safe mechanisms provided by MyFaces CODI for developing JSF applications which are more type-safe and easier to maintain as well as common pitfalls. Beyond that there is an basic overview of Apache DeltaSpike.
-
-**Slides:** http://www.slideshare.net/os890/myfaces-codi-and-jboss-seam3-become-apache-deltaspike
-
-=== Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
-This talk is a detailed case study about the migration of a JSF-based web application from Spring 3 to Java EE 7 and CDI. It is presented at the JavaOne 2014 conference. 
-
-**Slides:** http://www.slideshare.net/MarioLeanderReimer/migrating-a-jsfbased-web-application-from-spring-3-to-java-ee-7-and-cdi
-
-**Video:** https://parleys.com/play/543faae5e4b06e1184ae423a/about
-
-=== [de] Flexibilitaet mit CDI und Apache DeltaSpike
-Presentation about DeltaSpike
-
-**Slides:** http://www.slideshare.net/os890/flexibilitaet-mit-cdi-und-apache-delta-spike
-
-=== [pt-BR] Deixando de refazer a roda com Apache DeltaSpike
-CDI e DeltaSpike presentation in TDC - The Developers Conference 2015
-
-**Video and Slides:** http://www.infoq.com/br/presentations/deixando-de-refazer-a-roda-com-apache-deltaspike
-
-
-== Examples
-
-=== IdeaFork (full)
-This example is a Java EE6 application which illustrates several features of CDI and DeltaSpike.
-It covers features of all modules provided by DeltaSpike.
-There are profiles to create web-archives for Apache TomEE, JBoss AS7 (and WildFly) and Oracle GlassFish3.
-The complexity is mixed. There are some simple examples as well as some more advanced cases.
-The repository contains every step (one commit is one step) described in the online-book.
-
-**Source code:** https://github.com/CDIatWork/IdeaFork
-
-=== IdeaFork (lite)
-This example is based on IdeaFork (full),
-but without some indirections which were needed to demonstrate different features of CDI and DeltaSpike (in a simple Application).
-
-**Source code (beta - work in progress):** https://github.com/CDIatWork/IdeaForkLite_Beta
-
-
-=== Confess 2012 Workshop Demo
-This example was prepared for the Confess workshop and demonstrates how to use DeltaSpike instead of and side-by-side with MyFaces CODI. The secured web application demonstrates presenting users with differentiating content based on their account status.
-
-**Source code:** https://github.com/confess/confess2012_deltaspike
-
-=== Fullstack EE6+ with DeltaSpike
-Simple example based on Java EE6+ and DeltaSpike (tested with EE6 and EE7).
-
-**Source code:** https://github.com/os890/ee6-ds-demo
-
-=== Fullstack CODI to DeltaSpike
-This pair of examples show how to achieve the most important MyFaces CODI features with DeltaSpike and also how to migrate a CODI project to DeltaSpike. The examples are basic, compacting core CODI features into just a few JSF pages, and are intended for deployment with TomEE. 
-
-**Source code:** https://github.com/os890/tomee_mf_stack_001
-
-* CODI version in master branch
-* Migrated DeltaSpike version in codi2ds branch
-
-=== JBoss Quickstarts 
-The JBoss quickstarts are small working examples that demonstrate recommended practices for specific Java EE technology use cases. A subset of these quickstarts are dedicated to demonstrating DeltaSpike, including custom authorization restrictions using annotations, constructing and modifying beans, extending the influence of CDI using BeanManager, and deactivating DeltaSpike features.
-
-**Source code:** https://github.com/jboss-developer/jboss-wfk-quickstarts
-
-=== DeltaSpike Examples
-A collection of example applications demonstrating the features of the DeltaSpike project.
-
-**Source code:** https://github.com/rsmeral/deltaspike-examples
-
-=== [pt-BR] DeltaSpike microblog example
-Application that shows a microblog using DeltaSpike
-
-**Source code:** https://github.com/rafabene/demo_deltaspike
-
-=== Why you should consider using Apache DeltaSpike
-Blog post demonstrating 5 features of Apache DeltaSpike
-
-**Blog post:** http://www.thedevpiece.com/why-you-should-consider-using-apache-deltaspike/
-
-== Magazines
-
-=== [pt-BR] Brazilian Java Magazine
-Apache DeltaSpike: CDI Programável
-
-**Online article:** http://www.devmedia.com.br/apache-deltaspike-cdi-programavel/31982
-
-== Interviews
-
-=== [pt-BR] InfoQ Brazil
-Apache DeltaSpike, a API de extensions do CDI
-
-**Online interview:** http://www.infoq.com/br/interviews/entrevista-rafael-benevides-delta-spike
-
-=== [pt-BR] InfoQ Brazil
-O que é DeltaSpike?
-
-**Online interview:** https://www.youtube.com/watch?v=jtCuxfPxDE8
-
-== Templates
-=== Java SE + CDI + DS
-**Source code:** https://github.com/os890/javase-cdi-ds-project-template
-
-=== JSF + CDI + DS (Servlet-Container)
-**Source code:** https://github.com/os890/javaweb-cdi-ds-project-template
- 
-=== EJB + CDI + DS (Module)
-**Source code:** https://github.com/os890/javaee_cdi_ejb_ds_project_template
-
-=== JSF + EJB + CDI + DS (EE-Server)
-**Source code:** https://github.com/os890/javaee_jsf_cdi_ejb_ds_project_template
-
-=== JSF + JPA + CDI + DS-Data (diff. EE-Server-Profiles)
-**Source code:** https://github.com/os890/javaee_jsf_cdi_jpa_data_ds_project_template
-
-=== JSF + JPA + CDI + DS-Data (Apache TomEE)
-**Source code:** https://github.com/os890/ds-data-project-template
-
-=== JSF + CDI + DS (Apache TomEE)
-**Source code:** https://github.com/os890/tomee-ds-project-template
-
-== Add-ons
-
-=== lbitonti@github
-This GitHub account contains e.g. a DBUnit Add-on for the Test-Control-Module of DeltaSpike.
-
-**Source code:** https://github.com/lbitonti/deltaspike-dbunit
-
-=== os890@github
-This GitHub account contains several DeltaSpike Add-ons e.g. to integrate CDI with other frameworks.
-
-**Source code:** https://github.com/os890/
-
-=== rmannibucau@github
-This GitHub account contains several DeltaSpike Add-ons e.g. an integration with the TomEE PasswordCipher API.
-
-**Source code:** https://github.com/rmannibucau/
-
+= External Examples and Templates

+

+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

+

+A number of DeltaSpike examples and templates have been developed external to the DeltaSpike project. These extend the DeltaSpike resources from which you can see DeltaSpike in action. Brief information is given here about the examples and templates, with details of where they can be obtained from.

+

+== Books (free/online)

+

+**CDI@Work (chapter about DeltaSpike):** http://cdiatwork.irian.at/

+

+CDI@Work is a free online book about CDI as well as Apache DeltaSpike.

+It covers basic information about CDI and DeltaSpike up to more advanced use-cases.

+An example for the latter is a type-safe configuration (interface-only)

+which allows you to resolve the configured values even from dynamic config-sources like a database and

+store them in a custom Config-Scoped cache which can be refreshed via CDI-events or a CRON based task or manually via JMX.

+

+The https://github.com/CDIatWork/[GitHub account] contains repositories e.g. for the sample application called IdeaFork.

+The commit-history follows the steps in the book. In most cases every commit translates to one step in the book.

+(Chapters are released once they are ready.)

+

+== Presentations

+

+=== Apache DeltaSpike: The CDI toolbox

+CDI portable extensions are one of greatest features of Java EE allowing the platform to be extended in a clean and portable way. But allowing extension is just part of the story. CDI opens the door to a whole new eco-system for Java EE, but it’s not the role of the specification to create these extensions. 

+Apache DeltaSpike is the project that leads this brand new eco-system by providing useful extension modules for CDI applications as well as tools to ease the creation of new ones.

+In this session, we’ll start by presenting the DeltaSpike toolbox and show how it helps you to develop for CDI. Then we’ll describe the major extensions included in Deltaspike, including  'configuration', 'scheduling' and 'data'.

+

+

+**Slides:** http://www.slideshare.net/antoinesd/apache-deltaspike-the-cdi-toolbox

+

+**Video:** https://www.youtube.com/watch?v=QbNdFvNPvVU

+

+**Event:** http://www.meetup.com/JBoss-User-Group-Worldwide/events/218755922/

+

+=== DeltaSpike: CDI extensions of the world, unite!

+Several popular CDI extension frameworks like Seam 3 and MyFaces CODI have faded out over the years. But not to worry - their functionality is taken over by projects like Picketlink, Agorava, and mainly DeltaSpike, a new Apache project that wants CDI extension authors to unite in an effort to make the life of web application developers easier. Even without a five year plan! 

+

+**Slides:** http://devconf.cz/filebrowser/download/414

+

+**Video:** https://www.youtube.com/watch?v=2FUNpzd1Nb8

+

+=== Apache DeltaSpike

+Presentation about Apache DeltaSpike

+

+**Slides:** http://www.slideshare.net/os890/apache-deltaspike

+

+=== MyFaces CODI and JBoss Seam3 become Apache DeltaSpike

+These slides show how to use type-safe mechanisms provided by MyFaces CODI for developing JSF applications which are more type-safe and easier to maintain as well as common pitfalls. Beyond that there is an basic overview of Apache DeltaSpike.

+

+**Slides:** http://www.slideshare.net/os890/myfaces-codi-and-jboss-seam3-become-apache-deltaspike

+

+=== Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI

+This talk is a detailed case study about the migration of a JSF-based web application from Spring 3 to Java EE 7 and CDI. It is presented at the JavaOne 2014 conference. 

+

+**Slides:** http://www.slideshare.net/MarioLeanderReimer/migrating-a-jsfbased-web-application-from-spring-3-to-java-ee-7-and-cdi

+

+**Video:** https://parleys.com/play/543faae5e4b06e1184ae423a/about

+

+=== [de] Flexibilitaet mit CDI und Apache DeltaSpike

+Presentation about DeltaSpike

+

+**Slides:** http://www.slideshare.net/os890/flexibilitaet-mit-cdi-und-apache-delta-spike

+

+=== [pt-BR] Deixando de refazer a roda com Apache DeltaSpike

+CDI e DeltaSpike presentation in TDC - The Developers Conference 2015

+

+**Video and Slides:** http://www.infoq.com/br/presentations/deixando-de-refazer-a-roda-com-apache-deltaspike

+

+=== Apache Deltaspike the CDI Toolbox (Java One 2015)

+

+**Slides:** https://pt.slideshare.net/antoinesd/apache-deltaspike-the-cdi-toolbox-java-one-2015

+

+=== JavaOne 2015 - Rafael Benevides - Apache DeltaSpike, the CDI Toolbox

+

+**Video:** https://www.youtube.com/watch?v=3McmEi3cs_s

+

+== Examples

+

+=== IdeaFork (full)

+This example is a Java EE6 application which illustrates several features of CDI and DeltaSpike.

+It covers features of all modules provided by DeltaSpike.

+There are profiles to create web-archives for Apache TomEE, JBoss AS7 (and WildFly) and Oracle GlassFish3.

+The complexity is mixed. There are some simple examples as well as some more advanced cases.

+The repository contains every step (one commit is one step) described in the online-book.

+

+**Source code:** https://github.com/CDIatWork/IdeaFork

+

+=== IdeaFork (lite)

+This example is based on IdeaFork (full),

+but without some indirections which were needed to demonstrate different features of CDI and DeltaSpike (in a simple Application).

+

+**Source code (beta - work in progress):** https://github.com/CDIatWork/IdeaForkLite_Beta

+

+

+=== Confess 2012 Workshop Demo

+This example was prepared for the Confess workshop and demonstrates how to use DeltaSpike instead of and side-by-side with MyFaces CODI. The secured web application demonstrates presenting users with differentiating content based on their account status.

+

+**Source code:** https://github.com/confess/confess2012_deltaspike

+

+=== Fullstack EE6+ with DeltaSpike

+Simple example based on Java EE6+ and DeltaSpike (tested with EE6 and EE7).

+

+**Source code:** https://github.com/os890/ee6-ds-demo

+

+=== Fullstack CODI to DeltaSpike

+This pair of examples show how to achieve the most important MyFaces CODI features with DeltaSpike and also how to migrate a CODI project to DeltaSpike. The examples are basic, compacting core CODI features into just a few JSF pages, and are intended for deployment with TomEE. 

+

+**Source code:** https://github.com/os890/tomee_mf_stack_001

+

+* CODI version in master branch

+* Migrated DeltaSpike version in codi2ds branch

+

+=== JBoss Quickstarts 

+The JBoss quickstarts are small working examples that demonstrate recommended practices for specific Java EE technology use cases. A subset of these quickstarts are dedicated to demonstrating DeltaSpike, including custom authorization restrictions using annotations, constructing and modifying beans, extending the influence of CDI using BeanManager, and deactivating DeltaSpike features.

+

+**Source code:** https://github.com/jboss-developer/jboss-wfk-quickstarts

+

+=== DeltaSpike Examples

+A collection of example applications demonstrating the features of the DeltaSpike project.

+

+**Source code:** https://github.com/rsmeral/deltaspike-examples

+

+=== [pt-BR] DeltaSpike microblog example

+Application that shows a microblog using DeltaSpike

+

+**Source code:** https://github.com/rafabene/demo_deltaspike

+

+=== Why you should consider using Apache DeltaSpike

+Blog post demonstrating 5 features of Apache DeltaSpike

+

+**Blog post:** http://www.thedevpiece.com/why-you-should-consider-using-apache-deltaspike/

+

+=== [pt-BR] Rest Application with DeltaSpike Data

+Simple example based on MicroProfile(OpenApi,Payara-Micro) and DeltaSpike-data

+

+**Source code:** https://github.com/Daniel-Dos/DanielDiasjava-Blog/tree/master/ProjetoDeltaSpike

+

+=== [pt-BR] CRUD-Deltaspike-CDI-Angular

+Simple CRUD example based on SparkJava and DeltaSpike-data

+

+**Source code:** https://github.com/SouJava-Rio/soujava-rio-labs/tree/master/microframeworks/spark-samples/CRUD-Deltaspike-CDI-Angular

+

+=== [pt-BR] CRUD-Deltaspike-CDI-Angular

+Simple CRUD example based on JavaLin and DeltaSpike-data

+

+**Source code:** https://github.com/Daniel-Dos/DanielDiasjava-Blog/tree/master/Projeto-Cloud/javalin

+

+=== [pt-BR] jax-rs-sample-cdi-deltaspike-data

+Simple CRUD example based on jax-rs(resteasy) and DeltaSpike-data for Tomcat

+

+**Source code:** https://github.com/SouJava-Rio/soujava-rio-labs/tree/master/jax-rs-samples/Jax-rs-deltaspike-angular2-4/jax-rs-sample-cdi-deltaspike-data

+

+== Magazines

+

+=== [pt-BR] Brazilian Java Magazine

+Apache DeltaSpike: CDI Programável

+

+**Online article:** http://www.devmedia.com.br/apache-deltaspike-cdi-programavel/31982

+

+== Interviews

+

+=== [pt-BR] InfoQ Brazil

+Apache DeltaSpike, a API de extensions do CDI

+

+**Online interview:** http://www.infoq.com/br/interviews/entrevista-rafael-benevides-delta-spike

+

+=== [pt-BR] InfoQ Brazil

+O que é DeltaSpike?

+

+**Online interview:** https://www.youtube.com/watch?v=jtCuxfPxDE8

+

+== Templates

+=== Java SE + CDI + DS

+**Source code:** https://github.com/os890/javase-cdi-ds-project-template

+

+=== JSF + CDI + DS (Servlet-Container)

+**Source code:** https://github.com/os890/javaweb-cdi-ds-project-template

+ 

+=== EJB + CDI + DS (Module)

+**Source code:** https://github.com/os890/javaee_cdi_ejb_ds_project_template

+

+=== JSF + EJB + CDI + DS (EE-Server)

+**Source code:** https://github.com/os890/javaee_jsf_cdi_ejb_ds_project_template

+

+=== JSF + JPA + CDI + DS-Data (diff. EE-Server-Profiles)

+**Source code:** https://github.com/os890/javaee_jsf_cdi_jpa_data_ds_project_template

+

+=== JSF + JPA + CDI + DS-Data (Apache TomEE)

+**Source code:** https://github.com/os890/ds-data-project-template

+

+=== JSF + CDI + DS (Apache TomEE)

+**Source code:** https://github.com/os890/tomee-ds-project-template

+

+== Add-ons

+

+=== lbitonti@github

+This GitHub account contains e.g. a DBUnit Add-on for the Test-Control-Module of DeltaSpike.

+

+**Source code:** https://github.com/lbitonti/deltaspike-dbunit

+

+=== os890@github

+This GitHub account contains several DeltaSpike Add-ons e.g. to integrate CDI with other frameworks.

+

+**Source code:** https://github.com/os890/

+

+=== rmannibucau@github

+This GitHub account contains several DeltaSpike Add-ons e.g. an integration with the TomEE PasswordCipher API.

+

+**Source code:** https://github.com/rmannibucau/

+

diff --git a/site/src/main/asciidoc/index.adoc b/site/src/main/asciidoc/index.adoc
index 63e234d..700e3f1 100644
--- a/site/src/main/asciidoc/index.adoc
+++ b/site/src/main/asciidoc/index.adoc
@@ -36,7 +36,7 @@
 [options="header,footer"]
 |===
 |*News* | *Examples*
-| Apache DeltaSpike 1.8.1 is now out!
+| Apache DeltaSpike 1.9.0 is now out!
 
 link:/news.html[View details »]
 
diff --git a/site/src/main/asciidoc/news.adoc b/site/src/main/asciidoc/news.adoc
index f620a81..7c098d8 100644
--- a/site/src/main/asciidoc/news.adoc
+++ b/site/src/main/asciidoc/news.adoc
@@ -4,9 +4,14 @@
 
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
+== 32th Release (1.9.0) (2018-09-18)
+
+The Apache DeltaSpike team is pleased to announce the 32th release
+(v1.9.0).  Release notes can be found https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12312820&version=12342846[here]
+
 == 31th Release (1.8.2) (2018-06-01)
 
-The Apache DeltaSpike team is pleased to announce the 30th release
+The Apache DeltaSpike team is pleased to announce the 31th release
 (v1.8.2).  Release notes can be found https://s.apache.org/DeltaSpike_1.8.2[here]
 
 == 30th Release (1.8.1) (2018-01-01)