How would I build the relation between the filled structs and the entities?

Should I use an ID stored in a string in the struct and then implement a function getStructByID? Or is there a better way?