Java Derby数据库不支持columnDefinition=";“长文本”;在@Column注释中?
我正在使用嵌入式ApacheDerby数据库进行JUnit测试。我有一些JPA实体。存在包含以下列的实体:Java Derby数据库不支持columnDefinition=";“长文本”;在@Column注释中?,java,jpa,junit,derby,Java,Jpa,Junit,Derby,我正在使用嵌入式ApacheDerby数据库进行JUnit测试。我有一些JPA实体。存在包含以下列的实体: @Column(nullable = false) private String rawResults; @Column(nullable = false, columnDefinition = "LONGTEXT") private String rawResults; org.apache.openjpa.lib.jdbc.ReportingSQLException: TYPE '
@Column(nullable = false)
private String rawResults;
@Column(nullable = false, columnDefinition = "LONGTEXT")
private String rawResults;
org.apache.openjpa.lib.jdbc.ReportingSQLException: TYPE 'LONGTEXT' does not exist. {stmnt 23146419 CREATE TABLE Assessment -- Assessment_JpaImpl
这一切都适用于嵌入式Derby,直到我厌倦了在由openjpa maven plugin
生成的查询中将TEXT
替换为LONGTEXT
,所以我将该专栏编辑成如下:
@Column(nullable = false)
private String rawResults;
@Column(nullable = false, columnDefinition = "LONGTEXT")
private String rawResults;
org.apache.openjpa.lib.jdbc.ReportingSQLException: TYPE 'LONGTEXT' does not exist. {stmnt 23146419 CREATE TABLE Assessment -- Assessment_JpaImpl
现在,openjpamaven插件
正在生成LONGTEXT
,而不是TEXT
。但这只在我跳过测试时有效
然后我运行我的测试并进行Derby,因此所有操作都会失败,出现如下错误:
@Column(nullable = false)
private String rawResults;
@Column(nullable = false, columnDefinition = "LONGTEXT")
private String rawResults;
org.apache.openjpa.lib.jdbc.ReportingSQLException: TYPE 'LONGTEXT' does not exist. {stmnt 23146419 CREATE TABLE Assessment -- Assessment_JpaImpl
我使用的是Derby 10.9.1.0,据我所知,它不支持
columnDefinition=“LONGTEXT”
。是这样吗?或者我需要设置一些配置,使derby支持此属性?以下是derby数据类型:您知道“columnDefinition”完全特定于一个RDBMS吗?所以你抛弃了便携性。