Deprecate Environment-scoped settings

Description

org.hibernate.cfg.Environment defines 3 static (and therefore ClassLoader-scoped) settings, meaning that these settings cannot be varied per-SessionFactory if they share the same ClassLoader:

  1. #useStreamsForBinary

  2. #useReflectionOptimizer

  3. #getBytecodeProvider

Ultimately these should all be moved to SessionFactoryOptions / SessionFactoryBuilder. Actually, for #useReflectionOptimizer and #getBytecodeProvider we may have to initially move them to MetadataBuildingOptions as they are used during the building of the Metadata object - that would be a transitory movement though until we can fix the Metadata building process to not require access to them.

Note that simple "deprecate now, but implement the proper way" approach will not work here as the Environment methods would potentially return incorrect information.

Environment

None
Fixed

Assignee

Steve Ebersole

Reporter

Steve Ebersole

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major
Configure