Setup and Configuration

This section describes how to include the Wicket viewer’s module and set its configuration properties.

Dependency Management

If your application inherits from the Apache Causeway starter app (org.apache.causeway.app:causeway-app-starter-parent) then that will define the version automatically:

pom.xml
<parent>
    <groupId>org.apache.causeway.app</groupId>
    <artifactId>causeway-app-starter-parent</artifactId>
    <version>2.1.0</version>
    <relativePath/>
</parent>

Alternatively, import the core BOM. This is usually done in the top-level parent pom of your application:

pom.xml
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.apache.causeway.core</groupId>
            <artifactId>causeway-core</artifactId>
            <version>2.1.0</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
    </dependencies>
</dependencyManagement>

JPA

This section describes the required changes to use QueryDSL if using JPA as your persistence mechanism.

Dependency

In the webapp module of your application, add the following dependency:

pom.xml
<dependencies>
    <dependency>
        <groupId>org.apache.causeway.persistence</groupId>
        <artifactId>causeway-persistence-querydsl-jpa</artifactId>
    </dependency>
</dependencies>

AppManifest

In your application’s AppManifest (top-level Spring @Configuration used to bootstrap the app), import the appropriate module:

AppManifest.java
@Configuration
@Import({
        ...
        CausewayModulePersistenceQueryDslJpa.class,
        ...
})
public class AppManifest {
}

Module with entities

In every module that contains entities, it’s necessary to generate the "Q" classes that are used in turn to construct the queries. This requires several changes to the module’s pom.xml file.

  • add the build plugin

    pom.xml
    <build>
        <plugins>
            ...
            <plugin>
                <groupId>com.mysema.maven</groupId>
                <artifactId>apt-maven-plugin</artifactId>
                <version>1.1.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>
                                target/generated-sources/java
                            </outputDirectory>
                            <processor>
                                com.querydsl.apt.jpa.JPAAnnotationProcessor
                            </processor>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            ...
        </plugins>
    </build>
  • add a dependency to the querydsl-apt annotation processor:

    pom.xml
    <dependencies>
        ...
        <dependency>
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-apt</artifactId>
            <scope>provided</scope>
        </dependency>
        ...
    </dependencies>
  • (recommended, usually required) add a dependency to the querydsl-applib module:

    pom.xml
    <dependencies>
        ...
        <dependency>
            <groupId>org.apache.causeway.persistence</groupId>
            <artifactId>causeway-persistence-querydsl-applib</artifactId>
        </dependency>
        ...
    </dependencies>

JDO

This section describes the required changes to use QueryDSL if using JDO as your persistence mechanism.

Dependency

In the webapp module of your application, add the following dependency:

pom.xml
<dependencies>
    <dependency>
        <groupId>org.apache.causeway.persistence</groupId>
        <artifactId>causeway-persistence-querydsl-jdo</artifactId>
    </dependency>
</dependencies>

AppManifest

In your application’s AppManifest (top-level Spring @Configuration used to bootstrap the app), import the appropriate module:

AppManifest.java
@Configuration
@Import({
        ...
        CausewayModulePersistenceQueryDslJdo.class,
        ...
})
public class AppManifest {
}

Module with entities

In every module that contains entities, it’s necessary to generate the "Q" classes that are used in turn to construct the queries. This requires several changes to the module’s pom.xml file.

  • add the build plugin

    pom.xml
    <build>
        <plugins>
            ...
            <plugin>
                <groupId>com.mysema.maven</groupId>
                <artifactId>apt-maven-plugin</artifactId>
                <version>1.1.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>
                                target/generated-sources/java
                            </outputDirectory>
                            <processor>
                                com.querydsl.apt.jdo.JDOAnnotationProcessor
                            </processor>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            ...
        </plugins>
    </build>
  • add a dependency to the querydsl-apt annotation processor:

    pom.xml
    <dependencies>
        ...
        <dependency>
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-apt</artifactId>
            <scope>provided</scope>
        </dependency>
        ...
    </dependencies>
  • (recommended, usually required) add a dependency to the querydsl-applib module:

    pom.xml
    <dependencies>
        ...
        <dependency>
            <groupId>org.apache.causeway.persistence</groupId>
            <artifactId>causeway-persistence-querydsl-applib</artifactId>
        </dependency>
        ...
    </dependencies>

Configuration Properties

There are currently no configuration properties for these modules.