|
29 | 29 | import java.util.concurrent.ConcurrentHashMap; |
30 | 30 | import java.util.stream.Collectors; |
31 | 31 |
|
| 32 | +import io.quarkus.hibernate.orm.runtime.PersistenceUnitUtil; |
32 | 33 | import jakarta.persistence.PersistenceException; |
33 | 34 | import jakarta.persistence.PersistenceUnitTransactionType; |
34 | 35 |
|
|
39 | 40 | import org.hibernate.boot.archive.scan.spi.Scanner; |
40 | 41 | import org.hibernate.boot.beanvalidation.BeanValidationIntegrator; |
41 | 42 | import org.hibernate.boot.internal.MetadataImpl; |
| 43 | +import org.hibernate.boot.model.FunctionContributor; |
| 44 | +import org.hibernate.boot.model.TypeContributor; |
42 | 45 | import org.hibernate.boot.model.process.spi.ManagedResources; |
43 | 46 | import org.hibernate.boot.model.process.spi.MetadataBuildingProcess; |
44 | 47 | import org.hibernate.boot.registry.StandardServiceRegistry; |
@@ -188,6 +191,9 @@ public FastBootMetadataBuilder(final QuarkusPersistenceUnitDefinition puDefiniti |
188 | 191 |
|
189 | 192 | applyMetadataBuilderContributor(); |
190 | 193 |
|
| 194 | + applyTypeContributors(); |
| 195 | + applyFunctionContributors(); |
| 196 | + |
191 | 197 | // Unable to automatically handle: |
192 | 198 | // AvailableSettings.ENHANCER_ENABLE_DIRTY_TRACKING, |
193 | 199 | // AvailableSettings.ENHANCER_ENABLE_LAZY_INITIALIZATION, |
@@ -663,6 +669,16 @@ private void applyMetadataBuilderContributor() { |
663 | 669 | } |
664 | 670 | } |
665 | 671 |
|
| 672 | + private void applyTypeContributors() { |
| 673 | + PersistenceUnitUtil.extensionInstancesForPersistenceUnit(TypeContributor.class, persistenceUnit.getName()) |
| 674 | + .stream().forEach(metamodelBuilder::applyTypes); |
| 675 | + } |
| 676 | + |
| 677 | + private void applyFunctionContributors() { |
| 678 | + PersistenceUnitUtil.extensionInstancesForPersistenceUnit(FunctionContributor.class, persistenceUnit.getName()) |
| 679 | + .stream().forEach(metamodelBuilder::applyFunctions); |
| 680 | + } |
| 681 | + |
666 | 682 | @SuppressWarnings("unchecked") |
667 | 683 | private <T> T loadSettingInstance(String settingName, Object settingValue, Class<T> clazz) { |
668 | 684 | T instance = null; |
|
0 commit comments