Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how do I generate Q class with the @QueryProjection annotation via GenericExporter. #480

Closed
wdaogang opened this issue Aug 22, 2013 · 1 comment
Assignees
Milestone

Comments

@wdaogang
Copy link

@wdaogang wdaogang commented Aug 22, 2013

I'm using querydsl 3.2.2 and jdk6 in spring roo .

I can export the Q file from the file with the @entity but I can't export QProductDTO.java via the ProductDTO which annotated @QueryProjection.

GenericExporter exporter = new GenericExporter();
exporter.setKeywords(Keywords.JPA);
exporter.setEntityAnnotation(Entity.class);
exporter.setEmbeddableAnnotation(Embeddable.class);
exporter.setEmbeddedAnnotation(Embedded.class);
exporter.setSupertypeAnnotation(MappedSuperclass.class);
exporter.setSkipAnnotation(Transient.class);
exporter.setTargetFolder(new File("target/generated-sources/java"));
exporter.export(Product.class.getPackage(),ProductDTO.class.getPackage());

below is the ProductDTO code:

public class ProductDTO {
private Product product;

@QueryProjection
public ProductDTO(Product product) {
    this.product = product;
}

public Product getProduct() {
    return product;
}

public void setProduct(Product product) {
    this.product = product;
}

}

@timowest
Copy link
Member

@timowest timowest commented Oct 20, 2013

Released in 3.2.4

@timowest timowest closed this Oct 20, 2013
@timowest timowest added this to the 3.2.4 milestone Apr 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants