Package org.hibernate.engine.query.sql

Examples of org.hibernate.engine.query.sql.NativeSQLQueryJoinReturn


        );
        customReturns.add( customReturn );
        customReturnsByAlias.put( rtn.getAlias(), customReturn );
      }
      else if ( queryReturns[i] instanceof NativeSQLQueryJoinReturn ) {
        NativeSQLQueryJoinReturn rtn = ( NativeSQLQueryJoinReturn ) queryReturns[i];
        String alias = rtn.getAlias();
        FetchReturn customReturn;
        NonScalarReturn ownerCustomReturn = ( NonScalarReturn ) customReturnsByAlias.get( rtn.getOwnerAlias() );
        if ( alias2CollectionPersister.containsKey( alias ) ) {
          SQLLoadableCollection persister = ( SQLLoadableCollection ) alias2CollectionPersister.get( alias );
          boolean isEntityElements = persister.getElementType().isEntityType();
          CollectionAliases collectionAliases;
          EntityAliases elementEntityAliases = null;
          if ( queryHadAliases || hasPropertyResultMap( alias ) ) {
            collectionAliases = new GeneratedCollectionAliases(
                ( Map ) collectionPropertyResultMaps.get( alias ),
                persister,
                ( String ) alias2CollectionSuffix.get( alias )
            );
            if ( isEntityElements ) {
              elementEntityAliases = new DefaultEntityAliases(
                  ( Map ) entityPropertyResultMaps.get( alias ),
                  ( SQLLoadable ) alias2Persister.get( alias ),
                  ( String ) alias2Suffix.get( alias )
              );
            }
          }
          else {
            collectionAliases = new ColumnCollectionAliases(
                ( Map ) collectionPropertyResultMaps.get( alias ),
                persister
            );
            if ( isEntityElements ) {
              elementEntityAliases = new ColumnEntityAliases(
                  ( Map ) entityPropertyResultMaps.get( alias ),
                  ( SQLLoadable ) alias2Persister.get( alias ),
                  ( String ) alias2Suffix.get( alias )
              );
            }
          }
          customReturn = new CollectionFetchReturn(
              alias,
              ownerCustomReturn,
              rtn.getOwnerProperty(),
              collectionAliases,
                  elementEntityAliases,
              rtn.getLockMode()
          );
        }
        else {
          EntityAliases entityAliases;
          if ( queryHadAliases || hasPropertyResultMap( alias ) ) {
            entityAliases = new DefaultEntityAliases(
                ( Map ) entityPropertyResultMaps.get( alias ),
                ( SQLLoadable ) alias2Persister.get( alias ),
                ( String ) alias2Suffix.get( alias )
            );
          }
          else {
            entityAliases = new ColumnEntityAliases(
                ( Map ) entityPropertyResultMaps.get( alias ),
                ( SQLLoadable ) alias2Persister.get( alias ),
                ( String ) alias2Suffix.get( alias )
            );
          }
          customReturn = new EntityFetchReturn(
              alias,
              entityAliases,
              ownerCustomReturn,
              rtn.getOwnerProperty(),
              rtn.getLockMode()
          );
        }
        customReturns.add( customReturn );
        customReturnsByAlias.put( alias, customReturn );
      }
View Full Code Here


    for ( int i = 0; i < queryReturns.length; i++ ) {
      if ( queryReturns[i] instanceof NativeSQLQueryNonScalarReturn ) {
        NativeSQLQueryNonScalarReturn rtn = ( NativeSQLQueryNonScalarReturn ) queryReturns[i];
        alias2Return.put( rtn.getAlias(), rtn );
        if ( rtn instanceof NativeSQLQueryJoinReturn ) {
          NativeSQLQueryJoinReturn fetchReturn = ( NativeSQLQueryJoinReturn ) rtn;
          alias2OwnerAlias.put( fetchReturn.getAlias(), fetchReturn.getOwnerAlias() );
        }
      }
    }

    // Now, process the returns
View Full Code Here

    String roleProperty = roleAttribute.substring( dot + 1 );

    //FIXME: get the PersistentClass
    java.util.Map propertyResults = bindPropertyResults(alias, returnElem, null, mappings );

    return new NativeSQLQueryJoinReturn(
        alias,
        roleOwnerAlias,
        roleProperty,
        propertyResults, // TODO: bindpropertyresults(alias, returnElem)
        lockMode
View Full Code Here

    if ( loc < 0 ) {
      throw new QueryException( "not a property path: " + path );
    }
    String ownerAlias = path.substring(0, loc);
    String role = path.substring(loc+1);
    queryReturns.add( new NativeSQLQueryJoinReturn(alias, ownerAlias, role, CollectionHelper.EMPTY_MAP, lockMode) );
    return this;
  }
