I do not understand how queries work in spring. So far, I have this query where I want to retrieve a value from a table based on string arguments. But from my research, in order to implement the query annotation, I am supposed to put the query annotation above a function. But how do i retrieve the value from this subroutine when it hasn't been implemented yet?
I start off from here
@Repository
public interface PhoneRepository {
@Query("SELECT price FROM phone WHERE model = ?1 AND storage = ?2 AND quality = ?3")
public double devicePrice(String model, String storage, String quality);
}
How am I supposed to get the price value from the table from here?
public class PhoneImplementation implements PhoneRepository{
public double devicePrice(String model, String storage, String quality) {
// return the price value here somehow
}
}