Hi,
Firstly, i use hibernate search 6.
I would like to use hibernate search on a JPA Query.
My query return a List, not Entity, and every time return different results.
default List<HelperDTO> getHelperDTO(final List<BigInteger> ids, final EntityManager entityManager) {
final QObjectA objectA = QObjectA .objectA;
final QObjectB objectB= QObjectB .objectB;
final JPAQuery<HelperDTO> query = new JPAQuery<>(entityManager);
return query.select(new QHelperDTO (objectA.id, objectA.firstname, objectA.lastname, objectB.id, objectB.firstname, objectB.lastname))
.from(objectB)
.innerJoin(objectA).on(objectB.objectA.id.eq(objectB.id))
.where(objectA.id.in(ids))
.fetch();
}
public class HelperDTO {
private BigInteger objectAId;
private String objectAFirstname;
private String objectALastname;
private BigInteger objectBId;
private String objectBFirstname;
private String objectBLastname;
}
Is it possible to use hibernate search on HelperDTO.class ? I think that it is not:grin:.
Thank you!