I don't think it is the solution. Because i have other classes (with descriptors) with '_' as the first character and it works For me, it is a problem of Interface ! I think the PersistentFieldIntrospectorImplNew class find the setter method on the Interface class but not on the intentiated class (in my case 'TailleStructure' class)
Samuel -----Message d'origine----- De : Thomas Dudziak [mailto:[EMAIL PROTECTED] Envoyé : jeudi 15 septembre 2005 13:03 À : OJB Users List Objet : Re: Pb with Interface On 9/15/05, Gru Samuel <[EMAIL PROTECTED]> wrote: > Hi, > > Now i use the 1.0.3 version (the pb with ArrayIndexOutOfBoundsException is > resolved). :-) > > I don't know how to describe in descriptors my classes diagram following : > > Interface Taille > { > int get_LargeurColonne(); > .... > } > Class TailleStructure implements Taille > { > int _LargeurColonne; > public int get_LargeurColonne(){...} > public void set_LargeurColonne(int att){...} > } > > Class Document > { > Taille _TailleCommandee; > ..... > public > public Taille get_TailleCommandee(){...} > public void set_TailleCommandee(Taille newTaille){...} > } > > > Class Maquette extends Document > { > BigDecimal _Numero; > public Maquette() > { > _TailleCommandee = new TailleStructure (); > } > .... > } > > All information for the maquette class (_Numero, _TailleCommandee, ...) is > in the 'maquette' table of the database. > my descriptor for these classes is : > <class-descriptor class='Maquette' table='maquette'> > <field-descriptor name="_Numero" column="numero" jdbc-type="numeric" > primarykey="true" access="readonly" autoincrement="true"/> > ..... > <!-- taille --> > <field-descriptor name="_TailleCommandee::_LargeurColonne" > column="nb_largeurcolcommandee" jdbc-type="INTEGER"/> > </class-descriptor> > > But when i do that, i have this exception (i use > PersistentFieldIntrospectorImplNew class) but i don't undestand because i > have this method (set_TailleCommandee): > org.apache.ojb.broker.metadata.MetadataException: Can't get WriteMethod for > property:_LargeurColonne in > object:fr.ouestfrance.sip.cezan.structure.taille.TailleStructure > at > org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldIntrospectorImplNe > w.setValueFor(Unknown Source) > at > org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldIntrospectorImplNe > w.set(Unknown Source) > at > org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.buildOrRefreshObject( > Unknown Source) > > Where is the problem ? I'm not sure whether '_' is allowed as the first character for property names. It would be easiest if you name the getter and setter methods following the standard Java conventions, eg. like this: Interface Taille { int getLargeurColonne(); .... } Class TailleStructure implements Taille { int _LargeurColonne; public int getLargeurColonne(){...} public void setLargeurColonne(int att){...} } Class Document { Taille _TailleCommandee; ..... public public Taille getTailleCommandee(){...} public void setTailleCommandee(Taille newTaille){...} } Class Maquette extends Document { BigDecimal _Numero; public Maquette() { _TailleCommandee = new TailleStructure (); } .... } and in the repository xml you then simply specify <class-descriptor class='Maquette' table='maquette'> <field-descriptor name="numero" column="numero" jdbc-type="numeric" primarykey="true" access="readonly" autoincrement="true"/> ..... <!-- taille --> <field-descriptor name="tailleCommandee::largeurColonne" column="nb_largeurcolcommandee" jdbc-type="INTEGER"/> </class-descriptor> (notice the missing '_' and that the first letter is lowercase) This way you'll avoid problems with Java's introspection. Tom --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ---------------------------------------------------------------------------- -------------- Les informations ou pièces jointes contenues dans ce message sont confidentielles. Seul le destinataire expressément visé peut en prendre connaissance. Toute autre personne qui en divulguera, diffusera ou prendra des copies sera passible de poursuites. La société Ouest-France décline en outre, toute responsabilité de quelque nature que ce soit au titre de ce message s'il a été altéré, déformé ou falsifié. ---------------------------------------------------------------------------- -------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
