HHH-14071 Fix binding for FetchProfile for OneToOne(mappedBy=...) associations
This commit is contained in:
parent
e60299c440
commit
f8fe50ad09
|
@ -252,6 +252,7 @@ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProc
|
||||||
}
|
}
|
||||||
|
|
||||||
AnnotationBinder.bindClass( clazz, inheritanceStatePerClass, rootMetadataBuildingContext );
|
AnnotationBinder.bindClass( clazz, inheritanceStatePerClass, rootMetadataBuildingContext );
|
||||||
|
AnnotationBinder.bindFetchProfilesForClass( clazz, rootMetadataBuildingContext );
|
||||||
processedEntityNames.add( clazz.getName() );
|
processedEntityNames.add( clazz.getName() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -301,7 +302,9 @@ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProc
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postProcessEntityHierarchies() {
|
public void postProcessEntityHierarchies() {
|
||||||
|
for ( String annotatedPackage : annotatedPackages ) {
|
||||||
|
AnnotationBinder.bindFetchProfilesForPackage( annotatedPackage, rootMetadataBuildingContext );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -349,7 +349,6 @@ public final class AnnotationBinder {
|
||||||
bindQueries( pckg, context );
|
bindQueries( pckg, context );
|
||||||
bindFilterDefs( pckg, context );
|
bindFilterDefs( pckg, context );
|
||||||
bindTypeDefs( pckg, context );
|
bindTypeDefs( pckg, context );
|
||||||
bindFetchProfiles( pckg, context );
|
|
||||||
BinderHelper.bindAnyMetaDefs( pckg, context );
|
BinderHelper.bindAnyMetaDefs( pckg, context );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -587,7 +586,6 @@ public final class AnnotationBinder {
|
||||||
bindQueries( clazzToProcess, context );
|
bindQueries( clazzToProcess, context );
|
||||||
bindFilterDefs( clazzToProcess, context );
|
bindFilterDefs( clazzToProcess, context );
|
||||||
bindTypeDefs( clazzToProcess, context );
|
bindTypeDefs( clazzToProcess, context );
|
||||||
bindFetchProfiles( clazzToProcess, context );
|
|
||||||
BinderHelper.bindAnyMetaDefs( clazzToProcess, context );
|
BinderHelper.bindAnyMetaDefs( clazzToProcess, context );
|
||||||
|
|
||||||
String schema = "";
|
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) {
|
private static void bindFetchProfiles(XAnnotatedElement annotatedElement, MetadataBuildingContext context) {
|
||||||
FetchProfile fetchProfileAnnotation = annotatedElement.getAnnotation( FetchProfile.class );
|
FetchProfile fetchProfileAnnotation = annotatedElement.getAnnotation( FetchProfile.class );
|
||||||
FetchProfiles fetchProfileAnnotations = annotatedElement.getAnnotation( FetchProfiles.class );
|
FetchProfiles fetchProfileAnnotations = annotatedElement.getAnnotation( FetchProfiles.class );
|
||||||
|
|
Loading…
Reference in New Issue