ذُو مَالٍ — ذَا مَالٍ — ذِي مَالٍ
Translation: a person possessing wealth, in three grammatical cases.
جَاءَ ذُو مَالٍ.
Translation: A wealthy person came. «ذُو» is the nominative subject marked by wāw.
رَأَيْتُ ذَا مَالٍ.
Translation: I saw a wealthy person. «ذَا» is the accusative object marked by alif.
مَرَرْتُ بِذِي مَالٍ.
Translation: I passed by a wealthy person. «ذِي» is genitive, marked by yāʾ.
In all three, «مَالٍ» is the genitive second term of iḍāfa. Here «ذُو» means possessor, not the demonstrative «ذَا».