Hibernate partition table


when we were using hibernate, we encountered the need for database partition tables.

For example, we need to store different Student objects in different tables according to different conditions, like the table student_1, student_2.

We find hibernate interceptor can implement partition table. But it seems not very suitable.

Does Hibernate has some other method to solve this problem?


Hibernate does not need to do anything special if you need to use partitioning because the database can take care of that.

From Hibernate perspective you just write to the Student table, and MySQL or PostgreSQL take care of routing rows internally to different paritions.