Adding support to hasOne and HasMany relational mapping