honor CLASSNAME for foreign keys as well, strip possible spaces from CLASSNAME before using it as a class name
reverted