У меня есть класс сущности, как показано ниже:
@Entity
public class UserDemo implements Serializable {
@Id
private Long id;
private String username;
private String createdBy;
@Version
private int version;
/***
*
* Getters and setters
*/
}
Используя Spring Data JPA и Querydsl, как я могу получить страницу UserDemo только с заполненными свойствами id
и username
? Мне нужно использовать подкачку, а также поиск. Короче говоря, я хотел бы достичь того же результата, что и
Page<UserDemo> findAll(Predicate predicate, Pageable pageable);
но с ограниченным полем UserDemo.