0

Trying to build application where tables & its fields are managed by master table & creation of tables & its fields happens on demand, on fly based on user data posted to server. Tried to look over similar question like this but wasnt able to find clue how to execute dynamic queries in DB without creating Repository & Entity in spring boot.

KOTIOS
  • 11,177
  • 3
  • 39
  • 66

1 Answers1

0

Robert Niestroj is correct when he writes in the comments

If you have dynamic tables JPA is the wrong approach. JPA is for static schema

I guess in theory you could do something where you generate code and possibly restart your ApplicationContext but it is bound to be really painful and you won't benefit from using JPA.

You should look into more dynamic technologies. MyBatis and plain old JdbcTemplate or NamedParameterJdbcTemplate come to my mind. Possibly with your own abstraction layer on top of it if you have recurring scenarios.

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348