HHH-16012 - Develop an abstraction for domain model Class refs

This commit is contained in:
Steve Ebersole 2023-04-03 19:54:24 -05:00
parent 3092eed9b0
commit 8e1247c909
2 changed files with 13 additions and 6 deletions

View File

@ -54,8 +54,12 @@ public class JPAXMLOverriddenMetadataProvider implements MetadataProvider {
private Map<AnnotatedElement, AnnotationReader> cache;
public JPAXMLOverriddenMetadataProvider(BootstrapContext bootstrapContext) {
this.classLoaderAccess = bootstrapContext.getClassLoaderAccess();
this.xmlContext = new XMLContext( bootstrapContext );
this( bootstrapContext.getClassLoaderAccess(), bootstrapContext );
}
public JPAXMLOverriddenMetadataProvider(ClassLoaderAccess classLoaderAccess, BootstrapContext bootstrapContext) {
this.classLoaderAccess = classLoaderAccess;
this.xmlContext = new XMLContext( classLoaderAccess, bootstrapContext.getClassmateContext() );
this.xmlMappingEnabled = bootstrapContext.getMetadataBuildingOptions().isXmlMappingEnabled();
}

View File

@ -57,13 +57,16 @@ public class XMLContext implements Serializable {
private boolean hasContext = false;
public XMLContext(BootstrapContext bootstrapContext) {
this.classLoaderAccess = bootstrapContext.getClassLoaderAccess();
this.classmateContext = bootstrapContext.getClassmateContext();
this( bootstrapContext.getClassLoaderAccess(), bootstrapContext.getClassmateContext() );
}
public XMLContext(ClassLoaderAccess classLoaderAccess, ClassmateContext classmateContext) {
this.classLoaderAccess = classLoaderAccess;
this.classmateContext = classmateContext;
}
/**
* @param entityMappings The xml document to add
* @return Add an xml document to this context and return the list of added class names.
* Add the JAXB binding to this context and return the list of added class names.
*/
public List<String> addDocument(JaxbEntityMappings entityMappings) {
hasContext = true;