Class OffsetDateTimeAttributeConverter
- java.lang.Object
-
- org.silverpeas.core.persistence.datasource.model.jpa.OffsetDateTimeAttributeConverter
-
- All Implemented Interfaces:
javax.persistence.AttributeConverter<OffsetDateTime,Timestamp>
public class OffsetDateTimeAttributeConverter extends Object implements javax.persistence.AttributeConverter<OffsetDateTime,Timestamp>
An automatic converter ofOffsetDateTime
values to SQLTimestamp
values for JPA 2.1 (JPA 2.1 was release before Java 8 and hence it doesn't support yet the new java time API).- Author:
- mmoquillon
-
-
Constructor Summary
Constructors Constructor Description OffsetDateTimeAttributeConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Timestamp
convertToDatabaseColumn(OffsetDateTime dateTime)
OffsetDateTime
convertToEntityAttribute(Timestamp sqlTimestamp)
-
-
-
Method Detail
-
convertToDatabaseColumn
public Timestamp convertToDatabaseColumn(OffsetDateTime dateTime)
- Specified by:
convertToDatabaseColumn
in interfacejavax.persistence.AttributeConverter<OffsetDateTime,Timestamp>
-
convertToEntityAttribute
public OffsetDateTime convertToEntityAttribute(Timestamp sqlTimestamp)
- Specified by:
convertToEntityAttribute
in interfacejavax.persistence.AttributeConverter<OffsetDateTime,Timestamp>
-
-