QueryStoragePolicy chains the current query on the "storage_policy" edge.
()
| 110 | |
| 111 | // QueryStoragePolicy chains the current query on the "storage_policy" edge. |
| 112 | func (eq *EntityQuery) QueryStoragePolicy() *StoragePolicyQuery { |
| 113 | query := (&StoragePolicyClient{config: eq.config}).Query() |
| 114 | query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { |
| 115 | if err := eq.prepareQuery(ctx); err != nil { |
| 116 | return nil, err |
| 117 | } |
| 118 | selector := eq.sqlQuery(ctx) |
| 119 | if err := selector.Err(); err != nil { |
| 120 | return nil, err |
| 121 | } |
| 122 | step := sqlgraph.NewStep( |
| 123 | sqlgraph.From(entity.Table, entity.FieldID, selector), |
| 124 | sqlgraph.To(storagepolicy.Table, storagepolicy.FieldID), |
| 125 | sqlgraph.Edge(sqlgraph.M2O, true, entity.StoragePolicyTable, entity.StoragePolicyColumn), |
| 126 | ) |
| 127 | fromU = sqlgraph.SetNeighbors(eq.driver.Dialect(), step) |
| 128 | return fromU, nil |
| 129 | } |
| 130 | return query |
| 131 | } |
| 132 | |
| 133 | // First returns the first Entity entity from the query. |
| 134 | // Returns a *NotFoundError when no Entity was found. |
nothing calls this directly
no test coverage detected