The court may adjust and determine the equities of all the parties to the action and the order of priority of different liens, and determine all issues raised by any defense or counterclaim in the action. But in no case shall the court determine any issue between the state and the contractor where a claim has been or can be submitted to the court of claims for adjudication and in case a counterclaim is set forth by any defendant in his answer, such defendant shall be deemed to have waived a trial by jury of the issues raised thereby.
N.Y. Lien Law § 45