This litigation appears before us for the second time after an intervening journey to the Supreme Court of Georgia. And for the second time, we find that summary judgment was appropriate on the third-party complaint of Kennedy Development (“Kennedy”) against Newton’s Crest Homeowners’ Association (“the NCHA”), and we therefore affirm the judgment of the trial court.
*40The underlying facts are laid out in detail in Newton’s Crest Homeowners’ Assn. v. Camp, 306 Ga. App. 207 (702 SE2d 41) (2010). To summarize, downstream landowners brought the main action against Kennedy Development (“Kennedy’) and others because of stormwater runoff onto their property from the Newton’s Crest subdivision, which was developed by Kennedy. Id. at 209-210. Over a year after suit was filed, and while the litigation was pending, Kennedy by written agreement conveyed all its interest in the subdivision to the NCHA. No evidence was presented that Kennedy notified the NCHA of the pending litigation. See id. at 214-215 (2). The “Assignment and Assumption Agreement” contained an indemnification clause for all claims arising from Kennedy’s development of the property, including those that arose prior to the date of the agreement. Id. at 214-215 (2), n. 5.
Over eight months later, Kennedy brought a third-party complaint against other upstream developers (Oak Ridge Homes, LLC and D. G. Jenkins Development Corporation), the entity that sold Kennedy the property (Tycor, Inc.), and the NCHA. In that complaint, Kennedy’s allegations against the NCHA in their entirety (other than its jurisdictional allegations) were as follows:
11.
Newton’s Crest owns the detention pond at issue in Plaintiffs’ Complaint. Pursuant to the Assignment and Assumption Agreement between Newton’s Crest, and Kennedy, dated April 23, 2007, Newton’s Crest is responsible for the maintenance and repair of the pond. See Exhibit “B.” Moreover, in that agreement, Newton’s Crest agreed to defend andindemnify Kennedy for any claims, actions or damages related to the construction, maintenance, repair or operation of Newton’s Crest Subdivision in the Detention Facility Agreement.
12.
Liability is expressly denied by Kennedy; however, if any finding of liability is made against Kennedy, then Newton’s Crest is liable to Kennedy and Kennedy is entitled to indemnity or contribution from Newton’s Crest for its share of any sum which may be adjudged due and owing from Kennedy to Plaintiffs.
The NCHA moved for summary judgment on Kennedy’s third-party claim, and Kennedy moved for summary judgment on the *41landowners’ claims against it. The trial court denied summary judgment both to Kennedy and to the NCHA, and both appealed.
We affirmed the denial of summary judgment on the main claim, 306 Ga. App. at 212-213 (1), but we reversed the trial court’s denial of summary judgment to the NCHA on Kennedy’s third-party claim, holding that the indemnity provision was void and unenforceable under OCGA § 13-8-2 (b) and that the trial court “erred in denying the NCHA’s motion for summary judgment on Kennedy’s third-party complaint.” Id. at 217 (2) (b). The Supreme Court of Georgia granted certiorari on the limited issue of the application of OCGA § 13-8-2 (b) and affirmed, holding that the Code section applied “to invalidate an indemnification clause within an assignment and assumption agreement transferring responsibility for the management and operation of a newly developed subdivision to its homeowners’ association.” Kennedy Dev. Co. v. Camp, 290 Ga. 257 (719 SE2d 442) (2011).
After the Supreme Court issued its opinion, the remittitur issued, and judgment on the remittitur was entered in favor of the NCHA. Kennedy then filed an amended third-party complaint in the trial court, alleging that the NCHA was liable to it under the theory of “common law indemnity and/or contribution.” The NCHA filed a second motion for summary judgment, asserting that Kennedy’s amended complaint was barred under the theory of res judicata. The trial court agreed that res judicata barred the claim and granted summary judgment.1 This appeal followed.
OCGA § 9-12-40 provides:
A judgment of a court of competent jurisdiction shall be conclusive between the same parties and their privies as to all matters put in issue or which under the rules of law might have been put in issue in the cause wherein the judgment was rendered until the judgment is reversed or set aside.
The doctrine of res judicata prevents the re-litigation of all claims which have already been adjudicated, or which could have been adjudicated, between identical parties or their privies in identical causes of action. Res judicata prevents a plaintiff from instituting a second complaint against a defendant on a claim that has already been brought, after having previously been adjudged not to be entitled to the recovery sought on that claim. Three prerequisites must be satisfied before res judicata applies — (1) identity of the cause of *42action, (2) identity of the parties or their privies, and (3) previous adjudication on the merits by a court of competent jurisdiction.
(Citations, punctuation and footnotes omitted; emphasis supplied.) Waldroup v. Greene County Hosp. Auth., 265 Ga. 864, 865-866 (1) (463 SE2d 5) (1995).
There is no dispute as to the identity of the parties: in both cases Kennedy is the third-party plaintiff and the NCHA is a third-party defendant. With respect to identity of the cause of action, Kennedy’s amended third-party complaint did not change the factual basis of its claim for contribution or indemnity. The new factual allegations against the NCHA repeat almost verbatim those of the original pleading, other than omitting any reference to the void indemnity agreement. And Kennedy’s amended allegation of liability merely inserted the words “common law” into a slightly reworded but identical claim for indemnity or contribution.
A cause of action has been deemed to be “the entire set of facts which give rise to an enforceable claim.” To determine what constitutes each cause of action in the present situation the subject matter and the issues raised by the pleadings in the two cases must be examined.
(Citations omitted.) Crowe v. Elder, 290 Ga. 686, 688 (723 SE2d 428) (2012). In Crowe, the plaintiff’s first suit in probate court attempted to set aside an award of a year’s support, alleging fraud on the part of the widow. Id. at 688. On appeal to superior court, summary judgment was granted and affirmed by this court. Id. at 687, n. 1. The plaintiff then filed a new action for breach of contract based on the same facts, the superior court granted summary judgment on the basis of res judicata, this court affirmed, and the Supreme Court likewise affirmed, observing that the facts pled in the original action were “identical” to those alleged in the second action, and that “[t]he recasting of the same alleged conduct... as breach of contract instead of fraud does not constitute a new or different cause of action.” Id. at 687-689.
In its sole enumeration of error, Kennedy argues that there was no “prior adjudication on the merits” as to its common law indemnity claim, contending that summary judgment was granted only as to its claims under the written indemnity agreement, not as to claims under “common law indemnity,” which it contends were contemplated though not expressly asserted in the original pleadings. This contention is without merit.
*43The NCHA did not move for partial summary judgment, but for “summary judgment against third-party plaintiff’s complaint.” It asserted that there were no genuine issues of material fact and that it was entitled to judgment as a matter of law “against all of third-party plaintiff Kennedy Development’s claims against it.” In Kennedy’s “Response in Opposition to Third-party Defendant Newton’s Crest Homeowners Association’s Motion for Summary Judgment,” it did not challenge the NCHA’s prayer for judgment on all claims against it, characterize the motion as one for partial summary judgment, or raise any contention that the motion addressed fewer than all its claims against the NCHA. It appears that Kennedy’s first mention of any common law indemnity claim was made in its appellee’s brief in the previous appeal. But in the opinion on that appeal, this court observed:
In its third-party complaint, Kennedy does not allege (nor did it present any evidence in the trial court to show) that NCHA did anything to cause or contribute to the Camps’ damages; instead, Kennedy’s contentions regarding NCHA’s potential liability to the Camps are based solely on the Assignment and Assumption Agreement between the parties.
Newton’s Crest, supra, 306 Ga. App. at 213 (1), n. 4.2
[I]n responding to a motion for summary judgment, plaintiffs have a statutory duty to produce whatever viable theory of recovery they might have or run the risk of an adj udication on the merits of their case. Thus, although plaintiffs enjoy considerable leeway in amending the complaint before the entry of a pre-trial order, see OCGA § 9-11-15 (a), plaintiffs who have lost on appeal from a summary judgment ruling are not allowed to return to the trial court and amend the complaint to try a new theory of recovery. As this Court nicely put the point a long time ago, no party, plaintiff or *44defendant, is permitted to stand his case before the court on some of its legs, and if it falls, set it up again on the rest in a subsequent proceeding, and thus evade the bar of the former judgment. Restyling the complaint in terms of a theory of recovery ascertainable in the original case will not revive a cause of action that was defeated on appeal from a summary judgment ruling.Decided May 29, 2013. Hicks, Casey & Foster, Lisa W. Banks, for appellant. Downey & Cleveland, Joshua S. Ruplin, for appellee.
(Citations and punctuation omitted; emphasis supplied.) Smith v. Lockridge, 288 Ga. 180, 186 (4) (702 SE2d 858) (2010) (summary judgment on original complaint seeking to set aside deed on ground of mental incompetence res judicata as to amended complaint seeking to set aside deed on grounds of undue influence, cloud on title, and mistake of fact). Here, Kennedy’s purported new theory of recovery was both ascertainable in its original third-party complaint and ruled on in the grant of summary judgment, and it is therefore barred by res judicata.
Judgment affirmed.
Doyle, P. J., and McFadden, J., concur.The trial court did not reach the NCHA’s alternate contention that common law indemnity does not apply here, and we likewise do not decide that issue.
Kennedy’s argument that this court or the Supreme Court could limit the scope of summary judgment after the fact is without merit. Kennedy contends that the Supreme Court’s amendment of its opinion on motion for reconsideration to add the phrase “to the extent that Kennedy’s third-party claims against the NCHA are premised on this invalid provision,” 290 Ga. at 261, establishes that its common-law indemnity claims were not ruled on by the trial court. But the Supreme Court’s limitation of its ruling to the terms of the indemnity agreement is entirely consistent with the issue articulated in its grant of certiorari: “Did the Court of Appeals err by holding that OCGA § 13-8-2 (b) applies to the contract between Kennedy Development Company, Inc. and the Newton’s Crest Homeowner’s Association, Inc.?” It did not speak to the scope of any other issues raised in the trial court or this court.