QueryParent queries the parent edge of a File.
(f *File)
| 958 | |
| 959 | // QueryParent queries the parent edge of a File. |
| 960 | func (c *FileClient) QueryParent(f *File) *FileQuery { |
| 961 | query := (&FileClient{config: c.config}).Query() |
| 962 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 963 | id := f.ID |
| 964 | step := sqlgraph.NewStep( |
| 965 | sqlgraph.From(file.Table, file.FieldID, id), |
| 966 | sqlgraph.To(file.Table, file.FieldID), |
| 967 | sqlgraph.Edge(sqlgraph.M2O, true, file.ParentTable, file.ParentColumn), |
| 968 | ) |
| 969 | fromV = sqlgraph.Neighbors(f.driver.Dialect(), step) |
| 970 | return fromV, nil |
| 971 | } |
| 972 | return query |
| 973 | } |
| 974 | |
| 975 | // QueryChildren queries the children edge of a File. |
| 976 | func (c *FileClient) QueryChildren(f *File) *FileQuery { |