Package org.hibernate.param

Examples of org.hibernate.param.ParameterSpecification


    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


    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

              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 wrap 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

    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.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

    final int size = parameterSpecifications.size();
    final List<ParameterInfo> ordinalParameterList = new ArrayList<ParameterInfo>();
    final Map<String,NamedParamTempHolder> namedParameterMap = new HashMap<String,NamedParamTempHolder>();
    for ( int i = 0; i < size; i++ ) {
      final ParameterSpecification spec = parameterSpecifications.get( i );
      if ( PositionalParameterSpecification.class.isInstance( spec ) ) {
        final PositionalParameterSpecification ordinalSpec = (PositionalParameterSpecification) spec;
        ordinalParameterList.add( new ParameterInfo( i, ordinalSpec.getExpectedType() ) );
      }
      else if ( NamedParameterSpecification.class.isInstance( spec ) ) {
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();

    translate(
View Full Code Here

      switch ( paramSpecs.size() ) {
        case 0:
          // nothing to do
          break;
        case 1:
          ParameterSpecification paramSpec = 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.