This is the law in Germany, because we have the conscript army. Nobody can, for example, hire a guy, send him to the reservists, and then kick him out. That is not allowed; it is regulated by law.
Also, he must be taken over for at least one year. His job is secure. In the case that the firm he has worked for breaks down, we will also see that he gets an additional job to suit his qualifications. Therefore, we have a special service in our forces to help those guys.