Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Restrict columns returned from a view?
 

Pages: 1
LLBLGen Pro Runtime Framework
Restrict columns returned from a view?
Page:1/1 

  Print all messages in this thread  
Poster Message
DaveR
User



Location:

Joined on:
15-Jun-2004 16:37:10
Posted:
43 posts
# Posted on: 08-Sep-2006 01:57:44.  
I apologize if this has been asked and answered before.

We have a TypedView that contains many columns. We wish to use any of these columns in the search filter, but return only a distinct subset of the columns to the application.

For example, if the view V contains columns A,B,C,D,E then we may want to execute a query such as

SELECT DISTINCT A,B,C FROM V WHERE D=1 AND E=2

Is this possible in LLBLGen version 1? If not, is it possible in version 2?
  Top
bclubb
User



Location:
Norman, Oklahoma
Joined on:
12-Feb-2004 22:18:04
Posted:
934 posts
# Posted on: 08-Sep-2006 03:08:56.  
You can map the view as an entity and then a typed list or dynamic list retrieve a portion of the view like you need.

  Top
DaveR
User



Location:

Joined on:
15-Jun-2004 16:37:10
Posted:
43 posts
# Posted on: 08-Sep-2006 15:29:43.  
But with a typed or dynamic list, aren't the filter parameters restricted to the fields of the list, and not the entire view (i.e. fields of the view that are not included in the typed list cannot be searched)?
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14569 posts
# Posted on: 08-Sep-2006 15:36:01.  
Using a dynamicList, you can select the fields you want to be returned, and use the fields you need as a filter. (no need for the filter to using fields from the returned set of fields).

So map the view to an entity and then use a dynamicList to select fields from this entity.


  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37804 posts
# Posted on: 08-Sep-2006 16:52:15.  
DaveR wrote:
But with a typed or dynamic list, aren't the filter parameters restricted to the fields of the list, and not the entire view (i.e. fields of the view that are not included in the typed list cannot be searched)?

No, you can create a filter based on all the fields in the entities in the filter and the one you select from. this also counts for views. The dynamic list / typed list controls the fields in the select list (i.e. the SELECT ... statement), the filter/relationcollection controls the entities you select from (FROM ... WHERE... statement).

With a typed view, you could create a dynamic list, as a TypedView has fields generated into the generated code, though if you want to create a typedlist, or want to join with other entities, it's recommended that you map an entity onto the view as Walaa says.
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
DaveR
User



Location:

Joined on:
15-Jun-2004 16:37:10
Posted:
43 posts
# Posted on: 08-Sep-2006 17:14:32.  
Thanks. We have the view mapped to both a TypedView and an Entity, so we should be able to simply create a TypedList with a subset of that entity's fields.

I probably should have realized this ...


  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.