small fixup

This commit is contained in:
Mengyi Zhou 2016-08-01 17:07:21 +08:00
parent d6b69ee485
commit 4dfad6490c
2 changed files with 15 additions and 0 deletions

View file

@ -141,6 +141,9 @@ public class GroupResource {
for (Group group : groupRepository.list(searchKeys)) {
listView.add(new ExtendedView.ExtendedGroup(group));
}
if (ViewConstraints.EXTENDED.equalsIgnoreCase(type)) {
viewDecorator.decorate(listView.getList(), "group");
}
if (listView.getTotal() == 0) throw new ValidationException("Group cannot be found.");
if (listView.getTotal() == 1) {

View file

@ -156,6 +156,18 @@
WHERE <FIELD name='id'/> = ${key-id}]]>
</statement>
</query>
<query name="update-status-by-target-and-topics" type="UPDATE" batch="true">
<param name="target-id"/>
<param name="topics"/>
<statement>
<![CDATA[
UPDATE <TABLE/>
SET <FIELD name='state'/> = ${state}
WHERE <FIELD name='target-id'/> = ${target-id}
AND <FIELD name='topic'/> IN <IN>${topics}</IN>
]]>
</statement>
</query>
</query-defs>
</entity>
</entities>