Package org.minijax.dao.converters
Class InstantConverter
java.lang.Object
org.minijax.dao.converters.InstantConverter
- All Implemented Interfaces:
jakarta.persistence.AttributeConverter<java.time.Instant,java.sql.Timestamp>
public class InstantConverter
extends java.lang.Object
implements jakarta.persistence.AttributeConverter<java.time.Instant,java.sql.Timestamp>
The InstantConverter class implements the JPA converter from
Java Instant to Java SQL Timestamp.
-
Constructor Summary
Constructors Constructor Description InstantConverter() -
Method Summary
Modifier and Type Method Description java.sql.TimestampconvertToDatabaseColumn(java.time.Instant instant)java.time.InstantconvertToEntityAttribute(java.sql.Timestamp timestamp)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
InstantConverter
public InstantConverter()
-
-
Method Details
-
convertToDatabaseColumn
public java.sql.Timestamp convertToDatabaseColumn(java.time.Instant instant)- Specified by:
convertToDatabaseColumnin interfacejakarta.persistence.AttributeConverter<java.time.Instant,java.sql.Timestamp>
-
convertToEntityAttribute
public java.time.Instant convertToEntityAttribute(java.sql.Timestamp timestamp)- Specified by:
convertToEntityAttributein interfacejakarta.persistence.AttributeConverter<java.time.Instant,java.sql.Timestamp>
-