Class JdbcConversionUtils
java.lang.Object
com.broadleafcommerce.sandbox.provider.jpa.repository.support.JdbcConversionUtils
Contains common functionality useful for converting values between Java/JDBC representation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TimestampinstantToTimestamp(Instant instant) Convert the givenInstantinto aTimestamprepresentation that can be passed toPreparedStatement.setTimestamp(int, Timestamp).
-
Method Details
-
instantToTimestamp
Convert the given
Instantinto aTimestamprepresentation that can be passed toPreparedStatement.setTimestamp(int, Timestamp).There are some quirks with how
Timestampis interpreted and converted byPreparedStatement.setTimestamp(int, Timestamp), which prevent us from using the same logic as Hibernate'sInstantJavaType.unwrap(Instant, Class, WrapperOptions)to perform this conversion. More details can be seen in these sources:
-