默认构造函数未定义隐式超级构造函数QueryDslRepositorySupport()。必须定义一个显式构造函数

时间:2013-03-10 09:56:19

标签: jpa spring-roo spring-data spring-data-jpa

我使用 Spring Roo + Spring数据 + 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 类不再具有默认构造函数,而之前就是这种情况。为什么???

我错了什么?

1 个答案:

答案 0 :(得分:3)

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