Class OracleIntervalDayToSecondType
- java.lang.Object
-
- com.vladmihalcea.hibernate.type.ImmutableType<java.time.Duration>
-
- com.vladmihalcea.hibernate.type.interval.OracleIntervalDayToSecondType
-
- All Implemented Interfaces:
java.io.Serializable
,org.hibernate.type.Type
,org.hibernate.usertype.UserType
public class OracleIntervalDayToSecondType extends ImmutableType<java.time.Duration>
Maps a JavaDuration
object to a Oracle IntervalDS column type.For more details about how to use it, check out this article on vladmihalcea.com.
- Since:
- 2.6.1
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static OracleIntervalDayToSecondType
INSTANCE
private static java.util.regex.Pattern
INTERVAL_PATTERN
private static java.lang.String
INTERVAL_TOKENS
private static int
SQL_COLUMN_TYPE
-
Constructor Summary
Constructors Constructor Description OracleIntervalDayToSecondType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.time.Duration
get(java.sql.ResultSet rs, java.lang.String[] names, org.hibernate.engine.spi.SharedSessionContractImplementor session, java.lang.Object owner)
Get the column value from the JDBCResultSet
.protected void
set(java.sql.PreparedStatement st, java.time.Duration value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor session)
Set the column value on the provided JDBCPreparedStatement
.int[]
sqlTypes()
-
Methods inherited from class com.vladmihalcea.hibernate.type.ImmutableType
assemble, assemble, beforeAssemble, compare, deepCopy, deepCopy, defaultSizes, dictatedSizes, disassemble, disassemble, equals, getColumnSpan, getConfiguration, getHashCode, getHashCode, getName, getReturnedClass, getSemiResolvedType, hashCode, hydrate, isAnyType, isAssociationType, isCollectionType, isComponentType, isDirty, isDirty, isDirty, isEntityType, isEqual, isEqual, isModified, isMutable, isSame, nullSafeGet, nullSafeGet, nullSafeSet, nullSafeSet, replace, replace, replace, resolve, returnedClass, semiResolve, sqlTypes, toColumnNullness, toLoggableString
-
-
-
-
Field Detail
-
INSTANCE
public static final OracleIntervalDayToSecondType INSTANCE
-
SQL_COLUMN_TYPE
private static final int SQL_COLUMN_TYPE
- See Also:
- Constant Field Values
-
INTERVAL_TOKENS
private static final java.lang.String INTERVAL_TOKENS
- See Also:
- Constant Field Values
-
INTERVAL_PATTERN
private static final java.util.regex.Pattern INTERVAL_PATTERN
-
-
Method Detail
-
get
protected java.time.Duration get(java.sql.ResultSet rs, java.lang.String[] names, org.hibernate.engine.spi.SharedSessionContractImplementor session, java.lang.Object owner) throws java.sql.SQLException
Description copied from class:ImmutableType
Get the column value from the JDBCResultSet
.- Specified by:
get
in classImmutableType<java.time.Duration>
- Parameters:
rs
- JDBCResultSet
names
- database column namesession
- current HibernateSession
owner
- current HibernateSessionFactoryImplementor
- Returns:
- column value
- Throws:
java.sql.SQLException
- in case of failure
-
set
protected void set(java.sql.PreparedStatement st, java.time.Duration value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor session) throws java.sql.SQLException
Description copied from class:ImmutableType
Set the column value on the provided JDBCPreparedStatement
.- Specified by:
set
in classImmutableType<java.time.Duration>
- Parameters:
st
- JDBCPreparedStatement
value
- database column valueindex
- database column indexsession
- current HibernateSession
- Throws:
java.sql.SQLException
- in case of failure
-
sqlTypes
public int[] sqlTypes()
-
-