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]

Reply via email to