Refactor move ScalarTypeBaseVarchar to ebean-core-type module

This commit is contained in:
Rob Bygrave
2022-08-26 12:28:29 +12:00
parent 13a913428e
commit 5b22506b9b
19 changed files with 33 additions and 10 deletions
@@ -1,11 +1,7 @@
package io.ebeaninternal.server.type;
package io.ebean.core.type;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import io.ebean.core.type.DataBinder;
import io.ebean.core.type.DataReader;
import io.ebean.core.type.DocPropertyType;
import io.ebean.core.type.ScalarTypeBase;
import java.io.DataInput;
import java.io.DataOutput;
@@ -17,13 +13,13 @@ import java.sql.Types;
* Base ScalarType for types which converts to and from a VARCHAR database
* column.
*/
abstract class ScalarTypeBaseVarchar<T> extends ScalarTypeBase<T> {
public abstract class ScalarTypeBaseVarchar<T> extends ScalarTypeBase<T> {
ScalarTypeBaseVarchar(Class<T> type) {
public ScalarTypeBaseVarchar(Class<T> type) {
super(type, false, Types.VARCHAR);
}
ScalarTypeBaseVarchar(Class<T> type, boolean jdbcNative, int jdbcType) {
public ScalarTypeBaseVarchar(Class<T> type, boolean jdbcNative, int jdbcType) {
super(type, jdbcNative, jdbcType);
}
@@ -102,7 +98,8 @@ abstract class ScalarTypeBaseVarchar<T> extends ScalarTypeBase<T> {
if (value == null) {
dataOutput.writeBoolean(false);
} else {
ScalarHelp.writeUTF(dataOutput, convertToDbString(value));
dataOutput.writeBoolean(true);
dataOutput.writeUTF(convertToDbString(value));
}
}
@@ -2,6 +2,7 @@ package io.ebeaninternal.server.type;
import io.ebean.core.type.DataBinder;
import io.ebean.core.type.DataReader;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import io.ebeaninternal.server.core.BasicTypeConverter;
import java.sql.SQLException;
@@ -1,9 +1,9 @@
package io.ebeaninternal.server.type;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import io.ebean.core.type.DataBinder;
import io.ebean.core.type.DataReader;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import io.ebeaninternal.server.core.BasicTypeConverter;
import java.io.IOException;
@@ -2,6 +2,7 @@ package io.ebeaninternal.server.type;
import io.ebean.config.dbplatform.ExtraDbTypes;
import io.ebean.core.type.DataBinder;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import io.ebean.types.Cidr;
import java.sql.SQLException;
@@ -1,5 +1,7 @@
package io.ebeaninternal.server.type;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import javax.persistence.PersistenceException;
/**
@@ -1,5 +1,7 @@
package io.ebeaninternal.server.type;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import java.util.Currency;
/**
@@ -2,6 +2,7 @@ package io.ebeaninternal.server.type;
import io.ebean.config.dbplatform.ExtraDbTypes;
import io.ebean.core.type.DataBinder;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import io.ebean.types.Inet;
import java.sql.SQLException;
@@ -1,5 +1,6 @@
package io.ebeaninternal.server.type;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import io.ebean.text.TextException;
import java.net.InetAddress;
@@ -2,6 +2,7 @@ package io.ebeaninternal.server.type;
import io.ebean.config.dbplatform.ExtraDbTypes;
import io.ebean.core.type.DataBinder;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import io.ebean.text.TextException;
import java.net.InetAddress;
@@ -1,5 +1,6 @@
package io.ebeaninternal.server.type;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import org.joda.time.Period;
/**
@@ -1,5 +1,7 @@
package io.ebeaninternal.server.type;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import java.util.Locale;
/**
@@ -1,5 +1,7 @@
package io.ebeaninternal.server.type;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import java.time.OffsetTime;
/**
@@ -1,5 +1,7 @@
package io.ebeaninternal.server.type;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Path;
@@ -1,5 +1,7 @@
package io.ebeaninternal.server.type;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import java.time.Period;
/**
@@ -1,5 +1,7 @@
package io.ebeaninternal.server.type;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import java.util.TimeZone;
/**
@@ -1,5 +1,6 @@
package io.ebeaninternal.server.type;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import io.ebean.text.TextException;
import java.net.URI;
@@ -1,5 +1,6 @@
package io.ebeaninternal.server.type;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import io.ebean.text.TextException;
import java.net.MalformedURLException;
@@ -1,5 +1,7 @@
package io.ebeaninternal.server.type;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import java.time.ZoneId;
/**
@@ -1,5 +1,7 @@
package io.ebeaninternal.server.type;
import io.ebean.core.type.ScalarTypeBaseVarchar;
import java.time.ZoneOffset;
/**