Java Spring Roo生成未知域模型
我刚刚开始使用SpringRoo,在使用实体生成简单项目时遇到了一些问题。我正在关注DZone的一篇评论 当我遵循这些步骤时,我生成了一个名为owner的域模型,其中包含两个字段Java Spring Roo生成未知域模型,java,spring-boot,spring-roo,Java,Spring Boot,Spring Roo,我刚刚开始使用SpringRoo,在使用实体生成简单项目时遇到了一些问题。我正在关注DZone的一篇评论 当我遵循这些步骤时,我生成了一个名为owner的域模型,其中包含两个字段 用户名 电子邮件 当我完成生成项目时,它创建了所有者模型,但是代码中有对QOwner的引用,无法找到它们的类 @RooJpaRepositoryCustomImpl(repository = OwnerRepositoryCustom.class) public class OwnerRepositoryImpl e
@RooJpaRepositoryCustomImpl(repository = OwnerRepositoryCustom.class)
public class OwnerRepositoryImpl extends QueryDslRepositorySupport{
OwnerRepositoryImpl() {
super(Owner.class);
}
private JPQLQuery getQueryFrom(QOwner qEntity){
return from(qEntity);
}
}
请记住,
Q
类是由querydsl-maven插件生成的,因此必须使用mvn-clean-compile
编译项目才能使用这些类
之后,如果您使用的是EclipseST或IntelliJ,则需要将生成此Q
类的文件夹(目标/生成的源代码/java)标记为源文件夹
,以允许IDE检测它们
希望有帮助