QueryFiles queries the files edge of a StoragePolicy.
(sp *StoragePolicy)
| 2595 | |
| 2596 | // QueryFiles queries the files edge of a StoragePolicy. |
| 2597 | func (c *StoragePolicyClient) QueryFiles(sp *StoragePolicy) *FileQuery { |
| 2598 | query := (&FileClient{config: c.config}).Query() |
| 2599 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 2600 | id := sp.ID |
| 2601 | step := sqlgraph.NewStep( |
| 2602 | sqlgraph.From(storagepolicy.Table, storagepolicy.FieldID, id), |
| 2603 | sqlgraph.To(file.Table, file.FieldID), |
| 2604 | sqlgraph.Edge(sqlgraph.O2M, false, storagepolicy.FilesTable, storagepolicy.FilesColumn), |
| 2605 | ) |
| 2606 | fromV = sqlgraph.Neighbors(sp.driver.Dialect(), step) |
| 2607 | return fromV, nil |
| 2608 | } |
| 2609 | return query |
| 2610 | } |
| 2611 | |
| 2612 | // QueryEntities queries the entities edge of a StoragePolicy. |
| 2613 | func (c *StoragePolicyClient) QueryEntities(sp *StoragePolicy) *EntityQuery { |