ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Meadors <lmead...@apache.org>
Subject Re: iBATIS strange behaviour
Date Fri, 07 Oct 2005 14:42:35 GMT
The mutator getIIdOferta is for a property named IIdOferta.

The mutator getiIdOferta is for a property named iIdOferta.

See for yourself:
===
  public void testShowProperties(){
    try {
      BeanInfo beanInfo;
      beanInfo = Introspector.getBeanInfo(TestBean.class);
      PropertyDescriptor[] propertyDescriptors;
      propertyDescriptors = beanInfo.getPropertyDescriptors();
      for(int i = 0; i< propertyDescriptors.length;i++){
        Method readMethod = propertyDescriptors[i].getReadMethod();
        Method writeMethod = propertyDescriptors[i].getWriteMethod();
        System.out.println(propertyDescriptors[i].getName() +
            "\n - type  : " +
propertyDescriptors[i].getPropertyType().getName() +
            "\n - getter: " +
(null==readMethod?"(write-only)":readMethod.getName()) +
            "\n - setter: " +
(null==writeMethod?"(read-ony)":writeMethod.getName())
        );
      }
    } catch (IntrospectionException e) {
      fail(e.getLocalizedMessage());
    }
  }

===

Hey! That is a handly little method! :)

Anyway, as you can see, this is how java's introspector class
interprets them (nevermind the specification), and this is how iBATIS
interprets them, too.

I would say that Eclipse screwed them up, but in fairness, I would say
that naming properties like  iSomeName is not officially supported
(i.e., it is out of the spec), and should not be done.

Larry

Mime
View raw message