There's no need to monitor power failure with a sensor, you can just use an AC relay connected across the mains or a DC relay connected across the output of the AC/DC adapter. Wire the normally-open contact to the plus output of the AC/DC adapter, the normally-closed contact to battery plus, and the relay common to load plus.
Wire the AC/DC adapter minus, battery minus, and load minus together, and you're done.
A caveat: When the relay is switching and the common contact is flying from the NO to the NC contact, (or from NC to NO if the mains come back up while the thing is operating on batteries) there'll be a short time when it's on neither the battery nor the adapter, and there'll be no output to the load, so you need to make sure there's a BFC across the load in order to keep its supply voltage high enough and long enough to keep it (the load) happy during switching.
IgnacioVazquez-Abrams makes a valid point, and if you can live with the voltage drop across the [Schottky] diode OR, that might be the way to go since it'll be a very smooth transition from the AC/DC adapter to the battery and way, way cheaper than with a relay and a BFC.