QuerydslPredicateExecutor 没有 save() 方法
QuerydslPredicateExecutor not having save() method
我在我的项目中尝试使用QuerydslJpaRepository
,但它已被弃用,建议改用QuerydslPredicateExecutor
。但是,QuerydslPredicateExecutor
没有 save()
方法,QuerydslJpaRepository
中存在该方法。
我该如何解决这个问题?
您的存储库不仅应该扩展 QueryDslPredicateExecutor
,还应该扩展 JpaRepository which contains save
method (inherited from CrudRepository)。
public interface YourEntityRepository
extends JpaRepository<YourEntity, ID>, QueryDslPredicateExecutor<YourEntity> {
}
我在我的项目中尝试使用QuerydslJpaRepository
,但它已被弃用,建议改用QuerydslPredicateExecutor
。但是,QuerydslPredicateExecutor
没有 save()
方法,QuerydslJpaRepository
中存在该方法。
我该如何解决这个问题?
您的存储库不仅应该扩展 QueryDslPredicateExecutor
,还应该扩展 JpaRepository which contains save
method (inherited from CrudRepository)。
public interface YourEntityRepository
extends JpaRepository<YourEntity, ID>, QueryDslPredicateExecutor<YourEntity> {
}