- java.lang.Object
-
- org.tentackle.sql.datatypes.AbstractDataType<T>
-
- org.tentackle.sql.datatypes.AbstractDateTimeType<T>
-
- Type Parameters:
T- the java type
- All Implemented Interfaces:
DataType<T>
- Direct Known Subclasses:
DateType,LocalDateTimeType,LocalDateType,LocalTimeType,TimestampType,TimeType
public abstract class AbstractDateTimeType<T> extends AbstractDataType<T>
Base class for date- or time-related data types.
-
-
Constructor Summary
Constructors Constructor Description AbstractDateTimeType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisDateOrTime()Returns whether this is a date and/or time type.protected java.sql.DateparseDate(java.lang.String str)protected java.sql.TimeparseTime(java.lang.String str)protected java.sql.TimestampparseTimestamp(java.lang.String str)protected java.lang.StringprintDate(java.util.Date date)protected java.lang.StringprintTime(java.util.Date time)protected java.lang.StringprintTimestamp(java.util.Date timestamp)-
Methods inherited from class org.tentackle.sql.datatypes.AbstractDataType
equals, getColumnCount, getColumnGetter, getColumnSuffix, getColumnValue, getCommentSuffix, getDataTypeConstant, getScale, getSize, getVariant, hashCode, isBool, isDowncastNecessary, isJavaTypeGenerified, isLiteralSupported, isMapNullSupported, isModelProvidingInnerType, isMutable, isNumeric, isPredefined, isPrimitive, isUTCSupported, set, toLiteral, toNonPrimitive, toPrimitive, toString, toString, valueOfLiteralToCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.tentackle.sql.DataType
get, getJavaType, getSqlType, set, valueOf
-
-
-
-
Method Detail
-
isDateOrTime
public boolean isDateOrTime()
Description copied from interface:DataTypeReturns whether this is a date and/or time type.- Specified by:
isDateOrTimein interfaceDataType<T>- Overrides:
isDateOrTimein classAbstractDataType<T>- Returns:
- true if time, date or timestamp
-
parseDate
protected java.sql.Date parseDate(java.lang.String str) throws BackendException- Throws:
BackendException
-
parseTime
protected java.sql.Time parseTime(java.lang.String str) throws BackendException- Throws:
BackendException
-
parseTimestamp
protected java.sql.Timestamp parseTimestamp(java.lang.String str) throws BackendException- Throws:
BackendException
-
printDate
protected java.lang.String printDate(java.util.Date date)
-
printTime
protected java.lang.String printTime(java.util.Date time)
-
printTimestamp
protected java.lang.String printTimestamp(java.util.Date timestamp)
-
-