I have 2 form Classes
public class Form1{
int id,
String name,
DateTime lastModified;
//setters and getters
}
public class Form2 {
int id,
String name,
Date lastModified;
//setters and getters
}
ie., one of the form has the same variable name lastModified with Date type and other one with joda DateTime type
I am trying to copy form1 values to form2
Form1 form1 = dao.getForm1();
Form2 form2 = new Form2();
BeanUtils.copyProperties(form2,form1)
But it is giving me error like
org.apache.commons.beanutils.ConversionException: DateConverter does not support default String to 'Date' conversion.
I tried the solution given in
https://stackoverflow.com/a/5757379/1370555
But it is giving me error like
org.apache.commons.beanutils.ConversionException: Error converting 'org.joda.time.DateTime' to 'Date' using pattern 'yyyy-MM-dd HH:mm:ss.0 Z'
I think it can be solved with apache ConvertUtils but i am not getting exactly how it is to be done
Can any one help me solve this?