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 "Dirk Manske (Service Respond)" <se...@nexgo.de> on 2004/03/02 00:31:24 UTC

AW: AW: Extent

thanks for the answer Tom. I need more information about the
ojb.modify-inherited tag. You say I could control which attribute will be
picked up. How? Here is the scenario: The BaseClass holds all the "common
attributes". For some objects (extended from BaseClass) all these common
attributes have to be persisted while for some other objects (also extended
from BaseClass) only a few of them have to be persisted. The problem is,
that the generated repository now holds all the common attributes for each
class-descriptor but I do not need them for each class. could the
ojb.modify-inherited tag help me in this case?  An example of how to exclude
an attribute for specific classes would be great. thx,

Dirk


-----Ursprüngliche Nachricht-----
Von: Thomas Dudziak [mailto:tomdz@first.gmd.de] 
Gesendet: Sonntag, 29. Februar 2004 21:03
An: OJB Users List
Betreff: Re: AW: Extent

On Sun, 29 Feb 2004, Dirk Manske (Service Respond) wrote:

> Hi Peter,
> 
> my first repository-user.xml does not contain the extent concept at 
> all. I simply did not set up a class-descriptor for BaseClass - just 
> as you described.
> 
> The extent concept came up to my mind when I thought that XDoclet 
> would be a great time saver to set up the repository. For each 
> attribute in the model class you declare an ojb.field, ojb.reference 
> etc. Since the common attributes are in BaseClass I wondered how to 
> set them up via XDoclet for each model class. That is why I guess U have
to use the extent concept of
> ojb.   

Simply put the required tags (ojb.field, ojb.reference etc.) in the
BaseClass. There is no need to tag the BaseClass with ojb.class, the XDoclet
module will pick up any inherited persistent (tagged) features regardless of
whether their class is persistent (ojb.class) or not, and add them to the
current class descriptor. You can also control which features are picked up
via the ojb.modify-inherited tag, which also allows you to modify them for
the current class.

Tom


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


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


AW: AW: AW: Extent

Posted by "Dirk Manske (Service Respond)" <se...@nexgo.de>.
hm. in my last download of ojb-1.0rc5 (dec. 2003) there was no docu about
the xdoclet support. however I got it from the cvs version  and it works
now. thanks.  

Dirk

-----Ursprüngliche Nachricht-----
Von: Thomas Dudziak [mailto:tomdz@first.gmd.de] 
Gesendet: Dienstag, 2. März 2004 10:54
An: OJB Users List
Betreff: Re: AW: AW: Extent

On Tue, 2 Mar 2004, Dirk Manske (Service Respond) wrote:

> thanks for the answer Tom. I need more information about the 
> ojb.modify-inherited tag. You say I could control which attribute will 
> be picked up. How? Here is the scenario: The BaseClass holds all the 
> "common attributes". For some objects (extended from BaseClass) all 
> these common attributes have to be persisted while for some other 
> objects (also extended from BaseClass) only a few of them have to be 
> persisted. The problem is, that the generated repository now holds all 
> the common attributes for each class-descriptor but I do not need them 
> for each class. could the ojb.modify-inherited tag help me in this 
> case?  An example of how to exclude an attribute for specific classes 
> would be great. thx,

There is one in the docs for the xdoclet-module. Bascially, you state the
inherited feature that you want to modify (via the name) and then you have
'ignore="true"' for it.
You should be careful with modification (though ignore should be safe) as
the xdoclet-module probably allows far more than OJB.
 
Tom


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


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


Re: AW: AW: Extent

Posted by Thomas Dudziak <to...@first.gmd.de>.
On Tue, 2 Mar 2004, Dirk Manske (Service Respond) wrote:

> thanks for the answer Tom. I need more information about the
> ojb.modify-inherited tag. You say I could control which attribute will be
> picked up. How? Here is the scenario: The BaseClass holds all the "common
> attributes". For some objects (extended from BaseClass) all these common
> attributes have to be persisted while for some other objects (also extended
> from BaseClass) only a few of them have to be persisted. The problem is,
> that the generated repository now holds all the common attributes for each
> class-descriptor but I do not need them for each class. could the
> ojb.modify-inherited tag help me in this case?  An example of how to exclude
> an attribute for specific classes would be great. thx,

There is one in the docs for the xdoclet-module. Bascially, you state the
inherited feature that you want to modify (via the name) and then you
have 'ignore="true"' for it.
You should be careful with modification (though ignore should be safe) as
the xdoclet-module probably allows far more than OJB.
 
Tom


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