This content has been marked as final.
Show 3 replies
-
1. Re: java.sql.Date, Seam-GWT remoting with EJB3/hibernate/JPA
dhartford Dec 4, 2007 4:52 PM (in response to dhartford)actually sending java.sql.Date over the JSON wire:
//EX ["com.domain.app.model.SimpleDTO/3809314052","java.sql.Date/20738045"]
-
2. Re: java.sql.Date, Seam-GWT remoting with EJB3/hibernate/JPA
dhartford Dec 5, 2007 11:44 AM (in response to dhartford)discussion on problem:
http://groups.google.com.ec/group/Google-Web-Toolkit/browse_thread/thread/ee868c16992937ac/0e2288691663d975
english:
http://translate.google.com/translate?hl=en&sl=es&u=http://groups.google.com.ec/group/Google-Web-Toolkit/browse_thread/thread/ee868c16992937ac/0e2288691663d975&sa=X&oi=translate&resnum=2&ct=result -
3. Re: java.sql.Date, Seam-GWT remoting with EJB3/hibernate/JPA
dhartford Dec 5, 2007 12:00 PM (in response to dhartford)another discussion here
http://groups.google.com/group/Google-Web-Toolkit/tree/browse_frm/month/2007-04/f7a5a1f03a87cc99?rnum=71&_done=%2Fgroup%2FGoogle-Web-Toolkit%2Fbrowse_frm%2Fmonth%2F2007-04%3F
and sample workaround:/** * utility method to re-process DTO's to make sure that the dates * are explicitly converted to java.util.Date. */ private SimpleDTO[] convertSqlDates(SimpleDTO[] myarray){ //DRH cloning would be safer, but private anyway. for (int i = 0; i < myarray.length; i++) { SimpleDTO simpleDTO = myarray; if(simpleDTO.getDateField() != null){ simpleDTO.setDateField(new java.util.Date(simpleDTO.getDateField().getTime())); } } return myarray; }
NOTE: I've tried changing the getter/setters and this will NOT work for hibernate/JPA, you need to change it after retrieval but before submitting over the wire.
Another NOTE: I've tried changing the GWTService, GWT13Service, GWT14Service classes in SEAM to modify this behavior, but I can't seem to find a good fix, so the workaround seems like the only option for now.