I am glad to announce that the fifth milestone of Cayenne 4.0 has been released and is now available from the download page  and from Maven Central. Some release highlights:
* New fluent API for SQL functions (including long-awaited aggregate functions).
* Auto-loading of additional Cayenne modules.
* New JCache module that allows to easily include any compatible cache provider.
* Further improvements and stabilization of database reverse-engineering tools.
* Fixes bugs, updates docs, etc.
This is another step taking us closer to 4.0 Beta. All the major (and most of the potentially breaking) features are in. While an intermediate M6 release is not entirely out of the question, I think we have been successful so far at fighting against the scope creep that could've delayed the Beta.
Please check out a full release announcement , try M5 and keep giving us feedback.