Package org.pentaho.actionsequence.dom.actions

Examples of org.pentaho.actionsequence.dom.actions.HQLQueryAction


  }

  @Override
  protected boolean validateAction() {
    HQLConnectionAction connAction = null;
    HQLQueryAction queryAction = null;
    boolean actionValidated = true;

    try {
      if ( getActionDefinition() instanceof HQLQueryAction ) {
        queryAction = (HQLQueryAction) getActionDefinition();

        actionValidated = isConnectionInfoSpecified( queryAction );

        // Check if the query is defined.
        if ( actionValidated && ( queryAction.getQuery() == ActionInputConstant.NULL_INPUT ) ) {
          actionValidated = false;
          error( Messages.getInstance().getErrorString(
            "HQLBaseComponent.ERROR_0004_QUERY_NOT_SPECIFIED", getActionName() ) ); //$NON-NLS-1$
        }

        // Check if output for the query is correctly defined.
        if ( actionValidated && ( queryAction.getOutputResultSetName() == null )
            && ( queryAction.getOutputPreparedStatementName() == null ) ) {
          actionValidated = false;
          error( Messages.getInstance().getErrorString(
            "HQLBaseComponent.ERROR_0005_OUTPUT_NOT_SPECIFIED", getActionName() ) ); //$NON-NLS-1$
        }
      } else if ( getActionDefinition() instanceof HQLConnectionAction ) {
View Full Code Here


  protected boolean executeAction() {
    boolean returnValue = true;

    try {
      if ( getActionDefinition() instanceof HQLQueryAction ) {
        HQLQueryAction queryAction = (HQLQueryAction) getActionDefinition();
        String[] classNames = null;
        String query = queryAction.getQuery().getStringValue();

        if ( queryAction.getInputSharedConnection() != ActionInputConstant.NULL_INPUT ) {
          connectionOwner = false;
          IPreparedComponent component = (IPreparedComponent) queryAction.getInputSharedConnection().getValue();
          IPentahoConnection conn = component.shareConnection();
          if ( IPentahoConnection.HQL_DATASOURCE.equals( conn.getDatasourceType() ) ) {
            connection = conn;
          } else {
            connection = null;
            returnValue = false;
            error( Messages.getInstance().getErrorString(
                "IPreparedComponent.ERROR_0001_INVALID_CONNECTION_TYPE", getActionName() ) ); //$NON-NLS-1$           
          }
        } else {
          createBasicConnection( queryAction, classNames );
        }

        if ( connection != null ) {
          IActionOutput actionOutput = queryAction.getOutputPreparedStatementParam();
          if ( actionOutput != null ) {
            // prepare the query for execution, but don't execute quite yet.
            prepareQuery( query );

            // set the output as self, which will be used later by another component.
View Full Code Here

TOP

Related Classes of org.pentaho.actionsequence.dom.actions.HQLQueryAction

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.