Note that there are some explanatory texts on larger screens.

plurals
  1. POGenerate QueryDsl Q Classes From Package
    primarykey
    data
    text
    <p>How do I generate QueryDsl Q-Classes by only specifying a package name? Given the source classes reside in my target/generated-sources folder since they are the product of other build plugins (WSDLs, XSDs, etc.)</p> <p>I have tried using the following plugins, but can't find the right configuration:</p> <pre><code>&lt;groupId&gt;com.mysema.querydsl&lt;/groupId&gt; &lt;artifactId&gt;querydsl-maven-plugin&lt;/artifactId&gt; &lt;version&gt;2.9.0&lt;/version&gt; &lt;executions&gt; &lt;phase&gt;generate-sources&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;process&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;outputDirectory&gt;target/generated-sources&lt;/outputDirectory&gt; &lt;processor&gt;${com.mysema.query.apt.ProcessorClass}&lt;/processor&gt; &lt;/configuration&gt; &lt;/executions&gt; </code></pre> <p>and:</p> <pre><code>&lt;groupId&gt;com.mysema.maven&lt;/groupId&gt; &lt;artifactId&gt;maven-apt-plugin&lt;/artifactId&gt; &lt;version&gt;1.0.4&lt;/version&gt; </code></pre> <p>What I'd like to do is something like this:</p> <pre><code>&lt;configuration&gt; &lt;packageName&gt;com.my.package&lt;/packageName&gt; &lt;sourceFolder&gt;target/generated-sources&lt;/sourceFolder&gt; &lt;targetFolder&gt;target/generated-sources/querydsl&lt;/targetFolder&gt; &lt;/configuration&gt; </code></pre> <p>...which would generate the classes:</p> <ul> <li>com.my.package.QFoo.java</li> <li>com.my.package.QBar.java</li> </ul> <p>Since there's no common JPA or JDO annotation, and I don't have have access to the source files, I haven't been able to use any of the <code>com.mysema.query.apt.*Processor</code>s for the maven-apt-plugin's <code>&lt;processor&gt;</code>.</p> <p><i><b>EDIT 1:</b> added full maven-apt-plugin configuration.</i></p> <p><i><b>EDIT 2:</b> </i> - I was able to get the maven-apt-plugin to work sporadically via the maven command line, but not Eclipse/STS by extending <code>AbstractQuerydslProcessor</code> to look for <code>@XmlType</code>-annotated classes. Double code-generation is admittedly not an ideal solution.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload