Originally posted by **jukanntenn** October 8, 2022
This is the example from official docs [Handling Custom Selects](https://www.sea-ql.org/SeaORM/docs/advanced-query/custom-select/#handling-custom-selects)
```rust
use sea_orm::{FromQueryResult, JoinType, RelationTrait};
use sea_query::Expr;
#[derive(FromQueryResult)]
struct CakeAndFillingCount {
id: i32,
name: String,
count: i32,
}
let cake_counts: Vec = cake::Entity::find()
.column_as(filling::Column::Id.count(), "count")
.join_rev(
// construct `RelationDef` on the fly
JoinType::InnerJoin,
cake_filling::Entity::belongs_to(cake::Entity)
.from(cake_filling::Column::CakeId)
.to(cake::Column::Id)
.into()
)
// reuse a `Relation` from existing Entity
.join(JoinType::InnerJoin, cake_filling::Relation::Filling.def())
.group_by(cake::Column::Id)
.into_model::()
.all(db)
.await?;
```
Then I also want to apply cursor pagination to the query, but `into_model` returns a `Selector` struct and `cursor_by` returns a `Cursor` struct. It seems they can not be used together or do I miss something?
Discussed in https://github.com/SeaQL/sea-orm/discussions/1101