You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by "Robert S. Sfeir" <ro...@codepuccino.com> on 2004/11/17 14:11:47 UTC

Bug in Xdoclet?

Hi all,

The xdoclet docs say:

"It is also possible to use the  ojb.field tag at the class level (i.e. in
the JavaDoc comment of  the class). In this case, the tag is used to define
an  anonymous field, e.g. a "field" that has  no counterpart in the class
but exists in the database."

I have a table called cdpcno_tickets, which has 2 columns for which my
object model does not have corresponding getters and setters, and I want to
add them as anonymous keys, so I did this:

 * @ojb.class table="cdpcno_tickets" determine-extents="true"
include-inherited="true" generate-table-info="true" refresh="true"
 * @ojb.field column="ticket_project_id" jdbc-type="INTEGER"
* @ojb.field column="ticket_submitter" jdbc-type="INTEGER"

However the resulting user_repository.xml shows this:

<class-descriptor
    class="com.codepuccino.mesquite.Ticket"
    table="cdpcno_tickets"
    refresh="true"
>
    <field-descriptor
        name=""
        column="ticket_project_id"
        jdbc-type="INTEGER"
        access="anonymous"
    >

2 problems, 1 the ticket_submitter is missing and note how the name="" is
blank, that's wrong obviously and xdoclet should check to see if the
ojb.field is being used in the class javadoc and require a name since it
cannot get that from the name of the class, it's anonymous.  The docs needs
to be fixed also I think.  If I add name="projectID" and name="submitterID"
to the ojb.field, then they both show up correctly.

If this is true, and it is a bug and not something misunderstood on my part,
just let me know and I'll fix it myself...  I just want to make sure I
didn't misunderstand something.

Thanks
R



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


Re: Bug in Xdoclet?

Posted by "Robert S. Sfeir" <ro...@codepuccino.com>.
Many thanks, will check out and test.

R


On 11/17/04 4:26 PM, "Thomas Dudziak" <to...@first.fhg.de> wrote:

> Robert S. Sfeir wrote:
> 
>> You're correct as usual.  Thanks for the fix, no rush since I have
>> workaround... Read the docs and use the name :D
> 
> Is fixed in CVS (stable and 1.1).
> 
> Tom
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org



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


Re: Bug in Xdoclet?

Posted by Thomas Dudziak <to...@first.fhg.de>.
Robert S. Sfeir wrote:

> You're correct as usual.  Thanks for the fix, no rush since I have
> workaround... Read the docs and use the name :D

Is fixed in CVS (stable and 1.1).

Tom

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


Re: Bug in Xdoclet?

Posted by "Robert S. Sfeir" <ro...@codepuccino.com>.
You're correct as usual.  Thanks for the fix, no rush since I have
workaround... Read the docs and use the name :D

R


On 11/17/04 8:34 AM, "Thomas Dudziak" <to...@first.fhg.de> wrote:

> Robert S. Sfeir wrote:
> 
>> Shouldn't the column name be required?  How would it know the column name if
>> it's not there?
>> 
>> I guess this is where I got tripped, reading so fast I mistook name for
>> column name (inattentive move on my part).  Maybe it should be more explicit
>> that name, column name and jdbc-types are required, since if I were using
>> xdoclet over a getter, the name is not required but the column name is?
>>  
>> 
> The column name is never required. If none is given, then the xdoclet
> module uses the name for the column (see description of column attribute
> in ojb.field tag).
> 
>> In either case, glad I could help.  Let me know when you have it, I'll test
>> and confirm if you'd like.
>>  
>> 
> Will check today, I think.
> 
> Tom
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org



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


Re: Bug in Xdoclet?

Posted by Thomas Dudziak <to...@first.fhg.de>.
Robert S. Sfeir wrote:

>Shouldn't the column name be required?  How would it know the column name if
>it's not there?
>
>I guess this is where I got tripped, reading so fast I mistook name for
>column name (inattentive move on my part).  Maybe it should be more explicit
>that name, column name and jdbc-types are required, since if I were using
>xdoclet over a getter, the name is not required but the column name is?
>  
>
The column name is never required. If none is given, then the xdoclet 
module uses the name for the column (see description of column attribute 
in ojb.field tag).

>In either case, glad I could help.  Let me know when you have it, I'll test
>and confirm if you'd like.
>  
>
Will check today, I think.

Tom


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


Re: Bug in Xdoclet?

