テーブル名を引用符で囲まずにHibernateがエラーをスローするPostgresに 'user'というテーブルを作成しようとしている状況があります。テーブル名を引用符で囲むようにHibernateを構成する方法
| Error 2012-02-27 23:06:58,782 [Thread-10] ERROR hbm2ddl.SchemaExport - Unsuccessful: create table user (id int8 not null, version int8 not null, account_expired bool not null, account_locked bool not null, email_address varchar(255) not null, enabled bool not null, first_name varchar(255) not null, last_name varchar(255) not null, mobile_number varchar(255) not null, "password" varchar(255) not null, password_expired bool not null, username varchar(255) not null unique, primary key (id))
これは、DataSource.groovyでPostgreSQLDialect使用する必要があることを指定するにもかかわらず、である:私はPostgresのを扱うときに、テーブル名の前後に引用符を置くために休止状態に設定するにはどうすればよい
dialect = org.hibernate.dialect.PostgreSQLDialect
を?
私は強く異なるテーブル名を使用することをお勧めします。予約語を使用すると、Hibernateだけでなく、すべての問題を解決できます。 –