在JPA存储库中执行自定义方法时发生异常

问题描述 投票:0回答:1
public class UserRepositoryImpl implements UserRepositoryCustom<User, Long> {

    @Override
    public void customMethod(User user) {

    }
}

public interface UserRepositoryCustom<T, ID extends Serializable> {

    void customMethod(User user);
}

@RepositoryRestResource
public interface UserRepository extends JpaRepository<User, Long>,
            UserRepositoryCustom<User, Long> {
}

为什么会出现此异常

Caused by: org.springframework.data.mapping.PropertyReferenceException: No property customMethod found for type User!
java spring-boot spring-data-jpa spring-data-rest
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.