Where did Confucius say that "Yi Di enters China and China becomes China" come from? What is the context?

Confucius said that "when China is invaded by Yi Di, China will take it, and when China is invaded by Yi Di, it will be conquered by Yi Di". At the same time, he also said that "it is not as good as the death of Xia", which emphasizes that Chinese civilization cannot be defeated by barbaric civilization.

Confucius' Spring and Autumn Annals also states that when a vassal uses a foreign ceremony, it is a foreign ceremony. Enter

China, then China. The Confucian Classics said, "It is better to have a monarch than to die in the summer."