Package org.hibernate.persister.entity

Examples of org.hibernate.persister.entity.SQLLoadable


    if ( alias2Persister.containsKey( rootReturn.getAlias() ) ) {
      // already been processed...
      return;
    }

    SQLLoadable persister = getSQLLoadable( rootReturn.getReturnEntityName() );
    addPersister( rootReturn.getAlias(), rootReturn.getPropertyResultsMap(), persister );
  }
View Full Code Here


    log.trace( "mapping alias [" + alias + "] to collection-suffix [" + suffix + "]" );
    alias2CollectionSuffix.put( alias, suffix );
    collectionPropertyResultMaps.put( alias, propertyResults );

    if ( collectionPersister.isOneToMany() ) {
      SQLLoadable persister = ( SQLLoadable ) collectionPersister.getElementPersister();
      addPersister( alias, filter( propertyResults ), persister );
    }
  }
View Full Code Here

    if ( !alias2Persister.containsKey( ownerAlias ) ) {
      NativeSQLQueryNonScalarReturn ownerReturn = ( NativeSQLQueryNonScalarReturn ) alias2Return.get(ownerAlias);
      processReturn( ownerReturn );
    }

    SQLLoadable ownerPersister = ( SQLLoadable ) alias2Persister.get( ownerAlias );
    Type returnType = ownerPersister.getPropertyType( fetchReturn.getOwnerProperty() );

    if ( returnType.isCollectionType() ) {
      String role = ownerPersister.getEntityName() + '.' + fetchReturn.getOwnerProperty();
      addCollection( role, alias, fetchReturn.getPropertyResultsMap() );
//      collectionOwnerAliases.add( ownerAlias );
    }
    else if ( returnType.isEntityType() ) {
      EntityType eType = ( EntityType ) returnType;
      String returnEntityName = eType.getAssociatedEntityName();
      SQLLoadable persister = getSQLLoadable( returnEntityName );
      addPersister( alias, fetchReturn.getPropertyResultsMap(), persister );
    }

  }
View Full Code Here

    if ( alias2Persister.containsKey( rootReturn.getAlias() ) ) {
      // already been processed...
      return;
    }

    SQLLoadable persister = getSQLLoadable( rootReturn.getReturnEntityName() );
    addPersister( rootReturn.getAlias(), rootReturn.getPropertyResultsMap(), persister );
  }
View Full Code Here

    log.trace( "mapping alias [" + alias + "] to collection-suffix [" + suffix + "]" );
    alias2CollectionSuffix.put( alias, suffix );
    collectionPropertyResultMaps.put( alias, propertyResults );

    if ( collectionPersister.isOneToMany() || collectionPersister.isManyToMany() ) {
      SQLLoadable persister = ( SQLLoadable ) collectionPersister.getElementPersister();
      addPersister( alias, filter( propertyResults ), persister );
    }
  }
View Full Code Here

    if ( !alias2Persister.containsKey( ownerAlias ) ) {
      NativeSQLQueryNonScalarReturn ownerReturn = ( NativeSQLQueryNonScalarReturn ) alias2Return.get(ownerAlias);
      processReturn( ownerReturn );
    }

    SQLLoadable ownerPersister = ( SQLLoadable ) alias2Persister.get( ownerAlias );
    Type returnType = ownerPersister.getPropertyType( fetchReturn.getOwnerProperty() );

    if ( returnType.isCollectionType() ) {
      String role = ownerPersister.getEntityName() + '.' + fetchReturn.getOwnerProperty();
      addCollection( role, alias, fetchReturn.getPropertyResultsMap() );
//      collectionOwnerAliases.add( ownerAlias );
    }
    else if ( returnType.isEntityType() ) {
      EntityType eType = ( EntityType ) returnType;
      String returnEntityName = eType.getAssociatedEntityName();
      SQLLoadable persister = getSQLLoadable( returnEntityName );
      addPersister( alias, fetchReturn.getPropertyResultsMap(), persister );
    }

  }
View Full Code Here

  }
  private String resolveProperties(
      String aliasName,
          String propertyName) {
    Map fieldResults = context.getPropertyResultsMapByAlias( aliasName );
    SQLLoadable persister = context.getEntityPersisterByAlias( aliasName );
    String suffix = context.getEntitySuffixByAlias( aliasName );

    if ( "*".equals( propertyName ) ) {
      if( !fieldResults.isEmpty() ) {
        throw new QueryException("Using return-propertys together with * syntax is not supported.");
      }     
      aliasesFound++;
      return persister.selectFragment( aliasName, suffix ) ;
    }
    else {

      String[] columnAliases;

      // Let return-propertys override whatever the persister has for aliases.
      columnAliases = (String[]) fieldResults.get( propertyName );
      if ( columnAliases == null ) {
        columnAliases = persister.getSubclassPropertyColumnAliases( propertyName, suffix );
      }

      if ( columnAliases == null || columnAliases.length == 0 ) {
        throw new QueryException(
            "No column name found for property [" + propertyName + "] for alias [" + aliasName + "]",
View Full Code Here

  }
  private String resolveProperties(
      String aliasName,
          String propertyName) {
    Map fieldResults = context.getPropertyResultsMapByAlias( aliasName );
    SQLLoadable persister = context.getEntityPersisterByAlias( aliasName );
    String suffix = context.getEntitySuffixByAlias( aliasName );

    if ( "*".equals( propertyName ) ) {
      if( !fieldResults.isEmpty() ) {
        throw new QueryException("Using return-propertys together with * syntax is not supported.");
      }     
      aliasesFound++;
      return persister.selectFragment( aliasName, suffix ) ;
    }
    else {

      String[] columnAliases;

      // Let return-propertys override whatever the persister has for aliases.
      columnAliases = (String[]) fieldResults.get( propertyName );
      if ( columnAliases == null ) {
        columnAliases = persister.getSubclassPropertyColumnAliases( propertyName, suffix );
      }

      if ( columnAliases == null || columnAliases.length == 0 ) {
        throw new QueryException(
            "No column name found for property [" + propertyName + "] for alias [" + aliasName + "]",
View Full Code Here

  }
  private String resolveProperties(
      String aliasName,
          String propertyName) {
    Map fieldResults = context.getPropertyResultsMapByAlias( aliasName );
    SQLLoadable persister = context.getEntityPersisterByAlias( aliasName );
    String suffix = context.getEntitySuffixByAlias( aliasName );

    if ( "*".equals( propertyName ) ) {
      if( !fieldResults.isEmpty() ) {
        throw new QueryException("Using return-propertys together with * syntax is not supported.");
      }     
      aliasesFound++;
      return persister.selectFragment( aliasName, suffix ) ;
    }
    else {

      String[] columnAliases;

      // Let return-propertys override whatever the persister has for aliases.
      columnAliases = (String[]) fieldResults.get( propertyName );
      if ( columnAliases == null ) {
        columnAliases = persister.getSubclassPropertyColumnAliases( propertyName, suffix );
      }

      if ( columnAliases == null || columnAliases.length == 0 ) {
        throw new QueryException(
            "No column name found for property [" + propertyName + "] for alias [" + aliasName + "]",
View Full Code Here

    if ( alias2Persister.containsKey( rootReturn.getAlias() ) ) {
      // already been processed...
      return;
    }

    SQLLoadable persister = getSQLLoadable( rootReturn.getReturnEntityName() );
    addPersister( rootReturn.getAlias(), rootReturn.getPropertyResultsMap(), persister );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.persister.entity.SQLLoadable

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.