0

我使用Spring Roo + Spring Data + QueryDSL,我有以下类/接口:

public interface FamilyAdvertisementRepositoryCustom {
}

@RooJpaRepository(domainType = FamilyAdvertisement.class)
public interface FamilyAdvertisementRepository extends FamilyAdvertisementRepositoryCustom {
}

public class FamilyAdvertisementRepositoryImpl extends QueryDslRepositorySupport implements FamilyAdvertisementRepositoryCustom {
   //NO CONSTRUCTOR
}

全部在以下包中:com.bignibou.repository;

使用以下配置:

<repositories base-package="com.bignibou.repository" />

但是,我收到此错误:

[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.2:compile (default) on project bignibou: Compiler errors : [ERROR] error at public class FamilyAdvertisementRepositoryImpl extends QueryDslRepositorySupport implements FamilyAdvertisementRepositoryCustom { [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ERROR] /home/julien/Documents/donnees/projets/site-garde-enfants/java/bignibou/src/main/java/com/bignibou/repository/FamilyAdvertisementRepositoryImpl.java:5:0::0 Implicit super constructor QueryDslRepositorySupport() is undefined for default constructor. Must define an explicit constructor

看起来QueryDslRepositorySupport类不再具有默认构造函数,而以前是这种情况。这是为什么??

我做错了什么?

4

1 回答 1

3

引入更改是为了强制将Builder其返回getBuilder()到单个域类型。只需创建一个不带参数的构造函数,并使用您为其实现存储库的域类型调用超类的构造函数。

于 2013-03-11T10:04:45.453 回答