blob: e66cafcd1e58c32d6a4f3f23e4de760a1b406b5f [file] [log] [blame]
===== Purpose
Allows switching which database to use to persist for the domain class for the scope of the current session (connection).
===== Examples
[source,java]
----
Book.useDatabase("non-fiction")
----
===== Description
The `useDatabase` method allows switching, at runtime, the database used persist and retrieve domain classes. The `DB` property will return the current database being used. Note that the method switches the database used for the scope of the current session/connection (ie. it is not permanent). If you wish to permanently change the database used then you need to configure the mapping of the domain class.