예제 #1
0
 /**
  * Return a connection object from the given connection factory.
  *
  * <p>The default implementation assumes a JCA {@link ConnectionFactory}. Subclasses should
  * override, if they use another type of connection factory.
  *
  * @deprecated
  * @see #getConnection(Object, ExecutionContext)
  * @param factory
  * @return a connection
  * @throws TranslatorException
  */
 @Deprecated
 @SuppressWarnings("unchecked")
 public C getConnection(F factory) throws TranslatorException {
   if (factory == null) {
     return null;
   }
   if (factory instanceof ConnectionFactory) {
     try {
       return (C) ((ConnectionFactory) factory).getConnection();
     } catch (ResourceException e) {
       throw new TranslatorException(DataPlugin.Event.TEIID60000, e);
     }
   }
   throw new AssertionError(
       factory.getClass().getName()
           + " is was not a ConnectionFactory implementation"); //$NON-NLS-1$
 }
 public FunctionExpression(F function) {
   this((Class) function.getClass(), function, null, Collections.<ParameterExpression>emptyList());
 }