empire-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ivan nemeth <ivan.nem...@forumdigital.net>
Subject Constraints on the same column
Date Tue, 29 Jul 2014 15:10:48 GMT
Hi,

I tried to execute a query on a table which has a Date column. I want to
add the following constraint

TABLE.DATE >= ? AND TABLE.DATE <= ?

If I write

Date d0 = ...
Date d1 = ...

cmd.where(TABLE.DATE.isMoreOrEqual(d0));
cmd.where(TABLE.DATE.isLessOrEqual(d1));

then the first constraint is removed, and only the second is valid (I know
this is a between constraint).
The documentation of the DBCommand.where method says

<If another restriction already exists for the same column it will be
replaced.>

(However if I add the two constraint through the
DBCommand.addWhereConstraints method, it works.)

Why is the previous constraint on the same column removed, what is the
logic behind it? I think it's the developers responsibility not to make
mutually exclusive conditions. Or am I missing something?

Thanks,
Ivan

Mime
View raw message