add methods for setting up hasMany and hasJoin relations.