Class MetadataBuildingProcess
java.lang.Object
org.hibernate.boot.model.process.spi.MetadataBuildingProcess
Represents the process of transforming a
MetadataSources
reference into a Metadata
reference. Allows for 2 different process paradigms:-
Single step : as defined by the
build(org.hibernate.boot.MetadataSources, org.hibernate.boot.spi.BootstrapContext, org.hibernate.boot.spi.MetadataBuildingOptions)
method; internally leverages the 2-step paradigm -
Two step : a first step coordinates resource scanning and some other preparation work; a second step
builds the
Metadata
. A hugely important distinction in the need for the steps is that the first phase should strive to not load user entity/component classes so that we can still perform enhancement on them later. This approach caters to the 2-phase bootstrap we use in regards to WildFly Hibernate-JPA integration. The first step is defined byprepare(org.hibernate.boot.MetadataSources, org.hibernate.boot.spi.BootstrapContext)
which returns aManagedResources
instance. The second step is defined by callingcomplete(org.hibernate.boot.model.process.spi.ManagedResources, org.hibernate.boot.spi.BootstrapContext, org.hibernate.boot.spi.MetadataBuildingOptions)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MetadataImplementor
build
(MetadataSources sources, BootstrapContext bootstrapContext, MetadataBuildingOptions options) Unified single phase for MetadataSources to Metadata processstatic MetadataImplementor
complete
(ManagedResources managedResources, BootstrapContext bootstrapContext, MetadataBuildingOptions options) Second step of two-phase for MetadataSources to Metadata processstatic void
coordinateProcessors
(ManagedResources managedResources, MetadataBuildingOptions options, MetadataBuildingContextRootImpl rootMetadataBuildingContext, DomainModelSource domainModelSource, InFlightMetadataCollectorImpl metadataCollector) static ManagedResources
prepare
(MetadataSources sources, BootstrapContext bootstrapContext) First step of two-phase for MetadataSources to Metadata processstatic DomainModelSource
processManagedResources
(ManagedResources managedResources, InFlightMetadataCollector metadataCollector, BootstrapContext bootstrapContext, MappingDefaults optionDefaults)
-
Constructor Details
-
MetadataBuildingProcess
public MetadataBuildingProcess()
-
-
Method Details
-
build
public static MetadataImplementor build(MetadataSources sources, BootstrapContext bootstrapContext, MetadataBuildingOptions options) Unified single phase for MetadataSources to Metadata process- Parameters:
sources
- The MetadataSourcesoptions
- The building options- Returns:
- The built Metadata
-
prepare
First step of two-phase for MetadataSources to Metadata process- Parameters:
sources
- The MetadataSourcesbootstrapContext
- The bootstrapContext- Returns:
- Token/memento representing all known users resources (classes, packages, mapping files, etc).
-
complete
public static MetadataImplementor complete(ManagedResources managedResources, BootstrapContext bootstrapContext, MetadataBuildingOptions options) Second step of two-phase for MetadataSources to Metadata process- Parameters:
managedResources
- The token/memento from 1st phaseoptions
- The building options- Returns:
- Token/memento representing all known users resources (classes, packages, mapping files, etc).
-
coordinateProcessors
@Internal public static void coordinateProcessors(ManagedResources managedResources, MetadataBuildingOptions options, MetadataBuildingContextRootImpl rootMetadataBuildingContext, DomainModelSource domainModelSource, InFlightMetadataCollectorImpl metadataCollector) -
processManagedResources
@Internal public static DomainModelSource processManagedResources(ManagedResources managedResources, InFlightMetadataCollector metadataCollector, BootstrapContext bootstrapContext, MappingDefaults optionDefaults)
-