I'm dealing with some legacy vendor code that I can't modify. I'd like
to wrap the database with an abstraction layer that is easier to use.

Given the following two tables, I need to create a mapping for
Process.Route that will find the matching Route for a given Process,
but that can be either dbo.Route.SourceProcessID or
dbo.Route.DestinationProcessID:

TABLE [dbo].[Route](    [RouteID] [bigint] IDENTITY(1,1) NOT NULL,
[SourceProcessID] [bigint] NOT NULL,    [DestinationProcessID]
[bigint] NOT NULLTABLE [dbo].[Process](    [ProcessID] [bigint]
IDENTITY(1,1) NOT NULL)

The SQL would be
SELECT p.*, r.*
FROM dbo.Process p
JOIN dbo.Route r ON (p.ProcessID = r.DestinationProcessID OR
p.ProcessID = r.SourceProcessID)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to