Class InstantConverter

  • All Implemented Interfaces:
    jakarta.persistence.AttributeConverter<Instant,​Timestamp>

    public class InstantConverter
    extends Object
    implements jakarta.persistence.AttributeConverter<Instant,​Timestamp>
    The InstantConverter class implements the JPA converter from Java Instant to Java SQL Timestamp.
    • Constructor Detail

      • InstantConverter

        public InstantConverter()
    • Method Detail

      • convertToDatabaseColumn

        public Timestamp convertToDatabaseColumn​(Instant instant)
        Specified by:
        convertToDatabaseColumn in interface jakarta.persistence.AttributeConverter<Instant,​Timestamp>
      • convertToEntityAttribute

        public Instant convertToEntityAttribute​(Timestamp timestamp)
        Specified by:
        convertToEntityAttribute in interface jakarta.persistence.AttributeConverter<Instant,​Timestamp>