A primary school teacher has been sentenced to 10 years in prison for abusing his position of authority to engage in a romantic relationship with his student.