Jon Stevens wrote:
>
> Hey John, this looks very good.
>
> > c.or(d);
>
> Maybe make more method overloading that allows you to just define something
> like this:
>
> Criteria.Criterion c = crit.getNewCriterion("SCARAB_MODULE",
> "MODULE_NAME", "name", Criteria.EQUAL);
> c.or ("SCARAB_MODULE", "MODULE_DESCRIPTION", "%serious%", Criteria.LIKE);
>
> That would have the same effect as doing this:
>
> Criteria.Criterion c = crit.getNewCriterion("SCARAB_MODULE",
> "MODULE_NAME", "name", Criteria.EQUAL);
> Criteria.Criterion d = crit.getNewCriterion("SCARAB_MODULE",
> "MODULE_DESCRIPTION", "%serious%", Criteria.LIKE);
> c.or(d);
>
> It just seems cleaner to me than having to always first get a reference to
> the Criterion object when you may not really need it.
Yes, this would be nice. But the number of convenience methods in
Criteria is already quite large, I did not feel like adding another
complete set. (JDE/Emacs is already having trouble fontifying this
class, and I can't seem to shut it off.) Since I am just adding this
functionality I think it is possible to use the standard add methods in
most cases. If someone has more complex needs, they can volunteer to
add the extra convenience methods.
>
> > FROM SCARAB_R_MODULE_USER, SCARAB_MODULE, SCARAB_MODULE f, SCARAB_ISSUE
>
> Shouldn't SCARAB_MODULE only need to be defined once?
>
> Also, if you add an alias for a table name, then it should probably be used
> throughout the rest of the SQL statement instead of the main table name. Am
> I wrong in that thinking?
>
You are right in your thinking. I was just showing how the sql would
get added to define the alias, it is up to the developer to build the
rest of the statement correctly. The only reason I want this
functionality is to allow self-joins, so the table would be include
twice, probably with an alias for both. Though it can be used to
shorten the sql statement as well, might consider it at some point.
John McNally
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]