JBoss Community Archive (Read Only)

Teiid 9.0 (draft)

PreParser

If it is desirable to manipulate incoming queries prior to being handled by Teiid logic, then a custom pre-parser can be installed. Use the PreParser interface provided in the org.teiid.api jar to plug-in a pre-parser for the Teiid engine. See Setting up the build environment to start development. For Example:

Sample Java Code
import org.teiid.PreParser;
...

package com.something;

public class CustomPreParser implements PreParser {

    @Override
    public String preParse(String command, CommandContext context) {
        //manipulate the command
    }
}

Then build a JAR archive with above implementation class and create a file named org.teiid.PreParser in META-INF/services directory with contents:

com.something.CustomPreParser

The the jar has been built, this needs to be deployed in the JBoss AS as a module under <jboss-as>/modules directory. Follow the below steps to create a module.

Sample module.xml file
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.something">
    <resources>
        <resource-root path="something.jar" />
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.resource.api"/>
        <module name="org.jboss.teiid.common-core"/>
        <module name="org.jboss.teiid.teiid-api" />
    </dependencies>
</module>

Development Considerations

  • Changing the incoming query to a different type of statement is not recommended as are any modifications to the number or types of projected symbols.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 13:10:24 UTC, last content change 2015-03-12 15:25:16 UTC.