AND p.language = #{query.language}
</if>
<if test="query.nameOrKeyQuery!=null">
- AND (exists (
- select 1
- from resource_index ri
- where
- ri.resource_id=p.id
- AND ri.qualifier in
- <foreach collection="query.qualifiers" item="qualifier" open="(" close=")" separator=",">
- #{qualifier}
- </foreach>
- AND ri.kee like #{query.nameOrKeyQueryToSqlForResourceIndex} ESCAPE '/')
- OR p.kee like #{query.nameOrKeyQueryToSqlForProjectKey} ESCAPE '/')
+ AND (
+ exists (
+ select 1
+ from resource_index ri
+ where
+ ri.resource_id=p.id
+ AND ri.qualifier in
+ <foreach collection="query.qualifiers" item="qualifier" open="(" close=")" separator=",">
+ #{qualifier}
+ </foreach>
+ AND ri.kee like #{query.nameOrKeyQueryToSqlForResourceIndex} ESCAPE '/')
+ OR p.kee = #{query.nameOrKeyQuery})
</if>
</where>
</sql>
</foreach>
</if>
<if test="query.nameOrKeyQuery!=null">
- AND (exists (
- select 1
- from resource_index ri
- where
- (ri.resource_id=p.id OR ri.resource_id=p.copy_resource_id)
- AND ri.kee like #{query.nameOrKeyQueryToSqlForResourceIndex} ESCAPE '/')
- OR p.kee like #{query.nameOrKeyQueryToSqlForProjectKey} ESCAPE '/')
+ AND (
+ exists (
+ select 1
+ from resource_index ri
+ where
+ (ri.resource_id=p.id OR ri.resource_id=p.copy_resource_id)
+ AND ri.kee like #{query.nameOrKeyQueryToSqlForResourceIndex} ESCAPE '/')
+ OR p.kee = #{query.nameOrKeyQuery})
</if>
</sql>
db.commit();
componentDb.indexProjects();
- ComponentQuery query = ComponentQuery.builder().setNameOrKeyQuery("project-_%-").setQualifiers(Qualifiers.PROJECT).build();
+ ComponentQuery query = ComponentQuery.builder().setNameOrKeyQuery("project-_%-key").setQualifiers(Qualifiers.PROJECT).build();
List<ComponentDto> result = underTest.selectByQuery(dbSession, query, 0, 10);
assertThat(result).hasSize(1);
componentDb.indexProjects();
ComponentTreeQuery query = newTreeQuery(projectSnapshot)
- .setNameOrKeyQuery("file-key").build();
+ .setNameOrKeyQuery("file-key-1").build();
List<ComponentDtoWithSnapshotId> result = underTest.selectDirectChildren(dbSession, query);
int count = underTest.countDirectChildren(dbSession, query);