"It happened with King Jehoiachin, of whom it is written: 'Thus says the Lord, Write this man childless.' When he fell into the hands of the wicked Nebuchadnezzar, he was imprisoned, and all of Israel was distressed, saying, 'This is what remains of the House of David. Now he will die childless.' They were so distressed that they approached an old woman and gave her a litra of gold to persuade the king's wife on Jehoiachin's behalf. When Nebuchadnezzar desired his wife, she told him, 'Be patient for a moment and know that the King of Israel is imprisoned. Go and see how much he endures, and how he might die without offspring.' Immediately, the king was appeased and ordered a maiden to be brought to Jehoiachin. However, when Jehoiachin approached her, she told him she was menstruating. He immediately refrained from being with her, being cautious about the laws of Niddah (menstruation). God saw this and annulled the decree against him, as it is said, 'As I live, says the Lord, even though Jehoiachin, the son of Jehoiakim, were the signet ring on My right hand.' After the maiden had immersed herself in a mikveh (ritual bath), he was with her, and she bore him a child, as it says, 'And the sons of Jehoiachin, the son of Jehoiakim, were Assir and Shealtiel.' Assir, for he was imprisoned. And it says, 'Zerubbabel, the son of Shealtiel.' Wasn't his name Nehemiah? Rather, he was conceived in Babylon, and God preserved the seed of David through Jehoiachin because he was cautious about the laws of Niddah. He merited greatness, as it is said, 'In the thirty-seventh year of the exile of Jehoiachin.' (See Pesiḳta of Rav Kahana 163a, Buber edition, Leviticus Rabbah Chapters 10 and 19, and the Complete Talmudic Dictionary, page 930)."