Package org.hibernate

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


    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
          singularAttributeBinding.getGeneration() == PropertyGeneration.INSERT
              || singularAttributeBinding.getGeneration() == PropertyGeneration.ALWAYS,
          singularAttributeBinding.getGeneration() == PropertyGeneration.ALWAYS,
          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

    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

    return hibernateTypeDescriptor;
  }

  // same as for plural attributes...
  private static FetchMode getFetchMode(XMLManyToOneElement manyToOne) {
    FetchMode fetchMode;
    if ( manyToOne.getFetch() != null ) {
      fetchMode = "join".equals( manyToOne.getFetch().value() ) ? FetchMode.JOIN : FetchMode.SELECT;
    }
    else {
      String jfNodeValue = ( manyToOne.getOuterJoin() == null ? "auto" : manyToOne.getOuterJoin().value() );
View Full Code Here

    //TODO: fix this!!!
    this.hibernateTypeDescriptor.setTypeName( collection.getCollectionType() );
  }

  public FetchMode getFetchMode() {
    FetchMode fetchMode;
    if ( collection.getFetch() != null ) {
      fetchMode = "join".equals( collection.getFetch() ) ? FetchMode.JOIN : FetchMode.SELECT;
    }
    else {
      String jfNodeValue = ( collection.getOuterJoin().value() == null ? "auto" : collection.getOuterJoin().value() );
View Full Code Here

    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

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

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

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

    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

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

    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

TOP

Related Classes of org.hibernate.FetchMode

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.