Package org.hibernate.metamodel.binding

Examples of org.hibernate.metamodel.binding.FetchProfile


              origin()
          );
        }
        fetches.add( new FetchProfile.Fetch( entityName, fetch.getAssociation(), fetch.getStyle() ) );
      }
      metadata.addFetchProfile( new FetchProfile( profileName, fetches ) );
    }
  }
View Full Code Here


      }
      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 ) );
  }
View Full Code Here

              origin()
          );
        }
        fetches.add( new FetchProfile.Fetch( entityName, fetch.getAssociation(), fetch.getStyle() ) );
      }
      metadata.addFetchProfile( new FetchProfile( profileName, fetches ) );
    }
  }
View Full Code Here

              origin()
          );
        }
        fetches.add( new FetchProfile.Fetch( entityName, fetch.getAssociation(), fetch.getStyle() ) );
      }
      metadata.addFetchProfile( new FetchProfile( profileName, fetches ) );
    }
  }
View Full Code Here

  public Iterable<FetchProfile> getFetchProfiles() {
    return fetchProfiles.values();
  }

  public FetchProfile findOrCreateFetchProfile(String profileName, MetadataSource source) {
    FetchProfile profile = fetchProfiles.get( profileName );
    if ( profile == null ) {
      profile = new FetchProfile( profileName, source );
      fetchProfiles.put( profileName, profile );
    }
    return profile;
  }
View Full Code Here

  }

  private static void bindFetchProfileAnnotations(MetadataImpl meta, List<AnnotationInstance> fetchProfileAnnotations) {
    for ( AnnotationInstance fetchProfileAnnotation : fetchProfileAnnotations ) {
      String name = fetchProfileAnnotation.value( "name" ).asString();
      FetchProfile profile = meta.findOrCreateFetchProfile( name, MetadataSource.ANNOTATIONS );

      AnnotationInstance overrides[] = fetchProfileAnnotation.value( "fetchOverrides" ).asNestedArray();
      for ( AnnotationInstance overrideAnnotation : overrides ) {
        FetchMode fetchMode = Enum.valueOf( FetchMode.class, overrideAnnotation.value( "mode" ).asEnum() );
        if ( !fetchMode.equals( org.hibernate.annotations.FetchMode.JOIN ) ) {
          throw new MappingException( "Only FetchMode.JOIN is currently supported" );
        }

        String entityClassName = overrideAnnotation.value( "entity" ).asClass().name().toString();
        String associationName = overrideAnnotation.value( "association" ).asString();
        profile.addFetch(
            entityClassName, associationName, fetchMode.toString().toLowerCase()
        );
      }
    }
  }
View Full Code Here

              jaxbRoot.getOrigin()
          );
        }
        fetches.add( new FetchProfile.Fetch( entityName, fetch.getAssociation(), fetch.getStyle() ) );
      }
      metadata.addFetchProfile( new FetchProfile( profileName, fetches ) );
    }
  }
View Full Code Here

              ),
              fetchMode.toString().toLowerCase()
          )
      );
    }
    metadata.addFetchProfile( new FetchProfile( name, fetches ) );
  }
View Full Code Here

      }
      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 ) );
  }
View Full Code Here

      }
      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 ) );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.metamodel.binding.FetchProfile

Copyright © 2018 www.massapicom. 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.