I am going throught this similarly with my two step-sons, who are 5 and 6. I never encountered a teacher that responded to them the way your daughter's teacher did, though, and I agree with another mom's comments that you need to nip it in the bud. I think that teachers are use to a lot of parents not being parents and so they take on that role as well. You need to let the teacher know that you felt her response to your child was innapropriate and why you felt so, as well as let her know how you would like her to address your daughter's whining in the future. Your daughter's teacher has to do her job of teaching and the whining may be an obstacle to that, but as a Kindergarten teacher, she should know better than to engage in that level of behavior with a child.
As far as the whining itself goes, different things work for different children. For our older boy, simply telling him "You are whining, say it again without whining" And occasionally mimicing him as an example of what "whining" sounds like, so he could understand the difference in how he was expressign himself was all it took. A few reminders to simple "say it again without whining" and he got over it, with a few relapses. Now, our younger boy, 5, never had a problem with whining until recently. He has always been easily defeated, if he can't do it 'right' the first time without any effort, then he gives up. but recently this defeat has been causing him to collapse into tears and sometimes tantrums. Understandably so as he has gone through a lot of changes in his short life some of which are very confusing to anyone, let alone a 5 year old. But we are trying to give him the tools to address his frustation appropriately.
A good tool that we use is the catch phrase of Dory from "Finding Nemo". She swims around saying "Just keep swimming, just keep swimming" We tell him lightheartedly to "just keep tying, just keep tying" If he is tying his shoes for the 7th time that day, or to "just keep . . ." whatever. It helps him to "lighten up" and forget how upset he was and to keep trying. We remind him that he doesn't have to do it perfectly the first time and give im examples of how we struggle to 'get it right' when we do things as well. It seems to be working as the breakdowns are less often and less severe. And his older brother loves to join in and help to remind him of what Dory says.