QueryOwner chains the current query on the "owner" edge.
()
| 70 | |
| 71 | // QueryOwner chains the current query on the "owner" edge. |
| 72 | func (_q *AlertQuery) QueryOwner() *MachineQuery { |
| 73 | query := (&MachineClient{config: _q.config}).Query() |
| 74 | query.path = func(ctx context.Context) (fromU *sql.Selector, err error) { |
| 75 | if err := _q.prepareQuery(ctx); err != nil { |
| 76 | return nil, err |
| 77 | } |
| 78 | selector := _q.sqlQuery(ctx) |
| 79 | if err := selector.Err(); err != nil { |
| 80 | return nil, err |
| 81 | } |
| 82 | step := sqlgraph.NewStep( |
| 83 | sqlgraph.From(alert.Table, alert.FieldID, selector), |
| 84 | sqlgraph.To(machine.Table, machine.FieldID), |
| 85 | sqlgraph.Edge(sqlgraph.M2O, true, alert.OwnerTable, alert.OwnerColumn), |
| 86 | ) |
| 87 | fromU = sqlgraph.SetNeighbors(_q.driver.Dialect(), step) |
| 88 | return fromU, nil |
| 89 | } |
| 90 | return query |
| 91 | } |
| 92 | |
| 93 | // QueryDecisions chains the current query on the "decisions" edge. |
| 94 | func (_q *AlertQuery) QueryDecisions() *DecisionQuery { |
nothing calls this directly
no test coverage detected