DetachedCriteria with SubqueryExpression criterion are not serializable as intended

Description

By design, DetachedCriteria are intended to be serializable and this is something we have been leveraging in our result paging system for years. We are now hitting an issue when adding subqueries to the detached criteria where our session replication breaks on the serialization attempt.

In contrast to the rest of the DetachedCriteria object graph, the following classes are not serializable:

Instances of these can be present inside of any SubqueryExpression instance, which is connected to a DetachedCriteria as follows:

An example criteria that ends up with a PropertySubqueryExpression in that List:

Environment

Hibernate 4.3.4, MySQL 5.5

Assignee

Unassigned

Reporter

Josh Landin

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure