"fabriciobraga" wrote : Hi all,
|
| I have a trouble here while trying to find most recent date register from
my table.
|
| Here goes my finder method:
|
| anonymous wrote :
| | 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
replace
Project result = entityManager.createQuery(ejbQl).getSingleResult();
witn
Date date = (Date)entityManager.createQuery(ejbQl).getSingleResult();
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3919755#3919755
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3919755
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user