Function and Literal expressions can be non-deterministic but in most cases they are safe, and giving them proper toString()'s will help caching quite a bit.

This commit is contained in:
Par Winzell
2009-01-21 21:39:48 +00:00
parent 017d9242ac
commit 7dbc58d426
2 changed files with 12 additions and 0 deletions
@@ -20,6 +20,8 @@
package com.samskivert.depot.expression;
import com.samskivert.util.StringUtil;
import java.util.Collection;
import com.samskivert.depot.PersistentRecord;
@@ -63,6 +65,11 @@ public class FunctionExp implements SQLExpression
return _arguments;
}
public String toString ()
{
return _function + "(" + StringUtil.join(_arguments, ", ") + ")";
}
/** The literal name of this function, e.g. FLOOR */
protected String _function;
@@ -53,6 +53,11 @@ public class LiteralExp
return _text;
}
public String toString ()
{
return _text;
}
/** The literal text of this expression, e.g. COUNT(*) */
protected String _text;
}