Skip to content

Commit

Permalink
Renamed MultiTenant interface to MultiTenantProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddie Carpenter committed Jun 21, 2024
1 parent 6e7037c commit 95073d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package io.jpalite;

public interface MultiTenant
public interface MultiTenantProvider
{
JPALitePersistenceUnit getPersistenceUnit(JPALitePersistenceUnit persistenceUnit);
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ private JPALitePersistenceUnit getPersistenceUnit()
JPALitePersistenceUnit persistenceUnit = persistenceUnitProvider.getPersistenceUnit(persistenceUnitName);
if (persistenceUnit != null) {
if (persistenceUnit.getMultiTenantMode().equals(Boolean.TRUE)) {
ServiceLoader<MultiTenant> multiTenantLoader = ServiceLoader.load(MultiTenant.class);
for (MultiTenant multiTenant : multiTenantLoader) {
JPALitePersistenceUnit legacyPersistenceUnit = multiTenant.getPersistenceUnit(persistenceUnit);
ServiceLoader<MultiTenantProvider> multiTenantLoader = ServiceLoader.load(MultiTenantProvider.class);
for (MultiTenantProvider multiTenantProvider : multiTenantLoader) {
JPALitePersistenceUnit legacyPersistenceUnit = multiTenantProvider.getPersistenceUnit(persistenceUnit);
if (legacyPersistenceUnit != null) {
return legacyPersistenceUnit;
}//if
Expand Down

0 comments on commit 95073d9

Please sign in to comment.