Package org.hibernate.param

Examples of org.hibernate.param.ParameterSpecification


              versionType.getClass() +
                  ".sqlTypes() returns > 1 element; only single-valued versions are allowed."
          );
        }
        versionValueNode = getASTFactory().create( HqlSqlTokenTypes.PARAM, "?" );
        ParameterSpecification paramSpec = new VersionTypeSeedParameterSpecification( versionType );
        ( ( ParameterNode ) versionValueNode ).setHqlParameterSpecification( paramSpec );
        parameters.add( 0, paramSpec );

        if ( sessionFactoryHelper.getFactory().getDialect().requiresCastingOfParametersInSelectClause() ) {
          // we need to wrtap the param in a cast()
View Full Code Here


      eq.setFirstChild( versionPropertyNode );

      AST versionIncrementNode = null;
      if ( Date.class.isAssignableFrom( versionType.getReturnedClass() ) ) {
        versionIncrementNode = getASTFactory().create( HqlSqlTokenTypes.PARAM, "?" );
        ParameterSpecification paramSpec = new VersionTypeSeedParameterSpecification( versionType );
        ( ( ParameterNode ) versionIncrementNode ).setHqlParameterSpecification( paramSpec );
        parameters.add( 0, paramSpec );
      }
      else {
        // Not possible to simply re-use the versionPropertyNode here as it causes
View Full Code Here

    setType( HqlSqlTokenTypes.AND );
    setText( "AND" );
    String[] lhsElementTexts = extractMutationTexts( getLeftHandOperand(), valueElements );
    String[] rhsElementTexts = extractMutationTexts( getRightHandOperand(), valueElements );

    ParameterSpecification lhsEmbeddedCompositeParameterSpecification =
        getLeftHandOperand() == null || ( !ParameterNode.class.isInstance( getLeftHandOperand() ) )
            ? null
            : ( ( ParameterNode ) getLeftHandOperand() ).getHqlParameterSpecification();

    ParameterSpecification rhsEmbeddedCompositeParameterSpecification =
        getRightHandOperand() == null || ( !ParameterNode.class.isInstance( getRightHandOperand() ) )
            ? null
            : ( ( ParameterNode ) getRightHandOperand() ).getHqlParameterSpecification();

    AST container = this;
View Full Code Here

      try {
        st = session.getTransactionCoordinator().getJdbcCoordinator().getStatementPreparer().prepareStatement( sql, false );
        Iterator paramSpecItr = parameterSpecifications.iterator();
        int pos = 1;
        while ( paramSpecItr.hasNext() ) {
          final ParameterSpecification paramSpec = (ParameterSpecification) paramSpecItr.next();
          pos += paramSpec.bind( st, parameters, session, pos );
        }
        if ( selection != null ) {
          if ( selection.getTimeout() != null ) {
            st.setQueryTimeout( selection.getTimeout() );
          }
View Full Code Here

      final SessionImplementor session) throws SQLException {
    int position = startIndex;
    List parameterSpecs = queryTranslator.getCollectedParameterSpecifications();
    Iterator itr = parameterSpecs.iterator();
    while ( itr.hasNext() ) {
      ParameterSpecification spec = ( ParameterSpecification ) itr.next();
      position += spec.bind( statement, queryParameters, session, position );
    }
    return position - startIndex;
  }
View Full Code Here

              versionType.getClass() +
                  ".sqlTypes() returns > 1 element; only single-valued versions are allowed."
          );
        }
        versionValueNode = getASTFactory().create( HqlSqlTokenTypes.PARAM, "?" );
        ParameterSpecification paramSpec = new VersionTypeSeedParameterSpecification( versionType );
        ( ( ParameterNode ) versionValueNode ).setHqlParameterSpecification( paramSpec );
        parameters.add( 0, paramSpec );

        if ( sessionFactoryHelper.getFactory().getDialect().requiresCastingOfParametersInSelectClause() ) {
          // we need to wrtap the param in a cast()
View Full Code Here

      eq.setFirstChild( versionPropertyNode );

      AST versionIncrementNode = null;
      if ( isTimestampBasedVersion( versionType ) ) {
        versionIncrementNode = getASTFactory().create( HqlSqlTokenTypes.PARAM, "?" );
        ParameterSpecification paramSpec = new VersionTypeSeedParameterSpecification( versionType );
        ( ( ParameterNode ) versionIncrementNode ).setHqlParameterSpecification( paramSpec );
        parameters.add( 0, paramSpec );
      }
      else {
        // Not possible to simply re-use the versionPropertyNode here as it causes
View Full Code Here

      switch ( paramSpecs.size() ) {
        case 0 :
          // nothing to do
          break;
        case 1 :
          ParameterSpecification paramSpec = ( ParameterSpecification ) paramSpecs.get( 0 );
          paramSpec.setExpectedType( queryableCollection.getIndexType() );
          fromElement.setIndexCollectionSelectorParamSpec( paramSpec );
          break;
        default:
          fromElement.setIndexCollectionSelectorParamSpec(
              new AggregatedIndexCollectionSelectorParameterSpecifications( paramSpecs )
View Full Code Here

    public int bind(PreparedStatement statement, QueryParameters qp, SessionImplementor session, int position)
    throws SQLException {
      int bindCount = 0;
      Iterator itr = paramSpecs.iterator();
      while ( itr.hasNext() ) {
        final ParameterSpecification paramSpec = ( ParameterSpecification ) itr.next();
        bindCount += paramSpec.bind( statement, qp, session, position + bindCount );
      }
      return bindCount;
    }
View Full Code Here

    int position = startIndex;
//    List parameterSpecs = queryTranslator.getSqlAST().getWalker().getParameters();
    List parameterSpecs = queryTranslator.getCollectedParameterSpecifications();
    Iterator itr = parameterSpecs.iterator();
    while ( itr.hasNext() ) {
      ParameterSpecification spec = ( ParameterSpecification ) itr.next();
      position += spec.bind( statement, queryParameters, session, position );
    }
    return position - startIndex;
  }
View Full Code Here

TOP

Related Classes of org.hibernate.param.ParameterSpecification

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.