Unfortunately, I am afraid that there is no way to map your association scenario out-of-the-box with OpenAccess or any other general-purpose ORM product to my knowledge. The bottom line here is that you need a conditional statement to be executed on the database server when you try to load a referenced object. That statement should check if there is row with version equal to the current one otherwise return the object with version equal to 0.
Here is how the association resolution works with OpenAccess: There is metadata telling us which is the foreign key column(s) that hold the information about the referenced row in the database. When you try to load a referenced object, OpenAccess checks if there is a row in the referenced table that has its Primary Key column with the value of your foreign key. If no such row is found NULL is returned(or exception is thrown depending on the configuration). In your case, you have composite primary key. If you map only the first part of the primary key(PipeId) in the association, you will always get the first row in the database that has PipeId(in pipes table) = PipeId (in Demands table) which means you will always get the Pipe object with Version=0.
the Telerik team
Follow @OpenAccessORM Twitter channel to get first the latest updates on new releases, tips and tricks and sneak peeks at our product labs!