"Happy is the man who has not followed the advice of the wicked, or taken the path of sinners, or joined the company of the insolent; rather, the teaching of the Lord is his delight, and he studies that teaching day and night." The Midrash offers an alternative interpretation of the verse: "Another explanation: 'Happy is the man who does not follow the advice of the wicked.' This refers to the righteous man who did not follow the counsel of the three generations: the generation of Enosh, the generation of the Flood, and the generation of the Dispersion.
According to Rabbi Yehuda, the counsel of the wicked refers to the generation of Enosh, the way of sinners refers to the generation of the Flood, and the seat of scoffers refers to the generation of the Dispersion, who were all scoffers. But those who delight in the teaching of the Lord are those who observe the seven commandments that were given to the descendants of Noah, and study His Torah day and night.
"Why is the righteous man compared to a tree planted by streams of water (Psalm 1:3)? Rabbi Yehoshua ben Levi said that the ark stood in the water for four months like a ship that sails on the water (Genesis 7:24). 'Its fruit in season' (Psalm 1:3) means that all the children born in the ark were born after five hundred years of age. Only Noah was five hundred years old at the time of the Flood (Genesis 5:32).
Rabbi Chiya said in the name of Rabbi Abba that God had stopped up the spring of his (Noah's) loins so that he would not father a son who would be a descendant of the generation of the Flood and would be lost with them. For the heavenly court only punishes those who are descendants of the generation of the Flood. If Noah had a son who was one hundred years old at the time of the Flood, he would have died with them.
Rabbi Shimon ben Lakish said that in the days of the Messiah, the righteous will return to their original form, as it is said, 'For the youth shall die at the age of one hundred years' (Isaiah 65:20). If you say that there were less than one hundred years old during the Flood and they were destroyed, I say that they were punished for the sins of their ancestors, as it is said, 'For all flesh had corrupted its ways' (Genesis 6:12).
Another interpretation: Why did God stop up the spring of Noah's loins? So that he would not father many children who would be destroyed in the Flood. If you say that there were righteous people during the Flood, then why did God not make many arks? Therefore, God stopped up Noah's loins for five hundred years.
'Its leaves never wither' (Psalm 1:3) refers to Ham, 'and whatever he does prospers' (Psalm 1:3) refers to all the wicked."