mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-22 13:58:20 +00:00
Refactor move ScalarTypeBaseDate to ebean-core-type module
This commit is contained in:
+3
-3
@@ -1,4 +1,4 @@
|
||||
package io.ebeaninternal.server.type;
|
||||
package io.ebean.core.type;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
@@ -19,11 +19,11 @@ import java.sql.Types;
|
||||
/**
|
||||
* Base class for Date types.
|
||||
*/
|
||||
abstract class ScalarTypeBaseDate<T> extends ScalarTypeBase<T> {
|
||||
public abstract class ScalarTypeBaseDate<T> extends ScalarTypeBase<T> {
|
||||
|
||||
protected final JsonConfig.Date mode;
|
||||
|
||||
ScalarTypeBaseDate(JsonConfig.Date mode, Class<T> type, boolean jdbcNative, int jdbcType) {
|
||||
public ScalarTypeBaseDate(JsonConfig.Date mode, Class<T> type, boolean jdbcNative, int jdbcType) {
|
||||
super(type, jdbcNative, jdbcType);
|
||||
this.mode = mode;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package io.ebeaninternal.server.type;
|
||||
import io.ebean.config.JsonConfig;
|
||||
import io.ebean.core.type.DataBinder;
|
||||
import io.ebean.core.type.DataReader;
|
||||
import io.ebean.core.type.ScalarTypeBaseDate;
|
||||
import io.ebeaninternal.server.core.BasicTypeConverter;
|
||||
|
||||
import java.sql.Date;
|
||||
@@ -12,7 +13,7 @@ import java.sql.Types;
|
||||
/**
|
||||
* ScalarType for java.sql.Date.
|
||||
*/
|
||||
final class ScalarTypeDate extends ScalarTypeBaseDate<java.sql.Date> {
|
||||
final class ScalarTypeDate extends ScalarTypeBaseDate<Date> {
|
||||
|
||||
ScalarTypeDate(JsonConfig.Date mode) {
|
||||
super(mode, Date.class, true, Types.DATE);
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package io.ebeaninternal.server.type;
|
||||
|
||||
import io.ebean.config.JsonConfig;
|
||||
import io.ebean.core.type.ScalarTypeBaseDate;
|
||||
import io.ebeaninternal.server.core.BasicTypeConverter;
|
||||
import org.joda.time.DateMidnight;
|
||||
|
||||
@@ -11,7 +12,7 @@ import java.sql.Types;
|
||||
* ScalarType for Joda DateMidnight. This maps to a JDBC Date.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
final class ScalarTypeJodaDateMidnight extends ScalarTypeBaseDate<org.joda.time.DateMidnight> {
|
||||
final class ScalarTypeJodaDateMidnight extends ScalarTypeBaseDate<DateMidnight> {
|
||||
|
||||
/**
|
||||
* Instantiates a new scalar type joda date midnight.
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.ebeaninternal.server.type;
|
||||
import java.sql.Date;
|
||||
import java.sql.Types;
|
||||
|
||||
import io.ebean.core.type.ScalarTypeBaseDate;
|
||||
import org.joda.time.DateTimeZone;
|
||||
import org.joda.time.LocalDate;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.time.ZoneOffset;
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
import io.ebean.config.JsonConfig;
|
||||
import io.ebean.core.type.ScalarTypeBaseDate;
|
||||
import io.ebeaninternal.server.core.BasicTypeConverter;
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.ebeaninternal.server.type;
|
||||
import io.ebean.config.JsonConfig;
|
||||
import io.ebean.core.type.DataBinder;
|
||||
import io.ebean.core.type.DataReader;
|
||||
import io.ebean.core.type.ScalarTypeBaseDate;
|
||||
import io.ebeaninternal.server.core.BasicTypeConverter;
|
||||
|
||||
import java.sql.SQLException;
|
||||
@@ -89,7 +90,7 @@ final class ScalarTypeUtilDate {
|
||||
}
|
||||
}
|
||||
|
||||
static final class DateType extends ScalarTypeBaseDate<java.util.Date> {
|
||||
static final class DateType extends ScalarTypeBaseDate<Date> {
|
||||
|
||||
DateType(JsonConfig.Date mode) {
|
||||
super(mode, Date.class, false, Types.DATE);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package io.ebeaninternal.server.type;
|
||||
|
||||
import io.ebean.config.JsonConfig;
|
||||
import io.ebean.core.type.ScalarTypeBaseDate;
|
||||
import io.ebeaninternal.server.core.BasicTypeConverter;
|
||||
|
||||
import java.sql.Date;
|
||||
|
||||
Reference in New Issue
Block a user