hibernate could not get next sequence value

后端 未结 11 1422
夕颜
夕颜 2020-11-29 23:32

i have gwt application connect to postgres DB at the backend, and a java class \'Judgement\' mapping the table \'judgements\' in DB, when i tried to persistent a judgement i

11条回答
  •  -上瘾入骨i
    2020-11-30 00:31

    I would also like to add a few notes about a MySQL-to-PostgreSQL migration:

    1. In your DDL, in the object naming prefer the use of '_' (underscore) character for word separation to the camel case convention. The latter works fine in MySQL but brings a lot of issues in PostgreSQL.
    2. The IDENTITY strategy for @GeneratedValue annotation in your model class-identity fields works fine for PostgreSQLDialect in hibernate 3.2 and superior. Also, The AUTO strategy is the typical setting for MySQLDialect.
    3. If you annotate your model classes with @Table and set a literal value to these equal to the table name, make sure you did create the tables to be stored under public schema.

    That's as far as I remember now, hope these tips can spare you a few minutes of trial and error fiddling!

提交回复
热议问题