Overloaded setter methods is a violation of the JavaBeans specification. I recommend you don't do it. I also recommend you upgrade to JDK 1.5 if possible, which will avoid the need for this entirely.
Even if you don't upgrade, overloading for this reason is a bad idea IMHO....Java sucks for not having autoboxing until now, but dealing with it using ad-hoc polypmorphism is probably not the best idea. Honestly I'd recommend just picking either the primitives or the object wrappers and using them consistently.
Clinton
On 3/14/06, Anusuri, Vijay M <[EMAIL PROTECTED]> wrote:
Hi,I have two overloaded setter methods in DTO: one with Long Wrapper parameter and another with long primitive. This has been working fine for several months. But it stopped working recently and complaining that "The error happened while setting a property on the result object". I know what is happening here . Now IBatis is started using setter method with primitive long parameter. Earlier It used use Long Wrapper setter method. What is the reason for this behavior?Setter methods in DTO
/**
* @param parentAnalysisId The parentAnalysisId to set.
*/
public void setParentAnalysisId(Long parentAnalysisId) {
this.parentAnalysisId = parentAnalysisId;
}
/**
* @param parentAnalysisId The parentAnalysisId to set.
*/
public void setParentAnalysisId(long parentAnalysisId) {
this.parentAnalysisId = new Long(parentAnalysisId);
}
Thanks,Vijay
