Correct JPA Annotation for PostgreSQL's text type without Hibernate Annotations

前端 未结 4 2050
抹茶落季
抹茶落季 2020-12-15 16:28

I\'m developing an application using:

  • Java 1.7
  • JPA (included in javaee-api 7.0)
  • Hibernate 4.3.8.Final
  • PostgreSQL-JDBC 9.4-1200-jdbc4
4条回答
  •  無奈伤痛
    2020-12-15 17:13

    I just had to add this annotation:

    @Column(columnDefinition="TEXT")
    

    It did not work on its own. I had to recreate the table in the database.

    DROP TABLE yourtable or just alter column type to text with ALTER TABLE statement

提交回复
热议问题