HHH-9071 When an already initialized proxy is narrowed, initialize the
new proxy (cherry picked from commit
2cf52cc7f1e1d8f918188d5166a3a869fc213cd8)

Conflicts:
	hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java
HHH-9071 - Proxy narrowing loses the initialized state of the original
proxy (cherry picked from commit
c5bdec20b96a1179d70338644d8c2d5f1408001e)

Conflicts:
	hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java
HHH-7971 create regression test case for lazy loading with property ENABLE_LAZY_LOAD_NO_TRANS = true
(cherry picked from commit 30205607efb5b1253bc19ea025800fc9b6493ca8)
HHH-7971 - Enabling ENABLE_LAZY_LOAD_NO_TRANS results in trying to
remove elements in collections (cherry picked from commit
6f342358db3aa5618d60ec69f69f8c6cfb6eb611)

Conflicts:
	hibernate-core/src/main/java/org/hibernate/collection/internal/AbstractPersistentCollection.java
	hibernate-core/src/main/java/org/hibernate/proxy/AbstractLazyInitializer.java
HHH-9078 correct OrderColumn indexes for inverse, extra lazy collections
Conflicts:
	hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java
HHH-8923 - Reconsider closing of ServiceRegistry instances

Conflicts:
	hibernate-core/src/main/java/org/hibernate/boot/registry/internal/BootstrapServiceRegistryImpl.java
	hibernate-core/src/main/java/org/hibernate/boot/registry/internal/StandardServiceRegistryImpl.java
	hibernate-core/src/main/java/org/hibernate/service/internal/AbstractServiceRegistryImpl.java
	hibernate-testing/src/main/java/org/hibernate/testing/junit4/BaseCoreFunctionalTestCase.java
HHH-8923 corrected test case
HHH-8923 corrected test case
HHH-8923 - Reconsider closing of ServiceRegistry instances

Conflicts:
	hibernate-core/src/main/java/org/hibernate/boot/registry/BootstrapServiceRegistryBuilder.java
	hibernate-core/src/main/java/org/hibernate/boot/registry/StandardServiceRegistryBuilder.java
	hibernate-core/src/main/java/org/hibernate/boot/registry/internal/BootstrapServiceRegistryImpl.java
	hibernate-core/src/main/java/org/hibernate/boot/registry/internal/StandardServiceRegistryImpl.java
	hibernate-core/src/main/java/org/hibernate/service/internal/AbstractServiceRegistryImpl.java
	hibernate-core/src/test/java/org/hibernate/connection/ConnectionCreatorTest.java
HHH-9092 QueryBuilderTest.testMultiselectWithPredicates failing on most
databases
HHH-9103 Dialect resolver should use a newer Oracle dialect for
Oracle12c
Conflicts:
	hibernate-core/src/main/java/org/hibernate/engine/jdbc/dialect/internal/StandardDialectResolver.java
HHH-9104 corrected BasicHibernateAnnotationsTest.testFilterOnCollection
test data cleanup
HHH-9104 removing test's o.h.metamodel.* (stale and fails on jdk8)
HHH-9107 throw WrongClassException if attempting to load incorrect
subclass from 2lc
HHH-6747 - ClassCastException when rendering SimpleCaseExpression

Conflicts:
	hibernate-entitymanager/src/main/java/org/hibernate/jpa/criteria/expression/SimpleCaseExpression.java
HHH-4700 - ClassCastException with parameter in
CaseNode.getFirstThenNode() (cherry picked from commit
efa5dc2f6ca1b4f20725e2d58d6afac00dff10b6)

Conflicts:
	hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/Case2Node.java
	hibernate-core/src/main/java/org/hibernate/hql/internal/ast/tree/CaseNode.java
HHH-9100 - Improve CAST function support
(cherry picked from commit 6ffbf8f3f3d22a2e65017e4b6a1717a1297a17b9)

Conflicts:
	hibernate-core/src/main/antlr/hql.g
	hibernate-core/src/main/java/org/hibernate/dialect/function/CastFunction.java
	hibernate-core/src/main/java/org/hibernate/hql/internal/ast/HqlSqlWalker.java
	hibernate-core/src/main/java/org/hibernate/hql/internal/ast/SqlGenerator.java
HHH-9100 - Improve CAST function support
(cherry picked from commit 137c2daf8171a9fb47df58cb119d23c10fddf105)

Conflicts:
	hibernate-core/src/main/java/org/hibernate/hql/internal/ast/SqlGenerator.java
HHH-9100 corrected grammar
4.2.12.Final release