We have two cats, Cidie does not appear to know what hamsters are and does not bother them at all. She just purrs and rubs. You can sit one on her back and she does not mind! She is 17 though. Kennedy would, if he could, have one for supper!!
He will sit and stare at them and go all wide eyed and pouncy. We do not keep the hamsters anywhere cats can get into and if they are near them they are supervised. Even if you think the cage is secure a cat could knock it over and dislodge the lid so it is best to keep them separate.