Examples of FetchMode


Examples of org.hibernate.annotations.FetchMode

  private static void bind(MetadataImplementor metadata, AnnotationInstance fetchProfile) {
    String name = JandexHelper.getValueAsString( fetchProfile, "name" );
    Set<Fetch> fetches = new HashSet<Fetch>();
    for ( AnnotationInstance override : JandexHelper.getValueAsArray( fetchProfile, "fetchOverrides" ) ) {
      FetchMode fetchMode = JandexHelper.getValueAsEnum( override, "mode", FetchMode.class );
      if ( !fetchMode.equals( org.hibernate.annotations.FetchMode.JOIN ) ) {
        throw new MappingException( "Only FetchMode.JOIN is currently supported" );
      }
      fetches.add(
          new Fetch(
              JandexHelper.getValueAsString( override, "entity" ), JandexHelper.getValueAsString(
                  override,
                  "association"
              ),
              fetchMode.toString().toLowerCase()
          )
      );
    }
    metadata.addFetchProfile( new FetchProfile( name, fetches ) );
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.