View Full Code Here

    String roleProperty = roleAttribute.substring( dot + 1 );

    //FIXME: get the PersistentClass
    java.util.Map propertyResults = bindPropertyResults(alias, returnElem, null, mappings );

    return new NativeSQLQueryJoinReturn(
        alias,
        roleOwnerAlias,
        roleProperty,
        propertyResults, // TODO: bindpropertyresults(alias, returnElem)
        lockMode
View Full Code Here

    String roleProperty = roleAttribute.substring( dot + 1 );

    //FIXME: get the PersistentClass
    java.util.Map propertyResults = bindPropertyResults(alias, returnElem, null, mappings );

    return new NativeSQLQueryJoinReturn(
        alias,
        roleOwnerAlias,
        roleProperty,
        propertyResults, // TODO: bindpropertyresults(alias, returnElem)
        lockMode
View Full Code Here

    if ( loc < 0 ) {
      throw new QueryException( "not a property path: " + path );
    }
    String ownerAlias = path.substring(0, loc);
    String role = path.substring(loc+1);
    queryReturns.add( new NativeSQLQueryJoinReturn(alias, ownerAlias, role, CollectionHelper.EMPTY_MAP, lockMode) );
    return this;
  }
View Full Code Here

    for ( int i = 0; i < queryReturns.length; i++ ) {
      if ( queryReturns[i] instanceof NativeSQLQueryNonScalarReturn ) {
        NativeSQLQueryNonScalarReturn rtn = ( NativeSQLQueryNonScalarReturn ) queryReturns[i];
        alias2Return.put( rtn.getAlias(), rtn );
        if ( rtn instanceof NativeSQLQueryJoinReturn ) {
          NativeSQLQueryJoinReturn fetchReturn = ( NativeSQLQueryJoinReturn ) rtn;
          alias2OwnerAlias.put( fetchReturn.getAlias(), fetchReturn.getOwnerAlias() );
        }
      }
    }

    // Now, process the returns
View Full Code Here

        );
        customReturns.add( customReturn );
        customReturnsByAlias.put( rtn.getAlias(), customReturn );
      }
      else if ( queryReturns[i] instanceof NativeSQLQueryJoinReturn ) {
        NativeSQLQueryJoinReturn rtn = ( NativeSQLQueryJoinReturn ) queryReturns[i];
        String alias = rtn.getAlias();
        FetchReturn customReturn;
        NonScalarReturn ownerCustomReturn = ( NonScalarReturn ) customReturnsByAlias.get( rtn.getOwnerAlias() );
        if ( alias2CollectionPersister.containsKey( alias ) ) {
          SQLLoadableCollection persister = ( SQLLoadableCollection ) alias2CollectionPersister.get( alias );
          boolean isEntityElements = persister.getElementType().isEntityType();
          CollectionAliases collectionAliases;
          EntityAliases elementEntityAliases = null;
          if ( queryHadAliases || hasPropertyResultMap( alias ) ) {
            collectionAliases = new GeneratedCollectionAliases(
                ( Map ) collectionPropertyResultMaps.get( alias ),
                persister,
                ( String ) alias2CollectionSuffix.get( alias )
            );
            if ( isEntityElements ) {
              elementEntityAliases = new DefaultEntityAliases(
                  ( Map ) entityPropertyResultMaps.get( alias ),
                  ( SQLLoadable ) alias2Persister.get( alias ),
                  ( String ) alias2Suffix.get( alias )
              );
            }
          }
          else {
            collectionAliases = new ColumnCollectionAliases(
                ( Map ) collectionPropertyResultMaps.get( alias ),
                persister
            );
            if ( isEntityElements ) {
              elementEntityAliases = new ColumnEntityAliases(
                  ( Map ) entityPropertyResultMaps.get( alias ),
                  ( SQLLoadable ) alias2Persister.get( alias ),
                  ( String ) alias2Suffix.get( alias )
              );
            }
          }
          customReturn = new CollectionFetchReturn(
              alias,
              ownerCustomReturn,
              rtn.getOwnerProperty(),
              collectionAliases,
                  elementEntityAliases,
              rtn.getLockMode()
          );
        }
        else {
          EntityAliases entityAliases;
          if ( queryHadAliases || hasPropertyResultMap( alias ) ) {
            entityAliases = new DefaultEntityAliases(
                ( Map ) entityPropertyResultMaps.get( alias ),
                ( SQLLoadable ) alias2Persister.get( alias ),
                ( String ) alias2Suffix.get( alias )
            );
          }
          else {
            entityAliases = new ColumnEntityAliases(
                ( Map ) entityPropertyResultMaps.get( alias ),
                ( SQLLoadable ) alias2Persister.get( alias ),
                ( String ) alias2Suffix.get( alias )
            );
          }
          customReturn = new EntityFetchReturn(
              alias,
              entityAliases,
              ownerCustomReturn,
              rtn.getOwnerProperty(),
              rtn.getLockMode()
          );
        }
        customReturns.add( customReturn );
        customReturnsByAlias.put( alias, customReturn );
      }
View Full Code Here

    String roleProperty = roleAttribute.substring( dot + 1 );

    //FIXME: get the PersistentClass
    java.util.Map propertyResults = bindPropertyResults(alias, returnElem, null, mappings );

    return new NativeSQLQueryJoinReturn(
        alias,
        roleOwnerAlias,
        roleProperty,
        propertyResults, // TODO: bindpropertyresults(alias, returnElem)
        lockMode
View Full Code Here

TOP

Related Classes of org.hibernate.engine.query.sql.NativeSQLQueryJoinReturn

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.