There are many ways we could store a {{java.time.YearMonth}} object:
- 2 separate fields - a {{VARCHAR}} for its toString representation - a number (e.g. short, int, long) where the value is: {{Year * 100 + Month}} or {{Year * 12 + Month}} .
Of all possibilities, the number alternative seems the most efficient in terms of database indexing. |
|