I love the pruneMissing feature, personally. I could see perhaps
wanting Cayenne to warn you (via a log message or something) if you
provide Map entries which don't fit into the expression (in case of
typos). This would slow it down a tad, though.
Alternatively, you could also create constant strings to help out.
public fooMethod()
{
final String FOO = "myFooVariable";
...
}
Then just reference FOO instead of "myFooVariable" whenever you need to
use it. Of course, you'd have to be careful to include the $ in your
expression, but that's what debugging and testing is for, right? :-)
/dev/mrg
-----Original Message-----
From: Gili [mailto:cowwo..bs.darktech.org]
Sent: Thursday, September 08, 2005 11:36 PM
To: cayenne-deve..bjectstyle.org
Subject: SelectQuery.queryWithParameters(ignoreMismatch)
Hi,
I'd like to propose we modify
queryWithParameters(java.util.Map parameters, boolean pruneMissing)
to
queryWithParameters(java.util.Map parameters, boolean ignoreMismatch)
where "ignoreMismatch" is the equivilent of "pruneMissing" as
well as
ignoring when the user provides too many parameters.
I bring this up because I ran into a situation where I was
running a
SelectQuery and it was consistently failing to behave as I expected.
After further investigation I noticed that my mapped SelectQuery's
qualifier string was incorrect. Something as simple as a typo in the
qualifier string is enough to cause the query to fail silently.
We should be able to execute in some sort of "strict mode" where
Cayenne throws an exception if too little or too many parameters are
provided (frankly, I'd love for strict mode to be the default -- right
now the opposite is true). I'm willing to work on this if you guys okay
this change. What do you think?
Gili
-- http://www.desktopbeautifier.com/
This archive was generated by hypermail 2.0.0 : Fri Sep 09 2005 - 09:51:57 EDT