QueryEntities queries the entities edge of a User.
(u *User)
| 3041 | |
| 3042 | // QueryEntities queries the entities edge of a User. |
| 3043 | func (c *UserClient) QueryEntities(u *User) *EntityQuery { |
| 3044 | query := (&EntityClient{config: c.config}).Query() |
| 3045 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 3046 | id := u.ID |
| 3047 | step := sqlgraph.NewStep( |
| 3048 | sqlgraph.From(user.Table, user.FieldID, id), |
| 3049 | sqlgraph.To(entity.Table, entity.FieldID), |
| 3050 | sqlgraph.Edge(sqlgraph.O2M, false, user.EntitiesTable, user.EntitiesColumn), |
| 3051 | ) |
| 3052 | fromV = sqlgraph.Neighbors(u.driver.Dialect(), step) |
| 3053 | return fromV, nil |
| 3054 | } |
| 3055 | return query |
| 3056 | } |
| 3057 | |
| 3058 | // QueryOauthGrants queries the oauth_grants edge of a User. |
| 3059 | func (c *UserClient) QueryOauthGrants(u *User) *OAuthGrantQuery { |