Chartjs-How to compare input text with database value in Spring Boot?

0👍

Try

ProductRepository.java

public interface ProductRepository extends JpaRepository<Product, Long> {
    public List<Object[]> findByTag00Is(@Param("tag00")float tag00);
    public List<Object[]> findByTimeIs(@Param("time")float time2); 
}

findByTimeIs(float time2) this is the same as Select ... from ... where time = time2

AppController.java

public class AppController {
    @Autowired
    private ProductService service; 
    @Autowired
    private ProductRepository prorepo;

    @RequestMapping("/ChartLine")
    public String viewLine(Model model, @RequestParam(name="time", required=false)float time) {
        // do anything with time
        // example : propero.findByTimeIs(time);
    }

Leave a comment