if ( persister != null && propertyName.equals( propertyPath ) && propertyName.equals( persister.getIdentifierPropertyName() ) ) {
type = persister.getIdentifierType();
}
else { // Otherwise, use the property mapping.
PropertyMapping mapping = getPropertyMapping( propertyName );
type = mapping.toType( propertyPath );
}
if ( type == null ) {
throw new MappingException( "Property " + propertyName + " does not exist in " +
( ( queryableCollection == null ) ? "class" : "collection" ) + " "
+ ( ( queryableCollection == null ) ? fromElement.getClassName() : queryableCollection.getRole() ) );