We are using Envers with both Oracle and MySQL without any problem. We are now trying PostgreSQL but we have the problem that the audit tables are created with a column REVTYPE of type TINYINT.

TINYINT is not supported by PostgreSQL.

Is there a way to change the type of REVTYPE?

Example:

create table AUD_SomeTable (
  dbId bigint not null,
  ...
  REV integer not null,
  REVTYPE tinyint,
  primary key (dbId, REV)
);

EDIT:

Problem solved: I forgot the change the Hibernate dialect.

有帮助吗?

解决方案

I don't know about about Envers, but you could create a new domain type.

CREATE DOMAIN "tinyint"
  AS smallint;

You can add CONSTRAINS to check for e.g. a postive value.

其他提示

You should test whether this is really an Envers issue or an Hibernate issue. Try mapping an entity with a property byte type using hibernate only. If it tries to generate a tinyint column it would be a Hibernate issue.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top