compute foreign key select string at class finalization