com.holonplatform.datastore.jpa.converters.datetime

## Class LocalDateTimeToDateAttributeConverter

- java.lang.Object
- - com.holonplatform.datastore.jpa.converters.datetime.LocalDateTimeToDateAttributeConverter

- All Implemented Interfaces:
    javax.persistence.AttributeConverter<LocalDateTime,Date>

      public class LocalDateTimeToDateAttributeConverter
      extends Object
      implements javax.persistence.AttributeConverter<LocalDateTime,Date>

  A JPA `AttributeConverter` to enable `LocalDateTime` data type for entity attributes.

  This converter is automatically applyed if present in the ORM auto-scan package list.

  Attribute values are expected to be backed by a `Date`-compatible type in database.

  Since:
    5.0.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocalDateTimeToDateAttributeConverter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Date` | `convertToDatabaseColumn(LocalDateTime attribute)`
    `LocalDateTime` | `convertToEntityAttribute(Date dbData)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LocalDateTimeToDateAttributeConverter

          public LocalDateTimeToDateAttributeConverter()

  - ### Method Detail

    - #### convertToDatabaseColumn

          public Date convertToDatabaseColumn(LocalDateTime attribute)

      Specified by:
        `convertToDatabaseColumn` in interface `javax.persistence.AttributeConverter<LocalDateTime,Date>`

    - #### convertToEntityAttribute

          public LocalDateTime convertToEntityAttribute(Date dbData)

      Specified by:
        `convertToEntityAttribute` in interface `javax.persistence.AttributeConverter<LocalDateTime,Date>`

Copyright © 2019 The Holon Platform. All rights reserved.