Code of Civil Procedure CCP § 389
(a) A person who is subject to service of process and whose joinder will not deprive the court of jurisdiction over the subject matter of the action shall be joined as a party in the action if (1) in his absence complete relief cannot be accorded among those already parties or (2) he claims an interest relating to the subject of the action and is so situated that the disposition of the action in his absence may (i) as a practical matter impair or impede his ability to protect that interest or (ii) leave any of the persons already parties subject to a substantial risk of incurring double, multiple, or otherwise inconsistent obligations by reason of his claimed interest. If he has not been so joined, the court shall order that he be made a party.
(b) If a person as described in paragraph (1) or (2) of subdivision (a) cannot be made a party, the court shall determine whether in equity and good conscience the action should proceed among the parties before it, or should be dismissed without prejudice, the absent person being thus regarded as indispensable. The factors to be considered by the court include: (1) to what extent a judgment rendered in the person’s absence might be prejudicial to him or those already parties; (2) the extent to which, by protective provisions in the judgment, by the shaping of relief, or other measures, the prejudice can be lessened or avoided; (3) whether a judgment rendered in the person’s absence will be adequate; (4) whether the plaintiff or cross-complainant will have an adequate remedy if the action is dismissed for nonjoinder.
(c) A complaint or cross-complaint shall state the names, if known to the pleader, of any persons as described in paragraph (1) or (2) of subdivision (a) who are not joined, and the reasons why they are not joined.
(d) Nothing in this section affects the law applicable to class actions.