Class PostgreSQLIntervalType
java.lang.Object
io.hypersistence.utils.hibernate.type.ImmutableType<Duration>
io.hypersistence.utils.hibernate.type.interval.PostgreSQLIntervalType
- All Implemented Interfaces:
Serializable
,org.hibernate.type.Type
,org.hibernate.usertype.EnhancedUserType<Duration>
,org.hibernate.usertype.UserType<Duration>
Maps a Java
Duration
object to a PostgreSQL Interval column type.
For more details about how to use it, check out this article on vladmihalcea.com.
- Since:
- 2.5.1
- Author:
- Jan-Willem Gmelig Meyling, Vlad Mihalcea
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPostgreSQLIntervalType
(org.hibernate.type.spi.TypeBootstrapContext typeBootstrapContext) -
Method Summary
Modifier and TypeMethodDescriptionfromStringValue
(CharSequence sequence) protected Duration
get
(ResultSet rs, int position, org.hibernate.engine.spi.SharedSessionContractImplementor session, Object owner) Get the column value from the JDBCResultSet
.int
protected void
set
(PreparedStatement st, Duration value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor session) Set the column value on the provided JDBCPreparedStatement
.Methods inherited from class io.hypersistence.utils.hibernate.type.ImmutableType
assemble, assemble, beforeAssemble, compare, deepCopy, deepCopy, disassemble, disassemble, equals, getColumnSpan, getConfiguration, getHashCode, getHashCode, getName, getReturnedClass, getSqlTypeCodes, hashCode, isAnyType, isAssociationType, isCollectionType, isComponentType, isDirty, isDirty, isDirty, isEntityType, isEqual, isEqual, isModified, isMutable, isSame, nullSafeGet, nullSafeSet, nullSafeSet, replace, replace, replace, returnedClass, toColumnNullness, toLoggableString, toSqlLiteral, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.type.Type
disassemble
Methods inherited from interface org.hibernate.usertype.UserType
getDefaultSqlLength, getDefaultSqlPrecision, getDefaultSqlScale, getJdbcType, getValueConverter
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
PostgreSQLIntervalType
public PostgreSQLIntervalType() -
PostgreSQLIntervalType
public PostgreSQLIntervalType(org.hibernate.type.spi.TypeBootstrapContext typeBootstrapContext)
-
-
Method Details
-
getSqlType
public int getSqlType() -
fromStringValue
- Throws:
org.hibernate.HibernateException