Connections are not required for a translator. This can be declared by calling setSourceRequired(false) in the translator constructor.
If you functions are static, then more than likely they should added as UDFs and not tied to a particular translator. Are you trying to expose functions or stored procedures?
Steven, thank you for your prompt reply. Maybe I should have expressed myself more clearly. I do not want to execute a SQL function or procedure. Instead I want to use a method that is defined in the connector (the implementation class of BasicConnection), or in my case SalesforceConnectionImpl. The Salesforce API provide a "upsert()" method (combination of insert/update) which is very useful in some circumstances (especially in cloud computing). So my intention is to extend the Salesforce connector with an "upsert" method and call that method directly. I thought of something like that:
Context ctx = new InitialContext();
org.teiid.resource.spi.WrappedConnectionFactory wrapper = ctx.lookup("java:/salesforceDS"); // jndi-name of resource adapter connection
Connection con = wrapper.getConnection();
... and so on.
But I have no idea how to cast it to the SalesforceConnectionImpl class to reach the methods. Or is there an error in my reasoning? Since I am new in TEIID I don't know if that all is possible using UDF's.
There is an existing issue: [TEIID-3630] Support merge statement pushdown - JBoss Issue Tracker that would allow Teiid to pushdown a merge statement directly. That is probably the preferred solution.
To do this on your own you have to fork / extend the SalesforceConnection / SalesforceConnectionImpl to expose the upsert call, then utilize that in an extended translator - which would initially only work through the direct query procedure.
Can you add a subtask to TEIID-3630 specifically for Salesforce?
Thanks. We should be able to get this into 9.2.