Deprecation of Hibernate Criteria and how we can still prevent it

I am just now attempting to migrate GORM away from the legacy Hibernate Criteria API and to the JPA 2.0 criteria API.

The JPA 2.0 API is certainly more verbose and less pleasant, although maybe it is better for some other cases I don’t know. However I have larger concerns as we have found limitations on what is possible that we don’t know how to progress forward with. The legacy Criteria API supports the following features which we use in GORM and are not sure how to implement a replacement:

  • Query By Example
  • Restrictions.sqlRestriction method for custom SQL restrictions

How do you suggest we support those features today with JPA 2.0 criteria API?

Regarding the extension, does that mean the legacy API is not going to be removed in 6.0 or it is going to be removed? If it is to be removed, will replacements for the above be put in place before then?