44This note captures the proposed direction for using this PoC to replace and simplify large parts of ORM bootstrap,
55especially the JPA path through `EntityManagerFactoryBuilderImpl` .
66
7+ [NOTE]
8+ ====
9+ This is an early, historical direction note.
10+
11+ The distilled current target is captured in
12+ link:session-factory-bootstrap-design.adoc[`session-factory-bootstrap-design.adoc`],
13+ and ongoing implementation status lives in
14+ link:session-factory-bootstrap-plan.adoc[`session-factory-bootstrap-plan.adoc`].
15+ ====
16+
717== Current ORM Shape
818
919From the JPA side, `EntityManagerFactoryBuilderImpl` currently handles several phases inline:
@@ -39,19 +49,18 @@ JpaBootstrapSettings
3949BootstrapSourceContributions
4050AvailableResources
4151CategorizedDomainModel
42- BoundMetadata
52+ ResolvedMetadata
4353----
4454
4555The intended flow is:
4656
4757[source]
4858----
4959PersistenceUnitDescriptor / HibernatePersistenceConfiguration
50- -> JpaBootstrapSourceCollector
5160 -> BootstrapSourceContributions
5261 -> AvailableResources
5362 -> DomainModelCategorizer
54- -> BindingCoordinator
63+ -> BindingCoordinator / MetadataResolver
5564----
5665
5766== Settings
@@ -83,7 +92,7 @@ Inputs:
8392* persistence-unit class names
8493* mapping file names
8594* standard `META-INF/orm.xml`
86- * explicit `HBM_XML_FILES`
95+ * [.line-through]# explicit `HBM_XML_FILES`#
8796* scanner results
8897* loaded classes
8998* packages
@@ -101,8 +110,11 @@ It should contain:
101110* resolved `ClassDetails` for managed classes
102111* resolved package-info `ClassDetails`
103112* XML bindings
104- * dynamic model names/classes if needed
105- * possibly extra query imports, either directly or as a sibling object
113+
114+ Dynamic model names/classes are discovered during XML processing rather than
115+ stored as separate `AvailableResources` buckets. Extra query imports should be
116+ represented explicitly by the caller/test infrastructure rather than folded into
117+ `AvailableResources`.
106118
107119It should not contain merged settings.
108120
@@ -112,16 +124,8 @@ should be source-model oriented and normalized for categorization.
112124
113125== XML Preprocessing
114126
115- Move XML preprocessing behind `AvailableResources`.
116-
117- The short-term adapter is acceptable:
118-
119- [source]
120- ----
121- AvailableResources -> ManagedResources adapter -> XmlPreProcessor
122- ----
123-
124- The intended direction is direct consumption:
127+ Move XML preprocessing behind `AvailableResources`. The PoC now uses direct
128+ consumption:
125129
126130[source]
127131----
@@ -134,7 +138,7 @@ Categorization should consume normalized resources:
134138
135139[source]
136140----
137- AvailableResources + BootstrapContext -> CategorizedDomainModel
141+ AvailableResources + MetadataBuildingContext -> CategorizedDomainModel
138142----
139143
140144This replaces the current ad hoc categorization work in `MetadataBuildingProcess.processManagedResources(...)`.
@@ -240,7 +244,7 @@ This is where the PoC’s DomainModelCategorizer belongs.
240244
241245[source]
242246----
243- (AvailableResources + BootstrapContext ) -> CategorizedDomainModel
247+ (AvailableResources + MetadataBuildingContext ) -> CategorizedDomainModel
244248----
245249
246250This replaces the current ad hoc collection in MetadataBuildingProcess.processManagedResources(...).
@@ -274,23 +278,26 @@ AvailableResources should be normalized:
274278* no setting merge concerns
275279
276280
277- == Next PoC Slice
281+ == Historical PoC Slice
278282
279- Prototype this chain :
283+ The original next slice was :
280284
281285[source]
282286----
283287PersistenceUnitDescriptor / HibernatePersistenceConfiguration
284- -> JpaBootstrapSourceCollector
288+ -> BootstrapSourceContributions
285289 -> AvailableResources
286290 -> DomainModelCategorizer
287291----
288292
289- Do not wire binding yet.
293+ That slice is now covered locally and binding has also been wired through
294+ `MetadataResolver`. Keep this section only as historical context for how the
295+ source/categorization work was first isolated.
290296
291- The test target should be :
297+ The original test target was :
292298
293299* Given JPA bootstrap inputs, the PoC derives the same available classes, packages, XML, and global registrations
294300 that ORM currently derives through `EntityManagerFactoryBuilderImpl` and `ManagedResources`
295301
296- This establishes a clean replacement boundary before touching binder and persister integration.
302+ That established the source/categorization replacement boundary before the PoC
303+ moved on to binder and SessionFactory integration.
0 commit comments