Package nl.vpro.persistence
Class DurationToIntervalConverter
- java.lang.Object
-
- nl.vpro.persistence.DurationToIntervalConverter
-
public class DurationToIntervalConverter extends Object implements javax.persistence.AttributeConverter<Duration,String>
Postgresql has a dedicated Interval type. I tried to get it working with something like this. It didn't work, I couldn't get hibernate to not report: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Wrong column type in public.subtitles for column offset. Found: interval, expected: varchar(255)- Since:
- 0.47
- Author:
- Michiel Meeuwissen
-
-
Constructor Summary
Constructors Constructor Description DurationToIntervalConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
convertToDatabaseColumn(Duration duration)
Duration
convertToEntityAttribute(String timestamp)
-