The JPA does not define such functions in JPQL, so EclipseLink does not currently support them.
See,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=219814EclipseLink does have support for several related date functions and user defined functions through Expression queries. You can create Expression queries using JpaEntityManager.createQuery(Expression, Class) or using a SessionCustomizer to add named ReadAllQuery's to the Session (and execute as normal JPA NamedQuery's).
EclipseLink does not have a month() function, but depending on your database platform you may be able to use,
- datePart(part)
- dateName(name)
- toChar(format)
or,
- getFunction(sqlFunction)
Gustav Trede-2 wrote:
Hello,
how do i implement support for the sql month( timestamp ) and
week(timestamp) for JPA queries?
regards
gustav