Search in sources :

Example 1 with MixinProxy

use of org.teiid.core.util.MixinProxy in project teiid by teiid.

the class JDBCExecutionFactory method getDialect.

public SQLDialect getDialect() {
    if (dialect == null) {
        String name = getHibernateDialectClassName();
        if (name != null) {
            try {
                Object impl = ReflectionHelper.create(name, null, this.getClass().getClassLoader());
                InvocationHandler handler = new MixinProxy(new Object[] { impl });
                this.dialect = (SQLDialect) Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class<?>[] { SQLDialect.class }, handler);
            } catch (TeiidException e) {
                // $NON-NLS-1$
                LogManager.logDetail(LogConstants.CTX_CONNECTOR, e, name, "could not be loaded");
            }
        }
        if (dialect == null) {
            dialect = new DefaultSQLDialect();
        }
    }
    return dialect;
}
Also used : MixinProxy(org.teiid.core.util.MixinProxy) InvocationHandler(java.lang.reflect.InvocationHandler) TeiidException(org.teiid.core.TeiidException)

Aggregations

InvocationHandler (java.lang.reflect.InvocationHandler)1 TeiidException (org.teiid.core.TeiidException)1 MixinProxy (org.teiid.core.util.MixinProxy)1