[jboss-user] [JBoss Seam] - Re: java.sql.Date, Seam-GWT remoting with EJB3/hibernate/JPA
hartfordd
do-not-reply at jboss.com
Wed Dec 5 12:00:43 EST 2007
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.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110618#4110618
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110618
More information about the jboss-user
mailing list