db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert S. Sfeir" <rob...@codepuccino.com>
Subject Re: Bug in Xdoclet?
Date Wed, 17 Nov 2004 13:26:03 GMT
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.


On 11/17/04 8:18 AM, "Thomas Dudziak" <tomdz@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

View raw message