Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set tablespace for @Entity?

I'm using hibernate to auto-create some postgres database tables. Now I'd like to move one of the tables to a different location (harddrive).

This is done using tablespaces.

Question: how can I define the tablespace for an @Entity? Is that possible at all?

like image 996
membersound Avatar asked Apr 27 '15 08:04

membersound


1 Answers

As of 4.3.9 version, there's no support for tablespaces in Hibernate, which leaves you with two options:

  1. You either customize the hbmddl generation to include the tablespace as previously suggested.

  2. You let go hbmddl and simply use your own incremental database schema generation. FlywayDB is both simple and powerful, and you can get the most control over the database schema generation.

like image 111
Vlad Mihalcea Avatar answered Sep 27 '22 17:09

Vlad Mihalcea