Java QueryDSL可以在接口后面生成QClass吗?
我有一个包含嵌套对象的实体,如下所示:Java QueryDSL可以在接口后面生成QClass吗?,java,spring-boot,querydsl,Java,Spring Boot,Querydsl,我有一个包含嵌套对象的实体,如下所示: @Data @Document(collection = RecordingEntity.COLLECTION_NAME) public class RecordingEntity { public static final String COLLECTION_NAME = "recording"; @Id private String id; private ProductDataEntity product
@Data
@Document(collection = RecordingEntity.COLLECTION_NAME)
public class RecordingEntity {
public static final String COLLECTION_NAME = "recording";
@Id
private String id;
private ProductDataEntity productdata; // This is an interface
}
现在我有了两种不同的接口ProductDataEntity实现
@Data
public class SoundRecordingEntity extends ProductDataEntity {
public SoundRecordingEntity() {
super();
}
private TitleTrackEntity titleTrackEntity;
}
另一方面:
@Data
public class VideoClipEntity extends ProductDataEntity {
public VideoClipEntity() {
super();
}
private SeasonInformationEntity seasonInformation;
}
现在我的问题是,我需要在标题trackentity
或季节信息实体
中进行查询,但是QueryDSL不生成我的接口实现,而只生成:
public final BooleanPath soundRecording = createBoolean("soundRecording");
public final BooleanPath videoClip = createBoolean("videoClip");
在QRecordingEntity
内。有没有一种方法可以在接口后面以某种方式生成这些实现,或者更好地实际查询这些接口后面的嵌套元素