diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanDescriptorManager.java b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanDescriptorManager.java index ef1117659..edeaa397b 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanDescriptorManager.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/BeanDescriptorManager.java @@ -6,16 +6,8 @@ import io.ebean.RawSqlBuilder; import io.ebean.annotation.ConstraintMode; import io.ebean.bean.BeanCollection; import io.ebean.bean.EntityBean; -import io.ebean.config.BeanNotEnhancedException; -import io.ebean.config.DatabaseConfig; -import io.ebean.config.EncryptKey; -import io.ebean.config.EncryptKeyManager; -import io.ebean.config.NamingConvention; -import io.ebean.config.dbplatform.DatabasePlatform; -import io.ebean.config.dbplatform.DbHistorySupport; -import io.ebean.config.dbplatform.DbIdentity; -import io.ebean.config.dbplatform.IdType; -import io.ebean.config.dbplatform.PlatformIdGenerator; +import io.ebean.config.*; +import io.ebean.config.dbplatform.*; import io.ebean.core.type.ScalarType; import io.ebean.event.changelog.ChangeLogFilter; import io.ebean.event.changelog.ChangeLogListener; @@ -36,26 +28,12 @@ import io.ebeaninternal.server.deploy.BeanDescriptor.EntityType; import io.ebeaninternal.server.deploy.id.IdBinder; import io.ebeaninternal.server.deploy.id.IdBinderEmbedded; import io.ebeaninternal.server.deploy.id.IdBinderFactory; -import io.ebeaninternal.server.deploy.meta.DeployBeanDescriptor; -import io.ebeaninternal.server.deploy.meta.DeployBeanProperty; -import io.ebeaninternal.server.deploy.meta.DeployBeanPropertyAssoc; -import io.ebeaninternal.server.deploy.meta.DeployBeanPropertyAssocMany; -import io.ebeaninternal.server.deploy.meta.DeployBeanPropertyAssocOne; -import io.ebeaninternal.server.deploy.meta.DeployBeanTable; -import io.ebeaninternal.server.deploy.meta.DeployIdentityMode; -import io.ebeaninternal.server.deploy.meta.DeployOrderColumn; -import io.ebeaninternal.server.deploy.meta.DeployTableJoin; -import io.ebeaninternal.server.deploy.parse.DeployBeanInfo; -import io.ebeaninternal.server.deploy.parse.DeployCreateProperties; -import io.ebeaninternal.server.deploy.parse.DeployInherit; -import io.ebeaninternal.server.deploy.parse.DeployUtil; -import io.ebeaninternal.server.deploy.parse.ReadAnnotations; -import io.ebeaninternal.server.deploy.parse.TransientProperties; +import io.ebeaninternal.server.deploy.meta.*; +import io.ebeaninternal.server.deploy.parse.*; import io.ebeaninternal.server.persist.platform.MultiValueBind; import io.ebeaninternal.server.properties.BeanPropertiesReader; import io.ebeaninternal.server.properties.BeanPropertyAccess; import io.ebeaninternal.server.properties.EnhanceBeanPropertyAccess; -import io.ebeaninternal.server.type.ScalarTypeInteger; import io.ebeaninternal.server.type.TypeManager; import io.ebeaninternal.xmapping.api.XmapEbean; import io.ebeaninternal.xmapping.api.XmapEntity; @@ -73,14 +51,7 @@ import javax.sql.DataSource; import java.io.Serializable; import java.lang.reflect.Field; import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.concurrent.TimeUnit; /** @@ -905,7 +876,8 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy private void makeOrderColumn(DeployBeanPropertyAssocMany oneToMany) { DeployBeanDescriptor targetDesc = getTargetDescriptor(oneToMany); DeployOrderColumn orderColumn = oneToMany.getOrderColumn(); - DeployBeanProperty orderProperty = new DeployBeanProperty(targetDesc, Integer.class, ScalarTypeInteger.INSTANCE, null); + final ScalarType scalarType = typeManager.getScalarType(Integer.class); + DeployBeanProperty orderProperty = new DeployBeanProperty(targetDesc, Integer.class, scalarType, null); orderProperty.setName(DeployOrderColumn.LOGICAL_NAME); orderProperty.setDbColumn(orderColumn.getName()); orderProperty.setNullable(orderColumn.isNullable()); diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationFields.java b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationFields.java index b6d570817..571e1d3ca 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationFields.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/parse/AnnotationFields.java @@ -82,9 +82,7 @@ final class AnnotationFields extends AnnotationParser { * If present read Jackson JsonIgnore. */ private final boolean jacksonAnnotationsPresent; - private final GeneratedPropertyFactory generatedPropFactory; - /** * By default we lazy load Lob properties. */ @@ -118,20 +116,16 @@ final class AnnotationFields extends AnnotationParser { * Read the Id marker annotations on EmbeddedId properties. */ private void readAssocOne(DeployBeanPropertyAssoc prop) { - readJsonAnnotations(prop); - if (has(prop, Id.class)) { readIdAssocOne(prop); } - if (has(prop, EmbeddedId.class)) { prop.setId(); prop.setNullable(false); prop.setEmbedded(); info.setEmbeddedId(prop); } - DocEmbedded docEmbedded = get(prop, DocEmbedded.class); if (docEmbedded != null) { prop.setDocStoreEmbedded(docEmbedded.doc()); @@ -143,19 +137,16 @@ final class AnnotationFields extends AnnotationParser { } } } - if (prop instanceof DeployBeanPropertyAssocOne) { if (prop.isId() && !prop.isEmbedded()) { prop.setEmbedded(); } readEmbeddedAttributeOverrides((DeployBeanPropertyAssocOne) prop); } - Formula formula = prop.getMetaAnnotationFormula(platform); if (formula != null) { prop.setSqlFormula(processFormula(formula.select()), processFormula(formula.join())); } - initWhoProperties(prop); initDbMigration(prop); } @@ -170,32 +161,26 @@ final class AnnotationFields extends AnnotationParser { } private void readField(DeployBeanProperty prop) { - // all Enums will have a ScalarType assigned... boolean isEnum = prop.getPropertyType().isEnum(); Enumerated enumerated = get(prop, Enumerated.class); if (isEnum || enumerated != null) { util.setEnumScalarType(enumerated, prop); } - // its persistent and assumed to be on the base table // rather than on a secondary table prop.setDbRead(true); prop.setDbInsertable(true); prop.setDbUpdateable(true); - Column column = prop.getMetaAnnotation(Column.class); if (column != null) { readColumn(column, prop); } - readJsonAnnotations(prop); - if (prop.getDbColumn() == null) { // No @Column or @Column.name() so use NamingConvention prop.setDbColumn(namingConvention.getColumnFromProperty(beanType, prop.getName())); } - initIdentity(prop); initTenantId(prop); initDbJson(prop); @@ -204,7 +189,6 @@ final class AnnotationFields extends AnnotationParser { initWhen(prop); initWhoProperties(prop); initDbMigration(prop); - // Want to process last so we can use with @Formula if (has(prop, Transient.class)) { // it is not a persistent property. @@ -213,9 +197,7 @@ final class AnnotationFields extends AnnotationParser { prop.setDbUpdateable(false); prop.setTransient(); } - initEncrypt(prop); - for (Index index : annotationIndexes(prop)) { addIndex(prop, index); } @@ -234,22 +216,18 @@ final class AnnotationFields extends AnnotationParser { if (identity != null) { readIdentity(identity); } - // determine the JDBC type using Lob/Temporal // otherwise based on the property Class Temporal temporal = get(prop, Temporal.class); if (temporal != null) { readTemporal(temporal, prop); - } else if (has(prop, Lob.class)) { util.setLobType(prop); } - Length length = get(prop, Length.class); if (length != null) { prop.setDbLength(length.value()); } - if (has(prop, io.ebean.annotation.NotNull.class)) { prop.setNullable(false); } @@ -336,7 +314,6 @@ final class AnnotationFields extends AnnotationParser { if (formula != null) { prop.setSqlFormula(processFormula(formula.select()), processFormula(formula.join())); } - final Aggregation aggregation = prop.getMetaAnnotation(Aggregation.class); if (aggregation != null) { prop.setAggregation(aggregation.value().replace("$1", prop.getName())); @@ -349,7 +326,6 @@ final class AnnotationFields extends AnnotationParser { prop.setVersionColumn(); generatedPropFactory.setVersion(prop); } - Basic basic = get(prop, Basic.class); if (basic != null) { prop.setFetchType(basic.fetch()); @@ -397,7 +373,6 @@ final class AnnotationFields extends AnnotationParser { if (dbDefault != null) { prop.setDbColumnDefault(dbDefault.value()); } - Set dbMigration = annotationDbMigrations(prop); dbMigration.forEach(ann -> prop.addDbMigrationInfo( new DbMigrationInfo(ann.preAdd(), ann.postAdd(), ann.preAlter(), ann.postAlter(), ann.platforms()))); @@ -423,7 +398,6 @@ final class AnnotationFields extends AnnotationParser { throw new RuntimeException("DB-columname has to be specified exactly one time in columnNames."); } } - if (columnNames.length == 1 && hasRelationshipItem(prop)) { throw new RuntimeException("Can't use Index on foreign key relationships."); } @@ -438,13 +412,11 @@ final class AnnotationFields extends AnnotationParser { prop.setJsonDeserialize(!jsonIgnore.value()); } } - Expose expose = get(prop, Expose.class); if (expose != null) { prop.setJsonSerialize(expose.serialize()); prop.setJsonDeserialize(expose.deserialize()); } - JsonIgnore jsonIgnore = get(prop, JsonIgnore.class); if (jsonIgnore != null) { prop.setJsonSerialize(jsonIgnore.serialize()); @@ -460,9 +432,7 @@ final class AnnotationFields extends AnnotationParser { } private void setEncryption(DeployBeanProperty prop, boolean dbEncString, int dbLen) { - util.checkEncryptKeyManagerDefined(prop.getFullBeanName()); - ScalarType st = prop.getScalarType(); if (byte[].class.equals(st.getType())) { // Always using Java client encryption rather than DB for encryption @@ -474,12 +444,9 @@ final class AnnotationFields extends AnnotationParser { prop.setScalarType(encryptedScalarType); prop.setLocalEncrypted(); return; - } if (dbEncString) { - DbEncrypt dbEncrypt = util.getDbPlatform().getDbEncrypt(); - if (dbEncrypt != null) { // check if we have a DB encryption function for this type int jdbcType = prop.getScalarType().getJdbcType(); @@ -491,7 +458,6 @@ final class AnnotationFields extends AnnotationParser { } } } - prop.setScalarType(createScalarType(prop, st)); prop.setLocalEncrypted(); if (dbLen > 0) { @@ -501,11 +467,9 @@ final class AnnotationFields extends AnnotationParser { @SuppressWarnings({"unchecked"}) private ScalarTypeEncryptedWrapper createScalarType(DeployBeanProperty prop, ScalarType st) { - // Use Java Encryptor wrapping the logical scalar type DataEncryptSupport support = createDataEncryptSupport(prop); ScalarTypeBytesBase byteType = getDbEncryptType(prop); - return new ScalarTypeEncryptedWrapper(st, byteType, support); } @@ -515,10 +479,8 @@ final class AnnotationFields extends AnnotationParser { } private DataEncryptSupport createDataEncryptSupport(DeployBeanProperty prop) { - String table = info.getDescriptor().getBaseTable(); String column = prop.getDbColumn(); - return util.createDataEncryptSupport(table, column); } @@ -530,7 +492,6 @@ final class AnnotationFields extends AnnotationParser { } } descriptor.setIdGeneratedValue(); - SequenceGenerator seq = get(prop, SequenceGenerator.class); if (seq != null) { String seqName = seq.sequenceName(); @@ -543,13 +504,11 @@ final class AnnotationFields extends AnnotationParser { GenerationType strategy = gen.strategy(); if (strategy == GenerationType.IDENTITY) { descriptor.setIdentityType(IdType.IDENTITY); - } else if (strategy == GenerationType.SEQUENCE) { descriptor.setIdentityType(IdType.SEQUENCE); if (!gen.generator().isEmpty()) { descriptor.setIdentitySequenceGenerator(gen.generator()); } - } else if (strategy == GenerationType.AUTO) { if (!gen.generator().isEmpty()) { // use a custom IdGenerator @@ -565,21 +524,16 @@ final class AnnotationFields extends AnnotationParser { } private void readTemporal(Temporal temporal, DeployBeanProperty prop) { - TemporalType type = temporal.value(); if (type == TemporalType.DATE) { prop.setDbType(Types.DATE); - } else if (type == TemporalType.TIMESTAMP) { prop.setDbType(Types.TIMESTAMP); - } else if (type == TemporalType.TIME) { prop.setDbType(Types.TIME); - } else { throw new PersistenceException("Unhandled type " + type); } } - } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ConvertInetAddresses.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ConvertInetAddresses.java index 03357004a..ebec02029 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ConvertInetAddresses.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ConvertInetAddresses.java @@ -112,7 +112,7 @@ import java.util.regex.Pattern; * @author Erik Kline * @since 5 */ -public final class ConvertInetAddresses { +final class ConvertInetAddresses { private static final int IPV4_PART_COUNT = 4; private static final int IPV6_PART_COUNT = 8; diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/DecimalUtils.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/DecimalUtils.java index 72f2d4e96..13ceb73c2 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/DecimalUtils.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/DecimalUtils.java @@ -27,7 +27,7 @@ import java.time.Instant; * @author Nick Williams * @since 2.2.0 */ -public final class DecimalUtils { +final class DecimalUtils { private static final char[] ZEROES = new char[]{'0', '0', '0', '0', '0', '0', '0', '0', '0'}; @@ -37,17 +37,17 @@ public final class DecimalUtils { throw new RuntimeException("DecimalUtils cannot be instantiated."); } - public static Duration toDuration(BigDecimal value) { + static Duration toDuration(BigDecimal value) { long seconds = value.longValue(); int nanoseconds = extractNanosecondDecimal(value, seconds); return Duration.ofSeconds(seconds, nanoseconds); } - public static BigDecimal toDecimal(Duration instant) { + static BigDecimal toDecimal(Duration instant) { return new BigDecimal(toDecimal(instant.getSeconds(), instant.getNano())); } - public static Timestamp toTimestamp(BigDecimal value) { + static Timestamp toTimestamp(BigDecimal value) { long seconds = value.longValue(); int nanoseconds = extractNanosecondDecimal(value, seconds); Timestamp ts = new Timestamp(seconds * 1000); @@ -55,30 +55,30 @@ public final class DecimalUtils { return ts; } - public static BigDecimal toDecimal(Timestamp instant) { + static BigDecimal toDecimal(Timestamp instant) { long millis = instant.getTime(); long secs = millis / 1000; return new BigDecimal(toDecimal(secs, instant.getNanos())); } - public static Instant toInstant(BigDecimal value) { + static Instant toInstant(BigDecimal value) { long seconds = value.longValue(); int nanoseconds = extractNanosecondDecimal(value, seconds); return Instant.ofEpochSecond(seconds, nanoseconds); } - public static BigDecimal toDecimal(Instant instant) { + static BigDecimal toDecimal(Instant instant) { return new BigDecimal(toDecimal(instant.getEpochSecond(), instant.getNano())); } - public static String toDecimal(long seconds, int nanoseconds) { + static String toDecimal(long seconds, int nanoseconds) { StringBuilder string = new StringBuilder(Integer.toString(nanoseconds)); if (string.length() < 9) string.insert(0, ZEROES, 0, 9 - string.length()); return seconds + "." + string; } - public static int extractNanosecondDecimal(BigDecimal value, long integer) { + static int extractNanosecondDecimal(BigDecimal value, long integer) { return value.subtract(new BigDecimal(integer)).multiply(ONE_BILLION).intValue(); } } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/DefaultTypeFactory.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/DefaultTypeFactory.java index 6c2f3b860..b962a4811 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/DefaultTypeFactory.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/DefaultTypeFactory.java @@ -14,7 +14,7 @@ import java.util.Date; * Helper to create some default ScalarType objects for Booleans, * java.util.Date, java.util.Calendar etc. */ -public final class DefaultTypeFactory { +final class DefaultTypeFactory { private final DatabaseConfig config; diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/DefaultTypeManager.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/DefaultTypeManager.java index 6e1e1f0d7..d58c284f3 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/DefaultTypeManager.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/DefaultTypeManager.java @@ -71,7 +71,7 @@ public final class DefaultTypeManager implements TypeManager { private final ScalarType varbinaryType = new ScalarTypeBytesVarbinary(); private final ScalarType longVarbinaryType = new ScalarTypeBytesLongVarbinary(); private final ScalarType shortType = new ScalarTypeShort(); - private final ScalarType integerType = ScalarTypeInteger.INSTANCE; + private final ScalarType integerType = new ScalarTypeInteger(); private final ScalarType longType = new ScalarTypeLong(); private final ScalarType doubleType = new ScalarTypeDouble(); private final ScalarType floatType = new ScalarTypeFloat(); diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/EnumToDbIntegerMap.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/EnumToDbIntegerMap.java index 419d8f53a..2e2d2cc31 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/EnumToDbIntegerMap.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/EnumToDbIntegerMap.java @@ -10,7 +10,7 @@ import java.sql.Types; /** * Used to map enum values to database integer values. */ -public final class EnumToDbIntegerMap extends EnumToDbValueMap { +final class EnumToDbIntegerMap extends EnumToDbValueMap { @Override public int getDbType() { diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/EnumToDbStringMap.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/EnumToDbStringMap.java index c7dc4bc89..062749580 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/EnumToDbStringMap.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/EnumToDbStringMap.java @@ -9,7 +9,7 @@ import java.sql.Types; /** * Used to map Enum values to database string/varchar values. */ -public final class EnumToDbStringMap extends EnumToDbValueMap { +final class EnumToDbStringMap extends EnumToDbValueMap { @Override public int getDbType() { diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/EnumToDbValueMap.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/EnumToDbValueMap.java index 57ab47ef5..92ebc9334 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/EnumToDbValueMap.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/EnumToDbValueMap.java @@ -15,9 +15,9 @@ import java.util.LinkedHashMap; * Enum gets converter to. *

*/ -public abstract class EnumToDbValueMap { +abstract class EnumToDbValueMap { - public static EnumToDbValueMap create(boolean integerType) { + static EnumToDbValueMap create(boolean integerType) { return integerType ? new EnumToDbIntegerMap() : new EnumToDbStringMap(); } @@ -30,7 +30,7 @@ public abstract class EnumToDbValueMap { /** * Construct with allowNulls defaulting to false. */ - public EnumToDbValueMap() { + EnumToDbValueMap() { this(false, false); } @@ -42,7 +42,7 @@ public abstract class EnumToDbValueMap { * value is found. *

*/ - public EnumToDbValueMap(boolean allowNulls, boolean isIntegerType) { + EnumToDbValueMap(boolean allowNulls, boolean isIntegerType) { this.allowNulls = allowNulls; this.isIntegerType = isIntegerType; this.keyMap = new LinkedHashMap<>(); @@ -54,7 +54,7 @@ public abstract class EnumToDbValueMap { * Return true if this is mapping to integers, false * if mapping to Strings. */ - public boolean isIntegerType() { + boolean isIntegerType() { return isIntegerType; } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/LongToTimestampConverter.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/LongToTimestampConverter.java deleted file mode 100644 index 83d55871d..000000000 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/LongToTimestampConverter.java +++ /dev/null @@ -1,24 +0,0 @@ -package io.ebeaninternal.server.type; - -import io.ebean.config.ScalarTypeConverter; - -import java.sql.Timestamp; - -public final class LongToTimestampConverter implements ScalarTypeConverter { - - @Override - public Long getNullValue() { - return null; - } - - @Override - public Timestamp unwrapValue(Long beanType) { - return new Timestamp(beanType); - } - - @Override - public Long wrapValue(Timestamp scalarType) { - return scalarType.getTime(); - } - -} diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/PostgresHelper.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/PostgresHelper.java index f0f9c54bd..768c7a751 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/PostgresHelper.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/PostgresHelper.java @@ -9,14 +9,14 @@ public final class PostgresHelper { /** * The Postgres JSON DB type. */ - public static final String JSON_TYPE = "json"; + static final String JSON_TYPE = "json"; /** * The Postgres JSONB DB type. */ - public static final String JSONB_TYPE = "jsonb"; + static final String JSONB_TYPE = "jsonb"; - public static final String INET_TYPE = "inet"; + static final String INET_TYPE = "inet"; public static Object asInet(String value) throws SQLException { return asObject(INET_TYPE, value); diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeArrayList.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeArrayList.java index 6ee64d5cf..f0b0ad855 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeArrayList.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeArrayList.java @@ -28,7 +28,7 @@ import static java.util.Collections.EMPTY_LIST; * Type mapped for DB ARRAY type (Postgres only effectively). */ @SuppressWarnings("rawtypes") -public class ScalarTypeArrayList extends ScalarTypeArrayBase implements ScalarTypeArray { +class ScalarTypeArrayList extends ScalarTypeArrayBase implements ScalarTypeArray { static PlatformArrayTypeFactory factory() { return new Factory(); diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeArraySet.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeArraySet.java index 90f592428..666d52b10 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeArraySet.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeArraySet.java @@ -29,7 +29,7 @@ import static java.util.Collections.EMPTY_SET; * Type mapped for DB ARRAY type (Postgres only effectively). */ @SuppressWarnings({"rawtypes", "unchecked"}) -public class ScalarTypeArraySet extends ScalarTypeArrayBase implements ScalarTypeArray { +class ScalarTypeArraySet extends ScalarTypeArrayBase implements ScalarTypeArray { static PlatformArrayTypeFactory factory() { return new Factory(); diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBase.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBase.java index a6a0675a0..5d2bb45e9 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBase.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBase.java @@ -6,15 +6,13 @@ import io.ebean.core.type.ScalarType; /** * Base ScalarType object. */ -public abstract class ScalarTypeBase implements ScalarType { +abstract class ScalarTypeBase implements ScalarType { protected final Class type; - protected final boolean jdbcNative; - protected final int jdbcType; - public ScalarTypeBase(Class type, boolean jdbcNative, int jdbcType) { + ScalarTypeBase(Class type, boolean jdbcNative, int jdbcType) { this.type = type; this.jdbcNative = jdbcNative; this.jdbcType = jdbcType; diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBaseDate.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBaseDate.java index f752da1d4..4e55d34de 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBaseDate.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBaseDate.java @@ -18,7 +18,7 @@ import java.sql.Types; /** * Base class for Date types. */ -public abstract class ScalarTypeBaseDate extends ScalarTypeBase { +abstract class ScalarTypeBaseDate extends ScalarTypeBase { protected final JsonConfig.Date mode; diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBaseDateTime.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBaseDateTime.java index c296b2e1f..aa1670df7 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBaseDateTime.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBaseDateTime.java @@ -21,11 +21,11 @@ import static io.ebeaninternal.server.type.IsoJsonDateTimeParser.parseIso; /** * Base type for DateTime types. */ -public abstract class ScalarTypeBaseDateTime extends ScalarTypeBase { +abstract class ScalarTypeBaseDateTime extends ScalarTypeBase { protected final JsonConfig.DateTime mode; - public ScalarTypeBaseDateTime(JsonConfig.DateTime mode, Class type, boolean jdbcNative, int jdbcType) { + ScalarTypeBaseDateTime(JsonConfig.DateTime mode, Class type, boolean jdbcNative, int jdbcType) { super(type, jdbcNative, jdbcType); this.mode = mode; } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBaseVarchar.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBaseVarchar.java index 78e26c4c0..7fd7d974e 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBaseVarchar.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBaseVarchar.java @@ -17,13 +17,13 @@ import java.sql.Types; * Base ScalarType for types which converts to and from a VARCHAR database * column. */ -public abstract class ScalarTypeBaseVarchar extends ScalarTypeBase { +abstract class ScalarTypeBaseVarchar extends ScalarTypeBase { - public ScalarTypeBaseVarchar(Class type) { + ScalarTypeBaseVarchar(Class type) { super(type, false, Types.VARCHAR); } - public ScalarTypeBaseVarchar(Class type, boolean jdbcNative, int jdbcType) { + ScalarTypeBaseVarchar(Class type, boolean jdbcNative, int jdbcType) { super(type, jdbcNative, jdbcType); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBigDecimal.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBigDecimal.java index 58dc1e720..0a3e98b6c 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBigDecimal.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBigDecimal.java @@ -17,9 +17,9 @@ import java.sql.Types; /** * ScalarType for BigDecimal. */ -public class ScalarTypeBigDecimal extends ScalarTypeBase { +class ScalarTypeBigDecimal extends ScalarTypeBase { - public ScalarTypeBigDecimal() { + ScalarTypeBigDecimal() { super(BigDecimal.class, true, Types.DECIMAL); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeByte.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeByte.java index 3a64f421f..250bb1006 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeByte.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeByte.java @@ -18,7 +18,7 @@ import java.sql.Types; /** * ScalarType for Byte. */ -public final class ScalarTypeByte extends ScalarTypeBase { +final class ScalarTypeByte extends ScalarTypeBase { public ScalarTypeByte() { super(Byte.class, true, Types.TINYINT); diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesBase.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesBase.java index 202ade97e..437c626f8 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesBase.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesBase.java @@ -17,7 +17,7 @@ import java.sql.SQLException; */ public abstract class ScalarTypeBytesBase extends ScalarTypeBase { - protected ScalarTypeBytesBase(boolean jdbcNative, int jdbcType) { + ScalarTypeBytesBase(boolean jdbcNative, int jdbcType) { super(byte[].class, jdbcNative, jdbcType); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesBinary.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesBinary.java index 18cdb096e..45e143aff 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesBinary.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesBinary.java @@ -8,9 +8,9 @@ import java.sql.Types; /** * ScalarType for Types.BINARY to byte[]. */ -public final class ScalarTypeBytesBinary extends ScalarTypeBytesBase { +final class ScalarTypeBytesBinary extends ScalarTypeBytesBase { - public ScalarTypeBytesBinary() { + ScalarTypeBytesBinary() { super(true, Types.BINARY); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesBlob.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesBlob.java index 5cc3e2afc..88ba70876 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesBlob.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesBlob.java @@ -8,9 +8,9 @@ import java.sql.Types; /** * ScalarType for BLOB. */ -public final class ScalarTypeBytesBlob extends ScalarTypeBytesBase { +final class ScalarTypeBytesBlob extends ScalarTypeBytesBase { - public ScalarTypeBytesBlob() { + ScalarTypeBytesBlob() { super(true, Types.BLOB); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesLongVarbinary.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesLongVarbinary.java index fef593e12..7b561a302 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesLongVarbinary.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesLongVarbinary.java @@ -8,9 +8,9 @@ import java.sql.Types; /** * ScalarType for Longvarbinary. */ -public final class ScalarTypeBytesLongVarbinary extends ScalarTypeBytesBase { +final class ScalarTypeBytesLongVarbinary extends ScalarTypeBytesBase { - public ScalarTypeBytesLongVarbinary() { + ScalarTypeBytesLongVarbinary() { super(true, Types.LONGVARBINARY); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesVarbinary.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesVarbinary.java index dea5cc1a1..dc61c87f2 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesVarbinary.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeBytesVarbinary.java @@ -8,9 +8,9 @@ import java.sql.Types; /** * ScalarType for Types.VARBINARY to byte[]. */ -public final class ScalarTypeBytesVarbinary extends ScalarTypeBytesBase { +final class ScalarTypeBytesVarbinary extends ScalarTypeBytesBase { - public ScalarTypeBytesVarbinary() { + ScalarTypeBytesVarbinary() { super(true, Types.VARBINARY); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCalendar.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCalendar.java index bbefa5a83..9028523b4 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCalendar.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCalendar.java @@ -16,9 +16,9 @@ import static io.ebeaninternal.server.type.IsoJsonDateTimeParser.formatIso; /** * ScalarType for java.util.Calendar. */ -public final class ScalarTypeCalendar extends ScalarTypeBaseDateTime { +final class ScalarTypeCalendar extends ScalarTypeBaseDateTime { - public ScalarTypeCalendar(JsonConfig.DateTime mode, int jdbcType) { + ScalarTypeCalendar(JsonConfig.DateTime mode, int jdbcType) { super(mode, Calendar.class, false, jdbcType); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeChar.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeChar.java index f5fe00954..6be7012b6 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeChar.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeChar.java @@ -10,9 +10,9 @@ import java.sql.Types; /** * ScalarType for char. */ -public final class ScalarTypeChar extends ScalarTypeBaseVarchar { +final class ScalarTypeChar extends ScalarTypeBaseVarchar { - public ScalarTypeChar() { + ScalarTypeChar() { super(char.class, false, Types.VARCHAR); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCharArray.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCharArray.java index ebfd69a6f..869614f9d 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCharArray.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCharArray.java @@ -13,9 +13,9 @@ import java.sql.Types; /** * ScalarType for char[]. */ -public final class ScalarTypeCharArray extends ScalarTypeBaseVarchar { +final class ScalarTypeCharArray extends ScalarTypeBaseVarchar { - public ScalarTypeCharArray() { + ScalarTypeCharArray() { super(char[].class, false, Types.VARCHAR); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCidr.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCidr.java index 390ac22c7..6c9f18b82 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCidr.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCidr.java @@ -10,7 +10,7 @@ import java.sql.Types; /** * ScalarType for Cidr to Varchar or Postgres CIDR. */ -public abstract class ScalarTypeCidr extends ScalarTypeBaseVarchar { +abstract class ScalarTypeCidr extends ScalarTypeBaseVarchar { ScalarTypeCidr() { super(Cidr.class, false, ExtraDbTypes.CIDR); @@ -42,7 +42,7 @@ public abstract class ScalarTypeCidr extends ScalarTypeBaseVarchar { /** * Cidr to Varchar. */ - public static final class Varchar extends ScalarTypeCidr { + static final class Varchar extends ScalarTypeCidr { @Override public void bind(DataBinder binder, Cidr value) throws SQLException { @@ -57,7 +57,7 @@ public abstract class ScalarTypeCidr extends ScalarTypeBaseVarchar { /** * Cidr to Postgres CIDR. */ - public static final class Postgres extends ScalarTypeCidr { + static final class Postgres extends ScalarTypeCidr { @Override public void bind(DataBinder binder, Cidr value) throws SQLException { diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeClass.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeClass.java index 78f4a19de..44fb1c475 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeClass.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeClass.java @@ -6,7 +6,7 @@ import javax.persistence.PersistenceException; * ScalarType for Class that persists it to VARCHAR column. */ @SuppressWarnings({"rawtypes"}) -public final class ScalarTypeClass extends ScalarTypeBaseVarchar { +final class ScalarTypeClass extends ScalarTypeBaseVarchar { public ScalarTypeClass() { super(Class.class); diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeClob.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeClob.java index f2df74f00..7903a76ea 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeClob.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeClob.java @@ -8,13 +8,13 @@ import java.sql.Types; /** * ScalarType for String. */ -public class ScalarTypeClob extends ScalarTypeStringBase { +class ScalarTypeClob extends ScalarTypeStringBase { ScalarTypeClob(boolean jdbcNative, int jdbcType) { super(jdbcNative, jdbcType); } - public ScalarTypeClob() { + ScalarTypeClob() { super(true, Types.CLOB); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCurrency.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCurrency.java index 0eaeb8602..194e43c32 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCurrency.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeCurrency.java @@ -5,9 +5,9 @@ import java.util.Currency; /** * ScalarType for java.util.Currency which converts to and from a VARCHAR database column. */ -public final class ScalarTypeCurrency extends ScalarTypeBaseVarchar { +final class ScalarTypeCurrency extends ScalarTypeBaseVarchar { - public ScalarTypeCurrency() { + ScalarTypeCurrency() { super(Currency.class); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDate.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDate.java index b69571c11..84d7330da 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDate.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDate.java @@ -12,9 +12,9 @@ import java.sql.Types; /** * ScalarType for java.sql.Date. */ -public final class ScalarTypeDate extends ScalarTypeBaseDate { +final class ScalarTypeDate extends ScalarTypeBaseDate { - public ScalarTypeDate(JsonConfig.Date mode) { + ScalarTypeDate(JsonConfig.Date mode) { super(mode, Date.class, true, Types.DATE); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDayOfWeek.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDayOfWeek.java index 1cee17865..b0c8b3e7f 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDayOfWeek.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDayOfWeek.java @@ -11,7 +11,7 @@ import java.time.DayOfWeek; /** * ScalarType mapping for Month enum. */ -public final class ScalarTypeDayOfWeek extends ScalarTypeEnumWithMapping { +final class ScalarTypeDayOfWeek extends ScalarTypeEnumWithMapping { static final EnumToDbIntegerMap beanDbMap = new EnumToDbIntegerMap(); @@ -22,7 +22,7 @@ public final class ScalarTypeDayOfWeek extends ScalarTypeEnumWithMapping { } } - public ScalarTypeDayOfWeek() { + ScalarTypeDayOfWeek() { super(beanDbMap, DayOfWeek.class, 1); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDouble.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDouble.java index 02adb9de8..5877c5d4a 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDouble.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDouble.java @@ -16,9 +16,9 @@ import java.sql.Types; /** * ScalarType for Double and double. */ -public final class ScalarTypeDouble extends ScalarTypeBase { +final class ScalarTypeDouble extends ScalarTypeBase { - public ScalarTypeDouble() { + ScalarTypeDouble() { super(Double.class, true, Types.DOUBLE); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDuration.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDuration.java index 4632160d9..8e34afe27 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDuration.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDuration.java @@ -19,21 +19,21 @@ import java.time.Duration; /** * ScalarType for java.time.Duration (with seconds precision). */ -public class ScalarTypeDuration extends ScalarTypeBase { +class ScalarTypeDuration extends ScalarTypeBase { - public ScalarTypeDuration() { + ScalarTypeDuration() { super(Duration.class, false, Types.BIGINT); } - protected ScalarTypeDuration(int jdbcType) { + ScalarTypeDuration(int jdbcType) { super(Duration.class, false, jdbcType); } - public BigDecimal convertToBigDecimal(Duration value) { + BigDecimal convertToBigDecimal(Duration value) { return (value == null) ? null : DecimalUtils.toDecimal(value); } - public Duration convertFromBigDecimal(BigDecimal value) { + Duration convertFromBigDecimal(BigDecimal value) { return (value == null) ? null : DecimalUtils.toDuration(value); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDurationWithNanos.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDurationWithNanos.java index 2f99708b3..9ba27cc6c 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDurationWithNanos.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeDurationWithNanos.java @@ -15,9 +15,9 @@ import java.time.Duration; * Stored in the DB as DECIMAL value. *

*/ -public final class ScalarTypeDurationWithNanos extends ScalarTypeDuration { +final class ScalarTypeDurationWithNanos extends ScalarTypeDuration { - public ScalarTypeDurationWithNanos() { + ScalarTypeDurationWithNanos() { super(Types.DECIMAL); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeEnumStandard.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeEnumStandard.java index dcdc8d42a..8545bc9a7 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeEnumStandard.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeEnumStandard.java @@ -28,17 +28,17 @@ import java.util.Set; * Ebean specific @EnumMapping. *

*/ -public final class ScalarTypeEnumStandard { +final class ScalarTypeEnumStandard { @SuppressWarnings({"rawtypes", "unchecked"}) - public static final class StringEnum extends EnumBase implements ScalarTypeEnum { + static final class StringEnum extends EnumBase implements ScalarTypeEnum { private final int length; /** * Create a ScalarTypeEnum. */ - public StringEnum(Class enumType) { + StringEnum(Class enumType) { super(enumType, false, Types.VARCHAR); this.length = maxValueLength(enumType); } @@ -117,14 +117,14 @@ public final class ScalarTypeEnumStandard { } @SuppressWarnings({"rawtypes", "unchecked"}) - public static final class OrdinalEnum extends EnumBase implements ScalarTypeEnum { + static final class OrdinalEnum extends EnumBase implements ScalarTypeEnum { private final Object[] enumArray; /** * Create a ScalarTypeEnum. */ - public OrdinalEnum(Class enumType) { + OrdinalEnum(Class enumType) { super(enumType, false, Types.INTEGER); this.enumArray = EnumSet.allOf(enumType).toArray(); } @@ -200,11 +200,11 @@ public final class ScalarTypeEnumStandard { } @SuppressWarnings({"rawtypes", "unchecked"}) - public abstract static class EnumBase extends ScalarTypeBase { + abstract static class EnumBase extends ScalarTypeBase { protected final Class enumType; - public EnumBase(Class type, boolean jdbcNative, int jdbcType) { + EnumBase(Class type, boolean jdbcNative, int jdbcType) { super(type, jdbcNative, jdbcType); this.enumType = type; } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeEnumWithMapping.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeEnumWithMapping.java index 6960d4d09..cafee64f7 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeEnumWithMapping.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeEnumWithMapping.java @@ -14,7 +14,7 @@ import java.util.Set; * Additional control over mapping to DB values. */ @SuppressWarnings({"unchecked", "rawtypes"}) -public class ScalarTypeEnumWithMapping extends ScalarTypeEnumStandard.EnumBase implements ScalarType, ScalarTypeEnum { +class ScalarTypeEnumWithMapping extends ScalarTypeEnumStandard.EnumBase implements ScalarType, ScalarTypeEnum { private final EnumToDbValueMap beanDbMap; private final int length; @@ -23,14 +23,14 @@ public class ScalarTypeEnumWithMapping extends ScalarTypeEnumStandard.EnumBase i /** * Create with an explicit mapping of bean to database values. */ - public ScalarTypeEnumWithMapping(EnumToDbValueMap beanDbMap, Class enumType, int length, boolean withConstraint) { + ScalarTypeEnumWithMapping(EnumToDbValueMap beanDbMap, Class enumType, int length, boolean withConstraint) { super(enumType, false, beanDbMap.getDbType()); this.beanDbMap = beanDbMap; this.length = length; this.withConstraint = withConstraint; } - public ScalarTypeEnumWithMapping(EnumToDbValueMap beanDbMap, Class enumType, int length) { + ScalarTypeEnumWithMapping(EnumToDbValueMap beanDbMap, Class enumType, int length) { this(beanDbMap, enumType, length, true); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeFile.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeFile.java index d6f694672..2aa96dba5 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeFile.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeFile.java @@ -25,7 +25,7 @@ import java.sql.Types; /** * ScalarType for streaming between a File and the database. */ -public final class ScalarTypeFile extends ScalarTypeBase { +final class ScalarTypeFile extends ScalarTypeBase { private static final Logger logger = LoggerFactory.getLogger(ScalarTypeFile.class); @@ -37,14 +37,14 @@ public final class ScalarTypeFile extends ScalarTypeBase { /** * Construct with reasonable defaults of Blob and 8096 buffer size. */ - public ScalarTypeFile() { + ScalarTypeFile() { this(Types.LONGVARBINARY, "db-", null, null, 8096); } /** * Create the ScalarTypeFile. */ - public ScalarTypeFile(int jdbcType, String prefix, String suffix, File directory, int bufferSize) { + ScalarTypeFile(int jdbcType, String prefix, String suffix, File directory, int bufferSize) { super(File.class, false, jdbcType); this.prefix = prefix; this.suffix = suffix; @@ -73,15 +73,12 @@ public final class ScalarTypeFile extends ScalarTypeBase { if (is == null) { return null; } - try { // stream from db into our temp file File tempFile = File.createTempFile(prefix, suffix, directory); OutputStream os = getOutputStream(tempFile); pump(is, os); - return tempFile; - } catch (IOException e) { throw new SQLException("Error reading db file inputStream", e); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeFloat.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeFloat.java index d468b74ef..fd13f2082 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeFloat.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeFloat.java @@ -16,9 +16,9 @@ import java.sql.Types; /** * ScalarType for Float and float. */ -public final class ScalarTypeFloat extends ScalarTypeBase { +final class ScalarTypeFloat extends ScalarTypeBase { - public ScalarTypeFloat() { + ScalarTypeFloat() { super(Float.class, true, Types.REAL); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInet.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInet.java index 9a7b884f4..122fdcc5a 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInet.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInet.java @@ -10,7 +10,7 @@ import java.sql.Types; /** * ScalarType for Inet to Varchar or Postgres INET. */ -public abstract class ScalarTypeInet extends ScalarTypeBaseVarchar { +abstract class ScalarTypeInet extends ScalarTypeBaseVarchar { ScalarTypeInet(int jdbcType) { super(Inet.class, false, jdbcType); diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInetAddress.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInetAddress.java index 419f52cd3..166a81280 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInetAddress.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInetAddress.java @@ -7,9 +7,9 @@ import java.net.InetAddress; /** * ScalarType for java.net.URI which converts to and from a VARCHAR database column. */ -public final class ScalarTypeInetAddress extends ScalarTypeBaseVarchar { +final class ScalarTypeInetAddress extends ScalarTypeBaseVarchar { - public ScalarTypeInetAddress() { + ScalarTypeInetAddress() { super(InetAddress.class); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInetAddressPostgres.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInetAddressPostgres.java index aba3aa4c9..a4ff9074d 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInetAddressPostgres.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInetAddressPostgres.java @@ -11,9 +11,9 @@ import java.sql.Types; /** * ScalarType for InetAddress to Postgres INET. */ -public final class ScalarTypeInetAddressPostgres extends ScalarTypeBaseVarchar { +final class ScalarTypeInetAddressPostgres extends ScalarTypeBaseVarchar { - public ScalarTypeInetAddressPostgres() { + ScalarTypeInetAddressPostgres() { super(InetAddress.class, false, ExtraDbTypes.INET); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInstant.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInstant.java index 0d84af6e1..d3fbee011 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInstant.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInstant.java @@ -9,9 +9,9 @@ import java.time.Instant; /** * ScalarType for java.sql.Timestamp. */ -public final class ScalarTypeInstant extends ScalarTypeBaseDateTime { +final class ScalarTypeInstant extends ScalarTypeBaseDateTime { - public ScalarTypeInstant(JsonConfig.DateTime mode) { + ScalarTypeInstant(JsonConfig.DateTime mode) { super(mode, Instant.class, false, Types.TIMESTAMP); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInteger.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInteger.java index cae0de91b..172522224 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInteger.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeInteger.java @@ -17,11 +17,9 @@ import java.sql.Types; /** * ScalarType for Integer and int. */ -public final class ScalarTypeInteger extends ScalarTypeBase { +final class ScalarTypeInteger extends ScalarTypeBase { - public static ScalarTypeInteger INSTANCE = new ScalarTypeInteger(); - - private ScalarTypeInteger() { + ScalarTypeInteger() { super(Integer.class, true, Types.INTEGER); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaDateMidnight.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaDateMidnight.java index c108b99f1..9a7990a6d 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaDateMidnight.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaDateMidnight.java @@ -11,12 +11,12 @@ import java.sql.Types; * ScalarType for Joda DateMidnight. This maps to a JDBC Date. */ @SuppressWarnings("deprecation") -public final class ScalarTypeJodaDateMidnight extends ScalarTypeBaseDate { +final class ScalarTypeJodaDateMidnight extends ScalarTypeBaseDate { /** * Instantiates a new scalar type joda date midnight. */ - public ScalarTypeJodaDateMidnight(JsonConfig.Date mode) { + ScalarTypeJodaDateMidnight(JsonConfig.Date mode) { super(mode, org.joda.time.DateMidnight.class, false, Types.DATE); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaDateTime.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaDateTime.java index 2ca296ed0..0291f31dd 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaDateTime.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaDateTime.java @@ -11,9 +11,9 @@ import java.time.Instant; /** * ScalarType for Joda DateTime. This maps to a JDBC Timestamp. */ -public final class ScalarTypeJodaDateTime extends ScalarTypeBaseDateTime { +final class ScalarTypeJodaDateTime extends ScalarTypeBaseDateTime { - public ScalarTypeJodaDateTime(JsonConfig.DateTime mode) { + ScalarTypeJodaDateTime(JsonConfig.DateTime mode) { super(mode, DateTime.class, false, Types.TIMESTAMP); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalDate.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalDate.java index 09acb797e..a7f385442 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalDate.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalDate.java @@ -11,9 +11,9 @@ import java.sql.Types; /** * ScalarType for Joda LocalDate. This maps to a JDBC Date. */ -public final class ScalarTypeJodaLocalDate extends ScalarTypeBaseDate { +final class ScalarTypeJodaLocalDate extends ScalarTypeBaseDate { - public ScalarTypeJodaLocalDate(JsonConfig.Date mode) { + ScalarTypeJodaLocalDate(JsonConfig.Date mode) { super(mode, LocalDate.class, false, Types.DATE); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalDateTime.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalDateTime.java index 5d537dc9c..913d290be 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalDateTime.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalDateTime.java @@ -11,9 +11,9 @@ import java.time.Instant; /** * ScalarType for Joda LocalDateTime. This maps to a JDBC Timestamp. */ -public final class ScalarTypeJodaLocalDateTime extends ScalarTypeBaseDateTime { +final class ScalarTypeJodaLocalDateTime extends ScalarTypeBaseDateTime { - public ScalarTypeJodaLocalDateTime(JsonConfig.DateTime mode) { + ScalarTypeJodaLocalDateTime(JsonConfig.DateTime mode) { super(mode, LocalDateTime.class, false, Types.TIMESTAMP); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalTime.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalTime.java index bb8f5070b..785069345 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalTime.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalTime.java @@ -20,9 +20,9 @@ import java.sql.Types; /** * ScalarType for Joda LocalTime. This maps to a JDBC Time. */ -public class ScalarTypeJodaLocalTime extends ScalarTypeBase { +class ScalarTypeJodaLocalTime extends ScalarTypeBase { - public ScalarTypeJodaLocalTime() { + ScalarTypeJodaLocalTime() { super(LocalTime.class, false, Types.TIME); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalTimeUTC.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalTimeUTC.java index 4de3c513a..e19af274e 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalTimeUTC.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaLocalTimeUTC.java @@ -13,9 +13,9 @@ import java.sql.Types; /** * ScalarType for Joda LocalTime. This maps to a JDBC Time. */ -public final class ScalarTypeJodaLocalTimeUTC extends ScalarTypeJodaLocalTime { +final class ScalarTypeJodaLocalTimeUTC extends ScalarTypeJodaLocalTime { - public ScalarTypeJodaLocalTimeUTC() { + ScalarTypeJodaLocalTimeUTC() { super(); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaPeriod.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaPeriod.java index 2dc09a233..5c319c6ef 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaPeriod.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJodaPeriod.java @@ -5,9 +5,9 @@ import org.joda.time.Period; /** * ScalarType for Joda Period stored as DB VARCHAR */ -public final class ScalarTypeJodaPeriod extends ScalarTypeBaseVarchar { +final class ScalarTypeJodaPeriod extends ScalarTypeBaseVarchar { - public ScalarTypeJodaPeriod() { + ScalarTypeJodaPeriod() { super(Period.class); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJsonNode.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJsonNode.java index 9c3950b94..675328de5 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJsonNode.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJsonNode.java @@ -22,14 +22,14 @@ import java.sql.Types; /** * Type which maps Jackson's JsonNode to various DB types (Clob, Varchar, Blob) in JSON format. */ -public abstract class ScalarTypeJsonNode extends ScalarTypeBase { +abstract class ScalarTypeJsonNode extends ScalarTypeBase { /** * Clob storage based implementation. */ - public static final class Clob extends ScalarTypeJsonNode { + static final class Clob extends ScalarTypeJsonNode { - public Clob(ObjectMapper objectMapper) { + Clob(ObjectMapper objectMapper) { super(objectMapper, Types.CLOB); } @@ -46,7 +46,7 @@ public abstract class ScalarTypeJsonNode extends ScalarTypeBase { /** * Varchar storage based implementation. */ - public static final class Varchar extends ScalarTypeJsonNode { + static final class Varchar extends ScalarTypeJsonNode { public Varchar(ObjectMapper objectMapper) { super(objectMapper, Types.VARCHAR); @@ -56,9 +56,9 @@ public abstract class ScalarTypeJsonNode extends ScalarTypeBase { /** * Blob storage based implementation. */ - public static class Blob extends ScalarTypeJsonNode { + static class Blob extends ScalarTypeJsonNode { - public Blob(ObjectMapper objectMapper) { + Blob(ObjectMapper objectMapper) { super(objectMapper, Types.BLOB); } @@ -91,7 +91,7 @@ public abstract class ScalarTypeJsonNode extends ScalarTypeBase { */ final ObjectMapper objectMapper; - public ScalarTypeJsonNode(ObjectMapper objectMapper, int jdbcType) { + ScalarTypeJsonNode(ObjectMapper objectMapper, int jdbcType) { super(JsonNode.class, false, jdbcType); this.objectMapper = objectMapper; } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJsonNodePostgres.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJsonNodePostgres.java index 94d46a67d..b23252367 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJsonNodePostgres.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeJsonNodePostgres.java @@ -10,10 +10,9 @@ import java.sql.SQLException; /** * Support for mapping JsonNode to Postgres DB types JSON and JSONB. */ -public abstract class ScalarTypeJsonNodePostgres extends ScalarTypeJsonNode { +abstract class ScalarTypeJsonNodePostgres extends ScalarTypeJsonNode { final ObjectMapper objectMapper; - final String postgresType; ScalarTypeJsonNodePostgres(ObjectMapper objectMapper, int jdbcType, String postgresType) { @@ -31,7 +30,7 @@ public abstract class ScalarTypeJsonNodePostgres extends ScalarTypeJsonNode { /** * ScalarType mapping JsonNode to Postgres JSON database type. */ - public static final class JSON extends ScalarTypeJsonNodePostgres { + static final class JSON extends ScalarTypeJsonNodePostgres { public JSON(ObjectMapper objectMapper) { super(objectMapper, DbPlatformType.JSON, PostgresHelper.JSON_TYPE); @@ -41,7 +40,7 @@ public abstract class ScalarTypeJsonNodePostgres extends ScalarTypeJsonNode { /** * ScalarType mapping JsonNode to Postgres JSONB database type. */ - public static final class JSONB extends ScalarTypeJsonNodePostgres { + static final class JSONB extends ScalarTypeJsonNodePostgres { public JSONB(ObjectMapper objectMapper) { super(objectMapper, DbPlatformType.JSONB, PostgresHelper.JSONB_TYPE); diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalDate.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalDate.java index 4fd228459..286818c37 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalDate.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalDate.java @@ -13,9 +13,9 @@ import java.time.ZonedDateTime; /** * ScalarType for java.time.LocalDate. This maps to a JDBC Date. */ -public final class ScalarTypeLocalDate extends ScalarTypeBaseDate { +final class ScalarTypeLocalDate extends ScalarTypeBaseDate { - public ScalarTypeLocalDate(JsonConfig.Date mode) { + ScalarTypeLocalDate(JsonConfig.Date mode) { super(mode, LocalDate.class, false, Types.DATE); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalDateTime.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalDateTime.java index e03c67898..5e43af855 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalDateTime.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalDateTime.java @@ -14,9 +14,9 @@ import java.time.ZoneId; /** * ScalarType for java.sql.Timestamp. */ -public final class ScalarTypeLocalDateTime extends ScalarTypeBaseDateTime { +final class ScalarTypeLocalDateTime extends ScalarTypeBaseDateTime { - public ScalarTypeLocalDateTime(JsonConfig.DateTime mode) { + ScalarTypeLocalDateTime(JsonConfig.DateTime mode) { super(mode, LocalDateTime.class, false, Types.TIMESTAMP); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalTime.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalTime.java index 42997622e..f851bdcfa 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalTime.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalTime.java @@ -19,13 +19,13 @@ import java.time.LocalTime; /** * ScalarType for java.time.LocalTime stored as JDBC Time. */ -public class ScalarTypeLocalTime extends ScalarTypeBase { +class ScalarTypeLocalTime extends ScalarTypeBase { - public ScalarTypeLocalTime() { + ScalarTypeLocalTime() { super(LocalTime.class, false, Types.TIME); } - protected ScalarTypeLocalTime(int jdbcTtype) { + ScalarTypeLocalTime(int jdbcTtype) { super(LocalTime.class, false, jdbcTtype); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalTimeWithNanos.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalTimeWithNanos.java index 2a86abbfa..237c2f633 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalTimeWithNanos.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocalTimeWithNanos.java @@ -11,9 +11,9 @@ import java.time.LocalTime; /** * ScalarType for java.time.LocalTime stored with Nanos as DB BIGINT type. */ -public final class ScalarTypeLocalTimeWithNanos extends ScalarTypeLocalTime { +final class ScalarTypeLocalTimeWithNanos extends ScalarTypeLocalTime { - public ScalarTypeLocalTimeWithNanos() { + ScalarTypeLocalTimeWithNanos() { super(Types.BIGINT); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocale.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocale.java index cc1a4c166..88190593a 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocale.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLocale.java @@ -5,9 +5,9 @@ import java.util.Locale; /** * ScalarType for java.util.Currency which converts to and from a VARCHAR database column. */ -public final class ScalarTypeLocale extends ScalarTypeBaseVarchar { +final class ScalarTypeLocale extends ScalarTypeBaseVarchar { - public ScalarTypeLocale() { + ScalarTypeLocale() { super(Locale.class); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLong.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLong.java index 697e84376..5287c5fd5 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLong.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLong.java @@ -16,9 +16,9 @@ import java.sql.Types; /** * ScalarType for Long and long. */ -public final class ScalarTypeLong extends ScalarTypeBase { +final class ScalarTypeLong extends ScalarTypeBase { - public ScalarTypeLong() { + ScalarTypeLong() { super(Long.class, true, Types.BIGINT); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLongVarchar.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLongVarchar.java index 9dd621d36..6b7dcecb8 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLongVarchar.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeLongVarchar.java @@ -5,7 +5,7 @@ import java.sql.Types; /** * ScalarType for String. */ -public final class ScalarTypeLongVarchar extends ScalarTypeClob { +final class ScalarTypeLongVarchar extends ScalarTypeClob { public ScalarTypeLongVarchar() { super(true, Types.LONGVARCHAR); diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeMathBigInteger.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeMathBigInteger.java index 3c5b99255..aa6d7d4b5 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeMathBigInteger.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeMathBigInteger.java @@ -17,9 +17,9 @@ import java.sql.Types; /** * ScalarType for java.math.BigInteger. */ -public final class ScalarTypeMathBigInteger extends ScalarTypeBase { +final class ScalarTypeMathBigInteger extends ScalarTypeBase { - public ScalarTypeMathBigInteger() { + ScalarTypeMathBigInteger() { super(BigInteger.class, false, Types.BIGINT); } diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeMonth.java b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeMonth.java index a04925ebc..1b1403230 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeMonth.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/type/ScalarTypeMonth.java @@ -11,10 +11,9 @@ import java.time.Month; /** * ScalarType mapping for Month enum. */ -public final class ScalarTypeMonth extends ScalarTypeEnumWithMapping { +final class ScalarTypeMonth extends ScalarTypeEnumWithMapping { static final EnumToDbIntegerMap beanDbMap = new EnumToDbIntegerMap(); - static { Month[] values = Month.values(); for (Month value : values) { @@ -22,7 +21,7 @@ public final class ScalarTypeMonth extends ScalarTypeEnumWithMapping { } } - public ScalarTypeMonth() { + ScalarTypeMonth() { super(beanDbMap, Month.class, 1); } diff --git a/ebean-core/src/test/java/org/tests/unitinternal/TestLocaleParse.java b/ebean-core/src/test/java/io/ebeaninternal/server/type/TestLocaleParse.java similarity index 97% rename from ebean-core/src/test/java/org/tests/unitinternal/TestLocaleParse.java rename to ebean-core/src/test/java/io/ebeaninternal/server/type/TestLocaleParse.java index 33f4ef818..6e81002da 100644 --- a/ebean-core/src/test/java/org/tests/unitinternal/TestLocaleParse.java +++ b/ebean-core/src/test/java/io/ebeaninternal/server/type/TestLocaleParse.java @@ -1,4 +1,4 @@ -package org.tests.unitinternal; +package io.ebeaninternal.server.type; import io.ebeaninternal.server.type.ScalarTypeLocale; import org.junit.Assert; diff --git a/ebean-core/src/test/java/io/ebean/server/type/TestTypeManager.java b/ebean-core/src/test/java/io/ebeaninternal/server/type/TestTypeManager.java similarity index 97% rename from ebean-core/src/test/java/io/ebean/server/type/TestTypeManager.java rename to ebean-core/src/test/java/io/ebeaninternal/server/type/TestTypeManager.java index 537191972..da942345d 100644 --- a/ebean-core/src/test/java/io/ebean/server/type/TestTypeManager.java +++ b/ebean-core/src/test/java/io/ebeaninternal/server/type/TestTypeManager.java @@ -1,9 +1,12 @@ -package io.ebean.server.type; +package io.ebeaninternal.server.type; import io.ebean.BaseTestCase; import io.ebean.config.ServerConfig; import io.ebean.config.dbplatform.h2.H2Platform; import io.ebean.core.type.ScalarType; +import io.ebean.server.type.MyDayOfWeek; +import io.ebean.server.type.MyEnum; +import io.ebean.server.type.MySex; import io.ebeaninternal.server.core.bootup.BootupClasses; import io.ebeaninternal.server.type.DefaultTypeManager; import io.ebeaninternal.server.type.RsetDataReader;