Skip to content

Commit

Permalink
Bugfix for issue objectbox#45: objectbox-go generator can not handle …
Browse files Browse the repository at this point in the history
…a struct with multiple lazy loaded relations
  • Loading branch information
nick-dijkshoorn authored Aug 24, 2023
1 parent 050f106 commit ff2276a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/generator/go/templates/binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ func ({{$entityNameCamel}}_EntityInfo) PutRelated(ob *objectbox.ObjectBox, objec
if err := BoxFor{{$field.Entity.Name}}(ob).RelationReplace({{.Entity.Name}}_.{{$field.Name}}, id, object, object.(*{{$field.Entity.Name}}).{{$field.Path}}); err != nil {
return err
}
{{if $field.IsLazyLoaded}} } {{end}}
{{if $field.IsLazyLoaded}} }
{{end}}
{{- else if $field.Property}}
{{- if and (not $field.Property.IsBasicType) $field.Property.ModelProperty.RelationTarget}}
if rel := {{if not $field.IsPointer}}&{{end}}object.(*{{$field.Entity.Name}}).{{$field.Path}}; rel != nil {
Expand Down

0 comments on commit ff2276a

Please sign in to comment.