Here is my JPQL query:
SELECT p,
exists( select dp from DocumentPublication dp where dp.documentVersion = p)
FROM
DocumentVersion p where document.id = :id
Here is the code to get the result:
Query query =
getEntityManager().createNamedQuery("DocumentVersion.findByDocumentId");
query.setParameter("id", docsFilter.getProjectId());
List<Object[]> res;
try
{
res = query.getResultList();
}
catch (NoResultException e)
{
return null;
}
// res only contains a list of DocumentVersion / No 'boolean'
I want to retrieve the list of results but when I perform a "getResultList" on my query, I only see the first part of the select ( a list of DocumentVersion), I don't see the boolean that I would like to get.
I am using one of the latest hibernate version as a pesistence provider.
Thank you.