Hibernate postgresql/hsqldb TEXT column incompatibility problem

前端 未结 6 1752
醉酒成梦
醉酒成梦 2021-01-02 00:26

I have a problem using Hibernate and PostgreSQL for production and HSQLDB for testing.
I am using top-down approach letting Hibernate create database schema.
I a

6条回答
  •  心在旅途
    2021-01-02 01:00

    The easiest way to deal with this specific issue is probably to not use the columnDefinition at all and instead to explicitly specify the column length with (for example)

    @Column(length=10000)
    

    It might also be that you could instead map it with @Lob(type = LobType.CLOB)

    but I'm not sure that is supported properly in HSQLDB. In Postgres it should give you your TEXT type.

提交回复
热议问题