QueryMetadata queries the metadata edge of a File.
(f *File)
| 990 | |
| 991 | // QueryMetadata queries the metadata edge of a File. |
| 992 | func (c *FileClient) QueryMetadata(f *File) *MetadataQuery { |
| 993 | query := (&MetadataClient{config: c.config}).Query() |
| 994 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 995 | id := f.ID |
| 996 | step := sqlgraph.NewStep( |
| 997 | sqlgraph.From(file.Table, file.FieldID, id), |
| 998 | sqlgraph.To(metadata.Table, metadata.FieldID), |
| 999 | sqlgraph.Edge(sqlgraph.O2M, false, file.MetadataTable, file.MetadataColumn), |
| 1000 | ) |
| 1001 | fromV = sqlgraph.Neighbors(f.driver.Dialect(), step) |
| 1002 | return fromV, nil |
| 1003 | } |
| 1004 | return query |
| 1005 | } |
| 1006 | |
| 1007 | // QueryEntities queries the entities edge of a File. |
| 1008 | func (c *FileClient) QueryEntities(f *File) *EntityQuery { |