I would like to use a Date field in my playOrm mapping. However, if I use
private Date birthDate;
in my bean, it gives me an exception saying this type is not supported.
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.
I can add Date if you open an issue. I was thinking of actually throwing an exception when people use Date that says this though instead..
See this as well
Joda Time to be included in Java 7?
If however, you still want to use Date, here is how
Then you need to implement the Converter interface with your DateConverter class and implement the byte[] to Date and Date to byte[] and String to Date and Date to String methods. NOTE: These methods are all called for S-SQL and for converting entities…it all uses the same converters.
The string conversions are VERY important as the command line tool will use them to convert your command line S-SQL to query the objects.
HOWEVER, if you want it built-in to PlayOrm, just open an issue and I can do it pretty quickly BUT I still suggest you use LocalDateTime instead in joda-time as it is more reliable and you can do more with it….after using joda-time quite a bit, it is on-par with C# date apis and way better than the old java stuff.
Dean