3
hier ist das Repository:aop.AopInvocationException: Null Rückgabewert von
@Query(value = "select u.balance from User u where u.name=:name")
float toGetBalance(@Param("name") String name);
und hier ist die DAO-Schnittstelle:
boolean checkBalance(String userName, float totalPrice);
und hier ist der Service
@Transactional(readOnly = true)
@Override
public boolean checkBalance(String userName, float totalPrice) {
if (userRepository.toGetBalance(userName) < totalPrice) {
return false;
} else {
return true;
}
}
und Hier ist die Fehlerinfo:
org.springframework.aop.AopInvocationException: Null return value from advice does not match primitive return type for: public abstract float com.repository.UserRepository.toGetBalance(java.lang.String)
und die Art der Balance ist float!
Was ist los?