Refactored hasMany and hasOne so that they support cross-DBMS relationship.