mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#3341 String length validation with Postgres PGobject (JSON/JSONB)
This commit is contained in:
@@ -35,7 +35,9 @@ public interface BindMaxLength {
|
||||
|
||||
@Override
|
||||
public long length(int dbLength, Object obj) {
|
||||
if (obj instanceof String) {
|
||||
if (obj == null) {
|
||||
return -1;
|
||||
} else if (obj instanceof String) {
|
||||
String s = (String) obj;
|
||||
return utf8String(dbLength, s);
|
||||
} else if (obj instanceof byte[]) {
|
||||
@@ -69,7 +71,9 @@ public interface BindMaxLength {
|
||||
|
||||
@Override
|
||||
public long length(int dbLength, Object obj) {
|
||||
if (obj instanceof String) {
|
||||
if (obj == null) {
|
||||
return -1;
|
||||
} else if (obj instanceof String) {
|
||||
return ((String) obj).length();
|
||||
} else if (obj instanceof byte[]) {
|
||||
return ((byte[]) obj).length;
|
||||
|
||||
Reference in New Issue
Block a user