Entity identification through type and name

Solution 1:

You're using the incorrect selector. Try:

tp @e[name="trainer"] ~ ~ ~

It looks for @e, all entities, and name="trainer", with the name trainer (case-insensitive).