Skip to content

Commit

Permalink
rename CarRoutingDataSource to TenantRoutingDataSource
Browse files Browse the repository at this point in the history
  • Loading branch information
akuksin committed Feb 5, 2020
1 parent 3b47352 commit b56c51d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public DataSourceConfiguration(DataSourceProperties dataSourceProperties) {

@Bean
public DataSource dataSource() {
CarRoutingDataSource customDataSource = new CarRoutingDataSource();
TenantRoutingDataSource customDataSource = new TenantRoutingDataSource();
customDataSource.setTargetDataSources(dataSourceProperties.getDatasources());
return customDataSource;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package de.kuksin.multitenant.configuration.datasource;

import de.kuksin.multitenant.configuration.web.ThreadTenantStorage;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;


public class CarRoutingDataSource extends AbstractRoutingDataSource {

@Override
protected Object determineCurrentLookupKey() {
return ThreadTenantStorage.getTenantId();
}
package de.kuksin.multitenant.configuration.datasource;

import de.kuksin.multitenant.configuration.web.ThreadTenantStorage;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;


public class TenantRoutingDataSource extends AbstractRoutingDataSource {

@Override
protected Object determineCurrentLookupKey() {
return ThreadTenantStorage.getTenantId();
}
}

0 comments on commit b56c51d

Please sign in to comment.