I want to separated fields in my model: actionDate and actionTime. Can I use the datatypes sql.Date and sql.Time for this? Or should I use util.Date for both?
What’s the correct way?
Thanks a lot,
joe
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
java.util.Date is probably the right choice. However, the question is why do you want a separate date and time in your model. A better pattern would be to have a single Date object that contained the date and time, and if you need setters/getters to interrogate the separate parts of the date/time, then you can do so.
There is nothing to stop you from using setters/getters in Play.