sqlMethodClassName = methodClassByDatastoreMethodName.get(key);
if (sqlMethodClassName == null)
{
if (className != null)
{
throw new NucleusUserException(LOCALISER.msg("060008", methodName, className));
}
else
{
throw new NucleusUserException(LOCALISER.msg("060009", methodName));
}
}
}
// Use SQLMethod().getExpression(SQLExpression, args)
try
{
method = (SQLMethod)stmt.getClassLoaderResolver().classForName(sqlMethodClassName).newInstance();
synchronized (method) // Only permit sole usage at any time
{
method.setStatement(stmt);
// Cache the method in case its used later
methodByClassMethodName.put(classMethodKey, method);
return method.getExpression(expr, args);
}
}
catch (ClassNotResolvedException cnre)
{
throw new NucleusUserException(LOCALISER.msg("060010", sqlMethodClassName));
}
catch (InstantiationException e)
{
throw new NucleusUserException(LOCALISER.msg("060011", sqlMethodClassName), e);
}
catch (IllegalAccessException e)
{
throw new NucleusUserException(LOCALISER.msg("060011", sqlMethodClassName), e);
}
}