How to set tablespace for @Entity?

I use hibernate to automatically create some postgres database tables. Now I would like to move one of the tables to another location (harddrive).

This is done using tablespaces .

Question: how to define tablespace for @Entity ? Is this even possible?

+7
java database postgresql hibernate jpa
source share
1 answer

In version 4.3.9 , Hibernate does not have tablespaces support, which leaves you with two options:

  • You either configure hbmddl generation to include tablespace as previously suggested .

  • You release hbmddl and just use your own incremental database schema . FlywayDB is simple and powerful, and you can get the most control over database schema generation.

+1
source share

All Articles