EJB QL How to find most recent date?
Hi all,
I have a trouble here while trying to find most recent date register from my table.
Here goes my finder method:
public Project findLastCreated()throws RemoteException{
String ejbQl ="select max(p.creationDate) from Project p";
Project result = entityManager.createQuery(ejbQl).getSingleResult();
return result;
}
When running this method it gives me an exception because something about timestamp.
The database is MySql and the field "CREATION_DATE" is "DATETIME" type. Anyone can help me? How can I find the most recent date register using EJB QL?
Regards,
Fabricio Braga

