if (args == null || args.size() != 2)
{
throw new NucleusException(LOCALISER.msg("060016", "containsValue", "MapExpression", 2));
}
MapExpression mapExpr = (MapExpression)expr;
SQLExpression keyExpr = (SQLExpression)args.get(0);
SQLExpression valExpr = (SQLExpression)args.get(1);
if (keyExpr.isParameter())
{
// Key is a parameter so make sure its type is set
AbstractMemberMetaData mmd = mapExpr.getJavaTypeMapping().getMemberMetaData();
if (mmd != null && mmd.getMap() != null)
{
Class keyCls = stmt.getQueryGenerator().getClassLoaderResolver().classForName(mmd.getMap().getKeyType());
stmt.getQueryGenerator().bindParameter(keyExpr.getParameterName(), keyCls);
}
}
if (valExpr.isParameter())
{
// Value is a parameter so make sure its type is set
AbstractMemberMetaData mmd = mapExpr.getJavaTypeMapping().getMemberMetaData();
if (mmd != null && mmd.getMap() != null)
{
Class valCls = stmt.getQueryGenerator().getClassLoaderResolver().classForName(mmd.getMap().getValueType());
stmt.getQueryGenerator().bindParameter(valExpr.getParameterName(), valCls);
}