So,
i'm using greendDao library and i want to store in SQL a date, but always is a timestamp date. I do not want that!
Is possible to change that configuration?
So,
i'm using greendDao library and i want to store in SQL a date, but always is a timestamp date. I do not want that!
Is possible to change that configuration?
Looking at the greedDao source i found that the date property is set by Integer type.
As a need a fast solution, i'll not add Date property, but string property and save the Date formated.
Maybe later i can fork greenDao and do the changes.
I did some adjustments to greendao. These include a method setDateFormat(String format)
. This method actually only applies for export to csv which is also among the adjustments I made. I will also include some lines to automatically truncate the date according to the format given.
I plan to make my changes available as plugins or extensions to greendao via contribution. Unfortunately I don't have time right now and so this project will have to wait.
Until then I suggest using date-properties and writing additional getters and setters in the KEEP-SECTION. This way you won't lose the possibility to sort this columns and you will probably be able to use the database in future (when there are possibilities to limit the value to date or time), since you don't have to change the column-type.
Using Strings is of course also a valid approach.