Related column in Collection

Posts   
 
    
NickD
User
Posts: 224
Joined: 31-Jan-2005
# Posted on: 08-Mar-2005 20:33:45   

I have a table attendance that has a code value in it which is foriegn keyed to a code set table that describes each possible code with an abbreviation and a description.

I am pulling the records from this table where the code is not '+' into a collection. I also want to pull the abbreviation from the FK table. Now, I think if I had a single entity, I would be able to say Attendance_dayEntity.code.abbr (because the Attendance_day table is foreign keyed to the cd_attn_day_code code set table(?)).

Is this really true, or do I need to do something else?

All I want to do is pull the description value for the coded value in each collection row. I'd like to try to avoid hitting the database for each record in my collection to pull this.

Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 08-Mar-2005 23:37:26   

You can do this the most efficient way by defining a prefetch path, which reads the foreign keyed entity as well as the attendance entities.

Frans Bouma | Lead developer LLBLGen Pro