QueryFiles chains the current query on the "files" edge.
()
| 90 | |
| 91 | // QueryFiles chains the current query on the "files" edge. |
| 92 | func (spq *StoragePolicyQuery) QueryFiles() *FileQuery { |
| 93 | query := (&FileClient{config: spq.config}).Query() |
| 94 | query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { |
| 95 | if err := spq.prepareQuery(ctx); err != nil { |
| 96 | return nil, err |
| 97 | } |
| 98 | selector := spq.sqlQuery(ctx) |
| 99 | if err := selector.Err(); err != nil { |
| 100 | return nil, err |
| 101 | } |
| 102 | step := sqlgraph.NewStep( |
| 103 | sqlgraph.From(storagepolicy.Table, storagepolicy.FieldID, selector), |
| 104 | sqlgraph.To(file.Table, file.FieldID), |
| 105 | sqlgraph.Edge(sqlgraph.O2M, false, storagepolicy.FilesTable, storagepolicy.FilesColumn), |
| 106 | ) |
| 107 | fromU = sqlgraph.SetNeighbors(spq.driver.Dialect(), step) |
| 108 | return fromU, nil |
| 109 | } |
| 110 | return query |
| 111 | } |
| 112 | |
| 113 | // QueryEntities chains the current query on the "entities" edge. |
| 114 | func (spq *StoragePolicyQuery) QueryEntities() *EntityQuery { |
nothing calls this directly
no test coverage detected