Well I would say that unless the cat and hamster grew up together since birth with constant contact and no food availability stress, then the cat would see the hamster as a potentially delicious...
It would be very hard, your best bet is just to keep them far apart from each other.
A cat could eat a hamster if it felt like it. I strongly suggest keeping the hamster away from the cat and the cat away from the hamster:/
I think its the other way around