@Test(expected = MappingException.class) public void testNonJoinFetchThrowsException() { @FetchProfile(name = "foo", fetchOverrides = { @FetchProfile.FetchOverride(entity = Foo.class, association = "bar", mode = FetchMode.SELECT) }) class Foo { } Index index = JandexHelper.indexForClass( service, Foo.class ); FetchProfileBinder.bind( new AnnotationBindingContextImpl( meta, index ) ); }
public static void bind(AnnotationBindingContext bindingContext) { List<AnnotationInstance> annotations = bindingContext.getIndex() .getAnnotations( HibernateDotNames.FETCH_PROFILE ); for ( AnnotationInstance fetchProfile : annotations ) { bind( bindingContext.getMetadataImplementor(), fetchProfile ); } annotations = bindingContext.getIndex().getAnnotations( HibernateDotNames.FETCH_PROFILES ); for ( AnnotationInstance fetchProfiles : annotations ) { AnnotationInstance[] fetchProfileAnnotations = JandexHelper.getValue( fetchProfiles, "value", AnnotationInstance[].class ); for ( AnnotationInstance fetchProfile : fetchProfileAnnotations ) { bind( bindingContext.getMetadataImplementor(), fetchProfile ); } } }
FetchProfileBinder { public static void bind(AnnotationBindingContext bindingContext) { List<AnnotationInstance> annotations = bindingContext.getIndex() .getAnnotations( HibernateDotNames.FETCH_PROFILE ); for ( AnnotationInstance fetchProfile : annotations ) { bind( bindingContext.getMetadataImplementor(), fetchProfile ); } annotations = bindingContext.getIndex().getAnnotations( HibernateDotNames.FETCH_PROFILES ); for ( AnnotationInstance fetchProfiles : annotations ) { AnnotationInstance[] fetchProfileAnnotations = JandexHelper.getValue( fetchProfiles, "value", AnnotationInstance[].class ); for ( AnnotationInstance fetchProfile : fetchProfileAnnotations ) { bind( bindingContext.getMetadataImplementor(), fetchProfile ); } } } }
FetchProfileBinder { public static void bind(AnnotationBindingContext bindingContext) { List<AnnotationInstance> annotations = bindingContext.getIndex() .getAnnotations( HibernateDotNames.FETCH_PROFILE ); for ( AnnotationInstance fetchProfile : annotations ) { bind( bindingContext.getMetadataImplementor(), fetchProfile ); } annotations = bindingContext.getIndex().getAnnotations( HibernateDotNames.FETCH_PROFILES ); for ( AnnotationInstance fetchProfiles : annotations ) { AnnotationInstance[] fetchProfileAnnotations = JandexHelper.getValue( fetchProfiles, "value", AnnotationInstance[].class ); for ( AnnotationInstance fetchProfile : fetchProfileAnnotations ) { bind( bindingContext.getMetadataImplementor(), fetchProfile ); } } } private  FetchProfileBinder(); }
FetchProfileBinder { public static void bind(AnnotationBindingContext bindingContext) { List<AnnotationInstance> annotations = bindingContext.getIndex() .getAnnotations( HibernateDotNames.FETCH_PROFILE ); for ( AnnotationInstance fetchProfile : annotations ) { bind( bindingContext.getMetadataImplementor(), fetchProfile ); } annotations = bindingContext.getIndex().getAnnotations( HibernateDotNames.FETCH_PROFILES ); for ( AnnotationInstance fetchProfiles : annotations ) { AnnotationInstance[] fetchProfileAnnotations = JandexHelper.getValue( fetchProfiles, "value", AnnotationInstance[].class ); for ( AnnotationInstance fetchProfile : fetchProfileAnnotations ) { bind( bindingContext.getMetadataImplementor(), fetchProfile ); } } } private  FetchProfileBinder(); static void bind(AnnotationBindingContext bindingContext); }
FetchProfileBinder { public static void bind(AnnotationBindingContext bindingContext) { List<AnnotationInstance> annotations = bindingContext.getIndex() .getAnnotations( HibernateDotNames.FETCH_PROFILE ); for ( AnnotationInstance fetchProfile : annotations ) { bind( bindingContext.getMetadataImplementor(), fetchProfile ); } annotations = bindingContext.getIndex().getAnnotations( HibernateDotNames.FETCH_PROFILES ); for ( AnnotationInstance fetchProfiles : annotations ) { AnnotationInstance[] fetchProfileAnnotations = JandexHelper.getValue( fetchProfiles, "value", AnnotationInstance[].class ); for ( AnnotationInstance fetchProfile : fetchProfileAnnotations ) { bind( bindingContext.getMetadataImplementor(), fetchProfile ); } } } private  FetchProfileBinder(); static void bind(AnnotationBindingContext bindingContext);  }