Hi!
I am trying to accomplish fetch, but I just can't do it right. I am using adapter scenario.
I have a couple of tables:
table ApplicationUser:
ApplicationUserId (PK),
BusinessRoleId (FK to BusinessRole table),
ApplicationUserUsername,
ApplicationUserActive (bit)...
table BusinessRole:
BusinessRoleId (PK),
BusinessRoleActive (bit)...
table BusinessSystemRole:
BusinessSystemRoleId (PK),
BusinessRoleId (FK to BusinessRole table),
SystemRoleId (FK to SystemRole table)...
table SystemRole:
SystemRoleId (PK),
SystemRoleActive (bit)...
I need to fetch single ApplicationUserEntity object for specified ApplicationUserUsername with it's related BusinessRoleEntity object that has collection of related SystemRoleEntity objects. Well, I don't seem to have any problems with creating prefetch paths.
Furthermore, user needs to have active business role (BusinessRoleActive = 1) and that business role has to contain only active system roles (SystemActiveRole = 1).
No matter how I set predicates, I get ApplicationUser with it's BusinessRole that contains all (active and non-active) SystemRole-s.
What is the proper way to set predicates for this search? Please help!