cph-cachet/carp-webservices-spring

Use Kotlinx Instant in Auditable

Opened this issue · 0 comments

As mentioned in #314, we currently use Java Instant since Spring data JPA doesn't reconigze Kotlin Instant as a Basic Type for annotation @CreatedBy, this results all the Entity inherited this class using Java Instant, which is -- all database tables.

This brings confusion and unneeded conversion, as core and rest of webservice is using Kotlin Instant.

To cosider:

  • write a one-to-one mapper for Auditable class for Spring data JPA understand how to translate it.
  • override this annotation
  • stop using Spring data JPA, which might also make sense we don't need auto generated controllers for those data, and we are switching away from default CRUD methods..