I want to select date in particular format in multiselect of jpa criteria query like we use
select to_char(tn.dbdate,'yyyy-MM-dd') from transaction tnin oracle.
I am able to use
query.multiselect(cb.function("TO_CHAR",String.class,transaction.get("dbdate")) );
but this returns date in database format i.e.
Wed Apr 2 12:20:50 2014
but how to get this in specific date format
'yyyy-MM-dd'