在我的项目中,我有两个实体:competition
和user
。用户应该能够观看(最喜欢的)比赛。
@Entity
public class Competition
{
@Id
@GenericGenerator(name = "competition_id", strategy = "de.deepsource.jpa.generator.CompetitionIdGenerator")
@GeneratedValue(generator = "competition_id")
private String id;
...
}
@Entity
public class User
{
@Id
private String email;
...
}
我通过competitions
访问所有PagingAndSortingRepository
:
public interface CompetitionRepository extends PagingAndSortingRepository <Competition, String>,
JpaSpecificationExecutor <Competition>
{
}
我通过以下方式获取所有分页结果:
wRep.findAll(spec, pageable)
我现在的问题是:我怎样才能意识到这一点&#34;观看&#34;功能?