llblgenpro: Adapter version 2.0.
dbase: sql2000.
Hi,
below are the snippets of the 2 codes:
Snippet 1:
private static IPrefetchPath2 PrefetchPath4ClaimBillLines()
{
IPrefetchPath2 prefetchPath = new PrefetchPath2((int)MW.DAL.EntityType.ClaimBillLineEntity);
prefetchPath.Add(MyClaimBillLineEntity.PrefetchPathClaimBill);
return prefetchPath;
}
public static EntityCollection<MyClaimBillLineEntity> GetClaimBillLines(PredicateExpression expression)
{
IPrefetchPath2 prefetchPath = PrefetchPath4ClaimBillLines();
IRelationPredicateBucket bucket = new RelationPredicateBucket(expression);
EntityCollection<MyClaimBillLineEntity> claimBillLines = new EntityCollection<MyClaimBillLineEntity>(new MyClaimBillLineEntityFactory());
DataAccessAdapter adapter = new DataAccessAdapter();
adapter.FetchEntityCollection(claimBillLines, bucket, prefetchPath);
return claimBillLines;
}
Snippet 2:
private static IPrefetchPath2 PrefetchPath4ClaimBillIcd9()
{
IPrefetchPath2 prefetchPath = new PrefetchPath2((int)MW.DAL.EntityType.ClaimBillIcd9Entity);
prefetchPath.Add(MyClaimBillIcd9Entity.PrefetchPathIcd9);
return prefetchPath;
}
public static EntityCollection<MyClaimBillIcd9Entity> GetClaimBillIcd9s(PredicateExpression expression)
{
IPrefetchPath2 prefetchPath = PrefetchPath4ClaimBillIcd9();
IRelationPredicateBucket bucket = new RelationPredicateBucket(expression);
bucket.Relations.Add(ClaimBillIcd9Entity.Relations.Icd9EntityUsingIcdCode);
EntityCollection<MyClaimBillIcd9Entity> claimBillIcd9s = new EntityCollection<MyClaimBillIcd9Entity>(new MyClaimBillIcd9EntityFactory());
DataAccessAdapter adapter = new DataAccessAdapter();
adapter.FetchEntityCollection(claimBillIcd9s, bucket, prefetchPath);
return claimBillIcd9s;
}
The relationships are as follow:
relationship1:
claimbillline.claimbillid = claimbill.id (n:1 relationship and claimbill.id is integer type)
relationship2:
claimbillicd9.icdcode = icd9.id (n:1 relationship and icd9.id is string type)
Problem
The first snippet works fine. i.e. I can retrieve the claimbill for each claimbillline.
In the second snippet I cannot retrieve icd9 for each claimbillicd9. The value is always null
Question
1. Does llblgenpro has issue with "using prefetchPath in the relationship where the PF key relationship is of type String"?
2. If yes, then is there any work around?
3. If no, then what did I do wrong?
Thanks.
BZ