// From root project
List<SnapshotDto> snapshots = sut.findChildrenModulesFromModule(session, "org.struts:struts");
assertThat(snapshots).hasSize(2);
- assertThat(snapshots).onProperty("id").containsOnly(2L, 3L);
- assertThat(snapshots).onProperty("last").containsOnly(true);
+ assertThat(snapshots).onProperty("resourceId").containsOnly(2L, 3L);
+ assertThat(snapshots).onProperty("parentId").containsOnly(1L, 2L);
// From module
snapshots = sut.findChildrenModulesFromModule(session, "org.struts:struts-core");
assertThat(snapshots).hasSize(1);
- assertThat(snapshots).onProperty("id").containsOnly(3L);
+ assertThat(snapshots).onProperty("resourceId").containsOnly(3L);
+ assertThat(snapshots).onProperty("parentId").containsOnly(2L);
// From sub module
snapshots = sut.findChildrenModulesFromModule(session, "org.struts:struts-data");
</select>
<sql id="selectChildrenModulesFromModuleQuery">
- SELECT <include refid="org.sonar.core.component.db.SnapshotMapper.snapshotColumns"/>
+ SELECT s.project_id as resourceId, s.parent_snapshot_id as parentId
FROM snapshots s
INNER JOIN snapshots root_snapshot ON root_snapshot.id = s.root_snapshot_id AND root_snapshot.islast = ${_true}
- INNER JOIN snapshots current_snapshot ON current_snapshot.root_project_id = root_snapshot.project_id AND s.islast = ${_true}
+ INNER JOIN snapshots current_snapshot ON current_snapshot.root_project_id = root_snapshot.project_id AND current_snapshot.islast = ${_true}
INNER JOIN projects module ON module.id = current_snapshot.project_id AND module.enabled = ${_true} AND module.kee = #{moduleKey}
<where>
AND s.islast = ${_true}
SELECT prop.id as id, prop.prop_key as "key", prop.text_value as value, prop.resource_id as resourceId, prop.user_id as userId
FROM properties prop
INNER JOIN (<include refid="org.sonar.core.component.db.SnapshotMapper.selectChildrenModulesFromModuleQuery" />) snapshotModules on snapshotModules.resourceId=prop.resource_id
- INNER JOIN projects p on p.id = prop.resource_id
WHERE prop.user_id IS NULL
</select>