#2598 - H2 + @Lob String fails with - Error[Value too long for column "CHARACTER VARYING": "... (1048577)" [22001-210]]

This commit is contained in:
Rob Bygrave committed 2022-03-16 22:13:52 +13:00
1 parent ff1b01e5ca
commit 92e85e32a2
2 files changed
+26 -1

No files matched your search

@@ -1,5 +1,6 @@
package io.ebeaninternal.server.type;
import io.ebean.core.type.DataBinder;
import io.ebean.core.type.DataReader;
import java.sql.SQLException;
@@ -18,6 +19,15 @@ class ScalarTypeClob extends ScalarTypeStringBase {
super(true, Types.CLOB);
}
@Override
public void bind(DataBinder binder, String value) throws SQLException {
if (value == null) {
binder.setNull(Types.VARCHAR);
} else {
binder.setClob(value);
}
}
@Override
public String read(DataReader reader) throws SQLException {
return reader.getStringFromStream();