With the many enhancements to the new Java 8 DateTime API, how should I instantiate a Date for an entity in JPA? Is it possible, for example, to have a YearMonth field that JPA controls?
With the many enhancements to the new Java 8 DateTime API, how should I instantiate a Date for an entity in JPA? Is it possible, for example, to have a YearMonth field that JPA controls?
So far, natively from the JPA, not yet. But will bear. I do not know whether in the JPA 2.2 specification or in JPA 3.0. See the specification that has been proposed, but no response.
What you can do is convert types as it explains this article . JPA even provides an elegant solution for these conversions.