简体   繁体   English

QueryDSL JPAAnnotation Processor为单个类生成QModel

[英]QueryDSL JPAAnnotation Processor generate QModel for a single class

I have a class that's located in a package. 我有一个位于包中的类。 In that package I have several JPAEntities. 在那个包中,我有几个JPAEntities。 However all I want for the JPAAnnotationProcessor to do is to generate QModel for a single class. 但是,我想要JPAAnnotationProcessor要做的就是为单个类生成QModel。 Not for all classes inside that package. 不适用于该软件包中的所有类。 Is that possible without moving the class to another package? 是否可以将类移到另一个软件包中?

You can use @QueryExclude annotation on top of the classes for which you don't want QClass to be generated. 您可以在不想QClass生成QClass的类之上使用@QueryExclude注释。

import com.mysema.query.annotations.QueryExclude

@Entity
@QueryExclude
public class MyEntity {}

Unfortunately it is not possible to solve the problem in package level atm. 不幸的是,不可能解决封装级atm中的问题。 If you mark all package with @QueryExclude and single class with @QueryEntity , still the whole package will be excluded. 如果标记所有包@QueryExclude和单类@QueryEntity ,还是全包将被排除在外。 Therefore you have to mark each class separately. 因此,您必须分别标记每个类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM