| Assuming that we want to call the NOW() database function from an entity query. If we write the query like this:
Date now = entityManager.createQuery(
"select FUNCTION('now') " +
"from Event " +
"where id = :id", Date.class)
.setParameter( "id", 1L )
.getSingleResult();
We get the following exception thrown:
If we provide a comma:
Date now = entityManager.createQuery(
"select FUNCTION('now',) " +
"from Event " +
"where id = :id", Date.class)
.setParameter( "id", 1L )
.getSingleResult();
It works fine. However, according to JPA specs, the BNF is:
|