Cave adaptation is a condition that happens to your dwarves after spending too much time underground. It is unclear as to how much time without sunlight causes cave adaptation, and there is no way to tell if a dwarf has cave adaptation simply by looking at their various stats.
When a dwarf with cave adaptation goes outside, the dwarf will gain one of two negative thoughts. If the dwarf has mild cave adaptation, he will gain the thought 'irritated by the sun recently', and suffer no other effects. A dwarf with serious cave adaptation will gain the thought, 'nauseated by the sun recently' and will vomit all over the ground. While vomiting a dwarf is unable to defend himself, which can be a problem during combat. A dwarf with cave adaptation may end up with a stun status when exposed to the sun.
A dwarf with the description, 'likes working outdoors and grumbles only mildly at inclement weather' is no more resistant to cave adaptation than a regular dwarf is - in fact, said dwarf may even have cave adaptation.
Fortunately, cave adaptation is not a serious issue. The unhappy thought from serious cave adaptation is strong (strong enough to totally negate the "slept in a room like a personal palace" happy thought), and can easily push already unhappy dwarves over the edge, but it is very controllable. Setting up a meeting area outside and above ground with items that cause powerful happy thoughts helps: very valuable statues are the best bet here. Be sure to wall it in or otherwise protect it so the area is not a liability during a siege (and don't forget flying creatures). Cave-adapted dwarves will come out, admire the items in the meeting area, get a happy thought, then vomit all over themselves. If you do it right, you roughly break even.
Prolonged, regular exposure to sunlight WILL cure cave adaptation, so this technique could be considered a controlled catharsis. Dwarves who vomit all the time don't seem to get hungry any faster.
If your trade depot is outside, cave adaptation can create the amusing scene of thirty dwarves carrying goods to the depot all emerging and throwing up at once. Fortunately, the merchants seem to take this in stride, and it doesn't seem to negatively affect negotiations.
 Preventing and curing cave adaptation
The easiest way to deal with cave adaptation is not to go outside at all. On most maps this is quite manageable, e.g. with traders bringing enough wood, making bolts from your own cattle (no hunting), et cetera.
Curing and prevention of cave adaptation are achieved through the same means: regular, extended exposure to outdoor sunlight. Indoor sunlight will not treat cave adaptation, nor will it trigger the ill effects. An outdoor area to fight cave adaptation may be accomplished by having a meeting area or statue garden exposed to sunlight, with no roof. An armor stand or weapon rack placed outside in the same manner and made into a barracks for sparring will prevent cave adaptation in your military and is highly recommended, as constantly vomiting champions aren't particularly useful during combat.
If you build your fortress in entirely above-ground areas, your dwarves will never become cave-adapted in the first place - if you start them off underground and then move them to the surface, they will vomit as they get used to the sunlight, but living in constructed surface buildings (or even a cast obsidian tower) will not cause them to relapse.
Occasional or brief exposures to sunlight cannot prevent cave adaptation, though it will still make them suffer; negative thoughts cannot be prevented in those who suffer cave adaptation, but can be treated with a really, really awesome dining room.
If all else fails, simply give up on the outside world and have your dwarves spend the rest of your fortress's life lurking in the bottom of a dark cave gnawing on a cold plump helmet.
You can also cure cave adaptation by cheating, and just removing the tag from the dwarves' RAW files. Under "creature_standard.txt", remove the [CAVE_ADAPT] line and save.
 Proper Perspective
|This article or section has been rated D for Dwarf. It may include witty humour, not-so-witty humour, bad humour, in-jokes, and references to the Bay12 forums. Don't believe everything you read, and if you miss some of the references, don't worry.|
Dwarven philosophers have pointed out that this odd human labeling misconceives an advantage for a problem and that in fact "sun adaptation" is rather something to worry about. Blinding and losing control over bowel movements is nothing but a strong and appropriate warning signal from exposing the so-amazingly-adapted dwarven eye to the piercing sunlight. More so, since there is no good reason for exposing oneself to the various uncontrollable surface dangers in the first place. Does not the best wood come from tower caps? How can one spend "too much" time underground? How is the dwarven adaptation to its natural environment (which is, by the way, a birth gift, not acquired) objectionable? Is it the human eye that picks out the greatest gems from inconspicuous rock? Or, in the words of Zuglares: "Does even a human look into the sun?" Did not the great poet Uristophanes say "Is there ore? Is there gem? Is there proper rock? Does the purple one spread its shield? What are you longing for, clouded mind?"
Pragmatically put, dwarves belong inside, buildings belong inside, if it means showing traders our great halls, all the better. If one lusts after strange surface crops, there are other ways. A true dwarf strives for his own tree farm. The hunter's fate is that of a pitiful outcast, sacrificing his sanity to serve his home. Who misses the petty glowball when one can admire legendary halls and artwork? Give the surface what it deserves - your refuse.