JPQL to query date / time of bank with hibernate without native query

1

Is there a way to query the database date / time without using active query ?

In Oracle I do this:

 SQLQuery qry = session.createSQLQuery("SELECT SYSDATE FROM dual");  

But I would like a generic query to not price the database.

    
asked by anonymous 17.04.2014 / 19:12

1 answer

1

Try this query:

SQLQuery query = session.createSQLQuery("SELECT CURRENT_DATE");
    
17.04.2014 / 19:53