Package org.hibernate.param

Examples of org.hibernate.param.ParameterSpecification


      final SessionImplementor session) throws SQLException {
    int position = bindFilterParameterValues( statement, queryParameters, startIndex, session );
    List parameterSpecs = queryTranslator.getSqlAST().getWalker().getParameters();
    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


    int size = parameterSpecifications.size();
    List ordinalParameterList = new ArrayList();
    Map namedParameterMap = new HashMap();
    for ( int i = 0; i < size; i++ ) {
      final ParameterSpecification spec = ( ParameterSpecification ) parameterSpecifications.get( i );
      if ( PositionalParameterSpecification.class.isAssignableFrom( spec.getClass() ) ) {
        PositionalParameterSpecification ordinalSpec = ( PositionalParameterSpecification ) spec;
        ordinalParameterList.add( new ParameterInfo( i, ordinalSpec.getExpectedType() ) );
      }
      else if ( NamedParameterSpecification.class.isAssignableFrom( spec.getClass() ) ) {
        NamedParameterSpecification namedSpec = ( NamedParameterSpecification ) spec;
        NamedParamTempHolder paramHolder = ( NamedParamTempHolder ) namedParameterMap.get( namedSpec.getName() );
        if ( paramHolder == null ) {
          paramHolder = new NamedParamTempHolder();
          paramHolder.name = namedSpec.getName();
View Full Code Here

      VersionType versionType = persister.getVersionType();
      AST versionValueNode = null;

      if ( sessionFactoryHelper.getFactory().getDialect().supportsParametersInInsertSelect() ) {
        versionValueNode = getASTFactory().create( HqlSqlTokenTypes.PARAM, "?" );
        ParameterSpecification paramSpec = new VersionTypeSeedParameterSpecification( versionType );
        ( ( ParameterNode ) versionValueNode ).setHqlParameterSpecification( paramSpec );
        parameters.add( 0, paramSpec );
      }
      else {
        if ( isIntegral( versionType ) ) {
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

        try {
          ps = session.getBatcher().prepareStatement( idInsertSelect );
          Iterator paramSpecifications = getWalker().getParameters().iterator();
          int pos = 1;
          while ( paramSpecifications.hasNext() ) {
            final ParameterSpecification paramSpec = ( ParameterSpecification ) paramSpecifications.next();
            pos += paramSpec.bind( ps, parameters, session, pos );
          }
          resultCount = ps.executeUpdate();
        }
        finally {
          if ( ps != null ) {
View Full Code Here

      try {
        st = session.getBatcher().prepareStatement( sql );
        Iterator paramSpecifications = getWalker().getParameters().iterator();
        int pos = 1;
        while ( paramSpecifications.hasNext() ) {
          final ParameterSpecification paramSpec = ( ParameterSpecification ) paramSpecifications.next();
          pos += paramSpec.bind( st, parameters, session, pos );
        }
        if ( selection != null ) {
          if ( selection.getTimeout() != null ) {
            st.setQueryTimeout( selection.getTimeout().intValue() );
          }
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 ( 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

      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

      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

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.