The short answer is community commons GetGUID.
The long answer is: think about using generalisation. A, B and C could inherit from G (General) the entity has an association with G.
Edit 1:
You can create an autonumber on A B and C and retrieve the data with that uniqe number. If you want a global unique number use the UUID generator from community commons and store that value in a string. Use that to retrieve the data later and set the association.
Hello Chris. Thanks. It really solves my question!