JPA bytecode enhancement

This commit is contained in:
Martin Stockhammer 2016-10-09 21:13:18 +02:00
parent e2581cd127
commit 8d9f47436e
3 changed files with 144 additions and 80 deletions

View File

@ -20,7 +20,7 @@
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
<persistence-unit name="redback-jpa">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<jta-data-source>java:comp/env/jdbc/redbackjpa</jta-data-source>
<non-jta-data-source>java:comp/env/jdbc/redbackjpa</non-jta-data-source>
<class>org.apache.archiva.redback.users.jpa.model.JpaUser</class>
<class>org.apache.archiva.redback.rbac.jpa.model.JpaOperation</class>
<class>org.apache.archiva.redback.rbac.jpa.model.JpaResource</class>
@ -28,9 +28,11 @@
<class>org.apache.archiva.redback.rbac.jpa.model.JpaRole</class>
<class>org.apache.archiva.redback.rbac.jpa.model.JpaUserAssignment</class>
<properties>
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
<property name="openjpa.jdbc.SchemaFactory" value="native(ForeignKeys=true)" />
<property name="openjpa.jdbc.MappingDefaults"
value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/>
<property name="openjpa.Log" value="DefaultLevel=TRACE, Runtime=TRACE, Tool=INFO"/>
</properties>
</persistence-unit>
</persistence>

View File

@ -66,5 +66,36 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<includes>**/model/*.class</includes>
<addDefaultConstructor>true</addDefaultConstructor>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
</configuration>
<executions>
<execution>
<id>enhancer</id>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<!-- set the version to be the same as the level in your runtime -->
<version>${openjpa.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>

View File

@ -65,4 +65,35 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<includes>**/model/*.class</includes>
<addDefaultConstructor>true</addDefaultConstructor>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
</configuration>
<executions>
<execution>
<id>enhancer</id>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<!-- set the version to be the same as the level in your runtime -->
<version>${openjpa.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>