empire-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis De Brabandere <franci...@gmail.com>
Subject Re: Problem with DBCommand.addWhereConstraints
Date Fri, 11 Sep 2015 10:55:56 GMT
Hi Ivan,

indeed sounds like a good idea, would you mind creating a ticket for this?
https://issues.apache.org/jira/browse/EMPIREDB

Cheers,
Francis


On 11 September 2015 at 12:49, Ivan Nemeth <ivan.nemeth@gmail.com> wrote:

> Hi,
>
> if you add an empty constraint list to DBCommand through
> addWhereConstraints, the resulting sql will end with an empty WHERE.
>
> Example:
>
> DBCommand cmd = db.createCommand();
> cmd.select(TABLE.getColumns());
> cmd.addWhereConstraints(new ArrayList());
>
> The generated sql will be something like this:
>
> "SELECT t0.name FROM table t0 WHERE"
>
> Since we use dynamically built queries we have to check every time whether
> the constraint list is empty.
>
> I think a check for an empty list  either in DBCommand.addWhereConstraint
> method or in DBCommand.addWhere(Stringbuffer...) method would solve this
> issue.
>
> Regards,
> Ivan
>

Mime
View raw message