You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by "Ivan Nemeth (JIRA)" <em...@incubator.apache.org> on 2015/09/11 13:15:45 UTC
[jira] [Commented] (EMPIREDB-226) Empire generates incorrect SQL
when DBCommand's where list is empty
[ https://issues.apache.org/jira/browse/EMPIREDB-226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14740591#comment-14740591 ]
Ivan Nemeth commented on EMPIREDB-226:
--------------------------------------
Changing the condition in DBCommand.addWhere(StringBuilder buf, long context) method to
if (where != null && !where.isEmpty())
is a possible solution.
> Empire generates incorrect SQL when DBCommand's where list is empty
> -------------------------------------------------------------------
>
> Key: EMPIREDB-226
> URL: https://issues.apache.org/jira/browse/EMPIREDB-226
> Project: Empire-DB
> Issue Type: Bug
> Reporter: Ivan Nemeth
> Priority: Minor
>
> 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"
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)