Package org.silverpeas.core.calendar
Class Recurrence.ExceptionDateNormalizer
- java.lang.Object
-
- org.silverpeas.core.calendar.Recurrence.ExceptionDateNormalizer
-
- All Implemented Interfaces:
javax.persistence.AttributeConverter<OffsetDateTime,Timestamp>
- Enclosing class:
- Recurrence
public static class Recurrence.ExceptionDateNormalizer extends Object implements javax.persistence.AttributeConverter<OffsetDateTime,Timestamp>
This converter is dedicated to theRecurrence.exceptionDates
collection.It converts the loaded dates into
OffsetDateTime
at UTC offset and avoids the collection update during exception dates manipulations. The manipulation of this collection induces database delete/add queries which could produces transaction blocking with some databases. Getting the dates loaded directly as they are attempted into Silverpeas's API avoid to update a date into collection just because it is not same offset, for example.
-
-
Constructor Summary
Constructors Constructor Description ExceptionDateNormalizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Timestamp
convertToDatabaseColumn(OffsetDateTime o)
OffsetDateTime
convertToEntityAttribute(Timestamp sqlTimestamp)
-
-
-
Method Detail
-
convertToDatabaseColumn
public Timestamp convertToDatabaseColumn(OffsetDateTime o)
- Specified by:
convertToDatabaseColumn
in interfacejavax.persistence.AttributeConverter<OffsetDateTime,Timestamp>
-
convertToEntityAttribute
public OffsetDateTime convertToEntityAttribute(Timestamp sqlTimestamp)
- Specified by:
convertToEntityAttribute
in interfacejavax.persistence.AttributeConverter<OffsetDateTime,Timestamp>
-
-