|
13 | 13 | import org.hibernate.boot.MetadataSources;
|
14 | 14 | import org.hibernate.boot.internal.ClassLoaderAccessImpl;
|
15 | 15 | import org.hibernate.boot.internal.InFlightMetadataCollectorImpl;
|
16 |
| -import org.hibernate.boot.internal.MetadataBuilderImpl.MetadataBuildingOptionsImpl; |
17 | 16 | import org.hibernate.boot.internal.MetadataBuildingContextRootImpl;
|
18 |
| -import org.hibernate.boot.internal.MetadataImpl; |
19 | 17 | import org.hibernate.boot.jaxb.internal.MappingBinder;
|
20 | 18 | import org.hibernate.boot.model.TypeContributions;
|
21 | 19 | import org.hibernate.boot.model.TypeContributor;
|
22 |
| -import org.hibernate.boot.model.process.internal.ManagedResourcesBuilder; |
| 20 | +import org.hibernate.boot.model.process.internal.ManagedResourcesImpl; |
| 21 | +import org.hibernate.boot.model.process.internal.ScanningCoordinator; |
23 | 22 | import org.hibernate.boot.model.source.internal.annotations.AnnotationMetadataSourceProcessorImpl;
|
24 | 23 | import org.hibernate.boot.model.source.internal.hbm.EntityHierarchyBuilder;
|
25 | 24 | import org.hibernate.boot.model.source.internal.hbm.EntityHierarchySourceImpl;
|
|
32 | 31 | import org.hibernate.boot.spi.ClassLoaderAccess;
|
33 | 32 | import org.hibernate.boot.spi.MetadataBuildingOptions;
|
34 | 33 | import org.hibernate.boot.spi.MetadataContributor;
|
| 34 | +import org.hibernate.boot.spi.MetadataImplementor; |
35 | 35 | import org.hibernate.cfg.AttributeConverterDefinition;
|
36 | 36 | import org.hibernate.cfg.MetadataSourceType;
|
37 | 37 | import org.hibernate.dialect.Dialect;
|
|
67 | 67 | public class MetadataBuildingProcess {
|
68 | 68 | private static final Logger log = Logger.getLogger( MetadataBuildingProcess.class );
|
69 | 69 |
|
70 |
| - public static MetadataImpl build( |
| 70 | + /** |
| 71 | + * Unified single phase for MetadataSources->Metadata process |
| 72 | + * |
| 73 | + * @param sources The MetadataSources |
| 74 | + * @param options The building options |
| 75 | + * |
| 76 | + * @return The built Metadata |
| 77 | + */ |
| 78 | + public static MetadataImplementor build( |
71 | 79 | final MetadataSources sources,
|
72 | 80 | final MetadataBuildingOptions options) {
|
73 | 81 | return complete( prepare( sources, options ), options );
|
74 | 82 | }
|
75 | 83 |
|
| 84 | + /** |
| 85 | + * First step of 2-phase for MetadataSources->Metadata process |
| 86 | + * |
| 87 | + * @param sources The MetadataSources |
| 88 | + * @param options The building options |
| 89 | + * |
| 90 | + * @return Token/memento representing all known users resources (classes, packages, mapping files, etc). |
| 91 | + */ |
76 | 92 | public static ManagedResources prepare(
|
77 | 93 | final MetadataSources sources,
|
78 | 94 | final MetadataBuildingOptions options) {
|
79 |
| - return ManagedResourcesBuilder.INSTANCE.buildCompleteManagedResources( sources, options ); |
| 95 | + final ManagedResourcesImpl managedResources = ManagedResourcesImpl.baseline( sources, options ); |
| 96 | + ScanningCoordinator.INSTANCE.coordinateScan( managedResources, options, sources.getXmlMappingBinderAccess() ); |
| 97 | + return managedResources; |
80 | 98 | }
|
81 | 99 |
|
82 |
| - public static MetadataImpl complete(final ManagedResources managedResources, final MetadataBuildingOptions options) { |
| 100 | + /** |
| 101 | + * Second step of 2-phase for MetadataSources->Metadata process |
| 102 | + * |
| 103 | + * @param managedResources The token/memento from 1st phase |
| 104 | + * @param options The building options |
| 105 | + * |
| 106 | + * @return Token/memento representing all known users resources (classes, packages, mapping files, etc). |
| 107 | + */ |
| 108 | + public static MetadataImplementor complete(final ManagedResources managedResources, final MetadataBuildingOptions options) { |
83 | 109 | final BasicTypeRegistry basicTypeRegistry = handleTypes( options );
|
84 | 110 |
|
85 | 111 | final InFlightMetadataCollectorImpl metadataCollector = new InFlightMetadataCollectorImpl(
|
|
0 commit comments