class DurationConverter implements AttributeConverter<Duration, String> {

  @Override
  public String convertToDatabaseColumn(Duration duration) {
    if (duration != null) {
      return duration.toString();
    } else {
      return null;
    }
  }

}