well then stop being a shitty employer if you have a problem with people moving on after you train them up. i thought we were into the free market here.
A key question is whether the training is actually worth what’s being charged for it.
The same issue comes up any time a company makes an "investment" in their staff. The bigger the investment, the bigger the incentive to jump ship.
but they don't stay longer. and unfortunately a pleasant work environment doesn't help because juniors don't know yet that other companies are different. it takes working for a few companies before someone learns to value work culture over a higher salary.
finding the right balance is not easy.