Class DurationUserType
java.lang.Object
google.registry.persistence.converter.DurationUserType
- All Implemented Interfaces:
org.hibernate.usertype.UserType<org.joda.time.Duration>
public class DurationUserType
extends Object
implements org.hibernate.usertype.UserType<org.joda.time.Duration>
Hibernate custom type for
Duration
.
Conversion of Duration
is automatic. See NomulusPostgreSQLDialect
for more information.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.joda.time.Duration
assemble
(Serializable serializable, Object o) static org.joda.time.Duration
convertToDuration
(org.postgresql.util.PGInterval dbData) static org.postgresql.util.PGInterval
convertToPGInterval
(org.joda.time.Duration duration) org.joda.time.Duration
deepCopy
(org.joda.time.Duration duration) disassemble
(org.joda.time.Duration duration) boolean
equals
(org.joda.time.Duration duration, org.joda.time.Duration other) int
int
hashCode
(org.joda.time.Duration duration) boolean
org.joda.time.Duration
nullSafeGet
(ResultSet resultSet, int i, org.hibernate.engine.spi.SharedSessionContractImplementor sharedSessionContractImplementor, Object o) void
nullSafeSet
(PreparedStatement preparedStatement, org.joda.time.Duration duration, int i, org.hibernate.engine.spi.SharedSessionContractImplementor sharedSessionContractImplementor) Class
<org.joda.time.Duration> Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.usertype.UserType
getDefaultSqlLength, getDefaultSqlPrecision, getDefaultSqlScale, getJdbcType, getValueConverter, replace
-
Constructor Details
-
DurationUserType
public DurationUserType()
-
-
Method Details
-
getSqlType
public int getSqlType()- Specified by:
getSqlType
in interfaceorg.hibernate.usertype.UserType<org.joda.time.Duration>
-
returnedClass
- Specified by:
returnedClass
in interfaceorg.hibernate.usertype.UserType<org.joda.time.Duration>
-
equals
public boolean equals(org.joda.time.Duration duration, org.joda.time.Duration other) - Specified by:
equals
in interfaceorg.hibernate.usertype.UserType<org.joda.time.Duration>
-
hashCode
public int hashCode(org.joda.time.Duration duration) - Specified by:
hashCode
in interfaceorg.hibernate.usertype.UserType<org.joda.time.Duration>
-
deepCopy
public org.joda.time.Duration deepCopy(org.joda.time.Duration duration) - Specified by:
deepCopy
in interfaceorg.hibernate.usertype.UserType<org.joda.time.Duration>
-
isMutable
public boolean isMutable()- Specified by:
isMutable
in interfaceorg.hibernate.usertype.UserType<org.joda.time.Duration>
-
disassemble
- Specified by:
disassemble
in interfaceorg.hibernate.usertype.UserType<org.joda.time.Duration>
-
assemble
- Specified by:
assemble
in interfaceorg.hibernate.usertype.UserType<org.joda.time.Duration>
-
convertToPGInterval
public static org.postgresql.util.PGInterval convertToPGInterval(org.joda.time.Duration duration) -
convertToDuration
@Nullable public static org.joda.time.Duration convertToDuration(org.postgresql.util.PGInterval dbData)
-