[DDC-2224] Rewrite instanceof feature with parameter needle ClassMetadata breaks caching of queries.
[DDC-2224] Adjust ClassMetadata processing
Merge branch 'DDC-2224-2' into 2.3