Welcome to the paradox of Asia. As Tonyaod mentioned - there are just blind ignorant bigots (they hate everyone) and then there are many more moderate Chinese who "hate" foreigners because of their long history of abuse - my family included (we're all US citizens BTW). You all know the story dating from the Opium wars, Japanese invasion, WW2 war crimes (US waived prosecution of most Japanese war criminals as they feared Chinese communism), yellow fever (idolizing Chinese women) etc ad infinitum.
Hong Kong and Macau were severe "in-your-face" examples of concessions from the opium wars. China has a LONG list of recent gripes with abuse at the hands of foreign powers - so despite it's maturing process - the current form of government is to be highly commended for its guidance of the country to date.
Hate results in racism and bigotry (take a look at some of the Yahoo-USA News comments to see classical examples of bigotry and hatred in the USA - it seems to be rampant.
My father went to the University of Nanjing shortly after the end of WW2. As a reminder, the civilian population of Nanjing was decimated by the Japanese during the Japanese occupation (torture, violent executions, bio and chemical experiments on humans) - an obviously heinous war crime - but the USA waived the Nuremburg war trials on that one. So, my father hates Japanese vehemently and was non too plussed with the US response however he offset that with the comment regarding how the USA used it's payment from the Chinese government for opium war reparations (qinghua university). Despite this blanket bigotry, he is always courteous towards my Japanese, American, Spanish, French, etc friends and only has pleasant things to say about them - aka he likes them as individuals.
So, sharing from my family's experience, hatred is caused by vibrant knowledge of recent past history and a wariness and suspicion based on the worst of the worst. It's a hatred or fear of the unknown - but it's usually not personal - once you get past the "get to know the person" phase. Chinese patriots may still hate all foreigners, while simultaneously liking you - hence the paradox. Hope that helps to explain the Asian paradox. It's not personal - just a rather general pervasive sentiment. Please just let it roll over you like water off a duck's back, live your life to the fullest, share your love of life, family, and culture, and revel in the Chinese experience and be careful too because China also has bad people.
And yes, the government sponsors patriotism and nationalism, which inadvertently results in bigotry and its derivatives, as they commemorate dates when they freed the country from various foreign oppression (and to be fair - CERTAIN elements of the USA greatly assisted the Chinese war effort during the Japanese occupation). As you may recall, this got a little out of hand a few years ago, resulting in some rioting and the vandalism of Japanese cars and businesses.
I teach my children somewhat the same thing - but I'm more fair about how I teach my children this philosophy of hatred - however I also show them parallels in Chinese history showing both massive achievements and massive abuses throughout various dynasties - so the general lesson to my children is the world is not a nice place - so they must learn caution in all things - learn how to see and hear through the great wall of BS. I wish the ocean was peaceful - but in reality it's filled with sharks - so just don't be naive.
And yes - as a US citizen - I share a love hate relationship with our government and it's elected and appointed officials. I love the USA and am only be saddened and disappointed when I observe the massive government abuses while the patriots try to return the ship to it's original course from within and without. I completely disagree that democracy should be pushed everywhere - I'm a huge fan of whatever government benefits the people - especially the farmers - and fits in with other global players.
Government should be a subtle benefactor as opposed to an overt tyrant. Many Americans are beginning to reel under the yoke of government oppression, corruption, and abuse. When government officials and servants forget they are there to serve the people...but I digress..
China is still an agrarian based society, the USA is not. Chinese are generally more consumed with pursuing the American dream (house, car, kid, financial security). This can only continue with a strong internal, American, and other foreign economies. China's culture is indeed rich - but China also needs to understand as much as possible other cultures so we can mutually benefit and prosper together.
So please try to understand the Asian paradox (I say Asian because it exists all over Asia) and try to overlook or ignore the "hate" comment and share culture and respect and neutralize hate one family at a time...and maybe make a new friend.