2

I am using hibernate 3.*. I want to update table's one column length from 255 to 512. Table has data already. I have tried "hbm2ddl.auto=update" but I gives me error like : ERROR JDBCExceptionReporter : String or binary data would be truncated. 12 May 2011 19:49:37,265 WARN DefaultMetricsRepository : Encountered error while closing Hibernate session org.hibernate.PropertyValueException: not-null property references a null or transient value:

1 Answers1

4

Alas, hibernate can't alter columns. I also wish it could, but it doesn't. So you will have to manually alter it.

I guess you can write something to plug in the schema update code so that ALTER queries are executed.

Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140