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 Thomas Dudziak <to...@first.gmd.de> on 2003/09/12 11:13:50 UTC

RE: Xdoclet: How to use base-class properties with different colu mn names in children?

A field declared in the class javadoc comment is only then not anonymous
if there is a tagged field with that name in a base class of that
class. So, you simply tag the field with @ojb.field in your base class
(BusinessObject if I remember correctly) - this does not require that you
also tag the class - and then the @ojb.field in the class javadoc comment
in the subclass will automatically override the base class tag for the
subclass.

E.g.

class BusinessObject
{
  /**
   * @ojb.field column="guid"
   */
  protected String guid;
}

/**
 * @ojb.class
 * @ojb.field name="guid"
 *            column="dog_guid"
 */
class Dog extends BusinessObject
{
}

Tom


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


RE: Xdoclet: How to use base-class properties with different colu mn names in children?

Posted by Andy Czerwonka <cz...@arcticpenguin.ca>.
Outstanding!!!!

On Fri, 2003-09-12 at 05:58, Thomas Dudziak wrote:
> Yes, both the repository descriptor (aka repository_user.xml) and the
> table schema (for Torque which then generates the tables in your
> database) are generated by the xdoclet ojb module.
> If you want to try it out, grab OJB from CVS and look into the contrib
> folder. There you'll find the module along with the xdoclet jars, and the
> documentation for the module.
> 
> Tom
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
-- 
andy


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


RE: Xdoclet: How to use base-class properties with different colu mn names in children?

Posted by Thomas Dudziak <to...@first.gmd.de>.
Yes, both the repository descriptor (aka repository_user.xml) and the
table schema (for Torque which then generates the tables in your
database) are generated by the xdoclet ojb module.
If you want to try it out, grab OJB from CVS and look into the contrib
folder. There you'll find the module along with the xdoclet jars, and the
documentation for the module.

Tom




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


RE: Xdoclet: How to use base-class properties with different colu mn names in children?

Posted by Andy Czerwonka <cz...@arcticpenguin.ca>.
I'd love to learn how your using XDoclet with OJB.  Are you generating
both the DDL and the repository?

On Fri, 2003-09-12 at 03:13, Thomas Dudziak wrote:
> A field declared in the class javadoc comment is only then not anonymous
> if there is a tagged field with that name in a base class of that
> class. So, you simply tag the field with @ojb.field in your base class
> (BusinessObject if I remember correctly) - this does not require that you
> also tag the class - and then the @ojb.field in the class javadoc comment
> in the subclass will automatically override the base class tag for the
> subclass.
> 
> E.g.
> 
> class BusinessObject
> {
>   /**
>    * @ojb.field column="guid"
>    */
>   protected String guid;
> }
> 
> /**
>  * @ojb.class
>  * @ojb.field name="guid"
>  *            column="dog_guid"
>  */
> class Dog extends BusinessObject
> {
> }
> 
> Tom
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
-- 
andy


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