private boolean isTVF(Procedure proc) { String value = proc.getProperty(PIMetadataProcessor.TVF, false); return Boolean.parseBoolean(value); }
private boolean isFunction(Procedure proc) { ODataType type = ODataType.valueOf(proc.getProperty(ODataMetadataProcessor.ODATA_TYPE, false)); return type == ODataType.FUNCTION; }
private static void removeProcedureOption(String key, Procedure proc) { if (proc.getProperty(key, false) != null) { proc.setProperty(key, null); } removeCommonProperty(key, proc); if (key.equals("UPDATECOUNT")) { //$NON-NLS-1$ proc.setUpdateCount(1); } }
private static void removeProcedureOption(String key, Procedure proc) { if (proc.getProperty(key, false) != null) { proc.setProperty(key, null); } removeCommonProperty(key, proc); if (key.equals("UPDATECOUNT")) { //$NON-NLS-1$ proc.setUpdateCount(1); } }
private static void removeProcedureOption(String key, Procedure proc) { if (proc.getProperty(key, false) != null) { proc.setProperty(key, null); } removeCommonProperty(key, proc); if (key.equals("UPDATECOUNT")) { //$NON-NLS-1$ proc.setUpdateCount(1); } }
private boolean isTVF(TableReference table) { if (table instanceof NamedTable) { String value = ((NamedTable)table).getMetadataObject().getProperty(PIMetadataProcessor.TVF, false); return Boolean.parseBoolean(value); } else if (table instanceof NamedProcedureCall) { String value = ((NamedProcedureCall)table).getCall().getMetadataObject().getProperty(PIMetadataProcessor.TVF, false); return Boolean.parseBoolean(value); } return false; }
private String buildProcedureOptions(Procedure procedure) { StringBuilder options = new StringBuilder(); addCommonOptions(options, procedure); if (procedure.getUpdateCount() != Procedure.AUTO_UPDATECOUNT) { addOption(options, UPDATECOUNT, procedure.getUpdateCount()); } if (!procedure.getProperties().isEmpty()) { for (String key:procedure.getProperties().keySet()) { addOption(options, key, procedure.getProperty(key, false)); } } return options.toString(); }
private String buildProcedureOptions(Procedure procedure) { StringBuilder options = new StringBuilder(); addCommonOptions(options, procedure); if (procedure.getUpdateCount() != Procedure.AUTO_UPDATECOUNT) { addOption(options, UPDATECOUNT, procedure.getUpdateCount()); } if (!procedure.getProperties().isEmpty()) { for (String key:procedure.getProperties().keySet()) { addOption(options, key, procedure.getProperty(key, false)); } } return options.toString(); }
private String buildProcedureOptions(Procedure procedure) { StringBuilder options = new StringBuilder(); addCommonOptions(options, procedure); if (procedure.getUpdateCount() != Procedure.AUTO_UPDATECOUNT) { addOption(options, UPDATECOUNT, procedure.getUpdateCount()); } if (!procedure.getProperties().isEmpty()) { for (String key:procedure.getProperties().keySet()) { addOption(options, key, procedure.getProperty(key, false)); } } return options.toString(); }
@Override public ProcedureExecution createProcedureExecution(Call command,ExecutionContext executionContext, RuntimeMetadata metadata, SalesforceConnection connection) throws TranslatorException { Procedure metadataObject = command.getMetadataObject(); String nativeQuery = metadataObject.getProperty(SQLStringVisitor.TEIID_NATIVE_QUERY, false); if (nativeQuery != null) { return new DirectQueryExecution(command.getArguments(), command, connection, metadata, executionContext, nativeQuery, false); } return new ProcedureExecutionParentImpl(command, connection, metadata, executionContext); }
String uri = procedure.getProperty(REST_NAMESPACE+"URI", false); //$NON-NLS-1$ String method = procedure.getProperty(REST_NAMESPACE+"METHOD", false); //$NON-NLS-1$ if (uri != null && method != null) { return true;
/** * @see org.teiid.language.visitor.SQLStringVisitor#visit(org.teiid.language.Call) */ public void visit(Call obj) { usingBinding = true; Procedure p = obj.getMetadataObject(); if (p != null) { String nativeQuery = p.getProperty(TEIID_NATIVE_QUERY, false); if (nativeQuery != null) { this.prepared = !Boolean.valueOf(p.getProperty(TEIID_NON_PREPARED, false)); if (this.prepared) { this.preparedValues = new ArrayList<Object>(); } parseNativeQueryParts(nativeQuery, obj.getArguments(), buffer, this); return; } } if (obj.isTableReference()) { usingBinding = false; super.visit(obj); return; } this.prepared = true; /* * preparedValues is now a list of procedure params instead of just values */ this.preparedValues = obj.getArguments(); buffer.append(generateSqlForStoredProcedure(obj)); }
@Override public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, GoogleSpreadsheetConnection connection) throws TranslatorException { String nativeQuery = command.getMetadataObject().getProperty(SQLStringVisitor.TEIID_NATIVE_QUERY, false); if (nativeQuery != null) { return new DirectSpreadsheetQueryExecution(nativeQuery, command.getArguments(), executionContext, connection, false); } throw new TranslatorException("Missing native-query extension metadata."); //$NON-NLS-1$ }
@Override public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, WSConnection connection) throws TranslatorException { String nativeQuery = command.getMetadataObject().getProperty(SQLStringVisitor.TEIID_NATIVE_QUERY, false); if (nativeQuery != null) { throw new TranslatorException(ODataPlugin.Util.gs(ODataPlugin.Event.TEIID17014)); } return new ODataProcedureExecution(command, this, executionContext, metadata, connection); }
@Override public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, EntityManager connection) throws TranslatorException { String nativeQuery = command.getMetadataObject().getProperty(SQLStringVisitor.TEIID_NATIVE_QUERY, false); if (nativeQuery != null) { return new JPQLDirectQueryExecution(command.getArguments(), command, executionContext, metadata, connection, nativeQuery, false); } throw new TranslatorException("Missing native-query extension metadata."); //$NON-NLS-1$ }
@Override public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, WSConnection connection) throws TranslatorException { String nativeQuery = command.getMetadataObject().getProperty( SQLStringVisitor.TEIID_NATIVE_QUERY, false); if (nativeQuery != null) { throw new TranslatorException(ODataPlugin.Util.gs(ODataPlugin.Event.TEIID17014)); } return new ODataProcedureExecution(command, this, executionContext, metadata, connection); }
@Override public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, LdapContext connection) throws TranslatorException { String nativeQuery = command.getMetadataObject().getProperty(SQLStringVisitor.TEIID_NATIVE_QUERY, false); if (nativeQuery != null) { if (nativeQuery.startsWith("search;")) { //$NON-NLS-1$ return new LDAPDirectSearchQueryExecution(command.getArguments(), this, executionContext, connection, nativeQuery, false); } return new LDAPDirectCreateUpdateDeleteQueryExecution(command.getArguments(), this, executionContext, connection, nativeQuery, false); } throw new TranslatorException("Missing native-query extension metadata."); //$NON-NLS-1$ }
@Override public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, MongoDBConnection connection) throws TranslatorException { String nativeQuery = command.getMetadataObject().getProperty(SQLStringVisitor.TEIID_NATIVE_QUERY, false); if (nativeQuery != null) { return new MongoDBDirectQueryExecution(command.getArguments(), command, executionContext, metadata, connection, nativeQuery, false, this); } throw new TranslatorException(MongoDBPlugin.Util.gs(MongoDBPlugin.Event.TEIID18011)); }
@Override public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, Connection connection) throws TranslatorException { String nativeQuery = command.getMetadataObject().getProperty(SQLStringVisitor.TEIID_NATIVE_QUERY, false); if (nativeQuery != null) { return new OlapQueryExecution(command.getArguments(), command, unwrap(connection), executionContext, this, nativeQuery, false); } throw new TranslatorException("Missing native-query extension metadata."); //$NON-NLS-1$ }
@Override public void visit(Call call) { if (oracleSuppliedDriver && call.getResultSetColumnTypes().length > 0 && call.getMetadataObject() != null) { if (call.getReturnType() == null && call.getMetadataObject().getProperty(SQLConversionVisitor.TEIID_NATIVE_QUERY, false) == null) { //assume stored function handling if (!setOutCursorType(call)) { call.setReturnType(RefCursorType.class); } } else { //TODO we only will allow a single out cursor if (call.getMetadataObject() != null) { ProcedureParameter param = call.getReturnParameter(); if (param != null && REF_CURSOR.equalsIgnoreCase(param.getNativeType())) { call.setReturnType(RefCursorType.class); } } setOutCursorType(call); } } super.visit(call); }