I have just started to use Spring Roo and I am encountering issues when generating a simple project with an entity. I am following a write up from DZone.
DZone How to generate spring boot application
When I follow the steps I generate a domain model called owner with 2 fields
Username
When I finish generating the project it corrected created the Owner model but there are references to QOwner in the code which are unable to find their class.
@RooJpaRepositoryCustomImpl(repository = OwnerRepositoryCustom.class)
public class OwnerRepositoryImpl extends QueryDslRepositorySupport{
OwnerRepositoryImpl() {
super(Owner.class);
}
private JPQLQuery getQueryFrom(QOwner qEntity){
return from(qEntity);
}
}
Remember that the Q
classes are generated by the querydsl-maven-plugin
, so you must compile the project using mvn clean compile
to have these classes available.
After that, if you are using Eclipse STS or IntelliJ, you need to mark the folder where this Q
classes are generated (target/generated-sources/java) as Source Folder
to allow your IDE to detect them.
Hope it helps,