Generate Q-Classes of JPA entities in a jar dependency with apt-maven-plugin

946 views
Skip to first unread message

Julien Gribonvald

unread,
Jul 7, 2014, 8:38:45 AM7/7/14
to quer...@googlegroups.com
Hi,

I have a project on which i have some JPA entities in dependencies, how can i generete the Q-classes for these entities ?

All my internal classes have a genereated Q-Classe expect those in the jar dependency. I tried to include it from the package entry (same with include) but nothing is done.

<plugin>
                <groupId>com.mysema.maven</groupId>
                <artifactId>apt-maven-plugin</artifactId>
                <version>1.1.1</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/generated-sources/java</outputDirectory>
                            <testOutputDirectory>${project.build.directory}/generated-test-sources/java</testOutputDirectory>
                            <processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
                            <showWarnings>true</showWarnings>
                            <packages>
                                <package>internal.entities</package>
                                <package>external.entities</package>
                            </packages>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

when i launch the mvn generate-sources i get this error :

 cannot find symbol
symbol  : class QEvaluator
location: package external.entities.evaluators
    public final external.entities.QEvaluator evaluator;

thanks

timowest

unread,
Jul 9, 2014, 11:41:48 AM7/9/14
to quer...@googlegroups.com
Hi Julien.

If you don't have lots of external entities you can use QueryEntities to declare external unmirrored types http://www.querydsl.com/static/querydsl/3.4.1/apidocs/com/mysema/query/annotations/QueryEntities.html

Using the QueryEntities on the package level is the suggested way to use it.

Timo

David Polo

unread,
Apr 4, 2017, 11:22:08 AM4/4/17
to Querydsl
If I have lots of external entities, what can I do?

QueryEntities is the only solution?

Thank you.

David
Reply all
Reply to author
Forward
0 new messages