return mapper(session).countByQuery(query);
}
- public boolean existsById(Long id, DbSession session) {
- return mapper(session).countById(id) > 0;
- }
-
public List<ComponentDto> selectSubProjectsByComponentUuids(DbSession session, Collection<String> keys) {
if (keys.isEmpty()) {
return emptyList();
/**
* List of ancestors, ordered from root to parent. The list is empty
- * if the component is a tree root.
+ * if the component is a tree root. Disabled components are excluded by design
+ * as tree represents the more recent analysis.
*/
public List<ComponentDto> selectAncestors(DbSession dbSession, ComponentDto component) {
if (component.isRoot()) {
assertThat(underTest.selectById(dbSession, 111L)).isAbsent();
}
- @Test
- public void count_by_id() {
- db.prepareDbUnit(getClass(), "shared.xml");
-
- assertThat(underTest.existsById(4L, dbSession)).isTrue();
- assertThat(underTest.existsById(111L, dbSession)).isFalse();
- }
-
@Test
public void select_component_keys_by_qualifiers() {
db.prepareDbUnit(getClass(), "shared.xml");