Auto-register entity and collection caches based on the Hibernate @Cache annotation (XML mapping) settings

Description

While upgrading my Hibernate testing repository to 5.3, I realized that we no longer auto-register the 2nd-level cache for entities and the collections even if those are annotated with the Hibernate @Cache annotation.

I noticed that the Hibernate tests have been modified and we require to register those manually:

Now, if I don't do that, I get the following exception:

However, I don't even use JCache. I use "ehcache" instead.

I'm worried about all those applications trying to upgrade to 5.3. Imagine if they have hundreds of entities and collections. People will surely start complaining if we force them to do that manually during bootstrap. More, I'm not sure how they can do when they just bootstrap via a JPA persistence.xml configuration file.

Environment

None

Assignee

Yoann Rodière

Reporter

Vlad Mihalcea

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Components

Affects versions

Priority

Blocker
Configure