Package org.hibernate.param

Examples of org.hibernate.param.ParameterSpecification


        getLeftHandOperand(),
        lhsColumnSpan
    );
    Node rhsNode = (Node) getInList().getFirstChild();

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

    final boolean negated = getType() == HqlSqlTokenTypes.NOT_IN;

    if ( rhsNode != null && rhsNode.getNextSibling() == null ) {
      /**
       * only one element in the vector grouping.
       * <code> where (a,b) in ( (1,2) ) </code> this will be mutated to
       * <code>where a=1 and b=2 </code>
       */
      String[] rhsElementTexts = extractMutationTexts( rhsNode, rhsColumnSpan );
      setType( negated ? HqlTokenTypes.OR : HqlSqlTokenTypes.AND );
      setText( negated ? "or" : "and" );
      ParameterSpecification rhsEmbeddedCompositeParameterSpecification =
          rhsNode == null || ( !ParameterNode.class.isInstance( rhsNode ) )
              ? null
              : ( (ParameterNode) rhsNode ).getHqlParameterSpecification();
      translate(
          lhsColumnSpan,
          negated ? HqlSqlTokenTypes.NE : HqlSqlTokenTypes.EQ,
          negated ? "<>" : "=",
          lhsElementTexts,
          rhsElementTexts,
          lhsEmbeddedCompositeParameterSpecification,
          rhsEmbeddedCompositeParameterSpecification,
          this
      );
    }
    else {
      List andElementsNodeList = new ArrayList();
      while ( rhsNode != null ) {
        String[] rhsElementTexts = extractMutationTexts( rhsNode, rhsColumnSpan );
        AST group = getASTFactory().create(
            negated ? HqlSqlTokenTypes.OR : HqlSqlTokenTypes.AND,
            negated ? "or" : "and"
        );
        ParameterSpecification rhsEmbeddedCompositeParameterSpecification =
            rhsNode == null || ( !ParameterNode.class.isInstance( rhsNode ) )
                ? null
                : ( (ParameterNode) rhsNode ).getHqlParameterSpecification();
        translate(
            lhsColumnSpan,
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

      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

      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

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

    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

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.