Evolution is creating and updating a database using simple SQL scripts. Therefore, if you use a framework that generates data tables themselves, for example, sleep mode, you need to turn off evolution (or turn off auto-generation and use only evolution).
Fill the database at startup
I have a similar problem with Cassandra, which I did - just create the code that reads the CQL file and execute it, and run this code after creating the actual data tables.
As I can see, Hibernate already has this function - you need to put your own SQL code in the /import.sql file at the root of your class path:
If a file named import.sql exists in the root directory of the class path ('/import.sql), then Hibernate will execute the SQL statements read from the file after creating the database schema.
Andriy kuba
source share