use of com.epam.ta.reportportal.jooq.tables.JTestItem in project commons-dao by reportportal.
the class TestItemRepositoryCustomImpl method selectIdsByAnalyzedWithLevelGte.
/**
* {@link Log} entities are searched from the whole tree under
* {@link TestItem} that matched to the provided `launchId` and `autoAnalyzed` conditions
*/
@Override
public List<Long> selectIdsByAnalyzedWithLevelGte(boolean autoAnalyzed, Long launchId, int logLevel) {
JTestItem outerItemTable = TEST_ITEM.as(OUTER_ITEM_TABLE);
JTestItem nestedItemTable = TEST_ITEM.as(NESTED);
return dsl.selectDistinct(fieldName(ID)).from(DSL.select(outerItemTable.ITEM_ID.as(ID)).from(outerItemTable).join(TEST_ITEM_RESULTS).on(outerItemTable.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)).join(ISSUE).on(TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)).where(outerItemTable.LAUNCH_ID.eq(launchId)).and(outerItemTable.HAS_STATS).andNot(outerItemTable.HAS_CHILDREN).and(ISSUE.AUTO_ANALYZED.eq(autoAnalyzed)).and(DSL.exists(DSL.selectOne().from(nestedItemTable).join(LOG).on(nestedItemTable.ITEM_ID.eq(LOG.ITEM_ID)).where(nestedItemTable.LAUNCH_ID.eq(launchId)).andNot(nestedItemTable.HAS_STATS).and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)).and(DSL.sql(outerItemTable.PATH + " @> " + nestedItemTable.PATH)))).unionAll(DSL.selectDistinct(TEST_ITEM.ITEM_ID.as(ID)).from(TEST_ITEM).join(TEST_ITEM_RESULTS).on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)).join(ISSUE).on(TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)).join(LOG).on(TEST_ITEM.ITEM_ID.eq(LOG.ITEM_ID)).where(TEST_ITEM.LAUNCH_ID.eq(launchId)).and(ISSUE.AUTO_ANALYZED.eq(autoAnalyzed)).and(LOG.LOG_LEVEL.greaterOrEqual(logLevel))).asTable(ITEM)).fetchInto(Long.class);
}
use of com.epam.ta.reportportal.jooq.tables.JTestItem in project commons-dao by reportportal.
the class TestItemRepositoryCustomImpl method selectIdsByHasDescendants.
@Override
public List<Long> selectIdsByHasDescendants(Collection<Long> itemIds) {
final JTestItem parent = TEST_ITEM.as(OUTER_ITEM_TABLE);
final JTestItem child = TEST_ITEM.as(CHILD_ITEM_TABLE);
return dsl.select(parent.ITEM_ID).from(parent).join(child).on(parent.ITEM_ID.eq(child.PARENT_ID)).where(parent.ITEM_ID.in(itemIds)).groupBy(parent.ITEM_ID).fetchInto(Long.class);
}
Aggregations