Multi Domain Relations

Posts   
 
    
tmaddox
User
Posts: 9
Joined: 02-Jul-2007
# Posted on: 05-Jul-2007 20:32:26   

Hello again,

I have 2 Domain layers (LLBLGen Self Servicing Projects) currently setup in my solution.

One of the domain (DPA) is an Oracle 9i database warehouse that I'm connecting to.

The other domain (TOMS) is a SQL Server 2005 Database.

I was wondering if it was possible to create relations for filtering/predicates based on columns that exist in both databases.

For instance DPA-->GenericRevenue-->GeneralLedgerAccountNumber I would have a relation linking to... TOMS-->GeneralLedger-->GeneralLedgerAccountNumber

It would be nice to do something like, with 2 projects....

relations.Add(GenericRevenueEntity.Relations.GeneralLedgerEntityUsingAccountNumber, JoinHint.Left)

If this is possible we would be able to do predicate expression that look for things such as descriptions, accountId's, etc inside the SQL database, when the data we are pulling and filtering is from the Oracle database. Is this possible?

Before we where using a linked server in SQL and create temp tables to achieve this, but performance was horrible so we decided to use 2 domain layer.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 06-Jul-2007 10:52:59   

Before we where using a linked server in SQL and create temp tables to achieve this, but performance was horrible so we decided to use 2 domain layer.

PredicateExpression are translated into WHERE Clauses in a SQL Query. So this won't work out if you are not using a Linked Server.

Instead this issue should be taken care of at the BL level, rather than the database or DAL level. Where you should select values from one database/domain, and use it in a query to the other database/domain.