How do i?

Posts   
 
    
Karlang
User
Posts: 6
Joined: 08-Mar-2006
# Posted on: 15-Apr-2006 06:22:40   

I have a Employee, EmployeeAddress, Address table.

Employee and EmployeeAddress is joined by EmployeeId. EmployeeAddress and Address is joined by AddressId. EmployeeAddress has AddressType (I want "Primary")

On my Employee Form i want to show Employee Data (FirstName,LastName....) and Primary Address i am able to show Employee Data... how do i create Address entity that has primary Address Data. in another words....

Select a.* from Address a, EmployeeAddress ea, Employee e where a.AddressId=ea.AddressId and e.EmployeeId=ea.EmployeeId and ea.AddressType="Primary"

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 15-Apr-2006 12:01:28   

Set up the relationscollection as you would normally and set the CustomFilter property of the EmployeeEntity.Relations.EmployeeAddressUsingEmployeeID (I guessed this name, but you know which one) relation to a filter on EmployeeAddress.AddressType == Primary. See Using the generated code -> Adapter/selfservicing -> Filtering and sorting -> Advanced filter usage -> Custom filters for entityrelations.

Frans Bouma | Lead developer LLBLGen Pro