Terry,
I don't remember if I mentioned that anywhere in the docs, but the old
style expressions (implemented as UnaryExpression, BinaryExpression and
TernaryExpression) can't be correctly serialized to strings.
There is a mismatch between the "new style" expressions and "old" ones.
"Old" expressions do everything they did in 1.0, but no more than that,
and will be eventually factored out in favor of "new" expressions. What
adds to the confusion is that ExpressionFactory is not fully switched
to the new form, so using its methods can produce a mixed expression
object that is useable throughout Cayenne (e.g. as a query qualifier),
except that it can't be stored as a valid string.
Conclusion - if you want to store/load expressions in your code, either
create them from string, or construct them manually using AST* classes
in exp.parser package.
Andrus
On Mar 23, 2004, at 1:56 PM, Terry Wilcox wrote:
> I'm trying to persist Expressions as strings, but I've hit an
> unexpected
> problem. Expression.fromString() doesn't parse the Strings created by
> Expressions' toString(), encodeAsString(), or encodeAsXML() methods.
>
> Am I missing something or do I have to create the String by hand?
>
> Thanks,
>
> Terry Wilcox
> terry.wilco..ntero.com
This archive was generated by hypermail 2.0.0 : Tue Mar 23 2004 - 14:24:57 EST