-2

I'm using spring boot and thymeleaf in my web app, my question it's simple, i have a web form with 3 controls (initialDate, endingDate and name). I wanna catch those parameters and find them in a MySQL table at the same time. Could you help me please to make a jpa query to do that. I've read about Criteria API it's a good idea but also with Query methods.Thank you a lot.

  • 3
    The role of this site is that you try something and when you have problems you post what you did with what input and what problem you had. It is not a code writing site ... – Neil Stockton Dec 08 '16 at 17:58

1 Answers1

1

Spring Data JPA

Spring Boot Guide: Accessing Data with JPA

Your use case is easily solved by leveraging the power of Spring Data JPA.

Take a look at the documentation and guide above and you'll pick it up quickly.

The gist of it is to encapsulate your fields in an Entity (POJO Annotated with @Entity). Then capture these parameters with a @Controller endpoint. Finally you persist the data with the help of a CrudRepository.

Explore the docs above for all the details.

Kyle Anderson
  • 6,801
  • 1
  • 29
  • 41