Posted by "Robert S. Sfeir" <ro...@codepuccino.com>.
Shouldn't the column name be required?  How would it know the column name if
it's not there?

I guess this is where I got tripped, reading so fast I mistook name for
column name (inattentive move on my part).  Maybe it should be more explicit
that name, column name and jdbc-types are required, since if I were using
xdoclet over a getter, the name is not required but the column name is?

In either case, glad I could help.  Let me know when you have it, I'll test
and confirm if you'd like.

R


On 11/17/04 8:18 AM, "Thomas Dudziak" <to...@first.fhg.de> wrote:

> Robert S. Sfeir wrote:
> 
>> Hi all,
>> 
>> The xdoclet docs say:
>> 
>> "It is also possible to use the  ojb.field tag at the class level (i.e. in
>> the JavaDoc comment of  the class). In this case, the tag is used to define
>> an  anonymous field, e.g. a "field" that has  no counterpart in the class
>> but exists in the database."
>> 
>> I have a table called cdpcno_tickets, which has 2 columns for which my
>> object model does not have corresponding getters and setters, and I want to
>> add them as anonymous keys, so I did this:
>> 
>> * @ojb.class table="cdpcno_tickets" determine-extents="true"
>> include-inherited="true" generate-table-info="true" refresh="true"
>> * @ojb.field column="ticket_project_id" jdbc-type="INTEGER"
>> * @ojb.field column="ticket_submitter" jdbc-type="INTEGER"
>> 
>> However the resulting user_repository.xml shows this:
>> 
>> <class-descriptor
>>    class="com.codepuccino.mesquite.Ticket"
>>    table="cdpcno_tickets"
>>    refresh="true"
>>  
>> 
>>    <field-descriptor
>>        name=""
>>        column="ticket_project_id"
>>        jdbc-type="INTEGER"
>>        access="anonymous"
>>> 
>> 
>> 2 problems, 1 the ticket_submitter is missing and note how the name="" is
>> blank, that's wrong obviously and xdoclet should check to see if the
>> ojb.field is being used in the class javadoc and require a name since it
>> cannot get that from the name of the class, it's anonymous.  The docs needs
>> to be fixed also I think.  If I add name="projectID" and name="submitterID"
>> to the ojb.field, then they both show up correctly.
>>  
>> 
> You're right in that the xdoclet module should report an error about the
> missing name (and not generate a field descriptor with an empty name
> attribute). I'll check that.
> But the docs clearly state that both name and jdbc-type are required for
> anonymous fields, so what part of the docs requires fixing ?
> 
> Tom
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org



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


Re: Bug in Xdoclet?

Posted by Thomas Dudziak <to...@first.fhg.de>.
Robert S. Sfeir wrote:

>Hi all,
>
>The xdoclet docs say:
>
>"It is also possible to use the  ojb.field tag at the class level (i.e. in
>the JavaDoc comment of  the class). In this case, the tag is used to define
>an  anonymous field, e.g. a "field" that has  no counterpart in the class
>but exists in the database."
>
>I have a table called cdpcno_tickets, which has 2 columns for which my
>object model does not have corresponding getters and setters, and I want to
>add them as anonymous keys, so I did this:
>
> * @ojb.class table="cdpcno_tickets" determine-extents="true"
>include-inherited="true" generate-table-info="true" refresh="true"
> * @ojb.field column="ticket_project_id" jdbc-type="INTEGER"
>* @ojb.field column="ticket_submitter" jdbc-type="INTEGER"
>
>However the resulting user_repository.xml shows this:
>
><class-descriptor
>    class="com.codepuccino.mesquite.Ticket"
>    table="cdpcno_tickets"
>    refresh="true"
>  
>
>    <field-descriptor
>        name=""
>        column="ticket_project_id"
>        jdbc-type="INTEGER"
>        access="anonymous"
>    >
>
>2 problems, 1 the ticket_submitter is missing and note how the name="" is
>blank, that's wrong obviously and xdoclet should check to see if the
>ojb.field is being used in the class javadoc and require a name since it
>cannot get that from the name of the class, it's anonymous.  The docs needs
>to be fixed also I think.  If I add name="projectID" and name="submitterID"
>to the ojb.field, then they both show up correctly.
>  
>
You're right in that the xdoclet module should report an error about the 
missing name (and not generate a field descriptor with an empty name 
attribute). I'll check that.
But the docs clearly state that both name and jdbc-type are required for 
anonymous fields, so what part of the docs requires fixing ?

Tom


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