Pruned old code.
Created a new Connection by downcasting the entity associated with the connection
Changed the iterator so that it will return ConnectionEntityRefImpl objects.