In Germany Copyright (Urheberrecht) is always with the original author and can not be sold or given to somebody else. It can be inherited.
One can sell or give permission the right to publish, duplicate, whatever (Verwertungsrecht).
Writing a book on company time and money automatically awards the company the rights to publish, make money, etc.
Writing a book in you spare time with "work related knowledge" might award the company with a claim for buying (at fair value) the publishing rights.
If you write a bestseller on company time you might also be entitled to a compensation in addition to your payrole. (But always best to have a contract beforehand)
But on the whole Germany is in the Berne convention.