Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Bugs & Issues> [FIXED] Can't Get Desired Typed List Relations
 

Pages: 1
Bugs & Issues
[FIXED] Can't Get Desired Typed List Relations
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: 15-Jun-2004 17:11:09.  
I have tables with the following relationships:

Customer
Setting
User.CustomerID
UserSetting.{UserID,SettingID}
DefaultSetting.{CustomerID,SettingID}

I am trying to create a typed list to join UserSetting, DefaultSetting, and Setting, using weak relations, to represent a union of all possible SettingIDs. In other words:

Setting LEFT JOIN UserSetting ON Setting.SettingID=UserSetting.SettingID
LEFT JOIN User ON UserSetting.UserID=User.UserID
LEFT JOIN DefaultSetting ON User.CustomerID=DefaultSetting.CustomerID AND Setting.SettingID=DefaultSetting.SettingID

The problem is, no matter what order I add the tables to the typed list, it will only join DefaultSetting to Setting via SettingID; it will not allow me to specify that DefaultSetting should be joined to User as well.

I have a feeling that this query is too complex to be handled with a typed list, so as a workaround I plan to use two different typed lists to retrieve DefaultSettings separately from UserSettings. However, I was curious if I was overlooking something in LLBLGen that would allow me to do what I am after.
  Top
Fishy
User



Location:
Medford, Oregon, USA
Joined on:
15-Apr-2004 00:58:38
Posted:
392 posts
# Posted on: 15-Jun-2004 17:18:19.  
This may sound like a stupid question but what is the difference between using a TypedList versus a TypedView?

Thanks,

Fishy


It could be that the purpose of your life is only to serve as a warning to others.  Top
Trig
User



Location:

Joined on:
09-Jun-2004 14:43:46
Posted:
96 posts
# Posted on: 15-Jun-2004 17:29:06.  
Typed lists are kind of an ad hoc way of creating a view in the LLBLGen designer whereas Typed Views pull a specific view from the database.
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37804 posts
# Posted on: 15-Jun-2004 17:40:46.  
It is possible only in Adapter and also not in the gui. SelfServicing has its BuildRelationSet routine marked private, which is changed very soon in the gui update release.

the relations shown in the GUI are the relations used to group the entities together, i.e. the relations generated into the code.

You need to specify a custom filter for the relation. This can be done by overriding the GetRelationInfo method in a subclass of your typed list class. See the adding of a custom filter to a relation the section: 'Using the generated code - SelfServicing/Adapter - Filtering and sorting - Custom filters for relations'.

Another workaround would be to add a view to the db and a typed view to the project. That's more efficient than the workaround you suggested I think.


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: 15-Jun-2004 20:37:34.  
I thought of deriving a class but couldn't override BuildRelationSet(). I didn't realize GetRelationInfo() was a viable alternative.

Nevertheless, Fishy's post opened my eyes to the possibility of using a TypedView, so I will go that route instead.
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37804 posts
# Posted on: 15-Jun-2004 21:39:58.  
DaveR wrote:
I thought of deriving a class but couldn't override BuildRelationSet(). I didn't realize GetRelationInfo() was a viable alternative.

GetRelationInfo is in adapter, BuildRelationSet is in SelfServicing, so if your project is build around selfservicing, you can't use hte adapter method obviously Regular Smiley

The method is made public in hte next revision of the gui/templates which is scheduled for release later this week.

Quote:

Nevertheless, Fishy's post opened my eyes to the possibility of using a TypedView, so I will go that route instead.

A view would be a good option indeed.


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: 16-Jun-2004 16:15:40.  
Otis wrote:
GetRelationInfo is in adapter, BuildRelationSet is in SelfServicing

I am using Adapter, and my typed list class has both methods: private BuildRelationSet() constructs _filterBucket while GetRelationInfo() simply returns it. Are you saying that BuildRelationSet() is never called in Adapter mode?

I've solved my problem using a view, but I'm curious about this...
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37804 posts
# Posted on: 16-Jun-2004 16:26:46.  
DaveR wrote:
Otis wrote:
GetRelationInfo is in adapter, BuildRelationSet is in SelfServicing

I am using Adapter, and my typed list class has both methods: private BuildRelationSet() constructs _filterBucket while GetRelationInfo() simply returns it. Are you saying that BuildRelationSet() is never called in Adapter mode?

I've solved my problem using a view, but I'm curious about this...

BuildRelationSet is a private method called by GetRelationInfo. You need GetRelationInfo, as that one produces the object you want to alter and that one is virtual public Regular Smiley


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


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

Version: 2.1.12172008 Final.