QueryStoragePolicy chains the current query on the "storage_policy" edge.
()
| 62 | |
| 63 | // QueryStoragePolicy chains the current query on the "storage_policy" edge. |
| 64 | func (nq *NodeQuery) QueryStoragePolicy() *StoragePolicyQuery { |
| 65 | query := (&StoragePolicyClient{config: nq.config}).Query() |
| 66 | query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { |
| 67 | if err := nq.prepareQuery(ctx); err != nil { |
| 68 | return nil, err |
| 69 | } |
| 70 | selector := nq.sqlQuery(ctx) |
| 71 | if err := selector.Err(); err != nil { |
| 72 | return nil, err |
| 73 | } |
| 74 | step := sqlgraph.NewStep( |
| 75 | sqlgraph.From(node.Table, node.FieldID, selector), |
| 76 | sqlgraph.To(storagepolicy.Table, storagepolicy.FieldID), |
| 77 | sqlgraph.Edge(sqlgraph.O2M, false, node.StoragePolicyTable, node.StoragePolicyColumn), |
| 78 | ) |
| 79 | fromU = sqlgraph.SetNeighbors(nq.driver.Dialect(), step) |
| 80 | return fromU, nil |
| 81 | } |
| 82 | return query |
| 83 | } |
| 84 | |
| 85 | // First returns the first Node entity from the query. |
| 86 | // Returns a *NotFoundError when no Node was found. |
nothing calls this directly
no test coverage detected