Tabnine Logo
ExecutionFactory.supportsDirectQueryProcedure
Code IndexAdd Tabnine to your IDE (free)

How to use
supportsDirectQueryProcedure
method
in
org.teiid.translator.ExecutionFactory

Best Java code snippets using org.teiid.translator.ExecutionFactory.supportsDirectQueryProcedure (Showing top 5 results out of 315)

origin: teiid/teiid

@Override
public boolean supportsDirectQueryProcedure() {
  return delegate.supportsDirectQueryProcedure();
}
public void setSupportsDirectQueryProcedure(boolean value) {
origin: teiid/teiid

/**
 * Create an execution object for the specified command  
 * @param command the command
 * @param executionContext Provides information about the context that this command is
 * executing within, such as the identifiers for the command being executed
 * @param metadata Access to runtime metadata if needed to translate the command
 * @param connection connection factory object to the data source
 * @return An execution object that can use to execute the command
 */
public Execution createExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, C connection) throws TranslatorException {
  if (command instanceof Call) {
    Call obj = (Call)command;
    //TODO: our extension property support in designer makes ad-hoc properties impossible, so
    //we just match based upon name.  it would be better to have the metadatarepository/tooling add a teiid property
    //to explicitly set this proc as direct.
    //the other approach would be to addd a native system stored procedure, but that would require
    //special security semantics, whereas this proc can be secured on a schema basis
    if (supportsDirectQueryProcedure() && obj.getMetadataObject().getName().equals(getDirectQueryProcedureName())) {
      List<Argument> arguments = obj.getArguments();
      return createDirectExecution(arguments, command, executionContext, metadata, connection);
    }
  }
  if (command instanceof QueryExpression) {
    return createResultSetExecution((QueryExpression)command, executionContext, metadata, connection);
  }
  if (command instanceof Call) {
    return createProcedureExecution((Call)command, executionContext, metadata, connection);
  }
  return createUpdateExecution(command, executionContext, metadata, connection);
}
origin: org.teiid/teiid-engine

  @Override
  public void loadMetadata(MetadataFactory factory, ExecutionFactory executionFactory, Object connectionFactory) throws TranslatorException {

    if (executionFactory != null && executionFactory.supportsDirectQueryProcedure() && factory.getSchema().getProcedure(executionFactory.getDirectQueryProcedureName()) == null) {
      Procedure p = factory.addProcedure(executionFactory.getDirectQueryProcedureName());
      p.setAnnotation("Invokes translator with a native query that returns results in an array of values"); //$NON-NLS-1$

      ProcedureParameter param = factory.addProcedureParameter("request", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
      param.setAnnotation("The native query to execute"); //$NON-NLS-1$
      param.setNullType(NullType.No_Nulls);

      param = factory.addProcedureParameter("variable", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p); //$NON-NLS-1$
      param.setAnnotation("Any number of varaibles; usage will vary by translator"); //$NON-NLS-1$
      param.setNullType(NullType.Nullable);
      param.setVarArg(true);
      
      factory.addProcedureResultSetColumn("tuple", DataTypeManager.getDataTypeName(DataTypeManager.getArrayType(TypeFacility.RUNTIME_TYPES.OBJECT)), p); //$NON-NLS-1$		
    }
  }    
}
origin: teiid/teiid

  @Override
  public void loadMetadata(MetadataFactory factory, ExecutionFactory executionFactory, Object connectionFactory) throws TranslatorException {

    if (executionFactory != null && executionFactory.supportsDirectQueryProcedure() && factory.getSchema().getProcedure(executionFactory.getDirectQueryProcedureName()) == null) {
      Procedure p = factory.addProcedure(executionFactory.getDirectQueryProcedureName());
      p.setAnnotation("Invokes translator with a native query that returns results in an array of values"); //$NON-NLS-1$

      ProcedureParameter param = factory.addProcedureParameter("request", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
      param.setAnnotation("The native query to execute"); //$NON-NLS-1$
      param.setNullType(NullType.No_Nulls);

      param = factory.addProcedureParameter("variable", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p); //$NON-NLS-1$
      param.setAnnotation("Any number of varaibles; usage will vary by translator"); //$NON-NLS-1$
      param.setNullType(NullType.Nullable);
      param.setVarArg(true);
      
      factory.addProcedureResultSetColumn("tuple", DataTypeManager.getDataTypeName(DataTypeManager.getArrayType(TypeFacility.RUNTIME_TYPES.OBJECT)), p); //$NON-NLS-1$		
    }
  }    
}
origin: org.jboss.teiid/teiid-engine

  @Override
  public void loadMetadata(MetadataFactory factory, ExecutionFactory executionFactory, Object connectionFactory) throws TranslatorException {

    if (executionFactory != null && executionFactory.supportsDirectQueryProcedure() && factory.getSchema().getProcedure(executionFactory.getDirectQueryProcedureName()) == null) {
      Procedure p = factory.addProcedure(executionFactory.getDirectQueryProcedureName());
      p.setAnnotation("Invokes translator with a native query that returns results in an array of values"); //$NON-NLS-1$

      ProcedureParameter param = factory.addProcedureParameter("request", TypeFacility.RUNTIME_NAMES.STRING, Type.In, p); //$NON-NLS-1$
      param.setAnnotation("The native query to execute"); //$NON-NLS-1$
      param.setNullType(NullType.No_Nulls);

      param = factory.addProcedureParameter("variable", TypeFacility.RUNTIME_NAMES.OBJECT, Type.In, p); //$NON-NLS-1$
      param.setAnnotation("Any number of varaibles; usage will vary by translator"); //$NON-NLS-1$
      param.setNullType(NullType.Nullable);
      param.setVarArg(true);
      
      factory.addProcedureResultSetColumn("tuple", DataTypeManager.getDataTypeName(DataTypeManager.getArrayType(TypeFacility.RUNTIME_TYPES.OBJECT)), p); //$NON-NLS-1$		
    }
  }    
}
org.teiid.translatorExecutionFactorysupportsDirectQueryProcedure

Javadoc

True, if this translator supports execution of source specific commands unaltered through a direct procedure.

Popular methods of ExecutionFactory

  • start
  • createExecution
  • getMetadata
  • isSourceRequired
  • areLobsUsableAfterClose
  • closeConnection
  • getCacheDirective
  • getCollationLocale
  • getConnection
  • getDefaultNullOrder
  • getDirectQueryProcedureName
  • getExcludedCommonTableExpressionName
  • getDirectQueryProcedureName,
  • getExcludedCommonTableExpressionName,
  • getMaxDependentInPredicates,
  • getMaxFromGroups,
  • getMaxInCriteriaSize,
  • getPushDownFunctions,
  • getRequiredLikeEscape,
  • getSupportedFunctions,
  • getSupportedJoinCriteria,
  • getTransactionSupport

Popular in Java

  • Finding current android device location
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • requestLocationUpdates (LocationManager)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • BoxLayout (javax.swing)
  • Option (scala)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now