#customquery #JPQL

I am trying to Implement a scenario . I have stored user name, emails and Password expiry date in my Database.
Now Bonita process will Search the Database and for those where the Expiry date is 15 days from current date, the Application will send an email to User notifying about the Expiry date.

Please help in implementing this.
1) Could we use a JPQL query to return a List of Dates ? But we cannot assign this output to Process variable. Nor can we assign the output to BDM Object variable.

SELECT c
FROM CarProperties c
WHERE
(c.pDateTime = :pDateTime or :pDateTime is NULL)
and (c.driverName like '%'||:driverName||'%' or :driverName is NULL)
ORDER BY c.persistenceId ASC

this work in BonitaStudioTomcat and H2 DB
But dont work in Tomcat bundle and PostgreSQL and raise Error :
org.bonitasoft.engine.commons.exceptions.SRetryableException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet

But now I want to get my table filled not with items via one filter, but with two.
So the actual code looks like this and its working:
../API/bdm/businessData/com.company.model.ManuskriptEinsenden?q=findByUserAndStatus&p=0&c=10&f=userId={{session.user_id}}&f=status=abgelehnt