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 Mickael LEFEVRE <Mi...@amdm.fr> on 2004/09/16 11:06:13 UTC

Xdoclet, reference and modify-inherited





Hello,

We use OJB 1.0.1 with one class per table.
To be simple, we have 3 classes : B extend A, and A have a reference to C.
The C id in A is anonymous.
A have the flag ' determine-extends="false" '

In B we could ignore the reference to C, but not the C id (which is
anonymous).
If we put :

 * // reference
 * @ojb.modify-inherited name="C"
 *        ignore="true"
 *
 * // foreignkey of the reference
 * @ojb.modify-inherited name="CId"
 *        ignore="true"

xdoclet-ojb simply reply :
<<The reference C in the class blabla.B uses the field CId as foreignkey
although this field is ignored in this class>>

If I delete :
 * @ojb.modify-inherited name="CId"
 *        ignore="true"
the ant task did well, but the field CId is present in the mapping of B.
That give bad SQL request on the database server, like if the field CId is
in the table associated to C.

We try to delete the anonymous CId field in the B mapping, and our test
succeed.
We could access the C reference from B. No bad join, or bad place field in
the SQL request.

Is it a bug, a feature, or something else ?

Michael


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


Re: Xdoclet, reference and modify-inherited

Posted by Thomas Dudziak <to...@first.fhg.de>.
Mickael LEFEVRE wrote:

> We use OJB 1.0.1 with one class per table.
> To be simple, we have 3 classes : B extend A, and A have a reference to C.
> The C id in A is anonymous.
> A have the flag ' determine-extends="false" '
> 
> In B we could ignore the reference to C, but not the C id (which is
> anonymous).
> If we put :
> 
>  * // reference
>  * @ojb.modify-inherited name="C"
>  *        ignore="true"
>  *
>  * // foreignkey of the reference
>  * @ojb.modify-inherited name="CId"
>  *        ignore="true"
> 
> xdoclet-ojb simply reply :
> <<The reference C in the class blabla.B uses the field CId as foreignkey
> although this field is ignored in this class>>
> 
> If I delete :
>  * @ojb.modify-inherited name="CId"
>  *        ignore="true"
> the ant task did well, but the field CId is present in the mapping of B.
> That give bad SQL request on the database server, like if the field CId is
> in the table associated to C.
> 
> We try to delete the anonymous CId field in the B mapping, and our test
> succeed.
> We could access the C reference from B. No bad join, or bad place field in
> the SQL request.
> 
> Is it a bug, a feature, or something else ?

You've hit a bug. The constraint was checked for the reference even 
though it is ignored.
I fixed that in CVS (both stable and 1.1-dev). You can get the new 
module jar here:

http://cvs.apache.org/viewcvs.cgi/*checkout*/db-ojb/lib/xdoclet-ojb-module-1.2.1.jar

Tom

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