2012-06-18 28 views
2

我是新來openjpa並得到此警告。openjpa現有列不兼容

Existing column ... is incompatible with the same column name in the given schema definition. 

它列出的差異,並以字段(VARCHAR)的大小不同,那就是它顯示150和255 150是我指定爲DB尺寸大小,但我不知道的255.在實體類中,String類型的相應字段。

請幫我這個。

回答

1

OpenJPA假定字符串列將在數據庫中爲255。由於您的列不是,您可以使用@ javax.persistence.Column註釋指定該非默認值。

@Column(name = "BOOYA_MSG", length = 150) 
protected String message;