HHH-9190 : consolidate contracts

(cherry picked from commit fbe72e7b641fba2c95ce0b8867e080fb7e52613d)

Conflicts:
	hibernate-core/src/main/java/org/hibernate/engine/query/spi/ParameterMetadataRecognizerInitiator.java
HHH-9138 - CastFunctionTest failing on most databases

(cherry picked from commit c012c4d8de9aa68f42fed067184d2520594013d5)
add test case with three-level derived identities
add a test case with column name overrides
extract method
adds support for nested derived identities

(if they use default column names; not sure if this works with overridden names)
link the join column

(so that it can be found later via mappings.getLogicalColumnName())
make sure CopyIdentifierComponentSecondPasses run in the correct order