[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


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