QueryFile queries the file edge of a Entity.
(e *Entity)
| 743 | |
| 744 | // QueryFile queries the file edge of a Entity. |
| 745 | func (c *EntityClient) QueryFile(e *Entity) *FileQuery { |
| 746 | query := (&FileClient{config: c.config}).Query() |
| 747 | query.path = func(context.Context) (fromV *sql.Selector, _ error) { |
| 748 | id := e.ID |
| 749 | step := sqlgraph.NewStep( |
| 750 | sqlgraph.From(entity.Table, entity.FieldID, id), |
| 751 | sqlgraph.To(file.Table, file.FieldID), |
| 752 | sqlgraph.Edge(sqlgraph.M2M, true, entity.FileTable, entity.FilePrimaryKey...), |
| 753 | ) |
| 754 | fromV = sqlgraph.Neighbors(e.driver.Dialect(), step) |
| 755 | return fromV, nil |
| 756 | } |
| 757 | return query |
| 758 | } |
| 759 | |
| 760 | // QueryUser queries the user edge of a Entity. |
| 761 | func (c *EntityClient) QueryUser(e *Entity) *UserQuery { |