I need a java class with several attributes that must have day and month (june 5. july 8, etc). What is the best way to define this field?
The type day of year will have problems with leap years, and dividing the attribute into day and month will make me have a lot of them (since I need several of these) so is there another approach to this field?
Also: I use MySql for persistance, so I want attributeseasy to persist.
- You can split your data in two fields:
monthNumber, and store them in your MySQL database as two
- You can store the data as a
chararray (4 entries) in Java, and store the value in a
Char(4)field in MySQL
I would personally go with option 1