From the Timefold's documentation it is known that Spring Data JPA can be used with Timefold's annotations. When you write the object that contains the solution (let's say Timetable Bean annotated with @PlanningSolution), will Timefold Solver know how to get the data from the database automatically, or do I have to manually write the way that the algorithm gets the data from the database using Spring JPA Data?
Timefold Solver does not connect to a database. You are responsible for loading data from a database, as well as for writing it back. Our persistence module can help with some details of it, but we will never actually contact the database for you.
We expect a planning solution as a Java/Kotlin object. How you get it is left completely at your discretion; it can come from a database, it can come over REST, it can be generated on-demand, really anything you can think of. To the solver, it does not matter.