Module litebridge.db.oracle
Package org.litebridge.db.oracle.convert
Class OracleOffsetDateTimeConverter
java.lang.Object
org.litebridge.convert.converter.OffsetDateTimeConverter
org.litebridge.db.oracle.convert.OracleOffsetDateTimeConverter
- All Implemented Interfaces:
Converter<OffsetDateTime>,ConverterFunction<OffsetDateTime>,SqlConverter<OffsetDateTime>
A specialised converter for Oracle-specific
OffsetDateTime SQL types.
This class extends OffsetDateTimeConverter to handle Oracle-specific
TIMESTAMPTZ SQL types alongside the standard TIMESTAMP_WITH_TIMEZONE.
It provides compatibility for Oracle's `TIMESTAMPTZ` type and ensures proper
conversion to OffsetDateTime.
Key functionality includes:
- Conversion of Oracle-specific
TIMESTAMPTZobjects toOffsetDateTime. - Fallback handling to
ZonedDateTimewhen direct conversion fromTIMESTAMPTZfails. - Delegation to the parent class
OffsetDateTimeConverterwhen the input value type is unsupported by this implementation.
The converter supports the following SQL types:
Types.TIMESTAMP_WITH_TIMEZONE- Oracle-specific
OracleTypes.TIMESTAMPTZ
Thread safety: The class is immutable and thread-safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable OffsetDateTimeConverts the given value to the target type.int[]sqlTypes()Returns the SQL types associated with this converter.Methods inherited from class org.litebridge.convert.converter.OffsetDateTimeConverter
typeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.litebridge.convert.converter.Converter
primitiveType
-
Constructor Details
-
OracleOffsetDateTimeConverter
public OracleOffsetDateTimeConverter()
-
-
Method Details
-
convert
Description copied from interface:ConverterFunctionConverts the given value to the target type.- Specified by:
convertin interfaceConverterFunction<OffsetDateTime>- Overrides:
convertin classOffsetDateTimeConverter- Parameters:
value- the value to convert, may benull- Returns:
- the converted value, or
nullif the input wasnullor could not be converted
-
sqlTypes
public int[] sqlTypes()Description copied from class:OffsetDateTimeConverterReturns the SQL types associated with this converter.- Specified by:
sqlTypesin interfaceSqlConverter<OffsetDateTime>- Overrides:
sqlTypesin classOffsetDateTimeConverter- Returns:
- an array containing
Types.TIMESTAMP_WITH_TIMEZONE
-