complete rewrite of hasOne and hasMany mapping methods.