QueryOwner queries the owner edge of a Event.
(_m *Event)
| 1307 | |
| 1308 | // QueryOwner queries the owner edge of a Event. |
| 1309 | func (c *EventClient) QueryOwner(_m *Event) *AlertQuery { |
| 1310 | query := (&AlertClient{config: c.config}).Query() |
| 1311 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 1312 | id := _m.ID |
| 1313 | step := sqlgraph.NewStep( |
| 1314 | sqlgraph.From(event.Table, event.FieldID, id), |
| 1315 | sqlgraph.To(alert.Table, alert.FieldID), |
| 1316 | sqlgraph.Edge(sqlgraph.M2O, true, event.OwnerTable, event.OwnerColumn), |
| 1317 | ) |
| 1318 | fromV = sqlgraph.Neighbors(_m.driver.Dialect(), step) |
| 1319 | return fromV, nil |
| 1320 | } |
| 1321 | return query |
| 1322 | } |
| 1323 | |
| 1324 | // Hooks returns the client hooks. |
| 1325 | func (c *EventClient) Hooks() []Hook { |