QueryEntities queries the entities edge of a StoragePolicy.
(sp *StoragePolicy)
| 2611 | |
| 2612 | // QueryEntities queries the entities edge of a StoragePolicy. |
| 2613 | func (c *StoragePolicyClient) QueryEntities(sp *StoragePolicy) *EntityQuery { |
| 2614 | query := (&EntityClient{config: c.config}).Query() |
| 2615 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 2616 | id := sp.ID |
| 2617 | step := sqlgraph.NewStep( |
| 2618 | sqlgraph.From(storagepolicy.Table, storagepolicy.FieldID, id), |
| 2619 | sqlgraph.To(entity.Table, entity.FieldID), |
| 2620 | sqlgraph.Edge(sqlgraph.O2M, false, storagepolicy.EntitiesTable, storagepolicy.EntitiesColumn), |
| 2621 | ) |
| 2622 | fromV = sqlgraph.Neighbors(sp.driver.Dialect(), step) |
| 2623 | return fromV, nil |
| 2624 | } |
| 2625 | return query |
| 2626 | } |
| 2627 | |
| 2628 | // QueryNode queries the node edge of a StoragePolicy. |
| 2629 | func (c *StoragePolicyClient) QueryNode(sp *StoragePolicy) *NodeQuery { |