package org.openur.module.persistence.rdbms.entity;

import java.sql.Timestamp;
import java.time.LocalDateTime;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

@Converter(autoApply = true)
public class LocalDateTimePersistenceConverter
	implements AttributeConverter<LocalDateTime, Timestamp>
{
	@Override
	public Timestamp convertToDatabaseColumn(LocalDateTime entityValue)
	{
		return Timestamp.valueOf(entityValue);
	}

	@Override
	public LocalDateTime convertToEntityAttribute(Timestamp databaseValue)
	{
		return databaseValue.toLocalDateTime();
	}
}

@@ -414,16 +414,38 @@
 %09%09return
+ entityValue != null ?
  Timesta
@@ -467,16 +467,23 @@
 tyValue)
+ : null
 ;%0A%09%7D%0A%0A%09@
@@ -574,16 +574,40 @@
 %09%09return
+ databaseValue != null ?
  databas
@@ -630,15 +630,22 @@
 teTime()
+ : null
 ;%0A%09%7D%0A%7D%0A

check if argument is null in both converter-methods