I'm relatively new in Germany. As far as I can remember, the doctors always prescribe the generic drug, but I can't verify because I never keep the prescriptions. Can someone confirm?
Does not really matter a lot what the doctor exactly writes on your prescription, because "aut idem" will not be ticked on the prescription in most cases.
The pharmacy then does most of the work and checks with your insurance which drug manufacturer has a contract with the insurer and hands you the cheapest one. This usually is a generic and you would get that even if the doctor wrote the brand-name one on your prescription.
The doctor can decide to tick "aut idem" and you would get exactly the medication by that exact manufacturer prescribed, but you might have to pay extra at the pharmacy for this so this is really uncommon.