Class StringDateTimeUserType
java.lang.Object
com.peterphi.std.guice.hibernate.usertype.StringDateTimeUserType
- All Implemented Interfaces:
Comparator
,org.hibernate.usertype.UserType
,org.hibernate.usertype.UserVersionType
public class StringDateTimeUserType
extends Object
implements org.hibernate.usertype.UserType, org.hibernate.usertype.UserVersionType, Comparator
Encodes Joda DateTime values into a VARCHAR column where the date format is:
The column size ranges between 20 and 24 characters.
yyyyMMdd'T'HHmmss.SSSZ
. The time zone offset is 'Z' for zero, and of the form '±HHmm' for non-zero.The column size ranges between 20 and 24 characters.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.joda.time.DateTime
assemble
(Serializable cached, Object owner) int
org.joda.time.DateTime
org.joda.time.DateTime
disassemble
(Object value) boolean
int
boolean
org.joda.time.DateTime
org.joda.time.DateTime
nullSafeGet
(ResultSet resultSet, String[] names, org.hibernate.engine.spi.SharedSessionContractImplementor session, Object owner) void
nullSafeSet
(PreparedStatement statement, Object value, int index, org.hibernate.engine.spi.SharedSessionContractImplementor session) org.joda.time.DateTime
org.joda.time.DateTime
seed
(org.hibernate.engine.spi.SharedSessionContractImplementor session) int[]
sqlTypes()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
StringDateTimeUserType
public StringDateTimeUserType()
-
-
Method Details
-
sqlTypes
public int[] sqlTypes()- Specified by:
sqlTypes
in interfaceorg.hibernate.usertype.UserType
-
returnedClass
- Specified by:
returnedClass
in interfaceorg.hibernate.usertype.UserType
-
equals
- Specified by:
equals
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
-
hashCode
- Specified by:
hashCode
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
-
deepCopy
- Specified by:
deepCopy
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
-
isMutable
public boolean isMutable()- Specified by:
isMutable
in interfaceorg.hibernate.usertype.UserType
-
disassemble
- Specified by:
disassemble
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
-
assemble
public org.joda.time.DateTime assemble(Serializable cached, Object owner) throws org.hibernate.HibernateException - Specified by:
assemble
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
-
replace
public org.joda.time.DateTime replace(Object original, Object target, Object owner) throws org.hibernate.HibernateException - Specified by:
replace
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
-
compare
- Specified by:
compare
in interfaceComparator
-