Skip to content

Commit

Permalink
String length validation tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
rbygrave committed Feb 27, 2024
1 parent 11c9bdf commit feb2bd1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ public class DatabaseConfig implements DatabaseBuilder.Settings {
private String dumpMetricsOptions;

private LengthCheck lengthCheck = LengthCheck.OFF;

private Function<String, String> metricNaming = MetricNamingMatch.INSTANCE;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
import io.ebean.bean.MutableValueInfo;
import io.ebean.bean.PersistenceContext;
import io.ebean.config.EncryptKey;
import io.ebean.config.LengthCheck;
import io.ebean.config.dbplatform.DbEncryptFunction;
import io.ebean.config.dbplatform.DbPlatformType;
import io.ebean.config.dbplatform.ExtraDbTypes;
import io.ebean.core.type.DataReader;
import io.ebean.core.type.DocPropertyType;
import io.ebean.core.type.InputStreamInfo;
import io.ebean.core.type.ScalarType;
import io.ebean.plugin.Property;
import io.ebean.text.StringParser;
Expand Down Expand Up @@ -50,7 +47,6 @@
import java.io.DataOutput;
import java.io.IOException;
import java.lang.reflect.Field;
import java.nio.charset.StandardCharsets;
import java.sql.SQLException;
import java.sql.Types;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class TestDbJsonLength {


/**
/**
* The property 'EBasicJsonMap.content' is annotated with @DbJson(length=5000). So we assume, that we cannot save Json-objects
* where the serialized form exceed that limit and we would expect an error on save.
* The length check works for platforms like h2, as H2 uses a 'varchar(5000)'. So it is impossible to save such long jsons,
Expand Down

0 comments on commit feb2bd1

Please sign in to comment.