Examples of FetchMode


Examples of org.hibernate.FetchMode

    return typeNode.getValue();
  }

  private static void initOuterJoinFetchSetting(Element node, Fetchable model) {
    Attribute fetchNode = node.attribute( "fetch" );
    final FetchMode fetchStyle;
    boolean lazy = true;
    if ( fetchNode == null ) {
      Attribute jfNode = node.attribute( "outer-join" );
      if ( jfNode == null ) {
        if ( "many-to-many".equals( node.getName() ) ) {
View Full Code Here

Examples of org.hibernate.FetchMode

    else {
      if ( translator.hasProjection() ) {
        return -1;
      }
      else {
        FetchMode fetchMode = translator.getRootCriteria().getFetchMode( path.getFullPath() );
        if ( isDefaultFetchMode( fetchMode ) ) {
          if ( isJoinFetchEnabledByProfile( persister, path, propertyNumber ) ) {
            return getJoinType( nullable, currentDepth );
          }
          else {
View Full Code Here

Examples of org.hibernate.FetchMode

    return typeNode.getValue();
  }

  private static void initOuterJoinFetchSetting(Element node, Fetchable model) {
    Attribute fetchNode = node.attribute( "fetch" );
    final FetchMode fetchStyle;
    boolean lazy = true;
    if ( fetchNode == null ) {
      Attribute jfNode = node.attribute( "outer-join" );
      if ( jfNode == null ) {
        if ( "many-to-many".equals( node.getName() ) ) {
View Full Code Here

Examples of org.hibernate.FetchMode

    return typeNode.getValue();
  }

  private static void initOuterJoinFetchSetting(Element node, Fetchable model) {
    Attribute fetchNode = node.attribute( "fetch" );
    final FetchMode fetchStyle;
    boolean lazy = true;
    if ( fetchNode == null ) {
      Attribute jfNode = node.attribute( "outer-join" );
      if ( jfNode == null ) {
        if ( "many-to-many".equals( node.getName() ) ) {
View Full Code Here

Examples of org.hibernate.FetchMode

    if ( property.getAttribute().isSingular() ) {
      final SingularAttributeBinding singularAttributeBinding = ( SingularAttributeBinding ) property;
      final CascadeStyle cascadeStyle = singularAttributeBinding.isAssociation()
          ? ( (AssociationAttributeBinding) singularAttributeBinding ).getCascadeStyle()
          : CascadeStyles.NONE;
      final FetchMode fetchMode = singularAttributeBinding.isAssociation()
          ? ( (AssociationAttributeBinding) singularAttributeBinding ).getFetchMode()
          : FetchMode.DEFAULT;

      return new StandardProperty(
          singularAttributeBinding.getAttribute().getName(),
          type,
          lazyAvailable && singularAttributeBinding.isLazy(),
          true, // insertable
          true, // updatable
          null,
          singularAttributeBinding.isNullable(),
          alwaysDirtyCheck || areAllValuesIncludedInUpdate( singularAttributeBinding ),
          singularAttributeBinding.isIncludedInOptimisticLocking(),
          cascadeStyle,
          fetchMode
      );
    }
    else {
      final AbstractPluralAttributeBinding pluralAttributeBinding = (AbstractPluralAttributeBinding) property;
      final CascadeStyle cascadeStyle = pluralAttributeBinding.isAssociation()
          ? pluralAttributeBinding.getCascadeStyle()
          : CascadeStyles.NONE;
      final FetchMode fetchMode = pluralAttributeBinding.isAssociation()
          ? pluralAttributeBinding.getFetchMode()
          : FetchMode.DEFAULT;

      return new StandardProperty(
          pluralAttributeBinding.getAttribute().getName(),
View Full Code Here

Examples of org.hibernate.FetchMode

    else {
      if ( translator.hasProjection() ) {
        return -1;
      }
      else {
        FetchMode fetchMode = translator.getRootCriteria().getFetchMode( path.getFullPath() );
        if ( isDefaultFetchMode( fetchMode ) ) {
          if ( isJoinFetchEnabledByProfile( persister, path, propertyNumber ) ) {
            return getJoinType( nullable, currentDepth );
          }
          else {
View Full Code Here

Examples of org.hibernate.FetchMode

    return typeNode.getValue();
  }

  private static void initOuterJoinFetchSetting(Element node, Fetchable model) {
    Attribute fetchNode = node.attribute( "fetch" );
    final FetchMode fetchStyle;
    boolean lazy = true;
    if ( fetchNode == null ) {
      Attribute jfNode = node.attribute( "outer-join" );
      if ( jfNode == null ) {
        if ( "many-to-many".equals( node.getName() ) ) {
View Full Code Here

Examples of org.hibernate.FetchMode

    return typeNode.getValue();
  }

  private static void initOuterJoinFetchSetting(Element node, Fetchable model) {
    Attribute fetchNode = node.attribute( "fetch" );
    final FetchMode fetchStyle;
    boolean lazy = true;
    if ( fetchNode == null ) {
      Attribute jfNode = node.attribute( "outer-join" );
      if ( jfNode == null ) {
        if ( "many-to-many".equals( node.getName() ) ) {
View Full Code Here

Examples of org.hibernate.annotations.FetchMode

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

Examples of org.hibernate.annotations.FetchMode

      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
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.