UNION Query or Manual Collection

Posts   
 
    
gabrielk avatar
gabrielk
User
Posts: 231
Joined: 01-Feb-2005
# Posted on: 06-Feb-2006 16:30:41   

Hi Folks,

I've got the following situation, a EmployeeEntity can have Events (Appointments) and Activtities (Tasks), BusinessCourses, etc assigned to it.

Now I need 1 datasource to use in any data show view (asp.net).

What is the best approach for this? It's gonna be a real lot of data and should ofcourse work as fast as possible.

Should I create a Typed View with a UNION query which results NAME,DATE,STATUS selected from each table, or should I create a collection with HistoryItems which I populate manually from the different collectionclasses?

Thanks for any advise on this,

Greets, Gab

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 07-Feb-2006 02:42:19   

Are you not able to use a current collection and prefetch paths to bring in all of the data that you need? If you would desire one source then I would strongly consider using a typed list in the designer to create datasource that you need.

gabrielk avatar
gabrielk
User
Posts: 231
Joined: 01-Feb-2005
# Posted on: 07-Feb-2006 10:42:33   

Thanks for the input...

A typed list would be based on a UNION query i guess?

I have to get 1 source, so it will be copying or union i assume.

thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 07-Feb-2006 11:43:20   

LLBLGen Pro doesnt support UNION queries, you have to call a fill twice.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 1268
Joined: 10-Mar-2006
# Posted on: 28-Jul-2006 03:12:29   

Otis, It looks like support for UNION has been wanted/needed for quite some time. I actually have a query that uses a UNION inside the subquery.

select * from table where somevalue in (select blah union select blah).

I am guessing you are not planning on adding support for union in the future?

(I guess I can rewrite the above query with two 'or in' statements)

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 28-Jul-2006 09:48:22   

adding UNION is hard, because it's often used with different resultsets and a set of NULL values, plus LLBLGen Pro doesn't use a Query object you fill and pass to a method, it uses action oriented methods: do this , do that. This means that if you say "FetchTypedList", where do you specify the second or third resultset? You can't, or it will get very awkward.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 1268
Joined: 10-Mar-2006
# Posted on: 28-Jul-2006 15:56:25   

Well, I consider it just like when I do a query with your FieldCompareSetPredicate. It mysteriously adds another query in the where clause. Need something that mysteriously adds another select after a union statement!

Yeah, the null thing.....I guess you would have to have some way to put a literal in for a field. Like, what I if I wanted to do

select Field, "Wayne", 12 from SomeTable

If that could be done, could simply supply NULL for the columns that were not going to be selected.

Please consider it in the future, as this is one of the (few) things your product is missing. Thanks!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 28-Jul-2006 16:41:39   

It's on the todo list simple_smile

Frans Bouma | Lead developer LLBLGen Pro