You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Maksimenko Alexander <ma...@bird.cris.net> on 2004/06/01 09:47:27 UTC

Ojb Xdoclet: nested fields

Hi!
I am confronted with strange behavior of the xdoclet module -
In the nested class I specify all attributes of the field except the 
column name:

  /**
   * @ojb.field jdbc-type="VARCHAR" length="50"
   */
  private String login;
  /**
   * @ojb.field jdbc-type="VARCHAR" length="50"
   */
  private String password;

In the container object I specify the column name (I think its very 
usual to customize only column name)
  /**
   * @ojb.nested
   * @ojb.modify-nested name="login" column="SCRIPT_EXEC_LOGIN"
   * @ojb.modify-nested name="password" column="SCRIPT_EXEC_PW"
   */
  private Credential scriptExecutionCredential;

I get the following class descriptor:
<field-descriptor
        name="scriptExecutionCredential::login"
        column="SCRIPT_EXEC_LOGIN"
        jdbc-type="VARCHAR"
        length="50"
    >
    </field-descriptor>
    <field-descriptor
        name="scriptExecutionCredential::password"
        column="scriptExecutionCredential_password"
        jdbc-type="VARCHAR"
        length="50"
    >
So the first nested field was processed well but in the second field the 
column name is incorrect.

-- 
Maksimenko Alexander
Softwarium, www.softwarium.net


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Ojb Xdoclet: nested fields

Posted by Maksimenko Alexander <ma...@bird.cris.net>.
Thomas Dudziak wrote:

>Is fixed in CVS. Apparently the module did only process one
>ojb.modify-inherited tag per field.
>
>Tom
>  
>
Thanks!
I've tried it. All works well :)
-- 
Maksimenko Alexander
Softwarium, www.softwarium.net


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Ojb Xdoclet: nested fields

Posted by Thomas Dudziak <to...@first.gmd.de>.
On Tue, 1 Jun 2004, Thomas Dudziak wrote:

> On Tue, 1 Jun 2004, Maksimenko Alexander wrote:
> 
> > Hi!
> > I am confronted with strange behavior of the xdoclet module -
> > In the nested class I specify all attributes of the field except the 
> > column name:
> > 
> >   /**
> >    * @ojb.field jdbc-type="VARCHAR" length="50"
> >    */
> >   private String login;
> >   /**
> >    * @ojb.field jdbc-type="VARCHAR" length="50"
> >    */
> >   private String password;
> > 
> > In the container object I specify the column name (I think its very 
> > usual to customize only column name)
> >   /**
> >    * @ojb.nested
> >    * @ojb.modify-nested name="login" column="SCRIPT_EXEC_LOGIN"
> >    * @ojb.modify-nested name="password" column="SCRIPT_EXEC_PW"
> >    */
> >   private Credential scriptExecutionCredential;
> > 
> > I get the following class descriptor:
> > <field-descriptor
> >         name="scriptExecutionCredential::login"
> >         column="SCRIPT_EXEC_LOGIN"
> >         jdbc-type="VARCHAR"
> >         length="50"
> >     >
> >     </field-descriptor>
> >     <field-descriptor
> >         name="scriptExecutionCredential::password"
> >         column="scriptExecutionCredential_password"
> >         jdbc-type="VARCHAR"
> >         length="50"
> >     >
> > So the first nested field was processed well but in the second field the 
> > column name is incorrect.
> 
> I added a test to verify that this is a bug in the XDoclet module. I will
> fix this later today.
> 
> Tom

Is fixed in CVS. Apparently the module did only process one
ojb.modify-inherited tag per field.

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Ojb Xdoclet: nested fields

Posted by Thomas Dudziak <to...@first.gmd.de>.
On Tue, 1 Jun 2004, Maksimenko Alexander wrote:

> Hi!
> I am confronted with strange behavior of the xdoclet module -
> In the nested class I specify all attributes of the field except the 
> column name:
> 
>   /**
>    * @ojb.field jdbc-type="VARCHAR" length="50"
>    */
>   private String login;
>   /**
>    * @ojb.field jdbc-type="VARCHAR" length="50"
>    */
>   private String password;
> 
> In the container object I specify the column name (I think its very 
> usual to customize only column name)
>   /**
>    * @ojb.nested
>    * @ojb.modify-nested name="login" column="SCRIPT_EXEC_LOGIN"
>    * @ojb.modify-nested name="password" column="SCRIPT_EXEC_PW"
>    */
>   private Credential scriptExecutionCredential;
> 
> I get the following class descriptor:
> <field-descriptor
>         name="scriptExecutionCredential::login"
>         column="SCRIPT_EXEC_LOGIN"
>         jdbc-type="VARCHAR"
>         length="50"
>     >
>     </field-descriptor>
>     <field-descriptor
>         name="scriptExecutionCredential::password"
>         column="scriptExecutionCredential_password"
>         jdbc-type="VARCHAR"
>         length="50"
>     >
> So the first nested field was processed well but in the second field the 
> column name is incorrect.

I added a test to verify that this is a bug in the XDoclet module. I will
fix this later today.

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org