Hi - my name is XXXXX XXXXX I'm a litigation
attorney. Thanks for your question. I'll be glad to assist.
An ex parte hearing means that it is one-sided or for the benefit of one party, and usually the relief is allowed regardless of an objection from a party. In this case, the motion is ex parte because the lawyer is requesting to be relieved of his obligation to represent you. Also, these motions are generally granted as long as it will not be unreasonably detrimental to the clients.
In this case, the fact that you've been working together for 4 years is a big issue, and you certainly could tell the judge that if he's allowed out of the case, that you'll have to start over with a new lawyer. However, if you are not set for trial within the near future, and if there's a reasonable chance that a new attorney could get up to speed reasonably quick, it is likely that a judge would allow the lawyer to withdraw.
As for tomorrow, the attorney will tell the judge why he wants to withdraw, and then you would be allowed to speak and tell your side. this is when you can emphasize the length of representation
and the potential hardship it would cause.
The judge certainly could order the attorney to stay in the case, but that's rare, and the more likely result is going to be that the lawyer will be allowed to withdraw and you'll be given a period of time to find a new lawyer -- probably a month or two.