Commit 6b22881d authored by ElyKar's avatar ElyKar
Browse files


parent 035dd439
Pipeline #300 failed with stage
package mgdb
import "reflect"
// Selector allow a user to build a selector like an struct
type Selector struct {
factory *MetadataFactory // The MetadataFactory for getting nested metadata
......@@ -27,7 +25,7 @@ func (s *Selector) AddChild(name string) *Selector {
nestedType, ok := s.metadata.Nested[name]
mapped, _ := s.metadata.Mapping[name]
if ok {
selector := NewSelector(s.factory, factory.Metadata(reflect.New(nestedType).Interface()), s)
selector := NewSelector(s.factory, s.factory.metadatas[nestedType], s)
s.maps[mapped] = selector.childs
s.childs[mapped] = selector
return selector
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment