RE: [Ikvm-developers] Converting JavaBeans into .Net classes
Brought to you by:
jfrijters
From: Jeroen F. <je...@su...> - 2005-04-14 14:22:49
|
Valdemar Mejstad wrote: > I have another question though. Say we have two classes A and B: >=20 > class A { > int intProperty; > public int getIntProperty() { return intProperty; } > } >=20 > class B { > public int getIntProperty() { return intProperty * 2; } > } >=20 > How would a correct map.xml file look like in this case? Should it=20 > contain only mappings for class A, or for both class A and class B? Both A and B. I would use java.beans.Introspector.getBeanInfo(clazz, clazz.getSuperclass()), that way you only get the properties for a specific class (and not the ones inherited). That way each class only defines the properties that it adds, but I suspect that in practice it doesn't make much difference, since you inherit them either way. Regards, Jeroen |