Created
November 13, 2020 18:20
-
-
Save iundarigun/5e4f00612d02e8316086d075f130f247 to your computer and use it in GitHub Desktop.
TenantDataSource
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TenantDataSource : AbstractRoutingDataSource() { | |
| companion object { | |
| val ctx = ThreadLocal<String>() | |
| fun setClient(client: String) { | |
| ctx.set(client) | |
| } | |
| } | |
| override fun determineCurrentLookupKey(): Any? { | |
| return ctx.get() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment