persistence
persistence copied to clipboard
YearMonth and MonthDay from java.time
A specification participant in Jakarta Data proposed adding java.time.YearMonth and java.time.MonthDay as supported temporal types in Jakarta Data. The participant also indicated having a business need for YearMonth. I noticed that as of Jakarta Persistence 3.2, there is no support for these temporal types, so for now we had to decline adding support for them to Jakarta Data. It was decided I would open this issue to ask about getting them supported in Jakarta Persistence.
In order for them to be supported by Jakarta Data, Jakarta Persistence would need to
- define representation in the database for
java.time.YearMonthandjava.time.MonthDaythat makes values comparable and sortable in a meaningful way (which for YearMonth would be year first then month, and for MonthDay would be month first then day as if all were in the same year) - support
EXTRACTofYEARandMONTHforYearMonth, andEXTRACTofMONTHandDAYfor MonthDay (and I supposeQUARTERwould also make sense for both). - list as supported types under Basic Types or elsewhere in the spec