private static void bindFetchProfile(FetchProfile fetchProfileAnnotation, MetadataBuildingContext context) { for ( FetchProfile.FetchOverride fetch : fetchProfileAnnotation.fetchOverrides() ) { org.hibernate.annotations.FetchMode mode = fetch.mode(); if ( !mode.equals( org.hibernate.annotations.FetchMode.JOIN ) ) { throw new MappingException( "Only FetchMode.JOIN is currently supported" ); } context.getMetadataCollector().addSecondPass( new VerifyFetchProfileReferenceSecondPass( fetchProfileAnnotation.name(), fetch, context ) ); } }
private static void bindFetchProfile(FetchProfile fetchProfileAnnotation, ExtendedMappings mappings) { for ( FetchProfile.FetchOverride fetch : fetchProfileAnnotation.fetchOverrides() ) { org.hibernate.annotations.FetchMode mode = fetch.mode(); if ( !mode.equals( org.hibernate.annotations.FetchMode.JOIN ) ) { throw new MappingException( "Only FetchMode.JOIN is currently supported" ); } SecondPass sp = new VerifyFetchProfileReferenceSecondPass( fetchProfileAnnotation.name(), fetch, mappings ); mappings.addSecondPass( sp ); } }
private static void bindFetchProfile(FetchProfile fetchProfileAnnotation, Mappings mappings) { for ( FetchProfile.FetchOverride fetch : fetchProfileAnnotation.fetchOverrides() ) { org.hibernate.annotations.FetchMode mode = fetch.mode(); if ( !mode.equals( org.hibernate.annotations.FetchMode.JOIN ) ) { throw new MappingException( "Only FetchMode.JOIN is currently supported" ); } SecondPass sp = new VerifyFetchProfileReferenceSecondPass( fetchProfileAnnotation.name(), fetch, mappings ); mappings.addSecondPass( sp ); } }
private static void bind(MetadataImplementor metadata, AnnotationInstance fetchProfile) { String name = JandexHelper.getValue( fetchProfile, "name", String.class ); Set<Fetch> fetches = new HashSet<Fetch>(); AnnotationInstance[] overrideAnnotations = JandexHelper.getValue( fetchProfile, "fetchOverrides", AnnotationInstance[].class ); for ( AnnotationInstance override : overrideAnnotations ) { FetchMode fetchMode = JandexHelper.getEnumValue( override, "mode", FetchMode.class ); if ( !fetchMode.equals( org.hibernate.annotations.FetchMode.JOIN ) ) { throw new MappingException( "Only FetchMode.JOIN is currently supported" ); } final String entityName = JandexHelper.getValue( override, "entity", String.class ); final String associationName = JandexHelper.getValue( override, "association", String.class ); fetches.add( new Fetch( entityName, associationName, fetchMode.toString().toLowerCase() ) ); } metadata.addFetchProfile( new FetchProfile( name, fetches ) ); } }
private static void bind(MetadataImplementor metadata, AnnotationInstance fetchProfile) { String name = JandexHelper.getValue( fetchProfile, "name", String.class ); Set<Fetch> fetches = new HashSet<Fetch>(); AnnotationInstance[] overrideAnnotations = JandexHelper.getValue( fetchProfile, "fetchOverrides", AnnotationInstance[].class ); for ( AnnotationInstance override : overrideAnnotations ) { FetchMode fetchMode = JandexHelper.getEnumValue( override, "mode", FetchMode.class ); if ( !fetchMode.equals( org.hibernate.annotations.FetchMode.JOIN ) ) { throw new MappingException( "Only FetchMode.JOIN is currently supported" ); } final String entityName = JandexHelper.getValue( override, "entity", String.class ); final String associationName = JandexHelper.getValue( override, "association", String.class ); fetches.add( new Fetch( entityName, associationName, fetchMode.toString().toLowerCase() ) ); } metadata.addFetchProfile( new FetchProfile( name, fetches ) ); } }
private static void bindFetchProfile(FetchProfile fetchProfileAnnotation, Mappings mappings) { for ( FetchProfile.FetchOverride fetch : fetchProfileAnnotation.fetchOverrides() ) { org.hibernate.annotations.FetchMode mode = fetch.mode(); if ( !mode.equals( org.hibernate.annotations.FetchMode.JOIN ) ) { throw new MappingException( "Only FetchMode.JOIN is currently supported" ); } SecondPass sp = new VerifyFetchProfileReferenceSecondPass( fetchProfileAnnotation.name(), fetch, mappings ); mappings.addSecondPass( sp ); } }
private static void bindFetchProfile(FetchProfile fetchProfileAnnotation, MetadataBuildingContext context) { for ( FetchProfile.FetchOverride fetch : fetchProfileAnnotation.fetchOverrides() ) { org.hibernate.annotations.FetchMode mode = fetch.mode(); if ( !mode.equals( org.hibernate.annotations.FetchMode.JOIN ) ) { throw new MappingException( "Only FetchMode.JOIN is currently supported" ); } context.getMetadataCollector().addSecondPass( new VerifyFetchProfileReferenceSecondPass( fetchProfileAnnotation.name(), fetch, context ) ); } }