thanks this clear things a bit. Just one more thing, if i define a compound key made of all the fields of my "fetch group", would i be able to get their values from the proxy using VirtualProxy.getPrimaryKeyValues() ?

Thomas Mahler wrote:

Hi ALessandro,

Alessandro Di Bella wrote:

Hi,
I just started using OJB and i'm having a problem with proxy classes. I want to be able to specify which are the fields to be loaded when the proxy object is instantiated and which one are loaded on demand.


The solution you are looking for is not a proxy solution, but is called "fetch groups" or "partial loading". OJB does not provide declarative support for this.
But you could implement this mechanism on top of the existing OJB features.
This is possible, but not something that you should do within the first 4 weeks of using OJB...
The solution
- could include runtime manipulation of mapping data.
- you could juggle with different repositories that contain different mappings for the same class, one having only 2 field-decsriptors and the other containing all 17 field-descriptors.
- or it could be based on your own *user-defined proxy* objects
- it could be also to have a *preview class* and a *full data class* mapped onto the same table.


The default *dynamic Proxy* mechanism works differently. It does not do partial loading but is based on a lazy delegation pattern.
Please see tutorial3.html for more details.


From the previous threads on the list i understood that it can be done with the so called "report queries", I have a general understanding on how to use them but it's still obscure to me how to integrate them with a proxy class.


Report queries do not fit into this picture. they are meant to produce tabular representation of arbitrary result sets. They circumvent the OJB object loading mechanism and thus they won't help you working with proxies.



cheers,
Thomas

Could someone give me some example/tutorial please?

Thanks

Alessandro


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to