Prefetch for unrelated entities

Posts   
 
    
fdb
User
Posts: 43
Joined: 01-Jul-2008
# Posted on: 26-Oct-2008 08:50:26   

Hi, I have a table in my database with no FK relation to other tables. But conceptually all of the tables in my database are related to this table. This table contains a list of enumeration values like (gender: 100->male, 101->female etc.). Other tables use primary key values of this table. For example:

Employee Table:

Firstname:string Lastname:string GenderCode:100 (100 is the primary key of the 'male' record in the enumerations table) . . .

There is no physical relation between 'GenderCode' and the primary key of the enumerations table. Is it possible to use 'Prefetch' for 'GenderCode' of this table?

Regards, Farzad Badili

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 26-Oct-2008 11:20:56   

You could create a relation in the designer.

Be aware that if a table has relations to all other entities, it's mandatory that you hide the fields mapped onto relations on the PK side, otherwise that side will get a lot of collections generated into the code.

Frans Bouma | Lead developer LLBLGen Pro
fdb
User
Posts: 43
Joined: 01-Jul-2008
# Posted on: 26-Oct-2008 11:37:06   

Is there any chance to solve this problem without creating relations in the designer?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39861
Joined: 17-Aug-2003
# Posted on: 26-Oct-2008 15:01:37   

no, prefetching is meant to fetch related entities into collections/references which are known at compile time, i.e. 'CustomerEntity.Orders'.

Frans Bouma | Lead developer LLBLGen Pro