HHH-14071 Fix binding for FetchProfile for OneToOne(mappedBy=...) associations
This commit is contained in:
parent
33e51c0c47
commit
6027fe1eea
|
@ -252,6 +252,7 @@ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProc
|
|||
}
|
||||
|
||||
AnnotationBinder.bindClass( clazz, inheritanceStatePerClass, rootMetadataBuildingContext );
|
||||
AnnotationBinder.bindFetchProfilesForClass( clazz, rootMetadataBuildingContext );
|
||||
processedEntityNames.add( clazz.getName() );
|
||||
}
|
||||
}
|
||||
|
@ -301,7 +302,9 @@ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProc
|
|||
|
||||
@Override
|
||||
public void postProcessEntityHierarchies() {
|
||||
|
||||
for ( String annotatedPackage : annotatedPackages ) {
|
||||
AnnotationBinder.bindFetchProfilesForPackage( annotatedPackage, rootMetadataBuildingContext );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -349,7 +349,6 @@ public final class AnnotationBinder {
|
|||
bindQueries( pckg, context );
|
||||
bindFilterDefs( pckg, context );
|
||||
bindTypeDefs( pckg, context );
|
||||
bindFetchProfiles( pckg, context );
|
||||
BinderHelper.bindAnyMetaDefs( pckg, context );
|
||||
|
||||
}
|
||||
|
@ -587,7 +586,6 @@ public final class AnnotationBinder {
|
|||
bindQueries( clazzToProcess, context );
|
||||
bindFilterDefs( clazzToProcess, context );
|
||||
bindTypeDefs( clazzToProcess, context );
|
||||
bindFetchProfiles( clazzToProcess, context );
|
||||
BinderHelper.bindAnyMetaDefs( clazzToProcess, context );
|
||||
|
||||
String schema = "";
|
||||
|
@ -1417,6 +1415,27 @@ public final class AnnotationBinder {
|
|||
|
||||
}
|
||||
|
||||
public static void bindFetchProfilesForClass(XClass clazzToProcess, MetadataBuildingContext context) {
|
||||
bindFetchProfiles( clazzToProcess, context );
|
||||
}
|
||||
|
||||
public static void bindFetchProfilesForPackage(String packageName, MetadataBuildingContext context) {
|
||||
XPackage pckg;
|
||||
try {
|
||||
pckg = context.getBootstrapContext().getReflectionManager().packageForName( packageName );
|
||||
}
|
||||
catch (ClassLoadingException e) {
|
||||
LOG.packageNotFound( packageName );
|
||||
return;
|
||||
}
|
||||
catch ( ClassNotFoundException cnf ) {
|
||||
LOG.packageNotFound( packageName );
|
||||
return;
|
||||
}
|
||||
|
||||
bindFetchProfiles( pckg, context );
|
||||
}
|
||||
|
||||
private static void bindFetchProfiles(XAnnotatedElement annotatedElement, MetadataBuildingContext context) {
|
||||
FetchProfile fetchProfileAnnotation = annotatedElement.getAnnotation( FetchProfile.class );
|
||||
FetchProfiles fetchProfileAnnotations = annotatedElement.getAnnotation( FetchProfiles.class );
|
||||
|
|
Loading…
Reference in New Issue