Package org.hibernate

Examples of org.hibernate.QueryException


  }

  private FetchReturn createFetchJoin(String tableAlias, String path) {
    int loc = path.indexOf( '.' );
    if ( loc < 0 ) {
      throw new QueryException( "not a property path: " + path );
    }
    final String ownerTableAlias = path.substring( 0, loc );
    final String joinedPropertyName = path.substring( loc + 1 );
    return addFetch( tableAlias, ownerTableAlias, joinedPropertyName );
  }
View Full Code Here


  }

  private FetchReturn createFetchJoin(String tableAlias, String path) {
    int loc = path.indexOf( '.' );
    if ( loc < 0 ) {
      throw new QueryException( "not a property path: " + path );
    }
    final String ownerTableAlias = path.substring( 0, loc );
    final String joinedPropertyName = path.substring( loc + 1 );
    return addFetch( tableAlias, ownerTableAlias, joinedPropertyName );
  }
View Full Code Here

    if ( log.isTraceEnabled() ) {
      log.trace( "iterate: " + getSourceQuery() );
      queryParameters.traceParameters( session.getFactory() );
    }
    if ( translators.length != 1 ) {
      throw new QueryException( "implicit polymorphism not supported for scroll() queries" );
    }
    if ( queryParameters.getRowSelection().definesLimits() && translators[0].containsCollectionFetches() ) {
      throw new QueryException( "firstResult/maxResults not supported in conjunction with scroll() of a query containing collection fetches" );
    }

    return translators[0].scroll( queryParameters, session );
  }
View Full Code Here

    while ( iter.hasNext() ) {
      Criteria subcriteria = ( Criteria ) iter.next();
      if ( subcriteria.getAlias() != null ) {
        Object old = aliasCriteriaMap.put( subcriteria.getAlias(), subcriteria );
        if ( old != null ) {
          throw new QueryException( "duplicate alias: " + subcriteria.getAlias() );
        }
      }
    }
  }
View Full Code Here

    while ( iter.hasNext() ) {
      CriteriaImpl.Subcriteria crit = ( CriteriaImpl.Subcriteria ) iter.next();
      String wholeAssociationPath = getWholeAssociationPath( crit );
      Object old = associationPathCriteriaMap.put( wholeAssociationPath, crit );
      if ( old != null ) {
        throw new QueryException( "duplicate association path: " + wholeAssociationPath );
      }
      int joinType = crit.getJoinType();
      old = associationPathJoinTypesMap.put( wholeAssociationPath, new Integer( joinType ) );
      if ( old != null ) {
        // TODO : not so sure this is needed...
        throw new QueryException( "duplicate association path: " + wholeAssociationPath );
      }
    }
  }
View Full Code Here

      }
      else if ( type.isComponentType() ) {
        componentPath += '.';
      }
      else {
        throw new QueryException( "not an association: " + componentPath );
      }
    }
    return persister.getEntityName();
  }
View Full Code Here

  }

  public String getColumn(Criteria criteria, String propertyName) {
    String[] cols = getColumns( propertyName, criteria );
    if ( cols.length != 1 ) {
      throw new QueryException( "property does not map to a single column: " + propertyName );
    }
    return cols[0];
  }
View Full Code Here

      }
    }
    else {
      if ( projectionTypes.length != 1 ) {
        //should never happen, i think
        throw new QueryException( "not a single-length projection: " + propertyName );
      }
      return projectionTypes[0];
    }
  }
View Full Code Here

        if ( type instanceof NullableType ) {
          NullableType nullableType = ( NullableType ) type;
          value = nullableType.fromStringValue( stringValue );
        }
        else {
          throw new QueryException( "Unsupported discriminator type " + type );
        }
        return new TypedValue(
            type,
                value,
                EntityMode.POJO
View Full Code Here

  public void validateParameters() throws QueryException {
    int types = positionalParameterTypes==null ? 0 : positionalParameterTypes.length;
    int values = positionalParameterValues==null ? 0 : positionalParameterValues.length;
    if (types!=values) {
      throw new QueryException(
          "Number of positional parameter types:" + types +
          " does not match number of positional parameters: " + values
        );
    }
  }
View Full Code Here

TOP

Related Classes of org.hibernate.QueryException

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.