HHH-17504 - Ongoing JPA 32 work HHH-17350 - Work on hibernate-models, XSD and JAXB HHH-16114 - Improve boot metamodel binding HHH-15996 - Develop an abstraction for Annotation in annotation processing HHH-16012 - Develop an abstraction for domain model Class refs HHH-15997 - Support for dynamic models in orm.xml HHH-15698 - Support for entity-name in mapping.xsd

This commit is contained in:
Andrea Boriero 2024-03-19 15:23:01 +01:00 committed by Steve Ebersole
parent 872b834047
commit 286f641f98
4 changed files with 36 additions and 27 deletions

View File

@ -2181,16 +2181,18 @@ public class JPAXMLOverriddenAnnotationReader implements AnnotationReader {
AnnotationDescriptor annSubgraphNode = new AnnotationDescriptor( NamedSubgraph.class ); AnnotationDescriptor annSubgraphNode = new AnnotationDescriptor( NamedSubgraph.class );
copyAttribute( annSubgraphNode, "name", subgraphNode.getName(), true ); copyAttribute( annSubgraphNode, "name", subgraphNode.getName(), true );
String clazzName = subgraphNode.getClazz(); String clazzName = subgraphNode.getClazz();
final Class<?> clazz; if ( StringHelper.isNotEmpty( clazzName ) ) {
try { final Class<?> clazz;
clazz = classLoaderAccess.classForName( try {
XMLContext.buildSafeClassName( clazzName, defaults ) clazz = classLoaderAccess.classForName(
); XMLContext.buildSafeClassName( clazzName, defaults )
);
}
catch (ClassLoadingException e) {
throw new AnnotationException( "Unable to find entity-class: " + clazzName, e );
}
annSubgraphNode.setValue( "type", clazz );
} }
catch (ClassLoadingException e) {
throw new AnnotationException( "Unable to find entity-class: " + clazzName, e );
}
annSubgraphNode.setValue( "type", clazz );
bindNamedAttributeNodes( subgraphNode.getNamedAttributeNode(), annSubgraphNode ); bindNamedAttributeNodes( subgraphNode.getNamedAttributeNode(), annSubgraphNode );
annSubgraphNodes.add( AnnotationFactory.create( annSubgraphNode ) ); annSubgraphNodes.add( AnnotationFactory.create( annSubgraphNode ) );
} }
@ -2233,16 +2235,18 @@ public class JPAXMLOverriddenAnnotationReader implements AnnotationReader {
parameterDescriptor.setValue( "mode", modeValue ); parameterDescriptor.setValue( "mode", modeValue );
} }
String clazzName = parameterElement.getClazz(); String clazzName = parameterElement.getClazz();
Class<?> clazz; if ( StringHelper.isNotEmpty( clazzName ) ) {
try { Class<?> clazz;
clazz = classLoaderAccess.classForName( try {
XMLContext.buildSafeClassName( clazzName, defaults ) clazz = classLoaderAccess.classForName(
); XMLContext.buildSafeClassName( clazzName, defaults )
);
}
catch (ClassLoadingException e) {
throw new AnnotationException( "Unable to find entity-class: " + clazzName, e );
}
parameterDescriptor.setValue( "type", clazz );
} }
catch (ClassLoadingException e) {
throw new AnnotationException( "Unable to find entity-class: " + clazzName, e );
}
parameterDescriptor.setValue( "type", clazz );
storedProcedureParameters.add( AnnotationFactory.create( parameterDescriptor ) ); storedProcedureParameters.add( AnnotationFactory.create( parameterDescriptor ) );
} }

View File

@ -843,6 +843,8 @@ public class ManagedTypeProcessor {
.getClassDetailsRegistry() .getClassDetailsRegistry()
.resolveClassDetails( className ); .resolveClassDetails( className );
XmlProcessingHelper.getOrMakeAnnotation( Embeddable.class, classDetails, xmlDocumentContext );
AttributeProcessor.processAttributes( AttributeProcessor.processAttributes(
jaxbEmbeddable.getAttributes(), jaxbEmbeddable.getAttributes(),
classDetails, classDetails,

View File

@ -50,14 +50,17 @@ public class ElementCollectionAttributeProcessing {
jaxbElementCollection.getFetch(), jaxbElementCollection.getFetch(),
elementCollectionAnn elementCollectionAnn
); );
XmlProcessingHelper.applyAttributeIfSpecified( final String targetClass = jaxbElementCollection.getTargetClass();
"targetClass", if ( targetClass != null ) {
XmlAnnotationHelper.resolveJavaType( XmlProcessingHelper.applyAttributeIfSpecified(
jaxbElementCollection.getTargetClass(), "targetClass",
xmlDocumentContext.getModelBuildingContext() XmlAnnotationHelper.resolveJavaType(
).determineRawClass(), targetClass,
elementCollectionAnn xmlDocumentContext.getModelBuildingContext()
); ).determineRawClass(),
elementCollectionAnn
);
}
CommonAttributeProcessing.applyAttributeBasics( jaxbElementCollection, memberDetails, elementCollectionAnn, accessType, xmlDocumentContext ); CommonAttributeProcessing.applyAttributeBasics( jaxbElementCollection, memberDetails, elementCollectionAnn, accessType, xmlDocumentContext );

View File

@ -70,7 +70,7 @@ dependencyResolutionManagement {
def byteBuddyVersion = version "byteBuddy", "1.14.18" def byteBuddyVersion = version "byteBuddy", "1.14.18"
def classmateVersion = version "classmate", "1.5.1" def classmateVersion = version "classmate", "1.5.1"
def geolatteVersion = version "geolatte", "1.9.1" def geolatteVersion = version "geolatte", "1.9.1"
def hibernateModelsVersion = version "hibernateModels", "0.7.1" def hibernateModelsVersion = version "hibernateModels", "0.7.2"
def jandexVersion = version "jandex", "3.2.0" def jandexVersion = version "jandex", "3.2.0"
def hcannVersion = version "hcann", "7.0.1.Final" def hcannVersion = version "hcann", "7.0.1.Final"
def jacksonVersion = version "jackson", "2.17.0" def jacksonVersion = version "jackson", "2.17.0"