If the database allows you to use datetime as the data type for these two columns, I would prefer Groovy Date , although you get the flexibility of using the Joda Time plugin.
The date will be an era and groovy dates a simple date / time analysis mechanism from String. For example, if startTime or endTime is represented as a string of type 13:45:32 (from a view or from a REST call) representing time 1:45 PM , then this string can be easily parsed for Date as:
Date.parse('HH:mm:ss', '13:45:32')
And vice versa, after receiving dates from the persistence level, you can compare:
endTime.after(startTime)
which will ultimately compare time ( HH:mm:ss ), since the date will always be an era [January 1, 1970] in all cases.
source share