Based on what you've written, you're going to use the car for a long time and care not for resale value.
Get the Camry na. Pag lumuma yung kotse, wala na ring magsasabi na "O Porma ng car mo." What is important is hassle-free reliability.
I'm not saying that the Sonata and the Optima are less reliable than the Camry. But what's sure is that the platform under the current Camry is a modified variant of the 2007 Camry platform - which means any major issues should already have been resolved already. That, and Toyota has a better track record with the Camry than Hyundai and Kia have with the Sonata and Optima. (Not that the track record accounts for much given you're comparing past vs present, but the fact that they've been doing better for longer amounts to something.)
Although -- Why are you looking at the Sonata Premium and not the Camry V? Halos same price range na rin yun. You get the leather seats too.