Skip to content

Commit

Permalink
Remove unused field
Browse files Browse the repository at this point in the history
Helps with #22833
  • Loading branch information
stuartwdouglas committed Jan 17, 2022
1 parent 28aaf7d commit 4f81ab8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ public void build(HibernateOrmRecorder recorder, HibernateOrmConfig hibernateOrm
.scope(Singleton.class)
.unremovable()
.supplier(recorder.jpaConfigSupportSupplier(
new JPAConfigSupport(persistenceUnitNames, entityPersistenceUnitMapping)))
new JPAConfigSupport(persistenceUnitNames)))
.done());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.quarkus.hibernate.orm.runtime;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
Expand All @@ -26,13 +25,10 @@ public class JPAConfig {

private static final Logger LOGGER = Logger.getLogger(JPAConfig.class.getName());

private final Map<String, Set<String>> entityPersistenceUnitMapping;

private final Map<String, LazyPersistenceUnit> persistenceUnits;

@Inject
public JPAConfig(JPAConfigSupport jpaConfigSupport) {
this.entityPersistenceUnitMapping = Collections.unmodifiableMap(jpaConfigSupport.entityPersistenceUnitMapping);

Map<String, LazyPersistenceUnit> persistenceUnitsBuilder = new HashMap<>();
for (String persistenceUnitName : jpaConfigSupport.persistenceUnitNames) {
Expand Down Expand Up @@ -101,13 +97,6 @@ public Set<String> getPersistenceUnits() {
return persistenceUnits.keySet();
}

/**
* Returns the set of persistence units an entity is attached to.
*/
public Set<String> getPersistenceUnitsForEntity(String entityClass) {
return entityPersistenceUnitMapping.getOrDefault(entityClass, Collections.emptySet());
}

/**
* Need to shutdown all instances of Hibernate ORM before the actual destroy event,
* as it might need to use the datasources during shutdown.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
package io.quarkus.hibernate.orm.runtime;

import java.util.Map;
import java.util.Set;

public class JPAConfigSupport {

public Set<String> persistenceUnitNames;
public Map<String, Set<String>> entityPersistenceUnitMapping;

public JPAConfigSupport() {
}

public JPAConfigSupport(Set<String> persistenceUnitNames,
Map<String, Set<String>> entityPersistenceUnitMapping) {
public JPAConfigSupport(Set<String> persistenceUnitNames) {
this.persistenceUnitNames = persistenceUnitNames;
this.entityPersistenceUnitMapping = entityPersistenceUnitMapping;
}
}

0 comments on commit 4f81ab8

Please sign in to comment.