A former clothing factory owner has been sentenced to 40 years in jail for enslaving, starving and beating employees.