HHH-14529 Fix access type being ignored when defined at the entity level in orm.xml

That's a bug I introduced when I migrated code from dom4j to jaxb.
This commit is contained in:
Yoann Rodière 2021-04-19 10:06:29 +02:00
parent 5b830f3f5e
commit 4f7bb75ec7
1 changed files with 10 additions and 5 deletions

View File

@ -127,11 +127,16 @@ public class XMLContext implements Serializable {
}
addedClasses.add( className );
managedTypeOverride.put( className, element );
Default localDefault = new Default();
localDefault.override( defaults );
localDefault.setMetadataComplete( element.isMetadataComplete() );
localDefault.setAccess( element.getAccess() );
defaultsOverride.put( className, localDefault );
Default mergedDefaults = new Default();
// Apply entity mapping defaults
mergedDefaults.override( defaults );
// ... then apply entity settings
Default fileDefaults = new Default();
fileDefaults.setMetadataComplete( element.isMetadataComplete() );
fileDefaults.setAccess( element.getAccess() );
mergedDefaults.override( fileDefaults );
// ... and we get the merged defaults for that entity
defaultsOverride.put( className, mergedDefaults );
LOG.debugf( "Adding XML overriding information for %s", className );
if ( element instanceof JaxbEntity ) {