QueryOwner queries the owner edge of a Decision.
(_m *Decision)
| 1158 | |
| 1159 | // QueryOwner queries the owner edge of a Decision. |
| 1160 | func (c *DecisionClient) QueryOwner(_m *Decision) *AlertQuery { |
| 1161 | query := (&AlertClient{config: c.config}).Query() |
| 1162 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 1163 | id := _m.ID |
| 1164 | step := sqlgraph.NewStep( |
| 1165 | sqlgraph.From(decision.Table, decision.FieldID, id), |
| 1166 | sqlgraph.To(alert.Table, alert.FieldID), |
| 1167 | sqlgraph.Edge(sqlgraph.M2O, true, decision.OwnerTable, decision.OwnerColumn), |
| 1168 | ) |
| 1169 | fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step) |
| 1170 | return fromV, nil |
| 1171 | } |
| 1172 | return query |
| 1173 | } |
| 1174 | |
| 1175 | // Hooks returns the client hooks. |
| 1176 | func (c *DecisionClient) Hooks() []Hook { |