QueryEntities chains the current query on the "entities" edge.
()
| 112 | |
| 113 | // QueryEntities chains the current query on the "entities" edge. |
| 114 | func (spq *StoragePolicyQuery) QueryEntities() *EntityQuery { |
| 115 | query := (&EntityClient{config: spq.config}).Query() |
| 116 | query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { |
| 117 | if err := spq.prepareQuery(ctx); err != nil { |
| 118 | return nil, err |
| 119 | } |
| 120 | selector := spq.sqlQuery(ctx) |
| 121 | if err := selector.Err(); err != nil { |
| 122 | return nil, err |
| 123 | } |
| 124 | step := sqlgraph.NewStep( |
| 125 | sqlgraph.From(storagepolicy.Table, storagepolicy.FieldID, selector), |
| 126 | sqlgraph.To(entity.Table, entity.FieldID), |
| 127 | sqlgraph.Edge(sqlgraph.O2M, false, storagepolicy.EntitiesTable, storagepolicy.EntitiesColumn), |
| 128 | ) |
| 129 | fromU = sqlgraph.SetNeighbors(spq.driver.Dialect(), step) |
| 130 | return fromU, nil |
| 131 | } |
| 132 | return query |
| 133 | } |
| 134 | |
| 135 | // QueryNode chains the current query on the "node" edge. |
| 136 | func (spq *StoragePolicyQuery) QueryNode() *NodeQuery { |
nothing calls this directly
no test coverage detected