Hierarchical Custom Projection

Posts   
 
    
Seth avatar
Seth
User
Posts: 204
Joined: 25-Mar-2006
# Posted on: 22-Jul-2007 06:14:51   

I am using LLBLGen 2.0 March release. I wanted to create a custom collection (with custom subcollections) as a provider agnosting report binding source. I was wondering what was the best way to do this kind of thing using projections. I understand how to do a projection onto a custom collection object. I am having a problem projecting the sub-items without re-querying for each item in the parent collection. Is there a way to do this? I know 2.5 has hierarchical binding to a dataset, but I am asking about custom collection objects.

-Seth

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 22-Jul-2007 19:33:39   

in 2.0 you can only project to 1 level. so for each table required for a dataset is another llbl query. You will also be responsible for creating the relationships.

in 2.5, currently in beta, they have a heirachal, dataset projection which does this for you.

Seth avatar
Seth
User
Posts: 204
Joined: 25-Mar-2006
# Posted on: 23-Jul-2007 03:40:37   

I am aware of that. My question does not have to do with datasets but with custom collections.

-Seth

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 23-Jul-2007 04:46:54   

Copied form v2.5 changelog:

v2.5 wrote:

It's now possible to perform a hierarchical projection of a full entity graph, using an entity collection as a startpoint. The projection can be onto a dataset (which will get one datatable per entity type, including datarelations) or a dictionary/hashtable with per type an entitycollection with the projection results per entity type found in the graph.

So, as far as I know, the only way would be migrating the projection resultset dataset to your customObjects collection in a user custom routine. I will check out whether there's a better approach.

David Elizondo | LLBLGen Support Team
Seth avatar
Seth
User
Posts: 204
Joined: 25-Mar-2006
# Posted on: 23-Jul-2007 22:06:54   

The whole idea is I would like to create a custom "data" object that is bound to reports. This custom object would only be used in reporting settings. Some of the data I would query would be aggregated from other tables (like replacing a lookup table id with its corresponding string). This would work fine even with a Typed Dataset. I looked through the 2.5 docs and saw that the code fetch a hierarchy of entity collections first and then projected them onto a dataset. Can this be done with a custom resultsetfields collection?

-Seth

--EDIT, MOVED TO http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=10614