1 package de.juplo.jpa.converters;
3 import java.time.OffsetDateTime;
4 import java.time.ZonedDateTime;
5 import javax.persistence.Access;
6 import javax.persistence.AccessType;
7 import javax.persistence.Convert;
8 import javax.persistence.Entity;
9 import javax.persistence.GeneratedValue;
10 import javax.persistence.Id;
11 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory;
20 @Access(AccessType.PROPERTY)
21 public class EierlegendeWollmilchSau
23 Logger log = LoggerFactory.getLogger(EierlegendeWollmilchSau.class);
39 public void setId(Long id)
45 @Convert(converter = OffsetDateTimeConverter.class)
46 public OffsetDateTime getOdt()
48 log.trace("get OffsetDateTime: {}", odt);
52 public void setOdt(OffsetDateTime odt)
54 log.trace("set OffsetDateTime: {}", odt);
58 @Convert(converter = ZonedDateTimeConverter.class)
59 public ZonedDateTime getZdt()
61 log.trace("get ZonedDateTime: {}", zdt);
65 public void setZdt(ZonedDateTime zdt)
67 log.trace("set ZonedDateTime: {}", zdt);
73 public String toString()
76 StringBuilder builder = new StringBuilder();
79 builder.append("OffsetDateTime: ");
87 builder.append("ZonedDateTime: ");
91 return builder.toString();