add unit test and fix for NH-3614

when getting the identifier in the selectrewiter it was returning a null constant when there was no class metadata, as it the case for type string
Merge branch 'MattsGitCode-NH-3614' into 3.4.x