From 0f8a4899f4833c9441ad7961d2e95a02524f3428 Mon Sep 17 00:00:00 2001 From: Ivan Date: Mon, 15 Nov 2021 15:16:54 +0300 Subject: [PATCH 001/110] EPMRPP-48316 || Ignore analyzer condition added (#793) --- .../ta/reportportal/dao/TestItemRepositoryCustom.java | 2 +- .../reportportal/dao/TestItemRepositoryCustomImpl.java | 8 +++++--- .../ta/reportportal/dao/TestItemRepositoryTest.java | 10 ++++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java index b3ae88e70..2d6b98d56 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java @@ -311,7 +311,7 @@ Page loadItemsHistoryPage(boolean isLatest, Queryable launchFil * @param logLevel {@link Log#getLogLevel()} * @return The {@link List} of the {@link TestItem#getItemId()} */ - List selectIdsByAnalyzedWithLevelGte(boolean autoAnalyzed, Long launchId, int logLevel); + List selectIdsByAnalyzedWithLevelGte(boolean autoAnalyzed, boolean ignoreAnalyzer, Long launchId, int logLevel); /** * @param itemId {@link TestItem#itemId} diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java index a14db3250..0dfdf8cca 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java @@ -656,11 +656,13 @@ public Optional> selectPath(String uuid) { * {@link TestItem} that matched to the provided `launchId` and `autoAnalyzed` conditions */ @Override - public List selectIdsByAnalyzedWithLevelGte(boolean autoAnalyzed, Long launchId, int logLevel) { + public List selectIdsByAnalyzedWithLevelGte(boolean autoAnalyzed, boolean ignoreAnalyzer, Long launchId, int logLevel) { JTestItem outerItemTable = TEST_ITEM.as(OUTER_ITEM_TABLE); JTestItem nestedItemTable = TEST_ITEM.as(NESTED); + final Condition issueCondition = ISSUE.AUTO_ANALYZED.eq(autoAnalyzed).and(ISSUE.IGNORE_ANALYZER.eq(ignoreAnalyzer)); + return dsl.selectDistinct(fieldName(ID)) .from(DSL.select(outerItemTable.ITEM_ID.as(ID)) .from(outerItemTable) @@ -671,7 +673,7 @@ public List selectIdsByAnalyzedWithLevelGte(boolean autoAnalyzed, Long lau .where(outerItemTable.LAUNCH_ID.eq(launchId)) .and(outerItemTable.HAS_STATS) .andNot(outerItemTable.HAS_CHILDREN) - .and(ISSUE.AUTO_ANALYZED.eq(autoAnalyzed)) + .and(issueCondition) .and(DSL.exists(DSL.selectOne() .from(nestedItemTable) .join(LOG) @@ -689,7 +691,7 @@ public List selectIdsByAnalyzedWithLevelGte(boolean autoAnalyzed, Long lau .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(issueCondition) .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel))) .asTable(ITEM)) .fetchInto(Long.class); diff --git a/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java index 622357c07..f4dfb28f8 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java @@ -381,12 +381,18 @@ void selectIdsNotInIssueByLaunch() { } @Test - void selectByAutoAnalyzedStatus() { - List itemIds = testItemRepository.selectIdsByAnalyzedWithLevelGte(false, 1L, LogLevel.ERROR.toInt()); + void selectByAutoAnalyzedStatusNotIgnoreAnalyzer() { + List itemIds = testItemRepository.selectIdsByAnalyzedWithLevelGte(false, false, 1L, LogLevel.ERROR.toInt()); assertNotNull(itemIds); assertThat(itemIds, Matchers.hasSize(1)); } + @Test + void selectByAutoAnalyzedStatusIgnoreAnalyzer() { + List itemIds = testItemRepository.selectIdsByAnalyzedWithLevelGte(false, true, 1L, LogLevel.ERROR.toInt()); + assertTrue(itemIds.isEmpty()); + } + @Test void streamIdsByNotHasChildrenAndLaunchIdAndStatus() { From 01a6a482bb6fa0585f6f3c63738581a0eb51d378 Mon Sep 17 00:00:00 2001 From: Ivan Date: Thu, 18 Nov 2021 12:20:46 +0300 Subject: [PATCH 002/110] EPMRPP-68775 || Unique error analyzer attributes (#794) --- project-properties.gradle | 3 ++- .../ta/reportportal/entity/enums/ProjectAttributeEnum.java | 5 ++++- .../epam/ta/reportportal/dao/AttributeRepositoryTest.java | 2 +- .../com/epam/ta/reportportal/dao/ProjectRepositoryTest.java | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/project-properties.gradle b/project-properties.gradle index f18728d88..eb0ba3ba2 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -9,7 +9,7 @@ project.ext { dependencyRepos = ["commons", "commons-rules", "commons-model", "commons-bom"] releaseMode = project.hasProperty("releaseMode") scriptsUrl = commonScriptsUrl + (releaseMode ? getProperty('scripts.version') : '5.5.0') - migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'develop') + migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'EPMRPP-68775-auto-unique-error-analyzer-attributes') //TODO refactor with archive download testScriptsSrc = [ (migrationsUrl + '/migrations/0_extensions.up.sql') : 'V001__extensions.sql', @@ -62,6 +62,7 @@ project.ext { (migrationsUrl + '/migrations/48_composite_attribute.up.sql') : 'V048__composite_attribute.sql', (migrationsUrl + '/migrations/51_cluster.up.sql') : 'V051__cluster.sql', (migrationsUrl + '/migrations/52_analyzer_search_attribute.up.sql') : 'V052__analyzer_search_attribute.sql', + (migrationsUrl + '/migrations/54_analyzer_unique_error_attribute.up.sql') : 'V054__analyzer_unique_error_attribute.sql', ] excludeTests = [ diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java b/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java index f3fa3ef80..8fc0ce2b6 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java @@ -44,7 +44,9 @@ public enum ProjectAttributeEnum { AUTO_ANALYZER_ENABLED(Prefix.ANALYZER + "isAutoAnalyzerEnabled", String.valueOf(false)), AUTO_ANALYZER_MODE(Prefix.ANALYZER + "autoAnalyzerMode", AnalyzeMode.BY_LAUNCH_NAME.getValue()), ALL_MESSAGES_SHOULD_MATCH(Prefix.ANALYZER + "allMessagesShouldMatch", String.valueOf(false)), - SEARCH_LOGS_MIN_SHOULD_MATCH(Prefix.ANALYZER + "searchLogsMinShouldMatch", String.valueOf(ProjectAnalyzerConfig.MIN_SHOULD_MATCH)); + SEARCH_LOGS_MIN_SHOULD_MATCH(Prefix.ANALYZER + "searchLogsMinShouldMatch", String.valueOf(ProjectAnalyzerConfig.MIN_SHOULD_MATCH)), + AUTO_UNIQUE_ERROR_ANALYZER_ENABLED(Prefix.ANALYZER + Prefix.UNIQUE_ERROR + "enabled", String.valueOf(true)), + UNIQUE_ERROR_ANALYZER_REMOVE_NUMBERS(Prefix.ANALYZER + Prefix.UNIQUE_ERROR + "removeNumbers", String.valueOf(true)); public static final String FOREVER_ALIAS = "0"; private String attribute; @@ -74,6 +76,7 @@ public String getDefaultValue() { public static class Prefix { public static final String ANALYZER = "analyzer."; public static final String JOB = "job."; + public static final String UNIQUE_ERROR = "uniqueError."; } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/AttributeRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/AttributeRepositoryTest.java index bd6204435..bf1bd6bfe 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/AttributeRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/AttributeRepositoryTest.java @@ -88,6 +88,6 @@ void findById() { void deleteById() { final Long attrId = 100L; attributeRepository.deleteById(attrId); - assertEquals(13, attributeRepository.findAll().size()); + assertEquals(15, attributeRepository.findAll().size()); } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/dao/ProjectRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/ProjectRepositoryTest.java index 787a8d0b0..77c136087 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/ProjectRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/ProjectRepositoryTest.java @@ -59,7 +59,7 @@ void findAllIdsAndProjectAttributesTest() { projects.getContent().forEach(project -> { assertNotNull(project.getId()); assertTrue(CollectionUtils.isNotEmpty(project.getProjectAttributes())); - assertEquals(13, project.getProjectAttributes().size()); + assertEquals(15, project.getProjectAttributes().size()); assertTrue(project.getProjectAttributes() .stream() .anyMatch(pa -> ofNullable(pa.getValue()).isPresent() && pa.getAttribute() From ec3d010e17d0253451d8cf81f120de13c45afb33 Mon Sep 17 00:00:00 2001 From: Ivan Date: Wed, 24 Nov 2021 21:26:10 +0300 Subject: [PATCH 003/110] EPMRPP-68819 || New cluster removing methods added (#795) --- project-properties.gradle | 2 +- .../reportportal/dao/ClusterRepository.java | 5 +++++ .../ta/reportportal/dao/LogRepository.java | 4 ++++ .../epam/ta/reportportal/entity/Metadata.java | 17 +++++++++++++++++ .../dao/ClusterRepositoryTest.java | 17 +++++++++++++---- .../reportportal/dao/LogRepositoryTest.java | 19 +++++++++++++++++++ 6 files changed, 59 insertions(+), 5 deletions(-) diff --git a/project-properties.gradle b/project-properties.gradle index eb0ba3ba2..ee006fe20 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -9,7 +9,7 @@ project.ext { dependencyRepos = ["commons", "commons-rules", "commons-model", "commons-bom"] releaseMode = project.hasProperty("releaseMode") scriptsUrl = commonScriptsUrl + (releaseMode ? getProperty('scripts.version') : '5.5.0') - migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'EPMRPP-68775-auto-unique-error-analyzer-attributes') + migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'develop') //TODO refactor with archive download testScriptsSrc = [ (migrationsUrl + '/migrations/0_extensions.up.sql') : 'V001__extensions.sql', diff --git a/src/main/java/com/epam/ta/reportportal/dao/ClusterRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ClusterRepository.java index b9b231717..8e760d47b 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ClusterRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ClusterRepository.java @@ -23,6 +23,7 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; +import java.util.Collection; import java.util.List; import java.util.Optional; @@ -52,4 +53,8 @@ public interface ClusterRepository extends ReportPortalRepository @Modifying @Query(value = "DELETE FROM clusters_test_item WHERE item_id = :itemId", nativeQuery = true) int deleteClusterTestItemsByItemId(@Param("itemId") Long itemId); + + @Modifying + @Query(value = "DELETE FROM clusters_test_item WHERE item_id IN (:itemIds)", nativeQuery = true) + int deleteClusterTestItemsByItemIds(@Param("itemIds") Collection itemIds); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java b/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java index 486fbfc14..6a52b1379 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java @@ -46,4 +46,8 @@ public interface LogRepository extends ReportPortalRepository, LogRep @Modifying @Query(value = "UPDATE log SET cluster_id = NULL WHERE cluster_id IN (SELECT id FROM clusters WHERE clusters.launch_id = :launchId)", nativeQuery = true) int updateClusterIdSetNullByLaunchId(@Param("launchId") Long launchId); + + @Modifying + @Query(value = "UPDATE log SET cluster_id = NULL WHERE cluster_id IS NOT NULL AND item_id IN (:itemIds)", nativeQuery = true) + int updateClusterIdSetNullByItemIds(@Param("itemIds") Collection itemIds); } diff --git a/src/main/java/com/epam/ta/reportportal/entity/Metadata.java b/src/main/java/com/epam/ta/reportportal/entity/Metadata.java index 32012865f..ff0e2e33c 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/Metadata.java +++ b/src/main/java/com/epam/ta/reportportal/entity/Metadata.java @@ -20,6 +20,7 @@ import java.io.Serializable; import java.util.Map; +import java.util.Objects; /** * @author Pavel Bortnik @@ -48,4 +49,20 @@ public void setMetadata(Map metadata) { this.metadata = metadata; } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Metadata comparing = (Metadata) o; + return Objects.equals(metadata, comparing.metadata); + } + + @Override + public int hashCode() { + return Objects.hash(metadata); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/ClusterRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/ClusterRepositoryTest.java index f96f2d8ab..52efab37e 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/ClusterRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/ClusterRepositoryTest.java @@ -28,10 +28,7 @@ import org.springframework.data.domain.Sort; import org.springframework.test.context.jdbc.Sql; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; import java.util.stream.LongStream; @@ -139,6 +136,18 @@ void shouldDeleteClusterTestItemsByItemId() { assertEquals(1, removed); } + @Test + void shouldDeleteClusterTestItemsByItemIdIn() { + final Cluster cluster = clusterRepository.findByIndexIdAndLaunchId(1L, 1L).get(); + clusterRepository.saveClusterTestItems(cluster, Set.of(1L)); + + final int removed = clusterRepository.deleteClusterTestItemsByItemIds(List.of(1L)); + assertEquals(1, removed); + + final int zeroRemoved = clusterRepository.deleteClusterTestItemsByItemIds(Collections.emptyList()); + assertEquals(0, zeroRemoved); + } + @Test void shouldSaveClusterTestItems() { final Cluster cluster = clusterRepository.findAllByLaunchId(LAUNCH_ID).get(0); diff --git a/src/test/java/com/epam/ta/reportportal/dao/LogRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/LogRepositoryTest.java index f8b881946..f3522052d 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/LogRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/LogRepositoryTest.java @@ -115,6 +115,25 @@ void updateClusterIdSetNullByLaunchId() { logs.forEach(l -> assertNull(l.getClusterId())); } + @Test + void updateClusterIdSetNullByItemIds() { + + final List logIds = List.of(1L, 2L, 3L); + + final int updated = logRepository.updateClusterIdByIdIn(1L, logIds); + + assertEquals(3, updated); + + final List itemIds = List.of(3L, 4L, 5L); + final int nullUpdated = logRepository.updateClusterIdSetNullByItemIds(itemIds); + + assertEquals(6, nullUpdated); + + final List logs = logRepository.findAllById(logIds); + + logs.forEach(l -> assertNull(l.getClusterId())); + } + @Test void getPageNumberTest() { Filter filter = Filter.builder() From 1022a7248a3611764c8119ba6acc9e8af62ed5c0 Mon Sep 17 00:00:00 2001 From: Ivan Date: Mon, 29 Nov 2021 12:49:46 +0300 Subject: [PATCH 004/110] EPMRPP-68619 || indexing performance fix (#796) --- .../dao/LaunchRepositoryCustom.java | 6 +++++- .../dao/LaunchRepositoryCustomImpl.java | 21 ++++++++++++------- .../dao/LaunchRepositoryTest.java | 17 ++++++++++----- 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustom.java index e2fbc46d6..d240e7e71 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustom.java @@ -23,11 +23,13 @@ import com.epam.ta.reportportal.entity.launch.Launch; import com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum; import com.epam.ta.reportportal.jooq.enums.JStatusEnum; +import com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum; import com.epam.ta.reportportal.ws.model.analyzer.IndexLaunch; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import java.time.LocalDateTime; +import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Optional; @@ -110,7 +112,9 @@ public interface LaunchRepositoryCustom extends FilterableRepository { List findIdsByProjectIdAndModeAndStatusNotEqAfterId(Long projectId, JLaunchModeEnum mode, JStatusEnum status, Long launchId, int limit); - List findIndexLaunchByIdsAndLogLevel(List ids, Integer logLevel); + boolean hasItemsWithLogsWithLogLevel(Long launchId, Collection itemTypes, Integer logLevel); + + List findIndexLaunchByIds(List ids); Optional findPreviousLaunchByProjectIdAndNameAndAttributesForLaunchIdAndModeNot( Long projectId, String name, String[] attributes, Long launchId, JLaunchModeEnum mode diff --git a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java index 442ec4ef0..f421d290d 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java @@ -23,6 +23,7 @@ import com.epam.ta.reportportal.entity.launch.Launch; import com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum; import com.epam.ta.reportportal.jooq.enums.JStatusEnum; +import com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum; import com.epam.ta.reportportal.util.SortUtils; import com.epam.ta.reportportal.ws.model.analyzer.IndexLaunch; import org.jooq.DSLContext; @@ -47,6 +48,7 @@ import static com.epam.ta.reportportal.dao.util.RecordMappers.INDEX_LAUNCH_RECORD_MAPPER; import static com.epam.ta.reportportal.dao.util.ResultFetchers.LAUNCH_FETCHER; import static com.epam.ta.reportportal.jooq.Tables.*; +import static com.epam.ta.reportportal.jooq.tables.JIssueType.ISSUE_TYPE; import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; import static com.epam.ta.reportportal.jooq.tables.JTestItemResults.TEST_ITEM_RESULTS; import static java.util.Optional.ofNullable; @@ -265,16 +267,21 @@ public List findIdsByProjectIdAndModeAndStatusNotEqAfterId(Long projectId, } @Override - public List findIndexLaunchByIdsAndLogLevel(List ids, Integer logLevel) { + public boolean hasItemsWithLogsWithLogLevel(Long launchId, Collection itemTypes, Integer logLevel) { + return dsl.fetchExists(DSL.selectOne() + .from(TEST_ITEM) + .join(LOG) + .on(TEST_ITEM.ITEM_ID.eq(LOG.ITEM_ID)) + .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) + .and(TEST_ITEM.TYPE.in(itemTypes)) + .and(LOG.LOG_LEVEL.ge(logLevel))); + } + + @Override + public List findIndexLaunchByIds(List ids) { return dsl.select(LAUNCH.ID, LAUNCH.NAME, LAUNCH.PROJECT_ID) .from(LAUNCH) .where(LAUNCH.ID.in(ids)) - .and(DSL.exists(DSL.selectOne() - .from(TEST_ITEM) - .join(LOG) - .on(TEST_ITEM.ITEM_ID.eq(LOG.ITEM_ID)) - .where(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) - .and(LOG.LOG_LEVEL.ge(logLevel)))) .orderBy(LAUNCH.ID) .fetch(INDEX_LAUNCH_RECORD_MAPPER); } diff --git a/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java index ad479e5ff..889af2428 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java @@ -20,9 +20,11 @@ import com.epam.ta.reportportal.commons.querygen.*; import com.epam.ta.reportportal.entity.enums.LaunchModeEnum; import com.epam.ta.reportportal.entity.enums.StatusEnum; +import com.epam.ta.reportportal.entity.enums.TestItemTypeEnum; import com.epam.ta.reportportal.entity.launch.Launch; import com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum; import com.epam.ta.reportportal.jooq.enums.JStatusEnum; +import com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum; import com.epam.ta.reportportal.ws.model.analyzer.IndexLaunch; import com.epam.ta.reportportal.ws.model.launch.Mode; import com.google.common.collect.Comparators; @@ -283,11 +285,16 @@ void findIndexLaunchByProjectIdAfterId() { } @Test - void findIndexLaunchByIdsAndLogLevel() { - final List result = launchRepository.findIndexLaunchByIdsAndLogLevel(List.of(100L, 200L, 300L), - 0 - ); - assertEquals(2, result.size()); + void hasItemsWithLogsWithLogLevel() { + assertTrue(launchRepository.hasItemsWithLogsWithLogLevel(100L, List.of(JTestItemTypeEnum.STEP, JTestItemTypeEnum.TEST), 0)); + assertTrue(launchRepository.hasItemsWithLogsWithLogLevel(200L, List.of(JTestItemTypeEnum.STEP, JTestItemTypeEnum.TEST), 0)); + assertFalse(launchRepository.hasItemsWithLogsWithLogLevel(300L, List.of(JTestItemTypeEnum.STEP, JTestItemTypeEnum.TEST), 0)); + } + + @Test + void findIndexLaunchByIds() { + final List result = launchRepository.findIndexLaunchByIds(List.of(100L, 200L, 300L)); + assertEquals(3, result.size()); } @Test From a18901d0c88361e72fa07ac96c716fc2858a9a08 Mon Sep 17 00:00:00 2001 From: Ivan_Budayeu Date: Mon, 20 Dec 2021 15:22:41 +0300 Subject: [PATCH 005/110] EPMRPP-57211 || TestItem baseline query impl --- .../dao/TestItemRepositoryCustom.java | 2 + .../dao/TestItemRepositoryCustomImpl.java | 38 +++++++++++++++++++ .../dao/TestItemRepositoryTest.java | 30 +++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java index 2d6b98d56..53c53ae19 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java @@ -72,6 +72,8 @@ public interface TestItemRepositoryCustom extends FilterableRepository Page findByFilter(boolean isLatest, Queryable launchFilter, Queryable testItemFilter, Pageable launchPageable, Pageable testItemPageable); + Page findAllNotFromBaseline(Queryable targetFilter, Queryable baselineFilter, Pageable pageable); + /** * Loads items {@link TestItemHistory} - {@link TestItem} executions from the whole {@link com.epam.ta.reportportal.entity.project.Project} * grouped by {@link TestItem#getTestCaseHash()} and ordered by {@link TestItem#getStartTime()} `DESCENDING` within group. diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java index 0dfdf8cca..de0df9348 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java @@ -69,6 +69,7 @@ import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; import static com.epam.ta.reportportal.dao.constant.WidgetRepositoryConstants.ID; import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; +import static com.epam.ta.reportportal.dao.util.QueryUtils.collectJoinFields; import static com.epam.ta.reportportal.dao.util.RecordMappers.*; import static com.epam.ta.reportportal.dao.util.ResultFetchers.*; import static com.epam.ta.reportportal.jooq.Tables.*; @@ -94,6 +95,8 @@ public class TestItemRepositoryCustomImpl implements TestItemRepositoryCustom { private static final String CHILD_ITEM_TABLE = "child"; + private static final String BASELINE_TABLE = "baseline"; + private static final String ITEM_START_TIME = "itemStartTime"; private static final String LAUNCH_START_TIME = "launchStartTime"; private static final String ACCUMULATED_STATISTICS = "accumulated_statistics"; @@ -167,6 +170,41 @@ public Page findByFilter(boolean isLatest, Queryable launchFilter, Que ); } + @Override + public Page findAllNotFromBaseline(Queryable targetFilter, Queryable baselineFilter, Pageable pageable) { + + final SelectQuery contentQuery = getQueryWithBaseline(targetFilter, baselineFilter, pageable).with(pageable) + .wrap() + .withWrapperSort(pageable.getSort()) + .build(); + final SelectQuery pagingQuery = getQueryWithBaseline(targetFilter, baselineFilter, pageable).build(); + + return PageableExecutionUtils.getPage(TEST_ITEM_FETCHER.apply(dsl.fetch(contentQuery)), + pageable, + () -> dsl.fetchCount(pagingQuery) + ); + + } + + private QueryBuilder getQueryWithBaseline(Queryable targetFilter, Queryable baselineFilter, Pageable pageable) { + + final SelectQuery baselineQuery = QueryBuilder.newBuilder(baselineFilter, collectJoinFields(baselineFilter)) + .build(); + baselineQuery.addSelect(TEST_ITEM.TEST_CASE_HASH); + final Table baseline = baselineQuery.asTable(BASELINE_TABLE); + + //https://github.com/jOOQ/jOOQ/issues/11238 + final Condition baselineHashIsNull = condition( + "array_agg(baseline.test_case_hash) filter (where baseline.test_case_hash is not null) is null"); + + return QueryBuilder.newBuilder(targetFilter, collectJoinFields(targetFilter, pageable.getSort())) + .addJoinToEnd(baseline, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.TEST_CASE_HASH.eq(fieldName(baseline.getName(), TEST_ITEM.TEST_CASE_HASH.getName()).cast(Integer.class)) + ) + .addHavingCondition(baselineHashIsNull); + } + @Override public Page loadItemsHistoryPage(Queryable filter, Pageable pageable, Long projectId, int historyDepth, boolean usingHash) { diff --git a/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java index f4dfb28f8..6c868f132 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java @@ -797,6 +797,36 @@ void findByLaunchAndTestItemFiltersTest() { Assertions.assertEquals(5, content.size()); } + @Test + void findAllNotFromBaseline() { + + Filter itemFilter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "true", CRITERIA_HAS_STATS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "false", CRITERIA_HAS_CHILDREN)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "STEP", CRITERIA_TYPE)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_LAUNCH_ID)) + .build(); + + Filter baseline = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "true", CRITERIA_HAS_STATS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "false", CRITERIA_HAS_CHILDREN)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "STEP", CRITERIA_TYPE)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "3", CRITERIA_LAUNCH_ID)) + .build(); + + final Page result = testItemRepository.findAllNotFromBaseline(itemFilter, + baseline, + PageRequest.of(0, 20, Sort.by(Sort.Order.asc("name"))) + ); + + assertEquals(1, result.getNumberOfElements()); + assertEquals(1, result.getTotalElements()); + } + @Test void testItemHistoryPage() { Filter itemFilter = Filter.builder() From 941fd841306909e61d3045025d35a45239559bb1 Mon Sep 17 00:00:00 2001 From: Ivan_Budayeu Date: Tue, 21 Dec 2021 12:47:48 +0300 Subject: [PATCH 006/110] EPMRPP-57211 || Statistics baseline query impl --- .../dao/TestItemRepositoryCustom.java | 2 + .../dao/TestItemRepositoryCustomImpl.java | 40 ++++++++++++++++--- .../dao/TestItemRepositoryTest.java | 30 +++++++++++++- 3 files changed, 66 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java index 53c53ae19..ad177f4ec 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java @@ -57,6 +57,8 @@ public interface TestItemRepositoryCustom extends FilterableRepository */ Set accumulateStatisticsByFilter(Queryable filter); + Set accumulateStatisticsByFilterNotFromBaseline(Queryable targetFilter, Queryable baselineFilter); + Optional findIdByFilter(Queryable filter, Sort sort); /** diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java index de0df9348..2b4d62b13 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java @@ -129,6 +129,31 @@ public Set accumulateStatisticsByFilter(Queryable filter) { }); } + @Override + public Set accumulateStatisticsByFilterNotFromBaseline(Queryable targetFilter, Queryable baselineFilter) { + final QueryBuilder targetBuilder = QueryBuilder.newBuilder(targetFilter, collectJoinFields(targetFilter)); + final QueryBuilder baselineBuilder = QueryBuilder.newBuilder(baselineFilter, collectJoinFields(baselineFilter)); + final SelectQuery contentQuery = getQueryWithBaseline(targetBuilder, baselineBuilder).build(); + + return dsl.fetch(DSL.with(FILTERED_QUERY) + .as(contentQuery) + .select(DSL.sum(STATISTICS.S_COUNTER).as(ACCUMULATED_STATISTICS), STATISTICS_FIELD.NAME) + .from(STATISTICS) + .join(DSL.table(name(FILTERED_QUERY))) + .on(STATISTICS.ITEM_ID.eq(field(name(FILTERED_QUERY, FILTERED_ID), Long.class))) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .groupBy(STATISTICS_FIELD.NAME) + .getQuery()).intoSet(r -> { + Statistics statistics = new Statistics(); + StatisticsField statisticsField = new StatisticsField(); + statisticsField.setName(r.get(STATISTICS_FIELD.NAME)); + statistics.setStatisticsField(statisticsField); + statistics.setCounter(ofNullable(r.get(ACCUMULATED_STATISTICS, Integer.class)).orElse(0)); + return statistics; + }); + } + @Override public Optional findIdByFilter(Queryable filter, Sort sort) { @@ -173,11 +198,16 @@ public Page findByFilter(boolean isLatest, Queryable launchFilter, Que @Override public Page findAllNotFromBaseline(Queryable targetFilter, Queryable baselineFilter, Pageable pageable) { - final SelectQuery contentQuery = getQueryWithBaseline(targetFilter, baselineFilter, pageable).with(pageable) + final QueryBuilder targetBuilder = QueryBuilder.newBuilder(targetFilter, collectJoinFields(targetFilter, pageable.getSort())); + final QueryBuilder baselineBuilder = QueryBuilder.newBuilder(baselineFilter, collectJoinFields(baselineFilter)); + final SelectQuery contentQuery = getQueryWithBaseline(targetBuilder, baselineBuilder).with(pageable) .wrap() .withWrapperSort(pageable.getSort()) .build(); - final SelectQuery pagingQuery = getQueryWithBaseline(targetFilter, baselineFilter, pageable).build(); + + final QueryBuilder targetPagingBuilder = QueryBuilder.newBuilder(targetFilter, collectJoinFields(targetFilter, pageable.getSort())); + final QueryBuilder baselinePagingBuilder = QueryBuilder.newBuilder(baselineFilter, collectJoinFields(baselineFilter)); + final SelectQuery pagingQuery = getQueryWithBaseline(targetPagingBuilder, baselinePagingBuilder).build(); return PageableExecutionUtils.getPage(TEST_ITEM_FETCHER.apply(dsl.fetch(contentQuery)), pageable, @@ -186,9 +216,9 @@ public Page findAllNotFromBaseline(Queryable targetFilter, Queryable b } - private QueryBuilder getQueryWithBaseline(Queryable targetFilter, Queryable baselineFilter, Pageable pageable) { + private QueryBuilder getQueryWithBaseline(QueryBuilder targetBuilder, QueryBuilder baselineBuilder) { - final SelectQuery baselineQuery = QueryBuilder.newBuilder(baselineFilter, collectJoinFields(baselineFilter)) + final SelectQuery baselineQuery = baselineBuilder .build(); baselineQuery.addSelect(TEST_ITEM.TEST_CASE_HASH); final Table baseline = baselineQuery.asTable(BASELINE_TABLE); @@ -197,7 +227,7 @@ private QueryBuilder getQueryWithBaseline(Queryable targetFilter, Queryable base final Condition baselineHashIsNull = condition( "array_agg(baseline.test_case_hash) filter (where baseline.test_case_hash is not null) is null"); - return QueryBuilder.newBuilder(targetFilter, collectJoinFields(targetFilter, pageable.getSort())) + return targetBuilder .addJoinToEnd(baseline, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.TEST_CASE_HASH.eq(fieldName(baseline.getName(), TEST_ITEM.TEST_CASE_HASH.getName()).cast(Integer.class)) diff --git a/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java index 6c868f132..93bb98823 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java @@ -22,7 +22,10 @@ import com.epam.ta.reportportal.entity.enums.StatusEnum; import com.epam.ta.reportportal.entity.enums.TestItemIssueGroup; import com.epam.ta.reportportal.entity.enums.TestItemTypeEnum; -import com.epam.ta.reportportal.entity.item.*; +import com.epam.ta.reportportal.entity.item.NestedStep; +import com.epam.ta.reportportal.entity.item.Parameter; +import com.epam.ta.reportportal.entity.item.TestItem; +import com.epam.ta.reportportal.entity.item.TestItemResults; import com.epam.ta.reportportal.entity.item.history.TestItemHistory; import com.epam.ta.reportportal.entity.item.issue.IssueEntity; import com.epam.ta.reportportal.entity.item.issue.IssueType; @@ -732,6 +735,31 @@ void accumulateStatisticsByFilter() { assertNotNull(statistics); } + @Test + void accumulateStatisticsByFilterNotFromBaseline() { + Filter itemFilter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "true", CRITERIA_HAS_STATS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "false", CRITERIA_HAS_CHILDREN)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "STEP", CRITERIA_TYPE)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_LAUNCH_ID)) + .build(); + + Filter baseline = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "true", CRITERIA_HAS_STATS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "false", CRITERIA_HAS_CHILDREN)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "STEP", CRITERIA_TYPE)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "3", CRITERIA_LAUNCH_ID)) + .build(); + + final Set result = testItemRepository.accumulateStatisticsByFilterNotFromBaseline(itemFilter, baseline); + assertFalse(result.isEmpty()); + assertEquals(2, result.size()); + } + @Test void findAllNestedStepsByIds() { From 3e41513e968e01a51841a98308bbd3fd8e8f106b Mon Sep 17 00:00:00 2001 From: Ivan_Budayeu Date: Wed, 22 Dec 2021 15:24:25 +0300 Subject: [PATCH 007/110] EPMRPP-63122 || Widget options select added --- .../epam/ta/reportportal/commons/querygen/FilterTarget.java | 2 ++ .../java/com/epam/ta/reportportal/dao/util/RecordMappers.java | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java index de07eee71..2a26b6ca0 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java @@ -924,6 +924,7 @@ protected Collection selectFields() { DASHBOARD_WIDGET.WIDGET_WIDTH, DASHBOARD_WIDGET.WIDGET_POSITION_X, DASHBOARD_WIDGET.WIDGET_POSITION_Y, + WIDGET.WIDGET_OPTIONS, DASHBOARD_WIDGET.SHARE, SHAREABLE_ENTITY.SHARED, SHAREABLE_ENTITY.PROJECT_ID, @@ -939,6 +940,7 @@ protected void addFrom(SelectQuery query) { @Override protected void joinTables(QuerySupplier query) { query.addJoin(DASHBOARD_WIDGET, JoinType.LEFT_OUTER_JOIN, DASHBOARD.ID.eq(DASHBOARD_WIDGET.DASHBOARD_ID)); + query.addJoin(WIDGET, JoinType.LEFT_OUTER_JOIN, DASHBOARD_WIDGET.WIDGET_ID.eq(WIDGET.ID)); query.addJoin(SHAREABLE_ENTITY, JoinType.JOIN, DASHBOARD.ID.eq(SHAREABLE_ENTITY.ID)); query.addJoin(ACL_OBJECT_IDENTITY, JoinType.JOIN, DASHBOARD.ID.cast(String.class).eq(ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY)); query.addJoin(ACL_CLASS, JoinType.JOIN, ACL_CLASS.ID.eq(ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS)); diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java index d35bca525..2bc4bf409 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java @@ -479,6 +479,9 @@ public class RecordMappers { dashboardWidget.setWidgetName(r.get(DASHBOARD_WIDGET.WIDGET_NAME)); dashboardWidget.setWidgetType(r.get(DASHBOARD_WIDGET.WIDGET_TYPE)); dashboardWidget.setShare(r.get(DASHBOARD_WIDGET.SHARE)); + final Widget widget = new Widget(); + WIDGET_OPTIONS_MAPPER.accept(widget, r); + dashboardWidget.setWidget(widget); return Optional.of(dashboardWidget); }; From 5daabada0a1a90342129a90f487fa424b48cd5ad Mon Sep 17 00:00:00 2001 From: Pavel Bortnik Date: Fri, 24 Dec 2021 12:02:12 +0300 Subject: [PATCH 008/110] EPMRPP-68947 || Information about Jira Cloud issue (#800) * EPMRPP-68947 || Add plugin name field to the ticket model * EPMRPP-68947 || Add plugin name field to the ticket model * EPMRPP-68947 || Update jooq schema * EPMRPP-68947 || Disable jooq build * EPMRPP-68947 || Update path to db scripts * EPMRPP-68947 || Jooq regenerate * EPMRPP-68947 || Jooq regenerate * EPMRPP-68947 || Update migration scripts path --- project-properties.gradle | 1 + .../commons/querygen/FilterTarget.java | 1 + .../ta/reportportal/entity/bts/Ticket.java | 11 + .../epam/ta/reportportal/jooq/Indexes.java | 63 ++++- .../epam/ta/reportportal/jooq/JPublic.java | 78 ++++- .../com/epam/ta/reportportal/jooq/Keys.java | 119 +++++++- .../epam/ta/reportportal/jooq/Sequences.java | 4 +- .../com/epam/ta/reportportal/jooq/Tables.java | 67 ++++- .../jooq/tables/JAclObjectIdentity.java | 20 +- .../reportportal/jooq/tables/JAttachment.java | 6 +- .../jooq/tables/JAttachmentDeletion.java | 172 +++++++++++ .../reportportal/jooq/tables/JClusters.java | 20 +- .../jooq/tables/JClustersTestItem.java | 19 +- .../jooq/tables/JItemAttribute.java | 20 +- .../ta/reportportal/jooq/tables/JLaunch.java | 22 +- .../ta/reportportal/jooq/tables/JLog.java | 20 +- .../reportportal/jooq/tables/JOnboarding.java | 2 +- .../ta/reportportal/jooq/tables/JTicket.java | 15 +- .../records/JAttachmentDeletionRecord.java | 266 ++++++++++++++++++ .../jooq/tables/records/JClustersRecord.java | 5 +- .../jooq/tables/records/JTicketRecord.java | 59 +++- 21 files changed, 926 insertions(+), 64 deletions(-) create mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachmentDeletion.java create mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentDeletionRecord.java diff --git a/project-properties.gradle b/project-properties.gradle index ee006fe20..ab430568d 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -63,6 +63,7 @@ project.ext { (migrationsUrl + '/migrations/51_cluster.up.sql') : 'V051__cluster.sql', (migrationsUrl + '/migrations/52_analyzer_search_attribute.up.sql') : 'V052__analyzer_search_attribute.sql', (migrationsUrl + '/migrations/54_analyzer_unique_error_attribute.up.sql') : 'V054__analyzer_unique_error_attribute.sql', + (migrationsUrl + '/migrations/56_alter_ticket.up.sql') : 'V056__alter_ticket.sql', ] excludeTests = [ diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java index 2a26b6ca0..05eb12404 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java @@ -661,6 +661,7 @@ protected Collection selectFields() { TICKET.BTS_URL, TICKET.TICKET_ID, TICKET.URL, + TICKET.PLUGIN_NAME, PATTERN_TEMPLATE.ID, PATTERN_TEMPLATE.NAME ); diff --git a/src/main/java/com/epam/ta/reportportal/entity/bts/Ticket.java b/src/main/java/com/epam/ta/reportportal/entity/bts/Ticket.java index 7e5b557de..063e16952 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/bts/Ticket.java +++ b/src/main/java/com/epam/ta/reportportal/entity/bts/Ticket.java @@ -56,6 +56,9 @@ public class Ticket implements Serializable { @Column(name = "url") private String url; + @Column(name = "plugin_name") + private String pluginName; + @ManyToMany(mappedBy = "tickets") private Set issues = Sets.newHashSet(); @@ -126,6 +129,14 @@ public void setIssues(Set issues) { this.issues = issues; } + public String getPluginName() { + return pluginName; + } + + public void setPluginName(String pluginName) { + this.pluginName = pluginName; + } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java b/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java index c0f7342ea..5a2c433cd 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java @@ -4,13 +4,68 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.*; +import com.epam.ta.reportportal.jooq.tables.JAclClass; +import com.epam.ta.reportportal.jooq.tables.JAclEntry; +import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; +import com.epam.ta.reportportal.jooq.tables.JAclSid; +import com.epam.ta.reportportal.jooq.tables.JActivity; +import com.epam.ta.reportportal.jooq.tables.JAttachment; +import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; +import com.epam.ta.reportportal.jooq.tables.JAttribute; +import com.epam.ta.reportportal.jooq.tables.JClusters; +import com.epam.ta.reportportal.jooq.tables.JClustersTestItem; +import com.epam.ta.reportportal.jooq.tables.JContentField; +import com.epam.ta.reportportal.jooq.tables.JDashboard; +import com.epam.ta.reportportal.jooq.tables.JDashboardWidget; +import com.epam.ta.reportportal.jooq.tables.JFilter; +import com.epam.ta.reportportal.jooq.tables.JFilterCondition; +import com.epam.ta.reportportal.jooq.tables.JFilterSort; +import com.epam.ta.reportportal.jooq.tables.JIntegration; +import com.epam.ta.reportportal.jooq.tables.JIntegrationType; +import com.epam.ta.reportportal.jooq.tables.JIssue; +import com.epam.ta.reportportal.jooq.tables.JIssueGroup; +import com.epam.ta.reportportal.jooq.tables.JIssueTicket; +import com.epam.ta.reportportal.jooq.tables.JIssueType; +import com.epam.ta.reportportal.jooq.tables.JIssueTypeProject; +import com.epam.ta.reportportal.jooq.tables.JItemAttribute; +import com.epam.ta.reportportal.jooq.tables.JLaunch; +import com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules; +import com.epam.ta.reportportal.jooq.tables.JLaunchNames; +import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; +import com.epam.ta.reportportal.jooq.tables.JLog; +import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; +import com.epam.ta.reportportal.jooq.tables.JOnboarding; +import com.epam.ta.reportportal.jooq.tables.JParameter; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; +import com.epam.ta.reportportal.jooq.tables.JProject; +import com.epam.ta.reportportal.jooq.tables.JProjectAttribute; +import com.epam.ta.reportportal.jooq.tables.JProjectUser; +import com.epam.ta.reportportal.jooq.tables.JRecipients; +import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; +import com.epam.ta.reportportal.jooq.tables.JSenderCase; +import com.epam.ta.reportportal.jooq.tables.JServerSettings; +import com.epam.ta.reportportal.jooq.tables.JShareableEntity; +import com.epam.ta.reportportal.jooq.tables.JStatistics; +import com.epam.ta.reportportal.jooq.tables.JStatisticsField; +import com.epam.ta.reportportal.jooq.tables.JTestItem; +import com.epam.ta.reportportal.jooq.tables.JTestItemResults; +import com.epam.ta.reportportal.jooq.tables.JTicket; +import com.epam.ta.reportportal.jooq.tables.JUserCreationBid; +import com.epam.ta.reportportal.jooq.tables.JUserPreference; +import com.epam.ta.reportportal.jooq.tables.JUsers; +import com.epam.ta.reportportal.jooq.tables.JWidget; +import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; + +import javax.annotation.processing.Generated; + import org.jooq.Index; import org.jooq.OrderField; import org.jooq.impl.Internal; -import javax.annotation.processing.Generated; - /** * A class modelling indexes of tables of the public schema. @@ -47,6 +102,7 @@ public class Indexes { public static final Index ATT_PROJECT_IDX = Indexes0.ATT_PROJECT_IDX; public static final Index ATTACHMENT_PK = Indexes0.ATTACHMENT_PK; public static final Index ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX = Indexes0.ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX; + public static final Index ATTACHMENT_DELETION_PKEY = Indexes0.ATTACHMENT_DELETION_PKEY; public static final Index ATTRIBUTE_PK = Indexes0.ATTRIBUTE_PK; public static final Index CLUSTER_INDEX_ID_IDX = Indexes0.CLUSTER_INDEX_ID_IDX; public static final Index CLUSTER_LAUNCH_IDX = Indexes0.CLUSTER_LAUNCH_IDX; @@ -184,6 +240,7 @@ private static class Indexes0 { public static Index ATT_PROJECT_IDX = Internal.createIndex("att_project_idx", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.PROJECT_ID }, false); public static Index ATTACHMENT_PK = Internal.createIndex("attachment_pk", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.ID }, true); public static Index ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX = Internal.createIndex("attachment_project_id_creation_time_idx", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.PROJECT_ID, JAttachment.ATTACHMENT.CREATION_DATE }, false); + public static Index ATTACHMENT_DELETION_PKEY = Internal.createIndex("attachment_deletion_pkey", JAttachmentDeletion.ATTACHMENT_DELETION, new OrderField[] { JAttachmentDeletion.ATTACHMENT_DELETION.ID }, true); public static Index ATTRIBUTE_PK = Internal.createIndex("attribute_pk", JAttribute.ATTRIBUTE, new OrderField[] { JAttribute.ATTRIBUTE.ID }, true); public static Index CLUSTER_INDEX_ID_IDX = Internal.createIndex("cluster_index_id_idx", JClusters.CLUSTERS, new OrderField[] { JClusters.CLUSTERS.INDEX_ID }, false); public static Index CLUSTER_LAUNCH_IDX = Internal.createIndex("cluster_launch_idx", JClusters.CLUSTERS, new OrderField[] { JClusters.CLUSTERS.LAUNCH_ID }, false); diff --git a/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java b/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java index 67a2ec165..d395f9fa2 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java @@ -4,16 +4,78 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.*; +import com.epam.ta.reportportal.jooq.tables.JAclClass; +import com.epam.ta.reportportal.jooq.tables.JAclEntry; +import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; +import com.epam.ta.reportportal.jooq.tables.JAclSid; +import com.epam.ta.reportportal.jooq.tables.JActivity; +import com.epam.ta.reportportal.jooq.tables.JAttachment; +import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; +import com.epam.ta.reportportal.jooq.tables.JAttribute; +import com.epam.ta.reportportal.jooq.tables.JClusters; +import com.epam.ta.reportportal.jooq.tables.JClustersTestItem; +import com.epam.ta.reportportal.jooq.tables.JContentField; +import com.epam.ta.reportportal.jooq.tables.JDashboard; +import com.epam.ta.reportportal.jooq.tables.JDashboardWidget; +import com.epam.ta.reportportal.jooq.tables.JFilter; +import com.epam.ta.reportportal.jooq.tables.JFilterCondition; +import com.epam.ta.reportportal.jooq.tables.JFilterSort; +import com.epam.ta.reportportal.jooq.tables.JIntegration; +import com.epam.ta.reportportal.jooq.tables.JIntegrationType; +import com.epam.ta.reportportal.jooq.tables.JIssue; +import com.epam.ta.reportportal.jooq.tables.JIssueGroup; +import com.epam.ta.reportportal.jooq.tables.JIssueTicket; +import com.epam.ta.reportportal.jooq.tables.JIssueType; +import com.epam.ta.reportportal.jooq.tables.JIssueTypeProject; +import com.epam.ta.reportportal.jooq.tables.JItemAttribute; +import com.epam.ta.reportportal.jooq.tables.JLaunch; +import com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules; +import com.epam.ta.reportportal.jooq.tables.JLaunchNames; +import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; +import com.epam.ta.reportportal.jooq.tables.JLog; +import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; +import com.epam.ta.reportportal.jooq.tables.JOnboarding; +import com.epam.ta.reportportal.jooq.tables.JParameter; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; +import com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders; +import com.epam.ta.reportportal.jooq.tables.JProject; +import com.epam.ta.reportportal.jooq.tables.JProjectAttribute; +import com.epam.ta.reportportal.jooq.tables.JProjectUser; +import com.epam.ta.reportportal.jooq.tables.JRecipients; +import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; +import com.epam.ta.reportportal.jooq.tables.JSenderCase; +import com.epam.ta.reportportal.jooq.tables.JServerSettings; +import com.epam.ta.reportportal.jooq.tables.JShareableEntity; +import com.epam.ta.reportportal.jooq.tables.JStatistics; +import com.epam.ta.reportportal.jooq.tables.JStatisticsField; +import com.epam.ta.reportportal.jooq.tables.JTestItem; +import com.epam.ta.reportportal.jooq.tables.JTestItemResults; +import com.epam.ta.reportportal.jooq.tables.JTicket; +import com.epam.ta.reportportal.jooq.tables.JUserCreationBid; +import com.epam.ta.reportportal.jooq.tables.JUserPreference; +import com.epam.ta.reportportal.jooq.tables.JUsers; +import com.epam.ta.reportportal.jooq.tables.JWidget; +import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; import com.epam.ta.reportportal.jooq.tables.records.JPgpArmorHeadersRecord; -import org.jooq.*; -import org.jooq.impl.SchemaImpl; -import javax.annotation.processing.Generated; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import javax.annotation.processing.Generated; + +import org.jooq.Catalog; +import org.jooq.Configuration; +import org.jooq.Field; +import org.jooq.Result; +import org.jooq.Sequence; +import org.jooq.Table; +import org.jooq.impl.SchemaImpl; + /** * This class is generated by jOOQ. @@ -28,7 +90,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JPublic extends SchemaImpl { - private static final long serialVersionUID = -1370382793; + private static final long serialVersionUID = -1164524803; /** * The reference instance of public @@ -65,6 +127,11 @@ public class JPublic extends SchemaImpl { */ public final JAttachment ATTACHMENT = com.epam.ta.reportportal.jooq.tables.JAttachment.ATTACHMENT; + /** + * The table public.attachment_deletion. + */ + public final JAttachmentDeletion ATTACHMENT_DELETION = com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion.ATTACHMENT_DELETION; + /** * The table public.attribute. */ @@ -407,6 +474,7 @@ private final List> getTables0() { JAclSid.ACL_SID, JActivity.ACTIVITY, JAttachment.ATTACHMENT, + JAttachmentDeletion.ATTACHMENT_DELETION, JAttribute.ATTRIBUTE, JClusters.CLUSTERS, JClustersTestItem.CLUSTERS_TEST_ITEM, diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Keys.java b/src/main/java/com/epam/ta/reportportal/jooq/Keys.java index dabeb0e10..f95b8f879 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/Keys.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Keys.java @@ -4,15 +4,124 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.*; -import com.epam.ta.reportportal.jooq.tables.records.*; +import com.epam.ta.reportportal.jooq.tables.JAclClass; +import com.epam.ta.reportportal.jooq.tables.JAclEntry; +import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; +import com.epam.ta.reportportal.jooq.tables.JAclSid; +import com.epam.ta.reportportal.jooq.tables.JActivity; +import com.epam.ta.reportportal.jooq.tables.JAttachment; +import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; +import com.epam.ta.reportportal.jooq.tables.JAttribute; +import com.epam.ta.reportportal.jooq.tables.JClusters; +import com.epam.ta.reportportal.jooq.tables.JClustersTestItem; +import com.epam.ta.reportportal.jooq.tables.JContentField; +import com.epam.ta.reportportal.jooq.tables.JDashboard; +import com.epam.ta.reportportal.jooq.tables.JDashboardWidget; +import com.epam.ta.reportportal.jooq.tables.JFilter; +import com.epam.ta.reportportal.jooq.tables.JFilterCondition; +import com.epam.ta.reportportal.jooq.tables.JFilterSort; +import com.epam.ta.reportportal.jooq.tables.JIntegration; +import com.epam.ta.reportportal.jooq.tables.JIntegrationType; +import com.epam.ta.reportportal.jooq.tables.JIssue; +import com.epam.ta.reportportal.jooq.tables.JIssueGroup; +import com.epam.ta.reportportal.jooq.tables.JIssueTicket; +import com.epam.ta.reportportal.jooq.tables.JIssueType; +import com.epam.ta.reportportal.jooq.tables.JIssueTypeProject; +import com.epam.ta.reportportal.jooq.tables.JItemAttribute; +import com.epam.ta.reportportal.jooq.tables.JLaunch; +import com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules; +import com.epam.ta.reportportal.jooq.tables.JLaunchNames; +import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; +import com.epam.ta.reportportal.jooq.tables.JLog; +import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; +import com.epam.ta.reportportal.jooq.tables.JOnboarding; +import com.epam.ta.reportportal.jooq.tables.JParameter; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; +import com.epam.ta.reportportal.jooq.tables.JProject; +import com.epam.ta.reportportal.jooq.tables.JProjectAttribute; +import com.epam.ta.reportportal.jooq.tables.JProjectUser; +import com.epam.ta.reportportal.jooq.tables.JRecipients; +import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; +import com.epam.ta.reportportal.jooq.tables.JSenderCase; +import com.epam.ta.reportportal.jooq.tables.JServerSettings; +import com.epam.ta.reportportal.jooq.tables.JShareableEntity; +import com.epam.ta.reportportal.jooq.tables.JStatistics; +import com.epam.ta.reportportal.jooq.tables.JStatisticsField; +import com.epam.ta.reportportal.jooq.tables.JTestItem; +import com.epam.ta.reportportal.jooq.tables.JTestItemResults; +import com.epam.ta.reportportal.jooq.tables.JTicket; +import com.epam.ta.reportportal.jooq.tables.JUserCreationBid; +import com.epam.ta.reportportal.jooq.tables.JUserPreference; +import com.epam.ta.reportportal.jooq.tables.JUsers; +import com.epam.ta.reportportal.jooq.tables.JWidget; +import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; +import com.epam.ta.reportportal.jooq.tables.records.JAclClassRecord; +import com.epam.ta.reportportal.jooq.tables.records.JAclEntryRecord; +import com.epam.ta.reportportal.jooq.tables.records.JAclObjectIdentityRecord; +import com.epam.ta.reportportal.jooq.tables.records.JAclSidRecord; +import com.epam.ta.reportportal.jooq.tables.records.JActivityRecord; +import com.epam.ta.reportportal.jooq.tables.records.JAttachmentDeletionRecord; +import com.epam.ta.reportportal.jooq.tables.records.JAttachmentRecord; +import com.epam.ta.reportportal.jooq.tables.records.JAttributeRecord; +import com.epam.ta.reportportal.jooq.tables.records.JClustersRecord; +import com.epam.ta.reportportal.jooq.tables.records.JClustersTestItemRecord; +import com.epam.ta.reportportal.jooq.tables.records.JContentFieldRecord; +import com.epam.ta.reportportal.jooq.tables.records.JDashboardRecord; +import com.epam.ta.reportportal.jooq.tables.records.JDashboardWidgetRecord; +import com.epam.ta.reportportal.jooq.tables.records.JFilterConditionRecord; +import com.epam.ta.reportportal.jooq.tables.records.JFilterRecord; +import com.epam.ta.reportportal.jooq.tables.records.JFilterSortRecord; +import com.epam.ta.reportportal.jooq.tables.records.JIntegrationRecord; +import com.epam.ta.reportportal.jooq.tables.records.JIntegrationTypeRecord; +import com.epam.ta.reportportal.jooq.tables.records.JIssueGroupRecord; +import com.epam.ta.reportportal.jooq.tables.records.JIssueRecord; +import com.epam.ta.reportportal.jooq.tables.records.JIssueTicketRecord; +import com.epam.ta.reportportal.jooq.tables.records.JIssueTypeProjectRecord; +import com.epam.ta.reportportal.jooq.tables.records.JIssueTypeRecord; +import com.epam.ta.reportportal.jooq.tables.records.JItemAttributeRecord; +import com.epam.ta.reportportal.jooq.tables.records.JLaunchAttributeRulesRecord; +import com.epam.ta.reportportal.jooq.tables.records.JLaunchNamesRecord; +import com.epam.ta.reportportal.jooq.tables.records.JLaunchNumberRecord; +import com.epam.ta.reportportal.jooq.tables.records.JLaunchRecord; +import com.epam.ta.reportportal.jooq.tables.records.JLogRecord; +import com.epam.ta.reportportal.jooq.tables.records.JOauthAccessTokenRecord; +import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationRecord; +import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationRestrictionRecord; +import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationScopeRecord; +import com.epam.ta.reportportal.jooq.tables.records.JOnboardingRecord; +import com.epam.ta.reportportal.jooq.tables.records.JParameterRecord; +import com.epam.ta.reportportal.jooq.tables.records.JPatternTemplateRecord; +import com.epam.ta.reportportal.jooq.tables.records.JPatternTemplateTestItemRecord; +import com.epam.ta.reportportal.jooq.tables.records.JProjectAttributeRecord; +import com.epam.ta.reportportal.jooq.tables.records.JProjectRecord; +import com.epam.ta.reportportal.jooq.tables.records.JProjectUserRecord; +import com.epam.ta.reportportal.jooq.tables.records.JRecipientsRecord; +import com.epam.ta.reportportal.jooq.tables.records.JRestorePasswordBidRecord; +import com.epam.ta.reportportal.jooq.tables.records.JSenderCaseRecord; +import com.epam.ta.reportportal.jooq.tables.records.JServerSettingsRecord; +import com.epam.ta.reportportal.jooq.tables.records.JShareableEntityRecord; +import com.epam.ta.reportportal.jooq.tables.records.JStatisticsFieldRecord; +import com.epam.ta.reportportal.jooq.tables.records.JStatisticsRecord; +import com.epam.ta.reportportal.jooq.tables.records.JTestItemRecord; +import com.epam.ta.reportportal.jooq.tables.records.JTestItemResultsRecord; +import com.epam.ta.reportportal.jooq.tables.records.JTicketRecord; +import com.epam.ta.reportportal.jooq.tables.records.JUserCreationBidRecord; +import com.epam.ta.reportportal.jooq.tables.records.JUserPreferenceRecord; +import com.epam.ta.reportportal.jooq.tables.records.JUsersRecord; +import com.epam.ta.reportportal.jooq.tables.records.JWidgetFilterRecord; +import com.epam.ta.reportportal.jooq.tables.records.JWidgetRecord; + +import javax.annotation.processing.Generated; + import org.jooq.ForeignKey; import org.jooq.Identity; import org.jooq.UniqueKey; import org.jooq.impl.Internal; -import javax.annotation.processing.Generated; - /** * A class modelling foreign key relationships and constraints of tables of @@ -82,6 +191,7 @@ public class Keys { public static final UniqueKey UNIQUE_UK_1 = UniqueKeys0.UNIQUE_UK_1; public static final UniqueKey ACTIVITY_PK = UniqueKeys0.ACTIVITY_PK; public static final UniqueKey ATTACHMENT_PK = UniqueKeys0.ATTACHMENT_PK; + public static final UniqueKey ATTACHMENT_DELETION_PKEY = UniqueKeys0.ATTACHMENT_DELETION_PKEY; public static final UniqueKey ATTRIBUTE_PK = UniqueKeys0.ATTRIBUTE_PK; public static final UniqueKey CLUSTERS_PK = UniqueKeys0.CLUSTERS_PK; public static final UniqueKey INDEX_ID_LAUNCH_ID_UNQ = UniqueKeys0.INDEX_ID_LAUNCH_ID_UNQ; @@ -270,6 +380,7 @@ private static class UniqueKeys0 { public static final UniqueKey UNIQUE_UK_1 = Internal.createUniqueKey(JAclSid.ACL_SID, "unique_uk_1", JAclSid.ACL_SID.SID, JAclSid.ACL_SID.PRINCIPAL); public static final UniqueKey ACTIVITY_PK = Internal.createUniqueKey(JActivity.ACTIVITY, "activity_pk", JActivity.ACTIVITY.ID); public static final UniqueKey ATTACHMENT_PK = Internal.createUniqueKey(JAttachment.ATTACHMENT, "attachment_pk", JAttachment.ATTACHMENT.ID); + public static final UniqueKey ATTACHMENT_DELETION_PKEY = Internal.createUniqueKey(JAttachmentDeletion.ATTACHMENT_DELETION, "attachment_deletion_pkey", JAttachmentDeletion.ATTACHMENT_DELETION.ID); public static final UniqueKey ATTRIBUTE_PK = Internal.createUniqueKey(JAttribute.ATTRIBUTE, "attribute_pk", JAttribute.ATTRIBUTE.ID); public static final UniqueKey CLUSTERS_PK = Internal.createUniqueKey(JClusters.CLUSTERS, "clusters_pk", JClusters.CLUSTERS.ID); public static final UniqueKey INDEX_ID_LAUNCH_ID_UNQ = Internal.createUniqueKey(JClusters.CLUSTERS, "index_id_launch_id_unq", JClusters.CLUSTERS.INDEX_ID, JClusters.CLUSTERS.LAUNCH_ID); diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java b/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java index e07e007c7..4711cc1ad 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java @@ -4,11 +4,11 @@ package com.epam.ta.reportportal.jooq; +import javax.annotation.processing.Generated; + import org.jooq.Sequence; import org.jooq.impl.SequenceImpl; -import javax.annotation.processing.Generated; - /** * Convenience access to all sequences in public diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Tables.java b/src/main/java/com/epam/ta/reportportal/jooq/Tables.java index c6f771bc2..b77f6fdd2 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/Tables.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Tables.java @@ -4,14 +4,70 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.*; +import com.epam.ta.reportportal.jooq.tables.JAclClass; +import com.epam.ta.reportportal.jooq.tables.JAclEntry; +import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; +import com.epam.ta.reportportal.jooq.tables.JAclSid; +import com.epam.ta.reportportal.jooq.tables.JActivity; +import com.epam.ta.reportportal.jooq.tables.JAttachment; +import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; +import com.epam.ta.reportportal.jooq.tables.JAttribute; +import com.epam.ta.reportportal.jooq.tables.JClusters; +import com.epam.ta.reportportal.jooq.tables.JClustersTestItem; +import com.epam.ta.reportportal.jooq.tables.JContentField; +import com.epam.ta.reportportal.jooq.tables.JDashboard; +import com.epam.ta.reportportal.jooq.tables.JDashboardWidget; +import com.epam.ta.reportportal.jooq.tables.JFilter; +import com.epam.ta.reportportal.jooq.tables.JFilterCondition; +import com.epam.ta.reportportal.jooq.tables.JFilterSort; +import com.epam.ta.reportportal.jooq.tables.JIntegration; +import com.epam.ta.reportportal.jooq.tables.JIntegrationType; +import com.epam.ta.reportportal.jooq.tables.JIssue; +import com.epam.ta.reportportal.jooq.tables.JIssueGroup; +import com.epam.ta.reportportal.jooq.tables.JIssueTicket; +import com.epam.ta.reportportal.jooq.tables.JIssueType; +import com.epam.ta.reportportal.jooq.tables.JIssueTypeProject; +import com.epam.ta.reportportal.jooq.tables.JItemAttribute; +import com.epam.ta.reportportal.jooq.tables.JLaunch; +import com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules; +import com.epam.ta.reportportal.jooq.tables.JLaunchNames; +import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; +import com.epam.ta.reportportal.jooq.tables.JLog; +import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; +import com.epam.ta.reportportal.jooq.tables.JOnboarding; +import com.epam.ta.reportportal.jooq.tables.JParameter; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; +import com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders; +import com.epam.ta.reportportal.jooq.tables.JProject; +import com.epam.ta.reportportal.jooq.tables.JProjectAttribute; +import com.epam.ta.reportportal.jooq.tables.JProjectUser; +import com.epam.ta.reportportal.jooq.tables.JRecipients; +import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; +import com.epam.ta.reportportal.jooq.tables.JSenderCase; +import com.epam.ta.reportportal.jooq.tables.JServerSettings; +import com.epam.ta.reportportal.jooq.tables.JShareableEntity; +import com.epam.ta.reportportal.jooq.tables.JStatistics; +import com.epam.ta.reportportal.jooq.tables.JStatisticsField; +import com.epam.ta.reportportal.jooq.tables.JTestItem; +import com.epam.ta.reportportal.jooq.tables.JTestItemResults; +import com.epam.ta.reportportal.jooq.tables.JTicket; +import com.epam.ta.reportportal.jooq.tables.JUserCreationBid; +import com.epam.ta.reportportal.jooq.tables.JUserPreference; +import com.epam.ta.reportportal.jooq.tables.JUsers; +import com.epam.ta.reportportal.jooq.tables.JWidget; +import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; import com.epam.ta.reportportal.jooq.tables.records.JPgpArmorHeadersRecord; + +import javax.annotation.processing.Generated; + import org.jooq.Configuration; import org.jooq.Field; import org.jooq.Result; -import javax.annotation.processing.Generated; - /** * Convenience access to all tables in public @@ -56,6 +112,11 @@ public class Tables { */ public static final JAttachment ATTACHMENT = JAttachment.ATTACHMENT; + /** + * The table public.attachment_deletion. + */ + public static final JAttachmentDeletion ATTACHMENT_DELETION = JAttachmentDeletion.ATTACHMENT_DELETION; + /** * The table public.attribute. */ diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclObjectIdentity.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclObjectIdentity.java index c8edf042e..60968661a 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclObjectIdentity.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclObjectIdentity.java @@ -8,14 +8,26 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JAclObjectIdentityRecord; -import org.jooq.*; -import org.jooq.impl.DSL; -import org.jooq.impl.TableImpl; -import javax.annotation.processing.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row6; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java index cea39a14f..17b911178 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java @@ -43,7 +43,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JAttachment extends TableImpl { - private static final long serialVersionUID = 1859892484; + private static final long serialVersionUID = -1988681978; /** * The reference instance of public.attachment @@ -101,7 +101,7 @@ public Class getRecordType() { /** * The column public.attachment.creation_date. */ - public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); /** * Create a public.attachment table reference @@ -143,7 +143,7 @@ public Schema getSchema() { @Override public List getIndexes() { - return Arrays.asList(Indexes.ATT_ITEM_IDX, Indexes.ATT_LAUNCH_IDX, Indexes.ATT_PROJECT_IDX, Indexes.ATTACHMENT_PK); + return Arrays.asList(Indexes.ATT_ITEM_IDX, Indexes.ATT_LAUNCH_IDX, Indexes.ATT_PROJECT_IDX, Indexes.ATTACHMENT_PK, Indexes.ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX); } @Override diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachmentDeletion.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachmentDeletion.java new file mode 100644 index 000000000..6d09bc3a2 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachmentDeletion.java @@ -0,0 +1,172 @@ +/* + * This file is generated by jOOQ. + */ +package com.epam.ta.reportportal.jooq.tables; + + +import com.epam.ta.reportportal.jooq.Indexes; +import com.epam.ta.reportportal.jooq.JPublic; +import com.epam.ta.reportportal.jooq.Keys; +import com.epam.ta.reportportal.jooq.tables.records.JAttachmentDeletionRecord; + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row5; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.4" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JAttachmentDeletion extends TableImpl { + + private static final long serialVersionUID = -2120808493; + + /** + * The reference instance of public.attachment_deletion + */ + public static final JAttachmentDeletion ATTACHMENT_DELETION = new JAttachmentDeletion(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JAttachmentDeletionRecord.class; + } + + /** + * The column public.attachment_deletion.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.attachment_deletion.file_id. + */ + public final TableField FILE_ID = createField(DSL.name("file_id"), org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column public.attachment_deletion.thumbnail_id. + */ + public final TableField THUMBNAIL_ID = createField(DSL.name("thumbnail_id"), org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column public.attachment_deletion.creation_attachment_date. + */ + public final TableField CREATION_ATTACHMENT_DATE = createField(DSL.name("creation_attachment_date"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + + /** + * The column public.attachment_deletion.deletion_date. + */ + public final TableField DELETION_DATE = createField(DSL.name("deletion_date"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + + /** + * Create a public.attachment_deletion table reference + */ + public JAttachmentDeletion() { + this(DSL.name("attachment_deletion"), null); + } + + /** + * Create an aliased public.attachment_deletion table reference + */ + public JAttachmentDeletion(String alias) { + this(DSL.name(alias), ATTACHMENT_DELETION); + } + + /** + * Create an aliased public.attachment_deletion table reference + */ + public JAttachmentDeletion(Name alias) { + this(alias, ATTACHMENT_DELETION); + } + + private JAttachmentDeletion(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JAttachmentDeletion(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JAttachmentDeletion(Table child, ForeignKey key) { + super(child, key, ATTACHMENT_DELETION); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ATTACHMENT_DELETION_PKEY); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ATTACHMENT_DELETION_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ATTACHMENT_DELETION_PKEY); + } + + @Override + public JAttachmentDeletion as(String alias) { + return new JAttachmentDeletion(DSL.name(alias), this); + } + + @Override + public JAttachmentDeletion as(Name alias) { + return new JAttachmentDeletion(alias, this); + } + + /** + * Rename this table + */ + @Override + public JAttachmentDeletion rename(String name) { + return new JAttachmentDeletion(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JAttachmentDeletion rename(Name name) { + return new JAttachmentDeletion(name, null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } +} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JClusters.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JClusters.java index 618683e95..5d8ab0c83 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JClusters.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JClusters.java @@ -8,14 +8,26 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JClustersRecord; -import org.jooq.*; -import org.jooq.impl.DSL; -import org.jooq.impl.TableImpl; -import javax.annotation.processing.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row5; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JClustersTestItem.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JClustersTestItem.java index 2ba85e0a3..98498d548 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JClustersTestItem.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JClustersTestItem.java @@ -8,14 +8,25 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JClustersTestItemRecord; -import org.jooq.*; -import org.jooq.impl.DSL; -import org.jooq.impl.TableImpl; -import javax.annotation.processing.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row2; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JItemAttribute.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JItemAttribute.java index 9138e035b..28fb6cedb 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JItemAttribute.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JItemAttribute.java @@ -8,14 +8,26 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JItemAttributeRecord; -import org.jooq.*; -import org.jooq.impl.DSL; -import org.jooq.impl.TableImpl; -import javax.annotation.processing.Generated; import java.util.Arrays; import java.util.List; +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row6; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunch.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunch.java index 62b1c7e78..38a03ae90 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunch.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunch.java @@ -10,15 +10,27 @@ import com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum; import com.epam.ta.reportportal.jooq.enums.JStatusEnum; import com.epam.ta.reportportal.jooq.tables.records.JLaunchRecord; -import org.jooq.*; -import org.jooq.impl.DSL; -import org.jooq.impl.TableImpl; -import javax.annotation.processing.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row15; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. @@ -33,7 +45,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JLaunch extends TableImpl { - private static final long serialVersionUID = 260824601; + private static final long serialVersionUID = 1513226778; /** * The reference instance of public.launch diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLog.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLog.java index 1bb532c26..023f79df7 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLog.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLog.java @@ -8,15 +8,27 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JLogRecord; -import org.jooq.*; -import org.jooq.impl.DSL; -import org.jooq.impl.TableImpl; -import javax.annotation.processing.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row11; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + /** * This class is generated by jOOQ. diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOnboarding.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOnboarding.java index cf01767ee..da8518405 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOnboarding.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOnboarding.java @@ -33,7 +33,7 @@ /** * This class is generated by jOOQ. */ - @Generated( +@Generated( value = { "http://www.jooq.org", "jOOQ version:3.12.4" diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTicket.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTicket.java index 7c9f9b70e..0520aa80f 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTicket.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTicket.java @@ -21,7 +21,7 @@ import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row7; +import org.jooq.Row8; import org.jooq.Schema; import org.jooq.Table; import org.jooq.TableField; @@ -43,7 +43,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JTicket extends TableImpl { - private static final long serialVersionUID = -328642386; + private static final long serialVersionUID = -119397332; /** * The reference instance of public.ticket @@ -93,6 +93,11 @@ public Class getRecordType() { */ public final TableField URL = createField(DSL.name("url"), org.jooq.impl.SQLDataType.VARCHAR(1024).nullable(false), this, ""); + /** + * The column public.ticket.plugin_name. + */ + public final TableField PLUGIN_NAME = createField(DSL.name("plugin_name"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); + /** * Create a public.ticket table reference */ @@ -178,11 +183,11 @@ public JTicket rename(Name name) { } // ------------------------------------------------------------------------- - // Row7 type methods + // Row8 type methods // ------------------------------------------------------------------------- @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentDeletionRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentDeletionRecord.java new file mode 100644 index 000000000..dc92a59ab --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentDeletionRecord.java @@ -0,0 +1,266 @@ +/* + * This file is generated by jOOQ. + */ +package com.epam.ta.reportportal.jooq.tables.records; + + +import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; + +import java.sql.Timestamp; + +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record5; +import org.jooq.Row5; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.4" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JAttachmentDeletionRecord extends UpdatableRecordImpl implements Record5 { + + private static final long serialVersionUID = 1506388720; + + /** + * Setter for public.attachment_deletion.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.attachment_deletion.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.attachment_deletion.file_id. + */ + public void setFileId(String value) { + set(1, value); + } + + /** + * Getter for public.attachment_deletion.file_id. + */ + public String getFileId() { + return (String) get(1); + } + + /** + * Setter for public.attachment_deletion.thumbnail_id. + */ + public void setThumbnailId(String value) { + set(2, value); + } + + /** + * Getter for public.attachment_deletion.thumbnail_id. + */ + public String getThumbnailId() { + return (String) get(2); + } + + /** + * Setter for public.attachment_deletion.creation_attachment_date. + */ + public void setCreationAttachmentDate(Timestamp value) { + set(3, value); + } + + /** + * Getter for public.attachment_deletion.creation_attachment_date. + */ + public Timestamp getCreationAttachmentDate() { + return (Timestamp) get(3); + } + + /** + * Setter for public.attachment_deletion.deletion_date. + */ + public void setDeletionDate(Timestamp value) { + set(4, value); + } + + /** + * Getter for public.attachment_deletion.deletion_date. + */ + public Timestamp getDeletionDate() { + return (Timestamp) get(4); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return JAttachmentDeletion.ATTACHMENT_DELETION.ID; + } + + @Override + public Field field2() { + return JAttachmentDeletion.ATTACHMENT_DELETION.FILE_ID; + } + + @Override + public Field field3() { + return JAttachmentDeletion.ATTACHMENT_DELETION.THUMBNAIL_ID; + } + + @Override + public Field field4() { + return JAttachmentDeletion.ATTACHMENT_DELETION.CREATION_ATTACHMENT_DATE; + } + + @Override + public Field field5() { + return JAttachmentDeletion.ATTACHMENT_DELETION.DELETION_DATE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getFileId(); + } + + @Override + public String component3() { + return getThumbnailId(); + } + + @Override + public Timestamp component4() { + return getCreationAttachmentDate(); + } + + @Override + public Timestamp component5() { + return getDeletionDate(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getFileId(); + } + + @Override + public String value3() { + return getThumbnailId(); + } + + @Override + public Timestamp value4() { + return getCreationAttachmentDate(); + } + + @Override + public Timestamp value5() { + return getDeletionDate(); + } + + @Override + public JAttachmentDeletionRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JAttachmentDeletionRecord value2(String value) { + setFileId(value); + return this; + } + + @Override + public JAttachmentDeletionRecord value3(String value) { + setThumbnailId(value); + return this; + } + + @Override + public JAttachmentDeletionRecord value4(Timestamp value) { + setCreationAttachmentDate(value); + return this; + } + + @Override + public JAttachmentDeletionRecord value5(Timestamp value) { + setDeletionDate(value); + return this; + } + + @Override + public JAttachmentDeletionRecord values(Long value1, String value2, String value3, Timestamp value4, Timestamp value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JAttachmentDeletionRecord + */ + public JAttachmentDeletionRecord() { + super(JAttachmentDeletion.ATTACHMENT_DELETION); + } + + /** + * Create a detached, initialised JAttachmentDeletionRecord + */ + public JAttachmentDeletionRecord(Long id, String fileId, String thumbnailId, Timestamp creationAttachmentDate, Timestamp deletionDate) { + super(JAttachmentDeletion.ATTACHMENT_DELETION); + + set(0, id); + set(1, fileId); + set(2, thumbnailId); + set(3, creationAttachmentDate); + set(4, deletionDate); + } +} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersRecord.java index b98e6a985..e165b6b84 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersRecord.java @@ -5,14 +5,15 @@ import com.epam.ta.reportportal.jooq.tables.JClusters; + +import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record5; import org.jooq.Row5; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.processing.Generated; - /** * This class is generated by jOOQ. diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTicketRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTicketRecord.java index 9e359b1f2..8891add6c 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTicketRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTicketRecord.java @@ -12,8 +12,8 @@ import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record7; -import org.jooq.Row7; +import org.jooq.Record8; +import org.jooq.Row8; import org.jooq.impl.UpdatableRecordImpl; @@ -28,9 +28,9 @@ comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JTicketRecord extends UpdatableRecordImpl implements Record7 { +public class JTicketRecord extends UpdatableRecordImpl implements Record8 { - private static final long serialVersionUID = 2052710105; + private static final long serialVersionUID = 2136482225; /** * Setter for public.ticket.id. @@ -130,6 +130,20 @@ public String getUrl() { return (String) get(6); } + /** + * Setter for public.ticket.plugin_name. + */ + public void setPluginName(String value) { + set(7, value); + } + + /** + * Getter for public.ticket.plugin_name. + */ + public String getPluginName() { + return (String) get(7); + } + // ------------------------------------------------------------------------- // Primary key information // ------------------------------------------------------------------------- @@ -140,17 +154,17 @@ public Record1 key() { } // ------------------------------------------------------------------------- - // Record7 type implementation + // Record8 type implementation // ------------------------------------------------------------------------- @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); } @Override - public Row7 valuesRow() { - return (Row7) super.valuesRow(); + public Row8 valuesRow() { + return (Row8) super.valuesRow(); } @Override @@ -188,6 +202,11 @@ public Field field7() { return JTicket.TICKET.URL; } + @Override + public Field field8() { + return JTicket.TICKET.PLUGIN_NAME; + } + @Override public Long component1() { return getId(); @@ -223,6 +242,11 @@ public String component7() { return getUrl(); } + @Override + public String component8() { + return getPluginName(); + } + @Override public Long value1() { return getId(); @@ -258,6 +282,11 @@ public String value7() { return getUrl(); } + @Override + public String value8() { + return getPluginName(); + } + @Override public JTicketRecord value1(Long value) { setId(value); @@ -301,7 +330,13 @@ public JTicketRecord value7(String value) { } @Override - public JTicketRecord values(Long value1, String value2, String value3, Timestamp value4, String value5, String value6, String value7) { + public JTicketRecord value8(String value) { + setPluginName(value); + return this; + } + + @Override + public JTicketRecord values(Long value1, String value2, String value3, Timestamp value4, String value5, String value6, String value7, String value8) { value1(value1); value2(value2); value3(value3); @@ -309,6 +344,7 @@ public JTicketRecord values(Long value1, String value2, String value3, Timestamp value5(value5); value6(value6); value7(value7); + value8(value8); return this; } @@ -326,7 +362,7 @@ public JTicketRecord() { /** * Create a detached, initialised JTicketRecord */ - public JTicketRecord(Long id, String ticketId, String submitter, Timestamp submitDate, String btsUrl, String btsProject, String url) { + public JTicketRecord(Long id, String ticketId, String submitter, Timestamp submitDate, String btsUrl, String btsProject, String url, String pluginName) { super(JTicket.TICKET); set(0, id); @@ -336,5 +372,6 @@ public JTicketRecord(Long id, String ticketId, String submitter, Timestamp submi set(4, btsUrl); set(5, btsProject); set(6, url); + set(7, pluginName); } } From 8937db55d5fde4f4ca54438735b154f999028eb7 Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 24 Dec 2021 12:03:21 +0300 Subject: [PATCH 009/110] EPMRPP-68897 || Widget on Dashboards count query (#799) Co-authored-by: Ivan_Budayeu Co-authored-by: Pavel Bortnik --- .../dao/DashboardWidgetRepository.java | 2 ++ .../dao/DashboardWidgetRepositoryTest.java | 26 ++++++++++++++ .../dashboard-widget-fill.sql | 34 +++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 src/test/java/com/epam/ta/reportportal/dao/DashboardWidgetRepositoryTest.java create mode 100644 src/test/resources/db/fill/dashboard-widget/dashboard-widget-fill.sql diff --git a/src/main/java/com/epam/ta/reportportal/dao/DashboardWidgetRepository.java b/src/main/java/com/epam/ta/reportportal/dao/DashboardWidgetRepository.java index b5adcb0bc..c7ec15a61 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/DashboardWidgetRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/DashboardWidgetRepository.java @@ -23,4 +23,6 @@ * @author Pavel Bortnik */ public interface DashboardWidgetRepository extends ReportPortalRepository { + + int countAllByWidgetId(Long widgetId); } diff --git a/src/test/java/com/epam/ta/reportportal/dao/DashboardWidgetRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/DashboardWidgetRepositoryTest.java new file mode 100644 index 000000000..61cdc09ea --- /dev/null +++ b/src/test/java/com/epam/ta/reportportal/dao/DashboardWidgetRepositoryTest.java @@ -0,0 +1,26 @@ +package com.epam.ta.reportportal.dao; + +import com.epam.ta.reportportal.BaseTest; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.jdbc.Sql; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * @author Ivan Budayeu + */ +@Sql("/db/fill/dashboard-widget/dashboard-widget-fill.sql") +class DashboardWidgetRepositoryTest extends BaseTest { + + @Autowired + private DashboardWidgetRepository dashboardWidgetRepository; + + @Test + void countAllByWidgetId() { + Assertions.assertEquals(3,dashboardWidgetRepository.countAllByWidgetId(5L)); + Assertions.assertEquals(2,dashboardWidgetRepository.countAllByWidgetId(6L)); + } + +} \ No newline at end of file diff --git a/src/test/resources/db/fill/dashboard-widget/dashboard-widget-fill.sql b/src/test/resources/db/fill/dashboard-widget/dashboard-widget-fill.sql new file mode 100644 index 000000000..22b6f1922 --- /dev/null +++ b/src/test/resources/db/fill/dashboard-widget/dashboard-widget-fill.sql @@ -0,0 +1,34 @@ +DELETE FROM public.users WHERE id = 3; + +INSERT INTO public.users (id, login, password, email, attachment, attachment_thumbnail, role, type, expired, full_name, metadata) +VALUES (3, 'jaja_user', '7c381f9d81b0e438af4e7094c6cae203', 'jaja@mail.com', null, null, 'USER', 'INTERNAL', false, 'Jaja Juja', '{"metadata": {"last_login": 1546605767372}}'); + +INSERT INTO public.project_user (user_id, project_id, project_role) VALUES (3, 1, 'MEMBER'); + +INSERT INTO public.shareable_entity (id, shared, owner, project_id) VALUES + (5, true, 'superadmin', 1), + (6, false, 'superadmin', 1), + (13, true, 'superadmin', 1), + (14, false, 'superadmin', 1), + (15, true, 'jaja_user', 1), + (16, false, 'jaja_user', 1), + (17, true, 'default', 2), + (18, false, 'default', 2); + +INSERT INTO public.widget (id, name, description, widget_type, items_count, widget_options) VALUES + (5, 'activity stream12', null, 'activityStream', 50, '{"options": {"user": "superadmin", "actionType": ["startLaunch", "finishLaunch"]}}'), + (6, 'LAUNCH STATISTICS', null, 'launchStatistics', 10, '{"options": {"timeline": "WEEK"}}'); + +INSERT INTO public.dashboard (id, name, description, creation_date) VALUES + (13, 'test admin dashboard', 'admin shared dashboard', '2019-01-10 13:01:06.083000'), + (14, 'test admin private dashboard', 'admin dashboard', '2019-01-10 13:01:19.259000'), + (15, 'test jaja shared dashboard', 'jaja dashboard', '2019-01-10 13:01:51.417000'); + +INSERT INTO public.dashboard_widget (dashboard_id, widget_id, widget_name, widget_owner, widget_type, widget_width, widget_height, + widget_position_x, + widget_position_y) +VALUES (13, 5, 'activity stream12', 'superadmin', 'activityStream', 5, 5, 0, 0), + (13, 6, 'INVESTIGATED PERCENTAGE OF LAUNCHES', 'superadmin', 'investigatedTrend', 6, 3, 0, 0), + (14, 5, 'activity stream12', 'superadmin', 'activityStream', 5, 5, 0, 0), + (14, 6, 'LAUNCH STATISTICS', 'superadmin', 'launchStatistics', 4, 6, 0, 0), + (15, 5, 'TEST CASES GROWTH TREND CHART', 'jaja_user', 'topTestCases', 7, 3, 0, 0); \ No newline at end of file From 70ac4ee50b1e4c7a95e4f07158c666bd2a87cf01 Mon Sep 17 00:00:00 2001 From: miracle8484 <76156909+miracle8484@users.noreply.github.com> Date: Mon, 27 Dec 2021 09:44:45 +0200 Subject: [PATCH 010/110] EPMRPP-68649 || Saving log message to elastic (#801) --- build.gradle | 1 + project-properties.gradle | 2 +- .../config/ElasticConfiguration.java | 40 ++++ .../elastic/dao/LogMessageRepository.java | 11 + .../elastic/dao/LogMessageRepositoryFake.java | 210 ++++++++++++++++++ .../reportportal/entity/log/LogMessage.java | 101 +++++++++ .../resources/test-application.properties | 7 +- 7 files changed, 370 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/epam/ta/reportportal/config/ElasticConfiguration.java create mode 100644 src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java create mode 100644 src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java create mode 100644 src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java diff --git a/build.gradle b/build.gradle index 09a257c0f..990533431 100644 --- a/build.gradle +++ b/build.gradle @@ -71,6 +71,7 @@ dependencies { exclude group: 'org.hibernate', module: 'hibernate-core' } compile('org.hibernate:hibernate-core:5.4.18.Final') + compile('org.springframework.boot:spring-boot-starter-data-elasticsearch') // //https://nvd.nist.gov/vuln/detail/CVE-2020-13692 diff --git a/project-properties.gradle b/project-properties.gradle index ab430568d..b3ce0e5d4 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -63,7 +63,7 @@ project.ext { (migrationsUrl + '/migrations/51_cluster.up.sql') : 'V051__cluster.sql', (migrationsUrl + '/migrations/52_analyzer_search_attribute.up.sql') : 'V052__analyzer_search_attribute.sql', (migrationsUrl + '/migrations/54_analyzer_unique_error_attribute.up.sql') : 'V054__analyzer_unique_error_attribute.sql', - (migrationsUrl + '/migrations/56_alter_ticket.up.sql') : 'V056__alter_ticket.sql', + (migrationsUrl + '/migrations/58_alter_ticket.up.sql') : 'V058__alter_ticket.sql', ] excludeTests = [ diff --git a/src/main/java/com/epam/ta/reportportal/config/ElasticConfiguration.java b/src/main/java/com/epam/ta/reportportal/config/ElasticConfiguration.java new file mode 100644 index 000000000..26efee0bb --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/config/ElasticConfiguration.java @@ -0,0 +1,40 @@ +package com.epam.ta.reportportal.config; + +import org.elasticsearch.client.RestHighLevelClient; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.elasticsearch.client.ClientConfiguration; +import org.springframework.data.elasticsearch.client.RestClients; +import org.springframework.data.elasticsearch.core.ElasticsearchOperations; +import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; +import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; + +@Configuration +@EnableElasticsearchRepositories( + basePackages = "com.epam.ta.reportportal.elastic.dao" +) +public class ElasticConfiguration { + + @Bean + @ConditionalOnExpression("!T(org.springframework.util.StringUtils).isEmpty('${rp.elasticsearchLogmessage.host}')") + public RestHighLevelClient client(@Value("${rp.elasticsearchLogmessage.host}") String host, + @Value("${rp.elasticsearchLogmessage.port}") int port, + @Value("${rp.elasticsearchLogmessage.username}") String username, + @Value("${rp.elasticsearchLogmessage.password}") String password) { + ClientConfiguration clientConfiguration + = ClientConfiguration.builder() + .connectedTo(host + ":" + port) + .withBasicAuth(username, password) + .build(); + + return RestClients.create(clientConfiguration).rest(); + } + + @Bean + @ConditionalOnExpression("!T(org.springframework.util.StringUtils).isEmpty('${rp.elasticsearchLogmessage.host}')") + public ElasticsearchOperations elasticsearchTemplate(RestHighLevelClient restHighLevelClient) { + return new ElasticsearchRestTemplate(restHighLevelClient); + } +} diff --git a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java new file mode 100644 index 000000000..0971aef2a --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java @@ -0,0 +1,11 @@ +package com.epam.ta.reportportal.elastic.dao; + +import com.epam.ta.reportportal.entity.log.LogMessage; +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; +import org.springframework.stereotype.Repository; + +@Repository +@ConditionalOnExpression("!T(org.springframework.util.StringUtils).isEmpty('${rp.elasticsearchLogmessage.host}')") +public interface LogMessageRepository extends ElasticsearchRepository { +} diff --git a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java new file mode 100644 index 000000000..d62fa5168 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java @@ -0,0 +1,210 @@ +package com.epam.ta.reportportal.elastic.dao; + +import com.epam.ta.reportportal.entity.log.LogMessage; +import org.elasticsearch.index.query.QueryBuilder; +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.elasticsearch.core.query.SearchQuery; +import org.springframework.stereotype.Repository; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; +import java.util.function.Function; + +/** + * Fake repository, need in case if configuration for elastic with logs doesn't exist. + */ +@Repository +@ConditionalOnExpression("T(org.springframework.util.StringUtils).isEmpty('${rp.elasticsearchLogmessage.host}')") +public class LogMessageRepositoryFake implements LogMessageRepository { + private final Iterable logMessageIterable = () -> null; + + @Override + public S index(S entity) { + return null; + } + + @Override + public S indexWithoutRefresh(S entity) { + return null; + } + + @Override + public Iterable search(QueryBuilder query) { + return null; + } + + @Override + public Page search(QueryBuilder query, Pageable pageable) { + return null; + } + + @Override + public Page search(SearchQuery searchQuery) { + return null; + } + + @Override + public Page searchSimilar(LogMessage entity, String[] fields, Pageable pageable) { + return null; + } + + @Override + public void refresh() { + + } + + @Override + public Class getEntityClass() { + return null; + } + + @Override + public Iterable findAll(Sort sort) { + return logMessageIterable; + } + + @Override + public Page findAll(Pageable pageable) { + return new Page() { + @Override + public int getTotalPages() { + return 0; + } + + @Override + public long getTotalElements() { + return 0; + } + + @Override + public Page map(Function converter) { + return Page.empty(); + } + + @Override + public int getNumber() { + return 0; + } + + @Override + public int getSize() { + return 0; + } + + @Override + public int getNumberOfElements() { + return 0; + } + + @Override + public List getContent() { + return new ArrayList<>(); + } + + @Override + public boolean hasContent() { + return false; + } + + @Override + public Sort getSort() { + return Sort.unsorted(); + } + + @Override + public boolean isFirst() { + return false; + } + + @Override + public boolean isLast() { + return false; + } + + @Override + public boolean hasNext() { + return false; + } + + @Override + public boolean hasPrevious() { + return false; + } + + @Override + public Pageable nextPageable() { + return Pageable.unpaged(); + } + + @Override + public Pageable previousPageable() { + return Pageable.unpaged(); + } + + @Override + public Iterator iterator() { + return null; + } + }; + } + + @Override + public S save(S entity) { + return entity; + } + + @Override + public Iterable saveAll(Iterable entities) { + return entities; + } + + @Override + public Optional findById(Long aLong) { + return Optional.empty(); + } + + @Override + public boolean existsById(Long aLong) { + return false; + } + + @Override + public Iterable findAll() { + return logMessageIterable; + } + + @Override + public Iterable findAllById(Iterable longs) { + return logMessageIterable; + } + + @Override + public long count() { + return 0; + } + + @Override + public void deleteById(Long aLong) { + + } + + @Override + public void delete(LogMessage entity) { + + } + + @Override + public void deleteAll(Iterable entities) { + + } + + @Override + public void deleteAll() { + + } +} diff --git a/src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java b/src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java new file mode 100644 index 000000000..2b544577b --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java @@ -0,0 +1,101 @@ +package com.epam.ta.reportportal.entity.log; + +import org.springframework.data.elasticsearch.annotations.DateFormat; +import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.annotations.Field; +import org.springframework.data.elasticsearch.annotations.FieldType; + +import javax.persistence.Id; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Objects; + +@Document(indexName = "log_message_store", type="log_message", createIndex = false) +public class LogMessage implements Serializable { + + @Id + @Field(type = FieldType.Long) + private Long id; + @Field(type = FieldType.Date, format = DateFormat.date_optional_time) + private LocalDateTime logTime; + @Field(type = FieldType.Text) + private String logMessage; + @Field(type = FieldType.Long) + private Long itemId; + @Field(type = FieldType.Long) + private Long launchId; + @Field(type = FieldType.Long) + private Long projectId; + + public LogMessage(Long id, LocalDateTime logTime, String logMessage, Long itemId, Long launchId, Long projectId) { + this.id = id; + this.logTime = logTime; + this.logMessage = logMessage; + this.itemId = itemId; + this.launchId = launchId; + this.projectId = projectId; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public LocalDateTime getLogTime() { + return logTime; + } + + public void setLogTime(LocalDateTime logTime) { + this.logTime = logTime; + } + + public String getLogMessage() { + return logMessage; + } + + public void setLogMessage(String logMessage) { + this.logMessage = logMessage; + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public Long getLaunchId() { + return launchId; + } + + public void setLaunchId(Long launchId) { + this.launchId = launchId; + } + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + LogMessage that = (LogMessage) o; + return Objects.equals(id, that.id) && Objects.equals(logTime, that.logTime) + && Objects.equals(logMessage, that.logMessage) && Objects.equals(itemId, that.itemId) + && Objects.equals(launchId, that.launchId) && Objects.equals(projectId, that.projectId); + } + + @Override + public int hashCode() { + return Objects.hash(id, logTime, logMessage, itemId, launchId, projectId); + } +} diff --git a/src/test/resources/test-application.properties b/src/test/resources/test-application.properties index 0a5ed2558..a7d0a5a1d 100644 --- a/src/test/resources/test-application.properties +++ b/src/test/resources/test-application.properties @@ -30,4 +30,9 @@ datastore.type=${rp.binarystore.type:filesystem} datastore.thumbnail.attachment.width=${rp.binarystore.thumbnail.attachment.width:100} datastore.thumbnail.attachment.height=${rp.binarystore.thumbnail.attachment.height:55} datastore.thumbnail.avatar.width=${rp.binarystore.thumbnail.avatar.width:40} -datastore.thumbnail.avatar.height=${rp.binarystore.thumbnail.avatar.height:50} \ No newline at end of file +datastore.thumbnail.avatar.height=${rp.binarystore.thumbnail.avatar.height:50} +# Configuration for elasticsearch for storing log message +rp.elasticsearchLogmessage.host +rp.elasticsearchLogmessage.port +rp.elasticsearchLogmessage.username +rp.elasticsearchLogmessage.password From 18bd31885f9f7b0642fa407d765ff0301a15fcc2 Mon Sep 17 00:00:00 2001 From: Ivan_Budayeu Date: Tue, 28 Dec 2021 16:00:16 +0300 Subject: [PATCH 011/110] EPMRPP-56432 || Top criteria max start time fix --- .../dao/WidgetContentRepositoryImpl.java | 6 +++--- .../ta/reportportal/dao/util/WidgetContentUtil.java | 13 +++++++++++++ .../entity/widget/content/CriteriaHistoryItem.java | 6 +++--- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java index 56316e618..acf73a657 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java @@ -131,12 +131,12 @@ private Condition itemTypeStepCondition(boolean includeMethods) { public List topItemsByCriteria(Filter filter, String criteria, int limit, boolean includeMethods) { Table> criteriaTable = getTopItemsCriteriaTable(filter, criteria, limit, includeMethods); - return dsl.select(TEST_ITEM.UNIQUE_ID, + return CRITERIA_HISTORY_ITEM_FETCHER.apply(dsl.select(TEST_ITEM.UNIQUE_ID, TEST_ITEM.NAME, DSL.arrayAgg(when(fieldName(criteriaTable.getName(), CRITERIA_FLAG).cast(Integer.class).ge(1), true).otherwise(false)) .orderBy(LAUNCH.NUMBER.asc()) .as(STATUS_HISTORY), - DSL.arrayAgg(TEST_ITEM.START_TIME).orderBy(LAUNCH.NUMBER.asc()).as(START_TIME_HISTORY), + DSL.max(TEST_ITEM.START_TIME).filterWhere(fieldName(criteriaTable.getName(), CRITERIA_FLAG).cast(Integer.class).ge(1)).as(START_TIME_HISTORY), DSL.sum(fieldName(criteriaTable.getName(), CRITERIA_FLAG).cast(Integer.class)).as(CRITERIA), DSL.count(TEST_ITEM.ITEM_ID).as(TOTAL) ) @@ -149,7 +149,7 @@ public List topItemsByCriteria(Filter filter, String criter .having(DSL.sum(fieldName(criteriaTable.getName(), CRITERIA_FLAG).cast(Integer.class)).greaterThan(BigDecimal.ZERO)) .orderBy(DSL.field(DSL.name(CRITERIA)).desc(), DSL.field(DSL.name(TOTAL)).asc()) .limit(MOST_FAILED_CRITERIA_LIMIT) - .fetchInto(CriteriaHistoryItem.class); + .fetch()); } private Table> getTopItemsCriteriaTable(Filter filter, String criteria, int limit, boolean includeMethods) { diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/WidgetContentUtil.java b/src/main/java/com/epam/ta/reportportal/dao/util/WidgetContentUtil.java index 7f1361f4a..f67cd9fe4 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/WidgetContentUtil.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/WidgetContentUtil.java @@ -433,6 +433,19 @@ private static void proceedProductStatusAttributes(Record record, String columnN }) .collect(Collectors.toList()); + public static final Function, List> CRITERIA_HISTORY_ITEM_FETCHER = result -> result.stream() + .map(record -> { + CriteriaHistoryItem entry = new CriteriaHistoryItem(); + entry.setStatus(record.get(DSL.field(fieldName(STATUS_HISTORY)), Boolean[].class)); + entry.setCriteria(record.get(DSL.field(fieldName(CRITERIA)), Long.class)); + entry.setTotal(record.get(DSL.field(fieldName(TOTAL)), Long.class)); + entry.setName(record.get(TEST_ITEM.NAME)); + entry.setUniqueId(record.get(TEST_ITEM.UNIQUE_ID)); + entry.setStartTime(Collections.singletonList(record.get(DSL.field(fieldName(START_TIME_HISTORY)), Date.class))); + return entry; + }) + .collect(Collectors.toList()); + public static final Function, List> LAUNCHES_STATISTICS_FETCHER = result -> new ArrayList<>( STATISTICS_FETCHER.apply(result).values()); diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/CriteriaHistoryItem.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/CriteriaHistoryItem.java index fe9ae9e07..0ea001667 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/CriteriaHistoryItem.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/CriteriaHistoryItem.java @@ -41,7 +41,7 @@ public class CriteriaHistoryItem implements Serializable { private Long criteria; @Column(name = STATUS_HISTORY) - private List status; + private Boolean[] status; @Column(name = START_TIME_HISTORY) private List startTime; @@ -78,11 +78,11 @@ public void setCriteria(Long criteria) { this.criteria = criteria; } - public List getStatus() { + public Boolean[] getStatus() { return status; } - public void setStatus(List status) { + public void setStatus(Boolean[] status) { this.status = status; } From 72a1042f0b1c837af301018540e73e2b05cd31b2 Mon Sep 17 00:00:00 2001 From: Ivan_Budayeu Date: Thu, 30 Dec 2021 14:10:23 +0300 Subject: [PATCH 012/110] EPMRPP-72339 || AA enalbed by default --- .../epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java b/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java index 8fc0ce2b6..ba691e672 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java @@ -41,7 +41,7 @@ public enum ProjectAttributeEnum { NUMBER_OF_LOG_LINES(Prefix.ANALYZER + "numberOfLogLines", String.valueOf(ProjectAnalyzerConfig.NUMBER_OF_LOG_LINES)), INDEXING_RUNNING(Prefix.ANALYZER + "indexingRunning", String.valueOf(false)), AUTO_PATTERN_ANALYZER_ENABLED(Prefix.ANALYZER + "isAutoPatternAnalyzerEnabled", String.valueOf(false)), - AUTO_ANALYZER_ENABLED(Prefix.ANALYZER + "isAutoAnalyzerEnabled", String.valueOf(false)), + AUTO_ANALYZER_ENABLED(Prefix.ANALYZER + "isAutoAnalyzerEnabled", String.valueOf(true)), AUTO_ANALYZER_MODE(Prefix.ANALYZER + "autoAnalyzerMode", AnalyzeMode.BY_LAUNCH_NAME.getValue()), ALL_MESSAGES_SHOULD_MATCH(Prefix.ANALYZER + "allMessagesShouldMatch", String.valueOf(false)), SEARCH_LOGS_MIN_SHOULD_MATCH(Prefix.ANALYZER + "searchLogsMinShouldMatch", String.valueOf(ProjectAnalyzerConfig.MIN_SHOULD_MATCH)), From 7ebb32d6502cbec1f2b0cfc7bf438d3856acf868 Mon Sep 17 00:00:00 2001 From: Ivan Date: Thu, 30 Dec 2021 18:13:22 +0300 Subject: [PATCH 013/110] ElasticSearch config refactoring --- .../config/ElasticAutoConfiguration.java | 37 +++++++++++++++++ .../config/ElasticConfiguration.java | 40 ------------------- .../elastic/dao/LogMessageRepository.java | 4 +- .../elastic/dao/LogMessageRepositoryFake.java | 4 +- src/main/resources/META-INF/spring.factories | 2 + .../resources/test-application.properties | 4 -- 6 files changed, 43 insertions(+), 48 deletions(-) create mode 100644 src/main/java/com/epam/ta/reportportal/config/ElasticAutoConfiguration.java delete mode 100644 src/main/java/com/epam/ta/reportportal/config/ElasticConfiguration.java create mode 100644 src/main/resources/META-INF/spring.factories diff --git a/src/main/java/com/epam/ta/reportportal/config/ElasticAutoConfiguration.java b/src/main/java/com/epam/ta/reportportal/config/ElasticAutoConfiguration.java new file mode 100644 index 000000000..87b0cb04e --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/config/ElasticAutoConfiguration.java @@ -0,0 +1,37 @@ +package com.epam.ta.reportportal.config; + +import org.elasticsearch.client.RestHighLevelClient; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.elasticsearch.client.ClientConfiguration; +import org.springframework.data.elasticsearch.client.RestClients; +import org.springframework.data.elasticsearch.core.ElasticsearchOperations; +import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; +import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; + +@Configuration +@EnableElasticsearchRepositories(basePackages = "com.epam.ta.reportportal.elastic.dao") +@ConditionalOnProperty(prefix = "rp.elasticsearchLogmessage", name = "host") +public class ElasticAutoConfiguration { + + @Bean + public RestHighLevelClient client(@Value("${rp.elasticsearchLogmessage.host}") String host, + @Value("${rp.elasticsearchLogmessage.port}") int port, @Value("${rp.elasticsearchLogmessage.username}") String username, + @Value("${rp.elasticsearchLogmessage.password}") String password) { + + ClientConfiguration clientConfiguration = ClientConfiguration.builder() + .connectedTo(host + ":" + port) + .withBasicAuth(username, password) + .build(); + + return RestClients.create(clientConfiguration).rest(); + } + + @Bean + public ElasticsearchOperations elasticsearchTemplate(RestHighLevelClient restHighLevelClient) { + return new ElasticsearchRestTemplate(restHighLevelClient); + } + +} diff --git a/src/main/java/com/epam/ta/reportportal/config/ElasticConfiguration.java b/src/main/java/com/epam/ta/reportportal/config/ElasticConfiguration.java deleted file mode 100644 index 26efee0bb..000000000 --- a/src/main/java/com/epam/ta/reportportal/config/ElasticConfiguration.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.epam.ta.reportportal.config; - -import org.elasticsearch.client.RestHighLevelClient; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.elasticsearch.client.ClientConfiguration; -import org.springframework.data.elasticsearch.client.RestClients; -import org.springframework.data.elasticsearch.core.ElasticsearchOperations; -import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; -import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; - -@Configuration -@EnableElasticsearchRepositories( - basePackages = "com.epam.ta.reportportal.elastic.dao" -) -public class ElasticConfiguration { - - @Bean - @ConditionalOnExpression("!T(org.springframework.util.StringUtils).isEmpty('${rp.elasticsearchLogmessage.host}')") - public RestHighLevelClient client(@Value("${rp.elasticsearchLogmessage.host}") String host, - @Value("${rp.elasticsearchLogmessage.port}") int port, - @Value("${rp.elasticsearchLogmessage.username}") String username, - @Value("${rp.elasticsearchLogmessage.password}") String password) { - ClientConfiguration clientConfiguration - = ClientConfiguration.builder() - .connectedTo(host + ":" + port) - .withBasicAuth(username, password) - .build(); - - return RestClients.create(clientConfiguration).rest(); - } - - @Bean - @ConditionalOnExpression("!T(org.springframework.util.StringUtils).isEmpty('${rp.elasticsearchLogmessage.host}')") - public ElasticsearchOperations elasticsearchTemplate(RestHighLevelClient restHighLevelClient) { - return new ElasticsearchRestTemplate(restHighLevelClient); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java index 0971aef2a..55c35a5c3 100644 --- a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java +++ b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java @@ -1,11 +1,11 @@ package com.epam.ta.reportportal.elastic.dao; import com.epam.ta.reportportal.entity.log.LogMessage; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.stereotype.Repository; @Repository -@ConditionalOnExpression("!T(org.springframework.util.StringUtils).isEmpty('${rp.elasticsearchLogmessage.host}')") +@ConditionalOnBean(name = "elasticsearchTemplate") public interface LogMessageRepository extends ElasticsearchRepository { } diff --git a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java index d62fa5168..c1ed03d07 100644 --- a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java +++ b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java @@ -2,7 +2,7 @@ import com.epam.ta.reportportal.entity.log.LogMessage; import org.elasticsearch.index.query.QueryBuilder; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; @@ -19,7 +19,7 @@ * Fake repository, need in case if configuration for elastic with logs doesn't exist. */ @Repository -@ConditionalOnExpression("T(org.springframework.util.StringUtils).isEmpty('${rp.elasticsearchLogmessage.host}')") +@ConditionalOnMissingBean(name = "elasticsearchTemplate") public class LogMessageRepositoryFake implements LogMessageRepository { private final Iterable logMessageIterable = () -> null; diff --git a/src/main/resources/META-INF/spring.factories b/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..5d0aa35dd --- /dev/null +++ b/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.epam.ta.reportportal.config.ElasticAutoConfiguration \ No newline at end of file diff --git a/src/test/resources/test-application.properties b/src/test/resources/test-application.properties index a7d0a5a1d..80da2f66d 100644 --- a/src/test/resources/test-application.properties +++ b/src/test/resources/test-application.properties @@ -32,7 +32,3 @@ datastore.thumbnail.attachment.height=${rp.binarystore.thumbnail.attachment.heig datastore.thumbnail.avatar.width=${rp.binarystore.thumbnail.avatar.width:40} datastore.thumbnail.avatar.height=${rp.binarystore.thumbnail.avatar.height:50} # Configuration for elasticsearch for storing log message -rp.elasticsearchLogmessage.host -rp.elasticsearchLogmessage.port -rp.elasticsearchLogmessage.username -rp.elasticsearchLogmessage.password From e14ffac5d58e730aa11b5bca95a7140fcb85b147 Mon Sep 17 00:00:00 2001 From: Ivan_Budayeu Date: Thu, 30 Dec 2021 19:18:58 +0300 Subject: [PATCH 014/110] ES repositories condition fix --- .../epam/ta/reportportal/elastic/dao/LogMessageRepository.java | 2 ++ .../ta/reportportal/elastic/dao/LogMessageRepositoryFake.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java index 55c35a5c3..7ee5db58e 100644 --- a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java +++ b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java @@ -2,10 +2,12 @@ import com.epam.ta.reportportal.entity.log.LogMessage; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.stereotype.Repository; @Repository +@ConditionalOnProperty(prefix = "rp.elasticsearchLogmessage", name = "host") @ConditionalOnBean(name = "elasticsearchTemplate") public interface LogMessageRepository extends ElasticsearchRepository { } diff --git a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java index c1ed03d07..6bf1309a4 100644 --- a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java +++ b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java @@ -19,7 +19,7 @@ * Fake repository, need in case if configuration for elastic with logs doesn't exist. */ @Repository -@ConditionalOnMissingBean(name = "elasticsearchTemplate") +@ConditionalOnMissingBean(name = "logMessageRepository") public class LogMessageRepositoryFake implements LogMessageRepository { private final Iterable logMessageIterable = () -> null; From b27955cf2d4642457a5ad76eb46d43b0ef7ecea2 Mon Sep 17 00:00:00 2001 From: Ivan Date: Thu, 20 Jan 2022 02:18:59 +0300 Subject: [PATCH 015/110] EPMRPP-73287 || Last switch date ordering fix (#806) --- .../dao/WidgetContentRepositoryImpl.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java index acf73a657..02dc5959f 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java @@ -209,12 +209,14 @@ private SelectOnConditionStep> statusCriteriaTable(JSt public List flakyCasesStatistics(Filter filter, boolean includeMethods, int limit) { return FLAKY_CASES_TABLE_FETCHER.apply(dsl.select(field(name(FLAKY_TABLE_RESULTS, TEST_ITEM.UNIQUE_ID.getName())).as(UNIQUE_ID), - field(name(FLAKY_TABLE_RESULTS, TEST_ITEM.NAME.getName())).as(ITEM_NAME), - DSL.arrayAgg(field(name(FLAKY_TABLE_RESULTS, TEST_ITEM_RESULTS.STATUS.getName()))).as(STATUSES), - DSL.max(field(name(FLAKY_TABLE_RESULTS, START_TIME))).as(START_TIME_HISTORY), - sum(field(name(FLAKY_TABLE_RESULTS, SWITCH_FLAG)).cast(Long.class)).as(FLAKY_COUNT), - count(field(name(FLAKY_TABLE_RESULTS, ITEM_ID))).minus(1).as(TOTAL) - ) + field(name(FLAKY_TABLE_RESULTS, TEST_ITEM.NAME.getName())).as(ITEM_NAME), + DSL.arrayAgg(field(name(FLAKY_TABLE_RESULTS, TEST_ITEM_RESULTS.STATUS.getName()))).as(STATUSES), + DSL.max(field(name(FLAKY_TABLE_RESULTS, START_TIME))) + .filterWhere(field(name(FLAKY_TABLE_RESULTS, SWITCH_FLAG)).cast(Integer.class).gt(ZERO_QUERY_VALUE)) + .as(START_TIME_HISTORY), + sum(field(name(FLAKY_TABLE_RESULTS, SWITCH_FLAG)).cast(Long.class)).as(FLAKY_COUNT), + count(field(name(FLAKY_TABLE_RESULTS, ITEM_ID))).minus(1).as(TOTAL) + ) .from(dsl.with(LAUNCHES) .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, Sort.unsorted())) .with(LAUNCH.NUMBER, SortOrder.DESC) @@ -226,10 +228,10 @@ public List flakyCasesStatistics(Filter filter, boolean TEST_ITEM.START_TIME, TEST_ITEM_RESULTS.STATUS, when(TEST_ITEM_RESULTS.STATUS.notEqual(lag(TEST_ITEM_RESULTS.STATUS).over(orderBy(TEST_ITEM.UNIQUE_ID, - TEST_ITEM.START_TIME.desc() - ))) + TEST_ITEM.START_TIME + ))) .and(TEST_ITEM.UNIQUE_ID.equal(lag(TEST_ITEM.UNIQUE_ID).over(orderBy(TEST_ITEM.UNIQUE_ID, - TEST_ITEM.START_TIME.desc() + TEST_ITEM.START_TIME )))), 1).otherwise(ZERO_QUERY_VALUE).as(SWITCH_FLAG) ) .from(LAUNCH) From d6aa2803472ff811ce413d26f5f270cedac11033 Mon Sep 17 00:00:00 2001 From: Ivan Date: Thu, 20 Jan 2022 13:42:07 +0300 Subject: [PATCH 016/110] EPMRPP-73239 || Stale materialized view repository impl (#807) --- project-properties.gradle | 1 + .../dao/StaleMaterializedViewRepository.java | 15 ++ .../StaleMaterializedViewRepositoryImpl.java | 45 +++++ .../materialized/StaleMaterializedView.java | 40 ++++ .../epam/ta/reportportal/jooq/Indexes.java | 67 +----- .../epam/ta/reportportal/jooq/JPublic.java | 79 ++------ .../com/epam/ta/reportportal/jooq/Keys.java | 123 +----------- .../epam/ta/reportportal/jooq/Sequences.java | 9 +- .../com/epam/ta/reportportal/jooq/Tables.java | 67 +----- .../jooq/tables/JStaleMaterializedView.java | 156 ++++++++++++++ .../records/JStaleMaterializedViewRecord.java | 190 ++++++++++++++++++ .../StaleMaterializedViewRepositoryTest.java | 43 ++++ 12 files changed, 536 insertions(+), 299 deletions(-) create mode 100644 src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepository.java create mode 100644 src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryImpl.java create mode 100644 src/main/java/com/epam/ta/reportportal/entity/materialized/StaleMaterializedView.java create mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JStaleMaterializedView.java create mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStaleMaterializedViewRecord.java create mode 100644 src/test/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryTest.java diff --git a/project-properties.gradle b/project-properties.gradle index b3ce0e5d4..3a2bc2b3e 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -64,6 +64,7 @@ project.ext { (migrationsUrl + '/migrations/52_analyzer_search_attribute.up.sql') : 'V052__analyzer_search_attribute.sql', (migrationsUrl + '/migrations/54_analyzer_unique_error_attribute.up.sql') : 'V054__analyzer_unique_error_attribute.sql', (migrationsUrl + '/migrations/58_alter_ticket.up.sql') : 'V058__alter_ticket.sql', + (migrationsUrl + '/migrations/59_stale_materialized_view.up.sql') : 'V059__stale_materialized_view.sql', ] excludeTests = [ diff --git a/src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepository.java b/src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepository.java new file mode 100644 index 000000000..e18c6bb40 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepository.java @@ -0,0 +1,15 @@ +package com.epam.ta.reportportal.dao; + +import com.epam.ta.reportportal.entity.materialized.StaleMaterializedView; + +import java.util.Optional; + +/** + * @author Ivan Budayeu + */ +public interface StaleMaterializedViewRepository { + + Optional findById(Long id); + + StaleMaterializedView insert(StaleMaterializedView view); +} diff --git a/src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryImpl.java b/src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryImpl.java new file mode 100644 index 000000000..4b24e0e7a --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryImpl.java @@ -0,0 +1,45 @@ +package com.epam.ta.reportportal.dao; + +import com.epam.ta.reportportal.entity.materialized.StaleMaterializedView; +import org.jooq.DSLContext; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; + +import java.sql.Timestamp; +import java.util.Optional; + +import static com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView.STALE_MATERIALIZED_VIEW; + +/** + * @author Ivan Budayeu + */ +@Repository +public class StaleMaterializedViewRepositoryImpl implements StaleMaterializedViewRepository { + + private final DSLContext dsl; + + @Autowired + public StaleMaterializedViewRepositoryImpl(DSLContext dsl) { + this.dsl = dsl; + } + + @Override + public Optional findById(Long id) { + return dsl.select() + .from(STALE_MATERIALIZED_VIEW) + .where(STALE_MATERIALIZED_VIEW.ID.eq(id)) + .fetchOptionalInto(StaleMaterializedView.class); + } + + @Override + public StaleMaterializedView insert(StaleMaterializedView view) { + Long id = dsl.insertInto(STALE_MATERIALIZED_VIEW) + .columns(STALE_MATERIALIZED_VIEW.NAME, STALE_MATERIALIZED_VIEW.CREATION_DATE) + .values(view.getName(), Timestamp.valueOf(view.getCreationDate())) + .returningResult(STALE_MATERIALIZED_VIEW.ID) + .fetchOne() + .into(Long.class); + view.setId(id); + return view; + } +} diff --git a/src/main/java/com/epam/ta/reportportal/entity/materialized/StaleMaterializedView.java b/src/main/java/com/epam/ta/reportportal/entity/materialized/StaleMaterializedView.java new file mode 100644 index 000000000..4067dc56b --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/entity/materialized/StaleMaterializedView.java @@ -0,0 +1,40 @@ +package com.epam.ta.reportportal.entity.materialized; + +import java.time.LocalDateTime; + +/** + * @author Ivan Budayeu + */ +public class StaleMaterializedView { + + private Long id; + private String name; + private LocalDateTime creationDate; + + public StaleMaterializedView() { + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public LocalDateTime getCreationDate() { + return creationDate; + } + + public void setCreationDate(LocalDateTime creationDate) { + this.creationDate = creationDate; + } +} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java b/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java index 5a2c433cd..40ec4c11b 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java @@ -4,68 +4,13 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.JAclClass; -import com.epam.ta.reportportal.jooq.tables.JAclEntry; -import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; -import com.epam.ta.reportportal.jooq.tables.JAclSid; -import com.epam.ta.reportportal.jooq.tables.JActivity; -import com.epam.ta.reportportal.jooq.tables.JAttachment; -import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; -import com.epam.ta.reportportal.jooq.tables.JAttribute; -import com.epam.ta.reportportal.jooq.tables.JClusters; -import com.epam.ta.reportportal.jooq.tables.JClustersTestItem; -import com.epam.ta.reportportal.jooq.tables.JContentField; -import com.epam.ta.reportportal.jooq.tables.JDashboard; -import com.epam.ta.reportportal.jooq.tables.JDashboardWidget; -import com.epam.ta.reportportal.jooq.tables.JFilter; -import com.epam.ta.reportportal.jooq.tables.JFilterCondition; -import com.epam.ta.reportportal.jooq.tables.JFilterSort; -import com.epam.ta.reportportal.jooq.tables.JIntegration; -import com.epam.ta.reportportal.jooq.tables.JIntegrationType; -import com.epam.ta.reportportal.jooq.tables.JIssue; -import com.epam.ta.reportportal.jooq.tables.JIssueGroup; -import com.epam.ta.reportportal.jooq.tables.JIssueTicket; -import com.epam.ta.reportportal.jooq.tables.JIssueType; -import com.epam.ta.reportportal.jooq.tables.JIssueTypeProject; -import com.epam.ta.reportportal.jooq.tables.JItemAttribute; -import com.epam.ta.reportportal.jooq.tables.JLaunch; -import com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules; -import com.epam.ta.reportportal.jooq.tables.JLaunchNames; -import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; -import com.epam.ta.reportportal.jooq.tables.JLog; -import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; -import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; -import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; -import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; -import com.epam.ta.reportportal.jooq.tables.JOnboarding; -import com.epam.ta.reportportal.jooq.tables.JParameter; -import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; -import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; -import com.epam.ta.reportportal.jooq.tables.JProject; -import com.epam.ta.reportportal.jooq.tables.JProjectAttribute; -import com.epam.ta.reportportal.jooq.tables.JProjectUser; -import com.epam.ta.reportportal.jooq.tables.JRecipients; -import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; -import com.epam.ta.reportportal.jooq.tables.JSenderCase; -import com.epam.ta.reportportal.jooq.tables.JServerSettings; -import com.epam.ta.reportportal.jooq.tables.JShareableEntity; -import com.epam.ta.reportportal.jooq.tables.JStatistics; -import com.epam.ta.reportportal.jooq.tables.JStatisticsField; -import com.epam.ta.reportportal.jooq.tables.JTestItem; -import com.epam.ta.reportportal.jooq.tables.JTestItemResults; -import com.epam.ta.reportportal.jooq.tables.JTicket; -import com.epam.ta.reportportal.jooq.tables.JUserCreationBid; -import com.epam.ta.reportportal.jooq.tables.JUserPreference; -import com.epam.ta.reportportal.jooq.tables.JUsers; -import com.epam.ta.reportportal.jooq.tables.JWidget; -import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; - -import javax.annotation.processing.Generated; - +import com.epam.ta.reportportal.jooq.tables.*; import org.jooq.Index; import org.jooq.OrderField; import org.jooq.impl.Internal; +import javax.annotation.processing.Generated; + /** * A class modelling indexes of tables of the public schema. @@ -186,6 +131,9 @@ public class Indexes { public static final Index SHAREABLE_PK = Indexes0.SHAREABLE_PK; public static final Index SHARED_ENTITY_OWNERX = Indexes0.SHARED_ENTITY_OWNERX; public static final Index SHARED_ENTITY_PROJECT_IDX = Indexes0.SHARED_ENTITY_PROJECT_IDX; + public static final Index STALE_MATERIALIZED_VIEW_NAME_KEY = Indexes0.STALE_MATERIALIZED_VIEW_NAME_KEY; + public static final Index STALE_MATERIALIZED_VIEW_PKEY = Indexes0.STALE_MATERIALIZED_VIEW_PKEY; + public static final Index STALE_MV_CREATION_DATE_IDX = Indexes0.STALE_MV_CREATION_DATE_IDX; public static final Index STATISTICS_LAUNCH_IDX = Indexes0.STATISTICS_LAUNCH_IDX; public static final Index STATISTICS_PK = Indexes0.STATISTICS_PK; public static final Index STATISTICS_TI_IDX = Indexes0.STATISTICS_TI_IDX; @@ -324,6 +272,9 @@ private static class Indexes0 { public static Index SHAREABLE_PK = Internal.createIndex("shareable_pk", JShareableEntity.SHAREABLE_ENTITY, new OrderField[] { JShareableEntity.SHAREABLE_ENTITY.ID }, true); public static Index SHARED_ENTITY_OWNERX = Internal.createIndex("shared_entity_ownerx", JShareableEntity.SHAREABLE_ENTITY, new OrderField[] { JShareableEntity.SHAREABLE_ENTITY.OWNER }, false); public static Index SHARED_ENTITY_PROJECT_IDX = Internal.createIndex("shared_entity_project_idx", JShareableEntity.SHAREABLE_ENTITY, new OrderField[] { JShareableEntity.SHAREABLE_ENTITY.PROJECT_ID }, false); + public static Index STALE_MATERIALIZED_VIEW_NAME_KEY = Internal.createIndex("stale_materialized_view_name_key", JStaleMaterializedView.STALE_MATERIALIZED_VIEW, new OrderField[] { JStaleMaterializedView.STALE_MATERIALIZED_VIEW.NAME }, true); + public static Index STALE_MATERIALIZED_VIEW_PKEY = Internal.createIndex("stale_materialized_view_pkey", JStaleMaterializedView.STALE_MATERIALIZED_VIEW, new OrderField[] { JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID }, true); + public static Index STALE_MV_CREATION_DATE_IDX = Internal.createIndex("stale_mv_creation_date_idx", JStaleMaterializedView.STALE_MATERIALIZED_VIEW, new OrderField[] { JStaleMaterializedView.STALE_MATERIALIZED_VIEW.CREATION_DATE }, false); public static Index STATISTICS_LAUNCH_IDX = Internal.createIndex("statistics_launch_idx", JStatistics.STATISTICS, new OrderField[] { JStatistics.STATISTICS.LAUNCH_ID }, false); public static Index STATISTICS_PK = Internal.createIndex("statistics_pk", JStatistics.STATISTICS, new OrderField[] { JStatistics.STATISTICS.S_ID }, true); public static Index STATISTICS_TI_IDX = Internal.createIndex("statistics_ti_idx", JStatistics.STATISTICS, new OrderField[] { JStatistics.STATISTICS.ITEM_ID }, false); diff --git a/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java b/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java index d395f9fa2..e36f4bc15 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java @@ -4,78 +4,16 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.JAclClass; -import com.epam.ta.reportportal.jooq.tables.JAclEntry; -import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; -import com.epam.ta.reportportal.jooq.tables.JAclSid; -import com.epam.ta.reportportal.jooq.tables.JActivity; -import com.epam.ta.reportportal.jooq.tables.JAttachment; -import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; -import com.epam.ta.reportportal.jooq.tables.JAttribute; -import com.epam.ta.reportportal.jooq.tables.JClusters; -import com.epam.ta.reportportal.jooq.tables.JClustersTestItem; -import com.epam.ta.reportportal.jooq.tables.JContentField; -import com.epam.ta.reportportal.jooq.tables.JDashboard; -import com.epam.ta.reportportal.jooq.tables.JDashboardWidget; -import com.epam.ta.reportportal.jooq.tables.JFilter; -import com.epam.ta.reportportal.jooq.tables.JFilterCondition; -import com.epam.ta.reportportal.jooq.tables.JFilterSort; -import com.epam.ta.reportportal.jooq.tables.JIntegration; -import com.epam.ta.reportportal.jooq.tables.JIntegrationType; -import com.epam.ta.reportportal.jooq.tables.JIssue; -import com.epam.ta.reportportal.jooq.tables.JIssueGroup; -import com.epam.ta.reportportal.jooq.tables.JIssueTicket; -import com.epam.ta.reportportal.jooq.tables.JIssueType; -import com.epam.ta.reportportal.jooq.tables.JIssueTypeProject; -import com.epam.ta.reportportal.jooq.tables.JItemAttribute; -import com.epam.ta.reportportal.jooq.tables.JLaunch; -import com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules; -import com.epam.ta.reportportal.jooq.tables.JLaunchNames; -import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; -import com.epam.ta.reportportal.jooq.tables.JLog; -import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; -import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; -import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; -import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; -import com.epam.ta.reportportal.jooq.tables.JOnboarding; -import com.epam.ta.reportportal.jooq.tables.JParameter; -import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; -import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; -import com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders; -import com.epam.ta.reportportal.jooq.tables.JProject; -import com.epam.ta.reportportal.jooq.tables.JProjectAttribute; -import com.epam.ta.reportportal.jooq.tables.JProjectUser; -import com.epam.ta.reportportal.jooq.tables.JRecipients; -import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; -import com.epam.ta.reportportal.jooq.tables.JSenderCase; -import com.epam.ta.reportportal.jooq.tables.JServerSettings; -import com.epam.ta.reportportal.jooq.tables.JShareableEntity; -import com.epam.ta.reportportal.jooq.tables.JStatistics; -import com.epam.ta.reportportal.jooq.tables.JStatisticsField; -import com.epam.ta.reportportal.jooq.tables.JTestItem; -import com.epam.ta.reportportal.jooq.tables.JTestItemResults; -import com.epam.ta.reportportal.jooq.tables.JTicket; -import com.epam.ta.reportportal.jooq.tables.JUserCreationBid; -import com.epam.ta.reportportal.jooq.tables.JUserPreference; -import com.epam.ta.reportportal.jooq.tables.JUsers; -import com.epam.ta.reportportal.jooq.tables.JWidget; -import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; +import com.epam.ta.reportportal.jooq.tables.*; import com.epam.ta.reportportal.jooq.tables.records.JPgpArmorHeadersRecord; +import org.jooq.*; +import org.jooq.impl.SchemaImpl; +import javax.annotation.processing.Generated; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import javax.annotation.processing.Generated; - -import org.jooq.Catalog; -import org.jooq.Configuration; -import org.jooq.Field; -import org.jooq.Result; -import org.jooq.Sequence; -import org.jooq.Table; -import org.jooq.impl.SchemaImpl; - /** * This class is generated by jOOQ. @@ -90,7 +28,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JPublic extends SchemaImpl { - private static final long serialVersionUID = -1164524803; + private static final long serialVersionUID = 784587878; /** * The reference instance of public @@ -348,6 +286,11 @@ public static JPgpArmorHeaders PGP_ARMOR_HEADERS(Field __1) { */ public final JShareableEntity SHAREABLE_ENTITY = com.epam.ta.reportportal.jooq.tables.JShareableEntity.SHAREABLE_ENTITY; + /** + * The table public.stale_materialized_view. + */ + public final JStaleMaterializedView STALE_MATERIALIZED_VIEW = com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView.STALE_MATERIALIZED_VIEW; + /** * The table public.statistics. */ @@ -451,6 +394,7 @@ private final List> getSequences0() { Sequences.SENDER_CASE_PROJECT_ID_SEQ, Sequences.SERVER_SETTINGS_ID_SEQ, Sequences.SHAREABLE_ENTITY_ID_SEQ, + Sequences.STALE_MATERIALIZED_VIEW_ID_SEQ, Sequences.STATISTICS_FIELD_SF_ID_SEQ, Sequences.STATISTICS_S_ID_SEQ, Sequences.TEST_ITEM_ITEM_ID_SEQ, @@ -514,6 +458,7 @@ private final List> getTables0() { JSenderCase.SENDER_CASE, JServerSettings.SERVER_SETTINGS, JShareableEntity.SHAREABLE_ENTITY, + JStaleMaterializedView.STALE_MATERIALIZED_VIEW, JStatistics.STATISTICS, JStatisticsField.STATISTICS_FIELD, JTestItem.TEST_ITEM, diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Keys.java b/src/main/java/com/epam/ta/reportportal/jooq/Keys.java index f95b8f879..f380b3074 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/Keys.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Keys.java @@ -4,124 +4,15 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.JAclClass; -import com.epam.ta.reportportal.jooq.tables.JAclEntry; -import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; -import com.epam.ta.reportportal.jooq.tables.JAclSid; -import com.epam.ta.reportportal.jooq.tables.JActivity; -import com.epam.ta.reportportal.jooq.tables.JAttachment; -import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; -import com.epam.ta.reportportal.jooq.tables.JAttribute; -import com.epam.ta.reportportal.jooq.tables.JClusters; -import com.epam.ta.reportportal.jooq.tables.JClustersTestItem; -import com.epam.ta.reportportal.jooq.tables.JContentField; -import com.epam.ta.reportportal.jooq.tables.JDashboard; -import com.epam.ta.reportportal.jooq.tables.JDashboardWidget; -import com.epam.ta.reportportal.jooq.tables.JFilter; -import com.epam.ta.reportportal.jooq.tables.JFilterCondition; -import com.epam.ta.reportportal.jooq.tables.JFilterSort; -import com.epam.ta.reportportal.jooq.tables.JIntegration; -import com.epam.ta.reportportal.jooq.tables.JIntegrationType; -import com.epam.ta.reportportal.jooq.tables.JIssue; -import com.epam.ta.reportportal.jooq.tables.JIssueGroup; -import com.epam.ta.reportportal.jooq.tables.JIssueTicket; -import com.epam.ta.reportportal.jooq.tables.JIssueType; -import com.epam.ta.reportportal.jooq.tables.JIssueTypeProject; -import com.epam.ta.reportportal.jooq.tables.JItemAttribute; -import com.epam.ta.reportportal.jooq.tables.JLaunch; -import com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules; -import com.epam.ta.reportportal.jooq.tables.JLaunchNames; -import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; -import com.epam.ta.reportportal.jooq.tables.JLog; -import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; -import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; -import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; -import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; -import com.epam.ta.reportportal.jooq.tables.JOnboarding; -import com.epam.ta.reportportal.jooq.tables.JParameter; -import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; -import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; -import com.epam.ta.reportportal.jooq.tables.JProject; -import com.epam.ta.reportportal.jooq.tables.JProjectAttribute; -import com.epam.ta.reportportal.jooq.tables.JProjectUser; -import com.epam.ta.reportportal.jooq.tables.JRecipients; -import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; -import com.epam.ta.reportportal.jooq.tables.JSenderCase; -import com.epam.ta.reportportal.jooq.tables.JServerSettings; -import com.epam.ta.reportportal.jooq.tables.JShareableEntity; -import com.epam.ta.reportportal.jooq.tables.JStatistics; -import com.epam.ta.reportportal.jooq.tables.JStatisticsField; -import com.epam.ta.reportportal.jooq.tables.JTestItem; -import com.epam.ta.reportportal.jooq.tables.JTestItemResults; -import com.epam.ta.reportportal.jooq.tables.JTicket; -import com.epam.ta.reportportal.jooq.tables.JUserCreationBid; -import com.epam.ta.reportportal.jooq.tables.JUserPreference; -import com.epam.ta.reportportal.jooq.tables.JUsers; -import com.epam.ta.reportportal.jooq.tables.JWidget; -import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; -import com.epam.ta.reportportal.jooq.tables.records.JAclClassRecord; -import com.epam.ta.reportportal.jooq.tables.records.JAclEntryRecord; -import com.epam.ta.reportportal.jooq.tables.records.JAclObjectIdentityRecord; -import com.epam.ta.reportportal.jooq.tables.records.JAclSidRecord; -import com.epam.ta.reportportal.jooq.tables.records.JActivityRecord; -import com.epam.ta.reportportal.jooq.tables.records.JAttachmentDeletionRecord; -import com.epam.ta.reportportal.jooq.tables.records.JAttachmentRecord; -import com.epam.ta.reportportal.jooq.tables.records.JAttributeRecord; -import com.epam.ta.reportportal.jooq.tables.records.JClustersRecord; -import com.epam.ta.reportportal.jooq.tables.records.JClustersTestItemRecord; -import com.epam.ta.reportportal.jooq.tables.records.JContentFieldRecord; -import com.epam.ta.reportportal.jooq.tables.records.JDashboardRecord; -import com.epam.ta.reportportal.jooq.tables.records.JDashboardWidgetRecord; -import com.epam.ta.reportportal.jooq.tables.records.JFilterConditionRecord; -import com.epam.ta.reportportal.jooq.tables.records.JFilterRecord; -import com.epam.ta.reportportal.jooq.tables.records.JFilterSortRecord; -import com.epam.ta.reportportal.jooq.tables.records.JIntegrationRecord; -import com.epam.ta.reportportal.jooq.tables.records.JIntegrationTypeRecord; -import com.epam.ta.reportportal.jooq.tables.records.JIssueGroupRecord; -import com.epam.ta.reportportal.jooq.tables.records.JIssueRecord; -import com.epam.ta.reportportal.jooq.tables.records.JIssueTicketRecord; -import com.epam.ta.reportportal.jooq.tables.records.JIssueTypeProjectRecord; -import com.epam.ta.reportportal.jooq.tables.records.JIssueTypeRecord; -import com.epam.ta.reportportal.jooq.tables.records.JItemAttributeRecord; -import com.epam.ta.reportportal.jooq.tables.records.JLaunchAttributeRulesRecord; -import com.epam.ta.reportportal.jooq.tables.records.JLaunchNamesRecord; -import com.epam.ta.reportportal.jooq.tables.records.JLaunchNumberRecord; -import com.epam.ta.reportportal.jooq.tables.records.JLaunchRecord; -import com.epam.ta.reportportal.jooq.tables.records.JLogRecord; -import com.epam.ta.reportportal.jooq.tables.records.JOauthAccessTokenRecord; -import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationRecord; -import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationRestrictionRecord; -import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationScopeRecord; -import com.epam.ta.reportportal.jooq.tables.records.JOnboardingRecord; -import com.epam.ta.reportportal.jooq.tables.records.JParameterRecord; -import com.epam.ta.reportportal.jooq.tables.records.JPatternTemplateRecord; -import com.epam.ta.reportportal.jooq.tables.records.JPatternTemplateTestItemRecord; -import com.epam.ta.reportportal.jooq.tables.records.JProjectAttributeRecord; -import com.epam.ta.reportportal.jooq.tables.records.JProjectRecord; -import com.epam.ta.reportportal.jooq.tables.records.JProjectUserRecord; -import com.epam.ta.reportportal.jooq.tables.records.JRecipientsRecord; -import com.epam.ta.reportportal.jooq.tables.records.JRestorePasswordBidRecord; -import com.epam.ta.reportportal.jooq.tables.records.JSenderCaseRecord; -import com.epam.ta.reportportal.jooq.tables.records.JServerSettingsRecord; -import com.epam.ta.reportportal.jooq.tables.records.JShareableEntityRecord; -import com.epam.ta.reportportal.jooq.tables.records.JStatisticsFieldRecord; -import com.epam.ta.reportportal.jooq.tables.records.JStatisticsRecord; -import com.epam.ta.reportportal.jooq.tables.records.JTestItemRecord; -import com.epam.ta.reportportal.jooq.tables.records.JTestItemResultsRecord; -import com.epam.ta.reportportal.jooq.tables.records.JTicketRecord; -import com.epam.ta.reportportal.jooq.tables.records.JUserCreationBidRecord; -import com.epam.ta.reportportal.jooq.tables.records.JUserPreferenceRecord; -import com.epam.ta.reportportal.jooq.tables.records.JUsersRecord; -import com.epam.ta.reportportal.jooq.tables.records.JWidgetFilterRecord; -import com.epam.ta.reportportal.jooq.tables.records.JWidgetRecord; - -import javax.annotation.processing.Generated; - +import com.epam.ta.reportportal.jooq.tables.*; +import com.epam.ta.reportportal.jooq.tables.records.*; import org.jooq.ForeignKey; import org.jooq.Identity; import org.jooq.UniqueKey; import org.jooq.impl.Internal; +import javax.annotation.processing.Generated; + /** * A class modelling foreign key relationships and constraints of tables of @@ -170,6 +61,7 @@ public class Keys { public static final Identity IDENTITY_SENDER_CASE = Identities0.IDENTITY_SENDER_CASE; public static final Identity IDENTITY_SERVER_SETTINGS = Identities0.IDENTITY_SERVER_SETTINGS; public static final Identity IDENTITY_SHAREABLE_ENTITY = Identities0.IDENTITY_SHAREABLE_ENTITY; + public static final Identity IDENTITY_STALE_MATERIALIZED_VIEW = Identities0.IDENTITY_STALE_MATERIALIZED_VIEW; public static final Identity IDENTITY_STATISTICS = Identities0.IDENTITY_STATISTICS; public static final Identity IDENTITY_STATISTICS_FIELD = Identities0.IDENTITY_STATISTICS_FIELD; public static final Identity IDENTITY_TEST_ITEM = Identities0.IDENTITY_TEST_ITEM; @@ -241,6 +133,8 @@ public class Keys { public static final UniqueKey SERVER_SETTINGS_ID = UniqueKeys0.SERVER_SETTINGS_ID; public static final UniqueKey SERVER_SETTINGS_KEY_KEY = UniqueKeys0.SERVER_SETTINGS_KEY_KEY; public static final UniqueKey SHAREABLE_PK = UniqueKeys0.SHAREABLE_PK; + public static final UniqueKey STALE_MATERIALIZED_VIEW_PKEY = UniqueKeys0.STALE_MATERIALIZED_VIEW_PKEY; + public static final UniqueKey STALE_MATERIALIZED_VIEW_NAME_KEY = UniqueKeys0.STALE_MATERIALIZED_VIEW_NAME_KEY; public static final UniqueKey STATISTICS_PK = UniqueKeys0.STATISTICS_PK; public static final UniqueKey UNIQUE_STATS_LAUNCH = UniqueKeys0.UNIQUE_STATS_LAUNCH; public static final UniqueKey UNIQUE_STATS_ITEM = UniqueKeys0.UNIQUE_STATS_ITEM; @@ -361,6 +255,7 @@ private static class Identities0 { public static Identity IDENTITY_SENDER_CASE = Internal.createIdentity(JSenderCase.SENDER_CASE, JSenderCase.SENDER_CASE.ID); public static Identity IDENTITY_SERVER_SETTINGS = Internal.createIdentity(JServerSettings.SERVER_SETTINGS, JServerSettings.SERVER_SETTINGS.ID); public static Identity IDENTITY_SHAREABLE_ENTITY = Internal.createIdentity(JShareableEntity.SHAREABLE_ENTITY, JShareableEntity.SHAREABLE_ENTITY.ID); + public static Identity IDENTITY_STALE_MATERIALIZED_VIEW = Internal.createIdentity(JStaleMaterializedView.STALE_MATERIALIZED_VIEW, JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID); public static Identity IDENTITY_STATISTICS = Internal.createIdentity(JStatistics.STATISTICS, JStatistics.STATISTICS.S_ID); public static Identity IDENTITY_STATISTICS_FIELD = Internal.createIdentity(JStatisticsField.STATISTICS_FIELD, JStatisticsField.STATISTICS_FIELD.SF_ID); public static Identity IDENTITY_TEST_ITEM = Internal.createIdentity(JTestItem.TEST_ITEM, JTestItem.TEST_ITEM.ITEM_ID); @@ -430,6 +325,8 @@ private static class UniqueKeys0 { public static final UniqueKey SERVER_SETTINGS_ID = Internal.createUniqueKey(JServerSettings.SERVER_SETTINGS, "server_settings_id", JServerSettings.SERVER_SETTINGS.ID); public static final UniqueKey SERVER_SETTINGS_KEY_KEY = Internal.createUniqueKey(JServerSettings.SERVER_SETTINGS, "server_settings_key_key", JServerSettings.SERVER_SETTINGS.KEY); public static final UniqueKey SHAREABLE_PK = Internal.createUniqueKey(JShareableEntity.SHAREABLE_ENTITY, "shareable_pk", JShareableEntity.SHAREABLE_ENTITY.ID); + public static final UniqueKey STALE_MATERIALIZED_VIEW_PKEY = Internal.createUniqueKey(JStaleMaterializedView.STALE_MATERIALIZED_VIEW, "stale_materialized_view_pkey", JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID); + public static final UniqueKey STALE_MATERIALIZED_VIEW_NAME_KEY = Internal.createUniqueKey(JStaleMaterializedView.STALE_MATERIALIZED_VIEW, "stale_materialized_view_name_key", JStaleMaterializedView.STALE_MATERIALIZED_VIEW.NAME); public static final UniqueKey STATISTICS_PK = Internal.createUniqueKey(JStatistics.STATISTICS, "statistics_pk", JStatistics.STATISTICS.S_ID); public static final UniqueKey UNIQUE_STATS_LAUNCH = Internal.createUniqueKey(JStatistics.STATISTICS, "unique_stats_launch", JStatistics.STATISTICS.STATISTICS_FIELD_ID, JStatistics.STATISTICS.LAUNCH_ID); public static final UniqueKey UNIQUE_STATS_ITEM = Internal.createUniqueKey(JStatistics.STATISTICS, "unique_stats_item", JStatistics.STATISTICS.STATISTICS_FIELD_ID, JStatistics.STATISTICS.ITEM_ID); diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java b/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java index 4711cc1ad..5ce18a0b2 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java @@ -4,11 +4,11 @@ package com.epam.ta.reportportal.jooq; -import javax.annotation.processing.Generated; - import org.jooq.Sequence; import org.jooq.impl.SequenceImpl; +import javax.annotation.processing.Generated; + /** * Convenience access to all sequences in public @@ -178,6 +178,11 @@ public class Sequences { */ public static final Sequence SHAREABLE_ENTITY_ID_SEQ = new SequenceImpl("shareable_entity_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + /** + * The sequence public.stale_materialized_view_id_seq + */ + public static final Sequence STALE_MATERIALIZED_VIEW_ID_SEQ = new SequenceImpl("stale_materialized_view_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + /** * The sequence public.statistics_field_sf_id_seq */ diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Tables.java b/src/main/java/com/epam/ta/reportportal/jooq/Tables.java index b77f6fdd2..725c8a244 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/Tables.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Tables.java @@ -4,70 +4,14 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.JAclClass; -import com.epam.ta.reportportal.jooq.tables.JAclEntry; -import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; -import com.epam.ta.reportportal.jooq.tables.JAclSid; -import com.epam.ta.reportportal.jooq.tables.JActivity; -import com.epam.ta.reportportal.jooq.tables.JAttachment; -import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; -import com.epam.ta.reportportal.jooq.tables.JAttribute; -import com.epam.ta.reportportal.jooq.tables.JClusters; -import com.epam.ta.reportportal.jooq.tables.JClustersTestItem; -import com.epam.ta.reportportal.jooq.tables.JContentField; -import com.epam.ta.reportportal.jooq.tables.JDashboard; -import com.epam.ta.reportportal.jooq.tables.JDashboardWidget; -import com.epam.ta.reportportal.jooq.tables.JFilter; -import com.epam.ta.reportportal.jooq.tables.JFilterCondition; -import com.epam.ta.reportportal.jooq.tables.JFilterSort; -import com.epam.ta.reportportal.jooq.tables.JIntegration; -import com.epam.ta.reportportal.jooq.tables.JIntegrationType; -import com.epam.ta.reportportal.jooq.tables.JIssue; -import com.epam.ta.reportportal.jooq.tables.JIssueGroup; -import com.epam.ta.reportportal.jooq.tables.JIssueTicket; -import com.epam.ta.reportportal.jooq.tables.JIssueType; -import com.epam.ta.reportportal.jooq.tables.JIssueTypeProject; -import com.epam.ta.reportportal.jooq.tables.JItemAttribute; -import com.epam.ta.reportportal.jooq.tables.JLaunch; -import com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules; -import com.epam.ta.reportportal.jooq.tables.JLaunchNames; -import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; -import com.epam.ta.reportportal.jooq.tables.JLog; -import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; -import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; -import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; -import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; -import com.epam.ta.reportportal.jooq.tables.JOnboarding; -import com.epam.ta.reportportal.jooq.tables.JParameter; -import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; -import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; -import com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders; -import com.epam.ta.reportportal.jooq.tables.JProject; -import com.epam.ta.reportportal.jooq.tables.JProjectAttribute; -import com.epam.ta.reportportal.jooq.tables.JProjectUser; -import com.epam.ta.reportportal.jooq.tables.JRecipients; -import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; -import com.epam.ta.reportportal.jooq.tables.JSenderCase; -import com.epam.ta.reportportal.jooq.tables.JServerSettings; -import com.epam.ta.reportportal.jooq.tables.JShareableEntity; -import com.epam.ta.reportportal.jooq.tables.JStatistics; -import com.epam.ta.reportportal.jooq.tables.JStatisticsField; -import com.epam.ta.reportportal.jooq.tables.JTestItem; -import com.epam.ta.reportportal.jooq.tables.JTestItemResults; -import com.epam.ta.reportportal.jooq.tables.JTicket; -import com.epam.ta.reportportal.jooq.tables.JUserCreationBid; -import com.epam.ta.reportportal.jooq.tables.JUserPreference; -import com.epam.ta.reportportal.jooq.tables.JUsers; -import com.epam.ta.reportportal.jooq.tables.JWidget; -import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; +import com.epam.ta.reportportal.jooq.tables.*; import com.epam.ta.reportportal.jooq.tables.records.JPgpArmorHeadersRecord; - -import javax.annotation.processing.Generated; - import org.jooq.Configuration; import org.jooq.Field; import org.jooq.Result; +import javax.annotation.processing.Generated; + /** * Convenience access to all tables in public @@ -333,6 +277,11 @@ public static JPgpArmorHeaders PGP_ARMOR_HEADERS(Field __1) { */ public static final JShareableEntity SHAREABLE_ENTITY = JShareableEntity.SHAREABLE_ENTITY; + /** + * The table public.stale_materialized_view. + */ + public static final JStaleMaterializedView STALE_MATERIALIZED_VIEW = JStaleMaterializedView.STALE_MATERIALIZED_VIEW; + /** * The table public.statistics. */ diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JStaleMaterializedView.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JStaleMaterializedView.java new file mode 100644 index 000000000..c8718b592 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JStaleMaterializedView.java @@ -0,0 +1,156 @@ +/* + * This file is generated by jOOQ. + */ +package com.epam.ta.reportportal.jooq.tables; + + +import com.epam.ta.reportportal.jooq.Indexes; +import com.epam.ta.reportportal.jooq.JPublic; +import com.epam.ta.reportportal.jooq.Keys; +import com.epam.ta.reportportal.jooq.tables.records.JStaleMaterializedViewRecord; +import org.jooq.*; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + +import javax.annotation.processing.Generated; +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.4" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JStaleMaterializedView extends TableImpl { + + private static final long serialVersionUID = 964883742; + + /** + * The reference instance of public.stale_materialized_view + */ + public static final JStaleMaterializedView STALE_MATERIALIZED_VIEW = new JStaleMaterializedView(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JStaleMaterializedViewRecord.class; + } + + /** + * The column public.stale_materialized_view.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('stale_materialized_view_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.stale_materialized_view.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); + + /** + * The column public.stale_materialized_view.creation_date. + */ + public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * Create a public.stale_materialized_view table reference + */ + public JStaleMaterializedView() { + this(DSL.name("stale_materialized_view"), null); + } + + /** + * Create an aliased public.stale_materialized_view table reference + */ + public JStaleMaterializedView(String alias) { + this(DSL.name(alias), STALE_MATERIALIZED_VIEW); + } + + /** + * Create an aliased public.stale_materialized_view table reference + */ + public JStaleMaterializedView(Name alias) { + this(alias, STALE_MATERIALIZED_VIEW); + } + + private JStaleMaterializedView(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JStaleMaterializedView(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JStaleMaterializedView(Table child, ForeignKey key) { + super(child, key, STALE_MATERIALIZED_VIEW); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.STALE_MATERIALIZED_VIEW_NAME_KEY, Indexes.STALE_MATERIALIZED_VIEW_PKEY, Indexes.STALE_MV_CREATION_DATE_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_STALE_MATERIALIZED_VIEW; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.STALE_MATERIALIZED_VIEW_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.STALE_MATERIALIZED_VIEW_PKEY, Keys.STALE_MATERIALIZED_VIEW_NAME_KEY); + } + + @Override + public JStaleMaterializedView as(String alias) { + return new JStaleMaterializedView(DSL.name(alias), this); + } + + @Override + public JStaleMaterializedView as(Name alias) { + return new JStaleMaterializedView(alias, this); + } + + /** + * Rename this table + */ + @Override + public JStaleMaterializedView rename(String name) { + return new JStaleMaterializedView(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JStaleMaterializedView rename(Name name) { + return new JStaleMaterializedView(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } +} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStaleMaterializedViewRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStaleMaterializedViewRecord.java new file mode 100644 index 000000000..04e5c8aa8 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStaleMaterializedViewRecord.java @@ -0,0 +1,190 @@ +/* + * This file is generated by jOOQ. + */ +package com.epam.ta.reportportal.jooq.tables.records; + + +import com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.UpdatableRecordImpl; + +import javax.annotation.processing.Generated; +import java.sql.Timestamp; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.4" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JStaleMaterializedViewRecord extends UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = -1478372239; + + /** + * Setter for public.stale_materialized_view.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.stale_materialized_view.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.stale_materialized_view.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.stale_materialized_view.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.stale_materialized_view.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(2, value); + } + + /** + * Getter for public.stale_materialized_view.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(2); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID; + } + + @Override + public Field field2() { + return JStaleMaterializedView.STALE_MATERIALIZED_VIEW.NAME; + } + + @Override + public Field field3() { + return JStaleMaterializedView.STALE_MATERIALIZED_VIEW.CREATION_DATE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public Timestamp component3() { + return getCreationDate(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public Timestamp value3() { + return getCreationDate(); + } + + @Override + public JStaleMaterializedViewRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JStaleMaterializedViewRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JStaleMaterializedViewRecord value3(Timestamp value) { + setCreationDate(value); + return this; + } + + @Override + public JStaleMaterializedViewRecord values(Long value1, String value2, Timestamp value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JStaleMaterializedViewRecord + */ + public JStaleMaterializedViewRecord() { + super(JStaleMaterializedView.STALE_MATERIALIZED_VIEW); + } + + /** + * Create a detached, initialised JStaleMaterializedViewRecord + */ + public JStaleMaterializedViewRecord(Long id, String name, Timestamp creationDate) { + super(JStaleMaterializedView.STALE_MATERIALIZED_VIEW); + + set(0, id); + set(1, name); + set(2, creationDate); + } +} diff --git a/src/test/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryTest.java new file mode 100644 index 000000000..7a59c7282 --- /dev/null +++ b/src/test/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryTest.java @@ -0,0 +1,43 @@ +package com.epam.ta.reportportal.dao; + +import com.epam.ta.reportportal.BaseTest; +import com.epam.ta.reportportal.entity.materialized.StaleMaterializedView; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * @author Ivan Budayeu + */ +class StaleMaterializedViewRepositoryTest extends BaseTest { + + @Autowired + private StaleMaterializedViewRepository staleMaterializedViewRepository; + + @Test + void shouldInsertAndSetId() { + + final StaleMaterializedView staleMaterializedView = new StaleMaterializedView(); + staleMaterializedView.setName("test"); + staleMaterializedView.setCreationDate(LocalDateTime.now(ZoneOffset.UTC)); + + final StaleMaterializedView result = staleMaterializedViewRepository.insert(staleMaterializedView); + + assertNotNull(staleMaterializedView.getId()); + assertNotNull(result.getId()); + assertEquals(result.getId(), staleMaterializedView.getId()); + + final Optional found = staleMaterializedViewRepository.findById(1L); + assertTrue(found.isPresent()); + + final Optional notFound = staleMaterializedViewRepository.findById(2L); + assertTrue(notFound.isEmpty()); + + } + +} \ No newline at end of file From 1a7e80366e93dc702c95d4e84cd51fb9d0169c11 Mon Sep 17 00:00:00 2001 From: Ivan Date: Mon, 24 Jan 2022 03:16:30 +0300 Subject: [PATCH 017/110] EPMRPP-73238 || ANY condition for Composite Attribute fix (#808) --- build.gradle | 2 +- .../commons/querygen/Condition.java | 8 +++ .../dao/LaunchRepositoryTest.java | 62 ++++++++++++++++++- .../dao/TestItemRepositoryTest.java | 59 ++++++++++++++++++ .../dao/WidgetContentRepositoryTest.java | 40 ++++++++++++ 5 files changed, 167 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 990533431..d9fb83ff8 100644 --- a/build.gradle +++ b/build.gradle @@ -51,7 +51,7 @@ repositories { dependencyManagement { imports { mavenBom(releaseMode ? 'com.epam.reportportal:commons-bom:' + getProperty('bom.version') : 'com.github.reportportal:commons-bom:efc4947e') - mavenBom('io.zonky.test.postgres:embedded-postgres-binaries-bom:12.0.0') + mavenBom('io.zonky.test.postgres:embedded-postgres-binaries-bom:12.9.0') } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/Condition.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/Condition.java index 678bb0cb5..c3a2a08cd 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/Condition.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/Condition.java @@ -323,6 +323,14 @@ public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder cri ); } + if (String[].class.equals(criteriaHolder.getDataType())) { + return DSL.condition(Operator.AND, + DSL.field(criteriaHolder.getAggregateCriteria()) + .contains(DSL.cast(this.castValue(criteriaHolder, filter.getValue(), INCORRECT_FILTER_PARAMETERS), + String[].class + )) + ); + } return DSL.condition(Operator.AND, PostgresDSL.arrayOverlap(DSL.field(criteriaHolder.getAggregateCriteria(), Object[].class), DSL.array((Object[]) this.castValue(criteriaHolder, filter.getValue(), INCORRECT_FILTER_PARAMETERS)) )); diff --git a/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java index 889af2428..2851c25e4 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java @@ -20,7 +20,6 @@ import com.epam.ta.reportportal.commons.querygen.*; import com.epam.ta.reportportal.entity.enums.LaunchModeEnum; import com.epam.ta.reportportal.entity.enums.StatusEnum; -import com.epam.ta.reportportal.entity.enums.TestItemTypeEnum; import com.epam.ta.reportportal.entity.launch.Launch; import com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum; import com.epam.ta.reportportal.jooq.enums.JStatusEnum; @@ -46,8 +45,7 @@ import java.util.stream.Stream; import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_ITEM_ATTRIBUTE_KEY; -import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_ITEM_ATTRIBUTE_VALUE; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.*; import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_UUID; import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_USER; @@ -417,6 +415,64 @@ void shouldNotFindLaunchesWithSystemAttributes() { assertTrue(launches.isEmpty()); } + @Test + void compositeAttributeHas() { + List launches = launchRepository.findByFilter(Filter.builder() + .withTarget(Launch.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.HAS) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue("key:value") + .build()) + .build()); + + assertFalse(launches.isEmpty()); + } + + @Test + void compositeAttributeHasNegative() { + List launches = launchRepository.findByFilter(Filter.builder() + .withTarget(Launch.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.HAS) + .withNegative(true) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue("key1:value1") + .build()) + .build()); + + assertFalse(launches.isEmpty()); + } + + @Test + void compositeAttributeAny() { + List launches = launchRepository.findByFilter(Filter.builder() + .withTarget(Launch.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.ANY) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue("key:value") + .build()) + .build()); + + assertFalse(launches.isEmpty()); + } + + @Test + void compositeAttributeAnyNegative() { + List launches = launchRepository.findByFilter(Filter.builder() + .withTarget(Launch.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.ANY) + .withNegative(true) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue("key1:value1") + .build()) + .build()); + + assertFalse(launches.isEmpty()); + } + private Filter buildDefaultFilter(Long projectId) { List conditionList = Lists.newArrayList(new FilterCondition(Condition.EQUALS, false, diff --git a/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java index 93bb98823..4649764e1 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java @@ -57,6 +57,7 @@ import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.*; import static com.epam.ta.reportportal.commons.querygen.constant.IssueCriteriaConstant.CRITERIA_ISSUE_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_COMPOSITE_ATTRIBUTE; import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_MESSAGE; import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_TEST_ITEM_ID; @@ -1164,6 +1165,64 @@ void saveItemWith700CharsTestCaseId() { testItemRepository.save(item); } + @Test + void compositeAttributeHas() { + List items = testItemRepository.findByFilter(Filter.builder() + .withTarget(TestItem.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.HAS) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue("suite:value1") + .build()) + .build()); + + assertFalse(items.isEmpty()); + } + + @Test + void compositeAttributeHasNegative() { + List items = testItemRepository.findByFilter(Filter.builder() + .withTarget(TestItem.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.HAS) + .withNegative(true) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue("suite:value1") + .build()) + .build()); + + assertFalse(items.isEmpty()); + } + + @Test + void compositeAttributeAny() { + List items = testItemRepository.findByFilter(Filter.builder() + .withTarget(TestItem.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.ANY) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue("suite:value1") + .build()) + .build()); + + assertFalse(items.isEmpty()); + } + + @Test + void compositeAttributeAnyNegative() { + List items = testItemRepository.findByFilter(Filter.builder() + .withTarget(TestItem.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.ANY) + .withNegative(true) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue("suite:value1") + .build()) + .build()); + + assertFalse(items.isEmpty()); + } + private void assertIssueExistsAndTicketsEmpty(TestItem testItem, Long expectedId) { assertEquals(expectedId, testItem.getItemId()); diff --git a/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java index 065e0f882..577df604c 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java @@ -1236,4 +1236,44 @@ void componentHealthCheckTable() { assertTrue(fetch1.isEmpty()); } + + @Test + void componentHealthCheckTableCompositeAttributeWithoutAny() { + + String sortingColumn = "statistics$defects$no_defect$nd001"; + + Filter launchFilter = buildDefaultFilter(1L); + List orderings = Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, sortingColumn), + new Sort.Order(Sort.Direction.DESC, CRITERIA_START_TIME) + ); + Sort sort = Sort.by(orderings); + + HealthCheckTableInitParams initParams = HealthCheckTableInitParams.of("test_view", + com.google.common.collect.Lists.newArrayList("build") + ); + + initParams.setCustomKey("build"); + + launchFilter.withCondition(FilterCondition.builder() + .withCondition(Condition.ANY) + .withNegative(true) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue("build:1") + .build()); + + widgetContentRepository.generateComponentHealthCheckTable(false, initParams, launchFilter, sort, 600, false); + + List healthCheckTableContents = widgetContentRepository.componentHealthCheckTable(HealthCheckTableGetParams.of( + initParams.getViewName(), + "build", + Sort.by(Sort.Direction.DESC, "customColumn"), + true, + new ArrayList<>() + )); + + assertFalse(healthCheckTableContents.isEmpty()); + + widgetContentRepository.removeWidgetView(initParams.getViewName()); + + } } \ No newline at end of file From d90b681d85846dd08ce3a4daf21ddc3207038f7e Mon Sep 17 00:00:00 2001 From: miracle8484 <76156909+miracle8484@users.noreply.github.com> Date: Fri, 4 Feb 2022 10:49:58 +0200 Subject: [PATCH 018/110] EPMRPP-74016 || Add custom repository for saving messagelog in elasticsearch (#809) --- .../elastic/dao/LogMessageRepository.java | 2 +- .../dao/LogMessageRepositoryCustom.java | 24 ++++++ .../dao/LogMessageRepositoryCustomImpl.java | 83 +++++++++++++++++++ .../reportportal/entity/log/LogMessage.java | 6 +- 4 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustom.java create mode 100644 src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustomImpl.java diff --git a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java index 7ee5db58e..d9a7d2b35 100644 --- a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java +++ b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java @@ -9,5 +9,5 @@ @Repository @ConditionalOnProperty(prefix = "rp.elasticsearchLogmessage", name = "host") @ConditionalOnBean(name = "elasticsearchTemplate") -public interface LogMessageRepository extends ElasticsearchRepository { +public interface LogMessageRepository extends ElasticsearchRepository, LogMessageRepositoryCustom { } diff --git a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustom.java new file mode 100644 index 000000000..041a87a79 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustom.java @@ -0,0 +1,24 @@ +package com.epam.ta.reportportal.elastic.dao; + +public interface LogMessageRepositoryCustom { + /** + * Saves a given entity. Use the returned instance for further operations as the save operation might have changed the + * entity instance completely. + * + * @param entity must not be {@literal null}. + * @return the saved entity; will never be {@literal null}. + * @throws IllegalArgumentException in case the given {@literal entity} is {@literal null}. + */ + S save(S entity); + + /** + * Saves all given entities. + * + * @param entities must not be {@literal null} nor must it contain {@literal null}. + * @return the saved entities; will never be {@literal null}. The returned {@literal Iterable} will have the same size + * as the {@literal Iterable} passed as an argument. + * @throws IllegalArgumentException in case the given {@link Iterable entities} or one of its entities is + * {@literal null}. + */ + Iterable saveAll(Iterable entities); +} diff --git a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustomImpl.java new file mode 100644 index 000000000..ae98a1e40 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustomImpl.java @@ -0,0 +1,83 @@ +package com.epam.ta.reportportal.elastic.dao; + +import com.epam.ta.reportportal.entity.log.LogMessage; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.elasticsearch.core.ElasticsearchOperations; +import org.springframework.data.elasticsearch.core.query.IndexQuery; +import org.springframework.data.elasticsearch.repository.support.AbstractElasticsearchRepository; +import org.springframework.data.elasticsearch.repository.support.ElasticsearchEntityInformationCreatorImpl; +import org.springframework.stereotype.Repository; +import org.springframework.util.Assert; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Implement rewritten methods to be able to use separated indexes for single entity based on their fields. + * + */ +@Repository +public class LogMessageRepositoryCustomImpl extends AbstractElasticsearchRepository + implements LogMessageRepositoryCustom { + + @Autowired + public LogMessageRepositoryCustomImpl(ElasticsearchOperations elasticsearchOperations) { + super(new ElasticsearchEntityInformationCreatorImpl( + elasticsearchOperations.getElasticsearchConverter().getMappingContext() + ).getEntityInformation(LogMessage.class), + elasticsearchOperations); + } + + @Override + // for now without force refreshing index + public S save(S logMessage) { + Assert.notNull(logMessage, "Cannot save 'null' entity."); + + elasticsearchOperations.index(createIndexQuery(logMessage)); + + return logMessage; + } + + @Override + // for now without force refreshing indexes + public Iterable saveAll(Iterable logMessageIterable) { + Assert.notNull(logMessageIterable, "Cannot insert 'null' as a List."); + + List queries = new ArrayList<>(); + for (S s : logMessageIterable) { + queries.add(createIndexQuery(s)); + } + elasticsearchOperations.bulkIndex(queries); + + return logMessageIterable; + } + + @Override + protected String stringIdRepresentation(Long id) { + return Objects.toString(id, null); + } + + private IndexQuery createIndexQuery(LogMessage logMessage) { + + IndexQuery query = new IndexQuery(); + query.setObject(logMessage); + query.setIndexName(getFullIndexName(logMessage)); + query.setId(stringIdRepresentation(extractIdFromBean(logMessage))); + query.setVersion(extractVersionFromBean(logMessage)); + query.setParentId(extractParentIdFromBean(logMessage)); + return query; + } + + private String getFullIndexName(LogMessage logMessage) { + return entityInformation.getIndexName() + logMessage.getProjectId(); + } + + private Long extractVersionFromBean(LogMessage logMessage) { + return entityInformation.getVersion(logMessage); + } + + private String extractParentIdFromBean(LogMessage logMessage) { + return entityInformation.getParentId(logMessage); + } +} diff --git a/src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java b/src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java index 2b544577b..afcf68d99 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java +++ b/src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java @@ -10,7 +10,11 @@ import java.time.LocalDateTime; import java.util.Objects; -@Document(indexName = "log_message_store", type="log_message", createIndex = false) +/** + * LogMessage - entity for storing message part of log + some additional info. + * indexName - is only prefix, real index name in Elasticsearch will be indexName + projectId. + */ +@Document(indexName = "log_message_store-", type="log_message", createIndex = false) public class LogMessage implements Serializable { @Id From 2c8ec035b977155888af21a29d47ad1c43b73cbc Mon Sep 17 00:00:00 2001 From: Pavel Bortnik Date: Mon, 7 Feb 2022 14:24:14 +0300 Subject: [PATCH 019/110] EPMRPP-74115 || Add missed fields for indexing (#810) --- build.gradle | 2 +- .../epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java | 2 +- .../epam/ta/reportportal/dao/LogRepositoryCustomImpl.java | 2 +- .../com/epam/ta/reportportal/dao/util/RecordMappers.java | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index d9fb83ff8..729029157 100644 --- a/build.gradle +++ b/build.gradle @@ -63,7 +63,7 @@ dependencies { } else { compile 'com.github.reportportal:commons:def053af' compile 'com.github.reportportal:commons-rules:5.3.0' - compile 'com.github.reportportal:commons-model:26a6101' + compile 'com.github.reportportal:commons-model:5af4980' } //https://nvd.nist.gov/vuln/detail/CVE-2020-10683 (dom4j 2.1.3 version dependency) AND https://nvd.nist.gov/vuln/detail/CVE-2019-14900 diff --git a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java index f421d290d..1fadd92a8 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java @@ -279,7 +279,7 @@ public boolean hasItemsWithLogsWithLogLevel(Long launchId, Collection findIndexLaunchByIds(List ids) { - return dsl.select(LAUNCH.ID, LAUNCH.NAME, LAUNCH.PROJECT_ID) + return dsl.select(LAUNCH.ID, LAUNCH.NAME, LAUNCH.PROJECT_ID, LAUNCH.START_TIME) .from(LAUNCH) .where(LAUNCH.ID.in(ids)) .orderBy(LAUNCH.ID) diff --git a/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustomImpl.java index 35c4dbfbd..3c0dbb648 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustomImpl.java @@ -137,7 +137,7 @@ public Map> findAllIndexUnderTestItemByLaunchIdAndTestItemI JTestItem parentItemTable = TEST_ITEM.as(PARENT_ITEM_TABLE); JTestItem childItemTable = TEST_ITEM.as(CHILD_ITEM_TABLE); - return INDEX_LOG_FETCHER.apply(dsl.selectDistinct(LOG.ID, LOG.LOG_LEVEL, LOG.LOG_MESSAGE, parentItemTable.ITEM_ID.as(ROOT_ITEM_ID), CLUSTERS.INDEX_ID) + return INDEX_LOG_FETCHER.apply(dsl.selectDistinct(LOG.ID, LOG.LOG_LEVEL, LOG.LOG_MESSAGE, LOG.LOG_TIME, parentItemTable.ITEM_ID.as(ROOT_ITEM_ID), CLUSTERS.INDEX_ID) .on(LOG.ID) .from(LOG) .join(childItemTable) diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java index 2bc4bf409..38115ad14 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java @@ -220,6 +220,7 @@ public class RecordMappers { indexLog.setLogId(r.get(LOG.ID, Long.class)); indexLog.setMessage(r.get(LOG.LOG_MESSAGE, String.class)); indexLog.setLogLevel(r.get(JLog.LOG.LOG_LEVEL, Integer.class)); + indexLog.setLogTime(r.get(LOG.LOG_TIME, LocalDateTime.class)); indexLog.setClusterId(r.get(CLUSTERS.INDEX_ID)); ofNullable(indexLogMapping.get(itemId)).ifPresentOrElse(indexLogs -> indexLogs.add(indexLog), () -> { @@ -269,7 +270,8 @@ public class RecordMappers { return indexTestItem; }; - public static final RecordMapper NESTED_STEP_RECORD_MAPPER = r -> new NestedStep(r.get(TEST_ITEM.ITEM_ID), + public static final RecordMapper NESTED_STEP_RECORD_MAPPER = r -> new NestedStep( + r.get(TEST_ITEM.ITEM_ID), r.get(TEST_ITEM.NAME), r.get(TEST_ITEM.UUID), TestItemTypeEnum.valueOf(r.get(TEST_ITEM.TYPE).getLiteral()), @@ -307,6 +309,7 @@ public class RecordMappers { final IndexLaunch indexLaunch = new IndexLaunch(); indexLaunch.setLaunchId(record.get(LAUNCH.ID)); indexLaunch.setLaunchName(record.get(LAUNCH.NAME)); + indexLaunch.setLaunchStartTime(record.get(LAUNCH.START_TIME).toLocalDateTime()); indexLaunch.setProjectId(record.get(LAUNCH.PROJECT_ID)); return indexLaunch; }; From 51b5687f817294c64fa12cc7d2cf8bc085e93359 Mon Sep 17 00:00:00 2001 From: Pavel Bortnik Date: Tue, 15 Feb 2022 21:00:34 +0300 Subject: [PATCH 020/110] EPMRPP-67609 || Add integration sorting by desc creation date (#811) --- .../ta/reportportal/dao/IntegrationRepository.java | 12 ++++++------ .../dao/IntegrationRepositoryCustomImpl.java | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepository.java b/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepository.java index c16d1a027..03c5e17e3 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepository.java @@ -53,7 +53,7 @@ public interface IntegrationRepository extends ReportPortalRepository findByNameAndTypeIdAndProjectIdIsNull(String name, Long integrationTypeId); /** - * @param id {@link Integration#getId()} ()} + * @param id {@link Integration#getId()} ()} * @param integrationTypeId {@link Integration#getType()}#{@link IntegrationType#getId()} * @return {@link Optional} with {@link Integration} */ @@ -100,7 +100,7 @@ public interface IntegrationRepository extends ReportPortalRepository findAllGlobalByType(@Param("integrationType") IntegrationType integrationType); /** @@ -109,7 +109,7 @@ public interface IntegrationRepository extends ReportPortalRepository findAllProjectByGroup(@Param("project") Project project, @Param("integrationGroup") IntegrationGroupEnum integrationGroup); @@ -119,7 +119,7 @@ List findAllProjectByGroup(@Param("project") Project project, * @param integrationGroup {@link IntegrationType#integrationGroup} * @return @return The {@link List} of the {@link Integration} */ - @Query(value = "SELECT i FROM Integration i JOIN i.type t WHERE i.project IS NULL AND t.integrationGroup = :integrationGroup") + @Query(value = "SELECT i FROM Integration i JOIN i.type t WHERE i.project IS NULL AND t.integrationGroup = :integrationGroup order by i.creationDate desc") List findAllGlobalByGroup(@Param("integrationGroup") IntegrationGroupEnum integrationGroup); /** @@ -127,7 +127,7 @@ List findAllProjectByGroup(@Param("project") Project project, * * @return @return The {@link List} of the global {@link Integration} */ - @Query(value = "SELECT i FROM Integration i WHERE i.project IS NULL") + @Query(value = "SELECT i FROM Integration i WHERE i.project IS NULL order by i.creationDate desc") List findAllGlobal(); /** @@ -177,6 +177,6 @@ Optional findProjectBtsByUrlAndLinkedProject(@Param("url") String u @Query(value = "UPDATE integration SET enabled = :enabled WHERE type = :integrationTypeId", nativeQuery = true) void updateEnabledStateByIntegrationTypeId(@Param("enabled") boolean enabled, @Param("integrationTypeId") Long integrationTypeId); - @Query(value = "SELECT * FROM integration i LEFT OUTER JOIN integration_type it ON i.type = it.id WHERE it.name IN (:types)", nativeQuery = true) + @Query(value = "SELECT * FROM integration i LEFT OUTER JOIN integration_type it ON i.type = it.id WHERE it.name IN (:types) order by i.creation_date desc", nativeQuery = true) List findAllByTypeIn(@Param("types") String... types); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepositoryCustomImpl.java index d0f672ab5..f7764142c 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepositoryCustomImpl.java @@ -81,6 +81,7 @@ public List findAllByProjectIdAndInIntegrationTypeIds(Long projectI .on(INTEGRATION.TYPE.eq(INTEGRATION_TYPE.ID)) .where(INTEGRATION_TYPE.ID.in(integrationTypeIds)) .and(INTEGRATION.PROJECT_ID.eq(projectId)) + .orderBy(INTEGRATION.CREATION_DATE.desc()) .fetch(PROJECT_INTEGRATION_RECORD_MAPPER); } @@ -92,6 +93,7 @@ public List findAllGlobalInIntegrationTypeIds(List integratio .on(INTEGRATION.TYPE.eq(INTEGRATION_TYPE.ID)) .where(INTEGRATION_TYPE.ID.in(integrationTypeIds)) .and(INTEGRATION.PROJECT_ID.isNull()) + .orderBy(INTEGRATION.CREATION_DATE.desc()) .fetch(GLOBAL_INTEGRATION_RECORD_MAPPER); } @@ -103,6 +105,7 @@ public List findAllGlobalNotInIntegrationTypeIds(List integra .on(INTEGRATION.TYPE.eq(INTEGRATION_TYPE.ID)) .where(INTEGRATION_TYPE.ID.notIn(integrationTypeIds)) .and(INTEGRATION.PROJECT_ID.isNull()) + .orderBy(INTEGRATION.CREATION_DATE.desc()) .fetch(GLOBAL_INTEGRATION_RECORD_MAPPER); } } From 03619ad08bf00d6f703c1134a2541def89437133 Mon Sep 17 00:00:00 2001 From: Pavel Bortnik Date: Thu, 17 Feb 2022 12:54:59 +0300 Subject: [PATCH 021/110] EPMRPP-67609 || Project integration sort added (#812) --- .../ta/reportportal/dao/IntegrationRepository.java | 4 ++-- .../reportportal/dao/IntegrationRepositoryTest.java | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepository.java b/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepository.java index 03c5e17e3..fc8897955 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepository.java @@ -65,7 +65,7 @@ public interface IntegrationRepository extends ReportPortalRepository findAllByProjectId(Long projectId); + List findAllByProjectIdOrderByCreationDateDesc(Long projectId); /** * Retrieve all {@link Integration} by project ID and integration type @@ -74,7 +74,7 @@ public interface IntegrationRepository extends ReportPortalRepository findAllByProjectIdAndType(Long projectId, IntegrationType integrationType); + List findAllByProjectIdAndTypeOrderByCreationDateDesc(Long projectId, IntegrationType integrationType); /** * Delete all {@link Integration} with {@link Integration#project} == NULL by integration type ID diff --git a/src/test/java/com/epam/ta/reportportal/dao/IntegrationRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/IntegrationRepositoryTest.java index 9d3a9c526..2a098e1c9 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/IntegrationRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/IntegrationRepositoryTest.java @@ -77,7 +77,7 @@ void shouldUpdateEnabledStateByIntegrationTypeId() { integrationRepository.updateEnabledStateByIntegrationTypeId(true, integrationType.getId()); - List enabledAfter = integrationRepository.findAllByProjectIdAndType(DEFAULT_PERSONAL_PROJECT_ID, integrationType); + List enabledAfter = integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc(DEFAULT_PERSONAL_PROJECT_ID, integrationType); enabledAfter.forEach(integration -> assertTrue(integration.isEnabled())); } @@ -103,7 +103,7 @@ void shouldFindAllByProjectIdAndIntegrationTypeWhenExists() { IntegrationType integrationType = integrationTypeRepository.findById(JIRA_INTEGRATION_TYPE_ID).get(); - List integrations = integrationRepository.findAllByProjectIdAndType(DEFAULT_PERSONAL_PROJECT_ID, integrationType); + List integrations = integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc(DEFAULT_PERSONAL_PROJECT_ID, integrationType); assertNotNull(integrations); assertEquals(1L, integrations.size()); @@ -118,8 +118,8 @@ void shouldDeleteAllGlobalByIntegrationTypeId() { assertThat(integrationRepository.findAllGlobalByType(integrationType), is(empty())); - assertThat(integrationRepository.findAllByProjectIdAndType(DEFAULT_PERSONAL_PROJECT_ID, integrationType), is(not(empty()))); - assertThat(integrationRepository.findAllByProjectIdAndType(SUPERADMIN_PERSONAL_PROJECT_ID, integrationType), is(not(empty()))); + assertThat(integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc(DEFAULT_PERSONAL_PROJECT_ID, integrationType), is(not(empty()))); + assertThat(integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc(SUPERADMIN_PERSONAL_PROJECT_ID, integrationType), is(not(empty()))); } @Test @@ -129,8 +129,8 @@ void shouldDeleteAllByProjectIdAndIntegrationTypeId() { integrationRepository.deleteAllByProjectIdAndIntegrationTypeId(SUPERADMIN_PERSONAL_PROJECT_ID, integrationType.getId()); - assertThat(integrationRepository.findAllByProjectIdAndType(SUPERADMIN_PERSONAL_PROJECT_ID, integrationType), is(empty())); - assertThat(integrationRepository.findAllByProjectIdAndType(DEFAULT_PERSONAL_PROJECT_ID, integrationType), is(not(empty()))); + assertThat(integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc(SUPERADMIN_PERSONAL_PROJECT_ID, integrationType), is(empty())); + assertThat(integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc(DEFAULT_PERSONAL_PROJECT_ID, integrationType), is(not(empty()))); } @Test From 32ad9c0804b2b6babbd7b0870af7d72dcce0a6f9 Mon Sep 17 00:00:00 2001 From: Pavel Bortnik Date: Thu, 17 Feb 2022 15:59:28 +0300 Subject: [PATCH 022/110] EPMRPP-67609 || Add integration sort annotation (#813) --- .../java/com/epam/ta/reportportal/entity/project/Project.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/Project.java b/src/main/java/com/epam/ta/reportportal/entity/project/Project.java index 7f93ce029..dfc408183 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/Project.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/Project.java @@ -54,6 +54,7 @@ public class Project implements Serializable { private ProjectType projectType; @OneToMany(mappedBy = "project", cascade = { CascadeType.PERSIST }, fetch = FetchType.LAZY) + @OrderBy("creationDate desc") private Set integrations = Sets.newHashSet(); @OneToMany(mappedBy = "project", cascade = { CascadeType.PERSIST }, fetch = FetchType.LAZY) From d5bb71a3b345a322fd57a86d71698c22c826c75e Mon Sep 17 00:00:00 2001 From: Pavel_Bortnik Date: Tue, 15 Mar 2022 18:54:36 +0300 Subject: [PATCH 023/110] EPMRPP-75477 || Provide project storage count queries for calculation --- .../com/epam/ta/reportportal/dao/LogRepository.java | 4 ++++ .../epam/ta/reportportal/dao/ProjectRepository.java | 4 ++++ .../epam/ta/reportportal/dao/TestItemRepository.java | 10 +++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java b/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java index 6a52b1379..db5ad4c4b 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java @@ -35,6 +35,10 @@ public interface LogRepository extends ReportPortalRepository, LogRep List findLogsByLogTime(Timestamp timestamp); + long countLogsByTestItemIn(List testItemIds); + + long countLogsByLaunchId(Long launchId); + @Modifying @Query(value = "UPDATE log SET launch_id = :newLaunchId WHERE launch_id = :currentLaunchId", nativeQuery = true) void updateLaunchIdByLaunchId(@Param("currentLaunchId") Long currentLaunchId, @Param("newLaunchId") Long newLaunchId); diff --git a/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java index 92b018cd7..1ecb73c61 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java @@ -19,6 +19,7 @@ import com.epam.ta.reportportal.entity.project.Project; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; +import org.springframework.security.core.parameters.P; import java.util.List; import java.util.Optional; @@ -34,4 +35,7 @@ public interface ProjectRepository extends ReportPortalRepository @Query(value = "SELECT * FROM project p JOIN project_user pu on p.id = pu.project_id JOIN users u on pu.user_id = u.id WHERE u.login = :login AND p.project_type = :projectType", nativeQuery = true) List findUserProjects(@Param("login") String login, @Param("projectType") String projectType); + + @Query(value = "INSERT INTO storage (project_id, total_number, current_storage) VALUES (:id, :num, :num * (SELECT value FROM billing.conventional_gb)) ON CONFLICT (project_id) DO UPDATE SET total_number = storage.total_number + :num, current_storage = :num * (SELECT value FROM billing.conventional_gb) + storage.current_storage", nativeQuery = true) + void updateProjectStorage(@Param("num") int number, @Param("id") Long projectId); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java index a5bb4b8f9..828612846 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java @@ -163,7 +163,7 @@ List findIdsByHasChildrenAndParentPathAndStatusOrderedByPathLevel(@Param(" * @param itemId Parent item id * @return True if has */ - @Query(value = "SELECT exists(SELECT 1 FROM test_item t WHERE t.parent_id = :itemId AND t.has_stats)", nativeQuery = true) + @Query(value = "SELECT EXISTS(SELECT 1 FROM test_item t WHERE t.parent_id = :itemId AND t.has_stats)", nativeQuery = true) boolean hasChildrenWithStats(@Param("itemId") Long itemId); /** @@ -314,4 +314,12 @@ Optional findLatestIdByTestCaseHashAndLaunchIdWithoutParents(@Param("testC + " ORDER BY t.start_time DESC, t.item_id DESC LIMIT 1 FOR UPDATE", nativeQuery = true) Optional findLatestIdByTestCaseHashAndLaunchIdAndParentId(@Param("testCaseHash") Integer testCaseHash, @Param("launchId") Long launchId, @Param("parentId") Long parentId); + + /** + * Count items by launch id + * + * @param launchId Launch id + * @return Number of {@link TestItem} + */ + long countTestItemByLaunchId(Long launchId); } From eb173ab633d9e92fc263bf043b3a08aa94d37bbd Mon Sep 17 00:00:00 2001 From: Pavel_Bortnik Date: Wed, 16 Mar 2022 12:10:54 +0300 Subject: [PATCH 024/110] EPMRPP-75477 || Fix count query --- src/main/java/com/epam/ta/reportportal/dao/LogRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java b/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java index db5ad4c4b..cadd6b46a 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java @@ -35,7 +35,7 @@ public interface LogRepository extends ReportPortalRepository, LogRep List findLogsByLogTime(Timestamp timestamp); - long countLogsByTestItemIn(List testItemIds); + long countLogsByTestItemItemIdIn(List testItemIds); long countLogsByLaunchId(Long launchId); From a732e4b2cfd36811992a1bdc82876bbd05ce4e1a Mon Sep 17 00:00:00 2001 From: Pavel_Bortnik Date: Wed, 16 Mar 2022 16:18:09 +0300 Subject: [PATCH 025/110] EPMRPP-75477 || Add modifying annotation for update query --- .../java/com/epam/ta/reportportal/dao/ProjectRepository.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java index 1ecb73c61..2109695e4 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java @@ -17,6 +17,7 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.project.Project; +import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.security.core.parameters.P; @@ -36,6 +37,7 @@ public interface ProjectRepository extends ReportPortalRepository @Query(value = "SELECT * FROM project p JOIN project_user pu on p.id = pu.project_id JOIN users u on pu.user_id = u.id WHERE u.login = :login AND p.project_type = :projectType", nativeQuery = true) List findUserProjects(@Param("login") String login, @Param("projectType") String projectType); + @Modifying @Query(value = "INSERT INTO storage (project_id, total_number, current_storage) VALUES (:id, :num, :num * (SELECT value FROM billing.conventional_gb)) ON CONFLICT (project_id) DO UPDATE SET total_number = storage.total_number + :num, current_storage = :num * (SELECT value FROM billing.conventional_gb) + storage.current_storage", nativeQuery = true) void updateProjectStorage(@Param("num") int number, @Param("id") Long projectId); } From 318b5fb5fd066108fe51ad50fe4c15251302816f Mon Sep 17 00:00:00 2001 From: Pavel_Bortnik Date: Thu, 17 Mar 2022 15:17:15 +0300 Subject: [PATCH 026/110] EPMRPP-75477 || Add query for retrieving item and retry ids for concrete launch --- .../epam/ta/reportportal/dao/TestItemRepository.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java index 828612846..40b752046 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java @@ -37,6 +37,17 @@ public interface TestItemRepository extends ReportPortalRepository findParentByChildId(@Param("childId") Long childId); + /** + * Retrieve list of test item ids for provided launch + * + * @param launchId Launch id + * @return List of test item ids + */ + @Query(value = "SELECT item_id FROM test_item WHERE launch_id = :launchId UNION " + + "SELECT item_id FROM test_item WHERE retry_of IS NOT NULL AND retry_of IN " + + "(SELECT item_id FROM test_item WHERE launch_id = :launchId);", nativeQuery = true) + List findIdsByLaunchId(@Param("launchId") Long launchId); + /** * Retrieve the {@link List} of the {@link TestItem#getItemId()} by launch ID, {@link StatusEnum#name()} and {@link TestItem#isHasChildren()} == false * From 1926b42ddf2120863da49375a70617b250612f9b Mon Sep 17 00:00:00 2001 From: chingiskhan-epam <102149723+chingiskhan-epam@users.noreply.github.com> Date: Tue, 5 Apr 2022 10:39:25 +0300 Subject: [PATCH 027/110] EPMRPP-76240 || Add method which returns integrationTypes by accessType (#814) --- .../reportportal/dao/IntegrationTypeRepository.java | 11 +++++++++++ .../dao/IntegrationTypeRepositoryTest.java | 10 ++++++++++ .../filesystem/FilePathGeneratorTest.java | 3 ++- .../db/migration/V001007__integration_type.sql | 3 ++- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/IntegrationTypeRepository.java b/src/main/java/com/epam/ta/reportportal/dao/IntegrationTypeRepository.java index 004a6026c..d4803c7ff 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/IntegrationTypeRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/IntegrationTypeRepository.java @@ -18,6 +18,8 @@ import com.epam.ta.reportportal.entity.enums.IntegrationGroupEnum; import com.epam.ta.reportportal.entity.integration.IntegrationType; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import java.util.List; import java.util.Optional; @@ -51,4 +53,13 @@ public interface IntegrationTypeRepository extends ReportPortalRepository findByName(String name); + + /** + * Retrieve all {@link IntegrationType} by accessType + * + * @param accessType {@link java.lang.String} + * @return The {@link List} of the {@link IntegrationType} + */ + @Query(value = "SELECT it.* FROM integration_type it WHERE (it.details -> 'details'->>'accessType' = :accessType)", nativeQuery = true) + List findAllByAccessType(@Param("accessType") String accessType); } diff --git a/src/test/java/com/epam/ta/reportportal/dao/IntegrationTypeRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/IntegrationTypeRepositoryTest.java index 524b10b7c..85b4f5419 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/IntegrationTypeRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/IntegrationTypeRepositoryTest.java @@ -33,8 +33,10 @@ class IntegrationTypeRepositoryTest extends BaseTest { private final static String JIRA_INTEGRATION_TYPE_NAME = "jira"; + private final static String ACCESS_TYPE_NAME = "public"; private final static String WRONG_INTEGRATION_TYPE_NAME = "WRONG"; private static final long BTS_INTEGRATIONS_COUNT = 2L; + private static final long PUBLIC_INTEGRATIONS_COUNT = 1L; @Autowired private IntegrationTypeRepository integrationTypeRepository; @@ -60,4 +62,12 @@ void shouldFindAllByIntegrationGroup() { assertNotNull(integrationTypes); assertEquals(BTS_INTEGRATIONS_COUNT, integrationTypes.size()); } + + @Test + void shouldFindAllIntegrationTypesByAccessType() { + List integrationTypes = integrationTypeRepository.findAllByAccessType(ACCESS_TYPE_NAME); + assertNotNull(integrationTypes); + assertEquals(PUBLIC_INTEGRATIONS_COUNT, integrationTypes.size()); + } + } diff --git a/src/test/java/com/epam/ta/reportportal/filesystem/FilePathGeneratorTest.java b/src/test/java/com/epam/ta/reportportal/filesystem/FilePathGeneratorTest.java index 2e41a4620..7bd5c9817 100644 --- a/src/test/java/com/epam/ta/reportportal/filesystem/FilePathGeneratorTest.java +++ b/src/test/java/com/epam/ta/reportportal/filesystem/FilePathGeneratorTest.java @@ -23,6 +23,7 @@ import org.junit.jupiter.api.Test; import org.mockito.Mockito; +import java.io.File; import java.time.LocalDateTime; import static org.mockito.Mockito.when; @@ -52,6 +53,6 @@ void generate_different_even_for_same_date() { // when: String pathOne = new FilePathGenerator(dateTimeProvider).generate(metaInfo); - Assertions.assertThat(pathOne).isEqualTo("1/2018-5/271b5881-9a62-4df4-b477-335a96acbe14"); + Assertions.assertThat(pathOne).isEqualTo("1" + File.separator +"2018-5" + File.separator + "271b5881-9a62-4df4-b477-335a96acbe14"); } } diff --git a/src/test/resources/db/migration/V001007__integration_type.sql b/src/test/resources/db/migration/V001007__integration_type.sql index f4041ac4d..5db41172d 100644 --- a/src/test/resources/db/migration/V001007__integration_type.sql +++ b/src/test/resources/db/migration/V001007__integration_type.sql @@ -1,2 +1,3 @@ INSERT INTO integration_type (enabled, name, auth_flow, creation_date, group_type) VALUES (TRUE, 'rally', 'OAUTH', now(), 'BTS') ; -INSERT INTO integration_type (enabled, name, auth_flow, creation_date, group_type) VALUES (TRUE, 'jira', 'BASIC', now(), 'BTS'); \ No newline at end of file +INSERT INTO integration_type (enabled, name, auth_flow, creation_date, group_type) VALUES (TRUE, 'jira', 'BASIC', now(), 'BTS'); +INSERT INTO integration_type (enabled, name, auth_flow, creation_date, group_type, details) VALUES (TRUE, 'signup', null, now(), 'OTHER', '{"details": {"accessType": "public"}}'); From 6b1e65414494b5788c1a7b318344817b6f6e728f Mon Sep 17 00:00:00 2001 From: Ivan Date: Thu, 7 Apr 2022 12:36:45 +0300 Subject: [PATCH 028/110] EPMRPP-75872 || UserCreationBid entity fields update (#815) * EPMRPP-75872 || UserCreationBid entity fields update * EPMRPP-75872 || JPA query fix * EPMRPP-75872 || JPA schema fix * EPMRPP-75872 || update test scripts branch * EPMRPP-75872 || Travis config removed Co-authored-by: Ivan_Budayeu --- .travis.yml | 23 -------------- project-properties.gradle | 1 + .../dao/UserCreationBidRepository.java | 3 +- .../entity/user/UserCreationBid.java | 30 ++++++++++++++----- .../dao/UserCreationBidRepositoryTest.java | 21 ++++++++++--- .../db/fill/user-bid/user-bid-fill.sql | 21 ++++++++++--- 6 files changed, 59 insertions(+), 40 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e37d0813e..000000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: java -dist: xenial - -script: ./gradlew build --full-stacktrace - -env: - global: - - GRADLE_OPTS="-Xms128m -Xmx1g" - - JAVA_TOOL_OPTIONS=-Dhttps.protocols=TLSv1.2 - -jdk: - - openjdk11 - -cache: - directories: - - $HOME/.m2 - - $HOME/.gradle - -notifications: - slack: reportportal:fl6xWHVQp1jvsMmCJxYW9YKP - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/project-properties.gradle b/project-properties.gradle index 3a2bc2b3e..544b59240 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -65,6 +65,7 @@ project.ext { (migrationsUrl + '/migrations/54_analyzer_unique_error_attribute.up.sql') : 'V054__analyzer_unique_error_attribute.sql', (migrationsUrl + '/migrations/58_alter_ticket.up.sql') : 'V058__alter_ticket.sql', (migrationsUrl + '/migrations/59_stale_materialized_view.up.sql') : 'V059__stale_materialized_view.sql', + (migrationsUrl + '/migrations/60_user_bid_extension.up.sql') : 'V060__user_bid_extension.up.sql', ] excludeTests = [ diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepository.java b/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepository.java index f4cbf9c83..64cbabd48 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepository.java @@ -29,7 +29,8 @@ */ public interface UserCreationBidRepository extends ReportPortalRepository, UserCreationBidRepositoryCustom { - Optional findByEmail(String email); + @Query(value = "SELECT bid.* FROM user_creation_bid bid WHERE bid.uuid = :uuid AND (bid.metadata -> 'metadata'->>'type' = :type)", nativeQuery = true) + Optional findByUuidAndType(@Param("uuid") String uuid, @Param("type") String type); @Modifying @Query(value = "DELETE FROM UserCreationBid u WHERE u.lastModified < :date") diff --git a/src/main/java/com/epam/ta/reportportal/entity/user/UserCreationBid.java b/src/main/java/com/epam/ta/reportportal/entity/user/UserCreationBid.java index 1468e6f7b..45854dccb 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/user/UserCreationBid.java +++ b/src/main/java/com/epam/ta/reportportal/entity/user/UserCreationBid.java @@ -16,8 +16,10 @@ package com.epam.ta.reportportal.entity.user; +import com.epam.ta.reportportal.entity.Metadata; import com.epam.ta.reportportal.entity.Modifiable; -import com.epam.ta.reportportal.entity.project.Project; +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; @@ -30,6 +32,7 @@ */ @Entity @Table(name = "user_creation_bid") +@TypeDef(name = "json", typeClass = Metadata.class) @EntityListeners(AuditingEntityListener.class) public class UserCreationBid implements Serializable, Modifiable { @@ -44,13 +47,16 @@ public class UserCreationBid implements Serializable, Modifiable { @Column(name = "email") private String email; - @OneToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "default_project_id") - private Project defaultProject; + @Column(name = "project_name") + private String projectName; @Column(name = "role") private String role; + @Type(type = "json") + @Column(name = "metadata") + private Metadata metadata; + public String getUuid() { return uuid; } @@ -67,12 +73,12 @@ public void setEmail(String email) { this.email = email; } - public Project getDefaultProject() { - return defaultProject; + public String getProjectName() { + return projectName; } - public void setDefaultProject(Project defaultProject) { - this.defaultProject = defaultProject; + public void setProjectName(String projectName) { + this.projectName = projectName; } public String getRole() { @@ -91,4 +97,12 @@ public Date getLastModified() { public void setLastModified(Date lastModified) { this.lastModified = lastModified; } + + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryTest.java index 43b3cab3f..f3c83bb72 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryTest.java @@ -37,17 +37,30 @@ @Sql("/db/fill/user-bid/user-bid-fill.sql") class UserCreationBidRepositoryTest extends BaseTest { + public static final String INTERNAL_TYPE = "internal"; + public static final String UNKNOWN_TYPE = "unknown"; + @Autowired private UserCreationBidRepository repository; @Test - void findByEmail() { - final String email = "superadminemail@domain.com"; + void findByUuidAndType() { + final String adminUuid = "0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb"; - final Optional userBid = repository.findByEmail(email); + final Optional userBid = repository.findByUuidAndType(adminUuid, INTERNAL_TYPE); assertTrue(userBid.isPresent(), "User bid should exists"); - assertEquals(email, userBid.get().getEmail(), "Incorrect email"); + assertEquals(adminUuid, userBid.get().getUuid(), "Incorrect uuid"); + assertEquals("superadminemail@domain.com", userBid.get().getEmail(), "Incorrect email"); + } + + @Test + void shouldNotFindByUuidAndTypeWhenTypeNotMatched() { + final String adminUuid = "0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb"; + + final Optional userBid = repository.findByUuidAndType(adminUuid, UNKNOWN_TYPE); + + assertTrue(userBid.isEmpty(), "User bid should not exists"); } @Test diff --git a/src/test/resources/db/fill/user-bid/user-bid-fill.sql b/src/test/resources/db/fill/user-bid/user-bid-fill.sql index d62dc4377..d4bb453dc 100644 --- a/src/test/resources/db/fill/user-bid/user-bid-fill.sql +++ b/src/test/resources/db/fill/user-bid/user-bid-fill.sql @@ -1,4 +1,17 @@ -INSERT INTO user_creation_bid(uuid, last_modified, email, default_project_id, role) -VALUES ('0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb', now(), 'superadminemail@domain.com', 1, 'PROJECT_MANAGER'), - ('6cb0ce2a-e974-44d8-ae78-d86baa38c356', now() - interval '30 day', 'defaultemail@domain.com', 2, 'PROJECT_MANAGER'), - ('04ff29db-88ef-44c9-9273-5701f6969127', now() - interval '1 day', 'defaultemail@domain.com', 1, 'MEMBER'); \ No newline at end of file +INSERT INTO user_creation_bid(uuid, last_modified, email, project_name, role, metadata) +VALUES ('0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb', now(), 'superadminemail@domain.com', 1, 'PROJECT_MANAGER', '{ + "metadata": { + "type": "internal" + } +}'), + + ('6cb0ce2a-e974-44d8-ae78-d86baa38c356', now() - interval '30 day', 'defaultemail@domain.com', 2, 'PROJECT_MANAGER', '{ + "metadata": { + "type": "internal" + } + }'), + ('04ff29db-88ef-44c9-9273-5701f6969127', now() - interval '1 day', 'defaultemail@domain.com', 1, 'MEMBER', '{ + "metadata": { + "type": "internal" + } + }'); \ No newline at end of file From 59bed640ce12014509f0c6d72db607d834ef5956 Mon Sep 17 00:00:00 2001 From: Pavel_Bortnik Date: Thu, 28 Apr 2022 00:03:03 +0300 Subject: [PATCH 029/110] EPMRPP-75477 || Remove unused queries --- .../java/com/epam/ta/reportportal/dao/ProjectRepository.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java index 2109695e4..75a43ed6d 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java @@ -37,7 +37,4 @@ public interface ProjectRepository extends ReportPortalRepository @Query(value = "SELECT * FROM project p JOIN project_user pu on p.id = pu.project_id JOIN users u on pu.user_id = u.id WHERE u.login = :login AND p.project_type = :projectType", nativeQuery = true) List findUserProjects(@Param("login") String login, @Param("projectType") String projectType); - @Modifying - @Query(value = "INSERT INTO storage (project_id, total_number, current_storage) VALUES (:id, :num, :num * (SELECT value FROM billing.conventional_gb)) ON CONFLICT (project_id) DO UPDATE SET total_number = storage.total_number + :num, current_storage = :num * (SELECT value FROM billing.conventional_gb) + storage.current_storage", nativeQuery = true) - void updateProjectStorage(@Param("num") int number, @Param("id") Long projectId); } From b7c47b2efdc6903803da898a18862903900d837c Mon Sep 17 00:00:00 2001 From: Chingiskhan Date: Thu, 5 May 2022 16:15:57 +0300 Subject: [PATCH 030/110] EPMRPP-76888 || Add 30s validation for registration link resend --- .../com/epam/ta/reportportal/dao/UserCreationBidRepository.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepository.java b/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepository.java index 64cbabd48..63875e104 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepository.java @@ -35,4 +35,6 @@ public interface UserCreationBidRepository extends ReportPortalRepository findFirstByEmailOrderByLastModifiedDesc(String email); } From c18577b34f7e8a96ef7b3f9aa82872e86578ca2e Mon Sep 17 00:00:00 2001 From: Ivan_Budayeu Date: Tue, 10 May 2022 13:41:48 +0300 Subject: [PATCH 031/110] EPMRPP-77071 || ANY condition for string array criteria fix --- .../commons/querygen/Condition.java | 9 +- ...LaunchCompositeAttributeFilteringTest.java | 123 ++++++++++++++++++ .../dao/LaunchRepositoryTest.java | 60 +-------- .../db/fill/launch/launch-filtering-data.sql | 14 ++ 4 files changed, 142 insertions(+), 64 deletions(-) create mode 100644 src/test/java/com/epam/ta/reportportal/dao/LaunchCompositeAttributeFilteringTest.java create mode 100644 src/test/resources/db/fill/launch/launch-filtering-data.sql diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/Condition.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/Condition.java index c3a2a08cd..79fa47cb7 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/Condition.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/Condition.java @@ -325,10 +325,9 @@ public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder cri } if (String[].class.equals(criteriaHolder.getDataType())) { return DSL.condition(Operator.AND, - DSL.field(criteriaHolder.getAggregateCriteria()) - .contains(DSL.cast(this.castValue(criteriaHolder, filter.getValue(), INCORRECT_FILTER_PARAMETERS), - String[].class - )) + PostgresDSL.arrayOverlap(DSL.field(criteriaHolder.getAggregateCriteria(), String[].class), + DSL.cast(this.castValue(criteriaHolder, filter.getValue(), INCORRECT_FILTER_PARAMETERS), String[].class) + ) ); } return DSL.condition(Operator.AND, PostgresDSL.arrayOverlap(DSL.field(criteriaHolder.getAggregateCriteria(), Object[].class), @@ -651,4 +650,4 @@ public Object[] castArray(CriteriaHolder criteriaHolder, String value, ErrorType } return castedValues; } -} \ No newline at end of file +} diff --git a/src/test/java/com/epam/ta/reportportal/dao/LaunchCompositeAttributeFilteringTest.java b/src/test/java/com/epam/ta/reportportal/dao/LaunchCompositeAttributeFilteringTest.java new file mode 100644 index 000000000..9c7233529 --- /dev/null +++ b/src/test/java/com/epam/ta/reportportal/dao/LaunchCompositeAttributeFilteringTest.java @@ -0,0 +1,123 @@ +package com.epam.ta.reportportal.dao; + +import com.epam.ta.reportportal.BaseTest; +import com.epam.ta.reportportal.commons.querygen.Condition; +import com.epam.ta.reportportal.commons.querygen.Filter; +import com.epam.ta.reportportal.commons.querygen.FilterCondition; +import com.epam.ta.reportportal.entity.launch.Launch; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.jdbc.Sql; + +import java.util.Arrays; +import java.util.List; + +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_COMPOSITE_ATTRIBUTE; +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * @author Ivan Budayeu + */ +@Sql("/db/fill/launch/launch-filtering-data.sql") +public class LaunchCompositeAttributeFilteringTest extends BaseTest { + + @Autowired + private LaunchRepository launchRepository; + + @Test + void compositeAttributeHas() { + List launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.HAS, + "key1:value1,key2:value2", + false + ))); + + assertEquals(2, launches.size()); + + launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.HAS, + "key1:value1,key2:value2,key3:value3", + false + ))); + + assertEquals(1, launches.size()); + assertEquals(1L, launches.get(0).getId()); + } + + @Test + void compositeAttributeHasNegative() { + List launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.HAS, + "key1:value1,key2:value2", + true + ))); + + assertEquals(0, launches.size()); + + launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.HAS, + "key1:value1,key2:value2,key3:value3", + true + ))); + + assertEquals(1, launches.size()); + assertEquals(2L, launches.get(0).getId()); + } + + @Test + void compositeAttributeAny() { + List launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, + "key1:value1,key2:value2,key3:value3", + false + ))); + + assertEquals(2, launches.size()); + + launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, "key1:value1,key3:value3", + false + ))); + + assertEquals(2, launches.size()); + + launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, "key3:value3", + false + ))); + + assertEquals(1, launches.size()); + assertEquals(1L, launches.get(0).getId()); + } + + @Test + void compositeAttributeAnyNegative() { + List launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, + "key1:value1,key2:value2,key3:value3", + true + ))); + + assertEquals(0, launches.size()); + + launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, "key1:value1,key3:value3", + true + ))); + + assertEquals(0, launches.size()); + + launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, "key3:value3", + true + ))); + + assertEquals(1, launches.size()); + assertEquals(2L, launches.get(0).getId()); + } + + private FilterCondition buildCompositeAttributeCondition(Condition condition, String value, boolean negative) { + return FilterCondition.builder() + .withCondition(condition) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue(value) + .withNegative(negative) + .build(); + } + + private Filter buildFilterWithConditions(FilterCondition... conditions) { + final Filter.FilterBuilder builder = Filter.builder().withTarget(Launch.class); + Arrays.stream(conditions).forEach(builder::withCondition); + return builder.build(); + } +} diff --git a/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java index 2851c25e4..780c89e2e 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java @@ -415,64 +415,6 @@ void shouldNotFindLaunchesWithSystemAttributes() { assertTrue(launches.isEmpty()); } - @Test - void compositeAttributeHas() { - List launches = launchRepository.findByFilter(Filter.builder() - .withTarget(Launch.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.HAS) - .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) - .withValue("key:value") - .build()) - .build()); - - assertFalse(launches.isEmpty()); - } - - @Test - void compositeAttributeHasNegative() { - List launches = launchRepository.findByFilter(Filter.builder() - .withTarget(Launch.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.HAS) - .withNegative(true) - .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) - .withValue("key1:value1") - .build()) - .build()); - - assertFalse(launches.isEmpty()); - } - - @Test - void compositeAttributeAny() { - List launches = launchRepository.findByFilter(Filter.builder() - .withTarget(Launch.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.ANY) - .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) - .withValue("key:value") - .build()) - .build()); - - assertFalse(launches.isEmpty()); - } - - @Test - void compositeAttributeAnyNegative() { - List launches = launchRepository.findByFilter(Filter.builder() - .withTarget(Launch.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.ANY) - .withNegative(true) - .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) - .withValue("key1:value1") - .build()) - .build()); - - assertFalse(launches.isEmpty()); - } - private Filter buildDefaultFilter(Long projectId) { List conditionList = Lists.newArrayList(new FilterCondition(Condition.EQUALS, false, @@ -485,4 +427,4 @@ private Filter buildDefaultFilter(Long projectId) { private Filter buildDefaultFilter2() { return new Filter(Launch.class, Lists.newArrayList(new FilterCondition(Condition.EQUALS, false, "uuid 11", CRITERIA_LAUNCH_UUID))); } -} \ No newline at end of file +} diff --git a/src/test/resources/db/fill/launch/launch-filtering-data.sql b/src/test/resources/db/fill/launch/launch-filtering-data.sql new file mode 100644 index 000000000..bc2eea10b --- /dev/null +++ b/src/test/resources/db/fill/launch/launch-filtering-data.sql @@ -0,0 +1,14 @@ +alter sequence launch_id_seq restart with 1; + +INSERT INTO launch(id, uuid, project_id, user_id, name, start_time, end_time, last_modified, mode, status) +VALUES (1, 'uuid-1', 2, 2, 'launch 1', now(), now(), now(), 'DEFAULT', 'FAILED'); + +INSERT INTO item_attribute(key, value, launch_id) VALUES ('key1', 'value1', 1); +INSERT INTO item_attribute(key, value, launch_id) VALUES ('key2', 'value2', 1); +INSERT INTO item_attribute(key, value, launch_id) VALUES ('key3', 'value3', 1); + +INSERT INTO launch(id, uuid, project_id, user_id, name, start_time, end_time, last_modified, mode, status) +VALUES (2, 'uuid-2', 2, 2, 'launch 2', now(), now(), now(), 'DEFAULT', 'FAILED'); + +INSERT INTO item_attribute(key, value, launch_id) VALUES ('key1', 'value1', 2); +INSERT INTO item_attribute(key, value, launch_id) VALUES ('key2', 'value2', 2); From 0fe75174e8a0a7b2e34a80b5e75db238efbee6ee Mon Sep 17 00:00:00 2001 From: Ivan_Budayeu Date: Fri, 13 May 2022 14:04:16 +0300 Subject: [PATCH 032/110] EPMRPP-45842 || Exclude issue types condition added --- .../dao/TestItemRepositoryCustom.java | 12 ++++-- .../dao/TestItemRepositoryCustomImpl.java | 8 +++- .../dao/IssueEntityRepositoryTest.java | 8 ++-- .../dao/TestItemRepositoryTest.java | 41 +++++++++++++++---- .../db/migration/V001004__items_init.sql | 4 +- 5 files changed, 54 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java index ad177f4ec..ff9f472b8 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java @@ -25,6 +25,7 @@ import com.epam.ta.reportportal.entity.item.TestItem; import com.epam.ta.reportportal.entity.item.TestItemResults; import com.epam.ta.reportportal.entity.item.history.TestItemHistory; +import com.epam.ta.reportportal.entity.item.issue.IssueEntity; import com.epam.ta.reportportal.entity.item.issue.IssueType; import com.epam.ta.reportportal.entity.launch.Launch; import com.epam.ta.reportportal.entity.log.Log; @@ -309,13 +310,16 @@ Page loadItemsHistoryPage(boolean isLatest, Queryable launchFil /** * Select item IDs by analyzed status and {@link TestItem#getLaunchId()} * with {@link Log} having {@link Log#getLogLevel()} greater than or equal to {@link com.epam.ta.reportportal.entity.enums.LogLevel#ERROR_INT} + * excluding {@link TestItem} that has {@link IssueEntity} with {@link IssueEntity#getIssueType()} from excluded types * - * @param autoAnalyzed {@link Issue#getAutoAnalyzed()} - * @param launchId {@link TestItem#getLaunchId()} - * @param logLevel {@link Log#getLogLevel()} + * @param autoAnalyzed {@link Issue#getAutoAnalyzed()} + * @param launchId {@link TestItem#getLaunchId()} + * @param logLevel {@link Log#getLogLevel()} + * @param excludedIssueTypes {@link Collection} of {@link IssueType#getId()} to exclude {@link TestItem} with provided type id * @return The {@link List} of the {@link TestItem#getItemId()} */ - List selectIdsByAnalyzedWithLevelGte(boolean autoAnalyzed, boolean ignoreAnalyzer, Long launchId, int logLevel); + List selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(boolean autoAnalyzed, boolean ignoreAnalyzer, Long launchId, int logLevel, + Collection excludedIssueTypes); /** * @param itemId {@link TestItem#itemId} diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java index 2b4d62b13..b00d33086 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java @@ -724,12 +724,16 @@ public Optional> selectPath(String uuid) { * {@link TestItem} that matched to the provided `launchId` and `autoAnalyzed` conditions */ @Override - public List selectIdsByAnalyzedWithLevelGte(boolean autoAnalyzed, boolean ignoreAnalyzer, Long launchId, int logLevel) { + public List selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(boolean autoAnalyzed, boolean ignoreAnalyzer, Long launchId, + int logLevel, Collection excludedIssueTypes) { JTestItem outerItemTable = TEST_ITEM.as(OUTER_ITEM_TABLE); JTestItem nestedItemTable = TEST_ITEM.as(NESTED); - final Condition issueCondition = ISSUE.AUTO_ANALYZED.eq(autoAnalyzed).and(ISSUE.IGNORE_ANALYZER.eq(ignoreAnalyzer)); + final List excludedTypeIds = excludedIssueTypes.stream().map(IssueType::getId).collect(toList()); + final Condition issueCondition = ISSUE.AUTO_ANALYZED.eq(autoAnalyzed) + .and(ISSUE.IGNORE_ANALYZER.eq(ignoreAnalyzer)) + .and(ISSUE.ISSUE_TYPE.notIn(excludedTypeIds)); return dsl.selectDistinct(fieldName(ID)) .from(DSL.select(outerItemTable.ITEM_ID.as(ID)) diff --git a/src/test/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryTest.java index c8ea04db3..7ed26ba06 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryTest.java @@ -41,14 +41,14 @@ class IssueEntityRepositoryTest extends BaseTest { @Test void findAllByIssueId() { - final Long toInvestigateTypeId = 1L; + final Long automationBugTypeId = 2L; final int expectedSize = 11; - final List issueEntities = repository.findAllByIssueTypeId(toInvestigateTypeId); + final List issueEntities = repository.findAllByIssueTypeId(automationBugTypeId); assertEquals(expectedSize, issueEntities.size(), "Incorrect size of issue entities"); - issueEntities.forEach(it -> assertEquals(TestItemIssueGroup.TO_INVESTIGATE, + issueEntities.forEach(it -> assertEquals(TestItemIssueGroup.AUTOMATION_BUG, it.getIssueType().getIssueGroup().getTestItemIssueGroup(), - "Issue entities should be int 'to investigate' group" + "Issue entities should be from 'automation bug' group" )); } diff --git a/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java index 4649764e1..1d9042e44 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java @@ -65,6 +65,7 @@ import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; import static java.util.stream.Collectors.toList; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.*; import static org.junit.jupiter.api.Assertions.*; /** @@ -76,6 +77,9 @@ class TestItemRepositoryTest extends BaseTest { @Autowired private TestItemRepository testItemRepository; + @Autowired + private IssueTypeRepository issueTypeRepository; + @Autowired private TicketRepository ticketRepository; @@ -232,7 +236,7 @@ void selectIdsByFilter() { Filter filter = Filter.builder() .withTarget(TestItem.class) .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_LAUNCH_ID)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_ISSUE_GROUP_ID)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "2", CRITERIA_ISSUE_GROUP_ID)) .build(); List itemIds = testItemRepository.selectIdsByFilter(1L, filter, 1, 0); @@ -386,14 +390,37 @@ void selectIdsNotInIssueByLaunch() { @Test void selectByAutoAnalyzedStatusNotIgnoreAnalyzer() { - List itemIds = testItemRepository.selectIdsByAnalyzedWithLevelGte(false, false, 1L, LogLevel.ERROR.toInt()); + final IssueType abIssueType = issueTypeRepository.findById(2L).get(); + + List itemIds = testItemRepository.selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(false, + false, + 1L, + LogLevel.ERROR.toInt(), + List.of(abIssueType) + ); assertNotNull(itemIds); - assertThat(itemIds, Matchers.hasSize(1)); + assertTrue(itemIds.isEmpty()); + + final IssueType tiIssueType = issueTypeRepository.findById(1L).get(); + itemIds = testItemRepository.selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(false, + false, + 1L, + LogLevel.ERROR.toInt(), + List.of(tiIssueType) + ); + assertNotNull(itemIds); + assertThat(itemIds, hasSize(1)); + } @Test void selectByAutoAnalyzedStatusIgnoreAnalyzer() { - List itemIds = testItemRepository.selectIdsByAnalyzedWithLevelGte(false, true, 1L, LogLevel.ERROR.toInt()); + List itemIds = testItemRepository.selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(false, + true, + 1L, + LogLevel.ERROR.toInt(), + Collections.emptyList() + ); assertTrue(itemIds.isEmpty()); } @@ -452,13 +479,13 @@ void streamIdsByHasChildrenAndParentPathAndStatusOrderedByPathLevel() { @Test void selectItemsInIssueByLaunch() { final Long launchId = 1L; - final String issueType = "ti001"; + final String issueType = "ab001"; final List items = testItemRepository.selectItemsInIssueByLaunch(launchId, issueType); assertNotNull(items, "Items should not be null"); assertTrue(!items.isEmpty(), "Items should not be empty"); items.forEach(it -> { assertEquals(launchId, it.getLaunchId(), "Incorrect launch id"); - assertEquals(it.getItemResults().getIssue().getIssueType().getId(), Long.valueOf(1L), "Incorrect item issue"); + assertThat(it.getItemResults().getIssue().getIssueType().getId(), anyOf(is(1L), is(2L))); }); } @@ -1230,4 +1257,4 @@ private void assertIssueExistsAndTicketsEmpty(TestItem testItem, Long expectedId assertNotEquals(null, issue); assertEquals(0, issue.getTickets().size()); } -} \ No newline at end of file +} diff --git a/src/test/resources/db/migration/V001004__items_init.sql b/src/test/resources/db/migration/V001004__items_init.sql index 707c892fd..a8de6ee52 100644 --- a/src/test/resources/db/migration/V001004__items_init.sql +++ b/src/test/resources/db/migration/V001004__items_init.sql @@ -122,7 +122,7 @@ BEGIN THEN UPDATE test_item_results SET status = 'FAILED' WHERE result_id = cur_step_id; INSERT INTO issue (issue_id, issue_type, auto_analyzed, issue_description) - VALUES (cur_step_id, 1, FALSE, 'issue description'); + VALUES (cur_step_id, 2, FALSE, 'issue description'); INSERT INTO ticket (ticket_id, submitter, submit_date, bts_url, bts_project, url) VALUES (concat('ticket_id_', cur_step_id), 'superadmin', now(), 'jira.com', 'project', @@ -290,4 +290,4 @@ BEGIN END LOOP; END; $$ - LANGUAGE plpgsql; \ No newline at end of file + LANGUAGE plpgsql; From fdd34de75de05164577627b167cea272bbc12676 Mon Sep 17 00:00:00 2001 From: Chingiskhan Date: Thu, 2 Jun 2022 15:04:19 +0300 Subject: [PATCH 033/110] EPMRPP-77646 || Update domain entity Hibernate mapping (sender case) --- .../entity/project/email/SenderCase.java | 13 ++++++++++++- .../db/fill/sendercase/sender-case-fill.sql | 6 +++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java b/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java index 2191bdf8d..bd7e80055 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java @@ -38,6 +38,9 @@ public class SenderCase implements Serializable { @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; + @Column(name = "rule_name", nullable = false) + private String ruleName; + @ElementCollection(fetch = FetchType.EAGER) @CollectionTable(name = "recipients", joinColumns = @JoinColumn(name = "sender_case_id")) @Column(name = "recipient") @@ -83,6 +86,14 @@ public void setId(Long id) { this.id = id; } + public String getRuleName() { + return ruleName; + } + + public void setRuleName(String ruleName) { + this.ruleName = ruleName; + } + public Set getRecipients() { return recipients; } @@ -130,4 +141,4 @@ public boolean isEnabled() { public void setEnabled(boolean enabled) { this.enabled = enabled; } -} \ No newline at end of file +} diff --git a/src/test/resources/db/fill/sendercase/sender-case-fill.sql b/src/test/resources/db/fill/sendercase/sender-case-fill.sql index a69377173..48638766f 100644 --- a/src/test/resources/db/fill/sendercase/sender-case-fill.sql +++ b/src/test/resources/db/fill/sendercase/sender-case-fill.sql @@ -1,7 +1,7 @@ alter sequence sender_case_id_seq restart with 1; -INSERT INTO sender_case (id, send_case, project_id, enabled) -VALUES (1, 'ALWAYS', 1, true); +INSERT INTO sender_case (id, rule_name, send_case, project_id, enabled) +VALUES (1, 'rule #1', 'ALWAYS', 1, true); INSERT INTO recipients(sender_case_id, recipient) VALUES (1, 'first'); -INSERT INTO recipients(sender_case_id, recipient) VALUES (1, 'second'); \ No newline at end of file +INSERT INTO recipients(sender_case_id, recipient) VALUES (1, 'second'); From fa23866651d74ae7e2dff94161bf1a48a6aa163c Mon Sep 17 00:00:00 2001 From: Chingiskhan Date: Thu, 2 Jun 2022 19:42:43 +0300 Subject: [PATCH 034/110] EPMRPP-77646 || updated migrationsUrl --- project-properties.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project-properties.gradle b/project-properties.gradle index c05a643e2..39acbbc9a 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -9,7 +9,7 @@ project.ext { dependencyRepos = ["commons", "commons-rules", "commons-model", "commons-bom"] releaseMode = project.hasProperty("releaseMode") scriptsUrl = commonScriptsUrl + (releaseMode ? getProperty('scripts.version') : 'master') - migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'develop') + migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'feature/EPMRPP-77644_add_field_rulename_to_db') //TODO refactor with archive download testScriptsSrc = [ (migrationsUrl + '/migrations/0_extensions.up.sql') : 'V001__extensions.sql', @@ -66,6 +66,7 @@ project.ext { (migrationsUrl + '/migrations/58_alter_ticket.up.sql') : 'V058__alter_ticket.sql', (migrationsUrl + '/migrations/59_stale_materialized_view.up.sql') : 'V059__stale_materialized_view.sql', (migrationsUrl + '/migrations/60_user_bid_extension.up.sql') : 'V060__user_bid_extension.up.sql', + (migrationsUrl + '/migrations/62_sender_case_rule_name.up.sql') : 'V062__sender_case_rule_name.up.sql', ] excludeTests = [ From 9a41821360dabded52deca4c718613932e11932c Mon Sep 17 00:00:00 2001 From: Chingiskhan Date: Fri, 3 Jun 2022 23:52:03 +0300 Subject: [PATCH 035/110] EPMRPP-77646 || updated the length of rule_name field --- .../epam/ta/reportportal/entity/project/email/SenderCase.java | 2 +- src/test/resources/db/fill/sendercase/sender-case-fill.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java b/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java index bd7e80055..c387f94d1 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java @@ -38,7 +38,7 @@ public class SenderCase implements Serializable { @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; - @Column(name = "rule_name", nullable = false) + @Column(name = "rule_name", nullable = false, length = 55) private String ruleName; @ElementCollection(fetch = FetchType.EAGER) diff --git a/src/test/resources/db/fill/sendercase/sender-case-fill.sql b/src/test/resources/db/fill/sendercase/sender-case-fill.sql index 48638766f..c822ce81b 100644 --- a/src/test/resources/db/fill/sendercase/sender-case-fill.sql +++ b/src/test/resources/db/fill/sendercase/sender-case-fill.sql @@ -1,7 +1,7 @@ alter sequence sender_case_id_seq restart with 1; INSERT INTO sender_case (id, rule_name, send_case, project_id, enabled) -VALUES (1, 'rule #1', 'ALWAYS', 1, true); +VALUES (1, 'Rule1', 'ALWAYS', 1, true); INSERT INTO recipients(sender_case_id, recipient) VALUES (1, 'first'); INSERT INTO recipients(sender_case_id, recipient) VALUES (1, 'second'); From a6179143048ffe48d96ceda689a64c457015a666 Mon Sep 17 00:00:00 2001 From: Chingiskhan Date: Mon, 6 Jun 2022 00:19:41 +0300 Subject: [PATCH 036/110] EPMRPP-77648 || getByProjectIdAndRuleNameIgnoreCase --- .../com/epam/ta/reportportal/dao/SenderCaseRepository.java | 3 +++ .../epam/ta/reportportal/dao/SenderCaseRepositoryTest.java | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java b/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java index bde568ad2..2485dec99 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java @@ -7,12 +7,15 @@ import java.util.Collection; import java.util.List; +import java.util.Optional; public interface SenderCaseRepository extends ReportPortalRepository { @Query(value = "SELECT sc FROM SenderCase sc WHERE sc.project.id = :projectId") List findAllByProjectId(@Param(value = "projectId") Long projectId); + Optional findByProjectIdAndRuleNameIgnoreCase(Long projectId, String ruleName); + @Modifying @Query(value = "DELETE FROM recipients WHERE sender_case_id = :id AND recipient IN (:recipients)", nativeQuery = true) int deleteRecipients(@Param(value = "id") Long id, @Param(value = "recipients") Collection recipients); diff --git a/src/test/java/com/epam/ta/reportportal/dao/SenderCaseRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/SenderCaseRepositoryTest.java index cd86bc196..689e9c484 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/SenderCaseRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/SenderCaseRepositoryTest.java @@ -9,6 +9,7 @@ import java.util.Collections; import java.util.List; +import java.util.Optional; @Sql("/db/fill/sendercase/sender-case-fill.sql") public class SenderCaseRepositoryTest extends BaseTest { @@ -22,6 +23,12 @@ void findAllByProjectId() { Assertions.assertFalse(senderCases.isEmpty()); } + @Test + void findAllByProjectIdAndRuleNameIgnoreCase() { + final Optional senderCases = senderCaseRepository.findByProjectIdAndRuleNameIgnoreCase(1L, "rule1"); + Assertions.assertTrue(senderCases.isPresent()); + } + @Test void deleteRecipients() { final int removed = senderCaseRepository.deleteRecipients(1L, Collections.singleton("first")); From 36eae7a322867116ed5bc85dc5a6df509bd7a356 Mon Sep 17 00:00:00 2001 From: Chingiskhan Date: Mon, 6 Jun 2022 10:45:59 +0300 Subject: [PATCH 037/110] EPMRPP-77646 || switched to develop --- project-properties.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project-properties.gradle b/project-properties.gradle index 39acbbc9a..bfc93e038 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -9,7 +9,7 @@ project.ext { dependencyRepos = ["commons", "commons-rules", "commons-model", "commons-bom"] releaseMode = project.hasProperty("releaseMode") scriptsUrl = commonScriptsUrl + (releaseMode ? getProperty('scripts.version') : 'master') - migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'feature/EPMRPP-77644_add_field_rulename_to_db') + migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'develop') //TODO refactor with archive download testScriptsSrc = [ (migrationsUrl + '/migrations/0_extensions.up.sql') : 'V001__extensions.sql', From b7dd3e8d97a561a4262192a27380537a64309e3e Mon Sep 17 00:00:00 2001 From: Chingiskhan Date: Mon, 6 Jun 2022 10:47:26 +0300 Subject: [PATCH 038/110] EPMRPP-77648 || switched to develop --- project-properties.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project-properties.gradle b/project-properties.gradle index 39acbbc9a..bfc93e038 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -9,7 +9,7 @@ project.ext { dependencyRepos = ["commons", "commons-rules", "commons-model", "commons-bom"] releaseMode = project.hasProperty("releaseMode") scriptsUrl = commonScriptsUrl + (releaseMode ? getProperty('scripts.version') : 'master') - migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'feature/EPMRPP-77644_add_field_rulename_to_db') + migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'develop') //TODO refactor with archive download testScriptsSrc = [ (migrationsUrl + '/migrations/0_extensions.up.sql') : 'V001__extensions.sql', From c1e2ef0d533dc2d134bf032e19b2ac382bc07ae6 Mon Sep 17 00:00:00 2001 From: Ivan_Budayeu Date: Thu, 16 Jun 2022 15:45:33 +0300 Subject: [PATCH 039/110] EPMRPP-77623 || Attribute removing method added --- .../dao/ItemAttributeRepository.java | 2 ++ .../dao/ItemAttributeRepositoryTest.java | 23 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepository.java index 7080e1f4b..adb448514 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepository.java @@ -26,4 +26,6 @@ public interface ItemAttributeRepository extends ReportPortalRepository, ItemAttributeRepositoryCustom { Optional findByLaunchIdAndKeyAndSystem(Long launchId, String key, boolean isSystem); + + int deleteByLaunchIdAndKeyAndSystem(Long launchId, String key, boolean isSystem); } diff --git a/src/test/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryTest.java index 383996a5f..14a54e7fc 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryTest.java @@ -163,4 +163,27 @@ void saveItemAttributeByLaunchId() { Assertions.assertEquals("new value", attribute.get().getValue()); Assertions.assertEquals(false, attribute.get().isSystem()); } + + @Test + void deleteByKeyAndSystem() { + repository.saveByLaunchId(1L, "first", "first", true); + repository.saveByLaunchId(1L, "second", "second", false); + + final Optional first = repository.findByLaunchIdAndKeyAndSystem(1L, "first", true); + final Optional second = repository.findByLaunchIdAndKeyAndSystem(1L, "second", false); + + Assertions.assertTrue(first.isPresent()); + Assertions.assertTrue(second.isPresent()); + + repository.deleteByLaunchIdAndKeyAndSystem(1L, "first", true); + repository.deleteByLaunchIdAndKeyAndSystem(1L, "second", false); + + final Optional firstAfterRemove = repository.findByLaunchIdAndKeyAndSystem(1L, "first", true); + final Optional secondAfterRemove = repository.findByLaunchIdAndKeyAndSystem(1L, "second", false); + + Assertions.assertFalse(firstAfterRemove.isPresent()); + Assertions.assertFalse(secondAfterRemove.isPresent()); + + + } } From b45911dbf34a2b2425957b038141d36c0ed075af Mon Sep 17 00:00:00 2001 From: Ivan_Budayeu Date: Thu, 16 Jun 2022 15:49:28 +0300 Subject: [PATCH 040/110] EPMRPP-77623 || Delete all fix --- .../com/epam/ta/reportportal/dao/ItemAttributeRepository.java | 2 +- .../epam/ta/reportportal/dao/ItemAttributeRepositoryTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepository.java index adb448514..4a7d75112 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepository.java @@ -27,5 +27,5 @@ public interface ItemAttributeRepository extends ReportPortalRepository findByLaunchIdAndKeyAndSystem(Long launchId, String key, boolean isSystem); - int deleteByLaunchIdAndKeyAndSystem(Long launchId, String key, boolean isSystem); + int deleteAllByLaunchIdAndKeyAndSystem(Long launchId, String key, boolean isSystem); } diff --git a/src/test/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryTest.java index 14a54e7fc..ee4767d87 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryTest.java @@ -175,8 +175,8 @@ void deleteByKeyAndSystem() { Assertions.assertTrue(first.isPresent()); Assertions.assertTrue(second.isPresent()); - repository.deleteByLaunchIdAndKeyAndSystem(1L, "first", true); - repository.deleteByLaunchIdAndKeyAndSystem(1L, "second", false); + repository.deleteAllByLaunchIdAndKeyAndSystem(1L, "first", true); + repository.deleteAllByLaunchIdAndKeyAndSystem(1L, "second", false); final Optional firstAfterRemove = repository.findByLaunchIdAndKeyAndSystem(1L, "first", true); final Optional secondAfterRemove = repository.findByLaunchIdAndKeyAndSystem(1L, "second", false); From c693ba743e19557c5ccbeefa7df9f09a6bd7dc56 Mon Sep 17 00:00:00 2001 From: Chingiskhan Date: Fri, 17 Jun 2022 17:27:15 +0300 Subject: [PATCH 041/110] EPMRPP-77778 || Implement DELETE endpoint (remove nested entities from SenderCase) --- .../com/epam/ta/reportportal/dao/SenderCaseRepository.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java b/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java index 2485dec99..f019acde0 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java @@ -19,4 +19,8 @@ public interface SenderCaseRepository extends ReportPortalRepository recipients); + + @Modifying + @Query(value = "DELETE FROM sender_case WHERE id = :id", nativeQuery = true) + int deleteSenderCaseById(@Param(value = "id") Long id); } From b5d619e0471f18c12e2ab75a333ca6f70f93555c Mon Sep 17 00:00:00 2001 From: Pavel_Bortnik Date: Thu, 23 Jun 2022 17:05:14 +0300 Subject: [PATCH 042/110] EPMRPP-77972 || Additional methods for retrieving nested steps and retries --- .../ta/reportportal/dao/TestItemRepository.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java index 40b752046..a16d46c0c 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java @@ -333,4 +333,20 @@ Optional findLatestIdByTestCaseHashAndLaunchIdAndParentId(@Param("testCase * @return Number of {@link TestItem} */ long countTestItemByLaunchId(Long launchId); + + /** + * Select items with provided parent ids + * @param parentIds Parent test items id + * @return List of item ids + */ + @Query(value = "SELECT t.item_id FROM test_item t WHERE t.parent_id IN (:parentIds)", nativeQuery = true) + List findIdsByParentIds(@Param("parentIds") Long... parentIds); + + /** + * Select items with provided retry of + * @param retryOf Retry of test item id + * @return List of item ids + */ + @Query(value = "SELECT t.item_id FROM test_item t WHERE t.retry_of = :retryOf", nativeQuery = true) + List findIdsByRetryOf(@Param("retryOf") Long retryOf); } From 9e2cf9d182e60183b4809d913941bf1b5ba4daa0 Mon Sep 17 00:00:00 2001 From: Pavel_Bortnik Date: Thu, 23 Jun 2022 18:06:16 +0300 Subject: [PATCH 043/110] EPMRPP-77972 || Update retries query --- .../java/com/epam/ta/reportportal/dao/TestItemRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java index a16d46c0c..34bd062c2 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java @@ -347,6 +347,6 @@ Optional findLatestIdByTestCaseHashAndLaunchIdAndParentId(@Param("testCase * @param retryOf Retry of test item id * @return List of item ids */ - @Query(value = "SELECT t.item_id FROM test_item t WHERE t.retry_of = :retryOf", nativeQuery = true) - List findIdsByRetryOf(@Param("retryOf") Long retryOf); + @Query(value = "SELECT t.path FROM test_item t WHERE t.retry_of = :retryOf", nativeQuery = true) + List findPathsByRetryOf(@Param("retryOf") Long retryOf); } From c11c6c5df5899343defabefb9370bf113c94eb21 Mon Sep 17 00:00:00 2001 From: Pavel_Bortnik Date: Thu, 23 Jun 2022 18:07:58 +0300 Subject: [PATCH 044/110] EPMRPP-77972 || Change retrun type --- .../java/com/epam/ta/reportportal/dao/TestItemRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java index 34bd062c2..51aeafc4b 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java @@ -343,10 +343,10 @@ Optional findLatestIdByTestCaseHashAndLaunchIdAndParentId(@Param("testCase List findIdsByParentIds(@Param("parentIds") Long... parentIds); /** - * Select items with provided retry of + * Select retries path with provided retry of * @param retryOf Retry of test item id * @return List of item ids */ @Query(value = "SELECT t.path FROM test_item t WHERE t.retry_of = :retryOf", nativeQuery = true) - List findPathsByRetryOf(@Param("retryOf") Long retryOf); + List findPathsByRetryOf(@Param("retryOf") Long retryOf); } From 2fb1fb6167742591ece5f675190cdda80e9cc21a Mon Sep 17 00:00:00 2001 From: Pavel_Bortnik Date: Thu, 23 Jun 2022 19:13:57 +0300 Subject: [PATCH 045/110] EPMRPP-77972 || Return query --- .../com/epam/ta/reportportal/dao/TestItemRepository.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java index 51aeafc4b..0c9139448 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java @@ -343,10 +343,10 @@ Optional findLatestIdByTestCaseHashAndLaunchIdAndParentId(@Param("testCase List findIdsByParentIds(@Param("parentIds") Long... parentIds); /** - * Select retries path with provided retry of + * Select items ids with provided retry of * @param retryOf Retry of test item id * @return List of item ids */ - @Query(value = "SELECT t.path FROM test_item t WHERE t.retry_of = :retryOf", nativeQuery = true) - List findPathsByRetryOf(@Param("retryOf") Long retryOf); + @Query(value = "SELECT t.item_id FROM test_item t WHERE t.retry_of = :retryOf", nativeQuery = true) + List findIdsByRetryOf(@Param("retryOf") Long retryOf); } From 6750b3f0be99a579acdd974d776929aa1a82bb28 Mon Sep 17 00:00:00 2001 From: Pavel_Bortnik Date: Thu, 23 Jun 2022 19:26:32 +0300 Subject: [PATCH 046/110] EPMRPP-77972 || Add path query --- .../com/epam/ta/reportportal/dao/TestItemRepository.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java index 0c9139448..9b644ee6c 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java @@ -342,6 +342,14 @@ Optional findLatestIdByTestCaseHashAndLaunchIdAndParentId(@Param("testCase @Query(value = "SELECT t.item_id FROM test_item t WHERE t.parent_id IN (:parentIds)", nativeQuery = true) List findIdsByParentIds(@Param("parentIds") Long... parentIds); + /** + * Select item paths by provided parent ids + * @param parentIds Parent test items id + * @return List of item paths + */ + @Query(value = "SELECT t.path FROM test_item t WHERE t.parent_id IN (:parentIds)", nativeQuery = true) + List findPathsByParentIds(@Param("parentIds") Long... parentIds); + /** * Select items ids with provided retry of * @param retryOf Retry of test item id From 0c21fcbf77652cb05ff85f0d5e79c050ffc9880d Mon Sep 17 00:00:00 2001 From: Pavel_Bortnik Date: Thu, 23 Jun 2022 23:17:50 +0300 Subject: [PATCH 047/110] EPMRPP-77972 || Add path cast --- .../java/com/epam/ta/reportportal/dao/TestItemRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java index 9b644ee6c..bbae267ba 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java @@ -347,7 +347,7 @@ Optional findLatestIdByTestCaseHashAndLaunchIdAndParentId(@Param("testCase * @param parentIds Parent test items id * @return List of item paths */ - @Query(value = "SELECT t.path FROM test_item t WHERE t.parent_id IN (:parentIds)", nativeQuery = true) + @Query(value = "SELECT CAST(t.path) AS varchar FROM test_item t WHERE t.parent_id IN (:parentIds)", nativeQuery = true) List findPathsByParentIds(@Param("parentIds") Long... parentIds); /** From 0fff857b9e339bfbbc247655c28bfe9a9e331598 Mon Sep 17 00:00:00 2001 From: Pavel_Bortnik Date: Thu, 23 Jun 2022 23:38:32 +0300 Subject: [PATCH 048/110] EPMRPP-77972 || Add path cast --- .../java/com/epam/ta/reportportal/dao/TestItemRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java index bbae267ba..3660c2a40 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java @@ -347,7 +347,7 @@ Optional findLatestIdByTestCaseHashAndLaunchIdAndParentId(@Param("testCase * @param parentIds Parent test items id * @return List of item paths */ - @Query(value = "SELECT CAST(t.path) AS varchar FROM test_item t WHERE t.parent_id IN (:parentIds)", nativeQuery = true) + @Query(value = "SELECT CAST(t.path AS VARCHAR) FROM test_item t WHERE t.parent_id IN (:parentIds)", nativeQuery = true) List findPathsByParentIds(@Param("parentIds") Long... parentIds); /** From ee07e36fd9273d5ec7b7b89d4d0a9b96db28b74d Mon Sep 17 00:00:00 2001 From: Ivan_Budayeu Date: Tue, 28 Jun 2022 12:48:57 +0300 Subject: [PATCH 049/110] EPMRPP-78107 || Attribute rule cascade merge --- .../entity/project/email/SenderCase.java | 5 +-- .../dao/SenderCaseRepositoryTest.java | 31 +++++++++++++++++-- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java b/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java index c387f94d1..f1647e840 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java @@ -51,7 +51,7 @@ public class SenderCase implements Serializable { @Column(name = "launch_name") private Set launchNames; - @OneToMany(mappedBy = "senderCase", cascade = CascadeType.PERSIST, orphanRemoval = true, fetch = FetchType.EAGER) + @OneToMany(mappedBy = "senderCase", cascade = { CascadeType.PERSIST, CascadeType.MERGE }, orphanRemoval = true, fetch = FetchType.EAGER) @OrderBy private Set launchAttributeRules; @@ -70,7 +70,8 @@ public class SenderCase implements Serializable { public SenderCase() { } - public SenderCase(Set recipients, Set launchNames, Set launchAttributeRules, SendCase sendCase, boolean enabled) { + public SenderCase(Set recipients, Set launchNames, Set launchAttributeRules, SendCase sendCase, + boolean enabled) { this.recipients = recipients; this.launchNames = launchNames; this.launchAttributeRules = launchAttributeRules; diff --git a/src/test/java/com/epam/ta/reportportal/dao/SenderCaseRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/SenderCaseRepositoryTest.java index 689e9c484..dac59149b 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/SenderCaseRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/SenderCaseRepositoryTest.java @@ -1,15 +1,14 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.BaseTest; +import com.epam.ta.reportportal.entity.project.email.LaunchAttributeRule; import com.epam.ta.reportportal.entity.project.email.SenderCase; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.jdbc.Sql; -import java.util.Collections; -import java.util.List; -import java.util.Optional; +import java.util.*; @Sql("/db/fill/sendercase/sender-case-fill.sql") public class SenderCaseRepositoryTest extends BaseTest { @@ -38,4 +37,30 @@ void deleteRecipients() { Assertions.assertEquals(1, updated.getRecipients().size()); Assertions.assertFalse(updated.getRecipients().contains("first")); } + + @Test + void saveAttributeRules() { + final Optional senderCases = senderCaseRepository.findByProjectIdAndRuleNameIgnoreCase(1L, "rule1"); + Assertions.assertTrue(senderCases.isPresent()); + + final SenderCase senderCaseDb = senderCases.get(); + final SenderCase senderCase = new SenderCase(); + senderCase.setId(senderCaseDb.getId()); + senderCase.setRuleName(senderCaseDb.getRuleName()); + senderCase.setProject(senderCase.getProject()); + senderCase.setEnabled(senderCaseDb.isEnabled()); + senderCase.setLaunchNames(senderCaseDb.getLaunchNames()); + senderCase.setSendCase(senderCaseDb.getSendCase()); + senderCase.setRecipients(senderCaseDb.getRecipients()); + final LaunchAttributeRule attributeRule = new LaunchAttributeRule(); + attributeRule.setValue("v1"); + attributeRule.setSenderCase(senderCase); + Set rules = new HashSet<>(); + rules.add(attributeRule); + senderCase.setLaunchAttributeRules(rules); + senderCaseRepository.save(senderCase); + final SenderCase found = senderCaseRepository.findById(senderCaseDb.getId()).get(); + + Assertions.assertFalse(found.getLaunchAttributeRules().isEmpty()); + } } From 2dbd0e579ac457ff49fc28fe39383503b840db20 Mon Sep 17 00:00:00 2001 From: Maksim Antonov Date: Mon, 11 Jul 2022 11:42:09 +0200 Subject: [PATCH 050/110] EPMRPP-78071 || Sender case order by id added --- .../epam/ta/reportportal/dao/SenderCaseRepository.java | 2 +- .../resources/db/fill/sendercase/sender-case-fill.sql | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java b/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java index f019acde0..f77866f21 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java @@ -11,7 +11,7 @@ public interface SenderCaseRepository extends ReportPortalRepository { - @Query(value = "SELECT sc FROM SenderCase sc WHERE sc.project.id = :projectId") + @Query(value = "SELECT sc FROM SenderCase sc WHERE sc.project.id = :projectId ORDER BY sc.id") List findAllByProjectId(@Param(value = "projectId") Long projectId); Optional findByProjectIdAndRuleNameIgnoreCase(Long projectId, String ruleName); diff --git a/src/test/resources/db/fill/sendercase/sender-case-fill.sql b/src/test/resources/db/fill/sendercase/sender-case-fill.sql index c822ce81b..73ce2d265 100644 --- a/src/test/resources/db/fill/sendercase/sender-case-fill.sql +++ b/src/test/resources/db/fill/sendercase/sender-case-fill.sql @@ -5,3 +5,12 @@ VALUES (1, 'Rule1', 'ALWAYS', 1, true); INSERT INTO recipients(sender_case_id, recipient) VALUES (1, 'first'); INSERT INTO recipients(sender_case_id, recipient) VALUES (1, 'second'); + +INSERT INTO sender_case (id, rule_name, send_case, project_id, enabled) +VALUES (2, 'Rule2', 'ALWAYS', 1, true); + +INSERT INTO sender_case (id, rule_name, send_case, project_id, enabled) +VALUES (3, 'Rule3', 'ALWAYS', 1, true); + +INSERT INTO sender_case (id, rule_name, send_case, project_id, enabled) +VALUES (4, 'Rule4', 'ALWAYS', 1, true); From 5b2f6670a0c652f436b3a98790eada05c13745df Mon Sep 17 00:00:00 2001 From: Maksim Antonov Date: Thu, 14 Jul 2022 14:07:21 +0200 Subject: [PATCH 051/110] EPMRPP-77922 || Performance fix and cleaning code --- build.gradle | 1 - gradle.properties | 2 +- .../commons/querygen/FilterTarget.java | 177 +++++++++------ .../commons/querygen/QueryBuilder.java | 25 ++- .../commons/querygen/query/QuerySupplier.java | 11 + .../config/ElasticAutoConfiguration.java | 37 --- .../dao/LaunchRepositoryCustomImpl.java | 61 ++++- .../reportportal/dao/util/RecordMappers.java | 29 ++- .../reportportal/dao/util/ResultFetchers.java | 4 +- .../elastic/dao/LogMessageRepository.java | 13 -- .../dao/LogMessageRepositoryCustom.java | 24 -- .../dao/LogMessageRepositoryCustomImpl.java | 83 ------- .../elastic/dao/LogMessageRepositoryFake.java | 210 ------------------ .../reportportal/entity/log/LogMessage.java | 18 -- src/main/resources/META-INF/spring.factories | 2 - .../resources/test-application.properties | 3 +- 16 files changed, 230 insertions(+), 470 deletions(-) delete mode 100644 src/main/java/com/epam/ta/reportportal/config/ElasticAutoConfiguration.java delete mode 100644 src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java delete mode 100644 src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustom.java delete mode 100644 src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustomImpl.java delete mode 100644 src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java diff --git a/build.gradle b/build.gradle index 729029157..5d181f61f 100644 --- a/build.gradle +++ b/build.gradle @@ -71,7 +71,6 @@ dependencies { exclude group: 'org.hibernate', module: 'hibernate-core' } compile('org.hibernate:hibernate-core:5.4.18.Final') - compile('org.springframework.boot:spring-boot-starter-data-elasticsearch') // //https://nvd.nist.gov/vuln/detail/CVE-2020-13692 diff --git a/gradle.properties b/gradle.properties index b02c10c11..93e2ef049 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=5.7.1 \ No newline at end of file +version=5.7.2 \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java index 05eb12404..9dff9c2e4 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java @@ -40,10 +40,7 @@ import org.jooq.impl.DSL; import java.sql.Timestamp; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Optional; +import java.util.*; import java.util.stream.Collectors; import static com.epam.ta.reportportal.commons.querygen.QueryBuilder.STATISTICS_KEY; @@ -324,29 +321,11 @@ protected Field idField() { )) { @Override protected Collection selectFields() { - return Lists.newArrayList(LAUNCH.ID, - LAUNCH.UUID, - LAUNCH.NAME, - LAUNCH.DESCRIPTION, - LAUNCH.START_TIME, - LAUNCH.END_TIME, - LAUNCH.PROJECT_ID, - LAUNCH.USER_ID, - LAUNCH.NUMBER, - LAUNCH.LAST_MODIFIED, - LAUNCH.MODE, - LAUNCH.STATUS, - LAUNCH.HAS_RETRIES, - LAUNCH.RERUN, - LAUNCH.APPROXIMATE_DURATION, - ITEM_ATTRIBUTE.KEY, - ITEM_ATTRIBUTE.VALUE, - ITEM_ATTRIBUTE.SYSTEM, - STATISTICS.S_COUNTER, - STATISTICS_FIELD.NAME, - USERS.ID, - USERS.LOGIN - ); + List> selectFields = new ArrayList<>(); + selectFields.addAll(getSelectSimpleFields()); + selectFields.addAll(getSelectAggregatedFields()); + + return selectFields; } @Override @@ -370,6 +349,47 @@ protected void joinTablesForFilter(QuerySupplier query) { protected Field idField() { return LAUNCH.ID; } + + @Override + protected void addGroupBy(QuerySupplier query) { + query.addGroupBy(getSelectSimpleFields()); + } + + @Override + public boolean withGrouping() { + return true; + } + + private List> getSelectSimpleFields() { + return Lists.newArrayList(LAUNCH.ID, + LAUNCH.UUID, + LAUNCH.NAME, + LAUNCH.DESCRIPTION, + LAUNCH.START_TIME, + LAUNCH.END_TIME, + LAUNCH.PROJECT_ID, + LAUNCH.USER_ID, + LAUNCH.NUMBER, + LAUNCH.LAST_MODIFIED, + LAUNCH.MODE, + LAUNCH.STATUS, + LAUNCH.HAS_RETRIES, + LAUNCH.RERUN, + LAUNCH.APPROXIMATE_DURATION, + STATISTICS.S_COUNTER, + STATISTICS_FIELD.NAME, + USERS.ID, + USERS.LOGIN + ); + } + + private List> getSelectAggregatedFields() { + return Lists.newArrayList(DSL.arrayAgg(DSL.concat( + ITEM_ATTRIBUTE.KEY, DSL.val(":"), + ITEM_ATTRIBUTE.VALUE, DSL.val(":"), + ITEM_ATTRIBUTE.SYSTEM)).as(ATTRIBUTE_ALIAS) + ); + } }, TEST_ITEM_TARGET(TestItem.class, @@ -618,6 +638,58 @@ protected Field idField() { ) { @Override protected Collection selectFields() { + List> selectFields = new ArrayList<>(); + selectFields.addAll(getSelectSimpleFields()); + selectFields.addAll(getSelectAggregatedFields()); + + return selectFields; + } + + @Override + protected void addFrom(SelectQuery query) { + query.addFrom(TEST_ITEM); + } + + @Override + protected Field idField() { + return TEST_ITEM.ITEM_ID; + } + + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(LAUNCH, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)); + query.addJoin(TEST_ITEM_RESULTS, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)); + query.addJoin(ITEM_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID)); + query.addJoin(STATISTICS, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(STATISTICS.ITEM_ID)); + query.addJoin(STATISTICS_FIELD, JoinType.LEFT_OUTER_JOIN, STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)); + query.addJoin(PATTERN_TEMPLATE_TEST_ITEM, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID)); + query.addJoin(PATTERN_TEMPLATE, JoinType.LEFT_OUTER_JOIN, PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID.eq(PATTERN_TEMPLATE.ID)); + query.addJoin(ISSUE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)); + query.addJoin(ISSUE_TYPE, JoinType.LEFT_OUTER_JOIN, ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)); + query.addJoin(ISSUE_GROUP, JoinType.LEFT_OUTER_JOIN, ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)); + query.addJoin(ISSUE_TICKET, JoinType.LEFT_OUTER_JOIN, ISSUE.ISSUE_ID.eq(ISSUE_TICKET.ISSUE_ID)); + query.addJoin(TICKET, JoinType.LEFT_OUTER_JOIN, ISSUE_TICKET.TICKET_ID.eq(TICKET.ID)); + query.addJoin(PARAMETER, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(PARAMETER.ITEM_ID)); + query.addJoin(LAUNCH_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, LAUNCH.ID.eq(LAUNCH_ATTRIBUTE.LAUNCH_ID)); + query.addJoin(CLUSTERS_TEST_ITEM, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(CLUSTERS_TEST_ITEM.ITEM_ID)); + } + + @Override + protected void joinTablesForFilter(QuerySupplier query) { + query.addJoin(LAUNCH, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)); + } + + @Override + protected void addGroupBy(QuerySupplier query) { + query.addGroupBy(getSelectSimpleFields()); + } + + @Override + public boolean withGrouping() { + return true; + } + + private List> getSelectSimpleFields() { return Lists.newArrayList(TEST_ITEM.ITEM_ID, TEST_ITEM.NAME, TEST_ITEM.CODE_REF, @@ -639,9 +711,6 @@ protected Collection selectFields() { TEST_ITEM_RESULTS.STATUS, TEST_ITEM_RESULTS.END_TIME, TEST_ITEM_RESULTS.DURATION, - ITEM_ATTRIBUTE.KEY, - ITEM_ATTRIBUTE.VALUE, - ITEM_ATTRIBUTE.SYSTEM, PARAMETER.ITEM_ID, PARAMETER.KEY, PARAMETER.VALUE, @@ -667,38 +736,12 @@ protected Collection selectFields() { ); } - @Override - protected void addFrom(SelectQuery query) { - query.addFrom(TEST_ITEM); - } - - @Override - protected Field idField() { - return TEST_ITEM.ITEM_ID; - } - - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(LAUNCH, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)); - query.addJoin(TEST_ITEM_RESULTS, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)); - query.addJoin(ITEM_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID)); - query.addJoin(STATISTICS, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(STATISTICS.ITEM_ID)); - query.addJoin(STATISTICS_FIELD, JoinType.LEFT_OUTER_JOIN, STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)); - query.addJoin(PATTERN_TEMPLATE_TEST_ITEM, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID)); - query.addJoin(PATTERN_TEMPLATE, JoinType.LEFT_OUTER_JOIN, PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID.eq(PATTERN_TEMPLATE.ID)); - query.addJoin(ISSUE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)); - query.addJoin(ISSUE_TYPE, JoinType.LEFT_OUTER_JOIN, ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)); - query.addJoin(ISSUE_GROUP, JoinType.LEFT_OUTER_JOIN, ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)); - query.addJoin(ISSUE_TICKET, JoinType.LEFT_OUTER_JOIN, ISSUE.ISSUE_ID.eq(ISSUE_TICKET.ISSUE_ID)); - query.addJoin(TICKET, JoinType.LEFT_OUTER_JOIN, ISSUE_TICKET.TICKET_ID.eq(TICKET.ID)); - query.addJoin(PARAMETER, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(PARAMETER.ITEM_ID)); - query.addJoin(LAUNCH_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, LAUNCH.ID.eq(LAUNCH_ATTRIBUTE.LAUNCH_ID)); - query.addJoin(CLUSTERS_TEST_ITEM, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(CLUSTERS_TEST_ITEM.ITEM_ID)); - } - - @Override - protected void joinTablesForFilter(QuerySupplier query) { - query.addJoin(LAUNCH, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)); + private List> getSelectAggregatedFields() { + return Lists.newArrayList(DSL.arrayAgg(DSL.concat( + ITEM_ATTRIBUTE.KEY, DSL.val(":"), + ITEM_ATTRIBUTE.VALUE, DSL.val(":"), + ITEM_ATTRIBUTE.SYSTEM)).as(ATTRIBUTE_ALIAS) + ); } }, @@ -1058,6 +1101,7 @@ protected Field idField() { }; public static final String FILTERED_QUERY = "filtered"; + public static final String ATTRIBUTE_ALIAS = "attribute"; public static final String FILTERED_ID = "id"; private Class clazz; @@ -1088,6 +1132,9 @@ protected void joinTablesForFilter(QuerySupplier query) { joinTables(query); } + protected void addGroupBy(QuerySupplier query) { + } + protected abstract Field idField(); public QuerySupplier wrapQuery(SelectQuery query) { @@ -1099,6 +1146,7 @@ public QuerySupplier wrapQuery(SelectQuery query) { idField().eq(field(DSL.name(FILTERED_QUERY, FILTERED_ID), Long.class)) ); joinTables(querySupplier); + addGroupBy(querySupplier); return querySupplier; } @@ -1115,6 +1163,7 @@ public QuerySupplier wrapQuery(SelectQuery query, String... ex idField().eq(field(DSL.name(FILTERED_QUERY, FILTERED_ID), Long.class)) ); joinTables(querySupplier); + addGroupBy(querySupplier); return querySupplier; } @@ -1146,4 +1195,8 @@ public static FilterTarget findByClass(Class clazz) { .findAny() .orElseThrow(() -> new IllegalArgumentException(String.format("No target query builder for clazz %s", clazz))); } + + public boolean withGrouping() { + return false; + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/QueryBuilder.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/QueryBuilder.java index 97a5bbc9a..4b773622e 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/QueryBuilder.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/QueryBuilder.java @@ -23,16 +23,14 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.tuple.Pair; import org.jooq.Condition; import org.jooq.*; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.function.BiPredicate; import java.util.stream.StreamSupport; @@ -273,10 +271,18 @@ public QueryBuilder withWrapperSort(Sort sort) { CriteriaHolder criteria = filterTarget.getCriteriaByFilter(order.getProperty()) .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_SORTING_PARAMETERS, order.getProperty())); if (criteria.getFilterCriteria().startsWith(STATISTICS_KEY)) { + if (filterTarget.withGrouping()) { + query.addGroupBy(fieldName(FILTERED_QUERY, criteria.getFilterCriteria())); + } + query.addOrderBy(fieldName(FILTERED_QUERY, criteria.getFilterCriteria()).sort(order.getDirection().isDescending() ? SortOrder.DESC : SortOrder.ASC)); } else { + if (filterTarget.withGrouping()) { + query.addGroupBy(field(criteria.getQueryCriteria())); + } + query.addOrderBy(field(criteria.getQueryCriteria()).sort(order.getDirection().isDescending() ? SortOrder.DESC : SortOrder.ASC)); @@ -325,4 +331,15 @@ private void addJoinsToQuery(QuerySupplier query, FilterTarget filterTarget, Set }); joinTables.forEach((key, value) -> query.addJoin(value.getTable(), value.getJoinType(), value.getJoinCondition())); } + + /** + * Adds group by condition + */ + public QueryBuilder addGroupByFields(Collection fields) { + if (CollectionUtils.isNotEmpty(fields)) { + query.addGroupBy(fields); + } + + return this; + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/query/QuerySupplier.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/query/QuerySupplier.java index 8c12c45e8..1051e0562 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/query/QuerySupplier.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/query/QuerySupplier.java @@ -19,6 +19,7 @@ import com.google.common.collect.Lists; import org.jooq.*; +import java.util.Collection; import java.util.List; import java.util.function.Supplier; @@ -100,4 +101,14 @@ public QuerySupplier addHaving(Condition condition) { selectQuery.addHaving(condition); return this; } + + public QuerySupplier addGroupBy(GroupField fields) { + selectQuery.addGroupBy(fields); + return this; + } + + public QuerySupplier addGroupBy(Collection fields) { + selectQuery.addGroupBy(fields); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/config/ElasticAutoConfiguration.java b/src/main/java/com/epam/ta/reportportal/config/ElasticAutoConfiguration.java deleted file mode 100644 index 87b0cb04e..000000000 --- a/src/main/java/com/epam/ta/reportportal/config/ElasticAutoConfiguration.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.epam.ta.reportportal.config; - -import org.elasticsearch.client.RestHighLevelClient; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.elasticsearch.client.ClientConfiguration; -import org.springframework.data.elasticsearch.client.RestClients; -import org.springframework.data.elasticsearch.core.ElasticsearchOperations; -import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; -import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; - -@Configuration -@EnableElasticsearchRepositories(basePackages = "com.epam.ta.reportportal.elastic.dao") -@ConditionalOnProperty(prefix = "rp.elasticsearchLogmessage", name = "host") -public class ElasticAutoConfiguration { - - @Bean - public RestHighLevelClient client(@Value("${rp.elasticsearchLogmessage.host}") String host, - @Value("${rp.elasticsearchLogmessage.port}") int port, @Value("${rp.elasticsearchLogmessage.username}") String username, - @Value("${rp.elasticsearchLogmessage.password}") String password) { - - ClientConfiguration clientConfiguration = ClientConfiguration.builder() - .connectedTo(host + ":" + port) - .withBasicAuth(username, password) - .build(); - - return RestClients.create(clientConfiguration).rest(); - } - - @Bean - public ElasticsearchOperations elasticsearchTemplate(RestHighLevelClient restHighLevelClient) { - return new ElasticsearchRestTemplate(restHighLevelClient); - } - -} diff --git a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java index 1fadd92a8..bc5a5cf05 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java @@ -26,7 +26,10 @@ import com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum; import com.epam.ta.reportportal.util.SortUtils; import com.epam.ta.reportportal.ws.model.analyzer.IndexLaunch; +import com.google.common.collect.Lists; import org.jooq.DSLContext; +import org.jooq.Field; +import org.jooq.SortField; import org.jooq.impl.DSL; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -40,6 +43,7 @@ import java.util.*; import java.util.stream.Collectors; +import static com.epam.ta.reportportal.commons.querygen.FilterTarget.ATTRIBUTE_ALIAS; import static com.epam.ta.reportportal.commons.querygen.FilterTarget.FILTERED_QUERY; import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.KEY_VALUE_SEPARATOR; import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; @@ -48,7 +52,6 @@ import static com.epam.ta.reportportal.dao.util.RecordMappers.INDEX_LAUNCH_RECORD_MAPPER; import static com.epam.ta.reportportal.dao.util.ResultFetchers.LAUNCH_FETCHER; import static com.epam.ta.reportportal.jooq.Tables.*; -import static com.epam.ta.reportportal.jooq.tables.JIssueType.ISSUE_TYPE; import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; import static com.epam.ta.reportportal.jooq.tables.JTestItemResults.TEST_ITEM_RESULTS; import static java.util.Optional.ofNullable; @@ -153,9 +156,20 @@ public Optional findLatestByFilter(Filter filter) { @Override public Page findAllLatestByFilter(Queryable filter, Pageable pageable) { + List> sortFieldList = SortUtils.TO_SORT_FIELDS.apply(pageable.getSort(), filter.getTarget()); + List> simpleSelectedFields = getLaunchSimpleSelectedFields(); + + List> selectFields = new ArrayList<>(simpleSelectedFields); + selectFields.add(getAttributeConcatedFields()); + + List> groupFields = new ArrayList<>(simpleSelectedFields); + for (SortField sortField : sortFieldList) { + groupFields.add(DSL.field(sortField.getName())); + } + return PageableExecutionUtils.getPage(LAUNCH_FETCHER.apply(dsl.with(FILTERED_QUERY) .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(filter, pageable.getSort(), true).with(pageable).build()) - .select() + .select(selectFields) .from(LAUNCH) .join(FILTERED_QUERY) .on(field(name(FILTERED_QUERY, ID), Long.class).eq(LAUNCH.ID)) @@ -167,7 +181,8 @@ public Page findAllLatestByFilter(Queryable filter, Pageable pageable) { .on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)) .leftJoin(USERS) .on(LAUNCH.USER_ID.eq(USERS.ID)) - .orderBy(SortUtils.TO_SORT_FIELDS.apply(pageable.getSort(), filter.getTarget())) + .groupBy(groupFields) + .orderBy(sortFieldList) .fetch()), pageable, () -> dsl.fetchCount(dsl.with(LAUNCHES) @@ -180,6 +195,35 @@ public Page findAllLatestByFilter(Queryable filter, Pageable pageable) { ); } + private Field getAttributeConcatedFields() { + return DSL.arrayAgg(DSL.concat( + ITEM_ATTRIBUTE.KEY, DSL.val(":"), + ITEM_ATTRIBUTE.VALUE, DSL.val(":"), + ITEM_ATTRIBUTE.SYSTEM)).as(ATTRIBUTE_ALIAS); + } + + private ArrayList> getLaunchSimpleSelectedFields() { + return Lists.newArrayList(LAUNCH.ID, + LAUNCH.UUID, + LAUNCH.NAME, + LAUNCH.DESCRIPTION, + LAUNCH.START_TIME, + LAUNCH.END_TIME, + LAUNCH.PROJECT_ID, + LAUNCH.USER_ID, + LAUNCH.NUMBER, + LAUNCH.LAST_MODIFIED, + LAUNCH.MODE, + LAUNCH.STATUS, + LAUNCH.HAS_RETRIES, + LAUNCH.RERUN, + LAUNCH.APPROXIMATE_DURATION, + STATISTICS.S_COUNTER, + STATISTICS_FIELD.NAME, + USERS.ID, + USERS.LOGIN); + } + @Override public List findLaunchIdsByProjectId(Long projectId) { return dsl.select(LAUNCH.ID).from(LAUNCH).where(LAUNCH.PROJECT_ID.eq(projectId)).fetchInto(Long.class); @@ -187,6 +231,11 @@ public List findLaunchIdsByProjectId(Long projectId) { @Override public Optional findLastRun(Long projectId, String mode) { + List> simpleSelectedFields = getLaunchSimpleSelectedFields(); + + List> selectFields = new ArrayList<>(simpleSelectedFields); + selectFields.add(getAttributeConcatedFields()); + return LAUNCH_FETCHER.apply(dsl.fetch(dsl.with(FILTERED_QUERY) .as(dsl.select(LAUNCH.ID) .from(LAUNCH) @@ -194,7 +243,7 @@ public Optional findLastRun(Long projectId, String mode) { .and(LAUNCH.MODE.eq(JLaunchModeEnum.valueOf(mode)).and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)))) .orderBy(LAUNCH.START_TIME.desc()) .limit(1)) - .select() + .select(selectFields) .from(LAUNCH) .join(FILTERED_QUERY) .on(LAUNCH.ID.eq(fieldName(FILTERED_QUERY, ID).cast(Long.class))) @@ -205,7 +254,9 @@ public Optional findLastRun(Long projectId, String mode) { .leftJoin(STATISTICS_FIELD) .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) .leftJoin(ITEM_ATTRIBUTE) - .on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)))).stream().findFirst(); + .on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)) + .groupBy(simpleSelectedFields) + )).stream().findFirst(); } @Override diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java index 38115ad14..4934f3306 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java @@ -64,6 +64,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; +import org.apache.logging.log4j.util.Strings; import org.jooq.Field; import org.jooq.Record; import org.jooq.RecordMapper; @@ -76,6 +77,7 @@ import java.util.function.BiFunction; import java.util.function.Function; +import static com.epam.ta.reportportal.commons.querygen.FilterTarget.ATTRIBUTE_ALIAS; import static com.epam.ta.reportportal.dao.LogRepositoryCustomImpl.ROOT_ITEM_ID; import static com.epam.ta.reportportal.dao.constant.TestItemRepositoryConstants.ATTACHMENTS_COUNT; import static com.epam.ta.reportportal.dao.constant.TestItemRepositoryConstants.HAS_CONTENT; @@ -447,12 +449,27 @@ public class RecordMappers { return Lists.newArrayList(widgetMap.values()); }; - public static final Function> ITEM_ATTRIBUTE_MAPPER = r -> { - String key = r.get(ITEM_ATTRIBUTE.KEY); - String value = r.get(ITEM_ATTRIBUTE.VALUE); - Boolean system = r.get(ITEM_ATTRIBUTE.SYSTEM); - if (key != null || value != null) { - return Optional.of(new ItemAttribute(key, value, system)); + public static final Function>> ITEM_ATTRIBUTE_MAPPER = r -> { + List attributeList = new ArrayList<>(); + + if (r.get(ATTRIBUTE_ALIAS) != null) { + String[] attributesArray = r.get(ATTRIBUTE_ALIAS, String[].class); + + for (String attributeString : attributesArray) { + if (Strings.isEmpty(attributeString)) continue; + + // explode attributes from string "key:value:system" + String[] attributes = attributeString.split(":"); + if (attributes[0] != null || attributes[1] != null) { + attributeList.add( + new ItemAttribute(attributes[0], attributes[1], Boolean.valueOf(attributes[2])) + ); + } + } + } + + if (attributeList.size() > 0) { + return Optional.of(attributeList); } else { return Optional.empty(); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/ResultFetchers.java b/src/main/java/com/epam/ta/reportportal/dao/util/ResultFetchers.java index 97d44d892..841d093e0 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/ResultFetchers.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/ResultFetchers.java @@ -108,7 +108,7 @@ private ResultFetchers() { } else { launch = launches.get(id); } - ITEM_ATTRIBUTE_MAPPER.apply(record).ifPresent(it -> launch.getAttributes().add(it)); + ITEM_ATTRIBUTE_MAPPER.apply(record).ifPresent(it -> launch.getAttributes().addAll(it)); launch.getStatistics().add(RecordMappers.STATISTICS_RECORD_MAPPER.map(record)); launches.put(id, launch); }); @@ -128,7 +128,7 @@ private ResultFetchers() { } else { testItem = testItems.get(id); } - ITEM_ATTRIBUTE_MAPPER.apply(record).ifPresent(it -> testItem.getAttributes().add(it)); + ITEM_ATTRIBUTE_MAPPER.apply(record).ifPresent(it -> testItem.getAttributes().addAll(it)); ofNullable(record.get(PARAMETER.ITEM_ID)).ifPresent(it -> testItem.getParameters().add(record.into(Parameter.class))); testItem.getItemResults().getStatistics().add(RecordMappers.STATISTICS_RECORD_MAPPER.map(record)); PATTERN_TEMPLATE_NAME_RECORD_MAPPER.apply(record) diff --git a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java deleted file mode 100644 index d9a7d2b35..000000000 --- a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepository.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.epam.ta.reportportal.elastic.dao; - -import com.epam.ta.reportportal.entity.log.LogMessage; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; -import org.springframework.stereotype.Repository; - -@Repository -@ConditionalOnProperty(prefix = "rp.elasticsearchLogmessage", name = "host") -@ConditionalOnBean(name = "elasticsearchTemplate") -public interface LogMessageRepository extends ElasticsearchRepository, LogMessageRepositoryCustom { -} diff --git a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustom.java deleted file mode 100644 index 041a87a79..000000000 --- a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustom.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.epam.ta.reportportal.elastic.dao; - -public interface LogMessageRepositoryCustom { - /** - * Saves a given entity. Use the returned instance for further operations as the save operation might have changed the - * entity instance completely. - * - * @param entity must not be {@literal null}. - * @return the saved entity; will never be {@literal null}. - * @throws IllegalArgumentException in case the given {@literal entity} is {@literal null}. - */ - S save(S entity); - - /** - * Saves all given entities. - * - * @param entities must not be {@literal null} nor must it contain {@literal null}. - * @return the saved entities; will never be {@literal null}. The returned {@literal Iterable} will have the same size - * as the {@literal Iterable} passed as an argument. - * @throws IllegalArgumentException in case the given {@link Iterable entities} or one of its entities is - * {@literal null}. - */ - Iterable saveAll(Iterable entities); -} diff --git a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustomImpl.java deleted file mode 100644 index ae98a1e40..000000000 --- a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryCustomImpl.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.epam.ta.reportportal.elastic.dao; - -import com.epam.ta.reportportal.entity.log.LogMessage; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.elasticsearch.core.ElasticsearchOperations; -import org.springframework.data.elasticsearch.core.query.IndexQuery; -import org.springframework.data.elasticsearch.repository.support.AbstractElasticsearchRepository; -import org.springframework.data.elasticsearch.repository.support.ElasticsearchEntityInformationCreatorImpl; -import org.springframework.stereotype.Repository; -import org.springframework.util.Assert; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * Implement rewritten methods to be able to use separated indexes for single entity based on their fields. - * - */ -@Repository -public class LogMessageRepositoryCustomImpl extends AbstractElasticsearchRepository - implements LogMessageRepositoryCustom { - - @Autowired - public LogMessageRepositoryCustomImpl(ElasticsearchOperations elasticsearchOperations) { - super(new ElasticsearchEntityInformationCreatorImpl( - elasticsearchOperations.getElasticsearchConverter().getMappingContext() - ).getEntityInformation(LogMessage.class), - elasticsearchOperations); - } - - @Override - // for now without force refreshing index - public S save(S logMessage) { - Assert.notNull(logMessage, "Cannot save 'null' entity."); - - elasticsearchOperations.index(createIndexQuery(logMessage)); - - return logMessage; - } - - @Override - // for now without force refreshing indexes - public Iterable saveAll(Iterable logMessageIterable) { - Assert.notNull(logMessageIterable, "Cannot insert 'null' as a List."); - - List queries = new ArrayList<>(); - for (S s : logMessageIterable) { - queries.add(createIndexQuery(s)); - } - elasticsearchOperations.bulkIndex(queries); - - return logMessageIterable; - } - - @Override - protected String stringIdRepresentation(Long id) { - return Objects.toString(id, null); - } - - private IndexQuery createIndexQuery(LogMessage logMessage) { - - IndexQuery query = new IndexQuery(); - query.setObject(logMessage); - query.setIndexName(getFullIndexName(logMessage)); - query.setId(stringIdRepresentation(extractIdFromBean(logMessage))); - query.setVersion(extractVersionFromBean(logMessage)); - query.setParentId(extractParentIdFromBean(logMessage)); - return query; - } - - private String getFullIndexName(LogMessage logMessage) { - return entityInformation.getIndexName() + logMessage.getProjectId(); - } - - private Long extractVersionFromBean(LogMessage logMessage) { - return entityInformation.getVersion(logMessage); - } - - private String extractParentIdFromBean(LogMessage logMessage) { - return entityInformation.getParentId(logMessage); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java b/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java deleted file mode 100644 index 6bf1309a4..000000000 --- a/src/main/java/com/epam/ta/reportportal/elastic/dao/LogMessageRepositoryFake.java +++ /dev/null @@ -1,210 +0,0 @@ -package com.epam.ta.reportportal.elastic.dao; - -import com.epam.ta.reportportal.entity.log.LogMessage; -import org.elasticsearch.index.query.QueryBuilder; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Sort; -import org.springframework.data.elasticsearch.core.query.SearchQuery; -import org.springframework.stereotype.Repository; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Optional; -import java.util.function.Function; - -/** - * Fake repository, need in case if configuration for elastic with logs doesn't exist. - */ -@Repository -@ConditionalOnMissingBean(name = "logMessageRepository") -public class LogMessageRepositoryFake implements LogMessageRepository { - private final Iterable logMessageIterable = () -> null; - - @Override - public S index(S entity) { - return null; - } - - @Override - public S indexWithoutRefresh(S entity) { - return null; - } - - @Override - public Iterable search(QueryBuilder query) { - return null; - } - - @Override - public Page search(QueryBuilder query, Pageable pageable) { - return null; - } - - @Override - public Page search(SearchQuery searchQuery) { - return null; - } - - @Override - public Page searchSimilar(LogMessage entity, String[] fields, Pageable pageable) { - return null; - } - - @Override - public void refresh() { - - } - - @Override - public Class getEntityClass() { - return null; - } - - @Override - public Iterable findAll(Sort sort) { - return logMessageIterable; - } - - @Override - public Page findAll(Pageable pageable) { - return new Page() { - @Override - public int getTotalPages() { - return 0; - } - - @Override - public long getTotalElements() { - return 0; - } - - @Override - public Page map(Function converter) { - return Page.empty(); - } - - @Override - public int getNumber() { - return 0; - } - - @Override - public int getSize() { - return 0; - } - - @Override - public int getNumberOfElements() { - return 0; - } - - @Override - public List getContent() { - return new ArrayList<>(); - } - - @Override - public boolean hasContent() { - return false; - } - - @Override - public Sort getSort() { - return Sort.unsorted(); - } - - @Override - public boolean isFirst() { - return false; - } - - @Override - public boolean isLast() { - return false; - } - - @Override - public boolean hasNext() { - return false; - } - - @Override - public boolean hasPrevious() { - return false; - } - - @Override - public Pageable nextPageable() { - return Pageable.unpaged(); - } - - @Override - public Pageable previousPageable() { - return Pageable.unpaged(); - } - - @Override - public Iterator iterator() { - return null; - } - }; - } - - @Override - public S save(S entity) { - return entity; - } - - @Override - public Iterable saveAll(Iterable entities) { - return entities; - } - - @Override - public Optional findById(Long aLong) { - return Optional.empty(); - } - - @Override - public boolean existsById(Long aLong) { - return false; - } - - @Override - public Iterable findAll() { - return logMessageIterable; - } - - @Override - public Iterable findAllById(Iterable longs) { - return logMessageIterable; - } - - @Override - public long count() { - return 0; - } - - @Override - public void deleteById(Long aLong) { - - } - - @Override - public void delete(LogMessage entity) { - - } - - @Override - public void deleteAll(Iterable entities) { - - } - - @Override - public void deleteAll() { - - } -} diff --git a/src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java b/src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java index afcf68d99..558a4ee9c 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java +++ b/src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java @@ -1,34 +1,16 @@ package com.epam.ta.reportportal.entity.log; -import org.springframework.data.elasticsearch.annotations.DateFormat; -import org.springframework.data.elasticsearch.annotations.Document; -import org.springframework.data.elasticsearch.annotations.Field; -import org.springframework.data.elasticsearch.annotations.FieldType; - -import javax.persistence.Id; import java.io.Serializable; import java.time.LocalDateTime; import java.util.Objects; -/** - * LogMessage - entity for storing message part of log + some additional info. - * indexName - is only prefix, real index name in Elasticsearch will be indexName + projectId. - */ -@Document(indexName = "log_message_store-", type="log_message", createIndex = false) public class LogMessage implements Serializable { - @Id - @Field(type = FieldType.Long) private Long id; - @Field(type = FieldType.Date, format = DateFormat.date_optional_time) private LocalDateTime logTime; - @Field(type = FieldType.Text) private String logMessage; - @Field(type = FieldType.Long) private Long itemId; - @Field(type = FieldType.Long) private Long launchId; - @Field(type = FieldType.Long) private Long projectId; public LogMessage(Long id, LocalDateTime logTime, String logMessage, Long itemId, Long launchId, Long projectId) { diff --git a/src/main/resources/META-INF/spring.factories b/src/main/resources/META-INF/spring.factories index 5d0aa35dd..e69de29bb 100644 --- a/src/main/resources/META-INF/spring.factories +++ b/src/main/resources/META-INF/spring.factories @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -com.epam.ta.reportportal.config.ElasticAutoConfiguration \ No newline at end of file diff --git a/src/test/resources/test-application.properties b/src/test/resources/test-application.properties index 80da2f66d..0a5ed2558 100644 --- a/src/test/resources/test-application.properties +++ b/src/test/resources/test-application.properties @@ -30,5 +30,4 @@ datastore.type=${rp.binarystore.type:filesystem} datastore.thumbnail.attachment.width=${rp.binarystore.thumbnail.attachment.width:100} datastore.thumbnail.attachment.height=${rp.binarystore.thumbnail.attachment.height:55} datastore.thumbnail.avatar.width=${rp.binarystore.thumbnail.avatar.width:40} -datastore.thumbnail.avatar.height=${rp.binarystore.thumbnail.avatar.height:50} -# Configuration for elasticsearch for storing log message +datastore.thumbnail.avatar.height=${rp.binarystore.thumbnail.avatar.height:50} \ No newline at end of file From d9f05d464518fe4bfaf566bd5b321210f434f177 Mon Sep 17 00:00:00 2001 From: Maksim Antonov Date: Fri, 29 Jul 2022 02:54:09 +0200 Subject: [PATCH 052/110] EPMRPP-78587 || Fix attribute grouping --- .../commons/querygen/FilterTarget.java | 24 ++++++++++++------- .../reportportal/dao/util/RecordMappers.java | 4 ++-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java index 9dff9c2e4..836349905 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java @@ -384,10 +384,14 @@ private List> getSelectSimpleFields() { } private List> getSelectAggregatedFields() { - return Lists.newArrayList(DSL.arrayAgg(DSL.concat( - ITEM_ATTRIBUTE.KEY, DSL.val(":"), - ITEM_ATTRIBUTE.VALUE, DSL.val(":"), - ITEM_ATTRIBUTE.SYSTEM)).as(ATTRIBUTE_ALIAS) + return Lists.newArrayList(DSL.arrayAgg( + DSL.field("concat({0}, {1}, {2}, {3}, {4})", + ITEM_ATTRIBUTE.KEY, + KEY_VALUE_SEPARATOR, + ITEM_ATTRIBUTE.VALUE, + KEY_VALUE_SEPARATOR, + ITEM_ATTRIBUTE.SYSTEM + )).as(ATTRIBUTE_ALIAS) ); } }, @@ -737,10 +741,14 @@ private List> getSelectSimpleFields() { } private List> getSelectAggregatedFields() { - return Lists.newArrayList(DSL.arrayAgg(DSL.concat( - ITEM_ATTRIBUTE.KEY, DSL.val(":"), - ITEM_ATTRIBUTE.VALUE, DSL.val(":"), - ITEM_ATTRIBUTE.SYSTEM)).as(ATTRIBUTE_ALIAS) + return Lists.newArrayList(DSL.arrayAgg( + DSL.field("concat({0}, {1}, {2}, {3}, {4})", + ITEM_ATTRIBUTE.KEY, + KEY_VALUE_SEPARATOR, + ITEM_ATTRIBUTE.VALUE, + KEY_VALUE_SEPARATOR, + ITEM_ATTRIBUTE.SYSTEM + )).as(ATTRIBUTE_ALIAS) ); } }, diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java index 4934f3306..1617ab9fa 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java @@ -459,8 +459,8 @@ public class RecordMappers { if (Strings.isEmpty(attributeString)) continue; // explode attributes from string "key:value:system" - String[] attributes = attributeString.split(":"); - if (attributes[0] != null || attributes[1] != null) { + String[] attributes = attributeString.split(":", -1); + if (attributes.length > 1 && (Strings.isNotEmpty(attributes[0]) || Strings.isNotEmpty(attributes[1]))) { attributeList.add( new ItemAttribute(attributes[0], attributes[1], Boolean.valueOf(attributes[2])) ); From d0baab6ea1ddaa54fd76c694261592e47884cebd Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Thu, 25 Aug 2022 15:43:03 +0300 Subject: [PATCH 053/110] Update promote.yml --- .github/workflows/promote.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml index 293e163a7..0174d39ee 100644 --- a/.github/workflows/promote.yml +++ b/.github/workflows/promote.yml @@ -32,13 +32,6 @@ jobs: runs-on: ubuntu-latest steps: - - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - distribution: 'adopt' - java-version: '11' - - name: Get variables run: | echo "ARTIFACT=`echo ${{ github.repository }} | cut -d/ -f2- | awk '{print tolower($0)}'`" >> $GITHUB_ENV @@ -58,7 +51,7 @@ jobs: export BUNDLE_FILE="bundle.jar" jar -cvf ${BUNDLE_FILE} "${files[@]}" echo 'Bundle upload' - curl -u ${{ secrets.SONATYPE_USER }}:${{ secrets.SONATYPE_PASSWORD }} -L \ + curl -f -u ${{ secrets.SONATYPE_USER }}:${{ secrets.SONATYPE_PASSWORD }} -L \ --request POST '${{ env.UPSTREAM_REPOSITORY_URL }}/service/local/staging/bundle_upload' \ --form "file=@${BUNDLE_FILE}" >response.json response_type=`jq type response.json || echo ''` @@ -105,4 +98,4 @@ jobs: else echo 'Verification failed, please check the bundle' 1>&2 exit 1 - fi \ No newline at end of file + fi From dfbf85161ba7d2d41deb35599fce1dc9b9af3fba Mon Sep 17 00:00:00 2001 From: Maksim Antonov Date: Tue, 6 Sep 2022 15:08:29 +0400 Subject: [PATCH 054/110] EPMRPP-75612 || Add ElasticSearch client --- build.gradle | 1 + .../dao/custom/ElasticSearchClient.java | 150 ++++++++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java diff --git a/build.gradle b/build.gradle index 5d181f61f..4fed690ae 100644 --- a/build.gradle +++ b/build.gradle @@ -80,6 +80,7 @@ dependencies { compile 'io.minio:minio:6.0.13' + implementation group: 'org.json', name: 'json', version: '20220320' compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310' compile 'org.hibernate.validator:hibernate-validator' diff --git a/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java b/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java new file mode 100644 index 000000000..46762e643 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java @@ -0,0 +1,150 @@ +package com.epam.ta.reportportal.dao.custom; + +import com.epam.ta.reportportal.entity.log.LogMessage; +import org.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.http.client.support.BasicAuthenticationInterceptor; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.web.client.RestTemplate; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Simple client to work with Elasticsearch. + * @author Maksim Antonov + */ +@Service +@ConditionalOnProperty(prefix = "rp.elasticsearch", name = "host") +public class ElasticSearchClient { + public static final String INDEX_PREFIX = "logs-reportportal-"; + public static final String CREATE_COMMAND = "{\"create\":{ }}\n"; + protected final Logger LOGGER = LoggerFactory.getLogger(ElasticSearchClient.class); + + private final String host; + private final RestTemplate restTemplate; + + public ElasticSearchClient(@Value("${rp.elasticsearch.host}") String host, + @Value("${rp.elasticsearch.username}") String username, + @Value("${rp.elasticsearch.password}") String password) { + restTemplate = new RestTemplate(); + restTemplate.getInterceptors().add(new BasicAuthenticationInterceptor(username, password)); + + this.host = host; + } + + public void save(List logMessageList) { + if (CollectionUtils.isEmpty(logMessageList)) return; + Map logsByIndex = new HashMap<>(); + + logMessageList.forEach(logMessage -> { + String indexName = getIndexName(logMessage.getProjectId()); + String logCreateBody = CREATE_COMMAND + convertToJson(logMessage) + "\n"; + + if (logsByIndex.containsKey(indexName)) { + logsByIndex.put(indexName, logsByIndex.get(indexName) + logCreateBody); + } else { + logsByIndex.put(indexName, logCreateBody); + } + }); + + logsByIndex.forEach((indexName, body) -> { + restTemplate.put(host + "/" + indexName + "/_bulk?refresh", getStringHttpEntity(body)); + }); + } + + public void deleteLogsByLogIdAndProjectId(Long projectId, Long logId) { + JSONObject terms = new JSONObject(); + terms.put("id", List.of(logId)); + + deleteLogsByTermsAndProjectId(projectId, terms); + } + + public void deleteLogsByItemSetAndProjectId(Long projectId, Set itemIds) { + JSONObject terms = new JSONObject(); + terms.put("itemId", itemIds); + + deleteLogsByTermsAndProjectId(projectId, terms); + } + + public void deleteLogsByLaunchIdAndProjectId(Long projectId, Long launchId) { + JSONObject terms = new JSONObject(); + terms.put("launchId", List.of(launchId)); + + deleteLogsByTermsAndProjectId(projectId, terms); + } + + public void deleteLogsByLaunchListAndProjectId(Long projectId, List launches) { + JSONObject terms = new JSONObject(); + terms.put("launchId", launches); + + deleteLogsByTermsAndProjectId(projectId, terms); + } + + public void deleteLogsByProjectId(Long projectId) { + String indexName = getIndexName(projectId); + try { + restTemplate.delete(host + "/_data_stream/" + indexName); + } catch (Exception exception) { + // to avoid checking of exists stream or not + LOGGER.error("DELETE stream from ES " + indexName + " Project: " + projectId + + " Message: " + exception.getMessage()); + } + } + + private void deleteLogsByTermsAndProjectId(Long projectId, JSONObject terms) { + String indexName = getIndexName(projectId); + try { + JSONObject deleteByLaunch = getDeleteJson(terms); + HttpEntity deleteRequest = getStringHttpEntity(deleteByLaunch.toString()); + + restTemplate.postForObject(host + "/" + indexName + "/_delete_by_query", deleteRequest, JSONObject.class); + } catch (Exception exception) { + // to avoid checking of exists stream or not + LOGGER.error("DELETE logs from stream ES error " + indexName + " Terms: " + terms + + " Message: " + exception.getMessage()); + } + } + + private String getIndexName(Long projectId) { + return INDEX_PREFIX + projectId; + } + + private JSONObject getDeleteJson(JSONObject terms) { + JSONObject query = new JSONObject(); + query.put("terms", terms); + + JSONObject deleteByLaunch = new JSONObject(); + deleteByLaunch.put("query", query); + + return deleteByLaunch; + } + + private JSONObject convertToJson(LogMessage logMessage) { + JSONObject personJsonObject = new JSONObject(); + personJsonObject.put("id", logMessage.getId()); + personJsonObject.put("message", logMessage.getLogMessage()); + personJsonObject.put("itemId", logMessage.getItemId()); + personJsonObject.put("@timestamp", logMessage.getLogTime()); + personJsonObject.put("launchId", logMessage.getLaunchId()); + + return personJsonObject; + } + + private HttpEntity getStringHttpEntity(String body) { + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + + return new HttpEntity<>(body, headers); + } + +} From 805914f07d820fed0d9ccd4407546dc72af86241 Mon Sep 17 00:00:00 2001 From: Ivan_Kustau Date: Mon, 19 Sep 2022 17:20:35 +0300 Subject: [PATCH 055/110] EPMRPP-79167 || Add check for possible 't' and 'f' values for system attribute --- .../com/epam/ta/reportportal/dao/util/RecordMappers.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java index 1617ab9fa..8b3e1bc38 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java @@ -461,8 +461,15 @@ public class RecordMappers { // explode attributes from string "key:value:system" String[] attributes = attributeString.split(":", -1); if (attributes.length > 1 && (Strings.isNotEmpty(attributes[0]) || Strings.isNotEmpty(attributes[1]))) { + Boolean systemAttribute; + //Case when system attribute is retrieved as 't' or 'f' + if ("t".equals(attributes[2]) || "f".equals(attributes[2])) { + systemAttribute = "t".equals(attributes[2]) ? Boolean.TRUE : Boolean.FALSE; + } else { + systemAttribute = Boolean.parseBoolean(attributes[2]); + } attributeList.add( - new ItemAttribute(attributes[0], attributes[1], Boolean.valueOf(attributes[2])) + new ItemAttribute(attributes[0], attributes[1], systemAttribute) ); } } From e3d92ce977bcb13e204008f24392d8668d3e9bb4 Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Thu, 6 Oct 2022 00:25:56 +0300 Subject: [PATCH 056/110] EPMRPP-78998 || Flaky test cases widget. Increase the amount of items to be displayed on widget from 20 to 50 --- .../dao/constant/WidgetContentRepositoryConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetContentRepositoryConstants.java b/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetContentRepositoryConstants.java index 3f801dcca..05ef0a874 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetContentRepositoryConstants.java +++ b/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetContentRepositoryConstants.java @@ -70,7 +70,7 @@ public class WidgetContentRepositoryConstants { /*Flaky test table widget constants*/ public static final String FLAKY_TABLE_RESULTS = "flaky"; - public static final Integer FLAKY_CASES_LIMIT = 20; + public static final Integer FLAKY_CASES_LIMIT = 50; /*Activity table widget constants*/ public static final String ACTIVITIES = "activities"; From d8849c8a7b59f27de85d39247fb1c0b855966b83 Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Thu, 20 Oct 2022 13:52:18 +0300 Subject: [PATCH 057/110] EPMRPP-79630 || Update Passing rate per Launch widget --- .../dao/WidgetContentRepositoryImpl.java | 5 +++-- .../constant/WidgetContentRepositoryConstants.java | 1 + .../widget/content/PassingRateStatisticsResult.java | 12 ++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java index 02dc5959f..a51cb8a02 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java @@ -396,14 +396,15 @@ public PassingRateStatisticsResult passingRatePerLaunchStatistics(Long launchId) return dsl.select(LAUNCH.ID, LAUNCH.NUMBER.as(NUMBER), sum(when(STATISTICS_FIELD.NAME.eq(EXECUTIONS_PASSED), STATISTICS.S_COUNTER).otherwise(0)).as(PASSED), - sum(when(STATISTICS_FIELD.NAME.eq(EXECUTIONS_TOTAL), STATISTICS.S_COUNTER).otherwise(0)).as(TOTAL) + sum(when(STATISTICS_FIELD.NAME.eq(EXECUTIONS_TOTAL), STATISTICS.S_COUNTER).otherwise(0)).as(TOTAL), + sum(when(STATISTICS_FIELD.NAME.eq(EXECUTIONS_SKIPPED), STATISTICS.S_COUNTER).otherwise(0)).as(SKIPPED) ) .from(LAUNCH) .leftJoin(STATISTICS) .on(LAUNCH.ID.eq(STATISTICS.LAUNCH_ID)) .leftJoin(STATISTICS_FIELD) .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .and(STATISTICS_FIELD.NAME.in(EXECUTIONS_PASSED, EXECUTIONS_TOTAL)) + .and(STATISTICS_FIELD.NAME.in(EXECUTIONS_PASSED, EXECUTIONS_TOTAL, EXECUTIONS_SKIPPED)) .where(LAUNCH.ID.eq(launchId)) .groupBy(LAUNCH.ID) .fetchOneInto(PassingRateStatisticsResult.class); diff --git a/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetContentRepositoryConstants.java b/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetContentRepositoryConstants.java index 3f801dcca..3ca8b3bf3 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetContentRepositoryConstants.java +++ b/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetContentRepositoryConstants.java @@ -36,6 +36,7 @@ public class WidgetContentRepositoryConstants { public static final String STATISTICS_SEPARATOR = "$"; public static final String TOTAL = "total"; + public static final String SKIPPED = "skipped"; public static final String EXECUTIONS_KEY = "executions"; public static final String DEFECTS_KEY = "defects"; diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/PassingRateStatisticsResult.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/PassingRateStatisticsResult.java index 319f8f3cc..52a71380a 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/PassingRateStatisticsResult.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/PassingRateStatisticsResult.java @@ -44,6 +44,10 @@ public class PassingRateStatisticsResult implements Serializable { @JsonProperty(value = TOTAL) private int total; + @Column(name = SKIPPED) + @JsonProperty(value = SKIPPED) + private int skipped; + public PassingRateStatisticsResult() { } @@ -78,4 +82,12 @@ public int getTotal() { public void setTotal(int total) { this.total = total; } + + public int getSkipped() { + return skipped; + } + + public void setSkipped(int skipped) { + this.skipped = skipped; + } } From ea33045e290dfa55f5feea835c81e6c9cff69577 Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Wed, 2 Nov 2022 14:37:51 +0300 Subject: [PATCH 058/110] EPMRPP-80176 || Update Passing rate summary widget --- .../ta/reportportal/dao/WidgetContentRepositoryImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java index a51cb8a02..30a576896 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java @@ -1099,6 +1099,9 @@ private SelectOnConditionStep buildPassingRateSelect(Filter fi sum(when(fieldName(STATISTICS_TABLE, SF_NAME).cast(String.class).eq(EXECUTIONS_TOTAL), fieldName(STATISTICS_TABLE, STATISTICS_COUNTER).cast(Integer.class) ).otherwise(0)).as(TOTAL), + sum(when(fieldName(STATISTICS_TABLE, SF_NAME).cast(String.class).eq(EXECUTIONS_SKIPPED), + fieldName(STATISTICS_TABLE, STATISTICS_COUNTER).cast(Integer.class) + ).otherwise(0)).as(SKIPPED), max(LAUNCH.NUMBER).as(NUMBER) ) .from(LAUNCH) @@ -1108,7 +1111,7 @@ private SelectOnConditionStep buildPassingRateSelect(Filter fi .from(STATISTICS) .join(STATISTICS_FIELD) .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .where(STATISTICS_FIELD.NAME.in(EXECUTIONS_PASSED, EXECUTIONS_TOTAL)) + .where(STATISTICS_FIELD.NAME.in(EXECUTIONS_PASSED, EXECUTIONS_TOTAL, EXECUTIONS_SKIPPED)) .asTable(STATISTICS_TABLE)) .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))); From d9db19c1553ec4672c63fd9ce4c55a5146217ca5 Mon Sep 17 00:00:00 2001 From: Ivan Kustau <86599591+IvanKustau@users.noreply.github.com> Date: Thu, 23 Feb 2023 10:03:24 +0300 Subject: [PATCH 059/110] Merge master into develop (#869) * EPMRPP-79211 || Change minio to Jcloud S3 Provider * EPMRPP-79211 || Return minio dependency * EPMRPP-79211 || Added api version * EPMRPP-79211 || Changed retrieving s3 location and changed provider to aws-s3 * EPMRPP-79211 || Added aws-s3 provider dependency * EPMRPP-79211 || Add logging for jcloud * EPMRPP-79211 || Adding multipart tu PutOptions * EPMRPP-79211 || Change bucketToRegion implementation to use custom location * EPMRPP-79211 || Remove logging module and add minio configuration * EPMRPP-79211 || Add documentation for custom module * EPMRPP-79211 || Remove multipart options * EPMRPP-80865 || Update bom and other versions * [Gradle Release Plugin] - new version commit: '5.7.5'. --------- Co-authored-by: miracle8484 <76156909+miracle8484@users.noreply.github.com> Co-authored-by: reportportal.io --- .github/workflows/release.yml | 4 +- build.gradle | 5 +- gradle.properties | 2 +- .../config/DataStoreConfiguration.java | 142 ++++++++++++++++-- .../S3DataStore.java} | 68 ++++++--- .../{minio/MinioFile.java => s3/S3File.java} | 6 +- .../distributed/minio/MinioDataStoreTest.java | 69 --------- .../distributed/s3/S3DataStoreTest.java | 89 +++++++++++ .../resources/test-application.properties | 8 +- 9 files changed, 276 insertions(+), 117 deletions(-) rename src/main/java/com/epam/ta/reportportal/filesystem/distributed/{minio/MinioDataStore.java => s3/S3DataStore.java} (56%) rename src/main/java/com/epam/ta/reportportal/filesystem/distributed/{minio/MinioFile.java => s3/S3File.java} (86%) delete mode 100644 src/test/java/com/epam/ta/reportportal/filesystem/distributed/minio/MinioDataStoreTest.java create mode 100644 src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac0c6b95f..3544a277f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,9 +12,9 @@ on: env: GH_USER_NAME: github.actor SCRIPTS_VERSION: 5.7.0 - BOM_VERSION: 5.7.3 + BOM_VERSION: 5.7.4 MIGRATIONS_VERSION: 5.7.3 - RELEASE_VERSION: 5.7.3 + RELEASE_VERSION: 5.7.4 jobs: release: diff --git a/build.gradle b/build.gradle index 80dd82cb1..306f45920 100644 --- a/build.gradle +++ b/build.gradle @@ -50,7 +50,7 @@ repositories { dependencyManagement { imports { - mavenBom(releaseMode ? 'com.epam.reportportal:commons-bom:' + getProperty('bom.version') : 'com.github.reportportal:commons-bom:76778372') + mavenBom(releaseMode ? 'com.epam.reportportal:commons-bom:' + getProperty('bom.version') : 'com.github.reportportal:commons-bom:f0b6bb6b') mavenBom('io.zonky.test.postgres:embedded-postgres-binaries-bom:12.9.0') } } @@ -95,6 +95,9 @@ dependencies { compile 'io.zonky.test:embedded-postgres:1.2.6' compile 'org.flywaydb:flyway-core:6.3.1' + compile 'org.apache.jclouds.api:s3:2.5.0' + compile 'org.apache.jclouds.provider:aws-s3:2.5.0' + testCompile 'org.springframework.boot:spring-boot-starter-test' testCompile 'org.flywaydb.flyway-test-extensions:flyway-spring-test:6.1.0' diff --git a/gradle.properties b/gradle.properties index 4de54008c..09ca0ec65 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=5.7.4 \ No newline at end of file +version=5.7.5 \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java b/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java index 08fc2afa8..e35f9a9eb 100644 --- a/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java +++ b/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java @@ -22,22 +22,115 @@ import com.epam.reportportal.commons.TikaContentTypeResolver; import com.epam.ta.reportportal.filesystem.DataStore; import com.epam.ta.reportportal.filesystem.LocalDataStore; -import com.epam.ta.reportportal.filesystem.distributed.minio.MinioDataStore; -import io.minio.MinioClient; -import io.minio.errors.InvalidEndpointException; -import io.minio.errors.InvalidPortException; +import com.epam.ta.reportportal.filesystem.distributed.s3.S3DataStore; +import com.google.common.base.Optional; +import com.google.common.base.Supplier; +import com.google.common.cache.CacheLoader; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Iterables; +import com.google.inject.Module; +import org.jclouds.ContextBuilder; +import org.jclouds.aws.s3.config.AWSS3HttpApiModule; +import org.jclouds.blobstore.BlobStore; +import org.jclouds.blobstore.BlobStoreContext; +import org.jclouds.blobstore.ContainerNotFoundException; +import org.jclouds.rest.ConfiguresHttpApi; +import org.jclouds.s3.S3Client; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import java.util.Set; + /** * @author Dzianis_Shybeka */ @Configuration public class DataStoreConfiguration { + /** + * Amazon has a general work flow they publish that allows clients to always find the correct URL endpoint for a given bucket: + * 1) ask s3.amazonaws.com for the bucket location + * 2) use the url returned to make the container specific request (get/put, etc) + * Jclouds cache the results from the first getBucketLocation call and use that region-specific URL, as needed. + * In this custom implementation of {@link AWSS3HttpApiModule} we are providing location from environment variable, so that + * we don't need to make getBucketLocation call + */ + @ConfiguresHttpApi + private static class CustomBucketToRegionModule extends AWSS3HttpApiModule { + private final String region; + + public CustomBucketToRegionModule(String region) { + this.region = region; + } + + @Override + @SuppressWarnings("Guava") + protected CacheLoader> bucketToRegion(Supplier> regionSupplier, S3Client client) { + Set regions = regionSupplier.get(); + if (regions.isEmpty()) { + return new CacheLoader<>() { + + @Override + @SuppressWarnings({ "Guava", "NullableProblems" }) + public Optional load(String bucket) { + if (CustomBucketToRegionModule.this.region != null) { + return Optional.of(CustomBucketToRegionModule.this.region); + } + return Optional.absent(); + } + + @Override + public String toString() { + return "noRegions()"; + } + }; + } else if (regions.size() == 1) { + final String onlyRegion = Iterables.getOnlyElement(regions); + return new CacheLoader<>() { + @SuppressWarnings("OptionalUsedAsFieldOrParameterType") + final Optional onlyRegionOption = Optional.of(onlyRegion); + + @Override + @SuppressWarnings("NullableProblems") + public Optional load(String bucket) { + if (CustomBucketToRegionModule.this.region != null) { + return Optional.of(CustomBucketToRegionModule.this.region); + } + return onlyRegionOption; + } + + @Override + public String toString() { + return "onlyRegion(" + onlyRegion + ")"; + } + }; + } else { + return new CacheLoader<>() { + @Override + @SuppressWarnings("NullableProblems") + public Optional load(String bucket) { + if (CustomBucketToRegionModule.this.region != null) { + return Optional.of(CustomBucketToRegionModule.this.region); + } + try { + return Optional.fromNullable(client.getBucketLocation(bucket)); + } catch (ContainerNotFoundException e) { + return Optional.absent(); + } + } + + @Override + public String toString() { + return "bucketToRegion()"; + } + }; + } + } + } + @Bean @ConditionalOnProperty(name = "datastore.type", havingValue = "filesystem") public DataStore localDataStore(@Value("${datastore.default.path:/data/store}") String storagePath) { @@ -46,18 +139,43 @@ public DataStore localDataStore(@Value("${datastore.default.path:/data/store}") @Bean @ConditionalOnProperty(name = "datastore.type", havingValue = "minio") - public MinioClient minioClient(@Value("${datastore.minio.endpoint}") String endpoint, - @Value("${datastore.minio.accessKey}") String accessKey, @Value("${datastore.minio.secretKey}") String secretKey, - @Value("${datastore.minio.region}") String region) throws InvalidPortException, InvalidEndpointException { - return new MinioClient(endpoint, accessKey, secretKey, region); + public BlobStore minioBlobStore(@Value("${datastore.minio.accessKey}") String accessKey, + @Value("${datastore.minio.secretKey}") String secretKey, @Value("${datastore.minio.endpoint}") String endpoint) { + + BlobStoreContext blobStoreContext = ContextBuilder.newBuilder("s3") + .endpoint(endpoint) + .credentials(accessKey, secretKey) + .buildView(BlobStoreContext.class); + + return blobStoreContext.getBlobStore(); } @Bean @ConditionalOnProperty(name = "datastore.type", havingValue = "minio") - public DataStore minioDataStore(@Autowired MinioClient minioClient, - @Value("${datastore.minio.bucketPrefix}") String bucketPrefix, - @Value("${datastore.minio.defaultBucketName}") String defaultBucketName) { - return new MinioDataStore(minioClient, bucketPrefix, defaultBucketName); + public DataStore minioDataStore(@Autowired BlobStore blobStore, @Value("${datastore.minio.bucketPrefix}") String bucketPrefix, + @Value("${datastore.minio.defaultBucketName}") String defaultBucketName, @Value("${datastore.minio.region}") String region) { + return new S3DataStore(blobStore, bucketPrefix, defaultBucketName, region); + } + + @Bean + @ConditionalOnProperty(name = "datastore.type", havingValue = "s3") + public BlobStore s3BlobStore(@Value("${datastore.s3.accessKey}") String accessKey, @Value("${datastore.s3.secretKey}") String secretKey, + @Value("${datastore.s3.region}") String region) { + Iterable modules = ImmutableSet.of(new CustomBucketToRegionModule(region)); + + BlobStoreContext blobStoreContext = ContextBuilder.newBuilder("aws-s3") + .modules(modules) + .credentials(accessKey, secretKey) + .buildView(BlobStoreContext.class); + + return blobStoreContext.getBlobStore(); + } + + @Bean + @ConditionalOnProperty(name = "datastore.type", havingValue = "s3") + public DataStore s3DataStore(@Autowired BlobStore blobStore, @Value("${datastore.s3.bucketPrefix}") String bucketPrefix, + @Value("${datastore.s3.defaultBucketName}") String defaultBucketName, @Value("${datastore.s3.region}") String region) { + return new S3DataStore(blobStore, bucketPrefix, defaultBucketName, region); } @Bean("attachmentThumbnailator") diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/minio/MinioDataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java similarity index 56% rename from src/main/java/com/epam/ta/reportportal/filesystem/distributed/minio/MinioDataStore.java rename to src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java index bcbd14024..803ecf531 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/minio/MinioDataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java @@ -14,63 +14,69 @@ * limitations under the License. */ -package com.epam.ta.reportportal.filesystem.distributed.minio; +package com.epam.ta.reportportal.filesystem.distributed.s3; import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.filesystem.DataStore; import com.epam.ta.reportportal.ws.model.ErrorType; -import com.google.common.collect.Maps; -import io.minio.MinioClient; -import io.minio.errors.MinioException; +import org.jclouds.blobstore.BlobStore; +import org.jclouds.blobstore.domain.Blob; +import org.jclouds.domain.Location; +import org.jclouds.domain.LocationBuilder; +import org.jclouds.domain.LocationScope; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; import java.io.InputStream; import java.nio.file.Path; import java.nio.file.Paths; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; /** * @author Ivan Budayeu */ -public class MinioDataStore implements DataStore { +public class S3DataStore implements DataStore { - private static final Logger LOGGER = LoggerFactory.getLogger(MinioDataStore.class); + private static final Logger LOGGER = LoggerFactory.getLogger(S3DataStore.class); private static final Lock CREATE_BUCKET_LOCK = new ReentrantLock(); - private final MinioClient minioClient; + private final BlobStore blobStore; private final String bucketPrefix; private final String defaultBucketName; + private final Location location; - public MinioDataStore(MinioClient minioClient, String bucketPrefix, String defaultBucketName) { - this.minioClient = minioClient; + public S3DataStore(BlobStore blobStore, String bucketPrefix, String defaultBucketName, String region) { + this.blobStore = blobStore; this.bucketPrefix = bucketPrefix; this.defaultBucketName = defaultBucketName; + this.location = getLocationFromString(region); } @Override public String save(String filePath, InputStream inputStream) { - MinioFile minioFile = getMinioFile(filePath); + S3File s3File = getS3File(filePath); try { - if (!minioClient.bucketExists(minioFile.getBucket())) { + if (!blobStore.containerExists(s3File.getBucket())) { CREATE_BUCKET_LOCK.lock(); try { - if (!minioClient.bucketExists(minioFile.getBucket())) { - minioClient.makeBucket(minioFile.getBucket()); + if (!blobStore.containerExists(s3File.getBucket())) { + blobStore.createContainerInLocation(location, s3File.getBucket()); } } finally { CREATE_BUCKET_LOCK.unlock(); } } - minioClient.putObject(minioFile.getBucket(), minioFile.getFilePath(), inputStream, inputStream.available(), Maps.newHashMap()); + Blob objectBlob = blobStore.blobBuilder(s3File.getFilePath()) + .payload(inputStream) + .contentDisposition(s3File.getFilePath()) + .contentLength(inputStream.available()) + .build(); + blobStore.putBlob(s3File.getBucket(), objectBlob); return Paths.get(filePath).toString(); - } catch (MinioException | IOException | InvalidKeyException | NoSuchAlgorithmException | XmlPullParserException e) { + } catch (IOException e) { LOGGER.error("Unable to save file '{}'", filePath, e); throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to save file"); } @@ -78,9 +84,9 @@ public String save(String filePath, InputStream inputStream) { @Override public InputStream load(String filePath) { - MinioFile minioFile = getMinioFile(filePath); + S3File s3File = getS3File(filePath); try { - return minioClient.getObject(minioFile.getBucket(), minioFile.getFilePath()); + return blobStore.getBlob(s3File.getBucket(), s3File.getFilePath()).getPayload().openStream(); } catch (Exception e) { LOGGER.error("Unable to find file '{}'", filePath, e); throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); @@ -89,26 +95,38 @@ public InputStream load(String filePath) { @Override public void delete(String filePath) { - MinioFile minioFile = getMinioFile(filePath); + S3File s3File = getS3File(filePath); try { - minioClient.removeObject(minioFile.getBucket(), minioFile.getFilePath()); + blobStore.removeBlob(s3File.getBucket(), s3File.getFilePath()); } catch (Exception e) { LOGGER.error("Unable to delete file '{}'", filePath, e); throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to delete file"); } } - private MinioFile getMinioFile(String filePath) { + private S3File getS3File(String filePath) { Path targetPath = Paths.get(filePath); int nameCount = targetPath.getNameCount(); if (nameCount > 1) { - return new MinioFile(bucketPrefix + retrievePath(targetPath, 0, 1), retrievePath(targetPath, 1, nameCount)); + return new S3File(bucketPrefix + retrievePath(targetPath, 0, 1), retrievePath(targetPath, 1, nameCount)); } else { - return new MinioFile(defaultBucketName, retrievePath(targetPath, 0, 1)); + return new S3File(defaultBucketName, retrievePath(targetPath, 0, 1)); } } + private Location getLocationFromString(String locationString) { + Location location = null; + if (locationString != null) { + location = new LocationBuilder() + .scope(LocationScope.REGION) + .id(locationString) + .description("region") + .build(); + } + return location; + } + private String retrievePath(Path path, int beginIndex, int endIndex) { return String.valueOf(path.subpath(beginIndex, endIndex)); } diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/minio/MinioFile.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3File.java similarity index 86% rename from src/main/java/com/epam/ta/reportportal/filesystem/distributed/minio/MinioFile.java rename to src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3File.java index 10ce0c061..27a2ce27f 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/minio/MinioFile.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3File.java @@ -14,17 +14,17 @@ * limitations under the License. */ -package com.epam.ta.reportportal.filesystem.distributed.minio; +package com.epam.ta.reportportal.filesystem.distributed.s3; /** * @author Ivan Budayeu */ -public class MinioFile { +public class S3File { private final String bucket; private final String filePath; - public MinioFile(String bucket, String filePath) { + public S3File(String bucket, String filePath) { this.bucket = bucket; this.filePath = filePath; } diff --git a/src/test/java/com/epam/ta/reportportal/filesystem/distributed/minio/MinioDataStoreTest.java b/src/test/java/com/epam/ta/reportportal/filesystem/distributed/minio/MinioDataStoreTest.java deleted file mode 100644 index e85231ff2..000000000 --- a/src/test/java/com/epam/ta/reportportal/filesystem/distributed/minio/MinioDataStoreTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.filesystem.distributed.minio; - -import com.google.common.collect.Maps; -import io.minio.MinioClient; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.io.InputStream; - -import static org.mockito.Mockito.*; - -/** - * @author Ivan Budayeu - */ -class MinioDataStoreTest { - - private static final String FILE_PATH = "someFile"; - private static final String BUCKET_PREFIX = "prj-"; - private static final String DEFAULT_BUCKET_NAME = "rp-bucket"; - - private final MinioClient minioClient = mock(MinioClient.class); - private final InputStream inputStream = mock(InputStream.class); - - private final MinioDataStore minioDataStore = new MinioDataStore(minioClient, BUCKET_PREFIX, DEFAULT_BUCKET_NAME); - - @Test - void save() throws Exception { - - when(minioClient.bucketExists(any(String.class))).thenReturn(true); - when(inputStream.available()).thenReturn(0); - - minioDataStore.save(FILE_PATH, inputStream); - - verify(minioClient, times(1)).putObject(DEFAULT_BUCKET_NAME, FILE_PATH, inputStream, inputStream.available(), Maps.newHashMap()); - } - - @Test - void load() throws Exception { - - when(minioClient.getObject(DEFAULT_BUCKET_NAME, FILE_PATH)).thenReturn(inputStream); - InputStream loaded = minioDataStore.load(FILE_PATH); - - Assertions.assertEquals(inputStream, loaded); - } - - @Test - void delete() throws Exception { - - minioDataStore.delete(FILE_PATH); - - verify(minioClient, times(1)).removeObject(DEFAULT_BUCKET_NAME, FILE_PATH); - } -} \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java b/src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java new file mode 100644 index 000000000..ec731b244 --- /dev/null +++ b/src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java @@ -0,0 +1,89 @@ +/* + * Copyright 2019 EPAM Systems + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.epam.ta.reportportal.filesystem.distributed.s3; + +import org.jclouds.blobstore.BlobStore; +import org.jclouds.blobstore.domain.Blob; +import org.jclouds.blobstore.domain.BlobBuilder; +import org.jclouds.io.Payload; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.io.InputStream; + +import static org.mockito.Mockito.*; + +/** + * @author Ivan Budayeu + */ +class S3DataStoreTest { + + private static final String FILE_PATH = "someFile"; + private static final String BUCKET_PREFIX = "prj-"; + private static final String DEFAULT_BUCKET_NAME = "rp-bucket"; + private static final String REGION = "us-east-1"; + private static final int ZERO = 0; + + private final BlobStore blobStore = mock(BlobStore.class); + private final InputStream inputStream = mock(InputStream.class); + + private final S3DataStore s3DataStore = new S3DataStore(blobStore, BUCKET_PREFIX, DEFAULT_BUCKET_NAME, REGION); + + @Test + void save() throws Exception { + + BlobBuilder blobBuilderMock = mock(BlobBuilder.class); + BlobBuilder.PayloadBlobBuilder payloadBlobBuilderMock = mock(BlobBuilder.PayloadBlobBuilder.class); + Blob blobMock = mock(Blob.class); + + when(inputStream.available()).thenReturn(ZERO); + when(payloadBlobBuilderMock.contentDisposition(FILE_PATH)).thenReturn(payloadBlobBuilderMock); + when(payloadBlobBuilderMock.contentLength(ZERO)).thenReturn(payloadBlobBuilderMock); + when(payloadBlobBuilderMock.build()).thenReturn(blobMock); + when(blobBuilderMock.payload(inputStream)).thenReturn(payloadBlobBuilderMock); + + when(blobStore.containerExists(any(String.class))).thenReturn(true); + when(blobStore.blobBuilder(FILE_PATH)).thenReturn(blobBuilderMock); + + s3DataStore.save(FILE_PATH, inputStream); + + verify(blobStore, times(1)).putBlob(DEFAULT_BUCKET_NAME, blobMock); + } + + @Test + void load() throws Exception { + + Blob mockBlob = mock(Blob.class); + Payload mockPayload = mock(Payload.class); + + when(mockPayload.openStream()).thenReturn(inputStream); + when(mockBlob.getPayload()).thenReturn(mockPayload); + + when(blobStore.getBlob(DEFAULT_BUCKET_NAME, FILE_PATH)).thenReturn(mockBlob); + InputStream loaded = s3DataStore.load(FILE_PATH); + + Assertions.assertEquals(inputStream, loaded); + } + + @Test + void delete() throws Exception { + + s3DataStore.delete(FILE_PATH); + + verify(blobStore, times(1)).removeBlob(DEFAULT_BUCKET_NAME, FILE_PATH); + } +} \ No newline at end of file diff --git a/src/test/resources/test-application.properties b/src/test/resources/test-application.properties index 0a5ed2558..2673e6adc 100644 --- a/src/test/resources/test-application.properties +++ b/src/test/resources/test-application.properties @@ -22,10 +22,10 @@ rp.binarystore.path=${java.io.tmpdir}/reportportal/datastore datastore.default.path=${rp.binarystore.path:/data/storage} datastore.seaweed.master.host=${rp.binarystore.master.host:localhost} datastore.seaweed.master.port=${rp.binarystore.master.port:9333} -datastore.minio.endpoint=${rp.binarystore.minio.endpoint:https://play.min.io} -datastore.minio.accessKey=${rp.binarystore.minio.accessKey:Q3AM3UQ867SPQQA43P2F} -datastore.minio.secretKey=${rp.binarystore.minio.secretKey:zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG} -# could be one of [seaweed, filesystem, minio] +datastore.s3.endpoint=${rp.binarystore.s3.endpoint:https://play.min.io} +datastore.s3.accessKey=${rp.binarystore.s3.accessKey:Q3AM3UQ867SPQQA43P2F} +datastore.s3.secretKey=${rp.binarystore.s3.secretKey:zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG} +# could be one of [seaweed, filesystem, s3] datastore.type=${rp.binarystore.type:filesystem} datastore.thumbnail.attachment.width=${rp.binarystore.thumbnail.attachment.width:100} datastore.thumbnail.attachment.height=${rp.binarystore.thumbnail.attachment.height:55} From 67dd3e1643aecd298d4ec383818f23cbcfcce1cd Mon Sep 17 00:00:00 2001 From: Maksim Antonov Date: Wed, 1 Mar 2023 13:56:16 +0400 Subject: [PATCH 060/110] EPMRPP-73535 || Updated ES client --- .../reportportal/dao/LogRepositoryCustom.java | 11 ++ .../dao/LogRepositoryCustomImpl.java | 14 ++ .../dao/custom/ElasticSearchClient.java | 98 ++++++++++- .../reportportal/dao/util/RecordMappers.java | 1 + .../ta/reportportal/entity/log/LogFull.java | 163 ++++++++++++++++++ 5 files changed, 283 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/epam/ta/reportportal/entity/log/LogFull.java diff --git a/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustom.java index 6c341e37f..5b14458ea 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustom.java @@ -200,5 +200,16 @@ List findNestedItemsWithPage(Long parentId, boolean excludeEmpty */ List findMessagesByLaunchIdAndItemIdAndPathAndLevelGte(Long launchId, Long itemId, String path, Integer level); + /** + * Retrieves log message id of specified test item with log level greather or equals than {@code level} + * + * @param launchId @link TestItem#getLaunchId()} + * @param itemId ID of {@link Log#getTestItem()} + * @param path {@link TestItem#getPath()} + * @param level log level + * @return {@link List} of {@link String} of log messages + */ + List findIdsByLaunchIdAndItemIdAndPathAndLevelGte(Long launchId, Long itemId, String path, Integer level); + int deleteByProjectId(Long projectId); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustomImpl.java index 94443c2ba..22e1a7a5f 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustomImpl.java @@ -373,6 +373,19 @@ public List findMessagesByLaunchIdAndItemIdAndPathAndLevelGte(Long launc .fetch(LOG.LOG_MESSAGE); } + @Override + public List findIdsByLaunchIdAndItemIdAndPathAndLevelGte(Long launchId, Long itemId, String path, Integer level) { + return dsl.select(LOG.ID) + .from(LOG) + .join(TEST_ITEM) + .on(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) + .where(LOG.LOG_LEVEL.ge(level) + .and(TEST_ITEM.LAUNCH_ID.eq(launchId)) + .and(TEST_ITEM.ITEM_ID.eq(itemId) + .or(TEST_ITEM.HAS_STATS.eq(false).and(DSL.sql(TEST_ITEM.PATH + " <@ cast(? AS LTREE)", path))))) + .fetch(LOG.ID); + } + @Override public int deleteByProjectId(Long projectId) { return dsl.deleteFrom(LOG).where(LOG.PROJECT_ID.eq(projectId)).execute(); @@ -390,6 +403,7 @@ private SelectConditionStep buildLogsUnderItemsQuery(Long laun parentItemTable.ITEM_ID.as(ROOT_ITEM_ID), LOG.LAUNCH_ID, LOG.LAST_MODIFIED, + LOG.PROJECT_ID, LOG.CLUSTER_ID ); diff --git a/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java b/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java index 46762e643..d44cf6fdf 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java +++ b/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java @@ -1,6 +1,7 @@ package com.epam.ta.reportportal.dao.custom; import com.epam.ta.reportportal.entity.log.LogMessage; +import org.apache.commons.collections.MapUtils; import org.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -14,10 +15,9 @@ import org.springframework.util.CollectionUtils; import org.springframework.web.client.RestTemplate; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; /** * Simple client to work with Elasticsearch. @@ -28,6 +28,8 @@ public class ElasticSearchClient { public static final String INDEX_PREFIX = "logs-reportportal-"; public static final String CREATE_COMMAND = "{\"create\":{ }}\n"; + public static final String ELASTIC_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS"; + public static final Integer MAX_RESULT_REQUEST = 5000; protected final Logger LOGGER = LoggerFactory.getLogger(ElasticSearchClient.class); private final String host; @@ -101,6 +103,83 @@ public void deleteLogsByProjectId(Long projectId) { } } + public LogMessage getLogMessageByProjectIdAndId(Long projectId, Long id) { + Map result = getLogMessagesByProjectIdAndIds(projectId, List.of(id)); + return MapUtils.isEmpty(result) ? null : result.get(id); + } + + public Map getLogMessagesByProjectIdAndIds(Long projectId, List logIds) { + Map logMessageMap = new HashMap<>(); + int i = 0; + while (true) { + int i2 = Math.min(logIds.size(), i + MAX_RESULT_REQUEST); + List logIdsBatch = logIds.subList(i, i2); + logMessageMap.putAll(getLogMessageMapBatch(projectId, logIdsBatch, MAX_RESULT_REQUEST)); + if (i2 == logIds.size()) { + break; + } + i += MAX_RESULT_REQUEST; + } + + return logMessageMap; + } + + private Map getLogMessageMapBatch(Long projectId, List logIds, Integer size) { + String indexName = getIndexName(projectId); + + JSONObject terms = new JSONObject(); + terms.put("id", logIds); + Map logMessageMap = new HashMap<>(); + + try { + JSONObject searchJson = getSearchJson(terms, size); + HttpEntity searchRequest = getStringHttpEntity(searchJson.toString()); + + LinkedHashMap result = restTemplate.postForObject(host + "/" + indexName + "/_search", searchRequest, LinkedHashMap.class); + + List> hits = (List>)((LinkedHashMap)result.get("hits")).get("hits"); + + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(hits)) { + for (LinkedHashMap hit : hits) { + Map source = (Map)hit.get("_source"); + LogMessage logMessage = convertElasticDataToLogMessage(projectId, source); + logMessageMap.put(logMessage.getId(), logMessage); + } + + } + + } catch (Exception exception) { + LOGGER.error("Search error " + indexName + " Terms: " + terms + + " Message: " + exception.getMessage()); + } + + return logMessageMap; + } + + private LogMessage convertElasticDataToLogMessage(Long projectId, Map source) { + String timestampString = (String) source.get("@timestamp"); + if (timestampString.lastIndexOf(".") > -1) { + int millsNumber = timestampString.length() - timestampString.lastIndexOf(".") - 1; + if (millsNumber < 6) { + timestampString += "0".repeat(6 - millsNumber); + } + } else { + timestampString += "." + "0".repeat(6); + } + + return new LogMessage( + ((Integer) source.get("id")).longValue(), + LocalDateTime.parse( + timestampString, + DateTimeFormatter.ofPattern(ELASTIC_DATETIME_FORMAT) + ), + (String) source.get("message"), + ((Integer) source.get("itemId")).longValue(), + ((Integer) source.get("launchId")).longValue(), + projectId + ); + } + private void deleteLogsByTermsAndProjectId(Long projectId, JSONObject terms) { String indexName = getIndexName(projectId); try { @@ -129,6 +208,17 @@ private JSONObject getDeleteJson(JSONObject terms) { return deleteByLaunch; } + private JSONObject getSearchJson(JSONObject terms, Integer size) { + JSONObject query = new JSONObject(); + query.put("terms", terms); + + JSONObject searchJson = new JSONObject(); + searchJson.put("query", query); + searchJson.put("size", size); + + return searchJson; + } + private JSONObject convertToJson(LogMessage logMessage) { JSONObject personJsonObject = new JSONObject(); personJsonObject.put("id", logMessage.getId()); diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java index 8b3e1bc38..6230dd6e1 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java @@ -196,6 +196,7 @@ public class RecordMappers { log.setLogMessage(result.get(LOG.LOG_MESSAGE, String.class)); log.setLastModified(result.get(LOG.LAST_MODIFIED, LocalDateTime.class)); log.setLogLevel(result.get(JLog.LOG.LOG_LEVEL, Integer.class)); + log.setProjectId(result.get(LOG.PROJECT_ID, Long.class)); ofNullable(result.get(LOG.LAUNCH_ID)).map(Launch::new).ifPresent(log::setLaunch); return log; }; diff --git a/src/main/java/com/epam/ta/reportportal/entity/log/LogFull.java b/src/main/java/com/epam/ta/reportportal/entity/log/LogFull.java new file mode 100644 index 000000000..19b51c036 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/entity/log/LogFull.java @@ -0,0 +1,163 @@ +/* + * Copyright 2019 EPAM Systems + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.epam.ta.reportportal.entity.log; + +import com.epam.ta.reportportal.entity.attachment.Attachment; +import com.epam.ta.reportportal.entity.item.TestItem; +import com.epam.ta.reportportal.entity.launch.Launch; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Objects; + +public class LogFull implements Serializable { + + private Long id; + private String uuid; + private LocalDateTime logTime; + private String logMessage; + private LocalDateTime lastModified; + private Integer logLevel; + private TestItem testItem; + private Launch launch; + private Long projectId; + private Long clusterId; + + private Attachment attachment; + + public LogFull(Long id, LocalDateTime logTime, String logMessage, LocalDateTime lastModified, Integer logLevel, TestItem testItem, + Attachment attachment) { + this.id = id; + this.logTime = logTime; + this.logMessage = logMessage; + this.lastModified = lastModified; + this.logLevel = logLevel; + this.testItem = testItem; + this.attachment = attachment; + } + + public LogFull() { + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public TestItem getTestItem() { + return testItem; + } + + public Launch getLaunch() { + return launch; + } + + public void setLaunch(Launch launch) { + this.launch = launch; + } + + public void setTestItem(TestItem testItem) { + this.testItem = testItem; + } + + public LocalDateTime getLogTime() { + return logTime; + } + + public void setLogTime(LocalDateTime logTime) { + this.logTime = logTime; + } + + public LocalDateTime getLastModified() { + return lastModified; + } + + public void setLastModified(LocalDateTime lastModified) { + this.lastModified = lastModified; + } + + public String getLogMessage() { + return logMessage; + } + + public void setLogMessage(String logMessage) { + this.logMessage = logMessage; + } + + public Integer getLogLevel() { + return logLevel; + } + + public void setLogLevel(Integer logLevel) { + this.logLevel = logLevel; + } + + public Attachment getAttachment() { + return attachment; + } + + public void setAttachment(Attachment attachment) { + this.attachment = attachment; + } + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + public Long getClusterId() { + return clusterId; + } + + public void setClusterId(Long clusterId) { + this.clusterId = clusterId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogFull log = (LogFull) o; + return Objects.equals(id, log.id) && Objects.equals(logTime, log.logTime) && Objects.equals(logMessage, log.logMessage) + && Objects.equals(lastModified, log.lastModified) && Objects.equals(logLevel, log.logLevel) && Objects.equals(testItem, + log.testItem + ) && Objects.equals(launch, log.launch) && Objects.equals(projectId, log.projectId) && Objects.equals(clusterId, log.clusterId); + } + + @Override + public int hashCode() { + return Objects.hash(id, logTime, logMessage, lastModified, logLevel, testItem, launch, projectId, clusterId); + } +} From eb97747d23bff291ff93165999162a2c913846db Mon Sep 17 00:00:00 2001 From: Maksim Antonov Date: Wed, 15 Mar 2023 20:03:16 +0400 Subject: [PATCH 061/110] EPMRPP-76400 || Pattern analyze working with ES --- .../dao/TestItemRepositoryCustom.java | 19 ++++ .../dao/TestItemRepositoryCustomImpl.java | 28 ++++++ .../dao/custom/ElasticSearchClient.java | 99 +++++++++++++++++++ 3 files changed, 146 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java index ff9f472b8..30f4a5f71 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java @@ -381,6 +381,15 @@ List selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(boolean autoAnalyz */ List selectIdsByRegexLogMessage(Collection itemIds, Integer logLevel, String pattern); + /** + * Select Log IDs which log's level is greater than or equal to provided. + * + * @param itemIds {@link Collection} of {@link TestItem#getItemId()} which logs should match + * @param logLevel {@link Log#getLogLevel()} + * @return The {@link List} of the {@link TestItem#getItemId()} + */ + List selectLogIdsWithLogLevelCondition(Collection itemIds, Integer logLevel); + /** * Select item IDs which descendants' log's level is greater than or equal to provided and log's message match to the REGEX pattern * @@ -392,6 +401,16 @@ List selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(boolean autoAnalyz */ List selectIdsUnderByStringLogMessage(Long launchId, Collection itemIds, Integer logLevel, String pattern); + /** + * Select Log IDs which descendants' log's level is greater than or equal to provided. + * + * @param launchId {@link TestItem#getLaunchId()} + * @param itemIds {@link Collection} of {@link TestItem#getItemId()} which logs should match + * @param logLevel {@link Log#getLogLevel()} + * @return The {@link List} of the {@link TestItem#getItemId()} + */ + List selectLogIdsUnderWithLogLevelCondition(Long launchId, Collection itemIds, Integer logLevel); + /** * Select item IDs which descendants' log's level is greater than or equal to provided and log's message match to the REGEX pattern * diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java index b00d33086..4ffee25c8 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java @@ -854,6 +854,17 @@ public List selectIdsByRegexLogMessage(Collection itemIds, Integer l .fetchInto(Long.class); } + @Override + public List selectLogIdsWithLogLevelCondition(Collection itemIds, Integer logLevel) { + return dsl.selectDistinct(LOG.ID) + .from(TEST_ITEM) + .join(LOG) + .on(TEST_ITEM.ITEM_ID.eq(LOG.ITEM_ID)) + .where(TEST_ITEM.ITEM_ID.in(itemIds)) + .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) + .fetchInto(Long.class); + } + @Override public List selectIdsUnderByStringLogMessage(Long launchId, Collection itemIds, Integer logLevel, String pattern) { final JTestItem child = TEST_ITEM.as(CHILD_ITEM_TABLE); @@ -873,6 +884,23 @@ public List selectIdsUnderByStringLogMessage(Long launchId, Collection selectLogIdsUnderWithLogLevelCondition(Long launchId, Collection itemIds, Integer logLevel) { + final JTestItem child = TEST_ITEM.as(CHILD_ITEM_TABLE); + + return dsl.selectDistinct(LOG.ID) + .from(TEST_ITEM) + .join(child) + .on(TEST_ITEM.PATH + " @> " + child.PATH) + .and(TEST_ITEM.ITEM_ID.notEqual(child.ITEM_ID)) + .join(LOG) + .on(child.ITEM_ID.eq(LOG.ITEM_ID)) + .where(TEST_ITEM.ITEM_ID.in(itemIds)) + .and(child.LAUNCH_ID.eq(launchId)) + .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) + .fetchInto(Long.class); + } + @Override public List selectIdsUnderByRegexLogMessage(Long launchId, Collection itemIds, Integer logLevel, String pattern) { final JTestItem child = TEST_ITEM.as(CHILD_ITEM_TABLE); diff --git a/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java b/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java index d44cf6fdf..e7dd0ee4c 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java +++ b/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java @@ -30,6 +30,7 @@ public class ElasticSearchClient { public static final String CREATE_COMMAND = "{\"create\":{ }}\n"; public static final String ELASTIC_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS"; public static final Integer MAX_RESULT_REQUEST = 5000; + public static final String LOG_MESSAGE_FIELD_NAME = "message"; protected final Logger LOGGER = LoggerFactory.getLogger(ElasticSearchClient.class); private final String host; @@ -124,6 +125,63 @@ public Map getLogMessagesByProjectIdAndIds(Long projectId, Lis return logMessageMap; } + public List searchTestItemIdsByLogIdsAndString(Long projectId, Collection logIds, String string) { + JSONObject filterTerms = new JSONObject(); + filterTerms.put("id", logIds); + List sourceFields = List.of("itemId"); + + JSONObject searchJson = getSearchStringJson(string, filterTerms, sourceFields, logIds.size()); + + return searchTestItemIdsByConditions(projectId, searchJson); + } + + public List searchTestItemIdsByLogIdsAndRegexp(Long projectId, Collection logIds, String pattern) { + JSONObject filterTerms = new JSONObject(); + filterTerms.put("id", logIds); + List sourceFields = List.of("itemId"); + + JSONObject searchJson = getSearchRegexpJson(pattern, filterTerms, sourceFields, logIds.size()); + + return searchTestItemIdsByConditions(projectId, searchJson); + } + + /** + * Search LogIds by logIds and conditions. + * LogIds instead of logs was used due to optimization. + * @param projectId + * @param searchJson + * @return + */ + private List searchTestItemIdsByConditions(Long projectId, JSONObject searchJson) { + String indexName = getIndexName(projectId); + + Set testItemIds = new HashSet<>(); + + try { + HttpEntity searchRequest = getStringHttpEntity(searchJson.toString()); + + LinkedHashMap result = restTemplate.postForObject(host + "/" + indexName + "/_search", searchRequest, LinkedHashMap.class); + + List> hits = (List>)((LinkedHashMap)result.get("hits")).get("hits"); + + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(hits)) { + for (LinkedHashMap hit : hits) { + Map source = (Map)hit.get("_source"); + Long testItemId = ((Integer) source.get("itemId")).longValue(); + testItemIds.add(testItemId); + } + + } + + } catch (Exception exception) { + LOGGER.error("Search error " + indexName + + " SearchJson: " + searchJson + + " Message: " + exception.getMessage()); + } + + return new ArrayList<>(testItemIds); + } + private Map getLogMessageMapBatch(Long projectId, List logIds, Integer size) { String indexName = getIndexName(projectId); @@ -219,6 +277,47 @@ private JSONObject getSearchJson(JSONObject terms, Integer size) { return searchJson; } + + private JSONObject getSearchStringJson(String string, JSONObject filterTerms, List sourceFields, Integer size) { + JSONObject postFilter = new JSONObject(); + postFilter.put("terms", filterTerms); + + JSONObject matchPhrase = new JSONObject(); + matchPhrase.put(LOG_MESSAGE_FIELD_NAME, string); + + JSONObject query = new JSONObject(); + query.put("match_phrase", matchPhrase); + + JSONObject searchJson = new JSONObject(); + searchJson.put("_source", sourceFields); + searchJson.put("query", query); + searchJson.put("post_filter", postFilter); + searchJson.put("size", size); + + return searchJson; + } + + // Separated from getSearchStringJson, because possibly will be added some + // specific configuration for regexp optimization. + private JSONObject getSearchRegexpJson(String pattern, JSONObject filterTerms, List sourceFields, Integer size) { + JSONObject postFilter = new JSONObject(); + postFilter.put("terms", filterTerms); + + JSONObject regexp = new JSONObject(); + regexp.put(LOG_MESSAGE_FIELD_NAME, pattern); + + JSONObject query = new JSONObject(); + query.put("regexp", regexp); + + JSONObject searchJson = new JSONObject(); + searchJson.put("_source", sourceFields); + searchJson.put("query", query); + searchJson.put("post_filter", postFilter); + searchJson.put("size", size); + + return searchJson; + } + private JSONObject convertToJson(LogMessage logMessage) { JSONObject personJsonObject = new JSONObject(); personJsonObject.put("id", logMessage.getId()); From 8aa9eef82e2fabcdcf0ad3a9767609b69968858f Mon Sep 17 00:00:00 2001 From: Ryhor <125865748+rkukharenka@users.noreply.github.com> Date: Thu, 16 Mar 2023 13:57:01 +0300 Subject: [PATCH 062/110] EPMRPP-82327 || Formatting code according to code style (#873) * EPMRPP-82327-commons-dao-code-style google-style applied * EPMRPP-82327-commons-dao-code-style fixed format after changes --- CHANGELOG.md | 27 +- README.md | 1 + build.gradle | 2 +- .../ApplicationContextAwareFactoryBean.java | 139 +- .../binary/AttachmentBinaryDataService.java | 14 +- .../binary/CreateLogAttachmentService.java | 21 +- .../reportportal/binary/DataStoreService.java | 8 +- .../binary/UserBinaryDataService.java | 13 +- .../impl/AttachmentBinaryDataServiceImpl.java | 273 +- .../impl/AttachmentDataStoreService.java | 45 +- .../binary/impl/CommonDataStoreService.java | 45 +- .../binary/impl/DataStoreUtils.java | 74 +- .../impl/UserBinaryDataServiceImpl.java | 168 +- .../binary/impl/UserDataStoreService.java | 45 +- .../commons/BinaryDataMetaInfo.java | 188 +- .../ta/reportportal/commons/EntityUtils.java | 77 +- .../commons/JsonbAwarePostgresDialect.java | 11 +- .../reportportal/commons/JsonbUserType.java | 223 +- .../reportportal/commons/MoreCollectors.java | 19 +- .../reportportal/commons/Preconditions.java | 136 +- .../ta/reportportal/commons/Predicates.java | 69 +- .../commons/ReportPortalUser.java | 381 +-- .../commons/accessible/Accessible.java | 26 +- .../commons/accessible/AccessibleField.java | 66 +- .../commons/accessible/AccessibleMethod.java | 68 +- .../commons/querygen/CompositeFilter.java | 121 +- .../querygen/CompositeFilterCondition.java | 87 +- .../commons/querygen/Condition.java | 1302 ++++---- .../commons/querygen/ConditionType.java | 4 +- .../querygen/ConvertibleCondition.java | 11 +- .../commons/querygen/CriteriaHolder.java | 383 +-- .../querygen/CriteriaHolderBuilder.java | 69 +- .../reportportal/commons/querygen/Filter.java | 415 +-- .../commons/querygen/FilterCondition.java | 518 +-- .../commons/querygen/FilterRules.java | 291 +- .../commons/querygen/FilterTarget.java | 2577 ++++++++------- .../commons/querygen/ProjectFilter.java | 54 +- .../commons/querygen/QueryBuilder.java | 638 ++-- .../commons/querygen/Queryable.java | 55 +- .../constant/ActivityCriteriaConstant.java | 18 +- .../constant/GeneralCriteriaConstant.java | 30 +- .../constant/IntegrationCriteriaConstant.java | 8 +- .../constant/IssueCriteriaConstant.java | 16 +- .../constant/ItemAttributeConstant.java | 22 +- .../constant/LaunchCriteriaConstant.java | 14 +- .../constant/LogCriteriaConstant.java | 24 +- .../constant/ProjectCriteriaConstant.java | 18 +- .../constant/TestItemCriteriaConstant.java | 53 +- .../constant/UserCriteriaConstant.java | 24 +- .../commons/querygen/query/JoinEntity.java | 50 +- .../commons/querygen/query/QuerySupplier.java | 177 +- .../reportportal/config/DataSourceConfig.java | 47 +- .../config/DataStoreConfiguration.java | 302 +- .../config/DatabaseConfiguration.java | 214 +- .../config/EncryptConfiguration.java | 112 +- .../dao/AbstractShareableRepositoryImpl.java | 117 +- .../reportportal/dao/ActivityRepository.java | 3 +- .../dao/ActivityRepositoryCustom.java | 35 +- .../dao/ActivityRepositoryCustomImpl.java | 72 +- .../dao/AttachmentRepository.java | 23 +- .../dao/AttachmentRepositoryCustom.java | 129 +- .../dao/AttachmentRepositoryCustomImpl.java | 348 +- .../reportportal/dao/AttributeRepository.java | 6 +- .../dao/AttributeRepositoryCustom.java | 3 +- .../dao/AttributeRepositoryCustomImpl.java | 39 +- .../reportportal/dao/ClusterRepository.java | 44 +- .../dao/ClusterRepositoryCustom.java | 3 +- .../dao/ClusterRepositoryCustomImpl.java | 32 +- .../reportportal/dao/DashboardRepository.java | 66 +- .../dao/DashboardRepositoryCustom.java | 1 + .../dao/DashboardRepositoryCustomImpl.java | 31 +- .../dao/DashboardWidgetRepository.java | 5 +- .../dao/FilterableRepository.java | 33 +- .../dao/IntegrationRepository.java | 311 +- .../dao/IntegrationRepositoryCustom.java | 73 +- .../dao/IntegrationRepositoryCustomImpl.java | 139 +- .../dao/IntegrationTypeRepository.java | 62 +- .../dao/IssueEntityRepository.java | 6 +- .../dao/IssueEntityRepositoryCustom.java | 17 +- .../dao/IssueEntityRepositoryCustomImpl.java | 37 +- .../dao/IssueGroupRepository.java | 2 +- .../reportportal/dao/IssueTypeRepository.java | 18 +- .../dao/IssueTypeRepositoryCustom.java | 5 +- .../dao/IssueTypeRepositoryCustomImpl.java | 65 +- .../dao/ItemAttributeRepository.java | 9 +- .../dao/ItemAttributeRepositoryCustom.java | 204 +- .../ItemAttributeRepositoryCustomImpl.java | 371 ++- .../ta/reportportal/dao/LaunchRepository.java | 228 +- .../dao/LaunchRepositoryCustom.java | 169 +- .../dao/LaunchRepositoryCustomImpl.java | 683 ++-- .../ta/reportportal/dao/LogRepository.java | 40 +- .../reportportal/dao/LogRepositoryCustom.java | 371 +-- .../dao/LogRepositoryCustomImpl.java | 965 +++--- .../dao/OAuth2AccessTokenRepository.java | 71 +- .../dao/OAuthRegistrationRepository.java | 4 +- .../OAuthRegistrationRepositoryCustom.java | 1 + ...OAuthRegistrationRepositoryCustomImpl.java | 1 + ...AuthRegistrationRestrictionRepository.java | 8 +- ...gistrationRestrictionRepositoryCustom.java | 1 + ...rationRestrictionRepositoryCustomImpl.java | 4 +- .../dao/OnboardingRepository.java | 31 +- .../dao/PatternTemplateRepository.java | 30 +- .../dao/PatternTemplateRepositoryCustom.java | 3 +- .../PatternTemplateRepositoryCustomImpl.java | 27 +- .../reportportal/dao/ProjectRepository.java | 23 +- .../dao/ProjectRepositoryCustom.java | 111 +- .../dao/ProjectRepositoryCustomImpl.java | 222 +- .../dao/ProjectUserRepository.java | 4 +- .../dao/ProjectUserRepositoryCustom.java | 5 +- .../dao/ProjectUserRepositoryCustomImpl.java | 42 +- .../dao/ReportPortalRepository.java | 7 +- .../dao/ReportPortalRepositoryImpl.java | 61 +- .../dao/RestorePasswordBidRepository.java | 18 +- .../dao/SenderCaseRepository.java | 26 +- .../dao/ServerSettingsRepository.java | 12 +- .../dao/ServerSettingsRepositoryCustom.java | 3 +- .../ServerSettingsRepositoryCustomImpl.java | 38 +- .../dao/ShareableEntityRepository.java | 17 +- .../reportportal/dao/ShareableRepository.java | 44 +- .../dao/StaleMaterializedViewRepository.java | 5 +- .../StaleMaterializedViewRepositoryImpl.java | 61 +- .../dao/StatisticsFieldRepository.java | 2 +- .../reportportal/dao/TestItemRepository.java | 704 +++-- .../dao/TestItemRepositoryCustom.java | 817 ++--- .../dao/TestItemRepositoryCustomImpl.java | 2244 ++++++------- .../ta/reportportal/dao/TicketRepository.java | 8 +- .../dao/TicketRepositoryCustom.java | 53 +- .../dao/TicketRepositoryCustomImpl.java | 112 +- .../dao/UserCreationBidRepository.java | 21 +- .../dao/UserCreationBidRepositoryCustom.java | 2 +- .../UserCreationBidRepositoryCustomImpl.java | 16 +- .../dao/UserFilterRepository.java | 67 +- .../dao/UserFilterRepositoryCustomImpl.java | 37 +- .../dao/UserPreferenceRepository.java | 54 +- .../ta/reportportal/dao/UserRepository.java | 84 +- .../dao/UserRepositoryCustom.java | 45 +- .../dao/UserRepositoryCustomImpl.java | 205 +- .../dao/WidgetContentRepository.java | 522 +-- .../dao/WidgetContentRepositoryImpl.java | 2807 +++++++++-------- .../ta/reportportal/dao/WidgetRepository.java | 83 +- .../dao/WidgetRepositoryCustom.java | 21 +- .../dao/WidgetRepositoryCustomImpl.java | 63 +- .../dao/constant/LogRepositoryConstants.java | 24 +- .../constant/TestItemRepositoryConstants.java | 20 +- .../WidgetContentRepositoryConstants.java | 226 +- .../constant/WidgetRepositoryConstants.java | 18 +- .../dao/custom/ElasticSearchClient.java | 526 +-- .../dao/util/JooqFieldNameTransformer.java | 24 +- .../ta/reportportal/dao/util/QueryUtils.java | 90 +- .../dao/util/RecordMapperUtils.java | 21 +- .../reportportal/dao/util/RecordMappers.java | 1047 +++--- .../reportportal/dao/util/ResultFetchers.java | 601 ++-- .../reportportal/dao/util/ShareableUtils.java | 65 +- .../reportportal/dao/util/TimestampUtils.java | 12 +- .../dao/util/WidgetContentUtil.java | 1152 +++---- .../dao/widget/WidgetContentProvider.java | 4 +- .../dao/widget/WidgetProviderChain.java | 6 +- .../dao/widget/WidgetQueryProvider.java | 7 +- .../content/HealthCheckTableChain.java | 126 +- .../content/HealthCheckTableColumnChain.java | 57 +- .../HealthCheckTableStatisticsChain.java | 114 +- .../HealthCheckTableColumnProvider.java | 30 +- .../HealthCheckTableStatisticsProvider.java | 28 +- ...AbstractHealthCheckTableQueryProvider.java | 77 +- .../query/CustomColumnQueryProvider.java | 81 +- .../query/StatisticsQueryProvider.java | 95 +- .../ta/reportportal/entity/AnalyzeMode.java | 27 +- .../entity/EmailSettingsEnum.java | 67 +- .../ta/reportportal/entity/ItemAttribute.java | 267 +- .../ta/reportportal/entity/LTreeType.java | 123 +- .../epam/ta/reportportal/entity/Metadata.java | 63 +- .../ta/reportportal/entity/Modifiable.java | 16 +- .../reportportal/entity/ServerSettings.java | 128 +- .../entity/ServerSettingsConstants.java | 10 +- .../entity/ServerSettingsEnum.java | 45 +- .../reportportal/entity/ShareableEntity.java | 76 +- .../entity/StatisticsAwareness.java | 5 +- .../entity/StatisticsCalculationStrategy.java | 49 +- .../entity/activity/Activity.java | 322 +- .../entity/activity/ActivityAction.java | 91 +- .../entity/activity/ActivityDetails.java | 62 +- .../entity/activity/HistoryField.java | 148 +- .../entity/attachment/Attachment.java | 196 +- .../entity/attachment/AttachmentMetaInfo.java | 170 +- .../entity/attachment/BinaryData.java | 78 +- .../entity/attribute/Attribute.java | 83 +- .../entity/bts/DefectFieldAllowedValue.java | 40 +- .../entity/bts/DefectFormField.java | 77 +- .../ta/reportportal/entity/bts/Ticket.java | 193 +- .../reportportal/entity/cluster/Cluster.java | 95 +- .../entity/dashboard/Dashboard.java | 81 +- .../entity/dashboard/DashboardWidget.java | 241 +- .../entity/dashboard/DashboardWidgetId.java | 86 +- .../entity/enums/ActivityEventType.java | 73 +- .../reportportal/entity/enums/AuthType.java | 51 +- .../entity/enums/ExternalSystemType.java | 86 +- .../entity/enums/ImageFormat.java | 28 +- .../entity/enums/InfoInterval.java | 50 +- .../entity/enums/IntegrationAuthFlowEnum.java | 23 +- .../entity/enums/IntegrationGroupEnum.java | 21 +- .../entity/enums/LaunchModeEnum.java | 18 +- .../reportportal/entity/enums/LogLevel.java | 160 +- .../entity/enums/PostgreSQLEnumType.java | 24 +- .../entity/enums/ProjectAttributeEnum.java | 106 +- .../entity/enums/ProjectType.java | 22 +- .../enums/ReservedIntegrationTypeEnum.java | 28 +- .../reportportal/entity/enums/SendCase.java | 53 +- .../reportportal/entity/enums/StatusEnum.java | 75 +- .../entity/enums/TestItemIssueGroup.java | 91 +- .../entity/enums/TestItemTypeEnum.java | 128 +- .../converter/AnalyzerModeConverter.java | 21 +- .../enums/converter/LogLevelConverter.java | 17 +- .../enums/converter/ProjectRoleConverter.java | 21 +- .../enums/converter/ProjectTypeConverter.java | 21 +- .../enums/converter/UserTypeConverter.java | 21 +- .../entity/filter/FilterSort.java | 100 +- .../entity/filter/ObjectType.java | 67 +- .../entity/filter/UserFilter.java | 106 +- .../entity/integration/Integration.java | 178 +- .../entity/integration/IntegrationParams.java | 33 +- .../entity/integration/IntegrationType.java | 163 +- .../integration/IntegrationTypeDetails.java | 23 +- .../entity/item/ItemAttributePojo.java | 139 +- .../entity/item/ItemPathName.java | 40 +- .../entity/item/LaunchPathName.java | 40 +- .../reportportal/entity/item/NestedItem.java | 98 +- .../entity/item/NestedItemPage.java | 22 +- .../reportportal/entity/item/NestedStep.java | 259 +- .../reportportal/entity/item/Parameter.java | 78 +- .../ta/reportportal/entity/item/PathName.java | 40 +- .../ta/reportportal/entity/item/TestItem.java | 594 ++-- .../entity/item/TestItemResults.java | 238 +- .../entity/item/history/TestItemHistory.java | 40 +- .../entity/item/issue/IssueEntity.java | 256 +- .../entity/item/issue/IssueEntityPojo.java | 113 +- .../entity/item/issue/IssueGroup.java | 92 +- .../entity/item/issue/IssueType.java | 222 +- .../entity/jasper/ReportFormat.java | 56 +- .../entity/jasper/ReportType.java | 6 +- .../ta/reportportal/entity/launch/Launch.java | 493 +-- .../epam/ta/reportportal/entity/log/Log.java | 324 +- .../ta/reportportal/entity/log/LogFull.java | 274 +- .../reportportal/entity/log/LogMessage.java | 157 +- .../materialized/StaleMaterializedView.java | 46 +- .../entity/oauth/OAuthRegistration.java | 379 +-- .../oauth/OAuthRegistrationRestriction.java | 137 +- .../entity/oauth/OAuthRegistrationScope.java | 95 +- .../entity/onboarding/Onboarding.java | 90 +- .../entity/pattern/PatternTemplate.java | 188 +- .../pattern/PatternTemplateTestItem.java | 91 +- .../pattern/PatternTemplateTestItemKey.java | 76 +- .../pattern/PatternTemplateTestItemPojo.java | 71 +- .../entity/pattern/PatternTemplateType.java | 11 +- .../entity/plugin/PluginFileExtension.java | 25 +- .../entity/preference/UserPreference.java | 75 +- .../reportportal/entity/project/Project.java | 336 +- .../entity/project/ProjectAnalyzerConfig.java | 8 +- .../entity/project/ProjectAttribute.java | 169 +- .../entity/project/ProjectAttributeKey.java | 77 +- .../entity/project/ProjectInfo.java | 118 +- .../entity/project/ProjectIssueType.java | 78 +- .../entity/project/ProjectIssueTypeKey.java | 75 +- .../entity/project/ProjectRole.java | 47 +- .../entity/project/ProjectUtils.java | 386 +-- .../project/email/LaunchAttributeRule.java | 134 +- .../project/email/ProjectInfoWidget.java | 35 +- .../entity/project/email/SenderCase.java | 240 +- .../entity/statistics/Statistics.java | 190 +- .../entity/statistics/StatisticsField.java | 83 +- .../reportportal/entity/user/ProjectUser.java | 187 +- .../entity/user/ProjectUserId.java | 70 +- .../entity/user/RestorePasswordBid.java | 148 +- .../entity/user/StoredAccessToken.java | 155 +- .../ta/reportportal/entity/user/User.java | 310 +- .../entity/user/UserCreationBid.java | 115 +- .../ta/reportportal/entity/user/UserRole.java | 38 +- .../ta/reportportal/entity/user/UserType.java | 36 +- .../ta/reportportal/entity/widget/Widget.java | 157 +- .../entity/widget/WidgetOptions.java | 34 +- .../entity/widget/WidgetState.java | 31 +- .../entity/widget/WidgetType.java | 95 +- .../AbstractLaunchStatisticsContent.java | 129 +- .../content/ChartStatisticsContent.java | 17 +- .../widget/content/CriteriaHistoryItem.java | 106 +- .../content/CumulativeTrendChartContent.java | 45 +- .../content/CumulativeTrendChartEntry.java | 42 +- .../content/FlakyCasesTableContent.java | 124 +- .../widget/content/LatestLaunchContent.java | 69 +- .../content/LaunchesDurationContent.java | 63 +- .../widget/content/LaunchesTableContent.java | 33 +- .../MostTimeConsumingTestCasesContent.java | 167 +- .../widget/content/NotPassedCasesContent.java | 21 +- .../content/OverallStatisticsContent.java | 27 +- .../content/PassingRateStatisticsResult.java | 105 +- .../PatternTemplateLaunchStatistics.java | 42 +- .../content/PatternTemplateStatistics.java | 45 +- .../ProductStatusStatisticsContent.java | 171 +- .../content/TopPatternTemplatesContent.java | 43 +- .../widget/content/UniqueBugContent.java | 150 +- .../ComponentHealthCheckContent.java | 63 +- .../healthcheck/HealthCheckTableContent.java | 65 +- .../HealthCheckTableGetParams.java | 92 +- .../HealthCheckTableInitParams.java | 88 +- .../HealthCheckTableStatisticsContent.java | 29 +- .../content/healthcheck/LevelEntry.java | 30 +- .../exception/DataStorageException.java | 14 +- .../reportportal/filesystem/DataEncoder.java | 53 +- .../ta/reportportal/filesystem/DataStore.java | 6 +- .../filesystem/FilePathGenerator.java | 32 +- .../filesystem/LocalDataStore.java | 83 +- .../distributed/s3/S3DataStore.java | 177 +- .../filesystem/distributed/s3/S3File.java | 24 +- .../ta/reportportal/jooq/DefaultCatalog.java | 62 +- .../epam/ta/reportportal/jooq/Indexes.java | 842 +++-- .../epam/ta/reportportal/jooq/JPublic.java | 936 +++--- .../com/epam/ta/reportportal/jooq/Keys.java | 1203 ++++--- .../epam/ta/reportportal/jooq/Sequences.java | 432 +-- .../com/epam/ta/reportportal/jooq/Tables.java | 656 ++-- .../jooq/enums/JAccessTokenTypeEnum.java | 52 +- .../jooq/enums/JAuthTypeEnum.java | 52 +- .../jooq/enums/JFilterConditionEnum.java | 68 +- .../jooq/enums/JIntegrationAuthFlowEnum.java | 54 +- .../jooq/enums/JIntegrationGroupEnum.java | 52 +- .../jooq/enums/JIssueGroupEnum.java | 54 +- .../jooq/enums/JLaunchModeEnum.java | 48 +- .../jooq/enums/JPasswordEncoderType.java | 54 +- .../jooq/enums/JProjectRoleEnum.java | 52 +- .../jooq/enums/JSortDirectionEnum.java | 48 +- .../reportportal/jooq/enums/JStatusEnum.java | 64 +- .../jooq/enums/JTestItemTypeEnum.java | 74 +- .../reportportal/jooq/tables/JAclClass.java | 250 +- .../reportportal/jooq/tables/JAclEntry.java | 327 +- .../jooq/tables/JAclObjectIdentity.java | 321 +- .../ta/reportportal/jooq/tables/JAclSid.java | 268 +- .../reportportal/jooq/tables/JActivity.java | 338 +- .../reportportal/jooq/tables/JAttachment.java | 313 +- .../jooq/tables/JAttachmentDeletion.java | 260 +- .../reportportal/jooq/tables/JAttribute.java | 240 +- .../reportportal/jooq/tables/JClusters.java | 271 +- .../jooq/tables/JClustersTestItem.java | 221 +- .../jooq/tables/JContentField.java | 227 +- .../reportportal/jooq/tables/JDashboard.java | 268 +- .../jooq/tables/JDashboardWidget.java | 353 ++- .../ta/reportportal/jooq/tables/JFilter.java | 266 +- .../jooq/tables/JFilterCondition.java | 303 +- .../reportportal/jooq/tables/JFilterSort.java | 281 +- .../jooq/tables/JIntegration.java | 330 +- .../jooq/tables/JIntegrationType.java | 298 +- .../ta/reportportal/jooq/tables/JIssue.java | 287 +- .../reportportal/jooq/tables/JIssueGroup.java | 241 +- .../jooq/tables/JIssueTicket.java | 256 +- .../reportportal/jooq/tables/JIssueType.java | 301 +- .../jooq/tables/JIssueTypeProject.java | 258 +- .../jooq/tables/JItemAttribute.java | 311 +- .../ta/reportportal/jooq/tables/JLaunch.java | 408 +-- .../jooq/tables/JLaunchAttributeRules.java | 282 +- .../jooq/tables/JLaunchNames.java | 227 +- .../jooq/tables/JLaunchNumber.java | 280 +- .../ta/reportportal/jooq/tables/JLog.java | 367 +-- .../jooq/tables/JOauthAccessToken.java | 333 +- .../jooq/tables/JOauthRegistration.java | 333 +- .../tables/JOauthRegistrationRestriction.java | 285 +- .../jooq/tables/JOauthRegistrationScope.java | 274 +- .../reportportal/jooq/tables/JOnboarding.java | 270 +- .../reportportal/jooq/tables/JParameter.java | 236 +- .../jooq/tables/JPatternTemplate.java | 302 +- .../jooq/tables/JPatternTemplateTestItem.java | 260 +- .../jooq/tables/JPgpArmorHeaders.java | 235 +- .../ta/reportportal/jooq/tables/JProject.java | 293 +- .../jooq/tables/JProjectAttribute.java | 282 +- .../jooq/tables/JProjectUser.java | 267 +- .../reportportal/jooq/tables/JRecipients.java | 227 +- .../jooq/tables/JRestorePasswordBid.java | 243 +- .../reportportal/jooq/tables/JSenderCase.java | 283 +- .../jooq/tables/JServerSettings.java | 252 +- .../jooq/tables/JShareableEntity.java | 293 +- .../jooq/tables/JStaleMaterializedView.java | 270 +- .../reportportal/jooq/tables/JStatistics.java | 309 +- .../jooq/tables/JStatisticsField.java | 243 +- .../reportportal/jooq/tables/JTestItem.java | 444 +-- .../jooq/tables/JTestItemResults.java | 270 +- .../ta/reportportal/jooq/tables/JTicket.java | 303 +- .../jooq/tables/JUserCreationBid.java | 280 +- .../jooq/tables/JUserPreference.java | 299 +- .../ta/reportportal/jooq/tables/JUsers.java | 331 +- .../ta/reportportal/jooq/tables/JWidget.java | 286 +- .../jooq/tables/JWidgetFilter.java | 256 +- .../jooq/tables/records/JAclClassRecord.java | 327 +- .../jooq/tables/records/JAclEntryRecord.java | 699 ++-- .../records/JAclObjectIdentityRecord.java | 552 ++-- .../jooq/tables/records/JAclSidRecord.java | 327 +- .../jooq/tables/records/JActivityRecord.java | 774 ++--- .../records/JAttachmentDeletionRecord.java | 479 +-- .../tables/records/JAttachmentRecord.java | 774 ++--- .../jooq/tables/records/JAttributeRecord.java | 253 +- .../jooq/tables/records/JClustersRecord.java | 475 ++- .../records/JClustersTestItemRecord.java | 235 +- .../tables/records/JContentFieldRecord.java | 235 +- .../jooq/tables/records/JDashboardRecord.java | 402 ++- .../records/JDashboardWidgetRecord.java | 923 +++--- .../records/JFilterConditionRecord.java | 551 ++-- .../jooq/tables/records/JFilterRecord.java | 401 ++- .../tables/records/JFilterSortRecord.java | 402 +-- .../tables/records/JIntegrationRecord.java | 700 ++-- .../records/JIntegrationTypeRecord.java | 627 ++-- .../tables/records/JIssueGroupRecord.java | 253 +- .../jooq/tables/records/JIssueRecord.java | 477 +-- .../tables/records/JIssueTicketRecord.java | 253 +- .../records/JIssueTypeProjectRecord.java | 253 +- .../jooq/tables/records/JIssueTypeRecord.java | 551 ++-- .../tables/records/JItemAttributeRecord.java | 551 ++-- .../records/JLaunchAttributeRulesRecord.java | 403 +-- .../tables/records/JLaunchNamesRecord.java | 235 +- .../tables/records/JLaunchNumberRecord.java | 401 ++- .../jooq/tables/records/JLaunchRecord.java | 1222 +++---- .../jooq/tables/records/JLogRecord.java | 923 +++--- .../records/JOauthAccessTokenRecord.java | 773 ++--- .../records/JOauthRegistrationRecord.java | 999 +++--- .../JOauthRegistrationRestrictionRecord.java | 404 +-- .../JOauthRegistrationScopeRecord.java | 327 +- .../tables/records/JOnboardingRecord.java | 478 +-- .../jooq/tables/records/JParameterRecord.java | 309 +- .../records/JPatternTemplateRecord.java | 551 ++-- .../JPatternTemplateTestItemRecord.java | 253 +- .../records/JPgpArmorHeadersRecord.java | 235 +- .../records/JProjectAttributeRecord.java | 327 +- .../jooq/tables/records/JProjectRecord.java | 626 ++-- .../tables/records/JProjectUserRecord.java | 327 +- .../tables/records/JRecipientsRecord.java | 235 +- .../records/JRestorePasswordBidRecord.java | 328 +- .../tables/records/JSenderCaseRecord.java | 401 ++- .../tables/records/JServerSettingsRecord.java | 327 +- .../records/JShareableEntityRecord.java | 401 ++- .../records/JStaleMaterializedViewRecord.java | 330 +- .../records/JStatisticsFieldRecord.java | 253 +- .../tables/records/JStatisticsRecord.java | 477 +-- .../jooq/tables/records/JTestItemRecord.java | 1444 ++++----- .../records/JTestItemResultsRecord.java | 404 +-- .../jooq/tables/records/JTicketRecord.java | 700 ++-- .../records/JUserCreationBidRecord.java | 478 +-- .../tables/records/JUserPreferenceRecord.java | 401 ++- .../jooq/tables/records/JUsersRecord.java | 923 +++--- .../tables/records/JWidgetFilterRecord.java | 253 +- .../jooq/tables/records/JWidgetRecord.java | 551 ++-- .../reportportal/util/DateTimeProvider.java | 9 +- .../util/PersonalProjectService.java | 152 +- .../epam/ta/reportportal/util/SortUtils.java | 63 +- .../epam/ta/reportportal/util/UserUtils.java | 24 +- .../ta/reportportal/util/WidgetSortUtils.java | 181 +- .../com/epam/ta/reportportal/BaseTest.java | 14 +- .../CreateLogAttachmentServiceTest.java | 92 +- .../AttachmentCommonDataStoreServiceTest.java | 87 +- .../impl/AttachmentDataStoreServiceTest.java | 83 +- .../impl/CommonDataStoreServiceTest.java | 155 +- .../impl/UserCommonDataStoreServiceTest.java | 50 +- .../binary/impl/UserDataStoreServiceTest.java | 83 +- .../reportportal/commons/EntityUtilsTest.java | 162 +- .../commons/PreconditionsTest.java | 86 +- .../commons/querygen/CompositeFilterTest.java | 169 +- .../commons/querygen/FilterConditionTest.java | 33 +- .../commons/querygen/FilterRulesTest.java | 337 +- .../config/EncryptConfigurationTest.java | 42 +- .../config/TestConfiguration.java | 46 +- .../dao/ActivityRepositoryTest.java | 514 +-- .../dao/AttachmentRepositoryTest.java | 221 +- .../dao/AttributeRepositoryTest.java | 97 +- .../dao/ClusterRepositoryTest.java | 260 +- .../dao/DashboardRepositoryTest.java | 295 +- .../dao/DashboardWidgetRepositoryTest.java | 16 +- .../dao/IntegrationRepositoryTest.java | 451 +-- .../dao/IntegrationTypeRepositoryTest.java | 75 +- .../dao/IssueEntityRepositoryTest.java | 49 +- .../dao/IssueGroupRepositoryTest.java | 30 +- .../dao/IssueTypeRepositoryTest.java | 82 +- .../dao/ItemAttributeRepositoryTest.java | 319 +- ...LaunchCompositeAttributeFilteringTest.java | 220 +- .../dao/LaunchRepositoryTest.java | 801 ++--- .../reportportal/dao/LogRepositoryTest.java | 737 ++--- .../dao/PatternTemplateRepositoryTest.java | 67 +- .../dao/ProjectRepositoryTest.java | 259 +- .../dao/ProjectUserRepositoryTest.java | 49 +- .../dao/RestorePasswordBidRepositoryTest.java | 51 +- .../dao/SenderCaseRepositoryTest.java | 95 +- .../dao/ServerSettingsRepositoryTest.java | 47 +- .../StaleMaterializedViewRepositoryTest.java | 44 +- .../dao/StatisticsFieldRepositoryTest.java | 30 +- .../dao/TestItemRepositoryTest.java | 2511 ++++++++------- .../dao/TicketRepositoryTest.java | 78 +- .../dao/UserCreationBidRepositoryTest.java | 93 +- .../dao/UserFilterRepositoryTest.java | 325 +- .../dao/UserPreferenceRepositoryTest.java | 121 +- .../reportportal/dao/UserRepositoryTest.java | 717 +++-- .../dao/WidgetContentRepositoryTest.java | 2574 ++++++++------- .../dao/WidgetRepositoryTest.java | 428 +-- .../dao/constant/TestConstants.java | 30 +- .../dao/util/RecordMapperUtilsTest.java | 16 +- .../entity/ActivityEntityTypeTest.java | 55 +- .../reportportal/entity/AnalyzeModeTest.java | 52 +- .../entity/EmailSettingsEnumTest.java | 65 +- .../entity/ItemAttributeTest.java | 114 +- .../entity/ServerSettingsEnumTest.java | 65 +- .../entity/activity/ActivityActionTest.java | 52 +- .../entity/enums/ActivityEventTypeTest.java | 52 +- .../entity/enums/AuthTypeTest.java | 61 +- .../entity/enums/ExternalSystemTypeTest.java | 61 +- .../entity/enums/ImageFormatTest.java | 48 +- .../entity/enums/InfoIntervalTest.java | 52 +- .../enums/IntegrationAuthFlowEnumTest.java | 61 +- .../enums/IntegrationGroupEnumTest.java | 61 +- .../entity/enums/LaunchModeEnumTest.java | 48 +- .../entity/enums/LogLevelTest.java | 173 +- .../enums/ProjectAttributeEnumTest.java | 65 +- .../entity/enums/ProjectTypeTest.java | 61 +- .../entity/enums/StatusEnumTest.java | 61 +- .../entity/enums/TestItemIssueGroupTest.java | 72 +- .../entity/enums/TestItemTypeEnumTest.java | 110 +- .../converter/AnalyzerModeConverterTest.java | 33 +- .../converter/AttributeConverterTest.java | 43 +- .../converter/LogLevelConverterTest.java | 58 +- .../converter/ProjectRoleConverterTest.java | 29 +- .../converter/ProjectTypeConverterTest.java | 29 +- .../converter/UserTypeConverterTest.java | 29 +- .../entity/filter/ObjectTypeTest.java | 67 +- .../plugin/PluginFileExtensionTest.java | 60 +- .../entity/project/ProjectRoleTest.java | 101 +- .../entity/project/ProjectUtilsTest.java | 704 +++-- .../project/email/ProjectInfoWidgetTest.java | 52 +- .../entity/project/email/SendCaseTest.java | 67 +- .../entity/user/UserRoleTest.java | 66 +- .../entity/user/UserTypeTest.java | 61 +- .../filesystem/DataEncoderTest.java | 103 +- .../filesystem/FilePathGeneratorTest.java | 48 +- .../filesystem/LocalDataStoreTest.java | 100 +- .../distributed/s3/S3DataStoreTest.java | 89 +- .../util/WidgetSortUtilsTest.java | 56 +- .../db/fill/attributes/attributes-fill.sql | 3 +- .../dashboard-widget-fill.sql | 52 +- .../db/fill/data-store/data-store-fill.sql | 12 +- .../db/fill/integration/integrations-fill.sql | 2 +- .../db/fill/issue-type/issue-type-fill.sql | 3 +- .../resources/db/fill/issue/issue-fill.sql | 6 +- .../resources/db/fill/item/items-fill.sql | 12 +- .../db/fill/item/items-with-nested-steps.sql | 250 +- .../resources/db/fill/launch/launch-fill.sql | 24 +- .../db/fill/launch/launch-filtering-data.sql | 21 +- .../db/fill/pattern/pattern-fill.sql | 15 +- .../db/fill/project/expired-project-fill.sql | 12 +- .../db/fill/sendercase/sender-case-fill.sql | 6 +- .../db/fill/shareable/shareable-fill.sql | 279 +- .../resources/db/fill/ticket/ticket-fill.sql | 9 +- .../db/fill/user-bid/user-bid-fill.sql | 9 +- .../migration/V001003__test_project_init.sql | 81 +- .../db/migration/V001004__items_init.sql | 193 +- .../V001005__widget_content_init.sql | 223 +- .../db/migration/V001006__launches_init.sql | 65 +- .../migration/V001007__integration_type.sql | 9 +- src/test/resources/logback-test.xml | 22 +- .../resources/test-application.properties | 2 - 558 files changed, 57032 insertions(+), 53195 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a434d86bc..bc3e84e6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,56 +3,71 @@ # Unreleased ### New Features -* Added `datastore.minio.bucketPrefix` and `datastore.minio.defaultBucketName` configuration properties + +* Added `datastore.minio.bucketPrefix` and `datastore.minio.defaultBucketName` configuration + properties ## 3.2.1 + ##### Released: XXX 2017 ### Bugfixes -* reportportal/reportportal#170 - Test run breaks with unclassified error (jbehave) #170 +* reportportal/reportportal#170 - Test run breaks with unclassified error (jbehave) #170 ## 3.2 + ##### Released: XXX 2017 ### New Features + * EPMRPP-26429/EPMRPP-26263 - Added possibility to get all latest launches * EPMRPP-26416 - Add possibility to use a 'dot' symbol in login of user ### Bug Fixes + * EPMRPP-29167 - Statistics for deleted elements with custom defect types are still present -* EPMRPP-29337 - Widgets with Latest Launches ON include statistics for launches with In Progress status +* EPMRPP-29337 - Widgets with Latest Launches ON include statistics for launches with In Progress + status * EPMRPP-29320 - Unclassified error for Latest Launches view selected in case no results ## 3.0 + ##### Released: XXX 2017 ### BugFixes + * EPMRPP-23564 - GET shared dashboard request does not contain 'description' parameter * EPMRPP-24914 - Item with investigated defect type only is not included in scope of analysis -* EPMRPP-24539 - Do not take into account items with No Defect type in analysis of following launches +* EPMRPP-24539 - Do not take into account items with No Defect type in analysis of following + launches * EPMRPP-25408 - No Defect items are included in scope of analysis in case item has ticket - ## 2.7.0 + ##### Released: 28 November 2016 ### BugFixes -* EPMRPP-21206 - Update personal project defaults +* EPMRPP-21206 - Update personal project defaults ## 2.6.1 + ##### Released: 30 September 2016 ### New Features + * Added GitHub auth support * Added Personal Spaces support ### BugFixes + * Fixed issue with Launches cascade delete ## 2.6.0 + ##### Released: 16 September 2016 ### New Features + * Initial release to Public Maven Repositories diff --git a/README.md b/README.md index 3b3bbdc5f..4479015c5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # commons-dao + [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![stackoverflow](https://img.shields.io/badge/reportportal-stackoverflow-orange.svg?style=flat)](http://stackoverflow.com/questions/tagged/reportportal) diff --git a/build.gradle b/build.gradle index 306f45920..e18fe8e81 100644 --- a/build.gradle +++ b/build.gradle @@ -100,7 +100,7 @@ dependencies { testCompile 'org.springframework.boot:spring-boot-starter-test' testCompile 'org.flywaydb.flyway-test-extensions:flyway-spring-test:6.1.0' - + } dependencyCheck { diff --git a/src/main/java/com/epam/ta/reportportal/ApplicationContextAwareFactoryBean.java b/src/main/java/com/epam/ta/reportportal/ApplicationContextAwareFactoryBean.java index eac08e896..7c51534fe 100644 --- a/src/main/java/com/epam/ta/reportportal/ApplicationContextAwareFactoryBean.java +++ b/src/main/java/com/epam/ta/reportportal/ApplicationContextAwareFactoryBean.java @@ -25,89 +25,88 @@ import org.springframework.context.ApplicationContextAware; /** - * {@link FactoryBean} with access to {@link ApplicationContext} with lazy - * initialization + * {@link FactoryBean} with access to {@link ApplicationContext} with lazy initialization * * @param - type of bean * @author Andrei Varabyeu */ -public abstract class ApplicationContextAwareFactoryBean implements FactoryBean, ApplicationContextAware, InitializingBean { +public abstract class ApplicationContextAwareFactoryBean implements FactoryBean, + ApplicationContextAware, InitializingBean { - /** - * Application context holder - */ - private ApplicationContext applicationContext; + /** + * Application context holder + */ + private ApplicationContext applicationContext; - /** - * Supplier of bean to be created - */ - private Supplier beanSupplier; + /** + * Supplier of bean to be created + */ + private Supplier beanSupplier; - /** - * Whether is bean to be creates going to be singleton - */ - private boolean singleton = true; + /** + * Whether is bean to be creates going to be singleton + */ + private boolean singleton = true; - /* - * (non-Javadoc) - * - * @see - * org.springframework.context.ApplicationContextAware#setApplicationContext - * (org.springframework.context.ApplicationContext) - */ - @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - this.applicationContext = applicationContext; - } + /* + * (non-Javadoc) + * + * @see org.springframework.beans.factory.FactoryBean#getObject() + */ + @Override + public T getObject() throws Exception { + return beanSupplier.get(); + } - /* - * (non-Javadoc) - * - * @see org.springframework.beans.factory.FactoryBean#getObject() - */ - @Override - public T getObject() throws Exception { - return beanSupplier.get(); - } + /* + * (non-Javadoc) + * + * @see org.springframework.beans.factory.FactoryBean#isSingleton() + */ + @Override + public boolean isSingleton() { + return this.singleton; + } - /* - * (non-Javadoc) - * - * @see org.springframework.beans.factory.FactoryBean#isSingleton() - */ - @Override - public boolean isSingleton() { - return this.singleton; - } + public void setSingleton(boolean singleton) { + this.singleton = singleton; + } - public void setSingleton(boolean singleton) { - this.singleton = singleton; - } + /** + * Instantiates supplier for bean to be created. This mades possible lazy-initialization + */ + @Override + public void afterPropertiesSet() throws Exception { + Supplier supplier = this::createInstance; - /** - * Instantiates supplier for bean to be created. This mades possible - * lazy-initialization - */ - @Override - public void afterPropertiesSet() throws Exception { - Supplier supplier = this::createInstance; + this.beanSupplier = isSingleton() ? Suppliers.memoize(supplier) : supplier; + } - this.beanSupplier = isSingleton() ? Suppliers.memoize(supplier) : supplier; - } + protected ApplicationContext getApplicationContext() { + return applicationContext; + } - protected ApplicationContext getApplicationContext() { - return applicationContext; - } + /* + * (non-Javadoc) + * + * @see + * org.springframework.context.ApplicationContextAware#setApplicationContext + * (org.springframework.context.ApplicationContext) + */ + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + this.applicationContext = applicationContext; + } - /** - * Template method that subclasses must override to construct the object - * returned by this factory. - *

- * Invoked on initialization of this FactoryBean in case of a singleton; - * else, on each {@link #getObject()} call. - * - * @return the object returned by this factory - * @see #getObject() - */ - protected abstract T createInstance(); + /** + * Template method that subclasses must override to construct the object returned by this + * factory. + *

+ * Invoked on initialization of this FactoryBean in case of a singleton; else, on each + * {@link #getObject()} call. + * + * @return the object returned by this factory + * @see #getObject() + */ + protected abstract T createInstance(); } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/binary/AttachmentBinaryDataService.java b/src/main/java/com/epam/ta/reportportal/binary/AttachmentBinaryDataService.java index cec525d02..70fe65624 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/AttachmentBinaryDataService.java +++ b/src/main/java/com/epam/ta/reportportal/binary/AttachmentBinaryDataService.java @@ -20,22 +20,22 @@ import com.epam.ta.reportportal.commons.ReportPortalUser; import com.epam.ta.reportportal.entity.attachment.AttachmentMetaInfo; import com.epam.ta.reportportal.entity.attachment.BinaryData; -import org.springframework.web.multipart.MultipartFile; - import java.util.Optional; +import org.springframework.web.multipart.MultipartFile; /** * @author Ihar Kahadouski */ public interface AttachmentBinaryDataService { - Optional saveAttachment(AttachmentMetaInfo attachmentMetaInfo, MultipartFile file); + Optional saveAttachment(AttachmentMetaInfo attachmentMetaInfo, + MultipartFile file); - void saveFileAndAttachToLog(MultipartFile file, AttachmentMetaInfo attachmentMetaInfo); + void saveFileAndAttachToLog(MultipartFile file, AttachmentMetaInfo attachmentMetaInfo); - void attachToLog(BinaryDataMetaInfo binaryDataMetaInfo, AttachmentMetaInfo attachmentMetaInfo); + void attachToLog(BinaryDataMetaInfo binaryDataMetaInfo, AttachmentMetaInfo attachmentMetaInfo); - BinaryData load(Long fileId, ReportPortalUser.ProjectDetails projectDetails); + BinaryData load(Long fileId, ReportPortalUser.ProjectDetails projectDetails); - void delete(String fileId); + void delete(String fileId); } diff --git a/src/main/java/com/epam/ta/reportportal/binary/CreateLogAttachmentService.java b/src/main/java/com/epam/ta/reportportal/binary/CreateLogAttachmentService.java index 940fd2573..7e931cdf4 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/CreateLogAttachmentService.java +++ b/src/main/java/com/epam/ta/reportportal/binary/CreateLogAttachmentService.java @@ -32,16 +32,17 @@ @Transactional public class CreateLogAttachmentService { - private final LogRepository logRepository; + private final LogRepository logRepository; - @Autowired - public CreateLogAttachmentService(LogRepository logRepository) { - this.logRepository = logRepository; - } + @Autowired + public CreateLogAttachmentService(LogRepository logRepository) { + this.logRepository = logRepository; + } - public void create(Attachment attachment, Long logId) { - Log log = logRepository.findById(logId).orElseThrow(() -> new ReportPortalException(ErrorType.LOG_NOT_FOUND, logId)); - log.setAttachment(attachment); - logRepository.save(log); - } + public void create(Attachment attachment, Long logId) { + Log log = logRepository.findById(logId) + .orElseThrow(() -> new ReportPortalException(ErrorType.LOG_NOT_FOUND, logId)); + log.setAttachment(attachment); + logRepository.save(log); + } } diff --git a/src/main/java/com/epam/ta/reportportal/binary/DataStoreService.java b/src/main/java/com/epam/ta/reportportal/binary/DataStoreService.java index c98a2029f..62512258e 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/DataStoreService.java +++ b/src/main/java/com/epam/ta/reportportal/binary/DataStoreService.java @@ -24,11 +24,11 @@ */ public interface DataStoreService { - String save(String fileName, InputStream data); + String save(String fileName, InputStream data); - String saveThumbnail(String fileName, InputStream data); + String saveThumbnail(String fileName, InputStream data); - void delete(String fileId); + void delete(String fileId); - Optional load(String fileId); + Optional load(String fileId); } diff --git a/src/main/java/com/epam/ta/reportportal/binary/UserBinaryDataService.java b/src/main/java/com/epam/ta/reportportal/binary/UserBinaryDataService.java index 16385a311..76d53202b 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/UserBinaryDataService.java +++ b/src/main/java/com/epam/ta/reportportal/binary/UserBinaryDataService.java @@ -18,22 +18,21 @@ import com.epam.ta.reportportal.entity.attachment.BinaryData; import com.epam.ta.reportportal.entity.user.User; -import org.springframework.web.multipart.MultipartFile; - import java.io.InputStream; +import org.springframework.web.multipart.MultipartFile; /** * @author Ihar Kahadouski */ public interface UserBinaryDataService { - void saveUserPhoto(User user, MultipartFile file); + void saveUserPhoto(User user, MultipartFile file); - void saveUserPhoto(User user, BinaryData binaryData); + void saveUserPhoto(User user, BinaryData binaryData); - void saveUserPhoto(User user, InputStream inputStream, String contentType); + void saveUserPhoto(User user, InputStream inputStream, String contentType); - BinaryData loadUserPhoto(User user, boolean loadThumbnail); + BinaryData loadUserPhoto(User user, boolean loadThumbnail); - public void deleteUserPhoto(User user); + public void deleteUserPhoto(User user); } diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java b/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java index fcdeb0e3f..256b38cf9 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java @@ -16,6 +16,11 @@ package com.epam.ta.reportportal.binary.impl; +import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.isContentTypePresent; +import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.resolveExtension; +import static com.epam.ta.reportportal.commons.validation.BusinessRule.expect; +import static com.epam.ta.reportportal.commons.validation.Suppliers.formattedSupplier; + import com.epam.reportportal.commons.ContentTypeResolver; import com.epam.ta.reportportal.binary.AttachmentBinaryDataService; import com.epam.ta.reportportal.binary.CreateLogAttachmentService; @@ -29,6 +34,13 @@ import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.filesystem.FilePathGenerator; import com.epam.ta.reportportal.ws.model.ErrorType; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Paths; +import java.util.Optional; +import java.util.function.Predicate; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,140 +50,141 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.commons.CommonsMultipartFile; -import java.io.*; -import java.nio.file.Paths; -import java.util.Optional; -import java.util.function.Predicate; - -import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.*; -import static com.epam.ta.reportportal.commons.validation.BusinessRule.expect; -import static com.epam.ta.reportportal.commons.validation.Suppliers.formattedSupplier; - /** * @author Ihar Kahadouski */ @Service public class AttachmentBinaryDataServiceImpl implements AttachmentBinaryDataService { - private static final Logger LOGGER = LoggerFactory.getLogger(AttachmentBinaryDataServiceImpl.class); - - private final ContentTypeResolver contentTypeResolver; - - private final FilePathGenerator filePathGenerator; - - private final DataStoreService dataStoreService; - - private final AttachmentRepository attachmentRepository; - - private final CreateLogAttachmentService createLogAttachmentService; - - @Autowired - public AttachmentBinaryDataServiceImpl(ContentTypeResolver contentTypeResolver, FilePathGenerator filePathGenerator, - @Qualifier("attachmentDataStoreService") DataStoreService dataStoreService, AttachmentRepository attachmentRepository, - CreateLogAttachmentService createLogAttachmentService) { - this.contentTypeResolver = contentTypeResolver; - this.filePathGenerator = filePathGenerator; - this.dataStoreService = dataStoreService; - this.attachmentRepository = attachmentRepository; - this.createLogAttachmentService = createLogAttachmentService; - } - - @Override - public Optional saveAttachment(AttachmentMetaInfo metaInfo, MultipartFile file) { - Optional result = Optional.empty(); - try (InputStream inputStream = file.getInputStream(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { - inputStream.transferTo(outputStream); - String contentType = resolveContentType(file.getContentType(), outputStream); - String fileName = resolveFileName(metaInfo, file, contentType); - - String commonPath = filePathGenerator.generate(metaInfo); - String targetPath = Paths.get(commonPath, fileName).toString(); - - String fileId; - try (ByteArrayInputStream copy = new ByteArrayInputStream(outputStream.toByteArray())) { - fileId = dataStoreService.save(targetPath, copy); - } - - result = Optional.of(BinaryDataMetaInfo.BinaryDataMetaInfoBuilder.aBinaryDataMetaInfo() - .withFileId(fileId) - .withContentType(contentType) - .withFileSize(file.getSize()) - .build()); - } catch (IOException e) { - LOGGER.error("Unable to save binary data", e); - } finally { - if (file instanceof CommonsMultipartFile) { - ((CommonsMultipartFile) file).getFileItem().delete(); - } - } - return result; - } - - private String resolveFileName(AttachmentMetaInfo metaInfo, MultipartFile file, String contentType) { - String extension = resolveExtension(contentType).orElse(resolveExtension(true, file)); - return metaInfo.getLogUuid() + "-" + file.getName() + extension; - } - - @Override - public void saveFileAndAttachToLog(MultipartFile file, AttachmentMetaInfo attachmentMetaInfo) { - saveAttachment(attachmentMetaInfo, file).ifPresent(it -> attachToLog(it, attachmentMetaInfo)); - } - - @Override - public void attachToLog(BinaryDataMetaInfo binaryDataMetaInfo, AttachmentMetaInfo attachmentMetaInfo) { - try { - Attachment attachment = new Attachment(); - attachment.setFileId(binaryDataMetaInfo.getFileId()); - attachment.setThumbnailId(binaryDataMetaInfo.getThumbnailFileId()); - attachment.setContentType(binaryDataMetaInfo.getContentType()); - attachment.setFileSize(binaryDataMetaInfo.getFileSize()); - - attachment.setProjectId(attachmentMetaInfo.getProjectId()); - attachment.setLaunchId(attachmentMetaInfo.getLaunchId()); - attachment.setItemId(attachmentMetaInfo.getItemId()); - attachment.setCreationDate(attachmentMetaInfo.getCreationDate()); - - createLogAttachmentService.create(attachment, attachmentMetaInfo.getLogId()); - } catch (Exception exception) { - LOGGER.error("Cannot save log to database, remove files ", exception); - - dataStoreService.delete(binaryDataMetaInfo.getFileId()); - dataStoreService.delete(binaryDataMetaInfo.getThumbnailFileId()); - throw exception; - } - } - - @Override - public BinaryData load(Long fileId, ReportPortalUser.ProjectDetails projectDetails) { - try { - Attachment attachment = attachmentRepository.findById(fileId) - .orElseThrow(() -> new ReportPortalException(ErrorType.ATTACHMENT_NOT_FOUND, fileId)); - InputStream data = dataStoreService.load(attachment.getFileId()) - .orElseThrow(() -> new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, fileId)); - expect(attachment.getProjectId(), Predicate.isEqual(projectDetails.getProjectId())).verify(ErrorType.ACCESS_DENIED, - formattedSupplier("You are not assigned to project '{}'", projectDetails.getProjectName()) - ); - return new BinaryData(attachment.getContentType(), (long) data.available(), data); - } catch (IOException e) { - LOGGER.error("Unable to load binary data", e); - throw new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, "Unable to load binary data"); - } - } - - @Override - public void delete(String fileId) { - if (StringUtils.isNotEmpty(fileId)) { - dataStoreService.delete(fileId); - attachmentRepository.findByFileId(fileId).ifPresent(attachmentRepository::delete); - } - } - - private String resolveContentType(String contentType, ByteArrayOutputStream outputStream) throws IOException { - if (isContentTypePresent(contentType)) { - return contentType; - } - try (ByteArrayInputStream copy = new ByteArrayInputStream(outputStream.toByteArray())) { - return contentTypeResolver.detectContentType(copy); - } - } + private static final Logger LOGGER = LoggerFactory.getLogger( + AttachmentBinaryDataServiceImpl.class); + + private final ContentTypeResolver contentTypeResolver; + + private final FilePathGenerator filePathGenerator; + + private final DataStoreService dataStoreService; + + private final AttachmentRepository attachmentRepository; + + private final CreateLogAttachmentService createLogAttachmentService; + + @Autowired + public AttachmentBinaryDataServiceImpl(ContentTypeResolver contentTypeResolver, + FilePathGenerator filePathGenerator, + @Qualifier("attachmentDataStoreService") DataStoreService dataStoreService, + AttachmentRepository attachmentRepository, + CreateLogAttachmentService createLogAttachmentService) { + this.contentTypeResolver = contentTypeResolver; + this.filePathGenerator = filePathGenerator; + this.dataStoreService = dataStoreService; + this.attachmentRepository = attachmentRepository; + this.createLogAttachmentService = createLogAttachmentService; + } + + @Override + public Optional saveAttachment(AttachmentMetaInfo metaInfo, + MultipartFile file) { + Optional result = Optional.empty(); + try (InputStream inputStream = file.getInputStream(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { + inputStream.transferTo(outputStream); + String contentType = resolveContentType(file.getContentType(), outputStream); + String fileName = resolveFileName(metaInfo, file, contentType); + + String commonPath = filePathGenerator.generate(metaInfo); + String targetPath = Paths.get(commonPath, fileName).toString(); + + String fileId; + try (ByteArrayInputStream copy = new ByteArrayInputStream(outputStream.toByteArray())) { + fileId = dataStoreService.save(targetPath, copy); + } + + result = Optional.of(BinaryDataMetaInfo.BinaryDataMetaInfoBuilder.aBinaryDataMetaInfo() + .withFileId(fileId) + .withContentType(contentType) + .withFileSize(file.getSize()) + .build()); + } catch (IOException e) { + LOGGER.error("Unable to save binary data", e); + } finally { + if (file instanceof CommonsMultipartFile) { + ((CommonsMultipartFile) file).getFileItem().delete(); + } + } + return result; + } + + private String resolveFileName(AttachmentMetaInfo metaInfo, MultipartFile file, + String contentType) { + String extension = resolveExtension(contentType).orElse(resolveExtension(true, file)); + return metaInfo.getLogUuid() + "-" + file.getName() + extension; + } + + @Override + public void saveFileAndAttachToLog(MultipartFile file, AttachmentMetaInfo attachmentMetaInfo) { + saveAttachment(attachmentMetaInfo, file).ifPresent(it -> attachToLog(it, attachmentMetaInfo)); + } + + @Override + public void attachToLog(BinaryDataMetaInfo binaryDataMetaInfo, + AttachmentMetaInfo attachmentMetaInfo) { + try { + Attachment attachment = new Attachment(); + attachment.setFileId(binaryDataMetaInfo.getFileId()); + attachment.setThumbnailId(binaryDataMetaInfo.getThumbnailFileId()); + attachment.setContentType(binaryDataMetaInfo.getContentType()); + attachment.setFileSize(binaryDataMetaInfo.getFileSize()); + + attachment.setProjectId(attachmentMetaInfo.getProjectId()); + attachment.setLaunchId(attachmentMetaInfo.getLaunchId()); + attachment.setItemId(attachmentMetaInfo.getItemId()); + attachment.setCreationDate(attachmentMetaInfo.getCreationDate()); + + createLogAttachmentService.create(attachment, attachmentMetaInfo.getLogId()); + } catch (Exception exception) { + LOGGER.error("Cannot save log to database, remove files ", exception); + + dataStoreService.delete(binaryDataMetaInfo.getFileId()); + dataStoreService.delete(binaryDataMetaInfo.getThumbnailFileId()); + throw exception; + } + } + + @Override + public BinaryData load(Long fileId, ReportPortalUser.ProjectDetails projectDetails) { + try { + Attachment attachment = attachmentRepository.findById(fileId) + .orElseThrow(() -> new ReportPortalException(ErrorType.ATTACHMENT_NOT_FOUND, fileId)); + InputStream data = dataStoreService.load(attachment.getFileId()) + .orElseThrow( + () -> new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, fileId)); + expect(attachment.getProjectId(), Predicate.isEqual(projectDetails.getProjectId())).verify( + ErrorType.ACCESS_DENIED, + formattedSupplier("You are not assigned to project '{}'", projectDetails.getProjectName()) + ); + return new BinaryData(attachment.getContentType(), (long) data.available(), data); + } catch (IOException e) { + LOGGER.error("Unable to load binary data", e); + throw new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, + "Unable to load binary data"); + } + } + + @Override + public void delete(String fileId) { + if (StringUtils.isNotEmpty(fileId)) { + dataStoreService.delete(fileId); + attachmentRepository.findByFileId(fileId).ifPresent(attachmentRepository::delete); + } + } + + private String resolveContentType(String contentType, ByteArrayOutputStream outputStream) + throws IOException { + if (isContentTypePresent(contentType)) { + return contentType; + } + try (ByteArrayInputStream copy = new ByteArrayInputStream(outputStream.toByteArray())) { + return contentTypeResolver.detectContentType(copy); + } + } } diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreService.java b/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreService.java index 009b00a21..290585010 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreService.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreService.java @@ -19,39 +19,38 @@ import com.epam.reportportal.commons.Thumbnailator; import com.epam.ta.reportportal.filesystem.DataEncoder; import com.epam.ta.reportportal.filesystem.DataStore; +import java.io.IOException; +import java.io.InputStream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; -import java.io.IOException; -import java.io.InputStream; - /** * @author Ihar Kahadouski */ @Service("attachmentDataStoreService") public class AttachmentDataStoreService extends CommonDataStoreService { - private static final Logger LOGGER = LoggerFactory.getLogger(AttachmentDataStoreService.class); - - private final Thumbnailator thumbnailator; - - @Autowired - public AttachmentDataStoreService(DataStore dataStore, DataEncoder dataEncoder, - @Qualifier("attachmentThumbnailator") Thumbnailator thumbnailator) { - super(dataStore, dataEncoder); - this.thumbnailator = thumbnailator; - } - - @Override - public String saveThumbnail(String fileName, InputStream data) { - try { - return dataEncoder.encode(dataStore.save(fileName, thumbnailator.createThumbnail(data))); - } catch (IOException e) { - LOGGER.error("Thumbnail is not created for file [{}]. Error:\n{}", fileName, e); - } - return null; - } + private static final Logger LOGGER = LoggerFactory.getLogger(AttachmentDataStoreService.class); + + private final Thumbnailator thumbnailator; + + @Autowired + public AttachmentDataStoreService(DataStore dataStore, DataEncoder dataEncoder, + @Qualifier("attachmentThumbnailator") Thumbnailator thumbnailator) { + super(dataStore, dataEncoder); + this.thumbnailator = thumbnailator; + } + + @Override + public String saveThumbnail(String fileName, InputStream data) { + try { + return dataEncoder.encode(dataStore.save(fileName, thumbnailator.createThumbnail(data))); + } catch (IOException e) { + LOGGER.error("Thumbnail is not created for file [{}]. Error:\n{}", fileName, e); + } + return null; + } } diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreService.java b/src/main/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreService.java index dc0ce8e6e..03c5ef21e 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreService.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreService.java @@ -16,44 +16,43 @@ package com.epam.ta.reportportal.binary.impl; +import static java.util.Optional.ofNullable; + import com.epam.ta.reportportal.binary.DataStoreService; import com.epam.ta.reportportal.filesystem.DataEncoder; import com.epam.ta.reportportal.filesystem.DataStore; - import java.io.InputStream; import java.util.Optional; -import static java.util.Optional.ofNullable; - /** * @author Ihar Kahadouski */ public abstract class CommonDataStoreService implements DataStoreService { - protected DataStore dataStore; + protected DataStore dataStore; - protected DataEncoder dataEncoder; + protected DataEncoder dataEncoder; - CommonDataStoreService(DataStore dataStore, DataEncoder dataEncoder) { - this.dataStore = dataStore; - this.dataEncoder = dataEncoder; - } + CommonDataStoreService(DataStore dataStore, DataEncoder dataEncoder) { + this.dataStore = dataStore; + this.dataEncoder = dataEncoder; + } - @Override - public String save(String fileName, InputStream data) { - return dataEncoder.encode(dataStore.save(fileName, data)); - } + @Override + public String save(String fileName, InputStream data) { + return dataEncoder.encode(dataStore.save(fileName, data)); + } - @Override - public abstract String saveThumbnail(String fileName, InputStream data); + @Override + public abstract String saveThumbnail(String fileName, InputStream data); - @Override - public void delete(String fileId) { - dataStore.delete(dataEncoder.decode(fileId)); - } + @Override + public void delete(String fileId) { + dataStore.delete(dataEncoder.decode(fileId)); + } - @Override - public Optional load(String fileId) { - return ofNullable(dataStore.load(dataEncoder.decode(fileId))); - } + @Override + public Optional load(String fileId) { + return ofNullable(dataStore.load(dataEncoder.decode(fileId))); + } } diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/DataStoreUtils.java b/src/main/java/com/epam/ta/reportportal/binary/impl/DataStoreUtils.java index 325c13af2..e719bbfd9 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/DataStoreUtils.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/DataStoreUtils.java @@ -17,6 +17,9 @@ package com.epam.ta.reportportal.binary.impl; import com.google.common.base.Strings; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Optional; import org.apache.commons.io.FilenameUtils; import org.apache.tika.mime.MimeTypeException; import org.apache.tika.mime.MimeTypes; @@ -25,54 +28,47 @@ import org.springframework.http.MediaType; import org.springframework.web.multipart.MultipartFile; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Optional; - /** * @author Ihar Kahadouski */ public class DataStoreUtils { - private static final Logger LOGGER = LoggerFactory.getLogger(DataStoreUtils.class); - - private static final String THUMBNAIL_PREFIX = "thumbnail-"; - - private static final String DOT = "."; - - static final String ROOT_USER_PHOTO_DIR = "users"; - - static final String ATTACHMENT_CONTENT_TYPE = "attachmentContentType"; + static final String ROOT_USER_PHOTO_DIR = "users"; + static final String ATTACHMENT_CONTENT_TYPE = "attachmentContentType"; + private static final Logger LOGGER = LoggerFactory.getLogger(DataStoreUtils.class); + private static final String THUMBNAIL_PREFIX = "thumbnail-"; + private static final String DOT = "."; - private DataStoreUtils() { - //static only - } + private DataStoreUtils() { + //static only + } - public static Optional resolveExtension(String contentType) { - Optional result = Optional.empty(); - try { - result = Optional.of(MimeTypes.getDefaultMimeTypes().forName(contentType).getExtension()); - } catch (MimeTypeException e) { - LOGGER.warn("Cannot resolve file extension from content type '{}'", contentType, e); - } - return result; - } + public static Optional resolveExtension(String contentType) { + Optional result = Optional.empty(); + try { + result = Optional.of(MimeTypes.getDefaultMimeTypes().forName(contentType).getExtension()); + } catch (MimeTypeException e) { + LOGGER.warn("Cannot resolve file extension from content type '{}'", contentType, e); + } + return result; + } - public static String resolveExtension(boolean prefixDot, MultipartFile file) { - final String extension = FilenameUtils.getExtension(file.getOriginalFilename()); - return prefixDot ? DOT + extension : extension; - } + public static String resolveExtension(boolean prefixDot, MultipartFile file) { + final String extension = FilenameUtils.getExtension(file.getOriginalFilename()); + return prefixDot ? DOT + extension : extension; + } - public static String buildThumbnailFileName(String commonPath, String fileName) { - Path thumbnailTargetPath = Paths.get(commonPath, THUMBNAIL_PREFIX.concat(fileName)); - return thumbnailTargetPath.toString(); - } + public static String buildThumbnailFileName(String commonPath, String fileName) { + Path thumbnailTargetPath = Paths.get(commonPath, THUMBNAIL_PREFIX.concat(fileName)); + return thumbnailTargetPath.toString(); + } - public static boolean isImage(String contentType) { - return contentType != null && contentType.contains("image"); - } + public static boolean isImage(String contentType) { + return contentType != null && contentType.contains("image"); + } - public static boolean isContentTypePresent(String contentType) { - return !Strings.isNullOrEmpty(contentType) && !MediaType.APPLICATION_OCTET_STREAM_VALUE.equals(contentType); - } + public static boolean isContentTypePresent(String contentType) { + return !Strings.isNullOrEmpty(contentType) && !MediaType.APPLICATION_OCTET_STREAM_VALUE.equals( + contentType); + } } diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/UserBinaryDataServiceImpl.java b/src/main/java/com/epam/ta/reportportal/binary/impl/UserBinaryDataServiceImpl.java index a60315fe4..79b09ce22 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/UserBinaryDataServiceImpl.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/UserBinaryDataServiceImpl.java @@ -16,6 +16,11 @@ package com.epam.ta.reportportal.binary.impl; +import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.ATTACHMENT_CONTENT_TYPE; +import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.ROOT_USER_PHOTO_DIR; +import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.buildThumbnailFileName; +import static java.util.Optional.ofNullable; + import com.epam.ta.reportportal.binary.DataStoreService; import com.epam.ta.reportportal.binary.UserBinaryDataService; import com.epam.ta.reportportal.entity.Metadata; @@ -24,6 +29,11 @@ import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.ws.model.ErrorType; import com.google.common.collect.Maps; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Paths; +import java.util.Optional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -34,96 +44,94 @@ import org.springframework.util.StreamUtils; import org.springframework.web.multipart.MultipartFile; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Paths; -import java.util.Optional; - -import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.*; -import static java.util.Optional.ofNullable; - /** * @author Ihar Kahadouski */ @Service public class UserBinaryDataServiceImpl implements UserBinaryDataService { - private static final Logger LOGGER = LoggerFactory.getLogger(UserBinaryDataServiceImpl.class); - - private DataStoreService dataStoreService; - - private static final String DEFAULT_USER_PHOTO = "image/defaultAvatar.png"; + private static final Logger LOGGER = LoggerFactory.getLogger(UserBinaryDataServiceImpl.class); + private static final String DEFAULT_USER_PHOTO = "image/defaultAvatar.png"; + private DataStoreService dataStoreService; - @Autowired - public UserBinaryDataServiceImpl(@Qualifier("userDataStoreService") DataStoreService dataStoreService) { - this.dataStoreService = dataStoreService; - } + @Autowired + public UserBinaryDataServiceImpl( + @Qualifier("userDataStoreService") DataStoreService dataStoreService) { + this.dataStoreService = dataStoreService; + } - @Override - public void saveUserPhoto(User user, MultipartFile file) { - try { - saveUserPhoto(user, file.getInputStream(), file.getContentType()); - } catch (IOException e) { - LOGGER.error("Unable to save user photo", e); - throw new ReportPortalException(ErrorType.BINARY_DATA_CANNOT_BE_SAVED, e); - } - } + @Override + public void saveUserPhoto(User user, MultipartFile file) { + try { + saveUserPhoto(user, file.getInputStream(), file.getContentType()); + } catch (IOException e) { + LOGGER.error("Unable to save user photo", e); + throw new ReportPortalException(ErrorType.BINARY_DATA_CANNOT_BE_SAVED, e); + } + } - @Override - public void saveUserPhoto(User user, BinaryData binaryData) { - saveUserPhoto(user, binaryData.getInputStream(), binaryData.getContentType()); - } + @Override + public void saveUserPhoto(User user, BinaryData binaryData) { + saveUserPhoto(user, binaryData.getInputStream(), binaryData.getContentType()); + } - @Override - public void saveUserPhoto(User user, InputStream inputStream, String contentType) { - try { - byte[] data = StreamUtils.copyToByteArray(inputStream); - try (InputStream userPhotoCopy = new ByteArrayInputStream(data); InputStream thumbnailCopy = new ByteArrayInputStream(data)) { - user.setAttachment(dataStoreService.save(Paths.get(ROOT_USER_PHOTO_DIR, user.getLogin()).toString(), userPhotoCopy)); - user.setAttachmentThumbnail(dataStoreService.saveThumbnail(buildThumbnailFileName(ROOT_USER_PHOTO_DIR, user.getLogin()), - thumbnailCopy - )); - } - ofNullable(user.getMetadata()).orElseGet(() -> new Metadata(Maps.newHashMap())) - .getMetadata() - .put(ATTACHMENT_CONTENT_TYPE, contentType); - } catch (IOException e) { - LOGGER.error("Unable to save user photo", e); - } - } + @Override + public void saveUserPhoto(User user, InputStream inputStream, String contentType) { + try { + byte[] data = StreamUtils.copyToByteArray(inputStream); + try (InputStream userPhotoCopy = new ByteArrayInputStream( + data); InputStream thumbnailCopy = new ByteArrayInputStream(data)) { + user.setAttachment( + dataStoreService.save(Paths.get(ROOT_USER_PHOTO_DIR, user.getLogin()).toString(), + userPhotoCopy)); + user.setAttachmentThumbnail(dataStoreService.saveThumbnail( + buildThumbnailFileName(ROOT_USER_PHOTO_DIR, user.getLogin()), + thumbnailCopy + )); + } + ofNullable(user.getMetadata()).orElseGet(() -> new Metadata(Maps.newHashMap())) + .getMetadata() + .put(ATTACHMENT_CONTENT_TYPE, contentType); + } catch (IOException e) { + LOGGER.error("Unable to save user photo", e); + } + } - @Override - public BinaryData loadUserPhoto(User user, boolean loadThumbnail) { - Optional fileId = ofNullable(loadThumbnail ? user.getAttachmentThumbnail() : user.getAttachment()); - InputStream data; - String contentType; - try { - if (fileId.isPresent()) { - contentType = (String) user.getMetadata().getMetadata().get(ATTACHMENT_CONTENT_TYPE); - data = dataStoreService.load(fileId.get()) - .orElseThrow(() -> new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, fileId.get())); - } else { - data = new ClassPathResource(DEFAULT_USER_PHOTO).getInputStream(); - contentType = MimeTypeUtils.IMAGE_JPEG_VALUE; - } - return new BinaryData(contentType, (long) data.available(), data); - } catch (IOException e) { - LOGGER.error("Unable to load user photo", e); - throw new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, "Unable to load user photo"); - } - } + @Override + public BinaryData loadUserPhoto(User user, boolean loadThumbnail) { + Optional fileId = ofNullable( + loadThumbnail ? user.getAttachmentThumbnail() : user.getAttachment()); + InputStream data; + String contentType; + try { + if (fileId.isPresent()) { + contentType = (String) user.getMetadata().getMetadata().get(ATTACHMENT_CONTENT_TYPE); + data = dataStoreService.load(fileId.get()) + .orElseThrow(() -> new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, + fileId.get())); + } else { + data = new ClassPathResource(DEFAULT_USER_PHOTO).getInputStream(); + contentType = MimeTypeUtils.IMAGE_JPEG_VALUE; + } + return new BinaryData(contentType, (long) data.available(), data); + } catch (IOException e) { + LOGGER.error("Unable to load user photo", e); + throw new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, + "Unable to load user photo"); + } + } - @Override - public void deleteUserPhoto(User user) { - ofNullable(user.getAttachment()).ifPresent(fileId -> { - dataStoreService.delete(fileId); - user.setAttachment(null); - Optional.ofNullable(user.getAttachmentThumbnail()).ifPresent(thumbnailId -> { - dataStoreService.delete(thumbnailId); - user.setAttachmentThumbnail(null); - }); - ofNullable(user.getMetadata()).ifPresent(metadata -> metadata.getMetadata().remove(ATTACHMENT_CONTENT_TYPE)); - }); - } + @Override + public void deleteUserPhoto(User user) { + ofNullable(user.getAttachment()).ifPresent(fileId -> { + dataStoreService.delete(fileId); + user.setAttachment(null); + Optional.ofNullable(user.getAttachmentThumbnail()).ifPresent(thumbnailId -> { + dataStoreService.delete(thumbnailId); + user.setAttachmentThumbnail(null); + }); + ofNullable(user.getMetadata()).ifPresent( + metadata -> metadata.getMetadata().remove(ATTACHMENT_CONTENT_TYPE)); + }); + } } diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/UserDataStoreService.java b/src/main/java/com/epam/ta/reportportal/binary/impl/UserDataStoreService.java index 435c52a48..6e9363c91 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/UserDataStoreService.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/UserDataStoreService.java @@ -19,39 +19,38 @@ import com.epam.reportportal.commons.Thumbnailator; import com.epam.ta.reportportal.filesystem.DataEncoder; import com.epam.ta.reportportal.filesystem.DataStore; +import java.io.IOException; +import java.io.InputStream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; -import java.io.IOException; -import java.io.InputStream; - /** * @author Ihar Kahadouski */ @Service("userDataStoreService") public class UserDataStoreService extends CommonDataStoreService { - private static final Logger LOGGER = LoggerFactory.getLogger(UserDataStoreService.class); - - private final Thumbnailator thumbnailator; - - @Autowired - public UserDataStoreService(DataStore dataStore, DataEncoder dataEncoder, - @Qualifier("userPhotoThumbnailator") Thumbnailator thumbnailator) { - super(dataStore, dataEncoder); - this.thumbnailator = thumbnailator; - } - - @Override - public String saveThumbnail(String fileName, InputStream data) { - try { - return dataEncoder.encode(dataStore.save(fileName, thumbnailator.createThumbnail(data))); - } catch (IOException e) { - LOGGER.error("Thumbnail is not created for file [{}]. Error:\n{}", fileName, e); - } - return null; - } + private static final Logger LOGGER = LoggerFactory.getLogger(UserDataStoreService.class); + + private final Thumbnailator thumbnailator; + + @Autowired + public UserDataStoreService(DataStore dataStore, DataEncoder dataEncoder, + @Qualifier("userPhotoThumbnailator") Thumbnailator thumbnailator) { + super(dataStore, dataEncoder); + this.thumbnailator = thumbnailator; + } + + @Override + public String saveThumbnail(String fileName, InputStream data) { + try { + return dataEncoder.encode(dataStore.save(fileName, thumbnailator.createThumbnail(data))); + } catch (IOException e) { + LOGGER.error("Thumbnail is not created for file [{}]. Error:\n{}", fileName, e); + } + return null; + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/BinaryDataMetaInfo.java b/src/main/java/com/epam/ta/reportportal/commons/BinaryDataMetaInfo.java index 2665b0056..72e628dca 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/BinaryDataMetaInfo.java +++ b/src/main/java/com/epam/ta/reportportal/commons/BinaryDataMetaInfo.java @@ -18,97 +18,99 @@ public class BinaryDataMetaInfo { - private String fileId; - - private String thumbnailFileId; - - private String contentType; - - private long fileSize; - - public BinaryDataMetaInfo() { - } - - /** - * Object to hold information about saved file. - * - * @param fileId - * @param thumbnailFileId - */ - public BinaryDataMetaInfo(String fileId, String thumbnailFileId, String contentType, long fileSize) { - this.fileId = fileId; - this.thumbnailFileId = thumbnailFileId; - this.contentType = contentType; - this.fileSize = fileSize; - } - - public String getFileId() { - return fileId; - } - - public String getThumbnailFileId() { - return thumbnailFileId; - } - - public String getContentType() { - return contentType; - } - - public long getFileSize() { - return fileSize; - } - - public void setFileId(String fileId) { - this.fileId = fileId; - } - - public void setThumbnailFileId(String thumbnailFileId) { - this.thumbnailFileId = thumbnailFileId; - } - - public void setContentType(String contentType) { - this.contentType = contentType; - } - - public void setFileSize(long fileSize) { - this.fileSize = fileSize; - } - - public static final class BinaryDataMetaInfoBuilder { - private String fileId; - private String thumbnailFileId; - private String contentType; - private long fileSize; - - private BinaryDataMetaInfoBuilder() { - } - - public static BinaryDataMetaInfoBuilder aBinaryDataMetaInfo() { - return new BinaryDataMetaInfoBuilder(); - } - - public BinaryDataMetaInfoBuilder withFileId(String fileId) { - this.fileId = fileId; - return this; - } - - public BinaryDataMetaInfoBuilder withThumbnailFileId(String thumbnailFileId) { - this.thumbnailFileId = thumbnailFileId; - return this; - } - - public BinaryDataMetaInfoBuilder withContentType(String contentType) { - this.contentType = contentType; - return this; - } - - public BinaryDataMetaInfoBuilder withFileSize(long fileSize) { - this.fileSize = fileSize; - return this; - } - - public BinaryDataMetaInfo build() { - return new BinaryDataMetaInfo(fileId, thumbnailFileId, contentType, fileSize); - } - } + private String fileId; + + private String thumbnailFileId; + + private String contentType; + + private long fileSize; + + public BinaryDataMetaInfo() { + } + + /** + * Object to hold information about saved file. + * + * @param fileId + * @param thumbnailFileId + */ + public BinaryDataMetaInfo(String fileId, String thumbnailFileId, String contentType, + long fileSize) { + this.fileId = fileId; + this.thumbnailFileId = thumbnailFileId; + this.contentType = contentType; + this.fileSize = fileSize; + } + + public String getFileId() { + return fileId; + } + + public void setFileId(String fileId) { + this.fileId = fileId; + } + + public String getThumbnailFileId() { + return thumbnailFileId; + } + + public void setThumbnailFileId(String thumbnailFileId) { + this.thumbnailFileId = thumbnailFileId; + } + + public String getContentType() { + return contentType; + } + + public void setContentType(String contentType) { + this.contentType = contentType; + } + + public long getFileSize() { + return fileSize; + } + + public void setFileSize(long fileSize) { + this.fileSize = fileSize; + } + + public static final class BinaryDataMetaInfoBuilder { + + private String fileId; + private String thumbnailFileId; + private String contentType; + private long fileSize; + + private BinaryDataMetaInfoBuilder() { + } + + public static BinaryDataMetaInfoBuilder aBinaryDataMetaInfo() { + return new BinaryDataMetaInfoBuilder(); + } + + public BinaryDataMetaInfoBuilder withFileId(String fileId) { + this.fileId = fileId; + return this; + } + + public BinaryDataMetaInfoBuilder withThumbnailFileId(String thumbnailFileId) { + this.thumbnailFileId = thumbnailFileId; + return this; + } + + public BinaryDataMetaInfoBuilder withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + public BinaryDataMetaInfoBuilder withFileSize(long fileSize) { + this.fileSize = fileSize; + return this; + } + + public BinaryDataMetaInfo build() { + return new BinaryDataMetaInfo(fileId, thumbnailFileId, contentType, fileSize); + } + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/EntityUtils.java b/src/main/java/com/epam/ta/reportportal/commons/EntityUtils.java index df9340d44..6c83b4d20 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/EntityUtils.java +++ b/src/main/java/com/epam/ta/reportportal/commons/EntityUtils.java @@ -16,60 +16,59 @@ package com.epam.ta.reportportal.commons; -import com.google.common.base.Preconditions; +import static com.google.common.base.Strings.isNullOrEmpty; +import static java.util.Optional.ofNullable; +import com.google.common.base.Preconditions; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.util.Date; import java.util.function.Function; import java.util.function.Predicate; -import static com.google.common.base.Strings.isNullOrEmpty; -import static java.util.Optional.ofNullable; - /** - * Some useful utils for working with entities
- * For example: usernames, project names, tags, etc. + * Some useful utils for working with entities
For example: usernames, project names, tags, + * etc. * * @author Andrei Varabyeu */ public class EntityUtils { - private static final String OLD_SEPARATOR = ","; - private static final String NEW_SEPARATOR = "_"; - - private EntityUtils() { - //static only - } - - public static final Function TO_LOCAL_DATE_TIME = date -> ofNullable(date).map(d -> LocalDateTime.ofInstant(d.toInstant(), - ZoneOffset.UTC - )).orElse(null); - - public static final Function TO_DATE = localDateTime -> ofNullable(localDateTime).map(l -> Date.from(l.atZone( - ZoneOffset.UTC).toInstant())).orElse(null); - - /** - * Remove leading and trailing spaces from list of string - */ - public static final Function TRIM_FUNCTION = it -> ofNullable(it).map(String::trim).orElse(null); - public static final Predicate NOT_EMPTY = s -> !isNullOrEmpty(s); + public static final Function TO_LOCAL_DATE_TIME = date -> ofNullable( + date).map(d -> LocalDateTime.ofInstant(d.toInstant(), + ZoneOffset.UTC + )).orElse(null); + public static final Function TO_DATE = localDateTime -> ofNullable( + localDateTime).map(l -> Date.from(l.atZone( + ZoneOffset.UTC).toInstant())).orElse(null); + /** + * Remove leading and trailing spaces from list of string + */ + public static final Function TRIM_FUNCTION = it -> ofNullable(it).map( + String::trim).orElse(null); + public static final Predicate NOT_EMPTY = s -> !isNullOrEmpty(s); + private static final String OLD_SEPARATOR = ","; + private static final String NEW_SEPARATOR = "_"; + /** + * Convert declined symbols on allowed for WS and UI + */ + public static final Function REPLACE_SEPARATOR = s -> ofNullable(s).map( + it -> it.replace(OLD_SEPARATOR, NEW_SEPARATOR)) + .orElse(null); - /** - * Convert declined symbols on allowed for WS and UI - */ - public static final Function REPLACE_SEPARATOR = s -> ofNullable(s).map(it -> it.replace(OLD_SEPARATOR, NEW_SEPARATOR)) - .orElse(null); + private EntityUtils() { + //static only + } - /** - * Normalize any ID for database ID fields, for example - * - * @param id ID to normalize - * @return String - */ + /** + * Normalize any ID for database ID fields, for example + * + * @param id ID to normalize + * @return String + */ - public static String normalizeId(String id) { - return Preconditions.checkNotNull(id, "Provided value shouldn't be null").toLowerCase(); - } + public static String normalizeId(String id) { + return Preconditions.checkNotNull(id, "Provided value shouldn't be null").toLowerCase(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/JsonbAwarePostgresDialect.java b/src/main/java/com/epam/ta/reportportal/commons/JsonbAwarePostgresDialect.java index 2f5ecf890..31775a66c 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/JsonbAwarePostgresDialect.java +++ b/src/main/java/com/epam/ta/reportportal/commons/JsonbAwarePostgresDialect.java @@ -16,9 +16,8 @@ package com.epam.ta.reportportal.commons; -import org.hibernate.dialect.PostgreSQL95Dialect; - import java.sql.Types; +import org.hibernate.dialect.PostgreSQL95Dialect; /** * Postgres Dialect aware of JSON/JSONB types @@ -27,8 +26,8 @@ */ public class JsonbAwarePostgresDialect extends PostgreSQL95Dialect { - public JsonbAwarePostgresDialect() { - super(); - this.registerColumnType(Types.JAVA_OBJECT, "json"); - } + public JsonbAwarePostgresDialect() { + super(); + this.registerColumnType(Types.JAVA_OBJECT, "json"); + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/JsonbUserType.java b/src/main/java/com/epam/ta/reportportal/commons/JsonbUserType.java index 90e13c8e7..808855d89 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/JsonbUserType.java +++ b/src/main/java/com/epam/ta/reportportal/commons/JsonbUserType.java @@ -21,6 +21,16 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Types; import org.hibernate.HibernateException; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.type.SerializationException; @@ -28,114 +38,115 @@ import org.postgresql.util.PGobject; import org.springframework.util.ObjectUtils; -import java.io.*; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Types; - /** * @author Pavel Bortnik */ public abstract class JsonbUserType implements UserType { - private final ObjectMapper mapper; - - public JsonbUserType() { - mapper = new ObjectMapper(); - mapper.registerModule(new JavaTimeModule()); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - } - - @Override - public int[] sqlTypes() { - return new int[] { Types.JAVA_OBJECT }; - } - - @Override - abstract public Class returnedClass(); - - @Override - public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) - throws HibernateException, SQLException { - if (rs.getObject(names[0]) == null) { - return null; - } - PGobject pgObject = (PGobject) rs.getObject(names[0]); - try { - return mapper.readValue(pgObject.getValue(), this.returnedClass()); - } catch (Exception e) { - throw new ReportPortalException("Failed to convert String to Invoice: " + e.getMessage(), e); - } - } - - @Override - public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) - throws HibernateException, SQLException { - if (value == null) { - st.setNull(index, Types.OTHER); - return; - } - try { - PGobject pGobject = new PGobject(); - pGobject.setType("jsonb"); - pGobject.setValue(mapper.writeValueAsString(value)); - st.setObject(index, pGobject); - } catch (final Exception ex) { - throw new ReportPortalException("Failed to convert Invoice to String: " + ex.getMessage(), ex); - } - - } - - @Override - public Object deepCopy(Object value) throws HibernateException { - try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bos)) { - // use serialization to create a deep copy - - oos.writeObject(value); - oos.flush(); - - ByteArrayInputStream bais = new ByteArrayInputStream(bos.toByteArray()); - return new ObjectInputStream(bais).readObject(); - } catch (ClassNotFoundException | IOException ex) { - throw new HibernateException(ex); - } - } - - @Override - public Serializable disassemble(Object value) throws HibernateException { - Object copy = deepCopy(value); - if (copy instanceof Serializable) { - return (Serializable) copy; - } - throw new SerializationException(String.format("Cannot serialize '%s', %s is not Serializable.", value, value.getClass()), null); - } - - @Override - public Object assemble(Serializable cached, Object owner) throws HibernateException { - return deepCopy(cached); - } - - @Override - public Object replace(Object original, Object target, Object owner) throws HibernateException { - return deepCopy(original); - } - - @Override - @JsonIgnore - public boolean isMutable() { - return true; - } - - @Override - public int hashCode(Object x) throws HibernateException { - if (x == null) { - return 0; - } - return x.hashCode(); - } - - @Override - public boolean equals(Object x, Object y) throws HibernateException { - return ObjectUtils.nullSafeEquals(x, y); - } + + private final ObjectMapper mapper; + + public JsonbUserType() { + mapper = new ObjectMapper(); + mapper.registerModule(new JavaTimeModule()); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + } + + @Override + public int[] sqlTypes() { + return new int[]{Types.JAVA_OBJECT}; + } + + @Override + abstract public Class returnedClass(); + + @Override + public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, + Object owner) + throws HibernateException, SQLException { + if (rs.getObject(names[0]) == null) { + return null; + } + PGobject pgObject = (PGobject) rs.getObject(names[0]); + try { + return mapper.readValue(pgObject.getValue(), this.returnedClass()); + } catch (Exception e) { + throw new ReportPortalException("Failed to convert String to Invoice: " + e.getMessage(), e); + } + } + + @Override + public void nullSafeSet(PreparedStatement st, Object value, int index, + SharedSessionContractImplementor session) + throws HibernateException, SQLException { + if (value == null) { + st.setNull(index, Types.OTHER); + return; + } + try { + PGobject pGobject = new PGobject(); + pGobject.setType("jsonb"); + pGobject.setValue(mapper.writeValueAsString(value)); + st.setObject(index, pGobject); + } catch (final Exception ex) { + throw new ReportPortalException("Failed to convert Invoice to String: " + ex.getMessage(), + ex); + } + + } + + @Override + public Object deepCopy(Object value) throws HibernateException { + try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream( + bos)) { + // use serialization to create a deep copy + + oos.writeObject(value); + oos.flush(); + + ByteArrayInputStream bais = new ByteArrayInputStream(bos.toByteArray()); + return new ObjectInputStream(bais).readObject(); + } catch (ClassNotFoundException | IOException ex) { + throw new HibernateException(ex); + } + } + + @Override + public Serializable disassemble(Object value) throws HibernateException { + Object copy = deepCopy(value); + if (copy instanceof Serializable) { + return (Serializable) copy; + } + throw new SerializationException( + String.format("Cannot serialize '%s', %s is not Serializable.", value, value.getClass()), + null); + } + + @Override + public Object assemble(Serializable cached, Object owner) throws HibernateException { + return deepCopy(cached); + } + + @Override + public Object replace(Object original, Object target, Object owner) throws HibernateException { + return deepCopy(original); + } + + @Override + @JsonIgnore + public boolean isMutable() { + return true; + } + + @Override + public int hashCode(Object x) throws HibernateException { + if (x == null) { + return 0; + } + return x.hashCode(); + } + + @Override + public boolean equals(Object x, Object y) throws HibernateException { + return ObjectUtils.nullSafeEquals(x, y); + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/MoreCollectors.java b/src/main/java/com/epam/ta/reportportal/commons/MoreCollectors.java index c497cd7bf..c6bb7e052 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/MoreCollectors.java +++ b/src/main/java/com/epam/ta/reportportal/commons/MoreCollectors.java @@ -28,14 +28,15 @@ */ public final class MoreCollectors { - private MoreCollectors() { - //static only - } + private MoreCollectors() { + //static only + } - public static Collector> toLinkedMap(Function keyMapper, - Function valueMapper) { - return Collectors.toMap(keyMapper, valueMapper, (u, v) -> { - throw new IllegalStateException(String.format("Duplicate key %s", u)); - }, LinkedHashMap::new); - } + public static Collector> toLinkedMap( + Function keyMapper, + Function valueMapper) { + return Collectors.toMap(keyMapper, valueMapper, (u, v) -> { + throw new IllegalStateException(String.format("Duplicate key %s", u)); + }, LinkedHashMap::new); + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/Preconditions.java b/src/main/java/com/epam/ta/reportportal/commons/Preconditions.java index 6899dcef0..367ff61d4 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/Preconditions.java +++ b/src/main/java/com/epam/ta/reportportal/commons/Preconditions.java @@ -16,20 +16,23 @@ package com.epam.ta.reportportal.commons; +import static com.epam.ta.reportportal.commons.EntityUtils.TO_LOCAL_DATE_TIME; +import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; + import com.epam.ta.reportportal.commons.querygen.FilterCondition; import com.epam.ta.reportportal.entity.enums.StatusEnum; import com.epam.ta.reportportal.entity.project.ProjectRole; import com.epam.ta.reportportal.ws.model.ErrorType; import com.epam.ta.reportportal.ws.model.launch.Mode; -import org.apache.commons.lang3.ArrayUtils; - import java.time.LocalDateTime; -import java.util.*; +import java.util.Collection; +import java.util.Date; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; import java.util.function.Predicate; import java.util.stream.StreamSupport; - -import static com.epam.ta.reportportal.commons.EntityUtils.TO_LOCAL_DATE_TIME; -import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; +import org.apache.commons.lang3.ArrayUtils; /** * Several validation checks @@ -38,65 +41,64 @@ */ public class Preconditions { - private Preconditions() { - - } - - /** - * grabbed from {@link UUID#fromString(String)} - */ - public static final Predicate IS_UUID = uuid -> uuid.split("-").length == 5; - - public static final Predicate> NOT_EMPTY_COLLECTION = t -> null != t && !t.isEmpty(); - - public static final Predicate> IS_PRESENT = Optional::isPresent; - - public static Predicate sameTimeOrLater(final LocalDateTime than) { - com.google.common.base.Preconditions.checkNotNull(than, ErrorType.BAD_REQUEST_ERROR); - return date -> { - LocalDateTime localDateTime = TO_LOCAL_DATE_TIME.apply(date); - return localDateTime.isAfter(than) || localDateTime.isEqual(than); - }; - } - - public static Predicate statusIn(final StatusEnum... statuses) { - return input -> ArrayUtils.contains(statuses, input); - } - - public static final Predicate HAS_ANY_MODE = hasMode(null); - - public static Predicate hasMode(final Mode mode) { - return condition -> (CRITERIA_LAUNCH_MODE.equalsIgnoreCase(condition.getSearchCriteria())) && (mode == null || mode.name() - .equalsIgnoreCase(condition.getValue())); - } - - /** - * Checks whether iterable contains elements matchers provided predicate - * - * @param filter - * @return - */ - public static Predicate> contains(final Predicate filter) { - return iterable -> StreamSupport.stream(iterable.spliterator(), false).anyMatch(filter); - } - - /** - * Checks whether map contains provided key - * - * @param key - * @return - */ - public static Predicate> containsKey(final K key) { - return map -> null != map && map.containsKey(key); - } - - /** - * Check whether user (principal) has enough role level - * - * @param principalRole - * @return - */ - public static Predicate isLevelEnough(final ProjectRole principalRole) { - return principalRole::sameOrHigherThan; - } + /** + * grabbed from {@link UUID#fromString(String)} + */ + public static final Predicate IS_UUID = uuid -> uuid.split("-").length == 5; + public static final Predicate> NOT_EMPTY_COLLECTION = t -> null != t + && !t.isEmpty(); + public static final Predicate> IS_PRESENT = Optional::isPresent; + public static final Predicate HAS_ANY_MODE = hasMode(null); + + private Preconditions() { + + } + + public static Predicate sameTimeOrLater(final LocalDateTime than) { + com.google.common.base.Preconditions.checkNotNull(than, ErrorType.BAD_REQUEST_ERROR); + return date -> { + LocalDateTime localDateTime = TO_LOCAL_DATE_TIME.apply(date); + return localDateTime.isAfter(than) || localDateTime.isEqual(than); + }; + } + + public static Predicate statusIn(final StatusEnum... statuses) { + return input -> ArrayUtils.contains(statuses, input); + } + + public static Predicate hasMode(final Mode mode) { + return condition -> (CRITERIA_LAUNCH_MODE.equalsIgnoreCase(condition.getSearchCriteria())) && ( + mode == null || mode.name() + .equalsIgnoreCase(condition.getValue())); + } + + /** + * Checks whether iterable contains elements matchers provided predicate + * + * @param filter + * @return + */ + public static Predicate> contains(final Predicate filter) { + return iterable -> StreamSupport.stream(iterable.spliterator(), false).anyMatch(filter); + } + + /** + * Checks whether map contains provided key + * + * @param key + * @return + */ + public static Predicate> containsKey(final K key) { + return map -> null != map && map.containsKey(key); + } + + /** + * Check whether user (principal) has enough role level + * + * @param principalRole + * @return + */ + public static Predicate isLevelEnough(final ProjectRole principalRole) { + return principalRole::sameOrHigherThan; + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/Predicates.java b/src/main/java/com/epam/ta/reportportal/commons/Predicates.java index 8d8ffa392..7c4fcb7ca 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/Predicates.java +++ b/src/main/java/com/epam/ta/reportportal/commons/Predicates.java @@ -28,48 +28,49 @@ */ public class Predicates { - private Predicates() { - //statics only - } + private Predicates() { + //statics only + } - public static Predicate notNull() { - return Objects::nonNull; - } + public static Predicate notNull() { + return Objects::nonNull; + } - public static Predicate isNull() { - return Objects::isNull; - } + public static Predicate isNull() { + return Objects::isNull; + } - public static Predicate equalTo(T target) { - return (target == null) ? Predicates.isNull() : t -> t.equals(target); - } + public static Predicate equalTo(T target) { + return (target == null) ? Predicates.isNull() : t -> t.equals(target); + } - public static Predicate not(Predicate predicate) { - return item -> !predicate.test(item); - } + public static Predicate not(Predicate predicate) { + return item -> !predicate.test(item); + } - public static Predicate in(Collection target) { - return target::contains; - } + public static Predicate in(Collection target) { + return target::contains; + } - public static Predicate alwaysFalse() { - return t -> false; - } + public static Predicate alwaysFalse() { + return t -> false; + } - public static Predicate and(List> components) { - return t -> components.stream().allMatch(predicate -> predicate.test(t)); - } + public static Predicate and(List> components) { + return t -> components.stream().allMatch(predicate -> predicate.test(t)); + } - @SuppressWarnings("unchecked") - public static Predicate or(Predicate... components) { - return t -> Stream.of(components).anyMatch(predicate -> predicate.test(t)); - } + @SuppressWarnings("unchecked") + public static Predicate or(Predicate... components) { + return t -> Stream.of(components).anyMatch(predicate -> predicate.test(t)); + } - public static Predicate or(Iterable> components) { - return t -> StreamSupport.stream(components.spliterator(), false).anyMatch(predicate -> predicate.test(t)); - } + public static Predicate or(Iterable> components) { + return t -> StreamSupport.stream(components.spliterator(), false) + .anyMatch(predicate -> predicate.test(t)); + } - public static Predicate> isPresent() { - return Optional::isPresent; - } + public static Predicate> isPresent() { + return Optional::isPresent; + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/ReportPortalUser.java b/src/main/java/com/epam/ta/reportportal/commons/ReportPortalUser.java index 4dc9c1c49..7dc6c7106 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/ReportPortalUser.java +++ b/src/main/java/com/epam/ta/reportportal/commons/ReportPortalUser.java @@ -16,23 +16,22 @@ package com.epam.ta.reportportal.commons; +import static java.util.Optional.ofNullable; + import com.epam.ta.reportportal.entity.project.ProjectRole; import com.epam.ta.reportportal.entity.user.UserRole; import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.ws.model.ErrorType; import com.fasterxml.jackson.annotation.JsonProperty; -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.SimpleGrantedAuthority; -import org.springframework.security.core.userdetails.User; -import org.springframework.security.core.userdetails.UserDetails; - import java.io.Serializable; import java.util.Collection; import java.util.Collections; import java.util.Map; import java.util.stream.Collectors; - -import static java.util.Optional.ofNullable; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.core.userdetails.UserDetails; /** * ReportPortal user representation @@ -41,197 +40,203 @@ */ public class ReportPortalUser extends User { - private Long userId; + private Long userId; + + private UserRole userRole; + + private String email; + + private Map projectDetails; + + private ReportPortalUser(String username, String password, + Collection authorities, Long userId, + UserRole role, Map projectDetails, String email) { + super(username, password, authorities); + this.userId = userId; + this.userRole = role; + this.projectDetails = projectDetails; + this.email = email; + } + + public static ReportPortalUserBuilder userBuilder() { + return new ReportPortalUserBuilder(); + } - private UserRole userRole; + public Long getUserId() { + return userId; + } - private String email; + public void setUserId(Long userId) { + this.userId = userId; + } - private Map projectDetails; + public UserRole getUserRole() { + return userRole; + } - private ReportPortalUser(String username, String password, Collection authorities, Long userId, - UserRole role, Map projectDetails, String email) { - super(username, password, authorities); - this.userId = userId; - this.userRole = role; - this.projectDetails = projectDetails; - this.email = email; - } + public void setUserRole(UserRole userRole) { + this.userRole = userRole; + } - public Long getUserId() { - return userId; - } + public String getEmail() { + return email; + } - public void setUserId(Long userId) { - this.userId = userId; - } + public void setEmail(String email) { + this.email = email; + } - public UserRole getUserRole() { - return userRole; - } + public Map getProjectDetails() { + return projectDetails; + } - public void setUserRole(UserRole userRole) { - this.userRole = userRole; - } + public void setProjectDetails(Map projectDetails) { + this.projectDetails = projectDetails; + } - public String getEmail() { - return email; - } + public static class ProjectDetails implements Serializable { - public void setEmail(String email) { - this.email = email; - } + @JsonProperty(value = "id") + private Long projectId; + + @JsonProperty(value = "name") + private String projectName; - public Map getProjectDetails() { - return projectDetails; - } + @JsonProperty("role") + private ProjectRole projectRole; - public void setProjectDetails(Map projectDetails) { - this.projectDetails = projectDetails; - } - - public static ReportPortalUserBuilder userBuilder() { - return new ReportPortalUserBuilder(); - } - - public static class ProjectDetails implements Serializable { - - @JsonProperty(value = "id") - private Long projectId; - - @JsonProperty(value = "name") - private String projectName; - - @JsonProperty("role") - private ProjectRole projectRole; - - public ProjectDetails(Long projectId, String projectName, ProjectRole projectRole) { - this.projectId = projectId; - this.projectName = projectName; - this.projectRole = projectRole; - } - - public Long getProjectId() { - return projectId; - } - - public String getProjectName() { - return projectName; - } - - public ProjectRole getProjectRole() { - return projectRole; - } - - public static ProjectDetailsBuilder builder() { - return new ProjectDetailsBuilder(); - } - - public static class ProjectDetailsBuilder { - private Long projectId; - private String projectName; - private ProjectRole projectRole; - - private ProjectDetailsBuilder() { - } - - public ProjectDetailsBuilder withProjectId(Long projectId) { - this.projectId = projectId; - return this; - } - - public ProjectDetailsBuilder withProjectName(String projectName) { - this.projectName = projectName; - return this; - } - - public ProjectDetailsBuilder withProjectRole(String projectRole) { - this.projectRole = ProjectRole.forName(projectRole) - .orElseThrow(() -> new ReportPortalException(ErrorType.ROLE_NOT_FOUND, projectRole)); - return this; - } - - public ProjectDetails build() { - return new ProjectDetails(projectId, projectName, projectRole); - } - } - } - - public static class ReportPortalUserBuilder { - private String username; - private String password; - private Long userId; - private UserRole userRole; - private String email; - private Map projectDetails; - private Collection authorities; - - private ReportPortalUserBuilder() { - - } - - public ReportPortalUserBuilder withUserName(String userName) { - this.username = userName; - return this; - } - - public ReportPortalUserBuilder withPassword(String password) { - this.password = password; - return this; - } - - public ReportPortalUserBuilder withAuthorities(Collection authorities) { - this.authorities = authorities; - return this; - } - - public ReportPortalUserBuilder withUserDetails(UserDetails userDetails) { - this.username = userDetails.getUsername(); - this.password = userDetails.getPassword(); - this.authorities = userDetails.getAuthorities(); - return this; - } - - public ReportPortalUserBuilder withUserId(Long userId) { - this.userId = userId; - return this; - } - - public ReportPortalUserBuilder withUserRole(UserRole userRole) { - this.userRole = userRole; - return this; - } - - public ReportPortalUserBuilder withEmail(String email) { - this.email = email; - return this; - } - - public ReportPortalUserBuilder withProjectDetails(Map projectDetails) { - this.projectDetails = projectDetails; - return this; - } - - public ReportPortalUser fromUser(com.epam.ta.reportportal.entity.user.User user) { - this.username = user.getLogin(); - this.email = user.getPassword(); - this.userId = user.getId(); - this.userRole = user.getRole(); - this.password = ofNullable(user.getPassword()).orElse(""); - this.authorities = Collections.singletonList(new SimpleGrantedAuthority(user.getRole().getAuthority())); - this.projectDetails = user.getProjects().stream().collect(Collectors.toMap( - it -> it.getProject().getName(), - it -> ProjectDetails.builder() - .withProjectId(it.getProject().getId()) - .withProjectRole(it.getProjectRole().name()) - .withProjectName(it.getProject().getName()) - .build() - )); - return build(); - } - - public ReportPortalUser build() { - return new ReportPortalUser(username, password, authorities, userId, userRole, projectDetails, email); - } - } + public ProjectDetails(Long projectId, String projectName, ProjectRole projectRole) { + this.projectId = projectId; + this.projectName = projectName; + this.projectRole = projectRole; + } + + public static ProjectDetailsBuilder builder() { + return new ProjectDetailsBuilder(); + } + + public Long getProjectId() { + return projectId; + } + + public String getProjectName() { + return projectName; + } + + public ProjectRole getProjectRole() { + return projectRole; + } + + public static class ProjectDetailsBuilder { + + private Long projectId; + private String projectName; + private ProjectRole projectRole; + + private ProjectDetailsBuilder() { + } + + public ProjectDetailsBuilder withProjectId(Long projectId) { + this.projectId = projectId; + return this; + } + + public ProjectDetailsBuilder withProjectName(String projectName) { + this.projectName = projectName; + return this; + } + + public ProjectDetailsBuilder withProjectRole(String projectRole) { + this.projectRole = ProjectRole.forName(projectRole) + .orElseThrow(() -> new ReportPortalException(ErrorType.ROLE_NOT_FOUND, projectRole)); + return this; + } + + public ProjectDetails build() { + return new ProjectDetails(projectId, projectName, projectRole); + } + } + } + + public static class ReportPortalUserBuilder { + + private String username; + private String password; + private Long userId; + private UserRole userRole; + private String email; + private Map projectDetails; + private Collection authorities; + + private ReportPortalUserBuilder() { + + } + + public ReportPortalUserBuilder withUserName(String userName) { + this.username = userName; + return this; + } + + public ReportPortalUserBuilder withPassword(String password) { + this.password = password; + return this; + } + + public ReportPortalUserBuilder withAuthorities( + Collection authorities) { + this.authorities = authorities; + return this; + } + + public ReportPortalUserBuilder withUserDetails(UserDetails userDetails) { + this.username = userDetails.getUsername(); + this.password = userDetails.getPassword(); + this.authorities = userDetails.getAuthorities(); + return this; + } + + public ReportPortalUserBuilder withUserId(Long userId) { + this.userId = userId; + return this; + } + + public ReportPortalUserBuilder withUserRole(UserRole userRole) { + this.userRole = userRole; + return this; + } + + public ReportPortalUserBuilder withEmail(String email) { + this.email = email; + return this; + } + + public ReportPortalUserBuilder withProjectDetails(Map projectDetails) { + this.projectDetails = projectDetails; + return this; + } + + public ReportPortalUser fromUser(com.epam.ta.reportportal.entity.user.User user) { + this.username = user.getLogin(); + this.email = user.getPassword(); + this.userId = user.getId(); + this.userRole = user.getRole(); + this.password = ofNullable(user.getPassword()).orElse(""); + this.authorities = Collections.singletonList( + new SimpleGrantedAuthority(user.getRole().getAuthority())); + this.projectDetails = user.getProjects().stream().collect(Collectors.toMap( + it -> it.getProject().getName(), + it -> ProjectDetails.builder() + .withProjectId(it.getProject().getId()) + .withProjectRole(it.getProjectRole().name()) + .withProjectName(it.getProject().getName()) + .build() + )); + return build(); + } + + public ReportPortalUser build() { + return new ReportPortalUser(username, password, authorities, userId, userRole, projectDetails, + email); + } + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/accessible/Accessible.java b/src/main/java/com/epam/ta/reportportal/commons/accessible/Accessible.java index 850ecd2ab..6343c085e 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/accessible/Accessible.java +++ b/src/main/java/com/epam/ta/reportportal/commons/accessible/Accessible.java @@ -26,22 +26,22 @@ */ public class Accessible { - private final Object object; + private final Object object; - private Accessible(Object object) { - this.object = object; + private Accessible(Object object) { + this.object = object; - } + } - public AccessibleMethod method(Method m) { - return new AccessibleMethod(object, m); - } + public static Accessible on(Object object) { + return new Accessible(object); + } - public AccessibleField field(Field f) { - return new AccessibleField(object, f); - } + public AccessibleMethod method(Method m) { + return new AccessibleMethod(object, m); + } - public static Accessible on(Object object) { - return new Accessible(object); - } + public AccessibleField field(Field f) { + return new AccessibleField(object, f); + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/commons/accessible/AccessibleField.java b/src/main/java/com/epam/ta/reportportal/commons/accessible/AccessibleField.java index 9150bb24f..240664310 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/accessible/AccessibleField.java +++ b/src/main/java/com/epam/ta/reportportal/commons/accessible/AccessibleField.java @@ -25,41 +25,41 @@ */ public class AccessibleField { - private final Field f; - private final Object bean; + private final Field f; + private final Object bean; - AccessibleField(Object bean, Field f) { - this.bean = bean; - this.f = f; - } + AccessibleField(Object bean, Field f) { + this.bean = bean; + this.f = f; + } - public Class getType() { - return this.f.getType(); - } + public Class getType() { + return this.f.getType(); + } - public void setValue(Object value) { - try { - this.f.set(this.bean, value); - } catch (IllegalAccessException accessException) { //NOSONAR - this.f.setAccessible(true); - try { - this.f.set(this.bean, value); - } catch (IllegalAccessException e) { //NOSONAR - throw new IllegalAccessError(e.getMessage()); - } - } - } + public Object getValue() { + try { + return this.f.get(this.bean); + } catch (IllegalAccessException accessException) { //NOSONAR + this.f.setAccessible(true); + try { + return this.f.get(this.bean); + } catch (IllegalAccessException e) { //NOSONAR + throw new IllegalAccessError(e.getMessage()); + } + } + } - public Object getValue() { - try { - return this.f.get(this.bean); - } catch (IllegalAccessException accessException) { //NOSONAR - this.f.setAccessible(true); - try { - return this.f.get(this.bean); - } catch (IllegalAccessException e) { //NOSONAR - throw new IllegalAccessError(e.getMessage()); - } - } - } + public void setValue(Object value) { + try { + this.f.set(this.bean, value); + } catch (IllegalAccessException accessException) { //NOSONAR + this.f.setAccessible(true); + try { + this.f.set(this.bean, value); + } catch (IllegalAccessException e) { //NOSONAR + throw new IllegalAccessError(e.getMessage()); + } + } + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/commons/accessible/AccessibleMethod.java b/src/main/java/com/epam/ta/reportportal/commons/accessible/AccessibleMethod.java index ea44c17b6..b1eb5ea04 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/accessible/AccessibleMethod.java +++ b/src/main/java/com/epam/ta/reportportal/commons/accessible/AccessibleMethod.java @@ -20,44 +20,44 @@ import java.lang.reflect.Method; /** - * Accessible method implementation. Set accessibility == true for specified - * method and can invoke methods + * Accessible method implementation. Set accessibility == true for specified method and can invoke + * methods * * @author Andrei Varabyeu */ public class AccessibleMethod { - private final Method method; - private final Object bean; - - AccessibleMethod(Object bean, Method method) { - this.bean = bean; - this.method = method; - } - - public Object invoke(Object... args) throws Throwable { - try { - return invoke(this.bean, this.method, args); - } catch (IllegalAccessException accessException) { //NOSONAR - this.method.setAccessible(true); - try { - return invoke(this.bean, this.method, args); - } catch (IllegalAccessException e) { //NOSONAR - throw new IllegalAccessError(e.getMessage()); - } - } - - } - - private Object invoke(Object bean, Method m, Object... args) throws Throwable { - try { - return m.invoke(bean, args); - } catch (IllegalArgumentException e) { - throw new RuntimeException(e); - } catch (InvocationTargetException e) { - throw e.getTargetException(); - } - - } + private final Method method; + private final Object bean; + + AccessibleMethod(Object bean, Method method) { + this.bean = bean; + this.method = method; + } + + public Object invoke(Object... args) throws Throwable { + try { + return invoke(this.bean, this.method, args); + } catch (IllegalAccessException accessException) { //NOSONAR + this.method.setAccessible(true); + try { + return invoke(this.bean, this.method, args); + } catch (IllegalAccessException e) { //NOSONAR + throw new IllegalAccessError(e.getMessage()); + } + } + + } + + private Object invoke(Object bean, Method m, Object... args) throws Throwable { + try { + return m.invoke(bean, args); + } catch (IllegalArgumentException e) { + throw new RuntimeException(e); + } catch (InvocationTargetException e) { + throw e.getTargetException(); + } + + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/CompositeFilter.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/CompositeFilter.java index eb553f675..1fa90ffd9 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/CompositeFilter.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/CompositeFilter.java @@ -16,16 +16,19 @@ package com.epam.ta.reportportal.commons.querygen; +import static org.postgresql.shaded.com.ongres.scram.common.util.Preconditions.checkArgument; + import com.epam.ta.reportportal.commons.querygen.query.QuerySupplier; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; import org.jooq.Condition; import org.jooq.Operator; import org.jooq.impl.DSL; -import java.util.*; -import java.util.stream.Collectors; - -import static org.postgresql.shaded.com.ongres.scram.common.util.Preconditions.checkArgument; - /** * Composite filter. Combines filters using {@link Operator} and builds query. * @@ -33,65 +36,69 @@ */ public class CompositeFilter implements Queryable { - private Operator operator; - private Collection filters; - private FilterTarget target; + private Operator operator; + private Collection filters; + private FilterTarget target; - public CompositeFilter(Operator operator, Collection filters) { - checkArgument(null != operator, "Operator is not specified"); - checkArgument(null != filters && !filters.isEmpty(), "Empty filter list"); - checkArgument(1 == filters.stream().map(Queryable::getTarget).distinct().count(), "Different targets"); - this.operator = operator; - this.target = filters.iterator().next().getTarget(); - this.filters = filters; - } + public CompositeFilter(Operator operator, Collection filters) { + checkArgument(null != operator, "Operator is not specified"); + checkArgument(null != filters && !filters.isEmpty(), "Empty filter list"); + checkArgument(1 == filters.stream().map(Queryable::getTarget).distinct().count(), + "Different targets"); + this.operator = operator; + this.target = filters.iterator().next().getTarget(); + this.filters = filters; + } - public CompositeFilter(Operator operator, Queryable... filters) { - this(operator, Arrays.asList(filters)); - } + public CompositeFilter(Operator operator, Queryable... filters) { + this(operator, Arrays.asList(filters)); + } - @Override - public QuerySupplier toQuery() { - QueryBuilder query = QueryBuilder.newBuilder(this.target); - Map conditions = toCondition(); - return query.addCondition(conditions.get(ConditionType.WHERE)) - .addHavingCondition(conditions.get(ConditionType.HAVING)) - .getQuerySupplier(); - } + @Override + public QuerySupplier toQuery() { + QueryBuilder query = QueryBuilder.newBuilder(this.target); + Map conditions = toCondition(); + return query.addCondition(conditions.get(ConditionType.WHERE)) + .addHavingCondition(conditions.get(ConditionType.HAVING)) + .getQuerySupplier(); + } - @Override - public Map toCondition() { - Map resultedConditions = new HashMap<>(); - for (Queryable filter : filters) { - filter.toCondition().forEach((conditionType, condition) -> { - Condition compositeCondition = resultedConditions.getOrDefault(conditionType, DSL.noCondition()); - resultedConditions.put(conditionType, DSL.condition(operator, compositeCondition, condition)); - }); - } - return resultedConditions; - } + @Override + public Map toCondition() { + Map resultedConditions = new HashMap<>(); + for (Queryable filter : filters) { + filter.toCondition().forEach((conditionType, condition) -> { + Condition compositeCondition = resultedConditions.getOrDefault(conditionType, + DSL.noCondition()); + resultedConditions.put(conditionType, + DSL.condition(operator, compositeCondition, condition)); + }); + } + return resultedConditions; + } - @Override - public FilterTarget getTarget() { - return target; - } + @Override + public FilterTarget getTarget() { + return target; + } - @Override - public List getFilterConditions() { - return filters.stream().flatMap(it -> it.getFilterConditions().stream()).collect(Collectors.toList()); - } + @Override + public List getFilterConditions() { + return filters.stream().flatMap(it -> it.getFilterConditions().stream()) + .collect(Collectors.toList()); + } - public boolean replaceSearchCriteria(FilterCondition oldCondition, FilterCondition newCondition) { - if (oldCondition == null || newCondition == null) { - return false; - } + public boolean replaceSearchCriteria(FilterCondition oldCondition, FilterCondition newCondition) { + if (oldCondition == null || newCondition == null) { + return false; + } - for (Queryable filter : filters) { - if (filter.replaceSearchCriteria(oldCondition, newCondition)) { - return true; - } - } + for (Queryable filter : filters) { + if (filter.replaceSearchCriteria(oldCondition, newCondition)) { + return true; + } + } - return false; - } + return false; + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/CompositeFilterCondition.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/CompositeFilterCondition.java index 31bb547fd..8c91b1fc1 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/CompositeFilterCondition.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/CompositeFilterCondition.java @@ -17,69 +17,70 @@ package com.epam.ta.reportportal.commons.querygen; import com.google.common.collect.Maps; -import org.jooq.Condition; -import org.jooq.Operator; -import org.jooq.impl.DSL; - import java.util.Collection; import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import org.jooq.Condition; +import org.jooq.Operator; +import org.jooq.impl.DSL; /** * @author Ivan Budayeu */ public class CompositeFilterCondition implements ConvertibleCondition { - private List conditions; + private List conditions; - private Operator operator; + private Operator operator; - public CompositeFilterCondition(List conditions, Operator operator) { - this.conditions = conditions; - this.operator = operator; - } + public CompositeFilterCondition(List conditions, Operator operator) { + this.conditions = conditions; + this.operator = operator; + } - public CompositeFilterCondition(List conditions) { - this.conditions = conditions; - this.operator = Operator.AND; - } + public CompositeFilterCondition(List conditions) { + this.conditions = conditions; + this.operator = Operator.AND; + } - @Override - public Map toCondition(FilterTarget filterTarget) { + @Override + public Map toCondition(FilterTarget filterTarget) { - Map result = Maps.newHashMapWithExpectedSize(ConditionType.values().length); + Map result = Maps.newHashMapWithExpectedSize( + ConditionType.values().length); - conditions.forEach(c -> { - Map conditionMap = c.toCondition(filterTarget); - conditionMap.forEach((key, value) -> { - Condition condition = result.getOrDefault(key, DSL.noCondition()); - result.put(key, DSL.condition(c.getOperator(), condition, value)); - }); - }); + conditions.forEach(c -> { + Map conditionMap = c.toCondition(filterTarget); + conditionMap.forEach((key, value) -> { + Condition condition = result.getOrDefault(key, DSL.noCondition()); + result.put(key, DSL.condition(c.getOperator(), condition, value)); + }); + }); - return result; - } + return result; + } - public List getConditions() { - return conditions; - } + public List getConditions() { + return conditions; + } - public void setConditions(List conditions) { - this.conditions = conditions; - } + public void setConditions(List conditions) { + this.conditions = conditions; + } - @Override - public Operator getOperator() { - return operator; - } + @Override + public Operator getOperator() { + return operator; + } - @Override - public List getAllConditions() { - return conditions.stream().map(ConvertibleCondition::getAllConditions).flatMap(Collection::stream).collect(Collectors.toList()); - } + public void setOperator(Operator operator) { + this.operator = operator; + } - public void setOperator(Operator operator) { - this.operator = operator; - } + @Override + public List getAllConditions() { + return conditions.stream().map(ConvertibleCondition::getAllConditions) + .flatMap(Collection::stream).collect(Collectors.toList()); + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/Condition.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/Condition.java index 79fa47cb7..485be6c30 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/Condition.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/Condition.java @@ -16,32 +16,41 @@ package com.epam.ta.reportportal.commons.querygen; -import com.epam.ta.reportportal.commons.Predicates; -import com.epam.ta.reportportal.ws.model.ErrorType; -import org.apache.commons.lang3.BooleanUtils; -import org.jooq.Field; -import org.jooq.Operator; -import org.jooq.impl.DSL; -import org.jooq.util.postgres.PostgresDSL; - -import java.time.ZoneOffset; -import java.time.ZonedDateTime; -import java.util.Arrays; -import java.util.Objects; -import java.util.Optional; - import static com.epam.ta.reportportal.commons.Predicates.or; -import static com.epam.ta.reportportal.commons.querygen.FilterRules.*; +import static com.epam.ta.reportportal.commons.querygen.FilterRules.countOfValues; +import static com.epam.ta.reportportal.commons.querygen.FilterRules.filterForArrayAggregation; +import static com.epam.ta.reportportal.commons.querygen.FilterRules.filterForDates; +import static com.epam.ta.reportportal.commons.querygen.FilterRules.filterForLogLevel; +import static com.epam.ta.reportportal.commons.querygen.FilterRules.filterForLtree; +import static com.epam.ta.reportportal.commons.querygen.FilterRules.filterForNumbers; +import static com.epam.ta.reportportal.commons.querygen.FilterRules.filterForString; +import static com.epam.ta.reportportal.commons.querygen.FilterRules.timeStamp; +import static com.epam.ta.reportportal.commons.querygen.FilterRules.zoneOffset; import static com.epam.ta.reportportal.commons.validation.BusinessRule.expect; import static com.epam.ta.reportportal.commons.validation.BusinessRule.fail; import static com.epam.ta.reportportal.commons.validation.Suppliers.formattedSupplier; import static com.epam.ta.reportportal.ws.model.ErrorType.INCORRECT_FILTER_PARAMETERS; import static java.lang.Long.parseLong; import static java.util.Date.from; -import static org.jooq.impl.DSL.*; +import static org.jooq.impl.DSL.any; +import static org.jooq.impl.DSL.field; +import static org.jooq.impl.DSL.function; import static org.jooq.util.postgres.PostgresDSL.arrayLength; import static org.jooq.util.postgres.PostgresDSL.arrayRemove; +import com.epam.ta.reportportal.commons.Predicates; +import com.epam.ta.reportportal.ws.model.ErrorType; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.util.Arrays; +import java.util.Objects; +import java.util.Optional; +import org.apache.commons.lang3.BooleanUtils; +import org.jooq.Field; +import org.jooq.Operator; +import org.jooq.impl.DSL; +import org.jooq.util.postgres.PostgresDSL; + /** * Types of supported filtering * @@ -49,605 +58,664 @@ */ public enum Condition { - /** - * EQUALS condition - */ - EQUALS("eq") { - @Override - public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { - this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), INCORRECT_FILTER_PARAMETERS); - return field(criteriaHolder.getAggregateCriteria()).eq(this.castValue(criteriaHolder, - filter.getValue(), - INCORRECT_FILTER_PARAMETERS - )); - } - - @Override - public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType) { - expect(isNegative, val -> Objects.equals(val, false)).verify(errorType, - "Filter is incorrect. '!' can't be used with 'eq' - use 'ne' instead" - ); - expect(criteriaHolder, Predicates.not(filterForArrayAggregation())).verify(errorType, - "Equals condition not applicable for fields that have to be aggregated before filtering. Use 'HAS' or 'ANY'" - ); - } - - @Override - public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { - return criteriaHolder.castValue(value, errorType); - } - }, - - /** - * Not equals condition - */ - NOT_EQUALS("ne") { - @Override - public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { - this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), INCORRECT_FILTER_PARAMETERS); - return field(criteriaHolder.getAggregateCriteria()).ne(this.castValue(criteriaHolder, - filter.getValue(), - INCORRECT_FILTER_PARAMETERS - )); - } - - @Override - public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType) { - expect(criteriaHolder, Predicates.not(filterForArrayAggregation())).verify( - errorType, - "Not equals condition not applicable for fields that have to be aggregated before filtering. Use 'HAS' or 'ANY'" - ); - } - - @Override - public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { - return criteriaHolder.castValue(value, errorType); - } - }, - - /** - * Contains operation. Case insensitive - */ - CONTAINS("cnt") { - @Override - public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { - /* Validate only strings */ - - this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), INCORRECT_FILTER_PARAMETERS); - return field(criteriaHolder.getAggregateCriteria()).likeIgnoreCase(DSL.inline("%" + DSL.escape(filter.getValue(), '\\') + "%")) - .and(field(criteriaHolder.getAggregateCriteria()).isNotNull()); - } - - @Override - public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType) { - expect(criteriaHolder, filterForString()).verify(errorType, formattedSupplier( - "Contains condition applicable only for strings. Type of field is '{}'", - criteriaHolder.getDataType().getSimpleName() - )); - } - - @Override - public Object castValue(CriteriaHolder criteriaHolder, String values, ErrorType errorType) { - // values cast is not required here - return values; - } - }, - - UNDER("under") { - @Override - public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { - validate(criteriaHolder, filter.getValue(), false, INCORRECT_FILTER_PARAMETERS); - return DSL.condition(DSL.inline(filter.getValue()) + " @> " + criteriaHolder.getAggregateCriteria()); - } - - @Override - public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType) { - expect(criteriaHolder, filterForLtree()).verify(errorType, formattedSupplier( - "'Under' condition is applicable only for 'path' filter condition. Type of field is '{}'", - criteriaHolder.getFilterCriteria() - )); - } - - @Override - public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { - return value; - } - }, - - LEVEL("level") { - @Override - public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { - this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), INCORRECT_FILTER_PARAMETERS); - return function("nlevel", Long.class, field(criteriaHolder.getAggregateCriteria())).eq((Long) this.castValue(criteriaHolder, - filter.getValue(), - INCORRECT_FILTER_PARAMETERS - )); - } - - @Override - public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType) { - expect(criteriaHolder, or(filterForNumbers(), filterForLtree())).verify(errorType, formattedSupplier( - "'Level' condition is applicable only for positive Numbers and 'path' filter condition. Type of field is '{}'", - criteriaHolder.getDataType().getSimpleName() - )); - } - - @Override - public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { - return criteriaHolder.castValue(value, errorType); - } - }, - - /** - * Exists condition - */ - EXISTS("ex") { - @Override - public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { - if (criteriaHolder.getQueryCriteria().equals(criteriaHolder.getAggregateCriteria())) { - return field(criteriaHolder.getAggregateCriteria()).isNotNull(); - } else { - boolean exists = BooleanUtils.toBoolean(filter.getValue()); - Field aggregatedCount = DSL.coalesce(arrayLength(arrayRemove(DSL.arrayAgg(field(criteriaHolder.getQueryCriteria())), - (String) null - )), 0); - return exists ? aggregatedCount.gt(0) : aggregatedCount.eq(0); - } - } - - @Override - public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType) { - // object type validations is not required here - } - - @Override - public Object castValue(CriteriaHolder criteriaHolder, String values, ErrorType errorType) { - // values cast is not required here - return values; - } - }, - - /** - * IN condition. Accepts filter value as comma-separated list - */ - IN("in") { - @Override - public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { - this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), INCORRECT_FILTER_PARAMETERS); - return field(criteriaHolder.getAggregateCriteria()).in(castValue(criteriaHolder, - filter.getValue(), - INCORRECT_FILTER_PARAMETERS - )); - } - - @Override - public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType) { - expect(criteriaHolder, Predicates.not(filterForArrayAggregation())).verify(errorType, - "In condition not applicable for fields that have to be aggregated before filtering. Use 'HAS' or 'ANY'" - ); - } - - @Override - public Object[] castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { - return castArray(criteriaHolder, value, errorType); - } - }, - - /** - * IN condition. Accepts filter value as comma-separated list - */ - EQUALS_ANY("ea") { - @Override - public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { - this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), INCORRECT_FILTER_PARAMETERS); - return field(criteriaHolder.getAggregateCriteria()).eq(any(DSL.array(castValue(criteriaHolder, - filter.getValue(), - INCORRECT_FILTER_PARAMETERS - )))); - } - - @Override - public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType) { - expect(criteriaHolder, Predicates.not(filterForArrayAggregation())).verify( - errorType, - "Equals any condition not applicable for fields that have to be aggregated before filtering. Use 'HAS' or 'ANY'" - ); - } - - @Override - public Object[] castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { - return castArray(criteriaHolder, value, errorType); - } - }, - - /** - * HAS condition. Accepts filter value as comma-separated list. Returns - * 'TRUE' of all provided values exist in collection
- * Applicable only for collections - */ - HAS("has") { - @Override - public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { - /* Validate only collections */ - this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), INCORRECT_FILTER_PARAMETERS); - if (String.class.equals(criteriaHolder.getDataType())) { - return DSL.condition(Operator.AND, - DSL.field(criteriaHolder.getAggregateCriteria()) - .contains(DSL.arrayAgg(DSL.val(this.castValue(criteriaHolder, - filter.getValue(), - INCORRECT_FILTER_PARAMETERS - )).cast(String[].class))) - ); - } - if (String[].class.equals(criteriaHolder.getDataType())) { - return DSL.condition(Operator.AND, - DSL.field(criteriaHolder.getAggregateCriteria()) - .contains(DSL.cast(this.castValue(criteriaHolder, filter.getValue(), INCORRECT_FILTER_PARAMETERS), - String[].class - )) - ); - } - return DSL.condition(Operator.AND, - DSL.field(criteriaHolder.getAggregateCriteria()) - .contains(DSL.array((Object[]) this.castValue(criteriaHolder, filter.getValue(), INCORRECT_FILTER_PARAMETERS))) - ); - - } - - @Override - public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType) { - expect(criteriaHolder, filterForArrayAggregation()).verify(errorType, - "'HAS' condition applicable only for fields that have to be aggregated." - ); - } - - @Override - public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { - return castArray(criteriaHolder, value, errorType); - } - }, - - /** - * Overlap condition between two arrays - */ - ANY("any") { - @Override - public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { - this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), INCORRECT_FILTER_PARAMETERS); - if (String.class.equals(criteriaHolder.getDataType())) { - return DSL.condition(Operator.AND, - PostgresDSL.arrayOverlap(DSL.field(criteriaHolder.getAggregateCriteria(), String[][].class), - DSL.array(DSL.val(this.castValue(criteriaHolder, filter.getValue(), INCORRECT_FILTER_PARAMETERS)) - .cast(String[].class)) - ) - ); - - } - if (String[].class.equals(criteriaHolder.getDataType())) { - return DSL.condition(Operator.AND, - PostgresDSL.arrayOverlap(DSL.field(criteriaHolder.getAggregateCriteria(), String[].class), - DSL.cast(this.castValue(criteriaHolder, filter.getValue(), INCORRECT_FILTER_PARAMETERS), String[].class) - ) - ); - } - return DSL.condition(Operator.AND, PostgresDSL.arrayOverlap(DSL.field(criteriaHolder.getAggregateCriteria(), Object[].class), - DSL.array((Object[]) this.castValue(criteriaHolder, filter.getValue(), INCORRECT_FILTER_PARAMETERS)) - )); - } - - @Override - public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType) { - expect(criteriaHolder, filterForArrayAggregation()).verify(errorType, - "'ANY' condition applicable only for fields that have to be aggregated." - ); - } - - @Override - public Object castValue(CriteriaHolder criteriaHolder, String values, ErrorType errorType) { - return castArray(criteriaHolder, values, errorType); - } - }, - - /** - * Greater than condition - */ - GREATER_THAN("gt") { - @Override - public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { - /* Validate only numbers & dates */ - this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), INCORRECT_FILTER_PARAMETERS); - return field(criteriaHolder.getAggregateCriteria()).greaterThan(this.castValue(criteriaHolder, - filter.getValue(), - INCORRECT_FILTER_PARAMETERS - )); - } - - @Override - @SuppressWarnings("unchecked") - public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType) { - expect(criteriaHolder, or(filterForNumbers(), filterForDates(), filterForLogLevel())).verify(errorType, formattedSupplier( - "'Greater than' condition applicable only for positive Numbers or Dates. Type of field is '{}'", - criteriaHolder.getDataType().getSimpleName() - )); - } - - @Override - public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { - return criteriaHolder.castValue(value, errorType); - } - }, - - /** - * Greater than or Equals condition - */ - GREATER_THAN_OR_EQUALS("gte") { - @Override - public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { - /* Validate only numbers & dates */ - this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), INCORRECT_FILTER_PARAMETERS); - return field(criteriaHolder.getAggregateCriteria()).greaterOrEqual(this.castValue(criteriaHolder, - filter.getValue(), - INCORRECT_FILTER_PARAMETERS - )); - } - - @Override - @SuppressWarnings("unchecked") - public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType) { - expect(criteriaHolder, or(filterForNumbers(), filterForDates(), filterForLogLevel())).verify(errorType, formattedSupplier( - "'Greater than or equals' condition applicable only for positive Numbers or Dates. Type of field is '{}'", - criteriaHolder.getDataType().getSimpleName() - )); - } - - @Override - public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { - return criteriaHolder.castValue(value, errorType); - } - }, - - /** - * Lower than condition - */ - LOWER_THAN("lt") { - @Override - public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { - /* Validate only numbers & dates */ - this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), INCORRECT_FILTER_PARAMETERS); - - return field(criteriaHolder.getAggregateCriteria()).lessThan(this.castValue(criteriaHolder, - filter.getValue(), - INCORRECT_FILTER_PARAMETERS - )); - } - - @Override - @SuppressWarnings("unchecked") - public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType) { - expect(criteriaHolder, or(filterForNumbers(), filterForDates(), filterForLogLevel())).verify(errorType, formattedSupplier( - "'Lower than' condition applicable only for positive Numbers or Dates. Type of field is '{}'", - criteriaHolder.getDataType().getSimpleName() - )); - } - - @Override - public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { - return criteriaHolder.castValue(value, errorType); - } - }, - - /** - * Lower than or Equals condition - */ - LOWER_THAN_OR_EQUALS("lte") { - @Override - public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { - /* Validate only numbers & dates */ - this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), INCORRECT_FILTER_PARAMETERS); - - return field(criteriaHolder.getAggregateCriteria()).lessOrEqual(this.castValue(criteriaHolder, - filter.getValue(), - INCORRECT_FILTER_PARAMETERS - )); - } - - @Override - @SuppressWarnings("unchecked") - public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType) { - expect(criteriaHolder, or(filterForNumbers(), filterForDates(), filterForLogLevel())).verify(errorType, formattedSupplier( - "'Lower than or equals' condition applicable only for positive Numbers or Dates. Type of field is '{}'", - criteriaHolder.getDataType().getSimpleName() - )); - } - - @Override - public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { - return criteriaHolder.castValue(value, errorType); - } - }, - - /** - * Between condition. Include boundaries - */ - BETWEEN("btw") { - @Override - @SuppressWarnings("unchecked") - public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType) { - expect(criteriaHolder, or(filterForNumbers(), filterForDates(), filterForLogLevel())).verify(errorType, - formattedSupplier("'Between' condition applicable only for positive Numbers, Dates or specific TimeStamp values. " - + "Type of field is '{}'", criteriaHolder.getDataType().getSimpleName()) - ); - if (value.contains(VALUES_SEPARATOR)) { - expect(value.split(VALUES_SEPARATOR), countOfValues(2)).verify(errorType, - formattedSupplier("Incorrect between filter format. Expected='value1,value2'. Provided filter is '{}'", value) - ); - } else if (value.contains(TIMESTAMP_SEPARATOR)) { - final String[] values = value.split(TIMESTAMP_SEPARATOR); - - expect(values, countOfValues(BETWEEN_FILTER_VALUES_COUNT)).verify(errorType, formattedSupplier( - "Incorrect between filter format. Expected='TIMESTAMP_CONSTANT;TimeZoneOffset'. Provided filter is '{}'", - value - )); - expect(values[ZONE_OFFSET_INDEX], zoneOffset()).verify(errorType, - formattedSupplier("Incorrect zoneOffset. Expected='+h, +hh, +hh:mm'. Provided value is '{}'", - values[ZONE_OFFSET_INDEX] - ) - ); - expect(values[ZERO_TIMESTAMP_INDEX], timeStamp()).verify(errorType, - formattedSupplier("Incorrect timestamp. Expected number. Provided value is '{}'", values[ZERO_TIMESTAMP_INDEX]) - ); - expect(values[FIRST_TIMESTAMP_INDEX], timeStamp()).verify(errorType, - formattedSupplier("Incorrect timestamp. Expected number. Provided value is '{}'", values[FIRST_TIMESTAMP_INDEX]) - ); - } else { - fail().withError(errorType, formattedSupplier( - "Incorrect between filter format. Filter value should be separated by ',' or ';'. Provided filter is '{}'", - value - )); - } - } - - @Override - public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { - this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), INCORRECT_FILTER_PARAMETERS); - Object[] castedValues; - if (filter.getValue().contains(",")) { - castedValues = (Object[]) this.castValue(criteriaHolder, filter.getValue(), INCORRECT_FILTER_PARAMETERS); - } else { - String[] values = filter.getValue().split(";"); - ZoneOffset offset = ZoneOffset.of(values[2]); - ZonedDateTime localDateTime = ZonedDateTime.now(offset).toLocalDate().atStartOfDay(offset); - long start = from(localDateTime.plusMinutes(parseLong(values[0])).toInstant()).getTime(); - long end = from(localDateTime.plusMinutes(parseLong(values[1])).toInstant()).getTime(); - String newValue = start + "," + end; - castedValues = (Object[]) this.castValue(criteriaHolder, newValue, INCORRECT_FILTER_PARAMETERS); - } - return DSL.condition(Operator.AND, - field(criteriaHolder.getAggregateCriteria()).greaterOrEqual(castedValues[0]), - field(criteriaHolder.getAggregateCriteria()).lessOrEqual(castedValues[1]) - ); - } - - @Override - public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { - /* For linguistic dynamic date range literals */ - if (value.contains(";")) { - return value; - } else { - return castArray(criteriaHolder, value, errorType); - } - } - }; - - /* - * Workaround. Added to be able to use as constant in annotations - */ - public static final String EQ = "eq."; - public static final String CNT = "cnt."; - public static final String HAS_FILTER = "has."; - public static final String UNDR = "under."; - - public static final String VALUES_SEPARATOR = ","; - public static final String TIMESTAMP_SEPARATOR = ";"; - public static final String NEGATIVE_MARKER = "!"; - public static final Integer BETWEEN_FILTER_VALUES_COUNT = 3; - public static final Integer ZERO_TIMESTAMP_INDEX = 0; - public static final Integer FIRST_TIMESTAMP_INDEX = 1; - public static final Integer ZONE_OFFSET_INDEX = 2; - - private String marker; - - Condition(final String marker) { - this.marker = marker; - } - - abstract public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder); - - /** - * Validate condition value. This method should be overridden in all - * conditions which contains validations - * - * @param criteriaHolder Criteria description - * @param value Value to be casted - * @param isNegative Whether filter is negative - */ - abstract public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, ErrorType errorType); - - /** - * Cast filter values according condition. - * - * @param criteriaHolder Criteria description - * @param values Value to be casted - * @return Casted value - */ - abstract public Object castValue(CriteriaHolder criteriaHolder, String values, ErrorType errorType); - - public String getMarker() { - return marker; - } - - /** - * Finds condition by marker. If there is no condition with specified marker - * returns NULL - * - * @param marker Marker to be checked - * @return Condition if found or NULL - */ - public static Optional findByMarker(String marker) { - // Negative condition excluder - if (isNegative(marker)) { - marker = marker.substring(1); - } - String finalMarker = marker; - return Arrays.stream(values()).filter(it -> it.getMarker().equals(finalMarker)).findAny(); - } - - /** - * Check whether condition is negative - * - * @param marker Marker to check - * @return TRUE of negative - */ - public static boolean isNegative(String marker) { - return marker.startsWith(NEGATIVE_MARKER); - } - - /** - * Makes filter marker negative - * - * @param negative Whether condition is negative - * @param marker Marker to check - * @return TRUE of negative - */ - public static String makeNegative(boolean negative, String marker) { - String result; - if (negative) { - result = marker.startsWith(NEGATIVE_MARKER) ? marker : NEGATIVE_MARKER.concat(marker); - } else { - result = marker.startsWith(NEGATIVE_MARKER) ? marker.substring(1, marker.length()) : marker; - } - return result; - - } - - /** - * Cast values for filters which have many values(filters with - * conditions:btw, in, etc) - * - * @param criteriaHolder Criteria description - * @param value Value to be casted - * @return Casted value - */ - public Object[] castArray(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { - String[] values = value.split(VALUES_SEPARATOR); - Object[] castedValues = new Object[values.length]; - if (!String.class.equals(criteriaHolder.getDataType()) && !String[].class.equals(criteriaHolder.getDataType())) { - for (int index = 0; index < values.length; index++) { - castedValues[index] = criteriaHolder.castValue(values[index].trim(), errorType); - } - } else { - castedValues = values; - } - return castedValues; - } + /** + * EQUALS condition + */ + EQUALS("eq") { + @Override + public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { + this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), + INCORRECT_FILTER_PARAMETERS); + return field(criteriaHolder.getAggregateCriteria()).eq(this.castValue(criteriaHolder, + filter.getValue(), + INCORRECT_FILTER_PARAMETERS + )); + } + + @Override + public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType) { + expect(isNegative, val -> Objects.equals(val, false)).verify(errorType, + "Filter is incorrect. '!' can't be used with 'eq' - use 'ne' instead" + ); + expect(criteriaHolder, Predicates.not(filterForArrayAggregation())).verify(errorType, + "Equals condition not applicable for fields that have to be aggregated before filtering. Use 'HAS' or 'ANY'" + ); + } + + @Override + public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { + return criteriaHolder.castValue(value, errorType); + } + }, + + /** + * Not equals condition + */ + NOT_EQUALS("ne") { + @Override + public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { + this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), + INCORRECT_FILTER_PARAMETERS); + return field(criteriaHolder.getAggregateCriteria()).ne(this.castValue(criteriaHolder, + filter.getValue(), + INCORRECT_FILTER_PARAMETERS + )); + } + + @Override + public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType) { + expect(criteriaHolder, Predicates.not(filterForArrayAggregation())).verify( + errorType, + "Not equals condition not applicable for fields that have to be aggregated before filtering. Use 'HAS' or 'ANY'" + ); + } + + @Override + public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { + return criteriaHolder.castValue(value, errorType); + } + }, + + /** + * Contains operation. Case insensitive + */ + CONTAINS("cnt") { + @Override + public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { + /* Validate only strings */ + + this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), + INCORRECT_FILTER_PARAMETERS); + return field(criteriaHolder.getAggregateCriteria()).likeIgnoreCase( + DSL.inline("%" + DSL.escape(filter.getValue(), '\\') + "%")) + .and(field(criteriaHolder.getAggregateCriteria()).isNotNull()); + } + + @Override + public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType) { + expect(criteriaHolder, filterForString()).verify(errorType, formattedSupplier( + "Contains condition applicable only for strings. Type of field is '{}'", + criteriaHolder.getDataType().getSimpleName() + )); + } + + @Override + public Object castValue(CriteriaHolder criteriaHolder, String values, ErrorType errorType) { + // values cast is not required here + return values; + } + }, + + UNDER("under") { + @Override + public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { + validate(criteriaHolder, filter.getValue(), false, INCORRECT_FILTER_PARAMETERS); + return DSL.condition( + DSL.inline(filter.getValue()) + " @> " + criteriaHolder.getAggregateCriteria()); + } + + @Override + public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType) { + expect(criteriaHolder, filterForLtree()).verify(errorType, formattedSupplier( + "'Under' condition is applicable only for 'path' filter condition. Type of field is '{}'", + criteriaHolder.getFilterCriteria() + )); + } + + @Override + public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { + return value; + } + }, + + LEVEL("level") { + @Override + public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { + this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), + INCORRECT_FILTER_PARAMETERS); + return function("nlevel", Long.class, field(criteriaHolder.getAggregateCriteria())).eq( + (Long) this.castValue(criteriaHolder, + filter.getValue(), + INCORRECT_FILTER_PARAMETERS + )); + } + + @Override + public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType) { + expect(criteriaHolder, or(filterForNumbers(), filterForLtree())).verify(errorType, + formattedSupplier( + "'Level' condition is applicable only for positive Numbers and 'path' filter condition. Type of field is '{}'", + criteriaHolder.getDataType().getSimpleName() + )); + } + + @Override + public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { + return criteriaHolder.castValue(value, errorType); + } + }, + + /** + * Exists condition + */ + EXISTS("ex") { + @Override + public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { + if (criteriaHolder.getQueryCriteria().equals(criteriaHolder.getAggregateCriteria())) { + return field(criteriaHolder.getAggregateCriteria()).isNotNull(); + } else { + boolean exists = BooleanUtils.toBoolean(filter.getValue()); + Field aggregatedCount = DSL.coalesce( + arrayLength(arrayRemove(DSL.arrayAgg(field(criteriaHolder.getQueryCriteria())), + (String) null + )), 0); + return exists ? aggregatedCount.gt(0) : aggregatedCount.eq(0); + } + } + + @Override + public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType) { + // object type validations is not required here + } + + @Override + public Object castValue(CriteriaHolder criteriaHolder, String values, ErrorType errorType) { + // values cast is not required here + return values; + } + }, + + /** + * IN condition. Accepts filter value as comma-separated list + */ + IN("in") { + @Override + public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { + this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), + INCORRECT_FILTER_PARAMETERS); + return field(criteriaHolder.getAggregateCriteria()).in(castValue(criteriaHolder, + filter.getValue(), + INCORRECT_FILTER_PARAMETERS + )); + } + + @Override + public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType) { + expect(criteriaHolder, Predicates.not(filterForArrayAggregation())).verify(errorType, + "In condition not applicable for fields that have to be aggregated before filtering. Use 'HAS' or 'ANY'" + ); + } + + @Override + public Object[] castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { + return castArray(criteriaHolder, value, errorType); + } + }, + + /** + * IN condition. Accepts filter value as comma-separated list + */ + EQUALS_ANY("ea") { + @Override + public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { + this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), + INCORRECT_FILTER_PARAMETERS); + return field(criteriaHolder.getAggregateCriteria()).eq(any(DSL.array(castValue(criteriaHolder, + filter.getValue(), + INCORRECT_FILTER_PARAMETERS + )))); + } + + @Override + public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType) { + expect(criteriaHolder, Predicates.not(filterForArrayAggregation())).verify( + errorType, + "Equals any condition not applicable for fields that have to be aggregated before filtering. Use 'HAS' or 'ANY'" + ); + } + + @Override + public Object[] castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { + return castArray(criteriaHolder, value, errorType); + } + }, + + /** + * HAS condition. Accepts filter value as comma-separated list. Returns 'TRUE' of all provided + * values exist in collection
+ * Applicable only for collections + */ + HAS("has") { + @Override + public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { + /* Validate only collections */ + this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), + INCORRECT_FILTER_PARAMETERS); + if (String.class.equals(criteriaHolder.getDataType())) { + return DSL.condition(Operator.AND, + DSL.field(criteriaHolder.getAggregateCriteria()) + .contains(DSL.arrayAgg(DSL.val(this.castValue(criteriaHolder, + filter.getValue(), + INCORRECT_FILTER_PARAMETERS + )).cast(String[].class))) + ); + } + if (String[].class.equals(criteriaHolder.getDataType())) { + return DSL.condition(Operator.AND, + DSL.field(criteriaHolder.getAggregateCriteria()) + .contains(DSL.cast( + this.castValue(criteriaHolder, filter.getValue(), INCORRECT_FILTER_PARAMETERS), + String[].class + )) + ); + } + return DSL.condition(Operator.AND, + DSL.field(criteriaHolder.getAggregateCriteria()) + .contains(DSL.array((Object[]) this.castValue(criteriaHolder, filter.getValue(), + INCORRECT_FILTER_PARAMETERS))) + ); + + } + + @Override + public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType) { + expect(criteriaHolder, filterForArrayAggregation()).verify(errorType, + "'HAS' condition applicable only for fields that have to be aggregated." + ); + } + + @Override + public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { + return castArray(criteriaHolder, value, errorType); + } + }, + + /** + * Overlap condition between two arrays + */ + ANY("any") { + @Override + public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { + this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), + INCORRECT_FILTER_PARAMETERS); + if (String.class.equals(criteriaHolder.getDataType())) { + return DSL.condition(Operator.AND, + PostgresDSL.arrayOverlap( + DSL.field(criteriaHolder.getAggregateCriteria(), String[][].class), + DSL.array(DSL.val( + this.castValue(criteriaHolder, filter.getValue(), INCORRECT_FILTER_PARAMETERS)) + .cast(String[].class)) + ) + ); + + } + if (String[].class.equals(criteriaHolder.getDataType())) { + return DSL.condition(Operator.AND, + PostgresDSL.arrayOverlap( + DSL.field(criteriaHolder.getAggregateCriteria(), String[].class), + DSL.cast( + this.castValue(criteriaHolder, filter.getValue(), INCORRECT_FILTER_PARAMETERS), + String[].class) + ) + ); + } + return DSL.condition(Operator.AND, + PostgresDSL.arrayOverlap(DSL.field(criteriaHolder.getAggregateCriteria(), Object[].class), + DSL.array((Object[]) this.castValue(criteriaHolder, filter.getValue(), + INCORRECT_FILTER_PARAMETERS)) + )); + } + + @Override + public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType) { + expect(criteriaHolder, filterForArrayAggregation()).verify(errorType, + "'ANY' condition applicable only for fields that have to be aggregated." + ); + } + + @Override + public Object castValue(CriteriaHolder criteriaHolder, String values, ErrorType errorType) { + return castArray(criteriaHolder, values, errorType); + } + }, + + /** + * Greater than condition + */ + GREATER_THAN("gt") { + @Override + public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { + /* Validate only numbers & dates */ + this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), + INCORRECT_FILTER_PARAMETERS); + return field(criteriaHolder.getAggregateCriteria()).greaterThan(this.castValue(criteriaHolder, + filter.getValue(), + INCORRECT_FILTER_PARAMETERS + )); + } + + @Override + @SuppressWarnings("unchecked") + public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType) { + expect(criteriaHolder, or(filterForNumbers(), filterForDates(), filterForLogLevel())).verify( + errorType, formattedSupplier( + "'Greater than' condition applicable only for positive Numbers or Dates. Type of field is '{}'", + criteriaHolder.getDataType().getSimpleName() + )); + } + + @Override + public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { + return criteriaHolder.castValue(value, errorType); + } + }, + + /** + * Greater than or Equals condition + */ + GREATER_THAN_OR_EQUALS("gte") { + @Override + public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { + /* Validate only numbers & dates */ + this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), + INCORRECT_FILTER_PARAMETERS); + return field(criteriaHolder.getAggregateCriteria()).greaterOrEqual( + this.castValue(criteriaHolder, + filter.getValue(), + INCORRECT_FILTER_PARAMETERS + )); + } + + @Override + @SuppressWarnings("unchecked") + public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType) { + expect(criteriaHolder, or(filterForNumbers(), filterForDates(), filterForLogLevel())).verify( + errorType, formattedSupplier( + "'Greater than or equals' condition applicable only for positive Numbers or Dates. Type of field is '{}'", + criteriaHolder.getDataType().getSimpleName() + )); + } + + @Override + public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { + return criteriaHolder.castValue(value, errorType); + } + }, + + /** + * Lower than condition + */ + LOWER_THAN("lt") { + @Override + public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { + /* Validate only numbers & dates */ + this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), + INCORRECT_FILTER_PARAMETERS); + + return field(criteriaHolder.getAggregateCriteria()).lessThan(this.castValue(criteriaHolder, + filter.getValue(), + INCORRECT_FILTER_PARAMETERS + )); + } + + @Override + @SuppressWarnings("unchecked") + public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType) { + expect(criteriaHolder, or(filterForNumbers(), filterForDates(), filterForLogLevel())).verify( + errorType, formattedSupplier( + "'Lower than' condition applicable only for positive Numbers or Dates. Type of field is '{}'", + criteriaHolder.getDataType().getSimpleName() + )); + } + + @Override + public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { + return criteriaHolder.castValue(value, errorType); + } + }, + + /** + * Lower than or Equals condition + */ + LOWER_THAN_OR_EQUALS("lte") { + @Override + public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { + /* Validate only numbers & dates */ + this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), + INCORRECT_FILTER_PARAMETERS); + + return field(criteriaHolder.getAggregateCriteria()).lessOrEqual(this.castValue(criteriaHolder, + filter.getValue(), + INCORRECT_FILTER_PARAMETERS + )); + } + + @Override + @SuppressWarnings("unchecked") + public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType) { + expect(criteriaHolder, or(filterForNumbers(), filterForDates(), filterForLogLevel())).verify( + errorType, formattedSupplier( + "'Lower than or equals' condition applicable only for positive Numbers or Dates. Type of field is '{}'", + criteriaHolder.getDataType().getSimpleName() + )); + } + + @Override + public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { + return criteriaHolder.castValue(value, errorType); + } + }, + + /** + * Between condition. Include boundaries + */ + BETWEEN("btw") { + @Override + @SuppressWarnings("unchecked") + public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType) { + expect(criteriaHolder, or(filterForNumbers(), filterForDates(), filterForLogLevel())).verify( + errorType, + formattedSupplier( + "'Between' condition applicable only for positive Numbers, Dates or specific TimeStamp values. " + + "Type of field is '{}'", criteriaHolder.getDataType().getSimpleName()) + ); + if (value.contains(VALUES_SEPARATOR)) { + expect(value.split(VALUES_SEPARATOR), countOfValues(2)).verify(errorType, + formattedSupplier( + "Incorrect between filter format. Expected='value1,value2'. Provided filter is '{}'", + value) + ); + } else if (value.contains(TIMESTAMP_SEPARATOR)) { + final String[] values = value.split(TIMESTAMP_SEPARATOR); + + expect(values, countOfValues(BETWEEN_FILTER_VALUES_COUNT)).verify(errorType, + formattedSupplier( + "Incorrect between filter format. Expected='TIMESTAMP_CONSTANT;TimeZoneOffset'. Provided filter is '{}'", + value + )); + expect(values[ZONE_OFFSET_INDEX], zoneOffset()).verify(errorType, + formattedSupplier( + "Incorrect zoneOffset. Expected='+h, +hh, +hh:mm'. Provided value is '{}'", + values[ZONE_OFFSET_INDEX] + ) + ); + expect(values[ZERO_TIMESTAMP_INDEX], timeStamp()).verify(errorType, + formattedSupplier("Incorrect timestamp. Expected number. Provided value is '{}'", + values[ZERO_TIMESTAMP_INDEX]) + ); + expect(values[FIRST_TIMESTAMP_INDEX], timeStamp()).verify(errorType, + formattedSupplier("Incorrect timestamp. Expected number. Provided value is '{}'", + values[FIRST_TIMESTAMP_INDEX]) + ); + } else { + fail().withError(errorType, formattedSupplier( + "Incorrect between filter format. Filter value should be separated by ',' or ';'. Provided filter is '{}'", + value + )); + } + } + + @Override + public org.jooq.Condition toCondition(FilterCondition filter, CriteriaHolder criteriaHolder) { + this.validate(criteriaHolder, filter.getValue(), filter.isNegative(), + INCORRECT_FILTER_PARAMETERS); + Object[] castedValues; + if (filter.getValue().contains(",")) { + castedValues = (Object[]) this.castValue(criteriaHolder, filter.getValue(), + INCORRECT_FILTER_PARAMETERS); + } else { + String[] values = filter.getValue().split(";"); + ZoneOffset offset = ZoneOffset.of(values[2]); + ZonedDateTime localDateTime = ZonedDateTime.now(offset).toLocalDate().atStartOfDay(offset); + long start = from(localDateTime.plusMinutes(parseLong(values[0])).toInstant()).getTime(); + long end = from(localDateTime.plusMinutes(parseLong(values[1])).toInstant()).getTime(); + String newValue = start + "," + end; + castedValues = (Object[]) this.castValue(criteriaHolder, newValue, + INCORRECT_FILTER_PARAMETERS); + } + return DSL.condition(Operator.AND, + field(criteriaHolder.getAggregateCriteria()).greaterOrEqual(castedValues[0]), + field(criteriaHolder.getAggregateCriteria()).lessOrEqual(castedValues[1]) + ); + } + + @Override + public Object castValue(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { + /* For linguistic dynamic date range literals */ + if (value.contains(";")) { + return value; + } else { + return castArray(criteriaHolder, value, errorType); + } + } + }; + + /* + * Workaround. Added to be able to use as constant in annotations + */ + public static final String EQ = "eq."; + public static final String CNT = "cnt."; + public static final String HAS_FILTER = "has."; + public static final String UNDR = "under."; + + public static final String VALUES_SEPARATOR = ","; + public static final String TIMESTAMP_SEPARATOR = ";"; + public static final String NEGATIVE_MARKER = "!"; + public static final Integer BETWEEN_FILTER_VALUES_COUNT = 3; + public static final Integer ZERO_TIMESTAMP_INDEX = 0; + public static final Integer FIRST_TIMESTAMP_INDEX = 1; + public static final Integer ZONE_OFFSET_INDEX = 2; + + private String marker; + + Condition(final String marker) { + this.marker = marker; + } + + /** + * Finds condition by marker. If there is no condition with specified marker returns NULL + * + * @param marker Marker to be checked + * @return Condition if found or NULL + */ + public static Optional findByMarker(String marker) { + // Negative condition excluder + if (isNegative(marker)) { + marker = marker.substring(1); + } + String finalMarker = marker; + return Arrays.stream(values()).filter(it -> it.getMarker().equals(finalMarker)).findAny(); + } + + /** + * Check whether condition is negative + * + * @param marker Marker to check + * @return TRUE of negative + */ + public static boolean isNegative(String marker) { + return marker.startsWith(NEGATIVE_MARKER); + } + + /** + * Makes filter marker negative + * + * @param negative Whether condition is negative + * @param marker Marker to check + * @return TRUE of negative + */ + public static String makeNegative(boolean negative, String marker) { + String result; + if (negative) { + result = marker.startsWith(NEGATIVE_MARKER) ? marker : NEGATIVE_MARKER.concat(marker); + } else { + result = marker.startsWith(NEGATIVE_MARKER) ? marker.substring(1, marker.length()) : marker; + } + return result; + + } + + abstract public org.jooq.Condition toCondition(FilterCondition filter, + CriteriaHolder criteriaHolder); + + /** + * Validate condition value. This method should be overridden in all conditions which contains + * validations + * + * @param criteriaHolder Criteria description + * @param value Value to be casted + * @param isNegative Whether filter is negative + */ + abstract public void validate(CriteriaHolder criteriaHolder, String value, boolean isNegative, + ErrorType errorType); + + /** + * Cast filter values according condition. + * + * @param criteriaHolder Criteria description + * @param values Value to be casted + * @return Casted value + */ + abstract public Object castValue(CriteriaHolder criteriaHolder, String values, + ErrorType errorType); + + public String getMarker() { + return marker; + } + + /** + * Cast values for filters which have many values(filters with conditions:btw, in, etc) + * + * @param criteriaHolder Criteria description + * @param value Value to be casted + * @return Casted value + */ + public Object[] castArray(CriteriaHolder criteriaHolder, String value, ErrorType errorType) { + String[] values = value.split(VALUES_SEPARATOR); + Object[] castedValues = new Object[values.length]; + if (!String.class.equals(criteriaHolder.getDataType()) && !String[].class.equals( + criteriaHolder.getDataType())) { + for (int index = 0; index < values.length; index++) { + castedValues[index] = criteriaHolder.castValue(values[index].trim(), errorType); + } + } else { + castedValues = values; + } + return castedValues; + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/ConditionType.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/ConditionType.java index 0dd20275b..7f12a1b89 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/ConditionType.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/ConditionType.java @@ -22,6 +22,6 @@ * @author Pavel Bortnik */ enum ConditionType { - WHERE, - HAVING + WHERE, + HAVING } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/ConvertibleCondition.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/ConvertibleCondition.java index d1242df65..9a87d8e3c 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/ConvertibleCondition.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/ConvertibleCondition.java @@ -16,21 +16,20 @@ package com.epam.ta.reportportal.commons.querygen; -import org.jooq.Condition; -import org.jooq.Operator; - import java.util.List; import java.util.Map; +import org.jooq.Condition; +import org.jooq.Operator; /** * @author Ivan Budayeu */ public interface ConvertibleCondition { - Map toCondition(FilterTarget filterTarget); + Map toCondition(FilterTarget filterTarget); - Operator getOperator(); + Operator getOperator(); - List getAllConditions(); + List getAllConditions(); } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/CriteriaHolder.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/CriteriaHolder.java index a0de87cb0..995026760 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/CriteriaHolder.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/CriteriaHolder.java @@ -19,7 +19,12 @@ import com.epam.ta.reportportal.commons.querygen.query.JoinEntity; import com.epam.ta.reportportal.commons.validation.BusinessRule; import com.epam.ta.reportportal.commons.validation.Suppliers; -import com.epam.ta.reportportal.entity.enums.*; +import com.epam.ta.reportportal.entity.enums.IntegrationGroupEnum; +import com.epam.ta.reportportal.entity.enums.LaunchModeEnum; +import com.epam.ta.reportportal.entity.enums.LogLevel; +import com.epam.ta.reportportal.entity.enums.StatusEnum; +import com.epam.ta.reportportal.entity.enums.TestItemIssueGroup; +import com.epam.ta.reportportal.entity.enums.TestItemTypeEnum; import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.jooq.enums.JIntegrationGroupEnum; import com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum; @@ -28,15 +33,18 @@ import com.epam.ta.reportportal.ws.model.ErrorType; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; -import org.apache.commons.lang3.BooleanUtils; -import org.jooq.Field; -import org.jooq.impl.DSL; - import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeParseException; -import java.util.*; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import org.apache.commons.lang3.BooleanUtils; +import org.jooq.Field; +import org.jooq.impl.DSL; /** * Holds mapping between request search criteria and DB engine search criteria. Should be used for @@ -46,178 +54,195 @@ */ public class CriteriaHolder { - public CriteriaHolder() { - // added for deserialization from DB - } - - /** - * Criteria from search string - */ - private String filterCriteria; - - /** - * Internal Criteria to internal search be performed - */ - private String queryCriteria; - - /** - * Aggregate criteria for filtering. Only for fields that should be aggregated. - * If not - used default queryCriteria - */ - private String aggregateCriteria; - - private Class dataType; - - private List joinChain = Lists.newArrayList(); - - public CriteriaHolder(String filterCriteria, String queryCriteria, Class dataType) { - this.filterCriteria = Preconditions.checkNotNull(filterCriteria, "Filter criteria should not be null"); - this.queryCriteria = Preconditions.checkNotNull(queryCriteria, "Filter criteria should not be null"); - this.aggregateCriteria = queryCriteria; - this.dataType = Preconditions.checkNotNull(dataType, "Data type should not be null"); - } - - public CriteriaHolder(String filterCriteria, String queryCriteria, Class dataType, List joinChain) { - this.filterCriteria = Preconditions.checkNotNull(filterCriteria, "Filter criteria should not be null"); - this.queryCriteria = Preconditions.checkNotNull(queryCriteria, "Filter criteria should not be null"); - this.aggregateCriteria = queryCriteria; - this.dataType = Preconditions.checkNotNull(dataType, "Data type should not be null"); - this.joinChain = Preconditions.checkNotNull(joinChain, "Join chain should not be null"); - } - - public CriteriaHolder(String filterCriteria, Field queryCriteria, Class dataType) { - this.filterCriteria = Preconditions.checkNotNull(filterCriteria, "Filter criteria should not be null"); - this.queryCriteria = Preconditions.checkNotNull(queryCriteria, "Filter criteria should not be null").getQualifiedName().toString(); - this.aggregateCriteria = queryCriteria.getQualifiedName().toString(); - this.dataType = Preconditions.checkNotNull(dataType, "Data type should not be null"); - } - - public CriteriaHolder(String filterCriteria, Field queryCriteria, Class dataType, List joinChain) { - this.filterCriteria = Preconditions.checkNotNull(filterCriteria, "Filter criteria should not be null"); - this.queryCriteria = Preconditions.checkNotNull(queryCriteria, "Filter criteria should not be null").getQualifiedName().toString(); - this.aggregateCriteria = queryCriteria.getQualifiedName().toString(); - this.dataType = Preconditions.checkNotNull(dataType, "Data type should not be null"); - this.joinChain = Preconditions.checkNotNull(joinChain, "Join chain should not be null"); - } - - public String getFilterCriteria() { - return filterCriteria; - } - - public String getQueryCriteria() { - return queryCriteria; - } - - public String getAggregateCriteria() { - return aggregateCriteria; - } - - public Class getDataType() { - return dataType; - } - - public List getJoinChain() { - return joinChain; - } - - public void setAggregateCriteria(String aggregateCriteria) { - this.aggregateCriteria = aggregateCriteria; - } - - public Object castValue(String oneValue) { - return this.castValue(oneValue, ErrorType.INCORRECT_FILTER_PARAMETERS); - } - - /** - * Casting provided criteriaHolder by specified {@link Class} for specified value. - *

- * NOTE:
- * errorType - error which should be thrown when unable cast value - * - * @param oneValue Value to cast - * @param errorType ErrorType in case of error - * @return Casted value - */ - public Object castValue(String oneValue, ErrorType errorType) { - Object castedValue; - if (Number.class.isAssignableFrom(getDataType())) { - /* Verify correct number */ - castedValue = parseLong(oneValue, errorType); - } else if (Date.class.isAssignableFrom(getDataType())) { - - if (FilterRules.dateInMillis().test(oneValue)) { - - castedValue = LocalDateTime.ofInstant(Instant.ofEpochMilli(Long.parseLong(oneValue)), ZoneId.systemDefault()); - } else { - - try { - Instant instant = Instant.parse(oneValue); - castedValue = LocalDateTime.ofInstant(instant, ZoneId.systemDefault()); - } catch (DateTimeParseException e) { - throw new ReportPortalException(errorType, - Suppliers.formattedSupplier("Cannot convert '{}' to valid date", oneValue).get() - ); - } - } - } else if (boolean.class.equals(getDataType()) || Boolean.class.isAssignableFrom(getDataType())) { - castedValue = BooleanUtils.toBoolean(oneValue); - } else if (LogLevel.class.isAssignableFrom(getDataType())) { - Optional level = LogLevel.toLevel(oneValue); - BusinessRule.expect(level, Optional::isPresent) - .verify(errorType, Suppliers.formattedSupplier("Cannot convert '{}' to valid 'LogLevel'", oneValue)); - castedValue = level.get().toInt(); - BusinessRule.expect(castedValue, Objects::nonNull) - .verify(errorType, Suppliers.formattedSupplier("Cannot convert '{}' to valid 'LogLevel'", oneValue)); - } else if (JStatusEnum.class.isAssignableFrom(getDataType())) { - - Optional status = StatusEnum.fromValue(oneValue); - BusinessRule.expect(status, Optional::isPresent) - .verify(errorType, Suppliers.formattedSupplier("Cannot convert '{}' to valid 'Status'", oneValue)); - castedValue = JStatusEnum.valueOf(status.get().name()); - - } else if (JTestItemTypeEnum.class.isAssignableFrom(getDataType())) { - - Optional itemType = TestItemTypeEnum.fromValue(oneValue); - BusinessRule.expect(itemType, Optional::isPresent) - .verify(errorType, Suppliers.formattedSupplier("Cannot convert '{}' to valid 'Test item type'", oneValue)); - castedValue = JTestItemTypeEnum.valueOf(itemType.get().name()); - - } else if (JLaunchModeEnum.class.isAssignableFrom(getDataType())) { - - Optional launchMode = LaunchModeEnum.findByName(oneValue); - BusinessRule.expect(launchMode, Optional::isPresent) - .verify(errorType, Suppliers.formattedSupplier("Cannot convert '{}' to valid 'Launch mode'", oneValue)); - castedValue = JLaunchModeEnum.valueOf(launchMode.get().name()); - - } else if (JIntegrationGroupEnum.class.isAssignableFrom(getDataType())) { - - Optional integrationGroup = IntegrationGroupEnum.findByName(oneValue); - BusinessRule.expect(integrationGroup, Optional::isPresent) - .verify(errorType, Suppliers.formattedSupplier("Cannot convert '{}' to valid 'Integration group", oneValue)); - castedValue = JIntegrationGroupEnum.valueOf(integrationGroup.get().name()); - - } else if (TestItemIssueGroup.class.isAssignableFrom(getDataType())) { - castedValue = TestItemIssueGroup.validate(oneValue); - BusinessRule.expect(castedValue, Objects::nonNull) - .verify(errorType, Suppliers.formattedSupplier("Cannot convert '{}' to valid 'Issue Type'", oneValue)); - } else if (Collection.class.isAssignableFrom(getDataType())) { - /* Collection doesn't stores objects as ObjectId */ - castedValue = oneValue; - } else if (String.class.isAssignableFrom(getDataType())) { - castedValue = oneValue != null ? oneValue.trim() : null; - } else { - castedValue = DSL.val(oneValue).cast(getDataType()); - } - - return castedValue; - } - - private Long parseLong(String value, ErrorType errorType) { - try { - return Long.parseLong(value); - } catch (final NumberFormatException nfe) { - throw new ReportPortalException(errorType, Suppliers.formattedSupplier("Cannot convert '{}' to valid number", value)); - } - } + /** + * Criteria from search string + */ + private String filterCriteria; + /** + * Internal Criteria to internal search be performed + */ + private String queryCriteria; + /** + * Aggregate criteria for filtering. Only for fields that should be aggregated. If not - used + * default queryCriteria + */ + private String aggregateCriteria; + private Class dataType; + private List joinChain = Lists.newArrayList(); + + public CriteriaHolder() { + // added for deserialization from DB + } + + public CriteriaHolder(String filterCriteria, String queryCriteria, Class dataType) { + this.filterCriteria = Preconditions.checkNotNull(filterCriteria, + "Filter criteria should not be null"); + this.queryCriteria = Preconditions.checkNotNull(queryCriteria, + "Filter criteria should not be null"); + this.aggregateCriteria = queryCriteria; + this.dataType = Preconditions.checkNotNull(dataType, "Data type should not be null"); + } + + public CriteriaHolder(String filterCriteria, String queryCriteria, Class dataType, + List joinChain) { + this.filterCriteria = Preconditions.checkNotNull(filterCriteria, + "Filter criteria should not be null"); + this.queryCriteria = Preconditions.checkNotNull(queryCriteria, + "Filter criteria should not be null"); + this.aggregateCriteria = queryCriteria; + this.dataType = Preconditions.checkNotNull(dataType, "Data type should not be null"); + this.joinChain = Preconditions.checkNotNull(joinChain, "Join chain should not be null"); + } + + public CriteriaHolder(String filterCriteria, Field queryCriteria, Class dataType) { + this.filterCriteria = Preconditions.checkNotNull(filterCriteria, + "Filter criteria should not be null"); + this.queryCriteria = Preconditions.checkNotNull(queryCriteria, + "Filter criteria should not be null").getQualifiedName().toString(); + this.aggregateCriteria = queryCriteria.getQualifiedName().toString(); + this.dataType = Preconditions.checkNotNull(dataType, "Data type should not be null"); + } + + public CriteriaHolder(String filterCriteria, Field queryCriteria, Class dataType, + List joinChain) { + this.filterCriteria = Preconditions.checkNotNull(filterCriteria, + "Filter criteria should not be null"); + this.queryCriteria = Preconditions.checkNotNull(queryCriteria, + "Filter criteria should not be null").getQualifiedName().toString(); + this.aggregateCriteria = queryCriteria.getQualifiedName().toString(); + this.dataType = Preconditions.checkNotNull(dataType, "Data type should not be null"); + this.joinChain = Preconditions.checkNotNull(joinChain, "Join chain should not be null"); + } + + public String getFilterCriteria() { + return filterCriteria; + } + + public String getQueryCriteria() { + return queryCriteria; + } + + public String getAggregateCriteria() { + return aggregateCriteria; + } + + public void setAggregateCriteria(String aggregateCriteria) { + this.aggregateCriteria = aggregateCriteria; + } + + public Class getDataType() { + return dataType; + } + + public List getJoinChain() { + return joinChain; + } + + public Object castValue(String oneValue) { + return this.castValue(oneValue, ErrorType.INCORRECT_FILTER_PARAMETERS); + } + + /** + * Casting provided criteriaHolder by specified {@link Class} for specified value. + *

+ * NOTE:
errorType - error which should be thrown when unable cast value + * + * @param oneValue Value to cast + * @param errorType ErrorType in case of error + * @return Casted value + */ + public Object castValue(String oneValue, ErrorType errorType) { + Object castedValue; + if (Number.class.isAssignableFrom(getDataType())) { + /* Verify correct number */ + castedValue = parseLong(oneValue, errorType); + } else if (Date.class.isAssignableFrom(getDataType())) { + + if (FilterRules.dateInMillis().test(oneValue)) { + + castedValue = LocalDateTime.ofInstant(Instant.ofEpochMilli(Long.parseLong(oneValue)), + ZoneId.systemDefault()); + } else { + + try { + Instant instant = Instant.parse(oneValue); + castedValue = LocalDateTime.ofInstant(instant, ZoneId.systemDefault()); + } catch (DateTimeParseException e) { + throw new ReportPortalException(errorType, + Suppliers.formattedSupplier("Cannot convert '{}' to valid date", oneValue).get() + ); + } + } + } else if (boolean.class.equals(getDataType()) || Boolean.class.isAssignableFrom( + getDataType())) { + castedValue = BooleanUtils.toBoolean(oneValue); + } else if (LogLevel.class.isAssignableFrom(getDataType())) { + Optional level = LogLevel.toLevel(oneValue); + BusinessRule.expect(level, Optional::isPresent) + .verify(errorType, + Suppliers.formattedSupplier("Cannot convert '{}' to valid 'LogLevel'", oneValue)); + castedValue = level.get().toInt(); + BusinessRule.expect(castedValue, Objects::nonNull) + .verify(errorType, + Suppliers.formattedSupplier("Cannot convert '{}' to valid 'LogLevel'", oneValue)); + } else if (JStatusEnum.class.isAssignableFrom(getDataType())) { + + Optional status = StatusEnum.fromValue(oneValue); + BusinessRule.expect(status, Optional::isPresent) + .verify(errorType, + Suppliers.formattedSupplier("Cannot convert '{}' to valid 'Status'", oneValue)); + castedValue = JStatusEnum.valueOf(status.get().name()); + + } else if (JTestItemTypeEnum.class.isAssignableFrom(getDataType())) { + + Optional itemType = TestItemTypeEnum.fromValue(oneValue); + BusinessRule.expect(itemType, Optional::isPresent) + .verify(errorType, + Suppliers.formattedSupplier("Cannot convert '{}' to valid 'Test item type'", + oneValue)); + castedValue = JTestItemTypeEnum.valueOf(itemType.get().name()); + + } else if (JLaunchModeEnum.class.isAssignableFrom(getDataType())) { + + Optional launchMode = LaunchModeEnum.findByName(oneValue); + BusinessRule.expect(launchMode, Optional::isPresent) + .verify(errorType, + Suppliers.formattedSupplier("Cannot convert '{}' to valid 'Launch mode'", oneValue)); + castedValue = JLaunchModeEnum.valueOf(launchMode.get().name()); + + } else if (JIntegrationGroupEnum.class.isAssignableFrom(getDataType())) { + + Optional integrationGroup = IntegrationGroupEnum.findByName(oneValue); + BusinessRule.expect(integrationGroup, Optional::isPresent) + .verify(errorType, + Suppliers.formattedSupplier("Cannot convert '{}' to valid 'Integration group", + oneValue)); + castedValue = JIntegrationGroupEnum.valueOf(integrationGroup.get().name()); + + } else if (TestItemIssueGroup.class.isAssignableFrom(getDataType())) { + castedValue = TestItemIssueGroup.validate(oneValue); + BusinessRule.expect(castedValue, Objects::nonNull) + .verify(errorType, + Suppliers.formattedSupplier("Cannot convert '{}' to valid 'Issue Type'", oneValue)); + } else if (Collection.class.isAssignableFrom(getDataType())) { + /* Collection doesn't stores objects as ObjectId */ + castedValue = oneValue; + } else if (String.class.isAssignableFrom(getDataType())) { + castedValue = oneValue != null ? oneValue.trim() : null; + } else { + castedValue = DSL.val(oneValue).cast(getDataType()); + } + + return castedValue; + } + + private Long parseLong(String value, ErrorType errorType) { + try { + return Long.parseLong(value); + } catch (final NumberFormatException nfe) { + throw new ReportPortalException(errorType, + Suppliers.formattedSupplier("Cannot convert '{}' to valid number", value)); + } + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/CriteriaHolderBuilder.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/CriteriaHolderBuilder.java index 12c1c228f..bdfd13fc1 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/CriteriaHolderBuilder.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/CriteriaHolderBuilder.java @@ -17,10 +17,9 @@ package com.epam.ta.reportportal.commons.querygen; import com.epam.ta.reportportal.commons.querygen.query.JoinEntity; -import org.jooq.Field; - import java.util.List; import java.util.function.Supplier; +import org.jooq.Field; /** * @author Pavel Bortnik @@ -28,35 +27,39 @@ public class CriteriaHolderBuilder implements Supplier { - private CriteriaHolder criteriaHolder; - - public CriteriaHolderBuilder newBuilder(String filterCriteria, String queryCriteria, Class dataType) { - this.criteriaHolder = new CriteriaHolder(filterCriteria, queryCriteria, dataType); - return this; - } - - public CriteriaHolderBuilder newBuilder(String filterCriteria, String queryCriteria, Class dataType, List joinChain) { - this.criteriaHolder = new CriteriaHolder(filterCriteria, queryCriteria, dataType, joinChain); - return this; - } - - public CriteriaHolderBuilder newBuilder(String filterCriteria, Field queryCriteria, Class dataType) { - this.criteriaHolder = new CriteriaHolder(filterCriteria, queryCriteria, dataType); - return this; - } - - public CriteriaHolderBuilder newBuilder(String filterCriteria, Field queryCriteria, Class dataType, List joinChain) { - this.criteriaHolder = new CriteriaHolder(filterCriteria, queryCriteria, dataType, joinChain); - return this; - } - - public CriteriaHolderBuilder withAggregateCriteria(String aggregateCriteria) { - this.criteriaHolder.setAggregateCriteria(aggregateCriteria); - return this; - } - - @Override - public CriteriaHolder get() { - return criteriaHolder; - } + private CriteriaHolder criteriaHolder; + + public CriteriaHolderBuilder newBuilder(String filterCriteria, String queryCriteria, + Class dataType) { + this.criteriaHolder = new CriteriaHolder(filterCriteria, queryCriteria, dataType); + return this; + } + + public CriteriaHolderBuilder newBuilder(String filterCriteria, String queryCriteria, + Class dataType, List joinChain) { + this.criteriaHolder = new CriteriaHolder(filterCriteria, queryCriteria, dataType, joinChain); + return this; + } + + public CriteriaHolderBuilder newBuilder(String filterCriteria, Field queryCriteria, + Class dataType) { + this.criteriaHolder = new CriteriaHolder(filterCriteria, queryCriteria, dataType); + return this; + } + + public CriteriaHolderBuilder newBuilder(String filterCriteria, Field queryCriteria, + Class dataType, List joinChain) { + this.criteriaHolder = new CriteriaHolder(filterCriteria, queryCriteria, dataType, joinChain); + return this; + } + + public CriteriaHolderBuilder withAggregateCriteria(String aggregateCriteria) { + this.criteriaHolder.setAggregateCriteria(aggregateCriteria); + return this; + } + + @Override + public CriteriaHolder get() { + return criteriaHolder; + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/Filter.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/Filter.java index 476cfad37..f1e99c991 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/Filter.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/Filter.java @@ -19,15 +19,14 @@ import com.epam.ta.reportportal.commons.querygen.query.QuerySupplier; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; -import org.jooq.Operator; -import org.jooq.impl.DSL; -import org.springframework.util.Assert; - import java.io.Serializable; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import org.jooq.Operator; +import org.jooq.impl.DSL; +import org.springframework.util.Assert; /** * Filter for building queries to database. Contains CriteriaHolder which is mapping between request @@ -37,203 +36,213 @@ */ public class Filter implements Serializable, Queryable { - private Long id; - - private FilterTarget target; - - private List filterConditions; - - /** - * This constructor uses during serialization to database. - */ - @SuppressWarnings("unused") - private Filter() { - - } - - public Filter(Class target, Condition condition, boolean negative, String value, String searchCriteria) { - this(FilterTarget.findByClass(target), Lists.newArrayList(new FilterCondition(condition, negative, value, searchCriteria))); - } - - public Filter(Class target, List filterConditions) { - this(FilterTarget.findByClass(target), filterConditions); - } - - public Filter(Long filterId, Class target, Condition condition, boolean negative, String value, String searchCriteria) { - this(filterId, - FilterTarget.findByClass(target), - Lists.newArrayList(new FilterCondition(condition, negative, value, searchCriteria)) - ); - } - - public Filter(Long filterId, Class target, List filterConditions) { - this(filterId, FilterTarget.findByClass(target), filterConditions); - } - - protected Filter(Long id, FilterTarget target, List filterConditions) { - Assert.notNull(id, "Filter id shouldn't be null"); - Assert.notNull(target, "Filter target shouldn't be null"); - Assert.notNull(filterConditions, "Conditions value shouldn't be null"); - this.id = id; - this.target = target; - this.filterConditions = filterConditions; - } - - protected Filter(FilterTarget target, List filterConditions) { - Assert.notNull(target, "Filter target shouldn't be null"); - Assert.notNull(filterConditions, "Conditions value shouldn't be null"); - this.target = target; - this.filterConditions = filterConditions; - } - - public Long getId() { - return id; - } - - @Override - public FilterTarget getTarget() { - return target; - } - - @Override - public List getFilterConditions() { - return filterConditions; - } - - public Filter withCondition(ConvertibleCondition filterCondition) { - this.filterConditions.add(filterCondition); - return this; - } - - public Filter withConditions(List conditions) { - this.filterConditions.addAll(conditions); - return this; - } - - @Override - public QuerySupplier toQuery() { - QueryBuilder queryBuilder = QueryBuilder.newBuilder(this.target); - Map conditions = toCondition(); - return queryBuilder.addCondition(conditions.get(ConditionType.WHERE)) - .addHavingCondition(conditions.get(ConditionType.HAVING)) - .getQuerySupplier(); - } - - @Override - public Map toCondition() { - Map resultedConditions = new HashMap<>(); - for (ConvertibleCondition filterCondition : filterConditions) { - filterCondition.toCondition(this.target) - .forEach((key, value) -> addTransformedCondition(resultedConditions, filterCondition.getOperator(), value, key)); - } - return resultedConditions; - } - - /** - * Transforms {@link FilterCondition} into {@link org.jooq.Condition} and adds it to existed {@link Condition} - * according the {@link ConditionType} with {@link FilterCondition#getOperator()} - * {@link org.jooq.Operator} - * - * @param resultedConditions Resulted map of conditions divided into {@link ConditionType} - * @param conditionType {@link ConditionType} - * @return Updated map of conditions - */ - private Map addTransformedCondition(Map resultedConditions, - Operator operator, org.jooq.Condition condition, ConditionType conditionType) { - org.jooq.Condition composite = resultedConditions.getOrDefault(conditionType, DSL.noCondition()); - composite = DSL.condition(operator, composite, condition); - resultedConditions.put(conditionType, composite); - return resultedConditions; - } - - public static FilterBuilder builder() { - return new FilterBuilder(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - Filter filter = (Filter) o; - return Objects.equals(id, filter.id) && target == filter.target && Objects.equals(filterConditions, filter.filterConditions); - } - - @Override - public int hashCode() { - return Objects.hash(id, target, filterConditions); - } - - @Override - public String toString() { - return "Filter{" + "id=" + id + ", target=" + target + ", filterConditions=" + filterConditions + '}'; - } - - /** - * Builder for {@link Filter} - */ - public static class FilterBuilder { - - private Class target; - - private List conditions = Lists.newArrayList(); - - private FilterBuilder() { - - } - - public FilterBuilder withTarget(Class target) { - this.target = target; - return this; - } - - public FilterBuilder withCondition(ConvertibleCondition condition) { - this.conditions.add(condition); - return this; - } - - public Filter build() { - List filterConditions = Lists.newArrayList(); - filterConditions.addAll(this.conditions); - Preconditions.checkArgument(null != target, "FilterTarget should not be null"); - Preconditions.checkArgument(!filterConditions.isEmpty(), "Filter should contain at least one condition"); - return new Filter(FilterTarget.findByClass(target), filterConditions); - } - } - - public boolean replaceSearchCriteria(FilterCondition oldCondition, FilterCondition newCondition) { - if (oldCondition == null || newCondition == null) { - return false; - } - - return replaceSearchCriteria(oldCondition, newCondition, filterConditions); - } - - private boolean replaceSearchCriteria(FilterCondition oldCondition, FilterCondition newCondition, - List filterConditionList) { - for (int i = 0, filterConditionListSize = filterConditionList.size(); i < filterConditionListSize; i++) { - ConvertibleCondition filterCondition = filterConditionList.get(i); - if (filterCondition instanceof FilterCondition) { - FilterCondition filterCondition1 = (FilterCondition) filterCondition; - if (filterCondition1.getCondition() == oldCondition.getCondition() && - filterCondition1.isNegative() == oldCondition.isNegative() && - Objects.equals(filterCondition1.getSearchCriteria(), oldCondition.getSearchCriteria()) - ) { - filterConditionList.set(i, newCondition); - return true; - } - } else if (filterCondition instanceof CompositeFilterCondition) { - if (replaceSearchCriteria(oldCondition, newCondition, - ((CompositeFilterCondition) filterCondition).getConditions())) { - return true; - } - } - } - - return false; - } + private Long id; + + private FilterTarget target; + + private List filterConditions; + + /** + * This constructor uses during serialization to database. + */ + @SuppressWarnings("unused") + private Filter() { + + } + + public Filter(Class target, Condition condition, boolean negative, String value, + String searchCriteria) { + this(FilterTarget.findByClass(target), + Lists.newArrayList(new FilterCondition(condition, negative, value, searchCriteria))); + } + + public Filter(Class target, List filterConditions) { + this(FilterTarget.findByClass(target), filterConditions); + } + + public Filter(Long filterId, Class target, Condition condition, boolean negative, String value, + String searchCriteria) { + this(filterId, + FilterTarget.findByClass(target), + Lists.newArrayList(new FilterCondition(condition, negative, value, searchCriteria)) + ); + } + + public Filter(Long filterId, Class target, List filterConditions) { + this(filterId, FilterTarget.findByClass(target), filterConditions); + } + + protected Filter(Long id, FilterTarget target, List filterConditions) { + Assert.notNull(id, "Filter id shouldn't be null"); + Assert.notNull(target, "Filter target shouldn't be null"); + Assert.notNull(filterConditions, "Conditions value shouldn't be null"); + this.id = id; + this.target = target; + this.filterConditions = filterConditions; + } + + protected Filter(FilterTarget target, List filterConditions) { + Assert.notNull(target, "Filter target shouldn't be null"); + Assert.notNull(filterConditions, "Conditions value shouldn't be null"); + this.target = target; + this.filterConditions = filterConditions; + } + + public static FilterBuilder builder() { + return new FilterBuilder(); + } + + public Long getId() { + return id; + } + + @Override + public FilterTarget getTarget() { + return target; + } + + @Override + public List getFilterConditions() { + return filterConditions; + } + + public Filter withCondition(ConvertibleCondition filterCondition) { + this.filterConditions.add(filterCondition); + return this; + } + + public Filter withConditions(List conditions) { + this.filterConditions.addAll(conditions); + return this; + } + + @Override + public QuerySupplier toQuery() { + QueryBuilder queryBuilder = QueryBuilder.newBuilder(this.target); + Map conditions = toCondition(); + return queryBuilder.addCondition(conditions.get(ConditionType.WHERE)) + .addHavingCondition(conditions.get(ConditionType.HAVING)) + .getQuerySupplier(); + } + + @Override + public Map toCondition() { + Map resultedConditions = new HashMap<>(); + for (ConvertibleCondition filterCondition : filterConditions) { + filterCondition.toCondition(this.target) + .forEach((key, value) -> addTransformedCondition(resultedConditions, + filterCondition.getOperator(), value, key)); + } + return resultedConditions; + } + + /** + * Transforms {@link FilterCondition} into {@link org.jooq.Condition} and adds it to existed + * {@link Condition} according the {@link ConditionType} with + * {@link FilterCondition#getOperator()} {@link org.jooq.Operator} + * + * @param resultedConditions Resulted map of conditions divided into {@link ConditionType} + * @param conditionType {@link ConditionType} + * @return Updated map of conditions + */ + private Map addTransformedCondition( + Map resultedConditions, + Operator operator, org.jooq.Condition condition, ConditionType conditionType) { + org.jooq.Condition composite = resultedConditions.getOrDefault(conditionType, + DSL.noCondition()); + composite = DSL.condition(operator, composite, condition); + resultedConditions.put(conditionType, composite); + return resultedConditions; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + Filter filter = (Filter) o; + return Objects.equals(id, filter.id) && target == filter.target && Objects.equals( + filterConditions, filter.filterConditions); + } + + @Override + public int hashCode() { + return Objects.hash(id, target, filterConditions); + } + + @Override + public String toString() { + return "Filter{" + "id=" + id + ", target=" + target + ", filterConditions=" + filterConditions + + '}'; + } + + public boolean replaceSearchCriteria(FilterCondition oldCondition, FilterCondition newCondition) { + if (oldCondition == null || newCondition == null) { + return false; + } + + return replaceSearchCriteria(oldCondition, newCondition, filterConditions); + } + + private boolean replaceSearchCriteria(FilterCondition oldCondition, FilterCondition newCondition, + List filterConditionList) { + for (int i = 0, filterConditionListSize = filterConditionList.size(); + i < filterConditionListSize; i++) { + ConvertibleCondition filterCondition = filterConditionList.get(i); + if (filterCondition instanceof FilterCondition) { + FilterCondition filterCondition1 = (FilterCondition) filterCondition; + if (filterCondition1.getCondition() == oldCondition.getCondition() && + filterCondition1.isNegative() == oldCondition.isNegative() && + Objects.equals(filterCondition1.getSearchCriteria(), oldCondition.getSearchCriteria()) + ) { + filterConditionList.set(i, newCondition); + return true; + } + } else if (filterCondition instanceof CompositeFilterCondition) { + if (replaceSearchCriteria(oldCondition, newCondition, + ((CompositeFilterCondition) filterCondition).getConditions())) { + return true; + } + } + } + + return false; + } + + /** + * Builder for {@link Filter} + */ + public static class FilterBuilder { + + private Class target; + + private List conditions = Lists.newArrayList(); + + private FilterBuilder() { + + } + + public FilterBuilder withTarget(Class target) { + this.target = target; + return this; + } + + public FilterBuilder withCondition(ConvertibleCondition condition) { + this.conditions.add(condition); + return this; + } + + public Filter build() { + List filterConditions = Lists.newArrayList(); + filterConditions.addAll(this.conditions); + Preconditions.checkArgument(null != target, "FilterTarget should not be null"); + Preconditions.checkArgument(!filterConditions.isEmpty(), + "Filter should contain at least one condition"); + return new Filter(FilterTarget.findByClass(target), filterConditions); + } + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterCondition.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterCondition.java index 849b3ab48..c75540b7e 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterCondition.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterCondition.java @@ -16,22 +16,33 @@ package com.epam.ta.reportportal.commons.querygen; +import static com.epam.ta.reportportal.commons.querygen.QueryBuilder.HAVING_CONDITION; + import com.epam.ta.reportportal.commons.validation.BusinessRule; import com.epam.ta.reportportal.commons.validation.Suppliers; import com.epam.ta.reportportal.entity.enums.PostgreSQLEnumType; import com.epam.ta.reportportal.ws.model.ErrorType; import com.google.common.collect.Lists; +import java.io.Serializable; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Transient; import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import org.jooq.Operator; -import javax.persistence.*; -import java.io.Serializable; -import java.util.*; -import java.util.stream.Collectors; - -import static com.epam.ta.reportportal.commons.querygen.QueryBuilder.HAVING_CONDITION; - /** * Filter condition class for filters specifics */ @@ -40,248 +51,253 @@ @TypeDef(name = "pgsql_enum", typeClass = PostgreSQLEnumType.class) public class FilterCondition implements ConvertibleCondition, Serializable { - private static final long serialVersionUID = 1L; - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id", unique = true, nullable = false, precision = 64) - private Long id; - - /** - * Filter Condition - */ - @Enumerated(EnumType.STRING) - @Type(type = "pqsql_enum") - @Column(name = "condition") - private Condition condition; - - /** - * Value to be filtered - */ - @Column(name = "value") - private String value; - - /** - * API Model Search Criteria - */ - @Column(name = "search_criteria") - private String searchCriteria; - - /** - * Whether this is 'NOT' filter - */ - @Column(name = "negative") - private boolean negative; - - /** - * Whether this is 'AND' or 'OR' filter - */ - @Transient - private Operator operator = Operator.AND; - - public FilterCondition() { - } - - public FilterCondition(Condition condition, boolean negative, String value, String searchCriteria) { - this.condition = condition; - this.value = value; - this.searchCriteria = searchCriteria; - this.negative = negative; - } - - public FilterCondition(Operator operator, Condition condition, boolean negative, String value, String searchCriteria) { - this.condition = condition; - this.value = value; - this.searchCriteria = searchCriteria; - this.negative = negative; - this.operator = operator; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Condition getCondition() { - return condition; - } - - public String getSearchCriteria() { - return searchCriteria; - } - - public String getValue() { - return value; - } - - public boolean isNegative() { - return negative; - } - - @Override - public Operator getOperator() { - return operator; - } - - @Override - public List getAllConditions() { - return Lists.newArrayList(this); - } - - public void setOperator(Operator operator) { - this.operator = operator; - } - - @Override - public Map toCondition(FilterTarget filterTarget) { - - Optional criteriaHolder = filterTarget.getCriteriaByFilter(searchCriteria); - - BusinessRule.expect(criteriaHolder, com.epam.ta.reportportal.commons.Preconditions.IS_PRESENT) - .verify(ErrorType.INCORRECT_FILTER_PARAMETERS, - Suppliers.formattedSupplier("Filter parameter {} is not defined", searchCriteria) - ); - - org.jooq.Condition condition = this.condition.toCondition(this, criteriaHolder.get()); - - /* Does FilterCondition contains negative=true? */ - if (negative) { - condition = condition.not(); - } - if (HAVING_CONDITION.test(this, filterTarget)) { - return Collections.singletonMap(ConditionType.HAVING, condition); - } else { - return Collections.singletonMap(ConditionType.WHERE, condition); - } - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((condition == null) ? 0 : condition.hashCode()); - result = prime * result + (negative ? 1231 : 1237); - result = prime * result + ((searchCriteria == null) ? 0 : searchCriteria.hashCode()); - result = prime * result + ((value == null) ? 0 : value.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - FilterCondition other = (FilterCondition) obj; - if (condition != other.condition) { - return false; - } - if (negative != other.negative) { - return false; - } - if (searchCriteria == null) { - if (other.searchCriteria != null) { - return false; - } - } else if (!searchCriteria.equals(other.searchCriteria)) { - return false; - } - if (value == null) { - if (other.value != null) { - return false; - } - } else if (!value.equals(other.value)) { - return false; - } - return true; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("FilterCondition {").append("condition = ") - .append(condition) - .append(", value = ") - .append(value) - .append(", searchCriteria = ") - .append(searchCriteria) - .append(", negative = ") - .append(negative) - .append("}"); - return sb.toString(); - } - - public static ConditionBuilder builder() { - return new ConditionBuilder(); - } - - /** - * Builder for {@link FilterCondition} - */ - public static class ConditionBuilder { - - private Condition condition; - - private boolean negative; - - private String value; - - private String searchCriteria; - - private Operator operator = Operator.AND; - - private ConditionBuilder() { - - } - - public FilterCondition.ConditionBuilder withCondition(Condition condition) { - this.condition = condition; - return this; - } - - public FilterCondition.ConditionBuilder withNegative(boolean negative) { - this.negative = negative; - return this; - } - - public FilterCondition.ConditionBuilder withValue(String value) { - this.value = value; - return this; - } - - public FilterCondition.ConditionBuilder withSearchCriteria(String searchCriteria) { - this.searchCriteria = searchCriteria; - return this; - } - - public FilterCondition.ConditionBuilder withOperator(Operator operator) { - this.operator = operator; - return this; - } - - public FilterCondition.ConditionBuilder eq(String searchCriteria, String value) { - return withCondition(Condition.EQUALS).withSearchCriteria(searchCriteria).withValue(value); - } - - public FilterCondition.ConditionBuilder in(String searchCriteria, List value) { - return withSearchCriteria(searchCriteria).withCondition(Condition.IN) - .withValue(value.stream().map(Object::toString).collect(Collectors.joining(","))); - } - - public FilterCondition build() { - BusinessRule.expect(condition, Objects::nonNull).verify(ErrorType.BAD_REQUEST_ERROR, "Condition should not be null"); - BusinessRule.expect(value, Objects::nonNull).verify(ErrorType.BAD_REQUEST_ERROR, "Value should not be null"); - BusinessRule.expect(searchCriteria, Objects::nonNull).verify(ErrorType.BAD_REQUEST_ERROR, "Search criteria should not be null"); - BusinessRule.expect(condition, c -> c != Condition.EQUALS || !negative) - .verify(ErrorType.BAD_REQUEST_ERROR, "Use 'ne' instead of '!eq"); - return new FilterCondition(operator, condition, negative, value, searchCriteria); - } - } + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", unique = true, nullable = false, precision = 64) + private Long id; + + /** + * Filter Condition + */ + @Enumerated(EnumType.STRING) + @Type(type = "pqsql_enum") + @Column(name = "condition") + private Condition condition; + + /** + * Value to be filtered + */ + @Column(name = "value") + private String value; + + /** + * API Model Search Criteria + */ + @Column(name = "search_criteria") + private String searchCriteria; + + /** + * Whether this is 'NOT' filter + */ + @Column(name = "negative") + private boolean negative; + + /** + * Whether this is 'AND' or 'OR' filter + */ + @Transient + private Operator operator = Operator.AND; + + public FilterCondition() { + } + + public FilterCondition(Condition condition, boolean negative, String value, + String searchCriteria) { + this.condition = condition; + this.value = value; + this.searchCriteria = searchCriteria; + this.negative = negative; + } + + public FilterCondition(Operator operator, Condition condition, boolean negative, String value, + String searchCriteria) { + this.condition = condition; + this.value = value; + this.searchCriteria = searchCriteria; + this.negative = negative; + this.operator = operator; + } + + public static ConditionBuilder builder() { + return new ConditionBuilder(); + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Condition getCondition() { + return condition; + } + + public String getSearchCriteria() { + return searchCriteria; + } + + public String getValue() { + return value; + } + + public boolean isNegative() { + return negative; + } + + @Override + public Operator getOperator() { + return operator; + } + + public void setOperator(Operator operator) { + this.operator = operator; + } + + @Override + public List getAllConditions() { + return Lists.newArrayList(this); + } + + @Override + public Map toCondition(FilterTarget filterTarget) { + + Optional criteriaHolder = filterTarget.getCriteriaByFilter(searchCriteria); + + BusinessRule.expect(criteriaHolder, com.epam.ta.reportportal.commons.Preconditions.IS_PRESENT) + .verify(ErrorType.INCORRECT_FILTER_PARAMETERS, + Suppliers.formattedSupplier("Filter parameter {} is not defined", searchCriteria) + ); + + org.jooq.Condition condition = this.condition.toCondition(this, criteriaHolder.get()); + + /* Does FilterCondition contains negative=true? */ + if (negative) { + condition = condition.not(); + } + if (HAVING_CONDITION.test(this, filterTarget)) { + return Collections.singletonMap(ConditionType.HAVING, condition); + } else { + return Collections.singletonMap(ConditionType.WHERE, condition); + } + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((condition == null) ? 0 : condition.hashCode()); + result = prime * result + (negative ? 1231 : 1237); + result = prime * result + ((searchCriteria == null) ? 0 : searchCriteria.hashCode()); + result = prime * result + ((value == null) ? 0 : value.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + FilterCondition other = (FilterCondition) obj; + if (condition != other.condition) { + return false; + } + if (negative != other.negative) { + return false; + } + if (searchCriteria == null) { + if (other.searchCriteria != null) { + return false; + } + } else if (!searchCriteria.equals(other.searchCriteria)) { + return false; + } + if (value == null) { + if (other.value != null) { + return false; + } + } else if (!value.equals(other.value)) { + return false; + } + return true; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("FilterCondition {").append("condition = ") + .append(condition) + .append(", value = ") + .append(value) + .append(", searchCriteria = ") + .append(searchCriteria) + .append(", negative = ") + .append(negative) + .append("}"); + return sb.toString(); + } + + /** + * Builder for {@link FilterCondition} + */ + public static class ConditionBuilder { + + private Condition condition; + + private boolean negative; + + private String value; + + private String searchCriteria; + + private Operator operator = Operator.AND; + + private ConditionBuilder() { + + } + + public FilterCondition.ConditionBuilder withCondition(Condition condition) { + this.condition = condition; + return this; + } + + public FilterCondition.ConditionBuilder withNegative(boolean negative) { + this.negative = negative; + return this; + } + + public FilterCondition.ConditionBuilder withValue(String value) { + this.value = value; + return this; + } + + public FilterCondition.ConditionBuilder withSearchCriteria(String searchCriteria) { + this.searchCriteria = searchCriteria; + return this; + } + + public FilterCondition.ConditionBuilder withOperator(Operator operator) { + this.operator = operator; + return this; + } + + public FilterCondition.ConditionBuilder eq(String searchCriteria, String value) { + return withCondition(Condition.EQUALS).withSearchCriteria(searchCriteria).withValue(value); + } + + public FilterCondition.ConditionBuilder in(String searchCriteria, List value) { + return withSearchCriteria(searchCriteria).withCondition(Condition.IN) + .withValue(value.stream().map(Object::toString).collect(Collectors.joining(","))); + } + + public FilterCondition build() { + BusinessRule.expect(condition, Objects::nonNull) + .verify(ErrorType.BAD_REQUEST_ERROR, "Condition should not be null"); + BusinessRule.expect(value, Objects::nonNull) + .verify(ErrorType.BAD_REQUEST_ERROR, "Value should not be null"); + BusinessRule.expect(searchCriteria, Objects::nonNull) + .verify(ErrorType.BAD_REQUEST_ERROR, "Search criteria should not be null"); + BusinessRule.expect(condition, c -> c != Condition.EQUALS || !negative) + .verify(ErrorType.BAD_REQUEST_ERROR, "Use 'ne' instead of '!eq"); + return new FilterCondition(operator, condition, negative, value, searchCriteria); + } + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterRules.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterRules.java index f034a8e8b..1061d0883 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterRules.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterRules.java @@ -17,159 +17,162 @@ package com.epam.ta.reportportal.commons.querygen; import com.epam.ta.reportportal.entity.enums.LogLevel; -import org.apache.commons.lang3.math.NumberUtils; - -import java.time.*; +import java.time.DateTimeException; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneOffset; import java.util.Collection; import java.util.Date; import java.util.function.Predicate; +import org.apache.commons.lang3.math.NumberUtils; /** - * Set of predicates which may be applied to the query builder and filter - * conditions
+ * Set of predicates which may be applied to the query builder and filter conditions
* * @author Andrei Varabyeu */ public class FilterRules { - private FilterRules() { - //static only - } - - /** - * Accepts only strings as data type - * - * @return Predicate - */ - public static Predicate filterForString() { - return filter -> String.class.equals(filter.getDataType()); - } - - /** - * Accepts only strings as data type - * - * @return Predicate - */ - public static Predicate filterForBoolean() { - return filter -> boolean.class.equals(filter.getDataType()) || Boolean.class.isAssignableFrom(filter.getDataType()); - } - - public static Predicate filterForLogLevel() { - return filter -> LogLevel.class.isAssignableFrom(filter.getDataType()); - } - - /** - * Accepts numbers only numbers as data type - * - * @return Predicate - */ - public static Predicate filterForNumbers() { - return filter -> Number.class.isAssignableFrom(filter.getDataType()); - } - - /** - * Accepts only 'path' criteria as a filter criteria - */ - public static Predicate filterForLtree() { - return filter -> "path".equalsIgnoreCase(filter.getFilterCriteria()); - } - - /** - * Accepts collections as data type - * - * @return Predicate - */ - public static Predicate filterForCollections() { - return filter -> Collection.class.isAssignableFrom(filter.getDataType()); - } - - /** - * Accepts filtering only for fields that are needed to be aggregated - * as array_agg after join - * - * @return Predicate - */ - public static Predicate filterForArrayAggregation() { - return filter -> filter.getAggregateCriteria().startsWith("array_agg") || filter.getAggregateCriteria().startsWith("array_cat"); - } - - /** - * Accepts numbers only numbers as data type - * - * @return Predicate - */ - public static Predicate numberIsPositive() { - return number -> number.longValue() >= 0; - } - - /** - * Accepts numbers only - * - * @return Predicate - */ - public static Predicate number() { - return NumberUtils::isCreatable; - } - - /** - * Accepts numbers only - * - * @return Predicate - */ - public static Predicate dateInMillis() { - return object -> { - /* - * May be rewritten in future. I suppose date as long value - */ - return number().test(object); - }; - } - - /** - * Accepts only dates as data type - * - * @return Predicate - */ - public static Predicate filterForDates() { - return filter -> Date.class.isAssignableFrom(filter.getDataType()); - } - - /** - * Count of values provided to filter - * - * @return Predicate - */ - public static Predicate countOfValues(final int count) { - return values -> count == values.length; - } - - public static Predicate zoneOffset() { - return value -> { - if (value == null) { - return false; - } - try { - ZoneOffset.of(value); - } catch (DateTimeException e) { - return false; - } - return true; - }; - } - - public static Predicate timeStamp() { - return value -> { - if (value == null) { - return false; - } - try { - long offset = Long.parseLong(value); - LocalDateTime.of(LocalDate.now(), LocalTime.of(0, 0)).plusMinutes(offset); - } catch (NumberFormatException | DateTimeException e) { - return false; - } - return true; - }; - } + private FilterRules() { + //static only + } + + /** + * Accepts only strings as data type + * + * @return Predicate + */ + public static Predicate filterForString() { + return filter -> String.class.equals(filter.getDataType()); + } + + /** + * Accepts only strings as data type + * + * @return Predicate + */ + public static Predicate filterForBoolean() { + return filter -> boolean.class.equals(filter.getDataType()) || Boolean.class.isAssignableFrom( + filter.getDataType()); + } + + public static Predicate filterForLogLevel() { + return filter -> LogLevel.class.isAssignableFrom(filter.getDataType()); + } + + /** + * Accepts numbers only numbers as data type + * + * @return Predicate + */ + public static Predicate filterForNumbers() { + return filter -> Number.class.isAssignableFrom(filter.getDataType()); + } + + /** + * Accepts only 'path' criteria as a filter criteria + */ + public static Predicate filterForLtree() { + return filter -> "path".equalsIgnoreCase(filter.getFilterCriteria()); + } + + /** + * Accepts collections as data type + * + * @return Predicate + */ + public static Predicate filterForCollections() { + return filter -> Collection.class.isAssignableFrom(filter.getDataType()); + } + + /** + * Accepts filtering only for fields that are needed to be aggregated as array_agg after join + * + * @return Predicate + */ + public static Predicate filterForArrayAggregation() { + return filter -> filter.getAggregateCriteria().startsWith("array_agg") + || filter.getAggregateCriteria().startsWith("array_cat"); + } + + /** + * Accepts numbers only numbers as data type + * + * @return Predicate + */ + public static Predicate numberIsPositive() { + return number -> number.longValue() >= 0; + } + + /** + * Accepts numbers only + * + * @return Predicate + */ + public static Predicate number() { + return NumberUtils::isCreatable; + } + + /** + * Accepts numbers only + * + * @return Predicate + */ + public static Predicate dateInMillis() { + return object -> { + /* + * May be rewritten in future. I suppose date as long value + */ + return number().test(object); + }; + } + + /** + * Accepts only dates as data type + * + * @return Predicate + */ + public static Predicate filterForDates() { + return filter -> Date.class.isAssignableFrom(filter.getDataType()); + } + + /** + * Count of values provided to filter + * + * @return Predicate + */ + public static Predicate countOfValues(final int count) { + return values -> count == values.length; + } + + public static Predicate zoneOffset() { + return value -> { + if (value == null) { + return false; + } + try { + ZoneOffset.of(value); + } catch (DateTimeException e) { + return false; + } + return true; + }; + } + + public static Predicate timeStamp() { + return value -> { + if (value == null) { + return false; + } + try { + long offset = Long.parseLong(value); + LocalDateTime.of(LocalDate.now(), LocalTime.of(0, 0)).plusMinutes(offset); + } catch (NumberFormatException | DateTimeException e) { + return false; + } + return true; + }; + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java index 836349905..862bfe2ae 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java @@ -16,6 +16,127 @@ package com.epam.ta.reportportal.commons.querygen; +import static com.epam.ta.reportportal.commons.querygen.QueryBuilder.STATISTICS_KEY; +import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.CRITERIA_ACTION; +import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.CRITERIA_CREATION_DATE; +import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.CRITERIA_ENTITY; +import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.CRITERIA_LOGIN; +import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.CRITERIA_OBJECT_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.CRITERIA_OBJECT_NAME; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_DESCRIPTION; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_END_TIME; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_LAST_MODIFIED; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_LAUNCH_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_NAME; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_OWNER; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_PROJECT; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_PROJECT_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_SHARED; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_START_TIME; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_USER_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.IntegrationCriteriaConstant.CRITERIA_INTEGRATION_TYPE; +import static com.epam.ta.reportportal.commons.querygen.constant.IssueCriteriaConstant.CRITERIA_ISSUE_AUTO_ANALYZED; +import static com.epam.ta.reportportal.commons.querygen.constant.IssueCriteriaConstant.CRITERIA_ISSUE_COMMENT; +import static com.epam.ta.reportportal.commons.querygen.constant.IssueCriteriaConstant.CRITERIA_ISSUE_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.IssueCriteriaConstant.CRITERIA_ISSUE_IGNORE_ANALYZER; +import static com.epam.ta.reportportal.commons.querygen.constant.IssueCriteriaConstant.CRITERIA_ISSUE_LOCATOR; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_COMPOSITE_ATTRIBUTE; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_ITEM_ATTRIBUTE_KEY; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_ITEM_ATTRIBUTE_VALUE; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_LEVEL_ATTRIBUTE; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.KEY_VALUE_SEPARATOR; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.LAUNCH_ATTRIBUTE; +import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; +import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_NUMBER; +import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_STATUS; +import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_UUID; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_ITEM_LAUNCH_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_BINARY_CONTENT; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_LAUNCH_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_LEVEL; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_MESSAGE; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_PROJECT_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_TIME; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_TEST_ITEM_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.ProjectCriteriaConstant.CRITERIA_ALLOCATED_STORAGE; +import static com.epam.ta.reportportal.commons.querygen.constant.ProjectCriteriaConstant.CRITERIA_PROJECT_ATTRIBUTE_NAME; +import static com.epam.ta.reportportal.commons.querygen.constant.ProjectCriteriaConstant.CRITERIA_PROJECT_CREATION_DATE; +import static com.epam.ta.reportportal.commons.querygen.constant.ProjectCriteriaConstant.CRITERIA_PROJECT_NAME; +import static com.epam.ta.reportportal.commons.querygen.constant.ProjectCriteriaConstant.CRITERIA_PROJECT_ORGANIZATION; +import static com.epam.ta.reportportal.commons.querygen.constant.ProjectCriteriaConstant.CRITERIA_PROJECT_TYPE; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_CLUSTER_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_DURATION; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_HAS_CHILDREN; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_HAS_RETRIES; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_HAS_STATS; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_ISSUE_GROUP_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_ISSUE_TYPE; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_ISSUE_TYPE_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_PARAMETER_KEY; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_PARAMETER_VALUE; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_PARENT_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_PATH; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_PATTERN_TEMPLATE_NAME; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_RETRY_PARENT_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_RETRY_PARENT_LAUNCH_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_STATUS; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_TEST_CASE_HASH; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_TEST_CASE_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_TICKET_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_UNIQUE_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_UUID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.RETRY_PARENT; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_EMAIL; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_EXPIRED; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_FULL_NAME; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_LAST_LOGIN; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_ROLE; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_SYNCHRONIZATION_DATE; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_TYPE; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_USER; +import static com.epam.ta.reportportal.entity.project.ProjectInfo.LAST_RUN; +import static com.epam.ta.reportportal.entity.project.ProjectInfo.LAUNCHES_QUANTITY; +import static com.epam.ta.reportportal.entity.project.ProjectInfo.USERS_QUANTITY; +import static com.epam.ta.reportportal.jooq.Tables.ACL_CLASS; +import static com.epam.ta.reportportal.jooq.Tables.ACL_ENTRY; +import static com.epam.ta.reportportal.jooq.Tables.ACL_OBJECT_IDENTITY; +import static com.epam.ta.reportportal.jooq.Tables.ACTIVITY; +import static com.epam.ta.reportportal.jooq.Tables.ATTACHMENT; +import static com.epam.ta.reportportal.jooq.Tables.ATTRIBUTE; +import static com.epam.ta.reportportal.jooq.Tables.CLUSTERS_TEST_ITEM; +import static com.epam.ta.reportportal.jooq.Tables.DASHBOARD; +import static com.epam.ta.reportportal.jooq.Tables.DASHBOARD_WIDGET; +import static com.epam.ta.reportportal.jooq.Tables.FILTER; +import static com.epam.ta.reportportal.jooq.Tables.FILTER_CONDITION; +import static com.epam.ta.reportportal.jooq.Tables.FILTER_SORT; +import static com.epam.ta.reportportal.jooq.Tables.INTEGRATION; +import static com.epam.ta.reportportal.jooq.Tables.INTEGRATION_TYPE; +import static com.epam.ta.reportportal.jooq.Tables.ISSUE; +import static com.epam.ta.reportportal.jooq.Tables.ISSUE_GROUP; +import static com.epam.ta.reportportal.jooq.Tables.ISSUE_TICKET; +import static com.epam.ta.reportportal.jooq.Tables.ISSUE_TYPE; +import static com.epam.ta.reportportal.jooq.Tables.ITEM_ATTRIBUTE; +import static com.epam.ta.reportportal.jooq.Tables.LAUNCH; +import static com.epam.ta.reportportal.jooq.Tables.LOG; +import static com.epam.ta.reportportal.jooq.Tables.PARAMETER; +import static com.epam.ta.reportportal.jooq.Tables.PATTERN_TEMPLATE; +import static com.epam.ta.reportportal.jooq.Tables.PATTERN_TEMPLATE_TEST_ITEM; +import static com.epam.ta.reportportal.jooq.Tables.PROJECT; +import static com.epam.ta.reportportal.jooq.Tables.PROJECT_ATTRIBUTE; +import static com.epam.ta.reportportal.jooq.Tables.PROJECT_USER; +import static com.epam.ta.reportportal.jooq.Tables.SHAREABLE_ENTITY; +import static com.epam.ta.reportportal.jooq.Tables.STATISTICS; +import static com.epam.ta.reportportal.jooq.Tables.STATISTICS_FIELD; +import static com.epam.ta.reportportal.jooq.Tables.TEST_ITEM; +import static com.epam.ta.reportportal.jooq.Tables.TEST_ITEM_RESULTS; +import static com.epam.ta.reportportal.jooq.Tables.TICKET; +import static com.epam.ta.reportportal.jooq.Tables.USERS; +import static com.epam.ta.reportportal.jooq.Tables.WIDGET; +import static org.jooq.impl.DSL.choose; +import static org.jooq.impl.DSL.field; + import com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant; import com.epam.ta.reportportal.commons.querygen.query.JoinEntity; import com.epam.ta.reportportal.commons.querygen.query.QuerySupplier; @@ -36,1175 +157,1307 @@ import com.epam.ta.reportportal.jooq.enums.JStatusEnum; import com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum; import com.google.common.collect.Lists; -import org.jooq.*; -import org.jooq.impl.DSL; - import java.sql.Timestamp; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; - -import static com.epam.ta.reportportal.commons.querygen.QueryBuilder.STATISTICS_KEY; -import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.IntegrationCriteriaConstant.CRITERIA_INTEGRATION_TYPE; -import static com.epam.ta.reportportal.commons.querygen.constant.IssueCriteriaConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.ProjectCriteriaConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_TYPE; -import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.*; -import static com.epam.ta.reportportal.entity.project.ProjectInfo.*; -import static com.epam.ta.reportportal.jooq.Tables.*; -import static org.jooq.impl.DSL.choose; -import static org.jooq.impl.DSL.field; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.SelectField; +import org.jooq.SelectQuery; +import org.jooq.impl.DSL; public enum FilterTarget { - PROJECT_TARGET(Project.class, - Arrays.asList(new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, PROJECT.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_ALLOCATED_STORAGE, PROJECT.ALLOCATED_STORAGE, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_NAME, PROJECT.NAME, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ORGANIZATION, PROJECT.ORGANIZATION, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_TYPE, PROJECT.PROJECT_TYPE, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ATTRIBUTE_NAME, - ATTRIBUTE.NAME, - String.class, - Lists.newArrayList(JoinEntity.of(PROJECT_ATTRIBUTE, - JoinType.LEFT_OUTER_JOIN, - PROJECT.ID.eq(PROJECT_ATTRIBUTE.PROJECT_ID) - ), JoinEntity.of(ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, PROJECT_ATTRIBUTE.ATTRIBUTE_ID.eq(ATTRIBUTE.ID))) - ).get(), - new CriteriaHolderBuilder().newBuilder(USERS_QUANTITY, - USERS_QUANTITY, - Long.class, - Lists.newArrayList(JoinEntity.of(PROJECT_USER, - JoinType.LEFT_OUTER_JOIN, - PROJECT.ID.eq(PROJECT_USER.PROJECT_ID) - )) - ).withAggregateCriteria(DSL.countDistinct(PROJECT_USER.USER_ID).toString()).get(), - new CriteriaHolderBuilder().newBuilder(LAUNCHES_QUANTITY, - LAUNCHES_QUANTITY, - Long.class, - Lists.newArrayList(JoinEntity.of(LAUNCH, JoinType.LEFT_OUTER_JOIN, PROJECT.ID.eq(LAUNCH.PROJECT_ID))) - ) - .withAggregateCriteria(DSL.countDistinct(choose().when(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT) - .and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)), LAUNCH.ID)).toString()) - .get() - ) - ) { - @Override - protected Collection selectFields() { - return Lists.newArrayList(PROJECT.ID, - PROJECT.NAME, - PROJECT.ORGANIZATION, - PROJECT.PROJECT_TYPE, - PROJECT.CREATION_DATE, - PROJECT.METADATA, - PROJECT_ATTRIBUTE.VALUE, - ATTRIBUTE.NAME, - PROJECT_USER.PROJECT_ID, - PROJECT_USER.PROJECT_ROLE, - PROJECT_USER.USER_ID, - USERS.LOGIN - ); - } - - @Override - protected void addFrom(SelectQuery query) { - query.addFrom(PROJECT); - } - - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(PROJECT_USER, JoinType.LEFT_OUTER_JOIN, PROJECT.ID.eq(PROJECT_USER.PROJECT_ID)); - query.addJoin(USERS, JoinType.LEFT_OUTER_JOIN, PROJECT_USER.USER_ID.eq(USERS.ID)); - query.addJoin(PROJECT_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, PROJECT.ID.eq(PROJECT_ATTRIBUTE.PROJECT_ID)); - query.addJoin(ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, PROJECT_ATTRIBUTE.ATTRIBUTE_ID.eq(ATTRIBUTE.ID)); - query.addJoin(LAUNCH, JoinType.LEFT_OUTER_JOIN, PROJECT.ID.eq(LAUNCH.PROJECT_ID)); - } - - @Override - protected void joinTablesForFilter(QuerySupplier query) { - - } - - @Override - protected Field idField() { - return PROJECT.ID; - } - }, - - PROJECT_INFO(ProjectInfo.class, - Arrays.asList(new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, PROJECT.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_NAME, PROJECT.NAME, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_TYPE, PROJECT.PROJECT_TYPE, String.class).get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ORGANIZATION, PROJECT.ORGANIZATION, String.class).get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_CREATION_DATE, PROJECT.CREATION_DATE, Timestamp.class).get(), - - new CriteriaHolderBuilder().newBuilder(USERS_QUANTITY, USERS_QUANTITY, Long.class) - .withAggregateCriteria(DSL.countDistinct(PROJECT_USER.USER_ID).toString()) - .get(), - - new CriteriaHolderBuilder().newBuilder(LAST_RUN, LAST_RUN, Timestamp.class) - .withAggregateCriteria(DSL.max(LAUNCH.START_TIME).toString()) - .get(), - - new CriteriaHolderBuilder().newBuilder(LAUNCHES_QUANTITY, LAUNCHES_QUANTITY, Long.class) - .withAggregateCriteria(DSL.countDistinct(choose().when(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT) - .and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)), LAUNCH.ID)).toString()) - .get() - ) - ) { - @Override - public QuerySupplier getQuery() { - SelectQuery query = DSL.select(selectFields()).getQuery(); - addFrom(query); - query.addGroupBy(PROJECT.ID, PROJECT.CREATION_DATE, PROJECT.NAME, PROJECT.PROJECT_TYPE); - QuerySupplier querySupplier = new QuerySupplier(query); - joinTables(querySupplier); - return querySupplier; - } - - @Override - protected Collection selectFields() { - return Lists.newArrayList(DSL.countDistinct(PROJECT_USER.USER_ID).as(USERS_QUANTITY), - DSL.countDistinct(choose().when(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT).and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)), - LAUNCH.ID - )).as(LAUNCHES_QUANTITY), - DSL.max(LAUNCH.START_TIME).as(LAST_RUN), - PROJECT.ID, - PROJECT.CREATION_DATE, - PROJECT.NAME, - PROJECT.PROJECT_TYPE, - PROJECT.ORGANIZATION - ); - } - - @Override - protected void addFrom(SelectQuery query) { - query.addFrom(PROJECT); - } - - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(PROJECT_USER, JoinType.LEFT_OUTER_JOIN, PROJECT.ID.eq(PROJECT_USER.PROJECT_ID)); - query.addJoin(LAUNCH, JoinType.LEFT_OUTER_JOIN, PROJECT.ID.eq(LAUNCH.PROJECT_ID)); - } - - @Override - public QuerySupplier wrapQuery(SelectQuery query) { - throw new UnsupportedOperationException("Doesn't supported for Project Info query"); - } - - @Override - public QuerySupplier wrapQuery(SelectQuery query, String... excluding) { - throw new UnsupportedOperationException("Doesn't supported for Project Info query"); - } - - @Override - protected Field idField() { - return PROJECT.ID; - } - }, - - USER_TARGET(User.class, Arrays.asList( - - new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, USERS.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_USER, USERS.LOGIN, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_EMAIL, USERS.EMAIL, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_FULL_NAME, USERS.FULL_NAME, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_ROLE, USERS.ROLE, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_TYPE, USERS.TYPE, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_EXPIRED, USERS.EXPIRED, Boolean.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, PROJECT_USER.PROJECT_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT, PROJECT.NAME, List.class) - .withAggregateCriteria(DSL.arrayAgg(PROJECT.NAME).toString()) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LAST_LOGIN, - "(" + USERS.METADATA + "-> 'metadata' ->> 'last_login')::DOUBLE PRECISION ", - Long.class - ).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_SYNCHRONIZATION_DATE, - "(" + USERS.METADATA.getQualifiedName().toString() + "-> 'metadata' ->> 'synchronizationDate')::DOUBLE PRECISION ", - Long.class - ).get() - - )) { - @Override - protected Collection selectFields() { - return Lists.newArrayList(USERS.ID, - USERS.LOGIN, - USERS.FULL_NAME, - USERS.TYPE, - USERS.ATTACHMENT, - USERS.ATTACHMENT_THUMBNAIL, - USERS.EMAIL, - USERS.EXPIRED, - USERS.PASSWORD, - USERS.ROLE, - USERS.METADATA, - PROJECT.NAME, - PROJECT.PROJECT_TYPE, - PROJECT_USER.PROJECT_ID, - PROJECT_USER.PROJECT_ROLE, - PROJECT_USER.USER_ID - ); - } - - @Override - protected void addFrom(SelectQuery query) { - query.addFrom(USERS); - } - - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(PROJECT_USER, JoinType.LEFT_OUTER_JOIN, USERS.ID.eq(PROJECT_USER.USER_ID)); - query.addJoin(PROJECT, JoinType.LEFT_OUTER_JOIN, PROJECT_USER.PROJECT_ID.eq(PROJECT.ID)); - } - - @Override - protected Field idField() { - return USERS.ID; - } - }, - - LAUNCH_TARGET(Launch.class, Arrays.asList( - - new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, LAUNCH.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, LAUNCH.NAME, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_DESCRIPTION, LAUNCH.DESCRIPTION, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LAUNCH_UUID, LAUNCH.UUID, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_START_TIME, LAUNCH.START_TIME, Timestamp.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_END_TIME, LAUNCH.END_TIME, Timestamp.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, LAUNCH.PROJECT_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_USER_ID, LAUNCH.USER_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LAUNCH_NUMBER, LAUNCH.NUMBER, Integer.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LAST_MODIFIED, LAUNCH.LAST_MODIFIED, Timestamp.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LAUNCH_MODE, LAUNCH.MODE, JLaunchModeEnum.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LAUNCH_STATUS, LAUNCH.STATUS, JStatusEnum.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_HAS_RETRIES, LAUNCH.HAS_RETRIES, Boolean.class).get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_ITEM_ATTRIBUTE_KEY, - ITEM_ATTRIBUTE.KEY, - String.class, - Lists.newArrayList(JoinEntity.of(ITEM_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID))) - ).withAggregateCriteria(DSL.arrayAggDistinct(ITEM_ATTRIBUTE.KEY).filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)).toString()).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_ITEM_ATTRIBUTE_VALUE, - ITEM_ATTRIBUTE.VALUE, - String.class, - Lists.newArrayList(JoinEntity.of(ITEM_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID))) - ) - .withAggregateCriteria(DSL.arrayAggDistinct(ITEM_ATTRIBUTE.VALUE) - .filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)) - .toString()) - .get(), - new CriteriaHolderBuilder().newBuilder( - CRITERIA_COMPOSITE_ATTRIBUTE, - ITEM_ATTRIBUTE.KEY, - String[].class, - Lists.newArrayList(JoinEntity.of(LAUNCH_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, LAUNCH.ID.eq(LAUNCH_ATTRIBUTE.LAUNCH_ID))) - ).withAggregateCriteria(DSL.field("{0}::varchar[] || {1}::varchar[] || {2}::varchar[]", - DSL.arrayAggDistinct(DSL.concat(LAUNCH_ATTRIBUTE.KEY, ":")).filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(false)), - DSL.arrayAggDistinct(DSL.concat(LAUNCH_ATTRIBUTE.VALUE)).filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(false)), - DSL.arrayAgg(DSL.concat(DSL.coalesce(LAUNCH_ATTRIBUTE.KEY, ""), DSL.val(KEY_VALUE_SEPARATOR), LAUNCH_ATTRIBUTE.VALUE)) - .filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(false)) - ).toString()).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_USER, - USERS.LOGIN, - String.class, - Lists.newArrayList(JoinEntity.of(USERS, JoinType.LEFT_OUTER_JOIN, LAUNCH.USER_ID.eq(USERS.ID))) - ).withAggregateCriteria(DSL.max(USERS.LOGIN).toString()).get() - )) { - @Override - protected Collection selectFields() { - List> selectFields = new ArrayList<>(); - selectFields.addAll(getSelectSimpleFields()); - selectFields.addAll(getSelectAggregatedFields()); - - return selectFields; - } - - @Override - protected void addFrom(SelectQuery query) { - query.addFrom(LAUNCH); - } - - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(ITEM_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)); - query.addJoin(USERS, JoinType.LEFT_OUTER_JOIN, LAUNCH.USER_ID.eq(USERS.ID)); - query.addJoin(STATISTICS, JoinType.LEFT_OUTER_JOIN, LAUNCH.ID.eq(STATISTICS.LAUNCH_ID)); - query.addJoin(STATISTICS_FIELD, JoinType.LEFT_OUTER_JOIN, STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)); - } - - @Override - protected void joinTablesForFilter(QuerySupplier query) { - } - - @Override - protected Field idField() { - return LAUNCH.ID; - } - - @Override - protected void addGroupBy(QuerySupplier query) { - query.addGroupBy(getSelectSimpleFields()); - } - - @Override - public boolean withGrouping() { - return true; - } - - private List> getSelectSimpleFields() { - return Lists.newArrayList(LAUNCH.ID, - LAUNCH.UUID, - LAUNCH.NAME, - LAUNCH.DESCRIPTION, - LAUNCH.START_TIME, - LAUNCH.END_TIME, - LAUNCH.PROJECT_ID, - LAUNCH.USER_ID, - LAUNCH.NUMBER, - LAUNCH.LAST_MODIFIED, - LAUNCH.MODE, - LAUNCH.STATUS, - LAUNCH.HAS_RETRIES, - LAUNCH.RERUN, - LAUNCH.APPROXIMATE_DURATION, - STATISTICS.S_COUNTER, - STATISTICS_FIELD.NAME, - USERS.ID, - USERS.LOGIN - ); - } - - private List> getSelectAggregatedFields() { - return Lists.newArrayList(DSL.arrayAgg( - DSL.field("concat({0}, {1}, {2}, {3}, {4})", - ITEM_ATTRIBUTE.KEY, - KEY_VALUE_SEPARATOR, - ITEM_ATTRIBUTE.VALUE, - KEY_VALUE_SEPARATOR, - ITEM_ATTRIBUTE.SYSTEM - )).as(ATTRIBUTE_ALIAS) - ); - } - }, - - TEST_ITEM_TARGET(TestItem.class, - Arrays.asList(new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, LAUNCH.PROJECT_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, TEST_ITEM.ITEM_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, TEST_ITEM.NAME, String.class).get(), - new CriteriaHolderBuilder().newBuilder(TestItemCriteriaConstant.CRITERIA_TYPE, TEST_ITEM.TYPE, JTestItemTypeEnum.class) - .withAggregateCriteria(DSL.max(TEST_ITEM.TYPE).toString()) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_START_TIME, TEST_ITEM.START_TIME, Timestamp.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_DESCRIPTION, TEST_ITEM.DESCRIPTION, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LAST_MODIFIED, TEST_ITEM.LAST_MODIFIED, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PATH, TEST_ITEM.PATH, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_UNIQUE_ID, TEST_ITEM.UNIQUE_ID, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_UUID, TEST_ITEM.UUID, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_TEST_CASE_ID, TEST_ITEM.TEST_CASE_ID, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_TEST_CASE_HASH, TEST_ITEM.TEST_CASE_HASH, Integer.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PARENT_ID, TEST_ITEM.PARENT_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_HAS_CHILDREN, TEST_ITEM.HAS_CHILDREN, Boolean.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_HAS_RETRIES, TEST_ITEM.HAS_RETRIES, Boolean.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_HAS_STATS, TEST_ITEM.HAS_STATS, Boolean.class).get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_STATUS, - TEST_ITEM_RESULTS.STATUS, - JStatusEnum.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) - )) - ).withAggregateCriteria(DSL.max(TEST_ITEM_RESULTS.STATUS).toString()).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_END_TIME, - TEST_ITEM_RESULTS.END_TIME, - Timestamp.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) - )) - ).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_DURATION, - TEST_ITEM_RESULTS.DURATION, - Long.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) - )) - ).get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_PARAMETER_KEY, - PARAMETER.KEY, - String.class, - Lists.newArrayList(JoinEntity.of(PARAMETER, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(PARAMETER.ITEM_ID))) - ).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PARAMETER_VALUE, - PARAMETER.VALUE, - String.class, - Lists.newArrayList(JoinEntity.of(PARAMETER, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(PARAMETER.ITEM_ID))) - ).get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_ID, - ISSUE.ISSUE_ID, - Long.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) - ), JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID))) - ).get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_TYPE, - ISSUE_TYPE.LOCATOR, - String.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) - ), - JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)), - JoinEntity.of(ISSUE_TYPE, JoinType.LEFT_OUTER_JOIN, ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) - ) - ).get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_TYPE_ID, - ISSUE.ISSUE_TYPE, - Long.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) - ), - JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)) - ) - ).get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_AUTO_ANALYZED, - ISSUE.AUTO_ANALYZED, - Boolean.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) - ), JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID))) - ).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_IGNORE_ANALYZER, - ISSUE.IGNORE_ANALYZER, - Boolean.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) - ), JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID))) - ).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_COMMENT, - ISSUE.ISSUE_DESCRIPTION, - String.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) - ), JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID))) - ).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_LOCATOR, - ISSUE_TYPE.LOCATOR, - String.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) - ), - JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)), - JoinEntity.of(ISSUE_TYPE, JoinType.LEFT_OUTER_JOIN, ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) - ) - ).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_GROUP_ID, - ISSUE_TYPE.ISSUE_GROUP_ID, - Short.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) - ), - JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)), - JoinEntity.of(ISSUE_TYPE, JoinType.LEFT_OUTER_JOIN, ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) - ) - ).get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_LAUNCH_ID, TEST_ITEM.LAUNCH_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LAUNCH_MODE, LAUNCH.MODE, JLaunchModeEnum.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PARENT_ID, TEST_ITEM.PARENT_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_RETRY_PARENT_ID, TEST_ITEM.RETRY_OF, Long.class).get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_ITEM_ATTRIBUTE_KEY, - ITEM_ATTRIBUTE.KEY, - List.class, - Lists.newArrayList(JoinEntity.of(ITEM_ATTRIBUTE, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID) - )) - ) - .withAggregateCriteria(DSL.arrayAggDistinct(ITEM_ATTRIBUTE.KEY) - .filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)) - .toString()) - .get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_ITEM_ATTRIBUTE_VALUE, - ITEM_ATTRIBUTE.VALUE, - List.class, - Lists.newArrayList(JoinEntity.of(ITEM_ATTRIBUTE, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID) - )) - ) - .withAggregateCriteria(DSL.arrayAggDistinct(ITEM_ATTRIBUTE.VALUE) - .filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)) - .toString()) - .get(), - - new CriteriaHolderBuilder().newBuilder( - CRITERIA_LEVEL_ATTRIBUTE, - ITEM_ATTRIBUTE.KEY, - List.class, - Lists.newArrayList(JoinEntity.of(ITEM_ATTRIBUTE, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID) - ), - JoinEntity.of(LAUNCH_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, LAUNCH.ID.eq(LAUNCH_ATTRIBUTE.LAUNCH_ID)) - ) - ) - .withAggregateCriteria(DSL.field("array_cat({0}, {1})::varchar[]", - DSL.arrayAgg(DSL.concat(DSL.coalesce(ITEM_ATTRIBUTE.KEY, ""), - DSL.val(KEY_VALUE_SEPARATOR), - ITEM_ATTRIBUTE.VALUE - )).filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)), - DSL.arrayAgg(DSL.concat(DSL.coalesce(LAUNCH_ATTRIBUTE.KEY, ""), - DSL.val(KEY_VALUE_SEPARATOR), - LAUNCH_ATTRIBUTE.VALUE - )).filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(false)) - ).toString()) - .get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_COMPOSITE_ATTRIBUTE, ITEM_ATTRIBUTE.KEY, String[].class, Lists.newArrayList( - JoinEntity.of(ITEM_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID)), - JoinEntity.of(LAUNCH_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, LAUNCH.ID.eq(LAUNCH_ATTRIBUTE.LAUNCH_ID)) - )).withAggregateCriteria(DSL.field( - "{0}::varchar[] || {1}::varchar[] || {2}::varchar[] || {3}::varchar[] || {4}::varchar[] || {5}::varchar[]", - DSL.arrayAggDistinct(DSL.concat(LAUNCH_ATTRIBUTE.KEY, ":")).filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(false)), - DSL.arrayAggDistinct(DSL.concat(LAUNCH_ATTRIBUTE.VALUE)).filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(false)), - DSL.arrayAgg(DSL.concat(DSL.coalesce(LAUNCH_ATTRIBUTE.KEY, ""), - DSL.val(KEY_VALUE_SEPARATOR), - LAUNCH_ATTRIBUTE.VALUE - )) - .filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(false)), - DSL.arrayAggDistinct(DSL.concat(ITEM_ATTRIBUTE.KEY, ":")).filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)), - DSL.arrayAggDistinct(DSL.concat(ITEM_ATTRIBUTE.VALUE)).filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)), - DSL.arrayAgg(DSL.concat(DSL.coalesce(ITEM_ATTRIBUTE.KEY, ""), - DSL.val(KEY_VALUE_SEPARATOR), - ITEM_ATTRIBUTE.VALUE - )) - .filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)) - ).toString()).get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_PATTERN_TEMPLATE_NAME, - PATTERN_TEMPLATE.NAME, - List.class, - Lists.newArrayList(JoinEntity.of(PATTERN_TEMPLATE_TEST_ITEM, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID) - ), - JoinEntity.of(PATTERN_TEMPLATE, - JoinType.LEFT_OUTER_JOIN, - PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID.eq(PATTERN_TEMPLATE.ID) - ) - ) - ).withAggregateCriteria(DSL.arrayAggDistinct(PATTERN_TEMPLATE.NAME).toString()).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_TICKET_ID, - TICKET.TICKET_ID, - String.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) - ), - JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)), - JoinEntity.of(ISSUE_TICKET, JoinType.LEFT_OUTER_JOIN, ISSUE.ISSUE_ID.eq(ISSUE_TICKET.ISSUE_ID)), - JoinEntity.of(TICKET, JoinType.LEFT_OUTER_JOIN, ISSUE_TICKET.TICKET_ID.eq(TICKET.ID)) - ) - ).withAggregateCriteria(DSL.arrayAggDistinct(TICKET.TICKET_ID).toString()).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_CLUSTER_ID, - CLUSTERS_TEST_ITEM.CLUSTER_ID, - Long.class, - Lists.newArrayList( - JoinEntity.of(CLUSTERS_TEST_ITEM, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(CLUSTERS_TEST_ITEM.ITEM_ID)) - ) - ).withAggregateCriteria(DSL.arrayAggDistinct(CLUSTERS_TEST_ITEM.CLUSTER_ID).toString()).get() - ) - ) { - @Override - protected Collection selectFields() { - List> selectFields = new ArrayList<>(); - selectFields.addAll(getSelectSimpleFields()); - selectFields.addAll(getSelectAggregatedFields()); - - return selectFields; - } - - @Override - protected void addFrom(SelectQuery query) { - query.addFrom(TEST_ITEM); - } - - @Override - protected Field idField() { - return TEST_ITEM.ITEM_ID; - } - - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(LAUNCH, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)); - query.addJoin(TEST_ITEM_RESULTS, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)); - query.addJoin(ITEM_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID)); - query.addJoin(STATISTICS, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(STATISTICS.ITEM_ID)); - query.addJoin(STATISTICS_FIELD, JoinType.LEFT_OUTER_JOIN, STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)); - query.addJoin(PATTERN_TEMPLATE_TEST_ITEM, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID)); - query.addJoin(PATTERN_TEMPLATE, JoinType.LEFT_OUTER_JOIN, PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID.eq(PATTERN_TEMPLATE.ID)); - query.addJoin(ISSUE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)); - query.addJoin(ISSUE_TYPE, JoinType.LEFT_OUTER_JOIN, ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)); - query.addJoin(ISSUE_GROUP, JoinType.LEFT_OUTER_JOIN, ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)); - query.addJoin(ISSUE_TICKET, JoinType.LEFT_OUTER_JOIN, ISSUE.ISSUE_ID.eq(ISSUE_TICKET.ISSUE_ID)); - query.addJoin(TICKET, JoinType.LEFT_OUTER_JOIN, ISSUE_TICKET.TICKET_ID.eq(TICKET.ID)); - query.addJoin(PARAMETER, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(PARAMETER.ITEM_ID)); - query.addJoin(LAUNCH_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, LAUNCH.ID.eq(LAUNCH_ATTRIBUTE.LAUNCH_ID)); - query.addJoin(CLUSTERS_TEST_ITEM, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(CLUSTERS_TEST_ITEM.ITEM_ID)); - } - - @Override - protected void joinTablesForFilter(QuerySupplier query) { - query.addJoin(LAUNCH, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)); - } - - @Override - protected void addGroupBy(QuerySupplier query) { - query.addGroupBy(getSelectSimpleFields()); - } - - @Override - public boolean withGrouping() { - return true; - } - - private List> getSelectSimpleFields() { - return Lists.newArrayList(TEST_ITEM.ITEM_ID, - TEST_ITEM.NAME, - TEST_ITEM.CODE_REF, - TEST_ITEM.TYPE, - TEST_ITEM.START_TIME, - TEST_ITEM.DESCRIPTION, - TEST_ITEM.LAST_MODIFIED, - TEST_ITEM.PATH, - TEST_ITEM.UNIQUE_ID, - TEST_ITEM.UUID, - TEST_ITEM.TEST_CASE_ID, - TEST_ITEM.TEST_CASE_HASH, - TEST_ITEM.PARENT_ID, - TEST_ITEM.RETRY_OF, - TEST_ITEM.HAS_CHILDREN, - TEST_ITEM.HAS_STATS, - TEST_ITEM.HAS_RETRIES, - TEST_ITEM.LAUNCH_ID, - TEST_ITEM_RESULTS.STATUS, - TEST_ITEM_RESULTS.END_TIME, - TEST_ITEM_RESULTS.DURATION, - PARAMETER.ITEM_ID, - PARAMETER.KEY, - PARAMETER.VALUE, - STATISTICS_FIELD.NAME, - STATISTICS.S_COUNTER, - ISSUE.ISSUE_ID, - ISSUE.AUTO_ANALYZED, - ISSUE.IGNORE_ANALYZER, - ISSUE.ISSUE_DESCRIPTION, - ISSUE_TYPE.LOCATOR, - ISSUE_TYPE.ABBREVIATION, - ISSUE_TYPE.HEX_COLOR, - ISSUE_TYPE.ISSUE_NAME, - ISSUE_GROUP.ISSUE_GROUP_, - TICKET.ID, - TICKET.BTS_PROJECT, - TICKET.BTS_URL, - TICKET.TICKET_ID, - TICKET.URL, - TICKET.PLUGIN_NAME, - PATTERN_TEMPLATE.ID, - PATTERN_TEMPLATE.NAME - ); - } - - private List> getSelectAggregatedFields() { - return Lists.newArrayList(DSL.arrayAgg( - DSL.field("concat({0}, {1}, {2}, {3}, {4})", - ITEM_ATTRIBUTE.KEY, - KEY_VALUE_SEPARATOR, - ITEM_ATTRIBUTE.VALUE, - KEY_VALUE_SEPARATOR, - ITEM_ATTRIBUTE.SYSTEM - )).as(ATTRIBUTE_ALIAS) - ); - } - }, - - LOG_TARGET(Log.class, Arrays.asList( - - new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, LOG.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LOG_ID, LOG.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LOG_TIME, LOG.LOG_TIME, Timestamp.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LAST_MODIFIED, LOG.LAST_MODIFIED, Timestamp.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LOG_LEVEL, LOG.LOG_LEVEL, LogLevel.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LOG_MESSAGE, LOG.LOG_MESSAGE, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_TEST_ITEM_ID, LOG.ITEM_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LOG_LAUNCH_ID, LOG.LAUNCH_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LOG_PROJECT_ID, LOG.PROJECT_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LOG_BINARY_CONTENT, - ATTACHMENT.FILE_ID, - String.class, - Lists.newArrayList(JoinEntity.of(ATTACHMENT, JoinType.LEFT_OUTER_JOIN, LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID))) - ).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_ITEM_LAUNCH_ID, - TEST_ITEM.LAUNCH_ID, - Long.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM, JoinType.LEFT_OUTER_JOIN, LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID))) - ).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_RETRY_PARENT_ID, - TEST_ITEM.RETRY_OF, - Long.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM, JoinType.LEFT_OUTER_JOIN, LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID))) - ).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_RETRY_PARENT_LAUNCH_ID, - TEST_ITEM.as(RETRY_PARENT).LAUNCH_ID, - Long.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM, JoinType.LEFT_OUTER_JOIN, LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)), - JoinEntity.of(TEST_ITEM.as(RETRY_PARENT), - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.RETRY_OF.eq(TEST_ITEM.as(RETRY_PARENT).ITEM_ID) - ) - ) - ).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PATH, - TEST_ITEM.PATH, - String.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM, JoinType.LEFT_OUTER_JOIN, LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID))) - ).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_STATUS, - TEST_ITEM_RESULTS.STATUS, - JStatusEnum.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM, JoinType.LEFT_OUTER_JOIN, LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)), - JoinEntity.of(TEST_ITEM_RESULTS, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - ) - ).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_AUTO_ANALYZED, - ISSUE.AUTO_ANALYZED, - Boolean.class, - Lists.newArrayList(JoinEntity.of(TEST_ITEM, JoinType.LEFT_OUTER_JOIN, LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)), - JoinEntity.of(TEST_ITEM_RESULTS, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)), - JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)) - ) - ).get() - )) { - @Override - protected Collection selectFields() { - return Lists.newArrayList(LOG.ID, - LOG.LOG_TIME, - LOG.LOG_MESSAGE, - LOG.LAST_MODIFIED, - LOG.LOG_LEVEL, - LOG.ITEM_ID, - LOG.LAUNCH_ID, - LOG.ATTACHMENT_ID, - ATTACHMENT.ID, - ATTACHMENT.FILE_ID, - ATTACHMENT.THUMBNAIL_ID, - ATTACHMENT.CONTENT_TYPE, - ATTACHMENT.FILE_SIZE, - ATTACHMENT.PROJECT_ID, - ATTACHMENT.LAUNCH_ID, - ATTACHMENT.ITEM_ID - ); - } - - @Override - protected void addFrom(SelectQuery query) { - query.addFrom(LOG); - } - - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(TEST_ITEM, JoinType.LEFT_OUTER_JOIN, LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)); - query.addJoin(TEST_ITEM_RESULTS, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)); - query.addJoin(ISSUE, JoinType.LEFT_OUTER_JOIN, TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)); - query.addJoin(ATTACHMENT, JoinType.LEFT_OUTER_JOIN, LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)); - } - - @Override - protected void joinTablesForFilter(QuerySupplier query) { - - } - - @Override - protected Field idField() { - return LOG.ID; - } - }, - - ACTIVITY_TARGET(Activity.class, Arrays.asList( - - new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, ACTIVITY.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, ACTIVITY.PROJECT_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_NAME, PROJECT.NAME, Long.class) - .withAggregateCriteria(DSL.max(PROJECT.NAME).toString()) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_USER_ID, ACTIVITY.USER_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_ENTITY, ACTIVITY.ENTITY, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_ACTION, ACTIVITY.ACTION, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_LOGIN, ACTIVITY.USERNAME, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_CREATION_DATE, ACTIVITY.CREATION_DATE, Timestamp.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_OBJECT_ID, ACTIVITY.OBJECT_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_USER, USERS.LOGIN, String.class) - .withAggregateCriteria(DSL.max(USERS.LOGIN).toString()) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_OBJECT_NAME, ACTIVITY.DETAILS + " ->> 'objectName'", String.class).get() - )) { - @Override - protected Collection selectFields() { - return Lists.newArrayList(ACTIVITY.ID, - ACTIVITY.PROJECT_ID, - ACTIVITY.USERNAME, - ACTIVITY.USER_ID, - ACTIVITY.ENTITY, - ACTIVITY.ACTION, - ACTIVITY.CREATION_DATE, - ACTIVITY.DETAILS, - ACTIVITY.OBJECT_ID, - USERS.LOGIN, - PROJECT.NAME - ); - } - - @Override - protected void addFrom(SelectQuery query) { - query.addFrom(ACTIVITY); - } - - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(USERS, JoinType.LEFT_OUTER_JOIN, ACTIVITY.USER_ID.eq(USERS.ID)); - query.addJoin(PROJECT, JoinType.JOIN, ACTIVITY.PROJECT_ID.eq(PROJECT.ID)); - } - - @Override - protected Field idField() { - return ACTIVITY.ID; - } - }, - - INTEGRATION_TARGET(Integration.class, Arrays.asList( - - new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, INTEGRATION.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, INTEGRATION.PROJECT_ID, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_INTEGRATION_TYPE, INTEGRATION_TYPE.GROUP_TYPE, JIntegrationGroupEnum.class) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, INTEGRATION_TYPE.NAME, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_NAME, PROJECT.NAME, String.class).get() - )) { - @Override - protected Collection selectFields() { - return Lists.newArrayList(INTEGRATION.ID, - INTEGRATION.NAME, - INTEGRATION.PROJECT_ID, - INTEGRATION.TYPE, - INTEGRATION.PARAMS, - INTEGRATION.CREATOR, - INTEGRATION.CREATION_DATE, - INTEGRATION_TYPE.NAME, - INTEGRATION_TYPE.GROUP_TYPE, - PROJECT.NAME - ); - } - - @Override - protected void addFrom(SelectQuery query) { - query.addFrom(INTEGRATION); - } - - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(INTEGRATION_TYPE, JoinType.JOIN, INTEGRATION.TYPE.eq(INTEGRATION_TYPE.ID)); - query.addJoin(PROJECT, JoinType.JOIN, INTEGRATION.PROJECT_ID.eq(PROJECT.ID)); - } - - @Override - protected Field idField() { - return DSL.cast(INTEGRATION.ID, Long.class); - } - }, - - DASHBOARD_TARGET(Dashboard.class, Arrays.asList( - - new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, DASHBOARD.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, DASHBOARD.NAME, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_SHARED, SHAREABLE_ENTITY.SHARED, Boolean.class) - .withAggregateCriteria(DSL.boolAnd(SHAREABLE_ENTITY.SHARED).toString()) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, SHAREABLE_ENTITY.PROJECT_ID, Long.class) - .withAggregateCriteria(DSL.max(SHAREABLE_ENTITY.PROJECT_ID).toString()) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, SHAREABLE_ENTITY.OWNER, String.class) - .withAggregateCriteria(DSL.max(SHAREABLE_ENTITY.OWNER).toString()) - .get() - )) { - @Override - protected Collection selectFields() { - return Lists.newArrayList(DASHBOARD.ID, - DASHBOARD.NAME, - DASHBOARD.DESCRIPTION, - DASHBOARD.CREATION_DATE, - DASHBOARD_WIDGET.WIDGET_OWNER, - DASHBOARD_WIDGET.IS_CREATED_ON, - DASHBOARD_WIDGET.WIDGET_ID, - DASHBOARD_WIDGET.WIDGET_NAME, - DASHBOARD_WIDGET.WIDGET_TYPE, - DASHBOARD_WIDGET.WIDGET_HEIGHT, - DASHBOARD_WIDGET.WIDGET_WIDTH, - DASHBOARD_WIDGET.WIDGET_POSITION_X, - DASHBOARD_WIDGET.WIDGET_POSITION_Y, - WIDGET.WIDGET_OPTIONS, - DASHBOARD_WIDGET.SHARE, - SHAREABLE_ENTITY.SHARED, - SHAREABLE_ENTITY.PROJECT_ID, - SHAREABLE_ENTITY.OWNER - ); - } - - @Override - protected void addFrom(SelectQuery query) { - query.addFrom(DASHBOARD); - } - - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(DASHBOARD_WIDGET, JoinType.LEFT_OUTER_JOIN, DASHBOARD.ID.eq(DASHBOARD_WIDGET.DASHBOARD_ID)); - query.addJoin(WIDGET, JoinType.LEFT_OUTER_JOIN, DASHBOARD_WIDGET.WIDGET_ID.eq(WIDGET.ID)); - query.addJoin(SHAREABLE_ENTITY, JoinType.JOIN, DASHBOARD.ID.eq(SHAREABLE_ENTITY.ID)); - query.addJoin(ACL_OBJECT_IDENTITY, JoinType.JOIN, DASHBOARD.ID.cast(String.class).eq(ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY)); - query.addJoin(ACL_CLASS, JoinType.JOIN, ACL_CLASS.ID.eq(ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS)); - query.addJoin(ACL_ENTRY, JoinType.JOIN, ACL_ENTRY.ACL_OBJECT_IDENTITY.eq(ACL_OBJECT_IDENTITY.ID)); - } - - @Override - protected Field idField() { - return DASHBOARD.ID.cast(Long.class); - } - }, - - WIDGET_TARGET(Widget.class, Arrays.asList( - - new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, WIDGET.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, WIDGET.NAME, String.class) - .withAggregateCriteria(DSL.max(WIDGET.NAME).toString()) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_DESCRIPTION, WIDGET.DESCRIPTION, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_SHARED, SHAREABLE_ENTITY.SHARED, Boolean.class) - .withAggregateCriteria(DSL.boolAnd(SHAREABLE_ENTITY.SHARED).toString()) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, SHAREABLE_ENTITY.PROJECT_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, SHAREABLE_ENTITY.OWNER, String.class) - .withAggregateCriteria(DSL.max(SHAREABLE_ENTITY.OWNER).toString()) - .get() - - )) { - @Override - protected Collection selectFields() { - return Lists.newArrayList(WIDGET.ID, - WIDGET.NAME, - WIDGET.WIDGET_TYPE, - WIDGET.DESCRIPTION, - WIDGET.ITEMS_COUNT, - SHAREABLE_ENTITY.PROJECT_ID, - SHAREABLE_ENTITY.SHARED, - SHAREABLE_ENTITY.OWNER - ); - } - - @Override - protected void addFrom(SelectQuery query) { - query.addFrom(WIDGET); - } - - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(SHAREABLE_ENTITY, JoinType.JOIN, WIDGET.ID.eq(SHAREABLE_ENTITY.ID)); - query.addJoin(ACL_OBJECT_IDENTITY, JoinType.JOIN, WIDGET.ID.cast(String.class).eq(ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY)); - query.addJoin(ACL_CLASS, JoinType.JOIN, ACL_CLASS.ID.eq(ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS)); - query.addJoin(ACL_ENTRY, JoinType.JOIN, ACL_ENTRY.ACL_OBJECT_IDENTITY.eq(ACL_OBJECT_IDENTITY.ID)); - } - - @Override - protected Field idField() { - return WIDGET.ID; - } - }, - - USER_FILTER_TARGET(UserFilter.class, - Arrays.asList(new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, FILTER.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, FILTER.NAME, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_SHARED, SHAREABLE_ENTITY.SHARED, Boolean.class) - .withAggregateCriteria(DSL.boolAnd(SHAREABLE_ENTITY.SHARED).toString()) - .get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, SHAREABLE_ENTITY.PROJECT_ID, Long.class) - .withAggregateCriteria(DSL.max(SHAREABLE_ENTITY.PROJECT_ID).toString()) - .get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, SHAREABLE_ENTITY.OWNER, String.class) - .withAggregateCriteria(DSL.max(SHAREABLE_ENTITY.OWNER).toString()) - .get() - ) - ) { - @Override - protected Collection selectFields() { - return Lists.newArrayList(FILTER.ID, - FILTER.NAME, - FILTER.TARGET, - FILTER.DESCRIPTION, - FILTER_CONDITION.SEARCH_CRITERIA, - FILTER_CONDITION.CONDITION, - FILTER_CONDITION.VALUE, - FILTER_CONDITION.NEGATIVE, - FILTER_SORT.FIELD, - FILTER_SORT.DIRECTION, - SHAREABLE_ENTITY.SHARED, - SHAREABLE_ENTITY.PROJECT_ID, - SHAREABLE_ENTITY.OWNER - ); - } - - @Override - protected void addFrom(SelectQuery query) { - query.addFrom(FILTER); - } - - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(SHAREABLE_ENTITY, JoinType.JOIN, FILTER.ID.eq(SHAREABLE_ENTITY.ID)); - query.addJoin(FILTER_CONDITION, JoinType.LEFT_OUTER_JOIN, FILTER.ID.eq(FILTER_CONDITION.FILTER_ID)); - query.addJoin(FILTER_SORT, JoinType.LEFT_OUTER_JOIN, FILTER.ID.eq(FILTER_SORT.FILTER_ID)); - query.addJoin(ACL_OBJECT_IDENTITY, JoinType.JOIN, FILTER.ID.cast(String.class).eq(ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY)); - query.addJoin(ACL_CLASS, JoinType.JOIN, ACL_CLASS.ID.eq(ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS)); - query.addJoin(ACL_ENTRY, JoinType.JOIN, ACL_ENTRY.ACL_OBJECT_IDENTITY.eq(ACL_OBJECT_IDENTITY.ID)); - } - - @Override - protected Field idField() { - return FILTER.ID; - } - }; - - public static final String FILTERED_QUERY = "filtered"; - public static final String ATTRIBUTE_ALIAS = "attribute"; - public static final String FILTERED_ID = "id"; - - private Class clazz; - private List criteriaHolders; - - FilterTarget(Class clazz, List criteriaHolders) { - this.clazz = clazz; - this.criteriaHolders = criteriaHolders; - } - - public QuerySupplier getQuery() { - SelectQuery query = DSL.select(idField().as(FILTERED_ID)).getQuery(); - addFrom(query); - query.addGroupBy(idField()); - - QuerySupplier querySupplier = new QuerySupplier(query); - joinTablesForFilter(querySupplier); - return querySupplier; - } - - protected abstract Collection selectFields(); - - protected abstract void addFrom(SelectQuery query); - - protected abstract void joinTables(QuerySupplier query); - - protected void joinTablesForFilter(QuerySupplier query) { - joinTables(query); - } - - protected void addGroupBy(QuerySupplier query) { - } - - protected abstract Field idField(); - - public QuerySupplier wrapQuery(SelectQuery query) { - SelectQuery wrappedQuery = DSL.with(FILTERED_QUERY).as(query).select(selectFields()).getQuery(); - addFrom(wrappedQuery); - QuerySupplier querySupplier = new QuerySupplier(wrappedQuery); - querySupplier.addJoin(DSL.table(DSL.name(FILTERED_QUERY)), - JoinType.JOIN, - idField().eq(field(DSL.name(FILTERED_QUERY, FILTERED_ID), Long.class)) - ); - joinTables(querySupplier); - addGroupBy(querySupplier); - return querySupplier; - } - - public QuerySupplier wrapQuery(SelectQuery query, String... excluding) { - List excludingFields = Lists.newArrayList(excluding); - List fields = selectFields().stream() - .filter(it -> !excludingFields.contains(it.getName())) - .collect(Collectors.toList()); - SelectQuery wrappedQuery = DSL.with(FILTERED_QUERY).as(query).select(fields).getQuery(); - addFrom(wrappedQuery); - QuerySupplier querySupplier = new QuerySupplier(wrappedQuery); - querySupplier.addJoin(DSL.table(DSL.name(FILTERED_QUERY)), - JoinType.JOIN, - idField().eq(field(DSL.name(FILTERED_QUERY, FILTERED_ID), Long.class)) - ); - joinTables(querySupplier); - addGroupBy(querySupplier); - return querySupplier; - } - - public Class getClazz() { - return clazz; - } - - public List getCriteriaHolders() { - return criteriaHolders; - } - - public Optional getCriteriaByFilter(String filterCriteria) { + PROJECT_TARGET(Project.class, + Arrays.asList( + new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, PROJECT.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_ALLOCATED_STORAGE, + PROJECT.ALLOCATED_STORAGE, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_NAME, PROJECT.NAME, String.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ORGANIZATION, + PROJECT.ORGANIZATION, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_TYPE, PROJECT.PROJECT_TYPE, + String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ATTRIBUTE_NAME, + ATTRIBUTE.NAME, + String.class, + Lists.newArrayList(JoinEntity.of(PROJECT_ATTRIBUTE, + JoinType.LEFT_OUTER_JOIN, + PROJECT.ID.eq(PROJECT_ATTRIBUTE.PROJECT_ID) + ), JoinEntity.of(ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, + PROJECT_ATTRIBUTE.ATTRIBUTE_ID.eq(ATTRIBUTE.ID))) + ).get(), + new CriteriaHolderBuilder().newBuilder(USERS_QUANTITY, + USERS_QUANTITY, + Long.class, + Lists.newArrayList(JoinEntity.of(PROJECT_USER, + JoinType.LEFT_OUTER_JOIN, + PROJECT.ID.eq(PROJECT_USER.PROJECT_ID) + )) + ).withAggregateCriteria(DSL.countDistinct(PROJECT_USER.USER_ID).toString()).get(), + new CriteriaHolderBuilder().newBuilder(LAUNCHES_QUANTITY, + LAUNCHES_QUANTITY, + Long.class, + Lists.newArrayList( + JoinEntity.of(LAUNCH, JoinType.LEFT_OUTER_JOIN, PROJECT.ID.eq(LAUNCH.PROJECT_ID))) + ) + .withAggregateCriteria( + DSL.countDistinct(choose().when(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT) + .and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)), LAUNCH.ID)).toString()) + .get() + ) + ) { + @Override + protected Collection selectFields() { + return Lists.newArrayList(PROJECT.ID, + PROJECT.NAME, + PROJECT.ORGANIZATION, + PROJECT.PROJECT_TYPE, + PROJECT.CREATION_DATE, + PROJECT.METADATA, + PROJECT_ATTRIBUTE.VALUE, + ATTRIBUTE.NAME, + PROJECT_USER.PROJECT_ID, + PROJECT_USER.PROJECT_ROLE, + PROJECT_USER.USER_ID, + USERS.LOGIN + ); + } + + @Override + protected void addFrom(SelectQuery query) { + query.addFrom(PROJECT); + } + + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(PROJECT_USER, JoinType.LEFT_OUTER_JOIN, PROJECT.ID.eq(PROJECT_USER.PROJECT_ID)); + query.addJoin(USERS, JoinType.LEFT_OUTER_JOIN, PROJECT_USER.USER_ID.eq(USERS.ID)); + query.addJoin(PROJECT_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, + PROJECT.ID.eq(PROJECT_ATTRIBUTE.PROJECT_ID)); + query.addJoin(ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, + PROJECT_ATTRIBUTE.ATTRIBUTE_ID.eq(ATTRIBUTE.ID)); + query.addJoin(LAUNCH, JoinType.LEFT_OUTER_JOIN, PROJECT.ID.eq(LAUNCH.PROJECT_ID)); + } + + @Override + protected void joinTablesForFilter(QuerySupplier query) { + + } + + @Override + protected Field idField() { + return PROJECT.ID; + } + }, + + PROJECT_INFO(ProjectInfo.class, + Arrays.asList( + new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, PROJECT.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_NAME, PROJECT.NAME, String.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_TYPE, PROJECT.PROJECT_TYPE, + String.class).get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ORGANIZATION, + PROJECT.ORGANIZATION, String.class).get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_CREATION_DATE, + PROJECT.CREATION_DATE, Timestamp.class).get(), + + new CriteriaHolderBuilder().newBuilder(USERS_QUANTITY, USERS_QUANTITY, Long.class) + .withAggregateCriteria(DSL.countDistinct(PROJECT_USER.USER_ID).toString()) + .get(), + + new CriteriaHolderBuilder().newBuilder(LAST_RUN, LAST_RUN, Timestamp.class) + .withAggregateCriteria(DSL.max(LAUNCH.START_TIME).toString()) + .get(), + + new CriteriaHolderBuilder().newBuilder(LAUNCHES_QUANTITY, LAUNCHES_QUANTITY, Long.class) + .withAggregateCriteria( + DSL.countDistinct(choose().when(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT) + .and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)), LAUNCH.ID)).toString()) + .get() + ) + ) { + @Override + public QuerySupplier getQuery() { + SelectQuery query = DSL.select(selectFields()).getQuery(); + addFrom(query); + query.addGroupBy(PROJECT.ID, PROJECT.CREATION_DATE, PROJECT.NAME, PROJECT.PROJECT_TYPE); + QuerySupplier querySupplier = new QuerySupplier(query); + joinTables(querySupplier); + return querySupplier; + } + + @Override + protected Collection selectFields() { + return Lists.newArrayList(DSL.countDistinct(PROJECT_USER.USER_ID).as(USERS_QUANTITY), + DSL.countDistinct(choose().when(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT) + .and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)), + LAUNCH.ID + )).as(LAUNCHES_QUANTITY), + DSL.max(LAUNCH.START_TIME).as(LAST_RUN), + PROJECT.ID, + PROJECT.CREATION_DATE, + PROJECT.NAME, + PROJECT.PROJECT_TYPE, + PROJECT.ORGANIZATION + ); + } + + @Override + protected void addFrom(SelectQuery query) { + query.addFrom(PROJECT); + } + + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(PROJECT_USER, JoinType.LEFT_OUTER_JOIN, PROJECT.ID.eq(PROJECT_USER.PROJECT_ID)); + query.addJoin(LAUNCH, JoinType.LEFT_OUTER_JOIN, PROJECT.ID.eq(LAUNCH.PROJECT_ID)); + } + + @Override + public QuerySupplier wrapQuery(SelectQuery query) { + throw new UnsupportedOperationException("Doesn't supported for Project Info query"); + } + + @Override + public QuerySupplier wrapQuery(SelectQuery query, String... excluding) { + throw new UnsupportedOperationException("Doesn't supported for Project Info query"); + } + + @Override + protected Field idField() { + return PROJECT.ID; + } + }, + + USER_TARGET(User.class, Arrays.asList( + + new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, USERS.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_USER, USERS.LOGIN, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_EMAIL, USERS.EMAIL, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_FULL_NAME, USERS.FULL_NAME, String.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_ROLE, USERS.ROLE, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_TYPE, USERS.TYPE, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_EXPIRED, USERS.EXPIRED, Boolean.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, PROJECT_USER.PROJECT_ID, + Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT, PROJECT.NAME, List.class) + .withAggregateCriteria(DSL.arrayAgg(PROJECT.NAME).toString()) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LAST_LOGIN, + "(" + USERS.METADATA + "-> 'metadata' ->> 'last_login')::DOUBLE PRECISION ", + Long.class + ).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_SYNCHRONIZATION_DATE, + "(" + USERS.METADATA.getQualifiedName().toString() + + "-> 'metadata' ->> 'synchronizationDate')::DOUBLE PRECISION ", + Long.class + ).get() + + )) { + @Override + protected Collection selectFields() { + return Lists.newArrayList(USERS.ID, + USERS.LOGIN, + USERS.FULL_NAME, + USERS.TYPE, + USERS.ATTACHMENT, + USERS.ATTACHMENT_THUMBNAIL, + USERS.EMAIL, + USERS.EXPIRED, + USERS.PASSWORD, + USERS.ROLE, + USERS.METADATA, + PROJECT.NAME, + PROJECT.PROJECT_TYPE, + PROJECT_USER.PROJECT_ID, + PROJECT_USER.PROJECT_ROLE, + PROJECT_USER.USER_ID + ); + } + + @Override + protected void addFrom(SelectQuery query) { + query.addFrom(USERS); + } + + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(PROJECT_USER, JoinType.LEFT_OUTER_JOIN, USERS.ID.eq(PROJECT_USER.USER_ID)); + query.addJoin(PROJECT, JoinType.LEFT_OUTER_JOIN, PROJECT_USER.PROJECT_ID.eq(PROJECT.ID)); + } + + @Override + protected Field idField() { + return USERS.ID; + } + }, + + LAUNCH_TARGET(Launch.class, Arrays.asList( + + new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, LAUNCH.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, LAUNCH.NAME, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_DESCRIPTION, LAUNCH.DESCRIPTION, String.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LAUNCH_UUID, LAUNCH.UUID, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_START_TIME, LAUNCH.START_TIME, + Timestamp.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_END_TIME, LAUNCH.END_TIME, Timestamp.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, LAUNCH.PROJECT_ID, Long.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_USER_ID, LAUNCH.USER_ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LAUNCH_NUMBER, LAUNCH.NUMBER, Integer.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LAST_MODIFIED, LAUNCH.LAST_MODIFIED, + Timestamp.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LAUNCH_MODE, LAUNCH.MODE, + JLaunchModeEnum.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LAUNCH_STATUS, LAUNCH.STATUS, + JStatusEnum.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_HAS_RETRIES, LAUNCH.HAS_RETRIES, + Boolean.class).get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_ITEM_ATTRIBUTE_KEY, + ITEM_ATTRIBUTE.KEY, + String.class, + Lists.newArrayList(JoinEntity.of(ITEM_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, + LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID))) + ).withAggregateCriteria( + DSL.arrayAggDistinct(ITEM_ATTRIBUTE.KEY).filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)) + .toString()).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_ITEM_ATTRIBUTE_VALUE, + ITEM_ATTRIBUTE.VALUE, + String.class, + Lists.newArrayList(JoinEntity.of(ITEM_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, + LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID))) + ) + .withAggregateCriteria(DSL.arrayAggDistinct(ITEM_ATTRIBUTE.VALUE) + .filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)) + .toString()) + .get(), + new CriteriaHolderBuilder().newBuilder( + CRITERIA_COMPOSITE_ATTRIBUTE, + ITEM_ATTRIBUTE.KEY, + String[].class, + Lists.newArrayList(JoinEntity.of(LAUNCH_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, + LAUNCH.ID.eq(LAUNCH_ATTRIBUTE.LAUNCH_ID))) + ).withAggregateCriteria(DSL.field("{0}::varchar[] || {1}::varchar[] || {2}::varchar[]", + DSL.arrayAggDistinct(DSL.concat(LAUNCH_ATTRIBUTE.KEY, ":")) + .filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(false)), + DSL.arrayAggDistinct(DSL.concat(LAUNCH_ATTRIBUTE.VALUE)) + .filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(false)), + DSL.arrayAgg( + DSL.concat(DSL.coalesce(LAUNCH_ATTRIBUTE.KEY, ""), DSL.val(KEY_VALUE_SEPARATOR), + LAUNCH_ATTRIBUTE.VALUE)) + .filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(false)) + ).toString()).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_USER, + USERS.LOGIN, + String.class, + Lists.newArrayList( + JoinEntity.of(USERS, JoinType.LEFT_OUTER_JOIN, LAUNCH.USER_ID.eq(USERS.ID))) + ).withAggregateCriteria(DSL.max(USERS.LOGIN).toString()).get() + )) { + @Override + protected Collection selectFields() { + List> selectFields = new ArrayList<>(); + selectFields.addAll(getSelectSimpleFields()); + selectFields.addAll(getSelectAggregatedFields()); + + return selectFields; + } + + @Override + protected void addFrom(SelectQuery query) { + query.addFrom(LAUNCH); + } + + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(ITEM_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, + LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)); + query.addJoin(USERS, JoinType.LEFT_OUTER_JOIN, LAUNCH.USER_ID.eq(USERS.ID)); + query.addJoin(STATISTICS, JoinType.LEFT_OUTER_JOIN, LAUNCH.ID.eq(STATISTICS.LAUNCH_ID)); + query.addJoin(STATISTICS_FIELD, JoinType.LEFT_OUTER_JOIN, + STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)); + } + + @Override + protected void joinTablesForFilter(QuerySupplier query) { + } + + @Override + protected Field idField() { + return LAUNCH.ID; + } + + @Override + protected void addGroupBy(QuerySupplier query) { + query.addGroupBy(getSelectSimpleFields()); + } + + @Override + public boolean withGrouping() { + return true; + } + + private List> getSelectSimpleFields() { + return Lists.newArrayList(LAUNCH.ID, + LAUNCH.UUID, + LAUNCH.NAME, + LAUNCH.DESCRIPTION, + LAUNCH.START_TIME, + LAUNCH.END_TIME, + LAUNCH.PROJECT_ID, + LAUNCH.USER_ID, + LAUNCH.NUMBER, + LAUNCH.LAST_MODIFIED, + LAUNCH.MODE, + LAUNCH.STATUS, + LAUNCH.HAS_RETRIES, + LAUNCH.RERUN, + LAUNCH.APPROXIMATE_DURATION, + STATISTICS.S_COUNTER, + STATISTICS_FIELD.NAME, + USERS.ID, + USERS.LOGIN + ); + } + + private List> getSelectAggregatedFields() { + return Lists.newArrayList(DSL.arrayAgg( + DSL.field("concat({0}, {1}, {2}, {3}, {4})", + ITEM_ATTRIBUTE.KEY, + KEY_VALUE_SEPARATOR, + ITEM_ATTRIBUTE.VALUE, + KEY_VALUE_SEPARATOR, + ITEM_ATTRIBUTE.SYSTEM + )).as(ATTRIBUTE_ALIAS) + ); + } + }, + + TEST_ITEM_TARGET(TestItem.class, + Arrays.asList( + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, LAUNCH.PROJECT_ID, Long.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, TEST_ITEM.ITEM_ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, TEST_ITEM.NAME, String.class).get(), + new CriteriaHolderBuilder().newBuilder(TestItemCriteriaConstant.CRITERIA_TYPE, + TEST_ITEM.TYPE, JTestItemTypeEnum.class) + .withAggregateCriteria(DSL.max(TEST_ITEM.TYPE).toString()) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_START_TIME, TEST_ITEM.START_TIME, + Timestamp.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_DESCRIPTION, TEST_ITEM.DESCRIPTION, + String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LAST_MODIFIED, TEST_ITEM.LAST_MODIFIED, + String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PATH, TEST_ITEM.PATH, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_UNIQUE_ID, TEST_ITEM.UNIQUE_ID, + String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_UUID, TEST_ITEM.UUID, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_TEST_CASE_ID, TEST_ITEM.TEST_CASE_ID, + String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_TEST_CASE_HASH, TEST_ITEM.TEST_CASE_HASH, + Integer.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PARENT_ID, TEST_ITEM.PARENT_ID, + Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_HAS_CHILDREN, TEST_ITEM.HAS_CHILDREN, + Boolean.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_HAS_RETRIES, TEST_ITEM.HAS_RETRIES, + Boolean.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_HAS_STATS, TEST_ITEM.HAS_STATS, + Boolean.class).get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_STATUS, + TEST_ITEM_RESULTS.STATUS, + JStatusEnum.class, + Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) + )) + ).withAggregateCriteria(DSL.max(TEST_ITEM_RESULTS.STATUS).toString()).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_END_TIME, + TEST_ITEM_RESULTS.END_TIME, + Timestamp.class, + Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) + )) + ).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_DURATION, + TEST_ITEM_RESULTS.DURATION, + Long.class, + Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) + )) + ).get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_PARAMETER_KEY, + PARAMETER.KEY, + String.class, + Lists.newArrayList(JoinEntity.of(PARAMETER, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(PARAMETER.ITEM_ID))) + ).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PARAMETER_VALUE, + PARAMETER.VALUE, + String.class, + Lists.newArrayList(JoinEntity.of(PARAMETER, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(PARAMETER.ITEM_ID))) + ).get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_ID, + ISSUE.ISSUE_ID, + Long.class, + Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) + ), JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID))) + ).get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_TYPE, + ISSUE_TYPE.LOCATOR, + String.class, + Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) + ), + JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)), + JoinEntity.of(ISSUE_TYPE, JoinType.LEFT_OUTER_JOIN, + ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) + ) + ).get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_TYPE_ID, + ISSUE.ISSUE_TYPE, + Long.class, + Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) + ), + JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)) + ) + ).get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_AUTO_ANALYZED, + ISSUE.AUTO_ANALYZED, + Boolean.class, + Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) + ), JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID))) + ).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_IGNORE_ANALYZER, + ISSUE.IGNORE_ANALYZER, + Boolean.class, + Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) + ), JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID))) + ).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_COMMENT, + ISSUE.ISSUE_DESCRIPTION, + String.class, + Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) + ), JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID))) + ).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_LOCATOR, + ISSUE_TYPE.LOCATOR, + String.class, + Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) + ), + JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)), + JoinEntity.of(ISSUE_TYPE, JoinType.LEFT_OUTER_JOIN, + ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) + ) + ).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_GROUP_ID, + ISSUE_TYPE.ISSUE_GROUP_ID, + Short.class, + Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) + ), + JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)), + JoinEntity.of(ISSUE_TYPE, JoinType.LEFT_OUTER_JOIN, + ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) + ) + ).get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_LAUNCH_ID, TEST_ITEM.LAUNCH_ID, + Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LAUNCH_MODE, LAUNCH.MODE, + JLaunchModeEnum.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PARENT_ID, TEST_ITEM.PARENT_ID, + Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_RETRY_PARENT_ID, TEST_ITEM.RETRY_OF, + Long.class).get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_ITEM_ATTRIBUTE_KEY, + ITEM_ATTRIBUTE.KEY, + List.class, + Lists.newArrayList(JoinEntity.of(ITEM_ATTRIBUTE, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID) + )) + ) + .withAggregateCriteria(DSL.arrayAggDistinct(ITEM_ATTRIBUTE.KEY) + .filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)) + .toString()) + .get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_ITEM_ATTRIBUTE_VALUE, + ITEM_ATTRIBUTE.VALUE, + List.class, + Lists.newArrayList(JoinEntity.of(ITEM_ATTRIBUTE, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID) + )) + ) + .withAggregateCriteria(DSL.arrayAggDistinct(ITEM_ATTRIBUTE.VALUE) + .filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)) + .toString()) + .get(), + + new CriteriaHolderBuilder().newBuilder( + CRITERIA_LEVEL_ATTRIBUTE, + ITEM_ATTRIBUTE.KEY, + List.class, + Lists.newArrayList(JoinEntity.of(ITEM_ATTRIBUTE, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID) + ), + JoinEntity.of(LAUNCH_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, + LAUNCH.ID.eq(LAUNCH_ATTRIBUTE.LAUNCH_ID)) + ) + ) + .withAggregateCriteria(DSL.field("array_cat({0}, {1})::varchar[]", + DSL.arrayAgg(DSL.concat(DSL.coalesce(ITEM_ATTRIBUTE.KEY, ""), + DSL.val(KEY_VALUE_SEPARATOR), + ITEM_ATTRIBUTE.VALUE + )).filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)), + DSL.arrayAgg(DSL.concat(DSL.coalesce(LAUNCH_ATTRIBUTE.KEY, ""), + DSL.val(KEY_VALUE_SEPARATOR), + LAUNCH_ATTRIBUTE.VALUE + )).filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(false)) + ).toString()) + .get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_COMPOSITE_ATTRIBUTE, ITEM_ATTRIBUTE.KEY, + String[].class, Lists.newArrayList( + JoinEntity.of(ITEM_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID)), + JoinEntity.of(LAUNCH_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, + LAUNCH.ID.eq(LAUNCH_ATTRIBUTE.LAUNCH_ID)) + )).withAggregateCriteria(DSL.field( + "{0}::varchar[] || {1}::varchar[] || {2}::varchar[] || {3}::varchar[] || {4}::varchar[] || {5}::varchar[]", + DSL.arrayAggDistinct(DSL.concat(LAUNCH_ATTRIBUTE.KEY, ":")) + .filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(false)), + DSL.arrayAggDistinct(DSL.concat(LAUNCH_ATTRIBUTE.VALUE)) + .filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(false)), + DSL.arrayAgg(DSL.concat(DSL.coalesce(LAUNCH_ATTRIBUTE.KEY, ""), + DSL.val(KEY_VALUE_SEPARATOR), + LAUNCH_ATTRIBUTE.VALUE + )) + .filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(false)), + DSL.arrayAggDistinct(DSL.concat(ITEM_ATTRIBUTE.KEY, ":")) + .filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)), + DSL.arrayAggDistinct(DSL.concat(ITEM_ATTRIBUTE.VALUE)) + .filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)), + DSL.arrayAgg(DSL.concat(DSL.coalesce(ITEM_ATTRIBUTE.KEY, ""), + DSL.val(KEY_VALUE_SEPARATOR), + ITEM_ATTRIBUTE.VALUE + )) + .filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)) + ).toString()).get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_PATTERN_TEMPLATE_NAME, + PATTERN_TEMPLATE.NAME, + List.class, + Lists.newArrayList(JoinEntity.of(PATTERN_TEMPLATE_TEST_ITEM, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID) + ), + JoinEntity.of(PATTERN_TEMPLATE, + JoinType.LEFT_OUTER_JOIN, + PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID.eq(PATTERN_TEMPLATE.ID) + ) + ) + ).withAggregateCriteria(DSL.arrayAggDistinct(PATTERN_TEMPLATE.NAME).toString()).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_TICKET_ID, + TICKET.TICKET_ID, + String.class, + Lists.newArrayList(JoinEntity.of(TEST_ITEM_RESULTS, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID) + ), + JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)), + JoinEntity.of(ISSUE_TICKET, JoinType.LEFT_OUTER_JOIN, + ISSUE.ISSUE_ID.eq(ISSUE_TICKET.ISSUE_ID)), + JoinEntity.of(TICKET, JoinType.LEFT_OUTER_JOIN, + ISSUE_TICKET.TICKET_ID.eq(TICKET.ID)) + ) + ).withAggregateCriteria(DSL.arrayAggDistinct(TICKET.TICKET_ID).toString()).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_CLUSTER_ID, + CLUSTERS_TEST_ITEM.CLUSTER_ID, + Long.class, + Lists.newArrayList( + JoinEntity.of(CLUSTERS_TEST_ITEM, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(CLUSTERS_TEST_ITEM.ITEM_ID)) + ) + ).withAggregateCriteria(DSL.arrayAggDistinct(CLUSTERS_TEST_ITEM.CLUSTER_ID).toString()) + .get() + ) + ) { + @Override + protected Collection selectFields() { + List> selectFields = new ArrayList<>(); + selectFields.addAll(getSelectSimpleFields()); + selectFields.addAll(getSelectAggregatedFields()); + + return selectFields; + } + + @Override + protected void addFrom(SelectQuery query) { + query.addFrom(TEST_ITEM); + } + + @Override + protected Field idField() { + return TEST_ITEM.ITEM_ID; + } + + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(LAUNCH, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)); + query.addJoin(TEST_ITEM_RESULTS, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)); + query.addJoin(ITEM_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID)); + query.addJoin(STATISTICS, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(STATISTICS.ITEM_ID)); + query.addJoin(STATISTICS_FIELD, JoinType.LEFT_OUTER_JOIN, + STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)); + query.addJoin(PATTERN_TEMPLATE_TEST_ITEM, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID)); + query.addJoin(PATTERN_TEMPLATE, JoinType.LEFT_OUTER_JOIN, + PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID.eq(PATTERN_TEMPLATE.ID)); + query.addJoin(ISSUE, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)); + query.addJoin(ISSUE_TYPE, JoinType.LEFT_OUTER_JOIN, ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)); + query.addJoin(ISSUE_GROUP, JoinType.LEFT_OUTER_JOIN, + ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)); + query.addJoin(ISSUE_TICKET, JoinType.LEFT_OUTER_JOIN, + ISSUE.ISSUE_ID.eq(ISSUE_TICKET.ISSUE_ID)); + query.addJoin(TICKET, JoinType.LEFT_OUTER_JOIN, ISSUE_TICKET.TICKET_ID.eq(TICKET.ID)); + query.addJoin(PARAMETER, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(PARAMETER.ITEM_ID)); + query.addJoin(LAUNCH_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, + LAUNCH.ID.eq(LAUNCH_ATTRIBUTE.LAUNCH_ID)); + query.addJoin(CLUSTERS_TEST_ITEM, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(CLUSTERS_TEST_ITEM.ITEM_ID)); + } + + @Override + protected void joinTablesForFilter(QuerySupplier query) { + query.addJoin(LAUNCH, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)); + } + + @Override + protected void addGroupBy(QuerySupplier query) { + query.addGroupBy(getSelectSimpleFields()); + } + + @Override + public boolean withGrouping() { + return true; + } + + private List> getSelectSimpleFields() { + return Lists.newArrayList(TEST_ITEM.ITEM_ID, + TEST_ITEM.NAME, + TEST_ITEM.CODE_REF, + TEST_ITEM.TYPE, + TEST_ITEM.START_TIME, + TEST_ITEM.DESCRIPTION, + TEST_ITEM.LAST_MODIFIED, + TEST_ITEM.PATH, + TEST_ITEM.UNIQUE_ID, + TEST_ITEM.UUID, + TEST_ITEM.TEST_CASE_ID, + TEST_ITEM.TEST_CASE_HASH, + TEST_ITEM.PARENT_ID, + TEST_ITEM.RETRY_OF, + TEST_ITEM.HAS_CHILDREN, + TEST_ITEM.HAS_STATS, + TEST_ITEM.HAS_RETRIES, + TEST_ITEM.LAUNCH_ID, + TEST_ITEM_RESULTS.STATUS, + TEST_ITEM_RESULTS.END_TIME, + TEST_ITEM_RESULTS.DURATION, + PARAMETER.ITEM_ID, + PARAMETER.KEY, + PARAMETER.VALUE, + STATISTICS_FIELD.NAME, + STATISTICS.S_COUNTER, + ISSUE.ISSUE_ID, + ISSUE.AUTO_ANALYZED, + ISSUE.IGNORE_ANALYZER, + ISSUE.ISSUE_DESCRIPTION, + ISSUE_TYPE.LOCATOR, + ISSUE_TYPE.ABBREVIATION, + ISSUE_TYPE.HEX_COLOR, + ISSUE_TYPE.ISSUE_NAME, + ISSUE_GROUP.ISSUE_GROUP_, + TICKET.ID, + TICKET.BTS_PROJECT, + TICKET.BTS_URL, + TICKET.TICKET_ID, + TICKET.URL, + TICKET.PLUGIN_NAME, + PATTERN_TEMPLATE.ID, + PATTERN_TEMPLATE.NAME + ); + } + + private List> getSelectAggregatedFields() { + return Lists.newArrayList(DSL.arrayAgg( + DSL.field("concat({0}, {1}, {2}, {3}, {4})", + ITEM_ATTRIBUTE.KEY, + KEY_VALUE_SEPARATOR, + ITEM_ATTRIBUTE.VALUE, + KEY_VALUE_SEPARATOR, + ITEM_ATTRIBUTE.SYSTEM + )).as(ATTRIBUTE_ALIAS) + ); + } + }, + + LOG_TARGET(Log.class, Arrays.asList( + + new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, LOG.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LOG_ID, LOG.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LOG_TIME, LOG.LOG_TIME, Timestamp.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LAST_MODIFIED, LOG.LAST_MODIFIED, + Timestamp.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LOG_LEVEL, LOG.LOG_LEVEL, LogLevel.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LOG_MESSAGE, LOG.LOG_MESSAGE, String.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_TEST_ITEM_ID, LOG.ITEM_ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LOG_LAUNCH_ID, LOG.LAUNCH_ID, Long.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LOG_PROJECT_ID, LOG.PROJECT_ID, Long.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LOG_BINARY_CONTENT, + ATTACHMENT.FILE_ID, + String.class, + Lists.newArrayList(JoinEntity.of(ATTACHMENT, JoinType.LEFT_OUTER_JOIN, + LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID))) + ).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_ITEM_LAUNCH_ID, + TEST_ITEM.LAUNCH_ID, + Long.class, + Lists.newArrayList( + JoinEntity.of(TEST_ITEM, JoinType.LEFT_OUTER_JOIN, LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID))) + ).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_RETRY_PARENT_ID, + TEST_ITEM.RETRY_OF, + Long.class, + Lists.newArrayList( + JoinEntity.of(TEST_ITEM, JoinType.LEFT_OUTER_JOIN, LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID))) + ).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_RETRY_PARENT_LAUNCH_ID, + TEST_ITEM.as(RETRY_PARENT).LAUNCH_ID, + Long.class, + Lists.newArrayList( + JoinEntity.of(TEST_ITEM, JoinType.LEFT_OUTER_JOIN, LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)), + JoinEntity.of(TEST_ITEM.as(RETRY_PARENT), + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.RETRY_OF.eq(TEST_ITEM.as(RETRY_PARENT).ITEM_ID) + ) + ) + ).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PATH, + TEST_ITEM.PATH, + String.class, + Lists.newArrayList( + JoinEntity.of(TEST_ITEM, JoinType.LEFT_OUTER_JOIN, LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID))) + ).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_STATUS, + TEST_ITEM_RESULTS.STATUS, + JStatusEnum.class, + Lists.newArrayList( + JoinEntity.of(TEST_ITEM, JoinType.LEFT_OUTER_JOIN, LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)), + JoinEntity.of(TEST_ITEM_RESULTS, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + ) + ).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_ISSUE_AUTO_ANALYZED, + ISSUE.AUTO_ANALYZED, + Boolean.class, + Lists.newArrayList( + JoinEntity.of(TEST_ITEM, JoinType.LEFT_OUTER_JOIN, LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)), + JoinEntity.of(TEST_ITEM_RESULTS, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)), + JoinEntity.of(ISSUE, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)) + ) + ).get() + )) { + @Override + protected Collection selectFields() { + return Lists.newArrayList(LOG.ID, + LOG.LOG_TIME, + LOG.LOG_MESSAGE, + LOG.LAST_MODIFIED, + LOG.LOG_LEVEL, + LOG.ITEM_ID, + LOG.LAUNCH_ID, + LOG.ATTACHMENT_ID, + ATTACHMENT.ID, + ATTACHMENT.FILE_ID, + ATTACHMENT.THUMBNAIL_ID, + ATTACHMENT.CONTENT_TYPE, + ATTACHMENT.FILE_SIZE, + ATTACHMENT.PROJECT_ID, + ATTACHMENT.LAUNCH_ID, + ATTACHMENT.ITEM_ID + ); + } + + @Override + protected void addFrom(SelectQuery query) { + query.addFrom(LOG); + } + + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(TEST_ITEM, JoinType.LEFT_OUTER_JOIN, LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)); + query.addJoin(TEST_ITEM_RESULTS, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)); + query.addJoin(ISSUE, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM_RESULTS.RESULT_ID.eq(ISSUE.ISSUE_ID)); + query.addJoin(ATTACHMENT, JoinType.LEFT_OUTER_JOIN, LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)); + } + + @Override + protected void joinTablesForFilter(QuerySupplier query) { + + } + + @Override + protected Field idField() { + return LOG.ID; + } + }, + + ACTIVITY_TARGET(Activity.class, Arrays.asList( + + new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, ACTIVITY.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, ACTIVITY.PROJECT_ID, Long.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_NAME, PROJECT.NAME, Long.class) + .withAggregateCriteria(DSL.max(PROJECT.NAME).toString()) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_USER_ID, ACTIVITY.USER_ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_ENTITY, ACTIVITY.ENTITY, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_ACTION, ACTIVITY.ACTION, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_LOGIN, ACTIVITY.USERNAME, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_CREATION_DATE, ACTIVITY.CREATION_DATE, + Timestamp.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_OBJECT_ID, ACTIVITY.OBJECT_ID, Long.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_USER, USERS.LOGIN, String.class) + .withAggregateCriteria(DSL.max(USERS.LOGIN).toString()) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_OBJECT_NAME, + ACTIVITY.DETAILS + " ->> 'objectName'", String.class).get() + )) { + @Override + protected Collection selectFields() { + return Lists.newArrayList(ACTIVITY.ID, + ACTIVITY.PROJECT_ID, + ACTIVITY.USERNAME, + ACTIVITY.USER_ID, + ACTIVITY.ENTITY, + ACTIVITY.ACTION, + ACTIVITY.CREATION_DATE, + ACTIVITY.DETAILS, + ACTIVITY.OBJECT_ID, + USERS.LOGIN, + PROJECT.NAME + ); + } + + @Override + protected void addFrom(SelectQuery query) { + query.addFrom(ACTIVITY); + } + + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(USERS, JoinType.LEFT_OUTER_JOIN, ACTIVITY.USER_ID.eq(USERS.ID)); + query.addJoin(PROJECT, JoinType.JOIN, ACTIVITY.PROJECT_ID.eq(PROJECT.ID)); + } + + @Override + protected Field idField() { + return ACTIVITY.ID; + } + }, + + INTEGRATION_TARGET(Integration.class, Arrays.asList( + + new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, INTEGRATION.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, INTEGRATION.PROJECT_ID, + String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_INTEGRATION_TYPE, INTEGRATION_TYPE.GROUP_TYPE, + JIntegrationGroupEnum.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, INTEGRATION_TYPE.NAME, String.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_NAME, PROJECT.NAME, String.class) + .get() + )) { + @Override + protected Collection selectFields() { + return Lists.newArrayList(INTEGRATION.ID, + INTEGRATION.NAME, + INTEGRATION.PROJECT_ID, + INTEGRATION.TYPE, + INTEGRATION.PARAMS, + INTEGRATION.CREATOR, + INTEGRATION.CREATION_DATE, + INTEGRATION_TYPE.NAME, + INTEGRATION_TYPE.GROUP_TYPE, + PROJECT.NAME + ); + } + + @Override + protected void addFrom(SelectQuery query) { + query.addFrom(INTEGRATION); + } + + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(INTEGRATION_TYPE, JoinType.JOIN, INTEGRATION.TYPE.eq(INTEGRATION_TYPE.ID)); + query.addJoin(PROJECT, JoinType.JOIN, INTEGRATION.PROJECT_ID.eq(PROJECT.ID)); + } + + @Override + protected Field idField() { + return DSL.cast(INTEGRATION.ID, Long.class); + } + }, + + DASHBOARD_TARGET(Dashboard.class, Arrays.asList( + + new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, DASHBOARD.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, DASHBOARD.NAME, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_SHARED, SHAREABLE_ENTITY.SHARED, + Boolean.class) + .withAggregateCriteria(DSL.boolAnd(SHAREABLE_ENTITY.SHARED).toString()) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, SHAREABLE_ENTITY.PROJECT_ID, + Long.class) + .withAggregateCriteria(DSL.max(SHAREABLE_ENTITY.PROJECT_ID).toString()) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, SHAREABLE_ENTITY.OWNER, String.class) + .withAggregateCriteria(DSL.max(SHAREABLE_ENTITY.OWNER).toString()) + .get() + )) { + @Override + protected Collection selectFields() { + return Lists.newArrayList(DASHBOARD.ID, + DASHBOARD.NAME, + DASHBOARD.DESCRIPTION, + DASHBOARD.CREATION_DATE, + DASHBOARD_WIDGET.WIDGET_OWNER, + DASHBOARD_WIDGET.IS_CREATED_ON, + DASHBOARD_WIDGET.WIDGET_ID, + DASHBOARD_WIDGET.WIDGET_NAME, + DASHBOARD_WIDGET.WIDGET_TYPE, + DASHBOARD_WIDGET.WIDGET_HEIGHT, + DASHBOARD_WIDGET.WIDGET_WIDTH, + DASHBOARD_WIDGET.WIDGET_POSITION_X, + DASHBOARD_WIDGET.WIDGET_POSITION_Y, + WIDGET.WIDGET_OPTIONS, + DASHBOARD_WIDGET.SHARE, + SHAREABLE_ENTITY.SHARED, + SHAREABLE_ENTITY.PROJECT_ID, + SHAREABLE_ENTITY.OWNER + ); + } + + @Override + protected void addFrom(SelectQuery query) { + query.addFrom(DASHBOARD); + } + + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(DASHBOARD_WIDGET, JoinType.LEFT_OUTER_JOIN, + DASHBOARD.ID.eq(DASHBOARD_WIDGET.DASHBOARD_ID)); + query.addJoin(WIDGET, JoinType.LEFT_OUTER_JOIN, DASHBOARD_WIDGET.WIDGET_ID.eq(WIDGET.ID)); + query.addJoin(SHAREABLE_ENTITY, JoinType.JOIN, DASHBOARD.ID.eq(SHAREABLE_ENTITY.ID)); + query.addJoin(ACL_OBJECT_IDENTITY, JoinType.JOIN, + DASHBOARD.ID.cast(String.class).eq(ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY)); + query.addJoin(ACL_CLASS, JoinType.JOIN, ACL_CLASS.ID.eq(ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS)); + query.addJoin(ACL_ENTRY, JoinType.JOIN, + ACL_ENTRY.ACL_OBJECT_IDENTITY.eq(ACL_OBJECT_IDENTITY.ID)); + } + + @Override + protected Field idField() { + return DASHBOARD.ID.cast(Long.class); + } + }, + + WIDGET_TARGET(Widget.class, Arrays.asList( + + new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, WIDGET.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, WIDGET.NAME, String.class) + .withAggregateCriteria(DSL.max(WIDGET.NAME).toString()) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_DESCRIPTION, WIDGET.DESCRIPTION, String.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_SHARED, SHAREABLE_ENTITY.SHARED, + Boolean.class) + .withAggregateCriteria(DSL.boolAnd(SHAREABLE_ENTITY.SHARED).toString()) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, SHAREABLE_ENTITY.PROJECT_ID, + Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, SHAREABLE_ENTITY.OWNER, String.class) + .withAggregateCriteria(DSL.max(SHAREABLE_ENTITY.OWNER).toString()) + .get() + + )) { + @Override + protected Collection selectFields() { + return Lists.newArrayList(WIDGET.ID, + WIDGET.NAME, + WIDGET.WIDGET_TYPE, + WIDGET.DESCRIPTION, + WIDGET.ITEMS_COUNT, + SHAREABLE_ENTITY.PROJECT_ID, + SHAREABLE_ENTITY.SHARED, + SHAREABLE_ENTITY.OWNER + ); + } + + @Override + protected void addFrom(SelectQuery query) { + query.addFrom(WIDGET); + } + + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(SHAREABLE_ENTITY, JoinType.JOIN, WIDGET.ID.eq(SHAREABLE_ENTITY.ID)); + query.addJoin(ACL_OBJECT_IDENTITY, JoinType.JOIN, + WIDGET.ID.cast(String.class).eq(ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY)); + query.addJoin(ACL_CLASS, JoinType.JOIN, ACL_CLASS.ID.eq(ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS)); + query.addJoin(ACL_ENTRY, JoinType.JOIN, + ACL_ENTRY.ACL_OBJECT_IDENTITY.eq(ACL_OBJECT_IDENTITY.ID)); + } + + @Override + protected Field idField() { + return WIDGET.ID; + } + }, + + USER_FILTER_TARGET(UserFilter.class, + Arrays.asList( + new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, FILTER.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, FILTER.NAME, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_SHARED, SHAREABLE_ENTITY.SHARED, + Boolean.class) + .withAggregateCriteria(DSL.boolAnd(SHAREABLE_ENTITY.SHARED).toString()) + .get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, SHAREABLE_ENTITY.PROJECT_ID, + Long.class) + .withAggregateCriteria(DSL.max(SHAREABLE_ENTITY.PROJECT_ID).toString()) + .get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, SHAREABLE_ENTITY.OWNER, + String.class) + .withAggregateCriteria(DSL.max(SHAREABLE_ENTITY.OWNER).toString()) + .get() + ) + ) { + @Override + protected Collection selectFields() { + return Lists.newArrayList(FILTER.ID, + FILTER.NAME, + FILTER.TARGET, + FILTER.DESCRIPTION, + FILTER_CONDITION.SEARCH_CRITERIA, + FILTER_CONDITION.CONDITION, + FILTER_CONDITION.VALUE, + FILTER_CONDITION.NEGATIVE, + FILTER_SORT.FIELD, + FILTER_SORT.DIRECTION, + SHAREABLE_ENTITY.SHARED, + SHAREABLE_ENTITY.PROJECT_ID, + SHAREABLE_ENTITY.OWNER + ); + } + + @Override + protected void addFrom(SelectQuery query) { + query.addFrom(FILTER); + } + + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(SHAREABLE_ENTITY, JoinType.JOIN, FILTER.ID.eq(SHAREABLE_ENTITY.ID)); + query.addJoin(FILTER_CONDITION, JoinType.LEFT_OUTER_JOIN, + FILTER.ID.eq(FILTER_CONDITION.FILTER_ID)); + query.addJoin(FILTER_SORT, JoinType.LEFT_OUTER_JOIN, FILTER.ID.eq(FILTER_SORT.FILTER_ID)); + query.addJoin(ACL_OBJECT_IDENTITY, JoinType.JOIN, + FILTER.ID.cast(String.class).eq(ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY)); + query.addJoin(ACL_CLASS, JoinType.JOIN, ACL_CLASS.ID.eq(ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS)); + query.addJoin(ACL_ENTRY, JoinType.JOIN, + ACL_ENTRY.ACL_OBJECT_IDENTITY.eq(ACL_OBJECT_IDENTITY.ID)); + } + + @Override + protected Field idField() { + return FILTER.ID; + } + }; + + public static final String FILTERED_QUERY = "filtered"; + public static final String ATTRIBUTE_ALIAS = "attribute"; + public static final String FILTERED_ID = "id"; + + private Class clazz; + private List criteriaHolders; + + FilterTarget(Class clazz, List criteriaHolders) { + this.clazz = clazz; + this.criteriaHolders = criteriaHolders; + } + + public static FilterTarget findByClass(Class clazz) { + return Arrays.stream(values()) + .filter(val -> val.clazz.equals(clazz)) + .findAny() + .orElseThrow(() -> new IllegalArgumentException( + String.format("No target query builder for clazz %s", clazz))); + } + + public QuerySupplier getQuery() { + SelectQuery query = DSL.select(idField().as(FILTERED_ID)).getQuery(); + addFrom(query); + query.addGroupBy(idField()); + + QuerySupplier querySupplier = new QuerySupplier(query); + joinTablesForFilter(querySupplier); + return querySupplier; + } + + protected abstract Collection selectFields(); + + protected abstract void addFrom(SelectQuery query); + + protected abstract void joinTables(QuerySupplier query); + + protected void joinTablesForFilter(QuerySupplier query) { + joinTables(query); + } + + protected void addGroupBy(QuerySupplier query) { + } + + protected abstract Field idField(); + + public QuerySupplier wrapQuery(SelectQuery query) { + SelectQuery wrappedQuery = DSL.with(FILTERED_QUERY).as(query).select(selectFields()) + .getQuery(); + addFrom(wrappedQuery); + QuerySupplier querySupplier = new QuerySupplier(wrappedQuery); + querySupplier.addJoin(DSL.table(DSL.name(FILTERED_QUERY)), + JoinType.JOIN, + idField().eq(field(DSL.name(FILTERED_QUERY, FILTERED_ID), Long.class)) + ); + joinTables(querySupplier); + addGroupBy(querySupplier); + return querySupplier; + } + + public QuerySupplier wrapQuery(SelectQuery query, String... excluding) { + List excludingFields = Lists.newArrayList(excluding); + List fields = selectFields().stream() + .filter(it -> !excludingFields.contains(it.getName())) + .collect(Collectors.toList()); + SelectQuery wrappedQuery = DSL.with(FILTERED_QUERY).as(query).select(fields).getQuery(); + addFrom(wrappedQuery); + QuerySupplier querySupplier = new QuerySupplier(wrappedQuery); + querySupplier.addJoin(DSL.table(DSL.name(FILTERED_QUERY)), + JoinType.JOIN, + idField().eq(field(DSL.name(FILTERED_QUERY, FILTERED_ID), Long.class)) + ); + joinTables(querySupplier); + addGroupBy(querySupplier); + return querySupplier; + } + + public Class getClazz() { + return clazz; + } + + public List getCriteriaHolders() { + return criteriaHolders; + } + + public Optional getCriteriaByFilter(String filterCriteria) { /* creates criteria holder for statistics search criteria cause there can be custom statistics so we can't know it till this moment */ - if (filterCriteria != null && filterCriteria.startsWith(STATISTICS_KEY)) { - return Optional.of(new CriteriaHolderBuilder().newBuilder(filterCriteria, - DSL.coalesce(DSL.max(STATISTICS.S_COUNTER).filterWhere(STATISTICS_FIELD.NAME.eq(filterCriteria)), 0).toString(), - Long.class - ).get()); - } - return criteriaHolders.stream().filter(holder -> holder.getFilterCriteria().equals(filterCriteria)).findAny(); - } - - public static FilterTarget findByClass(Class clazz) { - return Arrays.stream(values()) - .filter(val -> val.clazz.equals(clazz)) - .findAny() - .orElseThrow(() -> new IllegalArgumentException(String.format("No target query builder for clazz %s", clazz))); - } - - public boolean withGrouping() { - return false; - } + if (filterCriteria != null && filterCriteria.startsWith(STATISTICS_KEY)) { + return Optional.of(new CriteriaHolderBuilder().newBuilder(filterCriteria, + DSL.coalesce( + DSL.max(STATISTICS.S_COUNTER).filterWhere(STATISTICS_FIELD.NAME.eq(filterCriteria)), + 0).toString(), + Long.class + ).get()); + } + return criteriaHolders.stream() + .filter(holder -> holder.getFilterCriteria().equals(filterCriteria)).findAny(); + } + + public boolean withGrouping() { + return false; + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/ProjectFilter.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/ProjectFilter.java index efe6f9e25..61654ce5d 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/ProjectFilter.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/ProjectFilter.java @@ -20,32 +20,32 @@ public class ProjectFilter extends Filter { - private ProjectFilter(Long id, Queryable filter, Long projectId) { - super(id, filter.getTarget(), filter.getFilterConditions()); - getFilterConditions().add(new FilterCondition(Condition.EQUALS, - false, - String.valueOf(projectId), - GeneralCriteriaConstant.CRITERIA_PROJECT_ID - )); - - } - - private ProjectFilter(Queryable filter, Long projectId) { - super(filter.getTarget(), filter.getFilterConditions()); - getFilterConditions().add(new FilterCondition(Condition.EQUALS, - false, - String.valueOf(projectId), - GeneralCriteriaConstant.CRITERIA_PROJECT_ID - )); - - } - - public static ProjectFilter of(Queryable filter, Long projectId) { - return new ProjectFilter(filter, projectId); - } - - public static ProjectFilter of(Long id, Queryable filter, Long projectId) { - return new ProjectFilter(id, filter, projectId); - } + private ProjectFilter(Long id, Queryable filter, Long projectId) { + super(id, filter.getTarget(), filter.getFilterConditions()); + getFilterConditions().add(new FilterCondition(Condition.EQUALS, + false, + String.valueOf(projectId), + GeneralCriteriaConstant.CRITERIA_PROJECT_ID + )); + + } + + private ProjectFilter(Queryable filter, Long projectId) { + super(filter.getTarget(), filter.getFilterConditions()); + getFilterConditions().add(new FilterCondition(Condition.EQUALS, + false, + String.valueOf(projectId), + GeneralCriteriaConstant.CRITERIA_PROJECT_ID + )); + + } + + public static ProjectFilter of(Queryable filter, Long projectId) { + return new ProjectFilter(filter, projectId); + } + + public static ProjectFilter of(Long id, Queryable filter, Long projectId) { + return new ProjectFilter(id, filter, projectId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/QueryBuilder.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/QueryBuilder.java index 4b773622e..13d9a133b 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/QueryBuilder.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/QueryBuilder.java @@ -16,6 +16,16 @@ package com.epam.ta.reportportal.commons.querygen; +import static com.epam.ta.reportportal.commons.querygen.FilterTarget.FILTERED_QUERY; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; +import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; +import static com.epam.ta.reportportal.jooq.Tables.LAUNCH; +import static com.epam.ta.reportportal.jooq.Tables.STATISTICS; +import static com.epam.ta.reportportal.jooq.Tables.STATISTICS_FIELD; +import static com.epam.ta.reportportal.jooq.Tables.TEST_ITEM; +import static java.util.Optional.ofNullable; +import static org.jooq.impl.DSL.field; + import com.epam.ta.reportportal.commons.querygen.query.JoinEntity; import com.epam.ta.reportportal.commons.querygen.query.QuerySupplier; import com.epam.ta.reportportal.exception.ReportPortalException; @@ -23,323 +33,337 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.BiPredicate; +import java.util.stream.StreamSupport; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.tuple.Pair; import org.jooq.Condition; -import org.jooq.*; +import org.jooq.Field; +import org.jooq.GroupField; +import org.jooq.JoinType; +import org.jooq.Query; +import org.jooq.Record; +import org.jooq.SelectQuery; +import org.jooq.SortOrder; +import org.jooq.TableLike; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; -import java.util.*; -import java.util.function.BiPredicate; -import java.util.stream.StreamSupport; - -import static com.epam.ta.reportportal.commons.querygen.FilterTarget.FILTERED_QUERY; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; -import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; -import static com.epam.ta.reportportal.jooq.Tables.*; -import static java.util.Optional.ofNullable; -import static org.jooq.impl.DSL.field; - /** - * PostgreSQL query builder using JOOQ. Constructs PostgreSQL {@link Query} - * by provided filters. + * PostgreSQL query builder using JOOQ. Constructs PostgreSQL {@link Query} by provided filters. * * @author Pavel Bortnik */ public class QueryBuilder { - private final static Map STATISTICS_TARGET_MAPPING = ImmutableMap.builder().put( - FilterTarget.LAUNCH_TARGET, - JoinEntity.of(STATISTICS, JoinType.LEFT_OUTER_JOIN, LAUNCH.ID.eq(STATISTICS.LAUNCH_ID)) - ) - .put(FilterTarget.TEST_ITEM_TARGET, - JoinEntity.of(STATISTICS, JoinType.LEFT_OUTER_JOIN, TEST_ITEM.ITEM_ID.eq(STATISTICS.ITEM_ID)) - ) - .build(); - - /** - * Key word for statistics criteria. Query builder works a little bit in another way - * with statistics criteria. It implements kind of pivot using PostgerSQL possibilities - */ - public final static String STATISTICS_KEY = "statistics"; - - /** - * Conditions that should be applied with HAVING - */ - private static final List HAVING_CONDITIONS = ImmutableList.builder() - .add(com.epam.ta.reportportal.commons.querygen.Condition.HAS) - .add(com.epam.ta.reportportal.commons.querygen.Condition.ANY) - .build(); - - /** - * Predicate that checks if filter condition should be applied with HAVING - */ - public final static BiPredicate HAVING_CONDITION = (filterCondition, target) -> { - CriteriaHolder criteria = target.getCriteriaByFilter(filterCondition.getSearchCriteria()) - .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_FILTER_PARAMETERS, filterCondition.getSearchCriteria())); - return HAVING_CONDITIONS.contains(filterCondition.getCondition()) || filterCondition.getSearchCriteria().startsWith(STATISTICS_KEY) - || !criteria.getQueryCriteria().equals(criteria.getAggregateCriteria()); - }; - - /** - * JOOQ SQL query representation - */ - private QuerySupplier query; - - private FilterTarget filterTarget; - - private QueryBuilder(FilterTarget target) { - filterTarget = target; - query = target.getQuery(); - } - - private QueryBuilder(FilterTarget filterTarget, Set fields) { - this.filterTarget = filterTarget; - this.query = this.filterTarget.getQuery(); - addJoinsToQuery(this.query, this.filterTarget, fields); - } - - private QueryBuilder(Queryable query) { - filterTarget = query.getTarget(); - this.query = query.toQuery(); - } - - private QueryBuilder(Queryable queryable, Set fields) { - filterTarget = queryable.getTarget(); - this.query = queryable.toQuery(); - addJoinsToQuery(this.query, filterTarget, fields); - } - - public static QueryBuilder newBuilder(FilterTarget target) { - return new QueryBuilder(target); - } - - public static QueryBuilder newBuilder(FilterTarget target, Set fields) { - return new QueryBuilder(target, fields); - } - - public static QueryBuilder newBuilder(Queryable queryable) { - return new QueryBuilder(queryable); - } - - public static QueryBuilder newBuilder(Queryable queryable, Set fields) { - return new QueryBuilder(queryable, fields); - } - - public QueryBuilder addJointToStart(TableLike table, JoinType joinType, Condition condition) { - if (table != null && joinType != null && condition != null) { - query.addJoinToStart(JoinEntity.of(table, joinType, condition)); - } - return this; - } - - public QueryBuilder addJoinToEnd(TableLike table, JoinType joinType, Condition condition) { - if (table != null && joinType != null && condition != null) { - query.addJoinToEnd(JoinEntity.of(table, joinType, condition)); - } - return this; - } - - /** - * Adds condition to the query - * - * @param condition Condition - * @return QueryBuilder - */ - public QueryBuilder addCondition(Condition condition) { - if (null != condition) { - query.addCondition(condition); - } - return this; - } - - /** - * Adds statistics condition to the query - * - * @param condition Condition - */ - public QueryBuilder addHavingCondition(Condition condition) { - if (null != condition) { - query.addHaving(condition); - } - return this; - } - - /** - * Adds {@link Pageable} conditions - * - * @param pageable Pageable - * @return QueryBuilder - */ - public QueryBuilder with(Pageable pageable) { - if (pageable.isPaged()) { - query.addLimit(pageable.getPageSize()); - int offset = retrieveOffsetAndApplyBoundaries(pageable); - query.addOffset(offset); - } - return with(pageable.getSort()); - } - - /** - * Add limit - * - * @param limit Limit - * @return QueryBuilder - */ - public QueryBuilder with(int limit) { - query.addLimit(limit); - return this; - } - - /** - * Add offset - * - * @param offset offset - * @return QueryBuilder - */ - public QueryBuilder withOffset(int offset) { - query.addOffset(offset); - return this; - } - - /** - * Convert properties to query criteria and add sorting {@link Sort} - * - * @param sort Sort condition - * @return QueryBuilder - */ - public QueryBuilder with(Sort sort) { - - Set> sortingSelect = Sets.newLinkedHashSet(); - - ofNullable(sort).ifPresent(s -> s.get().forEach(order -> { - CriteriaHolder criteria = filterTarget.getCriteriaByFilter(order.getProperty()) - .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_SORTING_PARAMETERS, order.getProperty())); - Pair sorting = Pair.of(criteria.getFilterCriteria(), order.getDirection()); - if (!order.getProperty().equalsIgnoreCase(CRITERIA_ID) && !sortingSelect.contains(sorting)) { - query.addSelect(field(criteria.getAggregateCriteria()).as(criteria.getFilterCriteria())); - sortingSelect.add(sorting); - } - query.addOrderBy(field(criteria.getAggregateCriteria()).sort(order.getDirection().isDescending() ? - SortOrder.DESC : - SortOrder.ASC)); - })); - return this; - } - - public QueryBuilder with(Field field, SortOrder sort) { - query.addOrderBy(field.sort(sort)); - return this; - } - - public QuerySupplier getQuerySupplier() { - return query; - } - - /** - * Builds query - * - * @return Query - */ - public SelectQuery build() { - return query.get(); - } - - /** - * Joins inner query to load all columns after filtering - * - * @return Query builder - */ - public QueryBuilder wrap() { - query = filterTarget.wrapQuery(query.get()); - return this; - } - - /** - * Joins inner query to load columns excluding provided fields after filtering - * - * @return Query builder - */ - public QueryBuilder wrapExcludingFields(String... excludingFields) { - query = filterTarget.wrapQuery(query.get(), excludingFields); - return this; - } - - public QueryBuilder withWrapperSort(Sort sort) { - ofNullable(sort).ifPresent(s -> StreamSupport.stream(s.spliterator(), false).forEach(order -> { - CriteriaHolder criteria = filterTarget.getCriteriaByFilter(order.getProperty()) - .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_SORTING_PARAMETERS, order.getProperty())); - if (criteria.getFilterCriteria().startsWith(STATISTICS_KEY)) { - if (filterTarget.withGrouping()) { - query.addGroupBy(fieldName(FILTERED_QUERY, criteria.getFilterCriteria())); - } - - query.addOrderBy(fieldName(FILTERED_QUERY, criteria.getFilterCriteria()).sort(order.getDirection().isDescending() ? - SortOrder.DESC : - SortOrder.ASC)); - } else { - if (filterTarget.withGrouping()) { - query.addGroupBy(field(criteria.getQueryCriteria())); - } - - query.addOrderBy(field(criteria.getQueryCriteria()).sort(order.getDirection().isDescending() ? - SortOrder.DESC : - SortOrder.ASC)); - } - })); - return this; - } - - public static int retrieveOffsetAndApplyBoundaries(Pageable pageable) { - - long offset = pageable.getOffset(); - - if (offset < 0) { - return 0; - } - - if (offset > Integer.MAX_VALUE) { - return Integer.MAX_VALUE; - } else { - return (int) offset; - } - - } - - private void addJoinsToQuery(QuerySupplier query, FilterTarget filterTarget, Set fields) { - Map joinTables = new LinkedHashMap<>(); - fields.forEach(it -> { - if (!joinTables.containsKey(STATISTICS) && it.startsWith(STATISTICS_KEY)) { - ofNullable(STATISTICS_TARGET_MAPPING.get(filterTarget)).ifPresent(joinEntity -> { - joinTables.put(STATISTICS, joinEntity); - joinTables.put(STATISTICS_FIELD, - JoinEntity.of(STATISTICS_FIELD, - JoinType.LEFT_OUTER_JOIN, - STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID) - ) - ); - }); - } else { - filterTarget.getCriteriaByFilter(it).ifPresent(criteriaHolder -> criteriaHolder.getJoinChain().forEach(joinEntity -> { - if (!joinTables.containsKey(joinEntity.getTable())) { - joinTables.put(joinEntity.getTable(), joinEntity); - } - })); - - } - }); - joinTables.forEach((key, value) -> query.addJoin(value.getTable(), value.getJoinType(), value.getJoinCondition())); - } - - /** - * Adds group by condition - */ - public QueryBuilder addGroupByFields(Collection fields) { - if (CollectionUtils.isNotEmpty(fields)) { - query.addGroupBy(fields); - } - - return this; - } + /** + * Key word for statistics criteria. Query builder works a little bit in another way with + * statistics criteria. It implements kind of pivot using PostgerSQL possibilities + */ + public final static String STATISTICS_KEY = "statistics"; + private final static Map STATISTICS_TARGET_MAPPING = ImmutableMap.builder() + .put( + FilterTarget.LAUNCH_TARGET, + JoinEntity.of(STATISTICS, JoinType.LEFT_OUTER_JOIN, LAUNCH.ID.eq(STATISTICS.LAUNCH_ID)) + ) + .put(FilterTarget.TEST_ITEM_TARGET, + JoinEntity.of(STATISTICS, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(STATISTICS.ITEM_ID)) + ) + .build(); + /** + * Conditions that should be applied with HAVING + */ + private static final List HAVING_CONDITIONS = ImmutableList.builder() + .add(com.epam.ta.reportportal.commons.querygen.Condition.HAS) + .add(com.epam.ta.reportportal.commons.querygen.Condition.ANY) + .build(); + + /** + * Predicate that checks if filter condition should be applied with HAVING + */ + public final static BiPredicate HAVING_CONDITION = (filterCondition, target) -> { + CriteriaHolder criteria = target.getCriteriaByFilter(filterCondition.getSearchCriteria()) + .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_FILTER_PARAMETERS, + filterCondition.getSearchCriteria())); + return HAVING_CONDITIONS.contains(filterCondition.getCondition()) + || filterCondition.getSearchCriteria().startsWith(STATISTICS_KEY) + || !criteria.getQueryCriteria().equals(criteria.getAggregateCriteria()); + }; + + /** + * JOOQ SQL query representation + */ + private QuerySupplier query; + + private FilterTarget filterTarget; + + private QueryBuilder(FilterTarget target) { + filterTarget = target; + query = target.getQuery(); + } + + private QueryBuilder(FilterTarget filterTarget, Set fields) { + this.filterTarget = filterTarget; + this.query = this.filterTarget.getQuery(); + addJoinsToQuery(this.query, this.filterTarget, fields); + } + + private QueryBuilder(Queryable query) { + filterTarget = query.getTarget(); + this.query = query.toQuery(); + } + + private QueryBuilder(Queryable queryable, Set fields) { + filterTarget = queryable.getTarget(); + this.query = queryable.toQuery(); + addJoinsToQuery(this.query, filterTarget, fields); + } + + public static QueryBuilder newBuilder(FilterTarget target) { + return new QueryBuilder(target); + } + + public static QueryBuilder newBuilder(FilterTarget target, Set fields) { + return new QueryBuilder(target, fields); + } + + public static QueryBuilder newBuilder(Queryable queryable) { + return new QueryBuilder(queryable); + } + + public static QueryBuilder newBuilder(Queryable queryable, Set fields) { + return new QueryBuilder(queryable, fields); + } + + public static int retrieveOffsetAndApplyBoundaries(Pageable pageable) { + + long offset = pageable.getOffset(); + + if (offset < 0) { + return 0; + } + + if (offset > Integer.MAX_VALUE) { + return Integer.MAX_VALUE; + } else { + return (int) offset; + } + + } + + public QueryBuilder addJointToStart(TableLike table, JoinType joinType, + Condition condition) { + if (table != null && joinType != null && condition != null) { + query.addJoinToStart(JoinEntity.of(table, joinType, condition)); + } + return this; + } + + public QueryBuilder addJoinToEnd(TableLike table, JoinType joinType, + Condition condition) { + if (table != null && joinType != null && condition != null) { + query.addJoinToEnd(JoinEntity.of(table, joinType, condition)); + } + return this; + } + + /** + * Adds condition to the query + * + * @param condition Condition + * @return QueryBuilder + */ + public QueryBuilder addCondition(Condition condition) { + if (null != condition) { + query.addCondition(condition); + } + return this; + } + + /** + * Adds statistics condition to the query + * + * @param condition Condition + */ + public QueryBuilder addHavingCondition(Condition condition) { + if (null != condition) { + query.addHaving(condition); + } + return this; + } + + /** + * Adds {@link Pageable} conditions + * + * @param pageable Pageable + * @return QueryBuilder + */ + public QueryBuilder with(Pageable pageable) { + if (pageable.isPaged()) { + query.addLimit(pageable.getPageSize()); + int offset = retrieveOffsetAndApplyBoundaries(pageable); + query.addOffset(offset); + } + return with(pageable.getSort()); + } + + /** + * Add limit + * + * @param limit Limit + * @return QueryBuilder + */ + public QueryBuilder with(int limit) { + query.addLimit(limit); + return this; + } + + /** + * Add offset + * + * @param offset offset + * @return QueryBuilder + */ + public QueryBuilder withOffset(int offset) { + query.addOffset(offset); + return this; + } + + /** + * Convert properties to query criteria and add sorting {@link Sort} + * + * @param sort Sort condition + * @return QueryBuilder + */ + public QueryBuilder with(Sort sort) { + + Set> sortingSelect = Sets.newLinkedHashSet(); + + ofNullable(sort).ifPresent(s -> s.get().forEach(order -> { + CriteriaHolder criteria = filterTarget.getCriteriaByFilter(order.getProperty()) + .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_SORTING_PARAMETERS, + order.getProperty())); + Pair sorting = Pair.of(criteria.getFilterCriteria(), + order.getDirection()); + if (!order.getProperty().equalsIgnoreCase(CRITERIA_ID) && !sortingSelect.contains(sorting)) { + query.addSelect(field(criteria.getAggregateCriteria()).as(criteria.getFilterCriteria())); + sortingSelect.add(sorting); + } + query.addOrderBy( + field(criteria.getAggregateCriteria()).sort(order.getDirection().isDescending() ? + SortOrder.DESC : + SortOrder.ASC)); + })); + return this; + } + + public QueryBuilder with(Field field, SortOrder sort) { + query.addOrderBy(field.sort(sort)); + return this; + } + + public QuerySupplier getQuerySupplier() { + return query; + } + + /** + * Builds query + * + * @return Query + */ + public SelectQuery build() { + return query.get(); + } + + /** + * Joins inner query to load all columns after filtering + * + * @return Query builder + */ + public QueryBuilder wrap() { + query = filterTarget.wrapQuery(query.get()); + return this; + } + + /** + * Joins inner query to load columns excluding provided fields after filtering + * + * @return Query builder + */ + public QueryBuilder wrapExcludingFields(String... excludingFields) { + query = filterTarget.wrapQuery(query.get(), excludingFields); + return this; + } + + public QueryBuilder withWrapperSort(Sort sort) { + ofNullable(sort).ifPresent(s -> StreamSupport.stream(s.spliterator(), false).forEach(order -> { + CriteriaHolder criteria = filterTarget.getCriteriaByFilter(order.getProperty()) + .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_SORTING_PARAMETERS, + order.getProperty())); + if (criteria.getFilterCriteria().startsWith(STATISTICS_KEY)) { + if (filterTarget.withGrouping()) { + query.addGroupBy(fieldName(FILTERED_QUERY, criteria.getFilterCriteria())); + } + + query.addOrderBy(fieldName(FILTERED_QUERY, criteria.getFilterCriteria()).sort( + order.getDirection().isDescending() ? + SortOrder.DESC : + SortOrder.ASC)); + } else { + if (filterTarget.withGrouping()) { + query.addGroupBy(field(criteria.getQueryCriteria())); + } + + query.addOrderBy( + field(criteria.getQueryCriteria()).sort(order.getDirection().isDescending() ? + SortOrder.DESC : + SortOrder.ASC)); + } + })); + return this; + } + + private void addJoinsToQuery(QuerySupplier query, FilterTarget filterTarget, Set fields) { + Map joinTables = new LinkedHashMap<>(); + fields.forEach(it -> { + if (!joinTables.containsKey(STATISTICS) && it.startsWith(STATISTICS_KEY)) { + ofNullable(STATISTICS_TARGET_MAPPING.get(filterTarget)).ifPresent(joinEntity -> { + joinTables.put(STATISTICS, joinEntity); + joinTables.put(STATISTICS_FIELD, + JoinEntity.of(STATISTICS_FIELD, + JoinType.LEFT_OUTER_JOIN, + STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID) + ) + ); + }); + } else { + filterTarget.getCriteriaByFilter(it) + .ifPresent(criteriaHolder -> criteriaHolder.getJoinChain().forEach(joinEntity -> { + if (!joinTables.containsKey(joinEntity.getTable())) { + joinTables.put(joinEntity.getTable(), joinEntity); + } + })); + + } + }); + joinTables.forEach((key, value) -> query.addJoin(value.getTable(), value.getJoinType(), + value.getJoinCondition())); + } + + /** + * Adds group by condition + */ + public QueryBuilder addGroupByFields(Collection fields) { + if (CollectionUtils.isNotEmpty(fields)) { + query.addGroupBy(fields); + } + + return this; + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/Queryable.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/Queryable.java index 64fc2a6fc..863f93f19 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/Queryable.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/Queryable.java @@ -17,10 +17,9 @@ package com.epam.ta.reportportal.commons.querygen; import com.epam.ta.reportportal.commons.querygen.query.QuerySupplier; -import org.jooq.Condition; - import java.util.List; import java.util.Map; +import org.jooq.Condition; /** * Can be used to generate SQL queries with help of JOOQ @@ -30,30 +29,30 @@ */ public interface Queryable { - /** - * Builds a query with lazy joins - * - * @return {@link QuerySupplier} - */ - QuerySupplier toQuery(); - - /** - * Build a map where key is {@link ConditionType} and value is a composite {@link Condition} - * that should be applied either in {@link ConditionType#HAVING} or {@link ConditionType#WHERE} clause - * - * @return Resulted map - */ - Map toCondition(); - - /** - * @return {@link FilterTarget} - */ - FilterTarget getTarget(); - - /** - * @return Set of {@link FilterCondition} - */ - List getFilterConditions(); - - boolean replaceSearchCriteria(FilterCondition oldCondition, FilterCondition newCondition); + /** + * Builds a query with lazy joins + * + * @return {@link QuerySupplier} + */ + QuerySupplier toQuery(); + + /** + * Build a map where key is {@link ConditionType} and value is a composite {@link Condition} that + * should be applied either in {@link ConditionType#HAVING} or {@link ConditionType#WHERE} clause + * + * @return Resulted map + */ + Map toCondition(); + + /** + * @return {@link FilterTarget} + */ + FilterTarget getTarget(); + + /** + * @return Set of {@link FilterCondition} + */ + List getFilterConditions(); + + boolean replaceSearchCriteria(FilterCondition oldCondition, FilterCondition newCondition); } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ActivityCriteriaConstant.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ActivityCriteriaConstant.java index 9a0d30a71..0dd116fe0 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ActivityCriteriaConstant.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ActivityCriteriaConstant.java @@ -23,14 +23,14 @@ */ public final class ActivityCriteriaConstant { - private ActivityCriteriaConstant() { - //static only - } + public static final String CRITERIA_ACTION = "action"; + public static final String CRITERIA_LOGIN = "login"; + public static final String CRITERIA_OBJECT_ID = "objectId"; + public static final String CRITERIA_ENTITY = "entity"; + public static final String CRITERIA_CREATION_DATE = "creationDate"; + public static final String CRITERIA_OBJECT_NAME = "objectName"; - public static final String CRITERIA_ACTION = "action"; - public static final String CRITERIA_LOGIN = "login"; - public static final String CRITERIA_OBJECT_ID = "objectId"; - public static final String CRITERIA_ENTITY = "entity"; - public static final String CRITERIA_CREATION_DATE = "creationDate"; - public static final String CRITERIA_OBJECT_NAME = "objectName"; + private ActivityCriteriaConstant() { + //static only + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/GeneralCriteriaConstant.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/GeneralCriteriaConstant.java index d715359c5..d0ec9e4a9 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/GeneralCriteriaConstant.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/GeneralCriteriaConstant.java @@ -23,20 +23,20 @@ */ public final class GeneralCriteriaConstant { - private GeneralCriteriaConstant() { - //static only - } + public static final String CRITERIA_ID = "id"; + public static final String CRITERIA_NAME = "name"; + public static final String CRITERIA_SHARED = "shared"; + public static final String CRITERIA_OWNER = "owner"; + public static final String CRITERIA_PROJECT_ID = "projectId"; + public static final String CRITERIA_USER_ID = "userId"; + public static final String CRITERIA_LAST_MODIFIED = "lastModified"; + public static final String CRITERIA_DESCRIPTION = "description"; + public static final String CRITERIA_PROJECT = "project"; + public static final String CRITERIA_LAUNCH_ID = "launchId"; + public static final String CRITERIA_START_TIME = "startTime"; + public static final String CRITERIA_END_TIME = "endTime"; - public static final String CRITERIA_ID = "id"; - public static final String CRITERIA_NAME = "name"; - public static final String CRITERIA_SHARED = "shared"; - public static final String CRITERIA_OWNER = "owner"; - public static final String CRITERIA_PROJECT_ID = "projectId"; - public static final String CRITERIA_USER_ID = "userId"; - public static final String CRITERIA_LAST_MODIFIED = "lastModified"; - public static final String CRITERIA_DESCRIPTION = "description"; - public static final String CRITERIA_PROJECT = "project"; - public static final String CRITERIA_LAUNCH_ID = "launchId"; - public static final String CRITERIA_START_TIME = "startTime"; - public static final String CRITERIA_END_TIME = "endTime"; + private GeneralCriteriaConstant() { + //static only + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/IntegrationCriteriaConstant.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/IntegrationCriteriaConstant.java index e12d5d0c5..a1a689558 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/IntegrationCriteriaConstant.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/IntegrationCriteriaConstant.java @@ -23,9 +23,9 @@ */ public final class IntegrationCriteriaConstant { - private IntegrationCriteriaConstant() { - //static only - } + public static final String CRITERIA_INTEGRATION_TYPE = "type"; - public static final String CRITERIA_INTEGRATION_TYPE = "type"; + private IntegrationCriteriaConstant() { + //static only + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/IssueCriteriaConstant.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/IssueCriteriaConstant.java index cfe9312eb..1d7043977 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/IssueCriteriaConstant.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/IssueCriteriaConstant.java @@ -21,13 +21,13 @@ */ public final class IssueCriteriaConstant { - private IssueCriteriaConstant() { - //static only - } + public static final String CRITERIA_ISSUE_ID = "issueId"; + public static final String CRITERIA_ISSUE_AUTO_ANALYZED = "autoAnalyzed"; + public static final String CRITERIA_ISSUE_IGNORE_ANALYZER = "ignoreAnalyzer"; + public static final String CRITERIA_ISSUE_LOCATOR = "locator"; + public static final String CRITERIA_ISSUE_COMMENT = "issueComment"; - public static final String CRITERIA_ISSUE_ID = "issueId"; - public static final String CRITERIA_ISSUE_AUTO_ANALYZED = "autoAnalyzed"; - public static final String CRITERIA_ISSUE_IGNORE_ANALYZER = "ignoreAnalyzer"; - public static final String CRITERIA_ISSUE_LOCATOR = "locator"; - public static final String CRITERIA_ISSUE_COMMENT = "issueComment"; + private IssueCriteriaConstant() { + //static only + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ItemAttributeConstant.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ItemAttributeConstant.java index a85323c92..6548788a9 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ItemAttributeConstant.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ItemAttributeConstant.java @@ -23,16 +23,16 @@ */ public final class ItemAttributeConstant { - private ItemAttributeConstant() { - //static only - } + public static final String CRITERIA_ITEM_ATTRIBUTE_KEY = "attributeKey"; + public static final String CRITERIA_ITEM_ATTRIBUTE_VALUE = "attributeValue"; + public static final String CRITERIA_ITEM_ATTRIBUTE_SYSTEM = "attributeSystem"; + public static final String CRITERIA_COMPOSITE_ATTRIBUTE = "compositeAttribute"; + public static final String CRITERIA_LEVEL_ATTRIBUTE = "levelAttribute"; + public static final String KEY_VALUE_SEPARATOR = ":"; + public static final JItemAttribute LAUNCH_ATTRIBUTE = JItemAttribute.ITEM_ATTRIBUTE.as( + "launchAttribute"); - public static final String CRITERIA_ITEM_ATTRIBUTE_KEY = "attributeKey"; - public static final String CRITERIA_ITEM_ATTRIBUTE_VALUE = "attributeValue"; - public static final String CRITERIA_ITEM_ATTRIBUTE_SYSTEM = "attributeSystem"; - public static final String CRITERIA_COMPOSITE_ATTRIBUTE = "compositeAttribute"; - public static final String CRITERIA_LEVEL_ATTRIBUTE = "levelAttribute"; - public static final String KEY_VALUE_SEPARATOR = ":"; - - public static final JItemAttribute LAUNCH_ATTRIBUTE = JItemAttribute.ITEM_ATTRIBUTE.as("launchAttribute"); + private ItemAttributeConstant() { + //static only + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/LaunchCriteriaConstant.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/LaunchCriteriaConstant.java index 571624b76..5847e45f3 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/LaunchCriteriaConstant.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/LaunchCriteriaConstant.java @@ -23,13 +23,13 @@ */ public final class LaunchCriteriaConstant { - private LaunchCriteriaConstant() { - //static only - } + public static final String CRITERIA_LAUNCH_UUID = "uuid"; + public static final String CRITERIA_LAUNCH_MODE = "mode"; + public static final String CRITERIA_LAUNCH_STATUS = "status"; + public static final String CRITERIA_LAUNCH_NUMBER = "number"; - public static final String CRITERIA_LAUNCH_UUID = "uuid"; - public static final String CRITERIA_LAUNCH_MODE = "mode"; - public static final String CRITERIA_LAUNCH_STATUS = "status"; - public static final String CRITERIA_LAUNCH_NUMBER = "number"; + private LaunchCriteriaConstant() { + //static only + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/LogCriteriaConstant.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/LogCriteriaConstant.java index 64fc7d9ae..956847db4 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/LogCriteriaConstant.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/LogCriteriaConstant.java @@ -23,17 +23,17 @@ */ public final class LogCriteriaConstant { - private LogCriteriaConstant() { - //static only - } + public static final String CRITERIA_TEST_ITEM_ID = "item"; + public static final String CRITERIA_LOG_LAUNCH_ID = "launch"; + public static final String CRITERIA_ITEM_LAUNCH_ID = "launchId"; + public static final String CRITERIA_LOG_MESSAGE = "message"; + public static final String CRITERIA_LOG_LEVEL = "level"; + public static final String CRITERIA_LOG_ID = "logId"; + public static final String CRITERIA_LOG_TIME = "logTime"; + public static final String CRITERIA_LOG_BINARY_CONTENT = "binaryContent"; + public static final String CRITERIA_LOG_PROJECT_ID = "projectId"; - public static final String CRITERIA_TEST_ITEM_ID = "item"; - public static final String CRITERIA_LOG_LAUNCH_ID = "launch"; - public static final String CRITERIA_ITEM_LAUNCH_ID = "launchId"; - public static final String CRITERIA_LOG_MESSAGE = "message"; - public static final String CRITERIA_LOG_LEVEL = "level"; - public static final String CRITERIA_LOG_ID = "logId"; - public static final String CRITERIA_LOG_TIME = "logTime"; - public static final String CRITERIA_LOG_BINARY_CONTENT = "binaryContent"; - public static final String CRITERIA_LOG_PROJECT_ID = "projectId"; + private LogCriteriaConstant() { + //static only + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ProjectCriteriaConstant.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ProjectCriteriaConstant.java index 1e94f5f18..59a667720 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ProjectCriteriaConstant.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ProjectCriteriaConstant.java @@ -21,14 +21,14 @@ */ public final class ProjectCriteriaConstant { - private ProjectCriteriaConstant() { - //static only - } + public static final String CRITERIA_PROJECT_TYPE = "type"; + public static final String CRITERIA_PROJECT_NAME = "name"; + public static final String CRITERIA_ALLOCATED_STORAGE = "allocatedStorage"; + public static final String CRITERIA_PROJECT_ORGANIZATION = "organization"; + public static final String CRITERIA_PROJECT_CREATION_DATE = "creationDate"; + public static final String CRITERIA_PROJECT_ATTRIBUTE_NAME = "attributeName"; - public static final String CRITERIA_PROJECT_TYPE = "type"; - public static final String CRITERIA_PROJECT_NAME = "name"; - public static final String CRITERIA_ALLOCATED_STORAGE = "allocatedStorage"; - public static final String CRITERIA_PROJECT_ORGANIZATION = "organization"; - public static final String CRITERIA_PROJECT_CREATION_DATE = "creationDate"; - public static final String CRITERIA_PROJECT_ATTRIBUTE_NAME = "attributeName"; + private ProjectCriteriaConstant() { + //static only + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/TestItemCriteriaConstant.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/TestItemCriteriaConstant.java index 3827c9ea4..f3fe0cf52 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/TestItemCriteriaConstant.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/TestItemCriteriaConstant.java @@ -18,33 +18,32 @@ public final class TestItemCriteriaConstant { - private TestItemCriteriaConstant() { - //static only - } + public static final String CRITERIA_STATUS = "status"; + public static final String CRITERIA_HAS_CHILDREN = "hasChildren"; + public static final String CRITERIA_HAS_RETRIES = "hasRetries"; + public static final String CRITERIA_HAS_STATS = "hasStats"; + public static final String CRITERIA_TYPE = "type"; + public static final String CRITERIA_PATH = "path"; + public static final String CRITERIA_ISSUE_TYPE = "issueType"; + public static final String CRITERIA_ISSUE_TYPE_ID = "issueTypeId"; + public static final String CRITERIA_ISSUE_GROUP_ID = "issueGroupId"; + public static final String CRITERIA_UNIQUE_ID = "uniqueId"; + public static final String CRITERIA_UUID = "uuid"; + public static final String CRITERIA_TEST_CASE_ID = "testCaseId"; + public static final String CRITERIA_TEST_CASE_HASH = "testCaseHash"; + public static final String CRITERIA_PARENT_ID = "parentId"; + public static final String CRITERIA_RETRY_PARENT_ID = "retryParentId"; + public static final String CRITERIA_RETRY_PARENT_LAUNCH_ID = "retryParentLaunchId"; + public static final String CRITERIA_DURATION = "duration"; + public static final String CRITERIA_PARAMETER_KEY = "key"; + public static final String CRITERIA_PARAMETER_VALUE = "value"; + public static final String CRITERIA_PATTERN_TEMPLATE_NAME = "patternName"; + public static final String CRITERIA_TICKET_ID = "ticketId"; + public static final String CRITERIA_CLUSTER_ID = "clusterId"; + public static final String RETRY_PARENT = "retry_parent"; - public static final String CRITERIA_STATUS = "status"; - public static final String CRITERIA_HAS_CHILDREN = "hasChildren"; - public static final String CRITERIA_HAS_RETRIES = "hasRetries"; - public static final String CRITERIA_HAS_STATS = "hasStats"; - public static final String CRITERIA_TYPE = "type"; - public static final String CRITERIA_PATH = "path"; - public static final String CRITERIA_ISSUE_TYPE = "issueType"; - public static final String CRITERIA_ISSUE_TYPE_ID = "issueTypeId"; - public static final String CRITERIA_ISSUE_GROUP_ID = "issueGroupId"; - public static final String CRITERIA_UNIQUE_ID = "uniqueId"; - public static final String CRITERIA_UUID = "uuid"; - public static final String CRITERIA_TEST_CASE_ID = "testCaseId"; - public static final String CRITERIA_TEST_CASE_HASH = "testCaseHash"; - public static final String CRITERIA_PARENT_ID = "parentId"; - public static final String CRITERIA_RETRY_PARENT_ID = "retryParentId"; - public static final String CRITERIA_RETRY_PARENT_LAUNCH_ID = "retryParentLaunchId"; - public static final String CRITERIA_DURATION = "duration"; - public static final String CRITERIA_PARAMETER_KEY = "key"; - public static final String CRITERIA_PARAMETER_VALUE = "value"; - public static final String CRITERIA_PATTERN_TEMPLATE_NAME = "patternName"; - public static final String CRITERIA_TICKET_ID = "ticketId"; - public static final String CRITERIA_CLUSTER_ID = "clusterId"; - - public static final String RETRY_PARENT = "retry_parent"; + private TestItemCriteriaConstant() { + //static only + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/UserCriteriaConstant.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/UserCriteriaConstant.java index fb759ce98..f2b152924 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/UserCriteriaConstant.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/UserCriteriaConstant.java @@ -21,17 +21,17 @@ */ public final class UserCriteriaConstant { - public static final String CRITERIA_USER = "user"; - public static final String CRITERIA_ROLE = "role"; - public static final String CRITERIA_TYPE = "type"; - public static final String CRITERIA_FULL_NAME = "fullName"; - public static final String CRITERIA_EMAIL = "email"; - public static final String CRITERIA_EXPIRED = "expired"; - public static final String CRITERIA_LAST_LOGIN = "lastLogin"; - public static final String CRITERIA_SYNCHRONIZATION_DATE = "synchronizationDate"; - public static final String CRITERIA_USER_PROJECT = "project"; + public static final String CRITERIA_USER = "user"; + public static final String CRITERIA_ROLE = "role"; + public static final String CRITERIA_TYPE = "type"; + public static final String CRITERIA_FULL_NAME = "fullName"; + public static final String CRITERIA_EMAIL = "email"; + public static final String CRITERIA_EXPIRED = "expired"; + public static final String CRITERIA_LAST_LOGIN = "lastLogin"; + public static final String CRITERIA_SYNCHRONIZATION_DATE = "synchronizationDate"; + public static final String CRITERIA_USER_PROJECT = "project"; - private UserCriteriaConstant() { - //static only - } + private UserCriteriaConstant() { + //static only + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/query/JoinEntity.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/query/JoinEntity.java index e0a710fd9..a874e1a43 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/query/JoinEntity.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/query/JoinEntity.java @@ -26,29 +26,29 @@ */ public final class JoinEntity { - private final TableLike table; - private final JoinType joinType; - private final Condition joinCondition; - - private JoinEntity(TableLike table, JoinType joinType, Condition joinCondition) { - this.table = table; - this.joinType = joinType; - this.joinCondition = joinCondition; - } - - public TableLike getTable() { - return table; - } - - public JoinType getJoinType() { - return joinType; - } - - public Condition getJoinCondition() { - return joinCondition; - } - - public static JoinEntity of(TableLike table, JoinType joinType, Condition joinCondition) { - return new JoinEntity(table, joinType, joinCondition); - } + private final TableLike table; + private final JoinType joinType; + private final Condition joinCondition; + + private JoinEntity(TableLike table, JoinType joinType, Condition joinCondition) { + this.table = table; + this.joinType = joinType; + this.joinCondition = joinCondition; + } + + public static JoinEntity of(TableLike table, JoinType joinType, Condition joinCondition) { + return new JoinEntity(table, joinType, joinCondition); + } + + public TableLike getTable() { + return table; + } + + public JoinType getJoinType() { + return joinType; + } + + public Condition getJoinCondition() { + return joinCondition; + } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/query/QuerySupplier.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/query/QuerySupplier.java index 1051e0562..ac5b45174 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/query/QuerySupplier.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/query/QuerySupplier.java @@ -17,98 +17,105 @@ package com.epam.ta.reportportal.commons.querygen.query; import com.google.common.collect.Lists; -import org.jooq.*; - import java.util.Collection; import java.util.List; import java.util.function.Supplier; +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.GroupField; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.SelectQuery; +import org.jooq.SortField; +import org.jooq.TableLike; /** * @author Ivan Budayeu */ public class QuerySupplier implements Supplier> { - private final SelectQuery selectQuery; - private final List joinEntities; - - public QuerySupplier(SelectQuery selectQuery, List joinEntities) { - this.selectQuery = selectQuery; - this.joinEntities = joinEntities; - } - - public QuerySupplier(SelectQuery selectQuery) { - this.selectQuery = selectQuery; - this.joinEntities = Lists.newArrayList(); - } - - @Override - public SelectQuery get() { - joinEntities.forEach(join -> selectQuery.addJoin(join.getTable(), join.getJoinType(), join.getJoinCondition())); - return selectQuery; - } - - public QuerySupplier addJoin(TableLike table, JoinType joinType, Condition condition) { - addJoinToEnd(JoinEntity.of(table, joinType, condition)); - return this; - } - - public QuerySupplier addJoinToStart(JoinEntity joinEntity) { - joinEntities.add(0, joinEntity); - return this; - } - - public QuerySupplier addJoinToEnd(JoinEntity joinEntity) { - joinEntities.add(joinEntity); - return this; - } - - public boolean addJoin(int index, JoinEntity joinEntity) { - if (index >= 0 && index <= joinEntities.size()) { - joinEntities.add(index, joinEntity); - return true; - } else { - return false; - } - - } - - public QuerySupplier addSelect(Field as) { - selectQuery.addSelect(as); - return this; - } - - public QuerySupplier addOrderBy(SortField sortField) { - selectQuery.addOrderBy(sortField); - return this; - } - - public QuerySupplier addLimit(int limit) { - selectQuery.addLimit(limit); - return this; - } - - public QuerySupplier addOffset(int offset) { - selectQuery.addOffset(offset); - return this; - } - - public QuerySupplier addCondition(Condition condition) { - selectQuery.addConditions(condition); - return this; - } - - public QuerySupplier addHaving(Condition condition) { - selectQuery.addHaving(condition); - return this; - } - - public QuerySupplier addGroupBy(GroupField fields) { - selectQuery.addGroupBy(fields); - return this; - } - - public QuerySupplier addGroupBy(Collection fields) { - selectQuery.addGroupBy(fields); - return this; - } + private final SelectQuery selectQuery; + private final List joinEntities; + + public QuerySupplier(SelectQuery selectQuery, List joinEntities) { + this.selectQuery = selectQuery; + this.joinEntities = joinEntities; + } + + public QuerySupplier(SelectQuery selectQuery) { + this.selectQuery = selectQuery; + this.joinEntities = Lists.newArrayList(); + } + + @Override + public SelectQuery get() { + joinEntities.forEach( + join -> selectQuery.addJoin(join.getTable(), join.getJoinType(), join.getJoinCondition())); + return selectQuery; + } + + public QuerySupplier addJoin(TableLike table, JoinType joinType, Condition condition) { + addJoinToEnd(JoinEntity.of(table, joinType, condition)); + return this; + } + + public QuerySupplier addJoinToStart(JoinEntity joinEntity) { + joinEntities.add(0, joinEntity); + return this; + } + + public QuerySupplier addJoinToEnd(JoinEntity joinEntity) { + joinEntities.add(joinEntity); + return this; + } + + public boolean addJoin(int index, JoinEntity joinEntity) { + if (index >= 0 && index <= joinEntities.size()) { + joinEntities.add(index, joinEntity); + return true; + } else { + return false; + } + + } + + public QuerySupplier addSelect(Field as) { + selectQuery.addSelect(as); + return this; + } + + public QuerySupplier addOrderBy(SortField sortField) { + selectQuery.addOrderBy(sortField); + return this; + } + + public QuerySupplier addLimit(int limit) { + selectQuery.addLimit(limit); + return this; + } + + public QuerySupplier addOffset(int offset) { + selectQuery.addOffset(offset); + return this; + } + + public QuerySupplier addCondition(Condition condition) { + selectQuery.addConditions(condition); + return this; + } + + public QuerySupplier addHaving(Condition condition) { + selectQuery.addHaving(condition); + return this; + } + + public QuerySupplier addGroupBy(GroupField fields) { + selectQuery.addGroupBy(fields); + return this; + } + + public QuerySupplier addGroupBy(Collection fields) { + selectQuery.addGroupBy(fields); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/config/DataSourceConfig.java b/src/main/java/com/epam/ta/reportportal/config/DataSourceConfig.java index 783f9c4f0..7ce5d6f43 100644 --- a/src/main/java/com/epam/ta/reportportal/config/DataSourceConfig.java +++ b/src/main/java/com/epam/ta/reportportal/config/DataSourceConfig.java @@ -19,13 +19,15 @@ import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; import io.zonky.test.db.postgres.embedded.EmbeddedPostgres; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.*; - -import javax.sql.DataSource; import java.io.File; import java.io.IOException; +import javax.sql.DataSource; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.context.annotation.Profile; /** * @author Ihar Kahadouski @@ -34,22 +36,23 @@ @ConfigurationProperties(prefix = "rp.datasource") public class DataSourceConfig extends HikariConfig { - @Primary - @Bean - @Profile("!unittest") - public DataSource dataSource() { - return new HikariDataSource(this); - } + @Primary + @Bean + @Profile("!unittest") + public DataSource dataSource() { + return new HikariDataSource(this); + } - @Primary - @Bean - @Profile("unittest") - public DataSource testDataSource(@Value("${embedded.datasource.dir}") String dataDir, - @Value("${embedded.datasource.clean}") Boolean clean, @Value("${embedded.datasource.port}") Integer port) throws IOException { - final EmbeddedPostgres.Builder builder = EmbeddedPostgres.builder() - .setPort(port) - .setDataDirectory(new File(dataDir)) - .setCleanDataDirectory(clean); - return builder.start().getPostgresDatabase(); - } + @Primary + @Bean + @Profile("unittest") + public DataSource testDataSource(@Value("${embedded.datasource.dir}") String dataDir, + @Value("${embedded.datasource.clean}") Boolean clean, + @Value("${embedded.datasource.port}") Integer port) throws IOException { + final EmbeddedPostgres.Builder builder = EmbeddedPostgres.builder() + .setPort(port) + .setDataDirectory(new File(dataDir)) + .setCleanDataDirectory(clean); + return builder.start().getPostgresDatabase(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java b/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java index e35f9a9eb..ed43ce939 100644 --- a/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java +++ b/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java @@ -29,6 +29,7 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.inject.Module; +import java.util.Set; import org.jclouds.ContextBuilder; import org.jclouds.aws.s3.config.AWSS3HttpApiModule; import org.jclouds.blobstore.BlobStore; @@ -42,156 +43,165 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import java.util.Set; - /** * @author Dzianis_Shybeka */ @Configuration public class DataStoreConfiguration { - /** - * Amazon has a general work flow they publish that allows clients to always find the correct URL endpoint for a given bucket: - * 1) ask s3.amazonaws.com for the bucket location - * 2) use the url returned to make the container specific request (get/put, etc) - * Jclouds cache the results from the first getBucketLocation call and use that region-specific URL, as needed. - * In this custom implementation of {@link AWSS3HttpApiModule} we are providing location from environment variable, so that - * we don't need to make getBucketLocation call - */ - @ConfiguresHttpApi - private static class CustomBucketToRegionModule extends AWSS3HttpApiModule { - private final String region; - - public CustomBucketToRegionModule(String region) { - this.region = region; - } - - @Override - @SuppressWarnings("Guava") - protected CacheLoader> bucketToRegion(Supplier> regionSupplier, S3Client client) { - Set regions = regionSupplier.get(); - if (regions.isEmpty()) { - return new CacheLoader<>() { - - @Override - @SuppressWarnings({ "Guava", "NullableProblems" }) - public Optional load(String bucket) { - if (CustomBucketToRegionModule.this.region != null) { - return Optional.of(CustomBucketToRegionModule.this.region); - } - return Optional.absent(); - } - - @Override - public String toString() { - return "noRegions()"; - } - }; - } else if (regions.size() == 1) { - final String onlyRegion = Iterables.getOnlyElement(regions); - return new CacheLoader<>() { - @SuppressWarnings("OptionalUsedAsFieldOrParameterType") - final Optional onlyRegionOption = Optional.of(onlyRegion); - - @Override - @SuppressWarnings("NullableProblems") - public Optional load(String bucket) { - if (CustomBucketToRegionModule.this.region != null) { - return Optional.of(CustomBucketToRegionModule.this.region); - } - return onlyRegionOption; - } - - @Override - public String toString() { - return "onlyRegion(" + onlyRegion + ")"; - } - }; - } else { - return new CacheLoader<>() { - @Override - @SuppressWarnings("NullableProblems") - public Optional load(String bucket) { - if (CustomBucketToRegionModule.this.region != null) { - return Optional.of(CustomBucketToRegionModule.this.region); - } - try { - return Optional.fromNullable(client.getBucketLocation(bucket)); - } catch (ContainerNotFoundException e) { - return Optional.absent(); - } - } - - @Override - public String toString() { - return "bucketToRegion()"; - } - }; - } - } - } - - @Bean - @ConditionalOnProperty(name = "datastore.type", havingValue = "filesystem") - public DataStore localDataStore(@Value("${datastore.default.path:/data/store}") String storagePath) { - return new LocalDataStore(storagePath); - } - - @Bean - @ConditionalOnProperty(name = "datastore.type", havingValue = "minio") - public BlobStore minioBlobStore(@Value("${datastore.minio.accessKey}") String accessKey, - @Value("${datastore.minio.secretKey}") String secretKey, @Value("${datastore.minio.endpoint}") String endpoint) { - - BlobStoreContext blobStoreContext = ContextBuilder.newBuilder("s3") - .endpoint(endpoint) - .credentials(accessKey, secretKey) - .buildView(BlobStoreContext.class); - - return blobStoreContext.getBlobStore(); - } - - @Bean - @ConditionalOnProperty(name = "datastore.type", havingValue = "minio") - public DataStore minioDataStore(@Autowired BlobStore blobStore, @Value("${datastore.minio.bucketPrefix}") String bucketPrefix, - @Value("${datastore.minio.defaultBucketName}") String defaultBucketName, @Value("${datastore.minio.region}") String region) { - return new S3DataStore(blobStore, bucketPrefix, defaultBucketName, region); - } - - @Bean - @ConditionalOnProperty(name = "datastore.type", havingValue = "s3") - public BlobStore s3BlobStore(@Value("${datastore.s3.accessKey}") String accessKey, @Value("${datastore.s3.secretKey}") String secretKey, - @Value("${datastore.s3.region}") String region) { - Iterable modules = ImmutableSet.of(new CustomBucketToRegionModule(region)); - - BlobStoreContext blobStoreContext = ContextBuilder.newBuilder("aws-s3") - .modules(modules) - .credentials(accessKey, secretKey) - .buildView(BlobStoreContext.class); - - return blobStoreContext.getBlobStore(); - } - - @Bean - @ConditionalOnProperty(name = "datastore.type", havingValue = "s3") - public DataStore s3DataStore(@Autowired BlobStore blobStore, @Value("${datastore.s3.bucketPrefix}") String bucketPrefix, - @Value("${datastore.s3.defaultBucketName}") String defaultBucketName, @Value("${datastore.s3.region}") String region) { - return new S3DataStore(blobStore, bucketPrefix, defaultBucketName, region); - } - - @Bean("attachmentThumbnailator") - public Thumbnailator attachmentThumbnailator(@Value("${datastore.thumbnail.attachment.width}") int width, - @Value("${datastore.thumbnail.attachment.height}") int height) { - return new ThumbnailatorImpl(width, height); - } - - @Bean("userPhotoThumbnailator") - public Thumbnailator userPhotoThumbnailator(@Value("${datastore.thumbnail.avatar.width}") int width, - @Value("${datastore.thumbnail.avatar.height}") int height) { - return new ThumbnailatorImpl(width, height); - } - - @Bean - public ContentTypeResolver contentTypeResolver() { - return new TikaContentTypeResolver(); - } + @Bean + @ConditionalOnProperty(name = "datastore.type", havingValue = "filesystem") + public DataStore localDataStore( + @Value("${datastore.default.path:/data/store}") String storagePath) { + return new LocalDataStore(storagePath); + } + + @Bean + @ConditionalOnProperty(name = "datastore.type", havingValue = "minio") + public BlobStore minioBlobStore(@Value("${datastore.minio.accessKey}") String accessKey, + @Value("${datastore.minio.secretKey}") String secretKey, + @Value("${datastore.minio.endpoint}") String endpoint) { + + BlobStoreContext blobStoreContext = ContextBuilder.newBuilder("s3") + .endpoint(endpoint) + .credentials(accessKey, secretKey) + .buildView(BlobStoreContext.class); + + return blobStoreContext.getBlobStore(); + } + + @Bean + @ConditionalOnProperty(name = "datastore.type", havingValue = "minio") + public DataStore minioDataStore(@Autowired BlobStore blobStore, + @Value("${datastore.minio.bucketPrefix}") String bucketPrefix, + @Value("${datastore.minio.defaultBucketName}") String defaultBucketName, + @Value("${datastore.minio.region}") String region) { + return new S3DataStore(blobStore, bucketPrefix, defaultBucketName, region); + } + + @Bean + @ConditionalOnProperty(name = "datastore.type", havingValue = "s3") + public BlobStore s3BlobStore(@Value("${datastore.s3.accessKey}") String accessKey, + @Value("${datastore.s3.secretKey}") String secretKey, + @Value("${datastore.s3.region}") String region) { + Iterable modules = ImmutableSet.of(new CustomBucketToRegionModule(region)); + + BlobStoreContext blobStoreContext = ContextBuilder.newBuilder("aws-s3") + .modules(modules) + .credentials(accessKey, secretKey) + .buildView(BlobStoreContext.class); + + return blobStoreContext.getBlobStore(); + } + + @Bean + @ConditionalOnProperty(name = "datastore.type", havingValue = "s3") + public DataStore s3DataStore(@Autowired BlobStore blobStore, + @Value("${datastore.s3.bucketPrefix}") String bucketPrefix, + @Value("${datastore.s3.defaultBucketName}") String defaultBucketName, + @Value("${datastore.s3.region}") String region) { + return new S3DataStore(blobStore, bucketPrefix, defaultBucketName, region); + } + + @Bean("attachmentThumbnailator") + public Thumbnailator attachmentThumbnailator( + @Value("${datastore.thumbnail.attachment.width}") int width, + @Value("${datastore.thumbnail.attachment.height}") int height) { + return new ThumbnailatorImpl(width, height); + } + + @Bean("userPhotoThumbnailator") + public Thumbnailator userPhotoThumbnailator( + @Value("${datastore.thumbnail.avatar.width}") int width, + @Value("${datastore.thumbnail.avatar.height}") int height) { + return new ThumbnailatorImpl(width, height); + } + + @Bean + public ContentTypeResolver contentTypeResolver() { + return new TikaContentTypeResolver(); + } + + /** + * Amazon has a general work flow they publish that allows clients to always find the correct URL + * endpoint for a given bucket: 1) ask s3.amazonaws.com for the bucket location 2) use the url + * returned to make the container specific request (get/put, etc) Jclouds cache the results from + * the first getBucketLocation call and use that region-specific URL, as needed. In this custom + * implementation of {@link AWSS3HttpApiModule} we are providing location from environment + * variable, so that we don't need to make getBucketLocation call + */ + @ConfiguresHttpApi + private static class CustomBucketToRegionModule extends AWSS3HttpApiModule { + + private final String region; + + public CustomBucketToRegionModule(String region) { + this.region = region; + } + + @Override + @SuppressWarnings("Guava") + protected CacheLoader> bucketToRegion( + Supplier> regionSupplier, S3Client client) { + Set regions = regionSupplier.get(); + if (regions.isEmpty()) { + return new CacheLoader<>() { + + @Override + @SuppressWarnings({"Guava", "NullableProblems"}) + public Optional load(String bucket) { + if (CustomBucketToRegionModule.this.region != null) { + return Optional.of(CustomBucketToRegionModule.this.region); + } + return Optional.absent(); + } + + @Override + public String toString() { + return "noRegions()"; + } + }; + } else if (regions.size() == 1) { + final String onlyRegion = Iterables.getOnlyElement(regions); + return new CacheLoader<>() { + @SuppressWarnings("OptionalUsedAsFieldOrParameterType") + final Optional onlyRegionOption = Optional.of(onlyRegion); + + @Override + @SuppressWarnings("NullableProblems") + public Optional load(String bucket) { + if (CustomBucketToRegionModule.this.region != null) { + return Optional.of(CustomBucketToRegionModule.this.region); + } + return onlyRegionOption; + } + + @Override + public String toString() { + return "onlyRegion(" + onlyRegion + ")"; + } + }; + } else { + return new CacheLoader<>() { + @Override + @SuppressWarnings("NullableProblems") + public Optional load(String bucket) { + if (CustomBucketToRegionModule.this.region != null) { + return Optional.of(CustomBucketToRegionModule.this.region); + } + try { + return Optional.fromNullable(client.getBucketLocation(bucket)); + } catch (ContainerNotFoundException e) { + return Optional.absent(); + } + } + + @Override + public String toString() { + return "bucketToRegion()"; + } + }; + } + } + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/config/DatabaseConfiguration.java b/src/main/java/com/epam/ta/reportportal/config/DatabaseConfiguration.java index 9eb476a02..92f13329c 100644 --- a/src/main/java/com/epam/ta/reportportal/config/DatabaseConfiguration.java +++ b/src/main/java/com/epam/ta/reportportal/config/DatabaseConfiguration.java @@ -17,6 +17,12 @@ package com.epam.ta.reportportal.config; import com.epam.ta.reportportal.dao.ReportPortalRepositoryImpl; +import java.io.IOException; +import java.io.Serializable; +import java.util.Properties; +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.sql.DataSource; import org.flywaydb.core.Flyway; import org.jooq.SQLDialect; import org.jooq.impl.DataSourceConnectionProvider; @@ -45,118 +51,116 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.util.Assert; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.sql.DataSource; -import java.io.IOException; -import java.io.Serializable; -import java.util.Properties; - /** * @author Pavel Bortnik */ @Configuration @EnableJpaAuditing @EnableJpaRepositories(basePackages = { - "com.epam.ta.reportportal.dao" }, repositoryBaseClass = ReportPortalRepositoryImpl.class, repositoryFactoryBeanClass = DatabaseConfiguration.RpRepoFactoryBean.class) + "com.epam.ta.reportportal.dao"}, repositoryBaseClass = ReportPortalRepositoryImpl.class, repositoryFactoryBeanClass = DatabaseConfiguration.RpRepoFactoryBean.class) @EnableTransactionManagement public class DatabaseConfiguration { - @Autowired - private DataSource dataSource; - - @Bean - @Profile("unittest") - public Flyway flyway() throws IOException { - return Flyway.configure().dataSource(dataSource).validateOnMigrate(false).load(); - } - - @Bean - public EntityManagerFactory entityManagerFactory() { - - HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); - vendorAdapter.setGenerateDdl(false); - - LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean(); - factory.setJpaVendorAdapter(vendorAdapter); - factory.setPackagesToScan("com.epam.ta.reportportal.commons", "com.epam.ta.reportportal.entity"); - factory.setDataSource(dataSource); - - Properties jpaProperties = new Properties(); - jpaProperties.setProperty("hibernate.dialect", "com.epam.ta.reportportal.commons.JsonbAwarePostgresDialect"); - factory.setJpaProperties(jpaProperties); - - factory.afterPropertiesSet(); - - return factory.getObject(); - } - - @Bean - @Primary - public PlatformTransactionManager transactionManager() { - JpaTransactionManager transactionManager = new JpaTransactionManager(); - transactionManager.setEntityManagerFactory(entityManagerFactory()); - return transactionManager; - } - - @Bean - public TransactionAwareDataSourceProxy transactionAwareDataSource() { - return new TransactionAwareDataSourceProxy(dataSource); - } - - @Bean - public DataSourceConnectionProvider connectionProvider() { - return new DataSourceConnectionProvider(transactionAwareDataSource()); - } - - @Bean - public DefaultConfiguration configuration() { - DefaultConfiguration jooqConfiguration = new DefaultConfiguration(); - jooqConfiguration.set(SQLDialect.POSTGRES); - jooqConfiguration.setConnectionProvider(connectionProvider()); - return jooqConfiguration; - } - - @Bean - public DefaultDSLContext dsl() { - return new DefaultDSLContext(configuration()); - } - - public static class RpRepoFactoryBean, S, ID> extends JpaRepositoryFactoryBean { - - @Autowired - private AutowireCapableBeanFactory beanFactory; - - /** - * Creates a new {@link JpaRepositoryFactoryBean} for the given repository interface. - * - * @param repositoryInterface must not be {@literal null}. - */ - public RpRepoFactoryBean(Class repositoryInterface) { - super(repositoryInterface); - } - - @Override - protected RepositoryFactorySupport createRepositoryFactory(EntityManager entityManager) { - return new JpaRepositoryFactory(entityManager) { - @Override - public T getRepository(Class repositoryInterface) { - T repo = super.getRepository(repositoryInterface); - beanFactory.autowireBean(repo); - return repo; - } - - @Override - protected JpaRepositoryImplementation getTargetRepository(RepositoryInformation information, EntityManager em) { - - JpaEntityInformation entityInformation = getEntityInformation(information.getDomainType()); - Object repository = getTargetRepositoryViaReflection(information, entityInformation, em); - - Assert.isInstanceOf(JpaRepositoryImplementation.class, repository); - beanFactory.autowireBean(repository); - return (JpaRepositoryImplementation) repository; - } - }; - } - } + @Autowired + private DataSource dataSource; + + @Bean + @Profile("unittest") + public Flyway flyway() throws IOException { + return Flyway.configure().dataSource(dataSource).validateOnMigrate(false).load(); + } + + @Bean + public EntityManagerFactory entityManagerFactory() { + + HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); + vendorAdapter.setGenerateDdl(false); + + LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean(); + factory.setJpaVendorAdapter(vendorAdapter); + factory.setPackagesToScan("com.epam.ta.reportportal.commons", + "com.epam.ta.reportportal.entity"); + factory.setDataSource(dataSource); + + Properties jpaProperties = new Properties(); + jpaProperties.setProperty("hibernate.dialect", + "com.epam.ta.reportportal.commons.JsonbAwarePostgresDialect"); + factory.setJpaProperties(jpaProperties); + + factory.afterPropertiesSet(); + + return factory.getObject(); + } + + @Bean + @Primary + public PlatformTransactionManager transactionManager() { + JpaTransactionManager transactionManager = new JpaTransactionManager(); + transactionManager.setEntityManagerFactory(entityManagerFactory()); + return transactionManager; + } + + @Bean + public TransactionAwareDataSourceProxy transactionAwareDataSource() { + return new TransactionAwareDataSourceProxy(dataSource); + } + + @Bean + public DataSourceConnectionProvider connectionProvider() { + return new DataSourceConnectionProvider(transactionAwareDataSource()); + } + + @Bean + public DefaultConfiguration configuration() { + DefaultConfiguration jooqConfiguration = new DefaultConfiguration(); + jooqConfiguration.set(SQLDialect.POSTGRES); + jooqConfiguration.setConnectionProvider(connectionProvider()); + return jooqConfiguration; + } + + @Bean + public DefaultDSLContext dsl() { + return new DefaultDSLContext(configuration()); + } + + public static class RpRepoFactoryBean, S, ID> extends + JpaRepositoryFactoryBean { + + @Autowired + private AutowireCapableBeanFactory beanFactory; + + /** + * Creates a new {@link JpaRepositoryFactoryBean} for the given repository interface. + * + * @param repositoryInterface must not be {@literal null}. + */ + public RpRepoFactoryBean(Class repositoryInterface) { + super(repositoryInterface); + } + + @Override + protected RepositoryFactorySupport createRepositoryFactory(EntityManager entityManager) { + return new JpaRepositoryFactory(entityManager) { + @Override + public T getRepository(Class repositoryInterface) { + T repo = super.getRepository(repositoryInterface); + beanFactory.autowireBean(repo); + return repo; + } + + @Override + protected JpaRepositoryImplementation getTargetRepository( + RepositoryInformation information, EntityManager em) { + + JpaEntityInformation entityInformation = getEntityInformation( + information.getDomainType()); + Object repository = getTargetRepositoryViaReflection(information, entityInformation, em); + + Assert.isInstanceOf(JpaRepositoryImplementation.class, repository); + beanFactory.autowireBean(repository); + return (JpaRepositoryImplementation) repository; + } + }; + } + } } diff --git a/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java b/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java index 261759fef..1d2d9b963 100644 --- a/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java +++ b/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java @@ -18,6 +18,13 @@ import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.filesystem.DataStore; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.security.SecureRandom; +import java.util.Base64; import org.apache.commons.io.IOUtils; import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; import org.jasypt.util.text.BasicTextEncryptor; @@ -29,14 +36,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.security.SecureRandom; -import java.util.Base64; - /** * Encrypt beans configuration for password values * @@ -45,62 +44,63 @@ @Configuration public class EncryptConfiguration implements InitializingBean { - private static final Logger LOGGER = LoggerFactory.getLogger(EncryptConfiguration.class); + private static final Logger LOGGER = LoggerFactory.getLogger(EncryptConfiguration.class); - @Value("${rp.integration.salt.path:keystore}") - private String integrationSaltPath; + @Value("${rp.integration.salt.path:keystore}") + private String integrationSaltPath; - @Value("${rp.integration.salt.file:secret-integration-salt}") - private String integrationSaltFile; + @Value("${rp.integration.salt.file:secret-integration-salt}") + private String integrationSaltFile; - @Value("${rp.integration.salt.migration:migration}") - private String migrationFile; + @Value("${rp.integration.salt.migration:migration}") + private String migrationFile; - private String secretFilePath; - private String migrationFilePath; + private String secretFilePath; + private String migrationFilePath; - private DataStore dataStore; + private DataStore dataStore; - @Autowired - public EncryptConfiguration(DataStore dataStore) { - this.dataStore = dataStore; - } + @Autowired + public EncryptConfiguration(DataStore dataStore) { + this.dataStore = dataStore; + } - @Bean(name = "basicEncryptor") - public BasicTextEncryptor getBasicEncrypt() throws IOException { - BasicTextEncryptor basic = new BasicTextEncryptor(); - basic.setPassword(IOUtils.toString(dataStore.load(secretFilePath), StandardCharsets.UTF_8)); - return basic; - } + @Bean(name = "basicEncryptor") + public BasicTextEncryptor getBasicEncrypt() throws IOException { + BasicTextEncryptor basic = new BasicTextEncryptor(); + basic.setPassword(IOUtils.toString(dataStore.load(secretFilePath), StandardCharsets.UTF_8)); + return basic; + } - @Bean(name = "strongEncryptor") - public StandardPBEStringEncryptor getStrongEncryptor() throws IOException { - StandardPBEStringEncryptor strong = new StandardPBEStringEncryptor(); - strong.setPassword(IOUtils.toString(dataStore.load(secretFilePath), StandardCharsets.UTF_8)); - strong.setAlgorithm("PBEWithMD5AndTripleDES"); - return strong; - } + @Bean(name = "strongEncryptor") + public StandardPBEStringEncryptor getStrongEncryptor() throws IOException { + StandardPBEStringEncryptor strong = new StandardPBEStringEncryptor(); + strong.setPassword(IOUtils.toString(dataStore.load(secretFilePath), StandardCharsets.UTF_8)); + strong.setAlgorithm("PBEWithMD5AndTripleDES"); + return strong; + } - @Override - public void afterPropertiesSet() throws Exception { - secretFilePath = integrationSaltPath + File.separator + integrationSaltFile; - migrationFilePath = integrationSaltPath + File.separator + migrationFile; - loadOrGenerateIntegrationSalt(dataStore); - } + @Override + public void afterPropertiesSet() throws Exception { + secretFilePath = integrationSaltPath + File.separator + integrationSaltFile; + migrationFilePath = integrationSaltPath + File.separator + migrationFile; + loadOrGenerateIntegrationSalt(dataStore); + } - private void loadOrGenerateIntegrationSalt(DataStore dataStore) { - try { - dataStore.load(secretFilePath); - } catch (ReportPortalException ex) { - byte[] bytes = new byte[20]; - new SecureRandom().nextBytes(bytes); - try (InputStream secret = new ByteArrayInputStream(Base64.getUrlEncoder().withoutPadding().encode(bytes)); - InputStream empty = new ByteArrayInputStream(new byte[1])) { - dataStore.save(secretFilePath, secret); - dataStore.save(migrationFilePath, empty); - } catch (IOException ioEx) { - LOGGER.error("Unable to generate secret file", ioEx); - } - } - } + private void loadOrGenerateIntegrationSalt(DataStore dataStore) { + try { + dataStore.load(secretFilePath); + } catch (ReportPortalException ex) { + byte[] bytes = new byte[20]; + new SecureRandom().nextBytes(bytes); + try (InputStream secret = new ByteArrayInputStream( + Base64.getUrlEncoder().withoutPadding().encode(bytes)); + InputStream empty = new ByteArrayInputStream(new byte[1])) { + dataStore.save(secretFilePath, secret); + dataStore.save(migrationFilePath, empty); + } catch (IOException ioEx) { + LOGGER.error("Unable to generate secret file", ioEx); + } + } + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/dao/AbstractShareableRepositoryImpl.java b/src/main/java/com/epam/ta/reportportal/dao/AbstractShareableRepositoryImpl.java index 1899bc011..da0e3cc3c 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/AbstractShareableRepositoryImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/AbstractShareableRepositoryImpl.java @@ -16,10 +16,17 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.dao.util.ShareableUtils.ownCondition; +import static com.epam.ta.reportportal.dao.util.ShareableUtils.permittedCondition; +import static com.epam.ta.reportportal.dao.util.ShareableUtils.sharedCondition; +import static com.epam.ta.reportportal.jooq.Tables.SHAREABLE_ENTITY; + import com.epam.ta.reportportal.commons.querygen.Filter; import com.epam.ta.reportportal.commons.querygen.ProjectFilter; import com.epam.ta.reportportal.commons.querygen.QueryBuilder; import com.epam.ta.reportportal.entity.ShareableEntity; +import java.util.List; +import java.util.function.Function; import org.jooq.DSLContext; import org.jooq.Record; import org.jooq.Result; @@ -28,69 +35,71 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.repository.support.PageableExecutionUtils; -import java.util.List; -import java.util.function.Function; - -import static com.epam.ta.reportportal.dao.util.ShareableUtils.*; -import static com.epam.ta.reportportal.jooq.Tables.SHAREABLE_ENTITY; - /** * @author Ivan Budayeu */ -public abstract class AbstractShareableRepositoryImpl implements ShareableRepository { +public abstract class AbstractShareableRepositoryImpl implements + ShareableRepository { - protected DSLContext dsl; + protected DSLContext dsl; - @Autowired - public void setDsl(DSLContext dsl) { - this.dsl = dsl; - } + @Autowired + public void setDsl(DSLContext dsl) { + this.dsl = dsl; + } - protected Page getPermitted(Function, List> fetcher, Filter filter, Pageable pageable, String userName) { + protected Page getPermitted(Function, List> fetcher, Filter filter, + Pageable pageable, String userName) { - return PageableExecutionUtils.getPage( - fetcher.apply(dsl.fetch(QueryBuilder.newBuilder(filter) - .addCondition(permittedCondition(userName)) - .with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) - .build())), - pageable, - () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).addCondition(permittedCondition(userName)).build()) - ); + return PageableExecutionUtils.getPage( + fetcher.apply(dsl.fetch(QueryBuilder.newBuilder(filter) + .addCondition(permittedCondition(userName)) + .with(pageable) + .wrap() + .withWrapperSort(pageable.getSort()) + .build())), + pageable, + () -> dsl.fetchCount( + QueryBuilder.newBuilder(filter).addCondition(permittedCondition(userName)).build()) + ); - } + } - protected Page getOwn(Function, List> fetcher, ProjectFilter filter, Pageable pageable, - String userName) { - return PageableExecutionUtils.getPage( - fetcher.apply(dsl.fetch(QueryBuilder.newBuilder(filter) - .addCondition(ownCondition(userName)) - .with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) - .build())), - pageable, - () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).addCondition(ownCondition(userName)).build()) - ); - } + protected Page getOwn(Function, List> fetcher, + ProjectFilter filter, Pageable pageable, + String userName) { + return PageableExecutionUtils.getPage( + fetcher.apply(dsl.fetch(QueryBuilder.newBuilder(filter) + .addCondition(ownCondition(userName)) + .with(pageable) + .wrap() + .withWrapperSort(pageable.getSort()) + .build())), + pageable, + () -> dsl.fetchCount( + QueryBuilder.newBuilder(filter).addCondition(ownCondition(userName)).build()) + ); + } - protected Page getShared(Function, List> fetcher, ProjectFilter filter, Pageable pageable, - String userName) { - return PageableExecutionUtils.getPage( - fetcher.apply(dsl.fetch(QueryBuilder.newBuilder(filter) - .addCondition(sharedCondition(userName)) - .with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) - .build())), - pageable, - () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).addCondition(sharedCondition(userName)).build()) - ); - } + protected Page getShared(Function, List> fetcher, + ProjectFilter filter, Pageable pageable, + String userName) { + return PageableExecutionUtils.getPage( + fetcher.apply(dsl.fetch(QueryBuilder.newBuilder(filter) + .addCondition(sharedCondition(userName)) + .with(pageable) + .wrap() + .withWrapperSort(pageable.getSort()) + .build())), + pageable, + () -> dsl.fetchCount( + QueryBuilder.newBuilder(filter).addCondition(sharedCondition(userName)).build()) + ); + } - @Override - public void updateSharingFlag(List ids, boolean isShared) { - dsl.update(SHAREABLE_ENTITY).set(SHAREABLE_ENTITY.SHARED, isShared).where(SHAREABLE_ENTITY.ID.in(ids)).execute(); - } + @Override + public void updateSharingFlag(List ids, boolean isShared) { + dsl.update(SHAREABLE_ENTITY).set(SHAREABLE_ENTITY.SHARED, isShared) + .where(SHAREABLE_ENTITY.ID.in(ids)).execute(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ActivityRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ActivityRepository.java index fbdee4408..6c418bfa8 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ActivityRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ActivityRepository.java @@ -23,6 +23,7 @@ * * @author Andrei Varabyeu */ -public interface ActivityRepository extends ReportPortalRepository, ActivityRepositoryCustom { +public interface ActivityRepository extends ReportPortalRepository, + ActivityRepositoryCustom { } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ActivityRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/ActivityRepositoryCustom.java index 12918c3c9..62f17a802 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ActivityRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ActivityRepositoryCustom.java @@ -18,31 +18,30 @@ import com.epam.ta.reportportal.commons.querygen.Queryable; import com.epam.ta.reportportal.entity.activity.Activity; -import org.springframework.data.domain.Sort; - import java.time.Duration; import java.util.List; +import org.springframework.data.domain.Sort; /** * @author Ihar Kahadouski */ public interface ActivityRepositoryCustom extends FilterableRepository { - /** - * Delete outdated activities - * - * @param projectId ID of project - * @param period Time period - */ - void deleteModifiedLaterAgo(Long projectId, Duration period); + /** + * Delete outdated activities + * + * @param projectId ID of project + * @param period Time period + */ + void deleteModifiedLaterAgo(Long projectId, Duration period); - /** - * Find limiting count of results - * - * @param filter Filter - * @param sort Sorting details - * @param limit Maximum number of returning items - * @return Found activities - */ - List findByFilterWithSortingAndLimit(Queryable filter, Sort sort, int limit); + /** + * Find limiting count of results + * + * @param filter Filter + * @param sort Sorting details + * @param limit Maximum number of returning items + * @return Found activities + */ + List findByFilterWithSortingAndLimit(Queryable filter, Sort sort, int limit); } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/dao/ActivityRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/ActivityRepositoryCustomImpl.java index d7e5d7a24..ec8123278 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ActivityRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ActivityRepositoryCustomImpl.java @@ -16,9 +16,17 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.dao.util.RecordMappers.ACTIVITY_MAPPER; +import static com.epam.ta.reportportal.dao.util.ResultFetchers.ACTIVITY_FETCHER; +import static com.epam.ta.reportportal.jooq.tables.JActivity.ACTIVITY; + import com.epam.ta.reportportal.commons.querygen.QueryBuilder; import com.epam.ta.reportportal.commons.querygen.Queryable; import com.epam.ta.reportportal.entity.activity.Activity; +import java.sql.Timestamp; +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.List; import org.jooq.DSLContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -27,50 +35,44 @@ import org.springframework.data.repository.support.PageableExecutionUtils; import org.springframework.stereotype.Repository; -import java.sql.Timestamp; -import java.time.Duration; -import java.time.LocalDateTime; -import java.util.List; - -import static com.epam.ta.reportportal.dao.util.RecordMappers.ACTIVITY_MAPPER; -import static com.epam.ta.reportportal.dao.util.ResultFetchers.ACTIVITY_FETCHER; -import static com.epam.ta.reportportal.jooq.tables.JActivity.ACTIVITY; - /** * @author Ihar Kahadouski */ @Repository public class ActivityRepositoryCustomImpl implements ActivityRepositoryCustom { - private DSLContext dsl; + private DSLContext dsl; - @Autowired - public ActivityRepositoryCustomImpl(DSLContext dsl) { - this.dsl = dsl; - } + @Autowired + public ActivityRepositoryCustomImpl(DSLContext dsl) { + this.dsl = dsl; + } - @Override - public void deleteModifiedLaterAgo(Long projectId, Duration period) { - LocalDateTime bound = LocalDateTime.now().minus(period); - dsl.delete(ACTIVITY).where(ACTIVITY.PROJECT_ID.eq(projectId)).and(ACTIVITY.CREATION_DATE.lt(Timestamp.valueOf(bound))).execute(); - } + @Override + public void deleteModifiedLaterAgo(Long projectId, Duration period) { + LocalDateTime bound = LocalDateTime.now().minus(period); + dsl.delete(ACTIVITY).where(ACTIVITY.PROJECT_ID.eq(projectId)) + .and(ACTIVITY.CREATION_DATE.lt(Timestamp.valueOf(bound))).execute(); + } - @Override - public List findByFilterWithSortingAndLimit(Queryable filter, Sort sort, int limit) { - return dsl.fetch(QueryBuilder.newBuilder(filter).with(sort).with(limit).wrap().build()).map(ACTIVITY_MAPPER); - } + @Override + public List findByFilterWithSortingAndLimit(Queryable filter, Sort sort, int limit) { + return dsl.fetch(QueryBuilder.newBuilder(filter).with(sort).with(limit).wrap().build()) + .map(ACTIVITY_MAPPER); + } - @Override - public List findByFilter(Queryable filter) { - return ACTIVITY_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter).wrap().build())); - } + @Override + public List findByFilter(Queryable filter) { + return ACTIVITY_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter).wrap().build())); + } - @Override - public Page findByFilter(Queryable filter, Pageable pageable) { - return PageableExecutionUtils.getPage(ACTIVITY_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter) - .with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) - .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build())); - } + @Override + public Page findByFilter(Queryable filter, Pageable pageable) { + return PageableExecutionUtils.getPage( + ACTIVITY_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter) + .with(pageable) + .wrap() + .withWrapperSort(pageable.getSort()) + .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build())); + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java index fd210eb16..dc5418a53 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java @@ -17,25 +17,26 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.attachment.Attachment; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; - import java.util.Collection; import java.util.List; import java.util.Optional; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; /** * @author Ivan Budayeu */ -public interface AttachmentRepository extends ReportPortalRepository, AttachmentRepositoryCustom { +public interface AttachmentRepository extends ReportPortalRepository, + AttachmentRepositoryCustom { - Optional findByFileId(String fileId); + Optional findByFileId(String fileId); - List findAllByLaunchIdIn(Collection launchIds); + List findAllByLaunchIdIn(Collection launchIds); - @Modifying - @Query(value = "UPDATE attachment SET launch_id = :newLaunchId WHERE project_id = :projectId AND launch_id = :currentLaunchId", nativeQuery = true) - void updateLaunchIdByProjectIdAndLaunchId(@Param("projectId") Long projectId, @Param("currentLaunchId") Long currentLaunchId, - @Param("newLaunchId") Long newLaunchId); + @Modifying + @Query(value = "UPDATE attachment SET launch_id = :newLaunchId WHERE project_id = :projectId AND launch_id = :currentLaunchId", nativeQuery = true) + void updateLaunchIdByProjectIdAndLaunchId(@Param("projectId") Long projectId, + @Param("currentLaunchId") Long currentLaunchId, + @Param("newLaunchId") Long newLaunchId); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepositoryCustom.java index 311617f40..b854593bd 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepositoryCustom.java @@ -17,77 +17,78 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.attachment.Attachment; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; - import java.time.LocalDateTime; import java.util.Collection; import java.util.List; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; /** * @author Ivan Budayeu */ public interface AttachmentRepositoryCustom { - /** - * Moves attachments to the deletion table for further removing from file storage by project - * - * @param projectId Project id - * @return Number of moved attachments - */ - int moveForDeletionByProjectId(Long projectId); - - /** - * Moves attachments to the deletion table for further removing from file storage by launch - * - * @param launchId Launch id - * @return Number of moved attachments - */ - int moveForDeletionByLaunchId(Long launchId); - - /** - * Moves attachments to the deletion table for further removing from file storage by launches - * - * @param launchIds Launch ids - * @return Number of moved attachments - */ - int moveForDeletionByLaunchIds(Collection launchIds); - - /** - * Moves attachments to the deletion table for further removing from file storage by items - * - * @param itemIds Collection of item ids - * @return Number of moved attachments - */ - int moveForDeletionByItems(Collection itemIds); - - /** - * Moves attachment to the deletion table for further removing from file storage by id - * - * @param attachmentId Attachment id - * @return Number of moved attachments - */ - int moveForDeletion(Long attachmentId); - - /** - * Moves attachments to the deletion table for further removing from file storage by id - * - * @param attachmentIds Collection of attachments ids - * @return Number of moved attachments - */ - int moveForDeletion(Collection attachmentIds); - - Page findIdsByProjectId(Long projectId, Pageable pageable); - - Page findIdsByLaunchId(Long launchId, Pageable pageable); - - Page findIdsByTestItemId(Collection itemIds, Pageable pageable); - - int deleteAllByIds(Collection ids); - - List findByItemIdsAndLogTimeBefore(Collection itemIds, LocalDateTime before); - - List findByLaunchIdsAndLogTimeBefore(Collection launchIds, LocalDateTime before); - - List findByProjectIdsAndLogTimeBefore(Long projectId, LocalDateTime before, int limit, long offset); + /** + * Moves attachments to the deletion table for further removing from file storage by project + * + * @param projectId Project id + * @return Number of moved attachments + */ + int moveForDeletionByProjectId(Long projectId); + + /** + * Moves attachments to the deletion table for further removing from file storage by launch + * + * @param launchId Launch id + * @return Number of moved attachments + */ + int moveForDeletionByLaunchId(Long launchId); + + /** + * Moves attachments to the deletion table for further removing from file storage by launches + * + * @param launchIds Launch ids + * @return Number of moved attachments + */ + int moveForDeletionByLaunchIds(Collection launchIds); + + /** + * Moves attachments to the deletion table for further removing from file storage by items + * + * @param itemIds Collection of item ids + * @return Number of moved attachments + */ + int moveForDeletionByItems(Collection itemIds); + + /** + * Moves attachment to the deletion table for further removing from file storage by id + * + * @param attachmentId Attachment id + * @return Number of moved attachments + */ + int moveForDeletion(Long attachmentId); + + /** + * Moves attachments to the deletion table for further removing from file storage by id + * + * @param attachmentIds Collection of attachments ids + * @return Number of moved attachments + */ + int moveForDeletion(Collection attachmentIds); + + Page findIdsByProjectId(Long projectId, Pageable pageable); + + Page findIdsByLaunchId(Long launchId, Pageable pageable); + + Page findIdsByTestItemId(Collection itemIds, Pageable pageable); + + int deleteAllByIds(Collection ids); + + List findByItemIdsAndLogTimeBefore(Collection itemIds, LocalDateTime before); + + List findByLaunchIdsAndLogTimeBefore(Collection launchIds, + LocalDateTime before); + + List findByProjectIdsAndLogTimeBefore(Long projectId, LocalDateTime before, int limit, + long offset); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepositoryCustomImpl.java index bcf707676..2223e5309 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepositoryCustomImpl.java @@ -16,13 +16,18 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.jooq.Tables.LOG; +import static com.epam.ta.reportportal.jooq.Tables.TEST_ITEM; +import static com.epam.ta.reportportal.jooq.tables.JAttachment.ATTACHMENT; + import com.epam.ta.reportportal.commons.querygen.QueryBuilder; import com.epam.ta.reportportal.entity.attachment.Attachment; -import com.epam.ta.reportportal.jooq.tables.records.JAttachmentRecord; +import java.sql.Timestamp; +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.List; import org.jooq.DSLContext; -import org.jooq.DeleteResultStep; import org.jooq.Operator; -import org.jooq.Select; import org.jooq.impl.DSL; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -30,181 +35,176 @@ import org.springframework.data.repository.support.PageableExecutionUtils; import org.springframework.stereotype.Repository; -import java.sql.Timestamp; -import java.time.LocalDateTime; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import static com.epam.ta.reportportal.jooq.Tables.LOG; -import static com.epam.ta.reportportal.jooq.Tables.TEST_ITEM; -import static com.epam.ta.reportportal.jooq.tables.JAttachment.ATTACHMENT; -import static org.jooq.impl.DSL.select; -import static org.jooq.impl.DSL.table; - /** * @author Ivan Budayeu */ @Repository public class AttachmentRepositoryCustomImpl implements AttachmentRepositoryCustom { - @Autowired - private DSLContext dsl; - - @Override - public int moveForDeletionByProjectId(Long projectId) { - String condition = DSL.condition(Operator.AND, ATTACHMENT.PROJECT_ID.eq(projectId)).toString(); - return executeMoveQuery(condition); - } - - @Override - public int moveForDeletionByLaunchId(Long launchId) { - String condition = DSL.condition(Operator.AND, ATTACHMENT.LAUNCH_ID.eq(launchId)).toString(); - return executeMoveQuery(condition); - } - - @Override - public int moveForDeletionByLaunchIds(Collection launchIds) { - String condition = DSL.condition(Operator.AND, ATTACHMENT.LAUNCH_ID.in(launchIds)).toString(); - return executeMoveQuery(condition); - } - - @Override - public int moveForDeletionByItems(Collection itemIds) { - String condition = DSL.condition(Operator.AND, ATTACHMENT.ITEM_ID.in(itemIds)).toString(); - return executeMoveQuery(condition); - } - - @Override - public int moveForDeletion(Long attachmentId) { - String condition = DSL.condition(Operator.AND, ATTACHMENT.ID.eq(attachmentId)).toString(); - return executeMoveQuery(condition); - } - - @Override - public int moveForDeletion(Collection attachmentIds) { - String condition = DSL.condition(Operator.AND, ATTACHMENT.ID.in(attachmentIds)).toString(); - return executeMoveQuery(condition); - } - - private int executeMoveQuery(String condition) { - return dsl.query(String.format("WITH moved_rows AS (DELETE FROM attachment WHERE %s RETURNING id, file_id, thumbnail_id, creation_date) " - + "INSERT INTO attachment_deletion (id, file_id, thumbnail_id, creation_attachment_date, deletion_date) " - + "SELECT id, file_id, thumbnail_id, creation_date, NOW() FROM moved_rows;", - condition - )).execute(); - } - - @Override - public Page findIdsByProjectId(Long projectId, Pageable pageable) { - return PageableExecutionUtils.getPage(dsl.select(ATTACHMENT.ID) - .from(ATTACHMENT) - .where(ATTACHMENT.PROJECT_ID.eq(projectId)) - .orderBy(ATTACHMENT.ID) - .limit(pageable.getPageSize()) - .offset(QueryBuilder.retrieveOffsetAndApplyBoundaries(pageable)) - .fetchInto(Long.class), - pageable, - () -> dsl.fetchCount(dsl.select(ATTACHMENT.ID).from(ATTACHMENT).where(ATTACHMENT.PROJECT_ID.eq(projectId))) - ); - } - - @Override - public Page findIdsByLaunchId(Long launchId, Pageable pageable) { - return PageableExecutionUtils.getPage(dsl.select(ATTACHMENT.ID) - .from(ATTACHMENT) - .where(ATTACHMENT.LAUNCH_ID.eq(launchId)) - .orderBy(ATTACHMENT.ID) - .limit(pageable.getPageSize()) - .offset(QueryBuilder.retrieveOffsetAndApplyBoundaries(pageable)) - .fetchInto(Long.class), - pageable, - () -> dsl.fetchCount(dsl.select(ATTACHMENT.ID).from(ATTACHMENT).where(ATTACHMENT.LAUNCH_ID.eq(launchId))) - ); - } - - @Override - public Page findIdsByTestItemId(Collection itemIds, Pageable pageable) { - - return PageableExecutionUtils.getPage(dsl.select(ATTACHMENT.ID) - .from(ATTACHMENT) - .where(ATTACHMENT.ITEM_ID.in(itemIds)) - .orderBy(ATTACHMENT.ID) - .limit(pageable.getPageSize()) - .offset(QueryBuilder.retrieveOffsetAndApplyBoundaries(pageable)) - .fetchInto(Long.class), - pageable, - () -> dsl.fetchCount(dsl.select(ATTACHMENT.ID).from(ATTACHMENT).where(ATTACHMENT.ITEM_ID.in(itemIds))) - ); - } - - @Override - public int deleteAllByIds(Collection ids) { - return dsl.deleteFrom(ATTACHMENT).where(ATTACHMENT.ID.in(ids)).execute(); - } - - @Override - public List findByItemIdsAndLogTimeBefore(Collection itemIds, LocalDateTime before) { - return dsl.select(ATTACHMENT.ID, - ATTACHMENT.THUMBNAIL_ID, - ATTACHMENT.FILE_ID, - ATTACHMENT.CONTENT_TYPE, - ATTACHMENT.FILE_SIZE, - ATTACHMENT.ITEM_ID, - ATTACHMENT.LAUNCH_ID, - ATTACHMENT.PROJECT_ID - ) - .from(ATTACHMENT) - .join(LOG) - .on(LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)) - .join(TEST_ITEM) - .on(ATTACHMENT.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) - .where(TEST_ITEM.ITEM_ID.in(itemIds)) - .and(LOG.LOG_TIME.lt(Timestamp.valueOf(before))) - .and(ATTACHMENT.FILE_ID.isNotNull().or(ATTACHMENT.THUMBNAIL_ID.isNotNull())) - .fetchInto(Attachment.class); - } - - @Override - public List findByLaunchIdsAndLogTimeBefore(Collection launchIds, LocalDateTime before) { - return dsl.select(ATTACHMENT.ID, - ATTACHMENT.THUMBNAIL_ID, - ATTACHMENT.FILE_ID, - ATTACHMENT.CONTENT_TYPE, - ATTACHMENT.FILE_SIZE, - ATTACHMENT.ITEM_ID, - ATTACHMENT.LAUNCH_ID, - ATTACHMENT.PROJECT_ID - ) - .from(ATTACHMENT) - .join(LOG) - .on(LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)) - .where(LOG.LAUNCH_ID.in(launchIds)) - .and(LOG.LOG_TIME.lt(Timestamp.valueOf(before))) - .and(ATTACHMENT.FILE_ID.isNotNull().or(ATTACHMENT.THUMBNAIL_ID.isNotNull())) - .fetchInto(Attachment.class); - } - - @Override - public List findByProjectIdsAndLogTimeBefore(Long projectId, LocalDateTime before, int limit, long offset) { - return dsl.select(ATTACHMENT.ID, - ATTACHMENT.THUMBNAIL_ID, - ATTACHMENT.FILE_ID, - ATTACHMENT.CONTENT_TYPE, - ATTACHMENT.FILE_SIZE, - ATTACHMENT.ITEM_ID, - ATTACHMENT.LAUNCH_ID, - ATTACHMENT.PROJECT_ID - ) - .from(ATTACHMENT) - .join(LOG) - .on(LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)) - .where(ATTACHMENT.PROJECT_ID.eq(projectId)) - .and(LOG.LOG_TIME.lt(Timestamp.valueOf(before))) - .and(ATTACHMENT.FILE_ID.isNotNull().or(ATTACHMENT.THUMBNAIL_ID.isNotNull())) - .orderBy(ATTACHMENT.ID) - .limit(limit) - .offset(offset) - .fetchInto(Attachment.class); - } + @Autowired + private DSLContext dsl; + + @Override + public int moveForDeletionByProjectId(Long projectId) { + String condition = DSL.condition(Operator.AND, ATTACHMENT.PROJECT_ID.eq(projectId)).toString(); + return executeMoveQuery(condition); + } + + @Override + public int moveForDeletionByLaunchId(Long launchId) { + String condition = DSL.condition(Operator.AND, ATTACHMENT.LAUNCH_ID.eq(launchId)).toString(); + return executeMoveQuery(condition); + } + + @Override + public int moveForDeletionByLaunchIds(Collection launchIds) { + String condition = DSL.condition(Operator.AND, ATTACHMENT.LAUNCH_ID.in(launchIds)).toString(); + return executeMoveQuery(condition); + } + + @Override + public int moveForDeletionByItems(Collection itemIds) { + String condition = DSL.condition(Operator.AND, ATTACHMENT.ITEM_ID.in(itemIds)).toString(); + return executeMoveQuery(condition); + } + + @Override + public int moveForDeletion(Long attachmentId) { + String condition = DSL.condition(Operator.AND, ATTACHMENT.ID.eq(attachmentId)).toString(); + return executeMoveQuery(condition); + } + + @Override + public int moveForDeletion(Collection attachmentIds) { + String condition = DSL.condition(Operator.AND, ATTACHMENT.ID.in(attachmentIds)).toString(); + return executeMoveQuery(condition); + } + + private int executeMoveQuery(String condition) { + return dsl.query(String.format( + "WITH moved_rows AS (DELETE FROM attachment WHERE %s RETURNING id, file_id, thumbnail_id, creation_date) " + + "INSERT INTO attachment_deletion (id, file_id, thumbnail_id, creation_attachment_date, deletion_date) " + + "SELECT id, file_id, thumbnail_id, creation_date, NOW() FROM moved_rows;", + condition + )).execute(); + } + + @Override + public Page findIdsByProjectId(Long projectId, Pageable pageable) { + return PageableExecutionUtils.getPage(dsl.select(ATTACHMENT.ID) + .from(ATTACHMENT) + .where(ATTACHMENT.PROJECT_ID.eq(projectId)) + .orderBy(ATTACHMENT.ID) + .limit(pageable.getPageSize()) + .offset(QueryBuilder.retrieveOffsetAndApplyBoundaries(pageable)) + .fetchInto(Long.class), + pageable, + () -> dsl.fetchCount( + dsl.select(ATTACHMENT.ID).from(ATTACHMENT).where(ATTACHMENT.PROJECT_ID.eq(projectId))) + ); + } + + @Override + public Page findIdsByLaunchId(Long launchId, Pageable pageable) { + return PageableExecutionUtils.getPage(dsl.select(ATTACHMENT.ID) + .from(ATTACHMENT) + .where(ATTACHMENT.LAUNCH_ID.eq(launchId)) + .orderBy(ATTACHMENT.ID) + .limit(pageable.getPageSize()) + .offset(QueryBuilder.retrieveOffsetAndApplyBoundaries(pageable)) + .fetchInto(Long.class), + pageable, + () -> dsl.fetchCount( + dsl.select(ATTACHMENT.ID).from(ATTACHMENT).where(ATTACHMENT.LAUNCH_ID.eq(launchId))) + ); + } + + @Override + public Page findIdsByTestItemId(Collection itemIds, Pageable pageable) { + + return PageableExecutionUtils.getPage(dsl.select(ATTACHMENT.ID) + .from(ATTACHMENT) + .where(ATTACHMENT.ITEM_ID.in(itemIds)) + .orderBy(ATTACHMENT.ID) + .limit(pageable.getPageSize()) + .offset(QueryBuilder.retrieveOffsetAndApplyBoundaries(pageable)) + .fetchInto(Long.class), + pageable, + () -> dsl.fetchCount( + dsl.select(ATTACHMENT.ID).from(ATTACHMENT).where(ATTACHMENT.ITEM_ID.in(itemIds))) + ); + } + + @Override + public int deleteAllByIds(Collection ids) { + return dsl.deleteFrom(ATTACHMENT).where(ATTACHMENT.ID.in(ids)).execute(); + } + + @Override + public List findByItemIdsAndLogTimeBefore(Collection itemIds, + LocalDateTime before) { + return dsl.select(ATTACHMENT.ID, + ATTACHMENT.THUMBNAIL_ID, + ATTACHMENT.FILE_ID, + ATTACHMENT.CONTENT_TYPE, + ATTACHMENT.FILE_SIZE, + ATTACHMENT.ITEM_ID, + ATTACHMENT.LAUNCH_ID, + ATTACHMENT.PROJECT_ID + ) + .from(ATTACHMENT) + .join(LOG) + .on(LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)) + .join(TEST_ITEM) + .on(ATTACHMENT.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) + .where(TEST_ITEM.ITEM_ID.in(itemIds)) + .and(LOG.LOG_TIME.lt(Timestamp.valueOf(before))) + .and(ATTACHMENT.FILE_ID.isNotNull().or(ATTACHMENT.THUMBNAIL_ID.isNotNull())) + .fetchInto(Attachment.class); + } + + @Override + public List findByLaunchIdsAndLogTimeBefore(Collection launchIds, + LocalDateTime before) { + return dsl.select(ATTACHMENT.ID, + ATTACHMENT.THUMBNAIL_ID, + ATTACHMENT.FILE_ID, + ATTACHMENT.CONTENT_TYPE, + ATTACHMENT.FILE_SIZE, + ATTACHMENT.ITEM_ID, + ATTACHMENT.LAUNCH_ID, + ATTACHMENT.PROJECT_ID + ) + .from(ATTACHMENT) + .join(LOG) + .on(LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)) + .where(LOG.LAUNCH_ID.in(launchIds)) + .and(LOG.LOG_TIME.lt(Timestamp.valueOf(before))) + .and(ATTACHMENT.FILE_ID.isNotNull().or(ATTACHMENT.THUMBNAIL_ID.isNotNull())) + .fetchInto(Attachment.class); + } + + @Override + public List findByProjectIdsAndLogTimeBefore(Long projectId, LocalDateTime before, + int limit, long offset) { + return dsl.select(ATTACHMENT.ID, + ATTACHMENT.THUMBNAIL_ID, + ATTACHMENT.FILE_ID, + ATTACHMENT.CONTENT_TYPE, + ATTACHMENT.FILE_SIZE, + ATTACHMENT.ITEM_ID, + ATTACHMENT.LAUNCH_ID, + ATTACHMENT.PROJECT_ID + ) + .from(ATTACHMENT) + .join(LOG) + .on(LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)) + .where(ATTACHMENT.PROJECT_ID.eq(projectId)) + .and(LOG.LOG_TIME.lt(Timestamp.valueOf(before))) + .and(ATTACHMENT.FILE_ID.isNotNull().or(ATTACHMENT.THUMBNAIL_ID.isNotNull())) + .orderBy(ATTACHMENT.ID) + .limit(limit) + .offset(offset) + .fetchInto(Attachment.class); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/AttributeRepository.java b/src/main/java/com/epam/ta/reportportal/dao/AttributeRepository.java index 2e62718c3..1ae617ce1 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/AttributeRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/AttributeRepository.java @@ -21,11 +21,11 @@ */ import com.epam.ta.reportportal.entity.attribute.Attribute; - import java.util.Optional; -public interface AttributeRepository extends ReportPortalRepository, AttributeRepositoryCustom { +public interface AttributeRepository extends ReportPortalRepository, + AttributeRepositoryCustom { - Optional findByName(String attributeName); + Optional findByName(String attributeName); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/AttributeRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/AttributeRepositoryCustom.java index 134ac834a..532daa4ab 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/AttributeRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/AttributeRepositoryCustom.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.attribute.Attribute; - import java.util.Set; /** @@ -25,5 +24,5 @@ */ public interface AttributeRepositoryCustom { - Set getDefaultProjectAttributes(); + Set getDefaultProjectAttributes(); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/AttributeRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/AttributeRepositoryCustomImpl.java index 289a49fa1..d0a15e70f 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/AttributeRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/AttributeRepositoryCustomImpl.java @@ -16,39 +16,38 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.dao.util.RecordMappers.ATTRIBUTE_MAPPER; +import static com.epam.ta.reportportal.jooq.tables.JAttribute.ATTRIBUTE; + import com.epam.ta.reportportal.entity.attribute.Attribute; import com.epam.ta.reportportal.entity.enums.ProjectAttributeEnum; +import java.util.Arrays; +import java.util.Set; import org.jooq.DSLContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import java.util.Arrays; -import java.util.Set; - -import static com.epam.ta.reportportal.dao.util.RecordMappers.ATTRIBUTE_MAPPER; -import static com.epam.ta.reportportal.jooq.tables.JAttribute.ATTRIBUTE; - /** * @author Ivan Budaev */ @Repository public class AttributeRepositoryCustomImpl implements AttributeRepositoryCustom { - private final DSLContext dsl; + private final DSLContext dsl; - @Autowired - public AttributeRepositoryCustomImpl(DSLContext dsl) { - this.dsl = dsl; - } + @Autowired + public AttributeRepositoryCustomImpl(DSLContext dsl) { + this.dsl = dsl; + } - @Override - public Set getDefaultProjectAttributes() { - return dsl.select() - .from(ATTRIBUTE) - .where(ATTRIBUTE.NAME.in(Arrays.stream(ProjectAttributeEnum.values()) - .map(ProjectAttributeEnum::getAttribute) - .toArray(String[]::new))) - .fetchSet(ATTRIBUTE_MAPPER); + @Override + public Set getDefaultProjectAttributes() { + return dsl.select() + .from(ATTRIBUTE) + .where(ATTRIBUTE.NAME.in(Arrays.stream(ProjectAttributeEnum.values()) + .map(ProjectAttributeEnum::getAttribute) + .toArray(String[]::new))) + .fetchSet(ATTRIBUTE_MAPPER); - } + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ClusterRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ClusterRepository.java index 8e760d47b..5b4020155 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ClusterRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ClusterRepository.java @@ -17,44 +17,44 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.cluster.Cluster; +import java.util.Collection; +import java.util.List; +import java.util.Optional; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import java.util.Collection; -import java.util.List; -import java.util.Optional; - /** * @author Ivan Budayeu */ -public interface ClusterRepository extends ReportPortalRepository, ClusterRepositoryCustom { +public interface ClusterRepository extends ReportPortalRepository, + ClusterRepositoryCustom { - Optional findByIndexIdAndLaunchId(Long indexId, Long launchId); + Optional findByIndexIdAndLaunchId(Long indexId, Long launchId); - List findAllByLaunchId(Long launchId); + List findAllByLaunchId(Long launchId); - Page findAllByLaunchId(Long launchId, Pageable pageable); + Page findAllByLaunchId(Long launchId, Pageable pageable); - int deleteAllByProjectId(Long projectId); + int deleteAllByProjectId(Long projectId); - int deleteAllByLaunchId(Long launchId); + int deleteAllByLaunchId(Long launchId); - @Modifying - @Query(value = "DELETE FROM clusters_test_item WHERE cluster_id IN (SELECT id FROM clusters WHERE project_id = :projectId)", nativeQuery = true) - int deleteClusterTestItemsByProjectId(@Param("projectId") Long projectId); + @Modifying + @Query(value = "DELETE FROM clusters_test_item WHERE cluster_id IN (SELECT id FROM clusters WHERE project_id = :projectId)", nativeQuery = true) + int deleteClusterTestItemsByProjectId(@Param("projectId") Long projectId); - @Modifying - @Query(value = "DELETE FROM clusters_test_item WHERE cluster_id IN (SELECT id FROM clusters WHERE launch_id = :launchId)", nativeQuery = true) - int deleteClusterTestItemsByLaunchId(@Param("launchId") Long launchId); + @Modifying + @Query(value = "DELETE FROM clusters_test_item WHERE cluster_id IN (SELECT id FROM clusters WHERE launch_id = :launchId)", nativeQuery = true) + int deleteClusterTestItemsByLaunchId(@Param("launchId") Long launchId); - @Modifying - @Query(value = "DELETE FROM clusters_test_item WHERE item_id = :itemId", nativeQuery = true) - int deleteClusterTestItemsByItemId(@Param("itemId") Long itemId); + @Modifying + @Query(value = "DELETE FROM clusters_test_item WHERE item_id = :itemId", nativeQuery = true) + int deleteClusterTestItemsByItemId(@Param("itemId") Long itemId); - @Modifying - @Query(value = "DELETE FROM clusters_test_item WHERE item_id IN (:itemIds)", nativeQuery = true) - int deleteClusterTestItemsByItemIds(@Param("itemIds") Collection itemIds); + @Modifying + @Query(value = "DELETE FROM clusters_test_item WHERE item_id IN (:itemIds)", nativeQuery = true) + int deleteClusterTestItemsByItemIds(@Param("itemIds") Collection itemIds); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ClusterRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/ClusterRepositoryCustom.java index d493c31c8..ac84dc068 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ClusterRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ClusterRepositoryCustom.java @@ -1,7 +1,6 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.cluster.Cluster; - import java.util.Set; /** @@ -9,5 +8,5 @@ */ public interface ClusterRepositoryCustom { - int saveClusterTestItems(Cluster cluster, Set itemIds); + int saveClusterTestItems(Cluster cluster, Set itemIds); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ClusterRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/ClusterRepositoryCustomImpl.java index 5ee8cfc99..d33d05845 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ClusterRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ClusterRepositoryCustomImpl.java @@ -1,36 +1,36 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.jooq.tables.JClustersTestItem.CLUSTERS_TEST_ITEM; + import com.epam.ta.reportportal.entity.cluster.Cluster; import com.epam.ta.reportportal.jooq.tables.records.JClustersTestItemRecord; +import java.util.Set; import org.jooq.DSLContext; import org.jooq.InsertValuesStep2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import java.util.Set; - -import static com.epam.ta.reportportal.jooq.tables.JClustersTestItem.CLUSTERS_TEST_ITEM; - /** * @author Ivan Budayeu */ @Repository public class ClusterRepositoryCustomImpl implements ClusterRepositoryCustom { - private final DSLContext dsl; + private final DSLContext dsl; - @Autowired - public ClusterRepositoryCustomImpl(DSLContext dsl) { - this.dsl = dsl; - } + @Autowired + public ClusterRepositoryCustomImpl(DSLContext dsl) { + this.dsl = dsl; + } - @Override - public int saveClusterTestItems(Cluster cluster, Set itemIds) { - final InsertValuesStep2 insertQuery = dsl.insertInto(CLUSTERS_TEST_ITEM) - .columns(CLUSTERS_TEST_ITEM.CLUSTER_ID, CLUSTERS_TEST_ITEM.ITEM_ID); + @Override + public int saveClusterTestItems(Cluster cluster, Set itemIds) { + final InsertValuesStep2 insertQuery = dsl.insertInto( + CLUSTERS_TEST_ITEM) + .columns(CLUSTERS_TEST_ITEM.CLUSTER_ID, CLUSTERS_TEST_ITEM.ITEM_ID); - itemIds.forEach(itemId -> insertQuery.values(cluster.getId(), itemId)); + itemIds.forEach(itemId -> insertQuery.values(cluster.getId(), itemId)); - return insertQuery.execute(); - } + return insertQuery.execute(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/DashboardRepository.java b/src/main/java/com/epam/ta/reportportal/dao/DashboardRepository.java index 2bbd7e4f0..aeb3b964e 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/DashboardRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/DashboardRepository.java @@ -17,43 +17,45 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.dashboard.Dashboard; - import java.util.List; import java.util.Optional; /** * @author Pavel Bortnik */ -public interface DashboardRepository extends ReportPortalRepository, DashboardRepositoryCustom { - - /** - * Finds dashboard by 'id' and 'project id' - * - * @param id {@link Dashboard#id} - * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} whose dashboard will be extracted - * @return {@link Dashboard} wrapped in the {@link Optional} - */ - Optional findByIdAndProjectId(Long id, Long projectId); - - List findAllByProjectId(Long projectId); - - /** - * Checks the existence of the {@link Dashboard} with specified name for a user on a project - * - * @param name {@link Dashboard#name} - * @param owner {@link Dashboard#owner} - * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} on which dashboard existence will be checked - * @return if exists 'true' else 'false' - */ - boolean existsByNameAndOwnerAndProjectId(String name, String owner, Long projectId); - - /** - * Checks the existence of the {@link Dashboard} with specified name on a project - * - * @param name {@link Dashboard#name} - * @param projectId {@link com.epam.ta.reportportal.entity.project.Project#id} - * @return if exists 'true' else 'false' - */ - boolean existsByNameAndProjectId(String name, Long projectId); +public interface DashboardRepository extends ReportPortalRepository, + DashboardRepositoryCustom { + + /** + * Finds dashboard by 'id' and 'project id' + * + * @param id {@link Dashboard#id} + * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} whose + * dashboard will be extracted + * @return {@link Dashboard} wrapped in the {@link Optional} + */ + Optional findByIdAndProjectId(Long id, Long projectId); + + List findAllByProjectId(Long projectId); + + /** + * Checks the existence of the {@link Dashboard} with specified name for a user on a project + * + * @param name {@link Dashboard#name} + * @param owner {@link Dashboard#owner} + * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} on which + * dashboard existence will be checked + * @return if exists 'true' else 'false' + */ + boolean existsByNameAndOwnerAndProjectId(String name, String owner, Long projectId); + + /** + * Checks the existence of the {@link Dashboard} with specified name on a project + * + * @param name {@link Dashboard#name} + * @param projectId {@link com.epam.ta.reportportal.entity.project.Project#id} + * @return if exists 'true' else 'false' + */ + boolean existsByNameAndProjectId(String name, Long projectId); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustom.java index cf82fa6bc..f9d7fd5c6 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustom.java @@ -22,4 +22,5 @@ * @author Pavel Bortnik */ public interface DashboardRepositoryCustom extends ShareableRepository { + } diff --git a/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustomImpl.java index d8a89f5c0..81011957f 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustomImpl.java @@ -16,32 +16,33 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.dao.util.ResultFetchers.DASHBOARD_FETCHER; + import com.epam.ta.reportportal.commons.querygen.ProjectFilter; import com.epam.ta.reportportal.entity.dashboard.Dashboard; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Repository; -import static com.epam.ta.reportportal.dao.util.ResultFetchers.DASHBOARD_FETCHER; - /** * @author Pavel Bortnik */ @Repository -public class DashboardRepositoryCustomImpl extends AbstractShareableRepositoryImpl implements DashboardRepositoryCustom { +public class DashboardRepositoryCustomImpl extends + AbstractShareableRepositoryImpl implements DashboardRepositoryCustom { - @Override - public Page getPermitted(ProjectFilter filter, Pageable pageable, String userName) { - return getPermitted(DASHBOARD_FETCHER, filter, pageable, userName); - } + @Override + public Page getPermitted(ProjectFilter filter, Pageable pageable, String userName) { + return getPermitted(DASHBOARD_FETCHER, filter, pageable, userName); + } - @Override - public Page getOwn(ProjectFilter filter, Pageable pageable, String userName) { - return getOwn(DASHBOARD_FETCHER, filter, pageable, userName); - } + @Override + public Page getOwn(ProjectFilter filter, Pageable pageable, String userName) { + return getOwn(DASHBOARD_FETCHER, filter, pageable, userName); + } - @Override - public Page getShared(ProjectFilter filter, Pageable pageable, String userName) { - return getShared(DASHBOARD_FETCHER, filter, pageable, userName); - } + @Override + public Page getShared(ProjectFilter filter, Pageable pageable, String userName) { + return getShared(DASHBOARD_FETCHER, filter, pageable, userName); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/DashboardWidgetRepository.java b/src/main/java/com/epam/ta/reportportal/dao/DashboardWidgetRepository.java index c7ec15a61..f17d61ee1 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/DashboardWidgetRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/DashboardWidgetRepository.java @@ -22,7 +22,8 @@ /** * @author Pavel Bortnik */ -public interface DashboardWidgetRepository extends ReportPortalRepository { +public interface DashboardWidgetRepository extends + ReportPortalRepository { - int countAllByWidgetId(Long widgetId); + int countAllByWidgetId(Long widgetId); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/FilterableRepository.java b/src/main/java/com/epam/ta/reportportal/dao/FilterableRepository.java index e543e2320..eef87ce68 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/FilterableRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/FilterableRepository.java @@ -17,30 +17,29 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.commons.querygen.Queryable; +import java.util.List; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; -import java.util.List; - /** * @author Yauheni_Martynau */ public interface FilterableRepository { - /** - * Executes query built for given filter - * - * @param filter Filter to build a query - * @return List of mapped entries found - */ - List findByFilter(Queryable filter); + /** + * Executes query built for given filter + * + * @param filter Filter to build a query + * @return List of mapped entries found + */ + List findByFilter(Queryable filter); - /** - * Executes query built for given filter and maps result for given page - * - * @param filter Filter to build a query - * @param pageable {@link Pageable} - * @return List of mapped entries found - */ - Page findByFilter(Queryable filter, Pageable pageable); + /** + * Executes query built for given filter and maps result for given page + * + * @param filter Filter to build a query + * @param pageable {@link Pageable} + * @return List of mapped entries found + */ + Page findByFilter(Queryable filter, Pageable pageable); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepository.java b/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepository.java index fc8897955..27ffe6554 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepository.java @@ -19,164 +19,171 @@ import com.epam.ta.reportportal.entity.integration.Integration; import com.epam.ta.reportportal.entity.integration.IntegrationType; import com.epam.ta.reportportal.entity.project.Project; +import java.util.List; +import java.util.Optional; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import java.util.List; -import java.util.Optional; - /** * @author Ivan Budayeu * @author Andrei Varabyeu */ -public interface IntegrationRepository extends ReportPortalRepository, IntegrationRepositoryCustom { - - boolean existsByNameAndTypeIdAndProjectIdIsNull(String name, Long typeId); - - boolean existsByNameAndTypeIdAndProjectId(String name, Long typeId, Long projectId); - - /** - * Retrieve integration by ID and project ID - * - * @param id ID of integrations - * @param projectId ID of project - * @return Optional of integration - */ - Optional findByIdAndProjectId(Long id, Long projectId); - - /** - * @param name {@link Integration#getName()} - * @param integrationTypeId {@link Integration#getType()}#{@link IntegrationType#getId()} - * @return {@link Optional} with {@link Integration} - */ - Optional findByNameAndTypeIdAndProjectIdIsNull(String name, Long integrationTypeId); - - /** - * @param id {@link Integration#getId()} ()} - * @param integrationTypeId {@link Integration#getType()}#{@link IntegrationType#getId()} - * @return {@link Optional} with {@link Integration} - */ - Optional findByIdAndTypeIdAndProjectIdIsNull(Long id, Long integrationTypeId); - - /** - * Retrieve given project's integrations - * - * @param projectId ID of project - * @return Found integrations - */ - List findAllByProjectIdOrderByCreationDateDesc(Long projectId); - - /** - * Retrieve all {@link Integration} by project ID and integration type - * - * @param projectId {@link com.epam.ta.reportportal.entity.project.Project#id} - * @param integrationType {@link IntegrationType} - * @return The {@link List} of the {@link Integration} - */ - List findAllByProjectIdAndTypeOrderByCreationDateDesc(Long projectId, IntegrationType integrationType); - - /** - * Delete all {@link Integration} with {@link Integration#project} == NULL by integration type ID - * - * @param typeId {@link IntegrationType#id} - */ - @Modifying - @Query(value = "DELETE FROM integration WHERE project_id IS NULL AND type = :typeId", nativeQuery = true) - int deleteAllGlobalByIntegrationTypeId(@Param("typeId") Long typeId); - - /** - * Delete all {@link Integration} by projectID and integration type ID - * - * @param typeId {@link IntegrationType#id} - */ - @Modifying - @Query(value = "DELETE FROM integration WHERE project_id = :projectId AND type = :typeId", nativeQuery = true) - int deleteAllByProjectIdAndIntegrationTypeId(@Param("projectId") Long projectId, @Param("typeId") Long typeId); - - /** - * Retrieve all {@link Integration} with {@link Integration#project} == null by integration type - * - * @param integrationType {@link Integration#type} - * @return @return The {@link List} of the {@link Integration} - */ - @Query(value = "SELECT i FROM Integration i WHERE i.project IS NULL AND i.type = :integrationType order by i.creationDate desc") - List findAllGlobalByType(@Param("integrationType") IntegrationType integrationType); - - /** - * Retrieve all {@link Integration} with {@link Integration#project} by integration group - * - * @param integrationGroup {@link IntegrationType#integrationGroup} - * @return @return The {@link List} of the {@link Integration} - */ - @Query(value = "SELECT i FROM Integration i JOIN i.type t WHERE i.project = :project AND t.integrationGroup = :integrationGroup order by i.creationDate desc") - List findAllProjectByGroup(@Param("project") Project project, - @Param("integrationGroup") IntegrationGroupEnum integrationGroup); - - /** - * Retrieve all {@link Integration} with {@link Integration#project} == null by integration group - * - * @param integrationGroup {@link IntegrationType#integrationGroup} - * @return @return The {@link List} of the {@link Integration} - */ - @Query(value = "SELECT i FROM Integration i JOIN i.type t WHERE i.project IS NULL AND t.integrationGroup = :integrationGroup order by i.creationDate desc") - List findAllGlobalByGroup(@Param("integrationGroup") IntegrationGroupEnum integrationGroup); - - /** - * Retrieve all {@link Integration} with {@link Integration#project} == null - * - * @return @return The {@link List} of the global {@link Integration} - */ - @Query(value = "SELECT i FROM Integration i WHERE i.project IS NULL order by i.creationDate desc") - List findAllGlobal(); - - /** - * Find BTS integration by BTS url, BTS project name and Report Portal project id - * - * @param url Bug Tracking System url - * @param btsProject Bug Tracking System project name - * @param projectId {@link com.epam.ta.reportportal.entity.project.Project#id} - * @return The {@link Integration} wrapped in the {@link Optional} - */ - @Query(value = - "SELECT i.id, i.name, i.enabled, i.project_id, i.creator, i.creation_date, i.params, i.type, 0 AS clazz_ FROM integration i" - + " WHERE (params->'params'->>'url' = :url AND params->'params'->>'project' = :btsProject" - + " AND i.project_id = :projectId) LIMIT 1", nativeQuery = true) - Optional findProjectBtsByUrlAndLinkedProject(@Param("url") String url, @Param("btsProject") String btsProject, - @Param("projectId") Long projectId); - - /** - * Find BTS integration by BTS url, BTS project name and {@link Integration#project} == null - * - * @param url Bug Tracking System url - * @param btsProject Bug Tracking System project name - * @return The {@link Integration} wrapped in the {@link Optional} - */ - @Query(value = - "SELECT i.id, i.name, i.enabled, i.project_id, i.creator, i.creation_date, i.params, i.type, 0 AS clazz_ FROM integration i " - + " WHERE params->'params'->>'url' = :url AND i.params->'params'->>'project' = :btsProject AND i.project_id IS NULL LIMIT 1", nativeQuery = true) - Optional findGlobalBtsByUrlAndLinkedProject(@Param("url") String url, @Param("btsProject") String btsProject); - - /** - * Update {@link Integration#enabled} by integration ID - * - * @param enabled Enabled state flag - * @param integrationId {@link Integration#id} - */ - @Modifying - @Query(value = "UPDATE integration SET enabled = :enabled WHERE id = :integrationId", nativeQuery = true) - void updateEnabledStateById(@Param("enabled") boolean enabled, @Param("integrationId") Long integrationId); - - /** - * Update {@link Integration#enabled} of all integrations by integration type id - * - * @param enabled Enabled state flag - * @param integrationTypeId {@link IntegrationType#id} - */ - @Modifying - @Query(value = "UPDATE integration SET enabled = :enabled WHERE type = :integrationTypeId", nativeQuery = true) - void updateEnabledStateByIntegrationTypeId(@Param("enabled") boolean enabled, @Param("integrationTypeId") Long integrationTypeId); - - @Query(value = "SELECT * FROM integration i LEFT OUTER JOIN integration_type it ON i.type = it.id WHERE it.name IN (:types) order by i.creation_date desc", nativeQuery = true) - List findAllByTypeIn(@Param("types") String... types); +public interface IntegrationRepository extends ReportPortalRepository, + IntegrationRepositoryCustom { + + boolean existsByNameAndTypeIdAndProjectIdIsNull(String name, Long typeId); + + boolean existsByNameAndTypeIdAndProjectId(String name, Long typeId, Long projectId); + + /** + * Retrieve integration by ID and project ID + * + * @param id ID of integrations + * @param projectId ID of project + * @return Optional of integration + */ + Optional findByIdAndProjectId(Long id, Long projectId); + + /** + * @param name {@link Integration#getName()} + * @param integrationTypeId {@link Integration#getType()}#{@link IntegrationType#getId()} + * @return {@link Optional} with {@link Integration} + */ + Optional findByNameAndTypeIdAndProjectIdIsNull(String name, Long integrationTypeId); + + /** + * @param id {@link Integration#getId()} ()} + * @param integrationTypeId {@link Integration#getType()}#{@link IntegrationType#getId()} + * @return {@link Optional} with {@link Integration} + */ + Optional findByIdAndTypeIdAndProjectIdIsNull(Long id, Long integrationTypeId); + + /** + * Retrieve given project's integrations + * + * @param projectId ID of project + * @return Found integrations + */ + List findAllByProjectIdOrderByCreationDateDesc(Long projectId); + + /** + * Retrieve all {@link Integration} by project ID and integration type + * + * @param projectId {@link com.epam.ta.reportportal.entity.project.Project#id} + * @param integrationType {@link IntegrationType} + * @return The {@link List} of the {@link Integration} + */ + List findAllByProjectIdAndTypeOrderByCreationDateDesc(Long projectId, + IntegrationType integrationType); + + /** + * Delete all {@link Integration} with {@link Integration#project} == NULL by integration type ID + * + * @param typeId {@link IntegrationType#id} + */ + @Modifying + @Query(value = "DELETE FROM integration WHERE project_id IS NULL AND type = :typeId", nativeQuery = true) + int deleteAllGlobalByIntegrationTypeId(@Param("typeId") Long typeId); + + /** + * Delete all {@link Integration} by projectID and integration type ID + * + * @param typeId {@link IntegrationType#id} + */ + @Modifying + @Query(value = "DELETE FROM integration WHERE project_id = :projectId AND type = :typeId", nativeQuery = true) + int deleteAllByProjectIdAndIntegrationTypeId(@Param("projectId") Long projectId, + @Param("typeId") Long typeId); + + /** + * Retrieve all {@link Integration} with {@link Integration#project} == null by integration type + * + * @param integrationType {@link Integration#type} + * @return @return The {@link List} of the {@link Integration} + */ + @Query(value = "SELECT i FROM Integration i WHERE i.project IS NULL AND i.type = :integrationType order by i.creationDate desc") + List findAllGlobalByType(@Param("integrationType") IntegrationType integrationType); + + /** + * Retrieve all {@link Integration} with {@link Integration#project} by integration group + * + * @param integrationGroup {@link IntegrationType#integrationGroup} + * @return @return The {@link List} of the {@link Integration} + */ + @Query(value = "SELECT i FROM Integration i JOIN i.type t WHERE i.project = :project AND t.integrationGroup = :integrationGroup order by i.creationDate desc") + List findAllProjectByGroup(@Param("project") Project project, + @Param("integrationGroup") IntegrationGroupEnum integrationGroup); + + /** + * Retrieve all {@link Integration} with {@link Integration#project} == null by integration group + * + * @param integrationGroup {@link IntegrationType#integrationGroup} + * @return @return The {@link List} of the {@link Integration} + */ + @Query(value = "SELECT i FROM Integration i JOIN i.type t WHERE i.project IS NULL AND t.integrationGroup = :integrationGroup order by i.creationDate desc") + List findAllGlobalByGroup( + @Param("integrationGroup") IntegrationGroupEnum integrationGroup); + + /** + * Retrieve all {@link Integration} with {@link Integration#project} == null + * + * @return @return The {@link List} of the global {@link Integration} + */ + @Query(value = "SELECT i FROM Integration i WHERE i.project IS NULL order by i.creationDate desc") + List findAllGlobal(); + + /** + * Find BTS integration by BTS url, BTS project name and Report Portal project id + * + * @param url Bug Tracking System url + * @param btsProject Bug Tracking System project name + * @param projectId {@link com.epam.ta.reportportal.entity.project.Project#id} + * @return The {@link Integration} wrapped in the {@link Optional} + */ + @Query(value = + "SELECT i.id, i.name, i.enabled, i.project_id, i.creator, i.creation_date, i.params, i.type, 0 AS clazz_ FROM integration i" + + " WHERE (params->'params'->>'url' = :url AND params->'params'->>'project' = :btsProject" + + " AND i.project_id = :projectId) LIMIT 1", nativeQuery = true) + Optional findProjectBtsByUrlAndLinkedProject(@Param("url") String url, + @Param("btsProject") String btsProject, + @Param("projectId") Long projectId); + + /** + * Find BTS integration by BTS url, BTS project name and {@link Integration#project} == null + * + * @param url Bug Tracking System url + * @param btsProject Bug Tracking System project name + * @return The {@link Integration} wrapped in the {@link Optional} + */ + @Query(value = + "SELECT i.id, i.name, i.enabled, i.project_id, i.creator, i.creation_date, i.params, i.type, 0 AS clazz_ FROM integration i " + + " WHERE params->'params'->>'url' = :url AND i.params->'params'->>'project' = :btsProject AND i.project_id IS NULL LIMIT 1", nativeQuery = true) + Optional findGlobalBtsByUrlAndLinkedProject(@Param("url") String url, + @Param("btsProject") String btsProject); + + /** + * Update {@link Integration#enabled} by integration ID + * + * @param enabled Enabled state flag + * @param integrationId {@link Integration#id} + */ + @Modifying + @Query(value = "UPDATE integration SET enabled = :enabled WHERE id = :integrationId", nativeQuery = true) + void updateEnabledStateById(@Param("enabled") boolean enabled, + @Param("integrationId") Long integrationId); + + /** + * Update {@link Integration#enabled} of all integrations by integration type id + * + * @param enabled Enabled state flag + * @param integrationTypeId {@link IntegrationType#id} + */ + @Modifying + @Query(value = "UPDATE integration SET enabled = :enabled WHERE type = :integrationTypeId", nativeQuery = true) + void updateEnabledStateByIntegrationTypeId(@Param("enabled") boolean enabled, + @Param("integrationTypeId") Long integrationTypeId); + + @Query(value = "SELECT * FROM integration i LEFT OUTER JOIN integration_type it ON i.type = it.id WHERE it.name IN (:types) order by i.creation_date desc", nativeQuery = true) + List findAllByTypeIn(@Param("types") String... types); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepositoryCustom.java index d8cde3b32..ba2f3768b 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepositoryCustom.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.integration.Integration; - import java.util.List; import java.util.Optional; @@ -26,36 +25,50 @@ */ public interface IntegrationRepositoryCustom extends FilterableRepository { - /** - * Retrieve integration with {@link Integration#project} == null by integration ID - * - * @param integrationId {@link Integration#id} - * @return The {@link Integration} wrapped in the {@link Optional} - */ - Optional findGlobalById(Long integrationId); + /** + * Retrieve integration with {@link Integration#project} == null by integration ID + * + * @param integrationId {@link Integration#id} + * @return The {@link Integration} wrapped in the {@link Optional} + */ + Optional findGlobalById(Long integrationId); - /** - * Retrieve integrations by project ID and {@link com.epam.ta.reportportal.entity.integration.IntegrationType#id} IN provided integration type IDs - * - * @param projectId {@link com.epam.ta.reportportal.entity.project.Project#id} of the {@link Integration} - * @param integrationTypeIds The {@link List} of the {@link com.epam.ta.reportportal.entity.integration.IntegrationType#id} - * @return The {@link List} of the {@link Integration} - */ - List findAllByProjectIdAndInIntegrationTypeIds(Long projectId, List integrationTypeIds); + /** + * Retrieve integrations by project ID and + * {@link com.epam.ta.reportportal.entity.integration.IntegrationType#id} IN provided integration + * type IDs + * + * @param projectId {@link com.epam.ta.reportportal.entity.project.Project#id} of the + * {@link Integration} + * @param integrationTypeIds The {@link List} of the + * {@link + * com.epam.ta.reportportal.entity.integration.IntegrationType#id} + * @return The {@link List} of the {@link Integration} + */ + List findAllByProjectIdAndInIntegrationTypeIds(Long projectId, + List integrationTypeIds); - /** - * Retrieve integrations with {@link com.epam.ta.reportportal.entity.integration.IntegrationType#id} IN provided integration type IDs - * - * @param integrationTypeIds The {@link List} of the {@link com.epam.ta.reportportal.entity.integration.IntegrationType#id} - * @return The {@link List} of the {@link Integration} - */ - List findAllGlobalInIntegrationTypeIds(List integrationTypeIds); + /** + * Retrieve integrations with + * {@link com.epam.ta.reportportal.entity.integration.IntegrationType#id} IN provided integration + * type IDs + * + * @param integrationTypeIds The {@link List} of the + * {@link + * com.epam.ta.reportportal.entity.integration.IntegrationType#id} + * @return The {@link List} of the {@link Integration} + */ + List findAllGlobalInIntegrationTypeIds(List integrationTypeIds); - /** - * Retrieve integrations with {@link com.epam.ta.reportportal.entity.integration.IntegrationType#id} NOT IN provided integration type IDs - * - * @param integrationTypeIds The {@link List} of the {@link com.epam.ta.reportportal.entity.integration.IntegrationType#id} - * @return The {@link List} of the {@link Integration} - */ - List findAllGlobalNotInIntegrationTypeIds(List integrationTypeIds); + /** + * Retrieve integrations with + * {@link com.epam.ta.reportportal.entity.integration.IntegrationType#id} NOT IN provided + * integration type IDs + * + * @param integrationTypeIds The {@link List} of the + * {@link + * com.epam.ta.reportportal.entity.integration.IntegrationType#id} + * @return The {@link List} of the {@link Integration} + */ + List findAllGlobalNotInIntegrationTypeIds(List integrationTypeIds); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepositoryCustomImpl.java index f7764142c..8371be7f0 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/IntegrationRepositoryCustomImpl.java @@ -16,9 +16,18 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.dao.util.RecordMappers.GLOBAL_INTEGRATION_RECORD_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.PROJECT_INTEGRATION_RECORD_MAPPER; +import static com.epam.ta.reportportal.dao.util.ResultFetchers.INTEGRATION_FETCHER; +import static com.epam.ta.reportportal.jooq.tables.JIntegration.INTEGRATION; +import static com.epam.ta.reportportal.jooq.tables.JIntegrationType.INTEGRATION_TYPE; +import static java.util.Optional.ofNullable; + import com.epam.ta.reportportal.commons.querygen.QueryBuilder; import com.epam.ta.reportportal.commons.querygen.Queryable; import com.epam.ta.reportportal.entity.integration.Integration; +import java.util.List; +import java.util.Optional; import org.jooq.DSLContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -26,86 +35,78 @@ import org.springframework.data.repository.support.PageableExecutionUtils; import org.springframework.stereotype.Repository; -import java.util.List; -import java.util.Optional; - -import static com.epam.ta.reportportal.dao.util.RecordMappers.GLOBAL_INTEGRATION_RECORD_MAPPER; -import static com.epam.ta.reportportal.dao.util.RecordMappers.PROJECT_INTEGRATION_RECORD_MAPPER; -import static com.epam.ta.reportportal.dao.util.ResultFetchers.INTEGRATION_FETCHER; -import static com.epam.ta.reportportal.jooq.tables.JIntegration.INTEGRATION; -import static com.epam.ta.reportportal.jooq.tables.JIntegrationType.INTEGRATION_TYPE; -import static java.util.Optional.ofNullable; - /** * @author Yauheni_Martynau */ @Repository public class IntegrationRepositoryCustomImpl implements IntegrationRepositoryCustom { - private final DSLContext dsl; + private final DSLContext dsl; - @Autowired - public IntegrationRepositoryCustomImpl(DSLContext dsl) { - this.dsl = dsl; - } + @Autowired + public IntegrationRepositoryCustomImpl(DSLContext dsl) { + this.dsl = dsl; + } - @Override - public List findByFilter(Queryable filter) { - return INTEGRATION_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter).wrap().build())); - } + @Override + public List findByFilter(Queryable filter) { + return INTEGRATION_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter).wrap().build())); + } - @Override - public Page findByFilter(Queryable filter, Pageable pageable) { - return PageableExecutionUtils.getPage(INTEGRATION_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter) - .with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) - .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build())); - } + @Override + public Page findByFilter(Queryable filter, Pageable pageable) { + return PageableExecutionUtils.getPage( + INTEGRATION_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter) + .with(pageable) + .wrap() + .withWrapperSort(pageable.getSort()) + .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build())); + } - @Override - public Optional findGlobalById(Long integrationId) { - return ofNullable(dsl.select() - .from(INTEGRATION) - .join(INTEGRATION_TYPE) - .on(INTEGRATION.TYPE.eq(INTEGRATION_TYPE.ID)) - .where(INTEGRATION.ID.eq(integrationId.intValue()).and(INTEGRATION.PROJECT_ID.isNull())) - .fetchAny(GLOBAL_INTEGRATION_RECORD_MAPPER)); - } + @Override + public Optional findGlobalById(Long integrationId) { + return ofNullable(dsl.select() + .from(INTEGRATION) + .join(INTEGRATION_TYPE) + .on(INTEGRATION.TYPE.eq(INTEGRATION_TYPE.ID)) + .where(INTEGRATION.ID.eq(integrationId.intValue()).and(INTEGRATION.PROJECT_ID.isNull())) + .fetchAny(GLOBAL_INTEGRATION_RECORD_MAPPER)); + } - @Override - public List findAllByProjectIdAndInIntegrationTypeIds(Long projectId, List integrationTypeIds) { - return dsl.select() - .from(INTEGRATION) - .join(INTEGRATION_TYPE) - .on(INTEGRATION.TYPE.eq(INTEGRATION_TYPE.ID)) - .where(INTEGRATION_TYPE.ID.in(integrationTypeIds)) - .and(INTEGRATION.PROJECT_ID.eq(projectId)) - .orderBy(INTEGRATION.CREATION_DATE.desc()) - .fetch(PROJECT_INTEGRATION_RECORD_MAPPER); - } + @Override + public List findAllByProjectIdAndInIntegrationTypeIds(Long projectId, + List integrationTypeIds) { + return dsl.select() + .from(INTEGRATION) + .join(INTEGRATION_TYPE) + .on(INTEGRATION.TYPE.eq(INTEGRATION_TYPE.ID)) + .where(INTEGRATION_TYPE.ID.in(integrationTypeIds)) + .and(INTEGRATION.PROJECT_ID.eq(projectId)) + .orderBy(INTEGRATION.CREATION_DATE.desc()) + .fetch(PROJECT_INTEGRATION_RECORD_MAPPER); + } - @Override - public List findAllGlobalInIntegrationTypeIds(List integrationTypeIds) { - return dsl.select() - .from(INTEGRATION) - .join(INTEGRATION_TYPE) - .on(INTEGRATION.TYPE.eq(INTEGRATION_TYPE.ID)) - .where(INTEGRATION_TYPE.ID.in(integrationTypeIds)) - .and(INTEGRATION.PROJECT_ID.isNull()) - .orderBy(INTEGRATION.CREATION_DATE.desc()) - .fetch(GLOBAL_INTEGRATION_RECORD_MAPPER); - } + @Override + public List findAllGlobalInIntegrationTypeIds(List integrationTypeIds) { + return dsl.select() + .from(INTEGRATION) + .join(INTEGRATION_TYPE) + .on(INTEGRATION.TYPE.eq(INTEGRATION_TYPE.ID)) + .where(INTEGRATION_TYPE.ID.in(integrationTypeIds)) + .and(INTEGRATION.PROJECT_ID.isNull()) + .orderBy(INTEGRATION.CREATION_DATE.desc()) + .fetch(GLOBAL_INTEGRATION_RECORD_MAPPER); + } - @Override - public List findAllGlobalNotInIntegrationTypeIds(List integrationTypeIds) { - return dsl.select() - .from(INTEGRATION) - .join(INTEGRATION_TYPE) - .on(INTEGRATION.TYPE.eq(INTEGRATION_TYPE.ID)) - .where(INTEGRATION_TYPE.ID.notIn(integrationTypeIds)) - .and(INTEGRATION.PROJECT_ID.isNull()) - .orderBy(INTEGRATION.CREATION_DATE.desc()) - .fetch(GLOBAL_INTEGRATION_RECORD_MAPPER); - } + @Override + public List findAllGlobalNotInIntegrationTypeIds(List integrationTypeIds) { + return dsl.select() + .from(INTEGRATION) + .join(INTEGRATION_TYPE) + .on(INTEGRATION.TYPE.eq(INTEGRATION_TYPE.ID)) + .where(INTEGRATION_TYPE.ID.notIn(integrationTypeIds)) + .and(INTEGRATION.PROJECT_ID.isNull()) + .orderBy(INTEGRATION.CREATION_DATE.desc()) + .fetch(GLOBAL_INTEGRATION_RECORD_MAPPER); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/IntegrationTypeRepository.java b/src/main/java/com/epam/ta/reportportal/dao/IntegrationTypeRepository.java index d4803c7ff..0384f8aa7 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/IntegrationTypeRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/IntegrationTypeRepository.java @@ -18,11 +18,10 @@ import com.epam.ta.reportportal.entity.enums.IntegrationGroupEnum; import com.epam.ta.reportportal.entity.integration.IntegrationType; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; - import java.util.List; import java.util.Optional; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; /** * Repository for {@link com.epam.ta.reportportal.entity.integration.IntegrationType} entity @@ -31,35 +30,36 @@ */ public interface IntegrationTypeRepository extends ReportPortalRepository { - /** - * Retrieve all {@link IntegrationType} by {@link IntegrationType#integrationGroup} - * - * @param integrationGroup {@link IntegrationType#integrationGroup} - * @return The {@link List} of the {@link IntegrationType} - */ - List findAllByIntegrationGroup(IntegrationGroupEnum integrationGroup); + /** + * Retrieve all {@link IntegrationType} by {@link IntegrationType#integrationGroup} + * + * @param integrationGroup {@link IntegrationType#integrationGroup} + * @return The {@link List} of the {@link IntegrationType} + */ + List findAllByIntegrationGroup(IntegrationGroupEnum integrationGroup); - /** - * Retrieve all {@link IntegrationType} ordered by {@link IntegrationType#creationDate} in ascending order - * - * @return The {@link List} of the {@link IntegrationType} - */ - List findAllByOrderByCreationDate(); + /** + * Retrieve all {@link IntegrationType} ordered by {@link IntegrationType#creationDate} in + * ascending order + * + * @return The {@link List} of the {@link IntegrationType} + */ + List findAllByOrderByCreationDate(); - /** - * Find integration by name - * - * @param name Integration name - * @return @return The {@link Optional} of the {@link IntegrationType} - */ - Optional findByName(String name); + /** + * Find integration by name + * + * @param name Integration name + * @return @return The {@link Optional} of the {@link IntegrationType} + */ + Optional findByName(String name); - /** - * Retrieve all {@link IntegrationType} by accessType - * - * @param accessType {@link java.lang.String} - * @return The {@link List} of the {@link IntegrationType} - */ - @Query(value = "SELECT it.* FROM integration_type it WHERE (it.details -> 'details'->>'accessType' = :accessType)", nativeQuery = true) - List findAllByAccessType(@Param("accessType") String accessType); + /** + * Retrieve all {@link IntegrationType} by accessType + * + * @param accessType {@link java.lang.String} + * @return The {@link List} of the {@link IntegrationType} + */ + @Query(value = "SELECT it.* FROM integration_type it WHERE (it.details -> 'details'->>'accessType' = :accessType)", nativeQuery = true) + List findAllByAccessType(@Param("accessType") String accessType); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/IssueEntityRepository.java b/src/main/java/com/epam/ta/reportportal/dao/IssueEntityRepository.java index b94ec295a..a5c58387c 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/IssueEntityRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/IssueEntityRepository.java @@ -17,10 +17,10 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.item.issue.IssueEntity; - import java.util.List; -public interface IssueEntityRepository extends ReportPortalRepository, IssueEntityRepositoryCustom { +public interface IssueEntityRepository extends ReportPortalRepository, + IssueEntityRepositoryCustom { - List findAllByIssueTypeId(Long id); + List findAllByIssueTypeId(Long id); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryCustom.java index c68e8a5b1..ecaf192f7 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryCustom.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.item.issue.IssueEntityPojo; - import java.util.List; /** @@ -25,11 +24,13 @@ */ public interface IssueEntityRepositoryCustom { - /** - * Method for batch inserting of the {@link com.epam.ta.reportportal.entity.item.issue.IssueEntity}. Used for performance improvement - * - * @param issueEntities {@link IssueEntityPojo} - * @return Number of inserted rows - */ - int saveMultiple(List issueEntities); + /** + * Method for batch inserting of the + * {@link com.epam.ta.reportportal.entity.item.issue.IssueEntity}. Used for performance + * improvement + * + * @param issueEntities {@link IssueEntityPojo} + * @return Number of inserted rows + */ + int saveMultiple(List issueEntities); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryCustomImpl.java index 540b59eec..12c040e44 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryCustomImpl.java @@ -16,40 +16,41 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.jooq.tables.JIssue.ISSUE; + import com.epam.ta.reportportal.entity.item.issue.IssueEntityPojo; import com.epam.ta.reportportal.jooq.tables.records.JIssueRecord; +import java.util.List; import org.jooq.DSLContext; import org.jooq.InsertValuesStep5; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import java.util.List; - -import static com.epam.ta.reportportal.jooq.tables.JIssue.ISSUE; - /** * @author Ivan Budayeu */ @Repository public class IssueEntityRepositoryCustomImpl implements IssueEntityRepositoryCustom { - @Autowired - private DSLContext dslContext; + @Autowired + private DSLContext dslContext; - @Override - public int saveMultiple(List issueEntities) { + @Override + public int saveMultiple(List issueEntities) { - InsertValuesStep5 columns = dslContext.insertInto(ISSUE) - .columns(ISSUE.ISSUE_ID, ISSUE.ISSUE_TYPE, ISSUE.ISSUE_DESCRIPTION, ISSUE.AUTO_ANALYZED, ISSUE.IGNORE_ANALYZER); + InsertValuesStep5 columns = dslContext.insertInto( + ISSUE) + .columns(ISSUE.ISSUE_ID, ISSUE.ISSUE_TYPE, ISSUE.ISSUE_DESCRIPTION, ISSUE.AUTO_ANALYZED, + ISSUE.IGNORE_ANALYZER); - issueEntities.forEach(issue -> columns.values(issue.getItemId(), - issue.getIssueTypeId(), - issue.getDescription(), - issue.isAutoAnalyzed(), - issue.isIgnoreAnalyzer() - )); + issueEntities.forEach(issue -> columns.values(issue.getItemId(), + issue.getIssueTypeId(), + issue.getDescription(), + issue.isAutoAnalyzed(), + issue.isIgnoreAnalyzer() + )); - return columns.execute(); + return columns.execute(); - } + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/IssueGroupRepository.java b/src/main/java/com/epam/ta/reportportal/dao/IssueGroupRepository.java index 38ebc108c..741ee9b65 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/IssueGroupRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/IssueGroupRepository.java @@ -24,5 +24,5 @@ */ public interface IssueGroupRepository extends ReportPortalRepository { - IssueGroup findByTestItemIssueGroup(TestItemIssueGroup testItemIssueGroup); + IssueGroup findByTestItemIssueGroup(TestItemIssueGroup testItemIssueGroup); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/IssueTypeRepository.java b/src/main/java/com/epam/ta/reportportal/dao/IssueTypeRepository.java index 3f9959e11..97eaef08b 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/IssueTypeRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/IssueTypeRepository.java @@ -17,19 +17,19 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.item.issue.IssueType; - import java.util.Optional; /** * @author Pavel Bortnik */ -public interface IssueTypeRepository extends ReportPortalRepository, IssueTypeRepositoryCustom { +public interface IssueTypeRepository extends ReportPortalRepository, + IssueTypeRepositoryCustom { - /** - * Find issue type by it's locator - * - * @param locator locator - * @return Optional of IssueType - */ - Optional findByLocator(String locator); + /** + * Find issue type by it's locator + * + * @param locator locator + * @return Optional of IssueType + */ + Optional findByLocator(String locator); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/IssueTypeRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/IssueTypeRepositoryCustom.java index 3881fb66f..58f55f5cb 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/IssueTypeRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/IssueTypeRepositoryCustom.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.item.issue.IssueType; - import java.util.Collection; import java.util.List; @@ -26,8 +25,8 @@ */ public interface IssueTypeRepositoryCustom { - List getDefaultIssueTypes(); + List getDefaultIssueTypes(); - List getIssueTypeIdsByLocators(Collection locators); + List getIssueTypeIdsByLocators(Collection locators); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/IssueTypeRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/IssueTypeRepositoryCustomImpl.java index 7f1ff4348..91806950e 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/IssueTypeRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/IssueTypeRepositoryCustomImpl.java @@ -16,19 +16,18 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.dao.util.RecordMappers.ISSUE_TYPE_RECORD_MAPPER; +import static com.epam.ta.reportportal.jooq.Tables.ISSUE_GROUP; +import static com.epam.ta.reportportal.jooq.Tables.ISSUE_TYPE; + import com.epam.ta.reportportal.entity.enums.TestItemIssueGroup; import com.epam.ta.reportportal.entity.item.issue.IssueType; -import org.jooq.DSLContext; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Repository; - import java.util.Arrays; import java.util.Collection; import java.util.List; - -import static com.epam.ta.reportportal.dao.util.RecordMappers.ISSUE_TYPE_RECORD_MAPPER; -import static com.epam.ta.reportportal.jooq.Tables.ISSUE_GROUP; -import static com.epam.ta.reportportal.jooq.Tables.ISSUE_TYPE; +import org.jooq.DSLContext; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; /** * @author Pavel Bortnik @@ -36,29 +35,29 @@ @Repository public class IssueTypeRepositoryCustomImpl implements IssueTypeRepositoryCustom { - private DSLContext dsl; - - @Autowired - public void setDsl(DSLContext dsl) { - this.dsl = dsl; - } - - @Override - public List getDefaultIssueTypes() { - return dsl.select() - .from(ISSUE_TYPE) - .join(ISSUE_GROUP) - .on(ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)) - .where(ISSUE_TYPE.LOCATOR.in(Arrays.stream(TestItemIssueGroup.values()) - .map(TestItemIssueGroup::getLocator) - .toArray(String[]::new))) - .fetch(ISSUE_TYPE_RECORD_MAPPER); - } - - @Override - public List getIssueTypeIdsByLocators(Collection locators) { - return dsl.select(ISSUE_TYPE.ID).from(ISSUE_TYPE) - .where(ISSUE_TYPE.LOCATOR.in(locators)) - .fetch(ISSUE_TYPE.ID); - } + private DSLContext dsl; + + @Autowired + public void setDsl(DSLContext dsl) { + this.dsl = dsl; + } + + @Override + public List getDefaultIssueTypes() { + return dsl.select() + .from(ISSUE_TYPE) + .join(ISSUE_GROUP) + .on(ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)) + .where(ISSUE_TYPE.LOCATOR.in(Arrays.stream(TestItemIssueGroup.values()) + .map(TestItemIssueGroup::getLocator) + .toArray(String[]::new))) + .fetch(ISSUE_TYPE_RECORD_MAPPER); + } + + @Override + public List getIssueTypeIdsByLocators(Collection locators) { + return dsl.select(ISSUE_TYPE.ID).from(ISSUE_TYPE) + .where(ISSUE_TYPE.LOCATOR.in(locators)) + .fetch(ISSUE_TYPE.ID); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepository.java index 4a7d75112..d77b63c7a 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepository.java @@ -17,15 +17,16 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.ItemAttribute; - import java.util.Optional; /** * @author Ihar Kahadouski */ -public interface ItemAttributeRepository extends ReportPortalRepository, ItemAttributeRepositoryCustom { +public interface ItemAttributeRepository extends ReportPortalRepository, + ItemAttributeRepositoryCustom { - Optional findByLaunchIdAndKeyAndSystem(Long launchId, String key, boolean isSystem); + Optional findByLaunchIdAndKeyAndSystem(Long launchId, String key, + boolean isSystem); - int deleteAllByLaunchIdAndKeyAndSystem(Long launchId, String key, boolean isSystem); + int deleteAllByLaunchIdAndKeyAndSystem(Long launchId, String key, boolean isSystem); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryCustom.java index 396313803..13bc35f9f 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryCustom.java @@ -20,118 +20,126 @@ import com.epam.ta.reportportal.entity.ItemAttribute; import com.epam.ta.reportportal.entity.item.ItemAttributePojo; import com.epam.ta.reportportal.entity.launch.Launch; -import org.springframework.data.domain.Pageable; - import java.util.List; +import org.springframework.data.domain.Pageable; /** * @author Ihar Kahadouski */ public interface ItemAttributeRepositoryCustom { - /** - * Retrieves {@link com.epam.ta.reportportal.entity.launch.Launch} and {@link com.epam.ta.reportportal.entity.item.TestItem} - * {@link ItemAttribute#getKey()} by project id and part of the {@link ItemAttribute#getKey()}. - * - * @param launchFilter {@link Queryable} with {@link com.epam.ta.reportportal.commons.querygen.FilterTarget#LAUNCH_TARGET} - * @param launchPageable {@link Pageable} for launches sorting and limitation - * @param isLatest Flag defines whether all or latest launches launches will be included in the query condition - * @param keyPart Part of the {@link ItemAttribute#getKey()} - * @param isSystem {@link ItemAttribute#isSystem()} - * @return {@link List} of matched attribute keys - */ - List findAllKeysByLaunchFilter(Queryable launchFilter, Pageable launchPageable, boolean isLatest, String keyPart, - boolean isSystem); + /** + * Retrieves {@link com.epam.ta.reportportal.entity.launch.Launch} and + * {@link com.epam.ta.reportportal.entity.item.TestItem} {@link ItemAttribute#getKey()} by project + * id and part of the {@link ItemAttribute#getKey()}. + * + * @param launchFilter {@link Queryable} with + * {@link + * com.epam.ta.reportportal.commons.querygen.FilterTarget#LAUNCH_TARGET} + * @param launchPageable {@link Pageable} for launches sorting and limitation + * @param isLatest Flag defines whether all or latest launches launches will be included in + * the query condition + * @param keyPart Part of the {@link ItemAttribute#getKey()} + * @param isSystem {@link ItemAttribute#isSystem()} + * @return {@link List} of matched attribute keys + */ + List findAllKeysByLaunchFilter(Queryable launchFilter, Pageable launchPageable, + boolean isLatest, String keyPart, + boolean isSystem); - /** - * Retrieves launch attribute keys by project and part of value. - * Used for autocompletion functionality - * - * @param projectId Id of project - * @param value part of key - * @return List of matched attribute keys - */ - List findLaunchAttributeKeys(Long projectId, String value, boolean system); + /** + * Retrieves launch attribute keys by project and part of value. Used for autocompletion + * functionality + * + * @param projectId Id of project + * @param value part of key + * @return List of matched attribute keys + */ + List findLaunchAttributeKeys(Long projectId, String value, boolean system); - /** - * Retrieves launch attribute values by project, specified key and part of value. - * Used for autocompletion functionality - * - * @param projectId Id of project - * @param key Specified key - * @param value Part of value - * @return List of matched attribute values - */ - List findLaunchAttributeValues(Long projectId, String key, String value, boolean system); + /** + * Retrieves launch attribute values by project, specified key and part of value. Used for + * autocompletion functionality + * + * @param projectId Id of project + * @param key Specified key + * @param value Part of value + * @return List of matched attribute values + */ + List findLaunchAttributeValues(Long projectId, String key, String value, boolean system); - /** - * Retrieves test item attribute keys by launch and part of value. - * Used for autocompletion functionality - * - * @param launchId Id of launch - * @param value part of key - * @return List of matched attribute keys - */ - List findTestItemAttributeKeys(Long launchId, String value, boolean system); + /** + * Retrieves test item attribute keys by launch and part of value. Used for autocompletion + * functionality + * + * @param launchId Id of launch + * @param value part of key + * @return List of matched attribute keys + */ + List findTestItemAttributeKeys(Long launchId, String value, boolean system); - /** - * Retrieves test item attribute values by launch, specified key and part of value. - * Used for autocompletion functionality - * - * @param launchId Id of launch - * @param key Specified key - * @param value Part of value - * @return List of matched attribute values - */ - List findTestItemAttributeValues(Long launchId, String key, String value, boolean system); + /** + * Retrieves test item attribute values by launch, specified key and part of value. Used for + * autocompletion functionality + * + * @param launchId Id of launch + * @param key Specified key + * @param value Part of value + * @return List of matched attribute values + */ + List findTestItemAttributeValues(Long launchId, String key, String value, boolean system); - /** - * Retrieves test item attribute keys by project id and part of value. - * Used for autocompletion functionality - * - * @param projectId Id of {@link com.epam.ta.reportportal.entity.project.Project} which items' attribute keys should be found - * @param launchName {@link Launch#getName()} which items' attributes should be found - * @param keyPart part of key - * @return List of matched attribute keys - */ - List findTestItemKeysByProjectIdAndLaunchName(Long projectId, String launchName, String keyPart, boolean system); + /** + * Retrieves test item attribute keys by project id and part of value. Used for autocompletion + * functionality + * + * @param projectId Id of {@link com.epam.ta.reportportal.entity.project.Project} which items' + * attribute keys should be found + * @param launchName {@link Launch#getName()} which items' attributes should be found + * @param keyPart part of key + * @return List of matched attribute keys + */ + List findTestItemKeysByProjectIdAndLaunchName(Long projectId, String launchName, + String keyPart, boolean system); - /** - * Retrieves test item attribute values by project id, specified key and part of value. - * Used for autocompletion functionality - * - * @param projectId Id of {@link com.epam.ta.reportportal.entity.project.Project} which items' attribute values should be found - * @param launchName {@link Launch#getName()} which items' attributes should be found - * @param key Specified key - * @param valuePart Part of value - * @return List of matched attribute values - */ - List findTestItemValuesByProjectIdAndLaunchName(Long projectId, String launchName, String key, String valuePart, - boolean system); + /** + * Retrieves test item attribute values by project id, specified key and part of value. Used for + * autocompletion functionality + * + * @param projectId Id of {@link com.epam.ta.reportportal.entity.project.Project} which items' + * attribute values should be found + * @param launchName {@link Launch#getName()} which items' attributes should be found + * @param key Specified key + * @param valuePart Part of value + * @return List of matched attribute values + */ + List findTestItemValuesByProjectIdAndLaunchName(Long projectId, String launchName, + String key, String valuePart, + boolean system); - /** - * Save item attribute by {@link com.epam.ta.reportportal.entity.item.TestItem#itemId} - * - * @param itemId {@link ItemAttribute#testItem} ID - * @param key {@link ItemAttribute#key} - * @param value {@link ItemAttribute#value} - * @param isSystem {@link ItemAttribute#system} - * @return 1 if inserted, otherwise 0 - */ - int saveByItemId(Long itemId, String key, String value, boolean isSystem); + /** + * Save item attribute by {@link com.epam.ta.reportportal.entity.item.TestItem#itemId} + * + * @param itemId {@link ItemAttribute#testItem} ID + * @param key {@link ItemAttribute#key} + * @param value {@link ItemAttribute#value} + * @param isSystem {@link ItemAttribute#system} + * @return 1 if inserted, otherwise 0 + */ + int saveByItemId(Long itemId, String key, String value, boolean isSystem); - /** - * Save item attribute by {@link Launch#getId()} - * - * @return 1 if inserted, otherwise 0 - */ - int saveByLaunchId(Long launchId, String key, String value, boolean isSystem); + /** + * Save item attribute by {@link Launch#getId()} + * + * @return 1 if inserted, otherwise 0 + */ + int saveByLaunchId(Long launchId, String key, String value, boolean isSystem); - /** - * Method for batch inserting of the {@link ItemAttribute}. Used for performance improvement - * - * @param itemAttributes The {@link List} of the {@link ItemAttributePojo} - * @return Number of inserted records - */ - int saveMultiple(List itemAttributes); + /** + * Method for batch inserting of the {@link ItemAttribute}. Used for performance improvement + * + * @param itemAttributes The {@link List} of the {@link ItemAttributePojo} + * @return Number of inserted records + */ + int saveMultiple(List itemAttributes); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryCustomImpl.java index 8aeda1a4b..0e352c7c9 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryCustomImpl.java @@ -16,194 +16,217 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.KEY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.LAUNCHES; +import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; +import static com.epam.ta.reportportal.jooq.Tables.ITEM_ATTRIBUTE; +import static com.epam.ta.reportportal.jooq.Tables.LAUNCH; +import static com.epam.ta.reportportal.jooq.Tables.PROJECT; +import static com.epam.ta.reportportal.jooq.Tables.TEST_ITEM; +import static org.jooq.impl.DSL.not; + import com.epam.ta.reportportal.commons.querygen.Queryable; import com.epam.ta.reportportal.dao.util.QueryUtils; import com.epam.ta.reportportal.entity.item.ItemAttributePojo; import com.epam.ta.reportportal.jooq.tables.records.JItemAttributeRecord; -import org.jooq.*; +import java.util.List; +import org.jooq.Condition; +import org.jooq.DSLContext; +import org.jooq.InsertValuesStep4; +import org.jooq.Record; +import org.jooq.TableField; import org.jooq.impl.DSL; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Repository; -import java.util.List; - -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; -import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; -import static com.epam.ta.reportportal.jooq.Tables.*; -import static org.jooq.impl.DSL.not; - /** * @author Ihar Kahadouski */ @Repository public class ItemAttributeRepositoryCustomImpl implements ItemAttributeRepositoryCustom { - public static final Integer ATTRIBUTES_LIMIT = 50; - - private final DSLContext dslContext; - - @Autowired - public ItemAttributeRepositoryCustomImpl(DSLContext dslContext) { - this.dslContext = dslContext; - } - - @Override - public List findAllKeysByLaunchFilter(Queryable launchFilter, Pageable launchPageable, boolean isLatest, String keyPart, - boolean isSystem) { - - return dslContext.select(fieldName(KEY)) - .from(dslContext.with(LAUNCHES) - .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(launchFilter, launchPageable.getSort(), isLatest) - .with(launchPageable) - .build()) - .selectDistinct(ITEM_ATTRIBUTE.KEY) - .from(ITEM_ATTRIBUTE) - .join(TEST_ITEM) - .on(ITEM_ATTRIBUTE.ITEM_ID.eq(TEST_ITEM.ITEM_ID) - .and(TEST_ITEM.HAS_STATS) - .and(TEST_ITEM.HAS_CHILDREN.isFalse()) - .and(TEST_ITEM.RETRY_OF.isNull())) - .join(LAUNCHES) - .on(TEST_ITEM.LAUNCH_ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .where(ITEM_ATTRIBUTE.SYSTEM.isFalse()) - .and(ITEM_ATTRIBUTE.KEY.likeIgnoreCase(DSL.val("%" + DSL.escape(keyPart, '\\') + "%"))) - .unionAll(dslContext.selectDistinct(ITEM_ATTRIBUTE.KEY) - .from(ITEM_ATTRIBUTE) - .join(LAUNCHES) - .on(ITEM_ATTRIBUTE.LAUNCH_ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .where(ITEM_ATTRIBUTE.SYSTEM.isFalse()) - .and(ITEM_ATTRIBUTE.KEY.likeIgnoreCase(DSL.val("%" + DSL.escape(keyPart, '\\') + "%"))))) - .groupBy(fieldName(KEY)) - .orderBy(DSL.length(fieldName(KEY).cast(String.class))) - .limit(ATTRIBUTES_LIMIT) - .fetchInto(String.class); - } - - @Override - public List findLaunchAttributeKeys(Long projectId, String value, boolean system) { - return dslContext.selectDistinct(ITEM_ATTRIBUTE.KEY) - .from(ITEM_ATTRIBUTE) - .leftJoin(LAUNCH) - .on(ITEM_ATTRIBUTE.LAUNCH_ID.eq(LAUNCH.ID)) - .leftJoin(PROJECT) - .on(LAUNCH.PROJECT_ID.eq(PROJECT.ID)) - .where(PROJECT.ID.eq(projectId)) - .and(ITEM_ATTRIBUTE.SYSTEM.eq(system)) - .and(ITEM_ATTRIBUTE.KEY.likeIgnoreCase("%" + DSL.escape(value, '\\') + "%")) - .fetch(ITEM_ATTRIBUTE.KEY); - } - - @Override - public List findLaunchAttributeValues(Long projectId, String key, String value, boolean system) { - Condition condition = prepareFetchingValuesCondition(PROJECT.ID, projectId, key, value, system); - return dslContext.selectDistinct(ITEM_ATTRIBUTE.VALUE) - .from(ITEM_ATTRIBUTE) - .leftJoin(LAUNCH) - .on(ITEM_ATTRIBUTE.LAUNCH_ID.eq(LAUNCH.ID)) - .leftJoin(PROJECT) - .on(LAUNCH.PROJECT_ID.eq(PROJECT.ID)) - .where(condition) - .fetch(ITEM_ATTRIBUTE.VALUE); - } - - @Override - public List findTestItemAttributeKeys(Long launchId, String value, boolean system) { - return dslContext.selectDistinct(ITEM_ATTRIBUTE.KEY) - .from(ITEM_ATTRIBUTE) - .leftJoin(TEST_ITEM) - .on(ITEM_ATTRIBUTE.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) - .leftJoin(LAUNCH) - .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) - .where(LAUNCH.ID.eq(launchId)) - .and(ITEM_ATTRIBUTE.SYSTEM.eq(system)) - .and(ITEM_ATTRIBUTE.KEY.likeIgnoreCase("%" + DSL.escape(value, '\\') + "%")) - .fetch(ITEM_ATTRIBUTE.KEY); - } - - @Override - public List findTestItemAttributeValues(Long launchId, String key, String value, boolean system) { - Condition condition = prepareFetchingValuesCondition(LAUNCH.ID, launchId, key, value, system); - return dslContext.selectDistinct(ITEM_ATTRIBUTE.VALUE) - .from(ITEM_ATTRIBUTE) - .leftJoin(TEST_ITEM) - .on(ITEM_ATTRIBUTE.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) - .leftJoin(LAUNCH) - .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) - .where(condition) - .fetch(ITEM_ATTRIBUTE.VALUE); - } - - @Override - public List findTestItemKeysByProjectIdAndLaunchName(Long projectId, String launchName, String keyPart, boolean system) { - return dslContext.selectDistinct(ITEM_ATTRIBUTE.KEY) - .from(ITEM_ATTRIBUTE) - .join(TEST_ITEM) - .on(ITEM_ATTRIBUTE.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) - .join(LAUNCH) - .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) - .where(LAUNCH.PROJECT_ID.eq(projectId)) - .and(LAUNCH.NAME.eq(launchName)) - .and(TEST_ITEM.HAS_STATS) - .and(not(TEST_ITEM.HAS_CHILDREN)) - .and(ITEM_ATTRIBUTE.SYSTEM.eq(system)) - .and(ITEM_ATTRIBUTE.KEY.likeIgnoreCase("%" + DSL.escape(keyPart, '\\') + "%")) - .fetch(ITEM_ATTRIBUTE.KEY); - } - - @Override - public List findTestItemValuesByProjectIdAndLaunchName(Long projectId, String launchName, String key, String valuePart, - boolean system) { - Condition condition = prepareFetchingValuesCondition(LAUNCH.PROJECT_ID, projectId, key, valuePart, system); - return dslContext.selectDistinct(ITEM_ATTRIBUTE.VALUE) - .from(ITEM_ATTRIBUTE) - .join(TEST_ITEM) - .on(ITEM_ATTRIBUTE.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) - .join(LAUNCH) - .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) - .where(condition) - .and(LAUNCH.NAME.eq(launchName)) - .and(TEST_ITEM.HAS_STATS) - .and(not(TEST_ITEM.HAS_CHILDREN)) - .fetch(ITEM_ATTRIBUTE.VALUE); - } - - @Override - public int saveByItemId(Long itemId, String key, String value, boolean isSystem) { - return dslContext.insertInto(ITEM_ATTRIBUTE) - .columns(ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE, ITEM_ATTRIBUTE.ITEM_ID, ITEM_ATTRIBUTE.SYSTEM) - .values(key, value, itemId, isSystem) - .execute(); - } - - @Override - public int saveByLaunchId(Long launchId, String key, String value, boolean isSystem) { - return dslContext.insertInto(ITEM_ATTRIBUTE) - .columns(ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE, ITEM_ATTRIBUTE.LAUNCH_ID, ITEM_ATTRIBUTE.SYSTEM) - .values(key, value, launchId, isSystem) - .execute(); - } - - @Override - public int saveMultiple(List itemAttributes) { - - InsertValuesStep4 columns = dslContext.insertInto(ITEM_ATTRIBUTE) - .columns(ITEM_ATTRIBUTE.ITEM_ID, ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE, ITEM_ATTRIBUTE.SYSTEM); - - itemAttributes.forEach(pojo -> columns.values(pojo.getItemId(), pojo.getKey(), pojo.getValue(), pojo.isSystem())); - - return columns.execute(); - } - - private Condition prepareFetchingValuesCondition(TableField field, Long id, String key, String value, - boolean system) { - Condition condition = field.eq(id) - .and(ITEM_ATTRIBUTE.SYSTEM.eq(system)) - .and(ITEM_ATTRIBUTE.VALUE.likeIgnoreCase("%" + (value == null ? "" : DSL.escape(value, '\\') + "%"))); - if (key != null) { - condition = condition.and(ITEM_ATTRIBUTE.KEY.eq(key)); - } - return condition; - } + public static final Integer ATTRIBUTES_LIMIT = 50; + + private final DSLContext dslContext; + + @Autowired + public ItemAttributeRepositoryCustomImpl(DSLContext dslContext) { + this.dslContext = dslContext; + } + + @Override + public List findAllKeysByLaunchFilter(Queryable launchFilter, Pageable launchPageable, + boolean isLatest, String keyPart, + boolean isSystem) { + + return dslContext.select(fieldName(KEY)) + .from(dslContext.with(LAUNCHES) + .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(launchFilter, + launchPageable.getSort(), isLatest) + .with(launchPageable) + .build()) + .selectDistinct(ITEM_ATTRIBUTE.KEY) + .from(ITEM_ATTRIBUTE) + .join(TEST_ITEM) + .on(ITEM_ATTRIBUTE.ITEM_ID.eq(TEST_ITEM.ITEM_ID) + .and(TEST_ITEM.HAS_STATS) + .and(TEST_ITEM.HAS_CHILDREN.isFalse()) + .and(TEST_ITEM.RETRY_OF.isNull())) + .join(LAUNCHES) + .on(TEST_ITEM.LAUNCH_ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .where(ITEM_ATTRIBUTE.SYSTEM.isFalse()) + .and(ITEM_ATTRIBUTE.KEY.likeIgnoreCase(DSL.val("%" + DSL.escape(keyPart, '\\') + "%"))) + .unionAll(dslContext.selectDistinct(ITEM_ATTRIBUTE.KEY) + .from(ITEM_ATTRIBUTE) + .join(LAUNCHES) + .on(ITEM_ATTRIBUTE.LAUNCH_ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .where(ITEM_ATTRIBUTE.SYSTEM.isFalse()) + .and(ITEM_ATTRIBUTE.KEY.likeIgnoreCase( + DSL.val("%" + DSL.escape(keyPart, '\\') + "%"))))) + .groupBy(fieldName(KEY)) + .orderBy(DSL.length(fieldName(KEY).cast(String.class))) + .limit(ATTRIBUTES_LIMIT) + .fetchInto(String.class); + } + + @Override + public List findLaunchAttributeKeys(Long projectId, String value, boolean system) { + return dslContext.selectDistinct(ITEM_ATTRIBUTE.KEY) + .from(ITEM_ATTRIBUTE) + .leftJoin(LAUNCH) + .on(ITEM_ATTRIBUTE.LAUNCH_ID.eq(LAUNCH.ID)) + .leftJoin(PROJECT) + .on(LAUNCH.PROJECT_ID.eq(PROJECT.ID)) + .where(PROJECT.ID.eq(projectId)) + .and(ITEM_ATTRIBUTE.SYSTEM.eq(system)) + .and(ITEM_ATTRIBUTE.KEY.likeIgnoreCase("%" + DSL.escape(value, '\\') + "%")) + .fetch(ITEM_ATTRIBUTE.KEY); + } + + @Override + public List findLaunchAttributeValues(Long projectId, String key, String value, + boolean system) { + Condition condition = prepareFetchingValuesCondition(PROJECT.ID, projectId, key, value, system); + return dslContext.selectDistinct(ITEM_ATTRIBUTE.VALUE) + .from(ITEM_ATTRIBUTE) + .leftJoin(LAUNCH) + .on(ITEM_ATTRIBUTE.LAUNCH_ID.eq(LAUNCH.ID)) + .leftJoin(PROJECT) + .on(LAUNCH.PROJECT_ID.eq(PROJECT.ID)) + .where(condition) + .fetch(ITEM_ATTRIBUTE.VALUE); + } + + @Override + public List findTestItemAttributeKeys(Long launchId, String value, boolean system) { + return dslContext.selectDistinct(ITEM_ATTRIBUTE.KEY) + .from(ITEM_ATTRIBUTE) + .leftJoin(TEST_ITEM) + .on(ITEM_ATTRIBUTE.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) + .leftJoin(LAUNCH) + .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) + .where(LAUNCH.ID.eq(launchId)) + .and(ITEM_ATTRIBUTE.SYSTEM.eq(system)) + .and(ITEM_ATTRIBUTE.KEY.likeIgnoreCase("%" + DSL.escape(value, '\\') + "%")) + .fetch(ITEM_ATTRIBUTE.KEY); + } + + @Override + public List findTestItemAttributeValues(Long launchId, String key, String value, + boolean system) { + Condition condition = prepareFetchingValuesCondition(LAUNCH.ID, launchId, key, value, system); + return dslContext.selectDistinct(ITEM_ATTRIBUTE.VALUE) + .from(ITEM_ATTRIBUTE) + .leftJoin(TEST_ITEM) + .on(ITEM_ATTRIBUTE.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) + .leftJoin(LAUNCH) + .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) + .where(condition) + .fetch(ITEM_ATTRIBUTE.VALUE); + } + + @Override + public List findTestItemKeysByProjectIdAndLaunchName(Long projectId, String launchName, + String keyPart, boolean system) { + return dslContext.selectDistinct(ITEM_ATTRIBUTE.KEY) + .from(ITEM_ATTRIBUTE) + .join(TEST_ITEM) + .on(ITEM_ATTRIBUTE.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) + .join(LAUNCH) + .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) + .where(LAUNCH.PROJECT_ID.eq(projectId)) + .and(LAUNCH.NAME.eq(launchName)) + .and(TEST_ITEM.HAS_STATS) + .and(not(TEST_ITEM.HAS_CHILDREN)) + .and(ITEM_ATTRIBUTE.SYSTEM.eq(system)) + .and(ITEM_ATTRIBUTE.KEY.likeIgnoreCase("%" + DSL.escape(keyPart, '\\') + "%")) + .fetch(ITEM_ATTRIBUTE.KEY); + } + + @Override + public List findTestItemValuesByProjectIdAndLaunchName(Long projectId, String launchName, + String key, String valuePart, + boolean system) { + Condition condition = prepareFetchingValuesCondition(LAUNCH.PROJECT_ID, projectId, key, + valuePart, system); + return dslContext.selectDistinct(ITEM_ATTRIBUTE.VALUE) + .from(ITEM_ATTRIBUTE) + .join(TEST_ITEM) + .on(ITEM_ATTRIBUTE.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) + .join(LAUNCH) + .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) + .where(condition) + .and(LAUNCH.NAME.eq(launchName)) + .and(TEST_ITEM.HAS_STATS) + .and(not(TEST_ITEM.HAS_CHILDREN)) + .fetch(ITEM_ATTRIBUTE.VALUE); + } + + @Override + public int saveByItemId(Long itemId, String key, String value, boolean isSystem) { + return dslContext.insertInto(ITEM_ATTRIBUTE) + .columns(ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE, ITEM_ATTRIBUTE.ITEM_ID, + ITEM_ATTRIBUTE.SYSTEM) + .values(key, value, itemId, isSystem) + .execute(); + } + + @Override + public int saveByLaunchId(Long launchId, String key, String value, boolean isSystem) { + return dslContext.insertInto(ITEM_ATTRIBUTE) + .columns(ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE, ITEM_ATTRIBUTE.LAUNCH_ID, + ITEM_ATTRIBUTE.SYSTEM) + .values(key, value, launchId, isSystem) + .execute(); + } + + @Override + public int saveMultiple(List itemAttributes) { + + InsertValuesStep4 columns = dslContext.insertInto( + ITEM_ATTRIBUTE) + .columns(ITEM_ATTRIBUTE.ITEM_ID, ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE, + ITEM_ATTRIBUTE.SYSTEM); + + itemAttributes.forEach( + pojo -> columns.values(pojo.getItemId(), pojo.getKey(), pojo.getValue(), pojo.isSystem())); + + return columns.execute(); + } + + private Condition prepareFetchingValuesCondition(TableField field, + Long id, String key, String value, + boolean system) { + Condition condition = field.eq(id) + .and(ITEM_ATTRIBUTE.SYSTEM.eq(system)) + .and(ITEM_ATTRIBUTE.VALUE.likeIgnoreCase( + "%" + (value == null ? "" : DSL.escape(value, '\\') + "%"))); + if (key != null) { + condition = condition.and(ITEM_ATTRIBUTE.KEY.eq(key)); + } + return condition; + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepository.java b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepository.java index 8a7d08b64..55c2bfcb6 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepository.java @@ -16,124 +16,142 @@ package com.epam.ta.reportportal.dao; +import static org.hibernate.jpa.QueryHints.HINT_FETCH_SIZE; + import com.epam.ta.reportportal.entity.enums.LaunchModeEnum; import com.epam.ta.reportportal.entity.enums.StatusEnum; import com.epam.ta.reportportal.entity.item.TestItem; import com.epam.ta.reportportal.entity.item.TestItemResults; import com.epam.ta.reportportal.entity.launch.Launch; import com.epam.ta.reportportal.entity.project.Project; -import org.springframework.data.jpa.repository.Lock; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.jpa.repository.QueryHints; -import org.springframework.data.repository.query.Param; - -import javax.persistence.LockModeType; -import javax.persistence.QueryHint; import java.time.LocalDateTime; import java.util.Collection; import java.util.List; import java.util.Optional; import java.util.stream.Stream; - -import static org.hibernate.jpa.QueryHints.HINT_FETCH_SIZE; +import javax.persistence.LockModeType; +import javax.persistence.QueryHint; +import org.springframework.data.jpa.repository.Lock; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.jpa.repository.QueryHints; +import org.springframework.data.repository.query.Param; /** * @author Pavel Bortnik */ -public interface LaunchRepository extends ReportPortalRepository, LaunchRepositoryCustom { - - /** - * Finds launch by {@link Launch#id} and sets a lock on the found launch row in the database. - * Required for fetching launch from the concurrent environment to provide synchronization between dependant entities - * - * @param id {@link Launch#id} - * @return {@link Optional} with {@link Launch} object - */ - @Query(value = "SELECT l FROM Launch l WHERE l.id = :id") - @Lock(value = LockModeType.PESSIMISTIC_WRITE) - Optional findByIdForUpdate(@Param("id") Long id); - - void deleteByProjectId(Long projectId); - - List findAllByName(String name); - - Optional findByUuid(String uuid); - - /** - * Finds launch by {@link Launch#getUuid()} and sets a lock on the found launch row in the database. - * Required for fetching launch from the concurrent environment to provide synchronization between dependant entities - * - * @param uuid {@link Launch#getUuid()} - * @return {@link Optional} with {@link Launch} object - */ - @Query(value = "SELECT l FROM Launch l WHERE l.uuid = :uuid") - @Lock(value = LockModeType.PESSIMISTIC_WRITE) - Optional findByUuidForUpdate(@Param("uuid") String uuid); - - List findByProjectIdAndStartTimeGreaterThanAndMode(Long projectId, LocalDateTime after, LaunchModeEnum mode); - - @Query(value = "SELECT l.id FROM Launch l WHERE l.project_id = :projectId AND l.start_time < :before ORDER BY l.id LIMIT :size", nativeQuery = true) - List findIdsByProjectIdAndStartTimeBefore(@Param("projectId") Long projectId, @Param("before") LocalDateTime before, @Param("size") int limit); - - @Query(value = "SELECT l.id FROM Launch l WHERE l.project_id = :projectId AND l.start_time < :before ORDER BY l.id LIMIT :pageSize OFFSET :pageOffset", nativeQuery = true) - List findIdsByProjectIdAndStartTimeBefore(@Param("projectId") Long projectId, @Param("before") LocalDateTime before, @Param("pageSize") int limit, @Param("pageOffset") long offset); - - int deleteAllByIdIn(Collection ids); - - @QueryHints(value = @QueryHint(name = HINT_FETCH_SIZE, value = "1")) - @Query(value = "SELECT l.id FROM Launch l WHERE l.projectId = :projectId AND l.startTime < :before") - Stream streamIdsByStartTimeBefore(@Param("projectId") Long projectId, @Param("before") LocalDateTime before); - - @QueryHints(value = @QueryHint(name = HINT_FETCH_SIZE, value = "1")) - @Query(value = "SELECT l.id FROM Launch l WHERE l.status = :status AND l.projectId = :projectId AND l.startTime < :before") - Stream streamIdsWithStatusAndStartTimeBefore(@Param("projectId") Long projectId, @Param("status") StatusEnum status, - @Param("before") LocalDateTime before); - - @Query(value = "SELECT * FROM launch l WHERE l.id <= :startingLaunchId AND l.name = :launchName " - + "AND l.project_id = :projectId AND l.mode <> 'DEBUG' ORDER BY start_time DESC, number DESC LIMIT :historyDepth", nativeQuery = true) - List findLaunchesHistory(@Param("historyDepth") int historyDepth, @Param("startingLaunchId") Long startingLaunchId, - @Param("launchName") String launchName, @Param("projectId") Long projectId); - - @Query(value = "SELECT merge_launch(?1)", nativeQuery = true) - void mergeLaunchTestItems(Long launchId); - - /** - * Checks if a {@link Launch} has items with retries. - * - * @param launchId Current {@link Launch#id} - * @return True if has - */ - @Query(value = "SELECT exists(SELECT 1 FROM launch JOIN test_item ON launch.id = test_item.launch_id " - + "WHERE launch.id = :launchId AND test_item.has_retries LIMIT 1)", nativeQuery = true) - boolean hasRetries(@Param("launchId") Long launchId); - - /** - * @param launchId {@link Launch#getId()} - * @param status {@link TestItemResults#getStatus()} - * @return `true` if {@link TestItem#getLaunchId()} equal to provided `launchId`, {@link TestItem#getParent()} equal to `NULL` - * and {@link TestItemResults#getStatus()} is not equal to provided `status`, otherwise return `false` - */ - @Query(value = "SELECT exists(SELECT 1 FROM test_item ti JOIN test_item_results tir ON ti.item_id = tir.result_id " - + " WHERE ti.launch_id = :launchId AND ti.parent_id IS NULL AND ti.has_stats = TRUE " - + " AND CAST(tir.status AS VARCHAR) NOT IN (:statuses))", nativeQuery = true) - boolean hasRootItemsWithStatusNotEqual(@Param("launchId") Long launchId, @Param("statuses") String... statuses); - - @Query(value = "SELECT exists(SELECT 1 FROM test_item ti JOIN test_item_results tir ON ti.item_id = tir.result_id " - + " WHERE ti.launch_id = :launchId AND ti.has_stats = TRUE AND tir.status = cast(:#{#status.name()} AS STATUS_ENUM) LIMIT 1)", nativeQuery = true) - boolean hasItemsWithStatusEqual(@Param("launchId") Long launchId, @Param("status") StatusEnum status); - - @Query(value = "SELECT exists(SELECT 1 FROM test_item ti WHERE ti.launch_id = :launchId LIMIT 1)", nativeQuery = true) - boolean hasItems(@Param("launchId") Long launchId); - - /** - * Finds the latest(that has max {@link Launch#number} {@link Launch} with specified {@code name} and {@code projectId} - * - * @param name Name of {@link Launch} - * @param projectId Id of {@link Project} - * @return {@link Optional} if exists, {@link Optional#empty()} if not - */ - @Query(value = "SELECT * FROM launch l WHERE l.name =:name AND l.project_id=:projectId ORDER BY l.number DESC LIMIT 1", nativeQuery = true) - Optional findLatestByNameAndProjectId(@Param("name") String name, @Param("projectId") Long projectId); - - Optional findLaunchByProjectIdAndNameAndNumberAndIdNotAndModeNot(Long projectId, String name, Long number, Long launchId, LaunchModeEnum mode); +public interface LaunchRepository extends ReportPortalRepository, + LaunchRepositoryCustom { + + /** + * Finds launch by {@link Launch#id} and sets a lock on the found launch row in the database. + * Required for fetching launch from the concurrent environment to provide synchronization between + * dependant entities + * + * @param id {@link Launch#id} + * @return {@link Optional} with {@link Launch} object + */ + @Query(value = "SELECT l FROM Launch l WHERE l.id = :id") + @Lock(value = LockModeType.PESSIMISTIC_WRITE) + Optional findByIdForUpdate(@Param("id") Long id); + + void deleteByProjectId(Long projectId); + + List findAllByName(String name); + + Optional findByUuid(String uuid); + + /** + * Finds launch by {@link Launch#getUuid()} and sets a lock on the found launch row in the + * database. Required for fetching launch from the concurrent environment to provide + * synchronization between dependant entities + * + * @param uuid {@link Launch#getUuid()} + * @return {@link Optional} with {@link Launch} object + */ + @Query(value = "SELECT l FROM Launch l WHERE l.uuid = :uuid") + @Lock(value = LockModeType.PESSIMISTIC_WRITE) + Optional findByUuidForUpdate(@Param("uuid") String uuid); + + List findByProjectIdAndStartTimeGreaterThanAndMode(Long projectId, LocalDateTime after, + LaunchModeEnum mode); + + @Query(value = "SELECT l.id FROM Launch l WHERE l.project_id = :projectId AND l.start_time < :before ORDER BY l.id LIMIT :size", nativeQuery = true) + List findIdsByProjectIdAndStartTimeBefore(@Param("projectId") Long projectId, + @Param("before") LocalDateTime before, @Param("size") int limit); + + @Query(value = "SELECT l.id FROM Launch l WHERE l.project_id = :projectId AND l.start_time < :before ORDER BY l.id LIMIT :pageSize OFFSET :pageOffset", nativeQuery = true) + List findIdsByProjectIdAndStartTimeBefore(@Param("projectId") Long projectId, + @Param("before") LocalDateTime before, @Param("pageSize") int limit, + @Param("pageOffset") long offset); + + int deleteAllByIdIn(Collection ids); + + @QueryHints(value = @QueryHint(name = HINT_FETCH_SIZE, value = "1")) + @Query(value = "SELECT l.id FROM Launch l WHERE l.projectId = :projectId AND l.startTime < :before") + Stream streamIdsByStartTimeBefore(@Param("projectId") Long projectId, + @Param("before") LocalDateTime before); + + @QueryHints(value = @QueryHint(name = HINT_FETCH_SIZE, value = "1")) + @Query(value = "SELECT l.id FROM Launch l WHERE l.status = :status AND l.projectId = :projectId AND l.startTime < :before") + Stream streamIdsWithStatusAndStartTimeBefore(@Param("projectId") Long projectId, + @Param("status") StatusEnum status, + @Param("before") LocalDateTime before); + + @Query(value = "SELECT * FROM launch l WHERE l.id <= :startingLaunchId AND l.name = :launchName " + + "AND l.project_id = :projectId AND l.mode <> 'DEBUG' ORDER BY start_time DESC, number DESC LIMIT :historyDepth", nativeQuery = true) + List findLaunchesHistory(@Param("historyDepth") int historyDepth, + @Param("startingLaunchId") Long startingLaunchId, + @Param("launchName") String launchName, @Param("projectId") Long projectId); + + @Query(value = "SELECT merge_launch(?1)", nativeQuery = true) + void mergeLaunchTestItems(Long launchId); + + /** + * Checks if a {@link Launch} has items with retries. + * + * @param launchId Current {@link Launch#id} + * @return True if has + */ + @Query(value = + "SELECT exists(SELECT 1 FROM launch JOIN test_item ON launch.id = test_item.launch_id " + + "WHERE launch.id = :launchId AND test_item.has_retries LIMIT 1)", nativeQuery = true) + boolean hasRetries(@Param("launchId") Long launchId); + + /** + * @param launchId {@link Launch#getId()} + * @param status {@link TestItemResults#getStatus()} + * @return `true` if {@link TestItem#getLaunchId()} equal to provided `launchId`, + * {@link TestItem#getParent()} equal to `NULL` and {@link TestItemResults#getStatus()} is not + * equal to provided `status`, otherwise return `false` + */ + @Query(value = + "SELECT exists(SELECT 1 FROM test_item ti JOIN test_item_results tir ON ti.item_id = tir.result_id " + + " WHERE ti.launch_id = :launchId AND ti.parent_id IS NULL AND ti.has_stats = TRUE " + + " AND CAST(tir.status AS VARCHAR) NOT IN (:statuses))", nativeQuery = true) + boolean hasRootItemsWithStatusNotEqual(@Param("launchId") Long launchId, + @Param("statuses") String... statuses); + + @Query(value = + "SELECT exists(SELECT 1 FROM test_item ti JOIN test_item_results tir ON ti.item_id = tir.result_id " + + " WHERE ti.launch_id = :launchId AND ti.has_stats = TRUE AND tir.status = cast(:#{#status.name()} AS STATUS_ENUM) LIMIT 1)", nativeQuery = true) + boolean hasItemsWithStatusEqual(@Param("launchId") Long launchId, + @Param("status") StatusEnum status); + + @Query(value = "SELECT exists(SELECT 1 FROM test_item ti WHERE ti.launch_id = :launchId LIMIT 1)", nativeQuery = true) + boolean hasItems(@Param("launchId") Long launchId); + + /** + * Finds the latest(that has max {@link Launch#number} {@link Launch} with specified {@code name} + * and {@code projectId} + * + * @param name Name of {@link Launch} + * @param projectId Id of {@link Project} + * @return {@link Optional} if exists, {@link Optional#empty()} if not + */ + @Query(value = "SELECT * FROM launch l WHERE l.name =:name AND l.project_id=:projectId ORDER BY l.number DESC LIMIT 1", nativeQuery = true) + Optional findLatestByNameAndProjectId(@Param("name") String name, + @Param("projectId") Long projectId); + + Optional findLaunchByProjectIdAndNameAndNumberAndIdNotAndModeNot(Long projectId, + String name, Long number, Long launchId, LaunchModeEnum mode); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustom.java index d240e7e71..6619164ff 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustom.java @@ -25,98 +25,101 @@ import com.epam.ta.reportportal.jooq.enums.JStatusEnum; import com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum; import com.epam.ta.reportportal.ws.model.analyzer.IndexLaunch; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; - import java.time.LocalDateTime; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Optional; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; /** * @author Pavel Bortnik */ public interface LaunchRepositoryCustom extends FilterableRepository { - boolean hasItemsInStatuses(Long launchId, List statuses); - - /** - * Retrieves names of the launches by provided 'projectId', 'mode', 'value' as a part of the name - * and statuses that are not equal to the provided 'status' - * - * @param projectId {@link Launch#projectId} - * @param value A part of the {@link Launch#name} - * @param mode {@link Launch#mode} - * @param status {@link Launch#status} - * @return The {@link List} of the {@link Launch#name} - */ - List getLaunchNamesByModeExcludedByStatus(Long projectId, String value, LaunchModeEnum mode, StatusEnum status); - - List getOwnerNames(Long projectId, String value, String mode); - - Map getStatuses(Long projectId, Long[] ids); - - Optional findLatestByFilter(Filter filter); - - Page findAllLatestByFilter(Queryable filter, Pageable pageable); - - /** - * Finds launch ids of project with provided id - * - * @param projectId - Project id - * @return List of ids - */ - List findLaunchIdsByProjectId(Long projectId); - - /** - * Finds the last valid launch in project - * - * @param projectId Project id - * @param mode Launch mode - * @return {@link Optional} of {@link Launch} - */ - Optional findLastRun(Long projectId, String mode); - - /** - * Counts launches with mode for specified project from provided date - * - * @param projectId Project id - * @param mode Launch mode - * @param fromDate From Date to count - * @return Launches count - */ - Integer countLaunches(Long projectId, String mode, LocalDateTime fromDate); - - /** - * Counts launches with mode for specified project - * - * @param projectId {@link Launch#projectId} - * @param mode {@link Launch#mode} - * @return Launches count - */ - Integer countLaunches(Long projectId, String mode); - - /** - * Counts quantity of launches with mode per user for specified project. - * - * @param projectId Project id - * @param mode Launch mode - * @param from From Date to count - * @return Map of username and launches count - */ - Map countLaunchesGroupedByOwner(Long projectId, String mode, LocalDateTime from); - - List findIdsByProjectIdAndModeAndStatusNotEq(Long projectId, JLaunchModeEnum mode, JStatusEnum status, int limit); - - List findIdsByProjectIdAndModeAndStatusNotEqAfterId(Long projectId, JLaunchModeEnum mode, JStatusEnum status, Long launchId, - int limit); - - boolean hasItemsWithLogsWithLogLevel(Long launchId, Collection itemTypes, Integer logLevel); - - List findIndexLaunchByIds(List ids); - - Optional findPreviousLaunchByProjectIdAndNameAndAttributesForLaunchIdAndModeNot( - Long projectId, String name, String[] attributes, Long launchId, JLaunchModeEnum mode - ); + boolean hasItemsInStatuses(Long launchId, List statuses); + + /** + * Retrieves names of the launches by provided 'projectId', 'mode', 'value' as a part of the name + * and statuses that are not equal to the provided 'status' + * + * @param projectId {@link Launch#projectId} + * @param value A part of the {@link Launch#name} + * @param mode {@link Launch#mode} + * @param status {@link Launch#status} + * @return The {@link List} of the {@link Launch#name} + */ + List getLaunchNamesByModeExcludedByStatus(Long projectId, String value, + LaunchModeEnum mode, StatusEnum status); + + List getOwnerNames(Long projectId, String value, String mode); + + Map getStatuses(Long projectId, Long[] ids); + + Optional findLatestByFilter(Filter filter); + + Page findAllLatestByFilter(Queryable filter, Pageable pageable); + + /** + * Finds launch ids of project with provided id + * + * @param projectId - Project id + * @return List of ids + */ + List findLaunchIdsByProjectId(Long projectId); + + /** + * Finds the last valid launch in project + * + * @param projectId Project id + * @param mode Launch mode + * @return {@link Optional} of {@link Launch} + */ + Optional findLastRun(Long projectId, String mode); + + /** + * Counts launches with mode for specified project from provided date + * + * @param projectId Project id + * @param mode Launch mode + * @param fromDate From Date to count + * @return Launches count + */ + Integer countLaunches(Long projectId, String mode, LocalDateTime fromDate); + + /** + * Counts launches with mode for specified project + * + * @param projectId {@link Launch#projectId} + * @param mode {@link Launch#mode} + * @return Launches count + */ + Integer countLaunches(Long projectId, String mode); + + /** + * Counts quantity of launches with mode per user for specified project. + * + * @param projectId Project id + * @param mode Launch mode + * @param from From Date to count + * @return Map of username and launches count + */ + Map countLaunchesGroupedByOwner(Long projectId, String mode, LocalDateTime from); + + List findIdsByProjectIdAndModeAndStatusNotEq(Long projectId, JLaunchModeEnum mode, + JStatusEnum status, int limit); + + List findIdsByProjectIdAndModeAndStatusNotEqAfterId(Long projectId, JLaunchModeEnum mode, + JStatusEnum status, Long launchId, + int limit); + + boolean hasItemsWithLogsWithLogLevel(Long launchId, Collection itemTypes, + Integer logLevel); + + List findIndexLaunchByIds(List ids); + + Optional findPreviousLaunchByProjectIdAndNameAndAttributesForLaunchIdAndModeNot( + Long projectId, String name, String[] attributes, Long launchId, JLaunchModeEnum mode + ); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java index bc5a5cf05..e94d9496a 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java @@ -16,7 +16,37 @@ package com.epam.ta.reportportal.dao; -import com.epam.ta.reportportal.commons.querygen.*; +import static com.epam.ta.reportportal.commons.querygen.FilterTarget.ATTRIBUTE_ALIAS; +import static com.epam.ta.reportportal.commons.querygen.FilterTarget.FILTERED_QUERY; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.KEY_VALUE_SEPARATOR; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.LAUNCHES; +import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; +import static com.epam.ta.reportportal.dao.util.RecordMappers.INDEX_LAUNCH_RECORD_MAPPER; +import static com.epam.ta.reportportal.dao.util.ResultFetchers.LAUNCH_FETCHER; +import static com.epam.ta.reportportal.jooq.Tables.ITEM_ATTRIBUTE; +import static com.epam.ta.reportportal.jooq.Tables.LAUNCH; +import static com.epam.ta.reportportal.jooq.Tables.LOG; +import static com.epam.ta.reportportal.jooq.Tables.PROJECT; +import static com.epam.ta.reportportal.jooq.Tables.STATISTICS; +import static com.epam.ta.reportportal.jooq.Tables.STATISTICS_FIELD; +import static com.epam.ta.reportportal.jooq.Tables.USERS; +import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; +import static com.epam.ta.reportportal.jooq.tables.JTestItemResults.TEST_ITEM_RESULTS; +import static java.util.Optional.ofNullable; +import static org.jooq.impl.DSL.arrayAgg; +import static org.jooq.impl.DSL.arrayAggDistinct; +import static org.jooq.impl.DSL.coalesce; +import static org.jooq.impl.DSL.concat; +import static org.jooq.impl.DSL.field; +import static org.jooq.impl.DSL.name; +import static org.jooq.impl.DSL.val; + +import com.epam.ta.reportportal.commons.querygen.ConvertibleCondition; +import com.epam.ta.reportportal.commons.querygen.Filter; +import com.epam.ta.reportportal.commons.querygen.FilterCondition; +import com.epam.ta.reportportal.commons.querygen.QueryBuilder; +import com.epam.ta.reportportal.commons.querygen.Queryable; import com.epam.ta.reportportal.dao.util.QueryUtils; import com.epam.ta.reportportal.entity.enums.LaunchModeEnum; import com.epam.ta.reportportal.entity.enums.StatusEnum; @@ -27,6 +57,15 @@ import com.epam.ta.reportportal.util.SortUtils; import com.epam.ta.reportportal.ws.model.analyzer.IndexLaunch; import com.google.common.collect.Lists; +import java.sql.Timestamp; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; import org.jooq.DSLContext; import org.jooq.Field; import org.jooq.SortField; @@ -38,331 +77,331 @@ import org.springframework.data.repository.support.PageableExecutionUtils; import org.springframework.stereotype.Repository; -import java.sql.Timestamp; -import java.time.LocalDateTime; -import java.util.*; -import java.util.stream.Collectors; - -import static com.epam.ta.reportportal.commons.querygen.FilterTarget.ATTRIBUTE_ALIAS; -import static com.epam.ta.reportportal.commons.querygen.FilterTarget.FILTERED_QUERY; -import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.KEY_VALUE_SEPARATOR; -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.LAUNCHES; -import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; -import static com.epam.ta.reportportal.dao.util.RecordMappers.INDEX_LAUNCH_RECORD_MAPPER; -import static com.epam.ta.reportportal.dao.util.ResultFetchers.LAUNCH_FETCHER; -import static com.epam.ta.reportportal.jooq.Tables.*; -import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; -import static com.epam.ta.reportportal.jooq.tables.JTestItemResults.TEST_ITEM_RESULTS; -import static java.util.Optional.ofNullable; -import static org.jooq.impl.DSL.*; - /** * @author Pavel Bortnik */ @Repository public class LaunchRepositoryCustomImpl implements LaunchRepositoryCustom { - @Autowired - private DSLContext dsl; - - @Override - public boolean hasItemsInStatuses(Long launchId, List statuses) { - return dsl.fetchExists(dsl.selectOne() - .from(TEST_ITEM) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .where(TEST_ITEM.LAUNCH_ID.eq(launchId).and(TEST_ITEM_RESULTS.STATUS.in(statuses)))); - } - - @Override - public List findByFilter(Queryable filter) { - return LAUNCH_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter, - filter.getFilterConditions() - .stream() - .map(ConvertibleCondition::getAllConditions) - .flatMap(Collection::stream) - .map(FilterCondition::getSearchCriteria) - .collect(Collectors.toSet()) - ).wrap().build())); - } - - @Override - public Page findByFilter(Queryable filter, Pageable pageable) { - Set fields = filter.getFilterConditions() - .stream() - .map(ConvertibleCondition::getAllConditions) - .flatMap(Collection::stream) - .map(FilterCondition::getSearchCriteria) - .collect(Collectors.toSet()); - fields.addAll(pageable.getSort().get().map(Sort.Order::getProperty).collect(Collectors.toSet())); - - return PageableExecutionUtils.getPage(LAUNCH_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter, fields) - .with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) - .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter, fields).build())); - } - - @Override - public List getLaunchNamesByModeExcludedByStatus(Long projectId, String value, LaunchModeEnum mode, StatusEnum status) { - return dsl.selectDistinct(LAUNCH.NAME) - .from(LAUNCH) - .leftJoin(PROJECT) - .on(LAUNCH.PROJECT_ID.eq(PROJECT.ID)) - .where(PROJECT.ID.eq(projectId)) - .and(LAUNCH.MODE.eq(JLaunchModeEnum.valueOf(mode.name()))) - .and(LAUNCH.STATUS.notEqual(JStatusEnum.valueOf(status.name()))) - .and(LAUNCH.NAME.likeIgnoreCase("%" + DSL.escape(value, '\\') + "%")) - .fetch(LAUNCH.NAME); - } - - @Override - public List getOwnerNames(Long projectId, String value, String mode) { - return dsl.selectDistinct(USERS.LOGIN) - .from(LAUNCH) - .leftJoin(PROJECT) - .on(LAUNCH.PROJECT_ID.eq(PROJECT.ID)) - .leftJoin(USERS) - .on(LAUNCH.USER_ID.eq(USERS.ID)) - .where(PROJECT.ID.eq(projectId)) - .and(USERS.LOGIN.likeIgnoreCase("%" + DSL.escape(value, '\\') + "%")) - .and(LAUNCH.MODE.eq(JLaunchModeEnum.valueOf(mode))) - .fetch(USERS.LOGIN); - } - - @Override - public Map getStatuses(Long projectId, Long[] ids) { - return dsl.select(LAUNCH.ID, LAUNCH.STATUS) - .from(LAUNCH) - .where(LAUNCH.PROJECT_ID.eq(projectId)) - .and(LAUNCH.ID.in(ids)) - .fetch() - .intoMap(record -> String.valueOf(record.component1()), record -> record.component2().getLiteral()); - } - - @Override - public Optional findLatestByFilter(Filter filter) { - return ofNullable(dsl.with(LAUNCHES) - .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(filter, Sort.unsorted(), true).build()) - .select() - .from(LAUNCH) - .join(LAUNCHES) - .on(field(name(LAUNCHES, ID), Long.class).eq(LAUNCH.ID)) - .orderBy(LAUNCH.NAME, LAUNCH.NUMBER.desc()) - .fetchOneInto(Launch.class)); - } - - @Override - public Page findAllLatestByFilter(Queryable filter, Pageable pageable) { - - List> sortFieldList = SortUtils.TO_SORT_FIELDS.apply(pageable.getSort(), filter.getTarget()); - List> simpleSelectedFields = getLaunchSimpleSelectedFields(); - - List> selectFields = new ArrayList<>(simpleSelectedFields); - selectFields.add(getAttributeConcatedFields()); - - List> groupFields = new ArrayList<>(simpleSelectedFields); - for (SortField sortField : sortFieldList) { - groupFields.add(DSL.field(sortField.getName())); - } - - return PageableExecutionUtils.getPage(LAUNCH_FETCHER.apply(dsl.with(FILTERED_QUERY) - .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(filter, pageable.getSort(), true).with(pageable).build()) - .select(selectFields) - .from(LAUNCH) - .join(FILTERED_QUERY) - .on(field(name(FILTERED_QUERY, ID), Long.class).eq(LAUNCH.ID)) - .leftJoin(STATISTICS) - .on(LAUNCH.ID.eq(STATISTICS.LAUNCH_ID)) - .leftJoin(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .leftJoin(ITEM_ATTRIBUTE) - .on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)) - .leftJoin(USERS) - .on(LAUNCH.USER_ID.eq(USERS.ID)) - .groupBy(groupFields) - .orderBy(sortFieldList) - .fetch()), - pageable, - () -> dsl.fetchCount(dsl.with(LAUNCHES) - .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(filter, pageable.getSort(), true).build()) - .selectOne() - .distinctOn(LAUNCH.NAME) - .from(LAUNCH) - .join(LAUNCHES) - .on(field(name(LAUNCHES, ID), Long.class).eq(LAUNCH.ID))) - ); - } - - private Field getAttributeConcatedFields() { - return DSL.arrayAgg(DSL.concat( - ITEM_ATTRIBUTE.KEY, DSL.val(":"), - ITEM_ATTRIBUTE.VALUE, DSL.val(":"), - ITEM_ATTRIBUTE.SYSTEM)).as(ATTRIBUTE_ALIAS); - } - - private ArrayList> getLaunchSimpleSelectedFields() { - return Lists.newArrayList(LAUNCH.ID, - LAUNCH.UUID, - LAUNCH.NAME, - LAUNCH.DESCRIPTION, - LAUNCH.START_TIME, - LAUNCH.END_TIME, - LAUNCH.PROJECT_ID, - LAUNCH.USER_ID, - LAUNCH.NUMBER, - LAUNCH.LAST_MODIFIED, - LAUNCH.MODE, - LAUNCH.STATUS, - LAUNCH.HAS_RETRIES, - LAUNCH.RERUN, - LAUNCH.APPROXIMATE_DURATION, - STATISTICS.S_COUNTER, - STATISTICS_FIELD.NAME, - USERS.ID, - USERS.LOGIN); - } - - @Override - public List findLaunchIdsByProjectId(Long projectId) { - return dsl.select(LAUNCH.ID).from(LAUNCH).where(LAUNCH.PROJECT_ID.eq(projectId)).fetchInto(Long.class); - } - - @Override - public Optional findLastRun(Long projectId, String mode) { - List> simpleSelectedFields = getLaunchSimpleSelectedFields(); - - List> selectFields = new ArrayList<>(simpleSelectedFields); - selectFields.add(getAttributeConcatedFields()); - - return LAUNCH_FETCHER.apply(dsl.fetch(dsl.with(FILTERED_QUERY) - .as(dsl.select(LAUNCH.ID) - .from(LAUNCH) - .where(LAUNCH.PROJECT_ID.eq(projectId) - .and(LAUNCH.MODE.eq(JLaunchModeEnum.valueOf(mode)).and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)))) - .orderBy(LAUNCH.START_TIME.desc()) - .limit(1)) - .select(selectFields) - .from(LAUNCH) - .join(FILTERED_QUERY) - .on(LAUNCH.ID.eq(fieldName(FILTERED_QUERY, ID).cast(Long.class))) - .leftJoin(STATISTICS) - .on(LAUNCH.ID.eq(STATISTICS.LAUNCH_ID)) - .leftJoin(USERS) - .on(LAUNCH.USER_ID.eq(USERS.ID)) - .leftJoin(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .leftJoin(ITEM_ATTRIBUTE) - .on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)) - .groupBy(simpleSelectedFields) - )).stream().findFirst(); - } - - @Override - public Integer countLaunches(Long projectId, String mode, LocalDateTime from) { - return dsl.fetchCount(LAUNCH, - LAUNCH.PROJECT_ID.eq(projectId) - .and(LAUNCH.MODE.eq(JLaunchModeEnum.valueOf(mode))) - .and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS).and(LAUNCH.START_TIME.greaterThan(Timestamp.valueOf(from)))) - ); - } - - @Override - public Integer countLaunches(Long projectId, String mode) { - return dsl.fetchCount(LAUNCH, - LAUNCH.PROJECT_ID.eq(projectId) - .and(LAUNCH.MODE.eq(JLaunchModeEnum.valueOf(mode))) - .and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)) - ); - } - - @Override - public Map countLaunchesGroupedByOwner(Long projectId, String mode, LocalDateTime from) { - return dsl.select(USERS.LOGIN, DSL.count().as("count")) - .from(LAUNCH) - .join(USERS) - .on(LAUNCH.USER_ID.eq(USERS.ID)) - .where(LAUNCH.PROJECT_ID.eq(projectId) - .and(LAUNCH.MODE.eq(JLaunchModeEnum.valueOf(mode)) - .and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)) - .and(LAUNCH.START_TIME.greaterThan(Timestamp.valueOf(from))))) - .groupBy(USERS.LOGIN) - .fetchMap(USERS.LOGIN, field("count", Integer.class)); - } - - @Override - public List findIdsByProjectIdAndModeAndStatusNotEq(Long projectId, JLaunchModeEnum mode, JStatusEnum status, int limit) { - return dsl.select(LAUNCH.ID) - .from(LAUNCH) - .where(LAUNCH.PROJECT_ID.eq(projectId)) - .and(LAUNCH.MODE.eq(mode)) - .and(LAUNCH.STATUS.notEqual(status)) - .orderBy(LAUNCH.ID) - .limit(limit) - .fetchInto(Long.class); - } - - @Override - public List findIdsByProjectIdAndModeAndStatusNotEqAfterId(Long projectId, JLaunchModeEnum mode, JStatusEnum status, - Long launchId, int limit) { - return dsl.select(LAUNCH.ID) - .from(LAUNCH) - .where(LAUNCH.PROJECT_ID.eq(projectId)) - .and(LAUNCH.ID.gt(launchId)) - .and(LAUNCH.MODE.eq(mode)) - .and(LAUNCH.STATUS.notEqual(status)) - .orderBy(LAUNCH.ID) - .limit(limit) - .fetchInto(Long.class); - } - - @Override - public boolean hasItemsWithLogsWithLogLevel(Long launchId, Collection itemTypes, Integer logLevel) { - return dsl.fetchExists(DSL.selectOne() - .from(TEST_ITEM) - .join(LOG) - .on(TEST_ITEM.ITEM_ID.eq(LOG.ITEM_ID)) - .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) - .and(TEST_ITEM.TYPE.in(itemTypes)) - .and(LOG.LOG_LEVEL.ge(logLevel))); - } - - @Override - public List findIndexLaunchByIds(List ids) { - return dsl.select(LAUNCH.ID, LAUNCH.NAME, LAUNCH.PROJECT_ID, LAUNCH.START_TIME) - .from(LAUNCH) - .where(LAUNCH.ID.in(ids)) - .orderBy(LAUNCH.ID) - .fetch(INDEX_LAUNCH_RECORD_MAPPER); - } - - @Override - public Optional findPreviousLaunchByProjectIdAndNameAndAttributesForLaunchIdAndModeNot(Long projectId, String name, - String[] launchAttributes, Long launchId, JLaunchModeEnum mode) { - return dsl.select() - .from(LAUNCH) - .where(LAUNCH.ID.in(dsl.select(LAUNCH.ID) - .from(LAUNCH) - .leftJoin(ITEM_ATTRIBUTE) - .on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)) - .where(ITEM_ATTRIBUTE.SYSTEM.eq(false)) - .and(LAUNCH.PROJECT_ID.eq(projectId)) - .and(LAUNCH.NAME.eq(name)) - .and(LAUNCH.ID.lt(launchId)) - .and(LAUNCH.MODE.ne(mode)) - .groupBy(LAUNCH.ID) - .having(field("{0}::varchar[] || {1}::varchar[] || {2}::varchar[]", - arrayAggDistinct(concat(coalesce(ITEM_ATTRIBUTE.KEY, ""))).filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)), - arrayAggDistinct(concat(KEY_VALUE_SEPARATOR, ITEM_ATTRIBUTE.VALUE)).filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq( - false)), - arrayAgg(concat(coalesce(ITEM_ATTRIBUTE.KEY, ""), - val(KEY_VALUE_SEPARATOR), - ITEM_ATTRIBUTE.VALUE - )).filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)) - ).contains(launchAttributes)))) - .orderBy(LAUNCH.NUMBER.desc()) - .limit(1) - .fetchOptionalInto(Launch.class); - } + @Autowired + private DSLContext dsl; + + @Override + public boolean hasItemsInStatuses(Long launchId, List statuses) { + return dsl.fetchExists(dsl.selectOne() + .from(TEST_ITEM) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .where(TEST_ITEM.LAUNCH_ID.eq(launchId).and(TEST_ITEM_RESULTS.STATUS.in(statuses)))); + } + + @Override + public List findByFilter(Queryable filter) { + return LAUNCH_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter, + filter.getFilterConditions() + .stream() + .map(ConvertibleCondition::getAllConditions) + .flatMap(Collection::stream) + .map(FilterCondition::getSearchCriteria) + .collect(Collectors.toSet()) + ).wrap().build())); + } + + @Override + public Page findByFilter(Queryable filter, Pageable pageable) { + Set fields = filter.getFilterConditions() + .stream() + .map(ConvertibleCondition::getAllConditions) + .flatMap(Collection::stream) + .map(FilterCondition::getSearchCriteria) + .collect(Collectors.toSet()); + fields.addAll( + pageable.getSort().get().map(Sort.Order::getProperty).collect(Collectors.toSet())); + + return PageableExecutionUtils.getPage( + LAUNCH_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter, fields) + .with(pageable) + .wrap() + .withWrapperSort(pageable.getSort()) + .build())), pageable, + () -> dsl.fetchCount(QueryBuilder.newBuilder(filter, fields).build())); + } + + @Override + public List getLaunchNamesByModeExcludedByStatus(Long projectId, String value, + LaunchModeEnum mode, StatusEnum status) { + return dsl.selectDistinct(LAUNCH.NAME) + .from(LAUNCH) + .leftJoin(PROJECT) + .on(LAUNCH.PROJECT_ID.eq(PROJECT.ID)) + .where(PROJECT.ID.eq(projectId)) + .and(LAUNCH.MODE.eq(JLaunchModeEnum.valueOf(mode.name()))) + .and(LAUNCH.STATUS.notEqual(JStatusEnum.valueOf(status.name()))) + .and(LAUNCH.NAME.likeIgnoreCase("%" + DSL.escape(value, '\\') + "%")) + .fetch(LAUNCH.NAME); + } + + @Override + public List getOwnerNames(Long projectId, String value, String mode) { + return dsl.selectDistinct(USERS.LOGIN) + .from(LAUNCH) + .leftJoin(PROJECT) + .on(LAUNCH.PROJECT_ID.eq(PROJECT.ID)) + .leftJoin(USERS) + .on(LAUNCH.USER_ID.eq(USERS.ID)) + .where(PROJECT.ID.eq(projectId)) + .and(USERS.LOGIN.likeIgnoreCase("%" + DSL.escape(value, '\\') + "%")) + .and(LAUNCH.MODE.eq(JLaunchModeEnum.valueOf(mode))) + .fetch(USERS.LOGIN); + } + + @Override + public Map getStatuses(Long projectId, Long[] ids) { + return dsl.select(LAUNCH.ID, LAUNCH.STATUS) + .from(LAUNCH) + .where(LAUNCH.PROJECT_ID.eq(projectId)) + .and(LAUNCH.ID.in(ids)) + .fetch() + .intoMap(record -> String.valueOf(record.component1()), + record -> record.component2().getLiteral()); + } + + @Override + public Optional findLatestByFilter(Filter filter) { + return ofNullable(dsl.with(LAUNCHES) + .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(filter, Sort.unsorted(), true) + .build()) + .select() + .from(LAUNCH) + .join(LAUNCHES) + .on(field(name(LAUNCHES, ID), Long.class).eq(LAUNCH.ID)) + .orderBy(LAUNCH.NAME, LAUNCH.NUMBER.desc()) + .fetchOneInto(Launch.class)); + } + + @Override + public Page findAllLatestByFilter(Queryable filter, Pageable pageable) { + + List> sortFieldList = SortUtils.TO_SORT_FIELDS.apply(pageable.getSort(), + filter.getTarget()); + List> simpleSelectedFields = getLaunchSimpleSelectedFields(); + + List> selectFields = new ArrayList<>(simpleSelectedFields); + selectFields.add(getAttributeConcatedFields()); + + List> groupFields = new ArrayList<>(simpleSelectedFields); + for (SortField sortField : sortFieldList) { + groupFields.add(DSL.field(sortField.getName())); + } + + return PageableExecutionUtils.getPage(LAUNCH_FETCHER.apply(dsl.with(FILTERED_QUERY) + .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(filter, pageable.getSort(), true) + .with(pageable).build()) + .select(selectFields) + .from(LAUNCH) + .join(FILTERED_QUERY) + .on(field(name(FILTERED_QUERY, ID), Long.class).eq(LAUNCH.ID)) + .leftJoin(STATISTICS) + .on(LAUNCH.ID.eq(STATISTICS.LAUNCH_ID)) + .leftJoin(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .leftJoin(ITEM_ATTRIBUTE) + .on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)) + .leftJoin(USERS) + .on(LAUNCH.USER_ID.eq(USERS.ID)) + .groupBy(groupFields) + .orderBy(sortFieldList) + .fetch()), + pageable, + () -> dsl.fetchCount(dsl.with(LAUNCHES) + .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(filter, pageable.getSort(), + true).build()) + .selectOne() + .distinctOn(LAUNCH.NAME) + .from(LAUNCH) + .join(LAUNCHES) + .on(field(name(LAUNCHES, ID), Long.class).eq(LAUNCH.ID))) + ); + } + + private Field getAttributeConcatedFields() { + return DSL.arrayAgg(DSL.concat( + ITEM_ATTRIBUTE.KEY, DSL.val(":"), + ITEM_ATTRIBUTE.VALUE, DSL.val(":"), + ITEM_ATTRIBUTE.SYSTEM)).as(ATTRIBUTE_ALIAS); + } + + private ArrayList> getLaunchSimpleSelectedFields() { + return Lists.newArrayList(LAUNCH.ID, + LAUNCH.UUID, + LAUNCH.NAME, + LAUNCH.DESCRIPTION, + LAUNCH.START_TIME, + LAUNCH.END_TIME, + LAUNCH.PROJECT_ID, + LAUNCH.USER_ID, + LAUNCH.NUMBER, + LAUNCH.LAST_MODIFIED, + LAUNCH.MODE, + LAUNCH.STATUS, + LAUNCH.HAS_RETRIES, + LAUNCH.RERUN, + LAUNCH.APPROXIMATE_DURATION, + STATISTICS.S_COUNTER, + STATISTICS_FIELD.NAME, + USERS.ID, + USERS.LOGIN); + } + + @Override + public List findLaunchIdsByProjectId(Long projectId) { + return dsl.select(LAUNCH.ID).from(LAUNCH).where(LAUNCH.PROJECT_ID.eq(projectId)) + .fetchInto(Long.class); + } + + @Override + public Optional findLastRun(Long projectId, String mode) { + List> simpleSelectedFields = getLaunchSimpleSelectedFields(); + + List> selectFields = new ArrayList<>(simpleSelectedFields); + selectFields.add(getAttributeConcatedFields()); + + return LAUNCH_FETCHER.apply(dsl.fetch(dsl.with(FILTERED_QUERY) + .as(dsl.select(LAUNCH.ID) + .from(LAUNCH) + .where(LAUNCH.PROJECT_ID.eq(projectId) + .and(LAUNCH.MODE.eq(JLaunchModeEnum.valueOf(mode)) + .and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)))) + .orderBy(LAUNCH.START_TIME.desc()) + .limit(1)) + .select(selectFields) + .from(LAUNCH) + .join(FILTERED_QUERY) + .on(LAUNCH.ID.eq(fieldName(FILTERED_QUERY, ID).cast(Long.class))) + .leftJoin(STATISTICS) + .on(LAUNCH.ID.eq(STATISTICS.LAUNCH_ID)) + .leftJoin(USERS) + .on(LAUNCH.USER_ID.eq(USERS.ID)) + .leftJoin(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .leftJoin(ITEM_ATTRIBUTE) + .on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)) + .groupBy(simpleSelectedFields) + )).stream().findFirst(); + } + + @Override + public Integer countLaunches(Long projectId, String mode, LocalDateTime from) { + return dsl.fetchCount(LAUNCH, + LAUNCH.PROJECT_ID.eq(projectId) + .and(LAUNCH.MODE.eq(JLaunchModeEnum.valueOf(mode))) + .and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS) + .and(LAUNCH.START_TIME.greaterThan(Timestamp.valueOf(from)))) + ); + } + + @Override + public Integer countLaunches(Long projectId, String mode) { + return dsl.fetchCount(LAUNCH, + LAUNCH.PROJECT_ID.eq(projectId) + .and(LAUNCH.MODE.eq(JLaunchModeEnum.valueOf(mode))) + .and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)) + ); + } + + @Override + public Map countLaunchesGroupedByOwner(Long projectId, String mode, + LocalDateTime from) { + return dsl.select(USERS.LOGIN, DSL.count().as("count")) + .from(LAUNCH) + .join(USERS) + .on(LAUNCH.USER_ID.eq(USERS.ID)) + .where(LAUNCH.PROJECT_ID.eq(projectId) + .and(LAUNCH.MODE.eq(JLaunchModeEnum.valueOf(mode)) + .and(LAUNCH.STATUS.ne(JStatusEnum.IN_PROGRESS)) + .and(LAUNCH.START_TIME.greaterThan(Timestamp.valueOf(from))))) + .groupBy(USERS.LOGIN) + .fetchMap(USERS.LOGIN, field("count", Integer.class)); + } + + @Override + public List findIdsByProjectIdAndModeAndStatusNotEq(Long projectId, JLaunchModeEnum mode, + JStatusEnum status, int limit) { + return dsl.select(LAUNCH.ID) + .from(LAUNCH) + .where(LAUNCH.PROJECT_ID.eq(projectId)) + .and(LAUNCH.MODE.eq(mode)) + .and(LAUNCH.STATUS.notEqual(status)) + .orderBy(LAUNCH.ID) + .limit(limit) + .fetchInto(Long.class); + } + + @Override + public List findIdsByProjectIdAndModeAndStatusNotEqAfterId(Long projectId, + JLaunchModeEnum mode, JStatusEnum status, + Long launchId, int limit) { + return dsl.select(LAUNCH.ID) + .from(LAUNCH) + .where(LAUNCH.PROJECT_ID.eq(projectId)) + .and(LAUNCH.ID.gt(launchId)) + .and(LAUNCH.MODE.eq(mode)) + .and(LAUNCH.STATUS.notEqual(status)) + .orderBy(LAUNCH.ID) + .limit(limit) + .fetchInto(Long.class); + } + + @Override + public boolean hasItemsWithLogsWithLogLevel(Long launchId, + Collection itemTypes, Integer logLevel) { + return dsl.fetchExists(DSL.selectOne() + .from(TEST_ITEM) + .join(LOG) + .on(TEST_ITEM.ITEM_ID.eq(LOG.ITEM_ID)) + .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) + .and(TEST_ITEM.TYPE.in(itemTypes)) + .and(LOG.LOG_LEVEL.ge(logLevel))); + } + + @Override + public List findIndexLaunchByIds(List ids) { + return dsl.select(LAUNCH.ID, LAUNCH.NAME, LAUNCH.PROJECT_ID, LAUNCH.START_TIME) + .from(LAUNCH) + .where(LAUNCH.ID.in(ids)) + .orderBy(LAUNCH.ID) + .fetch(INDEX_LAUNCH_RECORD_MAPPER); + } + + @Override + public Optional findPreviousLaunchByProjectIdAndNameAndAttributesForLaunchIdAndModeNot( + Long projectId, String name, + String[] launchAttributes, Long launchId, JLaunchModeEnum mode) { + return dsl.select() + .from(LAUNCH) + .where(LAUNCH.ID.in(dsl.select(LAUNCH.ID) + .from(LAUNCH) + .leftJoin(ITEM_ATTRIBUTE) + .on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)) + .where(ITEM_ATTRIBUTE.SYSTEM.eq(false)) + .and(LAUNCH.PROJECT_ID.eq(projectId)) + .and(LAUNCH.NAME.eq(name)) + .and(LAUNCH.ID.lt(launchId)) + .and(LAUNCH.MODE.ne(mode)) + .groupBy(LAUNCH.ID) + .having(field("{0}::varchar[] || {1}::varchar[] || {2}::varchar[]", + arrayAggDistinct(concat(coalesce(ITEM_ATTRIBUTE.KEY, ""))).filterWhere( + ITEM_ATTRIBUTE.SYSTEM.eq(false)), + arrayAggDistinct(concat(KEY_VALUE_SEPARATOR, ITEM_ATTRIBUTE.VALUE)).filterWhere( + ITEM_ATTRIBUTE.SYSTEM.eq( + false)), + arrayAgg(concat(coalesce(ITEM_ATTRIBUTE.KEY, ""), + val(KEY_VALUE_SEPARATOR), + ITEM_ATTRIBUTE.VALUE + )).filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)) + ).contains(launchAttributes)))) + .orderBy(LAUNCH.NUMBER.desc()) + .limit(1) + .fetchOptionalInto(Launch.class); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java b/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java index cadd6b46a..35ae47941 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LogRepository.java @@ -17,41 +17,41 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.log.Log; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; - import java.sql.Timestamp; import java.util.Collection; import java.util.List; import java.util.Optional; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; /** * @author Pavel Bortnik */ public interface LogRepository extends ReportPortalRepository, LogRepositoryCustom { - Optional findByUuid(String uuid); + Optional findByUuid(String uuid); - List findLogsByLogTime(Timestamp timestamp); + List findLogsByLogTime(Timestamp timestamp); - long countLogsByTestItemItemIdIn(List testItemIds); + long countLogsByTestItemItemIdIn(List testItemIds); - long countLogsByLaunchId(Long launchId); + long countLogsByLaunchId(Long launchId); - @Modifying - @Query(value = "UPDATE log SET launch_id = :newLaunchId WHERE launch_id = :currentLaunchId", nativeQuery = true) - void updateLaunchIdByLaunchId(@Param("currentLaunchId") Long currentLaunchId, @Param("newLaunchId") Long newLaunchId); + @Modifying + @Query(value = "UPDATE log SET launch_id = :newLaunchId WHERE launch_id = :currentLaunchId", nativeQuery = true) + void updateLaunchIdByLaunchId(@Param("currentLaunchId") Long currentLaunchId, + @Param("newLaunchId") Long newLaunchId); - @Modifying - @Query(value = "UPDATE log SET cluster_id = :clusterId WHERE id IN (:ids)", nativeQuery = true) - int updateClusterIdByIdIn(@Param("clusterId") Long clusterId, @Param("ids") Collection ids); + @Modifying + @Query(value = "UPDATE log SET cluster_id = :clusterId WHERE id IN (:ids)", nativeQuery = true) + int updateClusterIdByIdIn(@Param("clusterId") Long clusterId, @Param("ids") Collection ids); - @Modifying - @Query(value = "UPDATE log SET cluster_id = NULL WHERE cluster_id IN (SELECT id FROM clusters WHERE clusters.launch_id = :launchId)", nativeQuery = true) - int updateClusterIdSetNullByLaunchId(@Param("launchId") Long launchId); + @Modifying + @Query(value = "UPDATE log SET cluster_id = NULL WHERE cluster_id IN (SELECT id FROM clusters WHERE clusters.launch_id = :launchId)", nativeQuery = true) + int updateClusterIdSetNullByLaunchId(@Param("launchId") Long launchId); - @Modifying - @Query(value = "UPDATE log SET cluster_id = NULL WHERE cluster_id IS NOT NULL AND item_id IN (:itemIds)", nativeQuery = true) - int updateClusterIdSetNullByItemIds(@Param("itemIds") Collection itemIds); + @Modifying + @Query(value = "UPDATE log SET cluster_id = NULL WHERE cluster_id IS NOT NULL AND item_id IN (:itemIds)", nativeQuery = true) + int updateClusterIdSetNullByItemIds(@Param("itemIds") Collection itemIds); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustom.java index 5b14458ea..42be6c07c 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustom.java @@ -25,191 +25,208 @@ import com.epam.ta.reportportal.entity.launch.Launch; import com.epam.ta.reportportal.entity.log.Log; import com.epam.ta.reportportal.ws.model.analyzer.IndexLog; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; - import java.time.Duration; import java.util.Collection; import java.util.List; import java.util.Map; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; /** * @author Pavel Bortnik */ public interface LogRepositoryCustom extends FilterableRepository { - /** - * Checks if the test item has any logs. - * - * @param itemId Item id - * @return true if logs were found - */ - boolean hasLogs(Long itemId); - - /** - * Load specified number of last logs for specified test item. binaryData - * field will be loaded if it specified in appropriate input parameter, all - * other fields will be fully loaded. - * - * @param limit Max count of logs to be loaded - * @param itemId Test Item log belongs to - * @return Found logs - */ - List findByTestItemId(Long itemId, int limit); - - /** - * Load specified number of last logs for specified test item. binaryData - * field will be loaded if it specified in appropriate input parameter, all - * other fields will be fully loaded. - * - * @param itemId Test Item log belongs to - * @return Found logs - */ - List findByTestItemId(Long itemId); - - /** - * @param launchId {@link} ID of the {@link Launch} to search {@link Log} under - * @param itemIds {@link List} of the {@link Log#getTestItem()} IDs - * @param logLevel {@link Log#getLogLevel()} - * @return {@link List} of {@link Log} - */ - List findAllUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(Long launchId, List itemIds, int logLevel); - - /** - * Find logs as {@link IndexLog} under {@link TestItem} and group by {@link Log#getTestItem()} ID - * - * @param launchId {@link} ID of the {@link Launch} to search {@link Log} under - * @param itemIds {@link List} of the {@link Log#getTestItem()} IDs - * @param logLevel {@link Log#getLogLevel()} - * @return {@link List} of {@link Log} - */ - Map> findAllIndexUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(Long launchId, List itemIds, - int logLevel); - - /** - * Find n latest logs for item - * - * @param launchId {@link} ID of the {@link Launch} to search {@link Log} under - * @param itemId {@link List} of the {@link Log#getTestItem()} IDs - * @param logLevel {@link Log#getLogLevel()} - * @param limit Number of logs to be fetch - * @return {@link List} of {@link Log} - */ - List findLatestUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(Long launchId, Long itemId, int logLevel, int limit); - - /** - * @param launchId {@link} ID of the {@link Launch} to search {@link Log} under - * @param itemIds {@link List} of the {@link Log#getTestItem()} IDs - * @param limit Max count of {@link Log} to be loaded - * @return {@link List} of {@link Log} - */ - List findAllUnderTestItemByLaunchIdAndTestItemIdsWithLimit(Long launchId, List itemIds, int limit); - - List findIdsByFilter(Queryable filter); - - List findIdsByTestItemId(Long testItemId); - - /** - * @param launchId {@link} ID of the {@link Launch} to search {@link Log} under - * @param itemIds {@link List} of the {@link Log#getTestItem()} IDs - * @param logLevel {@link Log#getLogLevel()} - * @return {@link List} of {@link Log#getId()} - */ - List findIdsUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(Long launchId, List itemIds, int logLevel); - - List findItemLogIdsByLaunchIdAndLogLevelGte(Long launchId, int logLevel); - - List findItemLogIdsByLaunchIdsAndLogLevelGte(List launchIds, int logLevel); - - List findIdsByTestItemIdsAndLogLevelGte(List itemIds, int logLevel); - - /** - * Get the specified log's page number - * - * @param id ID of log page should be found of - * @param filter Filter - * @param pageable Page details - * @return Page number log found using specified filter - */ - Integer getPageNumber(Long id, Filter filter, Pageable pageable); - - /** - * True if the {@link com.epam.ta.reportportal.entity.item.TestItem} with matching 'status' and 'launchId' - * has {@link Log}'s with {@link Log#lastModified} up to the current point of time minus provided 'period' - * - * @param period {@link Duration} - * @param launchId {@link com.epam.ta.reportportal.entity.launch.Launch#id} - * @param statuses {@link StatusEnum} - * @return true if logs(the log) exist(exists) - */ - boolean hasLogsAddedLately(Duration period, Long launchId, StatusEnum... statuses); - - /** - * @param period {@link Duration} - * @param testItemIds Collection of the {@link com.epam.ta.reportportal.entity.item.TestItem#itemId} referenced from {@link Log#testItem} - * @return Count of removed logs - */ - int deleteByPeriodAndTestItemIds(Duration period, Collection testItemIds); - - /** - * @param period {@link Duration} - * @param launchIds Collection of the {@link Launch#getId()} referenced from {@link Log#getLaunch()} - * @return Count of removed logs - */ - int deleteByPeriodAndLaunchIds(Duration period, Collection launchIds); - - /** - * Retrieve {@link Log} and {@link com.epam.ta.reportportal.entity.item.TestItem} entities' ids, differentiated by entity type - *

- * {@link Log} and {@link com.epam.ta.reportportal.entity.item.TestItem} entities filtered and sorted on the DB level - * and returned as UNION parsed into the {@link NestedItem} entity - * - * @param parentId {@link com.epam.ta.reportportal.entity.item.TestItem#itemId} of the parent item - * @param filter {@link Queryable} - * @param excludeEmptySteps Exclude steps without content (logs and child items) - * @param excludeLogs Exclude logs selection - * @param pageable {@link Pageable} - * @return {@link Page} with {@link NestedItem} as content - */ - Page findNestedItems(Long parentId, boolean excludeEmptySteps, boolean excludeLogs, Queryable filter, Pageable pageable); - - /** - * Retrieve {@link Log} and {@link com.epam.ta.reportportal.entity.item.TestItem} entities' ids, differentiated by entity type - *

- * {@link Log} and {@link com.epam.ta.reportportal.entity.item.TestItem} entities filtered and sorted on the DB level - * and returned as UNION parsed into the {@link NestedItemPage} entity with page where item is located - * - * @param parentId {@link com.epam.ta.reportportal.entity.item.TestItem#itemId} of the parent item - * @param filter {@link Queryable} - * @param excludeEmptySteps Exclude steps without content (logs and child items) - * @param excludeLogs Exclude logs selection - * @param pageable {@link Pageable} - * @return {@link Page} with {@link NestedItemPage} as content - */ - List findNestedItemsWithPage(Long parentId, boolean excludeEmptySteps, boolean excludeLogs, - Queryable filter, Pageable pageable); - - /** - * Retrieves log message of specified test item with log level greather or equals than {@code level} - * - * @param launchId @link TestItem#getLaunchId()} - * @param itemId ID of {@link Log#getTestItem()} - * @param path {@link TestItem#getPath()} - * @param level log level - * @return {@link List} of {@link String} of log messages - */ - List findMessagesByLaunchIdAndItemIdAndPathAndLevelGte(Long launchId, Long itemId, String path, Integer level); - - /** - * Retrieves log message id of specified test item with log level greather or equals than {@code level} - * - * @param launchId @link TestItem#getLaunchId()} - * @param itemId ID of {@link Log#getTestItem()} - * @param path {@link TestItem#getPath()} - * @param level log level - * @return {@link List} of {@link String} of log messages - */ - List findIdsByLaunchIdAndItemIdAndPathAndLevelGte(Long launchId, Long itemId, String path, Integer level); - - int deleteByProjectId(Long projectId); + /** + * Checks if the test item has any logs. + * + * @param itemId Item id + * @return true if logs were found + */ + boolean hasLogs(Long itemId); + + /** + * Load specified number of last logs for specified test item. binaryData field will be loaded if + * it specified in appropriate input parameter, all other fields will be fully loaded. + * + * @param limit Max count of logs to be loaded + * @param itemId Test Item log belongs to + * @return Found logs + */ + List findByTestItemId(Long itemId, int limit); + + /** + * Load specified number of last logs for specified test item. binaryData field will be loaded if + * it specified in appropriate input parameter, all other fields will be fully loaded. + * + * @param itemId Test Item log belongs to + * @return Found logs + */ + List findByTestItemId(Long itemId); + + /** + * @param launchId {@link} ID of the {@link Launch} to search {@link Log} under + * @param itemIds {@link List} of the {@link Log#getTestItem()} IDs + * @param logLevel {@link Log#getLogLevel()} + * @return {@link List} of {@link Log} + */ + List findAllUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(Long launchId, + List itemIds, int logLevel); + + /** + * Find logs as {@link IndexLog} under {@link TestItem} and group by {@link Log#getTestItem()} ID + * + * @param launchId {@link} ID of the {@link Launch} to search {@link Log} under + * @param itemIds {@link List} of the {@link Log#getTestItem()} IDs + * @param logLevel {@link Log#getLogLevel()} + * @return {@link List} of {@link Log} + */ + Map> findAllIndexUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte( + Long launchId, List itemIds, + int logLevel); + + /** + * Find n latest logs for item + * + * @param launchId {@link} ID of the {@link Launch} to search {@link Log} under + * @param itemId {@link List} of the {@link Log#getTestItem()} IDs + * @param logLevel {@link Log#getLogLevel()} + * @param limit Number of logs to be fetch + * @return {@link List} of {@link Log} + */ + List findLatestUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(Long launchId, + Long itemId, int logLevel, int limit); + + /** + * @param launchId {@link} ID of the {@link Launch} to search {@link Log} under + * @param itemIds {@link List} of the {@link Log#getTestItem()} IDs + * @param limit Max count of {@link Log} to be loaded + * @return {@link List} of {@link Log} + */ + List findAllUnderTestItemByLaunchIdAndTestItemIdsWithLimit(Long launchId, List itemIds, + int limit); + + List findIdsByFilter(Queryable filter); + + List findIdsByTestItemId(Long testItemId); + + /** + * @param launchId {@link} ID of the {@link Launch} to search {@link Log} under + * @param itemIds {@link List} of the {@link Log#getTestItem()} IDs + * @param logLevel {@link Log#getLogLevel()} + * @return {@link List} of {@link Log#getId()} + */ + List findIdsUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(Long launchId, + List itemIds, int logLevel); + + List findItemLogIdsByLaunchIdAndLogLevelGte(Long launchId, int logLevel); + + List findItemLogIdsByLaunchIdsAndLogLevelGte(List launchIds, int logLevel); + + List findIdsByTestItemIdsAndLogLevelGte(List itemIds, int logLevel); + + /** + * Get the specified log's page number + * + * @param id ID of log page should be found of + * @param filter Filter + * @param pageable Page details + * @return Page number log found using specified filter + */ + Integer getPageNumber(Long id, Filter filter, Pageable pageable); + + /** + * True if the {@link com.epam.ta.reportportal.entity.item.TestItem} with matching 'status' and + * 'launchId' has {@link Log}'s with {@link Log#lastModified} up to the current point of time + * minus provided 'period' + * + * @param period {@link Duration} + * @param launchId {@link com.epam.ta.reportportal.entity.launch.Launch#id} + * @param statuses {@link StatusEnum} + * @return true if logs(the log) exist(exists) + */ + boolean hasLogsAddedLately(Duration period, Long launchId, StatusEnum... statuses); + + /** + * @param period {@link Duration} + * @param testItemIds Collection of the + * {@link com.epam.ta.reportportal.entity.item.TestItem#itemId} referenced from + * {@link Log#testItem} + * @return Count of removed logs + */ + int deleteByPeriodAndTestItemIds(Duration period, Collection testItemIds); + + /** + * @param period {@link Duration} + * @param launchIds Collection of the {@link Launch#getId()} referenced from + * {@link Log#getLaunch()} + * @return Count of removed logs + */ + int deleteByPeriodAndLaunchIds(Duration period, Collection launchIds); + + /** + * Retrieve {@link Log} and {@link com.epam.ta.reportportal.entity.item.TestItem} entities' ids, + * differentiated by entity type + *

+ * {@link Log} and {@link com.epam.ta.reportportal.entity.item.TestItem} entities filtered and + * sorted on the DB level and returned as UNION parsed into the {@link NestedItem} entity + * + * @param parentId {@link com.epam.ta.reportportal.entity.item.TestItem#itemId} of the + * parent item + * @param filter {@link Queryable} + * @param excludeEmptySteps Exclude steps without content (logs and child items) + * @param excludeLogs Exclude logs selection + * @param pageable {@link Pageable} + * @return {@link Page} with {@link NestedItem} as content + */ + Page findNestedItems(Long parentId, boolean excludeEmptySteps, boolean excludeLogs, + Queryable filter, Pageable pageable); + + /** + * Retrieve {@link Log} and {@link com.epam.ta.reportportal.entity.item.TestItem} entities' ids, + * differentiated by entity type + *

+ * {@link Log} and {@link com.epam.ta.reportportal.entity.item.TestItem} entities filtered and + * sorted on the DB level and returned as UNION parsed into the {@link NestedItemPage} entity with + * page where item is located + * + * @param parentId {@link com.epam.ta.reportportal.entity.item.TestItem#itemId} of the + * parent item + * @param filter {@link Queryable} + * @param excludeEmptySteps Exclude steps without content (logs and child items) + * @param excludeLogs Exclude logs selection + * @param pageable {@link Pageable} + * @return {@link Page} with {@link NestedItemPage} as content + */ + List findNestedItemsWithPage(Long parentId, boolean excludeEmptySteps, + boolean excludeLogs, + Queryable filter, Pageable pageable); + + /** + * Retrieves log message of specified test item with log level greather or equals than + * {@code level} + * + * @param launchId @link TestItem#getLaunchId()} + * @param itemId ID of {@link Log#getTestItem()} + * @param path {@link TestItem#getPath()} + * @param level log level + * @return {@link List} of {@link String} of log messages + */ + List findMessagesByLaunchIdAndItemIdAndPathAndLevelGte(Long launchId, Long itemId, + String path, Integer level); + + /** + * Retrieves log message id of specified test item with log level greather or equals than + * {@code level} + * + * @param launchId @link TestItem#getLaunchId()} + * @param itemId ID of {@link Log#getTestItem()} + * @param path {@link TestItem#getPath()} + * @param level log level + * @return {@link List} of {@link String} of log messages + */ + List findIdsByLaunchIdAndItemIdAndPathAndLevelGte(Long launchId, Long itemId, String path, + Integer level); + + int deleteByProjectId(Long projectId); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustomImpl.java index 22e1a7a5f..9edd652ac 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LogRepositoryCustomImpl.java @@ -16,6 +16,37 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_TIME; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_STATUS; +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.DISTINCT_LOGS_TABLE; +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.ITEM; +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.LOGS; +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.LOG_LEVEL; +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.PAGE_NUMBER; +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.ROW_NUMBER; +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.TIME; +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.TYPE; +import static com.epam.ta.reportportal.dao.constant.TestItemRepositoryConstants.NESTED; +import static com.epam.ta.reportportal.dao.constant.WidgetRepositoryConstants.ID; +import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; +import static com.epam.ta.reportportal.dao.util.RecordMappers.ATTACHMENT_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.INDEX_LOG_FETCHER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.LOG_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.LOG_UNDER_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.LOG_UNDER_RECORD_MAPPER; +import static com.epam.ta.reportportal.dao.util.ResultFetchers.LOG_FETCHER; +import static com.epam.ta.reportportal.dao.util.ResultFetchers.NESTED_ITEM_FETCHER; +import static com.epam.ta.reportportal.dao.util.ResultFetchers.NESTED_ITEM_LOCATED_FETCHER; +import static com.epam.ta.reportportal.jooq.Tables.CLUSTERS; +import static com.epam.ta.reportportal.jooq.Tables.LAUNCH; +import static com.epam.ta.reportportal.jooq.Tables.LOG; +import static com.epam.ta.reportportal.jooq.tables.JAttachment.ATTACHMENT; +import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; +import static com.epam.ta.reportportal.jooq.tables.JTestItemResults.TEST_ITEM_RESULTS; +import static java.util.Optional.ofNullable; +import static java.util.stream.Collectors.toList; +import static org.jooq.impl.DSL.field; + import com.epam.ta.reportportal.commons.querygen.Filter; import com.epam.ta.reportportal.commons.querygen.QueryBuilder; import com.epam.ta.reportportal.commons.querygen.Queryable; @@ -32,7 +63,30 @@ import com.epam.ta.reportportal.ws.model.ErrorType; import com.epam.ta.reportportal.ws.model.analyzer.IndexLog; import com.google.common.collect.Lists; -import org.jooq.*; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.sql.Timestamp; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Stream; +import org.jooq.DSLContext; +import org.jooq.Field; +import org.jooq.OrderField; +import org.jooq.Record; +import org.jooq.Record4; +import org.jooq.SelectConditionStep; +import org.jooq.SelectHavingStep; +import org.jooq.SelectOnConditionStep; +import org.jooq.SelectOrderByStep; +import org.jooq.SortField; +import org.jooq.SortOrder; +import org.jooq.Table; import org.jooq.impl.DSL; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -41,457 +95,472 @@ import org.springframework.data.repository.support.PageableExecutionUtils; import org.springframework.stereotype.Repository; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.sql.Timestamp; -import java.time.Duration; -import java.util.*; -import java.util.stream.Stream; - -import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_TIME; -import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_STATUS; -import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.*; -import static com.epam.ta.reportportal.dao.constant.TestItemRepositoryConstants.NESTED; -import static com.epam.ta.reportportal.dao.constant.WidgetRepositoryConstants.ID; -import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; -import static com.epam.ta.reportportal.dao.util.RecordMappers.*; -import static com.epam.ta.reportportal.dao.util.ResultFetchers.*; -import static com.epam.ta.reportportal.jooq.Tables.LOG; -import static com.epam.ta.reportportal.jooq.Tables.*; -import static com.epam.ta.reportportal.jooq.tables.JAttachment.ATTACHMENT; -import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; -import static com.epam.ta.reportportal.jooq.tables.JTestItemResults.TEST_ITEM_RESULTS; -import static java.util.Optional.ofNullable; -import static java.util.stream.Collectors.toList; -import static org.jooq.impl.DSL.field; - /** * @author Pavel Bortnik */ @Repository public class LogRepositoryCustomImpl implements LogRepositoryCustom { - public static final String ROOT_ITEM_ID = "root_id"; - - private static final String PARENT_ITEM_TABLE = "parent"; - private static final String CHILD_ITEM_TABLE = "child"; - - private DSLContext dsl; - - @Autowired - public void setDsl(DSLContext dsl) { - this.dsl = dsl; - } - - @Override - public boolean hasLogs(Long itemId) { - return dsl.fetchExists(dsl.selectOne().from(LOG).where(LOG.ITEM_ID.eq(itemId))); - } - - @Override - public List findByTestItemId(Long itemId, int limit) { - if (itemId == null || limit <= 0) { - return new ArrayList<>(); - } - - return dsl.select() - .from(LOG) - .leftJoin(ATTACHMENT) - .on(LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)) - .where(LOG.ITEM_ID.eq(itemId)) - .orderBy(LOG.LOG_TIME.asc()) - .limit(limit) - .fetch() - .map(r -> LOG_MAPPER.apply(r, ATTACHMENT_MAPPER)); - } - - @Override - public List findByTestItemId(Long itemId) { - if (itemId == null) { - return new ArrayList<>(); - } - - return dsl.select() - .from(LOG) - .leftJoin(ATTACHMENT) - .on(LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)) - .where(LOG.ITEM_ID.eq(itemId)) - .orderBy(LOG.LOG_TIME.asc()) - .fetch() - .map(r -> LOG_MAPPER.apply(r, ATTACHMENT_MAPPER)); - } - - /** - * @return {@link List} of {@link Log} without {@link Log#getAttachment()} - */ - @Override - public List findAllUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(Long launchId, List itemIds, int logLevel) { - return buildLogsUnderItemsQuery(launchId, itemIds, false).and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) - .fetch() - .map(LOG_UNDER_RECORD_MAPPER); - } - - @Override - public Map> findAllIndexUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(Long launchId, List itemIds, int logLevel) { - JTestItem parentItemTable = TEST_ITEM.as(PARENT_ITEM_TABLE); - JTestItem childItemTable = TEST_ITEM.as(CHILD_ITEM_TABLE); - - return INDEX_LOG_FETCHER.apply(dsl.selectDistinct(LOG.ID, LOG.LOG_LEVEL, LOG.LOG_MESSAGE, LOG.LOG_TIME, parentItemTable.ITEM_ID.as(ROOT_ITEM_ID), CLUSTERS.INDEX_ID) - .on(LOG.ID) - .from(LOG) - .join(childItemTable) - .on(LOG.ITEM_ID.eq(childItemTable.ITEM_ID)) - .join(parentItemTable) - .on(DSL.sql(childItemTable.PATH + " <@ " + parentItemTable.PATH)) - .leftJoin(CLUSTERS) - .on(LOG.CLUSTER_ID.eq(CLUSTERS.ID)) - .where(childItemTable.LAUNCH_ID.eq(launchId)) - .and(parentItemTable.LAUNCH_ID.eq(launchId)) - .and(parentItemTable.ITEM_ID.in(itemIds)) - .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) - .fetch()); - } - - @Override - public List findLatestUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(Long launchId, Long itemId, int logLevel, int limit) { - return Lists.reverse(buildLogsUnderItemsQuery(launchId, Collections.singletonList(itemId), false).and(LOG.LOG_LEVEL.greaterOrEqual( - logLevel)).orderBy(LOG.LOG_TIME.desc()).limit(limit).fetch().map(LOG_UNDER_RECORD_MAPPER)); - } - - @Override - public List findAllUnderTestItemByLaunchIdAndTestItemIdsWithLimit(Long launchId, List itemIds, int limit) { - return buildLogsUnderItemsQuery(launchId, itemIds, true).limit(limit) - .fetch() - .map(r -> LOG_UNDER_MAPPER.apply(r, ATTACHMENT_MAPPER)); - - } - - @Override - public List findIdsByFilter(Queryable filter) { - Set fields = QueryUtils.collectJoinFields(filter); - return dsl.select(fieldName(ID)).from(QueryBuilder.newBuilder(filter, fields).build()).fetchInto(Long.class); - } - - @Override - public List findIdsByTestItemId(Long testItemId) { - return dsl.select(LOG.ID).from(LOG).where(LOG.ITEM_ID.eq(testItemId)).fetchInto(Long.class); - } - - @Override - public List findIdsUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(Long launchId, List itemIds, int logLevel) { - - JTestItem parentItemTable = TEST_ITEM.as(PARENT_ITEM_TABLE); - JTestItem childItemTable = TEST_ITEM.as(CHILD_ITEM_TABLE); - - return dsl.selectDistinct(LOG.ID) - .from(LOG) - .join(childItemTable) - .on(LOG.ITEM_ID.eq(childItemTable.ITEM_ID)) - .join(parentItemTable) - .on(DSL.sql(childItemTable.PATH + " <@ " + parentItemTable.PATH)) - .where(childItemTable.LAUNCH_ID.eq(launchId)) - .and(parentItemTable.LAUNCH_ID.eq(launchId)) - .and(parentItemTable.ITEM_ID.in(itemIds)) - .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) - .fetchInto(Long.class); - } - - @Override - public List findItemLogIdsByLaunchIdAndLogLevelGte(Long launchId, int logLevel) { - return dsl.select(LOG.ID) - .from(LOG) - .leftJoin(TEST_ITEM) - .on(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) - .join(LAUNCH) - .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) - .where(LAUNCH.ID.eq(launchId)) - .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) - .fetch(LOG.ID, Long.class); - } - - @Override - public List findItemLogIdsByLaunchIdsAndLogLevelGte(List launchIds, int logLevel) { - return dsl.select(LOG.ID) - .from(LOG) - .leftJoin(TEST_ITEM) - .on(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) - .join(LAUNCH) - .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) - .where(LAUNCH.ID.in(launchIds)) - .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) - .fetch(LOG.ID, Long.class); - } - - @Override - public List findIdsByTestItemIdsAndLogLevelGte(List itemIds, int logLevel) { - return dsl.select(LOG.ID) - .from(LOG) - .where(LOG.ITEM_ID.in(itemIds)) - .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) - .fetch(LOG.ID, Long.class); - } - - @Override - public List findByFilter(Queryable filter) { - return LOG_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter, QueryUtils.collectJoinFields(filter)).wrap().build())); - } - - @Override - public Page findByFilter(Queryable filter, Pageable pageable) { - Set joinFields = QueryUtils.collectJoinFields(filter, pageable.getSort()); - return PageableExecutionUtils.getPage(LOG_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter, joinFields) - .with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) - .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter, joinFields).build())); - } - - @Override - public Integer getPageNumber(Long id, Filter filter, Pageable pageable) { - - Sort.Order order = ofNullable(pageable.getSort().getOrderFor(CRITERIA_LOG_TIME)).orElseThrow(() -> new ReportPortalException( - ErrorType.INCORRECT_SORTING_PARAMETERS)); - - OrderField sortField = order.getDirection().isAscending() ? LOG.LOG_TIME.asc() : LOG.LOG_TIME.desc(); - - return ofNullable(dsl.select(fieldName(ROW_NUMBER)) - .from(dsl.select(LOG.ID, DSL.rowNumber().over(DSL.orderBy(sortField)).as(ROW_NUMBER)) - .from(LOG) - .join(QueryBuilder.newBuilder(filter, QueryUtils.collectJoinFields(filter, pageable.getSort())) - .with(pageable.getSort()) - .build() - .asTable(DISTINCT_LOGS_TABLE)) - .on(LOG.ID.eq(fieldName(DISTINCT_LOGS_TABLE, ID).cast(Long.class)))) - .where(fieldName(ID).cast(Long.class).eq(id)) - .fetchAny()).map(r -> { - Long rowNumber = r.into(Long.class); - return BigDecimal.valueOf(rowNumber).divide(BigDecimal.valueOf(pageable.getPageSize()), RoundingMode.CEILING).intValue(); - }).orElseThrow(() -> new ReportPortalException(ErrorType.LOG_NOT_FOUND, id)); - - } - - @Override - public boolean hasLogsAddedLately(Duration period, Long launchId, StatusEnum... statuses) { - List jStatuses = Arrays.stream(statuses).map(it -> JStatusEnum.valueOf(it.name())).collect(toList()); - return dsl.fetchExists(dsl.selectOne() - .from(LOG) - .join(TEST_ITEM) - .on(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) - .and(TEST_ITEM_RESULTS.STATUS.in(jStatuses)) - .and(LOG.LOG_TIME.gt(TimestampUtils.getTimestampBackFromNow(period))) - .limit(1)); - } - - @Override - public int deleteByPeriodAndTestItemIds(Duration period, Collection testItemIds) { - - return dsl.deleteFrom(LOG) - .where(LOG.ITEM_ID.in(testItemIds).and(LOG.LOG_TIME.lt(TimestampUtils.getTimestampBackFromNow(period)))) - .execute(); - } - - @Override - public int deleteByPeriodAndLaunchIds(Duration period, Collection launchIds) { - return dsl.deleteFrom(LOG) - .where(LOG.LAUNCH_ID.in(launchIds).and(LOG.LOG_TIME.lt(TimestampUtils.getTimestampBackFromNow(period)))) - .execute(); - } - - @Override - public Page findNestedItems(Long parentId, boolean excludeEmptySteps, boolean excludeLogs, Queryable filter, - Pageable pageable) { - - SortField sorting = pageable.getSort() - .stream() - .filter(order -> CRITERIA_LOG_TIME.equals(order.getProperty())) - .findFirst() - .filter(order -> !order.isAscending()) - .map(order -> field(TIME).sort(SortOrder.DESC)) - .orElseGet(() -> field(TIME).sort(SortOrder.ASC)); - - SelectOrderByStep> selectQuery = buildNestedStepQuery(parentId, excludeEmptySteps, filter); - - if (!excludeLogs) { - selectQuery = selectQuery.unionAll(buildNestedLogQuery(parentId, filter)); - } - - int total = dsl.fetchCount(selectQuery); - - return PageableExecutionUtils.getPage(NESTED_ITEM_FETCHER.apply(dsl.fetch(selectQuery.orderBy( - sorting, - field(ID).sort(sorting.getOrder()) - ).limit(pageable.getPageSize()).offset(QueryBuilder.retrieveOffsetAndApplyBoundaries(pageable)))), pageable, () -> total); - - } - - @Override - public List findNestedItemsWithPage(Long parentId, boolean excludeEmptySteps, boolean excludeLogs, - Queryable filter, Pageable pageable) { - - SortField sorting = pageable.getSort() - .stream() - .filter(order -> CRITERIA_LOG_TIME.equals(order.getProperty())) - .findFirst() - .filter(order -> !order.isAscending()) - .map(order -> field(TIME).sort(SortOrder.DESC)) - .orElseGet(() -> field(TIME).sort(SortOrder.ASC)); - - SelectOrderByStep> selectQuery = buildNestedStepQuery(parentId, excludeEmptySteps, filter); - - if (!excludeLogs) { - selectQuery = selectQuery.unionAll(buildNestedLogQuery(parentId, filter)); - } - - final Table itemsWithPages = DSL.table("item_with_pages"); - - return NESTED_ITEM_LOCATED_FETCHER.apply(dsl.fetch(dsl.with(itemsWithPages.getName()).as(selectQuery).select( - fieldName(itemsWithPages.getName(), ID), - fieldName(itemsWithPages.getName(), TYPE), - fieldName(itemsWithPages.getName(), LOG_LEVEL), - DSL.rowNumber() - .over(DSL.orderBy(sorting, field(ID).sort(sorting.getOrder()))) - .minus(1) - .div(pageable.getPageSize()) - .plus(1) - .as(PAGE_NUMBER) - ).from(itemsWithPages))); - } - - @Override - public List findMessagesByLaunchIdAndItemIdAndPathAndLevelGte(Long launchId, Long itemId, String path, Integer level) { - return dsl.select(LOG.LOG_MESSAGE) - .from(LOG) - .join(TEST_ITEM) - .on(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) - .where(LOG.LOG_LEVEL.ge(level) - .and(TEST_ITEM.LAUNCH_ID.eq(launchId)) - .and(TEST_ITEM.ITEM_ID.eq(itemId) - .or(TEST_ITEM.HAS_STATS.eq(false).and(DSL.sql(TEST_ITEM.PATH + " <@ cast(? AS LTREE)", path))))) - .fetch(LOG.LOG_MESSAGE); - } - - @Override - public List findIdsByLaunchIdAndItemIdAndPathAndLevelGte(Long launchId, Long itemId, String path, Integer level) { - return dsl.select(LOG.ID) - .from(LOG) - .join(TEST_ITEM) - .on(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) - .where(LOG.LOG_LEVEL.ge(level) - .and(TEST_ITEM.LAUNCH_ID.eq(launchId)) - .and(TEST_ITEM.ITEM_ID.eq(itemId) - .or(TEST_ITEM.HAS_STATS.eq(false).and(DSL.sql(TEST_ITEM.PATH + " <@ cast(? AS LTREE)", path))))) - .fetch(LOG.ID); - } - - @Override - public int deleteByProjectId(Long projectId) { - return dsl.deleteFrom(LOG).where(LOG.PROJECT_ID.eq(projectId)).execute(); - } - - private SelectConditionStep buildLogsUnderItemsQuery(Long launchId, List itemIds, boolean includeAttachments) { - - JTestItem parentItemTable = TEST_ITEM.as(PARENT_ITEM_TABLE); - JTestItem childItemTable = TEST_ITEM.as(CHILD_ITEM_TABLE); - - List> selectFields = Lists.newArrayList(LOG.ID, - LOG.LOG_LEVEL, - LOG.LOG_MESSAGE, - LOG.LOG_TIME, - parentItemTable.ITEM_ID.as(ROOT_ITEM_ID), - LOG.LAUNCH_ID, - LOG.LAST_MODIFIED, - LOG.PROJECT_ID, - LOG.CLUSTER_ID - ); - - if (includeAttachments) { - Collections.addAll(selectFields, ATTACHMENT.fields()); - } - - SelectOnConditionStep logsSelect = dsl.selectDistinct(selectFields) - .on(LOG.ID, LOG.LOG_TIME) - .from(LOG) - .join(childItemTable) - .on(LOG.ITEM_ID.eq(childItemTable.ITEM_ID)) - .join(parentItemTable) - .on(DSL.sql(childItemTable.PATH + " <@ " + parentItemTable.PATH)); - - if (includeAttachments) { - logsSelect = logsSelect.leftJoin(ATTACHMENT).on(LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)); - } - - return logsSelect.where(childItemTable.LAUNCH_ID.eq(launchId)) - .and(parentItemTable.LAUNCH_ID.eq(launchId)) - .and(parentItemTable.ITEM_ID.in(itemIds)); - } - - private SelectHavingStep> buildNestedStepQuery(Long parentId, boolean excludeEmptySteps, - Queryable filter) { - - SelectConditionStep> nestedStepSelect = dsl.select(TEST_ITEM.ITEM_ID.as(ID), - TEST_ITEM.START_TIME.as(TIME), - DSL.val(ITEM).as(TYPE), - DSL.val(0).as(LOG_LEVEL) - ) - .from(TEST_ITEM) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .where(TEST_ITEM.PARENT_ID.eq(parentId)) - .and(TEST_ITEM.HAS_STATS.isFalse()); - - filter.getFilterConditions() - .stream() - .flatMap(condition -> condition.getAllConditions().stream()) - .filter(c -> CRITERIA_STATUS.equals(c.getSearchCriteria())) - .findFirst() - .map(c -> Stream.of(c.getValue().split(",")).filter(StatusEnum::isPresent).map(JStatusEnum::valueOf).collect(toList())) - .map(TEST_ITEM_RESULTS.STATUS::in) - .ifPresent(nestedStepSelect::and); - - if (excludeEmptySteps) { - JTestItem nested = TEST_ITEM.as(NESTED); - nestedStepSelect.and(field(DSL.exists(dsl.with(LOGS) - .as(QueryBuilder.newBuilder(filter, QueryUtils.collectJoinFields(filter)) - .addCondition(LOG.ITEM_ID.eq(parentId)) - .build()) - .select() - .from(LOG) - .join(LOGS) - .on(LOG.ID.eq(field(LOGS, ID).cast(Long.class))) - .where(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID))) - .orExists(dsl.select().from(nested).where(nested.PARENT_ID.eq(TEST_ITEM.ITEM_ID))))); - } - - return nestedStepSelect.groupBy(TEST_ITEM.ITEM_ID); - } - - private SelectOnConditionStep> buildNestedLogQuery(Long parentId, Queryable filter) { - - Queryable logFilter = filter.getFilterConditions() - .stream() - .flatMap(condition -> condition.getAllConditions().stream()) - .filter(condition -> CRITERIA_STATUS.equalsIgnoreCase(condition.getSearchCriteria())) - .findAny() - .map(condition -> (Queryable) new Filter(filter.getTarget().getClazz(), - filter.getFilterConditions() - .stream() - .flatMap(simpleCondition -> simpleCondition.getAllConditions().stream()) - .filter(filterCondition -> !condition.getSearchCriteria() - .equalsIgnoreCase(filterCondition.getSearchCriteria())) - .collect(toList()) - )) - .orElse(filter); - - QueryBuilder queryBuilder = QueryBuilder.newBuilder(logFilter, QueryUtils.collectJoinFields(logFilter)); - - return dsl.with(LOGS) - .as(queryBuilder.addCondition(LOG.ITEM_ID.eq(parentId)).build()) - .select(LOG.ID.as(ID), LOG.LOG_TIME.as(TIME), DSL.val(LogRepositoryConstants.LOG).as(TYPE), LOG.LOG_LEVEL) - .from(LOG) - .join(LOGS) - .on(fieldName(LOGS, ID).cast(Long.class).eq(LOG.ID)); - } + public static final String ROOT_ITEM_ID = "root_id"; + + private static final String PARENT_ITEM_TABLE = "parent"; + private static final String CHILD_ITEM_TABLE = "child"; + + private DSLContext dsl; + + @Autowired + public void setDsl(DSLContext dsl) { + this.dsl = dsl; + } + + @Override + public boolean hasLogs(Long itemId) { + return dsl.fetchExists(dsl.selectOne().from(LOG).where(LOG.ITEM_ID.eq(itemId))); + } + + @Override + public List findByTestItemId(Long itemId, int limit) { + if (itemId == null || limit <= 0) { + return new ArrayList<>(); + } + + return dsl.select() + .from(LOG) + .leftJoin(ATTACHMENT) + .on(LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)) + .where(LOG.ITEM_ID.eq(itemId)) + .orderBy(LOG.LOG_TIME.asc()) + .limit(limit) + .fetch() + .map(r -> LOG_MAPPER.apply(r, ATTACHMENT_MAPPER)); + } + + @Override + public List findByTestItemId(Long itemId) { + if (itemId == null) { + return new ArrayList<>(); + } + + return dsl.select() + .from(LOG) + .leftJoin(ATTACHMENT) + .on(LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)) + .where(LOG.ITEM_ID.eq(itemId)) + .orderBy(LOG.LOG_TIME.asc()) + .fetch() + .map(r -> LOG_MAPPER.apply(r, ATTACHMENT_MAPPER)); + } + + /** + * @return {@link List} of {@link Log} without {@link Log#getAttachment()} + */ + @Override + public List findAllUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(Long launchId, + List itemIds, int logLevel) { + return buildLogsUnderItemsQuery(launchId, itemIds, false).and( + LOG.LOG_LEVEL.greaterOrEqual(logLevel)) + .fetch() + .map(LOG_UNDER_RECORD_MAPPER); + } + + @Override + public Map> findAllIndexUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte( + Long launchId, List itemIds, int logLevel) { + JTestItem parentItemTable = TEST_ITEM.as(PARENT_ITEM_TABLE); + JTestItem childItemTable = TEST_ITEM.as(CHILD_ITEM_TABLE); + + return INDEX_LOG_FETCHER.apply( + dsl.selectDistinct(LOG.ID, LOG.LOG_LEVEL, LOG.LOG_MESSAGE, LOG.LOG_TIME, + parentItemTable.ITEM_ID.as(ROOT_ITEM_ID), CLUSTERS.INDEX_ID) + .on(LOG.ID) + .from(LOG) + .join(childItemTable) + .on(LOG.ITEM_ID.eq(childItemTable.ITEM_ID)) + .join(parentItemTable) + .on(DSL.sql(childItemTable.PATH + " <@ " + parentItemTable.PATH)) + .leftJoin(CLUSTERS) + .on(LOG.CLUSTER_ID.eq(CLUSTERS.ID)) + .where(childItemTable.LAUNCH_ID.eq(launchId)) + .and(parentItemTable.LAUNCH_ID.eq(launchId)) + .and(parentItemTable.ITEM_ID.in(itemIds)) + .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) + .fetch()); + } + + @Override + public List findLatestUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(Long launchId, + Long itemId, int logLevel, int limit) { + return Lists.reverse( + buildLogsUnderItemsQuery(launchId, Collections.singletonList(itemId), false).and( + LOG.LOG_LEVEL.greaterOrEqual( + logLevel)).orderBy(LOG.LOG_TIME.desc()).limit(limit).fetch() + .map(LOG_UNDER_RECORD_MAPPER)); + } + + @Override + public List findAllUnderTestItemByLaunchIdAndTestItemIdsWithLimit(Long launchId, + List itemIds, int limit) { + return buildLogsUnderItemsQuery(launchId, itemIds, true).limit(limit) + .fetch() + .map(r -> LOG_UNDER_MAPPER.apply(r, ATTACHMENT_MAPPER)); + + } + + @Override + public List findIdsByFilter(Queryable filter) { + Set fields = QueryUtils.collectJoinFields(filter); + return dsl.select(fieldName(ID)).from(QueryBuilder.newBuilder(filter, fields).build()) + .fetchInto(Long.class); + } + + @Override + public List findIdsByTestItemId(Long testItemId) { + return dsl.select(LOG.ID).from(LOG).where(LOG.ITEM_ID.eq(testItemId)).fetchInto(Long.class); + } + + @Override + public List findIdsUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(Long launchId, + List itemIds, int logLevel) { + + JTestItem parentItemTable = TEST_ITEM.as(PARENT_ITEM_TABLE); + JTestItem childItemTable = TEST_ITEM.as(CHILD_ITEM_TABLE); + + return dsl.selectDistinct(LOG.ID) + .from(LOG) + .join(childItemTable) + .on(LOG.ITEM_ID.eq(childItemTable.ITEM_ID)) + .join(parentItemTable) + .on(DSL.sql(childItemTable.PATH + " <@ " + parentItemTable.PATH)) + .where(childItemTable.LAUNCH_ID.eq(launchId)) + .and(parentItemTable.LAUNCH_ID.eq(launchId)) + .and(parentItemTable.ITEM_ID.in(itemIds)) + .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) + .fetchInto(Long.class); + } + + @Override + public List findItemLogIdsByLaunchIdAndLogLevelGte(Long launchId, int logLevel) { + return dsl.select(LOG.ID) + .from(LOG) + .leftJoin(TEST_ITEM) + .on(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) + .join(LAUNCH) + .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) + .where(LAUNCH.ID.eq(launchId)) + .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) + .fetch(LOG.ID, Long.class); + } + + @Override + public List findItemLogIdsByLaunchIdsAndLogLevelGte(List launchIds, int logLevel) { + return dsl.select(LOG.ID) + .from(LOG) + .leftJoin(TEST_ITEM) + .on(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) + .join(LAUNCH) + .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) + .where(LAUNCH.ID.in(launchIds)) + .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) + .fetch(LOG.ID, Long.class); + } + + @Override + public List findIdsByTestItemIdsAndLogLevelGte(List itemIds, int logLevel) { + return dsl.select(LOG.ID) + .from(LOG) + .where(LOG.ITEM_ID.in(itemIds)) + .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) + .fetch(LOG.ID, Long.class); + } + + @Override + public List findByFilter(Queryable filter) { + return LOG_FETCHER.apply(dsl.fetch( + QueryBuilder.newBuilder(filter, QueryUtils.collectJoinFields(filter)).wrap().build())); + } + + @Override + public Page findByFilter(Queryable filter, Pageable pageable) { + Set joinFields = QueryUtils.collectJoinFields(filter, pageable.getSort()); + return PageableExecutionUtils.getPage( + LOG_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter, joinFields) + .with(pageable) + .wrap() + .withWrapperSort(pageable.getSort()) + .build())), pageable, + () -> dsl.fetchCount(QueryBuilder.newBuilder(filter, joinFields).build())); + } + + @Override + public Integer getPageNumber(Long id, Filter filter, Pageable pageable) { + + Sort.Order order = ofNullable(pageable.getSort().getOrderFor(CRITERIA_LOG_TIME)).orElseThrow( + () -> new ReportPortalException( + ErrorType.INCORRECT_SORTING_PARAMETERS)); + + OrderField sortField = + order.getDirection().isAscending() ? LOG.LOG_TIME.asc() : LOG.LOG_TIME.desc(); + + return ofNullable(dsl.select(fieldName(ROW_NUMBER)) + .from(dsl.select(LOG.ID, DSL.rowNumber().over(DSL.orderBy(sortField)).as(ROW_NUMBER)) + .from(LOG) + .join(QueryBuilder.newBuilder(filter, + QueryUtils.collectJoinFields(filter, pageable.getSort())) + .with(pageable.getSort()) + .build() + .asTable(DISTINCT_LOGS_TABLE)) + .on(LOG.ID.eq(fieldName(DISTINCT_LOGS_TABLE, ID).cast(Long.class)))) + .where(fieldName(ID).cast(Long.class).eq(id)) + .fetchAny()).map(r -> { + Long rowNumber = r.into(Long.class); + return BigDecimal.valueOf(rowNumber) + .divide(BigDecimal.valueOf(pageable.getPageSize()), RoundingMode.CEILING).intValue(); + }).orElseThrow(() -> new ReportPortalException(ErrorType.LOG_NOT_FOUND, id)); + + } + + @Override + public boolean hasLogsAddedLately(Duration period, Long launchId, StatusEnum... statuses) { + List jStatuses = Arrays.stream(statuses).map(it -> JStatusEnum.valueOf(it.name())) + .collect(toList()); + return dsl.fetchExists(dsl.selectOne() + .from(LOG) + .join(TEST_ITEM) + .on(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) + .and(TEST_ITEM_RESULTS.STATUS.in(jStatuses)) + .and(LOG.LOG_TIME.gt(TimestampUtils.getTimestampBackFromNow(period))) + .limit(1)); + } + + @Override + public int deleteByPeriodAndTestItemIds(Duration period, Collection testItemIds) { + + return dsl.deleteFrom(LOG) + .where(LOG.ITEM_ID.in(testItemIds) + .and(LOG.LOG_TIME.lt(TimestampUtils.getTimestampBackFromNow(period)))) + .execute(); + } + + @Override + public int deleteByPeriodAndLaunchIds(Duration period, Collection launchIds) { + return dsl.deleteFrom(LOG) + .where(LOG.LAUNCH_ID.in(launchIds) + .and(LOG.LOG_TIME.lt(TimestampUtils.getTimestampBackFromNow(period)))) + .execute(); + } + + @Override + public Page findNestedItems(Long parentId, boolean excludeEmptySteps, + boolean excludeLogs, Queryable filter, + Pageable pageable) { + + SortField sorting = pageable.getSort() + .stream() + .filter(order -> CRITERIA_LOG_TIME.equals(order.getProperty())) + .findFirst() + .filter(order -> !order.isAscending()) + .map(order -> field(TIME).sort(SortOrder.DESC)) + .orElseGet(() -> field(TIME).sort(SortOrder.ASC)); + + SelectOrderByStep> selectQuery = buildNestedStepQuery( + parentId, excludeEmptySteps, filter); + + if (!excludeLogs) { + selectQuery = selectQuery.unionAll(buildNestedLogQuery(parentId, filter)); + } + + int total = dsl.fetchCount(selectQuery); + + return PageableExecutionUtils.getPage(NESTED_ITEM_FETCHER.apply(dsl.fetch(selectQuery.orderBy( + sorting, + field(ID).sort(sorting.getOrder()) + ).limit(pageable.getPageSize()) + .offset(QueryBuilder.retrieveOffsetAndApplyBoundaries(pageable)))), pageable, () -> total); + + } + + @Override + public List findNestedItemsWithPage(Long parentId, boolean excludeEmptySteps, + boolean excludeLogs, + Queryable filter, Pageable pageable) { + + SortField sorting = pageable.getSort() + .stream() + .filter(order -> CRITERIA_LOG_TIME.equals(order.getProperty())) + .findFirst() + .filter(order -> !order.isAscending()) + .map(order -> field(TIME).sort(SortOrder.DESC)) + .orElseGet(() -> field(TIME).sort(SortOrder.ASC)); + + SelectOrderByStep> selectQuery = buildNestedStepQuery( + parentId, excludeEmptySteps, filter); + + if (!excludeLogs) { + selectQuery = selectQuery.unionAll(buildNestedLogQuery(parentId, filter)); + } + + final Table itemsWithPages = DSL.table("item_with_pages"); + + return NESTED_ITEM_LOCATED_FETCHER.apply( + dsl.fetch(dsl.with(itemsWithPages.getName()).as(selectQuery).select( + fieldName(itemsWithPages.getName(), ID), + fieldName(itemsWithPages.getName(), TYPE), + fieldName(itemsWithPages.getName(), LOG_LEVEL), + DSL.rowNumber() + .over(DSL.orderBy(sorting, field(ID).sort(sorting.getOrder()))) + .minus(1) + .div(pageable.getPageSize()) + .plus(1) + .as(PAGE_NUMBER) + ).from(itemsWithPages))); + } + + @Override + public List findMessagesByLaunchIdAndItemIdAndPathAndLevelGte(Long launchId, Long itemId, + String path, Integer level) { + return dsl.select(LOG.LOG_MESSAGE) + .from(LOG) + .join(TEST_ITEM) + .on(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) + .where(LOG.LOG_LEVEL.ge(level) + .and(TEST_ITEM.LAUNCH_ID.eq(launchId)) + .and(TEST_ITEM.ITEM_ID.eq(itemId) + .or(TEST_ITEM.HAS_STATS.eq(false) + .and(DSL.sql(TEST_ITEM.PATH + " <@ cast(? AS LTREE)", path))))) + .fetch(LOG.LOG_MESSAGE); + } + + @Override + public List findIdsByLaunchIdAndItemIdAndPathAndLevelGte(Long launchId, Long itemId, + String path, Integer level) { + return dsl.select(LOG.ID) + .from(LOG) + .join(TEST_ITEM) + .on(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) + .where(LOG.LOG_LEVEL.ge(level) + .and(TEST_ITEM.LAUNCH_ID.eq(launchId)) + .and(TEST_ITEM.ITEM_ID.eq(itemId) + .or(TEST_ITEM.HAS_STATS.eq(false) + .and(DSL.sql(TEST_ITEM.PATH + " <@ cast(? AS LTREE)", path))))) + .fetch(LOG.ID); + } + + @Override + public int deleteByProjectId(Long projectId) { + return dsl.deleteFrom(LOG).where(LOG.PROJECT_ID.eq(projectId)).execute(); + } + + private SelectConditionStep buildLogsUnderItemsQuery(Long launchId, + List itemIds, boolean includeAttachments) { + + JTestItem parentItemTable = TEST_ITEM.as(PARENT_ITEM_TABLE); + JTestItem childItemTable = TEST_ITEM.as(CHILD_ITEM_TABLE); + + List> selectFields = Lists.newArrayList(LOG.ID, + LOG.LOG_LEVEL, + LOG.LOG_MESSAGE, + LOG.LOG_TIME, + parentItemTable.ITEM_ID.as(ROOT_ITEM_ID), + LOG.LAUNCH_ID, + LOG.LAST_MODIFIED, + LOG.PROJECT_ID, + LOG.CLUSTER_ID + ); + + if (includeAttachments) { + Collections.addAll(selectFields, ATTACHMENT.fields()); + } + + SelectOnConditionStep logsSelect = dsl.selectDistinct(selectFields) + .on(LOG.ID, LOG.LOG_TIME) + .from(LOG) + .join(childItemTable) + .on(LOG.ITEM_ID.eq(childItemTable.ITEM_ID)) + .join(parentItemTable) + .on(DSL.sql(childItemTable.PATH + " <@ " + parentItemTable.PATH)); + + if (includeAttachments) { + logsSelect = logsSelect.leftJoin(ATTACHMENT).on(LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)); + } + + return logsSelect.where(childItemTable.LAUNCH_ID.eq(launchId)) + .and(parentItemTable.LAUNCH_ID.eq(launchId)) + .and(parentItemTable.ITEM_ID.in(itemIds)); + } + + private SelectHavingStep> buildNestedStepQuery( + Long parentId, boolean excludeEmptySteps, + Queryable filter) { + + SelectConditionStep> nestedStepSelect = dsl.select( + TEST_ITEM.ITEM_ID.as(ID), + TEST_ITEM.START_TIME.as(TIME), + DSL.val(ITEM).as(TYPE), + DSL.val(0).as(LOG_LEVEL) + ) + .from(TEST_ITEM) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .where(TEST_ITEM.PARENT_ID.eq(parentId)) + .and(TEST_ITEM.HAS_STATS.isFalse()); + + filter.getFilterConditions() + .stream() + .flatMap(condition -> condition.getAllConditions().stream()) + .filter(c -> CRITERIA_STATUS.equals(c.getSearchCriteria())) + .findFirst() + .map(c -> Stream.of(c.getValue().split(",")).filter(StatusEnum::isPresent) + .map(JStatusEnum::valueOf).collect(toList())) + .map(TEST_ITEM_RESULTS.STATUS::in) + .ifPresent(nestedStepSelect::and); + + if (excludeEmptySteps) { + JTestItem nested = TEST_ITEM.as(NESTED); + nestedStepSelect.and(field(DSL.exists(dsl.with(LOGS) + .as(QueryBuilder.newBuilder(filter, QueryUtils.collectJoinFields(filter)) + .addCondition(LOG.ITEM_ID.eq(parentId)) + .build()) + .select() + .from(LOG) + .join(LOGS) + .on(LOG.ID.eq(field(LOGS, ID).cast(Long.class))) + .where(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID))) + .orExists(dsl.select().from(nested).where(nested.PARENT_ID.eq(TEST_ITEM.ITEM_ID))))); + } + + return nestedStepSelect.groupBy(TEST_ITEM.ITEM_ID); + } + + private SelectOnConditionStep> buildNestedLogQuery( + Long parentId, Queryable filter) { + + Queryable logFilter = filter.getFilterConditions() + .stream() + .flatMap(condition -> condition.getAllConditions().stream()) + .filter(condition -> CRITERIA_STATUS.equalsIgnoreCase(condition.getSearchCriteria())) + .findAny() + .map(condition -> (Queryable) new Filter(filter.getTarget().getClazz(), + filter.getFilterConditions() + .stream() + .flatMap(simpleCondition -> simpleCondition.getAllConditions().stream()) + .filter(filterCondition -> !condition.getSearchCriteria() + .equalsIgnoreCase(filterCondition.getSearchCriteria())) + .collect(toList()) + )) + .orElse(filter); + + QueryBuilder queryBuilder = QueryBuilder.newBuilder(logFilter, + QueryUtils.collectJoinFields(logFilter)); + + return dsl.with(LOGS) + .as(queryBuilder.addCondition(LOG.ITEM_ID.eq(parentId)).build()) + .select(LOG.ID.as(ID), LOG.LOG_TIME.as(TIME), DSL.val(LogRepositoryConstants.LOG).as(TYPE), + LOG.LOG_LEVEL) + .from(LOG) + .join(LOGS) + .on(fieldName(LOGS, ID).cast(Long.class).eq(LOG.ID)); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/OAuth2AccessTokenRepository.java b/src/main/java/com/epam/ta/reportportal/dao/OAuth2AccessTokenRepository.java index 4eedf8f77..0b8cea35c 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/OAuth2AccessTokenRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/OAuth2AccessTokenRepository.java @@ -17,46 +17,47 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.user.StoredAccessToken; -import org.springframework.stereotype.Repository; - import java.util.stream.Stream; +import org.springframework.stereotype.Repository; /** * @author Pavel Bortnik */ @Repository -public interface OAuth2AccessTokenRepository extends ReportPortalRepository { - - /** - * Find entity by token id - * - * @param tokenId token id - * @return {@link StoredAccessToken} - */ - StoredAccessToken findByTokenId(String tokenId); - - /** - * Find entity by authentication id - * - * @param authenticationId authentication id - * @return {@link StoredAccessToken} - */ - StoredAccessToken findByAuthenticationId(String authenticationId); - - /** - * Find entity by client id and username - * - * @param clientId Client id - * @param userName Username - * @return Stream of {@link StoredAccessToken} - */ - Stream findByClientIdAndUserName(String clientId, String userName); - - /** - * Find entity by client id - * @param clientId client id - * @return Stream of {@link StoredAccessToken} - */ - Stream findByClientId(String clientId); +public interface OAuth2AccessTokenRepository extends + ReportPortalRepository { + + /** + * Find entity by token id + * + * @param tokenId token id + * @return {@link StoredAccessToken} + */ + StoredAccessToken findByTokenId(String tokenId); + + /** + * Find entity by authentication id + * + * @param authenticationId authentication id + * @return {@link StoredAccessToken} + */ + StoredAccessToken findByAuthenticationId(String authenticationId); + + /** + * Find entity by client id and username + * + * @param clientId Client id + * @param userName Username + * @return Stream of {@link StoredAccessToken} + */ + Stream findByClientIdAndUserName(String clientId, String userName); + + /** + * Find entity by client id + * + * @param clientId client id + * @return Stream of {@link StoredAccessToken} + */ + Stream findByClientId(String clientId); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRepository.java b/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRepository.java index 3684a038a..1694b91ab 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRepository.java @@ -18,5 +18,7 @@ import com.epam.ta.reportportal.entity.oauth.OAuthRegistration; -public interface OAuthRegistrationRepository extends ReportPortalRepository, OAuthRegistrationRepositoryCustom { +public interface OAuthRegistrationRepository extends + ReportPortalRepository, OAuthRegistrationRepositoryCustom { + } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRepositoryCustom.java index dba7734ba..512cb5c62 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRepositoryCustom.java @@ -20,4 +20,5 @@ * @author Ivan Budayeu */ public interface OAuthRegistrationRepositoryCustom { + } diff --git a/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRepositoryCustomImpl.java index b7fe29360..232e6eee0 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRepositoryCustomImpl.java @@ -23,4 +23,5 @@ */ @Repository public class OAuthRegistrationRepositoryCustomImpl implements OAuthRegistrationRepositoryCustom { + } diff --git a/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRestrictionRepository.java b/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRestrictionRepository.java index afd621b2b..c41b452bd 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRestrictionRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRestrictionRepository.java @@ -17,12 +17,14 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.oauth.OAuthRegistrationRestriction; - import java.util.List; /** * @author Anton Machulski */ -public interface OAuthRegistrationRestrictionRepository extends ReportPortalRepository, OAuthRegistrationRestrictionRepositoryCustom { - List findByRegistrationId(String id); +public interface OAuthRegistrationRestrictionRepository extends + ReportPortalRepository, + OAuthRegistrationRestrictionRepositoryCustom { + + List findByRegistrationId(String id); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRestrictionRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRestrictionRepositoryCustom.java index f8bb7c4ff..f83ff07a1 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRestrictionRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRestrictionRepositoryCustom.java @@ -20,4 +20,5 @@ * @author Anton Machulski */ public interface OAuthRegistrationRestrictionRepositoryCustom { + } diff --git a/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRestrictionRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRestrictionRepositoryCustomImpl.java index 92efaec0f..d8dbd7d3d 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRestrictionRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/OAuthRegistrationRestrictionRepositoryCustomImpl.java @@ -22,5 +22,7 @@ * @author Anton Machulski */ @Repository -public class OAuthRegistrationRestrictionRepositoryCustomImpl implements OAuthRegistrationRestrictionRepositoryCustom { +public class OAuthRegistrationRestrictionRepositoryCustomImpl implements + OAuthRegistrationRestrictionRepositoryCustom { + } diff --git a/src/main/java/com/epam/ta/reportportal/dao/OnboardingRepository.java b/src/main/java/com/epam/ta/reportportal/dao/OnboardingRepository.java index a6d19edd1..f10ae6eea 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/OnboardingRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/OnboardingRepository.java @@ -15,14 +15,13 @@ */ package com.epam.ta.reportportal.dao; -import com.epam.ta.reportportal.entity.onboarding.Onboarding; -import org.jooq.DSLContext; -import org.springframework.stereotype.Repository; +import static com.epam.ta.reportportal.jooq.tables.JOnboarding.ONBOARDING; +import com.epam.ta.reportportal.entity.onboarding.Onboarding; import java.sql.Timestamp; import java.time.Instant; - -import static com.epam.ta.reportportal.jooq.tables.JOnboarding.ONBOARDING; +import org.jooq.DSLContext; +import org.springframework.stereotype.Repository; /** * @author Antonov Maksim @@ -30,17 +29,17 @@ @Repository public class OnboardingRepository { - private final DSLContext dsl; + private final DSLContext dsl; - public OnboardingRepository(DSLContext dsl) { - this.dsl = dsl; - } + public OnboardingRepository(DSLContext dsl) { + this.dsl = dsl; + } - public Onboarding findAvailableOnboardingByPage(String page) { - return dsl.select(ONBOARDING.fields()) - .from(ONBOARDING) - .where(ONBOARDING.PAGE.eq(page)) - .and(ONBOARDING.AVAILABLE_TO.ge(Timestamp.from(Instant.now()))) - .fetchOneInto(Onboarding.class); - } + public Onboarding findAvailableOnboardingByPage(String page) { + return dsl.select(ONBOARDING.fields()) + .from(ONBOARDING) + .where(ONBOARDING.PAGE.eq(page)) + .and(ONBOARDING.AVAILABLE_TO.ge(Timestamp.from(Instant.now()))) + .fetchOneInto(Onboarding.class); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepository.java b/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepository.java index 4aeef8163..fd5e55374 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepository.java @@ -17,29 +17,29 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.pattern.PatternTemplate; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; - import java.util.List; import java.util.Optional; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; /** * @author Ivan Budayeu */ -public interface PatternTemplateRepository extends ReportPortalRepository, PatternTemplateRepositoryCustom { +public interface PatternTemplateRepository extends ReportPortalRepository, + PatternTemplateRepositoryCustom { - Optional findByIdAndProjectId(Long id, Long projectId); + Optional findByIdAndProjectId(Long id, Long projectId); - List findAllByProjectIdAndEnabled(Long projectId, boolean enabled); + List findAllByProjectIdAndEnabled(Long projectId, boolean enabled); - boolean existsByProjectIdAndNameIgnoreCase(Long projectId, String name); + boolean existsByProjectIdAndNameIgnoreCase(Long projectId, String name); - /** - * Required for regex validation on database level. Some regex patterns can be compiled by Java {@link java.util.regex.Pattern} being - * incorrect for PostgreSQL regex syntax and vice versa - * - * @param regex Regex pattern - */ - @Query(value = "SELECT '' ~ :regex", nativeQuery = true) - void validateRegex(@Param("regex") String regex); + /** + * Required for regex validation on database level. Some regex patterns can be compiled by Java + * {@link java.util.regex.Pattern} being incorrect for PostgreSQL regex syntax and vice versa + * + * @param regex Regex pattern + */ + @Query(value = "SELECT '' ~ :regex", nativeQuery = true) + void validateRegex(@Param("regex") String regex); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustom.java index 23ab4c04d..a0d0fe798 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustom.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.pattern.PatternTemplateTestItemPojo; - import java.util.List; /** @@ -25,5 +24,5 @@ */ public interface PatternTemplateRepositoryCustom { - int saveInBatch(List patternTemplateTestItemPojos); + int saveInBatch(List patternTemplateTestItemPojos); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustomImpl.java index 588af7c2f..d50151092 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustomImpl.java @@ -16,34 +16,35 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM; + import com.epam.ta.reportportal.entity.pattern.PatternTemplateTestItemPojo; import com.epam.ta.reportportal.jooq.tables.records.JPatternTemplateTestItemRecord; +import java.util.List; import org.jooq.DSLContext; import org.jooq.InsertValuesStep2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import java.util.List; - -import static com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM; - /** * @author Ivan Budayeu */ @Repository public class PatternTemplateRepositoryCustomImpl implements PatternTemplateRepositoryCustom { - @Autowired - private DSLContext dslContext; + @Autowired + private DSLContext dslContext; - @Override - public int saveInBatch(List patternTemplateTestItems) { + @Override + public int saveInBatch(List patternTemplateTestItems) { - InsertValuesStep2 columns = dslContext.insertInto(PATTERN_TEMPLATE_TEST_ITEM) - .columns(PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID, PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID); + InsertValuesStep2 columns = dslContext.insertInto( + PATTERN_TEMPLATE_TEST_ITEM) + .columns(PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID, PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID); - patternTemplateTestItems.forEach(pojo -> columns.values(pojo.getPatternTemplateId(), pojo.getTestItemId())); + patternTemplateTestItems.forEach( + pojo -> columns.values(pojo.getPatternTemplateId(), pojo.getTestItemId())); - return columns.execute(); - } + return columns.execute(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java index 75a43ed6d..1600fe21f 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ProjectRepository.java @@ -17,24 +17,23 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.project.Project; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; -import org.springframework.security.core.parameters.P; - import java.util.List; import java.util.Optional; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; -public interface ProjectRepository extends ReportPortalRepository, ProjectRepositoryCustom { +public interface ProjectRepository extends ReportPortalRepository, + ProjectRepositoryCustom { - Optional findByName(String name); + Optional findByName(String name); - boolean existsByName(String name); + boolean existsByName(String name); - @Query(value = "SELECT p.* FROM project p JOIN project_user pu on p.id = pu.project_id JOIN users u on pu.user_id = u.id WHERE u.login = :login", nativeQuery = true) - List findUserProjects(@Param("login") String login); + @Query(value = "SELECT p.* FROM project p JOIN project_user pu on p.id = pu.project_id JOIN users u on pu.user_id = u.id WHERE u.login = :login", nativeQuery = true) + List findUserProjects(@Param("login") String login); - @Query(value = "SELECT * FROM project p JOIN project_user pu on p.id = pu.project_id JOIN users u on pu.user_id = u.id WHERE u.login = :login AND p.project_type = :projectType", nativeQuery = true) - List findUserProjects(@Param("login") String login, @Param("projectType") String projectType); + @Query(value = "SELECT * FROM project p JOIN project_user pu on p.id = pu.project_id JOIN users u on pu.user_id = u.id WHERE u.login = :login AND p.project_type = :projectType", nativeQuery = true) + List findUserProjects(@Param("login") String login, + @Param("projectType") String projectType); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ProjectRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/ProjectRepositoryCustom.java index d47c9a326..295d6030d 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ProjectRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ProjectRepositoryCustom.java @@ -22,76 +22,75 @@ import com.epam.ta.reportportal.entity.project.Project; import com.epam.ta.reportportal.entity.project.ProjectAttribute; import com.epam.ta.reportportal.entity.project.ProjectInfo; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; - import java.time.LocalDateTime; import java.util.List; import java.util.Optional; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; /** * @author Pavel Bortnik */ public interface ProjectRepositoryCustom extends FilterableRepository { - /** - * Find project entity without fetching related entities - * - * @param name Project name to search - * @return {@link Optional} with {@link Project} - */ - Optional findRawByName(String name); + /** + * Find project entity without fetching related entities + * + * @param name Project name to search + * @return {@link Optional} with {@link Project} + */ + Optional findRawByName(String name); - /** - * Find projects info by filter - * - * @param filter Filter - * @return List of project info objects - */ - List findProjectInfoByFilter(Queryable filter); + /** + * Find projects info by filter + * + * @param filter Filter + * @return List of project info objects + */ + List findProjectInfoByFilter(Queryable filter); - /** - * Find projects info by filter with paging - * - * @param filter Filter - * @param pageable Paging - * @return Page of project info objects - */ - Page findProjectInfoByFilter(Queryable filter, Pageable pageable); + /** + * Find projects info by filter with paging + * + * @param filter Filter + * @param pageable Paging + * @return Page of project info objects + */ + Page findProjectInfoByFilter(Queryable filter, Pageable pageable); - /** - * Find all project names - * - * @return List of project names - */ - List findAllProjectNames(); + /** + * Find all project names + * + * @return List of project names + */ + List findAllProjectNames(); - /** - * Find all project names, which contain provided term - * - * @return List of project names - */ - List findAllProjectNamesByTerm(String term); + /** + * Find all project names, which contain provided term + * + * @return List of project names + */ + List findAllProjectNamesByTerm(String term); - List findAllByUserLogin(String login); + List findAllByUserLogin(String login); - /** - * Get {@link Page} of {@link Project#getId()} with attributes - * - * @param pageable {@link Pageable} - * @return {@link Page} of {@link Project}s that contain only - * {@link Project#getId()}, {@link Attribute#getName()} - * and {@link ProjectAttribute#getValue()} - */ - Page findAllIdsAndProjectAttributes(Pageable pageable); + /** + * Get {@link Page} of {@link Project#getId()} with attributes + * + * @param pageable {@link Pageable} + * @return {@link Page} of {@link Project}s that contain only {@link Project#getId()}, + * {@link Attribute#getName()} and {@link ProjectAttribute#getValue()} + */ + Page findAllIdsAndProjectAttributes(Pageable pageable); - /** - * Delete {@code limit} project with specified {@code projectType} and last launch run before {@code bound} - * - * @param projectType - * @param bound - * @param limit - * @return number of deleted projects - */ - int deleteByTypeAndLastLaunchRunBefore(ProjectType projectType, LocalDateTime bound, int limit); + /** + * Delete {@code limit} project with specified {@code projectType} and last launch run before + * {@code bound} + * + * @param projectType + * @param bound + * @param limit + * @return number of deleted projects + */ + int deleteByTypeAndLastLaunchRunBefore(ProjectType projectType, LocalDateTime bound, int limit); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ProjectRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/ProjectRepositoryCustomImpl.java index 67bdf41d2..ff2122aaa 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ProjectRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ProjectRepositoryCustomImpl.java @@ -16,12 +16,28 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; +import static com.epam.ta.reportportal.dao.util.QueryUtils.collectJoinFields; +import static com.epam.ta.reportportal.dao.util.RecordMappers.PROJECT_MAPPER; +import static com.epam.ta.reportportal.dao.util.ResultFetchers.PROJECT_FETCHER; +import static com.epam.ta.reportportal.jooq.Tables.ATTRIBUTE; +import static com.epam.ta.reportportal.jooq.Tables.LAUNCH; +import static com.epam.ta.reportportal.jooq.Tables.PROJECT; +import static com.epam.ta.reportportal.jooq.Tables.PROJECT_ATTRIBUTE; +import static com.epam.ta.reportportal.jooq.Tables.PROJECT_USER; +import static com.epam.ta.reportportal.jooq.Tables.USERS; +import static org.jooq.impl.DSL.name; + import com.epam.ta.reportportal.commons.querygen.FilterTarget; import com.epam.ta.reportportal.commons.querygen.QueryBuilder; import com.epam.ta.reportportal.commons.querygen.Queryable; import com.epam.ta.reportportal.entity.enums.ProjectType; import com.epam.ta.reportportal.entity.project.Project; import com.epam.ta.reportportal.entity.project.ProjectInfo; +import java.sql.Timestamp; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Optional; import org.jooq.DSLContext; import org.jooq.impl.DSL; import org.springframework.beans.factory.annotation.Autowired; @@ -30,114 +46,108 @@ import org.springframework.data.repository.support.PageableExecutionUtils; import org.springframework.stereotype.Repository; -import java.sql.Timestamp; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Optional; - -import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; -import static com.epam.ta.reportportal.dao.util.QueryUtils.collectJoinFields; -import static com.epam.ta.reportportal.dao.util.RecordMappers.PROJECT_MAPPER; -import static com.epam.ta.reportportal.dao.util.ResultFetchers.PROJECT_FETCHER; -import static com.epam.ta.reportportal.jooq.Tables.*; -import static org.jooq.impl.DSL.name; - @Repository public class ProjectRepositoryCustomImpl implements ProjectRepositoryCustom { - private static final String FILTERED_PROJECT = "filtered_project"; - - @Autowired - private DSLContext dsl; - - @Override - public List findByFilter(Queryable filter) { - return PROJECT_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter, collectJoinFields(filter)).wrap().build())); - } - - @Override - public Page findByFilter(Queryable filter, Pageable pageable) { - return PageableExecutionUtils.getPage(PROJECT_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter, - collectJoinFields(filter, pageable.getSort()) - ).with(pageable).wrap().withWrapperSort(pageable.getSort()).build())), - pageable, - () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build()) - ); - } - - @Override - public Optional findRawByName(String name) { - return dsl.select(PROJECT.fields()).from(PROJECT).where(PROJECT.NAME.eq(name)).fetchOptional(PROJECT_MAPPER); - } - - @Override - public List findProjectInfoByFilter(Queryable filter) { - return dsl.fetch(QueryBuilder.newBuilder(filter).build()).into(ProjectInfo.class); - } - - @Override - public Page findProjectInfoByFilter(Queryable filter, Pageable pageable) { - return PageableExecutionUtils.getPage(dsl.fetch(QueryBuilder.newBuilder(filter).with(pageable).build()).into(ProjectInfo.class), - pageable, - () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build()) - ); - } - - @Override - public List findAllProjectNames() { - return dsl.select(PROJECT.NAME).from(PROJECT).fetchInto(String.class); - } - - @Override - public List findAllProjectNamesByTerm(String term) { - return dsl.select(PROJECT.NAME) - .from(PROJECT) - .where(PROJECT.NAME.likeIgnoreCase("%" + DSL.escape(term, '\\') + "%")) - .fetchInto(String.class); - } - - @Override - public List findAllByUserLogin(String login) { - return PROJECT_FETCHER.apply(dsl.select(PROJECT.fields()) - .from(PROJECT) - .join(PROJECT_USER) - .on(PROJECT.ID.eq(PROJECT_USER.PROJECT_ID)) - .join(USERS) - .on(PROJECT_USER.USER_ID.eq(USERS.ID)) - .where(USERS.LOGIN.eq(login)) - .fetch()); - } - - @Override - public Page findAllIdsAndProjectAttributes(Pageable pageable) { - - return PageableExecutionUtils.getPage(PROJECT_FETCHER.apply(dsl.fetch(dsl.with(FILTERED_PROJECT) - .as(QueryBuilder.newBuilder(FilterTarget.PROJECT_TARGET, collectJoinFields(pageable.getSort())).with(pageable).build()) - .select(PROJECT.ID, ATTRIBUTE.NAME, PROJECT_ATTRIBUTE.VALUE) - .from(PROJECT) - .join(PROJECT_ATTRIBUTE) - .on(PROJECT.ID.eq(PROJECT_ATTRIBUTE.PROJECT_ID)) - .join(ATTRIBUTE) - .on(PROJECT_ATTRIBUTE.ATTRIBUTE_ID.eq(ATTRIBUTE.ID)) - .join(DSL.table(name(FILTERED_PROJECT))) - .on(fieldName(FILTERED_PROJECT, PROJECT.ID.getName()).cast(Long.class).eq(PROJECT.ID)))), - pageable, - () -> dsl.fetchCount(QueryBuilder.newBuilder(FilterTarget.PROJECT_TARGET).build()) - ); - } - - @Override - public int deleteByTypeAndLastLaunchRunBefore(ProjectType projectType, LocalDateTime bound, int limit) { - return dsl.deleteFrom(PROJECT) - .where(PROJECT.ID.in(dsl.select(PROJECT.ID) - .from(PROJECT) - .join(LAUNCH) - .onKey() - .where(PROJECT.PROJECT_TYPE.eq(projectType.name())) - .groupBy(PROJECT.ID) - .having(DSL.max(LAUNCH.START_TIME).le(Timestamp.valueOf(bound))) - .limit(limit))) - .execute(); - } + private static final String FILTERED_PROJECT = "filtered_project"; + + @Autowired + private DSLContext dsl; + + @Override + public List findByFilter(Queryable filter) { + return PROJECT_FETCHER.apply( + dsl.fetch(QueryBuilder.newBuilder(filter, collectJoinFields(filter)).wrap().build())); + } + + @Override + public Page findByFilter(Queryable filter, Pageable pageable) { + return PageableExecutionUtils.getPage( + PROJECT_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter, + collectJoinFields(filter, pageable.getSort()) + ).with(pageable).wrap().withWrapperSort(pageable.getSort()).build())), + pageable, + () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build()) + ); + } + + @Override + public Optional findRawByName(String name) { + return dsl.select(PROJECT.fields()).from(PROJECT).where(PROJECT.NAME.eq(name)) + .fetchOptional(PROJECT_MAPPER); + } + + @Override + public List findProjectInfoByFilter(Queryable filter) { + return dsl.fetch(QueryBuilder.newBuilder(filter).build()).into(ProjectInfo.class); + } + + @Override + public Page findProjectInfoByFilter(Queryable filter, Pageable pageable) { + return PageableExecutionUtils.getPage( + dsl.fetch(QueryBuilder.newBuilder(filter).with(pageable).build()).into(ProjectInfo.class), + pageable, + () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build()) + ); + } + + @Override + public List findAllProjectNames() { + return dsl.select(PROJECT.NAME).from(PROJECT).fetchInto(String.class); + } + + @Override + public List findAllProjectNamesByTerm(String term) { + return dsl.select(PROJECT.NAME) + .from(PROJECT) + .where(PROJECT.NAME.likeIgnoreCase("%" + DSL.escape(term, '\\') + "%")) + .fetchInto(String.class); + } + + @Override + public List findAllByUserLogin(String login) { + return PROJECT_FETCHER.apply(dsl.select(PROJECT.fields()) + .from(PROJECT) + .join(PROJECT_USER) + .on(PROJECT.ID.eq(PROJECT_USER.PROJECT_ID)) + .join(USERS) + .on(PROJECT_USER.USER_ID.eq(USERS.ID)) + .where(USERS.LOGIN.eq(login)) + .fetch()); + } + + @Override + public Page findAllIdsAndProjectAttributes(Pageable pageable) { + + return PageableExecutionUtils.getPage(PROJECT_FETCHER.apply(dsl.fetch(dsl.with(FILTERED_PROJECT) + .as(QueryBuilder.newBuilder(FilterTarget.PROJECT_TARGET, + collectJoinFields(pageable.getSort())).with(pageable).build()) + .select(PROJECT.ID, ATTRIBUTE.NAME, PROJECT_ATTRIBUTE.VALUE) + .from(PROJECT) + .join(PROJECT_ATTRIBUTE) + .on(PROJECT.ID.eq(PROJECT_ATTRIBUTE.PROJECT_ID)) + .join(ATTRIBUTE) + .on(PROJECT_ATTRIBUTE.ATTRIBUTE_ID.eq(ATTRIBUTE.ID)) + .join(DSL.table(name(FILTERED_PROJECT))) + .on(fieldName(FILTERED_PROJECT, PROJECT.ID.getName()).cast(Long.class).eq(PROJECT.ID)))), + pageable, + () -> dsl.fetchCount(QueryBuilder.newBuilder(FilterTarget.PROJECT_TARGET).build()) + ); + } + + @Override + public int deleteByTypeAndLastLaunchRunBefore(ProjectType projectType, LocalDateTime bound, + int limit) { + return dsl.deleteFrom(PROJECT) + .where(PROJECT.ID.in(dsl.select(PROJECT.ID) + .from(PROJECT) + .join(LAUNCH) + .onKey() + .where(PROJECT.PROJECT_TYPE.eq(projectType.name())) + .groupBy(PROJECT.ID) + .having(DSL.max(LAUNCH.START_TIME).le(Timestamp.valueOf(bound))) + .limit(limit))) + .execute(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ProjectUserRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ProjectUserRepository.java index d0ee1b0e1..b92cb48d0 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ProjectUserRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ProjectUserRepository.java @@ -22,5 +22,7 @@ /** * @author Pavel Bortnik */ -public interface ProjectUserRepository extends ReportPortalRepository, ProjectUserRepositoryCustom { +public interface ProjectUserRepository extends ReportPortalRepository, + ProjectUserRepositoryCustom { + } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ProjectUserRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/ProjectUserRepositoryCustom.java index 3985be589..8164b9ddf 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ProjectUserRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ProjectUserRepositoryCustom.java @@ -1,9 +1,10 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.commons.ReportPortalUser; - import java.util.Optional; public interface ProjectUserRepositoryCustom { - Optional findDetailsByUserIdAndProjectName(Long userId, String projectName); + + Optional findDetailsByUserIdAndProjectName(Long userId, + String projectName); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ProjectUserRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/ProjectUserRepositoryCustomImpl.java index 46cfd9ff4..f03e03bad 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ProjectUserRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ProjectUserRepositoryCustomImpl.java @@ -1,34 +1,34 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.dao.util.RecordMappers.PROJECT_DETAILS_MAPPER; +import static com.epam.ta.reportportal.jooq.Tables.PROJECT; +import static com.epam.ta.reportportal.jooq.Tables.PROJECT_USER; + import com.epam.ta.reportportal.commons.ReportPortalUser; +import java.util.Optional; import org.jooq.DSLContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import java.util.Optional; - -import static com.epam.ta.reportportal.dao.util.RecordMappers.PROJECT_DETAILS_MAPPER; -import static com.epam.ta.reportportal.jooq.Tables.PROJECT; -import static com.epam.ta.reportportal.jooq.Tables.PROJECT_USER; - @Repository public class ProjectUserRepositoryCustomImpl implements ProjectUserRepositoryCustom { - private final DSLContext dsl; + private final DSLContext dsl; - @Autowired - public ProjectUserRepositoryCustomImpl(DSLContext dsl) { - this.dsl = dsl; - } + @Autowired + public ProjectUserRepositoryCustomImpl(DSLContext dsl) { + this.dsl = dsl; + } - @Override - public Optional findDetailsByUserIdAndProjectName(Long userId, String projectName) { - return dsl.select(PROJECT_USER.PROJECT_ID, PROJECT_USER.PROJECT_ROLE, PROJECT.NAME) - .from(PROJECT_USER) - .join(PROJECT) - .on(PROJECT_USER.PROJECT_ID.eq(PROJECT.ID)) - .where(PROJECT_USER.USER_ID.eq(userId)) - .and(PROJECT.NAME.eq(projectName)) - .fetchOptional(PROJECT_DETAILS_MAPPER); - } + @Override + public Optional findDetailsByUserIdAndProjectName(Long userId, + String projectName) { + return dsl.select(PROJECT_USER.PROJECT_ID, PROJECT_USER.PROJECT_ROLE, PROJECT.NAME) + .from(PROJECT_USER) + .join(PROJECT) + .on(PROJECT_USER.PROJECT_ID.eq(PROJECT.ID)) + .where(PROJECT_USER.USER_ID.eq(userId)) + .and(PROJECT.NAME.eq(projectName)) + .fetchOptional(PROJECT_DETAILS_MAPPER); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ReportPortalRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ReportPortalRepository.java index bcfb2be4e..9c06e2c87 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ReportPortalRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ReportPortalRepository.java @@ -17,19 +17,18 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.commons.querygen.Filter; +import java.io.Serializable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.NoRepositoryBean; -import java.io.Serializable; - /** * @author Pavel Bortnik */ @NoRepositoryBean public interface ReportPortalRepository extends JpaRepository { - void refresh(T t); + void refresh(T t); - boolean exists(Filter filter); + boolean exists(Filter filter); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ReportPortalRepositoryImpl.java b/src/main/java/com/epam/ta/reportportal/dao/ReportPortalRepositoryImpl.java index d05fd51dc..343ca2cc0 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ReportPortalRepositoryImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ReportPortalRepositoryImpl.java @@ -17,43 +17,44 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.commons.querygen.Filter; +import java.io.Serializable; +import javax.persistence.EntityManager; import org.jooq.DSLContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.jpa.repository.support.JpaEntityInformation; import org.springframework.data.jpa.repository.support.SimpleJpaRepository; import org.springframework.transaction.annotation.Transactional; -import javax.persistence.EntityManager; -import java.io.Serializable; - /** * @author Pavel Bortnik */ -public class ReportPortalRepositoryImpl extends SimpleJpaRepository - implements ReportPortalRepository { - - private final EntityManager entityManager; - - private DSLContext dsl; - - @Autowired - public void setDsl(DSLContext dsl) { - this.dsl = dsl; - } - - public ReportPortalRepositoryImpl(JpaEntityInformation entityInformation, EntityManager entityManager) { - super(entityInformation, entityManager); - this.entityManager = entityManager; - } - - @Override - @Transactional - public void refresh(T t) { - entityManager.refresh(t); - } - - @Override - public boolean exists(Filter filter) { - return dsl.fetchExists(filter.toQuery().get()); - } +public class ReportPortalRepositoryImpl extends + SimpleJpaRepository + implements ReportPortalRepository { + + private final EntityManager entityManager; + + private DSLContext dsl; + + public ReportPortalRepositoryImpl(JpaEntityInformation entityInformation, + EntityManager entityManager) { + super(entityInformation, entityManager); + this.entityManager = entityManager; + } + + @Autowired + public void setDsl(DSLContext dsl) { + this.dsl = dsl; + } + + @Override + @Transactional + public void refresh(T t) { + entityManager.refresh(t); + } + + @Override + public boolean exists(Filter filter) { + return dsl.fetchExists(filter.toQuery().get()); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/RestorePasswordBidRepository.java b/src/main/java/com/epam/ta/reportportal/dao/RestorePasswordBidRepository.java index 3e46fe522..14c03c725 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/RestorePasswordBidRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/RestorePasswordBidRepository.java @@ -17,19 +17,19 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.user.RestorePasswordBid; - import java.util.Optional; /** * @author Ivan Budaev */ -public interface RestorePasswordBidRepository extends ReportPortalRepository { +public interface RestorePasswordBidRepository extends + ReportPortalRepository { - /** - * Finds bid by specified email - * - * @param email email - * @return Optional - */ - Optional findByEmail(String email); + /** + * Finds bid by specified email + * + * @param email email + * @return Optional + */ + Optional findByEmail(String email); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java b/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java index f77866f21..47fcc17c3 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/SenderCaseRepository.java @@ -1,26 +1,26 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.project.email.SenderCase; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; - import java.util.Collection; import java.util.List; import java.util.Optional; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; public interface SenderCaseRepository extends ReportPortalRepository { - @Query(value = "SELECT sc FROM SenderCase sc WHERE sc.project.id = :projectId ORDER BY sc.id") - List findAllByProjectId(@Param(value = "projectId") Long projectId); + @Query(value = "SELECT sc FROM SenderCase sc WHERE sc.project.id = :projectId ORDER BY sc.id") + List findAllByProjectId(@Param(value = "projectId") Long projectId); - Optional findByProjectIdAndRuleNameIgnoreCase(Long projectId, String ruleName); + Optional findByProjectIdAndRuleNameIgnoreCase(Long projectId, String ruleName); - @Modifying - @Query(value = "DELETE FROM recipients WHERE sender_case_id = :id AND recipient IN (:recipients)", nativeQuery = true) - int deleteRecipients(@Param(value = "id") Long id, @Param(value = "recipients") Collection recipients); + @Modifying + @Query(value = "DELETE FROM recipients WHERE sender_case_id = :id AND recipient IN (:recipients)", nativeQuery = true) + int deleteRecipients(@Param(value = "id") Long id, + @Param(value = "recipients") Collection recipients); - @Modifying - @Query(value = "DELETE FROM sender_case WHERE id = :id", nativeQuery = true) - int deleteSenderCaseById(@Param(value = "id") Long id); + @Modifying + @Query(value = "DELETE FROM sender_case WHERE id = :id", nativeQuery = true) + int deleteSenderCaseById(@Param(value = "id") Long id); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ServerSettingsRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ServerSettingsRepository.java index 2c529b083..dae78ff78 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ServerSettingsRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ServerSettingsRepository.java @@ -17,17 +17,17 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.ServerSettings; -import org.springframework.data.jpa.repository.Query; - import java.util.Optional; +import org.springframework.data.jpa.repository.Query; /** * @author Ivan Budaev */ -public interface ServerSettingsRepository extends ReportPortalRepository, ServerSettingsRepositoryCustom { +public interface ServerSettingsRepository extends ReportPortalRepository, + ServerSettingsRepositoryCustom { - @Query(value = "INSERT INTO server_settings (key, value) VALUES ('secret.key', gen_random_bytes(32)) RETURNING value", nativeQuery = true) - String generateSecret(); + @Query(value = "INSERT INTO server_settings (key, value) VALUES ('secret.key', gen_random_bytes(32)) RETURNING value", nativeQuery = true) + String generateSecret(); - Optional findByKey(String key); + Optional findByKey(String key); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ServerSettingsRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/ServerSettingsRepositoryCustom.java index 263eba354..5134ec4da 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ServerSettingsRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ServerSettingsRepositoryCustom.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.ServerSettings; - import java.util.List; /** @@ -25,6 +24,6 @@ */ public interface ServerSettingsRepositoryCustom { - List selectServerSettings(); + List selectServerSettings(); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ServerSettingsRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/ServerSettingsRepositoryCustomImpl.java index c9e225a7f..d31eba5d1 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ServerSettingsRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ServerSettingsRepositoryCustomImpl.java @@ -16,36 +16,34 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.jooq.tables.JServerSettings.SERVER_SETTINGS; + import com.epam.ta.reportportal.entity.ServerSettings; +import java.util.List; import org.jooq.DSLContext; import org.jooq.impl.DSL; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import java.util.List; - -import static com.epam.ta.reportportal.jooq.tables.JServerSettings.SERVER_SETTINGS; - /** * @author Ivan Budaev */ @Repository public class ServerSettingsRepositoryCustomImpl implements ServerSettingsRepositoryCustom { - private final DSLContext dsl; - - static final String SERVER_SETTING_KEY = "server."; - - @Autowired - public ServerSettingsRepositoryCustomImpl(DSLContext dsl) { - this.dsl = dsl; - } - - @Override - public List selectServerSettings() { - return dsl.select() - .from(SERVER_SETTINGS) - .where(SERVER_SETTINGS.KEY.like(DSL.escape(SERVER_SETTING_KEY, '\\') + "%")) - .fetchInto(ServerSettings.class); - } + static final String SERVER_SETTING_KEY = "server."; + private final DSLContext dsl; + + @Autowired + public ServerSettingsRepositoryCustomImpl(DSLContext dsl) { + this.dsl = dsl; + } + + @Override + public List selectServerSettings() { + return dsl.select() + .from(SERVER_SETTINGS) + .where(SERVER_SETTINGS.KEY.like(DSL.escape(SERVER_SETTING_KEY, '\\') + "%")) + .fetchInto(ServerSettings.class); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ShareableEntityRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ShareableEntityRepository.java index faab872c4..a2a4081c9 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ShareableEntityRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ShareableEntityRepository.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.ShareableEntity; - import java.util.List; /** @@ -25,13 +24,13 @@ */ public interface ShareableEntityRepository extends ReportPortalRepository { - /** - * Find all shareable entities on project with share status - * - * @param projectId Project id - * @param shared Shared or not - * @return List of shareable entities - */ - List findAllByProjectIdAndShared(Long projectId, boolean shared); + /** + * Find all shareable entities on project with share status + * + * @param projectId Project id + * @param shared Shared or not + * @return List of shareable entities + */ + List findAllByProjectIdAndShared(Long projectId, boolean shared); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ShareableRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ShareableRepository.java index 7eae21ffa..01d524c89 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ShareableRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ShareableRepository.java @@ -18,37 +18,33 @@ import com.epam.ta.reportportal.commons.querygen.ProjectFilter; import com.epam.ta.reportportal.entity.ShareableEntity; +import java.util.List; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; - -import java.util.List; /** * @author Pavel Bortnik */ public interface ShareableRepository { - /** - * Get all permitted objects for specified user - */ - Page getPermitted(ProjectFilter filter, Pageable pageable, String userName); - - /** - * Get only objects for which the user is owner - */ - Page getOwn(ProjectFilter filter, Pageable pageable, String userName); - - /** - * Get all shared objects user without own objects - */ - Page getShared(ProjectFilter filter, Pageable pageable, String userName); - - /** - * Update share flag for provided shareable entities ids. - */ - void updateSharingFlag(List ids, boolean isShared); + /** + * Get all permitted objects for specified user + */ + Page getPermitted(ProjectFilter filter, Pageable pageable, String userName); + + /** + * Get only objects for which the user is owner + */ + Page getOwn(ProjectFilter filter, Pageable pageable, String userName); + + /** + * Get all shared objects user without own objects + */ + Page getShared(ProjectFilter filter, Pageable pageable, String userName); + + /** + * Update share flag for provided shareable entities ids. + */ + void updateSharingFlag(List ids, boolean isShared); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepository.java b/src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepository.java index e18c6bb40..74ff3ab08 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepository.java @@ -1,7 +1,6 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.materialized.StaleMaterializedView; - import java.util.Optional; /** @@ -9,7 +8,7 @@ */ public interface StaleMaterializedViewRepository { - Optional findById(Long id); + Optional findById(Long id); - StaleMaterializedView insert(StaleMaterializedView view); + StaleMaterializedView insert(StaleMaterializedView view); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryImpl.java b/src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryImpl.java index 4b24e0e7a..c7aab8cc4 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryImpl.java @@ -1,45 +1,44 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView.STALE_MATERIALIZED_VIEW; + import com.epam.ta.reportportal.entity.materialized.StaleMaterializedView; +import java.sql.Timestamp; +import java.util.Optional; import org.jooq.DSLContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import java.sql.Timestamp; -import java.util.Optional; - -import static com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView.STALE_MATERIALIZED_VIEW; - /** * @author Ivan Budayeu */ @Repository public class StaleMaterializedViewRepositoryImpl implements StaleMaterializedViewRepository { - private final DSLContext dsl; - - @Autowired - public StaleMaterializedViewRepositoryImpl(DSLContext dsl) { - this.dsl = dsl; - } - - @Override - public Optional findById(Long id) { - return dsl.select() - .from(STALE_MATERIALIZED_VIEW) - .where(STALE_MATERIALIZED_VIEW.ID.eq(id)) - .fetchOptionalInto(StaleMaterializedView.class); - } - - @Override - public StaleMaterializedView insert(StaleMaterializedView view) { - Long id = dsl.insertInto(STALE_MATERIALIZED_VIEW) - .columns(STALE_MATERIALIZED_VIEW.NAME, STALE_MATERIALIZED_VIEW.CREATION_DATE) - .values(view.getName(), Timestamp.valueOf(view.getCreationDate())) - .returningResult(STALE_MATERIALIZED_VIEW.ID) - .fetchOne() - .into(Long.class); - view.setId(id); - return view; - } + private final DSLContext dsl; + + @Autowired + public StaleMaterializedViewRepositoryImpl(DSLContext dsl) { + this.dsl = dsl; + } + + @Override + public Optional findById(Long id) { + return dsl.select() + .from(STALE_MATERIALIZED_VIEW) + .where(STALE_MATERIALIZED_VIEW.ID.eq(id)) + .fetchOptionalInto(StaleMaterializedView.class); + } + + @Override + public StaleMaterializedView insert(StaleMaterializedView view) { + Long id = dsl.insertInto(STALE_MATERIALIZED_VIEW) + .columns(STALE_MATERIALIZED_VIEW.NAME, STALE_MATERIALIZED_VIEW.CREATION_DATE) + .values(view.getName(), Timestamp.valueOf(view.getCreationDate())) + .returningResult(STALE_MATERIALIZED_VIEW.ID) + .fetchOne() + .into(Long.class); + view.setId(id); + return view; + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/StatisticsFieldRepository.java b/src/main/java/com/epam/ta/reportportal/dao/StatisticsFieldRepository.java index 2b67aea9f..5b7049b0d 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/StatisticsFieldRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/StatisticsFieldRepository.java @@ -23,5 +23,5 @@ */ public interface StatisticsFieldRepository extends ReportPortalRepository { - void deleteByName(String name); + void deleteByName(String name); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java index 3660c2a40..789a28d79 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepository.java @@ -20,341 +20,387 @@ import com.epam.ta.reportportal.entity.item.TestItem; import com.epam.ta.reportportal.entity.item.TestItemResults; import com.epam.ta.reportportal.entity.launch.Launch; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; - import java.util.Collection; import java.util.List; import java.util.Optional; import java.util.stream.Stream; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; /** * @author Pavel Bortnik */ -public interface TestItemRepository extends ReportPortalRepository, TestItemRepositoryCustom { - - @Query(value = "SELECT * FROM test_item WHERE item_id = (SELECT parent_id FROM test_item WHERE item_id = :childId)", nativeQuery = true) - Optional findParentByChildId(@Param("childId") Long childId); - - /** - * Retrieve list of test item ids for provided launch - * - * @param launchId Launch id - * @return List of test item ids - */ - @Query(value = "SELECT item_id FROM test_item WHERE launch_id = :launchId UNION " - + "SELECT item_id FROM test_item WHERE retry_of IS NOT NULL AND retry_of IN " - + "(SELECT item_id FROM test_item WHERE launch_id = :launchId);", nativeQuery = true) - List findIdsByLaunchId(@Param("launchId") Long launchId); - - /** - * Retrieve the {@link List} of the {@link TestItem#getItemId()} by launch ID, {@link StatusEnum#name()} and {@link TestItem#isHasChildren()} == false - * - * @param launchId {@link Launch#getId()} - * @param status {@link StatusEnum#name()} - * @return the {@link List} of the {@link TestItem#getItemId()} - */ - @Query(value = "SELECT test_item.item_id FROM test_item JOIN test_item_results result ON test_item.item_id = result.result_id " - + " WHERE test_item.launch_id = :launchId AND NOT test_item.has_children " - + " AND result.status = CAST(:#{#status.name()} AS STATUS_ENUM) ORDER BY test_item.item_id LIMIT :pageSize OFFSET :pageOffset", nativeQuery = true) - List findIdsByNotHasChildrenAndLaunchIdAndStatus(@Param("launchId") Long launchId, @Param("status") StatusEnum status, - @Param("pageSize") Integer limit, @Param("pageOffset") Long offset); - - /** - * Retrieve the {@link List} of the {@link TestItem#getItemId()} by launch ID, {@link StatusEnum#name()} and {@link TestItem#isHasChildren()} == true - * ordered (DESCENDING) by 'nlevel' of the {@link TestItem#getPath()} - * - * @param launchId {@link Launch#getId()} - * @param status {@link StatusEnum#name()} - * @return the {@link List} of the {@link TestItem#getItemId()} - * @see https://www.postgresql.org/docs/current/ltree.html - */ - @Query(value = "SELECT test_item.item_id FROM test_item JOIN test_item_results result ON test_item.item_id = result.result_id " - + " WHERE test_item.launch_id = :launchId AND test_item.has_children AND result.status = CAST(:#{#status.name()} AS STATUS_ENUM)" - + " ORDER BY nlevel(test_item.path) DESC, test_item.item_id LIMIT :pageSize OFFSET :pageOffset", nativeQuery = true) - List findIdsByHasChildrenAndLaunchIdAndStatusOrderedByPathLevel(@Param("launchId") Long launchId, - @Param("status") StatusEnum status, @Param("pageSize") Integer limit, @Param("pageOffset") Long offset); - - /** - * Retrieve the {@link Stream} of the {@link TestItem#getItemId()} under parent {@link TestItem#getPath()}, {@link StatusEnum#name()} - * and {@link TestItem#isHasChildren()} == false - * - * @param parentPath {@link TestItem#getPath()} of the parent item - * @param status {@link StatusEnum#name()} - * @return the {@link List} of the {@link TestItem#getItemId()} - */ - @Query(value = "SELECT test_item.item_id FROM test_item JOIN test_item_results result ON test_item.item_id = result.result_id " - + " WHERE CAST(:parentPath AS LTREE) @> test_item.path AND CAST(:parentPath AS LTREE) != test_item.path " - + " AND NOT test_item.has_children AND result.status = CAST(:#{#status.name()} AS STATUS_ENUM) ORDER BY test_item.item_id LIMIT :pageSize OFFSET :pageOffset", nativeQuery = true) - List findIdsByNotHasChildrenAndParentPathAndStatus(@Param("parentPath") String parentPath, @Param("status") StatusEnum status, - @Param("pageSize") Integer limit, @Param("pageOffset") Long offset); - - /** - * Retrieve the {@link Stream} of the {@link TestItem#getItemId()} under parent {@link TestItem#getPath()}, {@link StatusEnum#name()} - * and {@link TestItem#isHasChildren()} == true ordered (DESCENDING) by 'nlevel' of the {@link TestItem#getPath()} - * - * @param parentPath {@link TestItem#getPath()} of the parent item - * @param status {@link StatusEnum#name()} - * @return the {@link List} of the {@link TestItem#getItemId()} - * @see https://www.postgresql.org/docs/current/ltree.html - */ - @Query(value = "SELECT test_item.item_id FROM test_item JOIN test_item_results result ON test_item.item_id = result.result_id " - + " WHERE CAST(:parentPath AS LTREE) @> test_item.path AND CAST(:parentPath AS LTREE) != test_item.path " - + " AND test_item.has_children AND result.status = CAST(:#{#status.name()} AS STATUS_ENUM)" - + " ORDER BY nlevel(test_item.path) DESC, test_item.item_id LIMIT :pageSize OFFSET :pageOffset", nativeQuery = true) - List findIdsByHasChildrenAndParentPathAndStatusOrderedByPathLevel(@Param("parentPath") String parentPath, - @Param("status") StatusEnum status, @Param("pageSize") Integer limit, @Param("pageOffset") Long offset); - - List findTestItemsByUniqueId(String uniqueId); - - List findTestItemsByLaunchId(Long launchId); - - Optional findByUuid(String uuid); - - /** - * Finds {@link TestItem#getItemId()} by {@link TestItem#getUuid()} and sets a lock on the found 'item' row in the database. - * Required for fetching 'item' from the concurrent environment to provide synchronization between dependant entities - * - * @param uuid {@link TestItem#getUuid()} - * @return {@link Optional} with {@link TestItem} object - */ - @Query(value = "SELECT ti.item_id FROM test_item ti WHERE ti.uuid = :uuid FOR UPDATE", nativeQuery = true) - Optional findIdByUuidForUpdate(@Param("uuid") String uuid); - - /** - * Finds all {@link TestItem} by specified launch id - * - * @param launchId {@link Launch#getId()} - * @return {@link List} of {@link TestItem} ordered by {@link TestItem#getStartTime()} ascending - */ - List findTestItemsByLaunchIdOrderByStartTimeAsc(Long launchId); - - /** - * Execute sql-function that changes a structure of retries according to the MAX {@link TestItem#getStartTime()}. - * If the new-inserted {@link TestItem} with specified {@link TestItem#getItemId()} is a retry - * and it has {@link TestItem#getStartTime()} greater than MAX {@link TestItem#getStartTime()} of the other {@link TestItem} - * with the same {@link TestItem#getUniqueId()} then all those test items become retries of the new-inserted one: - * theirs {@link TestItem#isHasRetries()} flag is set to 'false' and {@link TestItem#getRetryOf()} gets the new-inserted {@link TestItem#getItemId()} value. - * The same operation applies to the new-inserted {@link TestItem} if its {@link TestItem#getStartTime()} is less than - * MAX {@link TestItem#getStartTime()} of the other {@link TestItem} with the same {@link TestItem#getUniqueId()} - * - * @param itemId The new-inserted {@link TestItem#getItemId()} - * @deprecated {@link TestItemRepository#handleRetry(Long, Long)} should be used instead - */ - @Deprecated - @Query(value = "SELECT handle_retries(:itemId)", nativeQuery = true) - void handleRetries(@Param("itemId") Long itemId); - - /** - * Execute sql-function that changes a structure of retries assigning {@link TestItem#getRetryOf()} value - * of the previously inserted retries and previous retries' parent to the new inserted parent id - * - * @param itemId Previous retries' parent {@link TestItem#getItemId()} - * @param retryParent The new-inserted {@link TestItem#getItemId()} - */ - @Query(value = "SELECT handle_retry(:itemId, :retryParent)", nativeQuery = true) - void handleRetry(@Param("itemId") Long itemId, @Param("retryParent") Long retryParent); - - @Query(value = "DELETE FROM test_item WHERE test_item.item_id = :itemId", nativeQuery = true) - void deleteTestItem(@Param(value = "itemId") Long itemId); - - /** - * Checks does test item have children. - * - * @param itemPath Current item path in a tree - * @return True if has - */ - @Query(value = "SELECT EXISTS(SELECT 1 FROM test_item t WHERE t.path <@ CAST(:itemPath AS LTREE) AND t.item_id != :itemId LIMIT 1)", nativeQuery = true) - boolean hasChildren(@Param("itemId") Long itemId, @Param("itemPath") String itemPath); - - /** - * Checks does test item have children with {@link TestItem#isHasStats()} == true. - * - * @param itemId Parent item id - * @return True if has - */ - @Query(value = "SELECT EXISTS(SELECT 1 FROM test_item t WHERE t.parent_id = :itemId AND t.has_stats)", nativeQuery = true) - boolean hasChildrenWithStats(@Param("itemId") Long itemId); - - /** - * Checks does test item have parent with provided status. - * - * @param itemId Cuttent item id - * @param itemPath Current item path in a tree - * @param status {@link StatusEnum} - * @return 'True' if has, otherwise 'false' - */ - @Query(value = "SELECT EXISTS(SELECT 1 FROM test_item ti JOIN test_item_results tir ON ti.item_id = tir.result_id" - + " WHERE ti.path @> CAST(:itemPath AS LTREE) AND ti.has_stats = TRUE AND ti.item_id != :itemId AND tir.status = CAST(:#{#status.name()} AS STATUS_ENUM) LIMIT 1)", nativeQuery = true) - boolean hasParentWithStatus(@Param("itemId") Long itemId, @Param("itemPath") String itemPath, @Param("status") StatusEnum status); - - /** - * Check for existence of descendants with statuses NOT EQUAL to provided status - * - * @param parentId {@link TestItem#getParent()} ID - * @param statuses {@link StatusEnum#name()} Array - * @return 'true' if items with statuses NOT EQUAL to provided status exist, otherwise 'false' - */ - @Query(value = "SELECT EXISTS(SELECT 1 FROM test_item ti JOIN test_item_results tir ON ti.item_id = tir.result_id" - + " WHERE ti.parent_id = :parentId AND ti.retry_of IS NULL AND CAST(tir.status AS VARCHAR) NOT IN (:statuses))", nativeQuery = true) - boolean hasDescendantsNotInStatus(@Param("parentId") Long parentId, @Param("statuses") String... statuses); - - /** - * True if the parent item has any child items with provided status. - * - * @param parentId parent item {@link TestItem#getItemId()} - * @param parentPath parent item {@link TestItem#getPath()} - * @param statuses child item {@link TestItemResults#getStatus()} - * @return True if contains, false if not - */ - @Query(value = "SELECT EXISTS(SELECT 1 FROM test_item ti JOIN test_item_results tir ON ti.item_id = tir.result_id" - + " WHERE ti.path <@ CAST(:parentPath AS LTREE) AND ti.item_id != :parentId AND CAST(tir.status AS VARCHAR) IN (:statuses))", nativeQuery = true) - boolean hasItemsInStatusByParent(@Param("parentId") Long parentId, @Param("parentPath") String parentPath, - @Param("statuses") String... statuses); - - /** - * True if the launch has any items with issue. - * - * @param launchId parent item {@link TestItem#getItemId()} - * @return True if contains, false if not - */ - @Query(value = "SELECT EXISTS(SELECT 1 FROM test_item ti JOIN issue i ON ti.item_id = i.issue_id WHERE ti.launch_id = :launchId)", nativeQuery = true) - boolean hasItemsWithIssueByLaunch(@Param("launchId") Long launchId); - - /** - * Interrupts all {@link com.epam.ta.reportportal.entity.enums.StatusEnum#IN_PROGRESS} children items of the - * launch with provided launchId. - * Sets them {@link com.epam.ta.reportportal.entity.enums.StatusEnum#INTERRUPTED} status - * - * @param launchId Launch id - */ - @Modifying - @Query(value = - "UPDATE test_item_results SET status = 'INTERRUPTED', end_time = CURRENT_TIMESTAMP, duration = EXTRACT(EPOCH FROM CURRENT_TIMESTAMP - i.start_time)" - + "FROM test_item i WHERE i.item_id = result_id AND i.launch_id = :launchId AND status = 'IN_PROGRESS'", nativeQuery = true) - void interruptInProgressItems(@Param("launchId") Long launchId); - - /** - * Checks if all children of test item with id = {@code parentId}, except item with id = {@code stepId}, - * has status not in provided {@code statuses} - * - * @param parentId Id of parent test item - * @param stepId Id of test item that should be ignored during the checking - * @param statuses {@link StatusEnum#name()} Array - * @return True if has - */ - @Query(value = "SELECT EXISTS(SELECT 1 FROM test_item JOIN test_item_results result ON test_item.item_id = result.result_id " - + " WHERE test_item.parent_id = :parentId AND test_item.item_id != :stepId AND test_item.retry_of IS NULL " - + " AND CAST(result.status AS VARCHAR) NOT IN (:statuses))", nativeQuery = true) - boolean hasDescendantsNotInStatusExcludingById(@Param("parentId") Long parentId, @Param("stepId") Long stepId, - @Param("statuses") String... statuses); - - /** - * Finds {@link TestItem} with specified {@code path} - * - * @param path Path of {@link TestItem} - * @return {@link Optional} of {@link TestItem} if it exists, {@link Optional#empty()} if not - */ - @Query(value = "SELECT * FROM test_item t WHERE t.path = CAST(:path AS LTREE)", nativeQuery = true) - Optional findByPath(@Param("path") String path); - - /** - * Finds latest {@link TestItem#getItemId()} with specified {@code uniqueId}, {@code launchId}, {@code parentId} - * - * @param uniqueId {@link TestItem#getUniqueId()} - * @param launchId {@link TestItem#getLaunchId()} - * @param parentId {@link TestItem#getParentId()} - * @return {@link Optional} of {@link TestItem} if exists otherwise {@link Optional#empty()} - */ - @Query(value = "SELECT t.item_id FROM test_item t WHERE t.unique_id = :uniqueId AND t.launch_id = :launchId " - + " AND t.parent_id = :parentId AND t.has_stats AND t.retry_of IS NULL" - + " ORDER BY t.start_time DESC, t.item_id DESC LIMIT 1 FOR UPDATE", nativeQuery = true) - Optional findLatestIdByUniqueIdAndLaunchIdAndParentId(@Param("uniqueId") String uniqueId, @Param("launchId") Long launchId, - @Param("parentId") Long parentId); - - /** - * Finds latest {@link TestItem#getItemId()} with specified {@code uniqueId}, {@code launchId}, {@code parentId} and not equal {@code itemId} - * - * @param uniqueId {@link TestItem#getUniqueId()} - * @param launchId {@link TestItem#getLaunchId()} - * @param parentId {@link TestItem#getParentId()} - * @param itemId {@link TestItem#getItemId()} ()} - * @return {@link Optional} of {@link TestItem} if exists otherwise {@link Optional#empty()} - */ - @Query(value = "SELECT t.item_id FROM test_item t WHERE t.unique_id = :uniqueId AND t.launch_id = :launchId " - + " AND t.parent_id = :parentId AND t.item_id != :itemId AND t.has_stats AND t.retry_of IS NULL" - + " ORDER BY t.start_time DESC, t.item_id DESC LIMIT 1 FOR UPDATE", nativeQuery = true) - Optional findLatestIdByUniqueIdAndLaunchIdAndParentIdAndItemIdNotEqual(@Param("uniqueId") String uniqueId, - @Param("launchId") Long launchId, @Param("parentId") Long parentId, @Param("itemId") Long itemId); - - /** - * Finds all descendants ids of {@link TestItem} with {@code path} include its own id - * - * @param path Path of {@link TestItem} - * @return {@link List} of test item ids - */ - @Query(value = "SELECT item_id FROM test_item WHERE path <@ CAST(:path AS LTREE)", nativeQuery = true) - List selectAllDescendantsIds(@Param("path") String path); - - void deleteAllByItemIdIn(Collection ids); - - /** - * Finds latest root(without any parent) {@link TestItem} with specified {@code testCaseHash} and {@code launchId} - * - * @param testCaseHash {@link TestItem#getTestCaseHash()} - * @param launchId {@link TestItem#getLaunchId()} - * @return {@link Optional} of {@link TestItem#getItemId()} if exists otherwise {@link Optional#empty()} - */ - @Query(value = - "SELECT t.item_id FROM test_item t WHERE t.test_case_hash = :testCaseHash AND t.launch_id = :launchId AND t.parent_id IS NULL " - + " ORDER BY t.start_time DESC, t.item_id DESC LIMIT 1 FOR UPDATE", nativeQuery = true) - Optional findLatestIdByTestCaseHashAndLaunchIdWithoutParents(@Param("testCaseHash") Integer testCaseHash, - @Param("launchId") Long launchId); - - /** - * Finds latest {@link TestItem#getItemId()} with specified {@code testCaseHash}, {@code launchId} and {@code parentId} - * - * @param testCaseHash {@link TestItem#getTestCaseHash()} - * @param launchId {@link TestItem#getLaunchId()} - * @param parentId {@link TestItem#getParentId()} - * @return {@link Optional} of {@link TestItem#getItemId()} if exists otherwise {@link Optional#empty()} - */ - @Query(value = "SELECT t.item_id FROM test_item t WHERE t.test_case_hash = :testCaseHash AND t.launch_id = :launchId " - + " AND t.parent_id = :parentId AND t.has_stats AND t.retry_of IS NULL" - + " ORDER BY t.start_time DESC, t.item_id DESC LIMIT 1 FOR UPDATE", nativeQuery = true) - Optional findLatestIdByTestCaseHashAndLaunchIdAndParentId(@Param("testCaseHash") Integer testCaseHash, - @Param("launchId") Long launchId, @Param("parentId") Long parentId); - - /** - * Count items by launch id - * - * @param launchId Launch id - * @return Number of {@link TestItem} - */ - long countTestItemByLaunchId(Long launchId); - - /** - * Select items with provided parent ids - * @param parentIds Parent test items id - * @return List of item ids - */ - @Query(value = "SELECT t.item_id FROM test_item t WHERE t.parent_id IN (:parentIds)", nativeQuery = true) - List findIdsByParentIds(@Param("parentIds") Long... parentIds); - - /** - * Select item paths by provided parent ids - * @param parentIds Parent test items id - * @return List of item paths - */ - @Query(value = "SELECT CAST(t.path AS VARCHAR) FROM test_item t WHERE t.parent_id IN (:parentIds)", nativeQuery = true) - List findPathsByParentIds(@Param("parentIds") Long... parentIds); - - /** - * Select items ids with provided retry of - * @param retryOf Retry of test item id - * @return List of item ids - */ - @Query(value = "SELECT t.item_id FROM test_item t WHERE t.retry_of = :retryOf", nativeQuery = true) - List findIdsByRetryOf(@Param("retryOf") Long retryOf); +public interface TestItemRepository extends ReportPortalRepository, + TestItemRepositoryCustom { + + @Query(value = "SELECT * FROM test_item WHERE item_id = (SELECT parent_id FROM test_item WHERE item_id = :childId)", nativeQuery = true) + Optional findParentByChildId(@Param("childId") Long childId); + + /** + * Retrieve list of test item ids for provided launch + * + * @param launchId Launch id + * @return List of test item ids + */ + @Query(value = "SELECT item_id FROM test_item WHERE launch_id = :launchId UNION " + + "SELECT item_id FROM test_item WHERE retry_of IS NOT NULL AND retry_of IN " + + "(SELECT item_id FROM test_item WHERE launch_id = :launchId);", nativeQuery = true) + List findIdsByLaunchId(@Param("launchId") Long launchId); + + /** + * Retrieve the {@link List} of the {@link TestItem#getItemId()} by launch ID, + * {@link StatusEnum#name()} and {@link TestItem#isHasChildren()} == false + * + * @param launchId {@link Launch#getId()} + * @param status {@link StatusEnum#name()} + * @return the {@link List} of the {@link TestItem#getItemId()} + */ + @Query(value = + "SELECT test_item.item_id FROM test_item JOIN test_item_results result ON test_item.item_id = result.result_id " + + " WHERE test_item.launch_id = :launchId AND NOT test_item.has_children " + + " AND result.status = CAST(:#{#status.name()} AS STATUS_ENUM) ORDER BY test_item.item_id LIMIT :pageSize OFFSET :pageOffset", nativeQuery = true) + List findIdsByNotHasChildrenAndLaunchIdAndStatus(@Param("launchId") Long launchId, + @Param("status") StatusEnum status, + @Param("pageSize") Integer limit, @Param("pageOffset") Long offset); + + /** + * Retrieve the {@link List} of the {@link TestItem#getItemId()} by launch ID, + * {@link StatusEnum#name()} and {@link TestItem#isHasChildren()} == true ordered (DESCENDING) by + * 'nlevel' of the {@link TestItem#getPath()} + * + * @param launchId {@link Launch#getId()} + * @param status {@link StatusEnum#name()} + * @return the {@link List} of the {@link TestItem#getItemId()} + * @see https://www.postgresql.org/docs/current/ltree.html + */ + @Query(value = + "SELECT test_item.item_id FROM test_item JOIN test_item_results result ON test_item.item_id = result.result_id " + + " WHERE test_item.launch_id = :launchId AND test_item.has_children AND result.status = CAST(:#{#status.name()} AS STATUS_ENUM)" + + " ORDER BY nlevel(test_item.path) DESC, test_item.item_id LIMIT :pageSize OFFSET :pageOffset", nativeQuery = true) + List findIdsByHasChildrenAndLaunchIdAndStatusOrderedByPathLevel( + @Param("launchId") Long launchId, + @Param("status") StatusEnum status, @Param("pageSize") Integer limit, + @Param("pageOffset") Long offset); + + /** + * Retrieve the {@link Stream} of the {@link TestItem#getItemId()} under parent + * {@link TestItem#getPath()}, {@link StatusEnum#name()} and {@link TestItem#isHasChildren()} == + * false + * + * @param parentPath {@link TestItem#getPath()} of the parent item + * @param status {@link StatusEnum#name()} + * @return the {@link List} of the {@link TestItem#getItemId()} + */ + @Query(value = + "SELECT test_item.item_id FROM test_item JOIN test_item_results result ON test_item.item_id = result.result_id " + + " WHERE CAST(:parentPath AS LTREE) @> test_item.path AND CAST(:parentPath AS LTREE) != test_item.path " + + " AND NOT test_item.has_children AND result.status = CAST(:#{#status.name()} AS STATUS_ENUM) ORDER BY test_item.item_id LIMIT :pageSize OFFSET :pageOffset", nativeQuery = true) + List findIdsByNotHasChildrenAndParentPathAndStatus(@Param("parentPath") String parentPath, + @Param("status") StatusEnum status, + @Param("pageSize") Integer limit, @Param("pageOffset") Long offset); + + /** + * Retrieve the {@link Stream} of the {@link TestItem#getItemId()} under parent + * {@link TestItem#getPath()}, {@link StatusEnum#name()} and {@link TestItem#isHasChildren()} == + * true ordered (DESCENDING) by 'nlevel' of the {@link TestItem#getPath()} + * + * @param parentPath {@link TestItem#getPath()} of the parent item + * @param status {@link StatusEnum#name()} + * @return the {@link List} of the {@link TestItem#getItemId()} + * @see https://www.postgresql.org/docs/current/ltree.html + */ + @Query(value = + "SELECT test_item.item_id FROM test_item JOIN test_item_results result ON test_item.item_id = result.result_id " + + " WHERE CAST(:parentPath AS LTREE) @> test_item.path AND CAST(:parentPath AS LTREE) != test_item.path " + + " AND test_item.has_children AND result.status = CAST(:#{#status.name()} AS STATUS_ENUM)" + + " ORDER BY nlevel(test_item.path) DESC, test_item.item_id LIMIT :pageSize OFFSET :pageOffset", nativeQuery = true) + List findIdsByHasChildrenAndParentPathAndStatusOrderedByPathLevel( + @Param("parentPath") String parentPath, + @Param("status") StatusEnum status, @Param("pageSize") Integer limit, + @Param("pageOffset") Long offset); + + List findTestItemsByUniqueId(String uniqueId); + + List findTestItemsByLaunchId(Long launchId); + + Optional findByUuid(String uuid); + + /** + * Finds {@link TestItem#getItemId()} by {@link TestItem#getUuid()} and sets a lock on the found + * 'item' row in the database. Required for fetching 'item' from the concurrent environment to + * provide synchronization between dependant entities + * + * @param uuid {@link TestItem#getUuid()} + * @return {@link Optional} with {@link TestItem} object + */ + @Query(value = "SELECT ti.item_id FROM test_item ti WHERE ti.uuid = :uuid FOR UPDATE", nativeQuery = true) + Optional findIdByUuidForUpdate(@Param("uuid") String uuid); + + /** + * Finds all {@link TestItem} by specified launch id + * + * @param launchId {@link Launch#getId()} + * @return {@link List} of {@link TestItem} ordered by {@link TestItem#getStartTime()} ascending + */ + List findTestItemsByLaunchIdOrderByStartTimeAsc(Long launchId); + + /** + * Execute sql-function that changes a structure of retries according to the MAX + * {@link TestItem#getStartTime()}. If the new-inserted {@link TestItem} with specified + * {@link TestItem#getItemId()} is a retry and it has {@link TestItem#getStartTime()} greater than + * MAX {@link TestItem#getStartTime()} of the other {@link TestItem} with the same + * {@link TestItem#getUniqueId()} then all those test items become retries of the new-inserted + * one: theirs {@link TestItem#isHasRetries()} flag is set to 'false' and + * {@link TestItem#getRetryOf()} gets the new-inserted {@link TestItem#getItemId()} value. The + * same operation applies to the new-inserted {@link TestItem} if its + * {@link TestItem#getStartTime()} is less than MAX {@link TestItem#getStartTime()} of the other + * {@link TestItem} with the same {@link TestItem#getUniqueId()} + * + * @param itemId The new-inserted {@link TestItem#getItemId()} + * @deprecated {@link TestItemRepository#handleRetry(Long, Long)} should be used instead + */ + @Deprecated + @Query(value = "SELECT handle_retries(:itemId)", nativeQuery = true) + void handleRetries(@Param("itemId") Long itemId); + + /** + * Execute sql-function that changes a structure of retries assigning + * {@link TestItem#getRetryOf()} value of the previously inserted retries and previous retries' + * parent to the new inserted parent id + * + * @param itemId Previous retries' parent {@link TestItem#getItemId()} + * @param retryParent The new-inserted {@link TestItem#getItemId()} + */ + @Query(value = "SELECT handle_retry(:itemId, :retryParent)", nativeQuery = true) + void handleRetry(@Param("itemId") Long itemId, @Param("retryParent") Long retryParent); + + @Query(value = "DELETE FROM test_item WHERE test_item.item_id = :itemId", nativeQuery = true) + void deleteTestItem(@Param(value = "itemId") Long itemId); + + /** + * Checks does test item have children. + * + * @param itemPath Current item path in a tree + * @return True if has + */ + @Query(value = "SELECT EXISTS(SELECT 1 FROM test_item t WHERE t.path <@ CAST(:itemPath AS LTREE) AND t.item_id != :itemId LIMIT 1)", nativeQuery = true) + boolean hasChildren(@Param("itemId") Long itemId, @Param("itemPath") String itemPath); + + /** + * Checks does test item have children with {@link TestItem#isHasStats()} == true. + * + * @param itemId Parent item id + * @return True if has + */ + @Query(value = "SELECT EXISTS(SELECT 1 FROM test_item t WHERE t.parent_id = :itemId AND t.has_stats)", nativeQuery = true) + boolean hasChildrenWithStats(@Param("itemId") Long itemId); + + /** + * Checks does test item have parent with provided status. + * + * @param itemId Cuttent item id + * @param itemPath Current item path in a tree + * @param status {@link StatusEnum} + * @return 'True' if has, otherwise 'false' + */ + @Query(value = + "SELECT EXISTS(SELECT 1 FROM test_item ti JOIN test_item_results tir ON ti.item_id = tir.result_id" + + " WHERE ti.path @> CAST(:itemPath AS LTREE) AND ti.has_stats = TRUE AND ti.item_id != :itemId AND tir.status = CAST(:#{#status.name()} AS STATUS_ENUM) LIMIT 1)", nativeQuery = true) + boolean hasParentWithStatus(@Param("itemId") Long itemId, @Param("itemPath") String itemPath, + @Param("status") StatusEnum status); + + /** + * Check for existence of descendants with statuses NOT EQUAL to provided status + * + * @param parentId {@link TestItem#getParent()} ID + * @param statuses {@link StatusEnum#name()} Array + * @return 'true' if items with statuses NOT EQUAL to provided status exist, otherwise 'false' + */ + @Query(value = + "SELECT EXISTS(SELECT 1 FROM test_item ti JOIN test_item_results tir ON ti.item_id = tir.result_id" + + " WHERE ti.parent_id = :parentId AND ti.retry_of IS NULL AND CAST(tir.status AS VARCHAR) NOT IN (:statuses))", nativeQuery = true) + boolean hasDescendantsNotInStatus(@Param("parentId") Long parentId, + @Param("statuses") String... statuses); + + /** + * True if the parent item has any child items with provided status. + * + * @param parentId parent item {@link TestItem#getItemId()} + * @param parentPath parent item {@link TestItem#getPath()} + * @param statuses child item {@link TestItemResults#getStatus()} + * @return True if contains, false if not + */ + @Query(value = + "SELECT EXISTS(SELECT 1 FROM test_item ti JOIN test_item_results tir ON ti.item_id = tir.result_id" + + " WHERE ti.path <@ CAST(:parentPath AS LTREE) AND ti.item_id != :parentId AND CAST(tir.status AS VARCHAR) IN (:statuses))", nativeQuery = true) + boolean hasItemsInStatusByParent(@Param("parentId") Long parentId, + @Param("parentPath") String parentPath, + @Param("statuses") String... statuses); + + /** + * True if the launch has any items with issue. + * + * @param launchId parent item {@link TestItem#getItemId()} + * @return True if contains, false if not + */ + @Query(value = "SELECT EXISTS(SELECT 1 FROM test_item ti JOIN issue i ON ti.item_id = i.issue_id WHERE ti.launch_id = :launchId)", nativeQuery = true) + boolean hasItemsWithIssueByLaunch(@Param("launchId") Long launchId); + + /** + * Interrupts all {@link com.epam.ta.reportportal.entity.enums.StatusEnum#IN_PROGRESS} children + * items of the launch with provided launchId. Sets them + * {@link com.epam.ta.reportportal.entity.enums.StatusEnum#INTERRUPTED} status + * + * @param launchId Launch id + */ + @Modifying + @Query(value = + "UPDATE test_item_results SET status = 'INTERRUPTED', end_time = CURRENT_TIMESTAMP, duration = EXTRACT(EPOCH FROM CURRENT_TIMESTAMP - i.start_time)" + + "FROM test_item i WHERE i.item_id = result_id AND i.launch_id = :launchId AND status = 'IN_PROGRESS'", nativeQuery = true) + void interruptInProgressItems(@Param("launchId") Long launchId); + + /** + * Checks if all children of test item with id = {@code parentId}, except item with id = + * {@code stepId}, has status not in provided {@code statuses} + * + * @param parentId Id of parent test item + * @param stepId Id of test item that should be ignored during the checking + * @param statuses {@link StatusEnum#name()} Array + * @return True if has + */ + @Query(value = + "SELECT EXISTS(SELECT 1 FROM test_item JOIN test_item_results result ON test_item.item_id = result.result_id " + + " WHERE test_item.parent_id = :parentId AND test_item.item_id != :stepId AND test_item.retry_of IS NULL " + + " AND CAST(result.status AS VARCHAR) NOT IN (:statuses))", nativeQuery = true) + boolean hasDescendantsNotInStatusExcludingById(@Param("parentId") Long parentId, + @Param("stepId") Long stepId, + @Param("statuses") String... statuses); + + /** + * Finds {@link TestItem} with specified {@code path} + * + * @param path Path of {@link TestItem} + * @return {@link Optional} of {@link TestItem} if it exists, {@link Optional#empty()} if not + */ + @Query(value = "SELECT * FROM test_item t WHERE t.path = CAST(:path AS LTREE)", nativeQuery = true) + Optional findByPath(@Param("path") String path); + + /** + * Finds latest {@link TestItem#getItemId()} with specified {@code uniqueId}, {@code launchId}, + * {@code parentId} + * + * @param uniqueId {@link TestItem#getUniqueId()} + * @param launchId {@link TestItem#getLaunchId()} + * @param parentId {@link TestItem#getParentId()} + * @return {@link Optional} of {@link TestItem} if exists otherwise {@link Optional#empty()} + */ + @Query(value = + "SELECT t.item_id FROM test_item t WHERE t.unique_id = :uniqueId AND t.launch_id = :launchId " + + " AND t.parent_id = :parentId AND t.has_stats AND t.retry_of IS NULL" + + " ORDER BY t.start_time DESC, t.item_id DESC LIMIT 1 FOR UPDATE", nativeQuery = true) + Optional findLatestIdByUniqueIdAndLaunchIdAndParentId(@Param("uniqueId") String uniqueId, + @Param("launchId") Long launchId, + @Param("parentId") Long parentId); + + /** + * Finds latest {@link TestItem#getItemId()} with specified {@code uniqueId}, {@code launchId}, + * {@code parentId} and not equal {@code itemId} + * + * @param uniqueId {@link TestItem#getUniqueId()} + * @param launchId {@link TestItem#getLaunchId()} + * @param parentId {@link TestItem#getParentId()} + * @param itemId {@link TestItem#getItemId()} ()} + * @return {@link Optional} of {@link TestItem} if exists otherwise {@link Optional#empty()} + */ + @Query(value = + "SELECT t.item_id FROM test_item t WHERE t.unique_id = :uniqueId AND t.launch_id = :launchId " + + " AND t.parent_id = :parentId AND t.item_id != :itemId AND t.has_stats AND t.retry_of IS NULL" + + " ORDER BY t.start_time DESC, t.item_id DESC LIMIT 1 FOR UPDATE", nativeQuery = true) + Optional findLatestIdByUniqueIdAndLaunchIdAndParentIdAndItemIdNotEqual( + @Param("uniqueId") String uniqueId, + @Param("launchId") Long launchId, @Param("parentId") Long parentId, + @Param("itemId") Long itemId); + + /** + * Finds all descendants ids of {@link TestItem} with {@code path} include its own id + * + * @param path Path of {@link TestItem} + * @return {@link List} of test item ids + */ + @Query(value = "SELECT item_id FROM test_item WHERE path <@ CAST(:path AS LTREE)", nativeQuery = true) + List selectAllDescendantsIds(@Param("path") String path); + + void deleteAllByItemIdIn(Collection ids); + + /** + * Finds latest root(without any parent) {@link TestItem} with specified {@code testCaseHash} and + * {@code launchId} + * + * @param testCaseHash {@link TestItem#getTestCaseHash()} + * @param launchId {@link TestItem#getLaunchId()} + * @return {@link Optional} of {@link TestItem#getItemId()} if exists otherwise + * {@link Optional#empty()} + */ + @Query(value = + "SELECT t.item_id FROM test_item t WHERE t.test_case_hash = :testCaseHash AND t.launch_id = :launchId AND t.parent_id IS NULL " + + " ORDER BY t.start_time DESC, t.item_id DESC LIMIT 1 FOR UPDATE", nativeQuery = true) + Optional findLatestIdByTestCaseHashAndLaunchIdWithoutParents( + @Param("testCaseHash") Integer testCaseHash, + @Param("launchId") Long launchId); + + /** + * Finds latest {@link TestItem#getItemId()} with specified {@code testCaseHash}, {@code launchId} + * and {@code parentId} + * + * @param testCaseHash {@link TestItem#getTestCaseHash()} + * @param launchId {@link TestItem#getLaunchId()} + * @param parentId {@link TestItem#getParentId()} + * @return {@link Optional} of {@link TestItem#getItemId()} if exists otherwise + * {@link Optional#empty()} + */ + @Query(value = + "SELECT t.item_id FROM test_item t WHERE t.test_case_hash = :testCaseHash AND t.launch_id = :launchId " + + " AND t.parent_id = :parentId AND t.has_stats AND t.retry_of IS NULL" + + " ORDER BY t.start_time DESC, t.item_id DESC LIMIT 1 FOR UPDATE", nativeQuery = true) + Optional findLatestIdByTestCaseHashAndLaunchIdAndParentId( + @Param("testCaseHash") Integer testCaseHash, + @Param("launchId") Long launchId, @Param("parentId") Long parentId); + + /** + * Count items by launch id + * + * @param launchId Launch id + * @return Number of {@link TestItem} + */ + long countTestItemByLaunchId(Long launchId); + + /** + * Select items with provided parent ids + * + * @param parentIds Parent test items id + * @return List of item ids + */ + @Query(value = "SELECT t.item_id FROM test_item t WHERE t.parent_id IN (:parentIds)", nativeQuery = true) + List findIdsByParentIds(@Param("parentIds") Long... parentIds); + + /** + * Select item paths by provided parent ids + * + * @param parentIds Parent test items id + * @return List of item paths + */ + @Query(value = "SELECT CAST(t.path AS VARCHAR) FROM test_item t WHERE t.parent_id IN (:parentIds)", nativeQuery = true) + List findPathsByParentIds(@Param("parentIds") Long... parentIds); + + /** + * Select items ids with provided retry of + * + * @param retryOf Retry of test item id + * @return List of item ids + */ + @Query(value = "SELECT t.item_id FROM test_item t WHERE t.retry_of = :retryOf", nativeQuery = true) + List findIdsByRetryOf(@Param("retryOf") Long retryOf); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java index 30f4a5f71..ef5883f47 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java @@ -35,406 +35,441 @@ import com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum; import com.epam.ta.reportportal.ws.model.analyzer.IndexTestItem; import com.epam.ta.reportportal.ws.model.issue.Issue; +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import org.springframework.data.repository.query.Param; import org.springframework.data.util.Pair; -import java.time.Duration; -import java.time.LocalDateTime; -import java.util.*; - /** * @author Pavel Bortnik */ public interface TestItemRepositoryCustom extends FilterableRepository { - /** - * Gets accumulated statistics of items queried by provided filter - * - * @param filter {@link Queryable} with {@link com.epam.ta.reportportal.commons.querygen.FilterTarget#TEST_ITEM_TARGET} - * @return Set of accumulated statistics; - */ - Set accumulateStatisticsByFilter(Queryable filter); - - Set accumulateStatisticsByFilterNotFromBaseline(Queryable targetFilter, Queryable baselineFilter); - - Optional findIdByFilter(Queryable filter, Sort sort); - - /** - * Executes query built for given filters and maps result for given page - * - * @param isLatest Flag for retrieving only latest launches - * @param launchFilter {@link Queryable} with {@link com.epam.ta.reportportal.commons.querygen.FilterTarget#LAUNCH_TARGET} - * @param testItemFilter {@link Queryable} with {@link com.epam.ta.reportportal.commons.querygen.FilterTarget#TEST_ITEM_TARGET} - * @param launchPageable {@link Pageable} for {@link com.epam.ta.reportportal.entity.launch.Launch} query - * @param testItemPageable {@link Pageable} for {@link TestItem} query - * @return List of mapped entries found - */ - Page findByFilter(boolean isLatest, Queryable launchFilter, Queryable testItemFilter, Pageable launchPageable, - Pageable testItemPageable); - - Page findAllNotFromBaseline(Queryable targetFilter, Queryable baselineFilter, Pageable pageable); - - /** - * Loads items {@link TestItemHistory} - {@link TestItem} executions from the whole {@link com.epam.ta.reportportal.entity.project.Project} - * grouped by {@link TestItem#getTestCaseHash()} and ordered by {@link TestItem#getStartTime()} `DESCENDING` within group. - * Max group size equals to the provided `historyDepth` value. - * - * @param filter {@link Queryable} - * @param pageable {@link Pageable} - * @param projectId {@link Project#getId()} - * @param historyDepth max {@link TestItemHistory} group size - * @return {@link Page} with {@link TestItemHistory} as content - */ - Page loadItemsHistoryPage(Queryable filter, Pageable pageable, Long projectId, int historyDepth, boolean usingHash); - - /** - * Loads items {@link TestItemHistory} - {@link TestItem} executions from the {@link com.epam.ta.reportportal.entity.project.Project} - * with provided `projectId` and {@link Launch#getName()} equal to the provided `launchName` value. - * Result is grouped by {@link TestItem#getTestCaseHash()} and is ordered by {@link TestItem#getStartTime()} `DESCENDING` within group. - * Max group size equals to the provided `historyDepth` value. - * - * @param filter {@link Queryable} - * @param pageable {@link Pageable} - * @param projectId {@link Project#getId()} - * @param launchName Name of the {@link Launch} which {@link TestItem} should be retrieved - * @param historyDepth Max {@link TestItemHistory} group size - * @return {@link Page} with {@link TestItemHistory} as content - */ - Page loadItemsHistoryPage(Queryable filter, Pageable pageable, Long projectId, String launchName, int historyDepth, - boolean usingHash); - - /** - * Loads items {@link TestItemHistory} - {@link TestItem} executions from the {@link com.epam.ta.reportportal.entity.project.Project} - * with provided `projectId` and {@link Launch} which IDs are in provided `launchIds`. - * Result is grouped by {@link TestItem#getTestCaseHash()} and is ordered by {@link TestItem#getStartTime()} `DESCENDING` within group. - * Max group size equals to the provided `historyDepth` value. - * - * @param filter {@link Queryable} - * @param pageable {@link Pageable} - * @param projectId {@link Project#getId()} - * @param launchIds IDs of the {@link Launch}es which {@link TestItem} should be retrieved - * @param historyDepth Max {@link TestItemHistory} group size - * @return {@link Page} with {@link TestItemHistory} as content - */ - Page loadItemsHistoryPage(Queryable filter, Pageable pageable, Long projectId, List launchIds, int historyDepth, - boolean usingHash); - - /** - * Loads items {@link TestItemHistory} - {@link TestItem} executions from the whole {@link com.epam.ta.reportportal.entity.project.Project} - * grouped by {@link TestItem#getTestCaseHash()} ordered by {@link TestItem#getStartTime()} `DESCENDING` within group. - * Max group size equals to the provided `historyDepth` value. - * Items result query is built from filters with {@link com.epam.ta.reportportal.commons.querygen.FilterTarget#LAUNCH_TARGET} - * and {@link com.epam.ta.reportportal.commons.querygen.FilterTarget#TEST_ITEM_TARGET} - * - * @param isLatest Flag for retrieving only latest launches - * @param launchFilter {@link Queryable} for {@link Launch} query - * @param testItemFilter {@link Queryable} for {@link TestItem} query - * @param launchPageable {@link Pageable} for {@link Launch} query - * @param testItemPageable {@link Pageable} for {@link TestItem} query - * @param projectId {@link Project#getId()} - * @param historyDepth Max {@link TestItemHistory} group size - * @return {@link Page} with {@link TestItemHistory} as content - */ - Page loadItemsHistoryPage(boolean isLatest, Queryable launchFilter, Queryable testItemFilter, Pageable launchPageable, - Pageable testItemPageable, Long projectId, int historyDepth, boolean usingHash); - - /** - * Loads items {@link TestItemHistory} - {@link TestItem} executions from the {@link com.epam.ta.reportportal.entity.project.Project} - * with provided `projectId` and {@link Launch#getName()} equal to the provided `launchName` value. - * Result is grouped by {@link TestItem#getTestCaseHash()} and is ordered by {@link TestItem#getStartTime()} `DESCENDING` within group. - * Max group size equals to the provided `historyDepth` value. - * Items result query is built from filters with {@link com.epam.ta.reportportal.commons.querygen.FilterTarget#LAUNCH_TARGET} - * and {@link com.epam.ta.reportportal.commons.querygen.FilterTarget#TEST_ITEM_TARGET} - * - * @param isLatest Flag for retrieving only latest launches - * @param launchFilter {@link Queryable} for {@link Launch} query - * @param testItemFilter {@link Queryable} for {@link TestItem} query - * @param launchPageable {@link Pageable} for {@link Launch} query - * @param testItemPageable {@link Pageable} for {@link TestItem} query - * @param projectId {@link Project#getId()} - * @param launchName Name of the {@link Launch} which {@link TestItem} should be retrieved - * @param historyDepth Max {@link TestItemHistory} group size - * @return {@link Page} with {@link TestItemHistory} as content - */ - Page loadItemsHistoryPage(boolean isLatest, Queryable launchFilter, Queryable testItemFilter, Pageable launchPageable, - Pageable testItemPageable, Long projectId, String launchName, int historyDepth, boolean usingHash); - - /** - * Selects all descendants of TestItem with provided id. - * - * @param itemId TestItem id - * @return List of all descendants - */ - List selectAllDescendants(Long itemId); - - /** - * Selects all descendants of TestItem with provided id, which has at least one child. - * - * @param itemId TestItem id - * @return List of descendants - */ - List selectAllDescendantsWithChildren(Long itemId); - - List findTestItemIdsByLaunchId(@Param("launchId") Long launchId, Pageable pageable); - - /** - * Select common items object that have provided status for - * specified launch. - * - * @param launchId Launch - * @param statuses Statuses - * @return List of items - */ - List selectItemsInStatusByLaunch(Long launchId, StatusEnum... statuses); - - /** - * Select common items object that have provided status for - * specified parent item. - * - * @param parentId Parent item - * @param statuses Statuses - * @return List of items - */ - List selectItemsInStatusByParent(Long parentId, StatusEnum... statuses); - - /** - * True if the provided launch contains any items with - * a specified status. - * - * @param launchId Checking launch id - * @param statuses Checking statuses - * @return True if contains, false if not - */ - Boolean hasItemsInStatusByLaunch(Long launchId, StatusEnum... statuses); - - /** - * Select items that has different issue from provided for - * specified launch. - * - * @param launchId Launch - * @param locator Issue type locator - * @return List of items - */ - List findAllNotInIssueByLaunch(Long launchId, String locator); - - /** - * Select items that has different issue from provided for - * specified launch. - * - * @param launchId Launch - * @param locator Issue type locator - * @return List of items - */ - List selectIdsNotInIssueByLaunch(Long launchId, String locator); - - List findAllNotInIssueGroupByLaunch(Long launchId, TestItemIssueGroup issueGroup); - - List selectIdsNotInIssueGroupByLaunch(Long launchId, TestItemIssueGroup issueGroup); - - List findAllInIssueGroupByLaunch(Long launchId, TestItemIssueGroup issueGroup); - - /** - * Select all {@link TestItem#getItemId()} of {@link TestItem} with attached {@link Issue} - * and {@link TestItem#getLaunchId()} equal to provided `launchId` - * - * @param launchId {@link TestItem#getLaunchId()} - * @return {@link List} of {@link TestItem#getItemId()} - */ - List selectIdsWithIssueByLaunch(Long launchId); - - /** - * True if the {@link com.epam.ta.reportportal.entity.item.TestItem} with matching 'status' and 'launchId' - * was started within the provided 'period' - * - * @param period {@link Duration} - * @param launchId {@link com.epam.ta.reportportal.entity.launch.Launch#id} - * @param statuses {@link StatusEnum} - * @return true if items(the item) exist(exists) - */ - Boolean hasItemsInStatusAddedLately(Long launchId, Duration period, StatusEnum... statuses); - - /** - * True if {@link TestItem} wasn't modified before the provided 'period' and has logs - * - * @param launchId {@link com.epam.ta.reportportal.entity.launch.Launch#id} - * @param period {@link Duration} - * @param statuses {@link StatusEnum} - * @return true if {@link TestItem} wasn't modified before the provided 'period' and has logs - */ - Boolean hasLogs(Long launchId, Duration period, StatusEnum... statuses); - - /** - * Select test items that has issue with provided issue type for - * specified launch. - * - * @param launchId Launch id - * @param issueType Issue type - * @return List of items - */ - List selectItemsInIssueByLaunch(Long launchId, String issueType); - - List selectRetries(List retryOfIds); - - //TODO move to project repo - List selectIssueLocatorsByProject(Long projectId); - - /** - * Selects issue type object by provided locator for specified project. - * - * @param projectId Project id - * @param locator Issue type locator - * @return Issue type - */ - Optional selectIssueTypeByLocator(Long projectId, String locator); - - /** - * Select id and path for item by uuid - * - * @param uuid {@link TestItem#getUuid()} ()} - * @return id from collection -> {@link PathName} - */ - Optional> selectPath(String uuid); - - /** - * Select {@link PathName} containing ids and names of all items in a tree till current and launch name and number - * for each item id from the provided collection - * - * @param testItems {@link Collection} of {@link TestItem} - * @return testItemId from collection -> {@link PathName} - */ - Map selectPathNames(Collection testItems); - - /** - * Select item IDs by analyzed status and {@link TestItem#getLaunchId()} - * with {@link Log} having {@link Log#getLogLevel()} greater than or equal to {@link com.epam.ta.reportportal.entity.enums.LogLevel#ERROR_INT} - * excluding {@link TestItem} that has {@link IssueEntity} with {@link IssueEntity#getIssueType()} from excluded types - * - * @param autoAnalyzed {@link Issue#getAutoAnalyzed()} - * @param launchId {@link TestItem#getLaunchId()} - * @param logLevel {@link Log#getLogLevel()} - * @param excludedIssueTypes {@link Collection} of {@link IssueType#getId()} to exclude {@link TestItem} with provided type id - * @return The {@link List} of the {@link TestItem#getItemId()} - */ - List selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(boolean autoAnalyzed, boolean ignoreAnalyzer, Long launchId, int logLevel, - Collection excludedIssueTypes); - - /** - * @param itemId {@link TestItem#itemId} - * @param status New status - * @param endTime {@link com.epam.ta.reportportal.entity.item.TestItemResults#endTime} - * @return 1 if updated, otherwise 0 - */ - int updateStatusAndEndTimeById(Long itemId, JStatusEnum status, LocalDateTime endTime); - - /** - * @param retryOfId {@link TestItem#getRetryOf()} - * @param from Previous item {@link TestItemResults#getStatus()} criteria to update - * @param to New {@link TestItemResults#getStatus()} - * @param endTime New {@link TestItemResults#getEndTime()} - * @return amount of updated items - */ - int updateStatusAndEndTimeByRetryOfId(Long retryOfId, JStatusEnum from, JStatusEnum to, LocalDateTime endTime); - - /** - * @param itemId {@link TestItem#itemId} - * @return {@link TestItemTypeEnum} - */ - TestItemTypeEnum getTypeByItemId(Long itemId); - - /** - * @param launchId {@link TestItem#getLaunchId()} - * @param filter {@link Queryable} for additional dynamic filtering - * @param limit query limit - * @param offset query offset - * @return {@link List} of {@link TestItem#getItemId()} - */ - List selectIdsByFilter(Long launchId, Queryable filter, int limit, int offset); - - /** - * Select ids of items that has descendants - * - * @param itemIds {@link Collection} of {@link TestItem#getItemId()} that should be filtered by having descendants - * @return {@link List} of {@link TestItem#getItemId()} - */ - List selectIdsByHasDescendants(Collection itemIds); - - /** - * Select item IDs which log's level is greater than or equal to provided and log's message match to the STRING pattern - * - * @param itemIds {@link Collection} of {@link TestItem#getItemId()} which logs should match - * @param logLevel {@link Log#getLogLevel()} - * @param pattern CASE SENSITIVE STRING pattern for log message search - * @return The {@link List} of the {@link TestItem#getItemId()} - */ - List selectIdsByStringLogMessage(Collection itemIds, Integer logLevel, String pattern); - - /** - * Select item IDs which log's level is greater than or equal to provided and log's message match to the REGEX pattern - * - * @param itemIds {@link Collection} of {@link TestItem#getItemId()} which logs should match - * @param logLevel {@link Log#getLogLevel()} - * @param pattern REGEX pattern for log message search - * @return The {@link List} of the {@link TestItem#getItemId()} - */ - List selectIdsByRegexLogMessage(Collection itemIds, Integer logLevel, String pattern); - - /** - * Select Log IDs which log's level is greater than or equal to provided. - * - * @param itemIds {@link Collection} of {@link TestItem#getItemId()} which logs should match - * @param logLevel {@link Log#getLogLevel()} - * @return The {@link List} of the {@link TestItem#getItemId()} - */ - List selectLogIdsWithLogLevelCondition(Collection itemIds, Integer logLevel); - - /** - * Select item IDs which descendants' log's level is greater than or equal to provided and log's message match to the REGEX pattern - * - * @param launchId {@link TestItem#getLaunchId()} - * @param itemIds {@link Collection} of {@link TestItem#getItemId()} which logs should match - * @param logLevel {@link Log#getLogLevel()} - * @param pattern REGEX pattern for log message search - * @return The {@link List} of the {@link TestItem#getItemId()} - */ - List selectIdsUnderByStringLogMessage(Long launchId, Collection itemIds, Integer logLevel, String pattern); - - /** - * Select Log IDs which descendants' log's level is greater than or equal to provided. - * - * @param launchId {@link TestItem#getLaunchId()} - * @param itemIds {@link Collection} of {@link TestItem#getItemId()} which logs should match - * @param logLevel {@link Log#getLogLevel()} - * @return The {@link List} of the {@link TestItem#getItemId()} - */ - List selectLogIdsUnderWithLogLevelCondition(Long launchId, Collection itemIds, Integer logLevel); - - /** - * Select item IDs which descendants' log's level is greater than or equal to provided and log's message match to the REGEX pattern - * - * @param launchId {@link TestItem#getLaunchId()} - * @param itemIds {@link Collection} of {@link TestItem#getItemId()} which logs should match - * @param logLevel {@link Log#getLogLevel()} - * @param pattern REGEX pattern for log message search - * @return The {@link List} of the {@link TestItem#getItemId()} - */ - List selectIdsUnderByRegexLogMessage(Long launchId, Collection itemIds, Integer logLevel, String pattern); - - /** - * Select {@link NestedStep} entities by provided 'IDs' with {@link NestedStep#attachmentsCount} - * of the {@link com.epam.ta.reportportal.entity.log.Log} entities of all descendants for each {@link NestedStep} - * and {@link NestedStep#hasContent} flag to check whether entity is a last one - * in the descendants tree or there are {@link com.epam.ta.reportportal.entity.log.Log} or {@link NestedStep} entities exist under it - * - * @param ids {@link Collection} of the {@link TestItem#itemId} - * @param logFilter {@link Queryable} with {@link com.epam.ta.reportportal.entity.log.Log} target, to evaluate 'hasContent' flag - * and attachments count - * @return {@link List} of the {@link NestedStep} - */ - - List findAllNestedStepsByIds(Collection ids, Queryable logFilter, boolean excludePassedLogs); - - List findIndexTestItemByLaunchId(Long launchId, Collection itemTypes); + /** + * Gets accumulated statistics of items queried by provided filter + * + * @param filter {@link Queryable} with + * {@link com.epam.ta.reportportal.commons.querygen.FilterTarget#TEST_ITEM_TARGET} + * @return Set of accumulated statistics; + */ + Set accumulateStatisticsByFilter(Queryable filter); + + Set accumulateStatisticsByFilterNotFromBaseline(Queryable targetFilter, + Queryable baselineFilter); + + Optional findIdByFilter(Queryable filter, Sort sort); + + /** + * Executes query built for given filters and maps result for given page + * + * @param isLatest Flag for retrieving only latest launches + * @param launchFilter {@link Queryable} with + * {@link + * com.epam.ta.reportportal.commons.querygen.FilterTarget#LAUNCH_TARGET} + * @param testItemFilter {@link Queryable} with + * {@link + * com.epam.ta.reportportal.commons.querygen.FilterTarget#TEST_ITEM_TARGET} + * @param launchPageable {@link Pageable} for + * {@link com.epam.ta.reportportal.entity.launch.Launch} query + * @param testItemPageable {@link Pageable} for {@link TestItem} query + * @return List of mapped entries found + */ + Page findByFilter(boolean isLatest, Queryable launchFilter, Queryable testItemFilter, + Pageable launchPageable, + Pageable testItemPageable); + + Page findAllNotFromBaseline(Queryable targetFilter, Queryable baselineFilter, + Pageable pageable); + + /** + * Loads items {@link TestItemHistory} - {@link TestItem} executions from the whole + * {@link com.epam.ta.reportportal.entity.project.Project} grouped by + * {@link TestItem#getTestCaseHash()} and ordered by {@link TestItem#getStartTime()} `DESCENDING` + * within group. Max group size equals to the provided `historyDepth` value. + * + * @param filter {@link Queryable} + * @param pageable {@link Pageable} + * @param projectId {@link Project#getId()} + * @param historyDepth max {@link TestItemHistory} group size + * @return {@link Page} with {@link TestItemHistory} as content + */ + Page loadItemsHistoryPage(Queryable filter, Pageable pageable, Long projectId, + int historyDepth, boolean usingHash); + + /** + * Loads items {@link TestItemHistory} - {@link TestItem} executions from the + * {@link com.epam.ta.reportportal.entity.project.Project} with provided `projectId` and + * {@link Launch#getName()} equal to the provided `launchName` value. Result is grouped by + * {@link TestItem#getTestCaseHash()} and is ordered by {@link TestItem#getStartTime()} + * `DESCENDING` within group. Max group size equals to the provided `historyDepth` value. + * + * @param filter {@link Queryable} + * @param pageable {@link Pageable} + * @param projectId {@link Project#getId()} + * @param launchName Name of the {@link Launch} which {@link TestItem} should be retrieved + * @param historyDepth Max {@link TestItemHistory} group size + * @return {@link Page} with {@link TestItemHistory} as content + */ + Page loadItemsHistoryPage(Queryable filter, Pageable pageable, Long projectId, + String launchName, int historyDepth, + boolean usingHash); + + /** + * Loads items {@link TestItemHistory} - {@link TestItem} executions from the + * {@link com.epam.ta.reportportal.entity.project.Project} with provided `projectId` and + * {@link Launch} which IDs are in provided `launchIds`. Result is grouped by + * {@link TestItem#getTestCaseHash()} and is ordered by {@link TestItem#getStartTime()} + * `DESCENDING` within group. Max group size equals to the provided `historyDepth` value. + * + * @param filter {@link Queryable} + * @param pageable {@link Pageable} + * @param projectId {@link Project#getId()} + * @param launchIds IDs of the {@link Launch}es which {@link TestItem} should be retrieved + * @param historyDepth Max {@link TestItemHistory} group size + * @return {@link Page} with {@link TestItemHistory} as content + */ + Page loadItemsHistoryPage(Queryable filter, Pageable pageable, Long projectId, + List launchIds, int historyDepth, + boolean usingHash); + + /** + * Loads items {@link TestItemHistory} - {@link TestItem} executions from the whole + * {@link com.epam.ta.reportportal.entity.project.Project} grouped by + * {@link TestItem#getTestCaseHash()} ordered by {@link TestItem#getStartTime()} `DESCENDING` + * within group. Max group size equals to the provided `historyDepth` value. Items result query is + * built from filters with + * {@link com.epam.ta.reportportal.commons.querygen.FilterTarget#LAUNCH_TARGET} and + * {@link com.epam.ta.reportportal.commons.querygen.FilterTarget#TEST_ITEM_TARGET} + * + * @param isLatest Flag for retrieving only latest launches + * @param launchFilter {@link Queryable} for {@link Launch} query + * @param testItemFilter {@link Queryable} for {@link TestItem} query + * @param launchPageable {@link Pageable} for {@link Launch} query + * @param testItemPageable {@link Pageable} for {@link TestItem} query + * @param projectId {@link Project#getId()} + * @param historyDepth Max {@link TestItemHistory} group size + * @return {@link Page} with {@link TestItemHistory} as content + */ + Page loadItemsHistoryPage(boolean isLatest, Queryable launchFilter, + Queryable testItemFilter, Pageable launchPageable, + Pageable testItemPageable, Long projectId, int historyDepth, boolean usingHash); + + /** + * Loads items {@link TestItemHistory} - {@link TestItem} executions from the + * {@link com.epam.ta.reportportal.entity.project.Project} with provided `projectId` and + * {@link Launch#getName()} equal to the provided `launchName` value. Result is grouped by + * {@link TestItem#getTestCaseHash()} and is ordered by {@link TestItem#getStartTime()} + * `DESCENDING` within group. Max group size equals to the provided `historyDepth` value. Items + * result query is built from filters with + * {@link com.epam.ta.reportportal.commons.querygen.FilterTarget#LAUNCH_TARGET} and + * {@link com.epam.ta.reportportal.commons.querygen.FilterTarget#TEST_ITEM_TARGET} + * + * @param isLatest Flag for retrieving only latest launches + * @param launchFilter {@link Queryable} for {@link Launch} query + * @param testItemFilter {@link Queryable} for {@link TestItem} query + * @param launchPageable {@link Pageable} for {@link Launch} query + * @param testItemPageable {@link Pageable} for {@link TestItem} query + * @param projectId {@link Project#getId()} + * @param launchName Name of the {@link Launch} which {@link TestItem} should be retrieved + * @param historyDepth Max {@link TestItemHistory} group size + * @return {@link Page} with {@link TestItemHistory} as content + */ + Page loadItemsHistoryPage(boolean isLatest, Queryable launchFilter, + Queryable testItemFilter, Pageable launchPageable, + Pageable testItemPageable, Long projectId, String launchName, int historyDepth, + boolean usingHash); + + /** + * Selects all descendants of TestItem with provided id. + * + * @param itemId TestItem id + * @return List of all descendants + */ + List selectAllDescendants(Long itemId); + + /** + * Selects all descendants of TestItem with provided id, which has at least one child. + * + * @param itemId TestItem id + * @return List of descendants + */ + List selectAllDescendantsWithChildren(Long itemId); + + List findTestItemIdsByLaunchId(@Param("launchId") Long launchId, Pageable pageable); + + /** + * Select common items object that have provided status for specified launch. + * + * @param launchId Launch + * @param statuses Statuses + * @return List of items + */ + List selectItemsInStatusByLaunch(Long launchId, StatusEnum... statuses); + + /** + * Select common items object that have provided status for specified parent item. + * + * @param parentId Parent item + * @param statuses Statuses + * @return List of items + */ + List selectItemsInStatusByParent(Long parentId, StatusEnum... statuses); + + /** + * True if the provided launch contains any items with a specified status. + * + * @param launchId Checking launch id + * @param statuses Checking statuses + * @return True if contains, false if not + */ + Boolean hasItemsInStatusByLaunch(Long launchId, StatusEnum... statuses); + + /** + * Select items that has different issue from provided for specified launch. + * + * @param launchId Launch + * @param locator Issue type locator + * @return List of items + */ + List findAllNotInIssueByLaunch(Long launchId, String locator); + + /** + * Select items that has different issue from provided for specified launch. + * + * @param launchId Launch + * @param locator Issue type locator + * @return List of items + */ + List selectIdsNotInIssueByLaunch(Long launchId, String locator); + + List findAllNotInIssueGroupByLaunch(Long launchId, TestItemIssueGroup issueGroup); + + List selectIdsNotInIssueGroupByLaunch(Long launchId, TestItemIssueGroup issueGroup); + + List findAllInIssueGroupByLaunch(Long launchId, TestItemIssueGroup issueGroup); + + /** + * Select all {@link TestItem#getItemId()} of {@link TestItem} with attached {@link Issue} and + * {@link TestItem#getLaunchId()} equal to provided `launchId` + * + * @param launchId {@link TestItem#getLaunchId()} + * @return {@link List} of {@link TestItem#getItemId()} + */ + List selectIdsWithIssueByLaunch(Long launchId); + + /** + * True if the {@link com.epam.ta.reportportal.entity.item.TestItem} with matching 'status' and + * 'launchId' was started within the provided 'period' + * + * @param period {@link Duration} + * @param launchId {@link com.epam.ta.reportportal.entity.launch.Launch#id} + * @param statuses {@link StatusEnum} + * @return true if items(the item) exist(exists) + */ + Boolean hasItemsInStatusAddedLately(Long launchId, Duration period, StatusEnum... statuses); + + /** + * True if {@link TestItem} wasn't modified before the provided 'period' and has logs + * + * @param launchId {@link com.epam.ta.reportportal.entity.launch.Launch#id} + * @param period {@link Duration} + * @param statuses {@link StatusEnum} + * @return true if {@link TestItem} wasn't modified before the provided 'period' and has logs + */ + Boolean hasLogs(Long launchId, Duration period, StatusEnum... statuses); + + /** + * Select test items that has issue with provided issue type for specified launch. + * + * @param launchId Launch id + * @param issueType Issue type + * @return List of items + */ + List selectItemsInIssueByLaunch(Long launchId, String issueType); + + List selectRetries(List retryOfIds); + + //TODO move to project repo + List selectIssueLocatorsByProject(Long projectId); + + /** + * Selects issue type object by provided locator for specified project. + * + * @param projectId Project id + * @param locator Issue type locator + * @return Issue type + */ + Optional selectIssueTypeByLocator(Long projectId, String locator); + + /** + * Select id and path for item by uuid + * + * @param uuid {@link TestItem#getUuid()} ()} + * @return id from collection -> {@link PathName} + */ + Optional> selectPath(String uuid); + + /** + * Select {@link PathName} containing ids and names of all items in a tree till current and launch + * name and number for each item id from the provided collection + * + * @param testItems {@link Collection} of {@link TestItem} + * @return testItemId from collection -> {@link PathName} + */ + Map selectPathNames(Collection testItems); + + /** + * Select item IDs by analyzed status and {@link TestItem#getLaunchId()} with {@link Log} having + * {@link Log#getLogLevel()} greater than or equal to + * {@link com.epam.ta.reportportal.entity.enums.LogLevel#ERROR_INT} excluding {@link TestItem} + * that has {@link IssueEntity} with {@link IssueEntity#getIssueType()} from excluded types + * + * @param autoAnalyzed {@link Issue#getAutoAnalyzed()} + * @param launchId {@link TestItem#getLaunchId()} + * @param logLevel {@link Log#getLogLevel()} + * @param excludedIssueTypes {@link Collection} of {@link IssueType#getId()} to exclude + * {@link TestItem} with provided type id + * @return The {@link List} of the {@link TestItem#getItemId()} + */ + List selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(boolean autoAnalyzed, + boolean ignoreAnalyzer, Long launchId, int logLevel, + Collection excludedIssueTypes); + + /** + * @param itemId {@link TestItem#itemId} + * @param status New status + * @param endTime {@link com.epam.ta.reportportal.entity.item.TestItemResults#endTime} + * @return 1 if updated, otherwise 0 + */ + int updateStatusAndEndTimeById(Long itemId, JStatusEnum status, LocalDateTime endTime); + + /** + * @param retryOfId {@link TestItem#getRetryOf()} + * @param from Previous item {@link TestItemResults#getStatus()} criteria to update + * @param to New {@link TestItemResults#getStatus()} + * @param endTime New {@link TestItemResults#getEndTime()} + * @return amount of updated items + */ + int updateStatusAndEndTimeByRetryOfId(Long retryOfId, JStatusEnum from, JStatusEnum to, + LocalDateTime endTime); + + /** + * @param itemId {@link TestItem#itemId} + * @return {@link TestItemTypeEnum} + */ + TestItemTypeEnum getTypeByItemId(Long itemId); + + /** + * @param launchId {@link TestItem#getLaunchId()} + * @param filter {@link Queryable} for additional dynamic filtering + * @param limit query limit + * @param offset query offset + * @return {@link List} of {@link TestItem#getItemId()} + */ + List selectIdsByFilter(Long launchId, Queryable filter, int limit, int offset); + + /** + * Select ids of items that has descendants + * + * @param itemIds {@link Collection} of {@link TestItem#getItemId()} that should be filtered by + * having descendants + * @return {@link List} of {@link TestItem#getItemId()} + */ + List selectIdsByHasDescendants(Collection itemIds); + + /** + * Select item IDs which log's level is greater than or equal to provided and log's message match + * to the STRING pattern + * + * @param itemIds {@link Collection} of {@link TestItem#getItemId()} which logs should match + * @param logLevel {@link Log#getLogLevel()} + * @param pattern CASE SENSITIVE STRING pattern for log message search + * @return The {@link List} of the {@link TestItem#getItemId()} + */ + List selectIdsByStringLogMessage(Collection itemIds, Integer logLevel, + String pattern); + + /** + * Select item IDs which log's level is greater than or equal to provided and log's message match + * to the REGEX pattern + * + * @param itemIds {@link Collection} of {@link TestItem#getItemId()} which logs should match + * @param logLevel {@link Log#getLogLevel()} + * @param pattern REGEX pattern for log message search + * @return The {@link List} of the {@link TestItem#getItemId()} + */ + List selectIdsByRegexLogMessage(Collection itemIds, Integer logLevel, String pattern); + + /** + * Select Log IDs which log's level is greater than or equal to provided. + * + * @param itemIds {@link Collection} of {@link TestItem#getItemId()} which logs should match + * @param logLevel {@link Log#getLogLevel()} + * @return The {@link List} of the {@link TestItem#getItemId()} + */ + List selectLogIdsWithLogLevelCondition(Collection itemIds, Integer logLevel); + + /** + * Select item IDs which descendants' log's level is greater than or equal to provided and log's + * message match to the REGEX pattern + * + * @param launchId {@link TestItem#getLaunchId()} + * @param itemIds {@link Collection} of {@link TestItem#getItemId()} which logs should match + * @param logLevel {@link Log#getLogLevel()} + * @param pattern REGEX pattern for log message search + * @return The {@link List} of the {@link TestItem#getItemId()} + */ + List selectIdsUnderByStringLogMessage(Long launchId, Collection itemIds, + Integer logLevel, String pattern); + + /** + * Select Log IDs which descendants' log's level is greater than or equal to provided. + * + * @param launchId {@link TestItem#getLaunchId()} + * @param itemIds {@link Collection} of {@link TestItem#getItemId()} which logs should match + * @param logLevel {@link Log#getLogLevel()} + * @return The {@link List} of the {@link TestItem#getItemId()} + */ + List selectLogIdsUnderWithLogLevelCondition(Long launchId, Collection itemIds, + Integer logLevel); + + /** + * Select item IDs which descendants' log's level is greater than or equal to provided and log's + * message match to the REGEX pattern + * + * @param launchId {@link TestItem#getLaunchId()} + * @param itemIds {@link Collection} of {@link TestItem#getItemId()} which logs should match + * @param logLevel {@link Log#getLogLevel()} + * @param pattern REGEX pattern for log message search + * @return The {@link List} of the {@link TestItem#getItemId()} + */ + List selectIdsUnderByRegexLogMessage(Long launchId, Collection itemIds, + Integer logLevel, String pattern); + + /** + * Select {@link NestedStep} entities by provided 'IDs' with {@link NestedStep#attachmentsCount} + * of the {@link com.epam.ta.reportportal.entity.log.Log} entities of all descendants for each + * {@link NestedStep} and {@link NestedStep#hasContent} flag to check whether entity is a last one + * in the descendants tree or there are {@link com.epam.ta.reportportal.entity.log.Log} or + * {@link NestedStep} entities exist under it + * + * @param ids {@link Collection} of the {@link TestItem#itemId} + * @param logFilter {@link Queryable} with {@link com.epam.ta.reportportal.entity.log.Log} target, + * to evaluate 'hasContent' flag and attachments count + * @return {@link List} of the {@link NestedStep} + */ + + List findAllNestedStepsByIds(Collection ids, Queryable logFilter, + boolean excludePassedLogs); + + List findIndexTestItemByLaunchId(Long launchId, + Collection itemTypes); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java index 4ffee25c8..c1ce38fec 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java @@ -16,14 +16,69 @@ package com.epam.ta.reportportal.dao; -import com.epam.ta.reportportal.commons.querygen.*; +import static com.epam.ta.reportportal.commons.querygen.FilterTarget.FILTERED_ID; +import static com.epam.ta.reportportal.commons.querygen.FilterTarget.FILTERED_QUERY; +import static com.epam.ta.reportportal.commons.querygen.QueryBuilder.retrieveOffsetAndApplyBoundaries; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_START_TIME; +import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_TEST_CASE_HASH; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_UNIQUE_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.RETRY_PARENT; +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.ITEM; +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.LOGS; +import static com.epam.ta.reportportal.dao.constant.TestItemRepositoryConstants.ATTACHMENTS_COUNT; +import static com.epam.ta.reportportal.dao.constant.TestItemRepositoryConstants.HAS_CONTENT; +import static com.epam.ta.reportportal.dao.constant.TestItemRepositoryConstants.NESTED; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.HISTORY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ITEMS; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.LAUNCHES; +import static com.epam.ta.reportportal.dao.constant.WidgetRepositoryConstants.ID; +import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; +import static com.epam.ta.reportportal.dao.util.QueryUtils.collectJoinFields; +import static com.epam.ta.reportportal.dao.util.RecordMappers.INDEX_TEST_ITEM_RECORD_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.ISSUE_TYPE_RECORD_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.NESTED_STEP_RECORD_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.TEST_ITEM_RECORD_MAPPER; +import static com.epam.ta.reportportal.dao.util.ResultFetchers.TEST_ITEM_FETCHER; +import static com.epam.ta.reportportal.dao.util.ResultFetchers.TEST_ITEM_RETRY_FETCHER; +import static com.epam.ta.reportportal.jooq.Tables.ATTACHMENT; +import static com.epam.ta.reportportal.jooq.Tables.ISSUE; +import static com.epam.ta.reportportal.jooq.Tables.ISSUE_GROUP; +import static com.epam.ta.reportportal.jooq.Tables.ISSUE_TYPE_PROJECT; +import static com.epam.ta.reportportal.jooq.Tables.LAUNCH; +import static com.epam.ta.reportportal.jooq.Tables.LOG; +import static com.epam.ta.reportportal.jooq.Tables.PARAMETER; +import static com.epam.ta.reportportal.jooq.Tables.PROJECT; +import static com.epam.ta.reportportal.jooq.Tables.STATISTICS; +import static com.epam.ta.reportportal.jooq.Tables.STATISTICS_FIELD; +import static com.epam.ta.reportportal.jooq.tables.JIssueType.ISSUE_TYPE; +import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; +import static com.epam.ta.reportportal.jooq.tables.JTestItemResults.TEST_ITEM_RESULTS; +import static java.util.Optional.ofNullable; +import static java.util.stream.Collectors.toList; +import static org.jooq.impl.DSL.condition; +import static org.jooq.impl.DSL.field; +import static org.jooq.impl.DSL.max; +import static org.jooq.impl.DSL.name; +import static org.jooq.impl.DSL.with; + +import com.epam.ta.reportportal.commons.querygen.ConvertibleCondition; +import com.epam.ta.reportportal.commons.querygen.Filter; +import com.epam.ta.reportportal.commons.querygen.FilterCondition; +import com.epam.ta.reportportal.commons.querygen.QueryBuilder; +import com.epam.ta.reportportal.commons.querygen.Queryable; import com.epam.ta.reportportal.dao.util.QueryUtils; import com.epam.ta.reportportal.dao.util.TimestampUtils; import com.epam.ta.reportportal.entity.enums.LaunchModeEnum; import com.epam.ta.reportportal.entity.enums.StatusEnum; import com.epam.ta.reportportal.entity.enums.TestItemIssueGroup; import com.epam.ta.reportportal.entity.enums.TestItemTypeEnum; -import com.epam.ta.reportportal.entity.item.*; +import com.epam.ta.reportportal.entity.item.ItemPathName; +import com.epam.ta.reportportal.entity.item.LaunchPathName; +import com.epam.ta.reportportal.entity.item.NestedStep; +import com.epam.ta.reportportal.entity.item.PathName; +import com.epam.ta.reportportal.entity.item.TestItem; import com.epam.ta.reportportal.entity.item.history.TestItemHistory; import com.epam.ta.reportportal.entity.item.issue.IssueType; import com.epam.ta.reportportal.entity.statistics.Statistics; @@ -36,10 +91,34 @@ import com.epam.ta.reportportal.jooq.tables.JTestItem; import com.epam.ta.reportportal.ws.model.analyzer.IndexTestItem; import com.google.common.collect.Lists; +import java.sql.Timestamp; +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; import org.apache.commons.collections4.CollectionUtils; import org.apache.logging.log4j.util.Strings; import org.jooq.Condition; -import org.jooq.*; +import org.jooq.DSLContext; +import org.jooq.DatePart; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Log; +import org.jooq.Record; +import org.jooq.Record4; +import org.jooq.Result; +import org.jooq.SelectOnConditionStep; +import org.jooq.SelectQuery; +import org.jooq.Table; import org.jooq.impl.DSL; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -50,1063 +129,1116 @@ import org.springframework.data.util.Pair; import org.springframework.stereotype.Repository; -import java.sql.Timestamp; -import java.time.Duration; -import java.time.LocalDateTime; -import java.util.*; -import java.util.stream.Collectors; - -import static com.epam.ta.reportportal.commons.querygen.FilterTarget.FILTERED_ID; -import static com.epam.ta.reportportal.commons.querygen.FilterTarget.FILTERED_QUERY; -import static com.epam.ta.reportportal.commons.querygen.QueryBuilder.retrieveOffsetAndApplyBoundaries; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_START_TIME; -import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; -import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.*; -import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.ITEM; -import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.LOGS; -import static com.epam.ta.reportportal.dao.constant.TestItemRepositoryConstants.*; -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; -import static com.epam.ta.reportportal.dao.constant.WidgetRepositoryConstants.ID; -import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; -import static com.epam.ta.reportportal.dao.util.QueryUtils.collectJoinFields; -import static com.epam.ta.reportportal.dao.util.RecordMappers.*; -import static com.epam.ta.reportportal.dao.util.ResultFetchers.*; -import static com.epam.ta.reportportal.jooq.Tables.*; -import static com.epam.ta.reportportal.jooq.tables.JIssueType.ISSUE_TYPE; -import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; -import static com.epam.ta.reportportal.jooq.tables.JTestItemResults.TEST_ITEM_RESULTS; -import static java.util.Optional.ofNullable; -import static java.util.stream.Collectors.toList; -import static org.jooq.impl.DSL.*; - /** * @author Pavel Bortnik */ @Repository public class TestItemRepositoryCustomImpl implements TestItemRepositoryCustom { - private static final String OUTER_ITEM_TABLE = "outer_item_table"; - private static final String INNER_ITEM_TABLE = "inner_item_table"; - private static final String TEST_CASE_ID_TABLE = "test_case_id_table"; - private static final String RESULT_OUTER_TABLE = "resultOuterTable"; - private static final String LATERAL_TABLE = "lateralTable"; - private static final String RESULT_INNER_TABLE = "resultInnerTable"; - - private static final String CHILD_ITEM_TABLE = "child"; - - private static final String BASELINE_TABLE = "baseline"; - - private static final String ITEM_START_TIME = "itemStartTime"; - private static final String LAUNCH_START_TIME = "launchStartTime"; - private static final String ACCUMULATED_STATISTICS = "accumulated_statistics"; - - private DSLContext dsl; - - @Autowired - public void setDsl(DSLContext dsl) { - this.dsl = dsl; - } - - @Override - public Set accumulateStatisticsByFilter(Queryable filter) { - return dsl.fetch(DSL.with(FILTERED_QUERY) - .as(QueryBuilder.newBuilder(filter, QueryUtils.collectJoinFields(filter)).build()) - .select(DSL.sum(STATISTICS.S_COUNTER).as(ACCUMULATED_STATISTICS), STATISTICS_FIELD.NAME) - .from(STATISTICS) - .join(DSL.table(name(FILTERED_QUERY))) - .on(STATISTICS.ITEM_ID.eq(field(name(FILTERED_QUERY, FILTERED_ID), Long.class))) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .groupBy(STATISTICS_FIELD.NAME) - .getQuery()).intoSet(r -> { - Statistics statistics = new Statistics(); - StatisticsField statisticsField = new StatisticsField(); - statisticsField.setName(r.get(STATISTICS_FIELD.NAME)); - statistics.setStatisticsField(statisticsField); - statistics.setCounter(ofNullable(r.get(ACCUMULATED_STATISTICS, Integer.class)).orElse(0)); - return statistics; - }); - } - - @Override - public Set accumulateStatisticsByFilterNotFromBaseline(Queryable targetFilter, Queryable baselineFilter) { - final QueryBuilder targetBuilder = QueryBuilder.newBuilder(targetFilter, collectJoinFields(targetFilter)); - final QueryBuilder baselineBuilder = QueryBuilder.newBuilder(baselineFilter, collectJoinFields(baselineFilter)); - final SelectQuery contentQuery = getQueryWithBaseline(targetBuilder, baselineBuilder).build(); - - return dsl.fetch(DSL.with(FILTERED_QUERY) - .as(contentQuery) - .select(DSL.sum(STATISTICS.S_COUNTER).as(ACCUMULATED_STATISTICS), STATISTICS_FIELD.NAME) - .from(STATISTICS) - .join(DSL.table(name(FILTERED_QUERY))) - .on(STATISTICS.ITEM_ID.eq(field(name(FILTERED_QUERY, FILTERED_ID), Long.class))) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .groupBy(STATISTICS_FIELD.NAME) - .getQuery()).intoSet(r -> { - Statistics statistics = new Statistics(); - StatisticsField statisticsField = new StatisticsField(); - statisticsField.setName(r.get(STATISTICS_FIELD.NAME)); - statistics.setStatisticsField(statisticsField); - statistics.setCounter(ofNullable(r.get(ACCUMULATED_STATISTICS, Integer.class)).orElse(0)); - return statistics; - }); - } - - @Override - public Optional findIdByFilter(Queryable filter, Sort sort) { - - final Set joinFields = QueryUtils.collectJoinFields(filter, sort); - - return dsl.select(fieldName(ID)) - .from(QueryBuilder.newBuilder(filter, joinFields).with(sort).with(1).build().asTable(ITEM)) - .fetchOptionalInto(Long.class); - - } - - @Override - public Page findByFilter(boolean isLatest, Queryable launchFilter, Queryable testItemFilter, Pageable launchPageable, - Pageable testItemPageable) { - - Table launchesTable = QueryUtils.createQueryBuilderWithLatestLaunchesOption(launchFilter, - launchPageable.getSort(), - isLatest - ).with(launchPageable).build().asTable(LAUNCHES); - - Set joinFields = QueryUtils.collectJoinFields(testItemFilter, testItemPageable.getSort()); - - return PageableExecutionUtils.getPage(TEST_ITEM_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(testItemFilter, joinFields) - .with(testItemPageable) - .addJointToStart(launchesTable, - JoinType.JOIN, - TEST_ITEM.LAUNCH_ID.eq(fieldName(launchesTable.getName(), ID).cast(Long.class)) - ) - .wrap() - .withWrapperSort(testItemPageable.getSort()) - .build())), - testItemPageable, - () -> dsl.fetchCount(QueryBuilder.newBuilder(testItemFilter, joinFields) - .addJointToStart(launchesTable, - JoinType.JOIN, - TEST_ITEM.LAUNCH_ID.eq(fieldName(launchesTable.getName(), ID).cast(Long.class)) - ) - .build()) - ); - } - - @Override - public Page findAllNotFromBaseline(Queryable targetFilter, Queryable baselineFilter, Pageable pageable) { - - final QueryBuilder targetBuilder = QueryBuilder.newBuilder(targetFilter, collectJoinFields(targetFilter, pageable.getSort())); - final QueryBuilder baselineBuilder = QueryBuilder.newBuilder(baselineFilter, collectJoinFields(baselineFilter)); - final SelectQuery contentQuery = getQueryWithBaseline(targetBuilder, baselineBuilder).with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) - .build(); - - final QueryBuilder targetPagingBuilder = QueryBuilder.newBuilder(targetFilter, collectJoinFields(targetFilter, pageable.getSort())); - final QueryBuilder baselinePagingBuilder = QueryBuilder.newBuilder(baselineFilter, collectJoinFields(baselineFilter)); - final SelectQuery pagingQuery = getQueryWithBaseline(targetPagingBuilder, baselinePagingBuilder).build(); - - return PageableExecutionUtils.getPage(TEST_ITEM_FETCHER.apply(dsl.fetch(contentQuery)), - pageable, - () -> dsl.fetchCount(pagingQuery) - ); - - } - - private QueryBuilder getQueryWithBaseline(QueryBuilder targetBuilder, QueryBuilder baselineBuilder) { - - final SelectQuery baselineQuery = baselineBuilder - .build(); - baselineQuery.addSelect(TEST_ITEM.TEST_CASE_HASH); - final Table baseline = baselineQuery.asTable(BASELINE_TABLE); - - //https://github.com/jOOQ/jOOQ/issues/11238 - final Condition baselineHashIsNull = condition( - "array_agg(baseline.test_case_hash) filter (where baseline.test_case_hash is not null) is null"); - - return targetBuilder - .addJoinToEnd(baseline, - JoinType.LEFT_OUTER_JOIN, - TEST_ITEM.TEST_CASE_HASH.eq(fieldName(baseline.getName(), TEST_ITEM.TEST_CASE_HASH.getName()).cast(Integer.class)) - ) - .addHavingCondition(baselineHashIsNull); - } - - @Override - public Page loadItemsHistoryPage(Queryable filter, Pageable pageable, Long projectId, int historyDepth, - boolean usingHash) { - SelectQuery filteringQuery = QueryBuilder.newBuilder(filter, - QueryUtils.collectJoinFields(filter, pageable.getSort()) - ).with(pageable.getSort()).build(); - Field historyGroupingField = usingHash ? TEST_ITEM.TEST_CASE_HASH : TEST_ITEM.UNIQUE_ID; - Page historyBaseline = loadHistoryBaseline(filteringQuery, historyGroupingField, LAUNCH.PROJECT_ID.eq(projectId), pageable); - - List itemHistories = historyBaseline.getContent().stream().map(value -> { - List itemIds = loadHistoryItem(getHistoryFilter(filter, usingHash, value), - pageable.getSort(), - LAUNCH.PROJECT_ID.eq(projectId) - ).map(testItem -> getHistoryIds(testItem, usingHash, projectId, historyDepth - 1)).orElseGet(Collections::emptyList); - return new TestItemHistory(value, itemIds); - }).collect(Collectors.toList()); - - return new PageImpl<>(itemHistories, pageable, historyBaseline.getTotalElements()); - - } - - @Override - public Page loadItemsHistoryPage(Queryable filter, Pageable pageable, Long projectId, String launchName, - int historyDepth, boolean usingHash) { - SelectQuery filteringQuery = QueryBuilder.newBuilder(filter, - QueryUtils.collectJoinFields(filter, pageable.getSort()) - ).with(pageable.getSort()).build(); - Field historyGroupingField = usingHash ? TEST_ITEM.TEST_CASE_HASH : TEST_ITEM.UNIQUE_ID; - Page historyBaseline = loadHistoryBaseline(filteringQuery, - historyGroupingField, - LAUNCH.PROJECT_ID.eq(projectId).and(LAUNCH.NAME.eq(launchName)), - pageable - ); - - List itemHistories = historyBaseline.getContent().stream().map(value -> { - List itemIds = loadHistoryItem(getHistoryFilter(filter, usingHash, value), - pageable.getSort(), - LAUNCH.PROJECT_ID.eq(projectId).and(LAUNCH.NAME.eq(launchName)) - ).map(testItem -> getHistoryIds(testItem, usingHash, projectId, launchName, historyDepth - 1)) - .orElseGet(Collections::emptyList); - return new TestItemHistory(value, itemIds); - }).collect(Collectors.toList()); - - return new PageImpl<>(itemHistories, pageable, historyBaseline.getTotalElements()); - - } - - @Override - public Page loadItemsHistoryPage(Queryable filter, Pageable pageable, Long projectId, List launchIds, - int historyDepth, boolean usingHash) { - SelectQuery filteringQuery = QueryBuilder.newBuilder(filter, - QueryUtils.collectJoinFields(filter, pageable.getSort()) - ) - .with(pageable.getSort()) - .addCondition(LAUNCH.ID.in(launchIds).and(LAUNCH.PROJECT_ID.eq(projectId))) - .build(); - - Field historyGroupingField = usingHash ? TEST_ITEM.TEST_CASE_HASH : TEST_ITEM.UNIQUE_ID; - Page historyBaseline = loadHistoryBaseline(filteringQuery, - historyGroupingField, - LAUNCH.ID.in(launchIds).and(LAUNCH.PROJECT_ID.eq(projectId)), - pageable - ); - - List itemHistories = historyBaseline.getContent().stream().map(value -> { - List itemIds = loadHistoryItem(getHistoryFilter(filter, usingHash, value), - pageable.getSort(), - LAUNCH.ID.in(launchIds).and(LAUNCH.PROJECT_ID.eq(projectId)) - ).map(testItem -> getHistoryIds(testItem, usingHash, projectId, historyDepth - 1)).orElseGet(Collections::emptyList); - return new TestItemHistory(value, itemIds); - }).collect(Collectors.toList()); - - return new PageImpl<>(itemHistories, pageable, historyBaseline.getTotalElements()); - - } - - @Override - public Page loadItemsHistoryPage(boolean isLatest, Queryable launchFilter, Queryable testItemFilter, - Pageable launchPageable, Pageable testItemPageable, Long projectId, int historyDepth, boolean usingHash) { - SelectQuery filteringQuery = buildCompositeFilterHistoryQuery(isLatest, - launchFilter, - testItemFilter, - launchPageable, - testItemPageable - ); - - Field historyGroupingField = usingHash ? TEST_ITEM.TEST_CASE_HASH : TEST_ITEM.UNIQUE_ID; - Page historyBaseline = loadHistoryBaseline(filteringQuery, - historyGroupingField, - LAUNCH.PROJECT_ID.eq(projectId), - testItemPageable - ); - - List itemHistories = historyBaseline.getContent().stream().map(value -> { - List itemIds = loadHistoryItem(getHistoryFilter(testItemFilter, usingHash, value), - testItemPageable.getSort(), - LAUNCH.PROJECT_ID.eq(projectId) - ).map(testItem -> getHistoryIds(testItem, usingHash, projectId, historyDepth - 1)).orElseGet(Collections::emptyList); - return new TestItemHistory(value, itemIds); - }).collect(Collectors.toList()); - - return new PageImpl<>(itemHistories, testItemPageable, historyBaseline.getTotalElements()); - } - - @Override - public Page loadItemsHistoryPage(boolean isLatest, Queryable launchFilter, Queryable testItemFilter, - Pageable launchPageable, Pageable testItemPageable, Long projectId, String launchName, int historyDepth, boolean usingHash) { - SelectQuery filteringQuery = buildCompositeFilterHistoryQuery(isLatest, - launchFilter, - testItemFilter, - launchPageable, - testItemPageable - ); - - Field historyGroupingField = usingHash ? TEST_ITEM.TEST_CASE_HASH : TEST_ITEM.UNIQUE_ID; - Page historyBaseline = loadHistoryBaseline(filteringQuery, - historyGroupingField, - LAUNCH.PROJECT_ID.eq(projectId).and(LAUNCH.NAME.eq(launchName)), - testItemPageable - ); - - List itemHistories = historyBaseline.getContent().stream().map(value -> { - List itemIds = loadHistoryItem(getHistoryFilter(testItemFilter, usingHash, value), - testItemPageable.getSort(), - LAUNCH.PROJECT_ID.eq(projectId).and(LAUNCH.NAME.eq(launchName)) - ).map(testItem -> getHistoryIds(testItem, usingHash, projectId, historyDepth - 1)).orElseGet(Collections::emptyList); - return new TestItemHistory(value, itemIds); - }).collect(Collectors.toList()); - - return new PageImpl<>(itemHistories, testItemPageable, historyBaseline.getTotalElements()); - } - - private SelectQuery buildCompositeFilterHistoryQuery(boolean isLatest, Queryable launchFilter, - Queryable testItemFilter, Pageable launchPageable, Pageable testItemPageable) { - Table launchesTable = QueryUtils.createQueryBuilderWithLatestLaunchesOption(launchFilter, - launchPageable.getSort(), - isLatest - ).with(launchPageable).build().asTable(LAUNCHES); - - return QueryBuilder.newBuilder(testItemFilter, QueryUtils.collectJoinFields(testItemFilter, testItemPageable.getSort())) - .with(testItemPageable.getSort()) - .addJointToStart(launchesTable, - JoinType.JOIN, - TEST_ITEM.LAUNCH_ID.eq(fieldName(launchesTable.getName(), ID).cast(Long.class)) - ) - .build(); - } - - private Page loadHistoryBaseline(SelectQuery filteringQuery, Field historyGroupingField, - Condition baselineCondition, Pageable pageable) { - return PageableExecutionUtils.getPage(dsl.with(ITEMS) - .as(filteringQuery) - .select(historyGroupingField) - .from(TEST_ITEM) - .join(ITEMS) - .on(TEST_ITEM.ITEM_ID.eq(fieldName(ITEMS, ID).cast(Long.class))) - .join(LAUNCH) - .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) - .where(baselineCondition) - .and(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT)) - .groupBy(historyGroupingField) - .orderBy(max(TEST_ITEM.START_TIME)) - .limit(pageable.getPageSize()) - .offset(retrieveOffsetAndApplyBoundaries(pageable)) - .fetchInto(String.class), - pageable, - () -> dsl.fetchCount(with(ITEMS).as(filteringQuery) - .select(TEST_ITEM.field(historyGroupingField)) - .from(TEST_ITEM) - .join(ITEMS) - .on(TEST_ITEM.ITEM_ID.eq(fieldName(ITEMS, ID).cast(Long.class))) - .groupBy(TEST_ITEM.field(historyGroupingField))) - ); - } - - private Filter getHistoryFilter(Queryable filter, boolean usingHash, String historyValue) { - List commonConditions = filter.getFilterConditions(); - return new Filter(filter.getTarget().getClazz(), Lists.newArrayList()).withConditions(commonConditions) - .withCondition(usingHash ? - FilterCondition.builder().eq(CRITERIA_TEST_CASE_HASH, historyValue).build() : - FilterCondition.builder().eq(CRITERIA_UNIQUE_ID, historyValue).build()) - .withCondition(FilterCondition.builder().eq(CRITERIA_LAUNCH_MODE, LaunchModeEnum.DEFAULT.name()).build()); - } - - private List getHistoryIds(TestItem testItem, boolean usingHash, Long projectId, int historyDepth) { - List historyIds = usingHash ? loadHistory(testItem.getStartTime(), - testItem.getItemId(), - LAUNCH.PROJECT_ID.eq(projectId).and(TEST_ITEM.TEST_CASE_HASH.eq(testItem.getTestCaseHash())), - historyDepth - ) : loadHistory(testItem.getStartTime(), - testItem.getItemId(), - LAUNCH.PROJECT_ID.eq(projectId).and(TEST_ITEM.UNIQUE_ID.eq(testItem.getUniqueId())), - historyDepth - ); - historyIds.add(0, testItem.getItemId()); - return historyIds; - } - - private List getHistoryIds(TestItem testItem, boolean usingHash, Long projectId, String launchName, int historyDepth) { - if (historyDepth > 0) { - List historyIds = usingHash ? loadHistory(testItem.getStartTime(), - testItem.getItemId(), - LAUNCH.PROJECT_ID.eq(projectId) - .and(LAUNCH.NAME.eq(launchName)) - .and(TEST_ITEM.TEST_CASE_HASH.eq(testItem.getTestCaseHash())), - historyDepth - ) : loadHistory(testItem.getStartTime(), - testItem.getItemId(), - LAUNCH.PROJECT_ID.eq(projectId).and(LAUNCH.NAME.eq(launchName)).and(TEST_ITEM.UNIQUE_ID.eq(testItem.getUniqueId())), - historyDepth - ); - historyIds.add(0, testItem.getItemId()); - return historyIds; - } - return Lists.newArrayList(testItem.getItemId()); - } - - private Optional loadHistoryItem(Queryable filter, Sort sort, Condition baselineCondition) { - List orders = sort.get().collect(toList()); - orders.add(new Sort.Order(Sort.Direction.DESC, CRITERIA_START_TIME)); - - SelectQuery selectQuery = QueryBuilder.newBuilder(filter, QueryUtils.collectJoinFields(filter, sort)) - .with(Sort.by(orders)) - .with(1) - .build(); - selectQuery.addConditions(baselineCondition); - - return dsl.with(HISTORY) - .as(selectQuery) - .select() - .from(TEST_ITEM) - .join(HISTORY) - .on(TEST_ITEM.ITEM_ID.eq(fieldName(HISTORY, ID).cast(Long.class))) - .fetchInto(TestItem.class) - .stream() - .findFirst(); - } - - private List loadHistory(LocalDateTime startTime, Long itemId, Condition baselineCondition, int historyDepth) { - return dsl.select(TEST_ITEM.ITEM_ID) - .from(TEST_ITEM) - .join(LAUNCH) - .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) - .where(baselineCondition) - .and(TEST_ITEM.ITEM_ID.notEqual(itemId)) - .and(TEST_ITEM.START_TIME.lessOrEqual(Timestamp.valueOf(startTime))) - .and(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT)) - .orderBy(TEST_ITEM.START_TIME.desc(), LAUNCH.START_TIME.desc(), LAUNCH.NUMBER.desc()) - .limit(historyDepth) - .fetchInto(Long.class); - } - - @Override - public List selectAllDescendants(Long itemId) { - return commonTestItemDslSelect().where(TEST_ITEM.PARENT_ID.eq(itemId)).fetch(TEST_ITEM_RECORD_MAPPER); - } - - @Override - public List selectAllDescendantsWithChildren(Long itemId) { - JTestItem childTestItem = JTestItem.TEST_ITEM.as("cti"); - return commonTestItemDslSelect().where(TEST_ITEM.PARENT_ID.eq(itemId)) - .and(DSL.exists(DSL.selectOne() - .from(TEST_ITEM) - .join(childTestItem) - .on(TEST_ITEM.ITEM_ID.eq(childTestItem.PARENT_ID)) - .where(TEST_ITEM.PARENT_ID.eq(itemId)))) - .fetch(TEST_ITEM_RECORD_MAPPER); - } - - @Override - public List findTestItemIdsByLaunchId(Long launchId, Pageable pageable) { - JTestItem retryParent = TEST_ITEM.as(RETRY_PARENT); - return dsl.select(TEST_ITEM.ITEM_ID) - .from(TEST_ITEM) - .leftJoin(retryParent) - .on(TEST_ITEM.RETRY_OF.eq(retryParent.ITEM_ID)) - .where(TEST_ITEM.LAUNCH_ID.eq(launchId).or(retryParent.LAUNCH_ID.eq(launchId))) - .orderBy(TEST_ITEM.ITEM_ID) - .limit(pageable.getPageSize()) - .offset(retrieveOffsetAndApplyBoundaries(pageable)) - .fetchInto(Long.class); - } - - @Override - public List selectItemsInStatusByLaunch(Long launchId, StatusEnum... statuses) { - List jStatuses = Arrays.stream(statuses).map(it -> JStatusEnum.valueOf(it.name())).collect(toList()); - return commonTestItemDslSelect().where(TEST_ITEM.LAUNCH_ID.eq(launchId).and(TEST_ITEM_RESULTS.STATUS.in(jStatuses))) - .fetch(TEST_ITEM_RECORD_MAPPER); - } - - @Override - public List selectItemsInStatusByParent(Long itemId, StatusEnum... statuses) { - List jStatuses = Arrays.stream(statuses).map(it -> JStatusEnum.valueOf(it.name())).collect(toList()); - return commonTestItemDslSelect().where(TEST_ITEM.PARENT_ID.eq(itemId).and(TEST_ITEM_RESULTS.STATUS.in(jStatuses))) - .fetch(TEST_ITEM_RECORD_MAPPER); - } - - @Override - public Boolean hasItemsInStatusByLaunch(Long launchId, StatusEnum... statuses) { - List jStatuses = Arrays.stream(statuses).map(it -> JStatusEnum.valueOf(it.name())).collect(toList()); - return dsl.fetchExists(dsl.selectOne() - .from(TEST_ITEM) - .join(TEST_ITEM_RESULTS) - .onKey() - .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) - .and(TEST_ITEM_RESULTS.STATUS.in(jStatuses)) - .limit(1)); - } - - @Override - public List findAllNotInIssueByLaunch(Long launchId, String locator) { - return commonTestItemDslSelect().join(ISSUE) - .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .join(ISSUE_TYPE) - .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) - .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) - .and(ISSUE_TYPE.LOCATOR.ne(locator)) - .fetch(TEST_ITEM_RECORD_MAPPER); - } - - @Override - public List selectIdsNotInIssueByLaunch(Long launchId, String locator) { - return dsl.select(TEST_ITEM.ITEM_ID) - .from(TEST_ITEM) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .join(ISSUE) - .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .join(ISSUE_TYPE) - .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) - .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) - .and(ISSUE_TYPE.LOCATOR.ne(locator)) - .fetchInto(Long.class); - } - - @Override - public List findAllNotInIssueGroupByLaunch(Long launchId, TestItemIssueGroup issueGroup) { - return dsl.select() - .from(TEST_ITEM) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .join(ISSUE) - .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .join(ISSUE_TYPE) - .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) - .join(ISSUE_GROUP) - .on(ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)) - .where(TEST_ITEM.LAUNCH_ID.eq(launchId).and(ISSUE_GROUP.ISSUE_GROUP_.ne(JIssueGroupEnum.valueOf(issueGroup.getValue())))) - .fetch(TEST_ITEM_RECORD_MAPPER); - - } - - @Override - public List selectIdsNotInIssueGroupByLaunch(Long launchId, TestItemIssueGroup issueGroup) { - return dsl.select(TEST_ITEM.ITEM_ID) - .from(TEST_ITEM) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .join(ISSUE) - .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .join(ISSUE_TYPE) - .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) - .join(ISSUE_GROUP) - .on(ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)) - .where(TEST_ITEM.LAUNCH_ID.eq(launchId).and(ISSUE_GROUP.ISSUE_GROUP_.ne(JIssueGroupEnum.valueOf(issueGroup.getValue())))) - .fetchInto(Long.class); - } - - @Override - public List findAllInIssueGroupByLaunch(Long launchId, TestItemIssueGroup issueGroup) { - return dsl.select() - .from(TEST_ITEM) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .join(ISSUE) - .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .join(ISSUE_TYPE) - .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) - .join(ISSUE_GROUP) - .on(ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)) - .where(TEST_ITEM.LAUNCH_ID.eq(launchId).and(ISSUE_GROUP.ISSUE_GROUP_.eq(JIssueGroupEnum.valueOf(issueGroup.getValue())))) - .fetch(TEST_ITEM_RECORD_MAPPER); - } - - @Override - public List selectIdsWithIssueByLaunch(Long launchId) { - return dsl.select(TEST_ITEM.ITEM_ID) - .from(TEST_ITEM) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .join(ISSUE) - .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) - .fetchInto(Long.class); - } - - @Override - public Boolean hasItemsInStatusAddedLately(Long launchId, Duration period, StatusEnum... statuses) { - List jStatuses = Arrays.stream(statuses).map(it -> JStatusEnum.valueOf(it.name())).collect(toList()); - return dsl.fetchExists(dsl.selectOne() - .from(TEST_ITEM) - .join(TEST_ITEM_RESULTS) - .onKey() - .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) - .and(TEST_ITEM_RESULTS.STATUS.in(jStatuses)) - .and(TEST_ITEM.START_TIME.gt(TimestampUtils.getTimestampBackFromNow(period))) - .limit(1)); - } - - @Override - public Boolean hasLogs(Long launchId, Duration period, StatusEnum... statuses) { - List jStatuses = Arrays.stream(statuses).map(it -> JStatusEnum.valueOf(it.name())).collect(toList()); - return dsl.fetchExists(dsl.selectOne() - .from(TEST_ITEM) - .join(TEST_ITEM_RESULTS) - .onKey() - .join(LOG) - .on(TEST_ITEM.ITEM_ID.eq(LOG.ITEM_ID)) - .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) - .and(TEST_ITEM_RESULTS.STATUS.in(jStatuses)) - .and(TEST_ITEM.START_TIME.lt(TimestampUtils.getTimestampBackFromNow(period))) - .limit(1)); - } - - @Override - public List selectItemsInIssueByLaunch(Long launchId, String issueType) { - return commonTestItemDslSelect().join(ISSUE) - .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .join(ISSUE_TYPE) - .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) - .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) - .and(ISSUE_TYPE.LOCATOR.eq(issueType)) - .fetch(TEST_ITEM_RECORD_MAPPER::map); - } - - @Override - public List selectRetries(List retryOfIds) { - return TEST_ITEM_RETRY_FETCHER.apply(dsl.select() - .from(TEST_ITEM) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .leftJoin(PARAMETER) - .on(TEST_ITEM.ITEM_ID.eq(PARAMETER.ITEM_ID)) - .where(TEST_ITEM.RETRY_OF.in(retryOfIds)) - .and(TEST_ITEM.LAUNCH_ID.isNull()) - .orderBy(TEST_ITEM.START_TIME) - .fetch()); - } - - @Override - public List selectIssueLocatorsByProject(Long projectId) { - return dsl.select() - .from(PROJECT) - .join(ISSUE_TYPE_PROJECT) - .on(PROJECT.ID.eq(ISSUE_TYPE_PROJECT.PROJECT_ID)) - .join(ISSUE_TYPE) - .on(ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID.eq(ISSUE_TYPE.ID)) - .join(ISSUE_GROUP) - .on(Tables.ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)) - .where(PROJECT.ID.eq(projectId)) - .fetch(ISSUE_TYPE_RECORD_MAPPER); - } - - @Override - public Optional selectIssueTypeByLocator(Long projectId, String locator) { - return ofNullable(dsl.select() - .from(ISSUE_TYPE) - .join(ISSUE_TYPE_PROJECT) - .on(ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID.eq(ISSUE_TYPE.ID)) - .join(ISSUE_GROUP) - .on(ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)) - .where(ISSUE_TYPE_PROJECT.PROJECT_ID.eq(projectId)) - .and(ISSUE_TYPE.LOCATOR.eq(locator)) - .fetchOne(ISSUE_TYPE_RECORD_MAPPER)); - } - - @Override - public Optional> selectPath(String uuid) { - return dsl.select(TEST_ITEM.ITEM_ID, TEST_ITEM.PATH) - .from(TEST_ITEM) - .where(TEST_ITEM.UUID.eq(uuid)) - .fetchOptional(r -> Pair.of(r.get(TEST_ITEM.ITEM_ID), r.get(TEST_ITEM.PATH, String.class))); - } - - /** - * {@link Log} entities are searched from the whole tree under - * {@link TestItem} that matched to the provided `launchId` and `autoAnalyzed` conditions - */ - @Override - public List selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(boolean autoAnalyzed, boolean ignoreAnalyzer, Long launchId, - int logLevel, Collection excludedIssueTypes) { - - JTestItem outerItemTable = TEST_ITEM.as(OUTER_ITEM_TABLE); - JTestItem nestedItemTable = TEST_ITEM.as(NESTED); - - final List excludedTypeIds = excludedIssueTypes.stream().map(IssueType::getId).collect(toList()); - final Condition issueCondition = ISSUE.AUTO_ANALYZED.eq(autoAnalyzed) - .and(ISSUE.IGNORE_ANALYZER.eq(ignoreAnalyzer)) - .and(ISSUE.ISSUE_TYPE.notIn(excludedTypeIds)); - - 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(issueCondition) - .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(issueCondition) - .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel))) - .asTable(ITEM)) - .fetchInto(Long.class); - } - - @Override - public int updateStatusAndEndTimeById(Long itemId, JStatusEnum status, LocalDateTime endTime) { - - return dsl.update(TEST_ITEM_RESULTS) - .set(TEST_ITEM_RESULTS.STATUS, status) - .set(TEST_ITEM_RESULTS.END_TIME, Timestamp.valueOf(endTime)) - .set(TEST_ITEM_RESULTS.DURATION, - dsl.select(DSL.extract(endTime, DatePart.EPOCH) - .minus(DSL.extract(TEST_ITEM.START_TIME, DatePart.EPOCH)) - .cast(Double.class)).from(TEST_ITEM).where(TEST_ITEM.ITEM_ID.eq(itemId)) - ) - .where(TEST_ITEM_RESULTS.RESULT_ID.eq(itemId)) - .execute(); - } - - @Override - public int updateStatusAndEndTimeByRetryOfId(Long retryOfId, JStatusEnum from, JStatusEnum to, LocalDateTime endTime) { - return dsl.update(TEST_ITEM_RESULTS) - .set(TEST_ITEM_RESULTS.STATUS, to) - .set(TEST_ITEM_RESULTS.END_TIME, Timestamp.valueOf(endTime)) - .set(TEST_ITEM_RESULTS.DURATION, - dsl.select(DSL.extract(endTime, DatePart.EPOCH) - .minus(DSL.extract(TEST_ITEM.START_TIME, DatePart.EPOCH)) - .cast(Double.class)).from(TEST_ITEM).where(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - ) - .where(TEST_ITEM_RESULTS.RESULT_ID.in(DSL.select(TEST_ITEM.ITEM_ID) - .from(TEST_ITEM) - .where(TEST_ITEM.RETRY_OF.eq(retryOfId)))) - .and(TEST_ITEM_RESULTS.STATUS.eq(from)) - .execute(); - } - - @Override - public TestItemTypeEnum getTypeByItemId(Long itemId) { - return dsl.select(TEST_ITEM.TYPE).from(TEST_ITEM).where(TEST_ITEM.ITEM_ID.eq(itemId)).fetchOneInto(TestItemTypeEnum.class); - } - - @Override - public List selectIdsByFilter(Long launchId, Queryable filter, int limit, int offset) { - final SelectQuery selectQuery = QueryBuilder.newBuilder(filter, QueryUtils.collectJoinFields(filter)) - .with(limit) - .withOffset(offset) - .with(Sort.by(Sort.Order.asc(CRITERIA_ID))) - .build(); - selectQuery.addConditions(TEST_ITEM.LAUNCH_ID.eq(launchId)); - return dsl.select(fieldName(ITEMS, ID)).from(selectQuery.asTable(ITEMS)).fetchInto(Long.class); - } - - @Override - public List selectIdsByHasDescendants(Collection 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); - } - - @Override - public List selectIdsByStringLogMessage(Collection itemIds, Integer logLevel, String pattern) { - return dsl.selectDistinct(TEST_ITEM.ITEM_ID) - .from(TEST_ITEM) - .join(LOG) - .on(TEST_ITEM.ITEM_ID.eq(LOG.ITEM_ID)) - .where(TEST_ITEM.ITEM_ID.in(itemIds)) - .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) - .and(LOG.LOG_MESSAGE.like("%" + DSL.escape(pattern, '\\') + "%")) - .fetchInto(Long.class); - } - - @Override - public List selectIdsByRegexLogMessage(Collection itemIds, Integer logLevel, String pattern) { - return dsl.selectDistinct(TEST_ITEM.ITEM_ID) - .from(TEST_ITEM) - .join(LOG) - .on(TEST_ITEM.ITEM_ID.eq(LOG.ITEM_ID)) - .where(TEST_ITEM.ITEM_ID.in(itemIds)) - .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) - .and(LOG.LOG_MESSAGE.likeRegex(pattern)) - .fetchInto(Long.class); - } - - @Override - public List selectLogIdsWithLogLevelCondition(Collection itemIds, Integer logLevel) { - return dsl.selectDistinct(LOG.ID) - .from(TEST_ITEM) - .join(LOG) - .on(TEST_ITEM.ITEM_ID.eq(LOG.ITEM_ID)) - .where(TEST_ITEM.ITEM_ID.in(itemIds)) - .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) - .fetchInto(Long.class); - } - - @Override - public List selectIdsUnderByStringLogMessage(Long launchId, Collection itemIds, Integer logLevel, String pattern) { - final JTestItem child = TEST_ITEM.as(CHILD_ITEM_TABLE); - - return dsl.selectDistinct(TEST_ITEM.ITEM_ID) - .from(TEST_ITEM) - .join(child) - .on(TEST_ITEM.PATH + " @> " + child.PATH) - .and(TEST_ITEM.ITEM_ID.notEqual(child.ITEM_ID)) - .join(LOG) - .on(child.ITEM_ID.eq(LOG.ITEM_ID)) - .where(TEST_ITEM.ITEM_ID.in(itemIds)) - .and(child.LAUNCH_ID.eq(launchId)) - .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) - .and(LOG.LOG_MESSAGE.like("%" + DSL.escape(pattern, '\\') + "%")) - .groupBy(TEST_ITEM.ITEM_ID) - .fetchInto(Long.class); - } - - @Override - public List selectLogIdsUnderWithLogLevelCondition(Long launchId, Collection itemIds, Integer logLevel) { - final JTestItem child = TEST_ITEM.as(CHILD_ITEM_TABLE); - - return dsl.selectDistinct(LOG.ID) - .from(TEST_ITEM) - .join(child) - .on(TEST_ITEM.PATH + " @> " + child.PATH) - .and(TEST_ITEM.ITEM_ID.notEqual(child.ITEM_ID)) - .join(LOG) - .on(child.ITEM_ID.eq(LOG.ITEM_ID)) - .where(TEST_ITEM.ITEM_ID.in(itemIds)) - .and(child.LAUNCH_ID.eq(launchId)) - .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) - .fetchInto(Long.class); - } - - @Override - public List selectIdsUnderByRegexLogMessage(Long launchId, Collection itemIds, Integer logLevel, String pattern) { - final JTestItem child = TEST_ITEM.as(CHILD_ITEM_TABLE); - - return dsl.selectDistinct(TEST_ITEM.ITEM_ID) - .from(TEST_ITEM) - .join(child) - .on(TEST_ITEM.PATH + " @> " + child.PATH) - .and(TEST_ITEM.ITEM_ID.notEqual(child.ITEM_ID)) - .join(LOG) - .on(child.ITEM_ID.eq(LOG.ITEM_ID)) - .where(TEST_ITEM.ITEM_ID.in(itemIds)) - .and(child.LAUNCH_ID.eq(launchId)) - .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) - .and(LOG.LOG_MESSAGE.likeRegex(pattern)) - .groupBy(TEST_ITEM.ITEM_ID) - .fetchInto(Long.class); - } - - /** - * Commons select of an item with it's results and structure - * - * @return Select condition step - */ - private SelectOnConditionStep commonTestItemDslSelect() { - return dsl.select().from(TEST_ITEM).join(TEST_ITEM_RESULTS).on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)); - } - - @Override - public List findByFilter(Queryable filter) { - return TEST_ITEM_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter, QueryUtils.collectJoinFields(filter)).wrap().build())); - } - - @Override - public Page findByFilter(Queryable filter, Pageable pageable) { - - Set joinFields = QueryUtils.collectJoinFields(filter, pageable.getSort()); - List items = TEST_ITEM_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter, joinFields) - .with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) - .build())); - - return PageableExecutionUtils.getPage(items, pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter, joinFields).build())); - } - - @Override - public List findAllNestedStepsByIds(Collection ids, Queryable logFilter, boolean excludePassedLogs) { - JTestItem nested = TEST_ITEM.as(NESTED); - SelectQuery logsSelectQuery = QueryBuilder.newBuilder(logFilter, QueryUtils.collectJoinFields(logFilter)).build(); - - return dsl.select(TEST_ITEM.ITEM_ID, - TEST_ITEM.NAME, - TEST_ITEM.UUID, - TEST_ITEM.START_TIME, - TEST_ITEM.TYPE, - TEST_ITEM_RESULTS.STATUS, - TEST_ITEM_RESULTS.END_TIME, - TEST_ITEM_RESULTS.DURATION, - DSL.field(hasContentQuery(nested, logsSelectQuery, excludePassedLogs)).as(HAS_CONTENT), - DSL.field(dsl.with(LOGS) - .as(logsSelectQuery) - .selectCount() - .from(LOG) - .join(nested) - .on(LOG.ITEM_ID.eq(nested.ITEM_ID)) - .join(LOGS) - .on(LOG.ID.eq(fieldName(LOGS, ID).cast(Long.class))) - .join(ATTACHMENT) - .on(LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)) - .where(nested.HAS_STATS.isFalse() - .and(DSL.sql(fieldName(NESTED, TEST_ITEM.PATH.getName()) + " <@ cast(? AS LTREE)", TEST_ITEM.PATH)))) - .as(ATTACHMENTS_COUNT) - ) - .from(TEST_ITEM) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .where(TEST_ITEM.ITEM_ID.in(ids)) - .fetch(NESTED_STEP_RECORD_MAPPER); - } - - @Override - public List findIndexTestItemByLaunchId(Long launchId, Collection itemTypes) { - return dsl.select(TEST_ITEM.ITEM_ID, - TEST_ITEM.NAME, - TEST_ITEM.START_TIME, - TEST_ITEM.UNIQUE_ID, - TEST_ITEM.TEST_CASE_HASH, - ISSUE.AUTO_ANALYZED, - ISSUE_TYPE.LOCATOR - ) - .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(ISSUE_TYPE) - .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) - .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) - .and(TEST_ITEM.TYPE.in(itemTypes)) - .and(ISSUE.IGNORE_ANALYZER.isFalse()) - .fetch(INDEX_TEST_ITEM_RECORD_MAPPER); - - } - - private Condition hasContentQuery(JTestItem nested, SelectQuery logsSelectQuery, boolean excludePassedLogs) { - if (excludePassedLogs) { - return DSL.exists(dsl.with(LOGS) - .as(logsSelectQuery) - .select() - .from(LOG) - .join(LOGS) - .on(LOG.ID.eq(fieldName(LOGS, ID).cast(Long.class))) - .join(TEST_ITEM_RESULTS) - .on(LOG.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .where(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID))) - .and(TEST_ITEM_RESULTS.STATUS.notIn(JStatusEnum.PASSED, JStatusEnum.INFO, JStatusEnum.WARN)); - } else { - return DSL.exists(dsl.with(LOGS) - .as(logsSelectQuery) - .select() - .from(LOG) - .join(LOGS) - .on(LOG.ID.eq(fieldName(LOGS, ID).cast(Long.class))) - .where(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID))) - .orExists(dsl.select().from(nested).where(nested.PARENT_ID.eq(TEST_ITEM.ITEM_ID).and(nested.HAS_STATS.isFalse()))); - } - } - - /** - * @return Map - */ - @Override - public Map selectPathNames(Collection testItems) { - if (CollectionUtils.isEmpty(testItems)) return new HashMap<>(); - - // Item ids for search - Set testItemIds = new HashSet<>(); - // Structure for creating return object - Map> testItemWithPathIds = new HashMap<>(); - - for (TestItem testItem : testItems) { - String path = testItem.getPath(); - // For normal case is redundant, but not sure for current situation, better to check - // and skip testItem without path, cause of incorrect state. - if (Strings.isBlank(path)) { - continue; - } - String[] pathIds = path.split("\\."); - Arrays.asList(pathIds).forEach( - pathItemId -> { - long itemIdFromPath = Long.parseLong(pathItemId); - testItemIds.add(itemIdFromPath); - - List itemPaths = testItemWithPathIds.getOrDefault(testItem.getItemId(), new ArrayList<>()); - itemPaths.add(itemIdFromPath); - testItemWithPathIds.put(testItem.getItemId(), itemPaths); - } - ); - } - - Map> resultMap = new HashMap<>(); - // Convert database data to more useful form - getTestItemAndLaunchIdName(testItemIds).forEach(record -> resultMap.put( - record.get(fieldName("item_id"), Long.class), record - )); - - Map testItemPathNames = new HashMap<>(); - testItemWithPathIds.forEach((testItemId, pathIds) -> { - var record = resultMap.get(testItemId); - if (record == null) { - return; - } - - LaunchPathName launchPathName = new LaunchPathName( - record.get(fieldName("launch_name"), String.class), - record.get(fieldName("number"), Integer.class) - ); - - List itemPathNames = new ArrayList<>(); - pathIds.forEach(pathItemId -> { - // Base testItem don't add - if (!testItemId.equals(pathItemId) && resultMap.containsKey(pathItemId)) { - var record2 = resultMap.get(pathItemId); - String pathItemName = record2.get(fieldName("name"), String.class); - itemPathNames.add(new ItemPathName(pathItemId, pathItemName)); - } - }); - PathName pathName = new PathName(launchPathName, itemPathNames); - testItemPathNames.put(testItemId, pathName); - }); - - - return testItemPathNames; - } - - /** - * @param testItemIds Collection - * @return Result> - */ - private Result> getTestItemAndLaunchIdName(Collection testItemIds) { - return dsl.select(TEST_ITEM.ITEM_ID, TEST_ITEM.NAME, LAUNCH.NUMBER, LAUNCH.NAME.as("launch_name")) - .from(TEST_ITEM) - .join(LAUNCH) - .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) - .where(TEST_ITEM.ITEM_ID.in(testItemIds)) - .fetch(); - } + private static final String OUTER_ITEM_TABLE = "outer_item_table"; + private static final String INNER_ITEM_TABLE = "inner_item_table"; + private static final String TEST_CASE_ID_TABLE = "test_case_id_table"; + private static final String RESULT_OUTER_TABLE = "resultOuterTable"; + private static final String LATERAL_TABLE = "lateralTable"; + private static final String RESULT_INNER_TABLE = "resultInnerTable"; + + private static final String CHILD_ITEM_TABLE = "child"; + + private static final String BASELINE_TABLE = "baseline"; + + private static final String ITEM_START_TIME = "itemStartTime"; + private static final String LAUNCH_START_TIME = "launchStartTime"; + private static final String ACCUMULATED_STATISTICS = "accumulated_statistics"; + + private DSLContext dsl; + + @Autowired + public void setDsl(DSLContext dsl) { + this.dsl = dsl; + } + + @Override + public Set accumulateStatisticsByFilter(Queryable filter) { + return dsl.fetch(DSL.with(FILTERED_QUERY) + .as(QueryBuilder.newBuilder(filter, QueryUtils.collectJoinFields(filter)).build()) + .select(DSL.sum(STATISTICS.S_COUNTER).as(ACCUMULATED_STATISTICS), STATISTICS_FIELD.NAME) + .from(STATISTICS) + .join(DSL.table(name(FILTERED_QUERY))) + .on(STATISTICS.ITEM_ID.eq(field(name(FILTERED_QUERY, FILTERED_ID), Long.class))) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .groupBy(STATISTICS_FIELD.NAME) + .getQuery()).intoSet(r -> { + Statistics statistics = new Statistics(); + StatisticsField statisticsField = new StatisticsField(); + statisticsField.setName(r.get(STATISTICS_FIELD.NAME)); + statistics.setStatisticsField(statisticsField); + statistics.setCounter(ofNullable(r.get(ACCUMULATED_STATISTICS, Integer.class)).orElse(0)); + return statistics; + }); + } + + @Override + public Set accumulateStatisticsByFilterNotFromBaseline(Queryable targetFilter, + Queryable baselineFilter) { + final QueryBuilder targetBuilder = QueryBuilder.newBuilder(targetFilter, + collectJoinFields(targetFilter)); + final QueryBuilder baselineBuilder = QueryBuilder.newBuilder(baselineFilter, + collectJoinFields(baselineFilter)); + final SelectQuery contentQuery = getQueryWithBaseline(targetBuilder, + baselineBuilder).build(); + + return dsl.fetch(DSL.with(FILTERED_QUERY) + .as(contentQuery) + .select(DSL.sum(STATISTICS.S_COUNTER).as(ACCUMULATED_STATISTICS), STATISTICS_FIELD.NAME) + .from(STATISTICS) + .join(DSL.table(name(FILTERED_QUERY))) + .on(STATISTICS.ITEM_ID.eq(field(name(FILTERED_QUERY, FILTERED_ID), Long.class))) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .groupBy(STATISTICS_FIELD.NAME) + .getQuery()).intoSet(r -> { + Statistics statistics = new Statistics(); + StatisticsField statisticsField = new StatisticsField(); + statisticsField.setName(r.get(STATISTICS_FIELD.NAME)); + statistics.setStatisticsField(statisticsField); + statistics.setCounter(ofNullable(r.get(ACCUMULATED_STATISTICS, Integer.class)).orElse(0)); + return statistics; + }); + } + + @Override + public Optional findIdByFilter(Queryable filter, Sort sort) { + + final Set joinFields = QueryUtils.collectJoinFields(filter, sort); + + return dsl.select(fieldName(ID)) + .from(QueryBuilder.newBuilder(filter, joinFields).with(sort).with(1).build().asTable(ITEM)) + .fetchOptionalInto(Long.class); + + } + + @Override + public Page findByFilter(boolean isLatest, Queryable launchFilter, + Queryable testItemFilter, Pageable launchPageable, + Pageable testItemPageable) { + + Table launchesTable = QueryUtils.createQueryBuilderWithLatestLaunchesOption( + launchFilter, + launchPageable.getSort(), + isLatest + ).with(launchPageable).build().asTable(LAUNCHES); + + Set joinFields = QueryUtils.collectJoinFields(testItemFilter, + testItemPageable.getSort()); + + return PageableExecutionUtils.getPage( + TEST_ITEM_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(testItemFilter, joinFields) + .with(testItemPageable) + .addJointToStart(launchesTable, + JoinType.JOIN, + TEST_ITEM.LAUNCH_ID.eq(fieldName(launchesTable.getName(), ID).cast(Long.class)) + ) + .wrap() + .withWrapperSort(testItemPageable.getSort()) + .build())), + testItemPageable, + () -> dsl.fetchCount(QueryBuilder.newBuilder(testItemFilter, joinFields) + .addJointToStart(launchesTable, + JoinType.JOIN, + TEST_ITEM.LAUNCH_ID.eq(fieldName(launchesTable.getName(), ID).cast(Long.class)) + ) + .build()) + ); + } + + @Override + public Page findAllNotFromBaseline(Queryable targetFilter, Queryable baselineFilter, + Pageable pageable) { + + final QueryBuilder targetBuilder = QueryBuilder.newBuilder(targetFilter, + collectJoinFields(targetFilter, pageable.getSort())); + final QueryBuilder baselineBuilder = QueryBuilder.newBuilder(baselineFilter, + collectJoinFields(baselineFilter)); + final SelectQuery contentQuery = getQueryWithBaseline(targetBuilder, + baselineBuilder).with(pageable) + .wrap() + .withWrapperSort(pageable.getSort()) + .build(); + + final QueryBuilder targetPagingBuilder = QueryBuilder.newBuilder(targetFilter, + collectJoinFields(targetFilter, pageable.getSort())); + final QueryBuilder baselinePagingBuilder = QueryBuilder.newBuilder(baselineFilter, + collectJoinFields(baselineFilter)); + final SelectQuery pagingQuery = getQueryWithBaseline(targetPagingBuilder, + baselinePagingBuilder).build(); + + return PageableExecutionUtils.getPage(TEST_ITEM_FETCHER.apply(dsl.fetch(contentQuery)), + pageable, + () -> dsl.fetchCount(pagingQuery) + ); + + } + + private QueryBuilder getQueryWithBaseline(QueryBuilder targetBuilder, + QueryBuilder baselineBuilder) { + + final SelectQuery baselineQuery = baselineBuilder + .build(); + baselineQuery.addSelect(TEST_ITEM.TEST_CASE_HASH); + final Table baseline = baselineQuery.asTable(BASELINE_TABLE); + + //https://github.com/jOOQ/jOOQ/issues/11238 + final Condition baselineHashIsNull = condition( + "array_agg(baseline.test_case_hash) filter (where baseline.test_case_hash is not null) is null"); + + return targetBuilder + .addJoinToEnd(baseline, + JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.TEST_CASE_HASH.eq( + fieldName(baseline.getName(), TEST_ITEM.TEST_CASE_HASH.getName()).cast( + Integer.class)) + ) + .addHavingCondition(baselineHashIsNull); + } + + @Override + public Page loadItemsHistoryPage(Queryable filter, Pageable pageable, + Long projectId, int historyDepth, + boolean usingHash) { + SelectQuery filteringQuery = QueryBuilder.newBuilder(filter, + QueryUtils.collectJoinFields(filter, pageable.getSort()) + ).with(pageable.getSort()).build(); + Field historyGroupingField = usingHash ? TEST_ITEM.TEST_CASE_HASH : TEST_ITEM.UNIQUE_ID; + Page historyBaseline = loadHistoryBaseline(filteringQuery, historyGroupingField, + LAUNCH.PROJECT_ID.eq(projectId), pageable); + + List itemHistories = historyBaseline.getContent().stream().map(value -> { + List itemIds = loadHistoryItem(getHistoryFilter(filter, usingHash, value), + pageable.getSort(), + LAUNCH.PROJECT_ID.eq(projectId) + ).map(testItem -> getHistoryIds(testItem, usingHash, projectId, historyDepth - 1)) + .orElseGet(Collections::emptyList); + return new TestItemHistory(value, itemIds); + }).collect(Collectors.toList()); + + return new PageImpl<>(itemHistories, pageable, historyBaseline.getTotalElements()); + + } + + @Override + public Page loadItemsHistoryPage(Queryable filter, Pageable pageable, + Long projectId, String launchName, + int historyDepth, boolean usingHash) { + SelectQuery filteringQuery = QueryBuilder.newBuilder(filter, + QueryUtils.collectJoinFields(filter, pageable.getSort()) + ).with(pageable.getSort()).build(); + Field historyGroupingField = usingHash ? TEST_ITEM.TEST_CASE_HASH : TEST_ITEM.UNIQUE_ID; + Page historyBaseline = loadHistoryBaseline(filteringQuery, + historyGroupingField, + LAUNCH.PROJECT_ID.eq(projectId).and(LAUNCH.NAME.eq(launchName)), + pageable + ); + + List itemHistories = historyBaseline.getContent().stream().map(value -> { + List itemIds = loadHistoryItem(getHistoryFilter(filter, usingHash, value), + pageable.getSort(), + LAUNCH.PROJECT_ID.eq(projectId).and(LAUNCH.NAME.eq(launchName)) + ).map(testItem -> getHistoryIds(testItem, usingHash, projectId, launchName, historyDepth - 1)) + .orElseGet(Collections::emptyList); + return new TestItemHistory(value, itemIds); + }).collect(Collectors.toList()); + + return new PageImpl<>(itemHistories, pageable, historyBaseline.getTotalElements()); + + } + + @Override + public Page loadItemsHistoryPage(Queryable filter, Pageable pageable, + Long projectId, List launchIds, + int historyDepth, boolean usingHash) { + SelectQuery filteringQuery = QueryBuilder.newBuilder(filter, + QueryUtils.collectJoinFields(filter, pageable.getSort()) + ) + .with(pageable.getSort()) + .addCondition(LAUNCH.ID.in(launchIds).and(LAUNCH.PROJECT_ID.eq(projectId))) + .build(); + + Field historyGroupingField = usingHash ? TEST_ITEM.TEST_CASE_HASH : TEST_ITEM.UNIQUE_ID; + Page historyBaseline = loadHistoryBaseline(filteringQuery, + historyGroupingField, + LAUNCH.ID.in(launchIds).and(LAUNCH.PROJECT_ID.eq(projectId)), + pageable + ); + + List itemHistories = historyBaseline.getContent().stream().map(value -> { + List itemIds = loadHistoryItem(getHistoryFilter(filter, usingHash, value), + pageable.getSort(), + LAUNCH.ID.in(launchIds).and(LAUNCH.PROJECT_ID.eq(projectId)) + ).map(testItem -> getHistoryIds(testItem, usingHash, projectId, historyDepth - 1)) + .orElseGet(Collections::emptyList); + return new TestItemHistory(value, itemIds); + }).collect(Collectors.toList()); + + return new PageImpl<>(itemHistories, pageable, historyBaseline.getTotalElements()); + + } + + @Override + public Page loadItemsHistoryPage(boolean isLatest, Queryable launchFilter, + Queryable testItemFilter, + Pageable launchPageable, Pageable testItemPageable, Long projectId, int historyDepth, + boolean usingHash) { + SelectQuery filteringQuery = buildCompositeFilterHistoryQuery(isLatest, + launchFilter, + testItemFilter, + launchPageable, + testItemPageable + ); + + Field historyGroupingField = usingHash ? TEST_ITEM.TEST_CASE_HASH : TEST_ITEM.UNIQUE_ID; + Page historyBaseline = loadHistoryBaseline(filteringQuery, + historyGroupingField, + LAUNCH.PROJECT_ID.eq(projectId), + testItemPageable + ); + + List itemHistories = historyBaseline.getContent().stream().map(value -> { + List itemIds = loadHistoryItem(getHistoryFilter(testItemFilter, usingHash, value), + testItemPageable.getSort(), + LAUNCH.PROJECT_ID.eq(projectId) + ).map(testItem -> getHistoryIds(testItem, usingHash, projectId, historyDepth - 1)) + .orElseGet(Collections::emptyList); + return new TestItemHistory(value, itemIds); + }).collect(Collectors.toList()); + + return new PageImpl<>(itemHistories, testItemPageable, historyBaseline.getTotalElements()); + } + + @Override + public Page loadItemsHistoryPage(boolean isLatest, Queryable launchFilter, + Queryable testItemFilter, + Pageable launchPageable, Pageable testItemPageable, Long projectId, String launchName, + int historyDepth, boolean usingHash) { + SelectQuery filteringQuery = buildCompositeFilterHistoryQuery(isLatest, + launchFilter, + testItemFilter, + launchPageable, + testItemPageable + ); + + Field historyGroupingField = usingHash ? TEST_ITEM.TEST_CASE_HASH : TEST_ITEM.UNIQUE_ID; + Page historyBaseline = loadHistoryBaseline(filteringQuery, + historyGroupingField, + LAUNCH.PROJECT_ID.eq(projectId).and(LAUNCH.NAME.eq(launchName)), + testItemPageable + ); + + List itemHistories = historyBaseline.getContent().stream().map(value -> { + List itemIds = loadHistoryItem(getHistoryFilter(testItemFilter, usingHash, value), + testItemPageable.getSort(), + LAUNCH.PROJECT_ID.eq(projectId).and(LAUNCH.NAME.eq(launchName)) + ).map(testItem -> getHistoryIds(testItem, usingHash, projectId, historyDepth - 1)) + .orElseGet(Collections::emptyList); + return new TestItemHistory(value, itemIds); + }).collect(Collectors.toList()); + + return new PageImpl<>(itemHistories, testItemPageable, historyBaseline.getTotalElements()); + } + + private SelectQuery buildCompositeFilterHistoryQuery(boolean isLatest, + Queryable launchFilter, + Queryable testItemFilter, Pageable launchPageable, Pageable testItemPageable) { + Table launchesTable = QueryUtils.createQueryBuilderWithLatestLaunchesOption( + launchFilter, + launchPageable.getSort(), + isLatest + ).with(launchPageable).build().asTable(LAUNCHES); + + return QueryBuilder.newBuilder(testItemFilter, + QueryUtils.collectJoinFields(testItemFilter, testItemPageable.getSort())) + .with(testItemPageable.getSort()) + .addJointToStart(launchesTable, + JoinType.JOIN, + TEST_ITEM.LAUNCH_ID.eq(fieldName(launchesTable.getName(), ID).cast(Long.class)) + ) + .build(); + } + + private Page loadHistoryBaseline(SelectQuery filteringQuery, + Field historyGroupingField, + Condition baselineCondition, Pageable pageable) { + return PageableExecutionUtils.getPage(dsl.with(ITEMS) + .as(filteringQuery) + .select(historyGroupingField) + .from(TEST_ITEM) + .join(ITEMS) + .on(TEST_ITEM.ITEM_ID.eq(fieldName(ITEMS, ID).cast(Long.class))) + .join(LAUNCH) + .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) + .where(baselineCondition) + .and(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT)) + .groupBy(historyGroupingField) + .orderBy(max(TEST_ITEM.START_TIME)) + .limit(pageable.getPageSize()) + .offset(retrieveOffsetAndApplyBoundaries(pageable)) + .fetchInto(String.class), + pageable, + () -> dsl.fetchCount(with(ITEMS).as(filteringQuery) + .select(TEST_ITEM.field(historyGroupingField)) + .from(TEST_ITEM) + .join(ITEMS) + .on(TEST_ITEM.ITEM_ID.eq(fieldName(ITEMS, ID).cast(Long.class))) + .groupBy(TEST_ITEM.field(historyGroupingField))) + ); + } + + private Filter getHistoryFilter(Queryable filter, boolean usingHash, String historyValue) { + List commonConditions = filter.getFilterConditions(); + return new Filter(filter.getTarget().getClazz(), Lists.newArrayList()).withConditions( + commonConditions) + .withCondition(usingHash ? + FilterCondition.builder().eq(CRITERIA_TEST_CASE_HASH, historyValue).build() : + FilterCondition.builder().eq(CRITERIA_UNIQUE_ID, historyValue).build()) + .withCondition( + FilterCondition.builder().eq(CRITERIA_LAUNCH_MODE, LaunchModeEnum.DEFAULT.name()) + .build()); + } + + private List getHistoryIds(TestItem testItem, boolean usingHash, Long projectId, + int historyDepth) { + List historyIds = usingHash ? loadHistory(testItem.getStartTime(), + testItem.getItemId(), + LAUNCH.PROJECT_ID.eq(projectId) + .and(TEST_ITEM.TEST_CASE_HASH.eq(testItem.getTestCaseHash())), + historyDepth + ) : loadHistory(testItem.getStartTime(), + testItem.getItemId(), + LAUNCH.PROJECT_ID.eq(projectId).and(TEST_ITEM.UNIQUE_ID.eq(testItem.getUniqueId())), + historyDepth + ); + historyIds.add(0, testItem.getItemId()); + return historyIds; + } + + private List getHistoryIds(TestItem testItem, boolean usingHash, Long projectId, + String launchName, int historyDepth) { + if (historyDepth > 0) { + List historyIds = usingHash ? loadHistory(testItem.getStartTime(), + testItem.getItemId(), + LAUNCH.PROJECT_ID.eq(projectId) + .and(LAUNCH.NAME.eq(launchName)) + .and(TEST_ITEM.TEST_CASE_HASH.eq(testItem.getTestCaseHash())), + historyDepth + ) : loadHistory(testItem.getStartTime(), + testItem.getItemId(), + LAUNCH.PROJECT_ID.eq(projectId).and(LAUNCH.NAME.eq(launchName)) + .and(TEST_ITEM.UNIQUE_ID.eq(testItem.getUniqueId())), + historyDepth + ); + historyIds.add(0, testItem.getItemId()); + return historyIds; + } + return Lists.newArrayList(testItem.getItemId()); + } + + private Optional loadHistoryItem(Queryable filter, Sort sort, + Condition baselineCondition) { + List orders = sort.get().collect(toList()); + orders.add(new Sort.Order(Sort.Direction.DESC, CRITERIA_START_TIME)); + + SelectQuery selectQuery = QueryBuilder.newBuilder(filter, + QueryUtils.collectJoinFields(filter, sort)) + .with(Sort.by(orders)) + .with(1) + .build(); + selectQuery.addConditions(baselineCondition); + + return dsl.with(HISTORY) + .as(selectQuery) + .select() + .from(TEST_ITEM) + .join(HISTORY) + .on(TEST_ITEM.ITEM_ID.eq(fieldName(HISTORY, ID).cast(Long.class))) + .fetchInto(TestItem.class) + .stream() + .findFirst(); + } + + private List loadHistory(LocalDateTime startTime, Long itemId, Condition baselineCondition, + int historyDepth) { + return dsl.select(TEST_ITEM.ITEM_ID) + .from(TEST_ITEM) + .join(LAUNCH) + .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) + .where(baselineCondition) + .and(TEST_ITEM.ITEM_ID.notEqual(itemId)) + .and(TEST_ITEM.START_TIME.lessOrEqual(Timestamp.valueOf(startTime))) + .and(LAUNCH.MODE.eq(JLaunchModeEnum.DEFAULT)) + .orderBy(TEST_ITEM.START_TIME.desc(), LAUNCH.START_TIME.desc(), LAUNCH.NUMBER.desc()) + .limit(historyDepth) + .fetchInto(Long.class); + } + + @Override + public List selectAllDescendants(Long itemId) { + return commonTestItemDslSelect().where(TEST_ITEM.PARENT_ID.eq(itemId)) + .fetch(TEST_ITEM_RECORD_MAPPER); + } + + @Override + public List selectAllDescendantsWithChildren(Long itemId) { + JTestItem childTestItem = JTestItem.TEST_ITEM.as("cti"); + return commonTestItemDslSelect().where(TEST_ITEM.PARENT_ID.eq(itemId)) + .and(DSL.exists(DSL.selectOne() + .from(TEST_ITEM) + .join(childTestItem) + .on(TEST_ITEM.ITEM_ID.eq(childTestItem.PARENT_ID)) + .where(TEST_ITEM.PARENT_ID.eq(itemId)))) + .fetch(TEST_ITEM_RECORD_MAPPER); + } + + @Override + public List findTestItemIdsByLaunchId(Long launchId, Pageable pageable) { + JTestItem retryParent = TEST_ITEM.as(RETRY_PARENT); + return dsl.select(TEST_ITEM.ITEM_ID) + .from(TEST_ITEM) + .leftJoin(retryParent) + .on(TEST_ITEM.RETRY_OF.eq(retryParent.ITEM_ID)) + .where(TEST_ITEM.LAUNCH_ID.eq(launchId).or(retryParent.LAUNCH_ID.eq(launchId))) + .orderBy(TEST_ITEM.ITEM_ID) + .limit(pageable.getPageSize()) + .offset(retrieveOffsetAndApplyBoundaries(pageable)) + .fetchInto(Long.class); + } + + @Override + public List selectItemsInStatusByLaunch(Long launchId, StatusEnum... statuses) { + List jStatuses = Arrays.stream(statuses).map(it -> JStatusEnum.valueOf(it.name())) + .collect(toList()); + return commonTestItemDslSelect().where( + TEST_ITEM.LAUNCH_ID.eq(launchId).and(TEST_ITEM_RESULTS.STATUS.in(jStatuses))) + .fetch(TEST_ITEM_RECORD_MAPPER); + } + + @Override + public List selectItemsInStatusByParent(Long itemId, StatusEnum... statuses) { + List jStatuses = Arrays.stream(statuses).map(it -> JStatusEnum.valueOf(it.name())) + .collect(toList()); + return commonTestItemDslSelect().where( + TEST_ITEM.PARENT_ID.eq(itemId).and(TEST_ITEM_RESULTS.STATUS.in(jStatuses))) + .fetch(TEST_ITEM_RECORD_MAPPER); + } + + @Override + public Boolean hasItemsInStatusByLaunch(Long launchId, StatusEnum... statuses) { + List jStatuses = Arrays.stream(statuses).map(it -> JStatusEnum.valueOf(it.name())) + .collect(toList()); + return dsl.fetchExists(dsl.selectOne() + .from(TEST_ITEM) + .join(TEST_ITEM_RESULTS) + .onKey() + .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) + .and(TEST_ITEM_RESULTS.STATUS.in(jStatuses)) + .limit(1)); + } + + @Override + public List findAllNotInIssueByLaunch(Long launchId, String locator) { + return commonTestItemDslSelect().join(ISSUE) + .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(ISSUE_TYPE) + .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) + .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) + .and(ISSUE_TYPE.LOCATOR.ne(locator)) + .fetch(TEST_ITEM_RECORD_MAPPER); + } + + @Override + public List selectIdsNotInIssueByLaunch(Long launchId, String locator) { + return dsl.select(TEST_ITEM.ITEM_ID) + .from(TEST_ITEM) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(ISSUE) + .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(ISSUE_TYPE) + .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) + .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) + .and(ISSUE_TYPE.LOCATOR.ne(locator)) + .fetchInto(Long.class); + } + + @Override + public List findAllNotInIssueGroupByLaunch(Long launchId, + TestItemIssueGroup issueGroup) { + return dsl.select() + .from(TEST_ITEM) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(ISSUE) + .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(ISSUE_TYPE) + .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) + .join(ISSUE_GROUP) + .on(ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)) + .where(TEST_ITEM.LAUNCH_ID.eq(launchId) + .and(ISSUE_GROUP.ISSUE_GROUP_.ne(JIssueGroupEnum.valueOf(issueGroup.getValue())))) + .fetch(TEST_ITEM_RECORD_MAPPER); + + } + + @Override + public List selectIdsNotInIssueGroupByLaunch(Long launchId, TestItemIssueGroup issueGroup) { + return dsl.select(TEST_ITEM.ITEM_ID) + .from(TEST_ITEM) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(ISSUE) + .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(ISSUE_TYPE) + .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) + .join(ISSUE_GROUP) + .on(ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)) + .where(TEST_ITEM.LAUNCH_ID.eq(launchId) + .and(ISSUE_GROUP.ISSUE_GROUP_.ne(JIssueGroupEnum.valueOf(issueGroup.getValue())))) + .fetchInto(Long.class); + } + + @Override + public List findAllInIssueGroupByLaunch(Long launchId, TestItemIssueGroup issueGroup) { + return dsl.select() + .from(TEST_ITEM) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(ISSUE) + .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(ISSUE_TYPE) + .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) + .join(ISSUE_GROUP) + .on(ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)) + .where(TEST_ITEM.LAUNCH_ID.eq(launchId) + .and(ISSUE_GROUP.ISSUE_GROUP_.eq(JIssueGroupEnum.valueOf(issueGroup.getValue())))) + .fetch(TEST_ITEM_RECORD_MAPPER); + } + + @Override + public List selectIdsWithIssueByLaunch(Long launchId) { + return dsl.select(TEST_ITEM.ITEM_ID) + .from(TEST_ITEM) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(ISSUE) + .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) + .fetchInto(Long.class); + } + + @Override + public Boolean hasItemsInStatusAddedLately(Long launchId, Duration period, + StatusEnum... statuses) { + List jStatuses = Arrays.stream(statuses).map(it -> JStatusEnum.valueOf(it.name())) + .collect(toList()); + return dsl.fetchExists(dsl.selectOne() + .from(TEST_ITEM) + .join(TEST_ITEM_RESULTS) + .onKey() + .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) + .and(TEST_ITEM_RESULTS.STATUS.in(jStatuses)) + .and(TEST_ITEM.START_TIME.gt(TimestampUtils.getTimestampBackFromNow(period))) + .limit(1)); + } + + @Override + public Boolean hasLogs(Long launchId, Duration period, StatusEnum... statuses) { + List jStatuses = Arrays.stream(statuses).map(it -> JStatusEnum.valueOf(it.name())) + .collect(toList()); + return dsl.fetchExists(dsl.selectOne() + .from(TEST_ITEM) + .join(TEST_ITEM_RESULTS) + .onKey() + .join(LOG) + .on(TEST_ITEM.ITEM_ID.eq(LOG.ITEM_ID)) + .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) + .and(TEST_ITEM_RESULTS.STATUS.in(jStatuses)) + .and(TEST_ITEM.START_TIME.lt(TimestampUtils.getTimestampBackFromNow(period))) + .limit(1)); + } + + @Override + public List selectItemsInIssueByLaunch(Long launchId, String issueType) { + return commonTestItemDslSelect().join(ISSUE) + .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(ISSUE_TYPE) + .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) + .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) + .and(ISSUE_TYPE.LOCATOR.eq(issueType)) + .fetch(TEST_ITEM_RECORD_MAPPER::map); + } + + @Override + public List selectRetries(List retryOfIds) { + return TEST_ITEM_RETRY_FETCHER.apply(dsl.select() + .from(TEST_ITEM) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .leftJoin(PARAMETER) + .on(TEST_ITEM.ITEM_ID.eq(PARAMETER.ITEM_ID)) + .where(TEST_ITEM.RETRY_OF.in(retryOfIds)) + .and(TEST_ITEM.LAUNCH_ID.isNull()) + .orderBy(TEST_ITEM.START_TIME) + .fetch()); + } + + @Override + public List selectIssueLocatorsByProject(Long projectId) { + return dsl.select() + .from(PROJECT) + .join(ISSUE_TYPE_PROJECT) + .on(PROJECT.ID.eq(ISSUE_TYPE_PROJECT.PROJECT_ID)) + .join(ISSUE_TYPE) + .on(ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID.eq(ISSUE_TYPE.ID)) + .join(ISSUE_GROUP) + .on(Tables.ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)) + .where(PROJECT.ID.eq(projectId)) + .fetch(ISSUE_TYPE_RECORD_MAPPER); + } + + @Override + public Optional selectIssueTypeByLocator(Long projectId, String locator) { + return ofNullable(dsl.select() + .from(ISSUE_TYPE) + .join(ISSUE_TYPE_PROJECT) + .on(ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID.eq(ISSUE_TYPE.ID)) + .join(ISSUE_GROUP) + .on(ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)) + .where(ISSUE_TYPE_PROJECT.PROJECT_ID.eq(projectId)) + .and(ISSUE_TYPE.LOCATOR.eq(locator)) + .fetchOne(ISSUE_TYPE_RECORD_MAPPER)); + } + + @Override + public Optional> selectPath(String uuid) { + return dsl.select(TEST_ITEM.ITEM_ID, TEST_ITEM.PATH) + .from(TEST_ITEM) + .where(TEST_ITEM.UUID.eq(uuid)) + .fetchOptional(r -> Pair.of(r.get(TEST_ITEM.ITEM_ID), r.get(TEST_ITEM.PATH, String.class))); + } + + /** + * {@link Log} entities are searched from the whole tree under {@link TestItem} that matched to + * the provided `launchId` and `autoAnalyzed` conditions + */ + @Override + public List selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(boolean autoAnalyzed, + boolean ignoreAnalyzer, Long launchId, + int logLevel, Collection excludedIssueTypes) { + + JTestItem outerItemTable = TEST_ITEM.as(OUTER_ITEM_TABLE); + JTestItem nestedItemTable = TEST_ITEM.as(NESTED); + + final List excludedTypeIds = excludedIssueTypes.stream().map(IssueType::getId) + .collect(toList()); + final Condition issueCondition = ISSUE.AUTO_ANALYZED.eq(autoAnalyzed) + .and(ISSUE.IGNORE_ANALYZER.eq(ignoreAnalyzer)) + .and(ISSUE.ISSUE_TYPE.notIn(excludedTypeIds)); + + 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(issueCondition) + .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(issueCondition) + .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel))) + .asTable(ITEM)) + .fetchInto(Long.class); + } + + @Override + public int updateStatusAndEndTimeById(Long itemId, JStatusEnum status, LocalDateTime endTime) { + + return dsl.update(TEST_ITEM_RESULTS) + .set(TEST_ITEM_RESULTS.STATUS, status) + .set(TEST_ITEM_RESULTS.END_TIME, Timestamp.valueOf(endTime)) + .set(TEST_ITEM_RESULTS.DURATION, + dsl.select(DSL.extract(endTime, DatePart.EPOCH) + .minus(DSL.extract(TEST_ITEM.START_TIME, DatePart.EPOCH)) + .cast(Double.class)).from(TEST_ITEM).where(TEST_ITEM.ITEM_ID.eq(itemId)) + ) + .where(TEST_ITEM_RESULTS.RESULT_ID.eq(itemId)) + .execute(); + } + + @Override + public int updateStatusAndEndTimeByRetryOfId(Long retryOfId, JStatusEnum from, JStatusEnum to, + LocalDateTime endTime) { + return dsl.update(TEST_ITEM_RESULTS) + .set(TEST_ITEM_RESULTS.STATUS, to) + .set(TEST_ITEM_RESULTS.END_TIME, Timestamp.valueOf(endTime)) + .set(TEST_ITEM_RESULTS.DURATION, + dsl.select(DSL.extract(endTime, DatePart.EPOCH) + .minus(DSL.extract(TEST_ITEM.START_TIME, DatePart.EPOCH)) + .cast(Double.class)).from(TEST_ITEM) + .where(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + ) + .where(TEST_ITEM_RESULTS.RESULT_ID.in(DSL.select(TEST_ITEM.ITEM_ID) + .from(TEST_ITEM) + .where(TEST_ITEM.RETRY_OF.eq(retryOfId)))) + .and(TEST_ITEM_RESULTS.STATUS.eq(from)) + .execute(); + } + + @Override + public TestItemTypeEnum getTypeByItemId(Long itemId) { + return dsl.select(TEST_ITEM.TYPE).from(TEST_ITEM).where(TEST_ITEM.ITEM_ID.eq(itemId)) + .fetchOneInto(TestItemTypeEnum.class); + } + + @Override + public List selectIdsByFilter(Long launchId, Queryable filter, int limit, int offset) { + final SelectQuery selectQuery = QueryBuilder.newBuilder(filter, + QueryUtils.collectJoinFields(filter)) + .with(limit) + .withOffset(offset) + .with(Sort.by(Sort.Order.asc(CRITERIA_ID))) + .build(); + selectQuery.addConditions(TEST_ITEM.LAUNCH_ID.eq(launchId)); + return dsl.select(fieldName(ITEMS, ID)).from(selectQuery.asTable(ITEMS)).fetchInto(Long.class); + } + + @Override + public List selectIdsByHasDescendants(Collection 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); + } + + @Override + public List selectIdsByStringLogMessage(Collection itemIds, Integer logLevel, + String pattern) { + return dsl.selectDistinct(TEST_ITEM.ITEM_ID) + .from(TEST_ITEM) + .join(LOG) + .on(TEST_ITEM.ITEM_ID.eq(LOG.ITEM_ID)) + .where(TEST_ITEM.ITEM_ID.in(itemIds)) + .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) + .and(LOG.LOG_MESSAGE.like("%" + DSL.escape(pattern, '\\') + "%")) + .fetchInto(Long.class); + } + + @Override + public List selectIdsByRegexLogMessage(Collection itemIds, Integer logLevel, + String pattern) { + return dsl.selectDistinct(TEST_ITEM.ITEM_ID) + .from(TEST_ITEM) + .join(LOG) + .on(TEST_ITEM.ITEM_ID.eq(LOG.ITEM_ID)) + .where(TEST_ITEM.ITEM_ID.in(itemIds)) + .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) + .and(LOG.LOG_MESSAGE.likeRegex(pattern)) + .fetchInto(Long.class); + } + + @Override + public List selectLogIdsWithLogLevelCondition(Collection itemIds, Integer logLevel) { + return dsl.selectDistinct(LOG.ID) + .from(TEST_ITEM) + .join(LOG) + .on(TEST_ITEM.ITEM_ID.eq(LOG.ITEM_ID)) + .where(TEST_ITEM.ITEM_ID.in(itemIds)) + .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) + .fetchInto(Long.class); + } + + @Override + public List selectIdsUnderByStringLogMessage(Long launchId, Collection itemIds, + Integer logLevel, String pattern) { + final JTestItem child = TEST_ITEM.as(CHILD_ITEM_TABLE); + + return dsl.selectDistinct(TEST_ITEM.ITEM_ID) + .from(TEST_ITEM) + .join(child) + .on(TEST_ITEM.PATH + " @> " + child.PATH) + .and(TEST_ITEM.ITEM_ID.notEqual(child.ITEM_ID)) + .join(LOG) + .on(child.ITEM_ID.eq(LOG.ITEM_ID)) + .where(TEST_ITEM.ITEM_ID.in(itemIds)) + .and(child.LAUNCH_ID.eq(launchId)) + .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) + .and(LOG.LOG_MESSAGE.like("%" + DSL.escape(pattern, '\\') + "%")) + .groupBy(TEST_ITEM.ITEM_ID) + .fetchInto(Long.class); + } + + @Override + public List selectLogIdsUnderWithLogLevelCondition(Long launchId, Collection itemIds, + Integer logLevel) { + final JTestItem child = TEST_ITEM.as(CHILD_ITEM_TABLE); + + return dsl.selectDistinct(LOG.ID) + .from(TEST_ITEM) + .join(child) + .on(TEST_ITEM.PATH + " @> " + child.PATH) + .and(TEST_ITEM.ITEM_ID.notEqual(child.ITEM_ID)) + .join(LOG) + .on(child.ITEM_ID.eq(LOG.ITEM_ID)) + .where(TEST_ITEM.ITEM_ID.in(itemIds)) + .and(child.LAUNCH_ID.eq(launchId)) + .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) + .fetchInto(Long.class); + } + + @Override + public List selectIdsUnderByRegexLogMessage(Long launchId, Collection itemIds, + Integer logLevel, String pattern) { + final JTestItem child = TEST_ITEM.as(CHILD_ITEM_TABLE); + + return dsl.selectDistinct(TEST_ITEM.ITEM_ID) + .from(TEST_ITEM) + .join(child) + .on(TEST_ITEM.PATH + " @> " + child.PATH) + .and(TEST_ITEM.ITEM_ID.notEqual(child.ITEM_ID)) + .join(LOG) + .on(child.ITEM_ID.eq(LOG.ITEM_ID)) + .where(TEST_ITEM.ITEM_ID.in(itemIds)) + .and(child.LAUNCH_ID.eq(launchId)) + .and(LOG.LOG_LEVEL.greaterOrEqual(logLevel)) + .and(LOG.LOG_MESSAGE.likeRegex(pattern)) + .groupBy(TEST_ITEM.ITEM_ID) + .fetchInto(Long.class); + } + + /** + * Commons select of an item with it's results and structure + * + * @return Select condition step + */ + private SelectOnConditionStep commonTestItemDslSelect() { + return dsl.select().from(TEST_ITEM).join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)); + } + + @Override + public List findByFilter(Queryable filter) { + return TEST_ITEM_FETCHER.apply(dsl.fetch( + QueryBuilder.newBuilder(filter, QueryUtils.collectJoinFields(filter)).wrap().build())); + } + + @Override + public Page findByFilter(Queryable filter, Pageable pageable) { + + Set joinFields = QueryUtils.collectJoinFields(filter, pageable.getSort()); + List items = TEST_ITEM_FETCHER.apply( + dsl.fetch(QueryBuilder.newBuilder(filter, joinFields) + .with(pageable) + .wrap() + .withWrapperSort(pageable.getSort()) + .build())); + + return PageableExecutionUtils.getPage(items, pageable, + () -> dsl.fetchCount(QueryBuilder.newBuilder(filter, joinFields).build())); + } + + @Override + public List findAllNestedStepsByIds(Collection ids, Queryable logFilter, + boolean excludePassedLogs) { + JTestItem nested = TEST_ITEM.as(NESTED); + SelectQuery logsSelectQuery = QueryBuilder.newBuilder(logFilter, + QueryUtils.collectJoinFields(logFilter)).build(); + + return dsl.select(TEST_ITEM.ITEM_ID, + TEST_ITEM.NAME, + TEST_ITEM.UUID, + TEST_ITEM.START_TIME, + TEST_ITEM.TYPE, + TEST_ITEM_RESULTS.STATUS, + TEST_ITEM_RESULTS.END_TIME, + TEST_ITEM_RESULTS.DURATION, + DSL.field(hasContentQuery(nested, logsSelectQuery, excludePassedLogs)).as(HAS_CONTENT), + DSL.field(dsl.with(LOGS) + .as(logsSelectQuery) + .selectCount() + .from(LOG) + .join(nested) + .on(LOG.ITEM_ID.eq(nested.ITEM_ID)) + .join(LOGS) + .on(LOG.ID.eq(fieldName(LOGS, ID).cast(Long.class))) + .join(ATTACHMENT) + .on(LOG.ATTACHMENT_ID.eq(ATTACHMENT.ID)) + .where(nested.HAS_STATS.isFalse() + .and(DSL.sql(fieldName(NESTED, TEST_ITEM.PATH.getName()) + " <@ cast(? AS LTREE)", + TEST_ITEM.PATH)))) + .as(ATTACHMENTS_COUNT) + ) + .from(TEST_ITEM) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .where(TEST_ITEM.ITEM_ID.in(ids)) + .fetch(NESTED_STEP_RECORD_MAPPER); + } + + @Override + public List findIndexTestItemByLaunchId(Long launchId, + Collection itemTypes) { + return dsl.select(TEST_ITEM.ITEM_ID, + TEST_ITEM.NAME, + TEST_ITEM.START_TIME, + TEST_ITEM.UNIQUE_ID, + TEST_ITEM.TEST_CASE_HASH, + ISSUE.AUTO_ANALYZED, + ISSUE_TYPE.LOCATOR + ) + .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(ISSUE_TYPE) + .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) + .where(TEST_ITEM.LAUNCH_ID.eq(launchId)) + .and(TEST_ITEM.TYPE.in(itemTypes)) + .and(ISSUE.IGNORE_ANALYZER.isFalse()) + .fetch(INDEX_TEST_ITEM_RECORD_MAPPER); + + } + + private Condition hasContentQuery(JTestItem nested, SelectQuery logsSelectQuery, + boolean excludePassedLogs) { + if (excludePassedLogs) { + return DSL.exists(dsl.with(LOGS) + .as(logsSelectQuery) + .select() + .from(LOG) + .join(LOGS) + .on(LOG.ID.eq(fieldName(LOGS, ID).cast(Long.class))) + .join(TEST_ITEM_RESULTS) + .on(LOG.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .where(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID))) + .and(TEST_ITEM_RESULTS.STATUS.notIn(JStatusEnum.PASSED, JStatusEnum.INFO, + JStatusEnum.WARN)); + } else { + return DSL.exists(dsl.with(LOGS) + .as(logsSelectQuery) + .select() + .from(LOG) + .join(LOGS) + .on(LOG.ID.eq(fieldName(LOGS, ID).cast(Long.class))) + .where(LOG.ITEM_ID.eq(TEST_ITEM.ITEM_ID))) + .orExists(dsl.select().from(nested) + .where(nested.PARENT_ID.eq(TEST_ITEM.ITEM_ID).and(nested.HAS_STATS.isFalse()))); + } + } + + /** + * @return Map + */ + @Override + public Map selectPathNames(Collection testItems) { + if (CollectionUtils.isEmpty(testItems)) { + return new HashMap<>(); + } + + // Item ids for search + Set testItemIds = new HashSet<>(); + // Structure for creating return object + Map> testItemWithPathIds = new HashMap<>(); + + for (TestItem testItem : testItems) { + String path = testItem.getPath(); + // For normal case is redundant, but not sure for current situation, better to check + // and skip testItem without path, cause of incorrect state. + if (Strings.isBlank(path)) { + continue; + } + String[] pathIds = path.split("\\."); + Arrays.asList(pathIds).forEach( + pathItemId -> { + long itemIdFromPath = Long.parseLong(pathItemId); + testItemIds.add(itemIdFromPath); + + List itemPaths = testItemWithPathIds.getOrDefault(testItem.getItemId(), + new ArrayList<>()); + itemPaths.add(itemIdFromPath); + testItemWithPathIds.put(testItem.getItemId(), itemPaths); + } + ); + } + + Map> resultMap = new HashMap<>(); + // Convert database data to more useful form + getTestItemAndLaunchIdName(testItemIds).forEach(record -> resultMap.put( + record.get(fieldName("item_id"), Long.class), record + )); + + Map testItemPathNames = new HashMap<>(); + testItemWithPathIds.forEach((testItemId, pathIds) -> { + var record = resultMap.get(testItemId); + if (record == null) { + return; + } + + LaunchPathName launchPathName = new LaunchPathName( + record.get(fieldName("launch_name"), String.class), + record.get(fieldName("number"), Integer.class) + ); + + List itemPathNames = new ArrayList<>(); + pathIds.forEach(pathItemId -> { + // Base testItem don't add + if (!testItemId.equals(pathItemId) && resultMap.containsKey(pathItemId)) { + var record2 = resultMap.get(pathItemId); + String pathItemName = record2.get(fieldName("name"), String.class); + itemPathNames.add(new ItemPathName(pathItemId, pathItemName)); + } + }); + PathName pathName = new PathName(launchPathName, itemPathNames); + testItemPathNames.put(testItemId, pathName); + }); + + return testItemPathNames; + } + + /** + * @param testItemIds Collection + * @return Result> + */ + private Result> getTestItemAndLaunchIdName( + Collection testItemIds) { + return dsl.select(TEST_ITEM.ITEM_ID, TEST_ITEM.NAME, LAUNCH.NUMBER, + LAUNCH.NAME.as("launch_name")) + .from(TEST_ITEM) + .join(LAUNCH) + .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) + .where(TEST_ITEM.ITEM_ID.in(testItemIds)) + .fetch(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/TicketRepository.java b/src/main/java/com/epam/ta/reportportal/dao/TicketRepository.java index e4bacf191..9c59ac1dd 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TicketRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TicketRepository.java @@ -17,16 +17,16 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.bts.Ticket; - import java.util.List; import java.util.Optional; /** * @author Pavel Bortnik */ -public interface TicketRepository extends ReportPortalRepository, TicketRepositoryCustom { +public interface TicketRepository extends ReportPortalRepository, + TicketRepositoryCustom { - Optional findByTicketId(String ticketId); + Optional findByTicketId(String ticketId); - List findByTicketIdIn(List ticketId); + List findByTicketIdIn(List ticketId); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/TicketRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/TicketRepositoryCustom.java index ab46c9269..d93f59553 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TicketRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TicketRepositoryCustom.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.project.Project; - import java.time.LocalDateTime; import java.util.List; @@ -26,31 +25,31 @@ */ public interface TicketRepositoryCustom { - /** - * Find tickets that contains a term as a part inside for specified launch - * - * @param launchId Launch id - * @param term A part of ticket id - * @return List of ticket ids - */ - List findByLaunchIdAndTerm(Long launchId, String term); - - /** - * Find tickets that contains a term as a part inside for specified project - * - * @param projectId {@link Project#getId()} - * @param term A part of ticket id - * @return List of ticket ids - */ - List findByProjectIdAndTerm(Long projectId, String term); - - /** - * Returns number of unique tickets on specified project posted before {@code from} parameter - * - * @param projectId {@link com.epam.ta.reportportal.entity.project.Project#id} Id of project - * @param from Date threshold - * @return Number of unique tickets - */ - Integer findUniqueCountByProjectBefore(Long projectId, LocalDateTime from); + /** + * Find tickets that contains a term as a part inside for specified launch + * + * @param launchId Launch id + * @param term A part of ticket id + * @return List of ticket ids + */ + List findByLaunchIdAndTerm(Long launchId, String term); + + /** + * Find tickets that contains a term as a part inside for specified project + * + * @param projectId {@link Project#getId()} + * @param term A part of ticket id + * @return List of ticket ids + */ + List findByProjectIdAndTerm(Long projectId, String term); + + /** + * Returns number of unique tickets on specified project posted before {@code from} parameter + * + * @param projectId {@link com.epam.ta.reportportal.entity.project.Project#id} Id of project + * @param from Date threshold + * @return Number of unique tickets + */ + Integer findUniqueCountByProjectBefore(Long projectId, LocalDateTime from); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/TicketRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/TicketRepositoryCustomImpl.java index 70a55f2c4..3f9d04e5c 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TicketRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TicketRepositoryCustomImpl.java @@ -16,71 +16,75 @@ package com.epam.ta.reportportal.dao; -import org.jooq.DSLContext; -import org.jooq.impl.DSL; -import org.springframework.beans.factory.annotation.Autowired; +import static com.epam.ta.reportportal.jooq.Tables.ISSUE; +import static com.epam.ta.reportportal.jooq.Tables.ISSUE_TICKET; +import static com.epam.ta.reportportal.jooq.Tables.LAUNCH; +import static com.epam.ta.reportportal.jooq.Tables.TEST_ITEM; +import static com.epam.ta.reportportal.jooq.Tables.TEST_ITEM_RESULTS; +import static com.epam.ta.reportportal.jooq.Tables.TICKET; import java.sql.Timestamp; import java.time.LocalDateTime; import java.util.List; - -import static com.epam.ta.reportportal.jooq.Tables.*; +import org.jooq.DSLContext; +import org.jooq.impl.DSL; +import org.springframework.beans.factory.annotation.Autowired; /** * @author Pavel Bortnik */ public class TicketRepositoryCustomImpl implements TicketRepositoryCustom { - @Autowired - private DSLContext dsl; + @Autowired + private DSLContext dsl; - @Override - public List findByLaunchIdAndTerm(Long launchId, String term) { - return dsl.select(TICKET.TICKET_ID) - .from(TICKET) - .join(ISSUE_TICKET) - .on(TICKET.ID.eq(ISSUE_TICKET.TICKET_ID)) - .join(ISSUE) - .on(ISSUE_TICKET.ISSUE_ID.eq(ISSUE.ISSUE_ID)) - .join(TEST_ITEM) - .on(ISSUE.ISSUE_ID.eq(TEST_ITEM.ITEM_ID)) - .where(TICKET.TICKET_ID.likeIgnoreCase("%" + DSL.escape(term, '\\') + "%")) - .and(TEST_ITEM.LAUNCH_ID.eq(launchId)) - .fetchInto(String.class); - } + @Override + public List findByLaunchIdAndTerm(Long launchId, String term) { + return dsl.select(TICKET.TICKET_ID) + .from(TICKET) + .join(ISSUE_TICKET) + .on(TICKET.ID.eq(ISSUE_TICKET.TICKET_ID)) + .join(ISSUE) + .on(ISSUE_TICKET.ISSUE_ID.eq(ISSUE.ISSUE_ID)) + .join(TEST_ITEM) + .on(ISSUE.ISSUE_ID.eq(TEST_ITEM.ITEM_ID)) + .where(TICKET.TICKET_ID.likeIgnoreCase("%" + DSL.escape(term, '\\') + "%")) + .and(TEST_ITEM.LAUNCH_ID.eq(launchId)) + .fetchInto(String.class); + } - @Override - public List findByProjectIdAndTerm(Long projectId, String term) { - return dsl.selectDistinct(TICKET.TICKET_ID) - .from(TICKET) - .join(ISSUE_TICKET) - .on(TICKET.ID.eq(ISSUE_TICKET.TICKET_ID)) - .join(ISSUE) - .on(ISSUE_TICKET.ISSUE_ID.eq(ISSUE.ISSUE_ID)) - .join(TEST_ITEM_RESULTS) - .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .join(TEST_ITEM) - .on(TEST_ITEM_RESULTS.RESULT_ID.eq(TEST_ITEM.ITEM_ID)) - .join(LAUNCH) - .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) - .where(TICKET.TICKET_ID.likeIgnoreCase("%" + DSL.escape(term, '\\') + "%")) - .and(LAUNCH.PROJECT_ID.eq(projectId)) - .fetchInto(String.class); - } + @Override + public List findByProjectIdAndTerm(Long projectId, String term) { + return dsl.selectDistinct(TICKET.TICKET_ID) + .from(TICKET) + .join(ISSUE_TICKET) + .on(TICKET.ID.eq(ISSUE_TICKET.TICKET_ID)) + .join(ISSUE) + .on(ISSUE_TICKET.ISSUE_ID.eq(ISSUE.ISSUE_ID)) + .join(TEST_ITEM_RESULTS) + .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(TEST_ITEM) + .on(TEST_ITEM_RESULTS.RESULT_ID.eq(TEST_ITEM.ITEM_ID)) + .join(LAUNCH) + .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) + .where(TICKET.TICKET_ID.likeIgnoreCase("%" + DSL.escape(term, '\\') + "%")) + .and(LAUNCH.PROJECT_ID.eq(projectId)) + .fetchInto(String.class); + } - @Override - public Integer findUniqueCountByProjectBefore(Long projectId, LocalDateTime from) { - return dsl.fetchCount(dsl.selectDistinct(TICKET.TICKET_ID) - .from(TICKET) - .join(ISSUE_TICKET) - .on(TICKET.ID.eq(ISSUE_TICKET.TICKET_ID)) - .join(ISSUE) - .on(ISSUE_TICKET.ISSUE_ID.eq(ISSUE.ISSUE_ID)) - .join(TEST_ITEM) - .on(ISSUE.ISSUE_ID.eq(TEST_ITEM.ITEM_ID)) - .join(LAUNCH) - .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) - .where(LAUNCH.PROJECT_ID.eq(projectId)) - .and(TICKET.SUBMIT_DATE.greaterOrEqual(Timestamp.valueOf(from)))); - } + @Override + public Integer findUniqueCountByProjectBefore(Long projectId, LocalDateTime from) { + return dsl.fetchCount(dsl.selectDistinct(TICKET.TICKET_ID) + .from(TICKET) + .join(ISSUE_TICKET) + .on(TICKET.ID.eq(ISSUE_TICKET.TICKET_ID)) + .join(ISSUE) + .on(ISSUE_TICKET.ISSUE_ID.eq(ISSUE.ISSUE_ID)) + .join(TEST_ITEM) + .on(ISSUE.ISSUE_ID.eq(TEST_ITEM.ITEM_ID)) + .join(LAUNCH) + .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) + .where(LAUNCH.PROJECT_ID.eq(projectId)) + .and(TICKET.SUBMIT_DATE.greaterOrEqual(Timestamp.valueOf(from)))); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepository.java b/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepository.java index 63875e104..9cff50730 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepository.java @@ -17,24 +17,25 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.user.UserCreationBid; +import java.util.Date; +import java.util.Optional; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -import java.util.Date; -import java.util.Optional; - /** * @author Ivan Budaev */ -public interface UserCreationBidRepository extends ReportPortalRepository, UserCreationBidRepositoryCustom { +public interface UserCreationBidRepository extends ReportPortalRepository, + UserCreationBidRepositoryCustom { - @Query(value = "SELECT bid.* FROM user_creation_bid bid WHERE bid.uuid = :uuid AND (bid.metadata -> 'metadata'->>'type' = :type)", nativeQuery = true) - Optional findByUuidAndType(@Param("uuid") String uuid, @Param("type") String type); + @Query(value = "SELECT bid.* FROM user_creation_bid bid WHERE bid.uuid = :uuid AND (bid.metadata -> 'metadata'->>'type' = :type)", nativeQuery = true) + Optional findByUuidAndType(@Param("uuid") String uuid, + @Param("type") String type); - @Modifying - @Query(value = "DELETE FROM UserCreationBid u WHERE u.lastModified < :date") - int expireBidsOlderThan(@Param("date") Date date); + @Modifying + @Query(value = "DELETE FROM UserCreationBid u WHERE u.lastModified < :date") + int expireBidsOlderThan(@Param("date") Date date); - Optional findFirstByEmailOrderByLastModifiedDesc(String email); + Optional findFirstByEmailOrderByLastModifiedDesc(String email); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryCustom.java index 2f4ecc0bc..d0c0ba596 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryCustom.java @@ -21,5 +21,5 @@ */ public interface UserCreationBidRepositoryCustom { - int deleteAllByEmail(String email); + int deleteAllByEmail(String email); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryCustomImpl.java index 34340c082..6f88df11e 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryCustomImpl.java @@ -16,23 +16,23 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.jooq.tables.JUserCreationBid.USER_CREATION_BID; + import org.jooq.DSLContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import static com.epam.ta.reportportal.jooq.tables.JUserCreationBid.USER_CREATION_BID; - /** * @author Ihar Kahadouski */ @Repository public class UserCreationBidRepositoryCustomImpl implements UserCreationBidRepositoryCustom { - @Autowired - private DSLContext dsl; + @Autowired + private DSLContext dsl; - @Override - public int deleteAllByEmail(String email) { - return dsl.deleteFrom(USER_CREATION_BID).where(USER_CREATION_BID.EMAIL.eq(email)).execute(); - } + @Override + public int deleteAllByEmail(String email) { + return dsl.deleteFrom(USER_CREATION_BID).where(USER_CREATION_BID.EMAIL.eq(email)).execute(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepository.java b/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepository.java index c019e49f4..4180488e3 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepository.java @@ -17,10 +17,6 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.filter.UserFilter; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; - import java.util.Collection; import java.util.List; import java.util.Optional; @@ -28,38 +24,43 @@ /** * @author Pavel Bortnik */ -public interface UserFilterRepository extends ReportPortalRepository, UserFilterRepositoryCustom { +public interface UserFilterRepository extends ReportPortalRepository, + UserFilterRepositoryCustom { - /** - * Finds filter by 'id' and 'project id' - * - * @param id {@link UserFilter#id} - * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} whose filter will be extracted - * @return {@link UserFilter} wrapped in the {@link Optional} - */ - Optional findByIdAndProjectId(Long id, Long projectId); + /** + * Finds filter by 'id' and 'project id' + * + * @param id {@link UserFilter#id} + * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} whose filter + * will be extracted + * @return {@link UserFilter} wrapped in the {@link Optional} + */ + Optional findByIdAndProjectId(Long id, Long projectId); - /** - * @param ids {@link Iterable} of the filter Ids - * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} whose filters will be extracted - * @return The {@link List} of the {@link UserFilter} - */ - List findAllByIdInAndProjectId(Collection ids, Long projectId); + /** + * @param ids {@link Iterable} of the filter Ids + * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} whose + * filters will be extracted + * @return The {@link List} of the {@link UserFilter} + */ + List findAllByIdInAndProjectId(Collection ids, Long projectId); - /** - * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} whose filters will be extracted - * @return The {@link List} of the {@link UserFilter} - */ - List findAllByProjectId(Long projectId); + /** + * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} whose + * filters will be extracted + * @return The {@link List} of the {@link UserFilter} + */ + List findAllByProjectId(Long projectId); - /** - * Checks the existence of the {@link UserFilter} with specified name for a user on a project - * - * @param name {@link UserFilter#name} - * @param owner {@link UserFilter#owner} - * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} on which filter existence will be checked - * @return if exists 'true' else 'false' - */ - boolean existsByNameAndOwnerAndProjectId(String name, String owner, Long projectId); + /** + * Checks the existence of the {@link UserFilter} with specified name for a user on a project + * + * @param name {@link UserFilter#name} + * @param owner {@link UserFilter#owner} + * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} on which + * filter existence will be checked + * @return if exists 'true' else 'false' + */ + boolean existsByNameAndOwnerAndProjectId(String name, String owner, Long projectId); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustomImpl.java index 908de6d36..21e4cf8ea 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustomImpl.java @@ -16,33 +16,34 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.dao.util.ResultFetchers.USER_FILTER_FETCHER; + import com.epam.ta.reportportal.commons.querygen.ProjectFilter; import com.epam.ta.reportportal.entity.filter.UserFilter; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Repository; -import static com.epam.ta.reportportal.dao.util.ResultFetchers.USER_FILTER_FETCHER; - /** * @author Pavel Bortnik */ @Repository -public class UserFilterRepositoryCustomImpl extends AbstractShareableRepositoryImpl implements UserFilterRepositoryCustom { - - @Override - public Page getPermitted(ProjectFilter filter, Pageable pageable, String userName) { - return getPermitted(USER_FILTER_FETCHER, filter, pageable, userName); - } - - @Override - public Page getOwn(ProjectFilter filter, Pageable pageable, String userName) { - return getOwn(USER_FILTER_FETCHER, filter, pageable, userName); - } - - @Override - public Page getShared(ProjectFilter filter, Pageable pageable, String userName) { - return getShared(USER_FILTER_FETCHER, filter, pageable, userName); - } +public class UserFilterRepositoryCustomImpl extends + AbstractShareableRepositoryImpl implements UserFilterRepositoryCustom { + + @Override + public Page getPermitted(ProjectFilter filter, Pageable pageable, String userName) { + return getPermitted(USER_FILTER_FETCHER, filter, pageable, userName); + } + + @Override + public Page getOwn(ProjectFilter filter, Pageable pageable, String userName) { + return getOwn(USER_FILTER_FETCHER, filter, pageable, userName); + } + + @Override + public Page getShared(ProjectFilter filter, Pageable pageable, String userName) { + return getShared(USER_FILTER_FETCHER, filter, pageable, userName); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserPreferenceRepository.java b/src/main/java/com/epam/ta/reportportal/dao/UserPreferenceRepository.java index 846240cf2..a31adfe43 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserPreferenceRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserPreferenceRepository.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.preference.UserPreference; - import java.util.List; import java.util.Optional; @@ -28,31 +27,32 @@ */ public interface UserPreferenceRepository extends ReportPortalRepository { - /** - * Find user preferences by project and user - * - * @param projectId Project id - * @param userId User id - * @return List of user preferences - */ - List findByProjectIdAndUserId(Long projectId, Long userId); - - /** - * Find unique user preference - * - * @param projectId Project id - * @param userId User id - * @param filterId Filter id - * @return Optional of {@link UserPreference} - */ - Optional findByProjectIdAndUserIdAndFilterId(Long projectId, Long userId, Long filterId); - - /** - * Remove user preferences by project and user - * - * @param projectId Project id - * @param userId User id - */ - void removeByProjectIdAndUserId(Long projectId, Long userId); + /** + * Find user preferences by project and user + * + * @param projectId Project id + * @param userId User id + * @return List of user preferences + */ + List findByProjectIdAndUserId(Long projectId, Long userId); + + /** + * Find unique user preference + * + * @param projectId Project id + * @param userId User id + * @param filterId Filter id + * @return Optional of {@link UserPreference} + */ + Optional findByProjectIdAndUserIdAndFilterId(Long projectId, Long userId, + Long filterId); + + /** + * Remove user preferences by project and user + * + * @param projectId Project id + * @param userId User id + */ + void removeByProjectIdAndUserId(Long projectId, Long userId); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserRepository.java b/src/main/java/com/epam/ta/reportportal/dao/UserRepository.java index e313163ce..522187ca0 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserRepository.java @@ -20,70 +20,72 @@ import com.epam.ta.reportportal.entity.user.User; import com.epam.ta.reportportal.entity.user.UserRole; import com.epam.ta.reportportal.entity.user.UserType; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; - import java.time.LocalDateTime; import java.util.Collection; import java.util.List; import java.util.Optional; import java.util.Set; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; /** * @author Ivan Budayeu */ public interface UserRepository extends ReportPortalRepository, UserRepositoryCustom { - @Query(value = "SELECT id FROM users WHERE users.login = :username FOR UPDATE", nativeQuery = true) - Optional findIdByLoginForUpdate(@Param("username") String login); + @Query(value = "SELECT id FROM users WHERE users.login = :username FOR UPDATE", nativeQuery = true) + Optional findIdByLoginForUpdate(@Param("username") String login); - Optional findByEmail(String email); + Optional findByEmail(String email); - /** - * @param login user login for search - * @return {@link Optional} of {@link User} - */ - Optional findByLogin(String login); + /** + * @param login user login for search + * @return {@link Optional} of {@link User} + */ + Optional findByLogin(String login); - List findAllByEmailIn(Collection mails); + List findAllByEmailIn(Collection mails); - List findAllByLoginIn(Set loginSet); + List findAllByLoginIn(Set loginSet); - List findAllByRole(UserRole role); + List findAllByRole(UserRole role); - @Query(value = "SELECT u FROM User u WHERE u.userType = :userType AND u.isExpired = :isExpired") - Page findAllByUserTypeAndExpired(@Param("userType") UserType userType, @Param("isExpired") boolean isExpired, Pageable pageable); + @Query(value = "SELECT u FROM User u WHERE u.userType = :userType AND u.isExpired = :isExpired") + Page findAllByUserTypeAndExpired(@Param("userType") UserType userType, + @Param("isExpired") boolean isExpired, Pageable pageable); - @Modifying(clearAutomatically = true) - @Query(value = "UPDATE users SET expired = TRUE WHERE CAST(metadata-> 'metadata' ->> 'last_login' AS DOUBLE PRECISION) < (extract(EPOCH FROM CAST (:lastLogin AS TIMESTAMP)) * 1000);", nativeQuery = true) - void expireUsersLoggedOlderThan(@Param("lastLogin") LocalDateTime lastLogin); + @Modifying(clearAutomatically = true) + @Query(value = "UPDATE users SET expired = TRUE WHERE CAST(metadata-> 'metadata' ->> 'last_login' AS DOUBLE PRECISION) < (extract(EPOCH FROM CAST (:lastLogin AS TIMESTAMP)) * 1000);", nativeQuery = true) + void expireUsersLoggedOlderThan(@Param("lastLogin") LocalDateTime lastLogin); - /** - * Updates user's last login value - * - * @param lastLogin Last login date - * @param username User - */ - @Modifying(clearAutomatically = true) - @Query(value = "UPDATE users SET metadata = jsonb_set(metadata, '{metadata,last_login}', to_jsonb(extract(EPOCH FROM CAST (:lastLogin AS TIMESTAMP)) * 1000), TRUE ) WHERE login = :username", nativeQuery = true) - void updateLastLoginDate(@Param("lastLogin") LocalDateTime lastLogin, @Param("username") String username); + /** + * Updates user's last login value + * + * @param lastLogin Last login date + * @param username User + */ + @Modifying(clearAutomatically = true) + @Query(value = "UPDATE users SET metadata = jsonb_set(metadata, '{metadata,last_login}', to_jsonb(extract(EPOCH FROM CAST (:lastLogin AS TIMESTAMP)) * 1000), TRUE ) WHERE login = :username", nativeQuery = true) + void updateLastLoginDate(@Param("lastLogin") LocalDateTime lastLogin, + @Param("username") String username); - @Query(value = "SELECT u.login FROM users u JOIN project_user pu ON u.id = pu.user_id WHERE pu.project_id = :projectId", nativeQuery = true) - List findNamesByProject(@Param("projectId") Long projectId); + @Query(value = "SELECT u.login FROM users u JOIN project_user pu ON u.id = pu.user_id WHERE pu.project_id = :projectId", nativeQuery = true) + List findNamesByProject(@Param("projectId") Long projectId); - @Query(value = "SELECT u.email FROM users u JOIN project_user pu ON u.id = pu.user_id WHERE pu.project_id = :projectId", nativeQuery = true) - List findEmailsByProject(@Param("projectId") Long projectId); + @Query(value = "SELECT u.email FROM users u JOIN project_user pu ON u.id = pu.user_id WHERE pu.project_id = :projectId", nativeQuery = true) + List findEmailsByProject(@Param("projectId") Long projectId); - @Query(value = "SELECT u.email FROM users u JOIN project_user pu ON u.id = pu.user_id WHERE pu.project_id = :projectId AND pu.project_role = cast(:#{#projectRole.name()} AS PROJECT_ROLE_ENUM)", nativeQuery = true) - List findEmailsByProjectAndRole(@Param("projectId") Long projectId, @Param("projectRole") ProjectRole projectRole); + @Query(value = "SELECT u.email FROM users u JOIN project_user pu ON u.id = pu.user_id WHERE pu.project_id = :projectId AND pu.project_role = cast(:#{#projectRole.name()} AS PROJECT_ROLE_ENUM)", nativeQuery = true) + List findEmailsByProjectAndRole(@Param("projectId") Long projectId, + @Param("projectRole") ProjectRole projectRole); - @Query(value = "SELECT u.login FROM users u JOIN project_user pu ON u.id = pu.user_id WHERE pu.project_id = :projectId AND u.login LIKE %:term%", nativeQuery = true) - List findNamesByProject(@Param("projectId") Long projectId, @Param("term") String term); + @Query(value = "SELECT u.login FROM users u JOIN project_user pu ON u.id = pu.user_id WHERE pu.project_id = :projectId AND u.login LIKE %:term%", nativeQuery = true) + List findNamesByProject(@Param("projectId") Long projectId, @Param("term") String term); - @Query(value = "SELECT users.login FROM users WHERE users.id = :id", nativeQuery = true) - Optional findLoginById(@Param("id") Long id); + @Query(value = "SELECT users.login FROM users WHERE users.id = :id", nativeQuery = true) + Optional findLoginById(@Param("id") Long id); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustom.java index ce11aab33..6927f04c6 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustom.java @@ -20,40 +20,39 @@ import com.epam.ta.reportportal.commons.querygen.Queryable; import com.epam.ta.reportportal.entity.project.ProjectRole; import com.epam.ta.reportportal.entity.user.User; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; - import java.util.Map; import java.util.Optional; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; /** * @author Pavel Bortnik */ public interface UserRepositoryCustom extends FilterableRepository { - Page findByFilterExcludingProjects(Queryable filter, Pageable pageable); + Page findByFilterExcludingProjects(Queryable filter, Pageable pageable); - Optional findRawById(Long id); + Optional findRawById(Long id); - /** - * Finds entities list according provided filter - * - * @param filter Filter - Query representation - * @param pageable Page Representation - * @param exclude Fields to exclude from query - * @return Found Paged objects - */ - Page findByFilterExcluding(Queryable filter, Pageable pageable, String... exclude); + /** + * Finds entities list according provided filter + * + * @param filter Filter - Query representation + * @param pageable Page Representation + * @param exclude Fields to exclude from query + * @return Found Paged objects + */ + Page findByFilterExcluding(Queryable filter, Pageable pageable, String... exclude); - Map findUsernamesWithProjectRolesByProjectId(Long projectId); + Map findUsernamesWithProjectRolesByProjectId(Long projectId); - /** - * Finds details about user and his project by login. - * - * @param login Login to find - * @return User details - */ - Optional findUserDetails(String login); + /** + * Finds details about user and his project by login. + * + * @param login Login to find + * @return User details + */ + Optional findUserDetails(String login); - Optional findReportPortalUser(String login); + Optional findReportPortalUser(String login); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustomImpl.java index 5da1784b1..513fec003 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustomImpl.java @@ -16,6 +16,15 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.dao.util.RecordMappers.REPORT_PORTAL_USER_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.USER_MAPPER; +import static com.epam.ta.reportportal.dao.util.ResultFetchers.REPORTPORTAL_USER_FETCHER; +import static com.epam.ta.reportportal.dao.util.ResultFetchers.USER_FETCHER; +import static com.epam.ta.reportportal.dao.util.ResultFetchers.USER_WITHOUT_PROJECT_FETCHER; +import static com.epam.ta.reportportal.jooq.tables.JProject.PROJECT; +import static com.epam.ta.reportportal.jooq.tables.JProjectUser.PROJECT_USER; +import static com.epam.ta.reportportal.jooq.tables.JUsers.USERS; + import com.epam.ta.reportportal.commons.ReportPortalUser; import com.epam.ta.reportportal.commons.querygen.QueryBuilder; import com.epam.ta.reportportal.commons.querygen.Queryable; @@ -23,6 +32,10 @@ import com.epam.ta.reportportal.entity.user.User; import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.ws.model.ErrorType; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; import org.jooq.DSLContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -30,111 +43,103 @@ import org.springframework.data.repository.support.PageableExecutionUtils; import org.springframework.stereotype.Repository; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.stream.Collectors; - -import static com.epam.ta.reportportal.dao.util.RecordMappers.REPORT_PORTAL_USER_MAPPER; -import static com.epam.ta.reportportal.dao.util.RecordMappers.USER_MAPPER; -import static com.epam.ta.reportportal.dao.util.ResultFetchers.*; -import static com.epam.ta.reportportal.jooq.tables.JProject.PROJECT; -import static com.epam.ta.reportportal.jooq.tables.JProjectUser.PROJECT_USER; -import static com.epam.ta.reportportal.jooq.tables.JUsers.USERS; - /** * @author Pavel Bortnik */ @Repository public class UserRepositoryCustomImpl implements UserRepositoryCustom { - private final DSLContext dsl; - - @Autowired - public UserRepositoryCustomImpl(DSLContext dsl) { - this.dsl = dsl; - } - - @Override - public List findByFilter(Queryable filter) { - return USER_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter).wrap().build())); - } - - @Override - public Page findByFilter(Queryable filter, Pageable pageable) { - return PageableExecutionUtils.getPage(USER_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter) - .with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) - .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build())); - } - - @Override - public Page findByFilterExcludingProjects(Queryable filter, Pageable pageable) { - return PageableExecutionUtils.getPage(USER_WITHOUT_PROJECT_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter) - .with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) - .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build())); - } - - @Override - public Optional findRawById(Long id) { - return dsl.select().from(USERS).where(USERS.ID.eq(id)).fetchOptional(USER_MAPPER); - } - - @Override - public Page findByFilterExcluding(Queryable filter, Pageable pageable, String... exclude) { - return PageableExecutionUtils.getPage(USER_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter) - .with(pageable) - .wrapExcludingFields(exclude) - .withWrapperSort(pageable.getSort()) - .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build())); - } - - @Override - public Map findUsernamesWithProjectRolesByProjectId(Long projectId) { - return dsl.select(USERS.LOGIN, PROJECT_USER.PROJECT_ROLE) - .from(USERS) - .join(PROJECT_USER) - .on(USERS.ID.eq(PROJECT_USER.USER_ID)) - .where(PROJECT_USER.PROJECT_ID.eq(projectId)) - .fetch() - .stream() - .collect(Collectors.toMap(r -> r.get(USERS.LOGIN), r -> { - String projectRoleName = r.get(PROJECT_USER.PROJECT_ROLE).getLiteral(); - return ProjectRole.forName(projectRoleName) - .orElseThrow(() -> new ReportPortalException(ErrorType.ROLE_NOT_FOUND, projectRoleName)); - })); - } - - @Override - public Optional findUserDetails(String login) { - return Optional.ofNullable(REPORTPORTAL_USER_FETCHER.apply(dsl.select( - USERS.ID, - USERS.LOGIN, - USERS.PASSWORD, - USERS.ROLE, - USERS.EMAIL, - PROJECT_USER.PROJECT_ID, - PROJECT_USER.PROJECT_ROLE, - PROJECT.NAME - ) - .from(USERS) - .leftJoin(PROJECT_USER) - .on(USERS.ID.eq(PROJECT_USER.USER_ID)) - .leftJoin(PROJECT) - .on(PROJECT_USER.PROJECT_ID.eq(PROJECT.ID)) - .where(USERS.LOGIN.eq(login)) - .fetch())); - } - - @Override - public Optional findReportPortalUser(String login) { - return dsl.select(USERS.ID, USERS.LOGIN, USERS.PASSWORD, USERS.ROLE, USERS.EMAIL) - .from(USERS) - .where(USERS.LOGIN.eq(login)) - .fetchOptional(REPORT_PORTAL_USER_MAPPER); - } + private final DSLContext dsl; + + @Autowired + public UserRepositoryCustomImpl(DSLContext dsl) { + this.dsl = dsl; + } + + @Override + public List findByFilter(Queryable filter) { + return USER_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter).wrap().build())); + } + + @Override + public Page findByFilter(Queryable filter, Pageable pageable) { + return PageableExecutionUtils.getPage( + USER_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter) + .with(pageable) + .wrap() + .withWrapperSort(pageable.getSort()) + .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build())); + } + + @Override + public Page findByFilterExcludingProjects(Queryable filter, Pageable pageable) { + return PageableExecutionUtils.getPage( + USER_WITHOUT_PROJECT_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter) + .with(pageable) + .wrap() + .withWrapperSort(pageable.getSort()) + .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build())); + } + + @Override + public Optional findRawById(Long id) { + return dsl.select().from(USERS).where(USERS.ID.eq(id)).fetchOptional(USER_MAPPER); + } + + @Override + public Page findByFilterExcluding(Queryable filter, Pageable pageable, String... exclude) { + return PageableExecutionUtils.getPage( + USER_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter) + .with(pageable) + .wrapExcludingFields(exclude) + .withWrapperSort(pageable.getSort()) + .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build())); + } + + @Override + public Map findUsernamesWithProjectRolesByProjectId(Long projectId) { + return dsl.select(USERS.LOGIN, PROJECT_USER.PROJECT_ROLE) + .from(USERS) + .join(PROJECT_USER) + .on(USERS.ID.eq(PROJECT_USER.USER_ID)) + .where(PROJECT_USER.PROJECT_ID.eq(projectId)) + .fetch() + .stream() + .collect(Collectors.toMap(r -> r.get(USERS.LOGIN), r -> { + String projectRoleName = r.get(PROJECT_USER.PROJECT_ROLE).getLiteral(); + return ProjectRole.forName(projectRoleName) + .orElseThrow( + () -> new ReportPortalException(ErrorType.ROLE_NOT_FOUND, projectRoleName)); + })); + } + + @Override + public Optional findUserDetails(String login) { + return Optional.ofNullable(REPORTPORTAL_USER_FETCHER.apply(dsl.select( + USERS.ID, + USERS.LOGIN, + USERS.PASSWORD, + USERS.ROLE, + USERS.EMAIL, + PROJECT_USER.PROJECT_ID, + PROJECT_USER.PROJECT_ROLE, + PROJECT.NAME + ) + .from(USERS) + .leftJoin(PROJECT_USER) + .on(USERS.ID.eq(PROJECT_USER.USER_ID)) + .leftJoin(PROJECT) + .on(PROJECT_USER.PROJECT_ID.eq(PROJECT.ID)) + .where(USERS.LOGIN.eq(login)) + .fetch())); + } + + @Override + public Optional findReportPortalUser(String login) { + return dsl.select(USERS.ID, USERS.LOGIN, USERS.PASSWORD, USERS.ROLE, USERS.EMAIL) + .from(USERS) + .where(USERS.LOGIN.eq(login)) + .fetchOptional(REPORT_PORTAL_USER_MAPPER); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepository.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepository.java index 0f040703e..58294d827 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepository.java @@ -20,284 +20,324 @@ import com.epam.ta.reportportal.entity.ItemAttribute; import com.epam.ta.reportportal.entity.launch.Launch; import com.epam.ta.reportportal.entity.pattern.PatternTemplate; -import com.epam.ta.reportportal.entity.widget.content.*; +import com.epam.ta.reportportal.entity.widget.content.ChartStatisticsContent; +import com.epam.ta.reportportal.entity.widget.content.CriteriaHistoryItem; +import com.epam.ta.reportportal.entity.widget.content.CumulativeTrendChartEntry; +import com.epam.ta.reportportal.entity.widget.content.FlakyCasesTableContent; +import com.epam.ta.reportportal.entity.widget.content.LaunchesDurationContent; +import com.epam.ta.reportportal.entity.widget.content.LaunchesTableContent; +import com.epam.ta.reportportal.entity.widget.content.MostTimeConsumingTestCasesContent; +import com.epam.ta.reportportal.entity.widget.content.NotPassedCasesContent; +import com.epam.ta.reportportal.entity.widget.content.OverallStatisticsContent; +import com.epam.ta.reportportal.entity.widget.content.PassingRateStatisticsResult; +import com.epam.ta.reportportal.entity.widget.content.ProductStatusStatisticsContent; +import com.epam.ta.reportportal.entity.widget.content.TopPatternTemplatesContent; +import com.epam.ta.reportportal.entity.widget.content.UniqueBugContent; import com.epam.ta.reportportal.entity.widget.content.healthcheck.ComponentHealthCheckContent; import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableContent; import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableGetParams; import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableInitParams; import com.epam.ta.reportportal.ws.model.ActivityResource; -import org.springframework.data.domain.Sort; - -import javax.annotation.Nullable; import java.util.List; import java.util.Map; +import javax.annotation.Nullable; +import org.springframework.data.domain.Sort; /** * @author Pavel Bortnik */ public interface WidgetContentRepository { - /** - * Overall statistics content loading. - * - * @param filter {@link Filter} - * @param sort {@link Sort} - * @param contentFields Content fields to load - * @param latest Load only for latest launches - * @param limit Limit of loaded launches - * @return {@link OverallStatisticsContent} - */ - OverallStatisticsContent overallStatisticsContent(Filter filter, Sort sort, List contentFields, boolean latest, int limit); + /** + * Overall statistics content loading. + * + * @param filter {@link Filter} + * @param sort {@link Sort} + * @param contentFields Content fields to load + * @param latest Load only for latest launches + * @param limit Limit of loaded launches + * @return {@link OverallStatisticsContent} + */ + OverallStatisticsContent overallStatisticsContent(Filter filter, Sort sort, + List contentFields, boolean latest, int limit); - /** - * Loads top limit history of items sorted in descending order by provided criteria - * for specified launch. Criteria could be one of statistics fields. - * For example if criteria is 'statistics$execution$failed' and launchName is 'DefaultLaunch' - * that is specified in the filter and limit is 20 the result will be top 20 grouped steps - * by uniqueId of the whole launch history with 'DefaultLaunch' name - * sorted by count of steps with existed statistics of 'statistics$execution$failed' - * - * @param filter Launches filter - * @param criteria Criteria for example 'statistics$execution$failed' - * @param limit Limit of items - * @param includeMethods Include or not test item types that have 'METHOD' or 'CLASS' - * @return List of items, one represents history of concrete step - */ - List topItemsByCriteria(Filter filter, String criteria, int limit, boolean includeMethods); + /** + * Loads top limit history of items sorted in descending order by provided criteria for specified + * launch. Criteria could be one of statistics fields. For example if criteria is + * 'statistics$execution$failed' and launchName is 'DefaultLaunch' that is specified in the filter + * and limit is 20 the result will be top 20 grouped steps by uniqueId of the whole launch history + * with 'DefaultLaunch' name sorted by count of steps with existed statistics of + * 'statistics$execution$failed' + * + * @param filter Launches filter + * @param criteria Criteria for example 'statistics$execution$failed' + * @param limit Limit of items + * @param includeMethods Include or not test item types that have 'METHOD' or 'CLASS' + * @return List of items, one represents history of concrete step + */ + List topItemsByCriteria(Filter filter, String criteria, int limit, + boolean includeMethods); - /** - * Launch statistics content loading - * - * @param filter {@link Filter} - * @param contentFields Custom fields for select query building - * @param sort {@link Sort} - * @param limit Results limit - * @return List of {@link ChartStatisticsContent} - */ - List launchStatistics(Filter filter, List contentFields, Sort sort, int limit); + /** + * Launch statistics content loading + * + * @param filter {@link Filter} + * @param contentFields Custom fields for select query building + * @param sort {@link Sort} + * @param limit Results limit + * @return List of {@link ChartStatisticsContent} + */ + List launchStatistics(Filter filter, List contentFields, + Sort sort, int limit); - /** - * Investigated statistics loading - * - * @param filter {@link Filter} - * @param sort {@link Sort} - * @param limit Results limit - * @return List of{@link ChartStatisticsContent} - */ - List investigatedStatistics(Filter filter, Sort sort, int limit); + /** + * Investigated statistics loading + * + * @param filter {@link Filter} + * @param sort {@link Sort} + * @param limit Results limit + * @return List of{@link ChartStatisticsContent} + */ + List investigatedStatistics(Filter filter, Sort sort, int limit); - /** - * Investigated statistics loading for timeline view - * - * @param filter {@link Filter} - * @param sort {@link Sort} - * @param limit Results limit - * @return List of{@link ChartStatisticsContent} - */ - List timelineInvestigatedStatistics(Filter filter, Sort sort, int limit); + /** + * Investigated statistics loading for timeline view + * + * @param filter {@link Filter} + * @param sort {@link Sort} + * @param limit Results limit + * @return List of{@link ChartStatisticsContent} + */ + List timelineInvestigatedStatistics(Filter filter, Sort sort, int limit); - /** - * Launch passing rate result for depending on the filter conditions - * - * @param launchId {@link Launch#getId()} - * @return {@link PassingRateStatisticsResult} - */ - PassingRateStatisticsResult passingRatePerLaunchStatistics(Long launchId); + /** + * Launch passing rate result for depending on the filter conditions + * + * @param launchId {@link Launch#getId()} + * @return {@link PassingRateStatisticsResult} + */ + PassingRateStatisticsResult passingRatePerLaunchStatistics(Long launchId); - /** - * Summary passing rate result for launches depending on the filter conditions - * - * @param filter {@link Filter} - * @param sort {@link Sort} - * @param limit Results limit - * @return {@link PassingRateStatisticsResult} - */ - PassingRateStatisticsResult summaryPassingRateStatistics(Filter filter, Sort sort, int limit); + /** + * Summary passing rate result for launches depending on the filter conditions + * + * @param filter {@link Filter} + * @param sort {@link Sort} + * @param limit Results limit + * @return {@link PassingRateStatisticsResult} + */ + PassingRateStatisticsResult summaryPassingRateStatistics(Filter filter, Sort sort, int limit); - /** - * Test cases' count trend loading - * - * @param filter {@link Filter} - * @param executionContentField Content field with table column name - * @param sort {@link Sort} - * @param limit Results limit - * @return List of{@link ChartStatisticsContent} - */ - List casesTrendStatistics(Filter filter, String executionContentField, Sort sort, int limit); + /** + * Test cases' count trend loading + * + * @param filter {@link Filter} + * @param executionContentField Content field with table column name + * @param sort {@link Sort} + * @param limit Results limit + * @return List of{@link ChartStatisticsContent} + */ + List casesTrendStatistics(Filter filter, String executionContentField, + Sort sort, int limit); - /** - * Bug trend loading - * - * @param filter {@link Filter} - * @param contentFields Custom fields for select query building - * @param sort {@link Sort} - * @param limit Results limit - * @return List of{@link ChartStatisticsContent} - */ - List bugTrendStatistics(Filter filter, List contentFields, Sort sort, int limit); + /** + * Bug trend loading + * + * @param filter {@link Filter} + * @param contentFields Custom fields for select query building + * @param sort {@link Sort} + * @param limit Results limit + * @return List of{@link ChartStatisticsContent} + */ + List bugTrendStatistics(Filter filter, List contentFields, + Sort sort, int limit); - /** - * Comparison statistics content loading for launches with specified Ids - * - * @param filter {@link Filter} - * @param contentFields Custom fields for select query building - * @param sort {@link Sort} - * @param limit Results limit - * @return List of{@link ChartStatisticsContent} - */ - List launchesComparisonStatistics(Filter filter, List contentFields, Sort sort, int limit); + /** + * Comparison statistics content loading for launches with specified Ids + * + * @param filter {@link Filter} + * @param contentFields Custom fields for select query building + * @param sort {@link Sort} + * @param limit Results limit + * @return List of{@link ChartStatisticsContent} + */ + List launchesComparisonStatistics(Filter filter, + List contentFields, Sort sort, int limit); - /** - * Launches duration content loading - * - * @param filter {@link Filter} - * @param sort {@link Sort} - * @param isLatest Flag for retrieving only latest launches - * @param limit Results limit - * @return List of{@link LaunchesDurationContent} - */ - List launchesDurationStatistics(Filter filter, Sort sort, boolean isLatest, int limit); + /** + * Launches duration content loading + * + * @param filter {@link Filter} + * @param sort {@link Sort} + * @param isLatest Flag for retrieving only latest launches + * @param limit Results limit + * @return List of{@link LaunchesDurationContent} + */ + List launchesDurationStatistics(Filter filter, Sort sort, + boolean isLatest, int limit); - /** - * Not passed cases content loading - * - * @param filter {@link Filter} - * @param sort {@link Sort} - * @param limit Results limit - * @return List of{@link NotPassedCasesContent} - */ - List notPassedCasesStatistics(Filter filter, Sort sort, int limit); + /** + * Not passed cases content loading + * + * @param filter {@link Filter} + * @param sort {@link Sort} + * @param limit Results limit + * @return List of{@link NotPassedCasesContent} + */ + List notPassedCasesStatistics(Filter filter, Sort sort, int limit); - /** - * Launches table content loading - * - * @param filter {@link Filter} - * @param contentFields Custom fields for select query building - * @param sort {@link Sort} - * @param limit Results limit - * @return List of{@link LaunchesTableContent} - */ - List launchesTableStatistics(Filter filter, List contentFields, Sort sort, int limit); + /** + * Launches table content loading + * + * @param filter {@link Filter} + * @param contentFields Custom fields for select query building + * @param sort {@link Sort} + * @param limit Results limit + * @return List of{@link LaunchesTableContent} + */ + List launchesTableStatistics(Filter filter, List contentFields, + Sort sort, int limit); - /** - * User activity content loading - * - * @param filter {@link Filter} - * @param sort {@link Sort} - * @param limit Results limit - * @return List of{@link ActivityResource} - */ - List activityStatistics(Filter filter, Sort sort, int limit); + /** + * User activity content loading + * + * @param filter {@link Filter} + * @param sort {@link Sort} + * @param limit Results limit + * @return List of{@link ActivityResource} + */ + List activityStatistics(Filter filter, Sort sort, int limit); - /** - * Loading unique bugs content that was produced by Bug Tracking System - * - * @param filter {@link Filter} - * @param sort {@link Sort} - * @param isLatest Flag for retrieving only latest launches - * @param limit Results limit - * @return Map grouped by ticket id as key and List of {@link UniqueBugContent} as value - */ - Map uniqueBugStatistics(Filter filter, Sort sort, boolean isLatest, int limit); + /** + * Loading unique bugs content that was produced by Bug Tracking System + * + * @param filter {@link Filter} + * @param sort {@link Sort} + * @param isLatest Flag for retrieving only latest launches + * @param limit Results limit + * @return Map grouped by ticket id as key and List of {@link UniqueBugContent} as value + */ + Map uniqueBugStatistics(Filter filter, Sort sort, boolean isLatest, + int limit); - /** - * Loading the most "flaky" test cases content - * - * @param filter {@link Filter} - * @param includeMethods Include or not test item types that have 'METHOD' or 'CLASS' - * @param limit Results limit - * @return List of {@link FlakyCasesTableContent} - */ - List flakyCasesStatistics(Filter filter, boolean includeMethods, int limit); + /** + * Loading the most "flaky" test cases content + * + * @param filter {@link Filter} + * @param includeMethods Include or not test item types that have 'METHOD' or 'CLASS' + * @param limit Results limit + * @return List of {@link FlakyCasesTableContent} + */ + List flakyCasesStatistics(Filter filter, boolean includeMethods, + int limit); - /** - * Loading the product status statistics grouped by one or more {@link Filter} - * - * @param filterSortMapping Map of {@link Filter} as key and {@link Sort} as value to implement multiple filters logic with own sorting - * @param contentFields Custom fields for select query building - * @param customColumns Map of the custom column name as key and {@link ItemAttribute#getKey()} as value - * @param isLatest Flag for retrieving only latest launches - * @param limit Results limit - * @return Map grouped by filter name with {@link com.epam.ta.reportportal.entity.filter.UserFilter#getName()} as key and list of {@link ProductStatusStatisticsContent} as value - */ - Map> productStatusGroupedByFilterStatistics(Map filterSortMapping, - List contentFields, Map customColumns, boolean isLatest, int limit); + /** + * Loading the product status statistics grouped by one or more {@link Filter} + * + * @param filterSortMapping Map of {@link Filter} as key and {@link Sort} as value to implement + * multiple filters logic with own sorting + * @param contentFields Custom fields for select query building + * @param customColumns Map of the custom column name as key and + * {@link ItemAttribute#getKey()} as value + * @param isLatest Flag for retrieving only latest launches + * @param limit Results limit + * @return Map grouped by filter name with + * {@link com.epam.ta.reportportal.entity.filter.UserFilter#getName()} as key and list of + * {@link ProductStatusStatisticsContent} as value + */ + Map> productStatusGroupedByFilterStatistics( + Map filterSortMapping, + List contentFields, Map customColumns, boolean isLatest, int limit); - /** - * Loading the product status statistics grouped by {@link com.epam.ta.reportportal.entity.launch.Launch} with combined {@link Filter} - * - * @param filter {@link Filter} - * @param contentFields Custom fields for select query building - * @param customColumns Map of the custom column name as key and {@link ItemAttribute#getKey()} as value - * @param sort {@link Sort} - * @param isLatest Flag for retrieving only latest launches - * @param limit Results limit - * @return list of {@link ProductStatusStatisticsContent} - */ - List productStatusGroupedByLaunchesStatistics(Filter filter, List contentFields, - Map customColumns, Sort sort, boolean isLatest, int limit); + /** + * Loading the product status statistics grouped by + * {@link com.epam.ta.reportportal.entity.launch.Launch} with combined {@link Filter} + * + * @param filter {@link Filter} + * @param contentFields Custom fields for select query building + * @param customColumns Map of the custom column name as key and {@link ItemAttribute#getKey()} as + * value + * @param sort {@link Sort} + * @param isLatest Flag for retrieving only latest launches + * @param limit Results limit + * @return list of {@link ProductStatusStatisticsContent} + */ + List productStatusGroupedByLaunchesStatistics(Filter filter, + List contentFields, + Map customColumns, Sort sort, boolean isLatest, int limit); - /** - * Loading the most time consuming test cases - * - * @param filter {@link Filter} - * @param limit Results limit - * @return list of {@link MostTimeConsumingTestCasesContent} - */ - List mostTimeConsumingTestCasesStatistics(Filter filter, int limit); + /** + * Loading the most time consuming test cases + * + * @param filter {@link Filter} + * @param limit Results limit + * @return list of {@link MostTimeConsumingTestCasesContent} + */ + List mostTimeConsumingTestCasesStatistics(Filter filter, + int limit); - /** - * Load TOP-20 most matched {@link com.epam.ta.reportportal.entity.pattern.PatternTemplate} entities with matched items count, - * grouped by {@link ItemAttribute#getValue()} and {@link PatternTemplate#getName()} - * - * @param filter {@link Filter} - * @param sort {@link Sort} - * @param attributeKey {@link ItemAttribute#getKey()} - * @param patternName {@link PatternTemplate#getName()} - * @param isLatest Flag for retrieving only latest launches - * @param launchesLimit Launches count limit - * @param attributesLimit Attributes count limit - * @return The {@link List} of the {@link TopPatternTemplatesContent} - */ - List patternTemplate(Filter filter, Sort sort, @Nullable String attributeKey, @Nullable String patternName, - boolean isLatest, int launchesLimit, int attributesLimit); + /** + * Load TOP-20 most matched {@link com.epam.ta.reportportal.entity.pattern.PatternTemplate} + * entities with matched items count, grouped by {@link ItemAttribute#getValue()} and + * {@link PatternTemplate#getName()} + * + * @param filter {@link Filter} + * @param sort {@link Sort} + * @param attributeKey {@link ItemAttribute#getKey()} + * @param patternName {@link PatternTemplate#getName()} + * @param isLatest Flag for retrieving only latest launches + * @param launchesLimit Launches count limit + * @param attributesLimit Attributes count limit + * @return The {@link List} of the {@link TopPatternTemplatesContent} + */ + List patternTemplate(Filter filter, Sort sort, + @Nullable String attributeKey, @Nullable String patternName, + boolean isLatest, int launchesLimit, int attributesLimit); - /** - * Load component health check data containing items count and passing rate. Multi-level widget - * with {@link ItemAttribute#getKey()} on each level. Previous levels are built based on - * {@link ItemAttribute#getKey()}-{@link ItemAttribute#getValue()} pairs - * - * @param launchFilter {@link Filter} with {@link com.epam.ta.reportportal.commons.querygen.FilterTarget#LAUNCH_TARGET} - * @param launchSort {@link Sort} for launches query - * @param isLatest Flag for retrieving only latest launches - * @param launchesLimit launches limit - * @param testItemFilter {@link Filter} with {@link com.epam.ta.reportportal.commons.querygen.FilterTarget#TEST_ITEM_TARGET} - * @param currentLevelKey {@link ItemAttribute#getKey()} for query level select - * @return {@link List} of {@link ComponentHealthCheckContent} - */ - List componentHealthCheck(Filter launchFilter, Sort launchSort, boolean isLatest, int launchesLimit, - Filter testItemFilter, String currentLevelKey); + /** + * Load component health check data containing items count and passing rate. Multi-level widget + * with {@link ItemAttribute#getKey()} on each level. Previous levels are built based on + * {@link ItemAttribute#getKey()}-{@link ItemAttribute#getValue()} pairs + * + * @param launchFilter {@link Filter} with + * {@link + * com.epam.ta.reportportal.commons.querygen.FilterTarget#LAUNCH_TARGET} + * @param launchSort {@link Sort} for launches query + * @param isLatest Flag for retrieving only latest launches + * @param launchesLimit launches limit + * @param testItemFilter {@link Filter} with + * {@link + * com.epam.ta.reportportal.commons.querygen.FilterTarget#TEST_ITEM_TARGET} + * @param currentLevelKey {@link ItemAttribute#getKey()} for query level select + * @return {@link List} of {@link ComponentHealthCheckContent} + */ + List componentHealthCheck(Filter launchFilter, Sort launchSort, + boolean isLatest, int launchesLimit, + Filter testItemFilter, String currentLevelKey); - /** - * Generate a materialized view for cumulative trend chart widget. - * - * @param refresh Refreshed state - * @param viewName View name - * @param launchFilter Launches filter - * @param launchesLimit Launches limit for widget - */ - void generateCumulativeTrendChartView(boolean refresh, String viewName, Filter launchFilter, Sort launchesSort, List attributes, - int launchesLimit); + /** + * Generate a materialized view for cumulative trend chart widget. + * + * @param refresh Refreshed state + * @param viewName View name + * @param launchFilter Launches filter + * @param launchesLimit Launches limit for widget + */ + void generateCumulativeTrendChartView(boolean refresh, String viewName, Filter launchFilter, + Sort launchesSort, List attributes, + int launchesLimit); - List cumulativeTrendChart(String viewName, String levelAttributeKey, String subAttributeKey, - String parentAttribute); + List cumulativeTrendChart(String viewName, String levelAttributeKey, + String subAttributeKey, + String parentAttribute); - List getCumulativeLevelRedirectLaunchIds(String viewName, String attributes); + List getCumulativeLevelRedirectLaunchIds(String viewName, String attributes); - void generateComponentHealthCheckTable(boolean refresh, HealthCheckTableInitParams params, Filter launchFilter, Sort launchSort, - int launchesLimit, boolean isLatest); + void generateComponentHealthCheckTable(boolean refresh, HealthCheckTableInitParams params, + Filter launchFilter, Sort launchSort, + int launchesLimit, boolean isLatest); - void removeWidgetView(String viewName); + void removeWidgetView(String viewName); - List componentHealthCheckTable(HealthCheckTableGetParams params); + List componentHealthCheckTable(HealthCheckTableGetParams params); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java index 30a576896..74679355a 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java @@ -16,6 +16,137 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.commons.querygen.Condition.VALUES_SEPARATOR; +import static com.epam.ta.reportportal.commons.querygen.QueryBuilder.STATISTICS_KEY; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_START_TIME; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.KEY_VALUE_SEPARATOR; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_DURATION; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ACTIVITIES; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.AGGREGATED_LAUNCHES_IDS; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ATTRIBUTE_KEY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ATTRIBUTE_VALUE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ATTR_ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ATTR_TABLE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.CRITERIA; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.CRITERIA_FLAG; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.CRITERIA_TABLE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.CUSTOM_ATTRIBUTE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.CUSTOM_COLUMN; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.DEFECTS_AUTOMATION_BUG_TOTAL; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.DEFECTS_KEY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.DEFECTS_NO_DEFECT_TOTAL; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.DEFECTS_PRODUCT_BUG_TOTAL; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.DEFECTS_SYSTEM_ISSUE_TOTAL; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.DEFECTS_TO_INVESTIGATE_TOTAL; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.DELTA; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.DURATION; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.EXECUTIONS_FAILED; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.EXECUTIONS_KEY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.EXECUTIONS_PASSED; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.EXECUTIONS_SKIPPED; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.EXECUTIONS_TOTAL; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.FILTER_NAME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.FIRST_LEVEL_ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.FLAKY_CASES_LIMIT; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.FLAKY_COUNT; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.FLAKY_TABLE_RESULTS; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.INVESTIGATED; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ITEMS; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ITEM_ATTRIBUTES; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ITEM_ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ITEM_NAME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.KEY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.LAUNCHES; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.LAUNCH_ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.MOST_FAILED_CRITERIA_LIMIT; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.NAME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.NUMBER; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.PASSED; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.PASSING_RATE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.PATTERNS_COUNT; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.PERCENTAGE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.PERCENTAGE_MULTIPLIER; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.SF_NAME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.SKIPPED; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.START_TIME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.START_TIME_HISTORY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATISTICS_COUNTER; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATISTICS_SEPARATOR; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATISTICS_TABLE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATUS; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATUSES; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATUS_HISTORY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.SUM; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.SWITCH_FLAG; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.TOTAL; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.TO_INVESTIGATE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.UNIQUE_ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.VALUE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.VERSION_DELIMITER; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.VERSION_PATTERN; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ZERO_QUERY_VALUE; +import static com.epam.ta.reportportal.dao.constant.WidgetRepositoryConstants.ID; +import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; +import static com.epam.ta.reportportal.dao.util.QueryUtils.collectJoinFields; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.ACTIVITY_MAPPER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.BUG_TREND_STATISTICS_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.CASES_GROWTH_TREND_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.COMPONENT_HEALTH_CHECK_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.CRITERIA_HISTORY_ITEM_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.CUMULATIVE_TOOLTIP_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.CUMULATIVE_TREND_CHART_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.FLAKY_CASES_TABLE_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.INVESTIGATED_STATISTICS_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.LAUNCHES_STATISTICS_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.LAUNCHES_TABLE_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.NOT_PASSED_CASES_CONTENT_RECORD_MAPPER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.OVERALL_STATISTICS_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.PATTERN_TEMPLATES_AGGREGATION_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.PRODUCT_STATUS_FILTER_GROUPED_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.PRODUCT_STATUS_LAUNCH_GROUPED_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.TIMELINE_INVESTIGATED_STATISTICS_RECORD_MAPPER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.TOP_PATTERN_TEMPLATES_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.TOP_PATTERN_TEMPLATES_GROUPED_FETCHER; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.UNIQUE_BUG_CONTENT_FETCHER; +import static com.epam.ta.reportportal.jooq.Tables.FILTER; +import static com.epam.ta.reportportal.jooq.Tables.ITEM_ATTRIBUTE; +import static com.epam.ta.reportportal.jooq.Tables.PATTERN_TEMPLATE; +import static com.epam.ta.reportportal.jooq.Tables.PATTERN_TEMPLATE_TEST_ITEM; +import static com.epam.ta.reportportal.jooq.Tables.STATISTICS; +import static com.epam.ta.reportportal.jooq.Tables.STATISTICS_FIELD; +import static com.epam.ta.reportportal.jooq.tables.JActivity.ACTIVITY; +import static com.epam.ta.reportportal.jooq.tables.JIssue.ISSUE; +import static com.epam.ta.reportportal.jooq.tables.JIssueTicket.ISSUE_TICKET; +import static com.epam.ta.reportportal.jooq.tables.JLaunch.LAUNCH; +import static com.epam.ta.reportportal.jooq.tables.JProject.PROJECT; +import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; +import static com.epam.ta.reportportal.jooq.tables.JTestItemResults.TEST_ITEM_RESULTS; +import static com.epam.ta.reportportal.jooq.tables.JTicket.TICKET; +import static com.epam.ta.reportportal.jooq.tables.JUsers.USERS; +import static java.util.Optional.ofNullable; +import static java.util.stream.Collectors.averagingDouble; +import static java.util.stream.Collectors.summingInt; +import static java.util.stream.Collectors.toList; +import static org.jooq.impl.DSL.and; +import static org.jooq.impl.DSL.arrayAggDistinct; +import static org.jooq.impl.DSL.coalesce; +import static org.jooq.impl.DSL.concat; +import static org.jooq.impl.DSL.count; +import static org.jooq.impl.DSL.field; +import static org.jooq.impl.DSL.lag; +import static org.jooq.impl.DSL.lateral; +import static org.jooq.impl.DSL.max; +import static org.jooq.impl.DSL.name; +import static org.jooq.impl.DSL.nullif; +import static org.jooq.impl.DSL.orderBy; +import static org.jooq.impl.DSL.round; +import static org.jooq.impl.DSL.select; +import static org.jooq.impl.DSL.selectDistinct; +import static org.jooq.impl.DSL.sum; +import static org.jooq.impl.DSL.timestampDiff; +import static org.jooq.impl.DSL.val; +import static org.jooq.impl.DSL.when; + import com.epam.ta.reportportal.commons.querygen.CriteriaHolder; import com.epam.ta.reportportal.commons.querygen.Filter; import com.epam.ta.reportportal.commons.querygen.QueryBuilder; @@ -23,7 +154,19 @@ import com.epam.ta.reportportal.dao.util.QueryUtils; import com.epam.ta.reportportal.dao.widget.WidgetProviderChain; import com.epam.ta.reportportal.entity.enums.StatusEnum; -import com.epam.ta.reportportal.entity.widget.content.*; +import com.epam.ta.reportportal.entity.widget.content.ChartStatisticsContent; +import com.epam.ta.reportportal.entity.widget.content.CriteriaHistoryItem; +import com.epam.ta.reportportal.entity.widget.content.CumulativeTrendChartEntry; +import com.epam.ta.reportportal.entity.widget.content.FlakyCasesTableContent; +import com.epam.ta.reportportal.entity.widget.content.LaunchesDurationContent; +import com.epam.ta.reportportal.entity.widget.content.LaunchesTableContent; +import com.epam.ta.reportportal.entity.widget.content.MostTimeConsumingTestCasesContent; +import com.epam.ta.reportportal.entity.widget.content.NotPassedCasesContent; +import com.epam.ta.reportportal.entity.widget.content.OverallStatisticsContent; +import com.epam.ta.reportportal.entity.widget.content.PassingRateStatisticsResult; +import com.epam.ta.reportportal.entity.widget.content.ProductStatusStatisticsContent; +import com.epam.ta.reportportal.entity.widget.content.TopPatternTemplatesContent; +import com.epam.ta.reportportal.entity.widget.content.UniqueBugContent; import com.epam.ta.reportportal.entity.widget.content.healthcheck.ComponentHealthCheckContent; import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableContent; import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableGetParams; @@ -36,44 +179,44 @@ import com.epam.ta.reportportal.ws.model.ActivityResource; import com.epam.ta.reportportal.ws.model.ErrorType; import com.google.common.collect.Lists; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; +import javax.annotation.Nullable; import org.apache.commons.lang3.StringUtils; -import org.jooq.*; +import org.jooq.Condition; +import org.jooq.DSLContext; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Operator; +import org.jooq.Record; +import org.jooq.Record1; +import org.jooq.Record2; +import org.jooq.Record4; +import org.jooq.Record5; +import org.jooq.Select; +import org.jooq.SelectConditionStep; +import org.jooq.SelectHavingStep; +import org.jooq.SelectJoinStep; +import org.jooq.SelectOnConditionStep; +import org.jooq.SelectQuery; +import org.jooq.SelectSeekStepN; +import org.jooq.SortOrder; +import org.jooq.Table; import org.jooq.impl.DSL; import org.jooq.util.postgres.PostgresDSL; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Repository; -import javax.annotation.Nullable; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.*; -import java.util.stream.Collectors; - -import static com.epam.ta.reportportal.commons.querygen.Condition.VALUES_SEPARATOR; -import static com.epam.ta.reportportal.commons.querygen.QueryBuilder.STATISTICS_KEY; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_START_TIME; -import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.KEY_VALUE_SEPARATOR; -import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_DURATION; -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; -import static com.epam.ta.reportportal.dao.constant.WidgetRepositoryConstants.ID; -import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; -import static com.epam.ta.reportportal.dao.util.QueryUtils.collectJoinFields; -import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.*; -import static com.epam.ta.reportportal.jooq.Tables.*; -import static com.epam.ta.reportportal.jooq.tables.JActivity.ACTIVITY; -import static com.epam.ta.reportportal.jooq.tables.JIssue.ISSUE; -import static com.epam.ta.reportportal.jooq.tables.JIssueTicket.ISSUE_TICKET; -import static com.epam.ta.reportportal.jooq.tables.JLaunch.LAUNCH; -import static com.epam.ta.reportportal.jooq.tables.JProject.PROJECT; -import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; -import static com.epam.ta.reportportal.jooq.tables.JTestItemResults.TEST_ITEM_RESULTS; -import static com.epam.ta.reportportal.jooq.tables.JTicket.TICKET; -import static com.epam.ta.reportportal.jooq.tables.JUsers.USERS; -import static java.util.Optional.ofNullable; -import static java.util.stream.Collectors.*; -import static org.jooq.impl.DSL.*; - /** * Repository that contains queries of content loading for widgets. * @@ -82,1230 +225,1380 @@ @Repository public class WidgetContentRepositoryImpl implements WidgetContentRepository { - @Autowired - private DSLContext dsl; - - @Autowired - private WidgetProviderChain> healthCheckTableChain; - - private static final List HAS_METHOD_OR_CLASS = Arrays.stream(JTestItemTypeEnum.values()).filter(it -> { - String name = it.name(); - return name.contains("METHOD") || name.contains("CLASS"); - }).collect(Collectors.toList()); - - @Override - public OverallStatisticsContent overallStatisticsContent(Filter filter, Sort sort, List contentFields, boolean latest, - int limit) { - - return OVERALL_STATISTICS_FETCHER.apply(dsl.with(LAUNCHES) - .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(filter, sort, latest).with(sort).with(limit).build()) - .select(STATISTICS_FIELD.NAME, sum(STATISTICS.S_COUNTER).as(SUM)) - .from(LAUNCH) - .join(LAUNCHES) - .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .leftJoin(STATISTICS) - .on(LAUNCH.ID.eq(STATISTICS.LAUNCH_ID)) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .where(STATISTICS_FIELD.NAME.in(contentFields)) - .groupBy(STATISTICS_FIELD.NAME) - .fetch()); - } - - /** - * Returns condition for step level test item types. - * Include before/after methods and classes types depends on {@code includeMethods} param. - * - * @param includeMethods - * @return {@link Condition} - */ - private Condition itemTypeStepCondition(boolean includeMethods) { - List itemTypes = Lists.newArrayList(JTestItemTypeEnum.STEP); - if (includeMethods) { - itemTypes.addAll(HAS_METHOD_OR_CLASS); - } - return TEST_ITEM.TYPE.in(itemTypes); - } - - @Override - public List topItemsByCriteria(Filter filter, String criteria, int limit, boolean includeMethods) { - Table> criteriaTable = getTopItemsCriteriaTable(filter, criteria, limit, includeMethods); - - return CRITERIA_HISTORY_ITEM_FETCHER.apply(dsl.select(TEST_ITEM.UNIQUE_ID, - TEST_ITEM.NAME, - DSL.arrayAgg(when(fieldName(criteriaTable.getName(), CRITERIA_FLAG).cast(Integer.class).ge(1), true).otherwise(false)) - .orderBy(LAUNCH.NUMBER.asc()) - .as(STATUS_HISTORY), - DSL.max(TEST_ITEM.START_TIME).filterWhere(fieldName(criteriaTable.getName(), CRITERIA_FLAG).cast(Integer.class).ge(1)).as(START_TIME_HISTORY), - DSL.sum(fieldName(criteriaTable.getName(), CRITERIA_FLAG).cast(Integer.class)).as(CRITERIA), - DSL.count(TEST_ITEM.ITEM_ID).as(TOTAL) - ) - .from(TEST_ITEM) - .join(criteriaTable) - .on(TEST_ITEM.ITEM_ID.eq(fieldName(criteriaTable.getName(), ITEM_ID).cast(Long.class))) - .join(LAUNCH) - .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) - .groupBy(TEST_ITEM.UNIQUE_ID, TEST_ITEM.NAME) - .having(DSL.sum(fieldName(criteriaTable.getName(), CRITERIA_FLAG).cast(Integer.class)).greaterThan(BigDecimal.ZERO)) - .orderBy(DSL.field(DSL.name(CRITERIA)).desc(), DSL.field(DSL.name(TOTAL)).asc()) - .limit(MOST_FAILED_CRITERIA_LIMIT) - .fetch()); - } - - private Table> getTopItemsCriteriaTable(Filter filter, String criteria, int limit, boolean includeMethods) { - Sort launchSort = Sort.by(Sort.Direction.DESC, CRITERIA_START_TIME); - Table launchesTable = QueryBuilder.newBuilder(filter, collectJoinFields(filter, launchSort)) - .with(limit) - .with(launchSort) - .build() - .asTable(LAUNCHES); - - return getCommonMostFailedQuery(criteria, launchesTable).where(itemTypeStepCondition(includeMethods)) - .and(TEST_ITEM.HAS_STATS.eq(Boolean.TRUE)) - .and(TEST_ITEM.HAS_CHILDREN.eq(false)) - .groupBy(TEST_ITEM.ITEM_ID) - .asTable(CRITERIA_TABLE); - } - - private SelectOnConditionStep> getCommonMostFailedQuery(String criteria, - Table launchesTable) { - if (StringUtils.endsWithAny(criteria, - StatusEnum.FAILED.getExecutionCounterField(), - StatusEnum.SKIPPED.getExecutionCounterField() - )) { - StatusEnum status = StatusEnum.fromValue(StringUtils.substringAfterLast(criteria, STATISTICS_SEPARATOR)) - .orElseThrow(() -> new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR)); - return statusCriteriaTable(JStatusEnum.valueOf(status.name()), launchesTable); - } else { - return statisticsCriteriaTable(criteria, launchesTable); - } - } - - private SelectOnConditionStep> statisticsCriteriaTable(String criteria, - Table launchesTable) { - return dsl.select(TEST_ITEM.ITEM_ID, sum(when(STATISTICS_FIELD.NAME.eq(criteria), 1).otherwise(ZERO_QUERY_VALUE)).as(CRITERIA_FLAG)) - .from(TEST_ITEM) - .join(launchesTable) - .on(TEST_ITEM.LAUNCH_ID.eq(fieldName(launchesTable.getName(), ID).cast(Long.class))) - .join(STATISTICS) - .on(TEST_ITEM.ITEM_ID.eq(STATISTICS.ITEM_ID)) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)); - } - - private SelectOnConditionStep> statusCriteriaTable(JStatusEnum criteria, - Table launchesTable) { - return dsl.select(TEST_ITEM.ITEM_ID, - sum(when(TEST_ITEM_RESULTS.STATUS.eq(criteria), 1).otherwise(ZERO_QUERY_VALUE)).as(CRITERIA_FLAG) - ) - .from(TEST_ITEM) - .join(launchesTable) - .on(TEST_ITEM.LAUNCH_ID.eq(fieldName(launchesTable.getName(), ID).cast(Long.class))) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)); - } - - @Override - public List flakyCasesStatistics(Filter filter, boolean includeMethods, int limit) { - - return FLAKY_CASES_TABLE_FETCHER.apply(dsl.select(field(name(FLAKY_TABLE_RESULTS, TEST_ITEM.UNIQUE_ID.getName())).as(UNIQUE_ID), - field(name(FLAKY_TABLE_RESULTS, TEST_ITEM.NAME.getName())).as(ITEM_NAME), - DSL.arrayAgg(field(name(FLAKY_TABLE_RESULTS, TEST_ITEM_RESULTS.STATUS.getName()))).as(STATUSES), - DSL.max(field(name(FLAKY_TABLE_RESULTS, START_TIME))) - .filterWhere(field(name(FLAKY_TABLE_RESULTS, SWITCH_FLAG)).cast(Integer.class).gt(ZERO_QUERY_VALUE)) - .as(START_TIME_HISTORY), - sum(field(name(FLAKY_TABLE_RESULTS, SWITCH_FLAG)).cast(Long.class)).as(FLAKY_COUNT), - count(field(name(FLAKY_TABLE_RESULTS, ITEM_ID))).minus(1).as(TOTAL) - ) - .from(dsl.with(LAUNCHES) - .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, Sort.unsorted())) - .with(LAUNCH.NUMBER, SortOrder.DESC) - .with(limit) - .build()) - .select(TEST_ITEM.ITEM_ID, - TEST_ITEM.UNIQUE_ID, - TEST_ITEM.NAME, - TEST_ITEM.START_TIME, - TEST_ITEM_RESULTS.STATUS, - when(TEST_ITEM_RESULTS.STATUS.notEqual(lag(TEST_ITEM_RESULTS.STATUS).over(orderBy(TEST_ITEM.UNIQUE_ID, - TEST_ITEM.START_TIME - ))) - .and(TEST_ITEM.UNIQUE_ID.equal(lag(TEST_ITEM.UNIQUE_ID).over(orderBy(TEST_ITEM.UNIQUE_ID, - TEST_ITEM.START_TIME - )))), 1).otherwise(ZERO_QUERY_VALUE).as(SWITCH_FLAG) - ) - .from(LAUNCH) - .join(LAUNCHES) - .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .join(TEST_ITEM) - .on(LAUNCH.ID.eq(TEST_ITEM.LAUNCH_ID)) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .where(itemTypeStepCondition(includeMethods)) - .and(TEST_ITEM.HAS_STATS.eq(Boolean.TRUE)) - .and(TEST_ITEM.HAS_CHILDREN.eq(false)) - .and(TEST_ITEM.RETRY_OF.isNull()) - .groupBy(TEST_ITEM.ITEM_ID, TEST_ITEM_RESULTS.STATUS, TEST_ITEM.UNIQUE_ID, TEST_ITEM.NAME, TEST_ITEM.START_TIME) - .orderBy(TEST_ITEM.UNIQUE_ID, TEST_ITEM.START_TIME.desc()) - .asTable(FLAKY_TABLE_RESULTS)) - .groupBy(field(name(FLAKY_TABLE_RESULTS, TEST_ITEM.UNIQUE_ID.getName())), - field(name(FLAKY_TABLE_RESULTS, TEST_ITEM.NAME.getName())) - ) - .having(count(field(name(FLAKY_TABLE_RESULTS, ITEM_ID))).gt(BigDecimal.ONE.intValue()) - .and(sum(field(name(FLAKY_TABLE_RESULTS, SWITCH_FLAG)).cast(Long.class)).gt(BigDecimal.ZERO))) - .orderBy(fieldName(FLAKY_COUNT).desc(), fieldName(TOTAL).asc(), fieldName(UNIQUE_ID)) - .limit(FLAKY_CASES_LIMIT) - .fetch()); - } - - @Override - public List launchStatistics(Filter filter, List contentFields, Sort sort, int limit) { - - List> groupingFields = Lists.newArrayList(field(LAUNCH.ID), - field(LAUNCH.NUMBER), - field(LAUNCH.START_TIME), - field(LAUNCH.NAME), - fieldName(STATISTICS_TABLE, SF_NAME), - fieldName(STATISTICS_TABLE, STATISTICS_COUNTER) - ); - - groupingFields.addAll(WidgetSortUtils.fieldTransformer(filter.getTarget()).apply(sort, LAUNCHES)); - - return LAUNCHES_STATISTICS_FETCHER.apply(dsl.with(LAUNCHES) - .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit).build()) - .select(LAUNCH.ID, - LAUNCH.NUMBER, - LAUNCH.START_TIME, - LAUNCH.NAME, - fieldName(STATISTICS_TABLE, SF_NAME), - fieldName(STATISTICS_TABLE, STATISTICS_COUNTER) - ) - .from(LAUNCH) - .join(LAUNCHES) - .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), STATISTICS_FIELD.NAME.as(SF_NAME)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .where(STATISTICS_FIELD.NAME.in(contentFields)) - .asTable(STATISTICS_TABLE)) - .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) - .groupBy(groupingFields) - .orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)) - .fetch()); - } - - @Override - public List investigatedStatistics(Filter filter, Sort sort, int limit) { - - List> groupingFields = Lists.newArrayList(field(LAUNCH.ID), - field(LAUNCH.NUMBER), - field(LAUNCH.START_TIME), - field(LAUNCH.NAME) - ); - - groupingFields.addAll(WidgetSortUtils.fieldTransformer(filter.getTarget()).apply(sort, LAUNCHES)); - - return INVESTIGATED_STATISTICS_FETCHER.apply(dsl.with(LAUNCHES) - .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit).build()) - .select(LAUNCH.ID, - LAUNCH.NUMBER, - LAUNCH.START_TIME, - LAUNCH.NAME, - round(val(PERCENTAGE_MULTIPLIER).mul(dsl.select(sum(STATISTICS.S_COUNTER)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .onKey() - .where(STATISTICS_FIELD.NAME.eq(DEFECTS_TO_INVESTIGATE_TOTAL).and(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID))) - .asField() - .cast(Double.class)) - .div(nullif(dsl.select(sum(STATISTICS.S_COUNTER)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .onKey() - .where(STATISTICS_FIELD.NAME.in(DEFECTS_AUTOMATION_BUG_TOTAL, - DEFECTS_NO_DEFECT_TOTAL, - DEFECTS_TO_INVESTIGATE_TOTAL, - DEFECTS_PRODUCT_BUG_TOTAL, - DEFECTS_SYSTEM_ISSUE_TOTAL - ).and(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID))) - .asField(), 0)), 2).as(TO_INVESTIGATE) - ) - .from(LAUNCH) - .join(LAUNCHES) - .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), STATISTICS_FIELD.NAME.as(SF_NAME)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .asTable(STATISTICS_TABLE)) - .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) - .groupBy(groupingFields) - .orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)) - .fetch()); - - } - - @Override - public List timelineInvestigatedStatistics(Filter filter, Sort sort, int limit) { - - List> groupingFields = Lists.newArrayList(field(LAUNCH.ID), - field(LAUNCH.NUMBER), - field(LAUNCH.START_TIME), - field(LAUNCH.NAME) - ); - - groupingFields.addAll(WidgetSortUtils.fieldTransformer(filter.getTarget()).apply(sort, LAUNCHES)); - - return dsl.with(LAUNCHES) - .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit).build()) - .select(LAUNCH.ID, - LAUNCH.NUMBER, - LAUNCH.START_TIME, - LAUNCH.NAME, - coalesce(DSL.select(sum(STATISTICS.S_COUNTER)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .onKey() - .where(STATISTICS_FIELD.NAME.eq(DEFECTS_TO_INVESTIGATE_TOTAL).and(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID))) - .asField() - .cast(Double.class), 0).as(TO_INVESTIGATE), - coalesce(DSL.select(sum(STATISTICS.S_COUNTER)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .onKey() - .where(STATISTICS_FIELD.NAME.in(DEFECTS_AUTOMATION_BUG_TOTAL, - DEFECTS_NO_DEFECT_TOTAL, - DEFECTS_TO_INVESTIGATE_TOTAL, - DEFECTS_PRODUCT_BUG_TOTAL, - DEFECTS_SYSTEM_ISSUE_TOTAL - ).and(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID))) - .asField(), 0).as(INVESTIGATED) - ) - .from(LAUNCH) - .join(LAUNCHES) - .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .groupBy(groupingFields) - .orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)) - .fetch(TIMELINE_INVESTIGATED_STATISTICS_RECORD_MAPPER); - } - - @Override - public PassingRateStatisticsResult passingRatePerLaunchStatistics(Long launchId) { - - return dsl.select(LAUNCH.ID, - LAUNCH.NUMBER.as(NUMBER), - sum(when(STATISTICS_FIELD.NAME.eq(EXECUTIONS_PASSED), STATISTICS.S_COUNTER).otherwise(0)).as(PASSED), - sum(when(STATISTICS_FIELD.NAME.eq(EXECUTIONS_TOTAL), STATISTICS.S_COUNTER).otherwise(0)).as(TOTAL), - sum(when(STATISTICS_FIELD.NAME.eq(EXECUTIONS_SKIPPED), STATISTICS.S_COUNTER).otherwise(0)).as(SKIPPED) - ) - .from(LAUNCH) - .leftJoin(STATISTICS) - .on(LAUNCH.ID.eq(STATISTICS.LAUNCH_ID)) - .leftJoin(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .and(STATISTICS_FIELD.NAME.in(EXECUTIONS_PASSED, EXECUTIONS_TOTAL, EXECUTIONS_SKIPPED)) - .where(LAUNCH.ID.eq(launchId)) - .groupBy(LAUNCH.ID) - .fetchOneInto(PassingRateStatisticsResult.class); - } - - @Override - public PassingRateStatisticsResult summaryPassingRateStatistics(Filter filter, Sort sort, int limit) { - return buildPassingRateSelect(filter, sort, limit).fetchInto(PassingRateStatisticsResult.class) - .stream() - .findFirst() - .orElseThrow(() -> new ReportPortalException("No results for filter were found")); - } - - @Override - public List casesTrendStatistics(Filter filter, String contentField, Sort sort, int limit) { - - List> groupingFields = Lists.newArrayList(field(LAUNCH.ID), - field(LAUNCH.NUMBER), - field(LAUNCH.START_TIME), - field(LAUNCH.NAME), - fieldName(STATISTICS_TABLE, STATISTICS_COUNTER) - ); - - groupingFields.addAll(WidgetSortUtils.fieldTransformer(filter.getTarget()).apply(sort, LAUNCHES)); - - return CASES_GROWTH_TREND_FETCHER.apply(dsl.with(LAUNCHES) - .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit).build()) - .select(LAUNCH.ID, - LAUNCH.NUMBER, - LAUNCH.START_TIME, - LAUNCH.NAME, - fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), - coalesce(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER).sub(lag(fieldName(STATISTICS_TABLE, - STATISTICS_COUNTER - )).over().orderBy(LAUNCH.START_TIME.asc())), 0).as(DELTA) - ) - .from(LAUNCH) - .join(LAUNCHES) - .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), STATISTICS_FIELD.NAME.as(SF_NAME)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .where(STATISTICS_FIELD.NAME.eq(contentField)) - .asTable(STATISTICS_TABLE)) - .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) - .groupBy(groupingFields) - .orderBy(LAUNCH.START_TIME.asc()) - .fetch(), contentField); - } - - @Override - public List bugTrendStatistics(Filter filter, List contentFields, Sort sort, int limit) { - - return BUG_TREND_STATISTICS_FETCHER.apply(dsl.with(LAUNCHES) - .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit).build()) - .select(LAUNCH.ID, - LAUNCH.NAME, - LAUNCH.NUMBER, - LAUNCH.START_TIME, - fieldName(STATISTICS_TABLE, SF_NAME), - fieldName(STATISTICS_TABLE, STATISTICS_COUNTER) - ) - .from(LAUNCH) - .join(LAUNCHES) - .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), STATISTICS_FIELD.NAME.as(SF_NAME)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .where(STATISTICS_FIELD.NAME.in(contentFields)) - .asTable(STATISTICS_TABLE)) - .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) - .orderBy(LAUNCH.START_TIME.asc()) - .fetch()); - - } - - @Override - public List launchesComparisonStatistics(Filter filter, List contentFields, Sort sort, int limit) { - - List executionStatisticsFields = contentFields.stream().filter(cf -> cf.contains(EXECUTIONS_KEY)).collect(toList()); - List defectStatisticsFields = contentFields.stream().filter(cf -> cf.contains(DEFECTS_KEY)).collect(toList()); - - return LAUNCHES_STATISTICS_FETCHER.apply(dsl.with(LAUNCHES) - .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit).build()) - .select(LAUNCH.ID, - LAUNCH.NAME, - LAUNCH.NUMBER, - LAUNCH.START_TIME, - field(name(STATISTICS_TABLE, SF_NAME), String.class), - when(field(name(STATISTICS_TABLE, SF_NAME)).equalIgnoreCase(EXECUTIONS_TOTAL), - field(name(STATISTICS_TABLE, STATISTICS_COUNTER)).cast(Double.class) - ).otherwise(round(val(PERCENTAGE_MULTIPLIER).mul(field(name(STATISTICS_TABLE, STATISTICS_COUNTER), Integer.class)) - .div(nullif(DSL.select(DSL.sum(STATISTICS.S_COUNTER)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .where(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID)) - .and(STATISTICS_FIELD.NAME.in(executionStatisticsFields) - .and(STATISTICS_FIELD.NAME.notEqual(EXECUTIONS_TOTAL))), 0).cast(Double.class)), 2)) - .as(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER)) - ) - .from(LAUNCH) - .join(LAUNCHES) - .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), STATISTICS_FIELD.NAME.as(SF_NAME)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .where(STATISTICS_FIELD.NAME.in(executionStatisticsFields)) - .asTable(STATISTICS_TABLE)) - .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) - .orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)) - .unionAll(DSL.select(LAUNCH.ID, - LAUNCH.NAME, - LAUNCH.NUMBER, - LAUNCH.START_TIME, - field(name(STATISTICS_TABLE, SF_NAME), String.class), - round(val(PERCENTAGE_MULTIPLIER).mul(field(name(STATISTICS_TABLE, STATISTICS_COUNTER), Integer.class)) - .div(nullif(DSL.select(DSL.sum(STATISTICS.S_COUNTER)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .where(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID)) - .and(STATISTICS_FIELD.NAME.in(defectStatisticsFields)), 0).cast(Double.class)), 2) - ) - .from(LAUNCH) - .join(LAUNCHES) - .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, - STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), - STATISTICS_FIELD.NAME.as(SF_NAME) - ) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .where(STATISTICS_FIELD.NAME.in(defectStatisticsFields)) - .asTable(STATISTICS_TABLE)) - .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) - .orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES))) - .fetch()); - - } - - @Override - public List launchesDurationStatistics(Filter filter, Sort sort, boolean isLatest, int limit) { - - return dsl.with(LAUNCHES) - .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(filter, sort, isLatest).with(sort).with(limit).build()) - .select(LAUNCH.ID, - LAUNCH.NAME, - LAUNCH.NUMBER, - LAUNCH.STATUS, - LAUNCH.START_TIME, - LAUNCH.END_TIME, - timestampDiff(LAUNCH.END_TIME, LAUNCH.START_TIME).as(DURATION) - ) - .from(LAUNCH) - .join(LAUNCHES) - .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)) - .fetchInto(LaunchesDurationContent.class); - } - - @Override - public List notPassedCasesStatistics(Filter filter, Sort sort, int limit) { - - return dsl.with(LAUNCHES) - .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit).build()) - .select(LAUNCH.ID, - LAUNCH.NAME, - LAUNCH.NUMBER, - LAUNCH.START_TIME, - fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), - coalesce(round(val(PERCENTAGE_MULTIPLIER).mul(DSL.select(DSL.sum(STATISTICS.S_COUNTER)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .where(STATISTICS_FIELD.NAME.in(EXECUTIONS_SKIPPED, EXECUTIONS_FAILED)) - .and(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID)) - .asField() - .cast(Double.class)) - .div(nullif(field(name(STATISTICS_TABLE, STATISTICS_COUNTER), Integer.class), 0).cast(Double.class)), 2), 0) - .as(PERCENTAGE) - ) - .from(LAUNCH) - .join(LAUNCHES) - .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), STATISTICS_FIELD.NAME.as(SF_NAME)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .where(STATISTICS_FIELD.NAME.eq(EXECUTIONS_TOTAL)) - .asTable(STATISTICS_TABLE)) - .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) - .orderBy(LAUNCH.START_TIME.asc()) - .fetch(NOT_PASSED_CASES_CONTENT_RECORD_MAPPER); - } - - @Override - public List launchesTableStatistics(Filter filter, List contentFields, Sort sort, int limit) { - - Map criteria = filter.getTarget() - .getCriteriaHolders() - .stream() - .collect(Collectors.toMap(CriteriaHolder::getFilterCriteria, CriteriaHolder::getQueryCriteria)); - - boolean isAttributePresent = contentFields.remove("attributes"); - - List> selectFields = contentFields.stream() - .filter(cf -> !cf.startsWith(STATISTICS_KEY)) - .map(cf -> field(ofNullable(criteria.get(cf)).orElseThrow(() -> new ReportPortalException(Suppliers.formattedSupplier( - "Unknown table field - '{}'", - cf - ).get())))) - .collect(Collectors.toList()); - - Collections.addAll(selectFields, LAUNCH.ID, fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), fieldName(STATISTICS_TABLE, SF_NAME)); - - if (isAttributePresent) { - Collections.addAll(selectFields, ITEM_ATTRIBUTE.ID.as(ATTR_ID), ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE); - } - - List statisticsFields = contentFields.stream().filter(cf -> cf.startsWith(STATISTICS_KEY)).collect(toList()); - - return LAUNCHES_TABLE_FETCHER.apply(buildLaunchesTableQuery(selectFields, statisticsFields, filter, sort, limit, isAttributePresent) - .fetch(), contentFields); - - } - - @Override - public List activityStatistics(Filter filter, Sort sort, int limit) { - - return dsl.with(ACTIVITIES) - .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit).build()) - .select(ACTIVITY.ID, - ACTIVITY.ACTION, - ACTIVITY.ENTITY, - ACTIVITY.CREATION_DATE, - ACTIVITY.DETAILS, - ACTIVITY.PROJECT_ID, - ACTIVITY.OBJECT_ID, - USERS.LOGIN, - PROJECT.NAME - ) - .from(ACTIVITY) - .join(ACTIVITIES) - .on(fieldName(ACTIVITIES, ID).cast(Long.class).eq(ACTIVITY.ID)) - .join(USERS) - .on(ACTIVITY.USER_ID.eq(USERS.ID)) - .join(PROJECT) - .on(ACTIVITY.PROJECT_ID.eq(PROJECT.ID)) - .orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, ACTIVITIES)) - .fetch() - .map(ACTIVITY_MAPPER); - - } - - @Override - public Map uniqueBugStatistics(Filter filter, Sort sort, boolean isLatest, int limit) { - - Map content = UNIQUE_BUG_CONTENT_FETCHER.apply(dsl.with(LAUNCHES) - .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(filter, sort, isLatest).with(limit).with(sort).build()) - .select(TICKET.TICKET_ID, - TICKET.SUBMIT_DATE, - TICKET.URL, - TICKET.SUBMITTER, - TEST_ITEM.ITEM_ID, - TEST_ITEM.NAME, - TEST_ITEM.PATH, - TEST_ITEM.LAUNCH_ID, - fieldName(ITEM_ATTRIBUTES, KEY), - fieldName(ITEM_ATTRIBUTES, VALUE) - ) - .from(TEST_ITEM) - .join(LAUNCHES) - .on(fieldName(LAUNCHES, ID).cast(Long.class).eq(TEST_ITEM.LAUNCH_ID)) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .leftJoin(ISSUE) - .on(TEST_ITEM.ITEM_ID.eq(ISSUE.ISSUE_ID)) - .leftJoin(ISSUE_TICKET) - .on(ISSUE.ISSUE_ID.eq(ISSUE_TICKET.ISSUE_ID)) - .join(TICKET) - .on(ISSUE_TICKET.TICKET_ID.eq(TICKET.ID)) - .leftJoin(lateral(dsl.select(ITEM_ATTRIBUTE.ITEM_ID, ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE) - .from(ITEM_ATTRIBUTE) - .where(ITEM_ATTRIBUTE.ITEM_ID.eq(TEST_ITEM.ITEM_ID).andNot(ITEM_ATTRIBUTE.SYSTEM))).as(ITEM_ATTRIBUTES)) - .on(TEST_ITEM.ITEM_ID.eq(fieldName(ITEM_ATTRIBUTES, ITEM_ID).cast(Long.class))) - .orderBy(TICKET.SUBMIT_DATE.desc()) - .fetch()); - - return content; - } - - @Override - public Map> productStatusGroupedByFilterStatistics(Map filterSortMapping, - List contentFields, Map customColumns, boolean isLatest, int limit) { - - Select select = filterSortMapping.entrySet() - .stream() - .map(f -> (Select) buildFilterGroupedQuery(f.getKey(), - isLatest, - f.getValue(), - limit, - contentFields, - customColumns - )) - .collect(Collectors.toList()) - .stream() - .reduce((prev, curr) -> curr = prev.unionAll(curr)) - .orElseThrow(() -> new ReportPortalException(ErrorType.BAD_REQUEST_ERROR, - "Query building for Product Status Widget failed" - )); - - Map> productStatusContent = PRODUCT_STATUS_FILTER_GROUPED_FETCHER.apply(select.fetch(), - customColumns - ); - - productStatusContent.put(TOTAL, countFilterTotalStatistics(productStatusContent)); - - return productStatusContent; - } - - @Override - public List productStatusGroupedByLaunchesStatistics(Filter filter, List contentFields, - Map customColumns, Sort sort, boolean isLatest, int limit) { - - List> selectFields = getCommonProductStatusFields(filter, contentFields); - - List productStatusStatisticsResult = PRODUCT_STATUS_LAUNCH_GROUPED_FETCHER.apply( - buildProductStatusQuery(filter, - isLatest, - sort, - limit, - selectFields, - contentFields, - customColumns - ).orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)).fetch(), - customColumns - ); - - if (!productStatusStatisticsResult.isEmpty()) { - productStatusStatisticsResult.add(countLaunchTotalStatistics(productStatusStatisticsResult)); - } - return productStatusStatisticsResult; - } - - @Override - public List mostTimeConsumingTestCasesStatistics(Filter filter, int limit) { - final Set fields = collectJoinFields(filter); - fields.add(CRITERIA_DURATION); - final SelectQuery filteringQuery = QueryBuilder.newBuilder(filter, fields) - .with(limit) - .build(); - filteringQuery.addOrderBy(max(TEST_ITEM_RESULTS.DURATION).desc()); - return dsl.with(ITEMS) - .as(filteringQuery) - .select(TEST_ITEM.ITEM_ID.as(ID), - TEST_ITEM.UNIQUE_ID, - TEST_ITEM.NAME, - TEST_ITEM.TYPE, - TEST_ITEM.PATH, - TEST_ITEM.START_TIME, - TEST_ITEM_RESULTS.END_TIME, - TEST_ITEM_RESULTS.DURATION, - TEST_ITEM_RESULTS.STATUS - ) - .from(TEST_ITEM) - .join(ITEMS) - .on(fieldName(ITEMS, ID).cast(Long.class).eq(TEST_ITEM.ITEM_ID)) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .orderBy(fieldName(TEST_ITEM_RESULTS.DURATION).desc()) - .fetchInto(MostTimeConsumingTestCasesContent.class); - } - - @Override - public List patternTemplate(Filter filter, Sort sort, @Nullable String attributeKey, - @Nullable String patternName, boolean isLatest, int launchesLimit, int attributesLimit) { - - Condition attributeKeyCondition = ofNullable(attributeKey).map(ITEM_ATTRIBUTE.KEY::eq).orElseGet(DSL::noCondition); - Field launchIdsField = isLatest ? DSL.max(LAUNCH.ID).as(ID) : DSL.arrayAgg(LAUNCH.ID).as(ID); - List> groupingFields = isLatest ? - Lists.newArrayList(LAUNCH.NAME, ITEM_ATTRIBUTE.VALUE) : - Lists.newArrayList(ITEM_ATTRIBUTE.VALUE); - - Map> attributeIdsMapping = PATTERN_TEMPLATES_AGGREGATION_FETCHER.apply(dsl.with(LAUNCHES) - .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(launchesLimit).build()) - .select(launchIdsField, ITEM_ATTRIBUTE.VALUE) - .from(LAUNCH) - .join(LAUNCHES) - .on(fieldName(LAUNCHES, ID).cast(Long.class).eq(LAUNCH.ID)) - .join(ITEM_ATTRIBUTE) - .on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)) - .where(attributeKeyCondition) - .and(ITEM_ATTRIBUTE.VALUE.in(dsl.select(ITEM_ATTRIBUTE.VALUE) - .from(ITEM_ATTRIBUTE) - .join(LAUNCHES) - .on(fieldName(LAUNCHES, ID).cast(Long.class).eq(ITEM_ATTRIBUTE.LAUNCH_ID)) - .where(attributeKeyCondition) - .groupBy(ITEM_ATTRIBUTE.VALUE) - .orderBy(DSL.when(ITEM_ATTRIBUTE.VALUE.likeRegex(VERSION_PATTERN), - PostgresDSL.stringToArray(ITEM_ATTRIBUTE.VALUE, VERSION_DELIMITER).cast(Integer[].class) - ).desc(), ITEM_ATTRIBUTE.VALUE.sort(SortOrder.DESC)) - .limit(attributesLimit))) - .groupBy(groupingFields) - .orderBy(DSL.when(ITEM_ATTRIBUTE.VALUE.likeRegex(VERSION_PATTERN), - PostgresDSL.stringToArray(ITEM_ATTRIBUTE.VALUE, VERSION_DELIMITER).cast(Integer[].class) - ).desc(), ITEM_ATTRIBUTE.VALUE.sort(SortOrder.DESC)) - .fetch(), isLatest); - - return StringUtils.isBlank(patternName) ? - buildPatternTemplatesQuery(attributeIdsMapping) : - buildPatternTemplatesQueryGroupedByPattern(attributeIdsMapping, patternName); - - } - - @Override - public List componentHealthCheck(Filter launchFilter, Sort launchSort, boolean isLatest, int launchesLimit, - Filter testItemFilter, String currentLevelKey) { - - Table launchesTable = QueryUtils.createQueryBuilderWithLatestLaunchesOption(launchFilter, launchSort, isLatest) - .with(launchesLimit) - .with(launchSort) - .build() - .asTable(LAUNCHES); - - return COMPONENT_HEALTH_CHECK_FETCHER.apply(dsl.select(fieldName(ITEMS, VALUE), - DSL.count(fieldName(ITEMS, ITEM_ID)).as(TOTAL), - DSL.round(DSL.val(PERCENTAGE_MULTIPLIER) - .mul(DSL.count(fieldName(ITEMS, ITEM_ID)) - .filterWhere(fieldName(ITEMS, STATUS).cast(JStatusEnum.class).eq(JStatusEnum.PASSED))) - .div(DSL.nullif(DSL.count(fieldName(ITEMS, ITEM_ID)), 0)), 2).as(PASSING_RATE) - ) - .from(dsl.with(ITEMS) - .as(QueryBuilder.newBuilder(testItemFilter, collectJoinFields(testItemFilter)) - .addJointToStart(launchesTable, - JoinType.JOIN, - TEST_ITEM.LAUNCH_ID.eq(fieldName(launchesTable.getName(), ID).cast(Long.class)) - ) - .build()) - .select(TEST_ITEM.ITEM_ID, TEST_ITEM_RESULTS.STATUS, ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE) - .from(TEST_ITEM) - .join(ITEMS) - .on(TEST_ITEM.ITEM_ID.eq(fieldName(ITEMS, ID).cast(Long.class))) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .join(ITEM_ATTRIBUTE) - .on((TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID).or(TEST_ITEM.LAUNCH_ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID))).and( - ITEM_ATTRIBUTE.KEY.eq(currentLevelKey).and(ITEM_ATTRIBUTE.SYSTEM.isFalse()))) - .groupBy(TEST_ITEM.ITEM_ID, TEST_ITEM_RESULTS.STATUS, ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE) - .asTable(ITEMS)) - .groupBy(fieldName(ITEMS, VALUE)) - .orderBy(DSL.round(DSL.val(PERCENTAGE_MULTIPLIER) - .mul(DSL.count(fieldName(ITEMS, ITEM_ID)) - .filterWhere(fieldName(ITEMS, STATUS).cast(JStatusEnum.class).eq(JStatusEnum.PASSED))) - .div(DSL.nullif(DSL.count(fieldName(ITEMS, ITEM_ID)), 0)), 2)) - .fetch()); - } - - @Override - public void generateCumulativeTrendChartView(boolean refresh, String viewName, Filter launchFilter, Sort launchesSort, - List attributes, int launchesLimit) { - - if (refresh) { - removeWidgetView(viewName); - } - - final String FIRST_LEVEL = "first_level"; - - final SelectJoinStep> FIRST_LEVEL_TABLE = dsl.with(FIRST_LEVEL) - .as(dsl.with(LAUNCHES) - .as(QueryBuilder.newBuilder(launchFilter, collectJoinFields(launchFilter)) - .with(launchesSort) - .with(launchesLimit) - .build()) - .select(max(LAUNCH.ID).as(ID), - LAUNCH.NAME, - arrayAggDistinct(LAUNCH.ID).as(AGGREGATED_LAUNCHES_IDS), - ITEM_ATTRIBUTE.KEY.as(ATTRIBUTE_KEY), - ITEM_ATTRIBUTE.VALUE.as(ATTRIBUTE_VALUE) - ) - .from(LAUNCH) - .join(LAUNCHES) - .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .join(ITEM_ATTRIBUTE) - .on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)) - .and(ITEM_ATTRIBUTE.KEY.eq(attributes.get(0)).and(ITEM_ATTRIBUTE.SYSTEM.isFalse())) - .groupBy(LAUNCH.NAME, ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE)) - .select(fieldName(FIRST_LEVEL, ID).cast(Long.class).as(ID), - fieldName(FIRST_LEVEL, NAME).cast(String.class).as(NAME), - val(null, fieldName(FIRST_LEVEL, ID).cast(Long.class)).as(FIRST_LEVEL_ID), - fieldName(FIRST_LEVEL, ATTRIBUTE_KEY).cast(String.class).as(ATTRIBUTE_KEY), - fieldName(FIRST_LEVEL, ATTRIBUTE_VALUE).cast(String.class).as(ATTRIBUTE_VALUE) - ) - .from(FIRST_LEVEL); - - SelectQuery> query; - - if (attributes.size() == 2 && attributes.get(1) != null) { - final SelectHavingStep> SECOND_LEVEL_TABLE = dsl.select(max(LAUNCH.ID).as(ID), - LAUNCH.NAME, - max(fieldName(FIRST_LEVEL, ID)).cast(Long.class).as(FIRST_LEVEL_ID), - ITEM_ATTRIBUTE.KEY.as(ATTRIBUTE_KEY), - ITEM_ATTRIBUTE.VALUE.as(ATTRIBUTE_VALUE) - ) - .from(FIRST_LEVEL) - .join(LAUNCH) - .on(Suppliers.formattedSupplier("{} = any({})", LAUNCH.ID, AGGREGATED_LAUNCHES_IDS).get()) - .join(ITEM_ATTRIBUTE) - .on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)) - .and(ITEM_ATTRIBUTE.KEY.eq(attributes.get(1)).and(ITEM_ATTRIBUTE.SYSTEM.isFalse())) - .groupBy(LAUNCH.NAME, - fieldName(FIRST_LEVEL, ATTRIBUTE_KEY), - fieldName(FIRST_LEVEL, ATTRIBUTE_VALUE), - ITEM_ATTRIBUTE.KEY, - ITEM_ATTRIBUTE.VALUE - ); - query = FIRST_LEVEL_TABLE.union(SECOND_LEVEL_TABLE).getQuery(); - } else { - query = FIRST_LEVEL_TABLE.getQuery(); - } - dsl.execute(DSL.sql(String.format("CREATE MATERIALIZED VIEW %s AS (%s)", DSL.name(viewName), query.toString()))); - } - - @Override - public List cumulativeTrendChart(String viewName, String levelAttributeKey, @Nullable String subAttributeKey, - @Nullable String parentAttribute) { - final SelectOnConditionStep baseQuery = dsl.select(DSL.arrayAgg(fieldName(viewName, ID)).as(LAUNCHES), - fieldName(viewName, ATTRIBUTE_VALUE), - STATISTICS_FIELD.NAME, - sum(STATISTICS.S_COUNTER).as(STATISTICS_COUNTER) - ) - .from(viewName) - .join(STATISTICS) - .on(fieldName(viewName, ID).cast(Long.class).eq(STATISTICS.LAUNCH_ID)) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)); - - if (parentAttribute != null) { - String[] split = parentAttribute.split(KEY_VALUE_SEPARATOR); - - final SelectConditionStep> subLevelLaunches = selectDistinct(fieldName(viewName, ID).cast(Long.class)).from( - viewName) - .where(fieldName(viewName, ATTRIBUTE_KEY).cast(String.class).eq(split[0])) - .and(fieldName(viewName, ATTRIBUTE_VALUE).cast(String.class).eq(split[1])); - baseQuery.where(fieldName(viewName, FIRST_LEVEL_ID).cast(Long.class).in(subLevelLaunches)); - } - - List accumulatedLaunches = CUMULATIVE_TREND_CHART_FETCHER.apply(baseQuery.where(fieldName(ATTRIBUTE_KEY).cast( - String.class).eq(levelAttributeKey)) - .groupBy(fieldName(viewName, ATTRIBUTE_VALUE), STATISTICS_FIELD.NAME) - .orderBy(when(fieldName(viewName, ATTRIBUTE_VALUE).likeRegex(VERSION_PATTERN), - PostgresDSL.stringToArray(field(name(viewName, ATTRIBUTE_VALUE), String.class), VERSION_DELIMITER) - .cast(Integer[].class) - ), fieldName(viewName, ATTRIBUTE_VALUE).sort(SortOrder.ASC)) - .fetch()); - - if (!StringUtils.isEmpty(subAttributeKey)) { - accumulatedLaunches.forEach(attributeLaunches -> CUMULATIVE_TOOLTIP_FETCHER.accept(attributeLaunches, - dsl.selectDistinct(fieldName(viewName, ATTRIBUTE_KEY), fieldName(viewName, ATTRIBUTE_VALUE)) - .from(viewName) - .where(fieldName(viewName, ATTRIBUTE_KEY).cast(String.class) - .eq(subAttributeKey) - .and(fieldName(viewName, ID).in(attributeLaunches.getContent().getLaunchIds()))) - .fetch() - )); - } - return accumulatedLaunches; - } - - @Override - public List getCumulativeLevelRedirectLaunchIds(String viewName, String attributes) { - String[] attributeLevels = attributes.split(VALUES_SEPARATOR); - - SelectConditionStep> firstLevelCondition = dsl.select(fieldName(viewName, ID).cast(Long.class)) - .from(viewName) - .where(concat(coalesce(fieldName(viewName, ATTRIBUTE_KEY), ""), - val(KEY_VALUE_SEPARATOR), - fieldName(viewName, ATTRIBUTE_VALUE) - ).eq(attributeLevels[0])); - - if (attributeLevels.length == 2) { - return dsl.select(fieldName(viewName, ID)) - .from(viewName) - .where(concat(coalesce(fieldName(viewName, ATTRIBUTE_KEY), ""), - val(KEY_VALUE_SEPARATOR), - fieldName(viewName, ATTRIBUTE_VALUE) - ).eq(attributeLevels[1])) - .and(fieldName(viewName, FIRST_LEVEL_ID).cast(Long.class).in(firstLevelCondition)) - .fetchInto(Long.class); - } - - return firstLevelCondition.fetchInto(Long.class); - } - - @Override - public void generateComponentHealthCheckTable(boolean refresh, HealthCheckTableInitParams params, Filter launchFilter, Sort launchSort, - int launchesLimit, boolean isLatest) { - - if (refresh) { - removeWidgetView(params.getViewName()); - } - - Table launchesTable = QueryUtils.createQueryBuilderWithLatestLaunchesOption(launchFilter, launchSort, isLatest) - .with(launchesLimit) - .with(launchSort) - .build() - .asTable(LAUNCHES); - - List> selectFields = Lists.newArrayList(TEST_ITEM.ITEM_ID, ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE); - - ofNullable(params.getCustomKey()).ifPresent(key -> selectFields.add(DSL.arrayAggDistinct(fieldName(CUSTOM_ATTRIBUTE, VALUE)) - .filterWhere(fieldName(CUSTOM_ATTRIBUTE, VALUE).isNotNull()) - .as(CUSTOM_COLUMN))); - - SelectOnConditionStep baseQuery = select(selectFields).from(TEST_ITEM) - .join(launchesTable) - .on(TEST_ITEM.LAUNCH_ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .join(TEST_ITEM_RESULTS) - .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) - .join(ITEM_ATTRIBUTE) - .on(and(TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID).or(TEST_ITEM.LAUNCH_ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID))).and( - ITEM_ATTRIBUTE.KEY.in(params.getAttributeKeys())).and(ITEM_ATTRIBUTE.SYSTEM.isFalse())); - - dsl.execute(DSL.sql(Suppliers.formattedSupplier("CREATE MATERIALIZED VIEW {} AS ({})", - DSL.name(params.getViewName()), - ofNullable(params.getCustomKey()).map(key -> { - JItemAttribute customAttribute = ITEM_ATTRIBUTE.as(CUSTOM_ATTRIBUTE); - return baseQuery.leftJoin(customAttribute) - .on(DSL.condition(Operator.OR, - TEST_ITEM.ITEM_ID.eq(customAttribute.ITEM_ID), - TEST_ITEM.LAUNCH_ID.eq(customAttribute.LAUNCH_ID) - ).and(customAttribute.KEY.eq(key))); - }) - .orElse(baseQuery) - .where(TEST_ITEM.HAS_STATS.isTrue() - .and(TEST_ITEM.HAS_CHILDREN.isFalse()) - .and(TEST_ITEM.TYPE.eq(JTestItemTypeEnum.STEP)) - .and(TEST_ITEM.RETRY_OF.isNull()) - .and(TEST_ITEM_RESULTS.STATUS.notEqual(JStatusEnum.IN_PROGRESS))) - .groupBy(TEST_ITEM.ITEM_ID, ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE) - .getQuery() - ).get())); - - } - - @Override - public void removeWidgetView(String viewName) { - dsl.execute(DSL.sql(Suppliers.formattedSupplier("DROP MATERIALIZED VIEW IF EXISTS {}", DSL.name(viewName)).get())); - } - - @Override - public List componentHealthCheckTable(HealthCheckTableGetParams params) { - return healthCheckTableChain.apply(params); - } - - private SelectSeekStepN buildLaunchesTableQuery(Collection> selectFields, - Collection statisticsFields, Filter filter, Sort sort, int limit, boolean isAttributePresent) { - - SelectOnConditionStep select = dsl.with(LAUNCHES) - .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit).build()) - .select(selectFields) - .from(LAUNCH) - .join(LAUNCHES) - .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), STATISTICS_FIELD.NAME.as(SF_NAME)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .where(STATISTICS_FIELD.NAME.in(statisticsFields)) - .asTable(STATISTICS_TABLE)) - .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) - .join(USERS) - .on(LAUNCH.USER_ID.eq(USERS.ID)); - if (isAttributePresent) { - select = select.leftJoin(ITEM_ATTRIBUTE).on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)); - } - - return select.orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)); - - } - - private SelectOnConditionStep buildPassingRateSelect(Filter filter, Sort sort, int limit) { - return dsl.with(LAUNCHES) - .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit).build()) - .select(sum(when(fieldName(STATISTICS_TABLE, SF_NAME).cast(String.class).eq(EXECUTIONS_PASSED), - fieldName(STATISTICS_TABLE, STATISTICS_COUNTER).cast(Integer.class) - ).otherwise(0)).as(PASSED), - sum(when(fieldName(STATISTICS_TABLE, SF_NAME).cast(String.class).eq(EXECUTIONS_TOTAL), - fieldName(STATISTICS_TABLE, STATISTICS_COUNTER).cast(Integer.class) - ).otherwise(0)).as(TOTAL), - sum(when(fieldName(STATISTICS_TABLE, SF_NAME).cast(String.class).eq(EXECUTIONS_SKIPPED), - fieldName(STATISTICS_TABLE, STATISTICS_COUNTER).cast(Integer.class) - ).otherwise(0)).as(SKIPPED), - max(LAUNCH.NUMBER).as(NUMBER) - ) - .from(LAUNCH) - .join(LAUNCHES) - .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), STATISTICS_FIELD.NAME.as(SF_NAME)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .where(STATISTICS_FIELD.NAME.in(EXECUTIONS_PASSED, EXECUTIONS_TOTAL, EXECUTIONS_SKIPPED)) - .asTable(STATISTICS_TABLE)) - .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))); - - } - - private SelectSeekStepN buildFilterGroupedQuery(Filter filter, boolean isLatest, Sort sort, int limit, - Collection contentFields, Map customColumns) { - - List> fields = getCommonProductStatusFields(filter, contentFields); - fields.add(DSL.selectDistinct(FILTER.NAME).from(FILTER).where(FILTER.ID.eq(filter.getId())).asField(FILTER_NAME)); - - return buildProductStatusQuery(filter, - isLatest, - sort, - limit, - fields, - contentFields, - customColumns - ).orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)); - - } - - private List> getCommonProductStatusFields(Filter filter, Collection contentFields) { - - Map criteria = filter.getTarget() - .getCriteriaHolders() - .stream() - .collect(Collectors.toMap(CriteriaHolder::getFilterCriteria, CriteriaHolder::getQueryCriteria)); - - List> selectFields = contentFields.stream() - .filter(cf -> !cf.startsWith(STATISTICS_KEY)) - .map(criteria::get) - .filter(Objects::nonNull) - .map(DSL::field) - .collect(Collectors.toList()); - - Collections.addAll(selectFields, - LAUNCH.ID, - LAUNCH.NAME, - LAUNCH.NUMBER, - fieldName(STATISTICS_TABLE, SF_NAME), - fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), - round(val(PERCENTAGE_MULTIPLIER).mul(dsl.select(sum(STATISTICS.S_COUNTER)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .onKey() - .where(STATISTICS_FIELD.NAME.eq(EXECUTIONS_PASSED).and(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID))) - .asField() - .cast(Double.class)) - .div(nullif(dsl.select(sum(STATISTICS.S_COUNTER)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .onKey() - .where(STATISTICS_FIELD.NAME.eq(EXECUTIONS_TOTAL).and(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID))) - .asField(), 0)), 2).as(PASSING_RATE), - timestampDiff(LAUNCH.END_TIME, LAUNCH.START_TIME).as(DURATION) - ); - - return selectFields; - } - - private SelectOnConditionStep buildProductStatusQuery(Filter filter, boolean isLatest, Sort sort, int limit, - Collection> fields, Collection contentFields, Map customColumns) { - - List attributesKeyConditions = customColumns.values() - .stream() - .map(customColumn -> ofNullable(customColumn).map(ITEM_ATTRIBUTE.KEY::eq).orElseGet(ITEM_ATTRIBUTE.KEY::isNull)) - .collect(Collectors.toList()); - - Optional combinedAttributeKeyCondition = attributesKeyConditions.stream().reduce((prev, curr) -> curr = prev.or(curr)); - - List statisticsFields = contentFields.stream().filter(cf -> cf.startsWith(STATISTICS_KEY)).collect(toList()); - - return combinedAttributeKeyCondition.map(c -> { - Collections.addAll(fields, - fieldName(ATTR_TABLE, ATTR_ID), - fieldName(ATTR_TABLE, ATTRIBUTE_VALUE), - fieldName(ATTR_TABLE, ATTRIBUTE_KEY) - ); - return getProductStatusSelect(filter, isLatest, sort, limit, fields, statisticsFields).leftJoin(DSL.select(ITEM_ATTRIBUTE.ID.as( - ATTR_ID), - ITEM_ATTRIBUTE.VALUE.as(ATTRIBUTE_VALUE), - ITEM_ATTRIBUTE.KEY.as(ATTRIBUTE_KEY), - ITEM_ATTRIBUTE.LAUNCH_ID.as(LAUNCH_ID) - ).from(ITEM_ATTRIBUTE).where(c).asTable(ATTR_TABLE)).on(LAUNCH.ID.eq(fieldName(ATTR_TABLE, LAUNCH_ID).cast(Long.class))); - }).orElseGet(() -> getProductStatusSelect(filter, isLatest, sort, limit, fields, statisticsFields)); - } - - private SelectOnConditionStep getProductStatusSelect(Filter filter, boolean isLatest, Sort sort, int limit, - Collection> fields, Collection contentFields) { - return dsl.with(LAUNCHES) - .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(filter, sort, isLatest).with(sort).with(limit).build()) - .select(fields) - .from(LAUNCH) - .join(LAUNCHES) - .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) - .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), STATISTICS_FIELD.NAME.as(SF_NAME)) - .from(STATISTICS) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .where(STATISTICS_FIELD.NAME.in(contentFields)) - .asTable(STATISTICS_TABLE)) - .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))); - } - - private ProductStatusStatisticsContent countLaunchTotalStatistics(List launchesStatisticsResult) { - Map total = launchesStatisticsResult.stream() - .flatMap(lsc -> lsc.getValues().entrySet().stream()) - .collect(Collectors.groupingBy(Map.Entry::getKey, summingInt(entry -> Integer.parseInt(entry.getValue())))); - - Double averagePassingRate = launchesStatisticsResult.stream() - .collect(averagingDouble(lsc -> ofNullable(lsc.getPassingRate()).orElse(0D))); - - ProductStatusStatisticsContent launchesStatisticsContent = new ProductStatusStatisticsContent(); - launchesStatisticsContent.setTotalStatistics(total); - - Double roundedAveragePassingRate = BigDecimal.valueOf(averagePassingRate).setScale(2, RoundingMode.HALF_UP).doubleValue(); - launchesStatisticsContent.setAveragePassingRate(roundedAveragePassingRate); - - return launchesStatisticsContent; - } - - private List countFilterTotalStatistics( - Map> launchesStatisticsResult) { - Map total = launchesStatisticsResult.values() - .stream() - .flatMap(Collection::stream) - .flatMap(lsc -> lsc.getValues().entrySet().stream()) - .collect(Collectors.groupingBy(Map.Entry::getKey, summingInt(entry -> Integer.parseInt(entry.getValue())))); - - Double averagePassingRate = launchesStatisticsResult.values() - .stream() - .flatMap(Collection::stream) - .collect(averagingDouble(lsc -> ofNullable(lsc.getPassingRate()).orElse(0D))); - - ProductStatusStatisticsContent launchesStatisticsContent = new ProductStatusStatisticsContent(); - launchesStatisticsContent.setTotalStatistics(total); - - Double roundedAveragePassingRate = BigDecimal.valueOf(averagePassingRate).setScale(2, RoundingMode.HALF_UP).doubleValue(); - launchesStatisticsContent.setAveragePassingRate(roundedAveragePassingRate); - - return Lists.newArrayList(launchesStatisticsContent); - } - - private List buildPatternTemplatesQuery(Map> attributeIdsMapping) { - - return attributeIdsMapping.entrySet() - .stream() - .map(entry -> (Select) dsl.select(DSL.val(entry.getKey()).as(ATTRIBUTE_VALUE), - PATTERN_TEMPLATE.NAME, - DSL.countDistinct(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID).as(TOTAL) - ) - .from(PATTERN_TEMPLATE) - .join(PATTERN_TEMPLATE_TEST_ITEM) - .on(PATTERN_TEMPLATE.ID.eq(PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID)) - .join(TEST_ITEM) - .on(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) - .join(LAUNCH) - .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) - .where(LAUNCH.ID.in(entry.getValue())) - .groupBy(PATTERN_TEMPLATE.NAME) - .orderBy(field(TOTAL).desc()) - .limit(PATTERNS_COUNT)) - .reduce((prev, curr) -> curr = prev.unionAll(curr)) - .map(select -> TOP_PATTERN_TEMPLATES_FETCHER.apply(select.fetch())) - .orElseGet(Collections::emptyList); - } - - private List buildPatternTemplatesQueryGroupedByPattern(Map> attributeIdsMapping, - String patternTemplateName) { - - return attributeIdsMapping.entrySet() - .stream() - .map(entry -> (Select) dsl.select(DSL.val(entry.getKey()).as(ATTRIBUTE_VALUE), - LAUNCH.ID, - LAUNCH.NAME, - LAUNCH.NUMBER, - DSL.countDistinct(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID).as(TOTAL) - ) - .from(PATTERN_TEMPLATE) - .join(PATTERN_TEMPLATE_TEST_ITEM) - .on(PATTERN_TEMPLATE.ID.eq(PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID)) - .join(TEST_ITEM) - .on(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) - .join(LAUNCH) - .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) - .where(LAUNCH.ID.in(entry.getValue())) - .and(PATTERN_TEMPLATE.NAME.eq(patternTemplateName)) - .groupBy(LAUNCH.ID, LAUNCH.NAME, LAUNCH.NUMBER, PATTERN_TEMPLATE.NAME) - .having(DSL.countDistinct(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID).gt(BigDecimal.ZERO.intValue())) - .orderBy(field(TOTAL).desc())) - .reduce((prev, curr) -> curr = prev.unionAll(curr)) - .map(select -> TOP_PATTERN_TEMPLATES_GROUPED_FETCHER.apply(select.fetch())) - .orElseGet(Collections::emptyList); - } + private static final List HAS_METHOD_OR_CLASS = Arrays.stream( + JTestItemTypeEnum.values()).filter(it -> { + String name = it.name(); + return name.contains("METHOD") || name.contains("CLASS"); + }).collect(Collectors.toList()); + @Autowired + private DSLContext dsl; + @Autowired + private WidgetProviderChain> healthCheckTableChain; + + @Override + public OverallStatisticsContent overallStatisticsContent(Filter filter, Sort sort, + List contentFields, boolean latest, + int limit) { + + return OVERALL_STATISTICS_FETCHER.apply(dsl.with(LAUNCHES) + .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(filter, sort, latest).with(sort) + .with(limit).build()) + .select(STATISTICS_FIELD.NAME, sum(STATISTICS.S_COUNTER).as(SUM)) + .from(LAUNCH) + .join(LAUNCHES) + .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .leftJoin(STATISTICS) + .on(LAUNCH.ID.eq(STATISTICS.LAUNCH_ID)) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .where(STATISTICS_FIELD.NAME.in(contentFields)) + .groupBy(STATISTICS_FIELD.NAME) + .fetch()); + } + + /** + * Returns condition for step level test item types. Include before/after methods and classes + * types depends on {@code includeMethods} param. + * + * @param includeMethods + * @return {@link Condition} + */ + private Condition itemTypeStepCondition(boolean includeMethods) { + List itemTypes = Lists.newArrayList(JTestItemTypeEnum.STEP); + if (includeMethods) { + itemTypes.addAll(HAS_METHOD_OR_CLASS); + } + return TEST_ITEM.TYPE.in(itemTypes); + } + + @Override + public List topItemsByCriteria(Filter filter, String criteria, int limit, + boolean includeMethods) { + Table> criteriaTable = getTopItemsCriteriaTable(filter, criteria, + limit, includeMethods); + + return CRITERIA_HISTORY_ITEM_FETCHER.apply(dsl.select(TEST_ITEM.UNIQUE_ID, + TEST_ITEM.NAME, + DSL.arrayAgg( + when(fieldName(criteriaTable.getName(), CRITERIA_FLAG).cast(Integer.class).ge(1), + true).otherwise(false)) + .orderBy(LAUNCH.NUMBER.asc()) + .as(STATUS_HISTORY), + DSL.max(TEST_ITEM.START_TIME).filterWhere( + fieldName(criteriaTable.getName(), CRITERIA_FLAG).cast(Integer.class).ge(1)) + .as(START_TIME_HISTORY), + DSL.sum(fieldName(criteriaTable.getName(), CRITERIA_FLAG).cast(Integer.class)).as(CRITERIA), + DSL.count(TEST_ITEM.ITEM_ID).as(TOTAL) + ) + .from(TEST_ITEM) + .join(criteriaTable) + .on(TEST_ITEM.ITEM_ID.eq(fieldName(criteriaTable.getName(), ITEM_ID).cast(Long.class))) + .join(LAUNCH) + .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) + .groupBy(TEST_ITEM.UNIQUE_ID, TEST_ITEM.NAME) + .having(DSL.sum(fieldName(criteriaTable.getName(), CRITERIA_FLAG).cast(Integer.class)) + .greaterThan(BigDecimal.ZERO)) + .orderBy(DSL.field(DSL.name(CRITERIA)).desc(), DSL.field(DSL.name(TOTAL)).asc()) + .limit(MOST_FAILED_CRITERIA_LIMIT) + .fetch()); + } + + private Table> getTopItemsCriteriaTable(Filter filter, String criteria, + int limit, boolean includeMethods) { + Sort launchSort = Sort.by(Sort.Direction.DESC, CRITERIA_START_TIME); + Table launchesTable = QueryBuilder.newBuilder(filter, + collectJoinFields(filter, launchSort)) + .with(limit) + .with(launchSort) + .build() + .asTable(LAUNCHES); + + return getCommonMostFailedQuery(criteria, launchesTable).where( + itemTypeStepCondition(includeMethods)) + .and(TEST_ITEM.HAS_STATS.eq(Boolean.TRUE)) + .and(TEST_ITEM.HAS_CHILDREN.eq(false)) + .groupBy(TEST_ITEM.ITEM_ID) + .asTable(CRITERIA_TABLE); + } + + private SelectOnConditionStep> getCommonMostFailedQuery(String criteria, + Table launchesTable) { + if (StringUtils.endsWithAny(criteria, + StatusEnum.FAILED.getExecutionCounterField(), + StatusEnum.SKIPPED.getExecutionCounterField() + )) { + StatusEnum status = StatusEnum.fromValue( + StringUtils.substringAfterLast(criteria, STATISTICS_SEPARATOR)) + .orElseThrow(() -> new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR)); + return statusCriteriaTable(JStatusEnum.valueOf(status.name()), launchesTable); + } else { + return statisticsCriteriaTable(criteria, launchesTable); + } + } + + private SelectOnConditionStep> statisticsCriteriaTable(String criteria, + Table launchesTable) { + return dsl.select(TEST_ITEM.ITEM_ID, + sum(when(STATISTICS_FIELD.NAME.eq(criteria), 1).otherwise(ZERO_QUERY_VALUE)).as( + CRITERIA_FLAG)) + .from(TEST_ITEM) + .join(launchesTable) + .on(TEST_ITEM.LAUNCH_ID.eq(fieldName(launchesTable.getName(), ID).cast(Long.class))) + .join(STATISTICS) + .on(TEST_ITEM.ITEM_ID.eq(STATISTICS.ITEM_ID)) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)); + } + + private SelectOnConditionStep> statusCriteriaTable(JStatusEnum criteria, + Table launchesTable) { + return dsl.select(TEST_ITEM.ITEM_ID, + sum(when(TEST_ITEM_RESULTS.STATUS.eq(criteria), 1).otherwise(ZERO_QUERY_VALUE)).as( + CRITERIA_FLAG) + ) + .from(TEST_ITEM) + .join(launchesTable) + .on(TEST_ITEM.LAUNCH_ID.eq(fieldName(launchesTable.getName(), ID).cast(Long.class))) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)); + } + + @Override + public List flakyCasesStatistics(Filter filter, boolean includeMethods, + int limit) { + + return FLAKY_CASES_TABLE_FETCHER.apply( + dsl.select(field(name(FLAKY_TABLE_RESULTS, TEST_ITEM.UNIQUE_ID.getName())).as(UNIQUE_ID), + field(name(FLAKY_TABLE_RESULTS, TEST_ITEM.NAME.getName())).as(ITEM_NAME), + DSL.arrayAgg(field(name(FLAKY_TABLE_RESULTS, TEST_ITEM_RESULTS.STATUS.getName()))) + .as(STATUSES), + DSL.max(field(name(FLAKY_TABLE_RESULTS, START_TIME))) + .filterWhere(field(name(FLAKY_TABLE_RESULTS, SWITCH_FLAG)).cast(Integer.class) + .gt(ZERO_QUERY_VALUE)) + .as(START_TIME_HISTORY), + sum(field(name(FLAKY_TABLE_RESULTS, SWITCH_FLAG)).cast(Long.class)).as(FLAKY_COUNT), + count(field(name(FLAKY_TABLE_RESULTS, ITEM_ID))).minus(1).as(TOTAL) + ) + .from(dsl.with(LAUNCHES) + .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, Sort.unsorted())) + .with(LAUNCH.NUMBER, SortOrder.DESC) + .with(limit) + .build()) + .select(TEST_ITEM.ITEM_ID, + TEST_ITEM.UNIQUE_ID, + TEST_ITEM.NAME, + TEST_ITEM.START_TIME, + TEST_ITEM_RESULTS.STATUS, + when(TEST_ITEM_RESULTS.STATUS.notEqual( + lag(TEST_ITEM_RESULTS.STATUS).over(orderBy(TEST_ITEM.UNIQUE_ID, + TEST_ITEM.START_TIME + ))) + .and(TEST_ITEM.UNIQUE_ID.equal( + lag(TEST_ITEM.UNIQUE_ID).over(orderBy(TEST_ITEM.UNIQUE_ID, + TEST_ITEM.START_TIME + )))), 1).otherwise(ZERO_QUERY_VALUE).as(SWITCH_FLAG) + ) + .from(LAUNCH) + .join(LAUNCHES) + .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .join(TEST_ITEM) + .on(LAUNCH.ID.eq(TEST_ITEM.LAUNCH_ID)) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .where(itemTypeStepCondition(includeMethods)) + .and(TEST_ITEM.HAS_STATS.eq(Boolean.TRUE)) + .and(TEST_ITEM.HAS_CHILDREN.eq(false)) + .and(TEST_ITEM.RETRY_OF.isNull()) + .groupBy(TEST_ITEM.ITEM_ID, TEST_ITEM_RESULTS.STATUS, TEST_ITEM.UNIQUE_ID, + TEST_ITEM.NAME, TEST_ITEM.START_TIME) + .orderBy(TEST_ITEM.UNIQUE_ID, TEST_ITEM.START_TIME.desc()) + .asTable(FLAKY_TABLE_RESULTS)) + .groupBy(field(name(FLAKY_TABLE_RESULTS, TEST_ITEM.UNIQUE_ID.getName())), + field(name(FLAKY_TABLE_RESULTS, TEST_ITEM.NAME.getName())) + ) + .having(count(field(name(FLAKY_TABLE_RESULTS, ITEM_ID))).gt(BigDecimal.ONE.intValue()) + .and(sum(field(name(FLAKY_TABLE_RESULTS, SWITCH_FLAG)).cast(Long.class)).gt( + BigDecimal.ZERO))) + .orderBy(fieldName(FLAKY_COUNT).desc(), fieldName(TOTAL).asc(), fieldName(UNIQUE_ID)) + .limit(FLAKY_CASES_LIMIT) + .fetch()); + } + + @Override + public List launchStatistics(Filter filter, List contentFields, + Sort sort, int limit) { + + List> groupingFields = Lists.newArrayList(field(LAUNCH.ID), + field(LAUNCH.NUMBER), + field(LAUNCH.START_TIME), + field(LAUNCH.NAME), + fieldName(STATISTICS_TABLE, SF_NAME), + fieldName(STATISTICS_TABLE, STATISTICS_COUNTER) + ); + + groupingFields.addAll( + WidgetSortUtils.fieldTransformer(filter.getTarget()).apply(sort, LAUNCHES)); + + return LAUNCHES_STATISTICS_FETCHER.apply(dsl.with(LAUNCHES) + .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit) + .build()) + .select(LAUNCH.ID, + LAUNCH.NUMBER, + LAUNCH.START_TIME, + LAUNCH.NAME, + fieldName(STATISTICS_TABLE, SF_NAME), + fieldName(STATISTICS_TABLE, STATISTICS_COUNTER) + ) + .from(LAUNCH) + .join(LAUNCHES) + .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), + STATISTICS_FIELD.NAME.as(SF_NAME)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .where(STATISTICS_FIELD.NAME.in(contentFields)) + .asTable(STATISTICS_TABLE)) + .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) + .groupBy(groupingFields) + .orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)) + .fetch()); + } + + @Override + public List investigatedStatistics(Filter filter, Sort sort, int limit) { + + List> groupingFields = Lists.newArrayList(field(LAUNCH.ID), + field(LAUNCH.NUMBER), + field(LAUNCH.START_TIME), + field(LAUNCH.NAME) + ); + + groupingFields.addAll( + WidgetSortUtils.fieldTransformer(filter.getTarget()).apply(sort, LAUNCHES)); + + return INVESTIGATED_STATISTICS_FETCHER.apply(dsl.with(LAUNCHES) + .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit) + .build()) + .select(LAUNCH.ID, + LAUNCH.NUMBER, + LAUNCH.START_TIME, + LAUNCH.NAME, + round(val(PERCENTAGE_MULTIPLIER).mul(dsl.select(sum(STATISTICS.S_COUNTER)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .onKey() + .where(STATISTICS_FIELD.NAME.eq(DEFECTS_TO_INVESTIGATE_TOTAL) + .and(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID))) + .asField() + .cast(Double.class)) + .div(nullif(dsl.select(sum(STATISTICS.S_COUNTER)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .onKey() + .where(STATISTICS_FIELD.NAME.in(DEFECTS_AUTOMATION_BUG_TOTAL, + DEFECTS_NO_DEFECT_TOTAL, + DEFECTS_TO_INVESTIGATE_TOTAL, + DEFECTS_PRODUCT_BUG_TOTAL, + DEFECTS_SYSTEM_ISSUE_TOTAL + ).and(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID))) + .asField(), 0)), 2).as(TO_INVESTIGATE) + ) + .from(LAUNCH) + .join(LAUNCHES) + .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), + STATISTICS_FIELD.NAME.as(SF_NAME)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .asTable(STATISTICS_TABLE)) + .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) + .groupBy(groupingFields) + .orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)) + .fetch()); + + } + + @Override + public List timelineInvestigatedStatistics(Filter filter, Sort sort, + int limit) { + + List> groupingFields = Lists.newArrayList(field(LAUNCH.ID), + field(LAUNCH.NUMBER), + field(LAUNCH.START_TIME), + field(LAUNCH.NAME) + ); + + groupingFields.addAll( + WidgetSortUtils.fieldTransformer(filter.getTarget()).apply(sort, LAUNCHES)); + + return dsl.with(LAUNCHES) + .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit) + .build()) + .select(LAUNCH.ID, + LAUNCH.NUMBER, + LAUNCH.START_TIME, + LAUNCH.NAME, + coalesce(DSL.select(sum(STATISTICS.S_COUNTER)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .onKey() + .where(STATISTICS_FIELD.NAME.eq(DEFECTS_TO_INVESTIGATE_TOTAL) + .and(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID))) + .asField() + .cast(Double.class), 0).as(TO_INVESTIGATE), + coalesce(DSL.select(sum(STATISTICS.S_COUNTER)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .onKey() + .where(STATISTICS_FIELD.NAME.in(DEFECTS_AUTOMATION_BUG_TOTAL, + DEFECTS_NO_DEFECT_TOTAL, + DEFECTS_TO_INVESTIGATE_TOTAL, + DEFECTS_PRODUCT_BUG_TOTAL, + DEFECTS_SYSTEM_ISSUE_TOTAL + ).and(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID))) + .asField(), 0).as(INVESTIGATED) + ) + .from(LAUNCH) + .join(LAUNCHES) + .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .groupBy(groupingFields) + .orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)) + .fetch(TIMELINE_INVESTIGATED_STATISTICS_RECORD_MAPPER); + } + + @Override + public PassingRateStatisticsResult passingRatePerLaunchStatistics(Long launchId) { + + return dsl.select(LAUNCH.ID, + LAUNCH.NUMBER.as(NUMBER), + sum(when(STATISTICS_FIELD.NAME.eq(EXECUTIONS_PASSED), STATISTICS.S_COUNTER).otherwise( + 0)).as(PASSED), + sum(when(STATISTICS_FIELD.NAME.eq(EXECUTIONS_TOTAL), STATISTICS.S_COUNTER).otherwise(0)).as( + TOTAL), + sum(when(STATISTICS_FIELD.NAME.eq(EXECUTIONS_SKIPPED), STATISTICS.S_COUNTER).otherwise( + 0)).as(SKIPPED) + ) + .from(LAUNCH) + .leftJoin(STATISTICS) + .on(LAUNCH.ID.eq(STATISTICS.LAUNCH_ID)) + .leftJoin(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .and(STATISTICS_FIELD.NAME.in(EXECUTIONS_PASSED, EXECUTIONS_TOTAL, EXECUTIONS_SKIPPED)) + .where(LAUNCH.ID.eq(launchId)) + .groupBy(LAUNCH.ID) + .fetchOneInto(PassingRateStatisticsResult.class); + } + + @Override + public PassingRateStatisticsResult summaryPassingRateStatistics(Filter filter, Sort sort, + int limit) { + return buildPassingRateSelect(filter, sort, limit).fetchInto(PassingRateStatisticsResult.class) + .stream() + .findFirst() + .orElseThrow(() -> new ReportPortalException("No results for filter were found")); + } + + @Override + public List casesTrendStatistics(Filter filter, String contentField, + Sort sort, int limit) { + + List> groupingFields = Lists.newArrayList(field(LAUNCH.ID), + field(LAUNCH.NUMBER), + field(LAUNCH.START_TIME), + field(LAUNCH.NAME), + fieldName(STATISTICS_TABLE, STATISTICS_COUNTER) + ); + + groupingFields.addAll( + WidgetSortUtils.fieldTransformer(filter.getTarget()).apply(sort, LAUNCHES)); + + return CASES_GROWTH_TREND_FETCHER.apply(dsl.with(LAUNCHES) + .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit) + .build()) + .select(LAUNCH.ID, + LAUNCH.NUMBER, + LAUNCH.START_TIME, + LAUNCH.NAME, + fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), + coalesce( + fieldName(STATISTICS_TABLE, STATISTICS_COUNTER).sub(lag(fieldName(STATISTICS_TABLE, + STATISTICS_COUNTER + )).over().orderBy(LAUNCH.START_TIME.asc())), 0).as(DELTA) + ) + .from(LAUNCH) + .join(LAUNCHES) + .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), + STATISTICS_FIELD.NAME.as(SF_NAME)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .where(STATISTICS_FIELD.NAME.eq(contentField)) + .asTable(STATISTICS_TABLE)) + .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) + .groupBy(groupingFields) + .orderBy(LAUNCH.START_TIME.asc()) + .fetch(), contentField); + } + + @Override + public List bugTrendStatistics(Filter filter, List contentFields, + Sort sort, int limit) { + + return BUG_TREND_STATISTICS_FETCHER.apply(dsl.with(LAUNCHES) + .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit) + .build()) + .select(LAUNCH.ID, + LAUNCH.NAME, + LAUNCH.NUMBER, + LAUNCH.START_TIME, + fieldName(STATISTICS_TABLE, SF_NAME), + fieldName(STATISTICS_TABLE, STATISTICS_COUNTER) + ) + .from(LAUNCH) + .join(LAUNCHES) + .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), + STATISTICS_FIELD.NAME.as(SF_NAME)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .where(STATISTICS_FIELD.NAME.in(contentFields)) + .asTable(STATISTICS_TABLE)) + .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) + .orderBy(LAUNCH.START_TIME.asc()) + .fetch()); + + } + + @Override + public List launchesComparisonStatistics(Filter filter, + List contentFields, Sort sort, int limit) { + + List executionStatisticsFields = contentFields.stream() + .filter(cf -> cf.contains(EXECUTIONS_KEY)).collect(toList()); + List defectStatisticsFields = contentFields.stream() + .filter(cf -> cf.contains(DEFECTS_KEY)).collect(toList()); + + return LAUNCHES_STATISTICS_FETCHER.apply(dsl.with(LAUNCHES) + .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit) + .build()) + .select(LAUNCH.ID, + LAUNCH.NAME, + LAUNCH.NUMBER, + LAUNCH.START_TIME, + field(name(STATISTICS_TABLE, SF_NAME), String.class), + when(field(name(STATISTICS_TABLE, SF_NAME)).equalIgnoreCase(EXECUTIONS_TOTAL), + field(name(STATISTICS_TABLE, STATISTICS_COUNTER)).cast(Double.class) + ).otherwise(round(val(PERCENTAGE_MULTIPLIER).mul( + field(name(STATISTICS_TABLE, STATISTICS_COUNTER), Integer.class)) + .div(nullif(DSL.select(DSL.sum(STATISTICS.S_COUNTER)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .where(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID)) + .and(STATISTICS_FIELD.NAME.in(executionStatisticsFields) + .and(STATISTICS_FIELD.NAME.notEqual(EXECUTIONS_TOTAL))), 0).cast( + Double.class)), 2)) + .as(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER)) + ) + .from(LAUNCH) + .join(LAUNCHES) + .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), + STATISTICS_FIELD.NAME.as(SF_NAME)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .where(STATISTICS_FIELD.NAME.in(executionStatisticsFields)) + .asTable(STATISTICS_TABLE)) + .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) + .orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)) + .unionAll(DSL.select(LAUNCH.ID, + LAUNCH.NAME, + LAUNCH.NUMBER, + LAUNCH.START_TIME, + field(name(STATISTICS_TABLE, SF_NAME), String.class), + round(val(PERCENTAGE_MULTIPLIER).mul( + field(name(STATISTICS_TABLE, STATISTICS_COUNTER), Integer.class)) + .div(nullif(DSL.select(DSL.sum(STATISTICS.S_COUNTER)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .where(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID)) + .and(STATISTICS_FIELD.NAME.in(defectStatisticsFields)), 0).cast(Double.class)), + 2) + ) + .from(LAUNCH) + .join(LAUNCHES) + .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, + STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), + STATISTICS_FIELD.NAME.as(SF_NAME) + ) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .where(STATISTICS_FIELD.NAME.in(defectStatisticsFields)) + .asTable(STATISTICS_TABLE)) + .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) + .orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES))) + .fetch()); + + } + + @Override + public List launchesDurationStatistics(Filter filter, Sort sort, + boolean isLatest, int limit) { + + return dsl.with(LAUNCHES) + .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(filter, sort, isLatest).with(sort) + .with(limit).build()) + .select(LAUNCH.ID, + LAUNCH.NAME, + LAUNCH.NUMBER, + LAUNCH.STATUS, + LAUNCH.START_TIME, + LAUNCH.END_TIME, + timestampDiff(LAUNCH.END_TIME, LAUNCH.START_TIME).as(DURATION) + ) + .from(LAUNCH) + .join(LAUNCHES) + .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)) + .fetchInto(LaunchesDurationContent.class); + } + + @Override + public List notPassedCasesStatistics(Filter filter, Sort sort, int limit) { + + return dsl.with(LAUNCHES) + .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit) + .build()) + .select(LAUNCH.ID, + LAUNCH.NAME, + LAUNCH.NUMBER, + LAUNCH.START_TIME, + fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), + coalesce(round(val(PERCENTAGE_MULTIPLIER).mul(DSL.select(DSL.sum(STATISTICS.S_COUNTER)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .where(STATISTICS_FIELD.NAME.in(EXECUTIONS_SKIPPED, EXECUTIONS_FAILED)) + .and(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID)) + .asField() + .cast(Double.class)) + .div(nullif(field(name(STATISTICS_TABLE, STATISTICS_COUNTER), Integer.class), + 0).cast(Double.class)), 2), 0) + .as(PERCENTAGE) + ) + .from(LAUNCH) + .join(LAUNCHES) + .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), + STATISTICS_FIELD.NAME.as(SF_NAME)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .where(STATISTICS_FIELD.NAME.eq(EXECUTIONS_TOTAL)) + .asTable(STATISTICS_TABLE)) + .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) + .orderBy(LAUNCH.START_TIME.asc()) + .fetch(NOT_PASSED_CASES_CONTENT_RECORD_MAPPER); + } + + @Override + public List launchesTableStatistics(Filter filter, + List contentFields, Sort sort, int limit) { + + Map criteria = filter.getTarget() + .getCriteriaHolders() + .stream() + .collect( + Collectors.toMap(CriteriaHolder::getFilterCriteria, CriteriaHolder::getQueryCriteria)); + + boolean isAttributePresent = contentFields.remove("attributes"); + + List> selectFields = contentFields.stream() + .filter(cf -> !cf.startsWith(STATISTICS_KEY)) + .map(cf -> field(ofNullable(criteria.get(cf)).orElseThrow( + () -> new ReportPortalException(Suppliers.formattedSupplier( + "Unknown table field - '{}'", + cf + ).get())))) + .collect(Collectors.toList()); + + Collections.addAll(selectFields, LAUNCH.ID, fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), + fieldName(STATISTICS_TABLE, SF_NAME)); + + if (isAttributePresent) { + Collections.addAll(selectFields, ITEM_ATTRIBUTE.ID.as(ATTR_ID), ITEM_ATTRIBUTE.KEY, + ITEM_ATTRIBUTE.VALUE); + } + + List statisticsFields = contentFields.stream() + .filter(cf -> cf.startsWith(STATISTICS_KEY)).collect(toList()); + + return LAUNCHES_TABLE_FETCHER.apply( + buildLaunchesTableQuery(selectFields, statisticsFields, filter, sort, limit, + isAttributePresent) + .fetch(), contentFields); + + } + + @Override + public List activityStatistics(Filter filter, Sort sort, int limit) { + + return dsl.with(ACTIVITIES) + .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit) + .build()) + .select(ACTIVITY.ID, + ACTIVITY.ACTION, + ACTIVITY.ENTITY, + ACTIVITY.CREATION_DATE, + ACTIVITY.DETAILS, + ACTIVITY.PROJECT_ID, + ACTIVITY.OBJECT_ID, + USERS.LOGIN, + PROJECT.NAME + ) + .from(ACTIVITY) + .join(ACTIVITIES) + .on(fieldName(ACTIVITIES, ID).cast(Long.class).eq(ACTIVITY.ID)) + .join(USERS) + .on(ACTIVITY.USER_ID.eq(USERS.ID)) + .join(PROJECT) + .on(ACTIVITY.PROJECT_ID.eq(PROJECT.ID)) + .orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, ACTIVITIES)) + .fetch() + .map(ACTIVITY_MAPPER); + + } + + @Override + public Map uniqueBugStatistics(Filter filter, Sort sort, + boolean isLatest, int limit) { + + Map content = UNIQUE_BUG_CONTENT_FETCHER.apply(dsl.with(LAUNCHES) + .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(filter, sort, isLatest) + .with(limit).with(sort).build()) + .select(TICKET.TICKET_ID, + TICKET.SUBMIT_DATE, + TICKET.URL, + TICKET.SUBMITTER, + TEST_ITEM.ITEM_ID, + TEST_ITEM.NAME, + TEST_ITEM.PATH, + TEST_ITEM.LAUNCH_ID, + fieldName(ITEM_ATTRIBUTES, KEY), + fieldName(ITEM_ATTRIBUTES, VALUE) + ) + .from(TEST_ITEM) + .join(LAUNCHES) + .on(fieldName(LAUNCHES, ID).cast(Long.class).eq(TEST_ITEM.LAUNCH_ID)) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .leftJoin(ISSUE) + .on(TEST_ITEM.ITEM_ID.eq(ISSUE.ISSUE_ID)) + .leftJoin(ISSUE_TICKET) + .on(ISSUE.ISSUE_ID.eq(ISSUE_TICKET.ISSUE_ID)) + .join(TICKET) + .on(ISSUE_TICKET.TICKET_ID.eq(TICKET.ID)) + .leftJoin( + lateral(dsl.select(ITEM_ATTRIBUTE.ITEM_ID, ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE) + .from(ITEM_ATTRIBUTE) + .where( + ITEM_ATTRIBUTE.ITEM_ID.eq(TEST_ITEM.ITEM_ID).andNot(ITEM_ATTRIBUTE.SYSTEM))).as( + ITEM_ATTRIBUTES)) + .on(TEST_ITEM.ITEM_ID.eq(fieldName(ITEM_ATTRIBUTES, ITEM_ID).cast(Long.class))) + .orderBy(TICKET.SUBMIT_DATE.desc()) + .fetch()); + + return content; + } + + @Override + public Map> productStatusGroupedByFilterStatistics( + Map filterSortMapping, + List contentFields, Map customColumns, boolean isLatest, int limit) { + + Select select = filterSortMapping.entrySet() + .stream() + .map(f -> (Select) buildFilterGroupedQuery(f.getKey(), + isLatest, + f.getValue(), + limit, + contentFields, + customColumns + )) + .collect(Collectors.toList()) + .stream() + .reduce((prev, curr) -> curr = prev.unionAll(curr)) + .orElseThrow(() -> new ReportPortalException(ErrorType.BAD_REQUEST_ERROR, + "Query building for Product Status Widget failed" + )); + + Map> productStatusContent = PRODUCT_STATUS_FILTER_GROUPED_FETCHER.apply( + select.fetch(), + customColumns + ); + + productStatusContent.put(TOTAL, countFilterTotalStatistics(productStatusContent)); + + return productStatusContent; + } + + @Override + public List productStatusGroupedByLaunchesStatistics( + Filter filter, List contentFields, + Map customColumns, Sort sort, boolean isLatest, int limit) { + + List> selectFields = getCommonProductStatusFields(filter, contentFields); + + List productStatusStatisticsResult = PRODUCT_STATUS_LAUNCH_GROUPED_FETCHER.apply( + buildProductStatusQuery(filter, + isLatest, + sort, + limit, + selectFields, + contentFields, + customColumns + ).orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)) + .fetch(), + customColumns + ); + + if (!productStatusStatisticsResult.isEmpty()) { + productStatusStatisticsResult.add(countLaunchTotalStatistics(productStatusStatisticsResult)); + } + return productStatusStatisticsResult; + } + + @Override + public List mostTimeConsumingTestCasesStatistics(Filter filter, + int limit) { + final Set fields = collectJoinFields(filter); + fields.add(CRITERIA_DURATION); + final SelectQuery filteringQuery = QueryBuilder.newBuilder(filter, fields) + .with(limit) + .build(); + filteringQuery.addOrderBy(max(TEST_ITEM_RESULTS.DURATION).desc()); + return dsl.with(ITEMS) + .as(filteringQuery) + .select(TEST_ITEM.ITEM_ID.as(ID), + TEST_ITEM.UNIQUE_ID, + TEST_ITEM.NAME, + TEST_ITEM.TYPE, + TEST_ITEM.PATH, + TEST_ITEM.START_TIME, + TEST_ITEM_RESULTS.END_TIME, + TEST_ITEM_RESULTS.DURATION, + TEST_ITEM_RESULTS.STATUS + ) + .from(TEST_ITEM) + .join(ITEMS) + .on(fieldName(ITEMS, ID).cast(Long.class).eq(TEST_ITEM.ITEM_ID)) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .orderBy(fieldName(TEST_ITEM_RESULTS.DURATION).desc()) + .fetchInto(MostTimeConsumingTestCasesContent.class); + } + + @Override + public List patternTemplate(Filter filter, Sort sort, + @Nullable String attributeKey, + @Nullable String patternName, boolean isLatest, int launchesLimit, int attributesLimit) { + + Condition attributeKeyCondition = ofNullable(attributeKey).map(ITEM_ATTRIBUTE.KEY::eq) + .orElseGet(DSL::noCondition); + Field launchIdsField = isLatest ? DSL.max(LAUNCH.ID).as(ID) : DSL.arrayAgg(LAUNCH.ID).as(ID); + List> groupingFields = isLatest ? + Lists.newArrayList(LAUNCH.NAME, ITEM_ATTRIBUTE.VALUE) : + Lists.newArrayList(ITEM_ATTRIBUTE.VALUE); + + Map> attributeIdsMapping = PATTERN_TEMPLATES_AGGREGATION_FETCHER.apply( + dsl.with(LAUNCHES) + .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort) + .with(launchesLimit).build()) + .select(launchIdsField, ITEM_ATTRIBUTE.VALUE) + .from(LAUNCH) + .join(LAUNCHES) + .on(fieldName(LAUNCHES, ID).cast(Long.class).eq(LAUNCH.ID)) + .join(ITEM_ATTRIBUTE) + .on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)) + .where(attributeKeyCondition) + .and(ITEM_ATTRIBUTE.VALUE.in(dsl.select(ITEM_ATTRIBUTE.VALUE) + .from(ITEM_ATTRIBUTE) + .join(LAUNCHES) + .on(fieldName(LAUNCHES, ID).cast(Long.class).eq(ITEM_ATTRIBUTE.LAUNCH_ID)) + .where(attributeKeyCondition) + .groupBy(ITEM_ATTRIBUTE.VALUE) + .orderBy(DSL.when(ITEM_ATTRIBUTE.VALUE.likeRegex(VERSION_PATTERN), + PostgresDSL.stringToArray(ITEM_ATTRIBUTE.VALUE, VERSION_DELIMITER) + .cast(Integer[].class) + ).desc(), ITEM_ATTRIBUTE.VALUE.sort(SortOrder.DESC)) + .limit(attributesLimit))) + .groupBy(groupingFields) + .orderBy(DSL.when(ITEM_ATTRIBUTE.VALUE.likeRegex(VERSION_PATTERN), + PostgresDSL.stringToArray(ITEM_ATTRIBUTE.VALUE, VERSION_DELIMITER) + .cast(Integer[].class) + ).desc(), ITEM_ATTRIBUTE.VALUE.sort(SortOrder.DESC)) + .fetch(), isLatest); + + return StringUtils.isBlank(patternName) ? + buildPatternTemplatesQuery(attributeIdsMapping) : + buildPatternTemplatesQueryGroupedByPattern(attributeIdsMapping, patternName); + + } + + @Override + public List componentHealthCheck(Filter launchFilter, + Sort launchSort, boolean isLatest, int launchesLimit, + Filter testItemFilter, String currentLevelKey) { + + Table launchesTable = QueryUtils.createQueryBuilderWithLatestLaunchesOption( + launchFilter, launchSort, isLatest) + .with(launchesLimit) + .with(launchSort) + .build() + .asTable(LAUNCHES); + + return COMPONENT_HEALTH_CHECK_FETCHER.apply(dsl.select(fieldName(ITEMS, VALUE), + DSL.count(fieldName(ITEMS, ITEM_ID)).as(TOTAL), + DSL.round(DSL.val(PERCENTAGE_MULTIPLIER) + .mul(DSL.count(fieldName(ITEMS, ITEM_ID)) + .filterWhere( + fieldName(ITEMS, STATUS).cast(JStatusEnum.class).eq(JStatusEnum.PASSED))) + .div(DSL.nullif(DSL.count(fieldName(ITEMS, ITEM_ID)), 0)), 2).as(PASSING_RATE) + ) + .from(dsl.with(ITEMS) + .as(QueryBuilder.newBuilder(testItemFilter, collectJoinFields(testItemFilter)) + .addJointToStart(launchesTable, + JoinType.JOIN, + TEST_ITEM.LAUNCH_ID.eq(fieldName(launchesTable.getName(), ID).cast(Long.class)) + ) + .build()) + .select(TEST_ITEM.ITEM_ID, TEST_ITEM_RESULTS.STATUS, ITEM_ATTRIBUTE.KEY, + ITEM_ATTRIBUTE.VALUE) + .from(TEST_ITEM) + .join(ITEMS) + .on(TEST_ITEM.ITEM_ID.eq(fieldName(ITEMS, ID).cast(Long.class))) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(ITEM_ATTRIBUTE) + .on((TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID) + .or(TEST_ITEM.LAUNCH_ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID))).and( + ITEM_ATTRIBUTE.KEY.eq(currentLevelKey).and(ITEM_ATTRIBUTE.SYSTEM.isFalse()))) + .groupBy(TEST_ITEM.ITEM_ID, TEST_ITEM_RESULTS.STATUS, ITEM_ATTRIBUTE.KEY, + ITEM_ATTRIBUTE.VALUE) + .asTable(ITEMS)) + .groupBy(fieldName(ITEMS, VALUE)) + .orderBy(DSL.round(DSL.val(PERCENTAGE_MULTIPLIER) + .mul(DSL.count(fieldName(ITEMS, ITEM_ID)) + .filterWhere( + fieldName(ITEMS, STATUS).cast(JStatusEnum.class).eq(JStatusEnum.PASSED))) + .div(DSL.nullif(DSL.count(fieldName(ITEMS, ITEM_ID)), 0)), 2)) + .fetch()); + } + + @Override + public void generateCumulativeTrendChartView(boolean refresh, String viewName, + Filter launchFilter, Sort launchesSort, + List attributes, int launchesLimit) { + + if (refresh) { + removeWidgetView(viewName); + } + + final String FIRST_LEVEL = "first_level"; + + final SelectJoinStep> FIRST_LEVEL_TABLE = dsl.with( + FIRST_LEVEL) + .as(dsl.with(LAUNCHES) + .as(QueryBuilder.newBuilder(launchFilter, collectJoinFields(launchFilter)) + .with(launchesSort) + .with(launchesLimit) + .build()) + .select(max(LAUNCH.ID).as(ID), + LAUNCH.NAME, + arrayAggDistinct(LAUNCH.ID).as(AGGREGATED_LAUNCHES_IDS), + ITEM_ATTRIBUTE.KEY.as(ATTRIBUTE_KEY), + ITEM_ATTRIBUTE.VALUE.as(ATTRIBUTE_VALUE) + ) + .from(LAUNCH) + .join(LAUNCHES) + .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .join(ITEM_ATTRIBUTE) + .on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)) + .and(ITEM_ATTRIBUTE.KEY.eq(attributes.get(0)).and(ITEM_ATTRIBUTE.SYSTEM.isFalse())) + .groupBy(LAUNCH.NAME, ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE)) + .select(fieldName(FIRST_LEVEL, ID).cast(Long.class).as(ID), + fieldName(FIRST_LEVEL, NAME).cast(String.class).as(NAME), + val(null, fieldName(FIRST_LEVEL, ID).cast(Long.class)).as(FIRST_LEVEL_ID), + fieldName(FIRST_LEVEL, ATTRIBUTE_KEY).cast(String.class).as(ATTRIBUTE_KEY), + fieldName(FIRST_LEVEL, ATTRIBUTE_VALUE).cast(String.class).as(ATTRIBUTE_VALUE) + ) + .from(FIRST_LEVEL); + + SelectQuery> query; + + if (attributes.size() == 2 && attributes.get(1) != null) { + final SelectHavingStep> SECOND_LEVEL_TABLE = dsl.select( + max(LAUNCH.ID).as(ID), + LAUNCH.NAME, + max(fieldName(FIRST_LEVEL, ID)).cast(Long.class).as(FIRST_LEVEL_ID), + ITEM_ATTRIBUTE.KEY.as(ATTRIBUTE_KEY), + ITEM_ATTRIBUTE.VALUE.as(ATTRIBUTE_VALUE) + ) + .from(FIRST_LEVEL) + .join(LAUNCH) + .on(Suppliers.formattedSupplier("{} = any({})", LAUNCH.ID, AGGREGATED_LAUNCHES_IDS).get()) + .join(ITEM_ATTRIBUTE) + .on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)) + .and(ITEM_ATTRIBUTE.KEY.eq(attributes.get(1)).and(ITEM_ATTRIBUTE.SYSTEM.isFalse())) + .groupBy(LAUNCH.NAME, + fieldName(FIRST_LEVEL, ATTRIBUTE_KEY), + fieldName(FIRST_LEVEL, ATTRIBUTE_VALUE), + ITEM_ATTRIBUTE.KEY, + ITEM_ATTRIBUTE.VALUE + ); + query = FIRST_LEVEL_TABLE.union(SECOND_LEVEL_TABLE).getQuery(); + } else { + query = FIRST_LEVEL_TABLE.getQuery(); + } + dsl.execute(DSL.sql(String.format("CREATE MATERIALIZED VIEW %s AS (%s)", DSL.name(viewName), + query.toString()))); + } + + @Override + public List cumulativeTrendChart(String viewName, + String levelAttributeKey, @Nullable String subAttributeKey, + @Nullable String parentAttribute) { + final SelectOnConditionStep baseQuery = dsl.select( + DSL.arrayAgg(fieldName(viewName, ID)).as(LAUNCHES), + fieldName(viewName, ATTRIBUTE_VALUE), + STATISTICS_FIELD.NAME, + sum(STATISTICS.S_COUNTER).as(STATISTICS_COUNTER) + ) + .from(viewName) + .join(STATISTICS) + .on(fieldName(viewName, ID).cast(Long.class).eq(STATISTICS.LAUNCH_ID)) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)); + + if (parentAttribute != null) { + String[] split = parentAttribute.split(KEY_VALUE_SEPARATOR); + + final SelectConditionStep> subLevelLaunches = selectDistinct( + fieldName(viewName, ID).cast(Long.class)).from( + viewName) + .where(fieldName(viewName, ATTRIBUTE_KEY).cast(String.class).eq(split[0])) + .and(fieldName(viewName, ATTRIBUTE_VALUE).cast(String.class).eq(split[1])); + baseQuery.where(fieldName(viewName, FIRST_LEVEL_ID).cast(Long.class).in(subLevelLaunches)); + } + + List accumulatedLaunches = CUMULATIVE_TREND_CHART_FETCHER.apply( + baseQuery.where(fieldName(ATTRIBUTE_KEY).cast( + String.class).eq(levelAttributeKey)) + .groupBy(fieldName(viewName, ATTRIBUTE_VALUE), STATISTICS_FIELD.NAME) + .orderBy(when(fieldName(viewName, ATTRIBUTE_VALUE).likeRegex(VERSION_PATTERN), + PostgresDSL.stringToArray(field(name(viewName, ATTRIBUTE_VALUE), String.class), + VERSION_DELIMITER) + .cast(Integer[].class) + ), fieldName(viewName, ATTRIBUTE_VALUE).sort(SortOrder.ASC)) + .fetch()); + + if (!StringUtils.isEmpty(subAttributeKey)) { + accumulatedLaunches.forEach( + attributeLaunches -> CUMULATIVE_TOOLTIP_FETCHER.accept(attributeLaunches, + dsl.selectDistinct(fieldName(viewName, ATTRIBUTE_KEY), + fieldName(viewName, ATTRIBUTE_VALUE)) + .from(viewName) + .where(fieldName(viewName, ATTRIBUTE_KEY).cast(String.class) + .eq(subAttributeKey) + .and(fieldName(viewName, ID).in( + attributeLaunches.getContent().getLaunchIds()))) + .fetch() + )); + } + return accumulatedLaunches; + } + + @Override + public List getCumulativeLevelRedirectLaunchIds(String viewName, String attributes) { + String[] attributeLevels = attributes.split(VALUES_SEPARATOR); + + SelectConditionStep> firstLevelCondition = dsl.select( + fieldName(viewName, ID).cast(Long.class)) + .from(viewName) + .where(concat(coalesce(fieldName(viewName, ATTRIBUTE_KEY), ""), + val(KEY_VALUE_SEPARATOR), + fieldName(viewName, ATTRIBUTE_VALUE) + ).eq(attributeLevels[0])); + + if (attributeLevels.length == 2) { + return dsl.select(fieldName(viewName, ID)) + .from(viewName) + .where(concat(coalesce(fieldName(viewName, ATTRIBUTE_KEY), ""), + val(KEY_VALUE_SEPARATOR), + fieldName(viewName, ATTRIBUTE_VALUE) + ).eq(attributeLevels[1])) + .and(fieldName(viewName, FIRST_LEVEL_ID).cast(Long.class).in(firstLevelCondition)) + .fetchInto(Long.class); + } + + return firstLevelCondition.fetchInto(Long.class); + } + + @Override + public void generateComponentHealthCheckTable(boolean refresh, HealthCheckTableInitParams params, + Filter launchFilter, Sort launchSort, + int launchesLimit, boolean isLatest) { + + if (refresh) { + removeWidgetView(params.getViewName()); + } + + Table launchesTable = QueryUtils.createQueryBuilderWithLatestLaunchesOption( + launchFilter, launchSort, isLatest) + .with(launchesLimit) + .with(launchSort) + .build() + .asTable(LAUNCHES); + + List> selectFields = Lists.newArrayList(TEST_ITEM.ITEM_ID, ITEM_ATTRIBUTE.KEY, + ITEM_ATTRIBUTE.VALUE); + + ofNullable(params.getCustomKey()).ifPresent( + key -> selectFields.add(DSL.arrayAggDistinct(fieldName(CUSTOM_ATTRIBUTE, VALUE)) + .filterWhere(fieldName(CUSTOM_ATTRIBUTE, VALUE).isNotNull()) + .as(CUSTOM_COLUMN))); + + SelectOnConditionStep baseQuery = select(selectFields).from(TEST_ITEM) + .join(launchesTable) + .on(TEST_ITEM.LAUNCH_ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(ITEM_ATTRIBUTE) + .on(and(TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID) + .or(TEST_ITEM.LAUNCH_ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID))).and( + ITEM_ATTRIBUTE.KEY.in(params.getAttributeKeys())).and(ITEM_ATTRIBUTE.SYSTEM.isFalse())); + + dsl.execute(DSL.sql(Suppliers.formattedSupplier("CREATE MATERIALIZED VIEW {} AS ({})", + DSL.name(params.getViewName()), + ofNullable(params.getCustomKey()).map(key -> { + JItemAttribute customAttribute = ITEM_ATTRIBUTE.as(CUSTOM_ATTRIBUTE); + return baseQuery.leftJoin(customAttribute) + .on(DSL.condition(Operator.OR, + TEST_ITEM.ITEM_ID.eq(customAttribute.ITEM_ID), + TEST_ITEM.LAUNCH_ID.eq(customAttribute.LAUNCH_ID) + ).and(customAttribute.KEY.eq(key))); + }) + .orElse(baseQuery) + .where(TEST_ITEM.HAS_STATS.isTrue() + .and(TEST_ITEM.HAS_CHILDREN.isFalse()) + .and(TEST_ITEM.TYPE.eq(JTestItemTypeEnum.STEP)) + .and(TEST_ITEM.RETRY_OF.isNull()) + .and(TEST_ITEM_RESULTS.STATUS.notEqual(JStatusEnum.IN_PROGRESS))) + .groupBy(TEST_ITEM.ITEM_ID, ITEM_ATTRIBUTE.KEY, ITEM_ATTRIBUTE.VALUE) + .getQuery() + ).get())); + + } + + @Override + public void removeWidgetView(String viewName) { + dsl.execute(DSL.sql( + Suppliers.formattedSupplier("DROP MATERIALIZED VIEW IF EXISTS {}", DSL.name(viewName)) + .get())); + } + + @Override + public List componentHealthCheckTable(HealthCheckTableGetParams params) { + return healthCheckTableChain.apply(params); + } + + private SelectSeekStepN buildLaunchesTableQuery( + Collection> selectFields, + Collection statisticsFields, Filter filter, Sort sort, int limit, + boolean isAttributePresent) { + + SelectOnConditionStep select = dsl.with(LAUNCHES) + .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit) + .build()) + .select(selectFields) + .from(LAUNCH) + .join(LAUNCHES) + .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), + STATISTICS_FIELD.NAME.as(SF_NAME)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .where(STATISTICS_FIELD.NAME.in(statisticsFields)) + .asTable(STATISTICS_TABLE)) + .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))) + .join(USERS) + .on(LAUNCH.USER_ID.eq(USERS.ID)); + if (isAttributePresent) { + select = select.leftJoin(ITEM_ATTRIBUTE).on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)); + } + + return select.orderBy( + WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)); + + } + + private SelectOnConditionStep buildPassingRateSelect(Filter filter, Sort sort, + int limit) { + return dsl.with(LAUNCHES) + .as(QueryBuilder.newBuilder(filter, collectJoinFields(filter, sort)).with(sort).with(limit) + .build()) + .select( + sum(when(fieldName(STATISTICS_TABLE, SF_NAME).cast(String.class).eq(EXECUTIONS_PASSED), + fieldName(STATISTICS_TABLE, STATISTICS_COUNTER).cast(Integer.class) + ).otherwise(0)).as(PASSED), + sum(when(fieldName(STATISTICS_TABLE, SF_NAME).cast(String.class).eq(EXECUTIONS_TOTAL), + fieldName(STATISTICS_TABLE, STATISTICS_COUNTER).cast(Integer.class) + ).otherwise(0)).as(TOTAL), + sum(when(fieldName(STATISTICS_TABLE, SF_NAME).cast(String.class).eq(EXECUTIONS_SKIPPED), + fieldName(STATISTICS_TABLE, STATISTICS_COUNTER).cast(Integer.class) + ).otherwise(0)).as(SKIPPED), + max(LAUNCH.NUMBER).as(NUMBER) + ) + .from(LAUNCH) + .join(LAUNCHES) + .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), + STATISTICS_FIELD.NAME.as(SF_NAME)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .where( + STATISTICS_FIELD.NAME.in(EXECUTIONS_PASSED, EXECUTIONS_TOTAL, EXECUTIONS_SKIPPED)) + .asTable(STATISTICS_TABLE)) + .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))); + + } + + private SelectSeekStepN buildFilterGroupedQuery(Filter filter, boolean isLatest, + Sort sort, int limit, + Collection contentFields, Map customColumns) { + + List> fields = getCommonProductStatusFields(filter, contentFields); + fields.add(DSL.selectDistinct(FILTER.NAME).from(FILTER).where(FILTER.ID.eq(filter.getId())) + .asField(FILTER_NAME)); + + return buildProductStatusQuery(filter, + isLatest, + sort, + limit, + fields, + contentFields, + customColumns + ).orderBy(WidgetSortUtils.sortingTransformer(filter.getTarget()).apply(sort, LAUNCHES)); + + } + + private List> getCommonProductStatusFields(Filter filter, + Collection contentFields) { + + Map criteria = filter.getTarget() + .getCriteriaHolders() + .stream() + .collect( + Collectors.toMap(CriteriaHolder::getFilterCriteria, CriteriaHolder::getQueryCriteria)); + + List> selectFields = contentFields.stream() + .filter(cf -> !cf.startsWith(STATISTICS_KEY)) + .map(criteria::get) + .filter(Objects::nonNull) + .map(DSL::field) + .collect(Collectors.toList()); + + Collections.addAll(selectFields, + LAUNCH.ID, + LAUNCH.NAME, + LAUNCH.NUMBER, + fieldName(STATISTICS_TABLE, SF_NAME), + fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), + round(val(PERCENTAGE_MULTIPLIER).mul(dsl.select(sum(STATISTICS.S_COUNTER)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .onKey() + .where( + STATISTICS_FIELD.NAME.eq(EXECUTIONS_PASSED).and(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID))) + .asField() + .cast(Double.class)) + .div(nullif(dsl.select(sum(STATISTICS.S_COUNTER)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .onKey() + .where(STATISTICS_FIELD.NAME.eq(EXECUTIONS_TOTAL) + .and(STATISTICS.LAUNCH_ID.eq(LAUNCH.ID))) + .asField(), 0)), 2).as(PASSING_RATE), + timestampDiff(LAUNCH.END_TIME, LAUNCH.START_TIME).as(DURATION) + ); + + return selectFields; + } + + private SelectOnConditionStep buildProductStatusQuery(Filter filter, + boolean isLatest, Sort sort, int limit, + Collection> fields, Collection contentFields, + Map customColumns) { + + List attributesKeyConditions = customColumns.values() + .stream() + .map(customColumn -> ofNullable(customColumn).map(ITEM_ATTRIBUTE.KEY::eq) + .orElseGet(ITEM_ATTRIBUTE.KEY::isNull)) + .collect(Collectors.toList()); + + Optional combinedAttributeKeyCondition = attributesKeyConditions.stream() + .reduce((prev, curr) -> curr = prev.or(curr)); + + List statisticsFields = contentFields.stream() + .filter(cf -> cf.startsWith(STATISTICS_KEY)).collect(toList()); + + return combinedAttributeKeyCondition.map(c -> { + Collections.addAll(fields, + fieldName(ATTR_TABLE, ATTR_ID), + fieldName(ATTR_TABLE, ATTRIBUTE_VALUE), + fieldName(ATTR_TABLE, ATTRIBUTE_KEY) + ); + return getProductStatusSelect(filter, isLatest, sort, limit, fields, + statisticsFields).leftJoin(DSL.select(ITEM_ATTRIBUTE.ID.as( + ATTR_ID), + ITEM_ATTRIBUTE.VALUE.as(ATTRIBUTE_VALUE), + ITEM_ATTRIBUTE.KEY.as(ATTRIBUTE_KEY), + ITEM_ATTRIBUTE.LAUNCH_ID.as(LAUNCH_ID) + ).from(ITEM_ATTRIBUTE).where(c).asTable(ATTR_TABLE)) + .on(LAUNCH.ID.eq(fieldName(ATTR_TABLE, LAUNCH_ID).cast(Long.class))); + }).orElseGet( + () -> getProductStatusSelect(filter, isLatest, sort, limit, fields, statisticsFields)); + } + + private SelectOnConditionStep getProductStatusSelect(Filter filter, boolean isLatest, + Sort sort, int limit, + Collection> fields, Collection contentFields) { + return dsl.with(LAUNCHES) + .as(QueryUtils.createQueryBuilderWithLatestLaunchesOption(filter, sort, isLatest).with(sort) + .with(limit).build()) + .select(fields) + .from(LAUNCH) + .join(LAUNCHES) + .on(LAUNCH.ID.eq(fieldName(LAUNCHES, ID).cast(Long.class))) + .leftJoin(DSL.select(STATISTICS.LAUNCH_ID, STATISTICS.S_COUNTER.as(STATISTICS_COUNTER), + STATISTICS_FIELD.NAME.as(SF_NAME)) + .from(STATISTICS) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .where(STATISTICS_FIELD.NAME.in(contentFields)) + .asTable(STATISTICS_TABLE)) + .on(LAUNCH.ID.eq(fieldName(STATISTICS_TABLE, LAUNCH_ID).cast(Long.class))); + } + + private ProductStatusStatisticsContent countLaunchTotalStatistics( + List launchesStatisticsResult) { + Map total = launchesStatisticsResult.stream() + .flatMap(lsc -> lsc.getValues().entrySet().stream()) + .collect(Collectors.groupingBy(Map.Entry::getKey, + summingInt(entry -> Integer.parseInt(entry.getValue())))); + + Double averagePassingRate = launchesStatisticsResult.stream() + .collect(averagingDouble(lsc -> ofNullable(lsc.getPassingRate()).orElse(0D))); + + ProductStatusStatisticsContent launchesStatisticsContent = new ProductStatusStatisticsContent(); + launchesStatisticsContent.setTotalStatistics(total); + + Double roundedAveragePassingRate = BigDecimal.valueOf(averagePassingRate) + .setScale(2, RoundingMode.HALF_UP).doubleValue(); + launchesStatisticsContent.setAveragePassingRate(roundedAveragePassingRate); + + return launchesStatisticsContent; + } + + private List countFilterTotalStatistics( + Map> launchesStatisticsResult) { + Map total = launchesStatisticsResult.values() + .stream() + .flatMap(Collection::stream) + .flatMap(lsc -> lsc.getValues().entrySet().stream()) + .collect(Collectors.groupingBy(Map.Entry::getKey, + summingInt(entry -> Integer.parseInt(entry.getValue())))); + + Double averagePassingRate = launchesStatisticsResult.values() + .stream() + .flatMap(Collection::stream) + .collect(averagingDouble(lsc -> ofNullable(lsc.getPassingRate()).orElse(0D))); + + ProductStatusStatisticsContent launchesStatisticsContent = new ProductStatusStatisticsContent(); + launchesStatisticsContent.setTotalStatistics(total); + + Double roundedAveragePassingRate = BigDecimal.valueOf(averagePassingRate) + .setScale(2, RoundingMode.HALF_UP).doubleValue(); + launchesStatisticsContent.setAveragePassingRate(roundedAveragePassingRate); + + return Lists.newArrayList(launchesStatisticsContent); + } + + private List buildPatternTemplatesQuery( + Map> attributeIdsMapping) { + + return attributeIdsMapping.entrySet() + .stream() + .map(entry -> (Select) dsl.select( + DSL.val(entry.getKey()).as(ATTRIBUTE_VALUE), + PATTERN_TEMPLATE.NAME, + DSL.countDistinct(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID).as(TOTAL) + ) + .from(PATTERN_TEMPLATE) + .join(PATTERN_TEMPLATE_TEST_ITEM) + .on(PATTERN_TEMPLATE.ID.eq(PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID)) + .join(TEST_ITEM) + .on(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) + .join(LAUNCH) + .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) + .where(LAUNCH.ID.in(entry.getValue())) + .groupBy(PATTERN_TEMPLATE.NAME) + .orderBy(field(TOTAL).desc()) + .limit(PATTERNS_COUNT)) + .reduce((prev, curr) -> curr = prev.unionAll(curr)) + .map(select -> TOP_PATTERN_TEMPLATES_FETCHER.apply(select.fetch())) + .orElseGet(Collections::emptyList); + } + + private List buildPatternTemplatesQueryGroupedByPattern( + Map> attributeIdsMapping, + String patternTemplateName) { + + return attributeIdsMapping.entrySet() + .stream() + .map(entry -> (Select) dsl.select( + DSL.val(entry.getKey()).as(ATTRIBUTE_VALUE), + LAUNCH.ID, + LAUNCH.NAME, + LAUNCH.NUMBER, + DSL.countDistinct(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID).as(TOTAL) + ) + .from(PATTERN_TEMPLATE) + .join(PATTERN_TEMPLATE_TEST_ITEM) + .on(PATTERN_TEMPLATE.ID.eq(PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID)) + .join(TEST_ITEM) + .on(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID.eq(TEST_ITEM.ITEM_ID)) + .join(LAUNCH) + .on(TEST_ITEM.LAUNCH_ID.eq(LAUNCH.ID)) + .where(LAUNCH.ID.in(entry.getValue())) + .and(PATTERN_TEMPLATE.NAME.eq(patternTemplateName)) + .groupBy(LAUNCH.ID, LAUNCH.NAME, LAUNCH.NUMBER, PATTERN_TEMPLATE.NAME) + .having(DSL.countDistinct(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID) + .gt(BigDecimal.ZERO.intValue())) + .orderBy(field(TOTAL).desc())) + .reduce((prev, curr) -> curr = prev.unionAll(curr)) + .map(select -> TOP_PATTERN_TEMPLATES_GROUPED_FETCHER.apply(select.fetch())) + .orElseGet(Collections::emptyList); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetRepository.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetRepository.java index 43c21eafc..b2a336b2c 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetRepository.java @@ -17,54 +17,63 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.widget.Widget; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; - import java.util.List; import java.util.Optional; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; /** * @author Pavel Bortnik */ -public interface WidgetRepository extends ReportPortalRepository, WidgetRepositoryCustom { +public interface WidgetRepository extends ReportPortalRepository, + WidgetRepositoryCustom { - /** - * Finds widget by 'id' and 'project id' - * - * @param id {@link Widget#id} - * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} whose widget will be extracted - * @return {@link Widget} wrapped in the {@link Optional} - */ - Optional findByIdAndProjectId(Long id, Long projectId); + /** + * Finds widget by 'id' and 'project id' + * + * @param id {@link Widget#id} + * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} whose widget + * will be extracted + * @return {@link Widget} wrapped in the {@link Optional} + */ + Optional findByIdAndProjectId(Long id, Long projectId); - /** - * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} whose widgets will be extracted - * @return The {@link List} of the {@link Widget} - */ - List findAllByProjectId(Long projectId); + /** + * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} whose + * widgets will be extracted + * @return The {@link List} of the {@link Widget} + */ + List findAllByProjectId(Long projectId); - /** - * Checks the existence of the {@link Widget} with specified name for a user on a project - * - * @param name {@link Widget#name} - * @param owner {@link Widget#owner} - * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} on which widget existence will be checked - * @return if exists 'true' else 'false' - */ - boolean existsByNameAndOwnerAndProjectId(String name, String owner, Long projectId); + /** + * Checks the existence of the {@link Widget} with specified name for a user on a project + * + * @param name {@link Widget#name} + * @param owner {@link Widget#owner} + * @param projectId Id of the {@link com.epam.ta.reportportal.entity.project.Project} on which + * widget existence will be checked + * @return if exists 'true' else 'false' + */ + boolean existsByNameAndOwnerAndProjectId(String name, String owner, Long projectId); - @Query(value = "SELECT w FROM Widget w WHERE w.project.id = :projectId AND w.widgetType IN :widgetTypes") - List findAllByProjectIdAndWidgetTypeIn(@Param("projectId") Long projectId, @Param("widgetTypes") List widgetTypes); + @Query(value = "SELECT w FROM Widget w WHERE w.project.id = :projectId AND w.widgetType IN :widgetTypes") + List findAllByProjectIdAndWidgetTypeIn(@Param("projectId") Long projectId, + @Param("widgetTypes") List widgetTypes); - @Query(value = "SELECT w FROM Widget w WHERE w.owner = :owner AND w.widgetType IN :widgetTypes") - List findAllByOwnerAndWidgetTypeIn(@Param("owner") String username, @Param("widgetTypes") List widgetTypes); + @Query(value = "SELECT w FROM Widget w WHERE w.owner = :owner AND w.widgetType IN :widgetTypes") + List findAllByOwnerAndWidgetTypeIn(@Param("owner") String username, + @Param("widgetTypes") List widgetTypes); - @Query(value = "SELECT w FROM Widget w WHERE w.project.id = :projectId AND w.widgetType IN :widgetTypes AND :contentField MEMBER w.contentFields") - List findAllByProjectIdAndWidgetTypeInAndContentFieldsContains(@Param("projectId") Long projectId, - @Param("widgetTypes") List widgetTypes, @Param("contentField") String contentField); + @Query(value = "SELECT w FROM Widget w WHERE w.project.id = :projectId AND w.widgetType IN :widgetTypes AND :contentField MEMBER w.contentFields") + List findAllByProjectIdAndWidgetTypeInAndContentFieldsContains( + @Param("projectId") Long projectId, + @Param("widgetTypes") List widgetTypes, @Param("contentField") String contentField); - @Query(value = "SELECT * FROM widget w JOIN shareable_entity se on w.id = se.id JOIN content_field cf on w.id = cf.id " - + " WHERE se.project_id = :projectId AND w.widget_type IN :widgetTypes AND cf.field LIKE :contentFieldPart || '%'", nativeQuery = true) - List findAllByProjectIdAndWidgetTypeInAndContentFieldContaining(@Param("projectId") Long projectId, - @Param("widgetTypes") List widgetTypes, @Param("contentFieldPart") String contentFieldPart); + @Query(value = + "SELECT * FROM widget w JOIN shareable_entity se on w.id = se.id JOIN content_field cf on w.id = cf.id " + + " WHERE se.project_id = :projectId AND w.widget_type IN :widgetTypes AND cf.field LIKE :contentFieldPart || '%'", nativeQuery = true) + List findAllByProjectIdAndWidgetTypeInAndContentFieldContaining( + @Param("projectId") Long projectId, + @Param("widgetTypes") List widgetTypes, + @Param("contentFieldPart") String contentFieldPart); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustom.java index 77b44f05d..2be615c83 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustom.java @@ -23,15 +23,16 @@ */ public interface WidgetRepositoryCustom extends ShareableRepository { - /** - * Remove many to many relation between {@link com.epam.ta.reportportal.entity.filter.UserFilter} by specified - * {@link com.epam.ta.reportportal.entity.filter.UserFilter#id} and {@link Widget} entities, - * that are not owned by the {@link com.epam.ta.reportportal.entity.filter.UserFilter} owner - * - * @param filterId {@link com.epam.ta.reportportal.entity.filter.UserFilter#id} - * @param owner {@link Widget#owner} - * @return count of removed {@link Widget} entities - */ - int deleteRelationByFilterIdAndNotOwner(Long filterId, String owner); + /** + * Remove many to many relation between {@link com.epam.ta.reportportal.entity.filter.UserFilter} + * by specified {@link com.epam.ta.reportportal.entity.filter.UserFilter#id} and {@link Widget} + * entities, that are not owned by the {@link com.epam.ta.reportportal.entity.filter.UserFilter} + * owner + * + * @param filterId {@link com.epam.ta.reportportal.entity.filter.UserFilter#id} + * @param owner {@link Widget#owner} + * @return count of removed {@link Widget} entities + */ + int deleteRelationByFilterIdAndNotOwner(Long filterId, String owner); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustomImpl.java index 6bc0d4942..f3c82473d 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustomImpl.java @@ -16,49 +16,50 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.dao.util.ResultFetchers.WIDGET_FETCHER; +import static com.epam.ta.reportportal.jooq.tables.JShareableEntity.SHAREABLE_ENTITY; +import static com.epam.ta.reportportal.jooq.tables.JWidget.WIDGET; +import static com.epam.ta.reportportal.jooq.tables.JWidgetFilter.WIDGET_FILTER; + import com.epam.ta.reportportal.commons.querygen.ProjectFilter; import com.epam.ta.reportportal.entity.widget.Widget; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Repository; -import static com.epam.ta.reportportal.dao.util.ResultFetchers.WIDGET_FETCHER; -import static com.epam.ta.reportportal.jooq.tables.JShareableEntity.SHAREABLE_ENTITY; -import static com.epam.ta.reportportal.jooq.tables.JWidget.WIDGET; -import static com.epam.ta.reportportal.jooq.tables.JWidgetFilter.WIDGET_FILTER; - /** * @author Pavel Bortnik */ @Repository -public class WidgetRepositoryCustomImpl extends AbstractShareableRepositoryImpl implements WidgetRepositoryCustom { +public class WidgetRepositoryCustomImpl extends AbstractShareableRepositoryImpl implements + WidgetRepositoryCustom { - @Override - public Page getPermitted(ProjectFilter filter, Pageable pageable, String userName) { - return getPermitted(WIDGET_FETCHER, filter, pageable, userName); - } + @Override + public Page getPermitted(ProjectFilter filter, Pageable pageable, String userName) { + return getPermitted(WIDGET_FETCHER, filter, pageable, userName); + } - @Override - public Page getOwn(ProjectFilter filter, Pageable pageable, String userName) { - return getOwn(WIDGET_FETCHER, filter, pageable, userName); - } + @Override + public Page getOwn(ProjectFilter filter, Pageable pageable, String userName) { + return getOwn(WIDGET_FETCHER, filter, pageable, userName); + } - @Override - public Page getShared(ProjectFilter filter, Pageable pageable, String userName) { - return getShared(WIDGET_FETCHER, filter, pageable, userName); - } + @Override + public Page getShared(ProjectFilter filter, Pageable pageable, String userName) { + return getShared(WIDGET_FETCHER, filter, pageable, userName); + } - @Override - public int deleteRelationByFilterIdAndNotOwner(Long filterId, String owner) { - return dsl.deleteFrom(WIDGET_FILTER) - .where(WIDGET_FILTER.WIDGET_ID.in(dsl.select(WIDGET.ID) - .from(WIDGET) - .join(WIDGET_FILTER) - .on(WIDGET.ID.eq(WIDGET_FILTER.WIDGET_ID)) - .join(SHAREABLE_ENTITY) - .on(WIDGET.ID.eq(SHAREABLE_ENTITY.ID)) - .where(WIDGET_FILTER.FILTER_ID.eq(filterId)) - .and(SHAREABLE_ENTITY.OWNER.notEqual(owner)))) - .execute(); - } + @Override + public int deleteRelationByFilterIdAndNotOwner(Long filterId, String owner) { + return dsl.deleteFrom(WIDGET_FILTER) + .where(WIDGET_FILTER.WIDGET_ID.in(dsl.select(WIDGET.ID) + .from(WIDGET) + .join(WIDGET_FILTER) + .on(WIDGET.ID.eq(WIDGET_FILTER.WIDGET_ID)) + .join(SHAREABLE_ENTITY) + .on(WIDGET.ID.eq(SHAREABLE_ENTITY.ID)) + .where(WIDGET_FILTER.FILTER_ID.eq(filterId)) + .and(SHAREABLE_ENTITY.OWNER.notEqual(owner)))) + .execute(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/constant/LogRepositoryConstants.java b/src/main/java/com/epam/ta/reportportal/dao/constant/LogRepositoryConstants.java index c97333687..f09a88a4b 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/constant/LogRepositoryConstants.java +++ b/src/main/java/com/epam/ta/reportportal/dao/constant/LogRepositoryConstants.java @@ -21,17 +21,17 @@ */ public final class LogRepositoryConstants { - public static final String DISTINCT_LOGS_TABLE = "logs_table"; - public static final String ROW_NUMBER = "row_number"; - public static final String PAGE_NUMBER = "page_number"; - public static final String TIME = "time"; - public static final String LOG_LEVEL = "log_level"; - public static final String ITEM = "item"; - public static final String LOG = "log"; - public static final String TYPE = "type"; - public static final String LOGS = "logs"; + public static final String DISTINCT_LOGS_TABLE = "logs_table"; + public static final String ROW_NUMBER = "row_number"; + public static final String PAGE_NUMBER = "page_number"; + public static final String TIME = "time"; + public static final String LOG_LEVEL = "log_level"; + public static final String ITEM = "item"; + public static final String LOG = "log"; + public static final String TYPE = "type"; + public static final String LOGS = "logs"; - private LogRepositoryConstants() { - //static only - } + private LogRepositoryConstants() { + //static only + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/constant/TestItemRepositoryConstants.java b/src/main/java/com/epam/ta/reportportal/dao/constant/TestItemRepositoryConstants.java index a5751714f..bde281beb 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/constant/TestItemRepositoryConstants.java +++ b/src/main/java/com/epam/ta/reportportal/dao/constant/TestItemRepositoryConstants.java @@ -21,15 +21,15 @@ */ public final class TestItemRepositoryConstants { - public static final String LAUNCH_ID = "launch_id"; - public static final String ITEM_ID = "item_id"; - public static final String HAS_CHILDREN = "has_children"; - public static final String RETRIES_TABLE = "retries"; - public static final String HAS_CONTENT = "hasContent"; - public static final String ATTACHMENTS_COUNT = "attachmentsCount"; - public static final String NESTED = "nested"; + public static final String LAUNCH_ID = "launch_id"; + public static final String ITEM_ID = "item_id"; + public static final String HAS_CHILDREN = "has_children"; + public static final String RETRIES_TABLE = "retries"; + public static final String HAS_CONTENT = "hasContent"; + public static final String ATTACHMENTS_COUNT = "attachmentsCount"; + public static final String NESTED = "nested"; - private TestItemRepositoryConstants() { - //static only - } + private TestItemRepositoryConstants() { + //static only + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetContentRepositoryConstants.java b/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetContentRepositoryConstants.java index 619c44549..78d1bff0a 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetContentRepositoryConstants.java +++ b/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetContentRepositoryConstants.java @@ -21,118 +21,118 @@ */ public class WidgetContentRepositoryConstants { - public static final String EXECUTIONS_TOTAL = "statistics$executions$total"; - public static final String EXECUTIONS_FAILED = "statistics$executions$failed"; - public static final String EXECUTIONS_SKIPPED = "statistics$executions$skipped"; - public static final String EXECUTIONS_PASSED = "statistics$executions$passed"; - public static final String EXECUTIONS_STOPPED = "statistics$executions$stopped"; - - public static final String DEFECTS_AUTOMATION_BUG_TOTAL = "statistics$defects$automation_bug$total"; - public static final String DEFECTS_PRODUCT_BUG_TOTAL = "statistics$defects$product_bug$total"; - public static final String DEFECTS_NO_DEFECT_TOTAL = "statistics$defects$no_defect$total"; - public static final String DEFECTS_SYSTEM_ISSUE_TOTAL = "statistics$defects$system_issue$total"; - public static final String DEFECTS_TO_INVESTIGATE_TOTAL = "statistics$defects$to_investigate$total"; - - public static final String STATISTICS_SEPARATOR = "$"; - - public static final String TOTAL = "total"; - public static final String SKIPPED = "skipped"; - public static final String EXECUTIONS_KEY = "executions"; - public static final String DEFECTS_KEY = "defects"; - - public static final String STATISTICS_TABLE = "statistics_table"; - public static final String STATISTICS_COUNTER = "s_counter"; - public static final String SF_NAME = "sf_name"; - - /*Constants for result query mapping*/ - public static final Double PERCENTAGE_MULTIPLIER = 100d; - public static final Integer ZERO_QUERY_VALUE = 0; - public static final String LAUNCH_ID = "launch_id"; - public static final String NAME = "name"; - public static final String DESCRIPTION = "description"; - public static final String TARGET = "target"; - public static final String ID = "id"; - public static final String STATUS = "status"; - public static final String NUMBER = "number"; - public static final String END_TIME = "endTime"; - - /* Most failed widget constants */ - public static final String HISTORY = "history"; - public static final String CRITERIA = "criteria"; - public static final String STATUS_HISTORY = "statusHistory"; - public static final String START_TIME_HISTORY = "startTimeHistory"; - public static final String CRITERIA_TABLE = "criteria_table"; - public static final String CRITERIA_FLAG = "criteria_flag"; - public static final String ITEM_ID = "item_id"; - public static final Integer MOST_FAILED_CRITERIA_LIMIT = 20; - - /* Overall statistics widget constants */ - public static final String LAUNCHES = "launches"; - - /*Flaky test table widget constants*/ - public static final String FLAKY_TABLE_RESULTS = "flaky"; - public static final Integer FLAKY_CASES_LIMIT = 50; - - /*Activity table widget constants*/ - public static final String ACTIVITIES = "activities"; - - /*Investigation widget constants*/ - public static final String INVESTIGATED = "investigated"; - public static final String TO_INVESTIGATE = "toInvestigate"; - - /*Launch pass widget constants*/ - public static final String PASSED = "passed"; - - /*Cases trend widget constants*/ - public static final String DELTA = "delta"; - - /*Launches duration widget constants*/ - public static final String ITEMS = "items"; - public static final String DURATION = "duration"; - - /*Not passed cases widget constants*/ - public static final String PERCENTAGE = "percentage"; - public static final String NOT_PASSED_STATISTICS_KEY = "% (Failed+Skipped)/Total"; - - /*Unique bugs table widget constants*/ - public static final String ITEM_ATTRIBUTES = "item_attributes"; - public static final String KEY = "key"; - public static final String VALUE = "value"; - - /*Flaky cases table widget constants*/ - public static final String UNIQUE_ID = "unique_id"; - public static final String ITEM_NAME = "item_name"; - public static final String STATUSES = "statuses"; - public static final String SWITCH_FLAG = "switchFlag"; - public static final String FLAKY_COUNT = "flakyCount"; - - /*Cumulative trend widget constants*/ - public static final String LAUNCHES_TABLE = "launches_table"; - public static final String AGGREGATED_LAUNCHES_IDS = "aggregated_launches_ids"; - public static final String START_TIME = "start_time"; - public static final String FIRST_LEVEL_ID = "first_level_id"; - public static final String LATEST_NUMBER = "latest_number"; - public static final String VERSION_PATTERN = "^(\\d+)(\\.\\d+)*$"; - public static final String VERSION_DELIMITER = "."; - - /*Product status widget constants*/ - public static final String ATTRIBUTE_VALUE = "attribute_value"; - public static final String ATTRIBUTE_KEY = "attribute_key"; - public static final String FILTER_NAME = "filter_name"; - public static final String ATTRIBUTE_VALUES = "attribute_values"; - public static final String PASSING_RATE = "passingRate"; - public static final String SUM = "sum"; - public static final String AVERAGE_PASSING_RATE = "averagePassingRate"; - public static final String ATTR_ID = "attr_id"; - public static final String ATTR_TABLE = "attr_table"; - - /*Top pattern templates widget constants*/ - public static final Integer PATTERNS_COUNT = 20; - - /*Health check table widget constants*/ - public static final String CUSTOM_ATTRIBUTE = "custom_attribute"; - public static final String AGGREGATED_VALUES = "aggregated_values"; - public static final String CUSTOM_COLUMN = "custom_column"; - public static final String CUSTOM_COLUMN_SORTING = "customColumn"; + public static final String EXECUTIONS_TOTAL = "statistics$executions$total"; + public static final String EXECUTIONS_FAILED = "statistics$executions$failed"; + public static final String EXECUTIONS_SKIPPED = "statistics$executions$skipped"; + public static final String EXECUTIONS_PASSED = "statistics$executions$passed"; + public static final String EXECUTIONS_STOPPED = "statistics$executions$stopped"; + + public static final String DEFECTS_AUTOMATION_BUG_TOTAL = "statistics$defects$automation_bug$total"; + public static final String DEFECTS_PRODUCT_BUG_TOTAL = "statistics$defects$product_bug$total"; + public static final String DEFECTS_NO_DEFECT_TOTAL = "statistics$defects$no_defect$total"; + public static final String DEFECTS_SYSTEM_ISSUE_TOTAL = "statistics$defects$system_issue$total"; + public static final String DEFECTS_TO_INVESTIGATE_TOTAL = "statistics$defects$to_investigate$total"; + + public static final String STATISTICS_SEPARATOR = "$"; + + public static final String TOTAL = "total"; + public static final String SKIPPED = "skipped"; + public static final String EXECUTIONS_KEY = "executions"; + public static final String DEFECTS_KEY = "defects"; + + public static final String STATISTICS_TABLE = "statistics_table"; + public static final String STATISTICS_COUNTER = "s_counter"; + public static final String SF_NAME = "sf_name"; + + /*Constants for result query mapping*/ + public static final Double PERCENTAGE_MULTIPLIER = 100d; + public static final Integer ZERO_QUERY_VALUE = 0; + public static final String LAUNCH_ID = "launch_id"; + public static final String NAME = "name"; + public static final String DESCRIPTION = "description"; + public static final String TARGET = "target"; + public static final String ID = "id"; + public static final String STATUS = "status"; + public static final String NUMBER = "number"; + public static final String END_TIME = "endTime"; + + /* Most failed widget constants */ + public static final String HISTORY = "history"; + public static final String CRITERIA = "criteria"; + public static final String STATUS_HISTORY = "statusHistory"; + public static final String START_TIME_HISTORY = "startTimeHistory"; + public static final String CRITERIA_TABLE = "criteria_table"; + public static final String CRITERIA_FLAG = "criteria_flag"; + public static final String ITEM_ID = "item_id"; + public static final Integer MOST_FAILED_CRITERIA_LIMIT = 20; + + /* Overall statistics widget constants */ + public static final String LAUNCHES = "launches"; + + /*Flaky test table widget constants*/ + public static final String FLAKY_TABLE_RESULTS = "flaky"; + public static final Integer FLAKY_CASES_LIMIT = 50; + + /*Activity table widget constants*/ + public static final String ACTIVITIES = "activities"; + + /*Investigation widget constants*/ + public static final String INVESTIGATED = "investigated"; + public static final String TO_INVESTIGATE = "toInvestigate"; + + /*Launch pass widget constants*/ + public static final String PASSED = "passed"; + + /*Cases trend widget constants*/ + public static final String DELTA = "delta"; + + /*Launches duration widget constants*/ + public static final String ITEMS = "items"; + public static final String DURATION = "duration"; + + /*Not passed cases widget constants*/ + public static final String PERCENTAGE = "percentage"; + public static final String NOT_PASSED_STATISTICS_KEY = "% (Failed+Skipped)/Total"; + + /*Unique bugs table widget constants*/ + public static final String ITEM_ATTRIBUTES = "item_attributes"; + public static final String KEY = "key"; + public static final String VALUE = "value"; + + /*Flaky cases table widget constants*/ + public static final String UNIQUE_ID = "unique_id"; + public static final String ITEM_NAME = "item_name"; + public static final String STATUSES = "statuses"; + public static final String SWITCH_FLAG = "switchFlag"; + public static final String FLAKY_COUNT = "flakyCount"; + + /*Cumulative trend widget constants*/ + public static final String LAUNCHES_TABLE = "launches_table"; + public static final String AGGREGATED_LAUNCHES_IDS = "aggregated_launches_ids"; + public static final String START_TIME = "start_time"; + public static final String FIRST_LEVEL_ID = "first_level_id"; + public static final String LATEST_NUMBER = "latest_number"; + public static final String VERSION_PATTERN = "^(\\d+)(\\.\\d+)*$"; + public static final String VERSION_DELIMITER = "."; + + /*Product status widget constants*/ + public static final String ATTRIBUTE_VALUE = "attribute_value"; + public static final String ATTRIBUTE_KEY = "attribute_key"; + public static final String FILTER_NAME = "filter_name"; + public static final String ATTRIBUTE_VALUES = "attribute_values"; + public static final String PASSING_RATE = "passingRate"; + public static final String SUM = "sum"; + public static final String AVERAGE_PASSING_RATE = "averagePassingRate"; + public static final String ATTR_ID = "attr_id"; + public static final String ATTR_TABLE = "attr_table"; + + /*Top pattern templates widget constants*/ + public static final Integer PATTERNS_COUNT = 20; + + /*Health check table widget constants*/ + public static final String CUSTOM_ATTRIBUTE = "custom_attribute"; + public static final String AGGREGATED_VALUES = "aggregated_values"; + public static final String CUSTOM_COLUMN = "custom_column"; + public static final String CUSTOM_COLUMN_SORTING = "customColumn"; } diff --git a/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetRepositoryConstants.java b/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetRepositoryConstants.java index a11219f32..a329212d5 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetRepositoryConstants.java +++ b/src/main/java/com/epam/ta/reportportal/dao/constant/WidgetRepositoryConstants.java @@ -21,13 +21,13 @@ */ public final class WidgetRepositoryConstants { - public static final String DISTINCT_WIDGET_TABLE = "widget_subquery"; - public static final String ID = "id"; - public static final String NAME = "name"; - public static final String DESCRIPTION = "description"; - public static final String SHARED = "shared"; - public static final String OWNER = "owner"; - public static final String SID = "sid"; - public static final String PROJECT_ID = "project_id"; - public static final String RETRIES_TABLE = "retries"; + public static final String DISTINCT_WIDGET_TABLE = "widget_subquery"; + public static final String ID = "id"; + public static final String NAME = "name"; + public static final String DESCRIPTION = "description"; + public static final String SHARED = "shared"; + public static final String OWNER = "owner"; + public static final String SID = "sid"; + public static final String PROJECT_ID = "project_id"; + public static final String RETRIES_TABLE = "retries"; } diff --git a/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java b/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java index e7dd0ee4c..72986e0cc 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java +++ b/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java @@ -1,6 +1,16 @@ package com.epam.ta.reportportal.dao.custom; import com.epam.ta.reportportal.entity.log.LogMessage; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; import org.apache.commons.collections.MapUtils; import org.json.JSONObject; import org.slf4j.Logger; @@ -15,325 +25,335 @@ import org.springframework.util.CollectionUtils; import org.springframework.web.client.RestTemplate; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.*; - /** * Simple client to work with Elasticsearch. + * * @author Maksim Antonov */ @Service @ConditionalOnProperty(prefix = "rp.elasticsearch", name = "host") public class ElasticSearchClient { - public static final String INDEX_PREFIX = "logs-reportportal-"; - public static final String CREATE_COMMAND = "{\"create\":{ }}\n"; - public static final String ELASTIC_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS"; - public static final Integer MAX_RESULT_REQUEST = 5000; - public static final String LOG_MESSAGE_FIELD_NAME = "message"; - protected final Logger LOGGER = LoggerFactory.getLogger(ElasticSearchClient.class); - - private final String host; - private final RestTemplate restTemplate; - - public ElasticSearchClient(@Value("${rp.elasticsearch.host}") String host, - @Value("${rp.elasticsearch.username}") String username, - @Value("${rp.elasticsearch.password}") String password) { - restTemplate = new RestTemplate(); - restTemplate.getInterceptors().add(new BasicAuthenticationInterceptor(username, password)); - - this.host = host; - } - - public void save(List logMessageList) { - if (CollectionUtils.isEmpty(logMessageList)) return; - Map logsByIndex = new HashMap<>(); - - logMessageList.forEach(logMessage -> { - String indexName = getIndexName(logMessage.getProjectId()); - String logCreateBody = CREATE_COMMAND + convertToJson(logMessage) + "\n"; - - if (logsByIndex.containsKey(indexName)) { - logsByIndex.put(indexName, logsByIndex.get(indexName) + logCreateBody); - } else { - logsByIndex.put(indexName, logCreateBody); - } - }); - - logsByIndex.forEach((indexName, body) -> { - restTemplate.put(host + "/" + indexName + "/_bulk?refresh", getStringHttpEntity(body)); - }); - } - - public void deleteLogsByLogIdAndProjectId(Long projectId, Long logId) { - JSONObject terms = new JSONObject(); - terms.put("id", List.of(logId)); - - deleteLogsByTermsAndProjectId(projectId, terms); - } - - public void deleteLogsByItemSetAndProjectId(Long projectId, Set itemIds) { - JSONObject terms = new JSONObject(); - terms.put("itemId", itemIds); - deleteLogsByTermsAndProjectId(projectId, terms); - } + public static final String INDEX_PREFIX = "logs-reportportal-"; + public static final String CREATE_COMMAND = "{\"create\":{ }}\n"; + public static final String ELASTIC_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSSSS"; + public static final Integer MAX_RESULT_REQUEST = 5000; + public static final String LOG_MESSAGE_FIELD_NAME = "message"; + protected final Logger LOGGER = LoggerFactory.getLogger(ElasticSearchClient.class); - public void deleteLogsByLaunchIdAndProjectId(Long projectId, Long launchId) { - JSONObject terms = new JSONObject(); - terms.put("launchId", List.of(launchId)); + private final String host; + private final RestTemplate restTemplate; - deleteLogsByTermsAndProjectId(projectId, terms); - } + public ElasticSearchClient(@Value("${rp.elasticsearch.host}") String host, + @Value("${rp.elasticsearch.username}") String username, + @Value("${rp.elasticsearch.password}") String password) { + restTemplate = new RestTemplate(); + restTemplate.getInterceptors().add(new BasicAuthenticationInterceptor(username, password)); - public void deleteLogsByLaunchListAndProjectId(Long projectId, List launches) { - JSONObject terms = new JSONObject(); - terms.put("launchId", launches); + this.host = host; + } - deleteLogsByTermsAndProjectId(projectId, terms); - } - - public void deleteLogsByProjectId(Long projectId) { - String indexName = getIndexName(projectId); - try { - restTemplate.delete(host + "/_data_stream/" + indexName); - } catch (Exception exception) { - // to avoid checking of exists stream or not - LOGGER.error("DELETE stream from ES " + indexName + " Project: " + projectId - + " Message: " + exception.getMessage()); - } + public void save(List logMessageList) { + if (CollectionUtils.isEmpty(logMessageList)) { + return; } - - public LogMessage getLogMessageByProjectIdAndId(Long projectId, Long id) { - Map result = getLogMessagesByProjectIdAndIds(projectId, List.of(id)); - return MapUtils.isEmpty(result) ? null : result.get(id); + Map logsByIndex = new HashMap<>(); + + logMessageList.forEach(logMessage -> { + String indexName = getIndexName(logMessage.getProjectId()); + String logCreateBody = CREATE_COMMAND + convertToJson(logMessage) + "\n"; + + if (logsByIndex.containsKey(indexName)) { + logsByIndex.put(indexName, logsByIndex.get(indexName) + logCreateBody); + } else { + logsByIndex.put(indexName, logCreateBody); + } + }); + + logsByIndex.forEach((indexName, body) -> { + restTemplate.put(host + "/" + indexName + "/_bulk?refresh", getStringHttpEntity(body)); + }); + } + + public void deleteLogsByLogIdAndProjectId(Long projectId, Long logId) { + JSONObject terms = new JSONObject(); + terms.put("id", List.of(logId)); + + deleteLogsByTermsAndProjectId(projectId, terms); + } + + public void deleteLogsByItemSetAndProjectId(Long projectId, Set itemIds) { + JSONObject terms = new JSONObject(); + terms.put("itemId", itemIds); + + deleteLogsByTermsAndProjectId(projectId, terms); + } + + public void deleteLogsByLaunchIdAndProjectId(Long projectId, Long launchId) { + JSONObject terms = new JSONObject(); + terms.put("launchId", List.of(launchId)); + + deleteLogsByTermsAndProjectId(projectId, terms); + } + + public void deleteLogsByLaunchListAndProjectId(Long projectId, List launches) { + JSONObject terms = new JSONObject(); + terms.put("launchId", launches); + + deleteLogsByTermsAndProjectId(projectId, terms); + } + + public void deleteLogsByProjectId(Long projectId) { + String indexName = getIndexName(projectId); + try { + restTemplate.delete(host + "/_data_stream/" + indexName); + } catch (Exception exception) { + // to avoid checking of exists stream or not + LOGGER.error("DELETE stream from ES " + indexName + " Project: " + projectId + + " Message: " + exception.getMessage()); } - - public Map getLogMessagesByProjectIdAndIds(Long projectId, List logIds) { - Map logMessageMap = new HashMap<>(); - int i = 0; - while (true) { - int i2 = Math.min(logIds.size(), i + MAX_RESULT_REQUEST); - List logIdsBatch = logIds.subList(i, i2); - logMessageMap.putAll(getLogMessageMapBatch(projectId, logIdsBatch, MAX_RESULT_REQUEST)); - if (i2 == logIds.size()) { - break; - } - i += MAX_RESULT_REQUEST; - } - - return logMessageMap; + } + + public LogMessage getLogMessageByProjectIdAndId(Long projectId, Long id) { + Map result = getLogMessagesByProjectIdAndIds(projectId, List.of(id)); + return MapUtils.isEmpty(result) ? null : result.get(id); + } + + public Map getLogMessagesByProjectIdAndIds(Long projectId, List logIds) { + Map logMessageMap = new HashMap<>(); + int i = 0; + while (true) { + int i2 = Math.min(logIds.size(), i + MAX_RESULT_REQUEST); + List logIdsBatch = logIds.subList(i, i2); + logMessageMap.putAll(getLogMessageMapBatch(projectId, logIdsBatch, MAX_RESULT_REQUEST)); + if (i2 == logIds.size()) { + break; + } + i += MAX_RESULT_REQUEST; } - public List searchTestItemIdsByLogIdsAndString(Long projectId, Collection logIds, String string) { - JSONObject filterTerms = new JSONObject(); - filterTerms.put("id", logIds); - List sourceFields = List.of("itemId"); - - JSONObject searchJson = getSearchStringJson(string, filterTerms, sourceFields, logIds.size()); + return logMessageMap; + } - return searchTestItemIdsByConditions(projectId, searchJson); - } + public List searchTestItemIdsByLogIdsAndString(Long projectId, Collection logIds, + String string) { + JSONObject filterTerms = new JSONObject(); + filterTerms.put("id", logIds); + List sourceFields = List.of("itemId"); - public List searchTestItemIdsByLogIdsAndRegexp(Long projectId, Collection logIds, String pattern) { - JSONObject filterTerms = new JSONObject(); - filterTerms.put("id", logIds); - List sourceFields = List.of("itemId"); + JSONObject searchJson = getSearchStringJson(string, filterTerms, sourceFields, logIds.size()); - JSONObject searchJson = getSearchRegexpJson(pattern, filterTerms, sourceFields, logIds.size()); + return searchTestItemIdsByConditions(projectId, searchJson); + } - return searchTestItemIdsByConditions(projectId, searchJson); - } + public List searchTestItemIdsByLogIdsAndRegexp(Long projectId, Collection logIds, + String pattern) { + JSONObject filterTerms = new JSONObject(); + filterTerms.put("id", logIds); + List sourceFields = List.of("itemId"); - /** - * Search LogIds by logIds and conditions. - * LogIds instead of logs was used due to optimization. - * @param projectId - * @param searchJson - * @return - */ - private List searchTestItemIdsByConditions(Long projectId, JSONObject searchJson) { - String indexName = getIndexName(projectId); + JSONObject searchJson = getSearchRegexpJson(pattern, filterTerms, sourceFields, logIds.size()); - Set testItemIds = new HashSet<>(); + return searchTestItemIdsByConditions(projectId, searchJson); + } - try { - HttpEntity searchRequest = getStringHttpEntity(searchJson.toString()); + /** + * Search LogIds by logIds and conditions. LogIds instead of logs was used due to optimization. + * + * @param projectId + * @param searchJson + * @return + */ + private List searchTestItemIdsByConditions(Long projectId, JSONObject searchJson) { + String indexName = getIndexName(projectId); - LinkedHashMap result = restTemplate.postForObject(host + "/" + indexName + "/_search", searchRequest, LinkedHashMap.class); + Set testItemIds = new HashSet<>(); - List> hits = (List>)((LinkedHashMap)result.get("hits")).get("hits"); + try { + HttpEntity searchRequest = getStringHttpEntity(searchJson.toString()); - if (org.apache.commons.collections.CollectionUtils.isNotEmpty(hits)) { - for (LinkedHashMap hit : hits) { - Map source = (Map)hit.get("_source"); - Long testItemId = ((Integer) source.get("itemId")).longValue(); - testItemIds.add(testItemId); - } + LinkedHashMap result = restTemplate.postForObject( + host + "/" + indexName + "/_search", searchRequest, LinkedHashMap.class); - } + List> hits = (List>) ((LinkedHashMap) result.get( + "hits")).get("hits"); - } catch (Exception exception) { - LOGGER.error("Search error " + indexName - + " SearchJson: " + searchJson - + " Message: " + exception.getMessage()); + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(hits)) { + for (LinkedHashMap hit : hits) { + Map source = (Map) hit.get("_source"); + Long testItemId = ((Integer) source.get("itemId")).longValue(); + testItemIds.add(testItemId); } - return new ArrayList<>(testItemIds); - } + } - private Map getLogMessageMapBatch(Long projectId, List logIds, Integer size) { - String indexName = getIndexName(projectId); + } catch (Exception exception) { + LOGGER.error("Search error " + indexName + + " SearchJson: " + searchJson + + " Message: " + exception.getMessage()); + } - JSONObject terms = new JSONObject(); - terms.put("id", logIds); - Map logMessageMap = new HashMap<>(); + return new ArrayList<>(testItemIds); + } - try { - JSONObject searchJson = getSearchJson(terms, size); - HttpEntity searchRequest = getStringHttpEntity(searchJson.toString()); + private Map getLogMessageMapBatch(Long projectId, List logIds, + Integer size) { + String indexName = getIndexName(projectId); - LinkedHashMap result = restTemplate.postForObject(host + "/" + indexName + "/_search", searchRequest, LinkedHashMap.class); + JSONObject terms = new JSONObject(); + terms.put("id", logIds); + Map logMessageMap = new HashMap<>(); - List> hits = (List>)((LinkedHashMap)result.get("hits")).get("hits"); + try { + JSONObject searchJson = getSearchJson(terms, size); + HttpEntity searchRequest = getStringHttpEntity(searchJson.toString()); - if (org.apache.commons.collections.CollectionUtils.isNotEmpty(hits)) { - for (LinkedHashMap hit : hits) { - Map source = (Map)hit.get("_source"); - LogMessage logMessage = convertElasticDataToLogMessage(projectId, source); - logMessageMap.put(logMessage.getId(), logMessage); - } + LinkedHashMap result = restTemplate.postForObject( + host + "/" + indexName + "/_search", searchRequest, LinkedHashMap.class); - } + List> hits = (List>) ((LinkedHashMap) result.get( + "hits")).get("hits"); - } catch (Exception exception) { - LOGGER.error("Search error " + indexName + " Terms: " + terms - + " Message: " + exception.getMessage()); + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(hits)) { + for (LinkedHashMap hit : hits) { + Map source = (Map) hit.get("_source"); + LogMessage logMessage = convertElasticDataToLogMessage(projectId, source); + logMessageMap.put(logMessage.getId(), logMessage); } - return logMessageMap; - } - - private LogMessage convertElasticDataToLogMessage(Long projectId, Map source) { - String timestampString = (String) source.get("@timestamp"); - if (timestampString.lastIndexOf(".") > -1) { - int millsNumber = timestampString.length() - timestampString.lastIndexOf(".") - 1; - if (millsNumber < 6) { - timestampString += "0".repeat(6 - millsNumber); - } - } else { - timestampString += "." + "0".repeat(6); - } + } - return new LogMessage( - ((Integer) source.get("id")).longValue(), - LocalDateTime.parse( - timestampString, - DateTimeFormatter.ofPattern(ELASTIC_DATETIME_FORMAT) - ), - (String) source.get("message"), - ((Integer) source.get("itemId")).longValue(), - ((Integer) source.get("launchId")).longValue(), - projectId - ); + } catch (Exception exception) { + LOGGER.error("Search error " + indexName + " Terms: " + terms + + " Message: " + exception.getMessage()); } - private void deleteLogsByTermsAndProjectId(Long projectId, JSONObject terms) { - String indexName = getIndexName(projectId); - try { - JSONObject deleteByLaunch = getDeleteJson(terms); - HttpEntity deleteRequest = getStringHttpEntity(deleteByLaunch.toString()); - - restTemplate.postForObject(host + "/" + indexName + "/_delete_by_query", deleteRequest, JSONObject.class); - } catch (Exception exception) { - // to avoid checking of exists stream or not - LOGGER.error("DELETE logs from stream ES error " + indexName + " Terms: " + terms - + " Message: " + exception.getMessage()); - } + return logMessageMap; + } + + private LogMessage convertElasticDataToLogMessage(Long projectId, Map source) { + String timestampString = (String) source.get("@timestamp"); + if (timestampString.lastIndexOf(".") > -1) { + int millsNumber = timestampString.length() - timestampString.lastIndexOf(".") - 1; + if (millsNumber < 6) { + timestampString += "0".repeat(6 - millsNumber); + } + } else { + timestampString += "." + "0".repeat(6); } - private String getIndexName(Long projectId) { - return INDEX_PREFIX + projectId; + return new LogMessage( + ((Integer) source.get("id")).longValue(), + LocalDateTime.parse( + timestampString, + DateTimeFormatter.ofPattern(ELASTIC_DATETIME_FORMAT) + ), + (String) source.get("message"), + ((Integer) source.get("itemId")).longValue(), + ((Integer) source.get("launchId")).longValue(), + projectId + ); + } + + private void deleteLogsByTermsAndProjectId(Long projectId, JSONObject terms) { + String indexName = getIndexName(projectId); + try { + JSONObject deleteByLaunch = getDeleteJson(terms); + HttpEntity deleteRequest = getStringHttpEntity(deleteByLaunch.toString()); + + restTemplate.postForObject(host + "/" + indexName + "/_delete_by_query", deleteRequest, + JSONObject.class); + } catch (Exception exception) { + // to avoid checking of exists stream or not + LOGGER.error("DELETE logs from stream ES error " + indexName + " Terms: " + terms + + " Message: " + exception.getMessage()); } + } - private JSONObject getDeleteJson(JSONObject terms) { - JSONObject query = new JSONObject(); - query.put("terms", terms); + private String getIndexName(Long projectId) { + return INDEX_PREFIX + projectId; + } - JSONObject deleteByLaunch = new JSONObject(); - deleteByLaunch.put("query", query); + private JSONObject getDeleteJson(JSONObject terms) { + JSONObject query = new JSONObject(); + query.put("terms", terms); - return deleteByLaunch; - } + JSONObject deleteByLaunch = new JSONObject(); + deleteByLaunch.put("query", query); - private JSONObject getSearchJson(JSONObject terms, Integer size) { - JSONObject query = new JSONObject(); - query.put("terms", terms); + return deleteByLaunch; + } - JSONObject searchJson = new JSONObject(); - searchJson.put("query", query); - searchJson.put("size", size); + private JSONObject getSearchJson(JSONObject terms, Integer size) { + JSONObject query = new JSONObject(); + query.put("terms", terms); - return searchJson; - } + JSONObject searchJson = new JSONObject(); + searchJson.put("query", query); + searchJson.put("size", size); + return searchJson; + } - private JSONObject getSearchStringJson(String string, JSONObject filterTerms, List sourceFields, Integer size) { - JSONObject postFilter = new JSONObject(); - postFilter.put("terms", filterTerms); - JSONObject matchPhrase = new JSONObject(); - matchPhrase.put(LOG_MESSAGE_FIELD_NAME, string); + private JSONObject getSearchStringJson(String string, JSONObject filterTerms, + List sourceFields, Integer size) { + JSONObject postFilter = new JSONObject(); + postFilter.put("terms", filterTerms); - JSONObject query = new JSONObject(); - query.put("match_phrase", matchPhrase); + JSONObject matchPhrase = new JSONObject(); + matchPhrase.put(LOG_MESSAGE_FIELD_NAME, string); - JSONObject searchJson = new JSONObject(); - searchJson.put("_source", sourceFields); - searchJson.put("query", query); - searchJson.put("post_filter", postFilter); - searchJson.put("size", size); + JSONObject query = new JSONObject(); + query.put("match_phrase", matchPhrase); - return searchJson; - } + JSONObject searchJson = new JSONObject(); + searchJson.put("_source", sourceFields); + searchJson.put("query", query); + searchJson.put("post_filter", postFilter); + searchJson.put("size", size); - // Separated from getSearchStringJson, because possibly will be added some - // specific configuration for regexp optimization. - private JSONObject getSearchRegexpJson(String pattern, JSONObject filterTerms, List sourceFields, Integer size) { - JSONObject postFilter = new JSONObject(); - postFilter.put("terms", filterTerms); + return searchJson; + } - JSONObject regexp = new JSONObject(); - regexp.put(LOG_MESSAGE_FIELD_NAME, pattern); + // Separated from getSearchStringJson, because possibly will be added some + // specific configuration for regexp optimization. + private JSONObject getSearchRegexpJson(String pattern, JSONObject filterTerms, + List sourceFields, Integer size) { + JSONObject postFilter = new JSONObject(); + postFilter.put("terms", filterTerms); - JSONObject query = new JSONObject(); - query.put("regexp", regexp); + JSONObject regexp = new JSONObject(); + regexp.put(LOG_MESSAGE_FIELD_NAME, pattern); - JSONObject searchJson = new JSONObject(); - searchJson.put("_source", sourceFields); - searchJson.put("query", query); - searchJson.put("post_filter", postFilter); - searchJson.put("size", size); + JSONObject query = new JSONObject(); + query.put("regexp", regexp); - return searchJson; - } + JSONObject searchJson = new JSONObject(); + searchJson.put("_source", sourceFields); + searchJson.put("query", query); + searchJson.put("post_filter", postFilter); + searchJson.put("size", size); - private JSONObject convertToJson(LogMessage logMessage) { - JSONObject personJsonObject = new JSONObject(); - personJsonObject.put("id", logMessage.getId()); - personJsonObject.put("message", logMessage.getLogMessage()); - personJsonObject.put("itemId", logMessage.getItemId()); - personJsonObject.put("@timestamp", logMessage.getLogTime()); - personJsonObject.put("launchId", logMessage.getLaunchId()); + return searchJson; + } - return personJsonObject; - } + private JSONObject convertToJson(LogMessage logMessage) { + JSONObject personJsonObject = new JSONObject(); + personJsonObject.put("id", logMessage.getId()); + personJsonObject.put("message", logMessage.getLogMessage()); + personJsonObject.put("itemId", logMessage.getItemId()); + personJsonObject.put("@timestamp", logMessage.getLogTime()); + personJsonObject.put("launchId", logMessage.getLaunchId()); - private HttpEntity getStringHttpEntity(String body) { - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); + return personJsonObject; + } - return new HttpEntity<>(body, headers); - } + private HttpEntity getStringHttpEntity(String body) { + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + + return new HttpEntity<>(body, headers); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/JooqFieldNameTransformer.java b/src/main/java/com/epam/ta/reportportal/dao/util/JooqFieldNameTransformer.java index 1a82dba25..292475fe1 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/JooqFieldNameTransformer.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/JooqFieldNameTransformer.java @@ -17,12 +17,12 @@ package com.epam.ta.reportportal.dao.util; -import org.jooq.Field; -import org.jooq.TableField; - import static org.jooq.impl.DSL.field; import static org.jooq.impl.DSL.name; +import org.jooq.Field; +import org.jooq.TableField; + /** * Transforms string into jooq {@link Field} representation * @@ -30,15 +30,15 @@ */ public final class JooqFieldNameTransformer { - public static Field fieldName(TableField tableField) { - return field(name(tableField.getName())); - } + public static Field fieldName(TableField tableField) { + return field(name(tableField.getName())); + } - public static Field fieldName(String tableFieldName) { - return field(name(tableFieldName)); - } + public static Field fieldName(String tableFieldName) { + return field(name(tableFieldName)); + } - public static Field fieldName(String... fieldQualifiers) { - return field(name(fieldQualifiers)); - } + public static Field fieldName(String... fieldQualifiers) { + return field(name(fieldQualifiers)); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/QueryUtils.java b/src/main/java/com/epam/ta/reportportal/dao/util/QueryUtils.java index 630364f64..a205fcb06 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/QueryUtils.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/QueryUtils.java @@ -16,71 +16,71 @@ package com.epam.ta.reportportal.dao.util; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.LAUNCHES; +import static com.epam.ta.reportportal.jooq.tables.JLaunch.LAUNCH; +import static java.util.stream.Collectors.toSet; +import static org.jooq.impl.DSL.field; +import static org.jooq.impl.DSL.name; + import com.epam.ta.reportportal.commons.querygen.ConvertibleCondition; import com.epam.ta.reportportal.commons.querygen.FilterCondition; import com.epam.ta.reportportal.commons.querygen.QueryBuilder; import com.epam.ta.reportportal.commons.querygen.Queryable; +import java.util.Collection; +import java.util.Set; import org.jooq.SortOrder; import org.jooq.impl.DSL; import org.springframework.data.domain.Sort; -import java.util.Collection; -import java.util.Set; - -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.LAUNCHES; -import static com.epam.ta.reportportal.jooq.tables.JLaunch.LAUNCH; -import static java.util.stream.Collectors.toSet; -import static org.jooq.impl.DSL.field; -import static org.jooq.impl.DSL.name; - /** * @author Ivan Budayeu */ public final class QueryUtils { - private QueryUtils() { - //static only - } + private QueryUtils() { + //static only + } - public static QueryBuilder createQueryBuilderWithLatestLaunchesOption(Queryable filter, Sort sort, boolean isLatest) { + public static QueryBuilder createQueryBuilderWithLatestLaunchesOption(Queryable filter, Sort sort, + boolean isLatest) { - Set joinFields = collectJoinFields(filter, sort); - QueryBuilder queryBuilder = QueryBuilder.newBuilder(filter, joinFields); + Set joinFields = collectJoinFields(filter, sort); + QueryBuilder queryBuilder = QueryBuilder.newBuilder(filter, joinFields); - if (isLatest) { - queryBuilder.with(LAUNCH.NUMBER, SortOrder.DESC) - .addCondition(LAUNCH.ID.in(DSL.with(LAUNCHES) - .as(QueryBuilder.newBuilder(filter, joinFields).build()) - .selectDistinct(LAUNCH.ID) - .on(LAUNCH.NAME) - .from(LAUNCH) - .join(LAUNCHES) - .on(field(name(LAUNCHES, ID), Long.class).eq(LAUNCH.ID)) - .orderBy(LAUNCH.NAME, LAUNCH.NUMBER.desc()))); - } + if (isLatest) { + queryBuilder.with(LAUNCH.NUMBER, SortOrder.DESC) + .addCondition(LAUNCH.ID.in(DSL.with(LAUNCHES) + .as(QueryBuilder.newBuilder(filter, joinFields).build()) + .selectDistinct(LAUNCH.ID) + .on(LAUNCH.NAME) + .from(LAUNCH) + .join(LAUNCHES) + .on(field(name(LAUNCHES, ID), Long.class).eq(LAUNCH.ID)) + .orderBy(LAUNCH.NAME, LAUNCH.NUMBER.desc()))); + } - return queryBuilder; + return queryBuilder; - } + } - public static Set collectJoinFields(Queryable filter) { - return filter.getFilterConditions() - .stream() - .map(ConvertibleCondition::getAllConditions) - .flatMap(Collection::stream) - .map(FilterCondition::getSearchCriteria) - .collect(toSet()); - } + public static Set collectJoinFields(Queryable filter) { + return filter.getFilterConditions() + .stream() + .map(ConvertibleCondition::getAllConditions) + .flatMap(Collection::stream) + .map(FilterCondition::getSearchCriteria) + .collect(toSet()); + } - public static Set collectJoinFields(Sort sort) { - return sort.get().map(Sort.Order::getProperty).collect(toSet()); - } + public static Set collectJoinFields(Sort sort) { + return sort.get().map(Sort.Order::getProperty).collect(toSet()); + } - public static Set collectJoinFields(Queryable filter, Sort sort) { - Set joinFields = collectJoinFields(filter); - joinFields.addAll(collectJoinFields(sort)); - return joinFields; - } + public static Set collectJoinFields(Queryable filter, Sort sort) { + Set joinFields = collectJoinFields(filter); + joinFields.addAll(collectJoinFields(sort)); + return joinFields; + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMapperUtils.java b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMapperUtils.java index a3dac3b6f..2dbcf4fae 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMapperUtils.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMapperUtils.java @@ -16,24 +16,23 @@ package com.epam.ta.reportportal.dao.util; -import org.jooq.Field; - import java.util.Arrays; import java.util.function.Predicate; +import org.jooq.Field; /** * @author Ivan Budayeu */ public final class RecordMapperUtils { - private RecordMapperUtils() { - //static only - } + private RecordMapperUtils() { + //static only + } - public static Predicate> fieldExcludingPredicate(Field... fields) { - return field -> Arrays.stream(fields) - .noneMatch(f -> f.getName().equalsIgnoreCase(field.getName()) && f.getQualifiedName() - .toString() - .equalsIgnoreCase(field.getQualifiedName().toString())); - } + public static Predicate> fieldExcludingPredicate(Field... fields) { + return field -> Arrays.stream(fields) + .noneMatch(f -> f.getName().equalsIgnoreCase(field.getName()) && f.getQualifiedName() + .toString() + .equalsIgnoreCase(field.getQualifiedName().toString())); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java index 6230dd6e1..8cfded51a 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java @@ -16,6 +16,37 @@ package com.epam.ta.reportportal.dao.util; +import static com.epam.ta.reportportal.commons.querygen.FilterTarget.ATTRIBUTE_ALIAS; +import static com.epam.ta.reportportal.dao.LogRepositoryCustomImpl.ROOT_ITEM_ID; +import static com.epam.ta.reportportal.dao.constant.TestItemRepositoryConstants.ATTACHMENTS_COUNT; +import static com.epam.ta.reportportal.dao.constant.TestItemRepositoryConstants.HAS_CONTENT; +import static com.epam.ta.reportportal.dao.util.RecordMapperUtils.fieldExcludingPredicate; +import static com.epam.ta.reportportal.jooq.Tables.ATTRIBUTE; +import static com.epam.ta.reportportal.jooq.Tables.CLUSTERS; +import static com.epam.ta.reportportal.jooq.Tables.CONTENT_FIELD; +import static com.epam.ta.reportportal.jooq.Tables.DASHBOARD; +import static com.epam.ta.reportportal.jooq.Tables.DASHBOARD_WIDGET; +import static com.epam.ta.reportportal.jooq.Tables.FILTER; +import static com.epam.ta.reportportal.jooq.Tables.INTEGRATION; +import static com.epam.ta.reportportal.jooq.Tables.INTEGRATION_TYPE; +import static com.epam.ta.reportportal.jooq.Tables.ISSUE; +import static com.epam.ta.reportportal.jooq.Tables.ISSUE_TYPE; +import static com.epam.ta.reportportal.jooq.Tables.LAUNCH; +import static com.epam.ta.reportportal.jooq.Tables.LOG; +import static com.epam.ta.reportportal.jooq.Tables.PATTERN_TEMPLATE; +import static com.epam.ta.reportportal.jooq.Tables.PROJECT; +import static com.epam.ta.reportportal.jooq.Tables.PROJECT_USER; +import static com.epam.ta.reportportal.jooq.Tables.STATISTICS_FIELD; +import static com.epam.ta.reportportal.jooq.Tables.TEST_ITEM; +import static com.epam.ta.reportportal.jooq.Tables.TEST_ITEM_RESULTS; +import static com.epam.ta.reportportal.jooq.Tables.TICKET; +import static com.epam.ta.reportportal.jooq.Tables.WIDGET; +import static com.epam.ta.reportportal.jooq.tables.JActivity.ACTIVITY; +import static com.epam.ta.reportportal.jooq.tables.JAttachment.ATTACHMENT; +import static com.epam.ta.reportportal.jooq.tables.JUsers.USERS; +import static java.util.Optional.empty; +import static java.util.Optional.ofNullable; + import com.epam.ta.reportportal.commons.ReportPortalUser; import com.epam.ta.reportportal.entity.ItemAttribute; import com.epam.ta.reportportal.entity.Metadata; @@ -26,7 +57,11 @@ import com.epam.ta.reportportal.entity.bts.Ticket; import com.epam.ta.reportportal.entity.dashboard.DashboardWidget; import com.epam.ta.reportportal.entity.dashboard.DashboardWidgetId; -import com.epam.ta.reportportal.entity.enums.*; +import com.epam.ta.reportportal.entity.enums.IntegrationAuthFlowEnum; +import com.epam.ta.reportportal.entity.enums.IntegrationGroupEnum; +import com.epam.ta.reportportal.entity.enums.ProjectType; +import com.epam.ta.reportportal.entity.enums.StatusEnum; +import com.epam.ta.reportportal.entity.enums.TestItemTypeEnum; import com.epam.ta.reportportal.entity.filter.UserFilter; import com.epam.ta.reportportal.entity.integration.Integration; import com.epam.ta.reportportal.entity.integration.IntegrationParams; @@ -64,517 +99,525 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -import org.apache.logging.log4j.util.Strings; -import org.jooq.Field; -import org.jooq.Record; -import org.jooq.RecordMapper; -import org.jooq.Result; - import java.io.IOException; import java.time.LocalDateTime; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Function; - -import static com.epam.ta.reportportal.commons.querygen.FilterTarget.ATTRIBUTE_ALIAS; -import static com.epam.ta.reportportal.dao.LogRepositoryCustomImpl.ROOT_ITEM_ID; -import static com.epam.ta.reportportal.dao.constant.TestItemRepositoryConstants.ATTACHMENTS_COUNT; -import static com.epam.ta.reportportal.dao.constant.TestItemRepositoryConstants.HAS_CONTENT; -import static com.epam.ta.reportportal.dao.util.RecordMapperUtils.fieldExcludingPredicate; -import static com.epam.ta.reportportal.jooq.Tables.*; -import static com.epam.ta.reportportal.jooq.tables.JActivity.ACTIVITY; -import static com.epam.ta.reportportal.jooq.tables.JAttachment.ATTACHMENT; -import static com.epam.ta.reportportal.jooq.tables.JUsers.USERS; -import static java.util.Optional.empty; -import static java.util.Optional.ofNullable; +import org.apache.logging.log4j.util.Strings; +import org.jooq.Field; +import org.jooq.Record; +import org.jooq.RecordMapper; +import org.jooq.Result; /** - * Set of record mappers that helps to convert the result of jooq queries into - * Java objects + * Set of record mappers that helps to convert the result of jooq queries into Java objects * * @author Pavel Bortnik */ public class RecordMappers { - private static ObjectMapper objectMapper; - - static { - objectMapper = new ObjectMapper(); - objectMapper.registerModule(new JavaTimeModule()); - objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - } - - /** - * Maps record into {@link Attribute} object - */ - public static final RecordMapper ATTRIBUTE_MAPPER = record -> { - Attribute attribute = new Attribute(); - ofNullable(record.field(ATTRIBUTE.ID)).ifPresent(f -> attribute.setId(record.get(f))); - ofNullable(record.field(ATTRIBUTE.NAME)).ifPresent(f -> attribute.setName(record.get(f))); - - return attribute; - }; - - /** - * Maps record into {@link IssueType} object - */ - public static final RecordMapper ISSUE_TYPE_RECORD_MAPPER = r -> { - IssueType type = r.into(IssueType.class); - type.setIssueGroup(r.into(IssueGroup.class)); - return type; - }; - - /** - * Maps record into {@link IssueEntity} object - */ - public static final RecordMapper ISSUE_RECORD_MAPPER = r -> { - IssueEntity issueEntity = r.into(IssueEntity.class); - issueEntity.setIssueType(ISSUE_TYPE_RECORD_MAPPER.map(r)); - return issueEntity; - }; - - /** - * Maps record into {@link Project} object - */ - public static final RecordMapper PROJECT_MAPPER = r -> { - Project project = r.into(PROJECT.ID, PROJECT.NAME, PROJECT.ORGANIZATION, PROJECT.CREATION_DATE, PROJECT.PROJECT_TYPE) - .into(Project.class); - ofNullable(r.field(PROJECT.METADATA)).ifPresent(f -> { - String metaDataString = r.get(f, String.class); - ofNullable(metaDataString).ifPresent(md -> { - try { - Metadata metadata = objectMapper.readValue(metaDataString, Metadata.class); - project.setMetadata(metadata); - } catch (IOException e) { - throw new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, "Error during parsing user metadata"); - } - }); - }); - - return project; - }; - - /** - * Maps record into {@link TestItemResults} object - */ - public static final RecordMapper TEST_ITEM_RESULTS_RECORD_MAPPER = r -> { - TestItemResults results = r.into(TestItemResults.class); - results.setIssue(ISSUE_RECORD_MAPPER.map(r)); - return results; - }; - - public static final RecordMapper STATISTICS_RECORD_MAPPER = r -> { - Statistics statistics = new Statistics(); - - StatisticsField statisticsField = new StatisticsField(); - statisticsField.setName(r.get(STATISTICS_FIELD.NAME)); - - statistics.setStatisticsField(statisticsField); - statistics.setCounter(ofNullable(r.get(Tables.STATISTICS.S_COUNTER)).orElse(0)); - return statistics; - }; - - public static final RecordMapper ATTACHMENT_MAPPER = r -> ofNullable(r.get(ATTACHMENT.ID)).map(id -> { - Attachment attachment = new Attachment(); - attachment.setId(id); - attachment.setFileId(r.get(ATTACHMENT.FILE_ID)); - attachment.setThumbnailId(r.get(ATTACHMENT.THUMBNAIL_ID)); - attachment.setContentType(r.get(ATTACHMENT.CONTENT_TYPE)); - attachment.setFileSize(r.get(ATTACHMENT.FILE_SIZE)); - attachment.setProjectId(r.get(ATTACHMENT.PROJECT_ID)); - attachment.setLaunchId(r.get(ATTACHMENT.LAUNCH_ID)); - attachment.setItemId(r.get(ATTACHMENT.ITEM_ID)); - - return attachment; - }).orElse(null); - - private static final RecordMapper COMMON_LOG_RECORD_MAPPER = result -> { - Log log = new Log(); - log.setId(result.get(LOG.ID, Long.class)); - log.setLogTime(result.get(LOG.LOG_TIME, LocalDateTime.class)); - log.setLogMessage(result.get(LOG.LOG_MESSAGE, String.class)); - log.setLastModified(result.get(LOG.LAST_MODIFIED, LocalDateTime.class)); - log.setLogLevel(result.get(JLog.LOG.LOG_LEVEL, Integer.class)); - log.setProjectId(result.get(LOG.PROJECT_ID, Long.class)); - ofNullable(result.get(LOG.LAUNCH_ID)).map(Launch::new).ifPresent(log::setLaunch); - return log; - }; - - public static final RecordMapper LOG_RECORD_MAPPER = result -> { - Log log = COMMON_LOG_RECORD_MAPPER.map(result); - ofNullable(result.get(LOG.ITEM_ID)).map(TestItem::new).ifPresent(log::setTestItem); - return log; - }; - - public static final RecordMapper LOG_UNDER_RECORD_MAPPER = result -> { - Log log = COMMON_LOG_RECORD_MAPPER.map(result); - ofNullable(result.get(ROOT_ITEM_ID, Long.class)).map(TestItem::new).ifPresent(log::setTestItem); - log.setClusterId(result.get(LOG.CLUSTER_ID, Long.class)); - return log; - }; - - public static final Function, Map>> INDEX_LOG_FETCHER = result -> { - final Map> indexLogMapping = new HashMap<>(); - result.forEach(r -> { - final Long itemId = r.get(ROOT_ITEM_ID, Long.class); - - final IndexLog indexLog = new IndexLog(); - indexLog.setLogId(r.get(LOG.ID, Long.class)); - indexLog.setMessage(r.get(LOG.LOG_MESSAGE, String.class)); - indexLog.setLogLevel(r.get(JLog.LOG.LOG_LEVEL, Integer.class)); - indexLog.setLogTime(r.get(LOG.LOG_TIME, LocalDateTime.class)); - indexLog.setClusterId(r.get(CLUSTERS.INDEX_ID)); - - ofNullable(indexLogMapping.get(itemId)).ifPresentOrElse(indexLogs -> indexLogs.add(indexLog), () -> { - final List indexLogs = new ArrayList<>(); - indexLogs.add(indexLog); - indexLogMapping.put(itemId, indexLogs); - }); - }); - return indexLogMapping; - }; - - public static final BiFunction, Log> LOG_MAPPER = (result, attachmentMapper) -> { - Log log = LOG_RECORD_MAPPER.map(result); - log.setAttachment(attachmentMapper.map(result)); - return log; - }; - - public static final BiFunction, Log> LOG_UNDER_MAPPER = (result, attachmentMapper) -> { - Log log = LOG_UNDER_RECORD_MAPPER.map(result); - log.setAttachment(attachmentMapper.map(result)); - return log; - }; - - /** - * Maps record into {@link TestItem} object - */ - public static final RecordMapper TEST_ITEM_RECORD_MAPPER = r -> { - TestItem testItem = r.into(TestItem.class); - testItem.setItemId(r.get(TEST_ITEM.ITEM_ID)); - testItem.setName(r.get(TEST_ITEM.NAME)); - testItem.setCodeRef(r.get(TEST_ITEM.CODE_REF)); - testItem.setItemResults(TEST_ITEM_RESULTS_RECORD_MAPPER.map(r)); - ofNullable(r.get(TEST_ITEM.LAUNCH_ID)).ifPresent(testItem::setLaunchId); - ofNullable(r.get(TEST_ITEM.PARENT_ID)).ifPresent(testItem::setParentId); - return testItem; - }; - - public static final RecordMapper INDEX_TEST_ITEM_RECORD_MAPPER = record -> { - final IndexTestItem indexTestItem = new IndexTestItem(); - indexTestItem.setTestItemId(record.get(TEST_ITEM.ITEM_ID)); - indexTestItem.setTestItemName(record.get(TEST_ITEM.NAME)); - indexTestItem.setStartTime(record.get(TEST_ITEM.START_TIME).toLocalDateTime()); - indexTestItem.setUniqueId(record.get(TEST_ITEM.UNIQUE_ID)); - indexTestItem.setTestCaseHash(record.get(TEST_ITEM.TEST_CASE_HASH)); - indexTestItem.setAutoAnalyzed(record.get(ISSUE.AUTO_ANALYZED)); - indexTestItem.setIssueTypeLocator(record.get(ISSUE_TYPE.LOCATOR)); - return indexTestItem; - }; - - public static final RecordMapper NESTED_STEP_RECORD_MAPPER = r -> new NestedStep( - r.get(TEST_ITEM.ITEM_ID), - r.get(TEST_ITEM.NAME), - r.get(TEST_ITEM.UUID), - TestItemTypeEnum.valueOf(r.get(TEST_ITEM.TYPE).getLiteral()), - r.get(HAS_CONTENT, Boolean.class), - r.get(ATTACHMENTS_COUNT, Integer.class), - StatusEnum.valueOf(r.get(TEST_ITEM_RESULTS.STATUS).getLiteral()), - r.get(TEST_ITEM.START_TIME, LocalDateTime.class), - r.get(TEST_ITEM_RESULTS.END_TIME, LocalDateTime.class), - r.get(TEST_ITEM_RESULTS.DURATION) - ); - - /** - * Maps record into {@link PatternTemplate} object (only {@link PatternTemplate#id} and {@link PatternTemplate#name} fields) - */ - public static final Function> PATTERN_TEMPLATE_NAME_RECORD_MAPPER = r -> ofNullable(r.get( - PATTERN_TEMPLATE.NAME)).map(name -> { - PatternTemplate patternTemplate = new PatternTemplate(); - patternTemplate.setId(r.get(PATTERN_TEMPLATE.ID)); - patternTemplate.setName(name); - return patternTemplate; - }); - - /** - * Maps record into {@link Launch} object - */ - public static final RecordMapper LAUNCH_RECORD_MAPPER = r -> { - Launch launch = r.into(Launch.class); - launch.setId(r.get(LAUNCH.ID)); - launch.setName(r.get(LAUNCH.NAME)); - launch.setUserId(r.get(LAUNCH.USER_ID)); - return launch; - }; - - public static final RecordMapper INDEX_LAUNCH_RECORD_MAPPER = record -> { - final IndexLaunch indexLaunch = new IndexLaunch(); - indexLaunch.setLaunchId(record.get(LAUNCH.ID)); - indexLaunch.setLaunchName(record.get(LAUNCH.NAME)); - indexLaunch.setLaunchStartTime(record.get(LAUNCH.START_TIME).toLocalDateTime()); - indexLaunch.setProjectId(record.get(LAUNCH.PROJECT_ID)); - return indexLaunch; - }; - - public static final RecordMapper REPORT_PORTAL_USER_MAPPER = r -> ReportPortalUser.userBuilder() - .withUserName(r.get(USERS.LOGIN)) - .withPassword(ofNullable(r.get(USERS.PASSWORD)).orElse("")) - .withAuthorities(Collections.emptyList()) - .withUserId(r.get(USERS.ID)) - .withUserRole(UserRole.findByName(r.get(USERS.ROLE)) - .orElseThrow(() -> new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR))) - .withEmail(r.get(USERS.EMAIL)) - .build(); - - public static final RecordMapper USER_MAPPER = r -> { - User user = r.into(USERS.fieldStream().filter(f -> fieldExcludingPredicate(USERS.METADATA).test(f)).toArray(Field[]::new)) - .into(User.class); - String metaDataString = r.get(USERS.METADATA, String.class); - ofNullable(metaDataString).ifPresent(md -> { - try { - Metadata metadata = objectMapper.readValue(metaDataString, Metadata.class); - user.setMetadata(metadata); - } catch (IOException e) { - throw new ReportPortalException("Error during parsing user metadata"); - } - }); - return user; - }; - - public static final RecordMapper PROJECT_USER_MAPPER = r -> { - ProjectUser projectUser = new ProjectUser(); - projectUser.setProjectRole(r.into(PROJECT_USER.PROJECT_ROLE).into(ProjectRole.class)); - - Project project = new Project(); - project.setId(r.get(PROJECT_USER.PROJECT_ID)); - project.setName(r.get(PROJECT.NAME)); - project.setProjectType(ProjectType.valueOf(r.get(PROJECT.PROJECT_TYPE))); - - User user = new User(); - user.setLogin(r.get(USERS.LOGIN)); - user.setId(r.get(PROJECT_USER.PROJECT_ID)); - - projectUser.setProject(project); - projectUser.setUser(user); - return projectUser; - }; - - public static final RecordMapper PROJECT_DETAILS_MAPPER = r -> { - final Long projectId = r.get(PROJECT_USER.PROJECT_ID); - final String projectName = r.get(PROJECT.NAME); - final ProjectRole projectRole = r.into(PROJECT_USER.PROJECT_ROLE).into(ProjectRole.class); - return new ReportPortalUser.ProjectDetails(projectId, projectName, projectRole); - }; - - public static final RecordMapper ACTIVITY_MAPPER = r -> { - Activity activity = new Activity(); - activity.setId(r.get(ACTIVITY.ID)); - activity.setUserId(r.get(ACTIVITY.USER_ID)); - activity.setProjectId(r.get(ACTIVITY.PROJECT_ID)); - activity.setAction(r.get(ACTIVITY.ACTION)); - activity.setUsername(ofNullable(r.get(USERS.LOGIN)).orElse(r.get(ACTIVITY.USERNAME))); - activity.setActivityEntityType(r.get(ACTIVITY.ENTITY, String.class)); - activity.setCreatedAt(r.get(ACTIVITY.CREATION_DATE, LocalDateTime.class)); - activity.setObjectId(r.get(ACTIVITY.OBJECT_ID)); - String detailsJson = r.get(ACTIVITY.DETAILS, String.class); - ofNullable(detailsJson).ifPresent(s -> { - try { - ActivityDetails details = objectMapper.readValue(s, ActivityDetails.class); - activity.setDetails(details); - } catch (IOException e) { - throw new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR); - } - }); - return activity; - }; - - public static final RecordMapper SHARED_ENTITY_MAPPER = r -> r.into(SharedEntity.class); - - private static final BiConsumer WIDGET_USER_FILTER_MAPPER = (widget, res) -> ofNullable(res.get(FILTER.ID)).ifPresent( - id -> { - Set filters = ofNullable(widget.getFilters()).orElseGet(Sets::newLinkedHashSet); - UserFilter filter = new UserFilter(); - filter.setId(id); - filters.add(filter); - widget.setFilters(filters); - }); - - private static final BiConsumer WIDGET_OPTIONS_MAPPER = (widget, res) -> { - ofNullable(res.get(WIDGET.WIDGET_OPTIONS, String.class)).ifPresent(wo -> { - try { - WidgetOptions widgetOptions = objectMapper.readValue(wo, WidgetOptions.class); - widget.setWidgetOptions(widgetOptions); - } catch (IOException e) { - throw new ReportPortalException("Error during parsing widget options"); - } - }); - }; - - private static final BiConsumer WIDGET_CONTENT_FIELD_MAPPER = (widget, res) -> ofNullable(res.get(CONTENT_FIELD.FIELD)).ifPresent( - field -> { - Set contentFields = ofNullable(widget.getContentFields()).orElseGet(Sets::newLinkedHashSet); - contentFields.add(field); - widget.setContentFields(contentFields); - }); - - public static final RecordMapper WIDGET_RECORD_MAPPER = r -> { - Widget widget = new Widget(); - widget.setDescription(r.get(WIDGET.DESCRIPTION)); - widget.setId(r.get(WIDGET.ID)); - widget.setName(r.get(WIDGET.NAME)); - widget.setItemsCount(r.get(WIDGET.ITEMS_COUNT)); - widget.setWidgetType(r.get(WIDGET.WIDGET_TYPE)); - - WIDGET_USER_FILTER_MAPPER.accept(widget, r); - WIDGET_OPTIONS_MAPPER.accept(widget, r); - WIDGET_CONTENT_FIELD_MAPPER.accept(widget, r); - - return widget; - }; - - public static final Function, List> WIDGET_FETCHER = result -> { - Map widgetMap = Maps.newLinkedHashMap(); - result.forEach(res -> { - Long widgetId = res.get(WIDGET.ID); - Widget widget = widgetMap.get(widgetId); - if (ofNullable(widget).isPresent()) { - WIDGET_USER_FILTER_MAPPER.accept(widget, res); - WIDGET_OPTIONS_MAPPER.accept(widget, res); - WIDGET_CONTENT_FIELD_MAPPER.accept(widget, res); - } else { - widgetMap.put(widgetId, WIDGET_RECORD_MAPPER.map(res)); - } - }); - - return Lists.newArrayList(widgetMap.values()); - }; - - public static final Function>> ITEM_ATTRIBUTE_MAPPER = r -> { - List attributeList = new ArrayList<>(); - - if (r.get(ATTRIBUTE_ALIAS) != null) { - String[] attributesArray = r.get(ATTRIBUTE_ALIAS, String[].class); - - for (String attributeString : attributesArray) { - if (Strings.isEmpty(attributeString)) continue; - - // explode attributes from string "key:value:system" - String[] attributes = attributeString.split(":", -1); - if (attributes.length > 1 && (Strings.isNotEmpty(attributes[0]) || Strings.isNotEmpty(attributes[1]))) { - Boolean systemAttribute; - //Case when system attribute is retrieved as 't' or 'f' - if ("t".equals(attributes[2]) || "f".equals(attributes[2])) { - systemAttribute = "t".equals(attributes[2]) ? Boolean.TRUE : Boolean.FALSE; - } else { - systemAttribute = Boolean.parseBoolean(attributes[2]); - } - attributeList.add( - new ItemAttribute(attributes[0], attributes[1], systemAttribute) - ); - } - } - } - - if (attributeList.size() > 0) { - return Optional.of(attributeList); - } else { - return Optional.empty(); - } - }; - - public static final Function> TICKET_MAPPER = r -> { - String ticketId = r.get(TICKET.TICKET_ID); - if (ticketId != null) { - return Optional.of(r.into(Ticket.class)); - } - return Optional.empty(); - }; - - public static final Function> DASHBOARD_WIDGET_MAPPER = r -> { - Long widgetId = r.get(DASHBOARD_WIDGET.WIDGET_ID); - if (widgetId == null) { - return empty(); - } - DashboardWidget dashboardWidget = new DashboardWidget(); - dashboardWidget.setId(new DashboardWidgetId(r.get(DASHBOARD.ID), widgetId)); - dashboardWidget.setPositionX(r.get(DASHBOARD_WIDGET.WIDGET_POSITION_X)); - dashboardWidget.setPositionY(r.get(DASHBOARD_WIDGET.WIDGET_POSITION_Y)); - dashboardWidget.setHeight(r.get(DASHBOARD_WIDGET.WIDGET_HEIGHT)); - dashboardWidget.setWidth(r.get(DASHBOARD_WIDGET.WIDGET_WIDTH)); - dashboardWidget.setCreatedOn(r.get(DASHBOARD_WIDGET.IS_CREATED_ON)); - dashboardWidget.setWidgetOwner(r.get(DASHBOARD_WIDGET.WIDGET_OWNER)); - dashboardWidget.setWidgetName(r.get(DASHBOARD_WIDGET.WIDGET_NAME)); - dashboardWidget.setWidgetType(r.get(DASHBOARD_WIDGET.WIDGET_TYPE)); - dashboardWidget.setShare(r.get(DASHBOARD_WIDGET.SHARE)); - final Widget widget = new Widget(); - WIDGET_OPTIONS_MAPPER.accept(widget, r); - dashboardWidget.setWidget(widget); - return Optional.of(dashboardWidget); - }; - - public static final RecordMapper INTEGRATION_TYPE_MAPPER = r -> { - IntegrationType integrationType = new IntegrationType(); - integrationType.setId(r.get(INTEGRATION_TYPE.ID, Long.class)); - integrationType.setEnabled(r.get(INTEGRATION_TYPE.ENABLED)); - integrationType.setCreationDate(r.get(INTEGRATION_TYPE.CREATION_DATE).toLocalDateTime()); - ofNullable(r.get(INTEGRATION_TYPE.AUTH_FLOW)).ifPresent(af -> { - integrationType.setAuthFlow(IntegrationAuthFlowEnum.findByName(af.getLiteral()) - .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_AUTHENTICATION_TYPE))); - }); - - integrationType.setName(r.get(INTEGRATION_TYPE.NAME)); - integrationType.setIntegrationGroup(IntegrationGroupEnum.findByName(r.get(INTEGRATION_TYPE.GROUP_TYPE).getLiteral()) - .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_AUTHENTICATION_TYPE))); - - String detailsJson = r.get(INTEGRATION_TYPE.DETAILS, String.class); - ofNullable(detailsJson).ifPresent(s -> { - try { - IntegrationTypeDetails details = objectMapper.readValue(s, IntegrationTypeDetails.class); - integrationType.setDetails(details); - } catch (IOException e) { - throw new ReportPortalException("Error during parsing integration type details"); - } - }); - - return integrationType; - }; - - public static final BiConsumer INTEGRATION_PARAMS_MAPPER = (i, r) -> { - String paramsJson = r.get(INTEGRATION.PARAMS, String.class); - ofNullable(paramsJson).ifPresent(s -> { - try { - IntegrationParams params = objectMapper.readValue(s, IntegrationParams.class); - i.setParams(params); - } catch (IOException e) { - throw new ReportPortalException("Error during parsing integration params"); - } - }); - }; - - public static final RecordMapper GLOBAL_INTEGRATION_RECORD_MAPPER = r -> { - - Integration integration = new Integration(); - integration.setId(r.get(INTEGRATION.ID, Long.class)); - integration.setName(r.get(INTEGRATION.NAME)); - integration.setType(INTEGRATION_TYPE_MAPPER.map(r)); - integration.setCreator(r.get(INTEGRATION.CREATOR)); - integration.setCreationDate(r.get(INTEGRATION.CREATION_DATE).toLocalDateTime()); - integration.setEnabled(r.get(INTEGRATION.ENABLED)); - INTEGRATION_PARAMS_MAPPER.accept(integration, r); - - return integration; - }; - - public static final RecordMapper PROJECT_INTEGRATION_RECORD_MAPPER = r -> { - - Integration integration = GLOBAL_INTEGRATION_RECORD_MAPPER.map(r); - - Project project = new Project(); - project.setId(r.get(INTEGRATION.PROJECT_ID)); - - integration.setProject(project); - - return integration; - }; + private static ObjectMapper objectMapper; + + static { + objectMapper = new ObjectMapper(); + objectMapper.registerModule(new JavaTimeModule()); + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + } + + /** + * Maps record into {@link Attribute} object + */ + public static final RecordMapper ATTRIBUTE_MAPPER = record -> { + Attribute attribute = new Attribute(); + ofNullable(record.field(ATTRIBUTE.ID)).ifPresent(f -> attribute.setId(record.get(f))); + ofNullable(record.field(ATTRIBUTE.NAME)).ifPresent(f -> attribute.setName(record.get(f))); + + return attribute; + }; + + /** + * Maps record into {@link IssueType} object + */ + public static final RecordMapper ISSUE_TYPE_RECORD_MAPPER = r -> { + IssueType type = r.into(IssueType.class); + type.setIssueGroup(r.into(IssueGroup.class)); + return type; + }; + + /** + * Maps record into {@link IssueEntity} object + */ + public static final RecordMapper ISSUE_RECORD_MAPPER = r -> { + IssueEntity issueEntity = r.into(IssueEntity.class); + issueEntity.setIssueType(ISSUE_TYPE_RECORD_MAPPER.map(r)); + return issueEntity; + }; + + /** + * Maps record into {@link Project} object + */ + public static final RecordMapper PROJECT_MAPPER = r -> { + Project project = r.into(PROJECT.ID, PROJECT.NAME, PROJECT.ORGANIZATION, PROJECT.CREATION_DATE, + PROJECT.PROJECT_TYPE) + .into(Project.class); + ofNullable(r.field(PROJECT.METADATA)).ifPresent(f -> { + String metaDataString = r.get(f, String.class); + ofNullable(metaDataString).ifPresent(md -> { + try { + Metadata metadata = objectMapper.readValue(metaDataString, Metadata.class); + project.setMetadata(metadata); + } catch (IOException e) { + throw new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, + "Error during parsing user metadata"); + } + }); + }); + + return project; + }; + + /** + * Maps record into {@link TestItemResults} object + */ + public static final RecordMapper TEST_ITEM_RESULTS_RECORD_MAPPER = r -> { + TestItemResults results = r.into(TestItemResults.class); + results.setIssue(ISSUE_RECORD_MAPPER.map(r)); + return results; + }; + + public static final RecordMapper STATISTICS_RECORD_MAPPER = r -> { + Statistics statistics = new Statistics(); + + StatisticsField statisticsField = new StatisticsField(); + statisticsField.setName(r.get(STATISTICS_FIELD.NAME)); + + statistics.setStatisticsField(statisticsField); + statistics.setCounter(ofNullable(r.get(Tables.STATISTICS.S_COUNTER)).orElse(0)); + return statistics; + }; + + public static final RecordMapper ATTACHMENT_MAPPER = r -> ofNullable( + r.get(ATTACHMENT.ID)).map(id -> { + Attachment attachment = new Attachment(); + attachment.setId(id); + attachment.setFileId(r.get(ATTACHMENT.FILE_ID)); + attachment.setThumbnailId(r.get(ATTACHMENT.THUMBNAIL_ID)); + attachment.setContentType(r.get(ATTACHMENT.CONTENT_TYPE)); + attachment.setFileSize(r.get(ATTACHMENT.FILE_SIZE)); + attachment.setProjectId(r.get(ATTACHMENT.PROJECT_ID)); + attachment.setLaunchId(r.get(ATTACHMENT.LAUNCH_ID)); + attachment.setItemId(r.get(ATTACHMENT.ITEM_ID)); + + return attachment; + }).orElse(null); + + private static final RecordMapper COMMON_LOG_RECORD_MAPPER = result -> { + Log log = new Log(); + log.setId(result.get(LOG.ID, Long.class)); + log.setLogTime(result.get(LOG.LOG_TIME, LocalDateTime.class)); + log.setLogMessage(result.get(LOG.LOG_MESSAGE, String.class)); + log.setLastModified(result.get(LOG.LAST_MODIFIED, LocalDateTime.class)); + log.setLogLevel(result.get(JLog.LOG.LOG_LEVEL, Integer.class)); + log.setProjectId(result.get(LOG.PROJECT_ID, Long.class)); + ofNullable(result.get(LOG.LAUNCH_ID)).map(Launch::new).ifPresent(log::setLaunch); + return log; + }; + + public static final RecordMapper LOG_RECORD_MAPPER = result -> { + Log log = COMMON_LOG_RECORD_MAPPER.map(result); + ofNullable(result.get(LOG.ITEM_ID)).map(TestItem::new).ifPresent(log::setTestItem); + return log; + }; + + public static final RecordMapper LOG_UNDER_RECORD_MAPPER = result -> { + Log log = COMMON_LOG_RECORD_MAPPER.map(result); + ofNullable(result.get(ROOT_ITEM_ID, Long.class)).map(TestItem::new).ifPresent(log::setTestItem); + log.setClusterId(result.get(LOG.CLUSTER_ID, Long.class)); + return log; + }; + + public static final Function, Map>> INDEX_LOG_FETCHER = result -> { + final Map> indexLogMapping = new HashMap<>(); + result.forEach(r -> { + final Long itemId = r.get(ROOT_ITEM_ID, Long.class); + + final IndexLog indexLog = new IndexLog(); + indexLog.setLogId(r.get(LOG.ID, Long.class)); + indexLog.setMessage(r.get(LOG.LOG_MESSAGE, String.class)); + indexLog.setLogLevel(r.get(JLog.LOG.LOG_LEVEL, Integer.class)); + indexLog.setLogTime(r.get(LOG.LOG_TIME, LocalDateTime.class)); + indexLog.setClusterId(r.get(CLUSTERS.INDEX_ID)); + + ofNullable(indexLogMapping.get(itemId)).ifPresentOrElse(indexLogs -> indexLogs.add(indexLog), + () -> { + final List indexLogs = new ArrayList<>(); + indexLogs.add(indexLog); + indexLogMapping.put(itemId, indexLogs); + }); + }); + return indexLogMapping; + }; + + public static final BiFunction, Log> LOG_MAPPER = (result, attachmentMapper) -> { + Log log = LOG_RECORD_MAPPER.map(result); + log.setAttachment(attachmentMapper.map(result)); + return log; + }; + + public static final BiFunction, Log> LOG_UNDER_MAPPER = (result, attachmentMapper) -> { + Log log = LOG_UNDER_RECORD_MAPPER.map(result); + log.setAttachment(attachmentMapper.map(result)); + return log; + }; + + /** + * Maps record into {@link TestItem} object + */ + public static final RecordMapper TEST_ITEM_RECORD_MAPPER = r -> { + TestItem testItem = r.into(TestItem.class); + testItem.setItemId(r.get(TEST_ITEM.ITEM_ID)); + testItem.setName(r.get(TEST_ITEM.NAME)); + testItem.setCodeRef(r.get(TEST_ITEM.CODE_REF)); + testItem.setItemResults(TEST_ITEM_RESULTS_RECORD_MAPPER.map(r)); + ofNullable(r.get(TEST_ITEM.LAUNCH_ID)).ifPresent(testItem::setLaunchId); + ofNullable(r.get(TEST_ITEM.PARENT_ID)).ifPresent(testItem::setParentId); + return testItem; + }; + + public static final RecordMapper INDEX_TEST_ITEM_RECORD_MAPPER = record -> { + final IndexTestItem indexTestItem = new IndexTestItem(); + indexTestItem.setTestItemId(record.get(TEST_ITEM.ITEM_ID)); + indexTestItem.setTestItemName(record.get(TEST_ITEM.NAME)); + indexTestItem.setStartTime(record.get(TEST_ITEM.START_TIME).toLocalDateTime()); + indexTestItem.setUniqueId(record.get(TEST_ITEM.UNIQUE_ID)); + indexTestItem.setTestCaseHash(record.get(TEST_ITEM.TEST_CASE_HASH)); + indexTestItem.setAutoAnalyzed(record.get(ISSUE.AUTO_ANALYZED)); + indexTestItem.setIssueTypeLocator(record.get(ISSUE_TYPE.LOCATOR)); + return indexTestItem; + }; + + public static final RecordMapper NESTED_STEP_RECORD_MAPPER = r -> new NestedStep( + r.get(TEST_ITEM.ITEM_ID), + r.get(TEST_ITEM.NAME), + r.get(TEST_ITEM.UUID), + TestItemTypeEnum.valueOf(r.get(TEST_ITEM.TYPE).getLiteral()), + r.get(HAS_CONTENT, Boolean.class), + r.get(ATTACHMENTS_COUNT, Integer.class), + StatusEnum.valueOf(r.get(TEST_ITEM_RESULTS.STATUS).getLiteral()), + r.get(TEST_ITEM.START_TIME, LocalDateTime.class), + r.get(TEST_ITEM_RESULTS.END_TIME, LocalDateTime.class), + r.get(TEST_ITEM_RESULTS.DURATION) + ); + + /** + * Maps record into {@link PatternTemplate} object (only {@link PatternTemplate#id} and + * {@link PatternTemplate#name} fields) + */ + public static final Function> PATTERN_TEMPLATE_NAME_RECORD_MAPPER = r -> ofNullable( + r.get( + PATTERN_TEMPLATE.NAME)).map(name -> { + PatternTemplate patternTemplate = new PatternTemplate(); + patternTemplate.setId(r.get(PATTERN_TEMPLATE.ID)); + patternTemplate.setName(name); + return patternTemplate; + }); + + /** + * Maps record into {@link Launch} object + */ + public static final RecordMapper LAUNCH_RECORD_MAPPER = r -> { + Launch launch = r.into(Launch.class); + launch.setId(r.get(LAUNCH.ID)); + launch.setName(r.get(LAUNCH.NAME)); + launch.setUserId(r.get(LAUNCH.USER_ID)); + return launch; + }; + + public static final RecordMapper INDEX_LAUNCH_RECORD_MAPPER = record -> { + final IndexLaunch indexLaunch = new IndexLaunch(); + indexLaunch.setLaunchId(record.get(LAUNCH.ID)); + indexLaunch.setLaunchName(record.get(LAUNCH.NAME)); + indexLaunch.setLaunchStartTime(record.get(LAUNCH.START_TIME).toLocalDateTime()); + indexLaunch.setProjectId(record.get(LAUNCH.PROJECT_ID)); + return indexLaunch; + }; + + public static final RecordMapper REPORT_PORTAL_USER_MAPPER = r -> ReportPortalUser.userBuilder() + .withUserName(r.get(USERS.LOGIN)) + .withPassword(ofNullable(r.get(USERS.PASSWORD)).orElse("")) + .withAuthorities(Collections.emptyList()) + .withUserId(r.get(USERS.ID)) + .withUserRole(UserRole.findByName(r.get(USERS.ROLE)) + .orElseThrow(() -> new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR))) + .withEmail(r.get(USERS.EMAIL)) + .build(); + + public static final RecordMapper USER_MAPPER = r -> { + User user = r.into( + USERS.fieldStream().filter(f -> fieldExcludingPredicate(USERS.METADATA).test(f)) + .toArray(Field[]::new)) + .into(User.class); + String metaDataString = r.get(USERS.METADATA, String.class); + ofNullable(metaDataString).ifPresent(md -> { + try { + Metadata metadata = objectMapper.readValue(metaDataString, Metadata.class); + user.setMetadata(metadata); + } catch (IOException e) { + throw new ReportPortalException("Error during parsing user metadata"); + } + }); + return user; + }; + + public static final RecordMapper PROJECT_USER_MAPPER = r -> { + ProjectUser projectUser = new ProjectUser(); + projectUser.setProjectRole(r.into(PROJECT_USER.PROJECT_ROLE).into(ProjectRole.class)); + + Project project = new Project(); + project.setId(r.get(PROJECT_USER.PROJECT_ID)); + project.setName(r.get(PROJECT.NAME)); + project.setProjectType(ProjectType.valueOf(r.get(PROJECT.PROJECT_TYPE))); + + User user = new User(); + user.setLogin(r.get(USERS.LOGIN)); + user.setId(r.get(PROJECT_USER.PROJECT_ID)); + + projectUser.setProject(project); + projectUser.setUser(user); + return projectUser; + }; + + public static final RecordMapper PROJECT_DETAILS_MAPPER = r -> { + final Long projectId = r.get(PROJECT_USER.PROJECT_ID); + final String projectName = r.get(PROJECT.NAME); + final ProjectRole projectRole = r.into(PROJECT_USER.PROJECT_ROLE).into(ProjectRole.class); + return new ReportPortalUser.ProjectDetails(projectId, projectName, projectRole); + }; + + public static final RecordMapper ACTIVITY_MAPPER = r -> { + Activity activity = new Activity(); + activity.setId(r.get(ACTIVITY.ID)); + activity.setUserId(r.get(ACTIVITY.USER_ID)); + activity.setProjectId(r.get(ACTIVITY.PROJECT_ID)); + activity.setAction(r.get(ACTIVITY.ACTION)); + activity.setUsername(ofNullable(r.get(USERS.LOGIN)).orElse(r.get(ACTIVITY.USERNAME))); + activity.setActivityEntityType(r.get(ACTIVITY.ENTITY, String.class)); + activity.setCreatedAt(r.get(ACTIVITY.CREATION_DATE, LocalDateTime.class)); + activity.setObjectId(r.get(ACTIVITY.OBJECT_ID)); + String detailsJson = r.get(ACTIVITY.DETAILS, String.class); + ofNullable(detailsJson).ifPresent(s -> { + try { + ActivityDetails details = objectMapper.readValue(s, ActivityDetails.class); + activity.setDetails(details); + } catch (IOException e) { + throw new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR); + } + }); + return activity; + }; + + public static final RecordMapper SHARED_ENTITY_MAPPER = r -> r.into( + SharedEntity.class); + + private static final BiConsumer WIDGET_USER_FILTER_MAPPER = (widget, res) -> ofNullable( + res.get(FILTER.ID)).ifPresent( + id -> { + Set filters = ofNullable(widget.getFilters()).orElseGet(Sets::newLinkedHashSet); + UserFilter filter = new UserFilter(); + filter.setId(id); + filters.add(filter); + widget.setFilters(filters); + }); + + private static final BiConsumer WIDGET_OPTIONS_MAPPER = (widget, res) -> { + ofNullable(res.get(WIDGET.WIDGET_OPTIONS, String.class)).ifPresent(wo -> { + try { + WidgetOptions widgetOptions = objectMapper.readValue(wo, WidgetOptions.class); + widget.setWidgetOptions(widgetOptions); + } catch (IOException e) { + throw new ReportPortalException("Error during parsing widget options"); + } + }); + }; + + private static final BiConsumer WIDGET_CONTENT_FIELD_MAPPER = (widget, res) -> ofNullable( + res.get(CONTENT_FIELD.FIELD)).ifPresent( + field -> { + Set contentFields = ofNullable(widget.getContentFields()).orElseGet( + Sets::newLinkedHashSet); + contentFields.add(field); + widget.setContentFields(contentFields); + }); + + public static final RecordMapper WIDGET_RECORD_MAPPER = r -> { + Widget widget = new Widget(); + widget.setDescription(r.get(WIDGET.DESCRIPTION)); + widget.setId(r.get(WIDGET.ID)); + widget.setName(r.get(WIDGET.NAME)); + widget.setItemsCount(r.get(WIDGET.ITEMS_COUNT)); + widget.setWidgetType(r.get(WIDGET.WIDGET_TYPE)); + + WIDGET_USER_FILTER_MAPPER.accept(widget, r); + WIDGET_OPTIONS_MAPPER.accept(widget, r); + WIDGET_CONTENT_FIELD_MAPPER.accept(widget, r); + + return widget; + }; + + public static final Function, List> WIDGET_FETCHER = result -> { + Map widgetMap = Maps.newLinkedHashMap(); + result.forEach(res -> { + Long widgetId = res.get(WIDGET.ID); + Widget widget = widgetMap.get(widgetId); + if (ofNullable(widget).isPresent()) { + WIDGET_USER_FILTER_MAPPER.accept(widget, res); + WIDGET_OPTIONS_MAPPER.accept(widget, res); + WIDGET_CONTENT_FIELD_MAPPER.accept(widget, res); + } else { + widgetMap.put(widgetId, WIDGET_RECORD_MAPPER.map(res)); + } + }); + + return Lists.newArrayList(widgetMap.values()); + }; + + public static final Function>> ITEM_ATTRIBUTE_MAPPER = r -> { + List attributeList = new ArrayList<>(); + + if (r.get(ATTRIBUTE_ALIAS) != null) { + String[] attributesArray = r.get(ATTRIBUTE_ALIAS, String[].class); + + for (String attributeString : attributesArray) { + if (Strings.isEmpty(attributeString)) { + continue; + } + + // explode attributes from string "key:value:system" + String[] attributes = attributeString.split(":", -1); + if (attributes.length > 1 && (Strings.isNotEmpty(attributes[0]) || Strings.isNotEmpty( + attributes[1]))) { + Boolean systemAttribute; + //Case when system attribute is retrieved as 't' or 'f' + if ("t".equals(attributes[2]) || "f".equals(attributes[2])) { + systemAttribute = "t".equals(attributes[2]) ? Boolean.TRUE : Boolean.FALSE; + } else { + systemAttribute = Boolean.parseBoolean(attributes[2]); + } + attributeList.add( + new ItemAttribute(attributes[0], attributes[1], systemAttribute) + ); + } + } + } + + if (attributeList.size() > 0) { + return Optional.of(attributeList); + } else { + return Optional.empty(); + } + }; + + public static final Function> TICKET_MAPPER = r -> { + String ticketId = r.get(TICKET.TICKET_ID); + if (ticketId != null) { + return Optional.of(r.into(Ticket.class)); + } + return Optional.empty(); + }; + + public static final Function> DASHBOARD_WIDGET_MAPPER = r -> { + Long widgetId = r.get(DASHBOARD_WIDGET.WIDGET_ID); + if (widgetId == null) { + return empty(); + } + DashboardWidget dashboardWidget = new DashboardWidget(); + dashboardWidget.setId(new DashboardWidgetId(r.get(DASHBOARD.ID), widgetId)); + dashboardWidget.setPositionX(r.get(DASHBOARD_WIDGET.WIDGET_POSITION_X)); + dashboardWidget.setPositionY(r.get(DASHBOARD_WIDGET.WIDGET_POSITION_Y)); + dashboardWidget.setHeight(r.get(DASHBOARD_WIDGET.WIDGET_HEIGHT)); + dashboardWidget.setWidth(r.get(DASHBOARD_WIDGET.WIDGET_WIDTH)); + dashboardWidget.setCreatedOn(r.get(DASHBOARD_WIDGET.IS_CREATED_ON)); + dashboardWidget.setWidgetOwner(r.get(DASHBOARD_WIDGET.WIDGET_OWNER)); + dashboardWidget.setWidgetName(r.get(DASHBOARD_WIDGET.WIDGET_NAME)); + dashboardWidget.setWidgetType(r.get(DASHBOARD_WIDGET.WIDGET_TYPE)); + dashboardWidget.setShare(r.get(DASHBOARD_WIDGET.SHARE)); + final Widget widget = new Widget(); + WIDGET_OPTIONS_MAPPER.accept(widget, r); + dashboardWidget.setWidget(widget); + return Optional.of(dashboardWidget); + }; + + public static final RecordMapper INTEGRATION_TYPE_MAPPER = r -> { + IntegrationType integrationType = new IntegrationType(); + integrationType.setId(r.get(INTEGRATION_TYPE.ID, Long.class)); + integrationType.setEnabled(r.get(INTEGRATION_TYPE.ENABLED)); + integrationType.setCreationDate(r.get(INTEGRATION_TYPE.CREATION_DATE).toLocalDateTime()); + ofNullable(r.get(INTEGRATION_TYPE.AUTH_FLOW)).ifPresent(af -> { + integrationType.setAuthFlow(IntegrationAuthFlowEnum.findByName(af.getLiteral()) + .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_AUTHENTICATION_TYPE))); + }); + + integrationType.setName(r.get(INTEGRATION_TYPE.NAME)); + integrationType.setIntegrationGroup( + IntegrationGroupEnum.findByName(r.get(INTEGRATION_TYPE.GROUP_TYPE).getLiteral()) + .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_AUTHENTICATION_TYPE))); + + String detailsJson = r.get(INTEGRATION_TYPE.DETAILS, String.class); + ofNullable(detailsJson).ifPresent(s -> { + try { + IntegrationTypeDetails details = objectMapper.readValue(s, IntegrationTypeDetails.class); + integrationType.setDetails(details); + } catch (IOException e) { + throw new ReportPortalException("Error during parsing integration type details"); + } + }); + + return integrationType; + }; + + public static final BiConsumer INTEGRATION_PARAMS_MAPPER = (i, r) -> { + String paramsJson = r.get(INTEGRATION.PARAMS, String.class); + ofNullable(paramsJson).ifPresent(s -> { + try { + IntegrationParams params = objectMapper.readValue(s, IntegrationParams.class); + i.setParams(params); + } catch (IOException e) { + throw new ReportPortalException("Error during parsing integration params"); + } + }); + }; + + public static final RecordMapper GLOBAL_INTEGRATION_RECORD_MAPPER = r -> { + + Integration integration = new Integration(); + integration.setId(r.get(INTEGRATION.ID, Long.class)); + integration.setName(r.get(INTEGRATION.NAME)); + integration.setType(INTEGRATION_TYPE_MAPPER.map(r)); + integration.setCreator(r.get(INTEGRATION.CREATOR)); + integration.setCreationDate(r.get(INTEGRATION.CREATION_DATE).toLocalDateTime()); + integration.setEnabled(r.get(INTEGRATION.ENABLED)); + INTEGRATION_PARAMS_MAPPER.accept(integration, r); + + return integration; + }; + + public static final RecordMapper PROJECT_INTEGRATION_RECORD_MAPPER = r -> { + + Integration integration = GLOBAL_INTEGRATION_RECORD_MAPPER.map(r); + + Project project = new Project(); + project.setId(r.get(INTEGRATION.PROJECT_ID)); + + integration.setProject(project); + + return integration; + }; } diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/ResultFetchers.java b/src/main/java/com/epam/ta/reportportal/dao/util/ResultFetchers.java index 21ba82411..8d24c7d17 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/ResultFetchers.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/ResultFetchers.java @@ -16,6 +16,33 @@ package com.epam.ta.reportportal.dao.util; +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.LOG_LEVEL; +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.PAGE_NUMBER; +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.TYPE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; +import static com.epam.ta.reportportal.dao.util.RecordMappers.ATTACHMENT_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.ATTRIBUTE_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.DASHBOARD_WIDGET_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.ITEM_ATTRIBUTE_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.LOG_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.PATTERN_TEMPLATE_NAME_RECORD_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.PROJECT_USER_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.TICKET_MAPPER; +import static com.epam.ta.reportportal.dao.util.RecordMappers.USER_MAPPER; +import static com.epam.ta.reportportal.jooq.Tables.ACTIVITY; +import static com.epam.ta.reportportal.jooq.Tables.FILTER_SORT; +import static com.epam.ta.reportportal.jooq.Tables.INTEGRATION; +import static com.epam.ta.reportportal.jooq.Tables.LAUNCH; +import static com.epam.ta.reportportal.jooq.Tables.LOG; +import static com.epam.ta.reportportal.jooq.Tables.PARAMETER; +import static com.epam.ta.reportportal.jooq.Tables.PROJECT_ATTRIBUTE; +import static com.epam.ta.reportportal.jooq.Tables.SHAREABLE_ENTITY; +import static com.epam.ta.reportportal.jooq.tables.JProject.PROJECT; +import static com.epam.ta.reportportal.jooq.tables.JProjectUser.PROJECT_USER; +import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; +import static com.epam.ta.reportportal.jooq.tables.JUsers.USERS; +import static java.util.Optional.ofNullable; + import com.epam.ta.reportportal.commons.ReportPortalUser; import com.epam.ta.reportportal.commons.querygen.FilterCondition; import com.epam.ta.reportportal.entity.activity.Activity; @@ -41,26 +68,18 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Function; import org.jooq.Record; import org.jooq.Result; import org.springframework.data.domain.Sort; import org.springframework.util.CollectionUtils; -import java.util.*; -import java.util.function.Function; - -import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.PAGE_NUMBER; -import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.TYPE; -import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.LOG_LEVEL; -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; -import static com.epam.ta.reportportal.dao.util.RecordMappers.*; -import static com.epam.ta.reportportal.jooq.Tables.*; -import static com.epam.ta.reportportal.jooq.tables.JProject.PROJECT; -import static com.epam.ta.reportportal.jooq.tables.JProjectUser.PROJECT_USER; -import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; -import static com.epam.ta.reportportal.jooq.tables.JUsers.USERS; -import static java.util.Optional.ofNullable; - /** * Fetches results from db by JOOQ queries into Java objects. * @@ -68,284 +87,284 @@ */ public class ResultFetchers { - private ResultFetchers() { - //static only - } - - /** - * Fetches records from db results into list of {@link Project} objects. - */ - public static final Function, List> PROJECT_FETCHER = records -> { - Map projects = Maps.newLinkedHashMap(); - records.forEach(record -> { - Long id = record.get(PROJECT.ID); - Project project; - if (!projects.containsKey(id)) { - project = RecordMappers.PROJECT_MAPPER.map(record); - } else { - project = projects.get(id); - } - ofNullable(record.field(PROJECT_ATTRIBUTE.VALUE)).flatMap(f -> ofNullable(record.get(f))) - .ifPresent(field -> project.getProjectAttributes() - .add(new ProjectAttribute().withProject(project).withAttribute(ATTRIBUTE_MAPPER.map(record)).withValue(field))); - ofNullable(record.field(PROJECT_USER.PROJECT_ROLE)).flatMap(f -> ofNullable(record.get(f))).ifPresent(field -> { - Set projectUsers = ofNullable(project.getUsers()).orElseGet(Sets::newHashSet); - projectUsers.add(PROJECT_USER_MAPPER.map(record)); - project.setUsers(projectUsers); - }); - - projects.put(id, project); - }); - return new ArrayList<>(projects.values()); - }; - - /** - * Fetches records from db results into list of {@link Launch} objects. - */ - public static final Function, List> LAUNCH_FETCHER = records -> { - Map launches = Maps.newLinkedHashMap(); - records.forEach(record -> { - Long id = record.get(LAUNCH.ID); - Launch launch; - if (!launches.containsKey(id)) { - launch = RecordMappers.LAUNCH_RECORD_MAPPER.map(record); - } else { - launch = launches.get(id); - } - ITEM_ATTRIBUTE_MAPPER.apply(record).ifPresent(it -> launch.getAttributes().addAll(it)); - launch.getStatistics().add(RecordMappers.STATISTICS_RECORD_MAPPER.map(record)); - launches.put(id, launch); - }); - return new ArrayList<>(launches.values()); - }; - - /** - * Fetches records from db results into list of {@link TestItem} objects. - */ - public static final Function, List> TEST_ITEM_FETCHER = records -> { - Map testItems = Maps.newLinkedHashMap(); - records.forEach(record -> { - Long id = record.get(TEST_ITEM.ITEM_ID); - TestItem testItem; - if (!testItems.containsKey(id)) { - testItem = RecordMappers.TEST_ITEM_RECORD_MAPPER.map(record); - } else { - testItem = testItems.get(id); - } - ITEM_ATTRIBUTE_MAPPER.apply(record).ifPresent(it -> testItem.getAttributes().addAll(it)); - ofNullable(record.get(PARAMETER.ITEM_ID)).ifPresent(it -> testItem.getParameters().add(record.into(Parameter.class))); - testItem.getItemResults().getStatistics().add(RecordMappers.STATISTICS_RECORD_MAPPER.map(record)); - PATTERN_TEMPLATE_NAME_RECORD_MAPPER.apply(record) - .ifPresent(patternTemplate -> testItem.getPatternTemplateTestItems() - .add(new PatternTemplateTestItem(patternTemplate, testItem))); - if (testItem.getItemResults().getIssue() != null) { - TICKET_MAPPER.apply(record).ifPresent(ticket -> testItem.getItemResults().getIssue().getTickets().add(ticket)); - } - testItems.put(id, testItem); - }); - return new ArrayList<>(testItems.values()); - }; - - /** - * Fetches records from db results into list of {@link TestItem} objects. - */ - public static final Function, List> TEST_ITEM_RETRY_FETCHER = records -> { - Map testItems = Maps.newLinkedHashMap(); - records.forEach(record -> { - Long id = record.get(TEST_ITEM.ITEM_ID); - TestItem testItem = testItems.computeIfAbsent(id, key -> RecordMappers.TEST_ITEM_RECORD_MAPPER.map(record)); - ofNullable(record.get(PARAMETER.ITEM_ID)).ifPresent(it -> testItem.getParameters().add(record.into(Parameter.class))); - testItems.put(id, testItem); - }); - return new ArrayList<>(testItems.values()); - }; - - /** - * Fetches records from db results into list of {@link com.epam.ta.reportportal.entity.log.Log} objects. - */ - public static final Function, List> LOG_FETCHER = records -> { - Map logs = Maps.newLinkedHashMap(); - records.forEach(record -> { - Long id = record.get(LOG.ID); - if (!logs.containsKey(id)) { - logs.put(id, LOG_MAPPER.apply(record, ATTACHMENT_MAPPER)); - } - }); - return new ArrayList<>(logs.values()); - }; - - /** - * Fetches records from db results into list of {@link Activity} objects. - */ - public static final Function, List> ACTIVITY_FETCHER = records -> { - Map activities = Maps.newLinkedHashMap(); - records.forEach(record -> { - Long id = record.get(ACTIVITY.ID); - Activity activity; - if (!activities.containsKey(id)) { - activity = RecordMappers.ACTIVITY_MAPPER.map(record); - } else { - activity = activities.get(id); - } - activities.put(id, activity); - }); - return new ArrayList<>(activities.values()); - }; - - /** - * Fetches records from db results into list of {@link com.epam.ta.reportportal.entity.integration.Integration} objects. - */ - public static final Function, List> INTEGRATION_FETCHER = records -> { - Map integrations = Maps.newLinkedHashMap(); - records.forEach(record -> { - Integer id = record.get(INTEGRATION.ID); - Integration integration; - if (!integrations.containsKey(id)) { - integration = record.into(Integration.class); - } else { - integration = integrations.get(id); - } - integrations.put(id, integration); - }); - return new ArrayList<>(integrations.values()); - }; - - public static final Function, List> USER_FETCHER = records -> { - Map users = Maps.newLinkedHashMap(); - records.forEach(record -> { - Long id = record.get(USERS.ID); - User user; - if (!users.containsKey(id)) { - user = record.map(USER_MAPPER); - } else { - user = users.get(id); - } - if (ofNullable(record.get(PROJECT_USER.PROJECT_ROLE)).isPresent()) { - user.getProjects().add(PROJECT_USER_MAPPER.map(record)); - } - - users.put(id, user); - }); - return new ArrayList<>(users.values()); - }; - - public static final Function, List> USER_WITHOUT_PROJECT_FETCHER = records -> { - Map users = Maps.newLinkedHashMap(); - records.forEach(record -> users.computeIfAbsent(record.get(USERS.ID), key -> record.map(USER_MAPPER))); - return new ArrayList<>(users.values()); - }; - - public static final Function, List> USER_FILTER_FETCHER = result -> { - Map userFilterMap = Maps.newLinkedHashMap(); - result.forEach(r -> { - Long userFilterID = r.get(ID, Long.class); - UserFilter userFilter; - if (userFilterMap.containsKey(userFilterID)) { - userFilter = userFilterMap.get(userFilterID); - } else { - userFilter = r.into(UserFilter.class); - userFilter.setOwner(r.get(SHAREABLE_ENTITY.OWNER)); - userFilter.setShared(r.get(SHAREABLE_ENTITY.SHARED)); - Project project = new Project(); - project.setId(r.get(SHAREABLE_ENTITY.PROJECT_ID, Long.class)); - userFilter.setProject(project); - } - userFilter.getFilterCondition().add(r.into(FilterCondition.class)); - FilterSort filterSort = new FilterSort(); - filterSort.setId(r.get(FILTER_SORT.ID)); - filterSort.setField(r.get(FILTER_SORT.FIELD)); - filterSort.setDirection(Sort.Direction.valueOf(r.get(FILTER_SORT.DIRECTION).toString())); - userFilter.getFilterSorts().add(filterSort); - userFilterMap.put(userFilterID, userFilter); - }); - return Lists.newArrayList(userFilterMap.values()); - }; - - public static final Function, List> DASHBOARD_FETCHER = result -> { - Map dashboardMap = Maps.newLinkedHashMap(); - result.forEach(r -> { - Long dashboardId = r.get(ID, Long.class); - Dashboard dashboard; - if (dashboardMap.containsKey(dashboardId)) { - dashboard = dashboardMap.get(dashboardId); - } else { - dashboard = r.into(Dashboard.class); - dashboard.setOwner(r.get(SHAREABLE_ENTITY.OWNER)); - dashboard.setShared(r.get(SHAREABLE_ENTITY.SHARED)); - Project project = new Project(); - project.setId(r.get(SHAREABLE_ENTITY.PROJECT_ID, Long.class)); - dashboard.setProject(project); - } - DASHBOARD_WIDGET_MAPPER.apply(r).ifPresent(it -> dashboard.getDashboardWidgets().add(it)); - dashboardMap.put(dashboardId, dashboard); - }); - return Lists.newArrayList(dashboardMap.values()); - }; - - public static final Function, List> WIDGET_FETCHER = result -> { - Map widgetMap = Maps.newLinkedHashMap(); - result.forEach(r -> { - Long widgetId = r.get(ID, Long.class); - Widget widget; - if (widgetMap.containsKey(widgetId)) { - widget = widgetMap.get(widgetId); - } else { - widget = r.into(Widget.class); - widget.setOwner(r.get(SHAREABLE_ENTITY.OWNER)); - widget.setShared(r.get(SHAREABLE_ENTITY.SHARED)); - Project project = new Project(); - project.setId(r.get(SHAREABLE_ENTITY.PROJECT_ID, Long.class)); - widget.setProject(project); - } - widgetMap.put(widgetId, widget); - }); - return Lists.newArrayList(widgetMap.values()); - }; + /** + * Fetches records from db results into list of {@link Project} objects. + */ + public static final Function, List> PROJECT_FETCHER = records -> { + Map projects = Maps.newLinkedHashMap(); + records.forEach(record -> { + Long id = record.get(PROJECT.ID); + Project project; + if (!projects.containsKey(id)) { + project = RecordMappers.PROJECT_MAPPER.map(record); + } else { + project = projects.get(id); + } + ofNullable(record.field(PROJECT_ATTRIBUTE.VALUE)).flatMap(f -> ofNullable(record.get(f))) + .ifPresent(field -> project.getProjectAttributes() + .add(new ProjectAttribute().withProject(project) + .withAttribute(ATTRIBUTE_MAPPER.map(record)).withValue(field))); + ofNullable(record.field(PROJECT_USER.PROJECT_ROLE)).flatMap(f -> ofNullable(record.get(f))) + .ifPresent(field -> { + Set projectUsers = ofNullable(project.getUsers()).orElseGet( + Sets::newHashSet); + projectUsers.add(PROJECT_USER_MAPPER.map(record)); + project.setUsers(projectUsers); + }); - public static final Function, List> NESTED_ITEM_FETCHER = result -> { - List nestedItems = Lists.newArrayListWithExpectedSize(result.size()); - result.forEach(record -> nestedItems.add(new NestedItem( - record.get(ID, Long.class), - record.get(TYPE, String.class), - record.get(LOG_LEVEL, Integer.class) - ))); - return nestedItems; - }; + projects.put(id, project); + }); + return new ArrayList<>(projects.values()); + }; + /** + * Fetches records from db results into list of {@link Launch} objects. + */ + public static final Function, List> LAUNCH_FETCHER = records -> { + Map launches = Maps.newLinkedHashMap(); + records.forEach(record -> { + Long id = record.get(LAUNCH.ID); + Launch launch; + if (!launches.containsKey(id)) { + launch = RecordMappers.LAUNCH_RECORD_MAPPER.map(record); + } else { + launch = launches.get(id); + } + ITEM_ATTRIBUTE_MAPPER.apply(record).ifPresent(it -> launch.getAttributes().addAll(it)); + launch.getStatistics().add(RecordMappers.STATISTICS_RECORD_MAPPER.map(record)); + launches.put(id, launch); + }); + return new ArrayList<>(launches.values()); + }; + /** + * Fetches records from db results into list of {@link TestItem} objects. + */ + public static final Function, List> TEST_ITEM_FETCHER = records -> { + Map testItems = Maps.newLinkedHashMap(); + records.forEach(record -> { + Long id = record.get(TEST_ITEM.ITEM_ID); + TestItem testItem; + if (!testItems.containsKey(id)) { + testItem = RecordMappers.TEST_ITEM_RECORD_MAPPER.map(record); + } else { + testItem = testItems.get(id); + } + ITEM_ATTRIBUTE_MAPPER.apply(record).ifPresent(it -> testItem.getAttributes().addAll(it)); + ofNullable(record.get(PARAMETER.ITEM_ID)).ifPresent( + it -> testItem.getParameters().add(record.into(Parameter.class))); + testItem.getItemResults().getStatistics() + .add(RecordMappers.STATISTICS_RECORD_MAPPER.map(record)); + PATTERN_TEMPLATE_NAME_RECORD_MAPPER.apply(record) + .ifPresent(patternTemplate -> testItem.getPatternTemplateTestItems() + .add(new PatternTemplateTestItem(patternTemplate, testItem))); + if (testItem.getItemResults().getIssue() != null) { + TICKET_MAPPER.apply(record) + .ifPresent(ticket -> testItem.getItemResults().getIssue().getTickets().add(ticket)); + } + testItems.put(id, testItem); + }); + return new ArrayList<>(testItems.values()); + }; + /** + * Fetches records from db results into list of {@link TestItem} objects. + */ + public static final Function, List> TEST_ITEM_RETRY_FETCHER = records -> { + Map testItems = Maps.newLinkedHashMap(); + records.forEach(record -> { + Long id = record.get(TEST_ITEM.ITEM_ID); + TestItem testItem = testItems.computeIfAbsent(id, + key -> RecordMappers.TEST_ITEM_RECORD_MAPPER.map(record)); + ofNullable(record.get(PARAMETER.ITEM_ID)).ifPresent( + it -> testItem.getParameters().add(record.into(Parameter.class))); + testItems.put(id, testItem); + }); + return new ArrayList<>(testItems.values()); + }; + /** + * Fetches records from db results into list of {@link com.epam.ta.reportportal.entity.log.Log} + * objects. + */ + public static final Function, List> LOG_FETCHER = records -> { + Map logs = Maps.newLinkedHashMap(); + records.forEach(record -> { + Long id = record.get(LOG.ID); + if (!logs.containsKey(id)) { + logs.put(id, LOG_MAPPER.apply(record, ATTACHMENT_MAPPER)); + } + }); + return new ArrayList<>(logs.values()); + }; + /** + * Fetches records from db results into list of {@link Activity} objects. + */ + public static final Function, List> ACTIVITY_FETCHER = records -> { + Map activities = Maps.newLinkedHashMap(); + records.forEach(record -> { + Long id = record.get(ACTIVITY.ID); + Activity activity; + if (!activities.containsKey(id)) { + activity = RecordMappers.ACTIVITY_MAPPER.map(record); + } else { + activity = activities.get(id); + } + activities.put(id, activity); + }); + return new ArrayList<>(activities.values()); + }; + /** + * Fetches records from db results into list of + * {@link com.epam.ta.reportportal.entity.integration.Integration} objects. + */ + public static final Function, List> INTEGRATION_FETCHER = records -> { + Map integrations = Maps.newLinkedHashMap(); + records.forEach(record -> { + Integer id = record.get(INTEGRATION.ID); + Integration integration; + if (!integrations.containsKey(id)) { + integration = record.into(Integration.class); + } else { + integration = integrations.get(id); + } + integrations.put(id, integration); + }); + return new ArrayList<>(integrations.values()); + }; + public static final Function, List> USER_FETCHER = records -> { + Map users = Maps.newLinkedHashMap(); + records.forEach(record -> { + Long id = record.get(USERS.ID); + User user; + if (!users.containsKey(id)) { + user = record.map(USER_MAPPER); + } else { + user = users.get(id); + } + if (ofNullable(record.get(PROJECT_USER.PROJECT_ROLE)).isPresent()) { + user.getProjects().add(PROJECT_USER_MAPPER.map(record)); + } - public static final Function, List> NESTED_ITEM_LOCATED_FETCHER = result -> { - List itemWithLocation = Lists.newArrayListWithExpectedSize(result.size()); - result.forEach(record -> itemWithLocation.add(new NestedItemPage(record.get(ID, Long.class), - record.get(TYPE, String.class), - record.get(LOG_LEVEL, Integer.class), - record.get(PAGE_NUMBER, Integer.class) - ))); - return itemWithLocation; - }; + users.put(id, user); + }); + return new ArrayList<>(users.values()); + }; + public static final Function, List> USER_WITHOUT_PROJECT_FETCHER = records -> { + Map users = Maps.newLinkedHashMap(); + records.forEach( + record -> users.computeIfAbsent(record.get(USERS.ID), key -> record.map(USER_MAPPER))); + return new ArrayList<>(users.values()); + }; + public static final Function, List> USER_FILTER_FETCHER = result -> { + Map userFilterMap = Maps.newLinkedHashMap(); + result.forEach(r -> { + Long userFilterID = r.get(ID, Long.class); + UserFilter userFilter; + if (userFilterMap.containsKey(userFilterID)) { + userFilter = userFilterMap.get(userFilterID); + } else { + userFilter = r.into(UserFilter.class); + userFilter.setOwner(r.get(SHAREABLE_ENTITY.OWNER)); + userFilter.setShared(r.get(SHAREABLE_ENTITY.SHARED)); + Project project = new Project(); + project.setId(r.get(SHAREABLE_ENTITY.PROJECT_ID, Long.class)); + userFilter.setProject(project); + } + userFilter.getFilterCondition().add(r.into(FilterCondition.class)); + FilterSort filterSort = new FilterSort(); + filterSort.setId(r.get(FILTER_SORT.ID)); + filterSort.setField(r.get(FILTER_SORT.FIELD)); + filterSort.setDirection(Sort.Direction.valueOf(r.get(FILTER_SORT.DIRECTION).toString())); + userFilter.getFilterSorts().add(filterSort); + userFilterMap.put(userFilterID, userFilter); + }); + return Lists.newArrayList(userFilterMap.values()); + }; + public static final Function, List> DASHBOARD_FETCHER = result -> { + Map dashboardMap = Maps.newLinkedHashMap(); + result.forEach(r -> { + Long dashboardId = r.get(ID, Long.class); + Dashboard dashboard; + if (dashboardMap.containsKey(dashboardId)) { + dashboard = dashboardMap.get(dashboardId); + } else { + dashboard = r.into(Dashboard.class); + dashboard.setOwner(r.get(SHAREABLE_ENTITY.OWNER)); + dashboard.setShared(r.get(SHAREABLE_ENTITY.SHARED)); + Project project = new Project(); + project.setId(r.get(SHAREABLE_ENTITY.PROJECT_ID, Long.class)); + dashboard.setProject(project); + } + DASHBOARD_WIDGET_MAPPER.apply(r).ifPresent(it -> dashboard.getDashboardWidgets().add(it)); + dashboardMap.put(dashboardId, dashboard); + }); + return Lists.newArrayList(dashboardMap.values()); + }; + public static final Function, List> WIDGET_FETCHER = result -> { + Map widgetMap = Maps.newLinkedHashMap(); + result.forEach(r -> { + Long widgetId = r.get(ID, Long.class); + Widget widget; + if (widgetMap.containsKey(widgetId)) { + widget = widgetMap.get(widgetId); + } else { + widget = r.into(Widget.class); + widget.setOwner(r.get(SHAREABLE_ENTITY.OWNER)); + widget.setShared(r.get(SHAREABLE_ENTITY.SHARED)); + Project project = new Project(); + project.setId(r.get(SHAREABLE_ENTITY.PROJECT_ID, Long.class)); + widget.setProject(project); + } + widgetMap.put(widgetId, widget); + }); + return Lists.newArrayList(widgetMap.values()); + }; + public static final Function, List> NESTED_ITEM_FETCHER = result -> { + List nestedItems = Lists.newArrayListWithExpectedSize(result.size()); + result.forEach(record -> nestedItems.add(new NestedItem( + record.get(ID, Long.class), + record.get(TYPE, String.class), + record.get(LOG_LEVEL, Integer.class) + ))); + return nestedItems; + }; + public static final Function, List> NESTED_ITEM_LOCATED_FETCHER = result -> { + List itemWithLocation = Lists.newArrayListWithExpectedSize(result.size()); + result.forEach(record -> itemWithLocation.add(new NestedItemPage(record.get(ID, Long.class), + record.get(TYPE, String.class), + record.get(LOG_LEVEL, Integer.class), + record.get(PAGE_NUMBER, Integer.class) + ))); + return itemWithLocation; + }; + public static final Function, ReportPortalUser> REPORTPORTAL_USER_FETCHER = records -> { + if (!CollectionUtils.isEmpty(records)) { + ReportPortalUser user = ReportPortalUser.userBuilder() + .withUserName(records.get(0).get(USERS.LOGIN)) + .withPassword(ofNullable(records.get(0).get(USERS.PASSWORD)).orElse("")) + .withAuthorities(Collections.emptyList()) + .withUserId(records.get(0).get(USERS.ID)) + .withUserRole(UserRole.findByName(records.get(0).get(USERS.ROLE)) + .orElseThrow( + () -> new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR))) + .withProjectDetails(new HashMap<>(records.size())) + .withEmail(records.get(0).get(USERS.EMAIL)) + .build(); + records.forEach( + record -> ofNullable(record.get(PROJECT_USER.PROJECT_ID, Long.class)).ifPresent( + projectId -> { + String projectName = record.get(PROJECT.NAME, String.class); + ReportPortalUser.ProjectDetails projectDetails = ReportPortalUser.ProjectDetails.builder() + .withProjectId(projectId) + .withProjectName(projectName) + .withProjectRole(record.get(PROJECT_USER.PROJECT_ROLE, String.class)) + .build(); + user.getProjectDetails().put(projectName, projectDetails); + })); + return user; + } + return null; + }; - public static final Function, ReportPortalUser> REPORTPORTAL_USER_FETCHER = records -> { - if (!CollectionUtils.isEmpty(records)) { - ReportPortalUser user = ReportPortalUser.userBuilder() - .withUserName(records.get(0).get(USERS.LOGIN)) - .withPassword(ofNullable(records.get(0).get(USERS.PASSWORD)).orElse("")) - .withAuthorities(Collections.emptyList()) - .withUserId(records.get(0).get(USERS.ID)) - .withUserRole(UserRole.findByName(records.get(0).get(USERS.ROLE)) - .orElseThrow(() -> new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR))) - .withProjectDetails(new HashMap<>(records.size())) - .withEmail(records.get(0).get(USERS.EMAIL)) - .build(); - records.forEach(record -> ofNullable(record.get(PROJECT_USER.PROJECT_ID, Long.class)).ifPresent(projectId -> { - String projectName = record.get(PROJECT.NAME, String.class); - ReportPortalUser.ProjectDetails projectDetails = ReportPortalUser.ProjectDetails.builder() - .withProjectId(projectId) - .withProjectName(projectName) - .withProjectRole(record.get(PROJECT_USER.PROJECT_ROLE, String.class)) - .build(); - user.getProjectDetails().put(projectName, projectDetails); - })); - return user; - } - return null; - }; + private ResultFetchers() { + //static only + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/ShareableUtils.java b/src/main/java/com/epam/ta/reportportal/dao/util/ShareableUtils.java index 7c918572d..9986f3191 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/ShareableUtils.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/ShareableUtils.java @@ -29,40 +29,41 @@ */ public class ShareableUtils { - private ShareableUtils() { - //static only - } + private ShareableUtils() { + //static only + } - /** - * Condition that retrieves entities only shared entities. - * - * @param userName Username - * @return Condition for shared entities - */ - public static Condition sharedCondition(String userName) { - return permittedCondition(userName).and(JShareableEntity.SHAREABLE_ENTITY.SHARED); - } + /** + * Condition that retrieves entities only shared entities. + * + * @param userName Username + * @return Condition for shared entities + */ + public static Condition sharedCondition(String userName) { + return permittedCondition(userName).and(JShareableEntity.SHAREABLE_ENTITY.SHARED); + } - /** - * Condition that retrieves entities permitted (shared + own) entities. - * - * @param userName Username - * @return Condition for permitted entities - */ - public static Condition permittedCondition(String userName) { - return JAclEntry.ACL_ENTRY.SID.in(DSL.select(JAclSid.ACL_SID.ID).from(JAclSid.ACL_SID).where(JAclSid.ACL_SID.SID.eq(userName))); - } + /** + * Condition that retrieves entities permitted (shared + own) entities. + * + * @param userName Username + * @return Condition for permitted entities + */ + public static Condition permittedCondition(String userName) { + return JAclEntry.ACL_ENTRY.SID.in(DSL.select(JAclSid.ACL_SID.ID).from(JAclSid.ACL_SID) + .where(JAclSid.ACL_SID.SID.eq(userName))); + } - /** - * Condition that retrieves entities of {@link FilterTarget} class only own entities. - * - * @param userName Username - * @return Condition for own entities - */ - public static Condition ownCondition(String userName) { - return JAclObjectIdentity.ACL_OBJECT_IDENTITY.OWNER_SID.in(DSL.select(JAclSid.ACL_SID.ID) - .from(JAclSid.ACL_SID) - .where(JAclSid.ACL_SID.SID.eq(userName))); - } + /** + * Condition that retrieves entities of {@link FilterTarget} class only own entities. + * + * @param userName Username + * @return Condition for own entities + */ + public static Condition ownCondition(String userName) { + return JAclObjectIdentity.ACL_OBJECT_IDENTITY.OWNER_SID.in(DSL.select(JAclSid.ACL_SID.ID) + .from(JAclSid.ACL_SID) + .where(JAclSid.ACL_SID.SID.eq(userName))); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/TimestampUtils.java b/src/main/java/com/epam/ta/reportportal/dao/util/TimestampUtils.java index d418205e4..0937d4c46 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/TimestampUtils.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/TimestampUtils.java @@ -25,11 +25,11 @@ */ public final class TimestampUtils { - private TimestampUtils() { - //static only - } + private TimestampUtils() { + //static only + } - public static Timestamp getTimestampBackFromNow(Duration period) { - return Timestamp.from(Instant.now().minusSeconds(period.getSeconds())); - } + public static Timestamp getTimestampBackFromNow(Duration period) { + return Timestamp.from(Instant.now().minusSeconds(period.getSeconds())); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/WidgetContentUtil.java b/src/main/java/com/epam/ta/reportportal/dao/util/WidgetContentUtil.java index f67cd9fe4..54e3c192b 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/WidgetContentUtil.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/WidgetContentUtil.java @@ -17,10 +17,70 @@ package com.epam.ta.reportportal.dao.util; +import static com.epam.ta.reportportal.commons.EntityUtils.TO_DATE; +import static com.epam.ta.reportportal.commons.querygen.QueryBuilder.STATISTICS_KEY; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_END_TIME; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_LAST_MODIFIED; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.AGGREGATED_VALUES; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ATTRIBUTE_KEY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ATTRIBUTE_VALUE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ATTR_ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ATTR_TABLE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.CRITERIA; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.DELTA; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.EXECUTIONS_PASSED; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.EXECUTIONS_TOTAL; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.FILTER_NAME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.FLAKY_COUNT; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.INVESTIGATED; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ITEM_ATTRIBUTES; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ITEM_NAME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.KEY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.LAUNCHES; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.LAUNCHES_TABLE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.NOT_PASSED_STATISTICS_KEY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.PASSING_RATE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.PERCENTAGE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.SF_NAME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.START_TIME_HISTORY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATISTICS_COUNTER; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATISTICS_TABLE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATUSES; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATUS_HISTORY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.SUM; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.TOTAL; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.TO_INVESTIGATE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.UNIQUE_ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.VALUE; +import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; +import static com.epam.ta.reportportal.jooq.tables.JActivity.ACTIVITY; +import static com.epam.ta.reportportal.jooq.tables.JItemAttribute.ITEM_ATTRIBUTE; +import static com.epam.ta.reportportal.jooq.tables.JLaunch.LAUNCH; +import static com.epam.ta.reportportal.jooq.tables.JPatternTemplate.PATTERN_TEMPLATE; +import static com.epam.ta.reportportal.jooq.tables.JProject.PROJECT; +import static com.epam.ta.reportportal.jooq.tables.JStatisticsField.STATISTICS_FIELD; +import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; +import static com.epam.ta.reportportal.jooq.tables.JTicket.TICKET; +import static com.epam.ta.reportportal.jooq.tables.JUsers.USERS; +import static java.util.Optional.ofNullable; + import com.epam.ta.reportportal.commons.querygen.CriteriaHolder; import com.epam.ta.reportportal.commons.querygen.FilterTarget; import com.epam.ta.reportportal.entity.activity.ActivityDetails; -import com.epam.ta.reportportal.entity.widget.content.*; +import com.epam.ta.reportportal.entity.widget.content.ChartStatisticsContent; +import com.epam.ta.reportportal.entity.widget.content.CriteriaHistoryItem; +import com.epam.ta.reportportal.entity.widget.content.CumulativeTrendChartContent; +import com.epam.ta.reportportal.entity.widget.content.CumulativeTrendChartEntry; +import com.epam.ta.reportportal.entity.widget.content.FlakyCasesTableContent; +import com.epam.ta.reportportal.entity.widget.content.LaunchesTableContent; +import com.epam.ta.reportportal.entity.widget.content.NotPassedCasesContent; +import com.epam.ta.reportportal.entity.widget.content.OverallStatisticsContent; +import com.epam.ta.reportportal.entity.widget.content.PatternTemplateLaunchStatistics; +import com.epam.ta.reportportal.entity.widget.content.PatternTemplateStatistics; +import com.epam.ta.reportportal.entity.widget.content.ProductStatusStatisticsContent; +import com.epam.ta.reportportal.entity.widget.content.TopPatternTemplatesContent; +import com.epam.ta.reportportal.entity.widget.content.UniqueBugContent; import com.epam.ta.reportportal.entity.widget.content.healthcheck.ComponentHealthCheckContent; import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableStatisticsContent; import com.epam.ta.reportportal.exception.ReportPortalException; @@ -34,42 +94,34 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; -import org.jooq.Field; -import org.jooq.Record; -import org.jooq.RecordMapper; -import org.jooq.Result; -import org.jooq.impl.DSL; - import java.io.IOException; import java.math.BigDecimal; import java.math.RoundingMode; import java.sql.Timestamp; import java.time.LocalDateTime; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; - -import static com.epam.ta.reportportal.commons.EntityUtils.TO_DATE; -import static com.epam.ta.reportportal.commons.querygen.QueryBuilder.STATISTICS_KEY; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_END_TIME; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_LAST_MODIFIED; -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; -import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; -import static com.epam.ta.reportportal.jooq.tables.JActivity.ACTIVITY; -import static com.epam.ta.reportportal.jooq.tables.JItemAttribute.ITEM_ATTRIBUTE; -import static com.epam.ta.reportportal.jooq.tables.JLaunch.LAUNCH; -import static com.epam.ta.reportportal.jooq.tables.JPatternTemplate.PATTERN_TEMPLATE; -import static com.epam.ta.reportportal.jooq.tables.JProject.PROJECT; -import static com.epam.ta.reportportal.jooq.tables.JStatisticsField.STATISTICS_FIELD; -import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; -import static com.epam.ta.reportportal.jooq.tables.JTicket.TICKET; -import static com.epam.ta.reportportal.jooq.tables.JUsers.USERS; -import static java.util.Optional.ofNullable; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; +import org.jooq.Field; +import org.jooq.Record; +import org.jooq.RecordMapper; +import org.jooq.Result; +import org.jooq.impl.DSL; /** * Util class for widget content repository. @@ -78,516 +130,540 @@ */ public class WidgetContentUtil { - private static ObjectMapper objectMapper; - - static { - objectMapper = new ObjectMapper(); - objectMapper.registerModule(new JavaTimeModule()); - objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - } - - private WidgetContentUtil() { - //static only - } - - private static final Function, Map> STATISTICS_FETCHER = result -> { - - Map resultMap = new LinkedHashMap<>(); - - result.forEach(record -> { - ChartStatisticsContent content; - if (resultMap.containsKey(record.get(LAUNCH.ID))) { - content = resultMap.get(record.get(LAUNCH.ID)); - } else { - content = record.into(ChartStatisticsContent.class); - resultMap.put(record.get(LAUNCH.ID), content); - } - - ofNullable(record.get(fieldName(STATISTICS_TABLE, SF_NAME), String.class)).ifPresent(v -> content.getValues() - .put(v, ofNullable(record.get(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), String.class)).orElse("0"))); - - }); - - return resultMap; - }; - - public static final Function, OverallStatisticsContent> OVERALL_STATISTICS_FETCHER = result -> { - Map values = new HashMap<>(); - - result.forEach(record -> ofNullable(record.get(STATISTICS_FIELD.NAME)).ifPresent(v -> values.put(v, - ofNullable(record.get(fieldName(SUM), Long.class)).orElse(0L) - ))); - - return new OverallStatisticsContent(values); - }; - - public static void consumeIfNotNull(K key, V value, BiConsumer consumer) { - ofNullable(key).ifPresent(k -> ofNullable(value).ifPresent(v -> consumer.accept(k, v))); - } - - public static final BiFunction, List, List> LAUNCHES_TABLE_FETCHER = (result, contentFields) -> { - - List nonStatisticsFields = contentFields.stream().filter(cf -> !cf.startsWith(STATISTICS_KEY)).collect(Collectors.toList()); - - nonStatisticsFields.removeAll(Stream.of(LAUNCH.ID, LAUNCH.NAME, LAUNCH.NUMBER, LAUNCH.START_TIME) - .map(cf -> CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, cf.getQualifiedName().last())) - .collect(Collectors.toList())); - - Map resultMap = new LinkedHashMap<>(); - - Map criteria = FilterTarget.LAUNCH_TARGET.getCriteriaHolders() - .stream() - .collect(Collectors.toMap(CriteriaHolder::getFilterCriteria, CriteriaHolder::getQueryCriteria)); - - Optional> statisticsField = ofNullable(result.field(fieldName(STATISTICS_TABLE, SF_NAME))); - Optional> startTimeField = ofNullable(result.field(LAUNCH.START_TIME.getQualifiedName().toString())); - Optional> itemAttributeIdField = ofNullable(result.field(ATTR_ID)); - - result.forEach(record -> { - LaunchesTableContent content; - if (resultMap.containsKey(record.get(LAUNCH.ID))) { - content = resultMap.get(record.get(LAUNCH.ID)); - } else { - content = new LaunchesTableContent(); - content.setId(record.get(LAUNCH.ID)); - content.setName(record.get(DSL.field(LAUNCH.NAME.getQualifiedName().toString()), String.class)); - content.setNumber(record.get(DSL.field(LAUNCH.NUMBER.getQualifiedName().toString()), Integer.class)); - - startTimeField.ifPresent(f -> content.setStartTime(record.get(f, Timestamp.class))); - } - - statisticsField.flatMap(sf -> ofNullable(record.get(sf, String.class))) - .ifPresent(v -> content.getValues() - .put(v, ofNullable(record.get(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), String.class)).orElse("0"))); - - resultMap.put(record.get(LAUNCH.ID), content); - - nonStatisticsFields.forEach(cf -> { - if (CRITERIA_END_TIME.equalsIgnoreCase(cf) || CRITERIA_LAST_MODIFIED.equalsIgnoreCase(cf)) { - consumeIfNotNull(cf, record.get(criteria.get(cf), Timestamp.class), (k, v) -> content.getValues().put(k, v)); - } else { - consumeIfNotNull(cf, record.get(criteria.get(cf)), (k, v) -> content.getValues().put(k, String.valueOf(v))); - } - }); - - itemAttributeIdField.flatMap(f -> ofNullable(record.get(f))).ifPresent(id -> { - Set attributes = ofNullable(content.getAttributes()).orElseGet(Sets::newLinkedHashSet); - - ItemAttributeResource attributeResource = new ItemAttributeResource(); - attributeResource.setKey(record.get(ITEM_ATTRIBUTE.KEY)); - attributeResource.setValue(record.get(ITEM_ATTRIBUTE.VALUE)); - - attributes.add(attributeResource); - - content.setAttributes(attributes); - }); - }); - - return new ArrayList<>(resultMap.values()); - - }; - - public static final RecordMapper ACTIVITY_MAPPER = r -> { - - ActivityResource activityResource = new ActivityResource(); - activityResource.setId(r.get(ACTIVITY.ID)); - activityResource.setUser(r.get(USERS.LOGIN)); - activityResource.setProjectId(r.get(ACTIVITY.PROJECT_ID)); - activityResource.setProjectName(r.get(PROJECT.NAME)); - activityResource.setActionType(r.get(ACTIVITY.ACTION)); - activityResource.setObjectType(r.get(ACTIVITY.ENTITY)); - activityResource.setLastModified(TO_DATE.apply(r.get(ACTIVITY.CREATION_DATE, LocalDateTime.class))); - activityResource.setLoggedObjectId(r.get(ACTIVITY.OBJECT_ID)); - String detailsJson = r.get(ACTIVITY.DETAILS, String.class); - ofNullable(detailsJson).ifPresent(s -> { - try { - ActivityDetails details = objectMapper.readValue(s, ActivityDetails.class); - activityResource.setDetails(details); - } catch (IOException e) { - throw new ReportPortalException(ErrorType.OBJECT_RETRIEVAL_ERROR, "Activity details"); - } - }); - return activityResource; - - }; - - private static final BiFunction, Record, ProductStatusStatisticsContent> PRODUCT_STATUS_WITHOUT_ATTRIBUTES_MAPPER = (mapping, record) -> { - ProductStatusStatisticsContent content; - if (mapping.containsKey(record.get(LAUNCH.ID))) { - content = mapping.get(record.get(LAUNCH.ID)); - } else { - content = record.into(ProductStatusStatisticsContent.class); - mapping.put(record.get(LAUNCH.ID), content); - } - - ofNullable(record.get(fieldName(STATISTICS_TABLE, SF_NAME), String.class)).ifPresent(v -> content.getValues() - .put(v, ofNullable(record.get(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), String.class)).orElse("0"))); - - return content; - }; - - private static void proceedProductStatusAttributes(Record record, String columnName, ProductStatusStatisticsContent content) { - - ofNullable(record.get(fieldName(ATTR_TABLE, ATTRIBUTE_VALUE), String.class)).ifPresent(value -> { - Map> attributesMapping = ofNullable(content.getAttributes()).orElseGet(LinkedHashMap::new); - Set attributeValues = attributesMapping.get(columnName); - if (ofNullable(attributeValues).isPresent()) { - attributeValues.add(value); - } else { - attributesMapping.put(columnName, Sets.newHashSet(value)); - } - content.setAttributes(attributesMapping); - }); - - } - - public static final BiFunction, Map, Map>> PRODUCT_STATUS_FILTER_GROUPED_FETCHER = (result, attributes) -> { - Map> filterMapping = new LinkedHashMap<>(); - - Optional> attributeField = ofNullable(result.field(fieldName(ATTR_TABLE, ATTRIBUTE_VALUE))); - Optional> startTimeField = ofNullable(result.field(LAUNCH.START_TIME.getQualifiedName().toString())); - Optional> statusField = ofNullable(result.field(LAUNCH.STATUS.getQualifiedName().toString())); - - result.forEach(record -> { - String filterName = record.get(fieldName(FILTER_NAME), String.class); - Map productStatusMapping; - if (filterMapping.containsKey(filterName)) { - productStatusMapping = filterMapping.get(filterName); - } else { - productStatusMapping = new LinkedHashMap<>(); - filterMapping.put(filterName, productStatusMapping); - } - - ProductStatusStatisticsContent content = PRODUCT_STATUS_WITHOUT_ATTRIBUTES_MAPPER.apply(productStatusMapping, record); - startTimeField.ifPresent(f -> content.setStartTime(record.get(f, Timestamp.class))); - statusField.ifPresent(f -> content.setStatus(record.get(f, String.class))); - if (attributeField.isPresent()) { - String attributeKey = record.get(fieldName(ATTR_TABLE, ATTRIBUTE_KEY), String.class); - attributes.entrySet() - .stream() - .filter(attributeName -> attributeKey == null || (StringUtils.isNotBlank(attributeKey) && attributeKey.startsWith( - attributeName.getValue()))) - .forEach(attribute -> proceedProductStatusAttributes(record, attribute.getKey(), content)); - - } - }); - - return filterMapping.entrySet() - .stream() - .collect(LinkedHashMap::new, - (res, filterMap) -> res.put(filterMap.getKey(), new ArrayList<>(filterMap.getValue().values())), - LinkedHashMap::putAll - ); - }; - - public static final BiFunction, Map, List> PRODUCT_STATUS_LAUNCH_GROUPED_FETCHER = (result, attributes) -> { - Map productStatusMapping = new LinkedHashMap<>(); - - Optional> attributeField = ofNullable(result.field(fieldName(ATTR_TABLE, ATTRIBUTE_VALUE))); - Optional> startTimeField = ofNullable(result.field(LAUNCH.START_TIME.getQualifiedName().toString())); - Optional> statusField = ofNullable(result.field(LAUNCH.STATUS.getQualifiedName().toString())); - - result.forEach(record -> { - ProductStatusStatisticsContent content = PRODUCT_STATUS_WITHOUT_ATTRIBUTES_MAPPER.apply(productStatusMapping, record); - startTimeField.ifPresent(f -> content.setStartTime(record.get(f, Timestamp.class))); - statusField.ifPresent(f -> content.setStatus(record.get(f, String.class))); - if (attributeField.isPresent()) { - String attributeKey = record.get(fieldName(ATTR_TABLE, ATTRIBUTE_KEY), String.class); - attributes.entrySet() - .stream() - .filter(attributeName -> attributeKey == null || (StringUtils.isNotBlank(attributeKey) && attributeKey.startsWith( - attributeName.getValue()))) - .forEach(attribute -> proceedProductStatusAttributes(record, attribute.getKey(), content)); - - } - }); - - return new ArrayList<>(productStatusMapping.values()); - }; - - public static final RecordMapper> ITEM_ATTRIBUTE_RESOURCE_MAPPER = record -> { - - String key = record.get(fieldName(ITEM_ATTRIBUTES, KEY), String.class); - String value = record.get(fieldName(ITEM_ATTRIBUTES, VALUE), String.class); - - if (key != null || value != null) { - return Optional.of(new ItemAttributeResource(key, value)); - } else { - return Optional.empty(); - } - }; - - private static final RecordMapper UNIQUE_BUG_CONTENT_RECORD_MAPPER = record -> { - UniqueBugContent uniqueBugContent = new UniqueBugContent(); - uniqueBugContent.setUrl(record.get(TICKET.URL)); - uniqueBugContent.setSubmitDate(record.get(TICKET.SUBMIT_DATE)); - uniqueBugContent.setSubmitter(record.get(TICKET.SUBMITTER)); - return uniqueBugContent; - }; - - private static final RecordMapper UNIQUE_BUG_ITEM_MAPPER = record -> { - UniqueBugContent.ItemInfo itemInfo = new UniqueBugContent.ItemInfo(); - itemInfo.setTestItemId(record.get(TEST_ITEM.ITEM_ID)); - itemInfo.setTestItemName(record.get(TEST_ITEM.NAME)); - itemInfo.setLaunchId(record.get(TEST_ITEM.LAUNCH_ID)); - itemInfo.setPath(record.get(TEST_ITEM.PATH, String.class)); - ITEM_ATTRIBUTE_RESOURCE_MAPPER.map(record).ifPresent(attribute -> itemInfo.getItemAttributeResources().add(attribute)); - return itemInfo; - }; - - public static final Function, Map> UNIQUE_BUG_CONTENT_FETCHER = result -> { - Map content = Maps.newLinkedHashMap(); - Map itemsMap = Maps.newHashMap(); - - result.forEach(record -> { - String ticketId = record.get(TICKET.TICKET_ID); - Long itemId = record.get(TEST_ITEM.ITEM_ID); - content.computeIfPresent(ticketId, (ticketID, bugContent) -> { - itemsMap.computeIfPresent(itemId, (itemID, itemInfo) -> { - ITEM_ATTRIBUTE_RESOURCE_MAPPER.map(record).ifPresent(attribute -> itemInfo.getItemAttributeResources().add(attribute)); - return itemInfo; - }); - itemsMap.computeIfAbsent(itemId, id -> { - UniqueBugContent.ItemInfo itemInfo = UNIQUE_BUG_ITEM_MAPPER.map(record); - bugContent.getItems().add(itemInfo); - return itemInfo; - }); - return bugContent; - }); - content.computeIfAbsent(ticketId, key -> { - UniqueBugContent.ItemInfo itemInfo = UNIQUE_BUG_ITEM_MAPPER.map(record); - itemsMap.put(itemId, itemInfo); - UniqueBugContent uniqueBugContent = UNIQUE_BUG_CONTENT_RECORD_MAPPER.map(record); - uniqueBugContent.getItems().add(itemInfo); - return uniqueBugContent; - }); - }); - - return content; - }; - - public static final Function, List> CUMULATIVE_TREND_CHART_FETCHER = result -> { - Map attributesMapping = Maps.newLinkedHashMap(); - - result.forEach(record -> { - String attributeValue = record.get(fieldName(LAUNCHES_TABLE, ATTRIBUTE_VALUE), String.class); - - String statistics = record.get(STATISTICS_FIELD.NAME, String.class); - Integer counter = record.get(STATISTICS_COUNTER, Integer.class); - - CumulativeTrendChartContent content = attributesMapping.getOrDefault(attributeValue, new CumulativeTrendChartContent()); - - Long[] launchIds = record.get(LAUNCHES, Long[].class); - if (ArrayUtils.isNotEmpty(launchIds)) { - content.getLaunchIds().addAll(Arrays.stream(launchIds).collect(Collectors.toSet())); - } - - content.getStatistics().computeIfPresent(statistics, (k, v) -> v + counter); - content.getStatistics().putIfAbsent(statistics, counter); - - attributesMapping.put(attributeValue, content); - }); - - return attributesMapping.entrySet() - .stream() - .map(entry -> new CumulativeTrendChartEntry(entry.getKey(), entry.getValue())) - .collect(Collectors.toCollection(LinkedList::new)); - }; - - public static final BiConsumer> CUMULATIVE_TOOLTIP_FETCHER = (cumulative, tooltipResult) -> { - tooltipResult.forEach(record -> { - String attributeKey = record.get(ATTRIBUTE_KEY, String.class); - String attributeValue = record.get(ATTRIBUTE_VALUE, String.class); - cumulative.getContent().getTooltipContent().add(attributeKey + ":" + attributeValue); - }); - }; - - public static final BiFunction, String, List> CASES_GROWTH_TREND_FETCHER = (result, contentField) -> { - List content = new ArrayList<>(result.size()); - - result.forEach(record -> { - ChartStatisticsContent statisticsContent = record.into(ChartStatisticsContent.class); - - ofNullable(record.get(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), - String.class - )).ifPresent(counter -> statisticsContent.getValues().put(contentField, counter)); - - ofNullable(record.get(fieldName(DELTA), String.class)).ifPresent(delta -> statisticsContent.getValues().put(DELTA, delta)); - - content.add(statisticsContent); - }); - - return content; - }; - - public static final Function, List> FLAKY_CASES_TABLE_FETCHER = result -> result.stream() - .map(record -> { - FlakyCasesTableContent entry = new FlakyCasesTableContent(); - entry.setStatuses((String[]) record.get(DSL.field(fieldName(STATUSES)))); - entry.setFlakyCount(record.get(DSL.field(fieldName(FLAKY_COUNT)), Long.class)); - entry.setTotal(record.get(DSL.field(fieldName(TOTAL)), Long.class)); - entry.setItemName(record.get(DSL.field(fieldName(ITEM_NAME)), String.class)); - entry.setUniqueId(record.get(DSL.field(fieldName(UNIQUE_ID)), String.class)); - entry.setStartTime(Collections.singletonList(record.get(DSL.field(fieldName(START_TIME_HISTORY)), Date.class))); - return entry; - }) - .collect(Collectors.toList()); - - public static final Function, List> CRITERIA_HISTORY_ITEM_FETCHER = result -> result.stream() - .map(record -> { - CriteriaHistoryItem entry = new CriteriaHistoryItem(); - entry.setStatus(record.get(DSL.field(fieldName(STATUS_HISTORY)), Boolean[].class)); - entry.setCriteria(record.get(DSL.field(fieldName(CRITERIA)), Long.class)); - entry.setTotal(record.get(DSL.field(fieldName(TOTAL)), Long.class)); - entry.setName(record.get(TEST_ITEM.NAME)); - entry.setUniqueId(record.get(TEST_ITEM.UNIQUE_ID)); - entry.setStartTime(Collections.singletonList(record.get(DSL.field(fieldName(START_TIME_HISTORY)), Date.class))); - return entry; - }) - .collect(Collectors.toList()); - - public static final Function, List> LAUNCHES_STATISTICS_FETCHER = result -> new ArrayList<>( - STATISTICS_FETCHER.apply(result).values()); - - public static final Function, List> BUG_TREND_STATISTICS_FETCHER = result -> { - Map resultMap = STATISTICS_FETCHER.apply(result); - - resultMap.values() - .forEach(content -> content.getValues() - .put(TOTAL, String.valueOf(content.getValues().values().stream().mapToInt(Integer::parseInt).sum()))); - - return new ArrayList<>(resultMap.values()); - }; - - public static final Function, List> INVESTIGATED_STATISTICS_FETCHER = result -> { - List statisticsContents = Lists.newArrayListWithExpectedSize(result.size()); - result.forEach(r -> ofNullable(r.get(TO_INVESTIGATE, Double.class)).ifPresent(toInvestigatePercentage -> { - ChartStatisticsContent content = r.into(ChartStatisticsContent.class); - content.getValues().put(TO_INVESTIGATE, String.valueOf(toInvestigatePercentage)); - content.getValues().put(INVESTIGATED, String.valueOf(100.0 - toInvestigatePercentage)); - statisticsContents.add(content); - })); - return statisticsContents; - }; - - public static final RecordMapper TIMELINE_INVESTIGATED_STATISTICS_RECORD_MAPPER = r -> { - ChartStatisticsContent res = r.into(ChartStatisticsContent.class); - res.getValues().put(TO_INVESTIGATE, String.valueOf(r.get(TO_INVESTIGATE, Integer.class))); - res.getValues().put(INVESTIGATED, String.valueOf(r.get(INVESTIGATED, Integer.class))); - return res; - }; - - public static final RecordMapper NOT_PASSED_CASES_CONTENT_RECORD_MAPPER = r -> { - NotPassedCasesContent res = r.into(NotPassedCasesContent.class); - res.setValues(Collections.singletonMap(NOT_PASSED_STATISTICS_KEY, r.getValue(fieldName(PERCENTAGE), String.class))); - return res; - }; - - public static final BiFunction, Boolean, Map>> PATTERN_TEMPLATES_AGGREGATION_FETCHER = (result, isLatest) -> { - Map> content; - if (isLatest) { - content = Maps.newLinkedHashMap(); - result.forEach(record -> { - String attribute = record.get(ITEM_ATTRIBUTE.VALUE, String.class); - List launchIds = content.computeIfAbsent(attribute, k -> Lists.newArrayList()); - launchIds.add(record.get(fieldName(ID), Long.class)); - }); - } else { - content = Maps.newLinkedHashMapWithExpectedSize(result.size()); - result.forEach(record -> { - String attribute = record.get(ITEM_ATTRIBUTE.VALUE, String.class); - content.put(attribute, Lists.newArrayList(record.get(fieldName(ID), Long[].class))); - }); - } - return content; - }; - - public static final Function, List> TOP_PATTERN_TEMPLATES_FETCHER = result -> { - - Map content = Maps.newLinkedHashMap(); - - result.forEach(record -> { - - String attributeValue = record.get(fieldName(ATTRIBUTE_VALUE), String.class); - TopPatternTemplatesContent patternTemplatesContent = content.computeIfAbsent(attributeValue, - k -> new TopPatternTemplatesContent(attributeValue) - ); - patternTemplatesContent.getPatternTemplates() - .add(new PatternTemplateStatistics(record.get(PATTERN_TEMPLATE.NAME), record.get(fieldName(TOTAL), Long.class))); - }); - - return new ArrayList<>(content.values()); - }; - - public static final Function, List> TOP_PATTERN_TEMPLATES_GROUPED_FETCHER = result -> { - - Map content = Maps.newLinkedHashMap(); - - result.forEach(record -> { - - String attributeValue = record.get(fieldName(ATTRIBUTE_VALUE), String.class); - TopPatternTemplatesContent patternTemplatesContent = content.computeIfAbsent(attributeValue, - k -> new TopPatternTemplatesContent(attributeValue) - ); - patternTemplatesContent.getPatternTemplates() - .add(new PatternTemplateLaunchStatistics(record.get(LAUNCH.NAME), - record.get(LAUNCH.NUMBER), - record.get(fieldName(TOTAL), Long.class), - record.get(LAUNCH.ID) - )); - }); - - return new ArrayList<>(content.values()); - }; - - public static final Function, List> COMPONENT_HEALTH_CHECK_FETCHER = result -> result.stream() - .map(record -> { - String attributeValue = record.get(fieldName(VALUE), String.class); - Long total = record.get(fieldName(TOTAL), Long.class); - Double passingRate = record.get(fieldName(PASSING_RATE), Double.class); - return new ComponentHealthCheckContent(attributeValue, total, passingRate); - }) - .collect(Collectors.toList()); - - public static final Function, Map> COMPONENT_HEALTH_CHECK_TABLE_STATS_FETCHER = result -> { - - Map resultMap = new LinkedHashMap<>(); - - result.forEach(record -> { - String attributeValue = record.get(fieldName(VALUE), String.class); - String statisticsField = record.get(STATISTICS_FIELD.NAME, String.class); - Integer counter = record.get(fieldName(SUM), Integer.class); - - HealthCheckTableStatisticsContent content; - if (resultMap.containsKey(attributeValue)) { - content = resultMap.get(attributeValue); - } else { - content = new HealthCheckTableStatisticsContent(); - resultMap.put(attributeValue, content); - } - content.getStatistics().put(statisticsField, counter); - - }); - - resultMap.forEach((key, content) -> { - double passingRate = 100.0 * content.getStatistics().getOrDefault(EXECUTIONS_PASSED, 0) / content.getStatistics() - .getOrDefault(EXECUTIONS_TOTAL, 1); - content.setPassingRate(new BigDecimal(passingRate).setScale(2, RoundingMode.HALF_UP).doubleValue()); - }); - - return resultMap; - }; - - public static final Function, Map>> COMPONENT_HEALTH_CHECK_TABLE_COLUMN_FETCHER = result -> { - - Map> resultMap = Maps.newLinkedHashMapWithExpectedSize(result.size()); - - result.forEach(record -> resultMap.put(record.get(fieldName(VALUE), String.class), - ofNullable(record.get(fieldName(AGGREGATED_VALUES), - String[].class - )).map(values -> (List) Lists.newArrayList(values)).orElseGet(Collections::emptyList) - )); - return resultMap; - }; + public static final Function, OverallStatisticsContent> OVERALL_STATISTICS_FETCHER = result -> { + Map values = new HashMap<>(); + + result.forEach( + record -> ofNullable(record.get(STATISTICS_FIELD.NAME)).ifPresent(v -> values.put(v, + ofNullable(record.get(fieldName(SUM), Long.class)).orElse(0L) + ))); + + return new OverallStatisticsContent(values); + }; + public static final BiFunction, List, List> LAUNCHES_TABLE_FETCHER = (result, contentFields) -> { + + List nonStatisticsFields = contentFields.stream() + .filter(cf -> !cf.startsWith(STATISTICS_KEY)).collect(Collectors.toList()); + + nonStatisticsFields.removeAll( + Stream.of(LAUNCH.ID, LAUNCH.NAME, LAUNCH.NUMBER, LAUNCH.START_TIME) + .map(cf -> CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, + cf.getQualifiedName().last())) + .collect(Collectors.toList())); + + Map resultMap = new LinkedHashMap<>(); + + Map criteria = FilterTarget.LAUNCH_TARGET.getCriteriaHolders() + .stream() + .collect( + Collectors.toMap(CriteriaHolder::getFilterCriteria, CriteriaHolder::getQueryCriteria)); + + Optional> statisticsField = ofNullable( + result.field(fieldName(STATISTICS_TABLE, SF_NAME))); + Optional> startTimeField = ofNullable( + result.field(LAUNCH.START_TIME.getQualifiedName().toString())); + Optional> itemAttributeIdField = ofNullable(result.field(ATTR_ID)); + + result.forEach(record -> { + LaunchesTableContent content; + if (resultMap.containsKey(record.get(LAUNCH.ID))) { + content = resultMap.get(record.get(LAUNCH.ID)); + } else { + content = new LaunchesTableContent(); + content.setId(record.get(LAUNCH.ID)); + content.setName( + record.get(DSL.field(LAUNCH.NAME.getQualifiedName().toString()), String.class)); + content.setNumber( + record.get(DSL.field(LAUNCH.NUMBER.getQualifiedName().toString()), Integer.class)); + + startTimeField.ifPresent(f -> content.setStartTime(record.get(f, Timestamp.class))); + } + + statisticsField.flatMap(sf -> ofNullable(record.get(sf, String.class))) + .ifPresent(v -> content.getValues() + .put(v, ofNullable( + record.get(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), String.class)).orElse( + "0"))); + + resultMap.put(record.get(LAUNCH.ID), content); + + nonStatisticsFields.forEach(cf -> { + if (CRITERIA_END_TIME.equalsIgnoreCase(cf) || CRITERIA_LAST_MODIFIED.equalsIgnoreCase(cf)) { + consumeIfNotNull(cf, record.get(criteria.get(cf), Timestamp.class), + (k, v) -> content.getValues().put(k, v)); + } else { + consumeIfNotNull(cf, record.get(criteria.get(cf)), + (k, v) -> content.getValues().put(k, String.valueOf(v))); + } + }); + + itemAttributeIdField.flatMap(f -> ofNullable(record.get(f))).ifPresent(id -> { + Set attributes = ofNullable(content.getAttributes()).orElseGet( + Sets::newLinkedHashSet); + + ItemAttributeResource attributeResource = new ItemAttributeResource(); + attributeResource.setKey(record.get(ITEM_ATTRIBUTE.KEY)); + attributeResource.setValue(record.get(ITEM_ATTRIBUTE.VALUE)); + + attributes.add(attributeResource); + + content.setAttributes(attributes); + }); + }); + + return new ArrayList<>(resultMap.values()); + + }; + public static final RecordMapper> ITEM_ATTRIBUTE_RESOURCE_MAPPER = record -> { + + String key = record.get(fieldName(ITEM_ATTRIBUTES, KEY), String.class); + String value = record.get(fieldName(ITEM_ATTRIBUTES, VALUE), String.class); + + if (key != null || value != null) { + return Optional.of(new ItemAttributeResource(key, value)); + } else { + return Optional.empty(); + } + }; + public static final Function, List> CUMULATIVE_TREND_CHART_FETCHER = result -> { + Map attributesMapping = Maps.newLinkedHashMap(); + + result.forEach(record -> { + String attributeValue = record.get(fieldName(LAUNCHES_TABLE, ATTRIBUTE_VALUE), String.class); + + String statistics = record.get(STATISTICS_FIELD.NAME, String.class); + Integer counter = record.get(STATISTICS_COUNTER, Integer.class); + + CumulativeTrendChartContent content = attributesMapping.getOrDefault(attributeValue, + new CumulativeTrendChartContent()); + + Long[] launchIds = record.get(LAUNCHES, Long[].class); + if (ArrayUtils.isNotEmpty(launchIds)) { + content.getLaunchIds().addAll(Arrays.stream(launchIds).collect(Collectors.toSet())); + } + + content.getStatistics().computeIfPresent(statistics, (k, v) -> v + counter); + content.getStatistics().putIfAbsent(statistics, counter); + + attributesMapping.put(attributeValue, content); + }); + + return attributesMapping.entrySet() + .stream() + .map(entry -> new CumulativeTrendChartEntry(entry.getKey(), entry.getValue())) + .collect(Collectors.toCollection(LinkedList::new)); + }; + public static final BiConsumer> CUMULATIVE_TOOLTIP_FETCHER = (cumulative, tooltipResult) -> { + tooltipResult.forEach(record -> { + String attributeKey = record.get(ATTRIBUTE_KEY, String.class); + String attributeValue = record.get(ATTRIBUTE_VALUE, String.class); + cumulative.getContent().getTooltipContent().add(attributeKey + ":" + attributeValue); + }); + }; + public static final BiFunction, String, List> CASES_GROWTH_TREND_FETCHER = (result, contentField) -> { + List content = new ArrayList<>(result.size()); + + result.forEach(record -> { + ChartStatisticsContent statisticsContent = record.into(ChartStatisticsContent.class); + + ofNullable(record.get(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), + String.class + )).ifPresent(counter -> statisticsContent.getValues().put(contentField, counter)); + + ofNullable(record.get(fieldName(DELTA), String.class)).ifPresent( + delta -> statisticsContent.getValues().put(DELTA, delta)); + + content.add(statisticsContent); + }); + + return content; + }; + public static final Function, List> FLAKY_CASES_TABLE_FETCHER = result -> result.stream() + .map(record -> { + FlakyCasesTableContent entry = new FlakyCasesTableContent(); + entry.setStatuses((String[]) record.get(DSL.field(fieldName(STATUSES)))); + entry.setFlakyCount(record.get(DSL.field(fieldName(FLAKY_COUNT)), Long.class)); + entry.setTotal(record.get(DSL.field(fieldName(TOTAL)), Long.class)); + entry.setItemName(record.get(DSL.field(fieldName(ITEM_NAME)), String.class)); + entry.setUniqueId(record.get(DSL.field(fieldName(UNIQUE_ID)), String.class)); + entry.setStartTime(Collections.singletonList( + record.get(DSL.field(fieldName(START_TIME_HISTORY)), Date.class))); + return entry; + }) + .collect(Collectors.toList()); + public static final Function, List> CRITERIA_HISTORY_ITEM_FETCHER = result -> result.stream() + .map(record -> { + CriteriaHistoryItem entry = new CriteriaHistoryItem(); + entry.setStatus(record.get(DSL.field(fieldName(STATUS_HISTORY)), Boolean[].class)); + entry.setCriteria(record.get(DSL.field(fieldName(CRITERIA)), Long.class)); + entry.setTotal(record.get(DSL.field(fieldName(TOTAL)), Long.class)); + entry.setName(record.get(TEST_ITEM.NAME)); + entry.setUniqueId(record.get(TEST_ITEM.UNIQUE_ID)); + entry.setStartTime(Collections.singletonList( + record.get(DSL.field(fieldName(START_TIME_HISTORY)), Date.class))); + return entry; + }) + .collect(Collectors.toList()); + public static final Function, List> INVESTIGATED_STATISTICS_FETCHER = result -> { + List statisticsContents = Lists.newArrayListWithExpectedSize( + result.size()); + result.forEach( + r -> ofNullable(r.get(TO_INVESTIGATE, Double.class)).ifPresent(toInvestigatePercentage -> { + ChartStatisticsContent content = r.into(ChartStatisticsContent.class); + content.getValues().put(TO_INVESTIGATE, String.valueOf(toInvestigatePercentage)); + content.getValues().put(INVESTIGATED, String.valueOf(100.0 - toInvestigatePercentage)); + statisticsContents.add(content); + })); + return statisticsContents; + }; + public static final RecordMapper TIMELINE_INVESTIGATED_STATISTICS_RECORD_MAPPER = r -> { + ChartStatisticsContent res = r.into(ChartStatisticsContent.class); + res.getValues().put(TO_INVESTIGATE, String.valueOf(r.get(TO_INVESTIGATE, Integer.class))); + res.getValues().put(INVESTIGATED, String.valueOf(r.get(INVESTIGATED, Integer.class))); + return res; + }; + public static final RecordMapper NOT_PASSED_CASES_CONTENT_RECORD_MAPPER = r -> { + NotPassedCasesContent res = r.into(NotPassedCasesContent.class); + res.setValues(Collections.singletonMap(NOT_PASSED_STATISTICS_KEY, + r.getValue(fieldName(PERCENTAGE), String.class))); + return res; + }; + public static final BiFunction, Boolean, Map>> PATTERN_TEMPLATES_AGGREGATION_FETCHER = (result, isLatest) -> { + Map> content; + if (isLatest) { + content = Maps.newLinkedHashMap(); + result.forEach(record -> { + String attribute = record.get(ITEM_ATTRIBUTE.VALUE, String.class); + List launchIds = content.computeIfAbsent(attribute, k -> Lists.newArrayList()); + launchIds.add(record.get(fieldName(ID), Long.class)); + }); + } else { + content = Maps.newLinkedHashMapWithExpectedSize(result.size()); + result.forEach(record -> { + String attribute = record.get(ITEM_ATTRIBUTE.VALUE, String.class); + content.put(attribute, Lists.newArrayList(record.get(fieldName(ID), Long[].class))); + }); + } + return content; + }; + public static final Function, List> TOP_PATTERN_TEMPLATES_FETCHER = result -> { + + Map content = Maps.newLinkedHashMap(); + + result.forEach(record -> { + + String attributeValue = record.get(fieldName(ATTRIBUTE_VALUE), String.class); + TopPatternTemplatesContent patternTemplatesContent = content.computeIfAbsent(attributeValue, + k -> new TopPatternTemplatesContent(attributeValue) + ); + patternTemplatesContent.getPatternTemplates() + .add(new PatternTemplateStatistics(record.get(PATTERN_TEMPLATE.NAME), + record.get(fieldName(TOTAL), Long.class))); + }); + + return new ArrayList<>(content.values()); + }; + public static final Function, List> TOP_PATTERN_TEMPLATES_GROUPED_FETCHER = result -> { + + Map content = Maps.newLinkedHashMap(); + + result.forEach(record -> { + + String attributeValue = record.get(fieldName(ATTRIBUTE_VALUE), String.class); + TopPatternTemplatesContent patternTemplatesContent = content.computeIfAbsent(attributeValue, + k -> new TopPatternTemplatesContent(attributeValue) + ); + patternTemplatesContent.getPatternTemplates() + .add(new PatternTemplateLaunchStatistics(record.get(LAUNCH.NAME), + record.get(LAUNCH.NUMBER), + record.get(fieldName(TOTAL), Long.class), + record.get(LAUNCH.ID) + )); + }); + + return new ArrayList<>(content.values()); + }; + public static final Function, List> COMPONENT_HEALTH_CHECK_FETCHER = result -> result.stream() + .map(record -> { + String attributeValue = record.get(fieldName(VALUE), String.class); + Long total = record.get(fieldName(TOTAL), Long.class); + Double passingRate = record.get(fieldName(PASSING_RATE), Double.class); + return new ComponentHealthCheckContent(attributeValue, total, passingRate); + }) + .collect(Collectors.toList()); + public static final Function, Map> COMPONENT_HEALTH_CHECK_TABLE_STATS_FETCHER = result -> { + + Map resultMap = new LinkedHashMap<>(); + + result.forEach(record -> { + String attributeValue = record.get(fieldName(VALUE), String.class); + String statisticsField = record.get(STATISTICS_FIELD.NAME, String.class); + Integer counter = record.get(fieldName(SUM), Integer.class); + + HealthCheckTableStatisticsContent content; + if (resultMap.containsKey(attributeValue)) { + content = resultMap.get(attributeValue); + } else { + content = new HealthCheckTableStatisticsContent(); + resultMap.put(attributeValue, content); + } + content.getStatistics().put(statisticsField, counter); + + }); + + resultMap.forEach((key, content) -> { + double passingRate = 100.0 * content.getStatistics().getOrDefault(EXECUTIONS_PASSED, 0) + / content.getStatistics() + .getOrDefault(EXECUTIONS_TOTAL, 1); + content.setPassingRate( + new BigDecimal(passingRate).setScale(2, RoundingMode.HALF_UP).doubleValue()); + }); + + return resultMap; + }; + public static final Function, Map>> COMPONENT_HEALTH_CHECK_TABLE_COLUMN_FETCHER = result -> { + + Map> resultMap = Maps.newLinkedHashMapWithExpectedSize(result.size()); + + result.forEach(record -> resultMap.put(record.get(fieldName(VALUE), String.class), + ofNullable(record.get(fieldName(AGGREGATED_VALUES), + String[].class + )).map(values -> (List) Lists.newArrayList(values)) + .orElseGet(Collections::emptyList) + )); + return resultMap; + }; + private static final Function, Map> STATISTICS_FETCHER = result -> { + + Map resultMap = new LinkedHashMap<>(); + + result.forEach(record -> { + ChartStatisticsContent content; + if (resultMap.containsKey(record.get(LAUNCH.ID))) { + content = resultMap.get(record.get(LAUNCH.ID)); + } else { + content = record.into(ChartStatisticsContent.class); + resultMap.put(record.get(LAUNCH.ID), content); + } + + ofNullable(record.get(fieldName(STATISTICS_TABLE, SF_NAME), String.class)).ifPresent( + v -> content.getValues() + .put(v, ofNullable( + record.get(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), String.class)).orElse( + "0"))); + + }); + + return resultMap; + }; + public static final Function, List> LAUNCHES_STATISTICS_FETCHER = result -> new ArrayList<>( + STATISTICS_FETCHER.apply(result).values()); + public static final Function, List> BUG_TREND_STATISTICS_FETCHER = result -> { + Map resultMap = STATISTICS_FETCHER.apply(result); + + resultMap.values() + .forEach(content -> content.getValues() + .put(TOTAL, String.valueOf( + content.getValues().values().stream().mapToInt(Integer::parseInt).sum()))); + + return new ArrayList<>(resultMap.values()); + }; + private static final BiFunction, Record, ProductStatusStatisticsContent> PRODUCT_STATUS_WITHOUT_ATTRIBUTES_MAPPER = (mapping, record) -> { + ProductStatusStatisticsContent content; + if (mapping.containsKey(record.get(LAUNCH.ID))) { + content = mapping.get(record.get(LAUNCH.ID)); + } else { + content = record.into(ProductStatusStatisticsContent.class); + mapping.put(record.get(LAUNCH.ID), content); + } + + ofNullable(record.get(fieldName(STATISTICS_TABLE, SF_NAME), String.class)).ifPresent( + v -> content.getValues() + .put(v, ofNullable( + record.get(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER), String.class)).orElse( + "0"))); + + return content; + }; + public static final BiFunction, Map, Map>> PRODUCT_STATUS_FILTER_GROUPED_FETCHER = (result, attributes) -> { + Map> filterMapping = new LinkedHashMap<>(); + + Optional> attributeField = ofNullable( + result.field(fieldName(ATTR_TABLE, ATTRIBUTE_VALUE))); + Optional> startTimeField = ofNullable( + result.field(LAUNCH.START_TIME.getQualifiedName().toString())); + Optional> statusField = ofNullable( + result.field(LAUNCH.STATUS.getQualifiedName().toString())); + + result.forEach(record -> { + String filterName = record.get(fieldName(FILTER_NAME), String.class); + Map productStatusMapping; + if (filterMapping.containsKey(filterName)) { + productStatusMapping = filterMapping.get(filterName); + } else { + productStatusMapping = new LinkedHashMap<>(); + filterMapping.put(filterName, productStatusMapping); + } + + ProductStatusStatisticsContent content = PRODUCT_STATUS_WITHOUT_ATTRIBUTES_MAPPER.apply( + productStatusMapping, record); + startTimeField.ifPresent(f -> content.setStartTime(record.get(f, Timestamp.class))); + statusField.ifPresent(f -> content.setStatus(record.get(f, String.class))); + if (attributeField.isPresent()) { + String attributeKey = record.get(fieldName(ATTR_TABLE, ATTRIBUTE_KEY), String.class); + attributes.entrySet() + .stream() + .filter(attributeName -> attributeKey == null || (StringUtils.isNotBlank(attributeKey) + && attributeKey.startsWith( + attributeName.getValue()))) + .forEach( + attribute -> proceedProductStatusAttributes(record, attribute.getKey(), content)); + + } + }); + + return filterMapping.entrySet() + .stream() + .collect(LinkedHashMap::new, + (res, filterMap) -> res.put(filterMap.getKey(), + new ArrayList<>(filterMap.getValue().values())), + LinkedHashMap::putAll + ); + }; + public static final BiFunction, Map, List> PRODUCT_STATUS_LAUNCH_GROUPED_FETCHER = (result, attributes) -> { + Map productStatusMapping = new LinkedHashMap<>(); + + Optional> attributeField = ofNullable( + result.field(fieldName(ATTR_TABLE, ATTRIBUTE_VALUE))); + Optional> startTimeField = ofNullable( + result.field(LAUNCH.START_TIME.getQualifiedName().toString())); + Optional> statusField = ofNullable( + result.field(LAUNCH.STATUS.getQualifiedName().toString())); + + result.forEach(record -> { + ProductStatusStatisticsContent content = PRODUCT_STATUS_WITHOUT_ATTRIBUTES_MAPPER.apply( + productStatusMapping, record); + startTimeField.ifPresent(f -> content.setStartTime(record.get(f, Timestamp.class))); + statusField.ifPresent(f -> content.setStatus(record.get(f, String.class))); + if (attributeField.isPresent()) { + String attributeKey = record.get(fieldName(ATTR_TABLE, ATTRIBUTE_KEY), String.class); + attributes.entrySet() + .stream() + .filter(attributeName -> attributeKey == null || (StringUtils.isNotBlank(attributeKey) + && attributeKey.startsWith( + attributeName.getValue()))) + .forEach( + attribute -> proceedProductStatusAttributes(record, attribute.getKey(), content)); + + } + }); + + return new ArrayList<>(productStatusMapping.values()); + }; + private static final RecordMapper UNIQUE_BUG_CONTENT_RECORD_MAPPER = record -> { + UniqueBugContent uniqueBugContent = new UniqueBugContent(); + uniqueBugContent.setUrl(record.get(TICKET.URL)); + uniqueBugContent.setSubmitDate(record.get(TICKET.SUBMIT_DATE)); + uniqueBugContent.setSubmitter(record.get(TICKET.SUBMITTER)); + return uniqueBugContent; + }; + private static final RecordMapper UNIQUE_BUG_ITEM_MAPPER = record -> { + UniqueBugContent.ItemInfo itemInfo = new UniqueBugContent.ItemInfo(); + itemInfo.setTestItemId(record.get(TEST_ITEM.ITEM_ID)); + itemInfo.setTestItemName(record.get(TEST_ITEM.NAME)); + itemInfo.setLaunchId(record.get(TEST_ITEM.LAUNCH_ID)); + itemInfo.setPath(record.get(TEST_ITEM.PATH, String.class)); + ITEM_ATTRIBUTE_RESOURCE_MAPPER.map(record) + .ifPresent(attribute -> itemInfo.getItemAttributeResources().add(attribute)); + return itemInfo; + }; + public static final Function, Map> UNIQUE_BUG_CONTENT_FETCHER = result -> { + Map content = Maps.newLinkedHashMap(); + Map itemsMap = Maps.newHashMap(); + + result.forEach(record -> { + String ticketId = record.get(TICKET.TICKET_ID); + Long itemId = record.get(TEST_ITEM.ITEM_ID); + content.computeIfPresent(ticketId, (ticketID, bugContent) -> { + itemsMap.computeIfPresent(itemId, (itemID, itemInfo) -> { + ITEM_ATTRIBUTE_RESOURCE_MAPPER.map(record) + .ifPresent(attribute -> itemInfo.getItemAttributeResources().add(attribute)); + return itemInfo; + }); + itemsMap.computeIfAbsent(itemId, id -> { + UniqueBugContent.ItemInfo itemInfo = UNIQUE_BUG_ITEM_MAPPER.map(record); + bugContent.getItems().add(itemInfo); + return itemInfo; + }); + return bugContent; + }); + content.computeIfAbsent(ticketId, key -> { + UniqueBugContent.ItemInfo itemInfo = UNIQUE_BUG_ITEM_MAPPER.map(record); + itemsMap.put(itemId, itemInfo); + UniqueBugContent uniqueBugContent = UNIQUE_BUG_CONTENT_RECORD_MAPPER.map(record); + uniqueBugContent.getItems().add(itemInfo); + return uniqueBugContent; + }); + }); + + return content; + }; + private static ObjectMapper objectMapper; + public static final RecordMapper ACTIVITY_MAPPER = r -> { + + ActivityResource activityResource = new ActivityResource(); + activityResource.setId(r.get(ACTIVITY.ID)); + activityResource.setUser(r.get(USERS.LOGIN)); + activityResource.setProjectId(r.get(ACTIVITY.PROJECT_ID)); + activityResource.setProjectName(r.get(PROJECT.NAME)); + activityResource.setActionType(r.get(ACTIVITY.ACTION)); + activityResource.setObjectType(r.get(ACTIVITY.ENTITY)); + activityResource.setLastModified( + TO_DATE.apply(r.get(ACTIVITY.CREATION_DATE, LocalDateTime.class))); + activityResource.setLoggedObjectId(r.get(ACTIVITY.OBJECT_ID)); + String detailsJson = r.get(ACTIVITY.DETAILS, String.class); + ofNullable(detailsJson).ifPresent(s -> { + try { + ActivityDetails details = objectMapper.readValue(s, ActivityDetails.class); + activityResource.setDetails(details); + } catch (IOException e) { + throw new ReportPortalException(ErrorType.OBJECT_RETRIEVAL_ERROR, "Activity details"); + } + }); + return activityResource; + + }; + + static { + objectMapper = new ObjectMapper(); + objectMapper.registerModule(new JavaTimeModule()); + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + } + + private WidgetContentUtil() { + //static only + } + + public static void consumeIfNotNull(K key, V value, BiConsumer consumer) { + ofNullable(key).ifPresent(k -> ofNullable(value).ifPresent(v -> consumer.accept(k, v))); + } + + private static void proceedProductStatusAttributes(Record record, String columnName, + ProductStatusStatisticsContent content) { + + ofNullable(record.get(fieldName(ATTR_TABLE, ATTRIBUTE_VALUE), String.class)).ifPresent( + value -> { + Map> attributesMapping = ofNullable( + content.getAttributes()).orElseGet(LinkedHashMap::new); + Set attributeValues = attributesMapping.get(columnName); + if (ofNullable(attributeValues).isPresent()) { + attributeValues.add(value); + } else { + attributesMapping.put(columnName, Sets.newHashSet(value)); + } + content.setAttributes(attributesMapping); + }); + + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/widget/WidgetContentProvider.java b/src/main/java/com/epam/ta/reportportal/dao/widget/WidgetContentProvider.java index 18b3f2824..d4da57a03 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/widget/WidgetContentProvider.java +++ b/src/main/java/com/epam/ta/reportportal/dao/widget/WidgetContentProvider.java @@ -1,12 +1,12 @@ package com.epam.ta.reportportal.dao.widget; +import java.util.function.Function; import org.jooq.Record; import org.jooq.Select; -import java.util.function.Function; - /** * @author Ivan Budayeu */ public interface WidgetContentProvider extends Function, R> { + } diff --git a/src/main/java/com/epam/ta/reportportal/dao/widget/WidgetProviderChain.java b/src/main/java/com/epam/ta/reportportal/dao/widget/WidgetProviderChain.java index 3478f434a..6c3d147cc 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/widget/WidgetProviderChain.java +++ b/src/main/java/com/epam/ta/reportportal/dao/widget/WidgetProviderChain.java @@ -7,7 +7,7 @@ */ public interface WidgetProviderChain extends Function { - default int resolvePriority(T input) { - return 0; - } + default int resolvePriority(T input) { + return 0; + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/widget/WidgetQueryProvider.java b/src/main/java/com/epam/ta/reportportal/dao/widget/WidgetQueryProvider.java index fca478278..b3c66e9f8 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/widget/WidgetQueryProvider.java +++ b/src/main/java/com/epam/ta/reportportal/dao/widget/WidgetQueryProvider.java @@ -1,15 +1,14 @@ package com.epam.ta.reportportal.dao.widget; -import org.jooq.Record; -import org.jooq.Select; - import java.util.Set; import java.util.function.Function; +import org.jooq.Record; +import org.jooq.Select; /** * @author Ivan Budayeu */ public interface WidgetQueryProvider extends Function> { - Set getSupportedSorting(); + Set getSupportedSorting(); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableChain.java b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableChain.java index 9b50c60cf..13bc4f6ff 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableChain.java +++ b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableChain.java @@ -1,85 +1,95 @@ package com.epam.ta.reportportal.dao.widget.healthcheck.content; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.PASSING_RATE; +import static java.util.Optional.ofNullable; +import static java.util.stream.Collectors.toList; + import com.epam.ta.reportportal.dao.widget.WidgetProviderChain; import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableContent; import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableGetParams; import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableStatisticsContent; import com.google.common.collect.Lists; import com.google.common.collect.Sets; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Set; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import java.util.*; - -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.PASSING_RATE; -import static java.util.Optional.ofNullable; -import static java.util.stream.Collectors.toList; - /** * @author Ivan Budayeu */ @Component -public class HealthCheckTableChain implements WidgetProviderChain> { +public class HealthCheckTableChain implements + WidgetProviderChain> { - private static final Set ALLOWED_SORTING = Sets.newHashSet(PASSING_RATE); + private static final Set ALLOWED_SORTING = Sets.newHashSet(PASSING_RATE); - private final WidgetProviderChain> healthCheckTableStatisticsChain; - private final WidgetProviderChain>> healthCheckTableColumnChain; + private final WidgetProviderChain> healthCheckTableStatisticsChain; + private final WidgetProviderChain>> healthCheckTableColumnChain; - @Autowired - public HealthCheckTableChain( - WidgetProviderChain> healthCheckTableStatisticsChain, - WidgetProviderChain>> healthCheckTableColumnChain) { - this.healthCheckTableStatisticsChain = healthCheckTableStatisticsChain; - this.healthCheckTableColumnChain = healthCheckTableColumnChain; - } + @Autowired + public HealthCheckTableChain( + WidgetProviderChain> healthCheckTableStatisticsChain, + WidgetProviderChain>> healthCheckTableColumnChain) { + this.healthCheckTableStatisticsChain = healthCheckTableStatisticsChain; + this.healthCheckTableColumnChain = healthCheckTableColumnChain; + } - @Override - public List apply(HealthCheckTableGetParams params) { + @Override + public List apply(HealthCheckTableGetParams params) { - boolean contentFirst = - healthCheckTableStatisticsChain.resolvePriority(params) - healthCheckTableColumnChain.resolvePriority(params) >= 0; - List result = concat(contentFirst, - healthCheckTableStatisticsChain.apply(params), - healthCheckTableColumnChain.apply(params) - ); + boolean contentFirst = + healthCheckTableStatisticsChain.resolvePriority(params) + - healthCheckTableColumnChain.resolvePriority(params) >= 0; + List result = concat(contentFirst, + healthCheckTableStatisticsChain.apply(params), + healthCheckTableColumnChain.apply(params) + ); - return params.getSort().get().filter(order -> ALLOWED_SORTING.contains(order.getProperty())).findFirst().map(it -> { - Comparator comparator = Comparator.comparingDouble(HealthCheckTableContent::getPassingRate); - return result.stream().sorted(it.isAscending() ? comparator : comparator.reversed()).collect(toList()); - }).orElse(result); - } + return params.getSort().get().filter(order -> ALLOWED_SORTING.contains(order.getProperty())) + .findFirst().map(it -> { + Comparator comparator = Comparator.comparingDouble( + HealthCheckTableContent::getPassingRate); + return result.stream().sorted(it.isAscending() ? comparator : comparator.reversed()) + .collect(toList()); + }).orElse(result); + } - private List concat(boolean contentFirst, Map content, - Map> columnMapping) { + private List concat(boolean contentFirst, + Map content, + Map> columnMapping) { - List result = Lists.newArrayListWithExpectedSize(content.size()); + List result = Lists.newArrayListWithExpectedSize(content.size()); - if (contentFirst) { - content.forEach((key, statistics) -> { - HealthCheckTableContent resultEntry = entryFromStatistics(key, statistics); - ofNullable(columnMapping.get(key)).ifPresent(resultEntry::setCustomValues); - result.add(resultEntry); - }); - } else { - columnMapping.forEach((key, attributes) -> { - HealthCheckTableContent resultEntry = ofNullable(content.remove(key)).map(statisticsContent -> entryFromStatistics(key, - statisticsContent - )).orElseGet(HealthCheckTableContent::new); - resultEntry.setCustomValues(attributes); - result.add(resultEntry); - }); - content.forEach((key, statistics) -> result.add(entryFromStatistics(key, statistics))); - } - return result; - } + if (contentFirst) { + content.forEach((key, statistics) -> { + HealthCheckTableContent resultEntry = entryFromStatistics(key, statistics); + ofNullable(columnMapping.get(key)).ifPresent(resultEntry::setCustomValues); + result.add(resultEntry); + }); + } else { + columnMapping.forEach((key, attributes) -> { + HealthCheckTableContent resultEntry = ofNullable(content.remove(key)).map( + statisticsContent -> entryFromStatistics(key, + statisticsContent + )).orElseGet(HealthCheckTableContent::new); + resultEntry.setCustomValues(attributes); + result.add(resultEntry); + }); + content.forEach((key, statistics) -> result.add(entryFromStatistics(key, statistics))); + } + return result; + } - private HealthCheckTableContent entryFromStatistics(String key, HealthCheckTableStatisticsContent statisticsContent) { - HealthCheckTableContent resultEntry = new HealthCheckTableContent(); - resultEntry.setAttributeValue(key); - resultEntry.setPassingRate(statisticsContent.getPassingRate()); - resultEntry.setStatistics(statisticsContent.getStatistics()); - return resultEntry; - } + private HealthCheckTableContent entryFromStatistics(String key, + HealthCheckTableStatisticsContent statisticsContent) { + HealthCheckTableContent resultEntry = new HealthCheckTableContent(); + resultEntry.setAttributeValue(key); + resultEntry.setPassingRate(statisticsContent.getPassingRate()); + resultEntry.setStatistics(statisticsContent.getStatistics()); + return resultEntry; + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableColumnChain.java b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableColumnChain.java index dc88190dd..924cb7195 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableColumnChain.java +++ b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableColumnChain.java @@ -4,45 +4,46 @@ import com.epam.ta.reportportal.dao.widget.WidgetProviderChain; import com.epam.ta.reportportal.dao.widget.WidgetQueryProvider; import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableGetParams; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Objects; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; /** * @author Ivan Budayeu */ @Component -public class HealthCheckTableColumnChain implements WidgetProviderChain>> { +public class HealthCheckTableColumnChain implements + WidgetProviderChain>> { - private final WidgetQueryProvider customColumnQueryProvider; - private final WidgetContentProvider>> healthCheckTableColumnProvider; + private final WidgetQueryProvider customColumnQueryProvider; + private final WidgetContentProvider>> healthCheckTableColumnProvider; - @Autowired - public HealthCheckTableColumnChain(WidgetQueryProvider customColumnQueryProvider, - WidgetContentProvider>> healthCheckTableColumnProvider) { - this.customColumnQueryProvider = customColumnQueryProvider; - this.healthCheckTableColumnProvider = healthCheckTableColumnProvider; - } + @Autowired + public HealthCheckTableColumnChain( + WidgetQueryProvider customColumnQueryProvider, + WidgetContentProvider>> healthCheckTableColumnProvider) { + this.customColumnQueryProvider = customColumnQueryProvider; + this.healthCheckTableColumnProvider = healthCheckTableColumnProvider; + } - @Override - public Map> apply(HealthCheckTableGetParams params) { - if (!params.isIncludeCustomColumn()) { - return Collections.emptyMap(); - } - return customColumnQueryProvider.andThen(healthCheckTableColumnProvider).apply(params); - } + @Override + public Map> apply(HealthCheckTableGetParams params) { + if (!params.isIncludeCustomColumn()) { + return Collections.emptyMap(); + } + return customColumnQueryProvider.andThen(healthCheckTableColumnProvider).apply(params); + } - @Override - public int resolvePriority(HealthCheckTableGetParams params) { - return customColumnQueryProvider.getSupportedSorting() - .stream() - .filter(sorting -> Objects.nonNull(params.getSort().getOrderFor(sorting))) - .findAny() - .map(it -> 1) - .orElse(0); - } + @Override + public int resolvePriority(HealthCheckTableGetParams params) { + return customColumnQueryProvider.getSupportedSorting() + .stream() + .filter(sorting -> Objects.nonNull(params.getSort().getOrderFor(sorting))) + .findAny() + .map(it -> 1) + .orElse(0); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableStatisticsChain.java b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableStatisticsChain.java index 898060480..8bd2e4d52 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableStatisticsChain.java +++ b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableStatisticsChain.java @@ -1,77 +1,83 @@ package com.epam.ta.reportportal.dao.widget.healthcheck.content; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.EXECUTIONS_FAILED; +import static java.util.Optional.ofNullable; + import com.epam.ta.reportportal.dao.widget.WidgetContentProvider; import com.epam.ta.reportportal.dao.widget.WidgetProviderChain; import com.epam.ta.reportportal.dao.widget.WidgetQueryProvider; import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableGetParams; import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableStatisticsContent; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Sort; -import org.springframework.stereotype.Component; - import java.util.LinkedHashMap; import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; - -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.EXECUTIONS_FAILED; -import static java.util.Optional.ofNullable; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Component; /** * @author Ivan Budayeu */ @Component public class HealthCheckTableStatisticsChain - implements WidgetProviderChain> { + implements + WidgetProviderChain> { - private final WidgetQueryProvider statisticsQueryProvider; - private final WidgetContentProvider> healthCheckTableStatisticsProvider; + private final WidgetQueryProvider statisticsQueryProvider; + private final WidgetContentProvider> healthCheckTableStatisticsProvider; - @Autowired - public HealthCheckTableStatisticsChain(WidgetQueryProvider statisticsQueryProvider, - WidgetContentProvider> healthCheckTableStatisticsProvider) { - this.statisticsQueryProvider = statisticsQueryProvider; - this.healthCheckTableStatisticsProvider = healthCheckTableStatisticsProvider; - } + @Autowired + public HealthCheckTableStatisticsChain( + WidgetQueryProvider statisticsQueryProvider, + WidgetContentProvider> healthCheckTableStatisticsProvider) { + this.statisticsQueryProvider = statisticsQueryProvider; + this.healthCheckTableStatisticsProvider = healthCheckTableStatisticsProvider; + } - @Override - public Map apply(HealthCheckTableGetParams params) { - Map result = statisticsQueryProvider.andThen(healthCheckTableStatisticsProvider) - .apply(params); - return getResult(params, result); - } + @Override + public Map apply(HealthCheckTableGetParams params) { + Map result = statisticsQueryProvider.andThen( + healthCheckTableStatisticsProvider) + .apply(params); + return getResult(params, result); + } - @Override - public int resolvePriority(HealthCheckTableGetParams params) { - return statisticsQueryProvider.getSupportedSorting() - .stream() - .filter(sorting -> Objects.nonNull(params.getSort().getOrderFor(sorting))) - .findAny() - .map(it -> 1) - .orElse(0); - } + @Override + public int resolvePriority(HealthCheckTableGetParams params) { + return statisticsQueryProvider.getSupportedSorting() + .stream() + .filter(sorting -> Objects.nonNull(params.getSort().getOrderFor(sorting))) + .findAny() + .map(it -> 1) + .orElse(0); + } - /** - * If sorting order is {@link Sort.Order#isAscending()} and statistics criteria doesn't exist in the result content - * items without statistics will be put after items with existing criteria. - * If there is no statistics criteria in the result content it means statistics counter = 0 so items should be put to the top - * - * @param params {@link HealthCheckTableGetParams} - * @param result {@link Map} with 'attribute value' as key and {@link HealthCheckTableStatisticsContent} as value - * @return resorted or original content - */ - private Map getResult(HealthCheckTableGetParams params, - Map result) { - return ofNullable(params.getSort().getOrderFor(EXECUTIONS_FAILED)).filter(Sort.Order::isAscending).map(sorting -> { - Map resortedResult = result.entrySet() - .stream() - .filter(entry -> Objects.isNull(entry.getValue().getStatistics().get(EXECUTIONS_FAILED))) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (prev, curr) -> curr, LinkedHashMap::new)); - if (resortedResult.isEmpty()) { - return result; - } - resortedResult.putAll(result); - return resortedResult; - }).orElse(result); - } + /** + * If sorting order is {@link Sort.Order#isAscending()} and statistics criteria doesn't exist in + * the result content items without statistics will be put after items with existing criteria. If + * there is no statistics criteria in the result content it means statistics counter = 0 so items + * should be put to the top + * + * @param params {@link HealthCheckTableGetParams} + * @param result {@link Map} with 'attribute value' as key and + * {@link HealthCheckTableStatisticsContent} as value + * @return resorted or original content + */ + private Map getResult(HealthCheckTableGetParams params, + Map result) { + return ofNullable(params.getSort().getOrderFor(EXECUTIONS_FAILED)).filter( + Sort.Order::isAscending).map(sorting -> { + Map resortedResult = result.entrySet() + .stream() + .filter(entry -> Objects.isNull(entry.getValue().getStatistics().get(EXECUTIONS_FAILED))) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (prev, curr) -> curr, + LinkedHashMap::new)); + if (resortedResult.isEmpty()) { + return result; + } + resortedResult.putAll(result); + return resortedResult; + }).orElse(result); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/provider/HealthCheckTableColumnProvider.java b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/provider/HealthCheckTableColumnProvider.java index 6c0596118..218675231 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/provider/HealthCheckTableColumnProvider.java +++ b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/provider/HealthCheckTableColumnProvider.java @@ -1,32 +1,32 @@ package com.epam.ta.reportportal.dao.widget.healthcheck.content.provider; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.COMPONENT_HEALTH_CHECK_TABLE_COLUMN_FETCHER; + import com.epam.ta.reportportal.dao.widget.WidgetContentProvider; +import java.util.List; +import java.util.Map; import org.jooq.DSLContext; import org.jooq.Record; import org.jooq.Select; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import java.util.List; -import java.util.Map; - -import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.COMPONENT_HEALTH_CHECK_TABLE_COLUMN_FETCHER; - /** * @author Ivan Budayeu */ @Component -public class HealthCheckTableColumnProvider implements WidgetContentProvider>> { +public class HealthCheckTableColumnProvider implements + WidgetContentProvider>> { - private final DSLContext dslContext; + private final DSLContext dslContext; - @Autowired - public HealthCheckTableColumnProvider(DSLContext dslContext) { - this.dslContext = dslContext; - } + @Autowired + public HealthCheckTableColumnProvider(DSLContext dslContext) { + this.dslContext = dslContext; + } - @Override - public Map> apply(Select records) { - return COMPONENT_HEALTH_CHECK_TABLE_COLUMN_FETCHER.apply(dslContext.fetch(records)); - } + @Override + public Map> apply(Select records) { + return COMPONENT_HEALTH_CHECK_TABLE_COLUMN_FETCHER.apply(dslContext.fetch(records)); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/provider/HealthCheckTableStatisticsProvider.java b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/provider/HealthCheckTableStatisticsProvider.java index e3b85f3b6..0a4bdef4e 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/provider/HealthCheckTableStatisticsProvider.java +++ b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/provider/HealthCheckTableStatisticsProvider.java @@ -1,32 +1,32 @@ package com.epam.ta.reportportal.dao.widget.healthcheck.content.provider; +import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.COMPONENT_HEALTH_CHECK_TABLE_STATS_FETCHER; + import com.epam.ta.reportportal.dao.widget.WidgetContentProvider; import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableStatisticsContent; +import java.util.Map; import org.jooq.DSLContext; import org.jooq.Record; import org.jooq.Select; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import java.util.Map; - -import static com.epam.ta.reportportal.dao.util.WidgetContentUtil.COMPONENT_HEALTH_CHECK_TABLE_STATS_FETCHER; - /** * @author Ivan Budayeu */ @Component -public class HealthCheckTableStatisticsProvider implements WidgetContentProvider> { +public class HealthCheckTableStatisticsProvider implements + WidgetContentProvider> { - private final DSLContext dslContext; + private final DSLContext dslContext; - @Autowired - public HealthCheckTableStatisticsProvider(DSLContext dslContext) { - this.dslContext = dslContext; - } + @Autowired + public HealthCheckTableStatisticsProvider(DSLContext dslContext) { + this.dslContext = dslContext; + } - @Override - public Map apply(Select records) { - return COMPONENT_HEALTH_CHECK_TABLE_STATS_FETCHER.apply(dslContext.fetch(records)); - } + @Override + public Map apply(Select records) { + return COMPONENT_HEALTH_CHECK_TABLE_STATS_FETCHER.apply(dslContext.fetch(records)); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/query/AbstractHealthCheckTableQueryProvider.java b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/query/AbstractHealthCheckTableQueryProvider.java index d4e8e5d8f..e564a149a 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/query/AbstractHealthCheckTableQueryProvider.java +++ b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/query/AbstractHealthCheckTableQueryProvider.java @@ -1,50 +1,53 @@ package com.epam.ta.reportportal.dao.widget.healthcheck.query; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ITEM_ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.KEY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.VALUE; +import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; + import com.epam.ta.reportportal.dao.widget.WidgetQueryProvider; import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableGetParams; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; import org.jooq.Condition; import org.jooq.Record; import org.jooq.Select; import org.jooq.impl.DSL; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; -import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; - /** * @author Ivan Budayeu */ -public abstract class AbstractHealthCheckTableQueryProvider implements WidgetQueryProvider { - - private final Set supportedSorting; - - protected AbstractHealthCheckTableQueryProvider(Set supportedSorting) { - this.supportedSorting = supportedSorting; - } - - protected abstract Select contentQuery(HealthCheckTableGetParams params, List levelConditions); - - @Override - public Select apply(HealthCheckTableGetParams params) { - - List levelConditions = params.getPreviousLevels() - .stream() - .map(levelEntry -> fieldName(params.getViewName(), ITEM_ID).cast(Long.class) - .in(DSL.selectDistinct(fieldName(ITEM_ID).cast(Long.class)) - .from(params.getViewName()) - .where(fieldName(KEY).cast(String.class) - .eq(levelEntry.getKey()) - .and(fieldName(VALUE).cast(String.class).eq(levelEntry.getValue()))))) - .collect(Collectors.toList()); - - return contentQuery(params, levelConditions); - } - - @Override - public Set getSupportedSorting() { - return supportedSorting; - } +public abstract class AbstractHealthCheckTableQueryProvider implements + WidgetQueryProvider { + + private final Set supportedSorting; + + protected AbstractHealthCheckTableQueryProvider(Set supportedSorting) { + this.supportedSorting = supportedSorting; + } + + protected abstract Select contentQuery(HealthCheckTableGetParams params, + List levelConditions); + + @Override + public Select apply(HealthCheckTableGetParams params) { + + List levelConditions = params.getPreviousLevels() + .stream() + .map(levelEntry -> fieldName(params.getViewName(), ITEM_ID).cast(Long.class) + .in(DSL.selectDistinct(fieldName(ITEM_ID).cast(Long.class)) + .from(params.getViewName()) + .where(fieldName(KEY).cast(String.class) + .eq(levelEntry.getKey()) + .and(fieldName(VALUE).cast(String.class).eq(levelEntry.getValue()))))) + .collect(Collectors.toList()); + + return contentQuery(params, levelConditions); + } + + @Override + public Set getSupportedSorting() { + return supportedSorting; + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/query/CustomColumnQueryProvider.java b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/query/CustomColumnQueryProvider.java index 9bc659f1b..ed0bb4bc2 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/query/CustomColumnQueryProvider.java +++ b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/query/CustomColumnQueryProvider.java @@ -1,51 +1,60 @@ package com.epam.ta.reportportal.dao.widget.healthcheck.query; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.AGGREGATED_VALUES; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.CUSTOM_COLUMN; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.CUSTOM_COLUMN_SORTING; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.KEY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.VALUE; +import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; + import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableGetParams; import com.google.common.collect.Sets; -import org.jooq.*; +import java.util.List; +import java.util.Optional; +import org.jooq.Condition; +import org.jooq.Record; +import org.jooq.Select; +import org.jooq.SelectHavingStep; +import org.jooq.SortOrder; import org.jooq.impl.DSL; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Component; -import java.util.List; -import java.util.Optional; - -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; -import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; - /** * @author Ivan Budayeu */ @Component public class CustomColumnQueryProvider extends AbstractHealthCheckTableQueryProvider { - public static final String UNNESTED_ARRAY = "unnested_array"; - - public CustomColumnQueryProvider() { - super(Sets.newHashSet(CUSTOM_COLUMN_SORTING)); - } - - @Override - protected Select contentQuery(HealthCheckTableGetParams params, List levelConditions) { - SelectHavingStep selectQuery = DSL.select(DSL.arrayAggDistinct(fieldName(UNNESTED_ARRAY)) - .filterWhere(fieldName(UNNESTED_ARRAY).isNotNull()) - .as(AGGREGATED_VALUES), fieldName(VALUE)) - .from(DSL.table(params.getViewName()), DSL.table(DSL.sql("unnest(?)", fieldName(CUSTOM_COLUMN))).as(UNNESTED_ARRAY)) - .where(fieldName(KEY).cast(String.class) - .eq(params.getCurrentLevelKey()) - .and(levelConditions.stream().reduce(DSL.noCondition(), Condition::and))) - .groupBy(fieldName(VALUE)); - - Optional resolvedSort = params.getSort() - .get() - .filter(order -> getSupportedSorting().contains(order.getProperty())) - .findFirst(); - - if (resolvedSort.isPresent()) { - return selectQuery.orderBy(resolvedSort.get().isAscending() ? - fieldName(AGGREGATED_VALUES).sort(SortOrder.ASC) : - fieldName(AGGREGATED_VALUES).sort(SortOrder.DESC)); - } - return selectQuery; - } + public static final String UNNESTED_ARRAY = "unnested_array"; + + public CustomColumnQueryProvider() { + super(Sets.newHashSet(CUSTOM_COLUMN_SORTING)); + } + + @Override + protected Select contentQuery(HealthCheckTableGetParams params, + List levelConditions) { + SelectHavingStep selectQuery = DSL.select(DSL.arrayAggDistinct(fieldName(UNNESTED_ARRAY)) + .filterWhere(fieldName(UNNESTED_ARRAY).isNotNull()) + .as(AGGREGATED_VALUES), fieldName(VALUE)) + .from(DSL.table(params.getViewName()), + DSL.table(DSL.sql("unnest(?)", fieldName(CUSTOM_COLUMN))).as(UNNESTED_ARRAY)) + .where(fieldName(KEY).cast(String.class) + .eq(params.getCurrentLevelKey()) + .and(levelConditions.stream().reduce(DSL.noCondition(), Condition::and))) + .groupBy(fieldName(VALUE)); + + Optional resolvedSort = params.getSort() + .get() + .filter(order -> getSupportedSorting().contains(order.getProperty())) + .findFirst(); + + if (resolvedSort.isPresent()) { + return selectQuery.orderBy(resolvedSort.get().isAscending() ? + fieldName(AGGREGATED_VALUES).sort(SortOrder.ASC) : + fieldName(AGGREGATED_VALUES).sort(SortOrder.DESC)); + } + return selectQuery; + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/query/StatisticsQueryProvider.java b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/query/StatisticsQueryProvider.java index 47ab7f0e9..6ec69516f 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/query/StatisticsQueryProvider.java +++ b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/query/StatisticsQueryProvider.java @@ -1,20 +1,29 @@ package com.epam.ta.reportportal.dao.widget.healthcheck.query; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.EXECUTIONS_FAILED; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.EXECUTIONS_TOTAL; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ITEM_ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.KEY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.SUM; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.VALUE; +import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; +import static com.epam.ta.reportportal.jooq.Tables.STATISTICS; +import static com.epam.ta.reportportal.jooq.Tables.STATISTICS_FIELD; + import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableGetParams; import com.google.common.collect.Sets; -import org.jooq.*; -import org.jooq.impl.DSL; -import org.springframework.data.domain.Sort; -import org.springframework.stereotype.Component; - import java.math.BigDecimal; import java.util.List; import java.util.Optional; - -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; -import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; -import static com.epam.ta.reportportal.jooq.Tables.STATISTICS; -import static com.epam.ta.reportportal.jooq.Tables.STATISTICS_FIELD; +import org.jooq.Condition; +import org.jooq.Record; +import org.jooq.Record3; +import org.jooq.Select; +import org.jooq.SelectHavingStep; +import org.jooq.SortOrder; +import org.jooq.impl.DSL; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Component; /** * @author Ivan Budayeu @@ -22,38 +31,42 @@ @Component public class StatisticsQueryProvider extends AbstractHealthCheckTableQueryProvider { - public StatisticsQueryProvider() { - super(Sets.newHashSet(EXECUTIONS_TOTAL, EXECUTIONS_FAILED)); - } + public StatisticsQueryProvider() { + super(Sets.newHashSet(EXECUTIONS_TOTAL, EXECUTIONS_FAILED)); + } - @Override - protected Select contentQuery(HealthCheckTableGetParams params, List levelConditions) { + @Override + protected Select contentQuery(HealthCheckTableGetParams params, + List levelConditions) { - SelectHavingStep> selectQuery = DSL.select(STATISTICS_FIELD.NAME, - DSL.sum(STATISTICS.S_COUNTER).as(SUM), - fieldName(VALUE) - ) - .from(params.getViewName()) - .join(STATISTICS) - .on(fieldName(params.getViewName(), ITEM_ID).cast(Long.class).eq(STATISTICS.ITEM_ID)) - .join(STATISTICS_FIELD) - .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) - .where(fieldName(KEY).cast(String.class) - .eq(params.getCurrentLevelKey()) - .and(levelConditions.stream().reduce(DSL.noCondition(), Condition::and))) - .groupBy(fieldName(VALUE), STATISTICS_FIELD.NAME); + SelectHavingStep> selectQuery = DSL.select( + STATISTICS_FIELD.NAME, + DSL.sum(STATISTICS.S_COUNTER).as(SUM), + fieldName(VALUE) + ) + .from(params.getViewName()) + .join(STATISTICS) + .on(fieldName(params.getViewName(), ITEM_ID).cast(Long.class).eq(STATISTICS.ITEM_ID)) + .join(STATISTICS_FIELD) + .on(STATISTICS.STATISTICS_FIELD_ID.eq(STATISTICS_FIELD.SF_ID)) + .where(fieldName(KEY).cast(String.class) + .eq(params.getCurrentLevelKey()) + .and(levelConditions.stream().reduce(DSL.noCondition(), Condition::and))) + .groupBy(fieldName(VALUE), STATISTICS_FIELD.NAME); - Optional resolvedSort = params.getSort() - .get() - .filter(order -> getSupportedSorting().contains(order.getProperty())) - .findFirst(); - if (resolvedSort.isPresent()) { - return selectQuery.orderBy(DSL.when(STATISTICS_FIELD.NAME.eq(resolvedSort.get().getProperty()), STATISTICS_FIELD.NAME), - resolvedSort.get().isAscending() ? - DSL.sum(STATISTICS.S_COUNTER).sort(SortOrder.ASC) : - DSL.sum(STATISTICS.S_COUNTER).sort(SortOrder.DESC) - ); - } - return selectQuery; - } + Optional resolvedSort = params.getSort() + .get() + .filter(order -> getSupportedSorting().contains(order.getProperty())) + .findFirst(); + if (resolvedSort.isPresent()) { + return selectQuery.orderBy( + DSL.when(STATISTICS_FIELD.NAME.eq(resolvedSort.get().getProperty()), + STATISTICS_FIELD.NAME), + resolvedSort.get().isAscending() ? + DSL.sum(STATISTICS.S_COUNTER).sort(SortOrder.ASC) : + DSL.sum(STATISTICS.S_COUNTER).sort(SortOrder.DESC) + ); + } + return selectQuery; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/AnalyzeMode.java b/src/main/java/com/epam/ta/reportportal/entity/AnalyzeMode.java index 69ee53854..f97069148 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/AnalyzeMode.java +++ b/src/main/java/com/epam/ta/reportportal/entity/AnalyzeMode.java @@ -24,21 +24,22 @@ */ public enum AnalyzeMode { - ALL_LAUNCHES("ALL"), - BY_LAUNCH_NAME("LAUNCH_NAME"), - CURRENT_LAUNCH("CURRENT_LAUNCH"); + ALL_LAUNCHES("ALL"), + BY_LAUNCH_NAME("LAUNCH_NAME"), + CURRENT_LAUNCH("CURRENT_LAUNCH"); - private String value; + private String value; - AnalyzeMode(String value) { - this.value = value; - } + AnalyzeMode(String value) { + this.value = value; + } - public static Optional fromString(String mode) { - return Arrays.stream(AnalyzeMode.values()).filter(it -> it.getValue().equalsIgnoreCase(mode)).findFirst(); - } + public static Optional fromString(String mode) { + return Arrays.stream(AnalyzeMode.values()).filter(it -> it.getValue().equalsIgnoreCase(mode)) + .findFirst(); + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/EmailSettingsEnum.java b/src/main/java/com/epam/ta/reportportal/entity/EmailSettingsEnum.java index 30e89e882..3b297a3f3 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/EmailSettingsEnum.java +++ b/src/main/java/com/epam/ta/reportportal/entity/EmailSettingsEnum.java @@ -25,37 +25,38 @@ */ public enum EmailSettingsEnum { - RP_HOST("rpHost"), - HOST("host"), - PORT("port"), - PROTOCOL("protocol"), - AUTH_ENABLED("authEnabled"), - STAR_TLS_ENABLED("starTlsEnabled"), - SSL_ENABLED("sslEnabled"), - USERNAME("username"), - PASSWORD("password"), - FROM("from"); - - private String attribute; - - EmailSettingsEnum(String attribute) { - this.attribute = attribute; - } - - public String getAttribute() { - return attribute; - } - - public Optional getAttribute(Map params) { - return Optional.ofNullable(params.get(this.attribute)).map(String::valueOf); - } - - public static Optional findByAttribute(String attribute) { - return Optional.ofNullable(attribute) - .flatMap(attr -> Arrays.stream(values()).filter(it -> it.attribute.equalsIgnoreCase(attr)).findAny()); - } - - public static boolean isPresent(String attribute) { - return findByAttribute(attribute).isPresent(); - } + RP_HOST("rpHost"), + HOST("host"), + PORT("port"), + PROTOCOL("protocol"), + AUTH_ENABLED("authEnabled"), + STAR_TLS_ENABLED("starTlsEnabled"), + SSL_ENABLED("sslEnabled"), + USERNAME("username"), + PASSWORD("password"), + FROM("from"); + + private String attribute; + + EmailSettingsEnum(String attribute) { + this.attribute = attribute; + } + + public static Optional findByAttribute(String attribute) { + return Optional.ofNullable(attribute) + .flatMap(attr -> Arrays.stream(values()).filter(it -> it.attribute.equalsIgnoreCase(attr)) + .findAny()); + } + + public static boolean isPresent(String attribute) { + return findByAttribute(attribute).isPresent(); + } + + public String getAttribute() { + return attribute; + } + + public Optional getAttribute(Map params) { + return Optional.ofNullable(params.get(this.attribute)).map(String::valueOf); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/ItemAttribute.java b/src/main/java/com/epam/ta/reportportal/entity/ItemAttribute.java index 352649020..50f5e5e53 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/ItemAttribute.java +++ b/src/main/java/com/epam/ta/reportportal/entity/ItemAttribute.java @@ -18,10 +18,17 @@ import com.epam.ta.reportportal.entity.item.TestItem; import com.epam.ta.reportportal.entity.launch.Launch; - -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; /** * @author Ihar Kahadouski @@ -30,129 +37,135 @@ @Table(name = "item_attribute") public class ItemAttribute implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id") - private Long id; - - @Column(name = "key") - private String key; - - @Column(name = "value") - private String value; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "item_id") - private TestItem testItem; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "launch_id") - private Launch launch; - - @Column(name = "system") - private Boolean system; - - public ItemAttribute() { - } - - public ItemAttribute(String key, String value, Boolean system) { - this.key = key; - this.value = value; - this.system = system; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public TestItem getTestItem() { - return testItem; - } - - public void setTestItem(TestItem testItem) { - this.testItem = testItem; - } - - public Launch getLaunch() { - return launch; - } - - public void setLaunch(Launch launch) { - this.launch = launch; - } - - public Boolean isSystem() { - return system; - } - - public void setSystem(Boolean system) { - this.system = system; - } - - /* - * DO NOT REGENERATE EQUALS AND HASHCODE! - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ItemAttribute that = (ItemAttribute) o; - - return Objects.equals(key, that.key) && Objects.equals(value, that.value) && Objects.equals(system, that.system) && Objects.equals( - testItem != null ? "testItem:" + (testItem.getItemId() != null ? testItem.getItemId() : "") : "testItem:", - that.testItem != null ? "testItem:" + (that.testItem.getItemId() != null ? that.testItem.getItemId() : "") : "testItem:" - ) && Objects.equals(launch != null ? "launch:" + (launch.getId() != null ? launch.getId() : "") : "launch:", - that.launch != null ? "launch:" + (that.launch.getId() != null ? that.launch.getId() : "") : "launch:" - ); - } - - /* - * DO NOT REGENERATE EQUALS AND HASHCODE! - */ - @Override - public int hashCode() { - return Objects.hash(key, - value, - system, - testItem != null ? "testItem:" + (testItem.getItemId() != null ? testItem.getItemId() : "") : "testItem:", - launch != null ? "launch:" + (launch.getId() != null ? launch.getId() : "") : "launch:" - ); - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("ItemAttribute{"); - sb.append("id=").append(id); - sb.append(", key='").append(key).append('\''); - sb.append(", value='").append(value).append('\''); - sb.append(", system=").append(system); - sb.append(testItem != null ? ", testItem=" + testItem.getItemId() : ""); - sb.append(launch != null ? ", launch=" + launch.getId() : ""); - sb.append('}'); - return sb.toString(); - } + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Long id; + + @Column(name = "key") + private String key; + + @Column(name = "value") + private String value; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "item_id") + private TestItem testItem; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "launch_id") + private Launch launch; + + @Column(name = "system") + private Boolean system; + + public ItemAttribute() { + } + + public ItemAttribute(String key, String value, Boolean system) { + this.key = key; + this.value = value; + this.system = system; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public TestItem getTestItem() { + return testItem; + } + + public void setTestItem(TestItem testItem) { + this.testItem = testItem; + } + + public Launch getLaunch() { + return launch; + } + + public void setLaunch(Launch launch) { + this.launch = launch; + } + + public Boolean isSystem() { + return system; + } + + public void setSystem(Boolean system) { + this.system = system; + } + + /* + * DO NOT REGENERATE EQUALS AND HASHCODE! + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemAttribute that = (ItemAttribute) o; + + return Objects.equals(key, that.key) && Objects.equals(value, that.value) && Objects.equals( + system, that.system) && Objects.equals( + testItem != null ? "testItem:" + (testItem.getItemId() != null ? testItem.getItemId() : "") + : "testItem:", + that.testItem != null ? "testItem:" + (that.testItem.getItemId() != null + ? that.testItem.getItemId() : "") : "testItem:" + ) && Objects.equals( + launch != null ? "launch:" + (launch.getId() != null ? launch.getId() : "") : "launch:", + that.launch != null ? "launch:" + (that.launch.getId() != null ? that.launch.getId() : "") + : "launch:" + ); + } + + /* + * DO NOT REGENERATE EQUALS AND HASHCODE! + */ + @Override + public int hashCode() { + return Objects.hash(key, + value, + system, + testItem != null ? "testItem:" + (testItem.getItemId() != null ? testItem.getItemId() : "") + : "testItem:", + launch != null ? "launch:" + (launch.getId() != null ? launch.getId() : "") : "launch:" + ); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("ItemAttribute{"); + sb.append("id=").append(id); + sb.append(", key='").append(key).append('\''); + sb.append(", value='").append(value).append('\''); + sb.append(", system=").append(system); + sb.append(testItem != null ? ", testItem=" + testItem.getItemId() : ""); + sb.append(launch != null ? ", launch=" + launch.getId() : ""); + sb.append('}'); + return sb.toString(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/LTreeType.java b/src/main/java/com/epam/ta/reportportal/entity/LTreeType.java index d3d0a550a..f041549ce 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/LTreeType.java +++ b/src/main/java/com/epam/ta/reportportal/entity/LTreeType.java @@ -16,74 +16,75 @@ package com.epam.ta.reportportal.entity; -import org.hibernate.HibernateException; -import org.hibernate.engine.spi.SharedSessionContractImplementor; -import org.hibernate.usertype.UserType; - import java.io.Serializable; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Types; +import org.hibernate.HibernateException; +import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.usertype.UserType; public class LTreeType implements UserType { - @Override - public int[] sqlTypes() { - return new int[] { Types.OTHER }; - } - - @SuppressWarnings("rawtypes") - @Override - public Class returnedClass() { - return String.class; - } - - @Override - public boolean equals(Object x, Object y) throws HibernateException { - return x == y; - } - - @Override - public int hashCode(Object x) throws HibernateException { - return x.hashCode(); - } - - @Override - public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) - throws HibernateException, SQLException { - return rs.getString(names[0]); - } - - @Override - public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) - throws HibernateException, SQLException { - st.setObject(index, value, Types.OTHER); - } - - @Override - public Object deepCopy(Object value) throws HibernateException { - return value; - } - - @Override - public boolean isMutable() { - return false; - } - - @Override - public Serializable disassemble(Object value) throws HibernateException { - return (Serializable) value; - } - - @Override - public Object assemble(Serializable cached, Object owner) throws HibernateException { - return cached; - } - - @Override - public Object replace(Object original, Object target, Object owner) throws HibernateException { - return deepCopy(original); - } + @Override + public int[] sqlTypes() { + return new int[]{Types.OTHER}; + } + + @SuppressWarnings("rawtypes") + @Override + public Class returnedClass() { + return String.class; + } + + @Override + public boolean equals(Object x, Object y) throws HibernateException { + return x == y; + } + + @Override + public int hashCode(Object x) throws HibernateException { + return x.hashCode(); + } + + @Override + public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, + Object owner) + throws HibernateException, SQLException { + return rs.getString(names[0]); + } + + @Override + public void nullSafeSet(PreparedStatement st, Object value, int index, + SharedSessionContractImplementor session) + throws HibernateException, SQLException { + st.setObject(index, value, Types.OTHER); + } + + @Override + public Object deepCopy(Object value) throws HibernateException { + return value; + } + + @Override + public boolean isMutable() { + return false; + } + + @Override + public Serializable disassemble(Object value) throws HibernateException { + return (Serializable) value; + } + + @Override + public Object assemble(Serializable cached, Object owner) throws HibernateException { + return cached; + } + + @Override + public Object replace(Object original, Object target, Object owner) throws HibernateException { + return deepCopy(original); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/Metadata.java b/src/main/java/com/epam/ta/reportportal/entity/Metadata.java index ff0e2e33c..eb59dc1e2 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/Metadata.java +++ b/src/main/java/com/epam/ta/reportportal/entity/Metadata.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.entity; import com.epam.ta.reportportal.commons.JsonbUserType; - import java.io.Serializable; import java.util.Map; import java.util.Objects; @@ -27,42 +26,42 @@ */ public class Metadata extends JsonbUserType implements Serializable { - @Override - public Class returnedClass() { - return Metadata.class; - } + private Map metadata; - private Map metadata; + public Metadata() { + } - public Metadata() { - } + public Metadata(Map metadata) { + this.metadata = metadata; + } - public Metadata(Map metadata) { - this.metadata = metadata; - } + @Override + public Class returnedClass() { + return Metadata.class; + } - public Map getMetadata() { - return metadata; - } + public Map getMetadata() { + return metadata; + } - public void setMetadata(Map metadata) { - this.metadata = metadata; - } + public void setMetadata(Map metadata) { + this.metadata = metadata; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Metadata comparing = (Metadata) o; - return Objects.equals(metadata, comparing.metadata); - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Metadata comparing = (Metadata) o; + return Objects.equals(metadata, comparing.metadata); + } - @Override - public int hashCode() { - return Objects.hash(metadata); - } + @Override + public int hashCode() { + return Objects.hash(metadata); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/Modifiable.java b/src/main/java/com/epam/ta/reportportal/entity/Modifiable.java index 047cc329a..319b2c8de 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/Modifiable.java +++ b/src/main/java/com/epam/ta/reportportal/entity/Modifiable.java @@ -25,14 +25,14 @@ */ public interface Modifiable { - String LAST_MODIFIED = "last_modified"; + String LAST_MODIFIED = "last_modified"; - String UPLOADED = "uploadDate"; + String UPLOADED = "uploadDate"; - /** - * Last modified date - * - * @return - */ - Date getLastModified(); + /** + * Last modified date + * + * @return + */ + Date getLastModified(); } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/ServerSettings.java b/src/main/java/com/epam/ta/reportportal/entity/ServerSettings.java index 9ca6512af..8e115b9ad 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/ServerSettings.java +++ b/src/main/java/com/epam/ta/reportportal/entity/ServerSettings.java @@ -16,73 +16,77 @@ package com.epam.ta.reportportal.entity; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; @Entity @Table(name = "server_settings", schema = "public") public class ServerSettings implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id", unique = true, nullable = false, precision = 64) - private Long id; - - @Column(name = "key", unique = true, nullable = false) - private String key; - - @Column(name = "value") - private String value; - - public ServerSettings() { - } - - public ServerSettings(String key, String value) { - this.key = key; - this.value = value; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ServerSettings that = (ServerSettings) o; - return Objects.equals(id, that.id) && Objects.equals(key, that.key) && Objects.equals(value, that.value); - } - - @Override - public int hashCode() { - return Objects.hash(id, key, value); - } + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", unique = true, nullable = false, precision = 64) + private Long id; + + @Column(name = "key", unique = true, nullable = false) + private String key; + + @Column(name = "value") + private String value; + + public ServerSettings() { + } + + public ServerSettings(String key, String value) { + this.key = key; + this.value = value; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ServerSettings that = (ServerSettings) o; + return Objects.equals(id, that.id) && Objects.equals(key, that.key) && Objects.equals(value, + that.value); + } + + @Override + public int hashCode() { + return Objects.hash(id, key, value); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/ServerSettingsConstants.java b/src/main/java/com/epam/ta/reportportal/entity/ServerSettingsConstants.java index d3e51235b..d6ed3ac17 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/ServerSettingsConstants.java +++ b/src/main/java/com/epam/ta/reportportal/entity/ServerSettingsConstants.java @@ -21,10 +21,10 @@ */ public final class ServerSettingsConstants { - public static final String ANALYTICS_CONFIG_PREFIX = "server.analytics."; - public static final String SERVER_DETAILS_CONFIG_PREFIX = "server.details."; + public static final String ANALYTICS_CONFIG_PREFIX = "server.analytics."; + public static final String SERVER_DETAILS_CONFIG_PREFIX = "server.details."; - private ServerSettingsConstants() { - //static only - } + private ServerSettingsConstants() { + //static only + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/ServerSettingsEnum.java b/src/main/java/com/epam/ta/reportportal/entity/ServerSettingsEnum.java index eca058c0f..32ea57e61 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/ServerSettingsEnum.java +++ b/src/main/java/com/epam/ta/reportportal/entity/ServerSettingsEnum.java @@ -16,41 +16,42 @@ package com.epam.ta.reportportal.entity; +import static com.epam.ta.reportportal.entity.ServerSettingsConstants.ANALYTICS_CONFIG_PREFIX; +import static com.epam.ta.reportportal.entity.ServerSettingsConstants.SERVER_DETAILS_CONFIG_PREFIX; + import java.util.Arrays; import java.util.Map; import java.util.Optional; -import static com.epam.ta.reportportal.entity.ServerSettingsConstants.ANALYTICS_CONFIG_PREFIX; -import static com.epam.ta.reportportal.entity.ServerSettingsConstants.SERVER_DETAILS_CONFIG_PREFIX; - /** * @author Ivan Budaev */ public enum ServerSettingsEnum { - ANALYTICS(ANALYTICS_CONFIG_PREFIX + "all"), - INSTANCE(SERVER_DETAILS_CONFIG_PREFIX + "instance"); + ANALYTICS(ANALYTICS_CONFIG_PREFIX + "all"), + INSTANCE(SERVER_DETAILS_CONFIG_PREFIX + "instance"); - private String attribute; + private String attribute; - ServerSettingsEnum(String attribute) { - this.attribute = attribute; - } + ServerSettingsEnum(String attribute) { + this.attribute = attribute; + } - public String getAttribute() { - return attribute; - } + public static Optional findByAttribute(String attribute) { + return Optional.ofNullable(attribute) + .flatMap(attr -> Arrays.stream(values()).filter(it -> it.attribute.equalsIgnoreCase(attr)) + .findAny()); + } - public Optional getAttribute(Map params) { - return Optional.ofNullable(params.get(this.attribute)).map(o -> (String) o); - } + public static boolean isPresent(String attribute) { + return findByAttribute(attribute).isPresent(); + } - public static Optional findByAttribute(String attribute) { - return Optional.ofNullable(attribute) - .flatMap(attr -> Arrays.stream(values()).filter(it -> it.attribute.equalsIgnoreCase(attr)).findAny()); - } + public String getAttribute() { + return attribute; + } - public static boolean isPresent(String attribute) { - return findByAttribute(attribute).isPresent(); - } + public Optional getAttribute(Map params) { + return Optional.ofNullable(params.get(this.attribute)).map(o -> (String) o); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/ShareableEntity.java b/src/main/java/com/epam/ta/reportportal/entity/ShareableEntity.java index 0c5d12e9e..9c5466103 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/ShareableEntity.java +++ b/src/main/java/com/epam/ta/reportportal/entity/ShareableEntity.java @@ -17,8 +17,16 @@ package com.epam.ta.reportportal.entity; import com.epam.ta.reportportal.entity.project.Project; - -import javax.persistence.*; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; /** * @author Pavel Bortnik @@ -28,47 +36,47 @@ @Inheritance(strategy = InheritanceType.JOINED) public abstract class ShareableEntity { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; - private String owner; + private String owner; - private boolean shared; + private boolean shared; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "project_id") - private Project project; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "project_id") + private Project project; - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public boolean isShared() { - return shared; - } + public boolean isShared() { + return shared; + } - public void setShared(boolean shared) { - this.shared = shared; - } + public void setShared(boolean shared) { + this.shared = shared; + } - public String getOwner() { - return owner; - } + public String getOwner() { + return owner; + } - public void setOwner(String owner) { - this.owner = owner; - } + public void setOwner(String owner) { + this.owner = owner; + } - public Project getProject() { - return project; - } + public Project getProject() { + return project; + } - public void setProject(Project project) { - this.project = project; - } + public void setProject(Project project) { + this.project = project; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/StatisticsAwareness.java b/src/main/java/com/epam/ta/reportportal/entity/StatisticsAwareness.java index 67026a9dc..b346e890c 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/StatisticsAwareness.java +++ b/src/main/java/com/epam/ta/reportportal/entity/StatisticsAwareness.java @@ -12,10 +12,11 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ + */ package com.epam.ta.reportportal.entity; public interface StatisticsAwareness { - String awareStatisticsField(); + + String awareStatisticsField(); } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/StatisticsCalculationStrategy.java b/src/main/java/com/epam/ta/reportportal/entity/StatisticsCalculationStrategy.java index 3373675a6..6e28fb561 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/StatisticsCalculationStrategy.java +++ b/src/main/java/com/epam/ta/reportportal/entity/StatisticsCalculationStrategy.java @@ -26,29 +26,30 @@ */ public enum StatisticsCalculationStrategy { - /** - * Step based strategy. Only steps should be calculated as statistics items - */ - STEP_BASED, - - /** - * All (including befores and afters) should be calculated as statistics items - */ - ALL_ITEMS_BASED, - - /** - * Optimized for BDD-based launches. Does NOT calculates stats for step/scenario level, only starting from TEST level - */ - TEST_BASED; - - /** - * Loads strategy by it's string name. Case matters. - * - * @param strategy Strategy string - * @return Optional of found enum value - */ - public static Optional fromString(String strategy) { - return Arrays.stream(values()).filter(s -> s.name().equals(strategy)).findAny(); - } + /** + * Step based strategy. Only steps should be calculated as statistics items + */ + STEP_BASED, + + /** + * All (including befores and afters) should be calculated as statistics items + */ + ALL_ITEMS_BASED, + + /** + * Optimized for BDD-based launches. Does NOT calculates stats for step/scenario level, only + * starting from TEST level + */ + TEST_BASED; + + /** + * Loads strategy by it's string name. Case matters. + * + * @param strategy Strategy string + * @return Optional of found enum value + */ + public static Optional fromString(String strategy) { + return Arrays.stream(values()).filter(s -> s.name().equals(strategy)).findAny(); + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/activity/Activity.java b/src/main/java/com/epam/ta/reportportal/entity/activity/Activity.java index fa5a201c5..ca59ef8f1 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/activity/Activity.java +++ b/src/main/java/com/epam/ta/reportportal/entity/activity/Activity.java @@ -16,16 +16,19 @@ package com.epam.ta.reportportal.entity.activity; -import org.hibernate.annotations.Type; -import org.hibernate.annotations.TypeDef; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -import javax.persistence.*; import java.io.Serializable; import java.time.LocalDateTime; import java.util.Arrays; import java.util.Objects; import java.util.Optional; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; /** * Activity table entity @@ -37,160 +40,165 @@ @TypeDef(name = "activityDetails", typeClass = ActivityDetails.class) public class Activity implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id", unique = true, nullable = false, precision = 64) - private Long id; - - @Column(name = "user_id", precision = 32) - private Long userId; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", unique = true, nullable = false, precision = 64) + private Long id; - @Column(name = "username") - private String username; + @Column(name = "user_id", precision = 32) + private Long userId; - @Column(name = "project_id", nullable = false) - private Long projectId; + @Column(name = "username") + private String username; - @Column(name = "entity", unique = true, nullable = false) - private String activityEntityType; - - @Column(name = "action", nullable = false) - private String action; - - @Column(name = "details") - @Type(type = "activityDetails") - private ActivityDetails details; - - @Column(name = "creation_date") - private LocalDateTime createdAt; - - @Column(name = "object_id") - private Long objectId; + @Column(name = "project_id", nullable = false) + private Long projectId; - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Long getUserId() { - return userId; - } - - public void setUserId(Long userId) { - this.userId = userId; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public Long getProjectId() { - return projectId; - } - - public void setProjectId(Long projectId) { - this.projectId = projectId; - } - - public String getActivityEntityType() { - return activityEntityType; - } - - public void setActivityEntityType(String activityEntityType) { - this.activityEntityType = activityEntityType; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public ActivityDetails getDetails() { - return details; - } - - public void setDetails(ActivityDetails details) { - this.details = details; - } - - public LocalDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(LocalDateTime createdAt) { - this.createdAt = createdAt; - } - - public Long getObjectId() { - return objectId; - } - - public void setObjectId(Long objectId) { - this.objectId = objectId; - } - - public enum ActivityEntityType { - LAUNCH("launch"), - ITEM("item"), - DASHBOARD("dashboard"), - DEFECT_TYPE("defectType"), - EMAIL_CONFIG("emailConfig"), - FILTER("filter"), - IMPORT("import"), - INTEGRATION("integration"), - ITEM_ISSUE("itemIssue"), - PROJECT("project"), - SHARING("sharing"), - TICKET("ticket"), - USER("user"), - WIDGET("widget"), - PATTERN("pattern"); - - private String value; - - ActivityEntityType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Optional fromString(String string) { - return Optional.ofNullable(string) - .flatMap(str -> Arrays.stream(values()).filter(it -> it.value.equalsIgnoreCase(str)).findAny()); - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Activity activity = (Activity) o; - return Objects.equals(id, activity.id) && Objects.equals(userId, activity.userId) && Objects.equals(username, activity.username) - && Objects.equals(projectId, activity.projectId) && Objects.equals(activityEntityType, activity.activityEntityType) - && Objects.equals(action, activity.action) && Objects.equals(details, activity.details) && Objects.equals( - createdAt, - activity.createdAt - ) && Objects.equals(objectId, activity.objectId); - } - - @Override - public int hashCode() { - return Objects.hash(id, userId, username, projectId, activityEntityType, action, details, createdAt, objectId); - } + @Column(name = "entity", unique = true, nullable = false) + private String activityEntityType; + + @Column(name = "action", nullable = false) + private String action; + + @Column(name = "details") + @Type(type = "activityDetails") + private ActivityDetails details; + + @Column(name = "creation_date") + private LocalDateTime createdAt; + + @Column(name = "object_id") + private Long objectId; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + public String getActivityEntityType() { + return activityEntityType; + } + + public void setActivityEntityType(String activityEntityType) { + this.activityEntityType = activityEntityType; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public ActivityDetails getDetails() { + return details; + } + + public void setDetails(ActivityDetails details) { + this.details = details; + } + + public LocalDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(LocalDateTime createdAt) { + this.createdAt = createdAt; + } + + public Long getObjectId() { + return objectId; + } + + public void setObjectId(Long objectId) { + this.objectId = objectId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Activity activity = (Activity) o; + return Objects.equals(id, activity.id) && Objects.equals(userId, activity.userId) + && Objects.equals(username, activity.username) + && Objects.equals(projectId, activity.projectId) && Objects.equals(activityEntityType, + activity.activityEntityType) + && Objects.equals(action, activity.action) && Objects.equals(details, activity.details) + && Objects.equals( + createdAt, + activity.createdAt + ) && Objects.equals(objectId, activity.objectId); + } + + @Override + public int hashCode() { + return Objects.hash(id, userId, username, projectId, activityEntityType, action, details, + createdAt, objectId); + } + + public enum ActivityEntityType { + LAUNCH("launch"), + ITEM("item"), + DASHBOARD("dashboard"), + DEFECT_TYPE("defectType"), + EMAIL_CONFIG("emailConfig"), + FILTER("filter"), + IMPORT("import"), + INTEGRATION("integration"), + ITEM_ISSUE("itemIssue"), + PROJECT("project"), + SHARING("sharing"), + TICKET("ticket"), + USER("user"), + WIDGET("widget"), + PATTERN("pattern"); + + private String value; + + ActivityEntityType(String value) { + this.value = value; + } + + public static Optional fromString(String string) { + return Optional.ofNullable(string) + .flatMap(str -> Arrays.stream(values()).filter(it -> it.value.equalsIgnoreCase(str)) + .findAny()); + } + + public String getValue() { + return value; + } + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/activity/ActivityAction.java b/src/main/java/com/epam/ta/reportportal/entity/activity/ActivityAction.java index 4f48dc6cb..85e4cc9f7 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/activity/ActivityAction.java +++ b/src/main/java/com/epam/ta/reportportal/entity/activity/ActivityAction.java @@ -24,53 +24,54 @@ */ public enum ActivityAction { - CREATE_DASHBOARD("createDashboard"), - UPDATE_DASHBOARD("updateDashboard"), - DELETE_DASHBOARD("deleteDashboard"), - CREATE_WIDGET("createWidget"), - UPDATE_WIDGET("updateWidget"), - DELETE_WIDGET("deleteWidget"), - CREATE_FILTER("createFilter"), - UPDATE_FILTER("updateFilter"), - DELETE_FILTER("deleteFilter"), - ANALYZE_ITEM("analyzeItem"), - CREATE_DEFECT("createDefect"), - UPDATE_DEFECT("updateDefect"), - DELETE_DEFECT("deleteDefect"), - CREATE_INTEGRATION("createIntegration"), - UPDATE_INTEGRATION("updateIntegration"), - DELETE_INTEGRATION("deleteIntegration"), - START_LAUNCH("startLaunch"), - FINISH_LAUNCH("finishLaunch"), - DELETE_LAUNCH("deleteLaunch"), - UPDATE_PROJECT("updateProject"), - UPDATE_ANALYZER("updateAnalyzer"), - POST_ISSUE("postIssue"), - LINK_ISSUE("linkIssue"), - LINK_ISSUE_AA("linkIssueAa"), - UNLINK_ISSUE("unlinkIssue"), - UPDATE_ITEM("updateItem"), - CREATE_USER("createUser"), - DELETE_INDEX("deleteIndex"), - GENERATE_INDEX("generateIndex"), - START_IMPORT("startImport"), - FINISH_IMPORT("finishImport"), - CREATE_PATTERN("createPattern"), - UPDATE_PATTERN("updatePattern"), - DELETE_PATTERN("deletePattern"), - PATTERN_MATCHED("patternMatched"); + CREATE_DASHBOARD("createDashboard"), + UPDATE_DASHBOARD("updateDashboard"), + DELETE_DASHBOARD("deleteDashboard"), + CREATE_WIDGET("createWidget"), + UPDATE_WIDGET("updateWidget"), + DELETE_WIDGET("deleteWidget"), + CREATE_FILTER("createFilter"), + UPDATE_FILTER("updateFilter"), + DELETE_FILTER("deleteFilter"), + ANALYZE_ITEM("analyzeItem"), + CREATE_DEFECT("createDefect"), + UPDATE_DEFECT("updateDefect"), + DELETE_DEFECT("deleteDefect"), + CREATE_INTEGRATION("createIntegration"), + UPDATE_INTEGRATION("updateIntegration"), + DELETE_INTEGRATION("deleteIntegration"), + START_LAUNCH("startLaunch"), + FINISH_LAUNCH("finishLaunch"), + DELETE_LAUNCH("deleteLaunch"), + UPDATE_PROJECT("updateProject"), + UPDATE_ANALYZER("updateAnalyzer"), + POST_ISSUE("postIssue"), + LINK_ISSUE("linkIssue"), + LINK_ISSUE_AA("linkIssueAa"), + UNLINK_ISSUE("unlinkIssue"), + UPDATE_ITEM("updateItem"), + CREATE_USER("createUser"), + DELETE_INDEX("deleteIndex"), + GENERATE_INDEX("generateIndex"), + START_IMPORT("startImport"), + FINISH_IMPORT("finishImport"), + CREATE_PATTERN("createPattern"), + UPDATE_PATTERN("updatePattern"), + DELETE_PATTERN("deletePattern"), + PATTERN_MATCHED("patternMatched"); - private String value; + private String value; - ActivityAction(String value) { - this.value = value; - } + ActivityAction(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public static Optional fromString(String string) { + return Optional.ofNullable(string).flatMap( + str -> Arrays.stream(values()).filter(it -> it.value.equalsIgnoreCase(str)).findAny()); + } - public static Optional fromString(String string) { - return Optional.ofNullable(string).flatMap(str -> Arrays.stream(values()).filter(it -> it.value.equalsIgnoreCase(str)).findAny()); - } + public String getValue() { + return value; + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/activity/ActivityDetails.java b/src/main/java/com/epam/ta/reportportal/entity/activity/ActivityDetails.java index 9fea710fb..70b71703c 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/activity/ActivityDetails.java +++ b/src/main/java/com/epam/ta/reportportal/entity/activity/ActivityDetails.java @@ -18,7 +18,6 @@ import com.epam.ta.reportportal.commons.JsonbUserType; import com.google.common.collect.Lists; - import java.io.Serializable; import java.util.List; @@ -27,44 +26,43 @@ */ public class ActivityDetails extends JsonbUserType implements Serializable { - @Override - public Class returnedClass() { - return ActivityDetails.class; - } - - private List history = Lists.newArrayList(); + private List history = Lists.newArrayList(); + private String objectName; - private String objectName; + public ActivityDetails() { + } - public ActivityDetails() { - } + public ActivityDetails(String objectName) { + this.objectName = objectName; + } - public ActivityDetails(String objectName) { - this.objectName = objectName; - } + public ActivityDetails(List history, String objectName) { + this.history = history; + this.objectName = objectName; + } - public ActivityDetails(List history, String objectName) { - this.history = history; - this.objectName = objectName; - } + @Override + public Class returnedClass() { + return ActivityDetails.class; + } - public List getHistory() { - return history; - } + public List getHistory() { + return history; + } - public void setHistory(List history) { - this.history = history; - } + public void setHistory(List history) { + this.history = history; + } - public String getObjectName() { - return objectName; - } + public String getObjectName() { + return objectName; + } - public void setObjectName(String objectName) { - this.objectName = objectName; - } + public void setObjectName(String objectName) { + this.objectName = objectName; + } - public void addHistoryField(HistoryField historyField) { - history.add(historyField); - } + public void addHistoryField(HistoryField historyField) { + history.add(historyField); + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/activity/HistoryField.java b/src/main/java/com/epam/ta/reportportal/entity/activity/HistoryField.java index 857b3a6e0..1e911b684 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/activity/HistoryField.java +++ b/src/main/java/com/epam/ta/reportportal/entity/activity/HistoryField.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.entity.activity; import com.epam.ta.reportportal.commons.JsonbUserType; - import java.io.Serializable; import java.util.Objects; @@ -26,78 +25,77 @@ */ public class HistoryField extends JsonbUserType implements Serializable { - @Override - public Class returnedClass() { - return HistoryField.class; - } - - private String field; - - private String oldValue; - - private String newValue; - - public HistoryField() { - } - - public HistoryField(String field, String oldValue, String newValue) { - this.field = field; - this.oldValue = oldValue; - this.newValue = newValue; - } - - public String getField() { - return field; - } - - public void setField(String field) { - this.field = field; - } - - public String getOldValue() { - return oldValue; - } - - public void setOldValue(String oldValue) { - this.oldValue = oldValue; - } - - public String getNewValue() { - return newValue; - } - - public void setNewValue(String newValue) { - this.newValue = newValue; - } - - public static HistoryField of(String field, String oldValue, String newValue) { - return new HistoryField(field, oldValue, newValue); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HistoryField that = (HistoryField) o; - return Objects.equals(field, that.field) && Objects.equals(oldValue, that.oldValue) && Objects.equals(newValue, that.newValue); - } - - @Override - public int hashCode() { - return Objects.hash(field, oldValue, newValue); - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("HistoryField{"); - sb.append("field='").append(field).append('\''); - sb.append(", oldValue='").append(oldValue).append('\''); - sb.append(", newValue='").append(newValue).append('\''); - sb.append('}'); - return sb.toString(); - } + private String field; + private String oldValue; + private String newValue; + + public HistoryField() { + } + + public HistoryField(String field, String oldValue, String newValue) { + this.field = field; + this.oldValue = oldValue; + this.newValue = newValue; + } + + public static HistoryField of(String field, String oldValue, String newValue) { + return new HistoryField(field, oldValue, newValue); + } + + @Override + public Class returnedClass() { + return HistoryField.class; + } + + public String getField() { + return field; + } + + public void setField(String field) { + this.field = field; + } + + public String getOldValue() { + return oldValue; + } + + public void setOldValue(String oldValue) { + this.oldValue = oldValue; + } + + public String getNewValue() { + return newValue; + } + + public void setNewValue(String newValue) { + this.newValue = newValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HistoryField that = (HistoryField) o; + return Objects.equals(field, that.field) && Objects.equals(oldValue, that.oldValue) + && Objects.equals(newValue, that.newValue); + } + + @Override + public int hashCode() { + return Objects.hash(field, oldValue, newValue); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("HistoryField{"); + sb.append("field='").append(field).append('\''); + sb.append(", oldValue='").append(oldValue).append('\''); + sb.append(", newValue='").append(newValue).append('\''); + sb.append('}'); + return sb.toString(); + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/attachment/Attachment.java b/src/main/java/com/epam/ta/reportportal/entity/attachment/Attachment.java index bdb192160..0e7501ded 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/attachment/Attachment.java +++ b/src/main/java/com/epam/ta/reportportal/entity/attachment/Attachment.java @@ -16,10 +16,15 @@ package com.epam.ta.reportportal.entity.attachment; -import javax.persistence.*; import java.io.Serializable; import java.time.LocalDateTime; import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; /** * @author Ivan Budayeu @@ -28,125 +33,126 @@ @Table(name = "attachment") public class Attachment implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; - @Column(name = "file_id") - private String fileId; + @Column(name = "file_id") + private String fileId; - @Column(name = "thumbnail_id") - private String thumbnailId; + @Column(name = "thumbnail_id") + private String thumbnailId; - @Column(name = "content_type") - private String contentType; + @Column(name = "content_type") + private String contentType; - @Column(name = "file_size") - private long fileSize; + @Column(name = "file_size") + private long fileSize; - @Column(name = "creation_date") - private LocalDateTime creationDate; + @Column(name = "creation_date") + private LocalDateTime creationDate; - @Column(name = "project_id") - private Long projectId; + @Column(name = "project_id") + private Long projectId; - @Column(name = "launch_id") - private Long launchId; + @Column(name = "launch_id") + private Long launchId; - @Column(name = "item_id") - private Long itemId; + @Column(name = "item_id") + private Long itemId; - public Attachment() { - } + public Attachment() { + } - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public String getFileId() { - return fileId; - } + public String getFileId() { + return fileId; + } - public void setFileId(String fileId) { - this.fileId = fileId; - } + public void setFileId(String fileId) { + this.fileId = fileId; + } - public String getThumbnailId() { - return thumbnailId; - } + public String getThumbnailId() { + return thumbnailId; + } - public void setThumbnailId(String thumbnailId) { - this.thumbnailId = thumbnailId; - } + public void setThumbnailId(String thumbnailId) { + this.thumbnailId = thumbnailId; + } - public String getContentType() { - return contentType; - } + public String getContentType() { + return contentType; + } - public void setContentType(String contentType) { - this.contentType = contentType; - } + public void setContentType(String contentType) { + this.contentType = contentType; + } - public long getFileSize() { - return fileSize; - } + public long getFileSize() { + return fileSize; + } - public void setFileSize(long fileSize) { - this.fileSize = fileSize; - } + public void setFileSize(long fileSize) { + this.fileSize = fileSize; + } - public LocalDateTime getCreationDate() { - return creationDate; - } + public LocalDateTime getCreationDate() { + return creationDate; + } - public void setCreationDate(LocalDateTime creationDate) { - this.creationDate = creationDate; - } + public void setCreationDate(LocalDateTime creationDate) { + this.creationDate = creationDate; + } - public Long getProjectId() { - return projectId; - } + public Long getProjectId() { + return projectId; + } - public void setProjectId(Long projectId) { - this.projectId = projectId; - } + public void setProjectId(Long projectId) { + this.projectId = projectId; + } - public Long getLaunchId() { - return launchId; - } + public Long getLaunchId() { + return launchId; + } - public void setLaunchId(Long launchId) { - this.launchId = launchId; - } + public void setLaunchId(Long launchId) { + this.launchId = launchId; + } - public Long getItemId() { - return itemId; - } + public Long getItemId() { + return itemId; + } - public void setItemId(Long itemId) { - this.itemId = itemId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Attachment that = (Attachment) o; - return Objects.equals(fileId, that.fileId) && Objects.equals(thumbnailId, that.thumbnailId) && Objects.equals(contentType, - that.contentType - ) && Objects.equals(fileSize, that.fileSize) && Objects.equals(creationDate, that.creationDate); - } - - @Override - public int hashCode() { - return Objects.hash(fileId, thumbnailId, contentType, fileSize, creationDate); - } + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Attachment that = (Attachment) o; + return Objects.equals(fileId, that.fileId) && Objects.equals(thumbnailId, that.thumbnailId) + && Objects.equals(contentType, + that.contentType + ) && Objects.equals(fileSize, that.fileSize) && Objects.equals(creationDate, that.creationDate); + } + + @Override + public int hashCode() { + return Objects.hash(fileId, thumbnailId, contentType, fileSize, creationDate); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/attachment/AttachmentMetaInfo.java b/src/main/java/com/epam/ta/reportportal/entity/attachment/AttachmentMetaInfo.java index 168294ad3..50e0d9043 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/attachment/AttachmentMetaInfo.java +++ b/src/main/java/com/epam/ta/reportportal/entity/attachment/AttachmentMetaInfo.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.entity.attachment; import com.google.common.base.Preconditions; - import java.time.LocalDateTime; /** @@ -25,118 +24,121 @@ */ public class AttachmentMetaInfo { - private Long projectId; + private Long projectId; + + private Long launchId; - private Long launchId; + private Long itemId; - private Long itemId; + private Long logId; - private Long logId; + private String launchUuid; - private String launchUuid; + private String logUuid; - private String logUuid; + private LocalDateTime creationDate; - private LocalDateTime creationDate; + public AttachmentMetaInfo(Long projectId, Long launchId, Long itemId, Long logId, + String launchUuid, String logUuid, LocalDateTime creationDate) { + this.projectId = projectId; + this.launchId = launchId; + this.itemId = itemId; + this.logId = logId; + this.launchUuid = launchUuid; + this.logUuid = logUuid; + this.creationDate = creationDate; + } - public AttachmentMetaInfo(Long projectId, Long launchId, Long itemId, Long logId, String launchUuid, String logUuid, LocalDateTime creationDate) { - this.projectId = projectId; - this.launchId = launchId; - this.itemId = itemId; - this.logId = logId; - this.launchUuid = launchUuid; - this.logUuid = logUuid; - this.creationDate = creationDate; - } + public static AttachmentMetaInfoBuilder builder() { + return new AttachmentMetaInfoBuilder(); + } - public static AttachmentMetaInfoBuilder builder() { - return new AttachmentMetaInfoBuilder(); - } + public Long getProjectId() { + return projectId; + } - public Long getProjectId() { - return projectId; - } + public Long getLaunchId() { + return launchId; + } - public Long getLaunchId() { - return launchId; - } + public Long getItemId() { + return itemId; + } - public Long getItemId() { - return itemId; - } + public Long getLogId() { + return logId; + } - public Long getLogId() { - return logId; - } + public String getLaunchUuid() { + return launchUuid; + } - public String getLaunchUuid() { - return launchUuid; - } + public String getLogUuid() { + return logUuid; + } - public String getLogUuid() { - return logUuid; - } + public LocalDateTime getCreationDate() { + return creationDate; + } - public LocalDateTime getCreationDate() { - return creationDate; - } + public static class AttachmentMetaInfoBuilder { - public static class AttachmentMetaInfoBuilder { - private Long projectId; + private Long projectId; - private Long launchId; + private Long launchId; - private Long itemId; + private Long itemId; - private Long logId; + private Long logId; - private String launchUuid; + private String launchUuid; - private String logUuid; + private String logUuid; - private LocalDateTime creationDate; + private LocalDateTime creationDate; - private AttachmentMetaInfoBuilder() { - } + private AttachmentMetaInfoBuilder() { + } - public AttachmentMetaInfoBuilder withProjectId(Long projectId) { - Preconditions.checkNotNull(projectId); - this.projectId = projectId; - return this; - } + public AttachmentMetaInfoBuilder withProjectId(Long projectId) { + Preconditions.checkNotNull(projectId); + this.projectId = projectId; + return this; + } - public AttachmentMetaInfoBuilder withLaunchId(Long launchId) { - this.launchId = launchId; - return this; - } + public AttachmentMetaInfoBuilder withLaunchId(Long launchId) { + this.launchId = launchId; + return this; + } - public AttachmentMetaInfoBuilder withItemId(Long itemId) { - this.itemId = itemId; - return this; - } + public AttachmentMetaInfoBuilder withItemId(Long itemId) { + this.itemId = itemId; + return this; + } - public AttachmentMetaInfoBuilder withLogId(Long logId) { - this.logId = logId; - return this; - } + public AttachmentMetaInfoBuilder withLogId(Long logId) { + this.logId = logId; + return this; + } - public AttachmentMetaInfoBuilder withLaunchUuid(String launchUuid) { - this.launchUuid = launchUuid; - return this; - } + public AttachmentMetaInfoBuilder withLaunchUuid(String launchUuid) { + this.launchUuid = launchUuid; + return this; + } - public AttachmentMetaInfoBuilder withLogUuid(String logUuid) { - this.logUuid = logUuid; - return this; - } + public AttachmentMetaInfoBuilder withLogUuid(String logUuid) { + this.logUuid = logUuid; + return this; + } - public AttachmentMetaInfoBuilder withCreationDate(LocalDateTime creationDate) { - this.creationDate = creationDate; - return this; - } + public AttachmentMetaInfoBuilder withCreationDate(LocalDateTime creationDate) { + this.creationDate = creationDate; + return this; + } - public AttachmentMetaInfo build() { - return new AttachmentMetaInfo(this.projectId, this.launchId, this.itemId, this.logId, this.launchUuid, this.logUuid, this.creationDate); - } - } + public AttachmentMetaInfo build() { + return new AttachmentMetaInfo(this.projectId, this.launchId, this.itemId, this.logId, + this.launchUuid, this.logUuid, this.creationDate); + } + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/attachment/BinaryData.java b/src/main/java/com/epam/ta/reportportal/entity/attachment/BinaryData.java index 4f1ade1de..1ed0e66b1 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/attachment/BinaryData.java +++ b/src/main/java/com/epam/ta/reportportal/entity/attachment/BinaryData.java @@ -18,61 +18,61 @@ import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.ws.model.ErrorType; -import org.springframework.web.multipart.MultipartFile; - import java.io.IOException; import java.io.InputStream; +import org.springframework.web.multipart.MultipartFile; /** - * Binary data representation. Contains only input stream and data type. - * Introduced to simplify store/retrieve operations + * Binary data representation. Contains only input stream and data type. Introduced to simplify + * store/retrieve operations * * @author Andrei Varabyeu */ public class BinaryData { - /** - * MIME Type of Binary Data - */ - private final String contentType; + /** + * MIME Type of Binary Data + */ + private final String contentType; - /** - * Data Stream - */ - private final InputStream inputStream; + /** + * Data Stream + */ + private final InputStream inputStream; - /** - * Content length - */ - private Long length; + /** + * Content length + */ + private Long length; - public BinaryData(String contentType, Long length, InputStream inputStream) { - this.contentType = contentType; - this.length = length; - this.inputStream = inputStream; - } + public BinaryData(String contentType, Long length, InputStream inputStream) { + this.contentType = contentType; + this.length = length; + this.inputStream = inputStream; + } - public BinaryData(MultipartFile multipartFile) { - this.contentType = multipartFile.getContentType(); - this.length = multipartFile.getSize(); + public BinaryData(MultipartFile multipartFile) { + this.contentType = multipartFile.getContentType(); + this.length = multipartFile.getSize(); - try { - this.inputStream = multipartFile.getInputStream(); - } catch (IOException e) { - throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to create binary data from multipart file"); - } - } + try { + this.inputStream = multipartFile.getInputStream(); + } catch (IOException e) { + throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, + "Unable to create binary data from multipart file"); + } + } - public String getContentType() { - return contentType; - } + public String getContentType() { + return contentType; + } - public InputStream getInputStream() { - return inputStream; - } + public InputStream getInputStream() { + return inputStream; + } - public Long getLength() { - return length; - } + public Long getLength() { + return length; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/attribute/Attribute.java b/src/main/java/com/epam/ta/reportportal/entity/attribute/Attribute.java index bf93312c6..0f37999d0 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/attribute/Attribute.java +++ b/src/main/java/com/epam/ta/reportportal/entity/attribute/Attribute.java @@ -16,9 +16,14 @@ package com.epam.ta.reportportal.entity.attribute; -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; /** * @author Andrey Plisunov @@ -27,52 +32,52 @@ @Table(name = "attribute") public class Attribute implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; - @Column(name = "name") - private String name; + @Column(name = "name") + private String name; - public Attribute() { - } + public Attribute() { + } - public Attribute(Long id, String name) { - this.id = id; - this.name = name; - } + public Attribute(Long id, String name) { + this.id = id; + this.name = name; + } - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Attribute attribute = (Attribute) o; - return Objects.equals(name, attribute.name); - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Attribute attribute = (Attribute) o; + return Objects.equals(name, attribute.name); + } - @Override - public int hashCode() { + @Override + public int hashCode() { - return Objects.hash(name); - } + return Objects.hash(name); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/bts/DefectFieldAllowedValue.java b/src/main/java/com/epam/ta/reportportal/entity/bts/DefectFieldAllowedValue.java index 3c8a85dfc..201173ba3 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/bts/DefectFieldAllowedValue.java +++ b/src/main/java/com/epam/ta/reportportal/entity/bts/DefectFieldAllowedValue.java @@ -23,31 +23,31 @@ */ public class DefectFieldAllowedValue implements Serializable { - private String valueId; + private String valueId; - private String valueName; + private String valueName; - public DefectFieldAllowedValue() { - } + public DefectFieldAllowedValue() { + } - public DefectFieldAllowedValue(String valueId, String valueName) { - this.valueId = valueId; - this.valueName = valueName; - } + public DefectFieldAllowedValue(String valueId, String valueName) { + this.valueId = valueId; + this.valueName = valueName; + } - public String getValueId() { - return valueId; - } + public String getValueId() { + return valueId; + } - public void setValueId(String valueId) { - this.valueId = valueId; - } + public void setValueId(String valueId) { + this.valueId = valueId; + } - public String getValueName() { - return valueName; - } + public String getValueName() { + return valueName; + } - public void setValueName(String valueName) { - this.valueName = valueName; - } + public void setValueName(String valueName) { + this.valueName = valueName; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/bts/DefectFormField.java b/src/main/java/com/epam/ta/reportportal/entity/bts/DefectFormField.java index 49a75070f..648af7c69 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/bts/DefectFormField.java +++ b/src/main/java/com/epam/ta/reportportal/entity/bts/DefectFormField.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.entity.bts; import com.google.common.collect.Sets; - import java.io.Serializable; import java.util.Set; @@ -26,57 +25,57 @@ */ public class DefectFormField implements Serializable { - private String fieldId; + private String fieldId; - private String type; + private String type; - private boolean isRequired; + private boolean isRequired; - private Set values; + private Set values; - private Set defectFieldAllowedValues = Sets.newHashSet(); + private Set defectFieldAllowedValues = Sets.newHashSet(); - public DefectFormField() { - } + public DefectFormField() { + } - public String getFieldId() { - return fieldId; - } + public String getFieldId() { + return fieldId; + } - public void setFieldId(String fieldId) { - this.fieldId = fieldId; - } + public void setFieldId(String fieldId) { + this.fieldId = fieldId; + } - public String getType() { - return type; - } + public String getType() { + return type; + } - public void setType(String type) { - this.type = type; - } + public void setType(String type) { + this.type = type; + } - public boolean isRequired() { - return isRequired; - } + public boolean isRequired() { + return isRequired; + } - public void setRequired(boolean required) { - isRequired = required; - } + public void setRequired(boolean required) { + isRequired = required; + } - public Set getValues() { - return values; - } + public Set getValues() { + return values; + } - public void setValues(Set values) { - this.values = values; - } + public void setValues(Set values) { + this.values = values; + } - public Set getDefectFieldAllowedValues() { - return defectFieldAllowedValues; - } + public Set getDefectFieldAllowedValues() { + return defectFieldAllowedValues; + } - public void setDefectFieldAllowedValues(Set defectFieldAllowedValues) { - this.defectFieldAllowedValues.clear(); - this.defectFieldAllowedValues.addAll(defectFieldAllowedValues); - } + public void setDefectFieldAllowedValues(Set defectFieldAllowedValues) { + this.defectFieldAllowedValues.clear(); + this.defectFieldAllowedValues.addAll(defectFieldAllowedValues); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/bts/Ticket.java b/src/main/java/com/epam/ta/reportportal/entity/bts/Ticket.java index 063e16952..3f57cb1dd 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/bts/Ticket.java +++ b/src/main/java/com/epam/ta/reportportal/entity/bts/Ticket.java @@ -18,12 +18,17 @@ import com.epam.ta.reportportal.entity.item.issue.IssueEntity; import com.google.common.collect.Sets; - -import javax.persistence.*; import java.io.Serializable; import java.time.LocalDateTime; import java.util.Objects; import java.util.Set; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToMany; +import javax.persistence.Table; /** * @author Pavel Bortnik @@ -33,124 +38,124 @@ @Table(name = "ticket") public class Ticket implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id") - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Long id; - @Column(name = "ticket_id") - private String ticketId; + @Column(name = "ticket_id") + private String ticketId; - @Column(name = "submitter") - private String submitter; + @Column(name = "submitter") + private String submitter; - @Column(name = "submit_date") - private LocalDateTime submitDate; + @Column(name = "submit_date") + private LocalDateTime submitDate; - @Column(name = "bts_url") - private String btsUrl; + @Column(name = "bts_url") + private String btsUrl; - @Column(name = "bts_project") - private String btsProject; + @Column(name = "bts_project") + private String btsProject; - @Column(name = "url") - private String url; + @Column(name = "url") + private String url; - @Column(name = "plugin_name") - private String pluginName; + @Column(name = "plugin_name") + private String pluginName; - @ManyToMany(mappedBy = "tickets") - private Set issues = Sets.newHashSet(); + @ManyToMany(mappedBy = "tickets") + private Set issues = Sets.newHashSet(); - public Ticket() { - } + public Ticket() { + } - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public String getTicketId() { - return ticketId; - } + public String getTicketId() { + return ticketId; + } - public void setTicketId(String ticketId) { - this.ticketId = ticketId; - } + public void setTicketId(String ticketId) { + this.ticketId = ticketId; + } - public String getSubmitter() { - return submitter; - } + public String getSubmitter() { + return submitter; + } - public void setSubmitter(String submitter) { - this.submitter = submitter; - } + public void setSubmitter(String submitter) { + this.submitter = submitter; + } - public LocalDateTime getSubmitDate() { - return submitDate; - } + public LocalDateTime getSubmitDate() { + return submitDate; + } - public void setSubmitDate(LocalDateTime submitDate) { - this.submitDate = submitDate; - } + public void setSubmitDate(LocalDateTime submitDate) { + this.submitDate = submitDate; + } - public String getBtsUrl() { - return btsUrl; - } + public String getBtsUrl() { + return btsUrl; + } - public void setBtsUrl(String btsUrl) { - this.btsUrl = btsUrl; - } + public void setBtsUrl(String btsUrl) { + this.btsUrl = btsUrl; + } - public String getBtsProject() { - return btsProject; - } + public String getBtsProject() { + return btsProject; + } - public void setBtsProject(String btsProject) { - this.btsProject = btsProject; - } + public void setBtsProject(String btsProject) { + this.btsProject = btsProject; + } - public String getUrl() { - return url; - } + public String getUrl() { + return url; + } - public void setUrl(String url) { - this.url = url; - } + public void setUrl(String url) { + this.url = url; + } - public Set getIssues() { - return issues; - } + public Set getIssues() { + return issues; + } - public void setIssues(Set issues) { - this.issues = issues; - } + public void setIssues(Set issues) { + this.issues = issues; + } - public String getPluginName() { - return pluginName; - } + public String getPluginName() { + return pluginName; + } - public void setPluginName(String pluginName) { - this.pluginName = pluginName; - } + public void setPluginName(String pluginName) { + this.pluginName = pluginName; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Ticket ticket = (Ticket) o; - return Objects.equals(ticketId, ticket.ticketId); - } - - @Override - public int hashCode() { - return Objects.hash(ticketId); - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Ticket ticket = (Ticket) o; + return Objects.equals(ticketId, ticket.ticketId); + } + + @Override + public int hashCode() { + return Objects.hash(ticketId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/cluster/Cluster.java b/src/main/java/com/epam/ta/reportportal/entity/cluster/Cluster.java index fa951a206..44753792e 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/cluster/Cluster.java +++ b/src/main/java/com/epam/ta/reportportal/entity/cluster/Cluster.java @@ -16,8 +16,13 @@ package com.epam.ta.reportportal.entity.cluster; -import javax.persistence.*; import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; /** * @author Ivan Budayeu @@ -26,63 +31,63 @@ @Table(name = "clusters", schema = "public") public class Cluster implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id") - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Long id; - @Column(name = "index_id") - private Long indexId; + @Column(name = "index_id") + private Long indexId; - @Column(name = "project_id") - private Long projectId; + @Column(name = "project_id") + private Long projectId; - @Column(name = "launch_id") - private Long launchId; + @Column(name = "launch_id") + private Long launchId; - @Column(name = "message") - private String message; + @Column(name = "message") + private String message; - public Cluster() { - } + public Cluster() { + } - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public Long getIndexId() { - return indexId; - } + public Long getIndexId() { + return indexId; + } - public void setIndexId(Long indexId) { - this.indexId = indexId; - } + public void setIndexId(Long indexId) { + this.indexId = indexId; + } - public Long getProjectId() { - return projectId; - } + public Long getProjectId() { + return projectId; + } - public void setProjectId(Long projectId) { - this.projectId = projectId; - } + public void setProjectId(Long projectId) { + this.projectId = projectId; + } - public Long getLaunchId() { - return launchId; - } + public Long getLaunchId() { + return launchId; + } - public void setLaunchId(Long launchId) { - this.launchId = launchId; - } + public void setLaunchId(Long launchId) { + this.launchId = launchId; + } - public String getMessage() { - return message; - } + public String getMessage() { + return message; + } - public void setMessage(String message) { - this.message = message; - } + public void setMessage(String message) { + this.message = message; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/dashboard/Dashboard.java b/src/main/java/com/epam/ta/reportportal/entity/dashboard/Dashboard.java index d7596ccd6..10a440d6d 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/dashboard/Dashboard.java +++ b/src/main/java/com/epam/ta/reportportal/entity/dashboard/Dashboard.java @@ -18,16 +18,19 @@ import com.epam.ta.reportportal.entity.ShareableEntity; import com.google.common.collect.Sets; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Set; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EntityListeners; +import javax.persistence.FetchType; +import javax.persistence.OneToMany; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; -import javax.persistence.*; -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.Set; - /** * @author Pavel Bortnik */ @@ -35,49 +38,49 @@ @EntityListeners(AuditingEntityListener.class) public class Dashboard extends ShareableEntity implements Serializable { - @Column(name = "name") - private String name; + @Column(name = "name") + private String name; - @Column(name = "description") - private String description; + @Column(name = "description") + private String description; - @CreatedDate - @Column(name = "creation_date") - private LocalDateTime creationDate; + @CreatedDate + @Column(name = "creation_date") + private LocalDateTime creationDate; - @OneToMany(fetch = FetchType.EAGER, mappedBy = "dashboard") - @Fetch(value = FetchMode.JOIN) - private Set widgets = Sets.newHashSet(); + @OneToMany(fetch = FetchType.EAGER, mappedBy = "dashboard") + @Fetch(value = FetchMode.JOIN) + private Set widgets = Sets.newHashSet(); - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public String getDescription() { - return description; - } + public String getDescription() { + return description; + } - public void setDescription(String description) { - this.description = description; - } + public void setDescription(String description) { + this.description = description; + } - public LocalDateTime getCreationDate() { - return creationDate; - } + public LocalDateTime getCreationDate() { + return creationDate; + } - public void setCreationDate(LocalDateTime creationDate) { - this.creationDate = creationDate; - } + public void setCreationDate(LocalDateTime creationDate) { + this.creationDate = creationDate; + } - public Set getDashboardWidgets() { - return widgets; - } + public Set getDashboardWidgets() { + return widgets; + } - public void addWidget(DashboardWidget widget) { - widgets.add(widget); - } + public void addWidget(DashboardWidget widget) { + widgets.add(widget); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/dashboard/DashboardWidget.java b/src/main/java/com/epam/ta/reportportal/entity/dashboard/DashboardWidget.java index e4b860f89..7bbd8d7b1 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/dashboard/DashboardWidget.java +++ b/src/main/java/com/epam/ta/reportportal/entity/dashboard/DashboardWidget.java @@ -17,9 +17,14 @@ package com.epam.ta.reportportal.entity.dashboard; import com.epam.ta.reportportal.entity.widget.Widget; - -import javax.persistence.*; import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.EmbeddedId; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.ManyToOne; +import javax.persistence.MapsId; +import javax.persistence.Table; /** * @author Pavel Bortnik @@ -28,156 +33,156 @@ @Table(name = "dashboard_widget") public class DashboardWidget implements Serializable { - @EmbeddedId - private DashboardWidgetId id; + @EmbeddedId + private DashboardWidgetId id; - @ManyToOne(fetch = FetchType.EAGER) - @MapsId("dashboard_id") - private Dashboard dashboard; + @ManyToOne(fetch = FetchType.EAGER) + @MapsId("dashboard_id") + private Dashboard dashboard; - @ManyToOne(fetch = FetchType.EAGER) - @MapsId("widget_id") - private Widget widget; + @ManyToOne(fetch = FetchType.EAGER) + @MapsId("widget_id") + private Widget widget; - @Column(name = "widget_name") - private String widgetName; + @Column(name = "widget_name") + private String widgetName; - @Column(name = "widget_owner") - private String widgetOwner; + @Column(name = "widget_owner") + private String widgetOwner; - @Column(name = "widget_type") - private String widgetType; + @Column(name = "widget_type") + private String widgetType; - @Column(name = "is_created_on") - private boolean createdOn; + @Column(name = "is_created_on") + private boolean createdOn; - @Column(name = "widget_width") - private int width; + @Column(name = "widget_width") + private int width; - @Column(name = "widget_height") - private int height; + @Column(name = "widget_height") + private int height; - @Column(name = "widget_position_x") - private int positionX; + @Column(name = "widget_position_x") + private int positionX; - @Column(name = "widget_position_y") - private int positionY; + @Column(name = "widget_position_y") + private int positionY; - @Column(name = "share") - private boolean share; + @Column(name = "share") + private boolean share; - public DashboardWidgetId getId() { - return id; - } + public DashboardWidgetId getId() { + return id; + } - public void setId(DashboardWidgetId id) { - this.id = id; - } + public void setId(DashboardWidgetId id) { + this.id = id; + } - public Dashboard getDashboard() { - return dashboard; - } + public Dashboard getDashboard() { + return dashboard; + } - public void setDashboard(Dashboard dashboard) { - this.dashboard = dashboard; - } + public void setDashboard(Dashboard dashboard) { + this.dashboard = dashboard; + } - public Widget getWidget() { - return widget; - } + public Widget getWidget() { + return widget; + } - public void setWidget(Widget widget) { - this.widget = widget; - } + public void setWidget(Widget widget) { + this.widget = widget; + } - public String getWidgetName() { - return widgetName; - } + public String getWidgetName() { + return widgetName; + } - public void setWidgetName(String widgetName) { - this.widgetName = widgetName; - } + public void setWidgetName(String widgetName) { + this.widgetName = widgetName; + } - public String getWidgetOwner() { - return widgetOwner; - } + public String getWidgetOwner() { + return widgetOwner; + } - public void setWidgetOwner(String widgetOwner) { - this.widgetOwner = widgetOwner; - } + public void setWidgetOwner(String widgetOwner) { + this.widgetOwner = widgetOwner; + } - public boolean isCreatedOn() { - return createdOn; - } + public boolean isCreatedOn() { + return createdOn; + } - public void setCreatedOn(boolean createdOn) { - this.createdOn = createdOn; - } + public void setCreatedOn(boolean createdOn) { + this.createdOn = createdOn; + } - public int getWidth() { - return width; - } + public int getWidth() { + return width; + } - public String getWidgetType() { - return widgetType; - } + public void setWidth(int width) { + this.width = width; + } - public void setWidgetType(String widgetType) { - this.widgetType = widgetType; - } + public String getWidgetType() { + return widgetType; + } - public void setWidth(int width) { - this.width = width; - } + public void setWidgetType(String widgetType) { + this.widgetType = widgetType; + } - public int getHeight() { - return height; - } + public int getHeight() { + return height; + } - public void setHeight(int height) { - this.height = height; - } + public void setHeight(int height) { + this.height = height; + } - public int getPositionX() { - return positionX; - } + public int getPositionX() { + return positionX; + } - public void setPositionX(int positionX) { - this.positionX = positionX; - } + public void setPositionX(int positionX) { + this.positionX = positionX; + } - public int getPositionY() { - return positionY; - } + public int getPositionY() { + return positionY; + } - public void setPositionY(int positionY) { - this.positionY = positionY; - } + public void setPositionY(int positionY) { + this.positionY = positionY; + } - public boolean isShare() { - return share; - } + public boolean isShare() { + return share; + } - public void setShare(boolean share) { - this.share = share; - } + public void setShare(boolean share) { + this.share = share; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - DashboardWidget that = (DashboardWidget) o; - - return id != null ? id.equals(that.id) : that.id == null; - } - - @Override - public int hashCode() { - return id != null ? id.hashCode() : 0; - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + DashboardWidget that = (DashboardWidget) o; + + return id != null ? id.equals(that.id) : that.id == null; + } + + @Override + public int hashCode() { + return id != null ? id.hashCode() : 0; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/dashboard/DashboardWidgetId.java b/src/main/java/com/epam/ta/reportportal/entity/dashboard/DashboardWidgetId.java index 5c0c1acce..b97825235 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/dashboard/DashboardWidgetId.java +++ b/src/main/java/com/epam/ta/reportportal/entity/dashboard/DashboardWidgetId.java @@ -16,9 +16,9 @@ package com.epam.ta.reportportal.entity.dashboard; +import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Embeddable; -import java.io.Serializable; /** * @author Pavel Bortnik @@ -26,57 +26,57 @@ @Embeddable public class DashboardWidgetId implements Serializable { - @Column(name = "dashboard_id") - private Long dashboardId; + @Column(name = "dashboard_id") + private Long dashboardId; - @Column(name = "widget_id") - private Long widgetId; + @Column(name = "widget_id") + private Long widgetId; - public DashboardWidgetId() { - } + public DashboardWidgetId() { + } - public DashboardWidgetId(Long dashboardId, Long widgetId) { - this.dashboardId = dashboardId; - this.widgetId = widgetId; - } + public DashboardWidgetId(Long dashboardId, Long widgetId) { + this.dashboardId = dashboardId; + this.widgetId = widgetId; + } - public Long getDashboardId() { - return dashboardId; - } + public Long getDashboardId() { + return dashboardId; + } - public void setDashboardId(Long dashboardId) { - this.dashboardId = dashboardId; - } + public void setDashboardId(Long dashboardId) { + this.dashboardId = dashboardId; + } - public Long getWidgetId() { - return widgetId; - } + public Long getWidgetId() { + return widgetId; + } - public void setWidgetId(Long widgetId) { - this.widgetId = widgetId; - } + public void setWidgetId(Long widgetId) { + this.widgetId = widgetId; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } - DashboardWidgetId that = (DashboardWidgetId) o; + DashboardWidgetId that = (DashboardWidgetId) o; - if (dashboardId != null ? !dashboardId.equals(that.dashboardId) : that.dashboardId != null) { - return false; - } - return widgetId != null ? widgetId.equals(that.widgetId) : that.widgetId == null; - } + if (dashboardId != null ? !dashboardId.equals(that.dashboardId) : that.dashboardId != null) { + return false; + } + return widgetId != null ? widgetId.equals(that.widgetId) : that.widgetId == null; + } - @Override - public int hashCode() { - int result = dashboardId != null ? dashboardId.hashCode() : 0; - result = 31 * result + (widgetId != null ? widgetId.hashCode() : 0); - return result; - } + @Override + public int hashCode() { + int result = dashboardId != null ? dashboardId.hashCode() : 0; + result = 31 * result + (widgetId != null ? widgetId.hashCode() : 0); + return result; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/ActivityEventType.java b/src/main/java/com/epam/ta/reportportal/entity/enums/ActivityEventType.java index 0c5692bb1..4bcadd576 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/ActivityEventType.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/ActivityEventType.java @@ -23,44 +23,45 @@ */ public enum ActivityEventType { - CREATE_DASHBOARD("createDashboard"), - UPDATE_DASHBOARD("updateDashboard"), - DELETE_DASHBOARD("deleteDashboard"), - CREATE_WIDGET("createWidget"), - UPDATE_WIDGET("updateWidget"), - DELETE_WIDGET("deleteWidget"), - CREATE_FILTER("createFilter"), - UPDATE_FILTER("updateFilter"), - DELETE_FILTER("deleteFilter"), - ANALYZE_ITEM("analyzeItem"), - UPDATE_DEFECT("updateDefect"), - DELETE_DEFECT("deleteDefect"), - CREATE_BTS("createBts"), - UPDATE_BTS("updateBts"), - DELETE_BTS("deleteBts"), - START_LAUNCH("startLaunch"), - FINISH_LAUNCH("finishLaunch"), - DELETE_LAUNCH("deleteLaunch"), - UPDATE_PROJECT("updateProject"), - POST_ISSUE("postIssue"), - ATTACH_ISSUE("attachIssue"), - ATTACH_ISSUE_AA("attachIssueAa"), - UPDATE_ITEM("updateItem"), - CREATE_USER("createUser"), - START_IMPORT("startImport"), - FINISH_IMPORT("finishImport"); + CREATE_DASHBOARD("createDashboard"), + UPDATE_DASHBOARD("updateDashboard"), + DELETE_DASHBOARD("deleteDashboard"), + CREATE_WIDGET("createWidget"), + UPDATE_WIDGET("updateWidget"), + DELETE_WIDGET("deleteWidget"), + CREATE_FILTER("createFilter"), + UPDATE_FILTER("updateFilter"), + DELETE_FILTER("deleteFilter"), + ANALYZE_ITEM("analyzeItem"), + UPDATE_DEFECT("updateDefect"), + DELETE_DEFECT("deleteDefect"), + CREATE_BTS("createBts"), + UPDATE_BTS("updateBts"), + DELETE_BTS("deleteBts"), + START_LAUNCH("startLaunch"), + FINISH_LAUNCH("finishLaunch"), + DELETE_LAUNCH("deleteLaunch"), + UPDATE_PROJECT("updateProject"), + POST_ISSUE("postIssue"), + ATTACH_ISSUE("attachIssue"), + ATTACH_ISSUE_AA("attachIssueAa"), + UPDATE_ITEM("updateItem"), + CREATE_USER("createUser"), + START_IMPORT("startImport"), + FINISH_IMPORT("finishImport"); - private String value; + private String value; - ActivityEventType(String value) { - this.value = value; - } + ActivityEventType(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public static Optional fromString(String string) { + return Optional.ofNullable(string).flatMap( + str -> Arrays.stream(values()).filter(it -> it.value.equalsIgnoreCase(str)).findAny()); + } - public static Optional fromString(String string) { - return Optional.ofNullable(string).flatMap(str -> Arrays.stream(values()).filter(it -> it.value.equalsIgnoreCase(str)).findAny()); - } + public String getValue() { + return value; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/AuthType.java b/src/main/java/com/epam/ta/reportportal/entity/enums/AuthType.java index 3776c715a..a9092a2a7 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/AuthType.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/AuthType.java @@ -26,29 +26,30 @@ */ public enum AuthType { - //@formatter:off - OAUTH(false), - NTLM(true), - APIKEY(true), - BASIC(true); - //@formatter:on - - final boolean requiresPassword; - - AuthType(boolean requiresPassword) { - this.requiresPassword = requiresPassword; - } - - public boolean requiresPassword() { - return requiresPassword; - } - - public static Optional findByName(String name) { - return Optional.ofNullable(name) - .flatMap(string -> Arrays.stream(values()).filter(it -> it.name().equalsIgnoreCase(string)).findAny()); - } - - public static boolean isPresent(String name) { - return findByName(name).isPresent(); - } + //@formatter:off + OAUTH(false), + NTLM(true), + APIKEY(true), + BASIC(true); + //@formatter:on + + final boolean requiresPassword; + + AuthType(boolean requiresPassword) { + this.requiresPassword = requiresPassword; + } + + public static Optional findByName(String name) { + return Optional.ofNullable(name) + .flatMap(string -> Arrays.stream(values()).filter(it -> it.name().equalsIgnoreCase(string)) + .findAny()); + } + + public static boolean isPresent(String name) { + return findByName(name).isPresent(); + } + + public boolean requiresPassword() { + return requiresPassword; + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/ExternalSystemType.java b/src/main/java/com/epam/ta/reportportal/entity/enums/ExternalSystemType.java index 2681923f2..4b0bb3f98 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/ExternalSystemType.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/ExternalSystemType.java @@ -16,10 +16,9 @@ package com.epam.ta.reportportal.entity.enums; -import org.apache.commons.lang3.StringUtils; - import java.util.Arrays; import java.util.Optional; +import org.apache.commons.lang3.StringUtils; /** * List of supported external systems @@ -28,52 +27,53 @@ */ public enum ExternalSystemType { - NONE { - @Override - public String makeUrl(String base, String id) { - return null; - } - }, - JIRA { - @Override - public String makeUrl(String base, String id) { - return StringUtils.stripEnd(base, "/") + "/browse/" + id; - } - }, - TFS { - @Override - public String makeUrl(String base, String id) { - return StringUtils.stripEnd(base, "/") + "/browse/" + id; - } - }, - RALLY { - @Override - public String makeUrl(String base, String id) { - return ""; - } - }; + NONE { + @Override + public String makeUrl(String base, String id) { + return null; + } + }, + JIRA { + @Override + public String makeUrl(String base, String id) { + return StringUtils.stripEnd(base, "/") + "/browse/" + id; + } + }, + TFS { + @Override + public String makeUrl(String base, String id) { + return StringUtils.stripEnd(base, "/") + "/browse/" + id; + } + }, + RALLY { + @Override + public String makeUrl(String base, String id) { + return ""; + } + }; - public static final String ISSUE_MARKER = "#"; + public static final String ISSUE_MARKER = "#"; - public abstract String makeUrl(String base, String id); + ExternalSystemType() { - ExternalSystemType() { + } - } + public static Optional knownIssue(String summary) { + if (summary.trim().startsWith(ISSUE_MARKER)) { + return Optional.of(StringUtils.substringAfter(summary, ISSUE_MARKER)); + } else { + return Optional.empty(); + } + } - public static Optional knownIssue(String summary) { - if (summary.trim().startsWith(ISSUE_MARKER)) { - return Optional.of(StringUtils.substringAfter(summary, ISSUE_MARKER)); - } else { - return Optional.empty(); - } - } + public static Optional findByName(String name) { + return Arrays.stream(ExternalSystemType.values()) + .filter(type -> type.name().equalsIgnoreCase(name)).findAny(); + } - public static Optional findByName(String name) { - return Arrays.stream(ExternalSystemType.values()).filter(type -> type.name().equalsIgnoreCase(name)).findAny(); - } + public static boolean isPresent(String name) { + return findByName(name).isPresent(); + } - public static boolean isPresent(String name) { - return findByName(name).isPresent(); - } + public abstract String makeUrl(String base, String id); } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/ImageFormat.java b/src/main/java/com/epam/ta/reportportal/entity/enums/ImageFormat.java index 6504de8aa..42e782d50 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/ImageFormat.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/ImageFormat.java @@ -41,21 +41,23 @@ */ public enum ImageFormat { - JPEG("JPEG"), - PNG("PNG"), - GIF("GIF"); + JPEG("JPEG"), + PNG("PNG"), + GIF("GIF"); - private String value; + private String value; - ImageFormat(String value) { - this.value = value; - } + ImageFormat(String value) { + this.value = value; + } - public static Optional fromValue(String value) { - return Arrays.stream(ImageFormat.values()).filter(format -> format.value.equalsIgnoreCase(value)).findAny(); - } + public static Optional fromValue(String value) { + return Arrays.stream(ImageFormat.values()) + .filter(format -> format.value.equalsIgnoreCase(value)).findAny(); + } - public static List getValues() { - return Arrays.stream(ImageFormat.values()).map(format -> format.value).collect(Collectors.toList()); - } + public static List getValues() { + return Arrays.stream(ImageFormat.values()).map(format -> format.value) + .collect(Collectors.toList()); + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/InfoInterval.java b/src/main/java/com/epam/ta/reportportal/entity/enums/InfoInterval.java index 74e0b0000..5d1c5f78e 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/InfoInterval.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/InfoInterval.java @@ -20,8 +20,7 @@ import java.util.Optional; /** - * Get project information intervals
- * Available values: + * Get project information intervals
Available values: *
    *
  • 1 week
  • *
  • 3 months (by default)
  • @@ -32,33 +31,34 @@ */ public enum InfoInterval { - //@formatter:off - ONE_MONTH("1M", 1), - THREE_MONTHS("3M", 3), - SIX_MONTHS("6M", 6); - //@formatter:on + //@formatter:off + ONE_MONTH("1M", 1), + THREE_MONTHS("3M", 3), + SIX_MONTHS("6M", 6); + //@formatter:on - private String interval; - private Integer counter; + private String interval; + private Integer counter; - public String getInterval() { - return interval; - } + InfoInterval(String value, Integer count) { + this.interval = value; + this.counter = count; + } - public Integer getCount() { - return counter; - } + public static InfoInterval getByName(String name) { + return InfoInterval.valueOf(name); + } - InfoInterval(String value, Integer count) { - this.interval = value; - this.counter = count; - } + public static Optional findByInterval(String interval) { + return Arrays.stream(InfoInterval.values()) + .filter(value -> value.getInterval().equalsIgnoreCase(interval)).findAny(); + } - public static InfoInterval getByName(String name) { - return InfoInterval.valueOf(name); - } + public String getInterval() { + return interval; + } - public static Optional findByInterval(String interval) { - return Arrays.stream(InfoInterval.values()).filter(value -> value.getInterval().equalsIgnoreCase(interval)).findAny(); - } + public Integer getCount() { + return counter; + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/IntegrationAuthFlowEnum.java b/src/main/java/com/epam/ta/reportportal/entity/enums/IntegrationAuthFlowEnum.java index f6d8e3c7c..0a1dbd22c 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/IntegrationAuthFlowEnum.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/IntegrationAuthFlowEnum.java @@ -21,17 +21,18 @@ public enum IntegrationAuthFlowEnum { - OAUTH, - BASIC, - TOKEN, - FORM, - LDAP; + OAUTH, + BASIC, + TOKEN, + FORM, + LDAP; - public static Optional findByName(String name) { - return Arrays.stream(IntegrationAuthFlowEnum.values()).filter(i -> i.name().equalsIgnoreCase(name)).findAny(); - } + public static Optional findByName(String name) { + return Arrays.stream(IntegrationAuthFlowEnum.values()) + .filter(i -> i.name().equalsIgnoreCase(name)).findAny(); + } - public static boolean isPresent(String name) { - return findByName(name).isPresent(); - } + public static boolean isPresent(String name) { + return findByName(name).isPresent(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/IntegrationGroupEnum.java b/src/main/java/com/epam/ta/reportportal/entity/enums/IntegrationGroupEnum.java index 6943a26a3..2eb7a63a3 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/IntegrationGroupEnum.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/IntegrationGroupEnum.java @@ -21,16 +21,17 @@ public enum IntegrationGroupEnum { - BTS, - NOTIFICATION, - AUTH, - OTHER; + BTS, + NOTIFICATION, + AUTH, + OTHER; - public static Optional findByName(String name) { - return Arrays.stream(IntegrationGroupEnum.values()).filter(i -> i.name().equalsIgnoreCase(name)).findAny(); - } + public static Optional findByName(String name) { + return Arrays.stream(IntegrationGroupEnum.values()).filter(i -> i.name().equalsIgnoreCase(name)) + .findAny(); + } - public static boolean isPresent(String name) { - return findByName(name).isPresent(); - } + public static boolean isPresent(String name) { + return findByName(name).isPresent(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/LaunchModeEnum.java b/src/main/java/com/epam/ta/reportportal/entity/enums/LaunchModeEnum.java index 70b641dd6..cedb65bdd 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/LaunchModeEnum.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/LaunchModeEnum.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.entity.enums; import com.epam.ta.reportportal.ws.model.launch.Mode; - import java.util.Arrays; import java.util.Optional; @@ -25,14 +24,15 @@ * @author Pavel Bortnik */ public enum LaunchModeEnum { - DEFAULT, - DEBUG; + DEFAULT, + DEBUG; - public static Optional findByName(String name) { - return Arrays.stream(LaunchModeEnum.values()).filter(type -> type.name().equalsIgnoreCase(name)).findAny(); - } + public static Optional findByName(String name) { + return Arrays.stream(LaunchModeEnum.values()).filter(type -> type.name().equalsIgnoreCase(name)) + .findAny(); + } - public static Optional findByMode(Mode mode) { - return findByName(mode.name()); - } + public static Optional findByMode(Mode mode) { + return findByName(mode.name()); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/LogLevel.java b/src/main/java/com/epam/ta/reportportal/entity/enums/LogLevel.java index 445f107bd..c7f3160da 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/LogLevel.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/LogLevel.java @@ -18,89 +18,91 @@ import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.ws.model.ErrorType; - import java.util.Arrays; import java.util.Optional; public enum LogLevel { - //@formatter:off - ERROR(LogLevel.ERROR_INT), - WARN(LogLevel.WARN_INT), - INFO(LogLevel.INFO_INT), - DEBUG(LogLevel.DEBUG_INT), - TRACE(LogLevel.TRACE_INT), - FATAL(LogLevel.FATAL_INT), - UNKNOWN(LogLevel.UNKNOWN_INT); - //@formatter:on - - public static final int UNKNOWN_INT = 60000; - public static final int FATAL_INT = 50000; - public static final int ERROR_INT = 40000; - public static final int WARN_INT = 30000; - public static final int INFO_INT = 20000; - public static final int DEBUG_INT = 10000; - public static final int TRACE_INT = 5000; - - private int intLevel; - - LogLevel(int intLevel) { - this.intLevel = intLevel; - } - - public int toInt() { - return intLevel; - } - - /** - * Returns true if this Level has a higher or equal Level than the Level passed as - * argument, false otherwise. - */ - public boolean isGreaterOrEqual(LogLevel r) { - return intLevel >= r.intLevel; - } - - /** - * Convert the string passed as argument to a Level. If there is no such level throws exception - */ - public static Optional toLevel(String levelString) { - return Arrays.stream(LogLevel.values()).filter(level -> level.name().equalsIgnoreCase(levelString)).findAny(); - } - - /** - * Convert the string passed as argument to a Level. - */ - public static int toCustomLogLevel(String levelString) { - - Optional level = Arrays.stream(LogLevel.values()).filter(l -> l.name().equalsIgnoreCase(levelString)).findFirst(); - - return level.map(LogLevel::toInt).orElseGet(() -> { - try { - int intLevel = Integer.parseInt(levelString); - return intLevel < TRACE.toInt() ? TRACE.toInt() : intLevel; - } catch (NumberFormatException ex) { - return UNKNOWN_INT; - } - - }); - } - - /** - * Convert the string passed as argument to a Level - */ - public static LogLevel toLevel(int intLevel) { - - return Arrays.stream(LogLevel.values()) - .sorted((prev, curr) -> Integer.compare(curr.toInt(), prev.toInt())) - .filter(l -> l.toInt() <= intLevel) - .findFirst() - .orElseThrow(() -> new ReportPortalException(ErrorType.BAD_SAVE_LOG_REQUEST, "Wrong level = " + intLevel)); - - } - - @Override - public String toString() { - return this.name(); - } + //@formatter:off + ERROR(LogLevel.ERROR_INT), + WARN(LogLevel.WARN_INT), + INFO(LogLevel.INFO_INT), + DEBUG(LogLevel.DEBUG_INT), + TRACE(LogLevel.TRACE_INT), + FATAL(LogLevel.FATAL_INT), + UNKNOWN(LogLevel.UNKNOWN_INT); + //@formatter:on + + public static final int UNKNOWN_INT = 60000; + public static final int FATAL_INT = 50000; + public static final int ERROR_INT = 40000; + public static final int WARN_INT = 30000; + public static final int INFO_INT = 20000; + public static final int DEBUG_INT = 10000; + public static final int TRACE_INT = 5000; + + private int intLevel; + + LogLevel(int intLevel) { + this.intLevel = intLevel; + } + + /** + * Convert the string passed as argument to a Level. If there is no such level throws exception + */ + public static Optional toLevel(String levelString) { + return Arrays.stream(LogLevel.values()) + .filter(level -> level.name().equalsIgnoreCase(levelString)).findAny(); + } + + /** + * Convert the string passed as argument to a Level. + */ + public static int toCustomLogLevel(String levelString) { + + Optional level = Arrays.stream(LogLevel.values()) + .filter(l -> l.name().equalsIgnoreCase(levelString)).findFirst(); + + return level.map(LogLevel::toInt).orElseGet(() -> { + try { + int intLevel = Integer.parseInt(levelString); + return intLevel < TRACE.toInt() ? TRACE.toInt() : intLevel; + } catch (NumberFormatException ex) { + return UNKNOWN_INT; + } + + }); + } + + /** + * Convert the string passed as argument to a Level + */ + public static LogLevel toLevel(int intLevel) { + + return Arrays.stream(LogLevel.values()) + .sorted((prev, curr) -> Integer.compare(curr.toInt(), prev.toInt())) + .filter(l -> l.toInt() <= intLevel) + .findFirst() + .orElseThrow(() -> new ReportPortalException(ErrorType.BAD_SAVE_LOG_REQUEST, + "Wrong level = " + intLevel)); + + } + + public int toInt() { + return intLevel; + } + + /** + * Returns true if this Level has a higher or equal Level than the Level passed as + * argument, false otherwise. + */ + public boolean isGreaterOrEqual(LogLevel r) { + return intLevel >= r.intLevel; + } + + @Override + public String toString() { + return this.name(); + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/PostgreSQLEnumType.java b/src/main/java/com/epam/ta/reportportal/entity/enums/PostgreSQLEnumType.java index 2726f186c..c7eaeadfd 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/PostgreSQLEnumType.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/PostgreSQLEnumType.java @@ -16,26 +16,26 @@ package com.epam.ta.reportportal.entity.enums; -import org.hibernate.HibernateException; -import org.hibernate.engine.spi.SharedSessionContractImplementor; -import org.hibernate.type.EnumType; - import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Types; +import org.hibernate.HibernateException; +import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.type.EnumType; /** * @author Pavel Bortnik */ public class PostgreSQLEnumType extends EnumType { - public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) - throws HibernateException, SQLException { - if (value == null) { - st.setNull(index, Types.OTHER); - } else { - st.setObject(index, value.toString(), Types.OTHER); - } - } + public void nullSafeSet(PreparedStatement st, Object value, int index, + SharedSessionContractImplementor session) + throws HibernateException, SQLException { + if (value == null) { + st.setNull(index, Types.OTHER); + } else { + st.setObject(index, value.toString(), Types.OTHER); + } + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java b/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java index ba691e672..6db857de7 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java @@ -18,7 +18,6 @@ import com.epam.ta.reportportal.entity.AnalyzeMode; import com.epam.ta.reportportal.entity.project.ProjectAnalyzerConfig; - import java.time.Duration; import java.util.Arrays; import java.util.Optional; @@ -30,54 +29,63 @@ */ public enum ProjectAttributeEnum { - NOTIFICATIONS_ENABLED("notifications.enabled", String.valueOf(false)), - - INTERRUPT_JOB_TIME(Prefix.JOB + "interruptJobTime", String.valueOf(Duration.ofDays(1).toSeconds())), - KEEP_LAUNCHES(Prefix.JOB + "keepLaunches", String.valueOf(Duration.ofDays(90).toSeconds())), - KEEP_LOGS(Prefix.JOB + "keepLogs", String.valueOf(Duration.ofDays(90).toSeconds())), - KEEP_SCREENSHOTS(Prefix.JOB + "keepScreenshots", String.valueOf(Duration.ofDays(14).toSeconds())), - - MIN_SHOULD_MATCH(Prefix.ANALYZER + "minShouldMatch", String.valueOf(ProjectAnalyzerConfig.MIN_SHOULD_MATCH)), - NUMBER_OF_LOG_LINES(Prefix.ANALYZER + "numberOfLogLines", String.valueOf(ProjectAnalyzerConfig.NUMBER_OF_LOG_LINES)), - INDEXING_RUNNING(Prefix.ANALYZER + "indexingRunning", String.valueOf(false)), - AUTO_PATTERN_ANALYZER_ENABLED(Prefix.ANALYZER + "isAutoPatternAnalyzerEnabled", String.valueOf(false)), - AUTO_ANALYZER_ENABLED(Prefix.ANALYZER + "isAutoAnalyzerEnabled", String.valueOf(true)), - AUTO_ANALYZER_MODE(Prefix.ANALYZER + "autoAnalyzerMode", AnalyzeMode.BY_LAUNCH_NAME.getValue()), - ALL_MESSAGES_SHOULD_MATCH(Prefix.ANALYZER + "allMessagesShouldMatch", String.valueOf(false)), - SEARCH_LOGS_MIN_SHOULD_MATCH(Prefix.ANALYZER + "searchLogsMinShouldMatch", String.valueOf(ProjectAnalyzerConfig.MIN_SHOULD_MATCH)), - AUTO_UNIQUE_ERROR_ANALYZER_ENABLED(Prefix.ANALYZER + Prefix.UNIQUE_ERROR + "enabled", String.valueOf(true)), - UNIQUE_ERROR_ANALYZER_REMOVE_NUMBERS(Prefix.ANALYZER + Prefix.UNIQUE_ERROR + "removeNumbers", String.valueOf(true)); - - public static final String FOREVER_ALIAS = "0"; - private String attribute; - private String defaultValue; - - ProjectAttributeEnum(String attribute, String defaultValue) { - this.attribute = attribute; - this.defaultValue = defaultValue; - } - - public static Optional findByAttributeName(String attributeName) { - return Arrays.stream(ProjectAttributeEnum.values()).filter(v -> v.getAttribute().equalsIgnoreCase(attributeName)).findAny(); - } - - public static boolean isPresent(String name) { - return findByAttributeName(name).isPresent(); - } - - public String getAttribute() { - return attribute; - } - - public String getDefaultValue() { - return defaultValue; - } - - public static class Prefix { - public static final String ANALYZER = "analyzer."; - public static final String JOB = "job."; - public static final String UNIQUE_ERROR = "uniqueError."; - } + NOTIFICATIONS_ENABLED("notifications.enabled", String.valueOf(false)), + + INTERRUPT_JOB_TIME(Prefix.JOB + "interruptJobTime", + String.valueOf(Duration.ofDays(1).toSeconds())), + KEEP_LAUNCHES(Prefix.JOB + "keepLaunches", String.valueOf(Duration.ofDays(90).toSeconds())), + KEEP_LOGS(Prefix.JOB + "keepLogs", String.valueOf(Duration.ofDays(90).toSeconds())), + KEEP_SCREENSHOTS(Prefix.JOB + "keepScreenshots", String.valueOf(Duration.ofDays(14).toSeconds())), + + MIN_SHOULD_MATCH(Prefix.ANALYZER + "minShouldMatch", + String.valueOf(ProjectAnalyzerConfig.MIN_SHOULD_MATCH)), + NUMBER_OF_LOG_LINES(Prefix.ANALYZER + "numberOfLogLines", + String.valueOf(ProjectAnalyzerConfig.NUMBER_OF_LOG_LINES)), + INDEXING_RUNNING(Prefix.ANALYZER + "indexingRunning", String.valueOf(false)), + AUTO_PATTERN_ANALYZER_ENABLED(Prefix.ANALYZER + "isAutoPatternAnalyzerEnabled", + String.valueOf(false)), + AUTO_ANALYZER_ENABLED(Prefix.ANALYZER + "isAutoAnalyzerEnabled", String.valueOf(true)), + AUTO_ANALYZER_MODE(Prefix.ANALYZER + "autoAnalyzerMode", AnalyzeMode.BY_LAUNCH_NAME.getValue()), + ALL_MESSAGES_SHOULD_MATCH(Prefix.ANALYZER + "allMessagesShouldMatch", String.valueOf(false)), + SEARCH_LOGS_MIN_SHOULD_MATCH(Prefix.ANALYZER + "searchLogsMinShouldMatch", + String.valueOf(ProjectAnalyzerConfig.MIN_SHOULD_MATCH)), + AUTO_UNIQUE_ERROR_ANALYZER_ENABLED(Prefix.ANALYZER + Prefix.UNIQUE_ERROR + "enabled", + String.valueOf(true)), + UNIQUE_ERROR_ANALYZER_REMOVE_NUMBERS(Prefix.ANALYZER + Prefix.UNIQUE_ERROR + "removeNumbers", + String.valueOf(true)); + + public static final String FOREVER_ALIAS = "0"; + private String attribute; + private String defaultValue; + + ProjectAttributeEnum(String attribute, String defaultValue) { + this.attribute = attribute; + this.defaultValue = defaultValue; + } + + public static Optional findByAttributeName(String attributeName) { + return Arrays.stream(ProjectAttributeEnum.values()) + .filter(v -> v.getAttribute().equalsIgnoreCase(attributeName)).findAny(); + } + + public static boolean isPresent(String name) { + return findByAttributeName(name).isPresent(); + } + + public String getAttribute() { + return attribute; + } + + public String getDefaultValue() { + return defaultValue; + } + + public static class Prefix { + + public static final String ANALYZER = "analyzer."; + public static final String JOB = "job."; + public static final String UNIQUE_ERROR = "uniqueError."; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectType.java b/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectType.java index 263148a58..3e45d98c6 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectType.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectType.java @@ -20,23 +20,23 @@ import java.util.Optional; /** - * Project Type enumeration
    - * Used for supporting different project types processing + * Project Type enumeration
    Used for supporting different project types processing * * @author Andrei_Ramanchuk * @author Andrei Varabyeu */ public enum ProjectType { - PERSONAL, - INTERNAL, - UPSA; + PERSONAL, + INTERNAL, + UPSA; - public static Optional findByName(String name) { - return Arrays.stream(ProjectType.values()).filter(type -> type.name().equalsIgnoreCase(name)).findAny(); - } + public static Optional findByName(String name) { + return Arrays.stream(ProjectType.values()).filter(type -> type.name().equalsIgnoreCase(name)) + .findAny(); + } - public static boolean isPresent(String name) { - return findByName(name).isPresent(); - } + public static boolean isPresent(String name) { + return findByName(name).isPresent(); + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/ReservedIntegrationTypeEnum.java b/src/main/java/com/epam/ta/reportportal/entity/enums/ReservedIntegrationTypeEnum.java index f71b0d6d8..110d16d37 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/ReservedIntegrationTypeEnum.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/ReservedIntegrationTypeEnum.java @@ -8,22 +8,22 @@ */ public enum ReservedIntegrationTypeEnum { - EMAIL("email"), - AD("ad"), - LDAP("ldap"), - SAML("saml"); + EMAIL("email"), + AD("ad"), + LDAP("ldap"), + SAML("saml"); - private String name; + private String name; - ReservedIntegrationTypeEnum(String name) { - this.name = name; - } + ReservedIntegrationTypeEnum(String name) { + this.name = name; + } - public String getName() { - return name; - } + public static Optional fromName(String name) { + return Arrays.stream(values()).filter(it -> it.getName().equalsIgnoreCase(name)).findAny(); + } - public static Optional fromName(String name) { - return Arrays.stream(values()).filter(it -> it.getName().equalsIgnoreCase(name)).findAny(); - } + public String getName() { + return name; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/SendCase.java b/src/main/java/com/epam/ta/reportportal/entity/enums/SendCase.java index 05bacab74..c7c427a13 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/SendCase.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/SendCase.java @@ -26,30 +26,31 @@ */ public enum SendCase { - //@formatter:off - ALWAYS("always"), - FAILED("failed"), - TO_INVESTIGATE("toInvestigate"), - MORE_10("more10"), - MORE_20("more20"), - MORE_50("more50"); - //@formatter:on - - private final String value; - - SendCase(String value) { - this.value = value; - } - - public static Optional findByName(String name) { - return Arrays.stream(SendCase.values()).filter(val -> val.getCaseString().equalsIgnoreCase(name)).findAny(); - } - - public static boolean isPresent(String name) { - return findByName(name).isPresent(); - } - - public String getCaseString() { - return value; - } + //@formatter:off + ALWAYS("always"), + FAILED("failed"), + TO_INVESTIGATE("toInvestigate"), + MORE_10("more10"), + MORE_20("more20"), + MORE_50("more50"); + //@formatter:on + + private final String value; + + SendCase(String value) { + this.value = value; + } + + public static Optional findByName(String name) { + return Arrays.stream(SendCase.values()) + .filter(val -> val.getCaseString().equalsIgnoreCase(name)).findAny(); + } + + public static boolean isPresent(String name) { + return findByName(name).isPresent(); + } + + public String getCaseString() { + return value; + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/StatusEnum.java b/src/main/java/com/epam/ta/reportportal/entity/enums/StatusEnum.java index 0781fc838..b342636da 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/StatusEnum.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/StatusEnum.java @@ -21,41 +21,42 @@ public enum StatusEnum { - //@formatter:off - IN_PROGRESS("", false), - PASSED("passed", true), - FAILED("failed", false), - STOPPED("stopped", false), //status for manually stopped launches - SKIPPED("skipped", false), - INTERRUPTED("failed", false), - //RESETED("reseted"), //status for items with deleted descendants - CANCELLED("cancelled", false), //soupUI specific status - INFO("info", true), - WARN("warn", true); - //@formatter:on - - private final String executionCounterField; - - private final boolean positive; - - StatusEnum(String executionCounterField, boolean isPositive) { - this.executionCounterField = executionCounterField; - this.positive = isPositive; - } - - public static Optional fromValue(String value) { - return Arrays.stream(StatusEnum.values()).filter(status -> status.name().equalsIgnoreCase(value)).findAny(); - } - - public static boolean isPresent(String name) { - return fromValue(name).isPresent(); - } - - public String getExecutionCounterField() { - return executionCounterField; - } - - public boolean isPositive() { - return positive; - } + //@formatter:off + IN_PROGRESS("", false), + PASSED("passed", true), + FAILED("failed", false), + STOPPED("stopped", false), //status for manually stopped launches + SKIPPED("skipped", false), + INTERRUPTED("failed", false), + //RESETED("reseted"), //status for items with deleted descendants + CANCELLED("cancelled", false), //soupUI specific status + INFO("info", true), + WARN("warn", true); + //@formatter:on + + private final String executionCounterField; + + private final boolean positive; + + StatusEnum(String executionCounterField, boolean isPositive) { + this.executionCounterField = executionCounterField; + this.positive = isPositive; + } + + public static Optional fromValue(String value) { + return Arrays.stream(StatusEnum.values()) + .filter(status -> status.name().equalsIgnoreCase(value)).findAny(); + } + + public static boolean isPresent(String name) { + return fromValue(name).isPresent(); + } + + public String getExecutionCounterField() { + return executionCounterField; + } + + public boolean isPositive() { + return positive; + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/TestItemIssueGroup.java b/src/main/java/com/epam/ta/reportportal/entity/enums/TestItemIssueGroup.java index 42804d78c..72d1250b3 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/TestItemIssueGroup.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/TestItemIssueGroup.java @@ -22,66 +22,67 @@ import java.util.stream.Collectors; /** - * Vocabulary for supported test item issues types. They are applied as markers - * for test steps. User marks test step according to the type of the issue, - * caused it's failure.
    - * locator - predefined ID for immutable issue type
    + * Vocabulary for supported test item issues types. They are applied as markers for test steps. User + * marks test step according to the type of the issue, caused it's failure.
    locator - predefined + * ID for immutable issue type
    * * @author Dzianis Shlychkou * @author Andrei_Ramanchuk */ public enum TestItemIssueGroup /*implements StatisticsAwareness*/ { - NOT_ISSUE_FLAG("NOT_ISSUE", "notIssue", ""), + NOT_ISSUE_FLAG("NOT_ISSUE", "notIssue", ""), - PRODUCT_BUG("PRODUCT_BUG", "productBug", "pb001"), - AUTOMATION_BUG("AUTOMATION_BUG", "automationBug", "ab001"), - SYSTEM_ISSUE("SYSTEM_ISSUE", "systemIssue", "si001"), - TO_INVESTIGATE("TO_INVESTIGATE", "toInvestigate", "ti001"), - NO_DEFECT("NO_DEFECT", "noDefect", "nd001"); + PRODUCT_BUG("PRODUCT_BUG", "productBug", "pb001"), + AUTOMATION_BUG("AUTOMATION_BUG", "automationBug", "ab001"), + SYSTEM_ISSUE("SYSTEM_ISSUE", "systemIssue", "si001"), + TO_INVESTIGATE("TO_INVESTIGATE", "toInvestigate", "ti001"), + NO_DEFECT("NO_DEFECT", "noDefect", "nd001"); - private final String value; + private final String value; - private final String issueCounterField; + private final String issueCounterField; - private final String locator; + private final String locator; - TestItemIssueGroup(String value, String executionCounterField, String locator) { - this.value = value; - this.issueCounterField = executionCounterField; - this.locator = locator; - } + TestItemIssueGroup(String value, String executionCounterField, String locator) { + this.value = value; + this.issueCounterField = executionCounterField; + this.locator = locator; + } - public String getValue() { - return value; - } + /** + * Retrieves TestItemIssueType value by it's string value + * + * @param value - string representation of desired TestItemIssueType value + * @return TestItemIssueType value + */ + public static Optional fromValue(String value) { + return Arrays.stream(TestItemIssueGroup.values()) + .filter(type -> type.getValue().equalsIgnoreCase(value)).findAny(); + } - public String getLocator() { - return locator; - } + public static TestItemIssueGroup validate(String value) { + return Arrays.stream(TestItemIssueGroup.values()) + .filter(type -> type.getValue().replace(" ", "_").equalsIgnoreCase(value)) + .findAny() + .orElse(null); + } - public String getIssueCounterField() { - return issueCounterField; - } + public static List validValues() { + return Arrays.stream(TestItemIssueGroup.values()).map(TestItemIssueGroup::getValue) + .collect(Collectors.toList()); + } - /** - * Retrieves TestItemIssueType value by it's string value - * - * @param value - string representation of desired TestItemIssueType value - * @return TestItemIssueType value - */ - public static Optional fromValue(String value) { - return Arrays.stream(TestItemIssueGroup.values()).filter(type -> type.getValue().equalsIgnoreCase(value)).findAny(); - } + public String getValue() { + return value; + } - public static TestItemIssueGroup validate(String value) { - return Arrays.stream(TestItemIssueGroup.values()) - .filter(type -> type.getValue().replace(" ", "_").equalsIgnoreCase(value)) - .findAny() - .orElse(null); - } + public String getLocator() { + return locator; + } - public static List validValues() { - return Arrays.stream(TestItemIssueGroup.values()).map(TestItemIssueGroup::getValue).collect(Collectors.toList()); - } + public String getIssueCounterField() { + return issueCounterField; + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/TestItemTypeEnum.java b/src/main/java/com/epam/ta/reportportal/entity/enums/TestItemTypeEnum.java index 920847edd..d01899626 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/TestItemTypeEnum.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/TestItemTypeEnum.java @@ -22,77 +22,79 @@ public enum TestItemTypeEnum implements Comparable { - SUITE(Constants.SUITE_LEVEL, true), - STORY(Constants.SUITE_LEVEL, true), - TEST(Constants.TEST_LEVEL, true), - SCENARIO(Constants.TEST_LEVEL, true), - STEP(Constants.STEP_LEVEL, true), - BEFORE_CLASS(Constants.STEP_LEVEL, false), - BEFORE_GROUPS(Constants.STEP_LEVEL, false), - BEFORE_METHOD(Constants.STEP_LEVEL, false), - BEFORE_SUITE(Constants.TEST_LEVEL, false), - BEFORE_TEST(Constants.STEP_LEVEL, false), - AFTER_CLASS(Constants.STEP_LEVEL, false), - AFTER_GROUPS(Constants.STEP_LEVEL, false), - AFTER_METHOD(Constants.STEP_LEVEL, false), - AFTER_SUITE(Constants.TEST_LEVEL, false), - AFTER_TEST(Constants.STEP_LEVEL, false); + SUITE(Constants.SUITE_LEVEL, true), + STORY(Constants.SUITE_LEVEL, true), + TEST(Constants.TEST_LEVEL, true), + SCENARIO(Constants.TEST_LEVEL, true), + STEP(Constants.STEP_LEVEL, true), + BEFORE_CLASS(Constants.STEP_LEVEL, false), + BEFORE_GROUPS(Constants.STEP_LEVEL, false), + BEFORE_METHOD(Constants.STEP_LEVEL, false), + BEFORE_SUITE(Constants.TEST_LEVEL, false), + BEFORE_TEST(Constants.STEP_LEVEL, false), + AFTER_CLASS(Constants.STEP_LEVEL, false), + AFTER_GROUPS(Constants.STEP_LEVEL, false), + AFTER_METHOD(Constants.STEP_LEVEL, false), + AFTER_SUITE(Constants.TEST_LEVEL, false), + AFTER_TEST(Constants.STEP_LEVEL, false); - private int level; - private boolean awareStatistics; + /** + * Level Comparator for TestItem types. Returns TRUE of level of first object is lower than + * level of second object + * + * @author Andrei Varabyeu + */ + private static final Comparator LEVEL_COMPARATOR = (o1, o2) -> Integer.compare( + o2.level, o1.level); + private int level; + private boolean awareStatistics; - TestItemTypeEnum(int level, boolean awareStatistics) { - this.level = level; - this.awareStatistics = awareStatistics; - } + TestItemTypeEnum(int level, boolean awareStatistics) { + this.level = level; + this.awareStatistics = awareStatistics; + } - public static Optional fromValue(String value) { - return Arrays.stream(TestItemTypeEnum.values()).filter(type -> type.name().equalsIgnoreCase(value)).findAny(); - } + public static Optional fromValue(String value) { + return Arrays.stream(TestItemTypeEnum.values()) + .filter(type -> type.name().equalsIgnoreCase(value)).findAny(); + } - public boolean sameLevel(TestItemTypeEnum other) { - return 0 == LEVEL_COMPARATOR.compare(this, other); - } + public boolean sameLevel(TestItemTypeEnum other) { + return 0 == LEVEL_COMPARATOR.compare(this, other); + } - /** - * Is level of current item higher than level of specified - * - * @param type Item to compare - * @return - */ - public boolean higherThan(TestItemTypeEnum type) { - return LEVEL_COMPARATOR.compare(this, type) > 0; - } + /** + * Is level of current item higher than level of specified + * + * @param type Item to compare + * @return + */ + public boolean higherThan(TestItemTypeEnum type) { + return LEVEL_COMPARATOR.compare(this, type) > 0; + } - /** - * Is level of current item lower than level of specified - * - * @param type Item to compare - * @return - */ - public boolean lowerThan(TestItemTypeEnum type) { - return LEVEL_COMPARATOR.compare(this, type) < 0; - } + /** + * Is level of current item lower than level of specified + * + * @param type Item to compare + * @return + */ + public boolean lowerThan(TestItemTypeEnum type) { + return LEVEL_COMPARATOR.compare(this, type) < 0; + } - public boolean awareStatistics() { - return awareStatistics; - } + public boolean awareStatistics() { + return awareStatistics; + } - public int getLevel() { - return level; - } + public int getLevel() { + return level; + } - /** - * Level Comparator for TestItem types. Returns TRUE of level of first - * object is lower than level of second object - * - * @author Andrei Varabyeu - */ - private static final Comparator LEVEL_COMPARATOR = (o1, o2) -> Integer.compare(o2.level, o1.level); + public static class Constants { - public static class Constants { - public static final int SUITE_LEVEL = 0; - public static final int TEST_LEVEL = 1; - public static final int STEP_LEVEL = 2; - } + public static final int SUITE_LEVEL = 0; + public static final int TEST_LEVEL = 1; + public static final int STEP_LEVEL = 2; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/converter/AnalyzerModeConverter.java b/src/main/java/com/epam/ta/reportportal/entity/enums/converter/AnalyzerModeConverter.java index c91bac41f..09b706cdd 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/converter/AnalyzerModeConverter.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/converter/AnalyzerModeConverter.java @@ -18,7 +18,6 @@ import com.epam.ta.reportportal.entity.AnalyzeMode; import com.epam.ta.reportportal.exception.ReportPortalException; - import javax.persistence.AttributeConverter; import javax.persistence.Converter; @@ -27,14 +26,16 @@ */ @Converter(autoApply = true) public class AnalyzerModeConverter implements AttributeConverter { - @Override - public String convertToDatabaseColumn(AnalyzeMode attribute) { - return attribute.getValue(); - } - @Override - public AnalyzeMode convertToEntityAttribute(String dbAnalyzerModeName) { - return AnalyzeMode.fromString(dbAnalyzerModeName) - .orElseThrow(() -> new ReportPortalException("Can not convert user type name from database.")); - } + @Override + public String convertToDatabaseColumn(AnalyzeMode attribute) { + return attribute.getValue(); + } + + @Override + public AnalyzeMode convertToEntityAttribute(String dbAnalyzerModeName) { + return AnalyzeMode.fromString(dbAnalyzerModeName) + .orElseThrow( + () -> new ReportPortalException("Can not convert user type name from database.")); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/converter/LogLevelConverter.java b/src/main/java/com/epam/ta/reportportal/entity/enums/converter/LogLevelConverter.java index 1897ddded..a84f68fee 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/converter/LogLevelConverter.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/converter/LogLevelConverter.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.entity.enums.converter; import com.epam.ta.reportportal.entity.enums.LogLevel; - import javax.persistence.AttributeConverter; import javax.persistence.Converter; @@ -27,13 +26,13 @@ @Converter(autoApply = true) public class LogLevelConverter implements AttributeConverter { - @Override - public Integer convertToDatabaseColumn(LogLevel attribute) { - return attribute.toInt(); - } + @Override + public Integer convertToDatabaseColumn(LogLevel attribute) { + return attribute.toInt(); + } - @Override - public LogLevel convertToEntityAttribute(Integer dbData) { - return LogLevel.toLevel(dbData); - } + @Override + public LogLevel convertToEntityAttribute(Integer dbData) { + return LogLevel.toLevel(dbData); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/converter/ProjectRoleConverter.java b/src/main/java/com/epam/ta/reportportal/entity/enums/converter/ProjectRoleConverter.java index 7fe0ecec0..666f95696 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/converter/ProjectRoleConverter.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/converter/ProjectRoleConverter.java @@ -18,7 +18,6 @@ import com.epam.ta.reportportal.entity.project.ProjectRole; import com.epam.ta.reportportal.exception.ReportPortalException; - import javax.persistence.AttributeConverter; import javax.persistence.Converter; @@ -27,14 +26,16 @@ */ @Converter(autoApply = true) public class ProjectRoleConverter implements AttributeConverter { - @Override - public String convertToDatabaseColumn(ProjectRole attribute) { - return attribute.toString(); - } - @Override - public ProjectRole convertToEntityAttribute(String dbProjectRoleName) { - return ProjectRole.forName(dbProjectRoleName) - .orElseThrow(() -> new ReportPortalException("Can not convert project role name from database.")); - } + @Override + public String convertToDatabaseColumn(ProjectRole attribute) { + return attribute.toString(); + } + + @Override + public ProjectRole convertToEntityAttribute(String dbProjectRoleName) { + return ProjectRole.forName(dbProjectRoleName) + .orElseThrow( + () -> new ReportPortalException("Can not convert project role name from database.")); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/converter/ProjectTypeConverter.java b/src/main/java/com/epam/ta/reportportal/entity/enums/converter/ProjectTypeConverter.java index f3fb3c56a..10b24889c 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/converter/ProjectTypeConverter.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/converter/ProjectTypeConverter.java @@ -18,7 +18,6 @@ import com.epam.ta.reportportal.entity.enums.ProjectType; import com.epam.ta.reportportal.exception.ReportPortalException; - import javax.persistence.AttributeConverter; import javax.persistence.Converter; @@ -27,14 +26,16 @@ */ @Converter(autoApply = true) public class ProjectTypeConverter implements AttributeConverter { - @Override - public String convertToDatabaseColumn(ProjectType attribute) { - return attribute.toString(); - } - @Override - public ProjectType convertToEntityAttribute(String dbProjectRoleName) { - return ProjectType.findByName(dbProjectRoleName) - .orElseThrow(() -> new ReportPortalException("Can not convert project type name from database.")); - } + @Override + public String convertToDatabaseColumn(ProjectType attribute) { + return attribute.toString(); + } + + @Override + public ProjectType convertToEntityAttribute(String dbProjectRoleName) { + return ProjectType.findByName(dbProjectRoleName) + .orElseThrow( + () -> new ReportPortalException("Can not convert project type name from database.")); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/converter/UserTypeConverter.java b/src/main/java/com/epam/ta/reportportal/entity/enums/converter/UserTypeConverter.java index c129b244a..5af8e8b7f 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/converter/UserTypeConverter.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/converter/UserTypeConverter.java @@ -18,7 +18,6 @@ import com.epam.ta.reportportal.entity.user.UserType; import com.epam.ta.reportportal.exception.ReportPortalException; - import javax.persistence.AttributeConverter; import javax.persistence.Converter; @@ -27,14 +26,16 @@ */ @Converter(autoApply = true) public class UserTypeConverter implements AttributeConverter { - @Override - public String convertToDatabaseColumn(UserType attribute) { - return attribute.toString(); - } - @Override - public UserType convertToEntityAttribute(String dbUserTypeName) { - return UserType.findByName(dbUserTypeName) - .orElseThrow(() -> new ReportPortalException("Can not convert user type name from database.")); - } + @Override + public String convertToDatabaseColumn(UserType attribute) { + return attribute.toString(); + } + + @Override + public UserType convertToEntityAttribute(String dbUserTypeName) { + return UserType.findByName(dbUserTypeName) + .orElseThrow( + () -> new ReportPortalException("Can not convert user type name from database.")); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/filter/FilterSort.java b/src/main/java/com/epam/ta/reportportal/entity/filter/FilterSort.java index c6231818f..93b3b658f 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/filter/FilterSort.java +++ b/src/main/java/com/epam/ta/reportportal/entity/filter/FilterSort.java @@ -17,14 +17,20 @@ package com.epam.ta.reportportal.entity.filter; import com.epam.ta.reportportal.entity.enums.PostgreSQLEnumType; +import java.io.Serializable; +import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import org.springframework.data.domain.Sort; -import javax.persistence.*; -import java.io.Serializable; -import java.util.Objects; - /** * @author Pavel Bortnik */ @@ -33,57 +39,57 @@ @Table(name = "filter_sort", schema = "public") public class FilterSort implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id", unique = true, nullable = false, precision = 64) - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", unique = true, nullable = false, precision = 64) + private Long id; - @Column(name = "field") - private String field; + @Column(name = "field") + private String field; - @Column(name = "direction", nullable = false) - @Enumerated(EnumType.STRING) - @Type(type = "pqsql_enum") - private Sort.Direction direction; + @Column(name = "direction", nullable = false) + @Enumerated(EnumType.STRING) + @Type(type = "pqsql_enum") + private Sort.Direction direction; - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public String getField() { - return field; - } + public String getField() { + return field; + } - public void setField(String field) { - this.field = field; - } + public void setField(String field) { + this.field = field; + } - public Sort.Direction getDirection() { - return direction; - } + public Sort.Direction getDirection() { + return direction; + } - public void setDirection(Sort.Direction direction) { - this.direction = direction; - } + public void setDirection(Sort.Direction direction) { + this.direction = direction; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FilterSort that = (FilterSort) o; - return Objects.equals(field, that.field) && direction == that.direction; - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FilterSort that = (FilterSort) o; + return Objects.equals(field, that.field) && direction == that.direction; + } - @Override - public int hashCode() { - return Objects.hash(field, direction); - } + @Override + public int hashCode() { + return Objects.hash(field, direction); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/filter/ObjectType.java b/src/main/java/com/epam/ta/reportportal/entity/filter/ObjectType.java index bf383507a..547ca582c 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/filter/ObjectType.java +++ b/src/main/java/com/epam/ta/reportportal/entity/filter/ObjectType.java @@ -16,57 +16,58 @@ package com.epam.ta.reportportal.entity.filter; +import static com.epam.ta.reportportal.commons.Predicates.isPresent; + import com.epam.ta.reportportal.commons.validation.BusinessRule; import com.epam.ta.reportportal.entity.activity.Activity; import com.epam.ta.reportportal.entity.item.TestItem; import com.epam.ta.reportportal.entity.launch.Launch; import com.epam.ta.reportportal.entity.log.Log; import com.epam.ta.reportportal.ws.model.ErrorType; - import java.util.Arrays; import java.util.Optional; -import static com.epam.ta.reportportal.commons.Predicates.isPresent; - /** - * Describe possible object types for {@link com.epam.ta.reportportal.commons.querygen.Filter} object
    - * construction and contains functionality for calculating classes objects
    - * by appropriate ObjectType's elements. + * Describe possible object types for {@link com.epam.ta.reportportal.commons.querygen.Filter} + * object
    construction and contains functionality for calculating classes objects
    by + * appropriate ObjectType's elements. * * @author Aliaksei_Makayed */ public enum ObjectType { - Launch(Launch.class), - TestItem(TestItem.class), - Activity(Activity.class), - Log(Log.class); + Launch(Launch.class), + TestItem(TestItem.class), + Activity(Activity.class), + Log(Log.class); - private Class classObject; + private Class classObject; - ObjectType(Class classObject) { - this.classObject = classObject; - } + ObjectType(Class classObject) { + this.classObject = classObject; + } - public static ObjectType getObjectTypeByName(String name) { - Optional objectType = Arrays.stream(ObjectType.values()).filter(type -> type.name().equalsIgnoreCase(name)).findAny(); - BusinessRule.expect(objectType, isPresent()).verify( - ErrorType.BAD_SAVE_USER_FILTER_REQUEST, - "Unknown Filter object type '" + name + "'. Possible types: log, launch, testItem." - ); - return objectType.get(); - } + public static ObjectType getObjectTypeByName(String name) { + Optional objectType = Arrays.stream(ObjectType.values()) + .filter(type -> type.name().equalsIgnoreCase(name)).findAny(); + BusinessRule.expect(objectType, isPresent()).verify( + ErrorType.BAD_SAVE_USER_FILTER_REQUEST, + "Unknown Filter object type '" + name + "'. Possible types: log, launch, testItem." + ); + return objectType.get(); + } - public static Class getTypeByName(String name) { - Optional objectType = Arrays.stream(ObjectType.values()).filter(type -> type.name().equalsIgnoreCase(name)).findAny(); - BusinessRule.expect(objectType, isPresent()).verify( - ErrorType.BAD_SAVE_USER_FILTER_REQUEST, - "Unknown Filter object type '" + name + "'. Possible types: log, launch, testItem." - ); - return objectType.get().classObject; - } + public static Class getTypeByName(String name) { + Optional objectType = Arrays.stream(ObjectType.values()) + .filter(type -> type.name().equalsIgnoreCase(name)).findAny(); + BusinessRule.expect(objectType, isPresent()).verify( + ErrorType.BAD_SAVE_USER_FILTER_REQUEST, + "Unknown Filter object type '" + name + "'. Possible types: log, launch, testItem." + ); + return objectType.get().classObject; + } - public Class getClassObject() { - return classObject; - } + public Class getClassObject() { + return classObject; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/filter/UserFilter.java b/src/main/java/com/epam/ta/reportportal/entity/filter/UserFilter.java index d14ad5a5d..4db212506 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/filter/UserFilter.java +++ b/src/main/java/com/epam/ta/reportportal/entity/filter/UserFilter.java @@ -20,12 +20,20 @@ import com.epam.ta.reportportal.entity.ShareableEntity; import com.epam.ta.reportportal.entity.enums.PostgreSQLEnumType; import com.google.common.collect.Sets; -import org.hibernate.annotations.Type; -import org.hibernate.annotations.TypeDef; - -import javax.persistence.*; import java.io.Serializable; import java.util.Set; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.OrderBy; +import javax.persistence.Table; +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; /** * @author Pavel Bortnik @@ -35,63 +43,63 @@ @TypeDef(name = "pgsql_enum", typeClass = PostgreSQLEnumType.class) public class UserFilter extends ShareableEntity implements Serializable { - @Column(name = "name") - private String name; + @Column(name = "name") + private String name; - @Enumerated(EnumType.STRING) - @Type(type = "pqsql_enum") - @Column(name = "target") - private ObjectType targetClass; + @Enumerated(EnumType.STRING) + @Type(type = "pqsql_enum") + @Column(name = "target") + private ObjectType targetClass; - @Column(name = "description") - private String description; + @Column(name = "description") + private String description; - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true) - @JoinColumn(name = "filter_id") - private Set filterCondition = Sets.newHashSet(); + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true) + @JoinColumn(name = "filter_id") + private Set filterCondition = Sets.newHashSet(); - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true) - @JoinColumn(name = "filter_id") - @OrderBy(value = "id") - private Set filterSorts = Sets.newLinkedHashSet(); + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true) + @JoinColumn(name = "filter_id") + @OrderBy(value = "id") + private Set filterSorts = Sets.newLinkedHashSet(); - public Set getFilterCondition() { - return filterCondition; - } + public Set getFilterCondition() { + return filterCondition; + } - public void setFilterCondition(Set filterCondition) { - this.filterCondition = filterCondition; - } + public void setFilterCondition(Set filterCondition) { + this.filterCondition = filterCondition; + } - public Set getFilterSorts() { - return filterSorts; - } + public Set getFilterSorts() { + return filterSorts; + } - public void setFilterSorts(Set filterSorts) { - this.filterSorts = filterSorts; - } + public void setFilterSorts(Set filterSorts) { + this.filterSorts = filterSorts; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public ObjectType getTargetClass() { - return targetClass; - } + public ObjectType getTargetClass() { + return targetClass; + } - public void setTargetClass(ObjectType targetClass) { - this.targetClass = targetClass; - } + public void setTargetClass(ObjectType targetClass) { + this.targetClass = targetClass; + } - public String getDescription() { - return description; - } + public String getDescription() { + return description; + } - public void setDescription(String description) { - this.description = description; - } + public void setDescription(String description) { + this.description = description; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/integration/Integration.java b/src/main/java/com/epam/ta/reportportal/entity/integration/Integration.java index a902a308c..1f4ae7c4e 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/integration/Integration.java +++ b/src/main/java/com/epam/ta/reportportal/entity/integration/Integration.java @@ -17,15 +17,24 @@ package com.epam.ta.reportportal.entity.integration; import com.epam.ta.reportportal.entity.project.Project; +import java.io.Serializable; +import java.time.LocalDateTime; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EntityListeners; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import org.springframework.data.annotation.CreatedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; -import javax.persistence.*; -import java.io.Serializable; -import java.time.LocalDateTime; - /** * @author Yauheni_Martynau */ @@ -36,109 +45,110 @@ @Inheritance(strategy = InheritanceType.JOINED) public class Integration implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id") - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Long id; - @Column(name = "name") - private String name; + @Column(name = "name") + private String name; - @ManyToOne - @JoinColumn(name = "project_id") - private Project project; + @ManyToOne + @JoinColumn(name = "project_id") + private Project project; - @ManyToOne - @JoinColumn(name = "type") - private IntegrationType type; + @ManyToOne + @JoinColumn(name = "type") + private IntegrationType type; - @Type(type = "params") - @Column(name = "params") - private IntegrationParams params; + @Type(type = "params") + @Column(name = "params") + private IntegrationParams params; - @Column(name = "enabled") - private boolean enabled; + @Column(name = "enabled") + private boolean enabled; - @Column(name = "creator") - private String creator; + @Column(name = "creator") + private String creator; - @CreatedDate - @Column(name = "creation_date") - private LocalDateTime creationDate; + @CreatedDate + @Column(name = "creation_date") + private LocalDateTime creationDate; - public Integration(Long id, Project project, IntegrationType type, IntegrationParams params, LocalDateTime creationDate) { - this.id = id; - this.project = project; - this.type = type; - this.params = params; - this.creationDate = creationDate; - } + public Integration(Long id, Project project, IntegrationType type, IntegrationParams params, + LocalDateTime creationDate) { + this.id = id; + this.project = project; + this.type = type; + this.params = params; + this.creationDate = creationDate; + } - public Integration() { - } + public Integration() { + } - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public Project getProject() { - return project; - } + public Project getProject() { + return project; + } - public void setProject(Project project) { - this.project = project; - } + public void setProject(Project project) { + this.project = project; + } - public IntegrationType getType() { - return type; - } + public IntegrationType getType() { + return type; + } - public void setType(IntegrationType type) { - this.type = type; - } + public void setType(IntegrationType type) { + this.type = type; + } - public IntegrationParams getParams() { - return params; - } + public IntegrationParams getParams() { + return params; + } - public void setParams(IntegrationParams params) { - this.params = params; - } + public void setParams(IntegrationParams params) { + this.params = params; + } - public String getCreator() { - return creator; - } + public String getCreator() { + return creator; + } - public void setCreator(String creator) { - this.creator = creator; - } + public void setCreator(String creator) { + this.creator = creator; + } - public LocalDateTime getCreationDate() { - return creationDate; - } + public LocalDateTime getCreationDate() { + return creationDate; + } - public void setCreationDate(LocalDateTime creationDate) { - this.creationDate = creationDate; - } + public void setCreationDate(LocalDateTime creationDate) { + this.creationDate = creationDate; + } - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } + public boolean isEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationParams.java b/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationParams.java index 76a53a0d4..68bdd8ac5 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationParams.java +++ b/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationParams.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.entity.integration; import com.epam.ta.reportportal.commons.JsonbUserType; - import java.io.Serializable; import java.util.Map; @@ -26,25 +25,25 @@ */ public class IntegrationParams extends JsonbUserType implements Serializable { - @Override - public Class returnedClass() { - return IntegrationParams.class; - } + private Map params; - private Map params; + public IntegrationParams() { + } - public IntegrationParams() { - } + public IntegrationParams(Map params) { + this.params = params; + } - public IntegrationParams(Map params) { - this.params = params; - } + @Override + public Class returnedClass() { + return IntegrationParams.class; + } - public Map getParams() { - return params; - } + public Map getParams() { + return params; + } - public void setParams(Map params) { - this.params = params; - } + public void setParams(Map params) { + this.params = params; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationType.java b/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationType.java index 75fcc5070..f737d0859 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationType.java +++ b/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationType.java @@ -20,15 +20,22 @@ import com.epam.ta.reportportal.entity.enums.IntegrationGroupEnum; import com.epam.ta.reportportal.entity.enums.PostgreSQLEnumType; import com.google.common.collect.Sets; -import org.hibernate.annotations.Type; -import org.hibernate.annotations.TypeDef; -import org.springframework.data.annotation.CreatedDate; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -import javax.persistence.*; import java.io.Serializable; import java.time.LocalDateTime; import java.util.Set; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; +import org.springframework.data.annotation.CreatedDate; /** * @author Yauheni_Martynau @@ -39,99 +46,99 @@ @Table(name = "integration_type", schema = "public") public class IntegrationType implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id", unique = true, nullable = false, precision = 64) - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", unique = true, nullable = false, precision = 64) + private Long id; - @Column(name = "name", nullable = false) - private String name; + @Column(name = "name", nullable = false) + private String name; - @Enumerated(EnumType.STRING) - @Type(type = "pqsql_enum") - @Column(name = "auth_flow", nullable = false) - private IntegrationAuthFlowEnum authFlow; + @Enumerated(EnumType.STRING) + @Type(type = "pqsql_enum") + @Column(name = "auth_flow", nullable = false) + private IntegrationAuthFlowEnum authFlow; - @CreatedDate - @Column(name = "creation_date", nullable = false) - private LocalDateTime creationDate; + @CreatedDate + @Column(name = "creation_date", nullable = false) + private LocalDateTime creationDate; - @Enumerated(EnumType.STRING) - @Type(type = "pqsql_enum") - @Column(name = "group_type", nullable = false) - private IntegrationGroupEnum integrationGroup; + @Enumerated(EnumType.STRING) + @Type(type = "pqsql_enum") + @Column(name = "group_type", nullable = false) + private IntegrationGroupEnum integrationGroup; - @Column(name = "enabled") - private boolean enabled; + @Column(name = "enabled") + private boolean enabled; - @Type(type = "details") - @Column(name = "details") - private IntegrationTypeDetails details; + @Type(type = "details") + @Column(name = "details") + private IntegrationTypeDetails details; - @OneToMany(mappedBy = "type", fetch = FetchType.LAZY, orphanRemoval = true) - private Set integrations = Sets.newHashSet(); + @OneToMany(mappedBy = "type", fetch = FetchType.LAZY, orphanRemoval = true) + private Set integrations = Sets.newHashSet(); - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public IntegrationAuthFlowEnum getAuthFlow() { - return authFlow; - } + public IntegrationAuthFlowEnum getAuthFlow() { + return authFlow; + } - public void setAuthFlow(IntegrationAuthFlowEnum authFlow) { - this.authFlow = authFlow; - } + public void setAuthFlow(IntegrationAuthFlowEnum authFlow) { + this.authFlow = authFlow; + } - public LocalDateTime getCreationDate() { - return creationDate; - } + public LocalDateTime getCreationDate() { + return creationDate; + } - public void setCreationDate(LocalDateTime creationDate) { - this.creationDate = creationDate; - } + public void setCreationDate(LocalDateTime creationDate) { + this.creationDate = creationDate; + } - public IntegrationGroupEnum getIntegrationGroup() { - return integrationGroup; - } + public IntegrationGroupEnum getIntegrationGroup() { + return integrationGroup; + } - public void setIntegrationGroup(IntegrationGroupEnum integrationGroup) { - this.integrationGroup = integrationGroup; - } + public void setIntegrationGroup(IntegrationGroupEnum integrationGroup) { + this.integrationGroup = integrationGroup; + } - public boolean isEnabled() { - return enabled; - } + public boolean isEnabled() { + return enabled; + } - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } - public IntegrationTypeDetails getDetails() { - return details; - } + public IntegrationTypeDetails getDetails() { + return details; + } - public void setDetails(IntegrationTypeDetails details) { - this.details = details; - } + public void setDetails(IntegrationTypeDetails details) { + this.details = details; + } - public Set getIntegrations() { - return integrations; - } + public Set getIntegrations() { + return integrations; + } - public void setIntegrations(Set integrations) { - this.integrations = integrations; - } + public void setIntegrations(Set integrations) { + this.integrations = integrations; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationTypeDetails.java b/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationTypeDetails.java index aab82d6a1..25e5f43d2 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationTypeDetails.java +++ b/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationTypeDetails.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.entity.integration; import com.epam.ta.reportportal.commons.JsonbUserType; - import java.io.Serializable; import java.util.Map; @@ -26,18 +25,18 @@ */ public class IntegrationTypeDetails extends JsonbUserType implements Serializable { - @Override - public Class returnedClass() { - return IntegrationTypeDetails.class; - } + private Map details; - private Map details; + @Override + public Class returnedClass() { + return IntegrationTypeDetails.class; + } - public Map getDetails() { - return details; - } + public Map getDetails() { + return details; + } - public void setDetails(Map details) { - this.details = details; - } + public void setDetails(Map details) { + this.details = details; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/item/ItemAttributePojo.java b/src/main/java/com/epam/ta/reportportal/entity/item/ItemAttributePojo.java index bc4e25a4b..09ec102ce 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/item/ItemAttributePojo.java +++ b/src/main/java/com/epam/ta/reportportal/entity/item/ItemAttributePojo.java @@ -24,73 +24,74 @@ */ public class ItemAttributePojo implements Serializable { - private Long itemId; - - private String key; - - private String value; - - private boolean isSystem; - - public ItemAttributePojo() { - } - - public ItemAttributePojo(Long itemId, String key, String value, boolean isSystem) { - this.itemId = itemId; - this.key = key; - this.value = value; - this.isSystem = isSystem; - } - - public Long getItemId() { - return itemId; - } - - public void setItemId(Long itemId) { - this.itemId = itemId; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public boolean isSystem() { - return isSystem; - } - - public void setSystem(boolean system) { - isSystem = system; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ItemAttributePojo that = (ItemAttributePojo) o; - return isSystem == that.isSystem && Objects.equals(itemId, that.itemId) && Objects.equals(key, that.key) && Objects.equals( - value, - that.value - ); - } - - @Override - public int hashCode() { - return Objects.hash(itemId, key, value, isSystem); - } + private Long itemId; + + private String key; + + private String value; + + private boolean isSystem; + + public ItemAttributePojo() { + } + + public ItemAttributePojo(Long itemId, String key, String value, boolean isSystem) { + this.itemId = itemId; + this.key = key; + this.value = value; + this.isSystem = isSystem; + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public boolean isSystem() { + return isSystem; + } + + public void setSystem(boolean system) { + isSystem = system; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemAttributePojo that = (ItemAttributePojo) o; + return isSystem == that.isSystem && Objects.equals(itemId, that.itemId) && Objects.equals(key, + that.key) && Objects.equals( + value, + that.value + ); + } + + @Override + public int hashCode() { + return Objects.hash(itemId, key, value, isSystem); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/item/ItemPathName.java b/src/main/java/com/epam/ta/reportportal/entity/item/ItemPathName.java index 1b7241db1..72caae300 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/item/ItemPathName.java +++ b/src/main/java/com/epam/ta/reportportal/entity/item/ItemPathName.java @@ -23,31 +23,31 @@ */ public class ItemPathName implements Serializable { - private Long id; + private Long id; - private String name; + private String name; - public ItemPathName() { - } + public ItemPathName() { + } - public ItemPathName(Long id, String name) { - this.id = id; - this.name = name; - } + public ItemPathName(Long id, String name) { + this.id = id; + this.name = name; + } - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/item/LaunchPathName.java b/src/main/java/com/epam/ta/reportportal/entity/item/LaunchPathName.java index 0e0936229..04ee37916 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/item/LaunchPathName.java +++ b/src/main/java/com/epam/ta/reportportal/entity/item/LaunchPathName.java @@ -23,30 +23,30 @@ */ public class LaunchPathName implements Serializable { - private String name; - private Integer number; + private String name; + private Integer number; - public LaunchPathName() { - } + public LaunchPathName() { + } - public LaunchPathName(String name, Integer number) { - this.name = name; - this.number = number; - } + public LaunchPathName(String name, Integer number) { + this.name = name; + this.number = number; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public Integer getNumber() { - return number; - } + public Integer getNumber() { + return number; + } - public void setNumber(Integer number) { - this.number = number; - } + public void setNumber(Integer number) { + this.number = number; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/item/NestedItem.java b/src/main/java/com/epam/ta/reportportal/entity/item/NestedItem.java index 1c91314e0..f46042d1b 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/item/NestedItem.java +++ b/src/main/java/com/epam/ta/reportportal/entity/item/NestedItem.java @@ -17,16 +17,17 @@ package com.epam.ta.reportportal.entity.item; import com.epam.ta.reportportal.commons.querygen.Queryable; -import org.springframework.data.domain.Pageable; - import java.io.Serializable; import java.util.Objects; +import org.springframework.data.domain.Pageable; /** - * Entity for query {@link com.epam.ta.reportportal.dao.LogRepository#findNestedItems(Long, boolean, boolean, Queryable, Pageable)}, consists from - * either {@link com.epam.ta.reportportal.entity.log.Log#id} or {@link TestItem#itemId} as {@link NestedItem#id} - * and {@link NestedItem#type} to identify what kind of entity is it and either {@link com.epam.ta.reportportal.entity.log.Log#logLevel} or - * 0 in case if it is an item + * Entity for query + * {@link com.epam.ta.reportportal.dao.LogRepository#findNestedItems(Long, boolean, boolean, + * Queryable, Pageable)}, consists from either {@link com.epam.ta.reportportal.entity.log.Log#id} or + * {@link TestItem#itemId} as {@link NestedItem#id} and {@link NestedItem#type} to identify what + * kind of entity is it and either {@link com.epam.ta.reportportal.entity.log.Log#logLevel} or 0 in + * case if it is an item *

    * Required for applying filters and sorting on the db level for different entity types * @@ -34,59 +35,60 @@ */ public class NestedItem implements Serializable { - private Long id; + private Long id; - private String type; + private String type; - private Integer logLevel; + private Integer logLevel; - public NestedItem() { - } + public NestedItem() { + } - public NestedItem(Long id, String type, Integer logLevel) { - this.id = id; - this.type = type; - this.logLevel = logLevel; - } + public NestedItem(Long id, String type, Integer logLevel) { + this.id = id; + this.type = type; + this.logLevel = logLevel; + } - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public String getType() { - return type; - } + public String getType() { + return type; + } - public void setType(String type) { - this.type = type; - } + public void setType(String type) { + this.type = type; + } - public Integer getLogLevel() { - return logLevel; - } + public Integer getLogLevel() { + return logLevel; + } - public void setLogLevel(Integer logLevel) { - this.logLevel = logLevel; - } + public void setLogLevel(Integer logLevel) { + this.logLevel = logLevel; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NestedItem that = (NestedItem) o; - return Objects.equals(id, that.id) && Objects.equals(type, that.type) && Objects.equals(logLevel, that.logLevel); + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - @Override - public int hashCode() { - return Objects.hash(id, type, logLevel); + if (o == null || getClass() != o.getClass()) { + return false; } + NestedItem that = (NestedItem) o; + return Objects.equals(id, that.id) && Objects.equals(type, that.type) && Objects.equals( + logLevel, that.logLevel); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, logLevel); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/item/NestedItemPage.java b/src/main/java/com/epam/ta/reportportal/entity/item/NestedItemPage.java index 026ac97d1..85cf2467d 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/item/NestedItemPage.java +++ b/src/main/java/com/epam/ta/reportportal/entity/item/NestedItemPage.java @@ -5,19 +5,19 @@ */ public class NestedItemPage extends NestedItem { - private Integer pageNumber; + private Integer pageNumber; - public NestedItemPage(Long id, String type, Integer logLevel, Integer pageNumber) { - super(id, type, logLevel); - this.pageNumber = pageNumber; - } + public NestedItemPage(Long id, String type, Integer logLevel, Integer pageNumber) { + super(id, type, logLevel); + this.pageNumber = pageNumber; + } - public Integer getPageNumber() { - return pageNumber; - } + public Integer getPageNumber() { + return pageNumber; + } - public void setPageNumber(Integer pageNumber) { - this.pageNumber = pageNumber; - } + public void setPageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/item/NestedStep.java b/src/main/java/com/epam/ta/reportportal/entity/item/NestedStep.java index b8a578a1f..679380699 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/item/NestedStep.java +++ b/src/main/java/com/epam/ta/reportportal/entity/item/NestedStep.java @@ -18,7 +18,6 @@ import com.epam.ta.reportportal.entity.enums.StatusEnum; import com.epam.ta.reportportal.entity.enums.TestItemTypeEnum; - import java.io.Serializable; import java.time.LocalDateTime; import java.util.Objects; @@ -28,144 +27,148 @@ */ public class NestedStep implements Serializable { - private Long id; - - private String name; - - private String uuid; - - private TestItemTypeEnum type; - - private boolean hasContent; - - private Integer attachmentsCount; - - private StatusEnum status; - - private LocalDateTime startTime; - - private LocalDateTime endTime; - - private Double duration; - - public NestedStep() { - - } - - public NestedStep(Long id, String name, String uuid, TestItemTypeEnum type, boolean hasContent, Integer attachmentsCount, - StatusEnum status, LocalDateTime startTime, LocalDateTime endTime, Double duration) { - this.id = id; - this.name = name; - this.uuid = uuid; - this.type = type; - this.hasContent = hasContent; - this.attachmentsCount = attachmentsCount; - this.status = status; - this.startTime = startTime; - this.endTime = endTime; - this.duration = duration; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } + private Long id; - public TestItemTypeEnum getType() { - return type; - } + private String name; - public void setType(TestItemTypeEnum type) { - this.type = type; - } + private String uuid; - public boolean isHasContent() { - return hasContent; - } + private TestItemTypeEnum type; - public void setHasContent(boolean hasContent) { - this.hasContent = hasContent; - } + private boolean hasContent; - public Integer getAttachmentsCount() { - return attachmentsCount; - } + private Integer attachmentsCount; - public void setAttachmentsCount(Integer attachmentsCount) { - this.attachmentsCount = attachmentsCount; - } + private StatusEnum status; - public StatusEnum getStatus() { - return status; - } + private LocalDateTime startTime; - public void setStatus(StatusEnum status) { - this.status = status; - } + private LocalDateTime endTime; - public LocalDateTime getStartTime() { - return startTime; - } + private Double duration; - public void setStartTime(LocalDateTime startTime) { - this.startTime = startTime; - } + public NestedStep() { - public LocalDateTime getEndTime() { - return endTime; - } + } - public void setEndTime(LocalDateTime endTime) { - this.endTime = endTime; - } + public NestedStep(Long id, String name, String uuid, TestItemTypeEnum type, boolean hasContent, + Integer attachmentsCount, + StatusEnum status, LocalDateTime startTime, LocalDateTime endTime, Double duration) { + this.id = id; + this.name = name; + this.uuid = uuid; + this.type = type; + this.hasContent = hasContent; + this.attachmentsCount = attachmentsCount; + this.status = status; + this.startTime = startTime; + this.endTime = endTime; + this.duration = duration; + } - public Double getDuration() { - return duration; - } - - public void setDuration(Double duration) { - this.duration = duration; - } - - public String getUuid() { - return uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NestedStep that = (NestedStep) o; - return hasContent == that.hasContent && Objects.equals(id, that.id) && Objects.equals(name, that.name) && type == that.type - && Objects.equals(attachmentsCount, that.attachmentsCount) && status == that.status && Objects.equals(startTime, - that.startTime - ) && Objects.equals(uuid, that.uuid) && Objects.equals(endTime, that.endTime) && Objects.equals( - duration, - that.duration - ); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, uuid, type, hasContent, attachmentsCount, status, startTime, endTime, duration); - } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public TestItemTypeEnum getType() { + return type; + } + + public void setType(TestItemTypeEnum type) { + this.type = type; + } + + public boolean isHasContent() { + return hasContent; + } + + public void setHasContent(boolean hasContent) { + this.hasContent = hasContent; + } + + public Integer getAttachmentsCount() { + return attachmentsCount; + } + + public void setAttachmentsCount(Integer attachmentsCount) { + this.attachmentsCount = attachmentsCount; + } + + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public LocalDateTime getStartTime() { + return startTime; + } + + public void setStartTime(LocalDateTime startTime) { + this.startTime = startTime; + } + + public LocalDateTime getEndTime() { + return endTime; + } + + public void setEndTime(LocalDateTime endTime) { + this.endTime = endTime; + } + + public Double getDuration() { + return duration; + } + + public void setDuration(Double duration) { + this.duration = duration; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NestedStep that = (NestedStep) o; + return hasContent == that.hasContent && Objects.equals(id, that.id) && Objects.equals(name, + that.name) && type == that.type + && Objects.equals(attachmentsCount, that.attachmentsCount) && status == that.status + && Objects.equals(startTime, + that.startTime + ) && Objects.equals(uuid, that.uuid) && Objects.equals(endTime, that.endTime) && Objects.equals( + duration, + that.duration + ); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, uuid, type, hasContent, attachmentsCount, status, startTime, + endTime, duration); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/item/Parameter.java b/src/main/java/com/epam/ta/reportportal/entity/item/Parameter.java index efd7ece19..784a08917 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/item/Parameter.java +++ b/src/main/java/com/epam/ta/reportportal/entity/item/Parameter.java @@ -16,9 +16,9 @@ package com.epam.ta.reportportal.entity.item; +import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Embeddable; -import java.io.Serializable; /** * @author Pavel Bortnik @@ -26,52 +26,52 @@ @Embeddable public class Parameter implements Serializable { - @Column(name = "key") - private String key; + @Column(name = "key") + private String key; - @Column(name = "value") - private String value; + @Column(name = "value") + private String value; - public Parameter() { - } + public Parameter() { + } - public String getKey() { - return key; - } + public String getKey() { + return key; + } - public void setKey(String key) { - this.key = key; - } + public void setKey(String key) { + this.key = key; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } - public void setValue(String value) { - this.value = value; - } + public void setValue(String value) { + this.value = value; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } - Parameter parameter = (Parameter) o; + Parameter parameter = (Parameter) o; - if (key != null ? !key.equals(parameter.key) : parameter.key != null) { - return false; - } - return value != null ? value.equals(parameter.value) : parameter.value == null; - } + if (key != null ? !key.equals(parameter.key) : parameter.key != null) { + return false; + } + return value != null ? value.equals(parameter.value) : parameter.value == null; + } - @Override - public int hashCode() { - int result = key != null ? key.hashCode() : 0; - result = 31 * result + (value != null ? value.hashCode() : 0); - return result; - } + @Override + public int hashCode() { + int result = key != null ? key.hashCode() : 0; + result = 31 * result + (value != null ? value.hashCode() : 0); + return result; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/item/PathName.java b/src/main/java/com/epam/ta/reportportal/entity/item/PathName.java index 70d77ee89..86cd6a94e 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/item/PathName.java +++ b/src/main/java/com/epam/ta/reportportal/entity/item/PathName.java @@ -24,30 +24,30 @@ */ public class PathName implements Serializable { - private LaunchPathName launchPathName; - private List itemPaths; + private LaunchPathName launchPathName; + private List itemPaths; - public PathName() { - } + public PathName() { + } - public PathName(LaunchPathName launchPathName, List itemPaths) { - this.launchPathName = launchPathName; - this.itemPaths = itemPaths; - } + public PathName(LaunchPathName launchPathName, List itemPaths) { + this.launchPathName = launchPathName; + this.itemPaths = itemPaths; + } - public LaunchPathName getLaunchPathName() { - return launchPathName; - } + public LaunchPathName getLaunchPathName() { + return launchPathName; + } - public void setLaunchPathName(LaunchPathName launchPathName) { - this.launchPathName = launchPathName; - } + public void setLaunchPathName(LaunchPathName launchPathName) { + this.launchPathName = launchPathName; + } - public List getItemPaths() { - return itemPaths; - } + public List getItemPaths() { + return itemPaths; + } - public void setItemPaths(List itemPaths) { - this.itemPaths = itemPaths; - } + public void setItemPaths(List itemPaths) { + this.itemPaths = itemPaths; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/item/TestItem.java b/src/main/java/com/epam/ta/reportportal/entity/item/TestItem.java index ee7e106a1..d8a7c46ab 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/item/TestItem.java +++ b/src/main/java/com/epam/ta/reportportal/entity/item/TestItem.java @@ -22,6 +22,27 @@ import com.epam.ta.reportportal.entity.log.Log; import com.epam.ta.reportportal.entity.pattern.PatternTemplateTestItem; import com.google.common.collect.Sets; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Objects; +import java.util.Set; +import javax.persistence.CascadeType; +import javax.persistence.CollectionTable; +import javax.persistence.Column; +import javax.persistence.ElementCollection; +import javax.persistence.Entity; +import javax.persistence.EntityListeners; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.OrderBy; +import javax.persistence.Table; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.Type; @@ -29,12 +50,6 @@ import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; -import javax.persistence.*; -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.Objects; -import java.util.Set; - /** * @author Pavel Bortnik */ @@ -44,314 +59,321 @@ @Table(name = "test_item", schema = "public") public class TestItem implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "item_id") - private Long itemId; - - @Column(name = "uuid") - private String uuid; - - @Column(name = "name", length = 256) - private String name; - - @Column(name = "code_ref") - private String codeRef; - - @Enumerated(EnumType.STRING) - @Type(type = "pqsql_enum") - @Column(name = "type", nullable = false) - private TestItemTypeEnum type; - - @Column(name = "start_time", nullable = false) - private LocalDateTime startTime; - - @Column(name = "description") - private String description; - - @Column(name = "launch_id", nullable = false) - private Long launchId; - - @LastModifiedDate - @Column(name = "last_modified", nullable = false) - private LocalDateTime lastModified; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "item_id") + private Long itemId; - @ElementCollection(fetch = FetchType.EAGER) - @CollectionTable(name = "parameter", joinColumns = @JoinColumn(name = "item_id")) - @Fetch(FetchMode.SUBSELECT) - private Set parameters = Sets.newHashSet(); + @Column(name = "uuid") + private String uuid; - @Column(name = "unique_id", nullable = false, length = 256) - private String uniqueId; + @Column(name = "name", length = 256) + private String name; - @Column(name = "test_case_id") - private String testCaseId; + @Column(name = "code_ref") + private String codeRef; - @Column(name = "test_case_hash") - private Integer testCaseHash; + @Enumerated(EnumType.STRING) + @Type(type = "pqsql_enum") + @Column(name = "type", nullable = false) + private TestItemTypeEnum type; - @OneToMany(mappedBy = "testItem", cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true) - @Fetch(FetchMode.SUBSELECT) - private Set attributes = Sets.newHashSet(); + @Column(name = "start_time", nullable = false) + private LocalDateTime startTime; - @OneToMany(mappedBy = "testItem", fetch = FetchType.LAZY, orphanRemoval = true) - private Set logs = Sets.newHashSet(); + @Column(name = "description") + private String description; - @Column(name = "path", nullable = false, columnDefinition = "ltree") - @Type(type = "com.epam.ta.reportportal.entity.LTreeType") - private String path; + @Column(name = "launch_id", nullable = false) + private Long launchId; - @Column(name = "retry_of", precision = 64) - private Long retryOf; + @LastModifiedDate + @Column(name = "last_modified", nullable = false) + private LocalDateTime lastModified; - @Column(name = "parent_id") - private Long parentId; + @ElementCollection(fetch = FetchType.EAGER) + @CollectionTable(name = "parameter", joinColumns = @JoinColumn(name = "item_id")) + @Fetch(FetchMode.SUBSELECT) + private Set parameters = Sets.newHashSet(); - @OneToOne(cascade = CascadeType.ALL, mappedBy = "testItem") - private TestItemResults itemResults; + @Column(name = "unique_id", nullable = false, length = 256) + private String uniqueId; - @OneToMany(mappedBy = "testItem", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE }, fetch = FetchType.LAZY) - @OrderBy(value = "pattern_id") - @Fetch(FetchMode.SUBSELECT) - private Set patternTemplateTestItems = Sets.newLinkedHashSet(); + @Column(name = "test_case_id") + private String testCaseId; - @Column(name = "has_children") - private boolean hasChildren; + @Column(name = "test_case_hash") + private Integer testCaseHash; - @Column(name = "has_retries") - private boolean hasRetries; + @OneToMany(mappedBy = "testItem", cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true) + @Fetch(FetchMode.SUBSELECT) + private Set attributes = Sets.newHashSet(); - @Column(name = "has_stats") - private boolean hasStats; + @OneToMany(mappedBy = "testItem", fetch = FetchType.LAZY, orphanRemoval = true) + private Set logs = Sets.newHashSet(); - public TestItem() { - } + @Column(name = "path", nullable = false, columnDefinition = "ltree") + @Type(type = "com.epam.ta.reportportal.entity.LTreeType") + private String path; - public TestItem(Long id) { - this.itemId = id; - } + @Column(name = "retry_of", precision = 64) + private Long retryOf; - public TestItem(Long itemId, String name, TestItemTypeEnum type, LocalDateTime startTime, String description, - LocalDateTime lastModified, String uniqueId, boolean hasChildren, boolean hasRetries, boolean hasStats) { - this.itemId = itemId; - this.name = name; - this.type = type; - this.startTime = startTime; - this.description = description; - this.lastModified = lastModified; - this.uniqueId = uniqueId; - this.hasChildren = hasChildren; - this.hasRetries = hasRetries; - } + @Column(name = "parent_id") + private Long parentId; - public Set getAttributes() { - return attributes; - } + @OneToOne(cascade = CascadeType.ALL, mappedBy = "testItem") + private TestItemResults itemResults; - public void setAttributes(Set tags) { - this.attributes.clear(); - this.attributes.addAll(tags); - } + @OneToMany(mappedBy = "testItem", cascade = {CascadeType.PERSIST, CascadeType.MERGE, + CascadeType.REMOVE}, fetch = FetchType.LAZY) + @OrderBy(value = "pattern_id") + @Fetch(FetchMode.SUBSELECT) + private Set patternTemplateTestItems = Sets.newLinkedHashSet(); - public Set getLogs() { - return logs; - } + @Column(name = "has_children") + private boolean hasChildren; - public void setLogs(Set logs) { - this.logs.clear(); - this.logs.addAll(logs); - } + @Column(name = "has_retries") + private boolean hasRetries; - public void addLog(Log log) { - logs.add(log); - } + @Column(name = "has_stats") + private boolean hasStats; - public Long getItemId() { - return itemId; - } + public TestItem() { + } - public void setItemId(Long itemId) { - this.itemId = itemId; - } + public TestItem(Long id) { + this.itemId = id; + } - public String getUuid() { - return uuid; - } + public TestItem(Long itemId, String name, TestItemTypeEnum type, LocalDateTime startTime, + String description, + LocalDateTime lastModified, String uniqueId, boolean hasChildren, boolean hasRetries, + boolean hasStats) { + this.itemId = itemId; + this.name = name; + this.type = type; + this.startTime = startTime; + this.description = description; + this.lastModified = lastModified; + this.uniqueId = uniqueId; + this.hasChildren = hasChildren; + this.hasRetries = hasRetries; + } - public void setUuid(String uuid) { - this.uuid = uuid; - } + public Set getAttributes() { + return attributes; + } - public String getName() { - return name; - } + public void setAttributes(Set tags) { + this.attributes.clear(); + this.attributes.addAll(tags); + } + + public Set getLogs() { + return logs; + } + + public void setLogs(Set logs) { + this.logs.clear(); + this.logs.addAll(logs); + } - public void setName(String name) { - this.name = name; - } + public void addLog(Log log) { + logs.add(log); + } - public String getCodeRef() { - return codeRef; - } + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public String getUuid() { + return uuid; + } - public void setCodeRef(String codeRef) { - this.codeRef = codeRef; - } - - public TestItemTypeEnum getType() { - return type; - } - - public void setType(TestItemTypeEnum type) { - this.type = type; - } - - public LocalDateTime getStartTime() { - return startTime; - } - - public void setStartTime(LocalDateTime startTime) { - this.startTime = startTime; - } - - public LocalDateTime getLastModified() { - return lastModified; - } - - public void setLastModified(LocalDateTime lastModified) { - this.lastModified = lastModified; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Set getParameters() { - return parameters; - } - - public void setParameters(Set parameters) { - this.parameters = parameters; - } - - public String getUniqueId() { - return uniqueId; - } - - public void setUniqueId(String uniqueId) { - this.uniqueId = uniqueId; - } - - public String getTestCaseId() { - return testCaseId; - } - - public void setTestCaseId(String testCaseId) { - this.testCaseId = testCaseId; - } - - public Integer getTestCaseHash() { - return testCaseHash; - } - - public void setTestCaseHash(Integer testCaseHash) { - this.testCaseHash = testCaseHash; - } - - public Long getLaunchId() { - return launchId; - } - - public void setLaunchId(Long launchId) { - this.launchId = launchId; - } - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public Long getRetryOf() { - return retryOf; - } - - public void setRetryOf(Long retryOf) { - this.retryOf = retryOf; - } - - public Long getParentId() { - return parentId; - } - - public void setParentId(Long parentId) { - this.parentId = parentId; - } - - public TestItemResults getItemResults() { - return itemResults; - } - - public void setItemResults(TestItemResults itemResults) { - this.itemResults = itemResults; - } - - public boolean isHasChildren() { - return hasChildren; - } - - public void setHasChildren(boolean hasChildren) { - this.hasChildren = hasChildren; - } - - public Set getPatternTemplateTestItems() { - return patternTemplateTestItems; - } - - public void setPatternTemplateTestItems(Set patternTemplateTestItems) { - this.patternTemplateTestItems = patternTemplateTestItems; - } - - public boolean isHasRetries() { - return hasRetries; - } - - public void setHasRetries(boolean hasRetries) { - this.hasRetries = hasRetries; - } - - public boolean isHasStats() { - return hasStats; - } - - public void setHasStats(boolean hasStats) { - this.hasStats = hasStats; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestItem testItem = (TestItem) o; - return Objects.equals(itemId, testItem.itemId) && Objects.equals(name, testItem.name) && Objects.equals(codeRef, testItem.codeRef) - && type == testItem.type && Objects.equals(uniqueId, testItem.uniqueId) && Objects.equals(testCaseId, testItem.testCaseId) - && Objects.equals(testCaseHash, testItem.testCaseHash) && Objects.equals(path, testItem.path) && Objects.equals(retryOf, - testItem.retryOf - ); - } - - @Override - public int hashCode() { - return Objects.hash(itemId, name, codeRef, type, uniqueId, testCaseId, testCaseHash, path, retryOf); - } + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCodeRef() { + return codeRef; + } + + public void setCodeRef(String codeRef) { + this.codeRef = codeRef; + } + + public TestItemTypeEnum getType() { + return type; + } + + public void setType(TestItemTypeEnum type) { + this.type = type; + } + + public LocalDateTime getStartTime() { + return startTime; + } + + public void setStartTime(LocalDateTime startTime) { + this.startTime = startTime; + } + + public LocalDateTime getLastModified() { + return lastModified; + } + + public void setLastModified(LocalDateTime lastModified) { + this.lastModified = lastModified; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Set getParameters() { + return parameters; + } + + public void setParameters(Set parameters) { + this.parameters = parameters; + } + + public String getUniqueId() { + return uniqueId; + } + + public void setUniqueId(String uniqueId) { + this.uniqueId = uniqueId; + } + + public String getTestCaseId() { + return testCaseId; + } + + public void setTestCaseId(String testCaseId) { + this.testCaseId = testCaseId; + } + + public Integer getTestCaseHash() { + return testCaseHash; + } + + public void setTestCaseHash(Integer testCaseHash) { + this.testCaseHash = testCaseHash; + } + + public Long getLaunchId() { + return launchId; + } + + public void setLaunchId(Long launchId) { + this.launchId = launchId; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public Long getRetryOf() { + return retryOf; + } + + public void setRetryOf(Long retryOf) { + this.retryOf = retryOf; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public TestItemResults getItemResults() { + return itemResults; + } + + public void setItemResults(TestItemResults itemResults) { + this.itemResults = itemResults; + } + + public boolean isHasChildren() { + return hasChildren; + } + + public void setHasChildren(boolean hasChildren) { + this.hasChildren = hasChildren; + } + + public Set getPatternTemplateTestItems() { + return patternTemplateTestItems; + } + + public void setPatternTemplateTestItems(Set patternTemplateTestItems) { + this.patternTemplateTestItems = patternTemplateTestItems; + } + + public boolean isHasRetries() { + return hasRetries; + } + + public void setHasRetries(boolean hasRetries) { + this.hasRetries = hasRetries; + } + + public boolean isHasStats() { + return hasStats; + } + + public void setHasStats(boolean hasStats) { + this.hasStats = hasStats; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestItem testItem = (TestItem) o; + return Objects.equals(itemId, testItem.itemId) && Objects.equals(name, testItem.name) + && Objects.equals(codeRef, testItem.codeRef) + && type == testItem.type && Objects.equals(uniqueId, testItem.uniqueId) && Objects.equals( + testCaseId, testItem.testCaseId) + && Objects.equals(testCaseHash, testItem.testCaseHash) && Objects.equals(path, + testItem.path) && Objects.equals(retryOf, + testItem.retryOf + ); + } + + @Override + public int hashCode() { + return Objects.hash(itemId, name, codeRef, type, uniqueId, testCaseId, testCaseHash, path, + retryOf); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/item/TestItemResults.java b/src/main/java/com/epam/ta/reportportal/entity/item/TestItemResults.java index a414c2a92..3da50a13d 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/item/TestItemResults.java +++ b/src/main/java/com/epam/ta/reportportal/entity/item/TestItemResults.java @@ -21,16 +21,26 @@ import com.epam.ta.reportportal.entity.item.issue.IssueEntity; import com.epam.ta.reportportal.entity.statistics.Statistics; import com.google.common.collect.Sets; -import org.hibernate.annotations.Fetch; -import org.hibernate.annotations.FetchMode; -import org.hibernate.annotations.Type; -import org.hibernate.annotations.TypeDef; - -import javax.persistence.*; import java.io.Serializable; import java.time.LocalDateTime; import java.util.Objects; import java.util.Set; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.MapsId; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.PrimaryKeyJoinColumn; +import javax.persistence.Table; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; /** * @author Pavel Bortnik @@ -40,111 +50,113 @@ @Table(name = "test_item_results", schema = "public") public class TestItemResults implements Serializable { - @Id - @Column(name = "result_id", unique = true, nullable = false, precision = 64) - private Long itemId; - - @Column(name = "status", nullable = false) - @Enumerated(EnumType.STRING) - @Type(type = "pqsql_enum") - private StatusEnum status; - - @Column(name = "end_time") - private LocalDateTime endTime; - - @Column(name = "duration") - private Double duration; - - @PrimaryKeyJoinColumn - @OneToOne(mappedBy = "testItemResults", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE }) - private IssueEntity issue; - - @OneToMany - @JoinColumn(name = "item_id", insertable = false, updatable = false) - @Fetch(FetchMode.SUBSELECT) - private Set statistics = Sets.newHashSet(); - - @OneToOne - @MapsId - @JoinColumn(name = "result_id") - private TestItem testItem; - - public TestItemResults() { - } - - public Long getItemId() { - return itemId; - } - - public void setItemId(Long itemId) { - this.itemId = itemId; - } - - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public LocalDateTime getEndTime() { - return endTime; - } - - public void setEndTime(LocalDateTime endTime) { - this.endTime = endTime; - } - - public Double getDuration() { - return duration; - } - - public void setDuration(Double duration) { - this.duration = duration; - } - - public IssueEntity getIssue() { - return issue; - } - - public void setIssue(IssueEntity issue) { - this.issue = issue; - } - - public Set getStatistics() { - return statistics; - } - - public void setStatistics(Set statistics) { - this.statistics = statistics; - } - - public TestItem getTestItem() { - return testItem; - } - - public void setTestItem(TestItem testItem) { - this.testItem = testItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestItemResults that = (TestItemResults) o; - return Objects.equals(itemId, that.itemId) && status == that.status && Objects.equals(endTime, that.endTime) && Objects.equals( - duration, - that.duration - ); - } - - @Override - public int hashCode() { - return Objects.hash(itemId, status, endTime, duration); - } + @Id + @Column(name = "result_id", unique = true, nullable = false, precision = 64) + private Long itemId; + + @Column(name = "status", nullable = false) + @Enumerated(EnumType.STRING) + @Type(type = "pqsql_enum") + private StatusEnum status; + + @Column(name = "end_time") + private LocalDateTime endTime; + + @Column(name = "duration") + private Double duration; + + @PrimaryKeyJoinColumn + @OneToOne(mappedBy = "testItemResults", cascade = {CascadeType.PERSIST, CascadeType.MERGE, + CascadeType.REMOVE}) + private IssueEntity issue; + + @OneToMany + @JoinColumn(name = "item_id", insertable = false, updatable = false) + @Fetch(FetchMode.SUBSELECT) + private Set statistics = Sets.newHashSet(); + + @OneToOne + @MapsId + @JoinColumn(name = "result_id") + private TestItem testItem; + + public TestItemResults() { + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public LocalDateTime getEndTime() { + return endTime; + } + + public void setEndTime(LocalDateTime endTime) { + this.endTime = endTime; + } + + public Double getDuration() { + return duration; + } + + public void setDuration(Double duration) { + this.duration = duration; + } + + public IssueEntity getIssue() { + return issue; + } + + public void setIssue(IssueEntity issue) { + this.issue = issue; + } + + public Set getStatistics() { + return statistics; + } + + public void setStatistics(Set statistics) { + this.statistics = statistics; + } + + public TestItem getTestItem() { + return testItem; + } + + public void setTestItem(TestItem testItem) { + this.testItem = testItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestItemResults that = (TestItemResults) o; + return Objects.equals(itemId, that.itemId) && status == that.status && Objects.equals(endTime, + that.endTime) && Objects.equals( + duration, + that.duration + ); + } + + @Override + public int hashCode() { + return Objects.hash(itemId, status, endTime, duration); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/item/history/TestItemHistory.java b/src/main/java/com/epam/ta/reportportal/entity/item/history/TestItemHistory.java index 1b20b9b4e..5de2c887f 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/item/history/TestItemHistory.java +++ b/src/main/java/com/epam/ta/reportportal/entity/item/history/TestItemHistory.java @@ -24,31 +24,31 @@ */ public class TestItemHistory implements Serializable { - private String groupingField; + private String groupingField; - private List itemIds; + private List itemIds; - public TestItemHistory() { - } + public TestItemHistory() { + } - public TestItemHistory(String groupingField, List itemIds) { - this.groupingField = groupingField; - this.itemIds = itemIds; - } + public TestItemHistory(String groupingField, List itemIds) { + this.groupingField = groupingField; + this.itemIds = itemIds; + } - public String getGroupingField() { - return groupingField; - } + public String getGroupingField() { + return groupingField; + } - public void setGroupingField(String groupingField) { - this.groupingField = groupingField; - } + public void setGroupingField(String groupingField) { + this.groupingField = groupingField; + } - public List getItemIds() { - return itemIds; - } + public List getItemIds() { + return itemIds; + } - public void setItemIds(List itemIds) { - this.itemIds = itemIds; - } + public void setItemIds(List itemIds) { + this.itemIds = itemIds; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueEntity.java b/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueEntity.java index 96429f9ec..a7478d2b4 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueEntity.java +++ b/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueEntity.java @@ -19,134 +19,150 @@ import com.epam.ta.reportportal.entity.bts.Ticket; import com.epam.ta.reportportal.entity.item.TestItemResults; import com.google.common.collect.Sets; -import org.hibernate.annotations.Fetch; -import org.hibernate.annotations.FetchMode; - -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; import java.util.Set; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.Index; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; +import javax.persistence.MapsId; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; /** * @author Pavel Bortnik */ @Entity -@Table(name = "issue", schema = "public", indexes = { @Index(name = "issue_pk", unique = true, columnList = "issue_id ASC") }) +@Table(name = "issue", schema = "public", indexes = { + @Index(name = "issue_pk", unique = true, columnList = "issue_id ASC")}) public class IssueEntity implements Serializable { - @Id - @Column(name = "issue_id", unique = true, nullable = false, precision = 64) - private Long issueId; - - @ManyToOne - @JoinColumn(name = "issue_type") - private IssueType issueType; - - @Column(name = "issue_description") - private String issueDescription; - - @Column(name = "auto_analyzed") - private boolean autoAnalyzed; - - @Column(name = "ignore_analyzer") - private boolean ignoreAnalyzer; - - @OneToOne - @MapsId - @JoinColumn(name = "issue_id") - private TestItemResults testItemResults; - - @ManyToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH }, fetch = FetchType.EAGER) - @JoinTable(name = "issue_ticket", joinColumns = @JoinColumn(name = "issue_id"), inverseJoinColumns = @JoinColumn(name = "ticket_id")) - @Fetch(FetchMode.SUBSELECT) - private Set tickets = Sets.newHashSet(); - - public IssueEntity() { - } - - public Long getIssueId() { - return issueId; - } - - public void setIssueId(Long issueId) { - this.issueId = issueId; - } - - public IssueType getIssueType() { - return issueType; - } - - public void setIssueType(IssueType issueType) { - this.issueType = issueType; - } - - public String getIssueDescription() { - return issueDescription; - } - - public void setIssueDescription(String issueDescription) { - this.issueDescription = issueDescription; - } - - public Set getTickets() { - return tickets; - } - - public void setTickets(Set tickets) { - this.tickets = tickets; - } - - public Boolean getAutoAnalyzed() { - return autoAnalyzed; - } - - public void setAutoAnalyzed(Boolean autoAnalyzed) { - this.autoAnalyzed = autoAnalyzed; - } - - public Boolean getIgnoreAnalyzer() { - return ignoreAnalyzer; - } - - public void setIgnoreAnalyzer(Boolean ignoreAnalyzer) { - this.ignoreAnalyzer = ignoreAnalyzer; - } - - public TestItemResults getTestItemResults() { - return testItemResults; - } - - public void setTestItemResults(TestItemResults testItemResults) { - this.testItemResults = testItemResults; - } - - public void removeTicket(Ticket ticket) { - tickets.remove(ticket); - ticket.getIssues().remove(this); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IssueEntity that = (IssueEntity) o; - return Objects.equals(issueId, that.issueId) && Objects.equals(issueType, that.issueType) && Objects.equals(issueDescription, - that.issueDescription - ) && Objects.equals(autoAnalyzed, that.autoAnalyzed) && Objects.equals(ignoreAnalyzer, that.ignoreAnalyzer); - } - - @Override - public int hashCode() { - return Objects.hash(issueId, issueType, issueDescription, autoAnalyzed, ignoreAnalyzer); - } - - @Override - public String toString() { - return "IssueEntity{" + "issueId=" + issueId + ", issueType=" + issueType + ", issueDescription='" + issueDescription + '\'' - + ", autoAnalyzed=" + autoAnalyzed + ", ignoreAnalyzer=" + ignoreAnalyzer; - } + @Id + @Column(name = "issue_id", unique = true, nullable = false, precision = 64) + private Long issueId; + + @ManyToOne + @JoinColumn(name = "issue_type") + private IssueType issueType; + + @Column(name = "issue_description") + private String issueDescription; + + @Column(name = "auto_analyzed") + private boolean autoAnalyzed; + + @Column(name = "ignore_analyzer") + private boolean ignoreAnalyzer; + + @OneToOne + @MapsId + @JoinColumn(name = "issue_id") + private TestItemResults testItemResults; + + @ManyToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, + CascadeType.REFRESH}, fetch = FetchType.EAGER) + @JoinTable(name = "issue_ticket", joinColumns = @JoinColumn(name = "issue_id"), inverseJoinColumns = @JoinColumn(name = "ticket_id")) + @Fetch(FetchMode.SUBSELECT) + private Set tickets = Sets.newHashSet(); + + public IssueEntity() { + } + + public Long getIssueId() { + return issueId; + } + + public void setIssueId(Long issueId) { + this.issueId = issueId; + } + + public IssueType getIssueType() { + return issueType; + } + + public void setIssueType(IssueType issueType) { + this.issueType = issueType; + } + + public String getIssueDescription() { + return issueDescription; + } + + public void setIssueDescription(String issueDescription) { + this.issueDescription = issueDescription; + } + + public Set getTickets() { + return tickets; + } + + public void setTickets(Set tickets) { + this.tickets = tickets; + } + + public Boolean getAutoAnalyzed() { + return autoAnalyzed; + } + + public void setAutoAnalyzed(Boolean autoAnalyzed) { + this.autoAnalyzed = autoAnalyzed; + } + + public Boolean getIgnoreAnalyzer() { + return ignoreAnalyzer; + } + + public void setIgnoreAnalyzer(Boolean ignoreAnalyzer) { + this.ignoreAnalyzer = ignoreAnalyzer; + } + + public TestItemResults getTestItemResults() { + return testItemResults; + } + + public void setTestItemResults(TestItemResults testItemResults) { + this.testItemResults = testItemResults; + } + + public void removeTicket(Ticket ticket) { + tickets.remove(ticket); + ticket.getIssues().remove(this); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueEntity that = (IssueEntity) o; + return Objects.equals(issueId, that.issueId) && Objects.equals(issueType, that.issueType) + && Objects.equals(issueDescription, + that.issueDescription + ) && Objects.equals(autoAnalyzed, that.autoAnalyzed) && Objects.equals(ignoreAnalyzer, + that.ignoreAnalyzer); + } + + @Override + public int hashCode() { + return Objects.hash(issueId, issueType, issueDescription, autoAnalyzed, ignoreAnalyzer); + } + + @Override + public String toString() { + return "IssueEntity{" + "issueId=" + issueId + ", issueType=" + issueType + + ", issueDescription='" + issueDescription + '\'' + + ", autoAnalyzed=" + autoAnalyzed + ", ignoreAnalyzer=" + ignoreAnalyzer; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueEntityPojo.java b/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueEntityPojo.java index 3646a509b..f29f7340b 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueEntityPojo.java +++ b/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueEntityPojo.java @@ -23,60 +23,61 @@ */ public class IssueEntityPojo implements Serializable { - private Long itemId; - private Long issueTypeId; - private String description; - private boolean autoAnalyzed; - private boolean ignoreAnalyzer; - - public IssueEntityPojo() { - } - - public IssueEntityPojo(Long itemId, Long issueTypeId, String description, boolean autoAnalyzed, boolean ignoreAnalyzer) { - this.itemId = itemId; - this.issueTypeId = issueTypeId; - this.description = description; - this.autoAnalyzed = autoAnalyzed; - this.ignoreAnalyzer = ignoreAnalyzer; - } - - public Long getItemId() { - return itemId; - } - - public void setItemId(Long itemId) { - this.itemId = itemId; - } - - public Long getIssueTypeId() { - return issueTypeId; - } - - public void setIssueTypeId(Long issueTypeId) { - this.issueTypeId = issueTypeId; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public boolean isAutoAnalyzed() { - return autoAnalyzed; - } - - public void setAutoAnalyzed(boolean autoAnalyzed) { - this.autoAnalyzed = autoAnalyzed; - } - - public boolean isIgnoreAnalyzer() { - return ignoreAnalyzer; - } - - public void setIgnoreAnalyzer(boolean ignoreAnalyzer) { - this.ignoreAnalyzer = ignoreAnalyzer; - } + private Long itemId; + private Long issueTypeId; + private String description; + private boolean autoAnalyzed; + private boolean ignoreAnalyzer; + + public IssueEntityPojo() { + } + + public IssueEntityPojo(Long itemId, Long issueTypeId, String description, boolean autoAnalyzed, + boolean ignoreAnalyzer) { + this.itemId = itemId; + this.issueTypeId = issueTypeId; + this.description = description; + this.autoAnalyzed = autoAnalyzed; + this.ignoreAnalyzer = ignoreAnalyzer; + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public Long getIssueTypeId() { + return issueTypeId; + } + + public void setIssueTypeId(Long issueTypeId) { + this.issueTypeId = issueTypeId; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public boolean isAutoAnalyzed() { + return autoAnalyzed; + } + + public void setAutoAnalyzed(boolean autoAnalyzed) { + this.autoAnalyzed = autoAnalyzed; + } + + public boolean isIgnoreAnalyzer() { + return ignoreAnalyzer; + } + + public void setIgnoreAnalyzer(boolean ignoreAnalyzer) { + this.ignoreAnalyzer = ignoreAnalyzer; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueGroup.java b/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueGroup.java index e9b06c16a..5d6f994c8 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueGroup.java +++ b/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueGroup.java @@ -17,11 +17,17 @@ package com.epam.ta.reportportal.entity.item.issue; import com.epam.ta.reportportal.entity.enums.TestItemIssueGroup; -import org.hibernate.annotations.Type; - -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import org.hibernate.annotations.Type; /** * @author Pavel Bortnik @@ -30,54 +36,54 @@ @Table(name = "issue_group", schema = "public") public class IssueGroup implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "issue_group_id") - private Integer id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "issue_group_id") + private Integer id; - @Column(name = "issue_group") - @Enumerated(EnumType.STRING) - @Type(type = "pqsql_enum") - private TestItemIssueGroup testItemIssueGroup; + @Column(name = "issue_group") + @Enumerated(EnumType.STRING) + @Type(type = "pqsql_enum") + private TestItemIssueGroup testItemIssueGroup; - public IssueGroup() { - } + public IssueGroup() { + } - public IssueGroup(TestItemIssueGroup testItemIssueGroup) { - this.testItemIssueGroup = testItemIssueGroup; - } + public IssueGroup(TestItemIssueGroup testItemIssueGroup) { + this.testItemIssueGroup = testItemIssueGroup; + } - public Integer getId() { - return id; - } + public Integer getId() { + return id; + } - public void setId(Integer id) { - this.id = id; - } + public void setId(Integer id) { + this.id = id; + } - public TestItemIssueGroup getTestItemIssueGroup() { - return testItemIssueGroup; - } + public TestItemIssueGroup getTestItemIssueGroup() { + return testItemIssueGroup; + } - public void setTestItemIssueGroup(TestItemIssueGroup testItemIssueGroup) { - this.testItemIssueGroup = testItemIssueGroup; - } + public void setTestItemIssueGroup(TestItemIssueGroup testItemIssueGroup) { + this.testItemIssueGroup = testItemIssueGroup; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IssueGroup that = (IssueGroup) o; - return testItemIssueGroup == that.testItemIssueGroup; - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueGroup that = (IssueGroup) o; + return testItemIssueGroup == that.testItemIssueGroup; + } - @Override - public int hashCode() { + @Override + public int hashCode() { - return Objects.hash(testItemIssueGroup); - } + return Objects.hash(testItemIssueGroup); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueType.java b/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueType.java index 9b1e6ea40..83f3777a8 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueType.java +++ b/src/main/java/com/epam/ta/reportportal/entity/item/issue/IssueType.java @@ -17,119 +17,131 @@ package com.epam.ta.reportportal.entity.item.issue; import com.epam.ta.reportportal.entity.enums.PostgreSQLEnumType; -import org.hibernate.annotations.TypeDef; - -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Index; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import org.hibernate.annotations.TypeDef; /** * @author Pavel Bortnik */ @Entity @TypeDef(name = "pqsql_enum", typeClass = PostgreSQLEnumType.class) -@Table(name = "issue_type", schema = "public", indexes = { @Index(name = "issue_type_pk", unique = true, columnList = "id ASC") }) +@Table(name = "issue_type", schema = "public", indexes = { + @Index(name = "issue_type_pk", unique = true, columnList = "id ASC")}) public class IssueType implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id", unique = true, nullable = false) - private Long id; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) - @JoinColumn(name = "issue_group_id") - private IssueGroup issueGroup; - - @Column(name = "locator", length = 64) - private String locator; - - @Column(name = "issue_name", length = 256) - private String longName; - - @Column(name = "abbreviation", length = 64) - private String shortName; - - @Column(name = "hex_color", length = 7) - private String hexColor; - - public IssueType() { - } - - public IssueType(IssueGroup issueGroup, String locator, String longName, String shortName, String hexColor) { - this.issueGroup = issueGroup; - this.locator = locator; - this.longName = longName; - this.shortName = shortName; - this.hexColor = hexColor; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public IssueGroup getIssueGroup() { - return issueGroup; - } - - public void setIssueGroup(IssueGroup issueGroup) { - this.issueGroup = issueGroup; - } - - public String getLocator() { - return locator; - } - - public void setLocator(String locator) { - this.locator = locator; - } - - public String getLongName() { - return longName; - } - - public void setLongName(String longName) { - this.longName = longName; - } - - public String getShortName() { - return shortName; - } - - public void setShortName(String shortName) { - this.shortName = shortName; - } - - public String getHexColor() { - return hexColor; - } - - public void setHexColor(String hexColor) { - this.hexColor = hexColor; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IssueType issueType = (IssueType) o; - return Objects.equals(id, issueType.id) && Objects.equals(issueGroup, issueType.issueGroup) && Objects.equals(locator, - issueType.locator - ) && Objects.equals(longName, issueType.longName) && Objects.equals( - shortName, - issueType.shortName - ) && Objects.equals(hexColor, issueType.hexColor); - } - - @Override - public int hashCode() { - return Objects.hash(id, issueGroup, locator, longName, shortName, hexColor); - } + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", unique = true, nullable = false) + private Long id; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @JoinColumn(name = "issue_group_id") + private IssueGroup issueGroup; + + @Column(name = "locator", length = 64) + private String locator; + + @Column(name = "issue_name", length = 256) + private String longName; + + @Column(name = "abbreviation", length = 64) + private String shortName; + + @Column(name = "hex_color", length = 7) + private String hexColor; + + public IssueType() { + } + + public IssueType(IssueGroup issueGroup, String locator, String longName, String shortName, + String hexColor) { + this.issueGroup = issueGroup; + this.locator = locator; + this.longName = longName; + this.shortName = shortName; + this.hexColor = hexColor; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public IssueGroup getIssueGroup() { + return issueGroup; + } + + public void setIssueGroup(IssueGroup issueGroup) { + this.issueGroup = issueGroup; + } + + public String getLocator() { + return locator; + } + + public void setLocator(String locator) { + this.locator = locator; + } + + public String getLongName() { + return longName; + } + + public void setLongName(String longName) { + this.longName = longName; + } + + public String getShortName() { + return shortName; + } + + public void setShortName(String shortName) { + this.shortName = shortName; + } + + public String getHexColor() { + return hexColor; + } + + public void setHexColor(String hexColor) { + this.hexColor = hexColor; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IssueType issueType = (IssueType) o; + return Objects.equals(id, issueType.id) && Objects.equals(issueGroup, issueType.issueGroup) + && Objects.equals(locator, + issueType.locator + ) && Objects.equals(longName, issueType.longName) && Objects.equals( + shortName, + issueType.shortName + ) && Objects.equals(hexColor, issueType.hexColor); + } + + @Override + public int hashCode() { + return Objects.hash(id, issueGroup, locator, longName, shortName, hexColor); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/jasper/ReportFormat.java b/src/main/java/com/epam/ta/reportportal/entity/jasper/ReportFormat.java index b49cbc80b..b30b4e69e 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/jasper/ReportFormat.java +++ b/src/main/java/com/epam/ta/reportportal/entity/jasper/ReportFormat.java @@ -16,7 +16,6 @@ package com.epam.ta.reportportal.entity.jasper; import com.google.common.net.MediaType; - import java.util.Arrays; import java.util.Optional; @@ -24,34 +23,33 @@ * Supported Jasper Report formats * * @author Andrei_Ramanchuk - * @author Andrei Varabyeu - * Make content type part of ReportFormat enum + * @author Andrei Varabyeu Make content type part of ReportFormat enum */ public enum ReportFormat { - //@formatter:off - XLS("xls", MediaType.MICROSOFT_EXCEL.withoutParameters().toString()), - HTML("html", MediaType.HTML_UTF_8.withoutParameters().toString()), - PDF("pdf", MediaType.PDF.withoutParameters().toString()), - CSV("csv", MediaType.CSV_UTF_8.withoutParameters().toString()); - //@formatter:on - - private String value; - private String contentType; - - ReportFormat(String value, String contentType) { - this.value = value; - this.contentType = contentType; - } - - public String getValue() { - return value; - } - - public String getContentType() { - return contentType; - } - - public static Optional findByName(String name) { - return Arrays.stream(values()).filter(format -> format.name().equalsIgnoreCase(name)).findAny(); - } + //@formatter:off + XLS("xls", MediaType.MICROSOFT_EXCEL.withoutParameters().toString()), + HTML("html", MediaType.HTML_UTF_8.withoutParameters().toString()), + PDF("pdf", MediaType.PDF.withoutParameters().toString()), + CSV("csv", MediaType.CSV_UTF_8.withoutParameters().toString()); + //@formatter:on + + private String value; + private String contentType; + + ReportFormat(String value, String contentType) { + this.value = value; + this.contentType = contentType; + } + + public static Optional findByName(String name) { + return Arrays.stream(values()).filter(format -> format.name().equalsIgnoreCase(name)).findAny(); + } + + public String getValue() { + return value; + } + + public String getContentType() { + return contentType; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/jasper/ReportType.java b/src/main/java/com/epam/ta/reportportal/entity/jasper/ReportType.java index e7115879d..40025aabd 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/jasper/ReportType.java +++ b/src/main/java/com/epam/ta/reportportal/entity/jasper/ReportType.java @@ -20,7 +20,7 @@ * @author Ivan Budayeu */ public enum ReportType { - PROJECT, - LAUNCH, - USER + PROJECT, + LAUNCH, + USER } diff --git a/src/main/java/com/epam/ta/reportportal/entity/launch/Launch.java b/src/main/java/com/epam/ta/reportportal/entity/launch/Launch.java index a439ddc93..5aa93e04d 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/launch/Launch.java +++ b/src/main/java/com/epam/ta/reportportal/entity/launch/Launch.java @@ -23,6 +23,25 @@ import com.epam.ta.reportportal.entity.log.Log; import com.epam.ta.reportportal.entity.statistics.Statistics; import com.google.common.collect.Sets; +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Objects; +import java.util.Set; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EntityListeners; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Index; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.UniqueConstraint; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.Type; @@ -30,12 +49,6 @@ import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; -import javax.persistence.*; -import java.io.Serializable; -import java.time.LocalDateTime; -import java.util.Objects; -import java.util.Set; - /** * @author Pavel Bortnik */ @@ -44,270 +57,274 @@ @EntityListeners(AuditingEntityListener.class) @TypeDef(name = "pqsql_enum", typeClass = PostgreSQLEnumType.class) @Table(name = "launch", schema = "public", uniqueConstraints = { - @UniqueConstraint(columnNames = { "name", "number", "project_id" }) }, indexes = { - @Index(name = "launch_pk", unique = true, columnList = "id ASC"), - @Index(name = "unq_name_number", unique = true, columnList = "name ASC, number ASC, project_id ASC") }) + @UniqueConstraint(columnNames = {"name", "number", "project_id"})}, indexes = { + @Index(name = "launch_pk", unique = true, columnList = "id ASC"), + @Index(name = "unq_name_number", unique = true, columnList = "name ASC, number ASC, project_id ASC")}) public class Launch implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id", unique = true, nullable = false, precision = 64) - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", unique = true, nullable = false, precision = 64) + private Long id; - @Column(name = "uuid", unique = true, nullable = false) - private String uuid; + @Column(name = "uuid", unique = true, nullable = false) + private String uuid; - @Column(name = "project_id", nullable = false, precision = 32) - private Long projectId; + @Column(name = "project_id", nullable = false, precision = 32) + private Long projectId; - @Column(name = "user_id", nullable = false) - private Long userId; + @Column(name = "user_id", nullable = false) + private Long userId; - @Column(name = "name", nullable = false, length = 256) - private String name; + @Column(name = "name", nullable = false, length = 256) + private String name; - @Column(name = "description") - private String description; + @Column(name = "description") + private String description; - @Column(name = "start_time", nullable = false) - private LocalDateTime startTime; + @Column(name = "start_time", nullable = false) + private LocalDateTime startTime; - @Column(name = "end_time") - private LocalDateTime endTime; + @Column(name = "end_time") + private LocalDateTime endTime; - @Column(name = "number", nullable = false, precision = 32) - private Long number; + @Column(name = "number", nullable = false, precision = 32) + private Long number; - @Column(name = "has_retries") - private boolean hasRetries; + @Column(name = "has_retries") + private boolean hasRetries; - @Column(name = "rerun") - private boolean rerun; + @Column(name = "rerun") + private boolean rerun; - @Column(name = "last_modified", nullable = false) - @LastModifiedDate - private LocalDateTime lastModified; + @Column(name = "last_modified", nullable = false) + @LastModifiedDate + private LocalDateTime lastModified; - @Column(name = "mode", nullable = false) - @Enumerated(EnumType.STRING) - @Type(type = "pqsql_enum") - private LaunchModeEnum mode; + @Column(name = "mode", nullable = false) + @Enumerated(EnumType.STRING) + @Type(type = "pqsql_enum") + private LaunchModeEnum mode; - @Column(name = "status", nullable = false) - @Enumerated(EnumType.STRING) - @Type(type = "pqsql_enum") - private StatusEnum status; + @Column(name = "status", nullable = false) + @Enumerated(EnumType.STRING) + @Type(type = "pqsql_enum") + private StatusEnum status; - @OneToMany(mappedBy = "launch", cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true) - @Fetch(FetchMode.JOIN) - private Set attributes = Sets.newHashSet(); + @OneToMany(mappedBy = "launch", cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true) + @Fetch(FetchMode.JOIN) + private Set attributes = Sets.newHashSet(); - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) - @Fetch(FetchMode.JOIN) - @JoinColumn(name = "launch_id", insertable = false, updatable = false) - private Set statistics = Sets.newHashSet(); + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @Fetch(FetchMode.JOIN) + @JoinColumn(name = "launch_id", insertable = false, updatable = false) + private Set statistics = Sets.newHashSet(); - @OneToMany(mappedBy = "launch", fetch = FetchType.LAZY, orphanRemoval = true) - private Set logs = Sets.newHashSet(); + @OneToMany(mappedBy = "launch", fetch = FetchType.LAZY, orphanRemoval = true) + private Set logs = Sets.newHashSet(); - @Column(name = "approximate_duration") - private double approximateDuration; + @Column(name = "approximate_duration") + private double approximateDuration; - public Set getAttributes() { - return attributes; - } + public Launch() { + } - public void setAttributes(Set tags) { - this.attributes.clear(); - this.attributes.addAll(tags); - } + public Launch(Long id) { + this.id = id; + } - public Launch() { - } + public Set getAttributes() { + return attributes; + } - public Launch(Long id) { - this.id = id; - } + public void setAttributes(Set tags) { + this.attributes.clear(); + this.attributes.addAll(tags); + } - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public String getUuid() { - return uuid; - } + public String getUuid() { + return uuid; + } - public void setUuid(String uuid) { - this.uuid = uuid; - } + public void setUuid(String uuid) { + this.uuid = uuid; + } - public Long getProjectId() { - return projectId; - } + public Long getProjectId() { + return projectId; + } - public void setProjectId(Long projectId) { - this.projectId = projectId; - } + public void setProjectId(Long projectId) { + this.projectId = projectId; + } - public Long getUserId() { - return userId; - } + public Long getUserId() { + return userId; + } - public void setUserId(Long userId) { - this.userId = userId; - } + public void setUserId(Long userId) { + this.userId = userId; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public boolean isRerun() { - return rerun; - } + public void setName(String name) { + this.name = name; + } - public void setRerun(boolean rerun) { - this.rerun = rerun; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public LocalDateTime getStartTime() { - return startTime; - } - - public void setStartTime(LocalDateTime startTime) { - this.startTime = startTime; - } - - public Set getStatistics() { - return statistics; - } - - public void setStatistics(Set statistics) { - this.statistics = statistics; - } - - public LocalDateTime getEndTime() { - return endTime; - } - - public void setEndTime(LocalDateTime endTime) { - this.endTime = endTime; - } - - public Long getNumber() { - return number; - } - - public void setNumber(Long number) { - this.number = number; - } - - public boolean isHasRetries() { - return hasRetries; - } - - public void setHasRetries(boolean hasRetries) { - this.hasRetries = hasRetries; - } - - public LocalDateTime getLastModified() { - return lastModified; - } - - public void setLastModified(LocalDateTime lastModified) { - this.lastModified = lastModified; - } - - public LaunchModeEnum getMode() { - return mode; - } - - public void setMode(LaunchModeEnum mode) { - this.mode = mode; - } - - public StatusEnum getStatus() { - return status; - } - - public Set getLogs() { - return logs; - } - - public void setLogs(Set logs) { - this.logs = logs; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public double getApproximateDuration() { - return approximateDuration; - } - - public void setApproximateDuration(double approximateDuration) { - this.approximateDuration = approximateDuration; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Launch launch = (Launch) o; - return hasRetries == launch.hasRetries && rerun == launch.rerun && Objects.equals(uuid, launch.uuid) && Objects.equals(projectId, - launch.projectId - ) && Objects.equals(name, launch.name) && Objects.equals(description, launch.description) && Objects.equals(startTime, - launch.startTime - ) && Objects.equals(endTime, launch.endTime) && Objects.equals(number, launch.number) && mode == launch.mode - && status == launch.status; - } - - @Override - public int hashCode() { - return Objects.hash(uuid, projectId, name, description, startTime, endTime, number, hasRetries, rerun, mode, status); - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("Launch{"); - sb.append("id=").append(id); - sb.append(", uuid='").append(uuid).append('\''); - sb.append(", projectId=").append(projectId); - sb.append(", userId=").append(userId); - sb.append(", name='").append(name).append('\''); - sb.append(", description='").append(description).append('\''); - sb.append(", startTime=").append(startTime); - sb.append(", endTime=").append(endTime); - sb.append(", number=").append(number); - sb.append(", hasRetries=").append(hasRetries); - sb.append(", rerun=").append(rerun); - sb.append(", lastModified=").append(lastModified); - sb.append(", mode=").append(mode); - sb.append(", status=").append(status); - sb.append(", attributes=").append(attributes); - sb.append(", statistics=").append(statistics); - sb.append(", approximateDuration=").append(approximateDuration); - sb.append('}'); - return sb.toString(); - } + public boolean isRerun() { + return rerun; + } + + public void setRerun(boolean rerun) { + this.rerun = rerun; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public LocalDateTime getStartTime() { + return startTime; + } + + public void setStartTime(LocalDateTime startTime) { + this.startTime = startTime; + } + + public Set getStatistics() { + return statistics; + } + + public void setStatistics(Set statistics) { + this.statistics = statistics; + } + + public LocalDateTime getEndTime() { + return endTime; + } + + public void setEndTime(LocalDateTime endTime) { + this.endTime = endTime; + } + + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + public boolean isHasRetries() { + return hasRetries; + } + + public void setHasRetries(boolean hasRetries) { + this.hasRetries = hasRetries; + } + + public LocalDateTime getLastModified() { + return lastModified; + } + + public void setLastModified(LocalDateTime lastModified) { + this.lastModified = lastModified; + } + + public LaunchModeEnum getMode() { + return mode; + } + + public void setMode(LaunchModeEnum mode) { + this.mode = mode; + } + + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Set getLogs() { + return logs; + } + + public void setLogs(Set logs) { + this.logs = logs; + } + + public double getApproximateDuration() { + return approximateDuration; + } + + public void setApproximateDuration(double approximateDuration) { + this.approximateDuration = approximateDuration; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Launch launch = (Launch) o; + return hasRetries == launch.hasRetries && rerun == launch.rerun && Objects.equals(uuid, + launch.uuid) && Objects.equals(projectId, + launch.projectId + ) && Objects.equals(name, launch.name) && Objects.equals(description, launch.description) + && Objects.equals(startTime, + launch.startTime + ) && Objects.equals(endTime, launch.endTime) && Objects.equals(number, launch.number) + && mode == launch.mode + && status == launch.status; + } + + @Override + public int hashCode() { + return Objects.hash(uuid, projectId, name, description, startTime, endTime, number, hasRetries, + rerun, mode, status); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("Launch{"); + sb.append("id=").append(id); + sb.append(", uuid='").append(uuid).append('\''); + sb.append(", projectId=").append(projectId); + sb.append(", userId=").append(userId); + sb.append(", name='").append(name).append('\''); + sb.append(", description='").append(description).append('\''); + sb.append(", startTime=").append(startTime); + sb.append(", endTime=").append(endTime); + sb.append(", number=").append(number); + sb.append(", hasRetries=").append(hasRetries); + sb.append(", rerun=").append(rerun); + sb.append(", lastModified=").append(lastModified); + sb.append(", mode=").append(mode); + sb.append(", status=").append(status); + sb.append(", attributes=").append(attributes); + sb.append(", statistics=").append(statistics); + sb.append(", approximateDuration=").append(approximateDuration); + sb.append('}'); + return sb.toString(); + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/log/Log.java b/src/main/java/com/epam/ta/reportportal/entity/log/Log.java index 33a1b264a..d52e4cb2f 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/log/Log.java +++ b/src/main/java/com/epam/ta/reportportal/entity/log/Log.java @@ -19,13 +19,23 @@ import com.epam.ta.reportportal.entity.attachment.Attachment; import com.epam.ta.reportportal.entity.item.TestItem; import com.epam.ta.reportportal.entity.launch.Launch; -import org.springframework.data.annotation.LastModifiedDate; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -import javax.persistence.*; import java.io.Serializable; import java.time.LocalDateTime; import java.util.Objects; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EntityListeners; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Index; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import org.springframework.data.annotation.LastModifiedDate; +import org.springframework.data.jpa.domain.support.AuditingEntityListener; /** * @author Pavel Bortnik @@ -33,167 +43,173 @@ @Entity @EntityListeners(AuditingEntityListener.class) -@Table(name = "log", schema = "public", indexes = { @Index(name = "log_pk", unique = true, columnList = "id ASC") }) +@Table(name = "log", schema = "public", indexes = { + @Index(name = "log_pk", unique = true, columnList = "id ASC")}) public class Log implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id", unique = true, nullable = false, precision = 64) - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", unique = true, nullable = false, precision = 64) + private Long id; - @Column(name = "uuid") - private String uuid; + @Column(name = "uuid") + private String uuid; - @Column(name = "log_time", nullable = false) - private LocalDateTime logTime; + @Column(name = "log_time", nullable = false) + private LocalDateTime logTime; - @Column(name = "log_message", nullable = false) - private String logMessage; + @Column(name = "log_message", nullable = false) + private String logMessage; - @LastModifiedDate - @Column(name = "last_modified", nullable = false) - private LocalDateTime lastModified; + @LastModifiedDate + @Column(name = "last_modified", nullable = false) + private LocalDateTime lastModified; - @Column(name = "log_level", nullable = false, precision = 32) - private Integer logLevel; + @Column(name = "log_level", nullable = false, precision = 32) + private Integer logLevel; - @ManyToOne - @JoinColumn(name = "item_id") - private TestItem testItem; + @ManyToOne + @JoinColumn(name = "item_id") + private TestItem testItem; - @ManyToOne - @JoinColumn(name = "launch_id") - private Launch launch; + @ManyToOne + @JoinColumn(name = "launch_id") + private Launch launch; - @Column(name = "project_id") - private Long projectId; + @Column(name = "project_id") + private Long projectId; - @Column(name = "cluster_id") - private Long clusterId; + @Column(name = "cluster_id") + private Long clusterId; - @OneToOne(cascade = CascadeType.PERSIST) - @JoinColumn(name = "attachment_id") - private Attachment attachment; + @OneToOne(cascade = CascadeType.PERSIST) + @JoinColumn(name = "attachment_id") + private Attachment attachment; - public Log(Long id, LocalDateTime logTime, String logMessage, LocalDateTime lastModified, Integer logLevel, TestItem testItem, - Attachment attachment) { - this.id = id; - this.logTime = logTime; - this.logMessage = logMessage; - this.lastModified = lastModified; - this.logLevel = logLevel; - this.testItem = testItem; - this.attachment = attachment; - } - - public Log() { - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUuid() { - return uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - public TestItem getTestItem() { - return testItem; - } - - public Launch getLaunch() { - return launch; - } - - public void setLaunch(Launch launch) { - this.launch = launch; - } - - public void setTestItem(TestItem testItem) { - this.testItem = testItem; - } - - public LocalDateTime getLogTime() { - return logTime; - } - - public void setLogTime(LocalDateTime logTime) { - this.logTime = logTime; - } - - public LocalDateTime getLastModified() { - return lastModified; - } - - public void setLastModified(LocalDateTime lastModified) { - this.lastModified = lastModified; - } - - public String getLogMessage() { - return logMessage; - } - - public void setLogMessage(String logMessage) { - this.logMessage = logMessage; - } - - public Integer getLogLevel() { - return logLevel; - } - - public void setLogLevel(Integer logLevel) { - this.logLevel = logLevel; - } - - public Attachment getAttachment() { - return attachment; - } - - public void setAttachment(Attachment attachment) { - this.attachment = attachment; - } - - public Long getProjectId() { - return projectId; - } - - public void setProjectId(Long projectId) { - this.projectId = projectId; - } - - public Long getClusterId() { - return clusterId; - } - - public void setClusterId(Long clusterId) { - this.clusterId = clusterId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Log log = (Log) o; - return Objects.equals(id, log.id) && Objects.equals(logTime, log.logTime) && Objects.equals(logMessage, log.logMessage) - && Objects.equals(lastModified, log.lastModified) && Objects.equals(logLevel, log.logLevel) && Objects.equals(testItem, - log.testItem - ) && Objects.equals(launch, log.launch) && Objects.equals(projectId, log.projectId) && Objects.equals(clusterId, log.clusterId); - } - - @Override - public int hashCode() { - return Objects.hash(id, logTime, logMessage, lastModified, logLevel, testItem, launch, projectId, clusterId); - } + public Log(Long id, LocalDateTime logTime, String logMessage, LocalDateTime lastModified, + Integer logLevel, TestItem testItem, + Attachment attachment) { + this.id = id; + this.logTime = logTime; + this.logMessage = logMessage; + this.lastModified = lastModified; + this.logLevel = logLevel; + this.testItem = testItem; + this.attachment = attachment; + } + + public Log() { + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public TestItem getTestItem() { + return testItem; + } + + public void setTestItem(TestItem testItem) { + this.testItem = testItem; + } + + public Launch getLaunch() { + return launch; + } + + public void setLaunch(Launch launch) { + this.launch = launch; + } + + public LocalDateTime getLogTime() { + return logTime; + } + + public void setLogTime(LocalDateTime logTime) { + this.logTime = logTime; + } + + public LocalDateTime getLastModified() { + return lastModified; + } + + public void setLastModified(LocalDateTime lastModified) { + this.lastModified = lastModified; + } + + public String getLogMessage() { + return logMessage; + } + + public void setLogMessage(String logMessage) { + this.logMessage = logMessage; + } + + public Integer getLogLevel() { + return logLevel; + } + + public void setLogLevel(Integer logLevel) { + this.logLevel = logLevel; + } + + public Attachment getAttachment() { + return attachment; + } + + public void setAttachment(Attachment attachment) { + this.attachment = attachment; + } + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + public Long getClusterId() { + return clusterId; + } + + public void setClusterId(Long clusterId) { + this.clusterId = clusterId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Log log = (Log) o; + return Objects.equals(id, log.id) && Objects.equals(logTime, log.logTime) && Objects.equals( + logMessage, log.logMessage) + && Objects.equals(lastModified, log.lastModified) && Objects.equals(logLevel, log.logLevel) + && Objects.equals(testItem, + log.testItem + ) && Objects.equals(launch, log.launch) && Objects.equals(projectId, log.projectId) + && Objects.equals(clusterId, log.clusterId); + } + + @Override + public int hashCode() { + return Objects.hash(id, logTime, logMessage, lastModified, logLevel, testItem, launch, + projectId, clusterId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/log/LogFull.java b/src/main/java/com/epam/ta/reportportal/entity/log/LogFull.java index 19b51c036..b5f799fa0 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/log/LogFull.java +++ b/src/main/java/com/epam/ta/reportportal/entity/log/LogFull.java @@ -19,145 +19,149 @@ import com.epam.ta.reportportal.entity.attachment.Attachment; import com.epam.ta.reportportal.entity.item.TestItem; import com.epam.ta.reportportal.entity.launch.Launch; - import java.io.Serializable; import java.time.LocalDateTime; import java.util.Objects; public class LogFull implements Serializable { - private Long id; - private String uuid; - private LocalDateTime logTime; - private String logMessage; - private LocalDateTime lastModified; - private Integer logLevel; - private TestItem testItem; - private Launch launch; - private Long projectId; - private Long clusterId; - - private Attachment attachment; - - public LogFull(Long id, LocalDateTime logTime, String logMessage, LocalDateTime lastModified, Integer logLevel, TestItem testItem, - Attachment attachment) { - this.id = id; - this.logTime = logTime; - this.logMessage = logMessage; - this.lastModified = lastModified; - this.logLevel = logLevel; - this.testItem = testItem; - this.attachment = attachment; - } - - public LogFull() { - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getUuid() { - return uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - public TestItem getTestItem() { - return testItem; - } - - public Launch getLaunch() { - return launch; - } - - public void setLaunch(Launch launch) { - this.launch = launch; - } - - public void setTestItem(TestItem testItem) { - this.testItem = testItem; - } - - public LocalDateTime getLogTime() { - return logTime; - } - - public void setLogTime(LocalDateTime logTime) { - this.logTime = logTime; - } - - public LocalDateTime getLastModified() { - return lastModified; - } - - public void setLastModified(LocalDateTime lastModified) { - this.lastModified = lastModified; - } - - public String getLogMessage() { - return logMessage; - } - - public void setLogMessage(String logMessage) { - this.logMessage = logMessage; - } - - public Integer getLogLevel() { - return logLevel; - } - - public void setLogLevel(Integer logLevel) { - this.logLevel = logLevel; - } - - public Attachment getAttachment() { - return attachment; - } - - public void setAttachment(Attachment attachment) { - this.attachment = attachment; - } - - public Long getProjectId() { - return projectId; - } - - public void setProjectId(Long projectId) { - this.projectId = projectId; - } - - public Long getClusterId() { - return clusterId; - } - - public void setClusterId(Long clusterId) { - this.clusterId = clusterId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LogFull log = (LogFull) o; - return Objects.equals(id, log.id) && Objects.equals(logTime, log.logTime) && Objects.equals(logMessage, log.logMessage) - && Objects.equals(lastModified, log.lastModified) && Objects.equals(logLevel, log.logLevel) && Objects.equals(testItem, - log.testItem - ) && Objects.equals(launch, log.launch) && Objects.equals(projectId, log.projectId) && Objects.equals(clusterId, log.clusterId); - } - - @Override - public int hashCode() { - return Objects.hash(id, logTime, logMessage, lastModified, logLevel, testItem, launch, projectId, clusterId); - } + private Long id; + private String uuid; + private LocalDateTime logTime; + private String logMessage; + private LocalDateTime lastModified; + private Integer logLevel; + private TestItem testItem; + private Launch launch; + private Long projectId; + private Long clusterId; + + private Attachment attachment; + + public LogFull(Long id, LocalDateTime logTime, String logMessage, LocalDateTime lastModified, + Integer logLevel, TestItem testItem, + Attachment attachment) { + this.id = id; + this.logTime = logTime; + this.logMessage = logMessage; + this.lastModified = lastModified; + this.logLevel = logLevel; + this.testItem = testItem; + this.attachment = attachment; + } + + public LogFull() { + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public TestItem getTestItem() { + return testItem; + } + + public Launch getLaunch() { + return launch; + } + + public void setLaunch(Launch launch) { + this.launch = launch; + } + + public void setTestItem(TestItem testItem) { + this.testItem = testItem; + } + + public LocalDateTime getLogTime() { + return logTime; + } + + public void setLogTime(LocalDateTime logTime) { + this.logTime = logTime; + } + + public LocalDateTime getLastModified() { + return lastModified; + } + + public void setLastModified(LocalDateTime lastModified) { + this.lastModified = lastModified; + } + + public String getLogMessage() { + return logMessage; + } + + public void setLogMessage(String logMessage) { + this.logMessage = logMessage; + } + + public Integer getLogLevel() { + return logLevel; + } + + public void setLogLevel(Integer logLevel) { + this.logLevel = logLevel; + } + + public Attachment getAttachment() { + return attachment; + } + + public void setAttachment(Attachment attachment) { + this.attachment = attachment; + } + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + public Long getClusterId() { + return clusterId; + } + + public void setClusterId(Long clusterId) { + this.clusterId = clusterId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogFull log = (LogFull) o; + return Objects.equals(id, log.id) && Objects.equals(logTime, log.logTime) && Objects.equals( + logMessage, log.logMessage) + && Objects.equals(lastModified, log.lastModified) && Objects.equals(logLevel, log.logLevel) + && Objects.equals(testItem, + log.testItem + ) && Objects.equals(launch, log.launch) && Objects.equals(projectId, log.projectId) + && Objects.equals(clusterId, log.clusterId); + } + + @Override + public int hashCode() { + return Objects.hash(id, logTime, logMessage, lastModified, logLevel, testItem, launch, + projectId, clusterId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java b/src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java index 558a4ee9c..6bdc61ff4 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java +++ b/src/main/java/com/epam/ta/reportportal/entity/log/LogMessage.java @@ -6,82 +6,87 @@ public class LogMessage implements Serializable { - private Long id; - private LocalDateTime logTime; - private String logMessage; - private Long itemId; - private Long launchId; - private Long projectId; - - public LogMessage(Long id, LocalDateTime logTime, String logMessage, Long itemId, Long launchId, Long projectId) { - this.id = id; - this.logTime = logTime; - this.logMessage = logMessage; - this.itemId = itemId; - this.launchId = launchId; - this.projectId = projectId; + private Long id; + private LocalDateTime logTime; + private String logMessage; + private Long itemId; + private Long launchId; + private Long projectId; + + public LogMessage(Long id, LocalDateTime logTime, String logMessage, Long itemId, Long launchId, + Long projectId) { + this.id = id; + this.logTime = logTime; + this.logMessage = logMessage; + this.itemId = itemId; + this.launchId = launchId; + this.projectId = projectId; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public LocalDateTime getLogTime() { + return logTime; + } + + public void setLogTime(LocalDateTime logTime) { + this.logTime = logTime; + } + + public String getLogMessage() { + return logMessage; + } + + public void setLogMessage(String logMessage) { + this.logMessage = logMessage; + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + public Long getLaunchId() { + return launchId; + } + + public void setLaunchId(Long launchId) { + this.launchId = launchId; + } + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public LocalDateTime getLogTime() { - return logTime; - } - - public void setLogTime(LocalDateTime logTime) { - this.logTime = logTime; - } - - public String getLogMessage() { - return logMessage; - } - - public void setLogMessage(String logMessage) { - this.logMessage = logMessage; - } - - public Long getItemId() { - return itemId; - } - - public void setItemId(Long itemId) { - this.itemId = itemId; - } - - public Long getLaunchId() { - return launchId; - } - - public void setLaunchId(Long launchId) { - this.launchId = launchId; - } - - public Long getProjectId() { - return projectId; - } - - public void setProjectId(Long projectId) { - this.projectId = projectId; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - LogMessage that = (LogMessage) o; - return Objects.equals(id, that.id) && Objects.equals(logTime, that.logTime) - && Objects.equals(logMessage, that.logMessage) && Objects.equals(itemId, that.itemId) - && Objects.equals(launchId, that.launchId) && Objects.equals(projectId, that.projectId); - } - - @Override - public int hashCode() { - return Objects.hash(id, logTime, logMessage, itemId, launchId, projectId); + if (o == null || getClass() != o.getClass()) { + return false; } + LogMessage that = (LogMessage) o; + return Objects.equals(id, that.id) && Objects.equals(logTime, that.logTime) + && Objects.equals(logMessage, that.logMessage) && Objects.equals(itemId, that.itemId) + && Objects.equals(launchId, that.launchId) && Objects.equals(projectId, that.projectId); + } + + @Override + public int hashCode() { + return Objects.hash(id, logTime, logMessage, itemId, launchId, projectId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/materialized/StaleMaterializedView.java b/src/main/java/com/epam/ta/reportportal/entity/materialized/StaleMaterializedView.java index 4067dc56b..74447fef6 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/materialized/StaleMaterializedView.java +++ b/src/main/java/com/epam/ta/reportportal/entity/materialized/StaleMaterializedView.java @@ -7,34 +7,34 @@ */ public class StaleMaterializedView { - private Long id; - private String name; - private LocalDateTime creationDate; + private Long id; + private String name; + private LocalDateTime creationDate; - public StaleMaterializedView() { - } + public StaleMaterializedView() { + } - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public LocalDateTime getCreationDate() { - return creationDate; - } + public LocalDateTime getCreationDate() { + return creationDate; + } - public void setCreationDate(LocalDateTime creationDate) { - this.creationDate = creationDate; - } + public void setCreationDate(LocalDateTime creationDate) { + this.creationDate = creationDate; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/oauth/OAuthRegistration.java b/src/main/java/com/epam/ta/reportportal/entity/oauth/OAuthRegistration.java index 9db98fc01..1dd0d9bf2 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/oauth/OAuthRegistration.java +++ b/src/main/java/com/epam/ta/reportportal/entity/oauth/OAuthRegistration.java @@ -16,12 +16,16 @@ package com.epam.ta.reportportal.entity.oauth; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; import java.util.Set; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; /** * @author Andrei Varabyeu @@ -30,205 +34,212 @@ @Table(name = "oauth_registration", schema = "public") public class OAuthRegistration implements Serializable { - @Id - @Column(name = "id") - private String id; - - @Column(name = "client_id") - private String clientId; + @Id + @Column(name = "id") + private String id; - @Column(name = "client_secret") - private String clientSecret; + @Column(name = "client_id") + private String clientId; - @Column(name = "client_auth_method") - private String clientAuthMethod; + @Column(name = "client_secret") + private String clientSecret; - @Column(name = "auth_grant_type") - private String authGrantType; + @Column(name = "client_auth_method") + private String clientAuthMethod; - @Column(name = "redirect_uri_template") - private String redirectUrlTemplate; + @Column(name = "auth_grant_type") + private String authGrantType; - @Column(name = "authorization_uri") - private String authorizationUri; + @Column(name = "redirect_uri_template") + private String redirectUrlTemplate; - @Column(name = "token_uri") - private String tokenUri; + @Column(name = "authorization_uri") + private String authorizationUri; - @Column(name = "user_info_endpoint_uri") - private String userInfoEndpointUri; + @Column(name = "token_uri") + private String tokenUri; - @Column(name = "user_info_endpoint_name_attr") - private String userInfoEndpointNameAttribute; + @Column(name = "user_info_endpoint_uri") + private String userInfoEndpointUri; - @Column(name = "jwk_set_uri") - private String jwkSetUri; + @Column(name = "user_info_endpoint_name_attr") + private String userInfoEndpointNameAttribute; - @Column(name = "client_name") - private String clientName; + @Column(name = "jwk_set_uri") + private String jwkSetUri; - @OneToMany(mappedBy = "registration", fetch = FetchType.EAGER, cascade = { CascadeType.PERSIST, CascadeType.MERGE, - CascadeType.REMOVE }, orphanRemoval = true) - private Set scopes; + @Column(name = "client_name") + private String clientName; - @OneToMany(mappedBy = "registration", fetch = FetchType.EAGER, cascade = { CascadeType.PERSIST, CascadeType.MERGE, - CascadeType.REMOVE }, orphanRemoval = true) - private Set restrictions; + @OneToMany(mappedBy = "registration", fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, + CascadeType.MERGE, + CascadeType.REMOVE}, orphanRemoval = true) + private Set scopes; - public String getId() { - return id; - } + @OneToMany(mappedBy = "registration", fetch = FetchType.EAGER, cascade = {CascadeType.PERSIST, + CascadeType.MERGE, + CascadeType.REMOVE}, orphanRemoval = true) + private Set restrictions; - public void setId(String id) { - this.id = id; - } + public String getId() { + return id; + } - public String getClientId() { - return clientId; - } + public void setId(String id) { + this.id = id; + } - public void setClientId(String clientId) { - this.clientId = clientId; - } + public String getClientId() { + return clientId; + } - public String getClientSecret() { - return clientSecret; - } + public void setClientId(String clientId) { + this.clientId = clientId; + } - public void setClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - } + public String getClientSecret() { + return clientSecret; + } - public String getClientAuthMethod() { - return clientAuthMethod; - } + public void setClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + } - public void setClientAuthMethod(String clientAuthMethod) { - this.clientAuthMethod = clientAuthMethod; - } - - public String getAuthGrantType() { - return authGrantType; - } - - public void setAuthGrantType(String authGrantType) { - this.authGrantType = authGrantType; - } - - public String getRedirectUrlTemplate() { - return redirectUrlTemplate; - } - - public void setRedirectUrlTemplate(String redirectUrlTemplate) { - this.redirectUrlTemplate = redirectUrlTemplate; - } - - public String getAuthorizationUri() { - return authorizationUri; - } - - public void setAuthorizationUri(String authorizationUri) { - this.authorizationUri = authorizationUri; - } - - public String getTokenUri() { - return tokenUri; - } - - public void setTokenUri(String tokenUri) { - this.tokenUri = tokenUri; - } - - public String getUserInfoEndpointUri() { - return userInfoEndpointUri; - } - - public void setUserInfoEndpointUri(String userInfoEndpointUri) { - this.userInfoEndpointUri = userInfoEndpointUri; - } - - public String getUserInfoEndpointNameAttribute() { - return userInfoEndpointNameAttribute; - } - - public void setUserInfoEndpointNameAttribute(String userInfoEndpointNameAttribute) { - this.userInfoEndpointNameAttribute = userInfoEndpointNameAttribute; - } - - public String getJwkSetUri() { - return jwkSetUri; - } - - public void setJwkSetUri(String jwkSetUri) { - this.jwkSetUri = jwkSetUri; - } - - public String getClientName() { - return clientName; - } - - public void setClientName(String clientName) { - this.clientName = clientName; - } - - public Set getScopes() { - return scopes; - } - - public void setScopes(Set scopes) { - if (this.scopes == null) { - this.scopes = scopes; - } else { - this.scopes.retainAll(scopes); - this.scopes.addAll(scopes); - } - } - - public Set getRestrictions() { - return restrictions; - } - - public void setRestrictions(Set restrictions) { - if (this.restrictions == null) { - this.restrictions = restrictions; - } else { - this.restrictions.retainAll(restrictions); - this.restrictions.addAll(restrictions); - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OAuthRegistration that = (OAuthRegistration) o; - return Objects.equals(id, that.id) && Objects.equals(clientId, that.clientId) && Objects.equals(clientSecret, that.clientSecret) - && Objects.equals(clientAuthMethod, that.clientAuthMethod) && Objects.equals(authGrantType, that.authGrantType) - && Objects.equals(redirectUrlTemplate, that.redirectUrlTemplate) && Objects.equals(authorizationUri, that.authorizationUri) - && Objects.equals(tokenUri, that.tokenUri) && Objects.equals(userInfoEndpointUri, that.userInfoEndpointUri) - && Objects.equals(userInfoEndpointNameAttribute, that.userInfoEndpointNameAttribute) && Objects.equals(jwkSetUri, - that.jwkSetUri - ) && Objects.equals(clientName, that.clientName); - } - - @Override - public int hashCode() { - return Objects.hash(id, - clientId, - clientSecret, - clientAuthMethod, - authGrantType, - redirectUrlTemplate, - authorizationUri, - tokenUri, - userInfoEndpointUri, - userInfoEndpointNameAttribute, - jwkSetUri, - clientName - ); - } + public String getClientAuthMethod() { + return clientAuthMethod; + } + + public void setClientAuthMethod(String clientAuthMethod) { + this.clientAuthMethod = clientAuthMethod; + } + + public String getAuthGrantType() { + return authGrantType; + } + + public void setAuthGrantType(String authGrantType) { + this.authGrantType = authGrantType; + } + + public String getRedirectUrlTemplate() { + return redirectUrlTemplate; + } + + public void setRedirectUrlTemplate(String redirectUrlTemplate) { + this.redirectUrlTemplate = redirectUrlTemplate; + } + + public String getAuthorizationUri() { + return authorizationUri; + } + + public void setAuthorizationUri(String authorizationUri) { + this.authorizationUri = authorizationUri; + } + + public String getTokenUri() { + return tokenUri; + } + + public void setTokenUri(String tokenUri) { + this.tokenUri = tokenUri; + } + + public String getUserInfoEndpointUri() { + return userInfoEndpointUri; + } + + public void setUserInfoEndpointUri(String userInfoEndpointUri) { + this.userInfoEndpointUri = userInfoEndpointUri; + } + + public String getUserInfoEndpointNameAttribute() { + return userInfoEndpointNameAttribute; + } + + public void setUserInfoEndpointNameAttribute(String userInfoEndpointNameAttribute) { + this.userInfoEndpointNameAttribute = userInfoEndpointNameAttribute; + } + + public String getJwkSetUri() { + return jwkSetUri; + } + + public void setJwkSetUri(String jwkSetUri) { + this.jwkSetUri = jwkSetUri; + } + + public String getClientName() { + return clientName; + } + + public void setClientName(String clientName) { + this.clientName = clientName; + } + + public Set getScopes() { + return scopes; + } + + public void setScopes(Set scopes) { + if (this.scopes == null) { + this.scopes = scopes; + } else { + this.scopes.retainAll(scopes); + this.scopes.addAll(scopes); + } + } + + public Set getRestrictions() { + return restrictions; + } + + public void setRestrictions(Set restrictions) { + if (this.restrictions == null) { + this.restrictions = restrictions; + } else { + this.restrictions.retainAll(restrictions); + this.restrictions.addAll(restrictions); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthRegistration that = (OAuthRegistration) o; + return Objects.equals(id, that.id) && Objects.equals(clientId, that.clientId) && Objects.equals( + clientSecret, that.clientSecret) + && Objects.equals(clientAuthMethod, that.clientAuthMethod) && Objects.equals(authGrantType, + that.authGrantType) + && Objects.equals(redirectUrlTemplate, that.redirectUrlTemplate) && Objects.equals( + authorizationUri, that.authorizationUri) + && Objects.equals(tokenUri, that.tokenUri) && Objects.equals(userInfoEndpointUri, + that.userInfoEndpointUri) + && Objects.equals(userInfoEndpointNameAttribute, that.userInfoEndpointNameAttribute) + && Objects.equals(jwkSetUri, + that.jwkSetUri + ) && Objects.equals(clientName, that.clientName); + } + + @Override + public int hashCode() { + return Objects.hash(id, + clientId, + clientSecret, + clientAuthMethod, + authGrantType, + redirectUrlTemplate, + authorizationUri, + tokenUri, + userInfoEndpointUri, + userInfoEndpointNameAttribute, + jwkSetUri, + clientName + ); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/oauth/OAuthRegistrationRestriction.java b/src/main/java/com/epam/ta/reportportal/entity/oauth/OAuthRegistrationRestriction.java index b37ea0f65..f2788a537 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/oauth/OAuthRegistrationRestriction.java +++ b/src/main/java/com/epam/ta/reportportal/entity/oauth/OAuthRegistrationRestriction.java @@ -16,77 +16,82 @@ package com.epam.ta.reportportal.entity.oauth; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; @Entity @Table(name = "oauth_registration_restriction", schema = "public") public class OAuthRegistrationRestriction implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id") - private Long id; - - @ManyToOne - @JoinColumn(name = "oauth_registration_fk") - private OAuthRegistration registration; - - @Column(name = "type") - private String type; - - @Column(name = "value") - private String value; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public OAuthRegistration getRegistration() { - return registration; - } - - public void setRegistration(OAuthRegistration registration) { - this.registration = registration; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OAuthRegistrationRestriction that = (OAuthRegistrationRestriction) o; - return Objects.equals(type, that.type) && Objects.equals(value, that.value); - } - - @Override - public int hashCode() { - return Objects.hash(type, value); - } + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Long id; + + @ManyToOne + @JoinColumn(name = "oauth_registration_fk") + private OAuthRegistration registration; + + @Column(name = "type") + private String type; + + @Column(name = "value") + private String value; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public OAuthRegistration getRegistration() { + return registration; + } + + public void setRegistration(OAuthRegistration registration) { + this.registration = registration; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthRegistrationRestriction that = (OAuthRegistrationRestriction) o; + return Objects.equals(type, that.type) && Objects.equals(value, that.value); + } + + @Override + public int hashCode() { + return Objects.hash(type, value); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/oauth/OAuthRegistrationScope.java b/src/main/java/com/epam/ta/reportportal/entity/oauth/OAuthRegistrationScope.java index 8e30d6714..565902ad0 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/oauth/OAuthRegistrationScope.java +++ b/src/main/java/com/epam/ta/reportportal/entity/oauth/OAuthRegistrationScope.java @@ -16,11 +16,16 @@ package com.epam.ta.reportportal.entity.oauth; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; /** * @author Andrei Varabyeu @@ -29,56 +34,56 @@ @Table(name = "oauth_registration_scope", schema = "public") public class OAuthRegistrationScope implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id") - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Long id; - @Column(name = "scope") - private String scope; + @Column(name = "scope") + private String scope; - @ManyToOne - @JoinColumn(name = "oauth_registration_fk") - private OAuthRegistration registration; + @ManyToOne + @JoinColumn(name = "oauth_registration_fk") + private OAuthRegistration registration; - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public String getScope() { - return scope; - } + public String getScope() { + return scope; + } - public void setScope(String scope) { - this.scope = scope; - } + public void setScope(String scope) { + this.scope = scope; + } - public OAuthRegistration getRegistration() { - return registration; - } + public OAuthRegistration getRegistration() { + return registration; + } - public void setRegistration(OAuthRegistration registration) { - this.registration = registration; - } + public void setRegistration(OAuthRegistration registration) { + this.registration = registration; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OAuthRegistrationScope that = (OAuthRegistrationScope) o; - return Objects.equals(scope, that.scope); - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthRegistrationScope that = (OAuthRegistrationScope) o; + return Objects.equals(scope, that.scope); + } - @Override - public int hashCode() { - return Objects.hash(scope); - } + @Override + public int hashCode() { + return Objects.hash(scope); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/onboarding/Onboarding.java b/src/main/java/com/epam/ta/reportportal/entity/onboarding/Onboarding.java index 587e92357..3fc3b2f6f 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/onboarding/Onboarding.java +++ b/src/main/java/com/epam/ta/reportportal/entity/onboarding/Onboarding.java @@ -8,49 +8,49 @@ */ public class Onboarding implements Serializable { - private Long id; - private String page; - private String data; - private LocalDateTime availableFrom; - private LocalDateTime availableTo; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getPage() { - return page; - } - - public void setPage(String page) { - this.page = page; - } - - public String getData() { - return data; - } - - public void setData(String data) { - this.data = data; - } - - public LocalDateTime getAvailableFrom() { - return availableFrom; - } - - public void setAvailableFrom(LocalDateTime availableFrom) { - this.availableFrom = availableFrom; - } - - public LocalDateTime getAvailableTo() { - return availableTo; - } - - public void setAvailableTo(LocalDateTime availableTo) { - this.availableTo = availableTo; - } + private Long id; + private String page; + private String data; + private LocalDateTime availableFrom; + private LocalDateTime availableTo; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPage() { + return page; + } + + public void setPage(String page) { + this.page = page; + } + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } + + public LocalDateTime getAvailableFrom() { + return availableFrom; + } + + public void setAvailableFrom(LocalDateTime availableFrom) { + this.availableFrom = availableFrom; + } + + public LocalDateTime getAvailableTo() { + return availableTo; + } + + public void setAvailableTo(LocalDateTime availableTo) { + this.availableTo = availableTo; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplate.java b/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplate.java index a5b66e315..ff04b132b 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplate.java +++ b/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplate.java @@ -16,9 +16,16 @@ package com.epam.ta.reportportal.entity.pattern; -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; /** * @author Ivan Budayeu @@ -27,93 +34,94 @@ @Table(name = "pattern_template") public class PatternTemplate implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @Column(name = "name") - private String name; - - @Column(name = "value") - private String value; - - @Enumerated(EnumType.STRING) - @Column(name = "type") - private PatternTemplateType templateType; - - @Column(name = "enabled") - private boolean enabled; - - @Column(name = "project_id") - private Long projectId; - - public PatternTemplate() { - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public PatternTemplateType getTemplateType() { - return templateType; - } - - public void setTemplateType(PatternTemplateType templateType) { - this.templateType = templateType; - } - - public Long getProjectId() { - return projectId; - } - - public void setProjectId(Long projectId) { - this.projectId = projectId; - } - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PatternTemplate that = (PatternTemplate) o; - return enabled == that.enabled && Objects.equals(id, that.id) && Objects.equals(name, that.name) && Objects.equals(value, - that.value - ) && templateType == that.templateType && Objects.equals(projectId, that.projectId); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, value, templateType, enabled, projectId); - } + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "name") + private String name; + + @Column(name = "value") + private String value; + + @Enumerated(EnumType.STRING) + @Column(name = "type") + private PatternTemplateType templateType; + + @Column(name = "enabled") + private boolean enabled; + + @Column(name = "project_id") + private Long projectId; + + public PatternTemplate() { + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public PatternTemplateType getTemplateType() { + return templateType; + } + + public void setTemplateType(PatternTemplateType templateType) { + this.templateType = templateType; + } + + public Long getProjectId() { + return projectId; + } + + public void setProjectId(Long projectId) { + this.projectId = projectId; + } + + public boolean isEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatternTemplate that = (PatternTemplate) o; + return enabled == that.enabled && Objects.equals(id, that.id) && Objects.equals(name, that.name) + && Objects.equals(value, + that.value + ) && templateType == that.templateType && Objects.equals(projectId, that.projectId); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, value, templateType, enabled, projectId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateTestItem.java b/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateTestItem.java index 5ada92f57..a9c48830d 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateTestItem.java +++ b/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateTestItem.java @@ -17,10 +17,14 @@ package com.epam.ta.reportportal.entity.pattern; import com.epam.ta.reportportal.entity.item.TestItem; - -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; /** * @author Ivan Budayeu @@ -30,54 +34,55 @@ @IdClass(value = PatternTemplateTestItemKey.class) public class PatternTemplateTestItem implements Serializable { - @Id - @ManyToOne - @JoinColumn(name = "pattern_id") - private PatternTemplate patternTemplate; + @Id + @ManyToOne + @JoinColumn(name = "pattern_id") + private PatternTemplate patternTemplate; - @Id - @ManyToOne - @JoinColumn(name = "item_id") - private TestItem testItem; + @Id + @ManyToOne + @JoinColumn(name = "item_id") + private TestItem testItem; - public PatternTemplateTestItem() { - } + public PatternTemplateTestItem() { + } - public PatternTemplateTestItem(PatternTemplate patternTemplate, TestItem testItem) { - this.patternTemplate = patternTemplate; - this.testItem = testItem; - } + public PatternTemplateTestItem(PatternTemplate patternTemplate, TestItem testItem) { + this.patternTemplate = patternTemplate; + this.testItem = testItem; + } - public PatternTemplate getPatternTemplate() { - return patternTemplate; - } + public PatternTemplate getPatternTemplate() { + return patternTemplate; + } - public void setPatternTemplate(PatternTemplate patternTemplate) { - this.patternTemplate = patternTemplate; - } + public void setPatternTemplate(PatternTemplate patternTemplate) { + this.patternTemplate = patternTemplate; + } - public TestItem getTestItem() { - return testItem; - } + public TestItem getTestItem() { + return testItem; + } - public void setTestItem(TestItem testItem) { - this.testItem = testItem; - } + public void setTestItem(TestItem testItem) { + this.testItem = testItem; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PatternTemplateTestItem that = (PatternTemplateTestItem) o; - return Objects.equals(patternTemplate, that.patternTemplate) && Objects.equals(testItem, that.testItem); - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatternTemplateTestItem that = (PatternTemplateTestItem) o; + return Objects.equals(patternTemplate, that.patternTemplate) && Objects.equals(testItem, + that.testItem); + } - @Override - public int hashCode() { - return Objects.hash(patternTemplate, testItem); - } + @Override + public int hashCode() { + return Objects.hash(patternTemplate, testItem); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateTestItemKey.java b/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateTestItemKey.java index d27ec38ae..265eebb6f 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateTestItemKey.java +++ b/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateTestItemKey.java @@ -17,59 +17,59 @@ package com.epam.ta.reportportal.entity.pattern; import com.epam.ta.reportportal.entity.item.TestItem; - +import java.io.Serializable; +import java.util.Objects; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; -import java.io.Serializable; -import java.util.Objects; /** * @author Ivan Budayeu */ public class PatternTemplateTestItemKey implements Serializable { - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = "pattern_id") - private PatternTemplate patternTemplate; + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "pattern_id") + private PatternTemplate patternTemplate; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "item_id") - private TestItem testItem; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "item_id") + private TestItem testItem; - public PatternTemplateTestItemKey() { - } + public PatternTemplateTestItemKey() { + } - public PatternTemplate getPatternTemplate() { - return patternTemplate; - } + public PatternTemplate getPatternTemplate() { + return patternTemplate; + } - public void setPatternTemplate(PatternTemplate patternTemplate) { - this.patternTemplate = patternTemplate; - } + public void setPatternTemplate(PatternTemplate patternTemplate) { + this.patternTemplate = patternTemplate; + } - public TestItem getTestItem() { - return testItem; - } + public TestItem getTestItem() { + return testItem; + } - public void setTestItem(TestItem testItem) { - this.testItem = testItem; - } + public void setTestItem(TestItem testItem) { + this.testItem = testItem; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PatternTemplateTestItemKey that = (PatternTemplateTestItemKey) o; - return Objects.equals(patternTemplate, that.patternTemplate) && Objects.equals(testItem, that.testItem); - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatternTemplateTestItemKey that = (PatternTemplateTestItemKey) o; + return Objects.equals(patternTemplate, that.patternTemplate) && Objects.equals(testItem, + that.testItem); + } - @Override - public int hashCode() { - return Objects.hash(patternTemplate, testItem); - } + @Override + public int hashCode() { + return Objects.hash(patternTemplate, testItem); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateTestItemPojo.java b/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateTestItemPojo.java index d5a209122..877fb1d4a 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateTestItemPojo.java +++ b/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateTestItemPojo.java @@ -24,48 +24,49 @@ */ public class PatternTemplateTestItemPojo implements Serializable { - private Long patternTemplateId; + private Long patternTemplateId; - private Long testItemId; + private Long testItemId; - public PatternTemplateTestItemPojo() { - } + public PatternTemplateTestItemPojo() { + } - public PatternTemplateTestItemPojo(Long patternTemplateId, Long testItemId) { - this.patternTemplateId = patternTemplateId; - this.testItemId = testItemId; - } + public PatternTemplateTestItemPojo(Long patternTemplateId, Long testItemId) { + this.patternTemplateId = patternTemplateId; + this.testItemId = testItemId; + } - public Long getPatternTemplateId() { - return patternTemplateId; - } + public Long getPatternTemplateId() { + return patternTemplateId; + } - public void setPatternTemplateId(Long patternTemplateId) { - this.patternTemplateId = patternTemplateId; - } + public void setPatternTemplateId(Long patternTemplateId) { + this.patternTemplateId = patternTemplateId; + } - public Long getTestItemId() { - return testItemId; - } + public Long getTestItemId() { + return testItemId; + } - public void setTestItemId(Long testItemId) { - this.testItemId = testItemId; - } + public void setTestItemId(Long testItemId) { + this.testItemId = testItemId; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PatternTemplateTestItemPojo that = (PatternTemplateTestItemPojo) o; - return Objects.equals(patternTemplateId, that.patternTemplateId) && Objects.equals(testItemId, that.testItemId); - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatternTemplateTestItemPojo that = (PatternTemplateTestItemPojo) o; + return Objects.equals(patternTemplateId, that.patternTemplateId) && Objects.equals(testItemId, + that.testItemId); + } - @Override - public int hashCode() { - return Objects.hash(patternTemplateId, testItemId); - } + @Override + public int hashCode() { + return Objects.hash(patternTemplateId, testItemId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateType.java b/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateType.java index 9e9d1e5cc..269b669ba 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateType.java +++ b/src/main/java/com/epam/ta/reportportal/entity/pattern/PatternTemplateType.java @@ -24,10 +24,11 @@ */ public enum PatternTemplateType { - STRING, - REGEX; + STRING, + REGEX; - public static Optional fromString(String string) { - return Arrays.stream(PatternTemplateType.values()).filter(type -> type.name().equalsIgnoreCase(string)).findFirst(); - } + public static Optional fromString(String string) { + return Arrays.stream(PatternTemplateType.values()) + .filter(type -> type.name().equalsIgnoreCase(string)).findFirst(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/plugin/PluginFileExtension.java b/src/main/java/com/epam/ta/reportportal/entity/plugin/PluginFileExtension.java index 0a5148c81..7aea7b1a3 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/plugin/PluginFileExtension.java +++ b/src/main/java/com/epam/ta/reportportal/entity/plugin/PluginFileExtension.java @@ -24,21 +24,22 @@ */ public enum PluginFileExtension { - JAR(".jar"), - ZIP(".zip"); + JAR(".jar"), + ZIP(".zip"); - private String extension; + private String extension; - PluginFileExtension(String extension) { - this.extension = extension; - } + PluginFileExtension(String extension) { + this.extension = extension; + } - public static Optional findByExtension(String extension) { + public static Optional findByExtension(String extension) { - return Arrays.stream(values()).filter(e -> e.getExtension().equalsIgnoreCase(extension)).findFirst(); - } + return Arrays.stream(values()).filter(e -> e.getExtension().equalsIgnoreCase(extension)) + .findFirst(); + } - public String getExtension() { - return extension; - } + public String getExtension() { + return extension; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/preference/UserPreference.java b/src/main/java/com/epam/ta/reportportal/entity/preference/UserPreference.java index 323962f91..04946daa6 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/preference/UserPreference.java +++ b/src/main/java/com/epam/ta/reportportal/entity/preference/UserPreference.java @@ -19,9 +19,14 @@ import com.epam.ta.reportportal.entity.filter.UserFilter; import com.epam.ta.reportportal.entity.project.Project; import com.epam.ta.reportportal.entity.user.User; - -import javax.persistence.*; import java.io.Serializable; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.Table; /** * @author Pavel Bortnik @@ -30,48 +35,48 @@ @Table(name = "user_preference", schema = "public") public class UserPreference implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; - @ManyToOne(fetch = FetchType.LAZY) - private UserFilter filter; + @ManyToOne(fetch = FetchType.LAZY) + private UserFilter filter; - @ManyToOne(fetch = FetchType.LAZY) - private Project project; + @ManyToOne(fetch = FetchType.LAZY) + private Project project; - @ManyToOne(fetch = FetchType.LAZY) - private User user; + @ManyToOne(fetch = FetchType.LAZY) + private User user; - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public UserFilter getFilter() { - return filter; - } + public UserFilter getFilter() { + return filter; + } - public void setFilter(UserFilter filter) { - this.filter = filter; - } + public void setFilter(UserFilter filter) { + this.filter = filter; + } - public Project getProject() { - return project; - } + public Project getProject() { + return project; + } - public void setProject(Project project) { - this.project = project; - } + public void setProject(Project project) { + this.project = project; + } - public User getUser() { - return user; - } + public User getUser() { + return user; + } - public void setUser(User user) { - this.user = user; - } + public void setUser(User user) { + this.user = user; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/Project.java b/src/main/java/com/epam/ta/reportportal/entity/project/Project.java index dfc408183..3029c1911 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/Project.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/Project.java @@ -23,14 +23,23 @@ import com.epam.ta.reportportal.entity.project.email.SenderCase; import com.epam.ta.reportportal.entity.user.ProjectUser; import com.google.common.collect.Sets; -import org.hibernate.annotations.Type; -import org.hibernate.annotations.TypeDef; - -import javax.persistence.*; import java.io.Serializable; import java.util.Date; import java.util.Objects; import java.util.Set; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.OrderBy; +import javax.persistence.Table; +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; /** * @author Ivan Budayeu @@ -40,185 +49,188 @@ @Table(name = "project", schema = "public") public class Project implements Serializable { - private static final long serialVersionUID = -263516611; - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id", unique = true, nullable = false, precision = 64) - private Long id; - - @Column(name = "name") - private String name; - - @Column(name = "project_type") - private ProjectType projectType; - - @OneToMany(mappedBy = "project", cascade = { CascadeType.PERSIST }, fetch = FetchType.LAZY) - @OrderBy("creationDate desc") - private Set integrations = Sets.newHashSet(); - - @OneToMany(mappedBy = "project", cascade = { CascadeType.PERSIST }, fetch = FetchType.LAZY) - private Set projectAttributes = Sets.newHashSet(); + private static final long serialVersionUID = -263516611; - @OneToMany(mappedBy = "project", cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY) - @OrderBy(value = "issue_type_id") - private Set projectIssueTypes = Sets.newHashSet(); + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", unique = true, nullable = false, precision = 64) + private Long id; - @OneToMany(mappedBy = "project", cascade = { CascadeType.PERSIST }, fetch = FetchType.EAGER, orphanRemoval = true) - private Set senderCases = Sets.newHashSet(); + @Column(name = "name") + private String name; - @Column(name = "creation_date") - private Date creationDate; + @Column(name = "project_type") + private ProjectType projectType; - @Type(type = "json") - @Column(name = "metadata") - private Metadata metadata; + @OneToMany(mappedBy = "project", cascade = {CascadeType.PERSIST}, fetch = FetchType.LAZY) + @OrderBy("creationDate desc") + private Set integrations = Sets.newHashSet(); - @Column(name = "organization") - private String organization; + @OneToMany(mappedBy = "project", cascade = {CascadeType.PERSIST}, fetch = FetchType.LAZY) + private Set projectAttributes = Sets.newHashSet(); - @Column(name = "allocated_storage", updatable = false) - private long allocatedStorage; + @OneToMany(mappedBy = "project", cascade = {CascadeType.PERSIST, + CascadeType.MERGE}, fetch = FetchType.LAZY) + @OrderBy(value = "issue_type_id") + private Set projectIssueTypes = Sets.newHashSet(); - @OneToMany(fetch = FetchType.LAZY, mappedBy = "project", cascade = CascadeType.PERSIST) - private Set users = Sets.newHashSet(); + @OneToMany(mappedBy = "project", cascade = { + CascadeType.PERSIST}, fetch = FetchType.EAGER, orphanRemoval = true) + private Set senderCases = Sets.newHashSet(); - @OneToMany(fetch = FetchType.EAGER, orphanRemoval = true) - @JoinColumn(name = "project_id", updatable = false) - @OrderBy - private Set patternTemplates = Sets.newHashSet(); + @Column(name = "creation_date") + private Date creationDate; - public Project(Long id, String name) { - this.id = id; - this.name = name; - } + @Type(type = "json") + @Column(name = "metadata") + private Metadata metadata; - public Project() { - } + @Column(name = "organization") + private String organization; - public Date getCreationDate() { - return creationDate; - } + @Column(name = "allocated_storage", updatable = false) + private long allocatedStorage; - public void setCreationDate(Date creationDate) { - this.creationDate = creationDate; - } + @OneToMany(fetch = FetchType.LAZY, mappedBy = "project", cascade = CascadeType.PERSIST) + private Set users = Sets.newHashSet(); - public Long getId() { - return this.id; - } + @OneToMany(fetch = FetchType.EAGER, orphanRemoval = true) + @JoinColumn(name = "project_id", updatable = false) + @OrderBy + private Set patternTemplates = Sets.newHashSet(); - public void setId(Long id) { - this.id = id; - } + public Project(Long id, String name) { + this.id = id; + this.name = name; + } - public ProjectType getProjectType() { - return projectType; - } + public Project() { + } - public void setProjectType(ProjectType projectType) { - this.projectType = projectType; - } + public Date getCreationDate() { + return creationDate; + } - public Set getUsers() { - return users; - } + public void setCreationDate(Date creationDate) { + this.creationDate = creationDate; + } - public void setUsers(Set users) { - this.users = users; - } + public Long getId() { + return this.id; + } - public long getAllocatedStorage() { - return allocatedStorage; - } + public void setId(Long id) { + this.id = id; + } - public void setAllocatedStorage(long allocatedStorage) { - this.allocatedStorage = allocatedStorage; - } + public ProjectType getProjectType() { + return projectType; + } - public Set getPatternTemplates() { - return patternTemplates; - } + public void setProjectType(ProjectType projectType) { + this.projectType = projectType; + } - public void setPatternTemplates(Set patternTemplates) { - this.patternTemplates = patternTemplates; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Set getIntegrations() { - return integrations; - } - - public void setIntegrations(Set integrations) { - this.integrations = integrations; - } - - public Set getProjectAttributes() { - return projectAttributes; - } - - public Set getProjectIssueTypes() { - return projectIssueTypes; - } - - public void setProjectIssueTypes(Set projectIssueTypes) { - this.projectIssueTypes = projectIssueTypes; - } - - public void setProjectAttributes(Set projectAttributes) { - this.projectAttributes = projectAttributes; - } - - public Set getSenderCases() { - return senderCases; - } - - public void setSenderCases(Set senderCases) { - this.senderCases = senderCases; - } - - public String getOrganization() { - return organization; - } - - public void setOrganization(String organization) { - this.organization = organization; - } - - public Metadata getMetadata() { - return metadata; - } - - public void setMetadata(Metadata metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Project project = (Project) o; - return Objects.equals(name, project.name) && Objects.equals(allocatedStorage, project.allocatedStorage) && Objects.equals( - creationDate, - project.creationDate - ) && Objects.equals(metadata, project.metadata); - } - - @Override - public int hashCode() { - - return Objects.hash(name, creationDate, metadata, allocatedStorage); - } + public Set getUsers() { + return users; + } + + public void setUsers(Set users) { + this.users = users; + } + + public long getAllocatedStorage() { + return allocatedStorage; + } + + public void setAllocatedStorage(long allocatedStorage) { + this.allocatedStorage = allocatedStorage; + } + + public Set getPatternTemplates() { + return patternTemplates; + } + + public void setPatternTemplates(Set patternTemplates) { + this.patternTemplates = patternTemplates; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Set getIntegrations() { + return integrations; + } + + public void setIntegrations(Set integrations) { + this.integrations = integrations; + } + + public Set getProjectAttributes() { + return projectAttributes; + } + + public void setProjectAttributes(Set projectAttributes) { + this.projectAttributes = projectAttributes; + } + + public Set getProjectIssueTypes() { + return projectIssueTypes; + } + + public void setProjectIssueTypes(Set projectIssueTypes) { + this.projectIssueTypes = projectIssueTypes; + } + + public Set getSenderCases() { + return senderCases; + } + + public void setSenderCases(Set senderCases) { + this.senderCases = senderCases; + } + + public String getOrganization() { + return organization; + } + + public void setOrganization(String organization) { + this.organization = organization; + } + + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Project project = (Project) o; + return Objects.equals(name, project.name) && Objects.equals(allocatedStorage, + project.allocatedStorage) && Objects.equals( + creationDate, + project.creationDate + ) && Objects.equals(metadata, project.metadata); + } + + @Override + public int hashCode() { + + return Objects.hash(name, creationDate, metadata, allocatedStorage); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectAnalyzerConfig.java b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectAnalyzerConfig.java index d30c6f95a..a190064ba 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectAnalyzerConfig.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectAnalyzerConfig.java @@ -23,9 +23,9 @@ */ public class ProjectAnalyzerConfig implements Serializable { - public static final int MIN_DOC_FREQ = 1; - public static final int MIN_TERM_FREQ = 1; - public static final int MIN_SHOULD_MATCH = 95; - public static final int NUMBER_OF_LOG_LINES = -1; + public static final int MIN_DOC_FREQ = 1; + public static final int MIN_TERM_FREQ = 1; + public static final int MIN_SHOULD_MATCH = 95; + public static final int NUMBER_OF_LOG_LINES = -1; } diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectAttribute.java b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectAttribute.java index eeef52fbe..36a9f1c87 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectAttribute.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectAttribute.java @@ -17,10 +17,15 @@ package com.epam.ta.reportportal.entity.project; import com.epam.ta.reportportal.entity.attribute.Attribute; - -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; /** * @author Andrey Plisunov @@ -30,84 +35,84 @@ @IdClass(ProjectAttributeKey.class) public class ProjectAttribute implements Serializable { - private static final long serialVersionUID = 1L; - - @Id - @ManyToOne - @JoinColumn(name = "attribute_id") - private Attribute attribute; - - @Column(name = "value") - private String value; - - @Id - @ManyToOne - @JoinColumn(name = "project_id") - private Project project; - - public ProjectAttribute() { - } - - public ProjectAttribute(Attribute attribute, String value, Project project) { - this.attribute = attribute; - this.value = value; - this.project = project; - } - - public Attribute getAttribute() { - return attribute; - } - - public void setAttribute(Attribute attribute) { - this.attribute = attribute; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public Project getProject() { - return project; - } - - public void setProject(Project project) { - this.project = project; - } - - public ProjectAttribute withAttribute(Attribute attribute) { - this.attribute = attribute; - return this; - } - - public ProjectAttribute withProject(Project project) { - this.project = project; - return this; - } - - public ProjectAttribute withValue(String value) { - this.value = value; - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectAttribute that = (ProjectAttribute) o; - return Objects.equals(attribute, that.attribute) && Objects.equals(value, that.value); - } - - @Override - public int hashCode() { - - return Objects.hash(attribute, value); - } + private static final long serialVersionUID = 1L; + + @Id + @ManyToOne + @JoinColumn(name = "attribute_id") + private Attribute attribute; + + @Column(name = "value") + private String value; + + @Id + @ManyToOne + @JoinColumn(name = "project_id") + private Project project; + + public ProjectAttribute() { + } + + public ProjectAttribute(Attribute attribute, String value, Project project) { + this.attribute = attribute; + this.value = value; + this.project = project; + } + + public Attribute getAttribute() { + return attribute; + } + + public void setAttribute(Attribute attribute) { + this.attribute = attribute; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public Project getProject() { + return project; + } + + public void setProject(Project project) { + this.project = project; + } + + public ProjectAttribute withAttribute(Attribute attribute) { + this.attribute = attribute; + return this; + } + + public ProjectAttribute withProject(Project project) { + this.project = project; + return this; + } + + public ProjectAttribute withValue(String value) { + this.value = value; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectAttribute that = (ProjectAttribute) o; + return Objects.equals(attribute, that.attribute) && Objects.equals(value, that.value); + } + + @Override + public int hashCode() { + + return Objects.hash(attribute, value); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectAttributeKey.java b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectAttributeKey.java index c7c23d9cf..921f62da3 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectAttributeKey.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectAttributeKey.java @@ -17,61 +17,60 @@ package com.epam.ta.reportportal.entity.project; import com.epam.ta.reportportal.entity.attribute.Attribute; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; - +import java.io.Serializable; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; -import java.io.Serializable; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; /** * @author Andrey Plisunov */ public class ProjectAttributeKey implements Serializable { - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = "project_id", nullable = false, insertable = false, updatable = false) - private Project project; + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "project_id", nullable = false, insertable = false, updatable = false) + private Project project; - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = "attribute_id", nullable = false, insertable = false, updatable = false) - private Attribute attribute; + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "attribute_id", nullable = false, insertable = false, updatable = false) + private Attribute attribute; - public Project getProject() { - return project; - } + public Project getProject() { + return project; + } - public void setProject(Project project) { - this.project = project; - } + public void setProject(Project project) { + this.project = project; + } - public Attribute getAttribute() { - return attribute; - } + public Attribute getAttribute() { + return attribute; + } - public void setAttribute(Attribute attribute) { - this.attribute = attribute; - } + public void setAttribute(Attribute attribute) { + this.attribute = attribute; + } - @Override - public int hashCode() { - return new HashCodeBuilder(17, 37).append(project).append(attribute).toHashCode(); - } + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(project).append(attribute).toHashCode(); + } - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof ProjectAttributeKey)) { - return false; - } + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ProjectAttributeKey)) { + return false; + } - ProjectAttributeKey projectAttributeKey = (ProjectAttributeKey) obj; + ProjectAttributeKey projectAttributeKey = (ProjectAttributeKey) obj; - return new EqualsBuilder().append(project.getId(), projectAttributeKey.project.getId()) - .append(attribute.getId(), projectAttributeKey.attribute.getId()) - .isEquals(); - } + return new EqualsBuilder().append(project.getId(), projectAttributeKey.project.getId()) + .append(attribute.getId(), projectAttributeKey.attribute.getId()) + .isEquals(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectInfo.java b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectInfo.java index 9cb874c10..1fa9d3fb3 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectInfo.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectInfo.java @@ -26,87 +26,87 @@ */ public class ProjectInfo implements Serializable { - public static final String USERS_QUANTITY = "usersQuantity"; - public static final String LAUNCHES_QUANTITY = "launchesQuantity"; - public static final String LAST_RUN = "lastRun"; + public static final String USERS_QUANTITY = "usersQuantity"; + public static final String LAUNCHES_QUANTITY = "launchesQuantity"; + public static final String LAST_RUN = "lastRun"; - private Long id; + private Long id; - private LocalDateTime creationDate; + private LocalDateTime creationDate; - private String name; + private String name; - private String projectType; + private String projectType; - private String organization; + private String organization; - private int usersQuantity; + private int usersQuantity; - private int launchesQuantity; + private int launchesQuantity; - private LocalDateTime lastRun; + private LocalDateTime lastRun; - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public LocalDateTime getCreationDate() { - return creationDate; - } + public LocalDateTime getCreationDate() { + return creationDate; + } - public void setCreationDate(LocalDateTime creationDate) { - this.creationDate = creationDate; - } + public void setCreationDate(LocalDateTime creationDate) { + this.creationDate = creationDate; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public String getProjectType() { - return projectType; - } + public String getProjectType() { + return projectType; + } - public void setProjectType(String projectType) { - this.projectType = projectType; - } + public void setProjectType(String projectType) { + this.projectType = projectType; + } - public String getOrganization() { - return organization; - } + public String getOrganization() { + return organization; + } - public void setOrganization(String organization) { - this.organization = organization; - } + public void setOrganization(String organization) { + this.organization = organization; + } - public int getUsersQuantity() { - return usersQuantity; - } + public int getUsersQuantity() { + return usersQuantity; + } - public void setUsersQuantity(int usersQuantity) { - this.usersQuantity = usersQuantity; - } + public void setUsersQuantity(int usersQuantity) { + this.usersQuantity = usersQuantity; + } - public int getLaunchesQuantity() { - return launchesQuantity; - } + public int getLaunchesQuantity() { + return launchesQuantity; + } - public void setLaunchesQuantity(int launchesQuantity) { - this.launchesQuantity = launchesQuantity; - } + public void setLaunchesQuantity(int launchesQuantity) { + this.launchesQuantity = launchesQuantity; + } - public LocalDateTime getLastRun() { - return lastRun; - } + public LocalDateTime getLastRun() { + return lastRun; + } - public void setLastRun(LocalDateTime lastRun) { - this.lastRun = lastRun; - } + public void setLastRun(LocalDateTime lastRun) { + this.lastRun = lastRun; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectIssueType.java b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectIssueType.java index e60d4a0ca..bb1a38609 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectIssueType.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectIssueType.java @@ -17,10 +17,14 @@ package com.epam.ta.reportportal.entity.project; import com.epam.ta.reportportal.entity.item.issue.IssueType; - -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; /** * @author Pavel Bortnik @@ -30,47 +34,47 @@ @IdClass(ProjectIssueTypeKey.class) public class ProjectIssueType implements Serializable { - @Id - @ManyToOne - @JoinColumn(name = "issue_type_id") - private IssueType issueType; + @Id + @ManyToOne + @JoinColumn(name = "issue_type_id") + private IssueType issueType; - @Id - @ManyToOne - @JoinColumn(name = "project_id") - private Project project; + @Id + @ManyToOne + @JoinColumn(name = "project_id") + private Project project; - public IssueType getIssueType() { - return issueType; - } + public IssueType getIssueType() { + return issueType; + } - public void setIssueType(IssueType issueType) { - this.issueType = issueType; - } + public void setIssueType(IssueType issueType) { + this.issueType = issueType; + } - public Project getProject() { - return project; - } + public Project getProject() { + return project; + } - public void setProject(Project project) { - this.project = project; - } + public void setProject(Project project) { + this.project = project; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectIssueType that = (ProjectIssueType) o; - return Objects.equals(issueType, that.issueType) && Objects.equals(project, that.project); - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectIssueType that = (ProjectIssueType) o; + return Objects.equals(issueType, that.issueType) && Objects.equals(project, that.project); + } - @Override - public int hashCode() { + @Override + public int hashCode() { - return Objects.hash(issueType, project); - } + return Objects.hash(issueType, project); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectIssueTypeKey.java b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectIssueTypeKey.java index 4ca1c7dc8..805d38722 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectIssueTypeKey.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectIssueTypeKey.java @@ -17,59 +17,58 @@ package com.epam.ta.reportportal.entity.project; import com.epam.ta.reportportal.entity.item.issue.IssueType; - +import java.io.Serializable; +import java.util.Objects; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; -import java.io.Serializable; -import java.util.Objects; /** * @author Pavel Bortnik */ public class ProjectIssueTypeKey implements Serializable { - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = "project_id", nullable = false, insertable = false, updatable = false) - private Project project; + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "project_id", nullable = false, insertable = false, updatable = false) + private Project project; - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = "issue_type_id", nullable = false, insertable = false, updatable = false) - private IssueType issueType; + @ManyToOne(fetch = FetchType.EAGER) + @JoinColumn(name = "issue_type_id", nullable = false, insertable = false, updatable = false) + private IssueType issueType; - public ProjectIssueTypeKey() { - } + public ProjectIssueTypeKey() { + } - public Project getProject() { - return project; - } + public Project getProject() { + return project; + } - public void setProject(Project project) { - this.project = project; - } + public void setProject(Project project) { + this.project = project; + } - public IssueType getIssueType() { - return issueType; - } + public IssueType getIssueType() { + return issueType; + } - public void setIssueType(IssueType issueType) { - this.issueType = issueType; - } + public void setIssueType(IssueType issueType) { + this.issueType = issueType; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectIssueTypeKey that = (ProjectIssueTypeKey) o; - return Objects.equals(project, that.project) && Objects.equals(issueType, that.issueType); - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectIssueTypeKey that = (ProjectIssueTypeKey) o; + return Objects.equals(project, that.project) && Objects.equals(issueType, that.issueType); + } - @Override - public int hashCode() { - return Objects.hash(project, issueType); - } + @Override + public int hashCode() { + return Objects.hash(project, issueType); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectRole.java b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectRole.java index c0db1e31a..b0c68771e 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectRole.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectRole.java @@ -24,34 +24,35 @@ */ public enum ProjectRole implements Comparable { - OPERATOR(0), - CUSTOMER(1), - MEMBER(2), - PROJECT_MANAGER(3); + OPERATOR(0), + CUSTOMER(1), + MEMBER(2), + PROJECT_MANAGER(3); - private int roleLevel; + private int roleLevel; - ProjectRole(int level) { - this.roleLevel = level; - } + ProjectRole(int level) { + this.roleLevel = level; + } - public boolean higherThan(ProjectRole other) { - return this.roleLevel > other.roleLevel; - } + public static Optional forName(final String name) { + return Arrays.stream(ProjectRole.values()).filter(role -> role.name().equalsIgnoreCase(name)) + .findAny(); + } - public boolean lowerThan(ProjectRole other) { - return this.roleLevel < other.roleLevel; - } + public boolean higherThan(ProjectRole other) { + return this.roleLevel > other.roleLevel; + } - public boolean sameOrHigherThan(ProjectRole other) { - return this.roleLevel >= other.roleLevel; - } + public boolean lowerThan(ProjectRole other) { + return this.roleLevel < other.roleLevel; + } - public boolean sameOrLowerThan(ProjectRole other) { - return this.roleLevel <= other.roleLevel; - } + public boolean sameOrHigherThan(ProjectRole other) { + return this.roleLevel >= other.roleLevel; + } - public static Optional forName(final String name) { - return Arrays.stream(ProjectRole.values()).filter(role -> role.name().equalsIgnoreCase(name)).findAny(); - } + public boolean sameOrLowerThan(ProjectRole other) { + return this.roleLevel <= other.roleLevel; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectUtils.java b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectUtils.java index dda50d37f..e1fa1cff6 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/ProjectUtils.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/ProjectUtils.java @@ -16,6 +16,11 @@ package com.epam.ta.reportportal.entity.project; +import static java.util.Arrays.asList; +import static java.util.Optional.ofNullable; +import static java.util.stream.Collectors.toSet; +import static java.util.stream.StreamSupport.stream; + import com.epam.ta.reportportal.commons.validation.Suppliers; import com.epam.ta.reportportal.entity.attribute.Attribute; import com.epam.ta.reportportal.entity.enums.ProjectAttributeEnum; @@ -28,17 +33,17 @@ import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.ws.model.ErrorType; import com.google.common.collect.Lists; - -import javax.annotation.Nullable; -import java.util.*; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; import java.util.function.Predicate; import java.util.regex.Pattern; import java.util.stream.Collectors; - -import static java.util.Arrays.asList; -import static java.util.Optional.ofNullable; -import static java.util.stream.Collectors.toSet; -import static java.util.stream.StreamSupport.stream; +import javax.annotation.Nullable; /** * Project related utility methods @@ -46,179 +51,194 @@ * @author Andrei_Ramanchuk */ public class ProjectUtils { - public static final String INIT_FROM = "reportportal@example.com"; - public static final String PERSONAL_PROJECT_POSTFIX_REGEX = "_personal(_?[0-9]+)?$"; - public static final String LINE_START_SYMBOL = "^"; - - private static final String OWNER = "OWNER"; - - private ProjectUtils() { - - } - - /** - * @return Generated default project configuration - */ - public static Set defaultProjectAttributes(Project project, Set defaultAttributes) { - - Map attributes = defaultAttributes.stream().collect(Collectors.toMap(Attribute::getName, a -> a)); - - Set projectAttributes = new HashSet<>(defaultAttributes.size()); - - Arrays.stream(ProjectAttributeEnum.values()) - .map(ProjectAttributeEnum::getAttribute) - .forEach(pa -> ofNullable(attributes.get(pa)).ifPresent(attr -> { - ProjectAttribute projectAttribute = new ProjectAttribute(); - projectAttribute.setAttribute(attr); - projectAttribute.setProject(project); - - projectAttribute.setValue(ProjectAttributeEnum.findByAttributeName(pa) - .orElseThrow(() -> new ReportPortalException(ErrorType.BAD_REQUEST_ERROR, - Suppliers.formattedSupplier("Attribute - {} was not found", pa).get() - )) - .getDefaultValue()); - - projectAttributes.add(projectAttribute); - })); - - return projectAttributes; - - } - - public static Set defaultIssueTypes(Project project, List defaultIssueTypes) { - - Map issueTypes = defaultIssueTypes.stream().collect(Collectors.toMap(IssueType::getLocator, i -> i)); - - Set projectIssueTypes = new HashSet<>(defaultIssueTypes.size()); - Arrays.stream(TestItemIssueGroup.values()) - .map(TestItemIssueGroup::getLocator) - .forEach(loc -> ofNullable(issueTypes.get(loc)).ifPresent(it -> { - ProjectIssueType projectIssueType = new ProjectIssueType(); - projectIssueType.setIssueType(it); - projectIssueType.setProject(project); - projectIssueTypes.add(projectIssueType); - })); - return projectIssueTypes; - } - - /** - * Exclude specified project recipients - * - * @param users - * @param project - * @return - */ - public static Project excludeProjectRecipients(Iterable users, Project project) { - if (users != null) { - Set toExclude = stream(users.spliterator(), false).map(user -> asList(user.getEmail().toLowerCase(), - user.getLogin().toLowerCase() - )).flatMap(List::stream).collect(toSet()); - /* Current recipients of specified project */ - Set cases = project.getSenderCases(); - if (null != cases) { - cases.stream().forEach(c -> { - // saved - list of saved user emails before changes - Set saved = c.getRecipients(); - c.setRecipients(saved.stream().filter(it -> !toExclude.contains(it.toLowerCase())).collect(Collectors.toSet())); - }); - project.setSenderCases(cases); - } - } - return project; - } - - /** - * Update specified project recipient - * - * @param oldEmail - * @param newEmail - * @param project - * @return - */ - public static Project updateProjectRecipients(String oldEmail, String newEmail, Project project) { - Set cases = project.getSenderCases(); - if ((null != cases) && (null != oldEmail) && (null != newEmail)) { - cases.stream().forEach(c -> { - Set saved = c.getRecipients(); - if (saved.stream().anyMatch(email -> email.equalsIgnoreCase(oldEmail))) { - c.setRecipients(saved.stream() - .filter(processRecipientsEmails(Lists.newArrayList(oldEmail))) - .collect(Collectors.toSet())); - c.getRecipients().add(newEmail); - } - }); - project.setSenderCases(cases); - } - return project; - } - - /** - * Checks if the user is assigned on project - * - * @param project Specified project - * @param user User login - * @return True, if exists - */ - public static boolean doesHaveUser(Project project, String user) { - return project.getUsers().stream().anyMatch(it -> user.equals(it.getUser().getLogin())); - } - - /** - * Finds UserConfig for specified login. Returns null - * if it doesn't exists. - * - * @param user Login for search - * @return UserConfig for specified login - */ - @Nullable - public static ProjectUser findUserConfigByLogin(Project project, String user) { - return project.getUsers().stream().filter(it -> user.equalsIgnoreCase(it.getUser().getLogin())).findAny().orElse(null); - } - - /** - * Checks if user is assigned to specified project - * - * @param user {@link User} - * @param projectId ID of project - * @return {@code true} if assigned, otherwise {@code false} - */ - public static boolean isAssignedToProject(User user, Long projectId) { - return user.getProjects().stream().anyMatch(it -> it.getProject().getId().equals(projectId)); - } - - public static Map getConfigParameters(Set projectAttributes) { - return ofNullable(projectAttributes).map(attributes -> attributes.stream() - .collect(Collectors.toMap(pa -> pa.getAttribute().getName(), ProjectAttribute::getValue))).orElseGet(Collections::emptyMap); - } - - public static Map getConfigParametersByPrefix(Set projectAttributes, String prefix) { - return ofNullable(projectAttributes).map(it -> it.stream() - .filter(pa -> pa.getAttribute().getName().startsWith(prefix)) - .collect(Collectors.toMap(pa -> pa.getAttribute().getName(), ProjectAttribute::getValue))).orElseGet(Collections::emptyMap); - } - - public static boolean isPersonalForUser(ProjectType projectType, String projectName, String username) { - return projectType == ProjectType.PERSONAL && Pattern.compile(LINE_START_SYMBOL + username + PERSONAL_PROJECT_POSTFIX_REGEX) - .matcher(projectName) - .matches(); - } - - public static Optional extractAttribute(Project project, ProjectAttributeEnum attribute) { - return project.getProjectAttributes() - .stream() - .filter(pa -> pa.getAttribute().getName().equalsIgnoreCase(attribute.getAttribute())) - .findFirst(); - } - - public static Optional extractAttributeValue(Project project, ProjectAttributeEnum attribute) { - return extractAttribute(project, attribute).map(ProjectAttribute::getValue); - } - - private static Predicate processRecipientsEmails(final Iterable emails) { - return input -> stream(emails.spliterator(), false).noneMatch(email -> email.equalsIgnoreCase(input)); - } - - public static String getOwner() { - return OWNER; - } + + public static final String INIT_FROM = "reportportal@example.com"; + public static final String PERSONAL_PROJECT_POSTFIX_REGEX = "_personal(_?[0-9]+)?$"; + public static final String LINE_START_SYMBOL = "^"; + + private static final String OWNER = "OWNER"; + + private ProjectUtils() { + + } + + /** + * @return Generated default project configuration + */ + public static Set defaultProjectAttributes(Project project, + Set defaultAttributes) { + + Map attributes = defaultAttributes.stream() + .collect(Collectors.toMap(Attribute::getName, a -> a)); + + Set projectAttributes = new HashSet<>(defaultAttributes.size()); + + Arrays.stream(ProjectAttributeEnum.values()) + .map(ProjectAttributeEnum::getAttribute) + .forEach(pa -> ofNullable(attributes.get(pa)).ifPresent(attr -> { + ProjectAttribute projectAttribute = new ProjectAttribute(); + projectAttribute.setAttribute(attr); + projectAttribute.setProject(project); + + projectAttribute.setValue(ProjectAttributeEnum.findByAttributeName(pa) + .orElseThrow(() -> new ReportPortalException(ErrorType.BAD_REQUEST_ERROR, + Suppliers.formattedSupplier("Attribute - {} was not found", pa).get() + )) + .getDefaultValue()); + + projectAttributes.add(projectAttribute); + })); + + return projectAttributes; + + } + + public static Set defaultIssueTypes(Project project, + List defaultIssueTypes) { + + Map issueTypes = defaultIssueTypes.stream() + .collect(Collectors.toMap(IssueType::getLocator, i -> i)); + + Set projectIssueTypes = new HashSet<>(defaultIssueTypes.size()); + Arrays.stream(TestItemIssueGroup.values()) + .map(TestItemIssueGroup::getLocator) + .forEach(loc -> ofNullable(issueTypes.get(loc)).ifPresent(it -> { + ProjectIssueType projectIssueType = new ProjectIssueType(); + projectIssueType.setIssueType(it); + projectIssueType.setProject(project); + projectIssueTypes.add(projectIssueType); + })); + return projectIssueTypes; + } + + /** + * Exclude specified project recipients + * + * @param users + * @param project + * @return + */ + public static Project excludeProjectRecipients(Iterable users, Project project) { + if (users != null) { + Set toExclude = stream(users.spliterator(), false).map( + user -> asList(user.getEmail().toLowerCase(), + user.getLogin().toLowerCase() + )).flatMap(List::stream).collect(toSet()); + /* Current recipients of specified project */ + Set cases = project.getSenderCases(); + if (null != cases) { + cases.stream().forEach(c -> { + // saved - list of saved user emails before changes + Set saved = c.getRecipients(); + c.setRecipients(saved.stream().filter(it -> !toExclude.contains(it.toLowerCase())) + .collect(Collectors.toSet())); + }); + project.setSenderCases(cases); + } + } + return project; + } + + /** + * Update specified project recipient + * + * @param oldEmail + * @param newEmail + * @param project + * @return + */ + public static Project updateProjectRecipients(String oldEmail, String newEmail, Project project) { + Set cases = project.getSenderCases(); + if ((null != cases) && (null != oldEmail) && (null != newEmail)) { + cases.stream().forEach(c -> { + Set saved = c.getRecipients(); + if (saved.stream().anyMatch(email -> email.equalsIgnoreCase(oldEmail))) { + c.setRecipients(saved.stream() + .filter(processRecipientsEmails(Lists.newArrayList(oldEmail))) + .collect(Collectors.toSet())); + c.getRecipients().add(newEmail); + } + }); + project.setSenderCases(cases); + } + return project; + } + + /** + * Checks if the user is assigned on project + * + * @param project Specified project + * @param user User login + * @return True, if exists + */ + public static boolean doesHaveUser(Project project, String user) { + return project.getUsers().stream().anyMatch(it -> user.equals(it.getUser().getLogin())); + } + + /** + * Finds UserConfig for specified login. Returns null if it doesn't exists. + * + * @param user Login for search + * @return UserConfig for specified login + */ + @Nullable + public static ProjectUser findUserConfigByLogin(Project project, String user) { + return project.getUsers().stream().filter(it -> user.equalsIgnoreCase(it.getUser().getLogin())) + .findAny().orElse(null); + } + + /** + * Checks if user is assigned to specified project + * + * @param user {@link User} + * @param projectId ID of project + * @return {@code true} if assigned, otherwise {@code false} + */ + public static boolean isAssignedToProject(User user, Long projectId) { + return user.getProjects().stream().anyMatch(it -> it.getProject().getId().equals(projectId)); + } + + public static Map getConfigParameters(Set projectAttributes) { + return ofNullable(projectAttributes).map(attributes -> attributes.stream() + .collect(Collectors.toMap(pa -> pa.getAttribute().getName(), ProjectAttribute::getValue))) + .orElseGet(Collections::emptyMap); + } + + public static Map getConfigParametersByPrefix( + Set projectAttributes, String prefix) { + return ofNullable(projectAttributes).map(it -> it.stream() + .filter(pa -> pa.getAttribute().getName().startsWith(prefix)) + .collect(Collectors.toMap(pa -> pa.getAttribute().getName(), ProjectAttribute::getValue))) + .orElseGet(Collections::emptyMap); + } + + public static boolean isPersonalForUser(ProjectType projectType, String projectName, + String username) { + return projectType == ProjectType.PERSONAL && Pattern.compile( + LINE_START_SYMBOL + username + PERSONAL_PROJECT_POSTFIX_REGEX) + .matcher(projectName) + .matches(); + } + + public static Optional extractAttribute(Project project, + ProjectAttributeEnum attribute) { + return project.getProjectAttributes() + .stream() + .filter(pa -> pa.getAttribute().getName().equalsIgnoreCase(attribute.getAttribute())) + .findFirst(); + } + + public static Optional extractAttributeValue(Project project, + ProjectAttributeEnum attribute) { + return extractAttribute(project, attribute).map(ProjectAttribute::getValue); + } + + private static Predicate processRecipientsEmails(final Iterable emails) { + return input -> stream(emails.spliterator(), false).noneMatch( + email -> email.equalsIgnoreCase(input)); + } + + public static String getOwner() { + return OWNER; + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/email/LaunchAttributeRule.java b/src/main/java/com/epam/ta/reportportal/entity/project/email/LaunchAttributeRule.java index c068f84be..9d81c7384 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/email/LaunchAttributeRule.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/email/LaunchAttributeRule.java @@ -16,9 +16,16 @@ package com.epam.ta.reportportal.entity.project.email; -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; /** * @author Ivan Budayeu @@ -27,66 +34,67 @@ @Table(name = "launch_attribute_rules") public class LaunchAttributeRule implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @Column(name = "key") - private String key; - - @Column(name = "value") - private String value; - - @ManyToOne - @JoinColumn(name = "sender_case_id") - private SenderCase senderCase; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public SenderCase getSenderCase() { - return senderCase; - } - - public void setSenderCase(SenderCase senderCase) { - this.senderCase = senderCase; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LaunchAttributeRule that = (LaunchAttributeRule) o; - return Objects.equals(id, that.id) && Objects.equals(key, that.key) && Objects.equals(value, that.value); - } - - @Override - public int hashCode() { - return Objects.hash(id, key, value); - } + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "key") + private String key; + + @Column(name = "value") + private String value; + + @ManyToOne + @JoinColumn(name = "sender_case_id") + private SenderCase senderCase; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public SenderCase getSenderCase() { + return senderCase; + } + + public void setSenderCase(SenderCase senderCase) { + this.senderCase = senderCase; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LaunchAttributeRule that = (LaunchAttributeRule) o; + return Objects.equals(id, that.id) && Objects.equals(key, that.key) && Objects.equals(value, + that.value); + } + + @Override + public int hashCode() { + return Objects.hash(id, key, value); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/email/ProjectInfoWidget.java b/src/main/java/com/epam/ta/reportportal/entity/project/email/ProjectInfoWidget.java index 6b255cebb..72cb524d5 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/email/ProjectInfoWidget.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/email/ProjectInfoWidget.java @@ -25,25 +25,26 @@ * @author Andrei_Ramanchuk */ public enum ProjectInfoWidget { - INVESTIGATED("investigated"), - CASES_STATISTIC("casesStats"), - LAUNCHES_QUANTITY("launchesQuantity"), - ISSUES_CHART("issuesChart"), - BUGS_PERCENTAGE("bugsPercentage"), - ACTIVITIES("activities"), - LAST_LAUNCH("lastLaunch"); + INVESTIGATED("investigated"), + CASES_STATISTIC("casesStats"), + LAUNCHES_QUANTITY("launchesQuantity"), + ISSUES_CHART("issuesChart"), + BUGS_PERCENTAGE("bugsPercentage"), + ACTIVITIES("activities"), + LAST_LAUNCH("lastLaunch"); - private String widgetCode; + private String widgetCode; - ProjectInfoWidget(String code) { - this.widgetCode = code; - } + ProjectInfoWidget(String code) { + this.widgetCode = code; + } - public String getWidgetCode() { - return widgetCode; - } + public static Optional findByCode(String code) { + return Arrays.stream(ProjectInfoWidget.values()) + .filter(type -> type.getWidgetCode().equalsIgnoreCase(code)).findAny(); + } - public static Optional findByCode(String code) { - return Arrays.stream(ProjectInfoWidget.values()).filter(type -> type.getWidgetCode().equalsIgnoreCase(code)).findAny(); - } + public String getWidgetCode() { + return widgetCode; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java b/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java index f1647e840..35fdbb50c 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java @@ -19,12 +19,26 @@ import com.epam.ta.reportportal.entity.enums.PostgreSQLEnumType; import com.epam.ta.reportportal.entity.enums.SendCase; import com.epam.ta.reportportal.entity.project.Project; -import org.hibernate.annotations.Type; -import org.hibernate.annotations.TypeDef; - -import javax.persistence.*; import java.io.Serializable; import java.util.Set; +import javax.persistence.CascadeType; +import javax.persistence.CollectionTable; +import javax.persistence.Column; +import javax.persistence.ElementCollection; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.OrderBy; +import javax.persistence.Table; +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; /** * @author Ivan Budayeu @@ -34,112 +48,114 @@ @TypeDef(name = "pqsql_enum", typeClass = PostgreSQLEnumType.class) public class SenderCase implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @Column(name = "rule_name", nullable = false, length = 55) - private String ruleName; - - @ElementCollection(fetch = FetchType.EAGER) - @CollectionTable(name = "recipients", joinColumns = @JoinColumn(name = "sender_case_id")) - @Column(name = "recipient") - private Set recipients; - - @ElementCollection(fetch = FetchType.EAGER) - @CollectionTable(name = "launch_names", joinColumns = @JoinColumn(name = "sender_case_id")) - @Column(name = "launch_name") - private Set launchNames; - - @OneToMany(mappedBy = "senderCase", cascade = { CascadeType.PERSIST, CascadeType.MERGE }, orphanRemoval = true, fetch = FetchType.EAGER) - @OrderBy - private Set launchAttributeRules; - - @Enumerated(EnumType.STRING) - @Column(name = "send_case") - @Type(type = "pqsql_enum") - private SendCase sendCase; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "project_id", nullable = false) - private Project project; - - @Column(name = "enabled") - private boolean enabled; - - public SenderCase() { - } - - public SenderCase(Set recipients, Set launchNames, Set launchAttributeRules, SendCase sendCase, - boolean enabled) { - this.recipients = recipients; - this.launchNames = launchNames; - this.launchAttributeRules = launchAttributeRules; - this.sendCase = sendCase; - this.enabled = enabled; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getRuleName() { - return ruleName; - } - - public void setRuleName(String ruleName) { - this.ruleName = ruleName; - } - - public Set getRecipients() { - return recipients; - } - - public void setRecipients(Set recipients) { - this.recipients = recipients; - } - - public Set getLaunchNames() { - return launchNames; - } - - public void setLaunchNames(Set launchNames) { - this.launchNames = launchNames; - } - - public Set getLaunchAttributeRules() { - return launchAttributeRules; - } - - public void setLaunchAttributeRules(Set launchAttributeRules) { - this.launchAttributeRules = launchAttributeRules; - } - - public SendCase getSendCase() { - return sendCase; - } - - public void setSendCase(SendCase sendCase) { - this.sendCase = sendCase; - } - - public Project getProject() { - return project; - } - - public void setProject(Project project) { - this.project = project; - } - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "rule_name", nullable = false, length = 55) + private String ruleName; + + @ElementCollection(fetch = FetchType.EAGER) + @CollectionTable(name = "recipients", joinColumns = @JoinColumn(name = "sender_case_id")) + @Column(name = "recipient") + private Set recipients; + + @ElementCollection(fetch = FetchType.EAGER) + @CollectionTable(name = "launch_names", joinColumns = @JoinColumn(name = "sender_case_id")) + @Column(name = "launch_name") + private Set launchNames; + + @OneToMany(mappedBy = "senderCase", cascade = {CascadeType.PERSIST, + CascadeType.MERGE}, orphanRemoval = true, fetch = FetchType.EAGER) + @OrderBy + private Set launchAttributeRules; + + @Enumerated(EnumType.STRING) + @Column(name = "send_case") + @Type(type = "pqsql_enum") + private SendCase sendCase; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "project_id", nullable = false) + private Project project; + + @Column(name = "enabled") + private boolean enabled; + + public SenderCase() { + } + + public SenderCase(Set recipients, Set launchNames, + Set launchAttributeRules, SendCase sendCase, + boolean enabled) { + this.recipients = recipients; + this.launchNames = launchNames; + this.launchAttributeRules = launchAttributeRules; + this.sendCase = sendCase; + this.enabled = enabled; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRuleName() { + return ruleName; + } + + public void setRuleName(String ruleName) { + this.ruleName = ruleName; + } + + public Set getRecipients() { + return recipients; + } + + public void setRecipients(Set recipients) { + this.recipients = recipients; + } + + public Set getLaunchNames() { + return launchNames; + } + + public void setLaunchNames(Set launchNames) { + this.launchNames = launchNames; + } + + public Set getLaunchAttributeRules() { + return launchAttributeRules; + } + + public void setLaunchAttributeRules(Set launchAttributeRules) { + this.launchAttributeRules = launchAttributeRules; + } + + public SendCase getSendCase() { + return sendCase; + } + + public void setSendCase(SendCase sendCase) { + this.sendCase = sendCase; + } + + public Project getProject() { + return project; + } + + public void setProject(Project project) { + this.project = project; + } + + public boolean isEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/statistics/Statistics.java b/src/main/java/com/epam/ta/reportportal/entity/statistics/Statistics.java index 3f3f1635c..620ffd5fb 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/statistics/Statistics.java +++ b/src/main/java/com/epam/ta/reportportal/entity/statistics/Statistics.java @@ -16,9 +16,18 @@ package com.epam.ta.reportportal.entity.statistics; -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; /** * @author Ivan Budayeu @@ -27,93 +36,94 @@ @Table(name = "statistics") public class Statistics implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "s_id") - private Long id; - - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.EAGER) - @JoinColumn(name = "statistics_field_id") - private StatisticsField statisticsField; - - @Column(name = "s_counter") - private int counter; - - @Column(name = "launch_id") - private Long launchId; - - @Column(name = "item_id") - private Long itemId; - - public Statistics() { - } - - public Statistics(StatisticsField statisticsField, int counter) { - this.statisticsField = statisticsField; - this.counter = counter; - } - - public Statistics(StatisticsField statisticsField, int counter, Long launchId) { - this.statisticsField = statisticsField; - this.counter = counter; - this.launchId = launchId; - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public StatisticsField getStatisticsField() { - return statisticsField; - } - - public void setStatisticsField(StatisticsField statisticsField) { - this.statisticsField = statisticsField; - } - - public int getCounter() { - return counter; - } - - public void setCounter(int counter) { - this.counter = counter; - } - - public Long getLaunchId() { - return launchId; - } - - public void setLaunchId(Long launchId) { - this.launchId = launchId; - } - - public Long getItemId() { - return itemId; - } - - public void setItemId(Long itemId) { - this.itemId = itemId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Statistics that = (Statistics) o; - return counter == that.counter && Objects.equals(id, that.id) && Objects.equals(statisticsField, that.statisticsField) - && Objects.equals(launchId, that.launchId) && Objects.equals(itemId, that.itemId); - } - - @Override - public int hashCode() { - return Objects.hash(id, statisticsField, counter, launchId, itemId); - } + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "s_id") + private Long id; + + @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.EAGER) + @JoinColumn(name = "statistics_field_id") + private StatisticsField statisticsField; + + @Column(name = "s_counter") + private int counter; + + @Column(name = "launch_id") + private Long launchId; + + @Column(name = "item_id") + private Long itemId; + + public Statistics() { + } + + public Statistics(StatisticsField statisticsField, int counter) { + this.statisticsField = statisticsField; + this.counter = counter; + } + + public Statistics(StatisticsField statisticsField, int counter, Long launchId) { + this.statisticsField = statisticsField; + this.counter = counter; + this.launchId = launchId; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public StatisticsField getStatisticsField() { + return statisticsField; + } + + public void setStatisticsField(StatisticsField statisticsField) { + this.statisticsField = statisticsField; + } + + public int getCounter() { + return counter; + } + + public void setCounter(int counter) { + this.counter = counter; + } + + public Long getLaunchId() { + return launchId; + } + + public void setLaunchId(Long launchId) { + this.launchId = launchId; + } + + public Long getItemId() { + return itemId; + } + + public void setItemId(Long itemId) { + this.itemId = itemId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Statistics that = (Statistics) o; + return counter == that.counter && Objects.equals(id, that.id) && Objects.equals(statisticsField, + that.statisticsField) + && Objects.equals(launchId, that.launchId) && Objects.equals(itemId, that.itemId); + } + + @Override + public int hashCode() { + return Objects.hash(id, statisticsField, counter, launchId, itemId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/statistics/StatisticsField.java b/src/main/java/com/epam/ta/reportportal/entity/statistics/StatisticsField.java index 5ee3344f3..3c27727db 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/statistics/StatisticsField.java +++ b/src/main/java/com/epam/ta/reportportal/entity/statistics/StatisticsField.java @@ -16,9 +16,14 @@ package com.epam.ta.reportportal.entity.statistics; -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; /** * @author Ivan Budaev @@ -27,52 +32,52 @@ @Table(name = "statistics_field") public class StatisticsField implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "sf_id") - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "sf_id") + private Long id; - @Column(name = "name") - private String name; + @Column(name = "name") + private String name; - public StatisticsField() { + public StatisticsField() { - } + } - public StatisticsField(String name) { - this.name = name; - } + public StatisticsField(String name) { + this.name = name; + } - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - StatisticsField that = (StatisticsField) o; - return Objects.equals(id, that.id) && Objects.equals(name, that.name); - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StatisticsField that = (StatisticsField) o; + return Objects.equals(id, that.id) && Objects.equals(name, that.name); + } - @Override - public int hashCode() { - return Objects.hash(id, name); - } + @Override + public int hashCode() { + return Objects.hash(id, name); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/user/ProjectUser.java b/src/main/java/com/epam/ta/reportportal/entity/user/ProjectUser.java index 1deee46b7..2f79b76ee 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/user/ProjectUser.java +++ b/src/main/java/com/epam/ta/reportportal/entity/user/ProjectUser.java @@ -19,13 +19,19 @@ import com.epam.ta.reportportal.entity.enums.PostgreSQLEnumType; import com.epam.ta.reportportal.entity.project.Project; import com.epam.ta.reportportal.entity.project.ProjectRole; -import org.hibernate.annotations.Type; -import org.hibernate.annotations.TypeDef; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.EmbeddedId; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.ManyToOne; +import javax.persistence.MapsId; +import javax.persistence.Table; +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; /** * @author Andrei Varabyeu @@ -35,89 +41,90 @@ @Table(name = "project_user", schema = "public") public class ProjectUser implements Serializable { - @EmbeddedId - private ProjectUserId id = new ProjectUserId(); - - @ManyToOne(fetch = FetchType.LAZY) - @MapsId("projectId") - private Project project; - - @ManyToOne(fetch = FetchType.LAZY) - @MapsId("userId") - private User user; - - @Column(name = "project_role") - @Enumerated(EnumType.STRING) - @Type(type = "pqsql_enum") - private ProjectRole projectRole; - - public ProjectUserId getId() { - return id; - } - - public void setId(ProjectUserId id) { - this.id = id; - } - - public Project getProject() { - return project; - } - - public void setProject(Project project) { - this.project = project; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public ProjectRole getProjectRole() { - return projectRole; - } - - public void setProjectRole(ProjectRole projectRole) { - this.projectRole = projectRole; - } - - public ProjectUser withProjectUserId(ProjectUserId id) { - this.id = id; - return this; - } - - public ProjectUser withUser(User user) { - this.user = user; - return this; - } - - public ProjectUser withProject(Project project) { - this.project = project; - return this; - } - - public ProjectUser withProjectRole(ProjectRole projectRole) { - this.projectRole = projectRole; - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectUser that = (ProjectUser) o; - return Objects.equals(id, that.id) && Objects.equals(project, that.project) && Objects.equals(user, that.user) - && projectRole == that.projectRole; - } - - @Override - public int hashCode() { - return Objects.hash(id, project, user, projectRole); - } + @EmbeddedId + private ProjectUserId id = new ProjectUserId(); + + @ManyToOne(fetch = FetchType.LAZY) + @MapsId("projectId") + private Project project; + + @ManyToOne(fetch = FetchType.LAZY) + @MapsId("userId") + private User user; + + @Column(name = "project_role") + @Enumerated(EnumType.STRING) + @Type(type = "pqsql_enum") + private ProjectRole projectRole; + + public ProjectUserId getId() { + return id; + } + + public void setId(ProjectUserId id) { + this.id = id; + } + + public Project getProject() { + return project; + } + + public void setProject(Project project) { + this.project = project; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public ProjectRole getProjectRole() { + return projectRole; + } + + public void setProjectRole(ProjectRole projectRole) { + this.projectRole = projectRole; + } + + public ProjectUser withProjectUserId(ProjectUserId id) { + this.id = id; + return this; + } + + public ProjectUser withUser(User user) { + this.user = user; + return this; + } + + public ProjectUser withProject(Project project) { + this.project = project; + return this; + } + + public ProjectUser withProjectRole(ProjectRole projectRole) { + this.projectRole = projectRole; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectUser that = (ProjectUser) o; + return Objects.equals(id, that.id) && Objects.equals(project, that.project) && Objects.equals( + user, that.user) + && projectRole == that.projectRole; + } + + @Override + public int hashCode() { + return Objects.hash(id, project, user, projectRole); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/user/ProjectUserId.java b/src/main/java/com/epam/ta/reportportal/entity/user/ProjectUserId.java index 6914f8836..ebf7e5eff 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/user/ProjectUserId.java +++ b/src/main/java/com/epam/ta/reportportal/entity/user/ProjectUserId.java @@ -16,10 +16,10 @@ package com.epam.ta.reportportal.entity.user; -import javax.persistence.Column; -import javax.persistence.Embeddable; import java.io.Serializable; import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Embeddable; /** * @author Andrei Varabyeu @@ -27,46 +27,46 @@ @Embeddable public class ProjectUserId implements Serializable { - @Column(name = "user_id") - private Long userId; + @Column(name = "user_id") + private Long userId; - @Column(name = "project_id") - private Long projectId; + @Column(name = "project_id") + private Long projectId; - public ProjectUserId() { - } + public ProjectUserId() { + } - public Long getUserId() { - return userId; - } + public Long getUserId() { + return userId; + } - public void setUserId(Long userId) { - this.userId = userId; - } + public void setUserId(Long userId) { + this.userId = userId; + } - public Long getProjectId() { - return projectId; - } + public Long getProjectId() { + return projectId; + } - public void setProjectId(Long projectId) { - this.projectId = projectId; - } + public void setProjectId(Long projectId) { + this.projectId = projectId; + } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ProjectUserId that = (ProjectUserId) o; - return Objects.equals(userId, that.userId) && Objects.equals(projectId, that.projectId); - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectUserId that = (ProjectUserId) o; + return Objects.equals(userId, that.userId) && Objects.equals(projectId, that.projectId); + } - @Override - public int hashCode() { + @Override + public int hashCode() { - return Objects.hash(userId, projectId); - } + return Objects.hash(userId, projectId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/user/RestorePasswordBid.java b/src/main/java/com/epam/ta/reportportal/entity/user/RestorePasswordBid.java index e7545dca1..453baefc9 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/user/RestorePasswordBid.java +++ b/src/main/java/com/epam/ta/reportportal/entity/user/RestorePasswordBid.java @@ -17,13 +17,14 @@ package com.epam.ta.reportportal.entity.user; import com.epam.ta.reportportal.entity.Modifiable; -import org.springframework.data.annotation.LastModifiedDate; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -import javax.persistence.*; import java.io.Serializable; import java.util.Date; import java.util.Objects; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import org.springframework.data.annotation.LastModifiedDate; /** * @author Ivan Budaev @@ -32,73 +33,74 @@ @Table(name = "restore_password_bid") public class RestorePasswordBid implements Serializable, Modifiable { - /** - * Generated UID - */ - private static final long serialVersionUID = 5010586530900139611L; - - @Id - private String uuid; - - @LastModifiedDate - @Column(name = LAST_MODIFIED) - private Date lastModifiedDate; - - @Column(name = "email") - private String email; - - public String getUuid() { - return uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - @Override - public Date getLastModified() { - return lastModifiedDate; - } - - public void setLastModifiedDate(Date lastModifiedDate) { - this.lastModifiedDate = lastModifiedDate; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RestorePasswordBid that = (RestorePasswordBid) o; - return Objects.equals(uuid, that.uuid) && Objects.equals(lastModifiedDate, that.lastModifiedDate) && Objects.equals( - email, - that.email - ); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, lastModifiedDate, email); - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("RestorePasswordBid{"); - sb.append("uuid='").append(uuid).append('\''); - sb.append(", lastModifiedDate=").append(lastModifiedDate); - sb.append(", email='").append(email).append('\''); - sb.append('}'); - return sb.toString(); - } + /** + * Generated UID + */ + private static final long serialVersionUID = 5010586530900139611L; + + @Id + private String uuid; + + @LastModifiedDate + @Column(name = LAST_MODIFIED) + private Date lastModifiedDate; + + @Column(name = "email") + private String email; + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + @Override + public Date getLastModified() { + return lastModifiedDate; + } + + public void setLastModifiedDate(Date lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestorePasswordBid that = (RestorePasswordBid) o; + return Objects.equals(uuid, that.uuid) && Objects.equals(lastModifiedDate, + that.lastModifiedDate) && Objects.equals( + email, + that.email + ); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, lastModifiedDate, email); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("RestorePasswordBid{"); + sb.append("uuid='").append(uuid).append('\''); + sb.append(", lastModifiedDate=").append(lastModifiedDate); + sb.append(", email='").append(email).append('\''); + sb.append('}'); + return sb.toString(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/user/StoredAccessToken.java b/src/main/java/com/epam/ta/reportportal/entity/user/StoredAccessToken.java index 6e6e452db..5dbb2101b 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/user/StoredAccessToken.java +++ b/src/main/java/com/epam/ta/reportportal/entity/user/StoredAccessToken.java @@ -16,8 +16,13 @@ package com.epam.ta.reportportal.entity.user; -import javax.persistence.*; import java.io.Serializable; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; /** * @author Pavel Bortnik @@ -26,105 +31,105 @@ @Table(name = "oauth_access_token", schema = "public") public class StoredAccessToken implements Serializable { - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id") - private Long id; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Long id; - @Column(name = "token_id") - private String tokenId; + @Column(name = "token_id") + private String tokenId; - @Column(name = "token") - private byte[] token; + @Column(name = "token") + private byte[] token; - @Column(name = "authentication_id") - private String authenticationId; + @Column(name = "authentication_id") + private String authenticationId; - @Column(name = "username") - private String userName; + @Column(name = "username") + private String userName; - @Column(name = "user_id") - private Long userId; + @Column(name = "user_id") + private Long userId; - @Column(name = "client_id") - private String clientId; + @Column(name = "client_id") + private String clientId; - @Column(name = "authentication") - private byte[] authentication; + @Column(name = "authentication") + private byte[] authentication; - @Column(name = "refresh_token") - private String refreshToken; + @Column(name = "refresh_token") + private String refreshToken; - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public String getTokenId() { - return tokenId; - } + public String getTokenId() { + return tokenId; + } - public void setTokenId(String tokenId) { - this.tokenId = tokenId; - } + public void setTokenId(String tokenId) { + this.tokenId = tokenId; + } - public byte[] getToken() { - return token; - } + public byte[] getToken() { + return token; + } - public void setToken(byte[] token) { - this.token = token; - } + public void setToken(byte[] token) { + this.token = token; + } - public String getAuthenticationId() { - return authenticationId; - } + public String getAuthenticationId() { + return authenticationId; + } - public void setAuthenticationId(String authenticationId) { - this.authenticationId = authenticationId; - } + public void setAuthenticationId(String authenticationId) { + this.authenticationId = authenticationId; + } - public String getUserName() { - return userName; - } + public String getUserName() { + return userName; + } - public void setUserName(String userName) { - this.userName = userName; - } + public void setUserName(String userName) { + this.userName = userName; + } - public Long getUserId() { - return userId; - } + public Long getUserId() { + return userId; + } - public void setUserId(Long userId) { - this.userId = userId; - } + public void setUserId(Long userId) { + this.userId = userId; + } - public String getClientId() { - return clientId; - } + public String getClientId() { + return clientId; + } - public void setClientId(String clientId) { - this.clientId = clientId; - } + public void setClientId(String clientId) { + this.clientId = clientId; + } - public byte[] getAuthentication() { - return authentication; - } + public byte[] getAuthentication() { + return authentication; + } - public void setAuthentication(byte[] authentication) { - this.authentication = authentication; - } + public void setAuthentication(byte[] authentication) { + this.authentication = authentication; + } - public String getRefreshToken() { - return refreshToken; - } + public String getRefreshToken() { + return refreshToken; + } - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } + public void setRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/user/User.java b/src/main/java/com/epam/ta/reportportal/entity/user/User.java index eb1a33a0e..2c3e2208a 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/user/User.java +++ b/src/main/java/com/epam/ta/reportportal/entity/user/User.java @@ -18,13 +18,22 @@ import com.epam.ta.reportportal.entity.Metadata; import com.google.common.collect.Sets; -import org.hibernate.annotations.Type; -import org.hibernate.annotations.TypeDef; - -import javax.persistence.*; import java.io.Serializable; import java.util.Objects; import java.util.Set; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; /** * @author Andrei Varabyeu @@ -34,167 +43,172 @@ @Table(name = "users", schema = "public") public class User implements Serializable { - private static final long serialVersionUID = 923392981; - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id", unique = true, nullable = false, precision = 64) - private Long id; - - @Column(name = "login") - private String login; - - @Column(name = "password") - private String password; - - @Column(name = "email") - private String email; - - @Column(name = "role") - @Enumerated(EnumType.STRING) - private UserRole role; - - @Column(name = "full_name") - private String fullName; - - @Column(name = "expired") - private boolean isExpired; - - @Column(name = "metadata") - @Type(type = "meta") - private Metadata metadata; - - @Column(name = "attachment") - private String attachment; + private static final long serialVersionUID = 923392981; - @Column(name = "attachment_thumbnail") - private String attachmentThumbnail; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", unique = true, nullable = false, precision = 64) + private Long id; - @Column(name = "type") - private UserType userType; + @Column(name = "login") + private String login; - @OneToMany(fetch = FetchType.LAZY, mappedBy = "user", cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) - private Set projects = Sets.newHashSet(); + @Column(name = "password") + private String password; - public User() { - } + @Column(name = "email") + private String email; - public Long getId() { - return this.id; - } + @Column(name = "role") + @Enumerated(EnumType.STRING) + private UserRole role; - public void setId(Long id) { - this.id = id; - } + @Column(name = "full_name") + private String fullName; - public String getLogin() { - return this.login; - } + @Column(name = "expired") + private boolean isExpired; - public void setLogin(String login) { - this.login = login; - } + @Column(name = "metadata") + @Type(type = "meta") + private Metadata metadata; - public String getPassword() { - return this.password; - } + @Column(name = "attachment") + private String attachment; - public void setPassword(String password) { - this.password = password; - } + @Column(name = "attachment_thumbnail") + private String attachmentThumbnail; - public String getEmail() { - return this.email; - } + @Column(name = "type") + private UserType userType; - public void setEmail(String email) { - this.email = email; - } + @OneToMany(fetch = FetchType.LAZY, mappedBy = "user", cascade = {CascadeType.PERSIST, + CascadeType.MERGE, CascadeType.REFRESH}) + private Set projects = Sets.newHashSet(); - public UserRole getRole() { - return role; - } + public User() { + } - public void setRole(UserRole role) { - this.role = role; - } + public Long getId() { + return this.id; + } - public Set getProjects() { - return projects; - } + public void setId(Long id) { + this.id = id; + } - public void setProjects(Set projects) { - this.projects = projects; - } + public String getLogin() { + return this.login; + } - public String getFullName() { - return this.fullName; - } + public void setLogin(String login) { + this.login = login; + } - public void setFullName(String fullName) { - this.fullName = fullName; - } - - public boolean isExpired() { - return isExpired; - } - - public void setExpired(boolean expired) { - isExpired = expired; - } - - public String getAttachment() { - return attachment; - } - - public void setAttachment(String attachment) { - this.attachment = attachment; - } - - public String getAttachmentThumbnail() { - return attachmentThumbnail; - } - - public void setAttachmentThumbnail(String attachmentThumbnail) { - this.attachmentThumbnail = attachmentThumbnail; - } - - public UserType getUserType() { - return userType; - } - - public void setUserType(UserType userType) { - this.userType = userType; - } - - public Metadata getMetadata() { - return metadata; - } - - public void setMetadata(Metadata metadata) { - this.metadata = metadata; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return isExpired == user.isExpired && Objects.equals(id, user.id) && Objects.equals(login, user.login) && Objects.equals(password, - user.password - ) && Objects.equals(email, user.email) && role == user.role && Objects.equals(fullName, user.fullName) && Objects.equals(metadata, - user.metadata - ) && Objects.equals(attachment, user.attachment) && Objects.equals(attachmentThumbnail, user.attachmentThumbnail) - && userType == user.userType; - } - - @Override - public int hashCode() { - return Objects.hash(id, login, password, email, role, fullName, isExpired, metadata, attachment, attachmentThumbnail, userType); - } + public String getPassword() { + return this.password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getEmail() { + return this.email; + } + + public void setEmail(String email) { + this.email = email; + } + + public UserRole getRole() { + return role; + } + + public void setRole(UserRole role) { + this.role = role; + } + + public Set getProjects() { + return projects; + } + + public void setProjects(Set projects) { + this.projects = projects; + } + + public String getFullName() { + return this.fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public boolean isExpired() { + return isExpired; + } + + public void setExpired(boolean expired) { + isExpired = expired; + } + + public String getAttachment() { + return attachment; + } + + public void setAttachment(String attachment) { + this.attachment = attachment; + } + + public String getAttachmentThumbnail() { + return attachmentThumbnail; + } + + public void setAttachmentThumbnail(String attachmentThumbnail) { + this.attachmentThumbnail = attachmentThumbnail; + } + + public UserType getUserType() { + return userType; + } + + public void setUserType(UserType userType) { + this.userType = userType; + } + + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return isExpired == user.isExpired && Objects.equals(id, user.id) && Objects.equals(login, + user.login) && Objects.equals(password, + user.password + ) && Objects.equals(email, user.email) && role == user.role && Objects.equals(fullName, + user.fullName) && Objects.equals(metadata, + user.metadata + ) && Objects.equals(attachment, user.attachment) && Objects.equals(attachmentThumbnail, + user.attachmentThumbnail) + && userType == user.userType; + } + + @Override + public int hashCode() { + return Objects.hash(id, login, password, email, role, fullName, isExpired, metadata, attachment, + attachmentThumbnail, userType); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/user/UserCreationBid.java b/src/main/java/com/epam/ta/reportportal/entity/user/UserCreationBid.java index 45854dccb..c2eec05d7 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/user/UserCreationBid.java +++ b/src/main/java/com/epam/ta/reportportal/entity/user/UserCreationBid.java @@ -18,15 +18,18 @@ import com.epam.ta.reportportal.entity.Metadata; import com.epam.ta.reportportal.entity.Modifiable; +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EntityListeners; +import javax.persistence.Id; +import javax.persistence.Table; import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.jpa.domain.support.AuditingEntityListener; -import javax.persistence.*; -import java.io.Serializable; -import java.util.Date; - /** * @author Ivan Budaev */ @@ -36,73 +39,73 @@ @EntityListeners(AuditingEntityListener.class) public class UserCreationBid implements Serializable, Modifiable { - @Id - @Column(name = "uuid") - private String uuid; + @Id + @Column(name = "uuid") + private String uuid; - @LastModifiedDate - @Column(name = LAST_MODIFIED) - private Date lastModified; + @LastModifiedDate + @Column(name = LAST_MODIFIED) + private Date lastModified; - @Column(name = "email") - private String email; + @Column(name = "email") + private String email; - @Column(name = "project_name") - private String projectName; + @Column(name = "project_name") + private String projectName; - @Column(name = "role") - private String role; + @Column(name = "role") + private String role; - @Type(type = "json") - @Column(name = "metadata") - private Metadata metadata; + @Type(type = "json") + @Column(name = "metadata") + private Metadata metadata; - public String getUuid() { - return uuid; - } + public String getUuid() { + return uuid; + } - public void setUuid(String uuid) { - this.uuid = uuid; - } + public void setUuid(String uuid) { + this.uuid = uuid; + } - public String getEmail() { - return email; - } + public String getEmail() { + return email; + } - public void setEmail(String email) { - this.email = email; - } + public void setEmail(String email) { + this.email = email; + } - public String getProjectName() { - return projectName; - } + public String getProjectName() { + return projectName; + } - public void setProjectName(String projectName) { - this.projectName = projectName; - } + public void setProjectName(String projectName) { + this.projectName = projectName; + } - public String getRole() { - return role; - } + public String getRole() { + return role; + } - public void setRole(String role) { - this.role = role; - } + public void setRole(String role) { + this.role = role; + } - @Override - public Date getLastModified() { - return lastModified; - } + @Override + public Date getLastModified() { + return lastModified; + } - public void setLastModified(Date lastModified) { - this.lastModified = lastModified; - } + public void setLastModified(Date lastModified) { + this.lastModified = lastModified; + } - public Metadata getMetadata() { - return metadata; - } + public Metadata getMetadata() { + return metadata; + } - public void setMetadata(Metadata metadata) { - this.metadata = metadata; - } + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/user/UserRole.java b/src/main/java/com/epam/ta/reportportal/entity/user/UserRole.java index d0110198d..1a5708786 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/user/UserRole.java +++ b/src/main/java/com/epam/ta/reportportal/entity/user/UserRole.java @@ -16,38 +16,36 @@ package com.epam.ta.reportportal.entity.user; import com.google.common.base.Strings; -import org.apache.commons.lang3.StringUtils; - import java.util.Arrays; import java.util.Optional; +import org.apache.commons.lang3.StringUtils; /** - * UserRole representation
    - * Role has more rights than the following one. So, Administrator is more - * privileged than User. + * UserRole representation
    Role has more rights than the following one. So, Administrator is + * more privileged than User. * * @author Andrei Varabyeu */ public enum UserRole { - USER, - ADMINISTRATOR; + USER, + ADMINISTRATOR; - public static final String ROLE_PREFIX = "ROLE_"; + public static final String ROLE_PREFIX = "ROLE_"; - public static Optional findByName(String name) { - return Arrays.stream(UserRole.values()).filter(role -> role.name().equals(name)).findAny(); - } + public static Optional findByName(String name) { + return Arrays.stream(UserRole.values()).filter(role -> role.name().equals(name)).findAny(); + } - public static Optional findByAuthority(String name) { - if (Strings.isNullOrEmpty(name)) { - return Optional.empty(); - } - return findByName(StringUtils.substringAfter(name, ROLE_PREFIX)); - } + public static Optional findByAuthority(String name) { + if (Strings.isNullOrEmpty(name)) { + return Optional.empty(); + } + return findByName(StringUtils.substringAfter(name, ROLE_PREFIX)); + } - public String getAuthority() { - return "ROLE_" + this.name(); - } + public String getAuthority() { + return "ROLE_" + this.name(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/user/UserType.java b/src/main/java/com/epam/ta/reportportal/entity/user/UserType.java index 1de309148..7f7a10d4f 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/user/UserType.java +++ b/src/main/java/com/epam/ta/reportportal/entity/user/UserType.java @@ -20,30 +20,30 @@ import java.util.Optional; /** - * User Type enumeration
    - * Used for supporting different project types processing + * User Type enumeration
    Used for supporting different project types processing * * @author Andrei Varabyeu */ public enum UserType { - //@formatter:off - INTERNAL, - UPSA, - GITHUB, - LDAP, - SAML; - //@formatter:on + //@formatter:off + INTERNAL, + UPSA, + GITHUB, + LDAP, + SAML; + //@formatter:on - public static UserType getByName(String type) { - return UserType.valueOf(type); - } + public static UserType getByName(String type) { + return UserType.valueOf(type); + } - public static Optional findByName(String name) { - return Arrays.stream(UserType.values()).filter(type -> type.name().equalsIgnoreCase(name)).findAny(); - } + public static Optional findByName(String name) { + return Arrays.stream(UserType.values()).filter(type -> type.name().equalsIgnoreCase(name)) + .findAny(); + } - public static boolean isPresent(String name) { - return findByName(name).isPresent(); - } + public static boolean isPresent(String name) { + return findByName(name).isPresent(); + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/Widget.java b/src/main/java/com/epam/ta/reportportal/entity/widget/Widget.java index d6f160db6..ab0f49886 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/Widget.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/Widget.java @@ -20,15 +20,24 @@ import com.epam.ta.reportportal.entity.dashboard.DashboardWidget; import com.epam.ta.reportportal.entity.filter.UserFilter; import com.google.common.collect.Sets; +import java.io.Serializable; +import java.util.Set; +import javax.persistence.CollectionTable; +import javax.persistence.Column; +import javax.persistence.ElementCollection; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.OneToMany; +import javax.persistence.OrderBy; +import javax.persistence.Table; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; -import javax.persistence.*; -import java.io.Serializable; -import java.util.Set; - /** * @author Pavel Bortnik */ @@ -37,97 +46,97 @@ @TypeDef(name = "widgetOptions", typeClass = WidgetOptions.class) public class Widget extends ShareableEntity implements Serializable { - @Column(name = "name") - private String name; + @Column(name = "name") + private String name; - @Column(name = "description") - private String description; + @Column(name = "description") + private String description; - @Column(name = "widget_type") - private String widgetType; + @Column(name = "widget_type") + private String widgetType; - @Column(name = "items_count") - private int itemsCount; + @Column(name = "items_count") + private int itemsCount; - @ManyToMany - @JoinTable(name = "widget_filter", joinColumns = @JoinColumn(name = "widget_id"), inverseJoinColumns = @JoinColumn(name = "filter_id")) - private Set filters; + @ManyToMany + @JoinTable(name = "widget_filter", joinColumns = @JoinColumn(name = "widget_id"), inverseJoinColumns = @JoinColumn(name = "filter_id")) + private Set filters; - @ElementCollection(fetch = FetchType.EAGER) - @CollectionTable(name = "content_field", joinColumns = @JoinColumn(name = "id")) - @Column(name = "field") - @OrderBy(value = "id") - private Set contentFields = Sets.newLinkedHashSet(); + @ElementCollection(fetch = FetchType.EAGER) + @CollectionTable(name = "content_field", joinColumns = @JoinColumn(name = "id")) + @Column(name = "field") + @OrderBy(value = "id") + private Set contentFields = Sets.newLinkedHashSet(); - @Type(type = "widgetOptions") - @Column(name = "widget_options") - private WidgetOptions widgetOptions; + @Type(type = "widgetOptions") + @Column(name = "widget_options") + private WidgetOptions widgetOptions; - @OneToMany(fetch = FetchType.LAZY, mappedBy = "widget") - @Fetch(value = FetchMode.JOIN) - private Set dashboardWidgets = Sets.newHashSet(); + @OneToMany(fetch = FetchType.LAZY, mappedBy = "widget") + @Fetch(value = FetchMode.JOIN) + private Set dashboardWidgets = Sets.newHashSet(); - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public String getDescription() { - return description; - } + public String getDescription() { + return description; + } - public void setDescription(String description) { - this.description = description; - } + public void setDescription(String description) { + this.description = description; + } - public String getWidgetType() { - return widgetType; - } + public String getWidgetType() { + return widgetType; + } - public void setWidgetType(String widgetType) { - this.widgetType = widgetType; - } + public void setWidgetType(String widgetType) { + this.widgetType = widgetType; + } - public int getItemsCount() { - return itemsCount; - } + public int getItemsCount() { + return itemsCount; + } - public void setItemsCount(int itemsCount) { - this.itemsCount = itemsCount; - } + public void setItemsCount(int itemsCount) { + this.itemsCount = itemsCount; + } - public Set getContentFields() { - return contentFields; - } + public Set getContentFields() { + return contentFields; + } - public void setContentFields(Set contentFields) { - this.contentFields = contentFields; - } + public void setContentFields(Set contentFields) { + this.contentFields = contentFields; + } - public WidgetOptions getWidgetOptions() { - return widgetOptions; - } + public WidgetOptions getWidgetOptions() { + return widgetOptions; + } - public void setWidgetOptions(WidgetOptions widgetOptions) { - this.widgetOptions = widgetOptions; - } + public void setWidgetOptions(WidgetOptions widgetOptions) { + this.widgetOptions = widgetOptions; + } - public Set getDashboardWidgets() { - return dashboardWidgets; - } + public Set getDashboardWidgets() { + return dashboardWidgets; + } - public void setDashboardWidgets(Set dashboardWidgets) { - this.dashboardWidgets = dashboardWidgets; - } + public void setDashboardWidgets(Set dashboardWidgets) { + this.dashboardWidgets = dashboardWidgets; + } - public Set getFilters() { - return filters; - } + public Set getFilters() { + return filters; + } - public void setFilters(Set filters) { - this.filters = filters; - } + public void setFilters(Set filters) { + this.filters = filters; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/WidgetOptions.java b/src/main/java/com/epam/ta/reportportal/entity/widget/WidgetOptions.java index 70ea737e4..f42c3be89 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/WidgetOptions.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/WidgetOptions.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.entity.widget; import com.epam.ta.reportportal.commons.JsonbUserType; - import java.io.Serializable; import java.util.Map; @@ -25,25 +24,26 @@ * @author Ivan Budayeu */ public class WidgetOptions extends JsonbUserType implements Serializable { - @Override - public Class returnedClass() { - return WidgetOptions.class; - } - private Map options; + private Map options; + + public WidgetOptions() { + } - public WidgetOptions() { - } + public WidgetOptions(Map options) { + this.options = options; + } - public WidgetOptions(Map options) { - this.options = options; - } + @Override + public Class returnedClass() { + return WidgetOptions.class; + } - public Map getOptions() { - return options; - } + public Map getOptions() { + return options; + } - public void setOptions(Map options) { - this.options = options; - } + public void setOptions(Map options) { + this.options = options; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/WidgetState.java b/src/main/java/com/epam/ta/reportportal/entity/widget/WidgetState.java index fc166dbfe..2f2a78d8f 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/WidgetState.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/WidgetState.java @@ -1,33 +1,34 @@ package com.epam.ta.reportportal.entity.widget; -import javax.annotation.Nullable; import java.util.Arrays; import java.util.Optional; +import javax.annotation.Nullable; /** * @author Ivan Budayeu */ public enum WidgetState { - CREATED("created"), + CREATED("created"), - RENDERING("rendering"), + RENDERING("rendering"), - READY("ready"), + READY("ready"), - FAILED("failed"); + FAILED("failed"); - WidgetState(String value) { - this.value = value; - } + private final String value; - private final String value; + WidgetState(String value) { + this.value = value; + } - public String getValue() { - return value; - } + public static Optional findByName(@Nullable String name) { + return Arrays.stream(WidgetState.values()) + .filter(state -> state.getValue().equalsIgnoreCase(name)).findAny(); + } - public static Optional findByName(@Nullable String name) { - return Arrays.stream(WidgetState.values()).filter(state -> state.getValue().equalsIgnoreCase(name)).findAny(); - } + public String getValue() { + return value; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/WidgetType.java b/src/main/java/com/epam/ta/reportportal/entity/widget/WidgetType.java index 52cb14ecc..7e000374a 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/WidgetType.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/WidgetType.java @@ -16,70 +16,71 @@ package com.epam.ta.reportportal.entity.widget; -import javax.annotation.Nullable; import java.util.Arrays; import java.util.Optional; +import javax.annotation.Nullable; /** * @author Pavel Bortnik */ public enum WidgetType { - OLD_LINE_CHART("oldLineChart", false, false), - INVESTIGATED_TREND("investigatedTrend", false, false), - LAUNCH_STATISTICS("launchStatistics", false, true), - STATISTIC_TREND("statisticTrend", false, true), - CASES_TREND("casesTrend", false, false), - NOT_PASSED("notPassed", false, false), - OVERALL_STATISTICS("overallStatistics", false, true), - UNIQUE_BUG_TABLE("uniqueBugTable", false, false), - BUG_TREND("bugTrend", false, false), - ACTIVITY("activityStream", false, false), - LAUNCHES_COMPARISON_CHART("launchesComparisonChart", false, false), - LAUNCHES_DURATION_CHART("launchesDurationChart", false, false), - LAUNCHES_TABLE("launchesTable", false, true), - TOP_TEST_CASES("topTestCases", false, false), - FLAKY_TEST_CASES("flakyTestCases", false, false), - PASSING_RATE_SUMMARY("passingRateSummary", false, false), - PASSING_RATE_PER_LAUNCH("passingRatePerLaunch", false, false), - PRODUCT_STATUS("productStatus", false, true), - MOST_TIME_CONSUMING("mostTimeConsuming", false, false), + OLD_LINE_CHART("oldLineChart", false, false), + INVESTIGATED_TREND("investigatedTrend", false, false), + LAUNCH_STATISTICS("launchStatistics", false, true), + STATISTIC_TREND("statisticTrend", false, true), + CASES_TREND("casesTrend", false, false), + NOT_PASSED("notPassed", false, false), + OVERALL_STATISTICS("overallStatistics", false, true), + UNIQUE_BUG_TABLE("uniqueBugTable", false, false), + BUG_TREND("bugTrend", false, false), + ACTIVITY("activityStream", false, false), + LAUNCHES_COMPARISON_CHART("launchesComparisonChart", false, false), + LAUNCHES_DURATION_CHART("launchesDurationChart", false, false), + LAUNCHES_TABLE("launchesTable", false, true), + TOP_TEST_CASES("topTestCases", false, false), + FLAKY_TEST_CASES("flakyTestCases", false, false), + PASSING_RATE_SUMMARY("passingRateSummary", false, false), + PASSING_RATE_PER_LAUNCH("passingRatePerLaunch", false, false), + PRODUCT_STATUS("productStatus", false, true), + MOST_TIME_CONSUMING("mostTimeConsuming", false, false), - CUMULATIVE("cumulative", true, false), - TOP_PATTERN_TEMPLATES("topPatternTemplates", true, false), - COMPONENT_HEALTH_CHECK("componentHealthCheck", true, false), - COMPONENT_HEALTH_CHECK_TABLE("componentHealthCheckTable", true, false); + CUMULATIVE("cumulative", true, false), + TOP_PATTERN_TEMPLATES("topPatternTemplates", true, false), + COMPONENT_HEALTH_CHECK("componentHealthCheck", true, false), + COMPONENT_HEALTH_CHECK_TABLE("componentHealthCheckTable", true, false); - private final String type; + private final String type; - private final boolean supportMultilevelStructure; + private final boolean supportMultilevelStructure; - private final boolean issueTypeUpdateSupported; + private final boolean issueTypeUpdateSupported; - WidgetType(String type, boolean supportMultilevelStructure, boolean issueTypeUpdateSupported) { - this.type = type; - this.supportMultilevelStructure = supportMultilevelStructure; - this.issueTypeUpdateSupported = issueTypeUpdateSupported; - } + WidgetType(String type, boolean supportMultilevelStructure, boolean issueTypeUpdateSupported) { + this.type = type; + this.supportMultilevelStructure = supportMultilevelStructure; + this.issueTypeUpdateSupported = issueTypeUpdateSupported; + } - public String getType() { - return this.type; - } + public static WidgetType getByName(String type) { + return WidgetType.valueOf(type); + } - public boolean isSupportMultilevelStructure() { - return supportMultilevelStructure; - } + public static Optional findByName(@Nullable String name) { + return Arrays.stream(WidgetType.values()) + .filter(gadgetTypes -> gadgetTypes.getType().equalsIgnoreCase(name)).findAny(); + } - public boolean isIssueTypeUpdateSupported() { - return issueTypeUpdateSupported; - } + public String getType() { + return this.type; + } - public static WidgetType getByName(String type) { - return WidgetType.valueOf(type); - } + public boolean isSupportMultilevelStructure() { + return supportMultilevelStructure; + } - public static Optional findByName(@Nullable String name) { - return Arrays.stream(WidgetType.values()).filter(gadgetTypes -> gadgetTypes.getType().equalsIgnoreCase(name)).findAny(); - } + public boolean isIssueTypeUpdateSupported() { + return issueTypeUpdateSupported; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/AbstractLaunchStatisticsContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/AbstractLaunchStatisticsContent.java index cb7a607da..bdc1db6cd 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/AbstractLaunchStatisticsContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/AbstractLaunchStatisticsContent.java @@ -16,14 +16,13 @@ package com.epam.ta.reportportal.entity.widget.content; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.persistence.Column; import java.io.Serializable; import java.sql.Timestamp; - -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; +import javax.persistence.Column; /** * @author Ivan Budayeu @@ -31,65 +30,65 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public abstract class AbstractLaunchStatisticsContent implements Serializable { - @Column(name = ID) - @JsonProperty(value = ID) - private Long id; - - @Column(name = "number") - @JsonProperty(value = "number") - private Integer number; - - @Column(name = "name") - @JsonProperty(value = "name") - private String name; - - @Column(name = "start_time") - @JsonProperty(value = "startTime") - private Timestamp startTime; - - public AbstractLaunchStatisticsContent() { - } - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Integer getNumber() { - return number; - } - - public void setNumber(Integer number) { - this.number = number; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Timestamp getStartTime() { - return startTime; - } - - public void setStartTime(Timestamp startTime) { - this.startTime = startTime; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("AbstractLaunchStatisticsContent{"); - sb.append("id=").append(id); - sb.append(", number=").append(number); - sb.append(", name='").append(name).append('\''); - sb.append(", startTime=").append(startTime); - sb.append('}'); - return sb.toString(); - } + @Column(name = ID) + @JsonProperty(value = ID) + private Long id; + + @Column(name = "number") + @JsonProperty(value = "number") + private Integer number; + + @Column(name = "name") + @JsonProperty(value = "name") + private String name; + + @Column(name = "start_time") + @JsonProperty(value = "startTime") + private Timestamp startTime; + + public AbstractLaunchStatisticsContent() { + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Timestamp getStartTime() { + return startTime; + } + + public void setStartTime(Timestamp startTime) { + this.startTime = startTime; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("AbstractLaunchStatisticsContent{"); + sb.append("id=").append(id); + sb.append(", number=").append(number); + sb.append(", name='").append(name).append('\''); + sb.append(", startTime=").append(startTime); + sb.append('}'); + return sb.toString(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/ChartStatisticsContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/ChartStatisticsContent.java index 027e367fb..dd67602f9 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/ChartStatisticsContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/ChartStatisticsContent.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - import java.util.LinkedHashMap; import java.util.Map; @@ -28,14 +27,14 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class ChartStatisticsContent extends AbstractLaunchStatisticsContent { - @JsonProperty(value = "values") - private Map values = new LinkedHashMap<>(); + @JsonProperty(value = "values") + private Map values = new LinkedHashMap<>(); - public Map getValues() { - return values; - } + public Map getValues() { + return values; + } - public void setValues(Map values) { - this.values = values; - } + public void setValues(Map values) { + this.values = values; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/CriteriaHistoryItem.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/CriteriaHistoryItem.java index 0ea001667..7ce0eb0db 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/CriteriaHistoryItem.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/CriteriaHistoryItem.java @@ -16,81 +16,85 @@ package com.epam.ta.reportportal.entity.widget.content; -import javax.persistence.Column; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.CRITERIA; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.START_TIME_HISTORY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATUS_HISTORY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.TOTAL; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.UNIQUE_ID; + import java.io.Serializable; import java.util.Date; import java.util.List; - -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; +import javax.persistence.Column; /** * @author Ivan Budaev */ public class CriteriaHistoryItem implements Serializable { - @Column(name = UNIQUE_ID) - private String uniqueId; + @Column(name = UNIQUE_ID) + private String uniqueId; - @Column(name = "name") - private String name; + @Column(name = "name") + private String name; - @Column(name = TOTAL) - private Long total; + @Column(name = TOTAL) + private Long total; - @Column(name = CRITERIA) - private Long criteria; + @Column(name = CRITERIA) + private Long criteria; - @Column(name = STATUS_HISTORY) - private Boolean[] status; + @Column(name = STATUS_HISTORY) + private Boolean[] status; - @Column(name = START_TIME_HISTORY) - private List startTime; + @Column(name = START_TIME_HISTORY) + private List startTime; - public String getUniqueId() { - return uniqueId; - } + public String getUniqueId() { + return uniqueId; + } - public void setUniqueId(String uniqueId) { - this.uniqueId = uniqueId; - } + public void setUniqueId(String uniqueId) { + this.uniqueId = uniqueId; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public Long getTotal() { - return total; - } + public Long getTotal() { + return total; + } - public void setTotal(Long total) { - this.total = total; - } + public void setTotal(Long total) { + this.total = total; + } - public Long getCriteria() { - return criteria; - } + public Long getCriteria() { + return criteria; + } - public void setCriteria(Long criteria) { - this.criteria = criteria; - } + public void setCriteria(Long criteria) { + this.criteria = criteria; + } - public Boolean[] getStatus() { - return status; - } + public Boolean[] getStatus() { + return status; + } - public void setStatus(Boolean[] status) { - this.status = status; - } + public void setStatus(Boolean[] status) { + this.status = status; + } - public List getStartTime() { - return startTime; - } + public List getStartTime() { + return startTime; + } - public void setStartTime(List startTime) { - this.startTime = startTime; - } + public void setStartTime(List startTime) { + this.startTime = startTime; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/CumulativeTrendChartContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/CumulativeTrendChartContent.java index eacf11a47..9f52ada02 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/CumulativeTrendChartContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/CumulativeTrendChartContent.java @@ -19,45 +19,44 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.google.common.collect.Maps; import com.google.common.collect.Sets; - import java.util.Map; import java.util.Set; /** * @author Ivan Budayeu - * + *

    * Not a database entity. It is used to represent widget data */ @JsonInclude(JsonInclude.Include.NON_NULL) public class CumulativeTrendChartContent { - private Set launchIds = Sets.newHashSet(); + private Set launchIds = Sets.newHashSet(); - private Map statistics = Maps.newHashMap(); + private Map statistics = Maps.newHashMap(); - private Set tooltipContent = Sets.newHashSet(); + private Set tooltipContent = Sets.newHashSet(); - public Set getLaunchIds() { - return launchIds; - } + public Set getLaunchIds() { + return launchIds; + } - public void setLaunchIds(Set launchIds) { - this.launchIds = launchIds; - } + public void setLaunchIds(Set launchIds) { + this.launchIds = launchIds; + } - public Map getStatistics() { - return statistics; - } + public Map getStatistics() { + return statistics; + } - public void setStatistics(Map statistics) { - this.statistics = statistics; - } + public void setStatistics(Map statistics) { + this.statistics = statistics; + } - public Set getTooltipContent() { - return tooltipContent; - } + public Set getTooltipContent() { + return tooltipContent; + } - public void setTooltipContent(Set tooltipContent) { - this.tooltipContent = tooltipContent; - } + public void setTooltipContent(Set tooltipContent) { + this.tooltipContent = tooltipContent; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/CumulativeTrendChartEntry.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/CumulativeTrendChartEntry.java index 3d373b2c3..dcdc36bc8 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/CumulativeTrendChartEntry.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/CumulativeTrendChartEntry.java @@ -18,36 +18,36 @@ /** * @author Ihar Kahadouski - * + *

    * Not a database entity. It is used to represent widget data */ public class CumulativeTrendChartEntry { - private String attributeValue; + private String attributeValue; - private CumulativeTrendChartContent content; + private CumulativeTrendChartContent content; - public CumulativeTrendChartEntry() { - } + public CumulativeTrendChartEntry() { + } - public CumulativeTrendChartEntry(String attributeValue, CumulativeTrendChartContent content) { - this.attributeValue = attributeValue; - this.content = content; - } + public CumulativeTrendChartEntry(String attributeValue, CumulativeTrendChartContent content) { + this.attributeValue = attributeValue; + this.content = content; + } - public String getAttributeValue() { - return attributeValue; - } + public String getAttributeValue() { + return attributeValue; + } - public void setAttributeValue(String attributeValue) { - this.attributeValue = attributeValue; - } + public void setAttributeValue(String attributeValue) { + this.attributeValue = attributeValue; + } - public CumulativeTrendChartContent getContent() { - return content; - } + public CumulativeTrendChartContent getContent() { + return content; + } - public void setContent(CumulativeTrendChartContent content) { - this.content = content; - } + public void setContent(CumulativeTrendChartContent content) { + this.content = content; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/FlakyCasesTableContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/FlakyCasesTableContent.java index 0012fab49..5e3d89612 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/FlakyCasesTableContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/FlakyCasesTableContent.java @@ -16,92 +16,96 @@ package com.epam.ta.reportportal.entity.widget.content; -import com.fasterxml.jackson.annotation.JsonProperty; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.FLAKY_COUNT; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ITEM_NAME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.START_TIME_HISTORY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATUSES; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.TOTAL; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.UNIQUE_ID; -import javax.persistence.Column; +import com.fasterxml.jackson.annotation.JsonProperty; import java.io.Serializable; import java.util.Date; import java.util.List; - -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; +import javax.persistence.Column; /** * @author Ivan Budayeu */ public class FlakyCasesTableContent implements Serializable { - @JsonProperty(value = STATUSES) - @Column(name = STATUSES) - private String[] statuses; + @JsonProperty(value = STATUSES) + @Column(name = STATUSES) + private String[] statuses; - @JsonProperty(value = FLAKY_COUNT) - @Column(name = FLAKY_COUNT) - private Long flakyCount; + @JsonProperty(value = FLAKY_COUNT) + @Column(name = FLAKY_COUNT) + private Long flakyCount; - @JsonProperty(value = TOTAL) - @Column(name = TOTAL) - private Long total; + @JsonProperty(value = TOTAL) + @Column(name = TOTAL) + private Long total; - @JsonProperty(value = "itemName") - @Column(name = ITEM_NAME) - private String itemName; + @JsonProperty(value = "itemName") + @Column(name = ITEM_NAME) + private String itemName; - @JsonProperty(value = "uniqueId") - @Column(name = UNIQUE_ID) - private String uniqueId; + @JsonProperty(value = "uniqueId") + @Column(name = UNIQUE_ID) + private String uniqueId; - @JsonProperty(value = "startTime") - @Column(name = START_TIME_HISTORY) - private List startTime; + @JsonProperty(value = "startTime") + @Column(name = START_TIME_HISTORY) + private List startTime; - public FlakyCasesTableContent() { - } + public FlakyCasesTableContent() { + } - public String[] getStatuses() { - return statuses; - } + public String[] getStatuses() { + return statuses; + } - public void setStatuses(String[] statuses) { - this.statuses = statuses; - } + public void setStatuses(String[] statuses) { + this.statuses = statuses; + } - public Long getFlakyCount() { - return flakyCount; - } + public Long getFlakyCount() { + return flakyCount; + } - public void setFlakyCount(Long flakyCount) { - this.flakyCount = flakyCount; - } + public void setFlakyCount(Long flakyCount) { + this.flakyCount = flakyCount; + } - public Long getTotal() { - return total; - } + public Long getTotal() { + return total; + } - public void setTotal(Long total) { - this.total = total; - } + public void setTotal(Long total) { + this.total = total; + } - public String getItemName() { - return itemName; - } + public String getItemName() { + return itemName; + } - public void setItemName(String itemName) { - this.itemName = itemName; - } + public void setItemName(String itemName) { + this.itemName = itemName; + } - public String getUniqueId() { - return uniqueId; - } + public String getUniqueId() { + return uniqueId; + } - public void setUniqueId(String uniqueId) { - this.uniqueId = uniqueId; - } + public void setUniqueId(String uniqueId) { + this.uniqueId = uniqueId; + } - public List getStartTime() { - return startTime; - } + public List getStartTime() { + return startTime; + } - public void setStartTime(List startTime) { - this.startTime = startTime; - } + public void setStartTime(List startTime) { + this.startTime = startTime; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/LatestLaunchContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/LatestLaunchContent.java index 943c5628d..f7f6e26e4 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/LatestLaunchContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/LatestLaunchContent.java @@ -16,59 +16,60 @@ package com.epam.ta.reportportal.entity.widget.content; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.NAME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.NUMBER; + import com.epam.ta.reportportal.entity.launch.Launch; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - import java.io.Serializable; -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; - /** * @author Ivan Budaev */ @JsonInclude(JsonInclude.Include.NON_NULL) public class LatestLaunchContent implements Serializable { - @JsonProperty(ID) - private Long id; + @JsonProperty(ID) + private Long id; - @JsonProperty(NAME) - private String name; + @JsonProperty(NAME) + private String name; - @JsonProperty(NUMBER) - private Long number; + @JsonProperty(NUMBER) + private Long number; - public Long getId() { - return id; - } + public LatestLaunchContent() { + } - public LatestLaunchContent() { - } + public LatestLaunchContent(Launch launch) { + this.id = launch.getId(); + this.name = launch.getName(); + this.number = launch.getNumber(); + } - public LatestLaunchContent(Launch launch) { - this.id = launch.getId(); - this.name = launch.getName(); - this.number = launch.getNumber(); - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public Long getNumber() { - return number; - } + public Long getNumber() { + return number; + } - public void setNumber(Long number) { - this.number = number; - } + public void setNumber(Long number) { + this.number = number; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/LaunchesDurationContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/LaunchesDurationContent.java index 671cc7742..7408e47bc 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/LaunchesDurationContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/LaunchesDurationContent.java @@ -16,52 +16,51 @@ package com.epam.ta.reportportal.entity.widget.content; -import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.persistence.Column; -import java.sql.Timestamp; - import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.DURATION; import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.END_TIME; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.sql.Timestamp; +import javax.persistence.Column; + /** * @author Ivan Budayeu */ public class LaunchesDurationContent extends AbstractLaunchStatisticsContent { - @JsonProperty(value = "status") - @Column(name = "status") - private String status; + @JsonProperty(value = "status") + @Column(name = "status") + private String status; - @Column(name = "end_time") - @JsonProperty(value = END_TIME) - private Timestamp endTime; + @Column(name = "end_time") + @JsonProperty(value = END_TIME) + private Timestamp endTime; - @Column(name = "duration") - @JsonProperty(value = DURATION) - private long duration; + @Column(name = "duration") + @JsonProperty(value = DURATION) + private long duration; - public String getStatus() { - return status; - } + public String getStatus() { + return status; + } - public void setStatus(String status) { - this.status = status; - } + public void setStatus(String status) { + this.status = status; + } - public Timestamp getEndTime() { - return endTime; - } + public Timestamp getEndTime() { + return endTime; + } - public void setEndTime(Timestamp endTime) { - this.endTime = endTime; - } + public void setEndTime(Timestamp endTime) { + this.endTime = endTime; + } - public long getDuration() { - return duration; - } + public long getDuration() { + return duration; + } - public void setDuration(long duration) { - this.duration = duration; - } + public void setDuration(long duration) { + this.duration = duration; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/LaunchesTableContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/LaunchesTableContent.java index 9d254f7ed..52400cbd5 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/LaunchesTableContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/LaunchesTableContent.java @@ -19,7 +19,6 @@ import com.epam.ta.reportportal.ws.model.attribute.ItemAttributeResource; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; @@ -30,25 +29,25 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class LaunchesTableContent extends AbstractLaunchStatisticsContent { - @JsonProperty(value = "attributes") - private Set attributes; + @JsonProperty(value = "attributes") + private Set attributes; - @JsonProperty(value = "values") - private Map values = new LinkedHashMap<>(); + @JsonProperty(value = "values") + private Map values = new LinkedHashMap<>(); - public Set getAttributes() { - return attributes; - } + public Set getAttributes() { + return attributes; + } - public void setAttributes(Set attributes) { - this.attributes = attributes; - } + public void setAttributes(Set attributes) { + this.attributes = attributes; + } - public Map getValues() { - return values; - } + public Map getValues() { + return values; + } - public void setValues(Map values) { - this.values = values; - } + public void setValues(Map values) { + this.values = values; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/MostTimeConsumingTestCasesContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/MostTimeConsumingTestCasesContent.java index c6b139dec..4d69bc93d 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/MostTimeConsumingTestCasesContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/MostTimeConsumingTestCasesContent.java @@ -16,13 +16,16 @@ package com.epam.ta.reportportal.entity.widget.content; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.DURATION; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.END_TIME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.NAME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.UNIQUE_ID; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.persistence.Column; import java.io.Serializable; - -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; +import javax.persistence.Column; /** * @author Ivan Budaev @@ -30,108 +33,108 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class MostTimeConsumingTestCasesContent implements Serializable { - @JsonProperty(value = ID) - @Column(name = ID) - private Long id; + @JsonProperty(value = ID) + @Column(name = ID) + private Long id; - @JsonProperty(value = NAME) - @Column(name = NAME) - private String name; + @JsonProperty(value = NAME) + @Column(name = NAME) + private String name; - @Column(name = "status") - private String status; + @Column(name = "status") + private String status; - @Column(name = "type") - private String type; + @Column(name = "type") + private String type; - @Column(name = "path") - private String path; + @Column(name = "path") + private String path; - @JsonProperty(value = "uniqueId") - @Column(name = UNIQUE_ID) - private String uniqueId; + @JsonProperty(value = "uniqueId") + @Column(name = UNIQUE_ID) + private String uniqueId; - @JsonProperty(value = "startTime") - @Column(name = "start_time") - private Long startTime; + @JsonProperty(value = "startTime") + @Column(name = "start_time") + private Long startTime; - @JsonProperty(value = END_TIME) - @Column(name = "end_time") - private Long endTime; + @JsonProperty(value = END_TIME) + @Column(name = "end_time") + private Long endTime; - @JsonProperty(value = DURATION) - @Column(name = DURATION) - private Double duration; + @JsonProperty(value = DURATION) + @Column(name = DURATION) + private Double duration; - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public String getStatus() { - return status; - } + public String getStatus() { + return status; + } - public void setStatus(String status) { - this.status = status; - } + public void setStatus(String status) { + this.status = status; + } - public String getType() { - return type; - } + public String getType() { + return type; + } - public void setType(String type) { - this.type = type; - } + public void setType(String type) { + this.type = type; + } - public String getPath() { - return path; - } + public String getPath() { + return path; + } - public void setPath(String path) { - this.path = path; - } + public void setPath(String path) { + this.path = path; + } - public String getUniqueId() { - return uniqueId; - } + public String getUniqueId() { + return uniqueId; + } - public void setUniqueId(String uniqueId) { - this.uniqueId = uniqueId; - } + public void setUniqueId(String uniqueId) { + this.uniqueId = uniqueId; + } - public Long getStartTime() { - return startTime; - } + public Long getStartTime() { + return startTime; + } - public void setStartTime(Long startTime) { - this.startTime = startTime; - } + public void setStartTime(Long startTime) { + this.startTime = startTime; + } - public Long getEndTime() { - return endTime; - } + public Long getEndTime() { + return endTime; + } - public void setEndTime(Long endTime) { - this.endTime = endTime; - } + public void setEndTime(Long endTime) { + this.endTime = endTime; + } - public Double getDuration() { - return duration; - } + public Double getDuration() { + return duration; + } - public void setDuration(Double duration) { - this.duration = duration; - } + public void setDuration(Double duration) { + this.duration = duration; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/NotPassedCasesContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/NotPassedCasesContent.java index e04cac86e..f8bde81d2 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/NotPassedCasesContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/NotPassedCasesContent.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.entity.widget.content; import com.fasterxml.jackson.annotation.JsonProperty; - import java.util.Map; /** @@ -25,18 +24,18 @@ */ public class NotPassedCasesContent extends AbstractLaunchStatisticsContent { - @JsonProperty(value = "values") - private Map values; + @JsonProperty(value = "values") + private Map values; - public NotPassedCasesContent() { - } + public NotPassedCasesContent() { + } - public Map getValues() { - return values; - } + public Map getValues() { + return values; + } - public void setValues(Map values) { - this.values = values; - } + public void setValues(Map values) { + this.values = values; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/OverallStatisticsContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/OverallStatisticsContent.java index d690e1791..a7d34df6d 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/OverallStatisticsContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/OverallStatisticsContent.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - import java.io.Serializable; import java.util.Map; @@ -28,21 +27,21 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class OverallStatisticsContent implements Serializable { - @JsonProperty(value = "values") - private Map values; + @JsonProperty(value = "values") + private Map values; - public OverallStatisticsContent() { - } + public OverallStatisticsContent() { + } - public OverallStatisticsContent(Map values) { - this.values = values; - } + public OverallStatisticsContent(Map values) { + this.values = values; + } - public Map getValues() { - return values; - } + public Map getValues() { + return values; + } - public void setValues(Map values) { - this.values = values; - } + public void setValues(Map values) { + this.values = values; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/PassingRateStatisticsResult.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/PassingRateStatisticsResult.java index 52a71380a..c37ab2fd8 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/PassingRateStatisticsResult.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/PassingRateStatisticsResult.java @@ -16,78 +16,81 @@ package com.epam.ta.reportportal.entity.widget.content; -import com.fasterxml.jackson.annotation.JsonProperty; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.NUMBER; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.PASSED; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.SKIPPED; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.TOTAL; -import javax.persistence.Column; +import com.fasterxml.jackson.annotation.JsonProperty; import java.io.Serializable; - -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; +import javax.persistence.Column; /** * @author Ivan Budayeu */ public class PassingRateStatisticsResult implements Serializable { - @Column(name = ID) - @JsonProperty(value = ID) - private Long id; + @Column(name = ID) + @JsonProperty(value = ID) + private Long id; - @Column(name = NUMBER) - @JsonProperty(value = NUMBER) - private int number; + @Column(name = NUMBER) + @JsonProperty(value = NUMBER) + private int number; - @Column(name = PASSED) - @JsonProperty(value = PASSED) - private int passed; + @Column(name = PASSED) + @JsonProperty(value = PASSED) + private int passed; - @Column(name = TOTAL) - @JsonProperty(value = TOTAL) - private int total; + @Column(name = TOTAL) + @JsonProperty(value = TOTAL) + private int total; - @Column(name = SKIPPED) - @JsonProperty(value = SKIPPED) - private int skipped; + @Column(name = SKIPPED) + @JsonProperty(value = SKIPPED) + private int skipped; - public PassingRateStatisticsResult() { - } + public PassingRateStatisticsResult() { + } - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public int getNumber() { - return number; - } + public int getNumber() { + return number; + } - public void setNumber(int number) { - this.number = number; - } + public void setNumber(int number) { + this.number = number; + } - public int getPassed() { - return passed; - } + public int getPassed() { + return passed; + } - public void setPassed(int passed) { - this.passed = passed; - } + public void setPassed(int passed) { + this.passed = passed; + } - public int getTotal() { - return total; - } + public int getTotal() { + return total; + } - public void setTotal(int total) { - this.total = total; - } + public void setTotal(int total) { + this.total = total; + } - public int getSkipped() { - return skipped; - } + public int getSkipped() { + return skipped; + } - public void setSkipped(int skipped) { - this.skipped = skipped; - } + public void setSkipped(int skipped) { + this.skipped = skipped; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/PatternTemplateLaunchStatistics.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/PatternTemplateLaunchStatistics.java index a26998dfd..9574448ce 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/PatternTemplateLaunchStatistics.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/PatternTemplateLaunchStatistics.java @@ -26,31 +26,31 @@ @JsonInclude(Include.NON_NULL) public class PatternTemplateLaunchStatistics extends PatternTemplateStatistics { - @JsonProperty(value = "id") - private Long id; + @JsonProperty(value = "id") + private Long id; - @JsonProperty(value = "number") - private Integer number; + @JsonProperty(value = "number") + private Integer number; - public PatternTemplateLaunchStatistics(String name, Integer number, Long count, Long id) { - super(name, count); - this.number = number; - this.id = id; - } + public PatternTemplateLaunchStatistics(String name, Integer number, Long count, Long id) { + super(name, count); + this.number = number; + this.id = id; + } - public Long getId() { - return id; - } + public Long getId() { + return id; + } - public void setId(Long id) { - this.id = id; - } + public void setId(Long id) { + this.id = id; + } - public Integer getNumber() { - return number; - } + public Integer getNumber() { + return number; + } - public void setNumber(Integer number) { - this.number = number; - } + public void setNumber(Integer number) { + this.number = number; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/PatternTemplateStatistics.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/PatternTemplateStatistics.java index 083a39ac6..16a90ea8b 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/PatternTemplateStatistics.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/PatternTemplateStatistics.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - import java.io.Serializable; /** @@ -27,33 +26,33 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class PatternTemplateStatistics implements Serializable { - @JsonProperty(value = "name") - private String name; + @JsonProperty(value = "name") + private String name; - @JsonProperty(value = "count") - private Long count; + @JsonProperty(value = "count") + private Long count; - public PatternTemplateStatistics() { - } + public PatternTemplateStatistics() { + } - public PatternTemplateStatistics(String name, Long count) { - this.name = name; - this.count = count; - } + public PatternTemplateStatistics(String name, Long count) { + this.name = name; + this.count = count; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public Long getCount() { - return count; - } + public Long getCount() { + return count; + } - public void setCount(Long count) { - this.count = count; - } + public void setCount(Long count) { + this.count = count; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/ProductStatusStatisticsContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/ProductStatusStatisticsContent.java index 68f593634..3bf1ad711 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/ProductStatusStatisticsContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/ProductStatusStatisticsContent.java @@ -16,16 +16,21 @@ package com.epam.ta.reportportal.entity.widget.content; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ATTRIBUTE_VALUE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ATTRIBUTE_VALUES; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.AVERAGE_PASSING_RATE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.DURATION; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.FILTER_NAME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.PASSING_RATE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.SUM; + import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - -import javax.persistence.Column; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; - -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; +import javax.persistence.Column; /** * @author Ivan Budayeu @@ -33,109 +38,109 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class ProductStatusStatisticsContent extends AbstractLaunchStatisticsContent { - @Column(name = "status") - @JsonProperty(value = "status") - private String status; + @Column(name = "status") + @JsonProperty(value = "status") + private String status; - @Column(name = ATTRIBUTE_VALUES) - @JsonProperty(value = "attributes") - private Map> attributes; + @Column(name = ATTRIBUTE_VALUES) + @JsonProperty(value = "attributes") + private Map> attributes; - @JsonProperty(value = "values") - private Map values = new LinkedHashMap<>(); + @JsonProperty(value = "values") + private Map values = new LinkedHashMap<>(); - @Column(name = SUM) - @JsonProperty(value = SUM) - private Map totalStatistics = new LinkedHashMap<>(); + @Column(name = SUM) + @JsonProperty(value = SUM) + private Map totalStatistics = new LinkedHashMap<>(); - @Column(name = DURATION) - @JsonProperty(value = DURATION) - private Long duration; + @Column(name = DURATION) + @JsonProperty(value = DURATION) + private Long duration; - @Column(name = PASSING_RATE) - @JsonProperty(value = PASSING_RATE) - private Double passingRate; + @Column(name = PASSING_RATE) + @JsonProperty(value = PASSING_RATE) + private Double passingRate; - @JsonProperty(value = AVERAGE_PASSING_RATE) - private Double averagePassingRate; + @JsonProperty(value = AVERAGE_PASSING_RATE) + private Double averagePassingRate; - @JsonIgnore - @Column(name = ATTRIBUTE_VALUE) - private String tagValue; + @JsonIgnore + @Column(name = ATTRIBUTE_VALUE) + private String tagValue; - @JsonIgnore - @Column(name = FILTER_NAME) - private String filterName; + @JsonIgnore + @Column(name = FILTER_NAME) + private String filterName; - public String getStatus() { - return status; - } + public String getStatus() { + return status; + } - public void setStatus(String status) { - this.status = status; - } + public void setStatus(String status) { + this.status = status; + } - public Map> getAttributes() { - return attributes; - } + public Map> getAttributes() { + return attributes; + } - public void setAttributes(Map> attributes) { - this.attributes = attributes; - } + public void setAttributes(Map> attributes) { + this.attributes = attributes; + } - public Map getValues() { - return values; - } + public Map getValues() { + return values; + } - public void setValues(Map values) { - this.values = values; - } + public void setValues(Map values) { + this.values = values; + } - public Map getTotalStatistics() { - return totalStatistics; - } + public Map getTotalStatistics() { + return totalStatistics; + } - public void setTotalStatistics(Map totalStatistics) { - this.totalStatistics = totalStatistics; - } + public void setTotalStatistics(Map totalStatistics) { + this.totalStatistics = totalStatistics; + } - public Long getDuration() { - return duration; - } + public Long getDuration() { + return duration; + } - public void setDuration(Long duration) { - this.duration = duration; - } + public void setDuration(Long duration) { + this.duration = duration; + } - public Double getPassingRate() { - return passingRate; - } + public Double getPassingRate() { + return passingRate; + } - public void setPassingRate(Double passingRate) { - this.passingRate = passingRate; - } + public void setPassingRate(Double passingRate) { + this.passingRate = passingRate; + } - public Double getAveragePassingRate() { - return averagePassingRate; - } + public Double getAveragePassingRate() { + return averagePassingRate; + } - public void setAveragePassingRate(Double averagePassingRate) { - this.averagePassingRate = averagePassingRate; - } + public void setAveragePassingRate(Double averagePassingRate) { + this.averagePassingRate = averagePassingRate; + } - public String getTagValue() { - return tagValue; - } + public String getTagValue() { + return tagValue; + } - public void setTagValue(String tagValue) { - this.tagValue = tagValue; - } + public void setTagValue(String tagValue) { + this.tagValue = tagValue; + } - public String getFilterName() { - return filterName; - } + public String getFilterName() { + return filterName; + } - public void setFilterName(String filterName) { - this.filterName = filterName; - } + public void setFilterName(String filterName) { + this.filterName = filterName; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/TopPatternTemplatesContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/TopPatternTemplatesContent.java index 650982f04..ef302d190 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/TopPatternTemplatesContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/TopPatternTemplatesContent.java @@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.Lists; - import java.io.Serializable; import java.util.List; @@ -29,32 +28,32 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class TopPatternTemplatesContent implements Serializable { - @JsonProperty("attributeValue") - private String attributeValue; + @JsonProperty("attributeValue") + private String attributeValue; - @JsonProperty(value = "patterns") - private List patternTemplates = Lists.newArrayList(); + @JsonProperty(value = "patterns") + private List patternTemplates = Lists.newArrayList(); - public TopPatternTemplatesContent() { - } + public TopPatternTemplatesContent() { + } - public TopPatternTemplatesContent(String attributeValue) { - this.attributeValue = attributeValue; - } + public TopPatternTemplatesContent(String attributeValue) { + this.attributeValue = attributeValue; + } - public String getAttributeValue() { - return attributeValue; - } + public String getAttributeValue() { + return attributeValue; + } - public void setAttributeValue(String attributeValue) { - this.attributeValue = attributeValue; - } + public void setAttributeValue(String attributeValue) { + this.attributeValue = attributeValue; + } - public List getPatternTemplates() { - return patternTemplates; - } + public List getPatternTemplates() { + return patternTemplates; + } - public void setPatternTemplates(List patternTemplates) { - this.patternTemplates = patternTemplates; - } + public void setPatternTemplates(List patternTemplates) { + this.patternTemplates = patternTemplates; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/UniqueBugContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/UniqueBugContent.java index 858f13e72..573c9a2d7 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/UniqueBugContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/UniqueBugContent.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.Lists; import com.google.common.collect.Sets; - import java.io.Serializable; import java.sql.Timestamp; import java.util.List; @@ -33,104 +32,105 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class UniqueBugContent implements Serializable { - @JsonProperty(value = "submitter") - private String submitter; + @JsonProperty(value = "submitter") + private String submitter; + + @JsonProperty(value = "url") + private String url; - @JsonProperty(value = "url") - private String url; + @JsonProperty(value = "submitDate") + private Timestamp submitDate; - @JsonProperty(value = "submitDate") - private Timestamp submitDate; + @JsonProperty(value = "items") + private List items = Lists.newArrayList(); - @JsonProperty(value = "items") - private List items = Lists.newArrayList(); + public String getSubmitter() { + return submitter; + } - public String getSubmitter() { - return submitter; - } + public void setSubmitter(String submitter) { + this.submitter = submitter; + } - public void setSubmitter(String submitter) { - this.submitter = submitter; - } + public String getUrl() { + return url; + } - public String getUrl() { - return url; - } + public void setUrl(String url) { + this.url = url; + } - public void setUrl(String url) { - this.url = url; - } + public Timestamp getSubmitDate() { + return submitDate; + } - public Timestamp getSubmitDate() { - return submitDate; - } + public void setSubmitDate(Timestamp submitDate) { + this.submitDate = submitDate; + } - public void setSubmitDate(Timestamp submitDate) { - this.submitDate = submitDate; - } + public List getItems() { + return items; + } - public List getItems() { - return items; - } + public void setItems(List items) { + this.items = items; + } - public void setItems(List items) { - this.items = items; - } + public static class ItemInfo implements Serializable { - public static class ItemInfo implements Serializable { - @JsonProperty(value = "itemId") - private Long testItemId; + @JsonProperty(value = "itemId") + private Long testItemId; - @JsonProperty(value = "itemName") - private String testItemName; + @JsonProperty(value = "itemName") + private String testItemName; - @JsonProperty(value = "launchId") - private Long launchId; + @JsonProperty(value = "launchId") + private Long launchId; - @JsonProperty(value = "path") - private String path; + @JsonProperty(value = "path") + private String path; - @JsonProperty(value = "attributes") - private Set itemAttributeResources = Sets.newHashSet(); + @JsonProperty(value = "attributes") + private Set itemAttributeResources = Sets.newHashSet(); - public Long getTestItemId() { - return testItemId; - } + public Long getTestItemId() { + return testItemId; + } - public void setTestItemId(Long testItemId) { - this.testItemId = testItemId; - } + public void setTestItemId(Long testItemId) { + this.testItemId = testItemId; + } - public String getTestItemName() { - return testItemName; - } + public String getTestItemName() { + return testItemName; + } - public void setTestItemName(String testItemName) { - this.testItemName = testItemName; - } + public void setTestItemName(String testItemName) { + this.testItemName = testItemName; + } - public Long getLaunchId() { - return launchId; - } + public Long getLaunchId() { + return launchId; + } - public void setLaunchId(Long launchId) { - this.launchId = launchId; - } + public void setLaunchId(Long launchId) { + this.launchId = launchId; + } - public String getPath() { - return path; - } + public String getPath() { + return path; + } - public void setPath(String path) { - this.path = path; - } + public void setPath(String path) { + this.path = path; + } - public Set getItemAttributeResources() { - return itemAttributeResources; - } + public Set getItemAttributeResources() { + return itemAttributeResources; + } - public void setItemAttributeResources(Set itemAttributeResources) { - this.itemAttributeResources = itemAttributeResources; - } - } + public void setItemAttributeResources(Set itemAttributeResources) { + this.itemAttributeResources = itemAttributeResources; + } + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/ComponentHealthCheckContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/ComponentHealthCheckContent.java index 21db28544..5054b15d7 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/ComponentHealthCheckContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/ComponentHealthCheckContent.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; - import java.io.Serializable; /** @@ -27,45 +26,45 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class ComponentHealthCheckContent implements Serializable { - @JsonProperty(value = "attributeValue") - private String attributeValue; + @JsonProperty(value = "attributeValue") + private String attributeValue; - @JsonProperty(value = "total") - private Long total; + @JsonProperty(value = "total") + private Long total; - @JsonProperty(value = "passingRate") - private Double passingRate; + @JsonProperty(value = "passingRate") + private Double passingRate; - public ComponentHealthCheckContent() { - } + public ComponentHealthCheckContent() { + } - public ComponentHealthCheckContent(String attributeValue, Long total, Double passingRate) { - this.attributeValue = attributeValue; - this.total = total; - this.passingRate = passingRate; - } + public ComponentHealthCheckContent(String attributeValue, Long total, Double passingRate) { + this.attributeValue = attributeValue; + this.total = total; + this.passingRate = passingRate; + } - public String getAttributeValue() { - return attributeValue; - } + public String getAttributeValue() { + return attributeValue; + } - public void setAttributeValue(String attributeValue) { - this.attributeValue = attributeValue; - } + public void setAttributeValue(String attributeValue) { + this.attributeValue = attributeValue; + } - public Long getTotal() { - return total; - } + public Long getTotal() { + return total; + } - public void setTotal(Long total) { - this.total = total; - } + public void setTotal(Long total) { + this.total = total; + } - public Double getPassingRate() { - return passingRate; - } + public Double getPassingRate() { + return passingRate; + } - public void setPassingRate(Double passingRate) { - this.passingRate = passingRate; - } + public void setPassingRate(Double passingRate) { + this.passingRate = passingRate; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableContent.java index 573105e0d..46dc584be 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableContent.java @@ -1,7 +1,6 @@ package com.epam.ta.reportportal.entity.widget.content.healthcheck; import com.fasterxml.jackson.annotation.JsonProperty; - import java.io.Serializable; import java.util.List; import java.util.Map; @@ -11,47 +10,47 @@ */ public class HealthCheckTableContent implements Serializable { - @JsonProperty(value = "attributeValue") - private String attributeValue; + @JsonProperty(value = "attributeValue") + private String attributeValue; - @JsonProperty(value = "passingRate") - private Double passingRate; + @JsonProperty(value = "passingRate") + private Double passingRate; - @JsonProperty(value = "statistics") - private Map statistics; + @JsonProperty(value = "statistics") + private Map statistics; - @JsonProperty(value = "customColumn") - private List customValues; + @JsonProperty(value = "customColumn") + private List customValues; - public String getAttributeValue() { - return attributeValue; - } + public String getAttributeValue() { + return attributeValue; + } - public void setAttributeValue(String attributeValue) { - this.attributeValue = attributeValue; - } + public void setAttributeValue(String attributeValue) { + this.attributeValue = attributeValue; + } - public Double getPassingRate() { - return passingRate; - } + public Double getPassingRate() { + return passingRate; + } - public void setPassingRate(Double passingRate) { - this.passingRate = passingRate; - } + public void setPassingRate(Double passingRate) { + this.passingRate = passingRate; + } - public Map getStatistics() { - return statistics; - } + public Map getStatistics() { + return statistics; + } - public void setStatistics(Map statistics) { - this.statistics = statistics; - } + public void setStatistics(Map statistics) { + this.statistics = statistics; + } - public List getCustomValues() { - return customValues; - } + public List getCustomValues() { + return customValues; + } - public void setCustomValues(List customValues) { - this.customValues = customValues; - } + public void setCustomValues(List customValues) { + this.customValues = customValues; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableGetParams.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableGetParams.java index d3d571327..0cbd460b8 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableGetParams.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableGetParams.java @@ -1,65 +1,69 @@ package com.epam.ta.reportportal.entity.widget.content.healthcheck; import com.google.common.collect.Lists; -import org.springframework.data.domain.Sort; - import java.util.List; +import org.springframework.data.domain.Sort; /** * @author Ivan Budayeu */ public class HealthCheckTableGetParams { - private final String viewName; - private final String currentLevelKey; - private final Sort sort; + private final String viewName; + private final String currentLevelKey; + private final Sort sort; - private final boolean includeCustomColumn; - private final List previousLevels; + private final boolean includeCustomColumn; + private final List previousLevels; - private HealthCheckTableGetParams(String viewName, String currentLevelKey, Sort sort, boolean includeCustomColumn) { - this.viewName = viewName; - this.currentLevelKey = currentLevelKey; - this.sort = sort; - this.includeCustomColumn = includeCustomColumn; - this.previousLevels = Lists.newArrayList(); - } + private HealthCheckTableGetParams(String viewName, String currentLevelKey, Sort sort, + boolean includeCustomColumn) { + this.viewName = viewName; + this.currentLevelKey = currentLevelKey; + this.sort = sort; + this.includeCustomColumn = includeCustomColumn; + this.previousLevels = Lists.newArrayList(); + } - private HealthCheckTableGetParams(String viewName, String currentLevelKey, Sort sort, boolean includeCustomColumn, - List previousLevels) { - this.viewName = viewName; - this.currentLevelKey = currentLevelKey; - this.sort = sort; - this.includeCustomColumn = includeCustomColumn; - this.previousLevels = previousLevels; - } + private HealthCheckTableGetParams(String viewName, String currentLevelKey, Sort sort, + boolean includeCustomColumn, + List previousLevels) { + this.viewName = viewName; + this.currentLevelKey = currentLevelKey; + this.sort = sort; + this.includeCustomColumn = includeCustomColumn; + this.previousLevels = previousLevels; + } - public static HealthCheckTableGetParams of(String viewName, String currentLevelKey, Sort sort, boolean includeCustomColumn) { - return new HealthCheckTableGetParams(viewName, currentLevelKey, sort, includeCustomColumn); - } + public static HealthCheckTableGetParams of(String viewName, String currentLevelKey, Sort sort, + boolean includeCustomColumn) { + return new HealthCheckTableGetParams(viewName, currentLevelKey, sort, includeCustomColumn); + } - public static HealthCheckTableGetParams of(String viewName, String currentLevelKey, Sort sort, boolean includeCustomColumn, - List previousLevels) { - return new HealthCheckTableGetParams(viewName, currentLevelKey, sort, includeCustomColumn, previousLevels); - } + public static HealthCheckTableGetParams of(String viewName, String currentLevelKey, Sort sort, + boolean includeCustomColumn, + List previousLevels) { + return new HealthCheckTableGetParams(viewName, currentLevelKey, sort, includeCustomColumn, + previousLevels); + } - public String getViewName() { - return viewName; - } + public String getViewName() { + return viewName; + } - public String getCurrentLevelKey() { - return currentLevelKey; - } + public String getCurrentLevelKey() { + return currentLevelKey; + } - public Sort getSort() { - return sort; - } + public Sort getSort() { + return sort; + } - public boolean isIncludeCustomColumn() { - return includeCustomColumn; - } + public boolean isIncludeCustomColumn() { + return includeCustomColumn; + } - public List getPreviousLevels() { - return previousLevels; - } + public List getPreviousLevels() { + return previousLevels; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableInitParams.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableInitParams.java index a71b02973..ef8548539 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableInitParams.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableInitParams.java @@ -1,54 +1,54 @@ package com.epam.ta.reportportal.entity.widget.content.healthcheck; -import javax.annotation.Nullable; import java.util.List; +import javax.annotation.Nullable; /** * @author Ivan Budayeu */ public class HealthCheckTableInitParams { - private final String viewName; - private final List attributeKeys; - - @Nullable - private String customKey; - - private HealthCheckTableInitParams(String viewName, List attributeKeys) { - this.viewName = viewName; - this.attributeKeys = attributeKeys; - } - - private HealthCheckTableInitParams(String viewName, List attributeKeys, - @Nullable String customKey) { - this.viewName = viewName; - this.attributeKeys = attributeKeys; - this.customKey = customKey; - } - - public static HealthCheckTableInitParams of(String viewName, List attributeKeys) { - return new HealthCheckTableInitParams(viewName, attributeKeys); - } - - public static HealthCheckTableInitParams of(String viewName, List attributeKeys, - @Nullable String customKey) { - return new HealthCheckTableInitParams(viewName, attributeKeys, customKey); - } - - public String getViewName() { - return viewName; - } - - public List getAttributeKeys() { - return attributeKeys; - } - - @Nullable - public String getCustomKey() { - return customKey; - } - - public void setCustomKey(@Nullable String customKey) { - this.customKey = customKey; - } + private final String viewName; + private final List attributeKeys; + + @Nullable + private String customKey; + + private HealthCheckTableInitParams(String viewName, List attributeKeys) { + this.viewName = viewName; + this.attributeKeys = attributeKeys; + } + + private HealthCheckTableInitParams(String viewName, List attributeKeys, + @Nullable String customKey) { + this.viewName = viewName; + this.attributeKeys = attributeKeys; + this.customKey = customKey; + } + + public static HealthCheckTableInitParams of(String viewName, List attributeKeys) { + return new HealthCheckTableInitParams(viewName, attributeKeys); + } + + public static HealthCheckTableInitParams of(String viewName, List attributeKeys, + @Nullable String customKey) { + return new HealthCheckTableInitParams(viewName, attributeKeys, customKey); + } + + public String getViewName() { + return viewName; + } + + public List getAttributeKeys() { + return attributeKeys; + } + + @Nullable + public String getCustomKey() { + return customKey; + } + + public void setCustomKey(@Nullable String customKey) { + this.customKey = customKey; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableStatisticsContent.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableStatisticsContent.java index bb81e8160..e85ca2a4b 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableStatisticsContent.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/HealthCheckTableStatisticsContent.java @@ -1,7 +1,6 @@ package com.epam.ta.reportportal.entity.widget.content.healthcheck; import com.google.common.collect.Maps; - import java.util.Map; /** @@ -9,23 +8,23 @@ */ public class HealthCheckTableStatisticsContent { - private Double passingRate; + private Double passingRate; - private Map statistics = Maps.newHashMap(); + private Map statistics = Maps.newHashMap(); - public Double getPassingRate() { - return passingRate; - } + public Double getPassingRate() { + return passingRate; + } - public void setPassingRate(Double passingRate) { - this.passingRate = passingRate; - } + public void setPassingRate(Double passingRate) { + this.passingRate = passingRate; + } - public Map getStatistics() { - return statistics; - } + public Map getStatistics() { + return statistics; + } - public void setStatistics(Map statistics) { - this.statistics = statistics; - } + public void setStatistics(Map statistics) { + this.statistics = statistics; + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/LevelEntry.java b/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/LevelEntry.java index 6dcc63c3e..42340ae62 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/LevelEntry.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/content/healthcheck/LevelEntry.java @@ -5,23 +5,23 @@ */ public class LevelEntry { - private final String key; - private final String value; + private final String key; + private final String value; - private LevelEntry(String key, String value) { - this.key = key; - this.value = value; - } + private LevelEntry(String key, String value) { + this.key = key; + this.value = value; + } - public static LevelEntry of(String key, String value) { - return new LevelEntry(key, value); - } + public static LevelEntry of(String key, String value) { + return new LevelEntry(key, value); + } - public String getKey() { - return key; - } + public String getKey() { + return key; + } - public String getValue() { - return value; - } + public String getValue() { + return value; + } } diff --git a/src/main/java/com/epam/ta/reportportal/exception/DataStorageException.java b/src/main/java/com/epam/ta/reportportal/exception/DataStorageException.java index 0c0688031..472379972 100644 --- a/src/main/java/com/epam/ta/reportportal/exception/DataStorageException.java +++ b/src/main/java/com/epam/ta/reportportal/exception/DataStorageException.java @@ -24,15 +24,15 @@ // TODO add binding to this exception public class DataStorageException extends ReportPortalException { - private static final long serialVersionUID = -6822780391660931103L; + private static final long serialVersionUID = -6822780391660931103L; - public DataStorageException(String message) { - super(message); + public DataStorageException(String message) { + super(message); - } + } - public DataStorageException(String message, Throwable e) { - super(message, e); - } + public DataStorageException(String message, Throwable e) { + super(message, e); + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/DataEncoder.java b/src/main/java/com/epam/ta/reportportal/filesystem/DataEncoder.java index 45f93db4a..e30544b67 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/DataEncoder.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/DataEncoder.java @@ -16,11 +16,10 @@ package com.epam.ta.reportportal.filesystem; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Component; - import java.nio.charset.StandardCharsets; import java.util.Base64; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; /** * @author Dzianis_Shybeka @@ -30,27 +29,29 @@ @Component public class DataEncoder { - /** - * Encode provided data. - * - * @param data - * @return - */ - public String encode(String data) { - - return StringUtils.isEmpty(data) ? - data : - Base64.getUrlEncoder().withoutPadding().encodeToString(data.getBytes(StandardCharsets.UTF_8)); - } - - /** - * Decode provided data. - * - * @param data - * @return - */ - public String decode(String data) { - - return StringUtils.isEmpty(data) ? data : new String(Base64.getUrlDecoder().decode(data), StandardCharsets.UTF_8); - } + /** + * Encode provided data. + * + * @param data + * @return + */ + public String encode(String data) { + + return StringUtils.isEmpty(data) ? + data : + Base64.getUrlEncoder().withoutPadding() + .encodeToString(data.getBytes(StandardCharsets.UTF_8)); + } + + /** + * Decode provided data. + * + * @param data + * @return + */ + public String decode(String data) { + + return StringUtils.isEmpty(data) ? data + : new String(Base64.getUrlDecoder().decode(data), StandardCharsets.UTF_8); + } } diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java index 58203495a..9e6c7e2d8 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java @@ -23,9 +23,9 @@ */ public interface DataStore { - String save(String fileName, InputStream inputStream); + String save(String fileName, InputStream inputStream); - InputStream load(String filePath); + InputStream load(String filePath); - void delete(String filePath); + void delete(String filePath); } diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/FilePathGenerator.java b/src/main/java/com/epam/ta/reportportal/filesystem/FilePathGenerator.java index dd2676e32..91d7ecf70 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/FilePathGenerator.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/FilePathGenerator.java @@ -18,10 +18,9 @@ import com.epam.ta.reportportal.entity.attachment.AttachmentMetaInfo; import com.epam.ta.reportportal.util.DateTimeProvider; -import org.springframework.stereotype.Component; - import java.nio.file.Paths; import java.time.LocalDateTime; +import org.springframework.stereotype.Component; /** * @author Dzianis_Shybeka @@ -29,20 +28,21 @@ @Component public class FilePathGenerator { - private final DateTimeProvider dateTimeProvider; + private final DateTimeProvider dateTimeProvider; - public FilePathGenerator(DateTimeProvider dateTimeProvider) { - this.dateTimeProvider = dateTimeProvider; - } + public FilePathGenerator(DateTimeProvider dateTimeProvider) { + this.dateTimeProvider = dateTimeProvider; + } - /** - * Generate relative file path for new local file. projectId/year-month/launchUUID - * - * @return Generated path - */ - public String generate(AttachmentMetaInfo metaInfo) { - LocalDateTime localDateTime = dateTimeProvider.localDateTimeNow(); - String date = localDateTime.getYear() + "-" + localDateTime.getMonthValue(); - return Paths.get(String.valueOf(metaInfo.getProjectId()), date, metaInfo.getLaunchUuid()).toString(); - } + /** + * Generate relative file path for new local file. projectId/year-month/launchUUID + * + * @return Generated path + */ + public String generate(AttachmentMetaInfo metaInfo) { + LocalDateTime localDateTime = dateTimeProvider.localDateTimeNow(); + String date = localDateTime.getYear() + "-" + localDateTime.getMonthValue(); + return Paths.get(String.valueOf(metaInfo.getProjectId()), date, metaInfo.getLaunchUuid()) + .toString(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java index ad74302c8..96d935a0f 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java @@ -18,9 +18,6 @@ import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.ws.model.ErrorType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; @@ -28,70 +25,72 @@ import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import java.util.Objects; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @author Dzianis_Shybeka */ public class LocalDataStore implements DataStore { - private static final Logger logger = LoggerFactory.getLogger(LocalDataStore.class); + private static final Logger logger = LoggerFactory.getLogger(LocalDataStore.class); - private final String storageRootPath; + private final String storageRootPath; - public LocalDataStore(String storageRootPath) { - this.storageRootPath = storageRootPath; - } + public LocalDataStore(String storageRootPath) { + this.storageRootPath = storageRootPath; + } - @Override - public String save(String filePath, InputStream inputStream) { + @Override + public String save(String filePath, InputStream inputStream) { - try { + try { - Path targetPath = Paths.get(storageRootPath, filePath); - Path targetDirectory = targetPath.getParent(); + Path targetPath = Paths.get(storageRootPath, filePath); + Path targetDirectory = targetPath.getParent(); - if (Objects.nonNull(targetDirectory) && !Files.isDirectory(targetDirectory)) { - Files.createDirectories(targetDirectory); - } + if (Objects.nonNull(targetDirectory) && !Files.isDirectory(targetDirectory)) { + Files.createDirectories(targetDirectory); + } - logger.debug("Saving to: {} ", targetPath.toAbsolutePath()); + logger.debug("Saving to: {} ", targetPath.toAbsolutePath()); - Files.copy(inputStream, targetPath, StandardCopyOption.REPLACE_EXISTING); + Files.copy(inputStream, targetPath, StandardCopyOption.REPLACE_EXISTING); - return filePath; - } catch (IOException e) { + return filePath; + } catch (IOException e) { - logger.error("Unable to save log file '{}'", filePath, e); + logger.error("Unable to save log file '{}'", filePath, e); - throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to save log file"); - } - } + throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to save log file"); + } + } - @Override - public InputStream load(String filePath) { + @Override + public InputStream load(String filePath) { - try { + try { - return Files.newInputStream(Paths.get(storageRootPath, filePath)); - } catch (IOException e) { + return Files.newInputStream(Paths.get(storageRootPath, filePath)); + } catch (IOException e) { - logger.error("Unable to find file '{}'", filePath, e); + logger.error("Unable to find file '{}'", filePath, e); - throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); - } - } + throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); + } + } - @Override - public void delete(String filePath) { + @Override + public void delete(String filePath) { - try { + try { - Files.deleteIfExists(Paths.get(storageRootPath, filePath)); - } catch (IOException e) { + Files.deleteIfExists(Paths.get(storageRootPath, filePath)); + } catch (IOException e) { - logger.error("Unable to delete file '{}'", filePath, e); + logger.error("Unable to delete file '{}'", filePath, e); - throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to delete file"); - } - } + throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to delete file"); + } + } } diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java index 803ecf531..84d417618 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java @@ -19,6 +19,12 @@ import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.filesystem.DataStore; import com.epam.ta.reportportal.ws.model.ErrorType; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.domain.Blob; import org.jclouds.domain.Location; @@ -27,107 +33,102 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; - /** * @author Ivan Budayeu */ public class S3DataStore implements DataStore { - private static final Logger LOGGER = LoggerFactory.getLogger(S3DataStore.class); - private static final Lock CREATE_BUCKET_LOCK = new ReentrantLock(); + private static final Logger LOGGER = LoggerFactory.getLogger(S3DataStore.class); + private static final Lock CREATE_BUCKET_LOCK = new ReentrantLock(); - private final BlobStore blobStore; - private final String bucketPrefix; - private final String defaultBucketName; - private final Location location; + private final BlobStore blobStore; + private final String bucketPrefix; + private final String defaultBucketName; + private final Location location; - public S3DataStore(BlobStore blobStore, String bucketPrefix, String defaultBucketName, String region) { - this.blobStore = blobStore; - this.bucketPrefix = bucketPrefix; - this.defaultBucketName = defaultBucketName; - this.location = getLocationFromString(region); - } + public S3DataStore(BlobStore blobStore, String bucketPrefix, String defaultBucketName, + String region) { + this.blobStore = blobStore; + this.bucketPrefix = bucketPrefix; + this.defaultBucketName = defaultBucketName; + this.location = getLocationFromString(region); + } - @Override - public String save(String filePath, InputStream inputStream) { - S3File s3File = getS3File(filePath); - try { - if (!blobStore.containerExists(s3File.getBucket())) { - CREATE_BUCKET_LOCK.lock(); - try { - if (!blobStore.containerExists(s3File.getBucket())) { - blobStore.createContainerInLocation(location, s3File.getBucket()); - } - } finally { - CREATE_BUCKET_LOCK.unlock(); - } - } + @Override + public String save(String filePath, InputStream inputStream) { + S3File s3File = getS3File(filePath); + try { + if (!blobStore.containerExists(s3File.getBucket())) { + CREATE_BUCKET_LOCK.lock(); + try { + if (!blobStore.containerExists(s3File.getBucket())) { + blobStore.createContainerInLocation(location, s3File.getBucket()); + } + } finally { + CREATE_BUCKET_LOCK.unlock(); + } + } - Blob objectBlob = blobStore.blobBuilder(s3File.getFilePath()) - .payload(inputStream) - .contentDisposition(s3File.getFilePath()) - .contentLength(inputStream.available()) - .build(); - blobStore.putBlob(s3File.getBucket(), objectBlob); - return Paths.get(filePath).toString(); - } catch (IOException e) { - LOGGER.error("Unable to save file '{}'", filePath, e); - throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to save file"); - } - } + Blob objectBlob = blobStore.blobBuilder(s3File.getFilePath()) + .payload(inputStream) + .contentDisposition(s3File.getFilePath()) + .contentLength(inputStream.available()) + .build(); + blobStore.putBlob(s3File.getBucket(), objectBlob); + return Paths.get(filePath).toString(); + } catch (IOException e) { + LOGGER.error("Unable to save file '{}'", filePath, e); + throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to save file"); + } + } - @Override - public InputStream load(String filePath) { - S3File s3File = getS3File(filePath); - try { - return blobStore.getBlob(s3File.getBucket(), s3File.getFilePath()).getPayload().openStream(); - } catch (Exception e) { - LOGGER.error("Unable to find file '{}'", filePath, e); - throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); - } - } + @Override + public InputStream load(String filePath) { + S3File s3File = getS3File(filePath); + try { + return blobStore.getBlob(s3File.getBucket(), s3File.getFilePath()).getPayload().openStream(); + } catch (Exception e) { + LOGGER.error("Unable to find file '{}'", filePath, e); + throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); + } + } - @Override - public void delete(String filePath) { - S3File s3File = getS3File(filePath); - try { - blobStore.removeBlob(s3File.getBucket(), s3File.getFilePath()); - } catch (Exception e) { - LOGGER.error("Unable to delete file '{}'", filePath, e); - throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to delete file"); - } - } + @Override + public void delete(String filePath) { + S3File s3File = getS3File(filePath); + try { + blobStore.removeBlob(s3File.getBucket(), s3File.getFilePath()); + } catch (Exception e) { + LOGGER.error("Unable to delete file '{}'", filePath, e); + throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to delete file"); + } + } - private S3File getS3File(String filePath) { - Path targetPath = Paths.get(filePath); - int nameCount = targetPath.getNameCount(); - if (nameCount > 1) { - return new S3File(bucketPrefix + retrievePath(targetPath, 0, 1), retrievePath(targetPath, 1, nameCount)); - } else { - return new S3File(defaultBucketName, retrievePath(targetPath, 0, 1)); - } + private S3File getS3File(String filePath) { + Path targetPath = Paths.get(filePath); + int nameCount = targetPath.getNameCount(); + if (nameCount > 1) { + return new S3File(bucketPrefix + retrievePath(targetPath, 0, 1), + retrievePath(targetPath, 1, nameCount)); + } else { + return new S3File(defaultBucketName, retrievePath(targetPath, 0, 1)); + } - } + } - private Location getLocationFromString(String locationString) { - Location location = null; - if (locationString != null) { - location = new LocationBuilder() - .scope(LocationScope.REGION) - .id(locationString) - .description("region") - .build(); - } - return location; - } + private Location getLocationFromString(String locationString) { + Location location = null; + if (locationString != null) { + location = new LocationBuilder() + .scope(LocationScope.REGION) + .id(locationString) + .description("region") + .build(); + } + return location; + } - private String retrievePath(Path path, int beginIndex, int endIndex) { - return String.valueOf(path.subpath(beginIndex, endIndex)); - } + private String retrievePath(Path path, int beginIndex, int endIndex) { + return String.valueOf(path.subpath(beginIndex, endIndex)); + } } diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3File.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3File.java index 27a2ce27f..aac56b4f3 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3File.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3File.java @@ -21,19 +21,19 @@ */ public class S3File { - private final String bucket; - private final String filePath; + private final String bucket; + private final String filePath; - public S3File(String bucket, String filePath) { - this.bucket = bucket; - this.filePath = filePath; - } + public S3File(String bucket, String filePath) { + this.bucket = bucket; + this.filePath = filePath; + } - public String getBucket() { - return bucket; - } + public String getBucket() { + return bucket; + } - public String getFilePath() { - return filePath; - } + public String getFilePath() { + return filePath; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/DefaultCatalog.java b/src/main/java/com/epam/ta/reportportal/jooq/DefaultCatalog.java index 4aa1da4ff..7750178ac 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/DefaultCatalog.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/DefaultCatalog.java @@ -7,9 +7,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Schema; import org.jooq.impl.CatalogImpl; @@ -24,37 +22,35 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class DefaultCatalog extends CatalogImpl { - private static final long serialVersionUID = 312084026; - - /** - * The reference instance of - */ - public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog(); - - /** - * The schema public. - */ - public final JPublic PUBLIC = com.epam.ta.reportportal.jooq.JPublic.PUBLIC; - - /** - * No further instances allowed - */ - private DefaultCatalog() { - super(""); - } - - @Override - public final List getSchemas() { - List result = new ArrayList(); - result.addAll(getSchemas0()); - return result; - } - - private final List getSchemas0() { - return Arrays.asList( - JPublic.PUBLIC); - } + /** + * The reference instance of + */ + public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog(); + private static final long serialVersionUID = 312084026; + /** + * The schema public. + */ + public final JPublic PUBLIC = com.epam.ta.reportportal.jooq.JPublic.PUBLIC; + + /** + * No further instances allowed + */ + private DefaultCatalog() { + super(""); + } + + @Override + public final List getSchemas() { + List result = new ArrayList(); + result.addAll(getSchemas0()); + return result; + } + + private final List getSchemas0() { + return Arrays.asList( + JPublic.PUBLIC); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java b/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java index 40ec4c11b..8c16731f6 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java @@ -4,13 +4,67 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.*; +import com.epam.ta.reportportal.jooq.tables.JAclClass; +import com.epam.ta.reportportal.jooq.tables.JAclEntry; +import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; +import com.epam.ta.reportportal.jooq.tables.JAclSid; +import com.epam.ta.reportportal.jooq.tables.JActivity; +import com.epam.ta.reportportal.jooq.tables.JAttachment; +import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; +import com.epam.ta.reportportal.jooq.tables.JAttribute; +import com.epam.ta.reportportal.jooq.tables.JClusters; +import com.epam.ta.reportportal.jooq.tables.JClustersTestItem; +import com.epam.ta.reportportal.jooq.tables.JContentField; +import com.epam.ta.reportportal.jooq.tables.JDashboard; +import com.epam.ta.reportportal.jooq.tables.JDashboardWidget; +import com.epam.ta.reportportal.jooq.tables.JFilter; +import com.epam.ta.reportportal.jooq.tables.JFilterCondition; +import com.epam.ta.reportportal.jooq.tables.JFilterSort; +import com.epam.ta.reportportal.jooq.tables.JIntegration; +import com.epam.ta.reportportal.jooq.tables.JIntegrationType; +import com.epam.ta.reportportal.jooq.tables.JIssue; +import com.epam.ta.reportportal.jooq.tables.JIssueGroup; +import com.epam.ta.reportportal.jooq.tables.JIssueTicket; +import com.epam.ta.reportportal.jooq.tables.JIssueType; +import com.epam.ta.reportportal.jooq.tables.JIssueTypeProject; +import com.epam.ta.reportportal.jooq.tables.JItemAttribute; +import com.epam.ta.reportportal.jooq.tables.JLaunch; +import com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules; +import com.epam.ta.reportportal.jooq.tables.JLaunchNames; +import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; +import com.epam.ta.reportportal.jooq.tables.JLog; +import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; +import com.epam.ta.reportportal.jooq.tables.JOnboarding; +import com.epam.ta.reportportal.jooq.tables.JParameter; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; +import com.epam.ta.reportportal.jooq.tables.JProject; +import com.epam.ta.reportportal.jooq.tables.JProjectAttribute; +import com.epam.ta.reportportal.jooq.tables.JProjectUser; +import com.epam.ta.reportportal.jooq.tables.JRecipients; +import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; +import com.epam.ta.reportportal.jooq.tables.JSenderCase; +import com.epam.ta.reportportal.jooq.tables.JServerSettings; +import com.epam.ta.reportportal.jooq.tables.JShareableEntity; +import com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView; +import com.epam.ta.reportportal.jooq.tables.JStatistics; +import com.epam.ta.reportportal.jooq.tables.JStatisticsField; +import com.epam.ta.reportportal.jooq.tables.JTestItem; +import com.epam.ta.reportportal.jooq.tables.JTestItemResults; +import com.epam.ta.reportportal.jooq.tables.JTicket; +import com.epam.ta.reportportal.jooq.tables.JUserCreationBid; +import com.epam.ta.reportportal.jooq.tables.JUserPreference; +import com.epam.ta.reportportal.jooq.tables.JUsers; +import com.epam.ta.reportportal.jooq.tables.JWidget; +import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; +import javax.annotation.processing.Generated; import org.jooq.Index; import org.jooq.OrderField; import org.jooq.impl.Internal; -import javax.annotation.processing.Generated; - /** * A class modelling indexes of tables of the public schema. @@ -22,288 +76,512 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class Indexes { - // ------------------------------------------------------------------------- - // INDEX definitions - // ------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // INDEX definitions + // ------------------------------------------------------------------------- + + public static final Index ACL_CLASS_PKEY = Indexes0.ACL_CLASS_PKEY; + public static final Index UNIQUE_UK_2 = Indexes0.UNIQUE_UK_2; + public static final Index ACL_ENTRY_PKEY = Indexes0.ACL_ENTRY_PKEY; + public static final Index UNIQUE_UK_4 = Indexes0.UNIQUE_UK_4; + public static final Index ACL_OBJECT_IDENTITY_PKEY = Indexes0.ACL_OBJECT_IDENTITY_PKEY; + public static final Index UNIQUE_UK_3 = Indexes0.UNIQUE_UK_3; + public static final Index ACL_SID_IDX = Indexes0.ACL_SID_IDX; + public static final Index ACL_SID_PKEY = Indexes0.ACL_SID_PKEY; + public static final Index UNIQUE_UK_1 = Indexes0.UNIQUE_UK_1; + public static final Index ACTIVITY_CREATION_DATE_IDX = Indexes0.ACTIVITY_CREATION_DATE_IDX; + public static final Index ACTIVITY_OBJECT_IDX = Indexes0.ACTIVITY_OBJECT_IDX; + public static final Index ACTIVITY_PK = Indexes0.ACTIVITY_PK; + public static final Index ACTIVITY_PROJECT_IDX = Indexes0.ACTIVITY_PROJECT_IDX; + public static final Index ATT_ITEM_IDX = Indexes0.ATT_ITEM_IDX; + public static final Index ATT_LAUNCH_IDX = Indexes0.ATT_LAUNCH_IDX; + public static final Index ATT_PROJECT_IDX = Indexes0.ATT_PROJECT_IDX; + public static final Index ATTACHMENT_PK = Indexes0.ATTACHMENT_PK; + public static final Index ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX = Indexes0.ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX; + public static final Index ATTACHMENT_DELETION_PKEY = Indexes0.ATTACHMENT_DELETION_PKEY; + public static final Index ATTRIBUTE_PK = Indexes0.ATTRIBUTE_PK; + public static final Index CLUSTER_INDEX_ID_IDX = Indexes0.CLUSTER_INDEX_ID_IDX; + public static final Index CLUSTER_LAUNCH_IDX = Indexes0.CLUSTER_LAUNCH_IDX; + public static final Index CLUSTER_PROJECT_IDX = Indexes0.CLUSTER_PROJECT_IDX; + public static final Index CLUSTERS_PK = Indexes0.CLUSTERS_PK; + public static final Index INDEX_ID_LAUNCH_ID_UNQ = Indexes0.INDEX_ID_LAUNCH_ID_UNQ; + public static final Index CLUSTER_ITEM_CLUSTER_IDX = Indexes0.CLUSTER_ITEM_CLUSTER_IDX; + public static final Index CLUSTER_ITEM_ITEM_IDX = Indexes0.CLUSTER_ITEM_ITEM_IDX; + public static final Index CLUSTER_ITEM_UNQ = Indexes0.CLUSTER_ITEM_UNQ; + public static final Index CONTENT_FIELD_IDX = Indexes0.CONTENT_FIELD_IDX; + public static final Index CONTENT_FIELD_WIDGET_IDX = Indexes0.CONTENT_FIELD_WIDGET_IDX; + public static final Index DASHBOARD_PKEY = Indexes0.DASHBOARD_PKEY; + public static final Index DASHBOARD_WIDGET_PK = Indexes0.DASHBOARD_WIDGET_PK; + public static final Index WIDGET_ON_DASHBOARD_UNQ = Indexes0.WIDGET_ON_DASHBOARD_UNQ; + public static final Index FILTER_PKEY = Indexes0.FILTER_PKEY; + public static final Index FILTER_COND_FILTER_IDX = Indexes0.FILTER_COND_FILTER_IDX; + public static final Index FILTER_CONDITION_PK = Indexes0.FILTER_CONDITION_PK; + public static final Index FILTER_SORT_FILTER_IDX = Indexes0.FILTER_SORT_FILTER_IDX; + public static final Index FILTER_SORT_PK = Indexes0.FILTER_SORT_PK; + public static final Index INTEGR_PROJECT_IDX = Indexes0.INTEGR_PROJECT_IDX; + public static final Index INTEGRATION_PK = Indexes0.INTEGRATION_PK; + public static final Index UNIQUE_GLOBAL_INTEGRATION_NAME = Indexes0.UNIQUE_GLOBAL_INTEGRATION_NAME; + public static final Index UNIQUE_PROJECT_INTEGRATION_NAME = Indexes0.UNIQUE_PROJECT_INTEGRATION_NAME; + public static final Index INTEGRATION_TYPE_NAME_KEY = Indexes0.INTEGRATION_TYPE_NAME_KEY; + public static final Index INTEGRATION_TYPE_PK = Indexes0.INTEGRATION_TYPE_PK; + public static final Index ISSUE_IT_IDX = Indexes0.ISSUE_IT_IDX; + public static final Index ISSUE_PK = Indexes0.ISSUE_PK; + public static final Index ISSUE_GROUP_PK = Indexes0.ISSUE_GROUP_PK; + public static final Index ISSUE_TICKET_PK = Indexes0.ISSUE_TICKET_PK; + public static final Index ISSUE_TYPE_GROUP_IDX = Indexes0.ISSUE_TYPE_GROUP_IDX; + public static final Index ISSUE_TYPE_LOCATOR_KEY = Indexes0.ISSUE_TYPE_LOCATOR_KEY; + public static final Index ISSUE_TYPE_PK = Indexes0.ISSUE_TYPE_PK; + public static final Index ISSUE_TYPE_PROJECT_PK = Indexes0.ISSUE_TYPE_PROJECT_PK; + public static final Index ITEM_ATTR_LAUNCH_IDX = Indexes0.ITEM_ATTR_LAUNCH_IDX; + public static final Index ITEM_ATTR_TI_IDX = Indexes0.ITEM_ATTR_TI_IDX; + public static final Index ITEM_ATTRIBUTE_PK = Indexes0.ITEM_ATTRIBUTE_PK; + public static final Index LAUNCH_PK = Indexes0.LAUNCH_PK; + public static final Index LAUNCH_PROJECT_START_TIME_IDX = Indexes0.LAUNCH_PROJECT_START_TIME_IDX; + public static final Index LAUNCH_USER_IDX = Indexes0.LAUNCH_USER_IDX; + public static final Index LAUNCH_UUID_KEY = Indexes0.LAUNCH_UUID_KEY; + public static final Index UNQ_NAME_NUMBER = Indexes0.UNQ_NAME_NUMBER; + public static final Index L_ATTR_RL_SEND_CASE_IDX = Indexes0.L_ATTR_RL_SEND_CASE_IDX; + public static final Index LAUNCH_ATTRIBUTE_RULES_PK = Indexes0.LAUNCH_ATTRIBUTE_RULES_PK; + public static final Index LN_SEND_CASE_IDX = Indexes0.LN_SEND_CASE_IDX; + public static final Index LAUNCH_NUMBER_PK = Indexes0.LAUNCH_NUMBER_PK; + public static final Index UNQ_PROJECT_NAME = Indexes0.UNQ_PROJECT_NAME; + public static final Index LOG_ATTACH_ID_IDX = Indexes0.LOG_ATTACH_ID_IDX; + public static final Index LOG_CLUSTER_IDX = Indexes0.LOG_CLUSTER_IDX; + public static final Index LOG_LAUNCH_ID_IDX = Indexes0.LOG_LAUNCH_ID_IDX; + public static final Index LOG_MESSAGE_TRGM_IDX = Indexes0.LOG_MESSAGE_TRGM_IDX; + public static final Index LOG_PK = Indexes0.LOG_PK; + public static final Index LOG_PROJECT_ID_LOG_TIME_IDX = Indexes0.LOG_PROJECT_ID_LOG_TIME_IDX; + public static final Index LOG_PROJECT_IDX = Indexes0.LOG_PROJECT_IDX; + public static final Index LOG_TI_IDX = Indexes0.LOG_TI_IDX; + public static final Index OAUTH_ACCESS_TOKEN_PKEY = Indexes0.OAUTH_ACCESS_TOKEN_PKEY; + public static final Index OAUTH_AT_USER_IDX = Indexes0.OAUTH_AT_USER_IDX; + public static final Index USERS_ACCESS_TOKEN_UNIQUE = Indexes0.USERS_ACCESS_TOKEN_UNIQUE; + public static final Index OAUTH_REGISTRATION_CLIENT_ID_KEY = Indexes0.OAUTH_REGISTRATION_CLIENT_ID_KEY; + public static final Index OAUTH_REGISTRATION_PKEY = Indexes0.OAUTH_REGISTRATION_PKEY; + public static final Index OAUTH_REGISTRATION_RESTRICTION_PK = Indexes0.OAUTH_REGISTRATION_RESTRICTION_PK; + public static final Index OAUTH_REGISTRATION_RESTRICTION_UNIQUE = Indexes0.OAUTH_REGISTRATION_RESTRICTION_UNIQUE; + public static final Index OAUTH_REGISTRATION_SCOPE_PK = Indexes0.OAUTH_REGISTRATION_SCOPE_PK; + public static final Index OAUTH_REGISTRATION_SCOPE_UNIQUE = Indexes0.OAUTH_REGISTRATION_SCOPE_UNIQUE; + public static final Index ONBOARDING_PK = Indexes0.ONBOARDING_PK; + public static final Index PARAMETER_TI_IDX = Indexes0.PARAMETER_TI_IDX; + public static final Index PATTERN_TEMPLATE_PK = Indexes0.PATTERN_TEMPLATE_PK; + public static final Index UNQ_NAME_PROJECTID = Indexes0.UNQ_NAME_PROJECTID; + public static final Index PATTERN_ITEM_ITEM_ID_IDX = Indexes0.PATTERN_ITEM_ITEM_ID_IDX; + public static final Index PATTERN_ITEM_UNQ = Indexes0.PATTERN_ITEM_UNQ; + public static final Index PROJECT_NAME_KEY = Indexes0.PROJECT_NAME_KEY; + public static final Index PROJECT_PK = Indexes0.PROJECT_PK; + public static final Index UNIQUE_ATTRIBUTE_PER_PROJECT = Indexes0.UNIQUE_ATTRIBUTE_PER_PROJECT; + public static final Index USERS_PROJECT_PK = Indexes0.USERS_PROJECT_PK; + public static final Index RCPNT_SEND_CASE_IDX = Indexes0.RCPNT_SEND_CASE_IDX; + public static final Index RESTORE_PASSWORD_BID_EMAIL_KEY = Indexes0.RESTORE_PASSWORD_BID_EMAIL_KEY; + public static final Index RESTORE_PASSWORD_BID_PK = Indexes0.RESTORE_PASSWORD_BID_PK; + public static final Index SENDER_CASE_PK = Indexes0.SENDER_CASE_PK; + public static final Index SENDER_CASE_PROJECT_IDX = Indexes0.SENDER_CASE_PROJECT_IDX; + public static final Index SERVER_SETTINGS_ID = Indexes0.SERVER_SETTINGS_ID; + public static final Index SERVER_SETTINGS_KEY_KEY = Indexes0.SERVER_SETTINGS_KEY_KEY; + public static final Index SHAREABLE_PK = Indexes0.SHAREABLE_PK; + public static final Index SHARED_ENTITY_OWNERX = Indexes0.SHARED_ENTITY_OWNERX; + public static final Index SHARED_ENTITY_PROJECT_IDX = Indexes0.SHARED_ENTITY_PROJECT_IDX; + public static final Index STALE_MATERIALIZED_VIEW_NAME_KEY = Indexes0.STALE_MATERIALIZED_VIEW_NAME_KEY; + public static final Index STALE_MATERIALIZED_VIEW_PKEY = Indexes0.STALE_MATERIALIZED_VIEW_PKEY; + public static final Index STALE_MV_CREATION_DATE_IDX = Indexes0.STALE_MV_CREATION_DATE_IDX; + public static final Index STATISTICS_LAUNCH_IDX = Indexes0.STATISTICS_LAUNCH_IDX; + public static final Index STATISTICS_PK = Indexes0.STATISTICS_PK; + public static final Index STATISTICS_TI_IDX = Indexes0.STATISTICS_TI_IDX; + public static final Index UNIQUE_STATS_ITEM = Indexes0.UNIQUE_STATS_ITEM; + public static final Index UNIQUE_STATS_LAUNCH = Indexes0.UNIQUE_STATS_LAUNCH; + public static final Index STATISTICS_FIELD_NAME_KEY = Indexes0.STATISTICS_FIELD_NAME_KEY; + public static final Index STATISTICS_FIELD_PK = Indexes0.STATISTICS_FIELD_PK; + public static final Index ITEM_TEST_CASE_ID_LAUNCH_ID_IDX = Indexes0.ITEM_TEST_CASE_ID_LAUNCH_ID_IDX; + public static final Index PATH_GIST_IDX = Indexes0.PATH_GIST_IDX; + public static final Index PATH_IDX = Indexes0.PATH_IDX; + public static final Index TEST_CASE_HASH_LAUNCH_ID_IDX = Indexes0.TEST_CASE_HASH_LAUNCH_ID_IDX; + public static final Index TEST_ITEM_PK = Indexes0.TEST_ITEM_PK; + public static final Index TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX = Indexes0.TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX; + public static final Index TEST_ITEM_UUID_KEY = Indexes0.TEST_ITEM_UUID_KEY; + public static final Index TI_LAUNCH_IDX = Indexes0.TI_LAUNCH_IDX; + public static final Index TI_PARENT_IDX = Indexes0.TI_PARENT_IDX; + public static final Index TI_RETRY_OF_IDX = Indexes0.TI_RETRY_OF_IDX; + public static final Index TEST_ITEM_RESULTS_PK = Indexes0.TEST_ITEM_RESULTS_PK; + public static final Index TICKET_ID_IDX = Indexes0.TICKET_ID_IDX; + public static final Index TICKET_PK = Indexes0.TICKET_PK; + public static final Index TICKET_SUBMITTER_IDX = Indexes0.TICKET_SUBMITTER_IDX; + public static final Index USER_BID_PROJECT_IDX = Indexes0.USER_BID_PROJECT_IDX; + public static final Index USER_CREATION_BID_PK = Indexes0.USER_CREATION_BID_PK; + public static final Index USER_PREFERENCE_PK = Indexes0.USER_PREFERENCE_PK; + public static final Index USER_PREFERENCE_UQ = Indexes0.USER_PREFERENCE_UQ; + public static final Index USERS_EMAIL_KEY = Indexes0.USERS_EMAIL_KEY; + public static final Index USERS_LOGIN_KEY = Indexes0.USERS_LOGIN_KEY; + public static final Index USERS_PK = Indexes0.USERS_PK; + public static final Index WIDGET_PKEY = Indexes0.WIDGET_PKEY; + public static final Index WIDGET_FILTER_PK = Indexes0.WIDGET_FILTER_PK; - public static final Index ACL_CLASS_PKEY = Indexes0.ACL_CLASS_PKEY; - public static final Index UNIQUE_UK_2 = Indexes0.UNIQUE_UK_2; - public static final Index ACL_ENTRY_PKEY = Indexes0.ACL_ENTRY_PKEY; - public static final Index UNIQUE_UK_4 = Indexes0.UNIQUE_UK_4; - public static final Index ACL_OBJECT_IDENTITY_PKEY = Indexes0.ACL_OBJECT_IDENTITY_PKEY; - public static final Index UNIQUE_UK_3 = Indexes0.UNIQUE_UK_3; - public static final Index ACL_SID_IDX = Indexes0.ACL_SID_IDX; - public static final Index ACL_SID_PKEY = Indexes0.ACL_SID_PKEY; - public static final Index UNIQUE_UK_1 = Indexes0.UNIQUE_UK_1; - public static final Index ACTIVITY_CREATION_DATE_IDX = Indexes0.ACTIVITY_CREATION_DATE_IDX; - public static final Index ACTIVITY_OBJECT_IDX = Indexes0.ACTIVITY_OBJECT_IDX; - public static final Index ACTIVITY_PK = Indexes0.ACTIVITY_PK; - public static final Index ACTIVITY_PROJECT_IDX = Indexes0.ACTIVITY_PROJECT_IDX; - public static final Index ATT_ITEM_IDX = Indexes0.ATT_ITEM_IDX; - public static final Index ATT_LAUNCH_IDX = Indexes0.ATT_LAUNCH_IDX; - public static final Index ATT_PROJECT_IDX = Indexes0.ATT_PROJECT_IDX; - public static final Index ATTACHMENT_PK = Indexes0.ATTACHMENT_PK; - public static final Index ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX = Indexes0.ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX; - public static final Index ATTACHMENT_DELETION_PKEY = Indexes0.ATTACHMENT_DELETION_PKEY; - public static final Index ATTRIBUTE_PK = Indexes0.ATTRIBUTE_PK; - public static final Index CLUSTER_INDEX_ID_IDX = Indexes0.CLUSTER_INDEX_ID_IDX; - public static final Index CLUSTER_LAUNCH_IDX = Indexes0.CLUSTER_LAUNCH_IDX; - public static final Index CLUSTER_PROJECT_IDX = Indexes0.CLUSTER_PROJECT_IDX; - public static final Index CLUSTERS_PK = Indexes0.CLUSTERS_PK; - public static final Index INDEX_ID_LAUNCH_ID_UNQ = Indexes0.INDEX_ID_LAUNCH_ID_UNQ; - public static final Index CLUSTER_ITEM_CLUSTER_IDX = Indexes0.CLUSTER_ITEM_CLUSTER_IDX; - public static final Index CLUSTER_ITEM_ITEM_IDX = Indexes0.CLUSTER_ITEM_ITEM_IDX; - public static final Index CLUSTER_ITEM_UNQ = Indexes0.CLUSTER_ITEM_UNQ; - public static final Index CONTENT_FIELD_IDX = Indexes0.CONTENT_FIELD_IDX; - public static final Index CONTENT_FIELD_WIDGET_IDX = Indexes0.CONTENT_FIELD_WIDGET_IDX; - public static final Index DASHBOARD_PKEY = Indexes0.DASHBOARD_PKEY; - public static final Index DASHBOARD_WIDGET_PK = Indexes0.DASHBOARD_WIDGET_PK; - public static final Index WIDGET_ON_DASHBOARD_UNQ = Indexes0.WIDGET_ON_DASHBOARD_UNQ; - public static final Index FILTER_PKEY = Indexes0.FILTER_PKEY; - public static final Index FILTER_COND_FILTER_IDX = Indexes0.FILTER_COND_FILTER_IDX; - public static final Index FILTER_CONDITION_PK = Indexes0.FILTER_CONDITION_PK; - public static final Index FILTER_SORT_FILTER_IDX = Indexes0.FILTER_SORT_FILTER_IDX; - public static final Index FILTER_SORT_PK = Indexes0.FILTER_SORT_PK; - public static final Index INTEGR_PROJECT_IDX = Indexes0.INTEGR_PROJECT_IDX; - public static final Index INTEGRATION_PK = Indexes0.INTEGRATION_PK; - public static final Index UNIQUE_GLOBAL_INTEGRATION_NAME = Indexes0.UNIQUE_GLOBAL_INTEGRATION_NAME; - public static final Index UNIQUE_PROJECT_INTEGRATION_NAME = Indexes0.UNIQUE_PROJECT_INTEGRATION_NAME; - public static final Index INTEGRATION_TYPE_NAME_KEY = Indexes0.INTEGRATION_TYPE_NAME_KEY; - public static final Index INTEGRATION_TYPE_PK = Indexes0.INTEGRATION_TYPE_PK; - public static final Index ISSUE_IT_IDX = Indexes0.ISSUE_IT_IDX; - public static final Index ISSUE_PK = Indexes0.ISSUE_PK; - public static final Index ISSUE_GROUP_PK = Indexes0.ISSUE_GROUP_PK; - public static final Index ISSUE_TICKET_PK = Indexes0.ISSUE_TICKET_PK; - public static final Index ISSUE_TYPE_GROUP_IDX = Indexes0.ISSUE_TYPE_GROUP_IDX; - public static final Index ISSUE_TYPE_LOCATOR_KEY = Indexes0.ISSUE_TYPE_LOCATOR_KEY; - public static final Index ISSUE_TYPE_PK = Indexes0.ISSUE_TYPE_PK; - public static final Index ISSUE_TYPE_PROJECT_PK = Indexes0.ISSUE_TYPE_PROJECT_PK; - public static final Index ITEM_ATTR_LAUNCH_IDX = Indexes0.ITEM_ATTR_LAUNCH_IDX; - public static final Index ITEM_ATTR_TI_IDX = Indexes0.ITEM_ATTR_TI_IDX; - public static final Index ITEM_ATTRIBUTE_PK = Indexes0.ITEM_ATTRIBUTE_PK; - public static final Index LAUNCH_PK = Indexes0.LAUNCH_PK; - public static final Index LAUNCH_PROJECT_START_TIME_IDX = Indexes0.LAUNCH_PROJECT_START_TIME_IDX; - public static final Index LAUNCH_USER_IDX = Indexes0.LAUNCH_USER_IDX; - public static final Index LAUNCH_UUID_KEY = Indexes0.LAUNCH_UUID_KEY; - public static final Index UNQ_NAME_NUMBER = Indexes0.UNQ_NAME_NUMBER; - public static final Index L_ATTR_RL_SEND_CASE_IDX = Indexes0.L_ATTR_RL_SEND_CASE_IDX; - public static final Index LAUNCH_ATTRIBUTE_RULES_PK = Indexes0.LAUNCH_ATTRIBUTE_RULES_PK; - public static final Index LN_SEND_CASE_IDX = Indexes0.LN_SEND_CASE_IDX; - public static final Index LAUNCH_NUMBER_PK = Indexes0.LAUNCH_NUMBER_PK; - public static final Index UNQ_PROJECT_NAME = Indexes0.UNQ_PROJECT_NAME; - public static final Index LOG_ATTACH_ID_IDX = Indexes0.LOG_ATTACH_ID_IDX; - public static final Index LOG_CLUSTER_IDX = Indexes0.LOG_CLUSTER_IDX; - public static final Index LOG_LAUNCH_ID_IDX = Indexes0.LOG_LAUNCH_ID_IDX; - public static final Index LOG_MESSAGE_TRGM_IDX = Indexes0.LOG_MESSAGE_TRGM_IDX; - public static final Index LOG_PK = Indexes0.LOG_PK; - public static final Index LOG_PROJECT_ID_LOG_TIME_IDX = Indexes0.LOG_PROJECT_ID_LOG_TIME_IDX; - public static final Index LOG_PROJECT_IDX = Indexes0.LOG_PROJECT_IDX; - public static final Index LOG_TI_IDX = Indexes0.LOG_TI_IDX; - public static final Index OAUTH_ACCESS_TOKEN_PKEY = Indexes0.OAUTH_ACCESS_TOKEN_PKEY; - public static final Index OAUTH_AT_USER_IDX = Indexes0.OAUTH_AT_USER_IDX; - public static final Index USERS_ACCESS_TOKEN_UNIQUE = Indexes0.USERS_ACCESS_TOKEN_UNIQUE; - public static final Index OAUTH_REGISTRATION_CLIENT_ID_KEY = Indexes0.OAUTH_REGISTRATION_CLIENT_ID_KEY; - public static final Index OAUTH_REGISTRATION_PKEY = Indexes0.OAUTH_REGISTRATION_PKEY; - public static final Index OAUTH_REGISTRATION_RESTRICTION_PK = Indexes0.OAUTH_REGISTRATION_RESTRICTION_PK; - public static final Index OAUTH_REGISTRATION_RESTRICTION_UNIQUE = Indexes0.OAUTH_REGISTRATION_RESTRICTION_UNIQUE; - public static final Index OAUTH_REGISTRATION_SCOPE_PK = Indexes0.OAUTH_REGISTRATION_SCOPE_PK; - public static final Index OAUTH_REGISTRATION_SCOPE_UNIQUE = Indexes0.OAUTH_REGISTRATION_SCOPE_UNIQUE; - public static final Index ONBOARDING_PK = Indexes0.ONBOARDING_PK; - public static final Index PARAMETER_TI_IDX = Indexes0.PARAMETER_TI_IDX; - public static final Index PATTERN_TEMPLATE_PK = Indexes0.PATTERN_TEMPLATE_PK; - public static final Index UNQ_NAME_PROJECTID = Indexes0.UNQ_NAME_PROJECTID; - public static final Index PATTERN_ITEM_ITEM_ID_IDX = Indexes0.PATTERN_ITEM_ITEM_ID_IDX; - public static final Index PATTERN_ITEM_UNQ = Indexes0.PATTERN_ITEM_UNQ; - public static final Index PROJECT_NAME_KEY = Indexes0.PROJECT_NAME_KEY; - public static final Index PROJECT_PK = Indexes0.PROJECT_PK; - public static final Index UNIQUE_ATTRIBUTE_PER_PROJECT = Indexes0.UNIQUE_ATTRIBUTE_PER_PROJECT; - public static final Index USERS_PROJECT_PK = Indexes0.USERS_PROJECT_PK; - public static final Index RCPNT_SEND_CASE_IDX = Indexes0.RCPNT_SEND_CASE_IDX; - public static final Index RESTORE_PASSWORD_BID_EMAIL_KEY = Indexes0.RESTORE_PASSWORD_BID_EMAIL_KEY; - public static final Index RESTORE_PASSWORD_BID_PK = Indexes0.RESTORE_PASSWORD_BID_PK; - public static final Index SENDER_CASE_PK = Indexes0.SENDER_CASE_PK; - public static final Index SENDER_CASE_PROJECT_IDX = Indexes0.SENDER_CASE_PROJECT_IDX; - public static final Index SERVER_SETTINGS_ID = Indexes0.SERVER_SETTINGS_ID; - public static final Index SERVER_SETTINGS_KEY_KEY = Indexes0.SERVER_SETTINGS_KEY_KEY; - public static final Index SHAREABLE_PK = Indexes0.SHAREABLE_PK; - public static final Index SHARED_ENTITY_OWNERX = Indexes0.SHARED_ENTITY_OWNERX; - public static final Index SHARED_ENTITY_PROJECT_IDX = Indexes0.SHARED_ENTITY_PROJECT_IDX; - public static final Index STALE_MATERIALIZED_VIEW_NAME_KEY = Indexes0.STALE_MATERIALIZED_VIEW_NAME_KEY; - public static final Index STALE_MATERIALIZED_VIEW_PKEY = Indexes0.STALE_MATERIALIZED_VIEW_PKEY; - public static final Index STALE_MV_CREATION_DATE_IDX = Indexes0.STALE_MV_CREATION_DATE_IDX; - public static final Index STATISTICS_LAUNCH_IDX = Indexes0.STATISTICS_LAUNCH_IDX; - public static final Index STATISTICS_PK = Indexes0.STATISTICS_PK; - public static final Index STATISTICS_TI_IDX = Indexes0.STATISTICS_TI_IDX; - public static final Index UNIQUE_STATS_ITEM = Indexes0.UNIQUE_STATS_ITEM; - public static final Index UNIQUE_STATS_LAUNCH = Indexes0.UNIQUE_STATS_LAUNCH; - public static final Index STATISTICS_FIELD_NAME_KEY = Indexes0.STATISTICS_FIELD_NAME_KEY; - public static final Index STATISTICS_FIELD_PK = Indexes0.STATISTICS_FIELD_PK; - public static final Index ITEM_TEST_CASE_ID_LAUNCH_ID_IDX = Indexes0.ITEM_TEST_CASE_ID_LAUNCH_ID_IDX; - public static final Index PATH_GIST_IDX = Indexes0.PATH_GIST_IDX; - public static final Index PATH_IDX = Indexes0.PATH_IDX; - public static final Index TEST_CASE_HASH_LAUNCH_ID_IDX = Indexes0.TEST_CASE_HASH_LAUNCH_ID_IDX; - public static final Index TEST_ITEM_PK = Indexes0.TEST_ITEM_PK; - public static final Index TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX = Indexes0.TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX; - public static final Index TEST_ITEM_UUID_KEY = Indexes0.TEST_ITEM_UUID_KEY; - public static final Index TI_LAUNCH_IDX = Indexes0.TI_LAUNCH_IDX; - public static final Index TI_PARENT_IDX = Indexes0.TI_PARENT_IDX; - public static final Index TI_RETRY_OF_IDX = Indexes0.TI_RETRY_OF_IDX; - public static final Index TEST_ITEM_RESULTS_PK = Indexes0.TEST_ITEM_RESULTS_PK; - public static final Index TICKET_ID_IDX = Indexes0.TICKET_ID_IDX; - public static final Index TICKET_PK = Indexes0.TICKET_PK; - public static final Index TICKET_SUBMITTER_IDX = Indexes0.TICKET_SUBMITTER_IDX; - public static final Index USER_BID_PROJECT_IDX = Indexes0.USER_BID_PROJECT_IDX; - public static final Index USER_CREATION_BID_PK = Indexes0.USER_CREATION_BID_PK; - public static final Index USER_PREFERENCE_PK = Indexes0.USER_PREFERENCE_PK; - public static final Index USER_PREFERENCE_UQ = Indexes0.USER_PREFERENCE_UQ; - public static final Index USERS_EMAIL_KEY = Indexes0.USERS_EMAIL_KEY; - public static final Index USERS_LOGIN_KEY = Indexes0.USERS_LOGIN_KEY; - public static final Index USERS_PK = Indexes0.USERS_PK; - public static final Index WIDGET_PKEY = Indexes0.WIDGET_PKEY; - public static final Index WIDGET_FILTER_PK = Indexes0.WIDGET_FILTER_PK; + // ------------------------------------------------------------------------- + // [#1459] distribute members to avoid static initialisers > 64kb + // ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- - // [#1459] distribute members to avoid static initialisers > 64kb - // ------------------------------------------------------------------------- + private static class Indexes0 { - private static class Indexes0 { - public static Index ACL_CLASS_PKEY = Internal.createIndex("acl_class_pkey", JAclClass.ACL_CLASS, new OrderField[] { JAclClass.ACL_CLASS.ID }, true); - public static Index UNIQUE_UK_2 = Internal.createIndex("unique_uk_2", JAclClass.ACL_CLASS, new OrderField[] { JAclClass.ACL_CLASS.CLASS }, true); - public static Index ACL_ENTRY_PKEY = Internal.createIndex("acl_entry_pkey", JAclEntry.ACL_ENTRY, new OrderField[] { JAclEntry.ACL_ENTRY.ID }, true); - public static Index UNIQUE_UK_4 = Internal.createIndex("unique_uk_4", JAclEntry.ACL_ENTRY, new OrderField[] { JAclEntry.ACL_ENTRY.ACL_OBJECT_IDENTITY, JAclEntry.ACL_ENTRY.ACE_ORDER }, true); - public static Index ACL_OBJECT_IDENTITY_PKEY = Internal.createIndex("acl_object_identity_pkey", JAclObjectIdentity.ACL_OBJECT_IDENTITY, new OrderField[] { JAclObjectIdentity.ACL_OBJECT_IDENTITY.ID }, true); - public static Index UNIQUE_UK_3 = Internal.createIndex("unique_uk_3", JAclObjectIdentity.ACL_OBJECT_IDENTITY, new OrderField[] { JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS, JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY }, true); - public static Index ACL_SID_IDX = Internal.createIndex("acl_sid_idx", JAclSid.ACL_SID, new OrderField[] { JAclSid.ACL_SID.SID }, false); - public static Index ACL_SID_PKEY = Internal.createIndex("acl_sid_pkey", JAclSid.ACL_SID, new OrderField[] { JAclSid.ACL_SID.ID }, true); - public static Index UNIQUE_UK_1 = Internal.createIndex("unique_uk_1", JAclSid.ACL_SID, new OrderField[] { JAclSid.ACL_SID.SID, JAclSid.ACL_SID.PRINCIPAL }, true); - public static Index ACTIVITY_CREATION_DATE_IDX = Internal.createIndex("activity_creation_date_idx", JActivity.ACTIVITY, new OrderField[] { JActivity.ACTIVITY.CREATION_DATE }, false); - public static Index ACTIVITY_OBJECT_IDX = Internal.createIndex("activity_object_idx", JActivity.ACTIVITY, new OrderField[] { JActivity.ACTIVITY.OBJECT_ID }, false); - public static Index ACTIVITY_PK = Internal.createIndex("activity_pk", JActivity.ACTIVITY, new OrderField[] { JActivity.ACTIVITY.ID }, true); - public static Index ACTIVITY_PROJECT_IDX = Internal.createIndex("activity_project_idx", JActivity.ACTIVITY, new OrderField[] { JActivity.ACTIVITY.PROJECT_ID }, false); - public static Index ATT_ITEM_IDX = Internal.createIndex("att_item_idx", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.ITEM_ID }, false); - public static Index ATT_LAUNCH_IDX = Internal.createIndex("att_launch_idx", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.LAUNCH_ID }, false); - public static Index ATT_PROJECT_IDX = Internal.createIndex("att_project_idx", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.PROJECT_ID }, false); - public static Index ATTACHMENT_PK = Internal.createIndex("attachment_pk", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.ID }, true); - public static Index ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX = Internal.createIndex("attachment_project_id_creation_time_idx", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.PROJECT_ID, JAttachment.ATTACHMENT.CREATION_DATE }, false); - public static Index ATTACHMENT_DELETION_PKEY = Internal.createIndex("attachment_deletion_pkey", JAttachmentDeletion.ATTACHMENT_DELETION, new OrderField[] { JAttachmentDeletion.ATTACHMENT_DELETION.ID }, true); - public static Index ATTRIBUTE_PK = Internal.createIndex("attribute_pk", JAttribute.ATTRIBUTE, new OrderField[] { JAttribute.ATTRIBUTE.ID }, true); - public static Index CLUSTER_INDEX_ID_IDX = Internal.createIndex("cluster_index_id_idx", JClusters.CLUSTERS, new OrderField[] { JClusters.CLUSTERS.INDEX_ID }, false); - public static Index CLUSTER_LAUNCH_IDX = Internal.createIndex("cluster_launch_idx", JClusters.CLUSTERS, new OrderField[] { JClusters.CLUSTERS.LAUNCH_ID }, false); - public static Index CLUSTER_PROJECT_IDX = Internal.createIndex("cluster_project_idx", JClusters.CLUSTERS, new OrderField[] { JClusters.CLUSTERS.PROJECT_ID }, false); - public static Index CLUSTERS_PK = Internal.createIndex("clusters_pk", JClusters.CLUSTERS, new OrderField[] { JClusters.CLUSTERS.ID }, true); - public static Index INDEX_ID_LAUNCH_ID_UNQ = Internal.createIndex("index_id_launch_id_unq", JClusters.CLUSTERS, new OrderField[] { JClusters.CLUSTERS.INDEX_ID, JClusters.CLUSTERS.LAUNCH_ID }, true); - public static Index CLUSTER_ITEM_CLUSTER_IDX = Internal.createIndex("cluster_item_cluster_idx", JClustersTestItem.CLUSTERS_TEST_ITEM, new OrderField[] { JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID }, false); - public static Index CLUSTER_ITEM_ITEM_IDX = Internal.createIndex("cluster_item_item_idx", JClustersTestItem.CLUSTERS_TEST_ITEM, new OrderField[] { JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID }, false); - public static Index CLUSTER_ITEM_UNQ = Internal.createIndex("cluster_item_unq", JClustersTestItem.CLUSTERS_TEST_ITEM, new OrderField[] { JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID, JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID }, true); - public static Index CONTENT_FIELD_IDX = Internal.createIndex("content_field_idx", JContentField.CONTENT_FIELD, new OrderField[] { JContentField.CONTENT_FIELD.FIELD }, false); - public static Index CONTENT_FIELD_WIDGET_IDX = Internal.createIndex("content_field_widget_idx", JContentField.CONTENT_FIELD, new OrderField[] { JContentField.CONTENT_FIELD.ID }, false); - public static Index DASHBOARD_PKEY = Internal.createIndex("dashboard_pkey", JDashboard.DASHBOARD, new OrderField[] { JDashboard.DASHBOARD.ID }, true); - public static Index DASHBOARD_WIDGET_PK = Internal.createIndex("dashboard_widget_pk", JDashboardWidget.DASHBOARD_WIDGET, new OrderField[] { JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID }, true); - public static Index WIDGET_ON_DASHBOARD_UNQ = Internal.createIndex("widget_on_dashboard_unq", JDashboardWidget.DASHBOARD_WIDGET, new OrderField[] { JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, JDashboardWidget.DASHBOARD_WIDGET.WIDGET_NAME, JDashboardWidget.DASHBOARD_WIDGET.WIDGET_OWNER }, true); - public static Index FILTER_PKEY = Internal.createIndex("filter_pkey", JFilter.FILTER, new OrderField[] { JFilter.FILTER.ID }, true); - public static Index FILTER_COND_FILTER_IDX = Internal.createIndex("filter_cond_filter_idx", JFilterCondition.FILTER_CONDITION, new OrderField[] { JFilterCondition.FILTER_CONDITION.FILTER_ID }, false); - public static Index FILTER_CONDITION_PK = Internal.createIndex("filter_condition_pk", JFilterCondition.FILTER_CONDITION, new OrderField[] { JFilterCondition.FILTER_CONDITION.ID }, true); - public static Index FILTER_SORT_FILTER_IDX = Internal.createIndex("filter_sort_filter_idx", JFilterSort.FILTER_SORT, new OrderField[] { JFilterSort.FILTER_SORT.FILTER_ID }, false); - public static Index FILTER_SORT_PK = Internal.createIndex("filter_sort_pk", JFilterSort.FILTER_SORT, new OrderField[] { JFilterSort.FILTER_SORT.ID }, true); - public static Index INTEGR_PROJECT_IDX = Internal.createIndex("integr_project_idx", JIntegration.INTEGRATION, new OrderField[] { JIntegration.INTEGRATION.PROJECT_ID }, false); - public static Index INTEGRATION_PK = Internal.createIndex("integration_pk", JIntegration.INTEGRATION, new OrderField[] { JIntegration.INTEGRATION.ID }, true); - public static Index UNIQUE_GLOBAL_INTEGRATION_NAME = Internal.createIndex("unique_global_integration_name", JIntegration.INTEGRATION, new OrderField[] { JIntegration.INTEGRATION.NAME, JIntegration.INTEGRATION.TYPE }, true); - public static Index UNIQUE_PROJECT_INTEGRATION_NAME = Internal.createIndex("unique_project_integration_name", JIntegration.INTEGRATION, new OrderField[] { JIntegration.INTEGRATION.NAME, JIntegration.INTEGRATION.TYPE, JIntegration.INTEGRATION.PROJECT_ID }, true); - public static Index INTEGRATION_TYPE_NAME_KEY = Internal.createIndex("integration_type_name_key", JIntegrationType.INTEGRATION_TYPE, new OrderField[] { JIntegrationType.INTEGRATION_TYPE.NAME }, true); - public static Index INTEGRATION_TYPE_PK = Internal.createIndex("integration_type_pk", JIntegrationType.INTEGRATION_TYPE, new OrderField[] { JIntegrationType.INTEGRATION_TYPE.ID }, true); - public static Index ISSUE_IT_IDX = Internal.createIndex("issue_it_idx", JIssue.ISSUE, new OrderField[] { JIssue.ISSUE.ISSUE_TYPE }, false); - public static Index ISSUE_PK = Internal.createIndex("issue_pk", JIssue.ISSUE, new OrderField[] { JIssue.ISSUE.ISSUE_ID }, true); - public static Index ISSUE_GROUP_PK = Internal.createIndex("issue_group_pk", JIssueGroup.ISSUE_GROUP, new OrderField[] { JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID }, true); - public static Index ISSUE_TICKET_PK = Internal.createIndex("issue_ticket_pk", JIssueTicket.ISSUE_TICKET, new OrderField[] { JIssueTicket.ISSUE_TICKET.ISSUE_ID, JIssueTicket.ISSUE_TICKET.TICKET_ID }, true); - public static Index ISSUE_TYPE_GROUP_IDX = Internal.createIndex("issue_type_group_idx", JIssueType.ISSUE_TYPE, new OrderField[] { JIssueType.ISSUE_TYPE.ISSUE_GROUP_ID }, false); - public static Index ISSUE_TYPE_LOCATOR_KEY = Internal.createIndex("issue_type_locator_key", JIssueType.ISSUE_TYPE, new OrderField[] { JIssueType.ISSUE_TYPE.LOCATOR }, true); - public static Index ISSUE_TYPE_PK = Internal.createIndex("issue_type_pk", JIssueType.ISSUE_TYPE, new OrderField[] { JIssueType.ISSUE_TYPE.ID }, true); - public static Index ISSUE_TYPE_PROJECT_PK = Internal.createIndex("issue_type_project_pk", JIssueTypeProject.ISSUE_TYPE_PROJECT, new OrderField[] { JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID, JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID }, true); - public static Index ITEM_ATTR_LAUNCH_IDX = Internal.createIndex("item_attr_launch_idx", JItemAttribute.ITEM_ATTRIBUTE, new OrderField[] { JItemAttribute.ITEM_ATTRIBUTE.LAUNCH_ID }, false); - public static Index ITEM_ATTR_TI_IDX = Internal.createIndex("item_attr_ti_idx", JItemAttribute.ITEM_ATTRIBUTE, new OrderField[] { JItemAttribute.ITEM_ATTRIBUTE.ITEM_ID }, false); - public static Index ITEM_ATTRIBUTE_PK = Internal.createIndex("item_attribute_pk", JItemAttribute.ITEM_ATTRIBUTE, new OrderField[] { JItemAttribute.ITEM_ATTRIBUTE.ID }, true); - public static Index LAUNCH_PK = Internal.createIndex("launch_pk", JLaunch.LAUNCH, new OrderField[] { JLaunch.LAUNCH.ID }, true); - public static Index LAUNCH_PROJECT_START_TIME_IDX = Internal.createIndex("launch_project_start_time_idx", JLaunch.LAUNCH, new OrderField[] { JLaunch.LAUNCH.PROJECT_ID, JLaunch.LAUNCH.START_TIME }, false); - public static Index LAUNCH_USER_IDX = Internal.createIndex("launch_user_idx", JLaunch.LAUNCH, new OrderField[] { JLaunch.LAUNCH.USER_ID }, false); - public static Index LAUNCH_UUID_KEY = Internal.createIndex("launch_uuid_key", JLaunch.LAUNCH, new OrderField[] { JLaunch.LAUNCH.UUID }, true); - public static Index UNQ_NAME_NUMBER = Internal.createIndex("unq_name_number", JLaunch.LAUNCH, new OrderField[] { JLaunch.LAUNCH.NAME, JLaunch.LAUNCH.NUMBER, JLaunch.LAUNCH.PROJECT_ID }, true); - public static Index L_ATTR_RL_SEND_CASE_IDX = Internal.createIndex("l_attr_rl_send_case_idx", JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, new OrderField[] { JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.SENDER_CASE_ID }, false); - public static Index LAUNCH_ATTRIBUTE_RULES_PK = Internal.createIndex("launch_attribute_rules_pk", JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, new OrderField[] { JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID }, true); - public static Index LN_SEND_CASE_IDX = Internal.createIndex("ln_send_case_idx", JLaunchNames.LAUNCH_NAMES, new OrderField[] { JLaunchNames.LAUNCH_NAMES.SENDER_CASE_ID }, false); - public static Index LAUNCH_NUMBER_PK = Internal.createIndex("launch_number_pk", JLaunchNumber.LAUNCH_NUMBER, new OrderField[] { JLaunchNumber.LAUNCH_NUMBER.ID }, true); - public static Index UNQ_PROJECT_NAME = Internal.createIndex("unq_project_name", JLaunchNumber.LAUNCH_NUMBER, new OrderField[] { JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID, JLaunchNumber.LAUNCH_NUMBER.LAUNCH_NAME }, true); - public static Index LOG_ATTACH_ID_IDX = Internal.createIndex("log_attach_id_idx", JLog.LOG, new OrderField[] { JLog.LOG.ATTACHMENT_ID }, false); - public static Index LOG_CLUSTER_IDX = Internal.createIndex("log_cluster_idx", JLog.LOG, new OrderField[] { JLog.LOG.CLUSTER_ID }, false); - public static Index LOG_LAUNCH_ID_IDX = Internal.createIndex("log_launch_id_idx", JLog.LOG, new OrderField[] { JLog.LOG.LAUNCH_ID }, false); - public static Index LOG_MESSAGE_TRGM_IDX = Internal.createIndex("log_message_trgm_idx", JLog.LOG, new OrderField[] { JLog.LOG.LOG_MESSAGE }, false); - public static Index LOG_PK = Internal.createIndex("log_pk", JLog.LOG, new OrderField[] { JLog.LOG.ID }, true); - public static Index LOG_PROJECT_ID_LOG_TIME_IDX = Internal.createIndex("log_project_id_log_time_idx", JLog.LOG, new OrderField[] { JLog.LOG.PROJECT_ID, JLog.LOG.LOG_TIME }, false); - public static Index LOG_PROJECT_IDX = Internal.createIndex("log_project_idx", JLog.LOG, new OrderField[] { JLog.LOG.PROJECT_ID }, false); - public static Index LOG_TI_IDX = Internal.createIndex("log_ti_idx", JLog.LOG, new OrderField[] { JLog.LOG.ITEM_ID }, false); - public static Index OAUTH_ACCESS_TOKEN_PKEY = Internal.createIndex("oauth_access_token_pkey", JOauthAccessToken.OAUTH_ACCESS_TOKEN, new OrderField[] { JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID }, true); - public static Index OAUTH_AT_USER_IDX = Internal.createIndex("oauth_at_user_idx", JOauthAccessToken.OAUTH_ACCESS_TOKEN, new OrderField[] { JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID }, false); - public static Index USERS_ACCESS_TOKEN_UNIQUE = Internal.createIndex("users_access_token_unique", JOauthAccessToken.OAUTH_ACCESS_TOKEN, new OrderField[] { JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN_ID, JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID }, true); - public static Index OAUTH_REGISTRATION_CLIENT_ID_KEY = Internal.createIndex("oauth_registration_client_id_key", JOauthRegistration.OAUTH_REGISTRATION, new OrderField[] { JOauthRegistration.OAUTH_REGISTRATION.CLIENT_ID }, true); - public static Index OAUTH_REGISTRATION_PKEY = Internal.createIndex("oauth_registration_pkey", JOauthRegistration.OAUTH_REGISTRATION, new OrderField[] { JOauthRegistration.OAUTH_REGISTRATION.ID }, true); - public static Index OAUTH_REGISTRATION_RESTRICTION_PK = Internal.createIndex("oauth_registration_restriction_pk", JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, new OrderField[] { JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID }, true); - public static Index OAUTH_REGISTRATION_RESTRICTION_UNIQUE = Internal.createIndex("oauth_registration_restriction_unique", JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, new OrderField[] { JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.TYPE, JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.VALUE, JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK }, true); - public static Index OAUTH_REGISTRATION_SCOPE_PK = Internal.createIndex("oauth_registration_scope_pk", JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, new OrderField[] { JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID }, true); - public static Index OAUTH_REGISTRATION_SCOPE_UNIQUE = Internal.createIndex("oauth_registration_scope_unique", JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, new OrderField[] { JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.SCOPE, JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK }, true); - public static Index ONBOARDING_PK = Internal.createIndex("onboarding_pk", JOnboarding.ONBOARDING, new OrderField[] { JOnboarding.ONBOARDING.ID }, true); - public static Index PARAMETER_TI_IDX = Internal.createIndex("parameter_ti_idx", JParameter.PARAMETER, new OrderField[] { JParameter.PARAMETER.ITEM_ID }, false); - public static Index PATTERN_TEMPLATE_PK = Internal.createIndex("pattern_template_pk", JPatternTemplate.PATTERN_TEMPLATE, new OrderField[] { JPatternTemplate.PATTERN_TEMPLATE.ID }, true); - public static Index UNQ_NAME_PROJECTID = Internal.createIndex("unq_name_projectid", JPatternTemplate.PATTERN_TEMPLATE, new OrderField[] { JPatternTemplate.PATTERN_TEMPLATE.NAME, JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID }, true); - public static Index PATTERN_ITEM_ITEM_ID_IDX = Internal.createIndex("pattern_item_item_id_idx", JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, new OrderField[] { JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID }, false); - public static Index PATTERN_ITEM_UNQ = Internal.createIndex("pattern_item_unq", JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, new OrderField[] { JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID, JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID }, true); - public static Index PROJECT_NAME_KEY = Internal.createIndex("project_name_key", JProject.PROJECT, new OrderField[] { JProject.PROJECT.NAME }, true); - public static Index PROJECT_PK = Internal.createIndex("project_pk", JProject.PROJECT, new OrderField[] { JProject.PROJECT.ID }, true); - public static Index UNIQUE_ATTRIBUTE_PER_PROJECT = Internal.createIndex("unique_attribute_per_project", JProjectAttribute.PROJECT_ATTRIBUTE, new OrderField[] { JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID, JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID }, true); - public static Index USERS_PROJECT_PK = Internal.createIndex("users_project_pk", JProjectUser.PROJECT_USER, new OrderField[] { JProjectUser.PROJECT_USER.USER_ID, JProjectUser.PROJECT_USER.PROJECT_ID }, true); - public static Index RCPNT_SEND_CASE_IDX = Internal.createIndex("rcpnt_send_case_idx", JRecipients.RECIPIENTS, new OrderField[] { JRecipients.RECIPIENTS.SENDER_CASE_ID }, false); - public static Index RESTORE_PASSWORD_BID_EMAIL_KEY = Internal.createIndex("restore_password_bid_email_key", JRestorePasswordBid.RESTORE_PASSWORD_BID, new OrderField[] { JRestorePasswordBid.RESTORE_PASSWORD_BID.EMAIL }, true); - public static Index RESTORE_PASSWORD_BID_PK = Internal.createIndex("restore_password_bid_pk", JRestorePasswordBid.RESTORE_PASSWORD_BID, new OrderField[] { JRestorePasswordBid.RESTORE_PASSWORD_BID.UUID }, true); - public static Index SENDER_CASE_PK = Internal.createIndex("sender_case_pk", JSenderCase.SENDER_CASE, new OrderField[] { JSenderCase.SENDER_CASE.ID }, true); - public static Index SENDER_CASE_PROJECT_IDX = Internal.createIndex("sender_case_project_idx", JSenderCase.SENDER_CASE, new OrderField[] { JSenderCase.SENDER_CASE.PROJECT_ID }, false); - public static Index SERVER_SETTINGS_ID = Internal.createIndex("server_settings_id", JServerSettings.SERVER_SETTINGS, new OrderField[] { JServerSettings.SERVER_SETTINGS.ID }, true); - public static Index SERVER_SETTINGS_KEY_KEY = Internal.createIndex("server_settings_key_key", JServerSettings.SERVER_SETTINGS, new OrderField[] { JServerSettings.SERVER_SETTINGS.KEY }, true); - public static Index SHAREABLE_PK = Internal.createIndex("shareable_pk", JShareableEntity.SHAREABLE_ENTITY, new OrderField[] { JShareableEntity.SHAREABLE_ENTITY.ID }, true); - public static Index SHARED_ENTITY_OWNERX = Internal.createIndex("shared_entity_ownerx", JShareableEntity.SHAREABLE_ENTITY, new OrderField[] { JShareableEntity.SHAREABLE_ENTITY.OWNER }, false); - public static Index SHARED_ENTITY_PROJECT_IDX = Internal.createIndex("shared_entity_project_idx", JShareableEntity.SHAREABLE_ENTITY, new OrderField[] { JShareableEntity.SHAREABLE_ENTITY.PROJECT_ID }, false); - public static Index STALE_MATERIALIZED_VIEW_NAME_KEY = Internal.createIndex("stale_materialized_view_name_key", JStaleMaterializedView.STALE_MATERIALIZED_VIEW, new OrderField[] { JStaleMaterializedView.STALE_MATERIALIZED_VIEW.NAME }, true); - public static Index STALE_MATERIALIZED_VIEW_PKEY = Internal.createIndex("stale_materialized_view_pkey", JStaleMaterializedView.STALE_MATERIALIZED_VIEW, new OrderField[] { JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID }, true); - public static Index STALE_MV_CREATION_DATE_IDX = Internal.createIndex("stale_mv_creation_date_idx", JStaleMaterializedView.STALE_MATERIALIZED_VIEW, new OrderField[] { JStaleMaterializedView.STALE_MATERIALIZED_VIEW.CREATION_DATE }, false); - public static Index STATISTICS_LAUNCH_IDX = Internal.createIndex("statistics_launch_idx", JStatistics.STATISTICS, new OrderField[] { JStatistics.STATISTICS.LAUNCH_ID }, false); - public static Index STATISTICS_PK = Internal.createIndex("statistics_pk", JStatistics.STATISTICS, new OrderField[] { JStatistics.STATISTICS.S_ID }, true); - public static Index STATISTICS_TI_IDX = Internal.createIndex("statistics_ti_idx", JStatistics.STATISTICS, new OrderField[] { JStatistics.STATISTICS.ITEM_ID }, false); - public static Index UNIQUE_STATS_ITEM = Internal.createIndex("unique_stats_item", JStatistics.STATISTICS, new OrderField[] { JStatistics.STATISTICS.STATISTICS_FIELD_ID, JStatistics.STATISTICS.ITEM_ID }, true); - public static Index UNIQUE_STATS_LAUNCH = Internal.createIndex("unique_stats_launch", JStatistics.STATISTICS, new OrderField[] { JStatistics.STATISTICS.STATISTICS_FIELD_ID, JStatistics.STATISTICS.LAUNCH_ID }, true); - public static Index STATISTICS_FIELD_NAME_KEY = Internal.createIndex("statistics_field_name_key", JStatisticsField.STATISTICS_FIELD, new OrderField[] { JStatisticsField.STATISTICS_FIELD.NAME }, true); - public static Index STATISTICS_FIELD_PK = Internal.createIndex("statistics_field_pk", JStatisticsField.STATISTICS_FIELD, new OrderField[] { JStatisticsField.STATISTICS_FIELD.SF_ID }, true); - public static Index ITEM_TEST_CASE_ID_LAUNCH_ID_IDX = Internal.createIndex("item_test_case_id_launch_id_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.TEST_CASE_ID, JTestItem.TEST_ITEM.LAUNCH_ID }, false); - public static Index PATH_GIST_IDX = Internal.createIndex("path_gist_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.PATH }, false); - public static Index PATH_IDX = Internal.createIndex("path_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.PATH }, false); - public static Index TEST_CASE_HASH_LAUNCH_ID_IDX = Internal.createIndex("test_case_hash_launch_id_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.TEST_CASE_HASH, JTestItem.TEST_ITEM.LAUNCH_ID }, false); - public static Index TEST_ITEM_PK = Internal.createIndex("test_item_pk", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.ITEM_ID }, true); - public static Index TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX = Internal.createIndex("test_item_unique_id_launch_id_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.UNIQUE_ID, JTestItem.TEST_ITEM.LAUNCH_ID }, false); - public static Index TEST_ITEM_UUID_KEY = Internal.createIndex("test_item_uuid_key", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.UUID }, true); - public static Index TI_LAUNCH_IDX = Internal.createIndex("ti_launch_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.LAUNCH_ID }, false); - public static Index TI_PARENT_IDX = Internal.createIndex("ti_parent_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.PARENT_ID }, false); - public static Index TI_RETRY_OF_IDX = Internal.createIndex("ti_retry_of_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.RETRY_OF }, false); - public static Index TEST_ITEM_RESULTS_PK = Internal.createIndex("test_item_results_pk", JTestItemResults.TEST_ITEM_RESULTS, new OrderField[] { JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID }, true); - public static Index TICKET_ID_IDX = Internal.createIndex("ticket_id_idx", JTicket.TICKET, new OrderField[] { JTicket.TICKET.TICKET_ID }, false); - public static Index TICKET_PK = Internal.createIndex("ticket_pk", JTicket.TICKET, new OrderField[] { JTicket.TICKET.ID }, true); - public static Index TICKET_SUBMITTER_IDX = Internal.createIndex("ticket_submitter_idx", JTicket.TICKET, new OrderField[] { JTicket.TICKET.SUBMITTER }, false); - public static Index USER_BID_PROJECT_IDX = Internal.createIndex("user_bid_project_idx", JUserCreationBid.USER_CREATION_BID, new OrderField[] { JUserCreationBid.USER_CREATION_BID.DEFAULT_PROJECT_ID }, false); - public static Index USER_CREATION_BID_PK = Internal.createIndex("user_creation_bid_pk", JUserCreationBid.USER_CREATION_BID, new OrderField[] { JUserCreationBid.USER_CREATION_BID.UUID }, true); - public static Index USER_PREFERENCE_PK = Internal.createIndex("user_preference_pk", JUserPreference.USER_PREFERENCE, new OrderField[] { JUserPreference.USER_PREFERENCE.ID }, true); - public static Index USER_PREFERENCE_UQ = Internal.createIndex("user_preference_uq", JUserPreference.USER_PREFERENCE, new OrderField[] { JUserPreference.USER_PREFERENCE.PROJECT_ID, JUserPreference.USER_PREFERENCE.USER_ID, JUserPreference.USER_PREFERENCE.FILTER_ID }, true); - public static Index USERS_EMAIL_KEY = Internal.createIndex("users_email_key", JUsers.USERS, new OrderField[] { JUsers.USERS.EMAIL }, true); - public static Index USERS_LOGIN_KEY = Internal.createIndex("users_login_key", JUsers.USERS, new OrderField[] { JUsers.USERS.LOGIN }, true); - public static Index USERS_PK = Internal.createIndex("users_pk", JUsers.USERS, new OrderField[] { JUsers.USERS.ID }, true); - public static Index WIDGET_PKEY = Internal.createIndex("widget_pkey", JWidget.WIDGET, new OrderField[] { JWidget.WIDGET.ID }, true); - public static Index WIDGET_FILTER_PK = Internal.createIndex("widget_filter_pk", JWidgetFilter.WIDGET_FILTER, new OrderField[] { JWidgetFilter.WIDGET_FILTER.WIDGET_ID, JWidgetFilter.WIDGET_FILTER.FILTER_ID }, true); - } + public static Index ACL_CLASS_PKEY = Internal.createIndex("acl_class_pkey", JAclClass.ACL_CLASS, + new OrderField[]{JAclClass.ACL_CLASS.ID}, true); + public static Index UNIQUE_UK_2 = Internal.createIndex("unique_uk_2", JAclClass.ACL_CLASS, + new OrderField[]{JAclClass.ACL_CLASS.CLASS}, true); + public static Index ACL_ENTRY_PKEY = Internal.createIndex("acl_entry_pkey", JAclEntry.ACL_ENTRY, + new OrderField[]{JAclEntry.ACL_ENTRY.ID}, true); + public static Index UNIQUE_UK_4 = Internal.createIndex("unique_uk_4", JAclEntry.ACL_ENTRY, + new OrderField[]{JAclEntry.ACL_ENTRY.ACL_OBJECT_IDENTITY, JAclEntry.ACL_ENTRY.ACE_ORDER}, + true); + public static Index ACL_OBJECT_IDENTITY_PKEY = Internal.createIndex("acl_object_identity_pkey", + JAclObjectIdentity.ACL_OBJECT_IDENTITY, + new OrderField[]{JAclObjectIdentity.ACL_OBJECT_IDENTITY.ID}, true); + public static Index UNIQUE_UK_3 = Internal.createIndex("unique_uk_3", + JAclObjectIdentity.ACL_OBJECT_IDENTITY, + new OrderField[]{JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS, + JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY}, true); + public static Index ACL_SID_IDX = Internal.createIndex("acl_sid_idx", JAclSid.ACL_SID, + new OrderField[]{JAclSid.ACL_SID.SID}, false); + public static Index ACL_SID_PKEY = Internal.createIndex("acl_sid_pkey", JAclSid.ACL_SID, + new OrderField[]{JAclSid.ACL_SID.ID}, true); + public static Index UNIQUE_UK_1 = Internal.createIndex("unique_uk_1", JAclSid.ACL_SID, + new OrderField[]{JAclSid.ACL_SID.SID, JAclSid.ACL_SID.PRINCIPAL}, true); + public static Index ACTIVITY_CREATION_DATE_IDX = Internal.createIndex( + "activity_creation_date_idx", JActivity.ACTIVITY, + new OrderField[]{JActivity.ACTIVITY.CREATION_DATE}, false); + public static Index ACTIVITY_OBJECT_IDX = Internal.createIndex("activity_object_idx", + JActivity.ACTIVITY, new OrderField[]{JActivity.ACTIVITY.OBJECT_ID}, false); + public static Index ACTIVITY_PK = Internal.createIndex("activity_pk", JActivity.ACTIVITY, + new OrderField[]{JActivity.ACTIVITY.ID}, true); + public static Index ACTIVITY_PROJECT_IDX = Internal.createIndex("activity_project_idx", + JActivity.ACTIVITY, new OrderField[]{JActivity.ACTIVITY.PROJECT_ID}, false); + public static Index ATT_ITEM_IDX = Internal.createIndex("att_item_idx", JAttachment.ATTACHMENT, + new OrderField[]{JAttachment.ATTACHMENT.ITEM_ID}, false); + public static Index ATT_LAUNCH_IDX = Internal.createIndex("att_launch_idx", + JAttachment.ATTACHMENT, new OrderField[]{JAttachment.ATTACHMENT.LAUNCH_ID}, false); + public static Index ATT_PROJECT_IDX = Internal.createIndex("att_project_idx", + JAttachment.ATTACHMENT, new OrderField[]{JAttachment.ATTACHMENT.PROJECT_ID}, false); + public static Index ATTACHMENT_PK = Internal.createIndex("attachment_pk", + JAttachment.ATTACHMENT, new OrderField[]{JAttachment.ATTACHMENT.ID}, true); + public static Index ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX = Internal.createIndex( + "attachment_project_id_creation_time_idx", JAttachment.ATTACHMENT, + new OrderField[]{JAttachment.ATTACHMENT.PROJECT_ID, JAttachment.ATTACHMENT.CREATION_DATE}, + false); + public static Index ATTACHMENT_DELETION_PKEY = Internal.createIndex("attachment_deletion_pkey", + JAttachmentDeletion.ATTACHMENT_DELETION, + new OrderField[]{JAttachmentDeletion.ATTACHMENT_DELETION.ID}, true); + public static Index ATTRIBUTE_PK = Internal.createIndex("attribute_pk", JAttribute.ATTRIBUTE, + new OrderField[]{JAttribute.ATTRIBUTE.ID}, true); + public static Index CLUSTER_INDEX_ID_IDX = Internal.createIndex("cluster_index_id_idx", + JClusters.CLUSTERS, new OrderField[]{JClusters.CLUSTERS.INDEX_ID}, false); + public static Index CLUSTER_LAUNCH_IDX = Internal.createIndex("cluster_launch_idx", + JClusters.CLUSTERS, new OrderField[]{JClusters.CLUSTERS.LAUNCH_ID}, false); + public static Index CLUSTER_PROJECT_IDX = Internal.createIndex("cluster_project_idx", + JClusters.CLUSTERS, new OrderField[]{JClusters.CLUSTERS.PROJECT_ID}, false); + public static Index CLUSTERS_PK = Internal.createIndex("clusters_pk", JClusters.CLUSTERS, + new OrderField[]{JClusters.CLUSTERS.ID}, true); + public static Index INDEX_ID_LAUNCH_ID_UNQ = Internal.createIndex("index_id_launch_id_unq", + JClusters.CLUSTERS, + new OrderField[]{JClusters.CLUSTERS.INDEX_ID, JClusters.CLUSTERS.LAUNCH_ID}, true); + public static Index CLUSTER_ITEM_CLUSTER_IDX = Internal.createIndex("cluster_item_cluster_idx", + JClustersTestItem.CLUSTERS_TEST_ITEM, + new OrderField[]{JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID}, false); + public static Index CLUSTER_ITEM_ITEM_IDX = Internal.createIndex("cluster_item_item_idx", + JClustersTestItem.CLUSTERS_TEST_ITEM, + new OrderField[]{JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID}, false); + public static Index CLUSTER_ITEM_UNQ = Internal.createIndex("cluster_item_unq", + JClustersTestItem.CLUSTERS_TEST_ITEM, + new OrderField[]{JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID, + JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID}, true); + public static Index CONTENT_FIELD_IDX = Internal.createIndex("content_field_idx", + JContentField.CONTENT_FIELD, new OrderField[]{JContentField.CONTENT_FIELD.FIELD}, false); + public static Index CONTENT_FIELD_WIDGET_IDX = Internal.createIndex("content_field_widget_idx", + JContentField.CONTENT_FIELD, new OrderField[]{JContentField.CONTENT_FIELD.ID}, false); + public static Index DASHBOARD_PKEY = Internal.createIndex("dashboard_pkey", + JDashboard.DASHBOARD, new OrderField[]{JDashboard.DASHBOARD.ID}, true); + public static Index DASHBOARD_WIDGET_PK = Internal.createIndex("dashboard_widget_pk", + JDashboardWidget.DASHBOARD_WIDGET, + new OrderField[]{JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, + JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID}, true); + public static Index WIDGET_ON_DASHBOARD_UNQ = Internal.createIndex("widget_on_dashboard_unq", + JDashboardWidget.DASHBOARD_WIDGET, + new OrderField[]{JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, + JDashboardWidget.DASHBOARD_WIDGET.WIDGET_NAME, + JDashboardWidget.DASHBOARD_WIDGET.WIDGET_OWNER}, true); + public static Index FILTER_PKEY = Internal.createIndex("filter_pkey", JFilter.FILTER, + new OrderField[]{JFilter.FILTER.ID}, true); + public static Index FILTER_COND_FILTER_IDX = Internal.createIndex("filter_cond_filter_idx", + JFilterCondition.FILTER_CONDITION, + new OrderField[]{JFilterCondition.FILTER_CONDITION.FILTER_ID}, false); + public static Index FILTER_CONDITION_PK = Internal.createIndex("filter_condition_pk", + JFilterCondition.FILTER_CONDITION, new OrderField[]{JFilterCondition.FILTER_CONDITION.ID}, + true); + public static Index FILTER_SORT_FILTER_IDX = Internal.createIndex("filter_sort_filter_idx", + JFilterSort.FILTER_SORT, new OrderField[]{JFilterSort.FILTER_SORT.FILTER_ID}, false); + public static Index FILTER_SORT_PK = Internal.createIndex("filter_sort_pk", + JFilterSort.FILTER_SORT, new OrderField[]{JFilterSort.FILTER_SORT.ID}, true); + public static Index INTEGR_PROJECT_IDX = Internal.createIndex("integr_project_idx", + JIntegration.INTEGRATION, new OrderField[]{JIntegration.INTEGRATION.PROJECT_ID}, false); + public static Index INTEGRATION_PK = Internal.createIndex("integration_pk", + JIntegration.INTEGRATION, new OrderField[]{JIntegration.INTEGRATION.ID}, true); + public static Index UNIQUE_GLOBAL_INTEGRATION_NAME = Internal.createIndex( + "unique_global_integration_name", JIntegration.INTEGRATION, + new OrderField[]{JIntegration.INTEGRATION.NAME, JIntegration.INTEGRATION.TYPE}, true); + public static Index UNIQUE_PROJECT_INTEGRATION_NAME = Internal.createIndex( + "unique_project_integration_name", JIntegration.INTEGRATION, + new OrderField[]{JIntegration.INTEGRATION.NAME, JIntegration.INTEGRATION.TYPE, + JIntegration.INTEGRATION.PROJECT_ID}, true); + public static Index INTEGRATION_TYPE_NAME_KEY = Internal.createIndex( + "integration_type_name_key", JIntegrationType.INTEGRATION_TYPE, + new OrderField[]{JIntegrationType.INTEGRATION_TYPE.NAME}, true); + public static Index INTEGRATION_TYPE_PK = Internal.createIndex("integration_type_pk", + JIntegrationType.INTEGRATION_TYPE, new OrderField[]{JIntegrationType.INTEGRATION_TYPE.ID}, + true); + public static Index ISSUE_IT_IDX = Internal.createIndex("issue_it_idx", JIssue.ISSUE, + new OrderField[]{JIssue.ISSUE.ISSUE_TYPE}, false); + public static Index ISSUE_PK = Internal.createIndex("issue_pk", JIssue.ISSUE, + new OrderField[]{JIssue.ISSUE.ISSUE_ID}, true); + public static Index ISSUE_GROUP_PK = Internal.createIndex("issue_group_pk", + JIssueGroup.ISSUE_GROUP, new OrderField[]{JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID}, true); + public static Index ISSUE_TICKET_PK = Internal.createIndex("issue_ticket_pk", + JIssueTicket.ISSUE_TICKET, + new OrderField[]{JIssueTicket.ISSUE_TICKET.ISSUE_ID, JIssueTicket.ISSUE_TICKET.TICKET_ID}, + true); + public static Index ISSUE_TYPE_GROUP_IDX = Internal.createIndex("issue_type_group_idx", + JIssueType.ISSUE_TYPE, new OrderField[]{JIssueType.ISSUE_TYPE.ISSUE_GROUP_ID}, false); + public static Index ISSUE_TYPE_LOCATOR_KEY = Internal.createIndex("issue_type_locator_key", + JIssueType.ISSUE_TYPE, new OrderField[]{JIssueType.ISSUE_TYPE.LOCATOR}, true); + public static Index ISSUE_TYPE_PK = Internal.createIndex("issue_type_pk", JIssueType.ISSUE_TYPE, + new OrderField[]{JIssueType.ISSUE_TYPE.ID}, true); + public static Index ISSUE_TYPE_PROJECT_PK = Internal.createIndex("issue_type_project_pk", + JIssueTypeProject.ISSUE_TYPE_PROJECT, + new OrderField[]{JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID, + JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID}, true); + public static Index ITEM_ATTR_LAUNCH_IDX = Internal.createIndex("item_attr_launch_idx", + JItemAttribute.ITEM_ATTRIBUTE, new OrderField[]{JItemAttribute.ITEM_ATTRIBUTE.LAUNCH_ID}, + false); + public static Index ITEM_ATTR_TI_IDX = Internal.createIndex("item_attr_ti_idx", + JItemAttribute.ITEM_ATTRIBUTE, new OrderField[]{JItemAttribute.ITEM_ATTRIBUTE.ITEM_ID}, + false); + public static Index ITEM_ATTRIBUTE_PK = Internal.createIndex("item_attribute_pk", + JItemAttribute.ITEM_ATTRIBUTE, new OrderField[]{JItemAttribute.ITEM_ATTRIBUTE.ID}, true); + public static Index LAUNCH_PK = Internal.createIndex("launch_pk", JLaunch.LAUNCH, + new OrderField[]{JLaunch.LAUNCH.ID}, true); + public static Index LAUNCH_PROJECT_START_TIME_IDX = Internal.createIndex( + "launch_project_start_time_idx", JLaunch.LAUNCH, + new OrderField[]{JLaunch.LAUNCH.PROJECT_ID, JLaunch.LAUNCH.START_TIME}, false); + public static Index LAUNCH_USER_IDX = Internal.createIndex("launch_user_idx", JLaunch.LAUNCH, + new OrderField[]{JLaunch.LAUNCH.USER_ID}, false); + public static Index LAUNCH_UUID_KEY = Internal.createIndex("launch_uuid_key", JLaunch.LAUNCH, + new OrderField[]{JLaunch.LAUNCH.UUID}, true); + public static Index UNQ_NAME_NUMBER = Internal.createIndex("unq_name_number", JLaunch.LAUNCH, + new OrderField[]{JLaunch.LAUNCH.NAME, JLaunch.LAUNCH.NUMBER, JLaunch.LAUNCH.PROJECT_ID}, + true); + public static Index L_ATTR_RL_SEND_CASE_IDX = Internal.createIndex("l_attr_rl_send_case_idx", + JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, + new OrderField[]{JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.SENDER_CASE_ID}, false); + public static Index LAUNCH_ATTRIBUTE_RULES_PK = Internal.createIndex( + "launch_attribute_rules_pk", JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, + new OrderField[]{JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID}, true); + public static Index LN_SEND_CASE_IDX = Internal.createIndex("ln_send_case_idx", + JLaunchNames.LAUNCH_NAMES, new OrderField[]{JLaunchNames.LAUNCH_NAMES.SENDER_CASE_ID}, + false); + public static Index LAUNCH_NUMBER_PK = Internal.createIndex("launch_number_pk", + JLaunchNumber.LAUNCH_NUMBER, new OrderField[]{JLaunchNumber.LAUNCH_NUMBER.ID}, true); + public static Index UNQ_PROJECT_NAME = Internal.createIndex("unq_project_name", + JLaunchNumber.LAUNCH_NUMBER, new OrderField[]{JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID, + JLaunchNumber.LAUNCH_NUMBER.LAUNCH_NAME}, true); + public static Index LOG_ATTACH_ID_IDX = Internal.createIndex("log_attach_id_idx", JLog.LOG, + new OrderField[]{JLog.LOG.ATTACHMENT_ID}, false); + public static Index LOG_CLUSTER_IDX = Internal.createIndex("log_cluster_idx", JLog.LOG, + new OrderField[]{JLog.LOG.CLUSTER_ID}, false); + public static Index LOG_LAUNCH_ID_IDX = Internal.createIndex("log_launch_id_idx", JLog.LOG, + new OrderField[]{JLog.LOG.LAUNCH_ID}, false); + public static Index LOG_MESSAGE_TRGM_IDX = Internal.createIndex("log_message_trgm_idx", + JLog.LOG, new OrderField[]{JLog.LOG.LOG_MESSAGE}, false); + public static Index LOG_PK = Internal.createIndex("log_pk", JLog.LOG, + new OrderField[]{JLog.LOG.ID}, true); + public static Index LOG_PROJECT_ID_LOG_TIME_IDX = Internal.createIndex( + "log_project_id_log_time_idx", JLog.LOG, + new OrderField[]{JLog.LOG.PROJECT_ID, JLog.LOG.LOG_TIME}, false); + public static Index LOG_PROJECT_IDX = Internal.createIndex("log_project_idx", JLog.LOG, + new OrderField[]{JLog.LOG.PROJECT_ID}, false); + public static Index LOG_TI_IDX = Internal.createIndex("log_ti_idx", JLog.LOG, + new OrderField[]{JLog.LOG.ITEM_ID}, false); + public static Index OAUTH_ACCESS_TOKEN_PKEY = Internal.createIndex("oauth_access_token_pkey", + JOauthAccessToken.OAUTH_ACCESS_TOKEN, + new OrderField[]{JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID}, true); + public static Index OAUTH_AT_USER_IDX = Internal.createIndex("oauth_at_user_idx", + JOauthAccessToken.OAUTH_ACCESS_TOKEN, + new OrderField[]{JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID}, false); + public static Index USERS_ACCESS_TOKEN_UNIQUE = Internal.createIndex( + "users_access_token_unique", JOauthAccessToken.OAUTH_ACCESS_TOKEN, + new OrderField[]{JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN_ID, + JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID}, true); + public static Index OAUTH_REGISTRATION_CLIENT_ID_KEY = Internal.createIndex( + "oauth_registration_client_id_key", JOauthRegistration.OAUTH_REGISTRATION, + new OrderField[]{JOauthRegistration.OAUTH_REGISTRATION.CLIENT_ID}, true); + public static Index OAUTH_REGISTRATION_PKEY = Internal.createIndex("oauth_registration_pkey", + JOauthRegistration.OAUTH_REGISTRATION, + new OrderField[]{JOauthRegistration.OAUTH_REGISTRATION.ID}, true); + public static Index OAUTH_REGISTRATION_RESTRICTION_PK = Internal.createIndex( + "oauth_registration_restriction_pk", + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, + new OrderField[]{JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID}, true); + public static Index OAUTH_REGISTRATION_RESTRICTION_UNIQUE = Internal.createIndex( + "oauth_registration_restriction_unique", + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, + new OrderField[]{JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.TYPE, + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.VALUE, + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK}, + true); + public static Index OAUTH_REGISTRATION_SCOPE_PK = Internal.createIndex( + "oauth_registration_scope_pk", JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, + new OrderField[]{JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID}, true); + public static Index OAUTH_REGISTRATION_SCOPE_UNIQUE = Internal.createIndex( + "oauth_registration_scope_unique", JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, + new OrderField[]{JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.SCOPE, + JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK}, true); + public static Index ONBOARDING_PK = Internal.createIndex("onboarding_pk", + JOnboarding.ONBOARDING, new OrderField[]{JOnboarding.ONBOARDING.ID}, true); + public static Index PARAMETER_TI_IDX = Internal.createIndex("parameter_ti_idx", + JParameter.PARAMETER, new OrderField[]{JParameter.PARAMETER.ITEM_ID}, false); + public static Index PATTERN_TEMPLATE_PK = Internal.createIndex("pattern_template_pk", + JPatternTemplate.PATTERN_TEMPLATE, new OrderField[]{JPatternTemplate.PATTERN_TEMPLATE.ID}, + true); + public static Index UNQ_NAME_PROJECTID = Internal.createIndex("unq_name_projectid", + JPatternTemplate.PATTERN_TEMPLATE, new OrderField[]{JPatternTemplate.PATTERN_TEMPLATE.NAME, + JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID}, true); + public static Index PATTERN_ITEM_ITEM_ID_IDX = Internal.createIndex("pattern_item_item_id_idx", + JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, + new OrderField[]{JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID}, false); + public static Index PATTERN_ITEM_UNQ = Internal.createIndex("pattern_item_unq", + JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, + new OrderField[]{JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID, + JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID}, true); + public static Index PROJECT_NAME_KEY = Internal.createIndex("project_name_key", + JProject.PROJECT, new OrderField[]{JProject.PROJECT.NAME}, true); + public static Index PROJECT_PK = Internal.createIndex("project_pk", JProject.PROJECT, + new OrderField[]{JProject.PROJECT.ID}, true); + public static Index UNIQUE_ATTRIBUTE_PER_PROJECT = Internal.createIndex( + "unique_attribute_per_project", JProjectAttribute.PROJECT_ATTRIBUTE, + new OrderField[]{JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID, + JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID}, true); + public static Index USERS_PROJECT_PK = Internal.createIndex("users_project_pk", + JProjectUser.PROJECT_USER, + new OrderField[]{JProjectUser.PROJECT_USER.USER_ID, JProjectUser.PROJECT_USER.PROJECT_ID}, + true); + public static Index RCPNT_SEND_CASE_IDX = Internal.createIndex("rcpnt_send_case_idx", + JRecipients.RECIPIENTS, new OrderField[]{JRecipients.RECIPIENTS.SENDER_CASE_ID}, false); + public static Index RESTORE_PASSWORD_BID_EMAIL_KEY = Internal.createIndex( + "restore_password_bid_email_key", JRestorePasswordBid.RESTORE_PASSWORD_BID, + new OrderField[]{JRestorePasswordBid.RESTORE_PASSWORD_BID.EMAIL}, true); + public static Index RESTORE_PASSWORD_BID_PK = Internal.createIndex("restore_password_bid_pk", + JRestorePasswordBid.RESTORE_PASSWORD_BID, + new OrderField[]{JRestorePasswordBid.RESTORE_PASSWORD_BID.UUID}, true); + public static Index SENDER_CASE_PK = Internal.createIndex("sender_case_pk", + JSenderCase.SENDER_CASE, new OrderField[]{JSenderCase.SENDER_CASE.ID}, true); + public static Index SENDER_CASE_PROJECT_IDX = Internal.createIndex("sender_case_project_idx", + JSenderCase.SENDER_CASE, new OrderField[]{JSenderCase.SENDER_CASE.PROJECT_ID}, false); + public static Index SERVER_SETTINGS_ID = Internal.createIndex("server_settings_id", + JServerSettings.SERVER_SETTINGS, new OrderField[]{JServerSettings.SERVER_SETTINGS.ID}, + true); + public static Index SERVER_SETTINGS_KEY_KEY = Internal.createIndex("server_settings_key_key", + JServerSettings.SERVER_SETTINGS, new OrderField[]{JServerSettings.SERVER_SETTINGS.KEY}, + true); + public static Index SHAREABLE_PK = Internal.createIndex("shareable_pk", + JShareableEntity.SHAREABLE_ENTITY, new OrderField[]{JShareableEntity.SHAREABLE_ENTITY.ID}, + true); + public static Index SHARED_ENTITY_OWNERX = Internal.createIndex("shared_entity_ownerx", + JShareableEntity.SHAREABLE_ENTITY, + new OrderField[]{JShareableEntity.SHAREABLE_ENTITY.OWNER}, false); + public static Index SHARED_ENTITY_PROJECT_IDX = Internal.createIndex( + "shared_entity_project_idx", JShareableEntity.SHAREABLE_ENTITY, + new OrderField[]{JShareableEntity.SHAREABLE_ENTITY.PROJECT_ID}, false); + public static Index STALE_MATERIALIZED_VIEW_NAME_KEY = Internal.createIndex( + "stale_materialized_view_name_key", JStaleMaterializedView.STALE_MATERIALIZED_VIEW, + new OrderField[]{JStaleMaterializedView.STALE_MATERIALIZED_VIEW.NAME}, true); + public static Index STALE_MATERIALIZED_VIEW_PKEY = Internal.createIndex( + "stale_materialized_view_pkey", JStaleMaterializedView.STALE_MATERIALIZED_VIEW, + new OrderField[]{JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID}, true); + public static Index STALE_MV_CREATION_DATE_IDX = Internal.createIndex( + "stale_mv_creation_date_idx", JStaleMaterializedView.STALE_MATERIALIZED_VIEW, + new OrderField[]{JStaleMaterializedView.STALE_MATERIALIZED_VIEW.CREATION_DATE}, false); + public static Index STATISTICS_LAUNCH_IDX = Internal.createIndex("statistics_launch_idx", + JStatistics.STATISTICS, new OrderField[]{JStatistics.STATISTICS.LAUNCH_ID}, false); + public static Index STATISTICS_PK = Internal.createIndex("statistics_pk", + JStatistics.STATISTICS, new OrderField[]{JStatistics.STATISTICS.S_ID}, true); + public static Index STATISTICS_TI_IDX = Internal.createIndex("statistics_ti_idx", + JStatistics.STATISTICS, new OrderField[]{JStatistics.STATISTICS.ITEM_ID}, false); + public static Index UNIQUE_STATS_ITEM = Internal.createIndex("unique_stats_item", + JStatistics.STATISTICS, new OrderField[]{JStatistics.STATISTICS.STATISTICS_FIELD_ID, + JStatistics.STATISTICS.ITEM_ID}, true); + public static Index UNIQUE_STATS_LAUNCH = Internal.createIndex("unique_stats_launch", + JStatistics.STATISTICS, new OrderField[]{JStatistics.STATISTICS.STATISTICS_FIELD_ID, + JStatistics.STATISTICS.LAUNCH_ID}, true); + public static Index STATISTICS_FIELD_NAME_KEY = Internal.createIndex( + "statistics_field_name_key", JStatisticsField.STATISTICS_FIELD, + new OrderField[]{JStatisticsField.STATISTICS_FIELD.NAME}, true); + public static Index STATISTICS_FIELD_PK = Internal.createIndex("statistics_field_pk", + JStatisticsField.STATISTICS_FIELD, + new OrderField[]{JStatisticsField.STATISTICS_FIELD.SF_ID}, true); + public static Index ITEM_TEST_CASE_ID_LAUNCH_ID_IDX = Internal.createIndex( + "item_test_case_id_launch_id_idx", JTestItem.TEST_ITEM, + new OrderField[]{JTestItem.TEST_ITEM.TEST_CASE_ID, JTestItem.TEST_ITEM.LAUNCH_ID}, false); + public static Index PATH_GIST_IDX = Internal.createIndex("path_gist_idx", JTestItem.TEST_ITEM, + new OrderField[]{JTestItem.TEST_ITEM.PATH}, false); + public static Index PATH_IDX = Internal.createIndex("path_idx", JTestItem.TEST_ITEM, + new OrderField[]{JTestItem.TEST_ITEM.PATH}, false); + public static Index TEST_CASE_HASH_LAUNCH_ID_IDX = Internal.createIndex( + "test_case_hash_launch_id_idx", JTestItem.TEST_ITEM, + new OrderField[]{JTestItem.TEST_ITEM.TEST_CASE_HASH, JTestItem.TEST_ITEM.LAUNCH_ID}, false); + public static Index TEST_ITEM_PK = Internal.createIndex("test_item_pk", JTestItem.TEST_ITEM, + new OrderField[]{JTestItem.TEST_ITEM.ITEM_ID}, true); + public static Index TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX = Internal.createIndex( + "test_item_unique_id_launch_id_idx", JTestItem.TEST_ITEM, + new OrderField[]{JTestItem.TEST_ITEM.UNIQUE_ID, JTestItem.TEST_ITEM.LAUNCH_ID}, false); + public static Index TEST_ITEM_UUID_KEY = Internal.createIndex("test_item_uuid_key", + JTestItem.TEST_ITEM, new OrderField[]{JTestItem.TEST_ITEM.UUID}, true); + public static Index TI_LAUNCH_IDX = Internal.createIndex("ti_launch_idx", JTestItem.TEST_ITEM, + new OrderField[]{JTestItem.TEST_ITEM.LAUNCH_ID}, false); + public static Index TI_PARENT_IDX = Internal.createIndex("ti_parent_idx", JTestItem.TEST_ITEM, + new OrderField[]{JTestItem.TEST_ITEM.PARENT_ID}, false); + public static Index TI_RETRY_OF_IDX = Internal.createIndex("ti_retry_of_idx", + JTestItem.TEST_ITEM, new OrderField[]{JTestItem.TEST_ITEM.RETRY_OF}, false); + public static Index TEST_ITEM_RESULTS_PK = Internal.createIndex("test_item_results_pk", + JTestItemResults.TEST_ITEM_RESULTS, + new OrderField[]{JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID}, true); + public static Index TICKET_ID_IDX = Internal.createIndex("ticket_id_idx", JTicket.TICKET, + new OrderField[]{JTicket.TICKET.TICKET_ID}, false); + public static Index TICKET_PK = Internal.createIndex("ticket_pk", JTicket.TICKET, + new OrderField[]{JTicket.TICKET.ID}, true); + public static Index TICKET_SUBMITTER_IDX = Internal.createIndex("ticket_submitter_idx", + JTicket.TICKET, new OrderField[]{JTicket.TICKET.SUBMITTER}, false); + public static Index USER_BID_PROJECT_IDX = Internal.createIndex("user_bid_project_idx", + JUserCreationBid.USER_CREATION_BID, + new OrderField[]{JUserCreationBid.USER_CREATION_BID.DEFAULT_PROJECT_ID}, false); + public static Index USER_CREATION_BID_PK = Internal.createIndex("user_creation_bid_pk", + JUserCreationBid.USER_CREATION_BID, + new OrderField[]{JUserCreationBid.USER_CREATION_BID.UUID}, true); + public static Index USER_PREFERENCE_PK = Internal.createIndex("user_preference_pk", + JUserPreference.USER_PREFERENCE, new OrderField[]{JUserPreference.USER_PREFERENCE.ID}, + true); + public static Index USER_PREFERENCE_UQ = Internal.createIndex("user_preference_uq", + JUserPreference.USER_PREFERENCE, + new OrderField[]{JUserPreference.USER_PREFERENCE.PROJECT_ID, + JUserPreference.USER_PREFERENCE.USER_ID, JUserPreference.USER_PREFERENCE.FILTER_ID}, + true); + public static Index USERS_EMAIL_KEY = Internal.createIndex("users_email_key", JUsers.USERS, + new OrderField[]{JUsers.USERS.EMAIL}, true); + public static Index USERS_LOGIN_KEY = Internal.createIndex("users_login_key", JUsers.USERS, + new OrderField[]{JUsers.USERS.LOGIN}, true); + public static Index USERS_PK = Internal.createIndex("users_pk", JUsers.USERS, + new OrderField[]{JUsers.USERS.ID}, true); + public static Index WIDGET_PKEY = Internal.createIndex("widget_pkey", JWidget.WIDGET, + new OrderField[]{JWidget.WIDGET.ID}, true); + public static Index WIDGET_FILTER_PK = Internal.createIndex("widget_filter_pk", + JWidgetFilter.WIDGET_FILTER, new OrderField[]{JWidgetFilter.WIDGET_FILTER.WIDGET_ID, + JWidgetFilter.WIDGET_FILTER.FILTER_ID}, true); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java b/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java index e36f4bc15..2fee64e48 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java @@ -4,15 +4,75 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.*; +import com.epam.ta.reportportal.jooq.tables.JAclClass; +import com.epam.ta.reportportal.jooq.tables.JAclEntry; +import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; +import com.epam.ta.reportportal.jooq.tables.JAclSid; +import com.epam.ta.reportportal.jooq.tables.JActivity; +import com.epam.ta.reportportal.jooq.tables.JAttachment; +import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; +import com.epam.ta.reportportal.jooq.tables.JAttribute; +import com.epam.ta.reportportal.jooq.tables.JClusters; +import com.epam.ta.reportportal.jooq.tables.JClustersTestItem; +import com.epam.ta.reportportal.jooq.tables.JContentField; +import com.epam.ta.reportportal.jooq.tables.JDashboard; +import com.epam.ta.reportportal.jooq.tables.JDashboardWidget; +import com.epam.ta.reportportal.jooq.tables.JFilter; +import com.epam.ta.reportportal.jooq.tables.JFilterCondition; +import com.epam.ta.reportportal.jooq.tables.JFilterSort; +import com.epam.ta.reportportal.jooq.tables.JIntegration; +import com.epam.ta.reportportal.jooq.tables.JIntegrationType; +import com.epam.ta.reportportal.jooq.tables.JIssue; +import com.epam.ta.reportportal.jooq.tables.JIssueGroup; +import com.epam.ta.reportportal.jooq.tables.JIssueTicket; +import com.epam.ta.reportportal.jooq.tables.JIssueType; +import com.epam.ta.reportportal.jooq.tables.JIssueTypeProject; +import com.epam.ta.reportportal.jooq.tables.JItemAttribute; +import com.epam.ta.reportportal.jooq.tables.JLaunch; +import com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules; +import com.epam.ta.reportportal.jooq.tables.JLaunchNames; +import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; +import com.epam.ta.reportportal.jooq.tables.JLog; +import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; +import com.epam.ta.reportportal.jooq.tables.JOnboarding; +import com.epam.ta.reportportal.jooq.tables.JParameter; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; +import com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders; +import com.epam.ta.reportportal.jooq.tables.JProject; +import com.epam.ta.reportportal.jooq.tables.JProjectAttribute; +import com.epam.ta.reportportal.jooq.tables.JProjectUser; +import com.epam.ta.reportportal.jooq.tables.JRecipients; +import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; +import com.epam.ta.reportportal.jooq.tables.JSenderCase; +import com.epam.ta.reportportal.jooq.tables.JServerSettings; +import com.epam.ta.reportportal.jooq.tables.JShareableEntity; +import com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView; +import com.epam.ta.reportportal.jooq.tables.JStatistics; +import com.epam.ta.reportportal.jooq.tables.JStatisticsField; +import com.epam.ta.reportportal.jooq.tables.JTestItem; +import com.epam.ta.reportportal.jooq.tables.JTestItemResults; +import com.epam.ta.reportportal.jooq.tables.JTicket; +import com.epam.ta.reportportal.jooq.tables.JUserCreationBid; +import com.epam.ta.reportportal.jooq.tables.JUserPreference; +import com.epam.ta.reportportal.jooq.tables.JUsers; +import com.epam.ta.reportportal.jooq.tables.JWidget; +import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; import com.epam.ta.reportportal.jooq.tables.records.JPgpArmorHeadersRecord; -import org.jooq.*; -import org.jooq.impl.SchemaImpl; - -import javax.annotation.processing.Generated; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import javax.annotation.processing.Generated; +import org.jooq.Catalog; +import org.jooq.Configuration; +import org.jooq.Field; +import org.jooq.Result; +import org.jooq.Sequence; +import org.jooq.Table; +import org.jooq.impl.SchemaImpl; /** @@ -25,449 +85,429 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JPublic extends SchemaImpl { - private static final long serialVersionUID = 784587878; - - /** - * The reference instance of public - */ - public static final JPublic PUBLIC = new JPublic(); - - /** - * The table public.acl_class. - */ - public final JAclClass ACL_CLASS = com.epam.ta.reportportal.jooq.tables.JAclClass.ACL_CLASS; - - /** - * The table public.acl_entry. - */ - public final JAclEntry ACL_ENTRY = com.epam.ta.reportportal.jooq.tables.JAclEntry.ACL_ENTRY; - - /** - * The table public.acl_object_identity. - */ - public final JAclObjectIdentity ACL_OBJECT_IDENTITY = com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity.ACL_OBJECT_IDENTITY; - - /** - * The table public.acl_sid. - */ - public final JAclSid ACL_SID = com.epam.ta.reportportal.jooq.tables.JAclSid.ACL_SID; - - /** - * The table public.activity. - */ - public final JActivity ACTIVITY = com.epam.ta.reportportal.jooq.tables.JActivity.ACTIVITY; - - /** - * The table public.attachment. - */ - public final JAttachment ATTACHMENT = com.epam.ta.reportportal.jooq.tables.JAttachment.ATTACHMENT; - - /** - * The table public.attachment_deletion. - */ - public final JAttachmentDeletion ATTACHMENT_DELETION = com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion.ATTACHMENT_DELETION; - - /** - * The table public.attribute. - */ - public final JAttribute ATTRIBUTE = com.epam.ta.reportportal.jooq.tables.JAttribute.ATTRIBUTE; - - /** - * The table public.clusters. - */ - public final JClusters CLUSTERS = com.epam.ta.reportportal.jooq.tables.JClusters.CLUSTERS; - - /** - * The table public.clusters_test_item. - */ - public final JClustersTestItem CLUSTERS_TEST_ITEM = com.epam.ta.reportportal.jooq.tables.JClustersTestItem.CLUSTERS_TEST_ITEM; - - /** - * The table public.content_field. - */ - public final JContentField CONTENT_FIELD = com.epam.ta.reportportal.jooq.tables.JContentField.CONTENT_FIELD; - - /** - * The table public.dashboard. - */ - public final JDashboard DASHBOARD = com.epam.ta.reportportal.jooq.tables.JDashboard.DASHBOARD; - - /** - * The table public.dashboard_widget. - */ - public final JDashboardWidget DASHBOARD_WIDGET = com.epam.ta.reportportal.jooq.tables.JDashboardWidget.DASHBOARD_WIDGET; - - /** - * The table public.filter. - */ - public final JFilter FILTER = com.epam.ta.reportportal.jooq.tables.JFilter.FILTER; - - /** - * The table public.filter_condition. - */ - public final JFilterCondition FILTER_CONDITION = com.epam.ta.reportportal.jooq.tables.JFilterCondition.FILTER_CONDITION; - - /** - * The table public.filter_sort. - */ - public final JFilterSort FILTER_SORT = com.epam.ta.reportportal.jooq.tables.JFilterSort.FILTER_SORT; - - /** - * The table public.integration. - */ - public final JIntegration INTEGRATION = com.epam.ta.reportportal.jooq.tables.JIntegration.INTEGRATION; - - /** - * The table public.integration_type. - */ - public final JIntegrationType INTEGRATION_TYPE = com.epam.ta.reportportal.jooq.tables.JIntegrationType.INTEGRATION_TYPE; - - /** - * The table public.issue. - */ - public final JIssue ISSUE = com.epam.ta.reportportal.jooq.tables.JIssue.ISSUE; - - /** - * The table public.issue_group. - */ - public final JIssueGroup ISSUE_GROUP = com.epam.ta.reportportal.jooq.tables.JIssueGroup.ISSUE_GROUP; - - /** - * The table public.issue_ticket. - */ - public final JIssueTicket ISSUE_TICKET = com.epam.ta.reportportal.jooq.tables.JIssueTicket.ISSUE_TICKET; - - /** - * The table public.issue_type. - */ - public final JIssueType ISSUE_TYPE = com.epam.ta.reportportal.jooq.tables.JIssueType.ISSUE_TYPE; - - /** - * The table public.issue_type_project. - */ - public final JIssueTypeProject ISSUE_TYPE_PROJECT = com.epam.ta.reportportal.jooq.tables.JIssueTypeProject.ISSUE_TYPE_PROJECT; - - /** - * The table public.item_attribute. - */ - public final JItemAttribute ITEM_ATTRIBUTE = com.epam.ta.reportportal.jooq.tables.JItemAttribute.ITEM_ATTRIBUTE; - - /** - * The table public.launch. - */ - public final JLaunch LAUNCH = com.epam.ta.reportportal.jooq.tables.JLaunch.LAUNCH; - - /** - * The table public.launch_attribute_rules. - */ - public final JLaunchAttributeRules LAUNCH_ATTRIBUTE_RULES = com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES; - - /** - * The table public.launch_names. - */ - public final JLaunchNames LAUNCH_NAMES = com.epam.ta.reportportal.jooq.tables.JLaunchNames.LAUNCH_NAMES; - - /** - * The table public.launch_number. - */ - public final JLaunchNumber LAUNCH_NUMBER = com.epam.ta.reportportal.jooq.tables.JLaunchNumber.LAUNCH_NUMBER; - - /** - * The table public.log. - */ - public final JLog LOG = com.epam.ta.reportportal.jooq.tables.JLog.LOG; - - /** - * The table public.oauth_access_token. - */ - public final JOauthAccessToken OAUTH_ACCESS_TOKEN = com.epam.ta.reportportal.jooq.tables.JOauthAccessToken.OAUTH_ACCESS_TOKEN; - - /** - * The table public.oauth_registration. - */ - public final JOauthRegistration OAUTH_REGISTRATION = com.epam.ta.reportportal.jooq.tables.JOauthRegistration.OAUTH_REGISTRATION; - - /** - * The table public.oauth_registration_restriction. - */ - public final JOauthRegistrationRestriction OAUTH_REGISTRATION_RESTRICTION = com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION; - - /** - * The table public.oauth_registration_scope. - */ - public final JOauthRegistrationScope OAUTH_REGISTRATION_SCOPE = com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE; - - /** - * The table public.onboarding. - */ - public final JOnboarding ONBOARDING = com.epam.ta.reportportal.jooq.tables.JOnboarding.ONBOARDING; - - /** - * The table public.parameter. - */ - public final JParameter PARAMETER = com.epam.ta.reportportal.jooq.tables.JParameter.PARAMETER; - - /** - * The table public.pattern_template. - */ - public final JPatternTemplate PATTERN_TEMPLATE = com.epam.ta.reportportal.jooq.tables.JPatternTemplate.PATTERN_TEMPLATE; - - /** - * The table public.pattern_template_test_item. - */ - public final JPatternTemplateTestItem PATTERN_TEMPLATE_TEST_ITEM = com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM; - - /** - * The table public.pgp_armor_headers. - */ - public final JPgpArmorHeaders PGP_ARMOR_HEADERS = com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS; - - /** - * Call public.pgp_armor_headers. - */ - public static Result PGP_ARMOR_HEADERS(Configuration configuration, String __1) { - return configuration.dsl().selectFrom(com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1)).fetch(); - } - - /** - * Get public.pgp_armor_headers as a table. - */ - public static JPgpArmorHeaders PGP_ARMOR_HEADERS(String __1) { - return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); - } - - /** - * Get public.pgp_armor_headers as a table. - */ - public static JPgpArmorHeaders PGP_ARMOR_HEADERS(Field __1) { - return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); - } - - /** - * The table public.project. - */ - public final JProject PROJECT = com.epam.ta.reportportal.jooq.tables.JProject.PROJECT; - - /** - * The table public.project_attribute. - */ - public final JProjectAttribute PROJECT_ATTRIBUTE = com.epam.ta.reportportal.jooq.tables.JProjectAttribute.PROJECT_ATTRIBUTE; - - /** - * The table public.project_user. - */ - public final JProjectUser PROJECT_USER = com.epam.ta.reportportal.jooq.tables.JProjectUser.PROJECT_USER; - - /** - * The table public.recipients. - */ - public final JRecipients RECIPIENTS = com.epam.ta.reportportal.jooq.tables.JRecipients.RECIPIENTS; - - /** - * The table public.restore_password_bid. - */ - public final JRestorePasswordBid RESTORE_PASSWORD_BID = com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid.RESTORE_PASSWORD_BID; - - /** - * The table public.sender_case. - */ - public final JSenderCase SENDER_CASE = com.epam.ta.reportportal.jooq.tables.JSenderCase.SENDER_CASE; - - /** - * The table public.server_settings. - */ - public final JServerSettings SERVER_SETTINGS = com.epam.ta.reportportal.jooq.tables.JServerSettings.SERVER_SETTINGS; - - /** - * The table public.shareable_entity. - */ - public final JShareableEntity SHAREABLE_ENTITY = com.epam.ta.reportportal.jooq.tables.JShareableEntity.SHAREABLE_ENTITY; - - /** - * The table public.stale_materialized_view. - */ - public final JStaleMaterializedView STALE_MATERIALIZED_VIEW = com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView.STALE_MATERIALIZED_VIEW; - - /** - * The table public.statistics. - */ - public final JStatistics STATISTICS = com.epam.ta.reportportal.jooq.tables.JStatistics.STATISTICS; - - /** - * The table public.statistics_field. - */ - public final JStatisticsField STATISTICS_FIELD = com.epam.ta.reportportal.jooq.tables.JStatisticsField.STATISTICS_FIELD; - - /** - * The table public.test_item. - */ - public final JTestItem TEST_ITEM = com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; - - /** - * The table public.test_item_results. - */ - public final JTestItemResults TEST_ITEM_RESULTS = com.epam.ta.reportportal.jooq.tables.JTestItemResults.TEST_ITEM_RESULTS; - - /** - * The table public.ticket. - */ - public final JTicket TICKET = com.epam.ta.reportportal.jooq.tables.JTicket.TICKET; - - /** - * The table public.user_creation_bid. - */ - public final JUserCreationBid USER_CREATION_BID = com.epam.ta.reportportal.jooq.tables.JUserCreationBid.USER_CREATION_BID; - - /** - * The table public.user_preference. - */ - public final JUserPreference USER_PREFERENCE = com.epam.ta.reportportal.jooq.tables.JUserPreference.USER_PREFERENCE; - - /** - * The table public.users. - */ - public final JUsers USERS = com.epam.ta.reportportal.jooq.tables.JUsers.USERS; - - /** - * The table public.widget. - */ - public final JWidget WIDGET = com.epam.ta.reportportal.jooq.tables.JWidget.WIDGET; - - /** - * The table public.widget_filter. - */ - public final JWidgetFilter WIDGET_FILTER = com.epam.ta.reportportal.jooq.tables.JWidgetFilter.WIDGET_FILTER; - - /** - * No further instances allowed - */ - private JPublic() { - super("public", null); - } - - - @Override - public Catalog getCatalog() { - return DefaultCatalog.DEFAULT_CATALOG; - } - - @Override - public final List> getSequences() { - List result = new ArrayList(); - result.addAll(getSequences0()); - return result; - } - - private final List> getSequences0() { - return Arrays.>asList( - Sequences.ACL_CLASS_ID_SEQ, - Sequences.ACL_ENTRY_ID_SEQ, - Sequences.ACL_OBJECT_IDENTITY_ID_SEQ, - Sequences.ACL_SID_ID_SEQ, - Sequences.ACTIVITY_ID_SEQ, - Sequences.ATTACHMENT_ID_SEQ, - Sequences.ATTRIBUTE_ID_SEQ, - Sequences.CLUSTERS_ID_SEQ, - Sequences.FILTER_CONDITION_ID_SEQ, - Sequences.FILTER_SORT_ID_SEQ, - Sequences.INTEGRATION_ID_SEQ, - Sequences.INTEGRATION_TYPE_ID_SEQ, - Sequences.ISSUE_GROUP_ISSUE_GROUP_ID_SEQ, - Sequences.ISSUE_TYPE_ID_SEQ, - Sequences.ITEM_ATTRIBUTE_ID_SEQ, - Sequences.LAUNCH_ATTRIBUTE_RULES_ID_SEQ, - Sequences.LAUNCH_ID_SEQ, - Sequences.LAUNCH_NUMBER_ID_SEQ, - Sequences.LOG_ID_SEQ, - Sequences.OAUTH_ACCESS_TOKEN_ID_SEQ, - Sequences.OAUTH_REGISTRATION_RESTRICTION_ID_SEQ, - Sequences.OAUTH_REGISTRATION_SCOPE_ID_SEQ, - Sequences.ONBOARDING_ID_SEQ, - Sequences.PATTERN_TEMPLATE_ID_SEQ, - Sequences.PROJECT_ATTRIBUTE_ATTRIBUTE_ID_SEQ, - Sequences.PROJECT_ATTRIBUTE_PROJECT_ID_SEQ, - Sequences.PROJECT_ID_SEQ, - Sequences.SENDER_CASE_ID_SEQ, - Sequences.SENDER_CASE_PROJECT_ID_SEQ, - Sequences.SERVER_SETTINGS_ID_SEQ, - Sequences.SHAREABLE_ENTITY_ID_SEQ, - Sequences.STALE_MATERIALIZED_VIEW_ID_SEQ, - Sequences.STATISTICS_FIELD_SF_ID_SEQ, - Sequences.STATISTICS_S_ID_SEQ, - Sequences.TEST_ITEM_ITEM_ID_SEQ, - Sequences.TICKET_ID_SEQ, - Sequences.USER_PREFERENCE_ID_SEQ, - Sequences.USERS_ID_SEQ); - } - - @Override - public final List> getTables() { - List result = new ArrayList(); - result.addAll(getTables0()); - return result; - } - - private final List> getTables0() { - return Arrays.>asList( - JAclClass.ACL_CLASS, - JAclEntry.ACL_ENTRY, - JAclObjectIdentity.ACL_OBJECT_IDENTITY, - JAclSid.ACL_SID, - JActivity.ACTIVITY, - JAttachment.ATTACHMENT, - JAttachmentDeletion.ATTACHMENT_DELETION, - JAttribute.ATTRIBUTE, - JClusters.CLUSTERS, - JClustersTestItem.CLUSTERS_TEST_ITEM, - JContentField.CONTENT_FIELD, - JDashboard.DASHBOARD, - JDashboardWidget.DASHBOARD_WIDGET, - JFilter.FILTER, - JFilterCondition.FILTER_CONDITION, - JFilterSort.FILTER_SORT, - JIntegration.INTEGRATION, - JIntegrationType.INTEGRATION_TYPE, - JIssue.ISSUE, - JIssueGroup.ISSUE_GROUP, - JIssueTicket.ISSUE_TICKET, - JIssueType.ISSUE_TYPE, - JIssueTypeProject.ISSUE_TYPE_PROJECT, - JItemAttribute.ITEM_ATTRIBUTE, - JLaunch.LAUNCH, - JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, - JLaunchNames.LAUNCH_NAMES, - JLaunchNumber.LAUNCH_NUMBER, - JLog.LOG, - JOauthAccessToken.OAUTH_ACCESS_TOKEN, - JOauthRegistration.OAUTH_REGISTRATION, - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, - JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, - JOnboarding.ONBOARDING, - JParameter.PARAMETER, - JPatternTemplate.PATTERN_TEMPLATE, - JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, - JPgpArmorHeaders.PGP_ARMOR_HEADERS, - JProject.PROJECT, - JProjectAttribute.PROJECT_ATTRIBUTE, - JProjectUser.PROJECT_USER, - JRecipients.RECIPIENTS, - JRestorePasswordBid.RESTORE_PASSWORD_BID, - JSenderCase.SENDER_CASE, - JServerSettings.SERVER_SETTINGS, - JShareableEntity.SHAREABLE_ENTITY, - JStaleMaterializedView.STALE_MATERIALIZED_VIEW, - JStatistics.STATISTICS, - JStatisticsField.STATISTICS_FIELD, - JTestItem.TEST_ITEM, - JTestItemResults.TEST_ITEM_RESULTS, - JTicket.TICKET, - JUserCreationBid.USER_CREATION_BID, - JUserPreference.USER_PREFERENCE, - JUsers.USERS, - JWidget.WIDGET, - JWidgetFilter.WIDGET_FILTER); - } + /** + * The reference instance of public + */ + public static final JPublic PUBLIC = new JPublic(); + private static final long serialVersionUID = 784587878; + /** + * The table public.acl_class. + */ + public final JAclClass ACL_CLASS = com.epam.ta.reportportal.jooq.tables.JAclClass.ACL_CLASS; + + /** + * The table public.acl_entry. + */ + public final JAclEntry ACL_ENTRY = com.epam.ta.reportportal.jooq.tables.JAclEntry.ACL_ENTRY; + + /** + * The table public.acl_object_identity. + */ + public final JAclObjectIdentity ACL_OBJECT_IDENTITY = com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity.ACL_OBJECT_IDENTITY; + + /** + * The table public.acl_sid. + */ + public final JAclSid ACL_SID = com.epam.ta.reportportal.jooq.tables.JAclSid.ACL_SID; + + /** + * The table public.activity. + */ + public final JActivity ACTIVITY = com.epam.ta.reportportal.jooq.tables.JActivity.ACTIVITY; + + /** + * The table public.attachment. + */ + public final JAttachment ATTACHMENT = com.epam.ta.reportportal.jooq.tables.JAttachment.ATTACHMENT; + + /** + * The table public.attachment_deletion. + */ + public final JAttachmentDeletion ATTACHMENT_DELETION = com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion.ATTACHMENT_DELETION; + + /** + * The table public.attribute. + */ + public final JAttribute ATTRIBUTE = com.epam.ta.reportportal.jooq.tables.JAttribute.ATTRIBUTE; + + /** + * The table public.clusters. + */ + public final JClusters CLUSTERS = com.epam.ta.reportportal.jooq.tables.JClusters.CLUSTERS; + + /** + * The table public.clusters_test_item. + */ + public final JClustersTestItem CLUSTERS_TEST_ITEM = com.epam.ta.reportportal.jooq.tables.JClustersTestItem.CLUSTERS_TEST_ITEM; + + /** + * The table public.content_field. + */ + public final JContentField CONTENT_FIELD = com.epam.ta.reportportal.jooq.tables.JContentField.CONTENT_FIELD; + + /** + * The table public.dashboard. + */ + public final JDashboard DASHBOARD = com.epam.ta.reportportal.jooq.tables.JDashboard.DASHBOARD; + + /** + * The table public.dashboard_widget. + */ + public final JDashboardWidget DASHBOARD_WIDGET = com.epam.ta.reportportal.jooq.tables.JDashboardWidget.DASHBOARD_WIDGET; + + /** + * The table public.filter. + */ + public final JFilter FILTER = com.epam.ta.reportportal.jooq.tables.JFilter.FILTER; + + /** + * The table public.filter_condition. + */ + public final JFilterCondition FILTER_CONDITION = com.epam.ta.reportportal.jooq.tables.JFilterCondition.FILTER_CONDITION; + + /** + * The table public.filter_sort. + */ + public final JFilterSort FILTER_SORT = com.epam.ta.reportportal.jooq.tables.JFilterSort.FILTER_SORT; + + /** + * The table public.integration. + */ + public final JIntegration INTEGRATION = com.epam.ta.reportportal.jooq.tables.JIntegration.INTEGRATION; + + /** + * The table public.integration_type. + */ + public final JIntegrationType INTEGRATION_TYPE = com.epam.ta.reportportal.jooq.tables.JIntegrationType.INTEGRATION_TYPE; + + /** + * The table public.issue. + */ + public final JIssue ISSUE = com.epam.ta.reportportal.jooq.tables.JIssue.ISSUE; + + /** + * The table public.issue_group. + */ + public final JIssueGroup ISSUE_GROUP = com.epam.ta.reportportal.jooq.tables.JIssueGroup.ISSUE_GROUP; + + /** + * The table public.issue_ticket. + */ + public final JIssueTicket ISSUE_TICKET = com.epam.ta.reportportal.jooq.tables.JIssueTicket.ISSUE_TICKET; + + /** + * The table public.issue_type. + */ + public final JIssueType ISSUE_TYPE = com.epam.ta.reportportal.jooq.tables.JIssueType.ISSUE_TYPE; + + /** + * The table public.issue_type_project. + */ + public final JIssueTypeProject ISSUE_TYPE_PROJECT = com.epam.ta.reportportal.jooq.tables.JIssueTypeProject.ISSUE_TYPE_PROJECT; + + /** + * The table public.item_attribute. + */ + public final JItemAttribute ITEM_ATTRIBUTE = com.epam.ta.reportportal.jooq.tables.JItemAttribute.ITEM_ATTRIBUTE; + + /** + * The table public.launch. + */ + public final JLaunch LAUNCH = com.epam.ta.reportportal.jooq.tables.JLaunch.LAUNCH; + + /** + * The table public.launch_attribute_rules. + */ + public final JLaunchAttributeRules LAUNCH_ATTRIBUTE_RULES = com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES; + + /** + * The table public.launch_names. + */ + public final JLaunchNames LAUNCH_NAMES = com.epam.ta.reportportal.jooq.tables.JLaunchNames.LAUNCH_NAMES; + + /** + * The table public.launch_number. + */ + public final JLaunchNumber LAUNCH_NUMBER = com.epam.ta.reportportal.jooq.tables.JLaunchNumber.LAUNCH_NUMBER; + + /** + * The table public.log. + */ + public final JLog LOG = com.epam.ta.reportportal.jooq.tables.JLog.LOG; + + /** + * The table public.oauth_access_token. + */ + public final JOauthAccessToken OAUTH_ACCESS_TOKEN = com.epam.ta.reportportal.jooq.tables.JOauthAccessToken.OAUTH_ACCESS_TOKEN; + + /** + * The table public.oauth_registration. + */ + public final JOauthRegistration OAUTH_REGISTRATION = com.epam.ta.reportportal.jooq.tables.JOauthRegistration.OAUTH_REGISTRATION; + + /** + * The table public.oauth_registration_restriction. + */ + public final JOauthRegistrationRestriction OAUTH_REGISTRATION_RESTRICTION = com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION; + + /** + * The table public.oauth_registration_scope. + */ + public final JOauthRegistrationScope OAUTH_REGISTRATION_SCOPE = com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE; + + /** + * The table public.onboarding. + */ + public final JOnboarding ONBOARDING = com.epam.ta.reportportal.jooq.tables.JOnboarding.ONBOARDING; + + /** + * The table public.parameter. + */ + public final JParameter PARAMETER = com.epam.ta.reportportal.jooq.tables.JParameter.PARAMETER; + + /** + * The table public.pattern_template. + */ + public final JPatternTemplate PATTERN_TEMPLATE = com.epam.ta.reportportal.jooq.tables.JPatternTemplate.PATTERN_TEMPLATE; + + /** + * The table public.pattern_template_test_item. + */ + public final JPatternTemplateTestItem PATTERN_TEMPLATE_TEST_ITEM = com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM; + + /** + * The table public.pgp_armor_headers. + */ + public final JPgpArmorHeaders PGP_ARMOR_HEADERS = com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS; + /** + * The table public.project. + */ + public final JProject PROJECT = com.epam.ta.reportportal.jooq.tables.JProject.PROJECT; + /** + * The table public.project_attribute. + */ + public final JProjectAttribute PROJECT_ATTRIBUTE = com.epam.ta.reportportal.jooq.tables.JProjectAttribute.PROJECT_ATTRIBUTE; + /** + * The table public.project_user. + */ + public final JProjectUser PROJECT_USER = com.epam.ta.reportportal.jooq.tables.JProjectUser.PROJECT_USER; + /** + * The table public.recipients. + */ + public final JRecipients RECIPIENTS = com.epam.ta.reportportal.jooq.tables.JRecipients.RECIPIENTS; + /** + * The table public.restore_password_bid. + */ + public final JRestorePasswordBid RESTORE_PASSWORD_BID = com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid.RESTORE_PASSWORD_BID; + /** + * The table public.sender_case. + */ + public final JSenderCase SENDER_CASE = com.epam.ta.reportportal.jooq.tables.JSenderCase.SENDER_CASE; + /** + * The table public.server_settings. + */ + public final JServerSettings SERVER_SETTINGS = com.epam.ta.reportportal.jooq.tables.JServerSettings.SERVER_SETTINGS; + /** + * The table public.shareable_entity. + */ + public final JShareableEntity SHAREABLE_ENTITY = com.epam.ta.reportportal.jooq.tables.JShareableEntity.SHAREABLE_ENTITY; + /** + * The table public.stale_materialized_view. + */ + public final JStaleMaterializedView STALE_MATERIALIZED_VIEW = com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView.STALE_MATERIALIZED_VIEW; + /** + * The table public.statistics. + */ + public final JStatistics STATISTICS = com.epam.ta.reportportal.jooq.tables.JStatistics.STATISTICS; + /** + * The table public.statistics_field. + */ + public final JStatisticsField STATISTICS_FIELD = com.epam.ta.reportportal.jooq.tables.JStatisticsField.STATISTICS_FIELD; + /** + * The table public.test_item. + */ + public final JTestItem TEST_ITEM = com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; + /** + * The table public.test_item_results. + */ + public final JTestItemResults TEST_ITEM_RESULTS = com.epam.ta.reportportal.jooq.tables.JTestItemResults.TEST_ITEM_RESULTS; + /** + * The table public.ticket. + */ + public final JTicket TICKET = com.epam.ta.reportportal.jooq.tables.JTicket.TICKET; + /** + * The table public.user_creation_bid. + */ + public final JUserCreationBid USER_CREATION_BID = com.epam.ta.reportportal.jooq.tables.JUserCreationBid.USER_CREATION_BID; + /** + * The table public.user_preference. + */ + public final JUserPreference USER_PREFERENCE = com.epam.ta.reportportal.jooq.tables.JUserPreference.USER_PREFERENCE; + /** + * The table public.users. + */ + public final JUsers USERS = com.epam.ta.reportportal.jooq.tables.JUsers.USERS; + /** + * The table public.widget. + */ + public final JWidget WIDGET = com.epam.ta.reportportal.jooq.tables.JWidget.WIDGET; + /** + * The table public.widget_filter. + */ + public final JWidgetFilter WIDGET_FILTER = com.epam.ta.reportportal.jooq.tables.JWidgetFilter.WIDGET_FILTER; + + /** + * No further instances allowed + */ + private JPublic() { + super("public", null); + } + + /** + * Call public.pgp_armor_headers. + */ + public static Result PGP_ARMOR_HEADERS(Configuration configuration, + String __1) { + return configuration.dsl().selectFrom( + com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1)).fetch(); + } + + /** + * Get public.pgp_armor_headers as a table. + */ + public static JPgpArmorHeaders PGP_ARMOR_HEADERS(String __1) { + return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); + } + + /** + * Get public.pgp_armor_headers as a table. + */ + public static JPgpArmorHeaders PGP_ARMOR_HEADERS(Field __1) { + return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); + } + + @Override + public Catalog getCatalog() { + return DefaultCatalog.DEFAULT_CATALOG; + } + + @Override + public final List> getSequences() { + List result = new ArrayList(); + result.addAll(getSequences0()); + return result; + } + + private final List> getSequences0() { + return Arrays.>asList( + Sequences.ACL_CLASS_ID_SEQ, + Sequences.ACL_ENTRY_ID_SEQ, + Sequences.ACL_OBJECT_IDENTITY_ID_SEQ, + Sequences.ACL_SID_ID_SEQ, + Sequences.ACTIVITY_ID_SEQ, + Sequences.ATTACHMENT_ID_SEQ, + Sequences.ATTRIBUTE_ID_SEQ, + Sequences.CLUSTERS_ID_SEQ, + Sequences.FILTER_CONDITION_ID_SEQ, + Sequences.FILTER_SORT_ID_SEQ, + Sequences.INTEGRATION_ID_SEQ, + Sequences.INTEGRATION_TYPE_ID_SEQ, + Sequences.ISSUE_GROUP_ISSUE_GROUP_ID_SEQ, + Sequences.ISSUE_TYPE_ID_SEQ, + Sequences.ITEM_ATTRIBUTE_ID_SEQ, + Sequences.LAUNCH_ATTRIBUTE_RULES_ID_SEQ, + Sequences.LAUNCH_ID_SEQ, + Sequences.LAUNCH_NUMBER_ID_SEQ, + Sequences.LOG_ID_SEQ, + Sequences.OAUTH_ACCESS_TOKEN_ID_SEQ, + Sequences.OAUTH_REGISTRATION_RESTRICTION_ID_SEQ, + Sequences.OAUTH_REGISTRATION_SCOPE_ID_SEQ, + Sequences.ONBOARDING_ID_SEQ, + Sequences.PATTERN_TEMPLATE_ID_SEQ, + Sequences.PROJECT_ATTRIBUTE_ATTRIBUTE_ID_SEQ, + Sequences.PROJECT_ATTRIBUTE_PROJECT_ID_SEQ, + Sequences.PROJECT_ID_SEQ, + Sequences.SENDER_CASE_ID_SEQ, + Sequences.SENDER_CASE_PROJECT_ID_SEQ, + Sequences.SERVER_SETTINGS_ID_SEQ, + Sequences.SHAREABLE_ENTITY_ID_SEQ, + Sequences.STALE_MATERIALIZED_VIEW_ID_SEQ, + Sequences.STATISTICS_FIELD_SF_ID_SEQ, + Sequences.STATISTICS_S_ID_SEQ, + Sequences.TEST_ITEM_ITEM_ID_SEQ, + Sequences.TICKET_ID_SEQ, + Sequences.USER_PREFERENCE_ID_SEQ, + Sequences.USERS_ID_SEQ); + } + + @Override + public final List> getTables() { + List result = new ArrayList(); + result.addAll(getTables0()); + return result; + } + + private final List> getTables0() { + return Arrays.>asList( + JAclClass.ACL_CLASS, + JAclEntry.ACL_ENTRY, + JAclObjectIdentity.ACL_OBJECT_IDENTITY, + JAclSid.ACL_SID, + JActivity.ACTIVITY, + JAttachment.ATTACHMENT, + JAttachmentDeletion.ATTACHMENT_DELETION, + JAttribute.ATTRIBUTE, + JClusters.CLUSTERS, + JClustersTestItem.CLUSTERS_TEST_ITEM, + JContentField.CONTENT_FIELD, + JDashboard.DASHBOARD, + JDashboardWidget.DASHBOARD_WIDGET, + JFilter.FILTER, + JFilterCondition.FILTER_CONDITION, + JFilterSort.FILTER_SORT, + JIntegration.INTEGRATION, + JIntegrationType.INTEGRATION_TYPE, + JIssue.ISSUE, + JIssueGroup.ISSUE_GROUP, + JIssueTicket.ISSUE_TICKET, + JIssueType.ISSUE_TYPE, + JIssueTypeProject.ISSUE_TYPE_PROJECT, + JItemAttribute.ITEM_ATTRIBUTE, + JLaunch.LAUNCH, + JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, + JLaunchNames.LAUNCH_NAMES, + JLaunchNumber.LAUNCH_NUMBER, + JLog.LOG, + JOauthAccessToken.OAUTH_ACCESS_TOKEN, + JOauthRegistration.OAUTH_REGISTRATION, + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, + JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, + JOnboarding.ONBOARDING, + JParameter.PARAMETER, + JPatternTemplate.PATTERN_TEMPLATE, + JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, + JPgpArmorHeaders.PGP_ARMOR_HEADERS, + JProject.PROJECT, + JProjectAttribute.PROJECT_ATTRIBUTE, + JProjectUser.PROJECT_USER, + JRecipients.RECIPIENTS, + JRestorePasswordBid.RESTORE_PASSWORD_BID, + JSenderCase.SENDER_CASE, + JServerSettings.SERVER_SETTINGS, + JShareableEntity.SHAREABLE_ENTITY, + JStaleMaterializedView.STALE_MATERIALIZED_VIEW, + JStatistics.STATISTICS, + JStatisticsField.STATISTICS_FIELD, + JTestItem.TEST_ITEM, + JTestItemResults.TEST_ITEM_RESULTS, + JTicket.TICKET, + JUserCreationBid.USER_CREATION_BID, + JUserPreference.USER_PREFERENCE, + JUsers.USERS, + JWidget.WIDGET, + JWidgetFilter.WIDGET_FILTER); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Keys.java b/src/main/java/com/epam/ta/reportportal/jooq/Keys.java index f380b3074..db174c4fb 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/Keys.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Keys.java @@ -4,19 +4,128 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.*; -import com.epam.ta.reportportal.jooq.tables.records.*; +import com.epam.ta.reportportal.jooq.tables.JAclClass; +import com.epam.ta.reportportal.jooq.tables.JAclEntry; +import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; +import com.epam.ta.reportportal.jooq.tables.JAclSid; +import com.epam.ta.reportportal.jooq.tables.JActivity; +import com.epam.ta.reportportal.jooq.tables.JAttachment; +import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; +import com.epam.ta.reportportal.jooq.tables.JAttribute; +import com.epam.ta.reportportal.jooq.tables.JClusters; +import com.epam.ta.reportportal.jooq.tables.JClustersTestItem; +import com.epam.ta.reportportal.jooq.tables.JContentField; +import com.epam.ta.reportportal.jooq.tables.JDashboard; +import com.epam.ta.reportportal.jooq.tables.JDashboardWidget; +import com.epam.ta.reportportal.jooq.tables.JFilter; +import com.epam.ta.reportportal.jooq.tables.JFilterCondition; +import com.epam.ta.reportportal.jooq.tables.JFilterSort; +import com.epam.ta.reportportal.jooq.tables.JIntegration; +import com.epam.ta.reportportal.jooq.tables.JIntegrationType; +import com.epam.ta.reportportal.jooq.tables.JIssue; +import com.epam.ta.reportportal.jooq.tables.JIssueGroup; +import com.epam.ta.reportportal.jooq.tables.JIssueTicket; +import com.epam.ta.reportportal.jooq.tables.JIssueType; +import com.epam.ta.reportportal.jooq.tables.JIssueTypeProject; +import com.epam.ta.reportportal.jooq.tables.JItemAttribute; +import com.epam.ta.reportportal.jooq.tables.JLaunch; +import com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules; +import com.epam.ta.reportportal.jooq.tables.JLaunchNames; +import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; +import com.epam.ta.reportportal.jooq.tables.JLog; +import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; +import com.epam.ta.reportportal.jooq.tables.JOnboarding; +import com.epam.ta.reportportal.jooq.tables.JParameter; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; +import com.epam.ta.reportportal.jooq.tables.JProject; +import com.epam.ta.reportportal.jooq.tables.JProjectAttribute; +import com.epam.ta.reportportal.jooq.tables.JProjectUser; +import com.epam.ta.reportportal.jooq.tables.JRecipients; +import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; +import com.epam.ta.reportportal.jooq.tables.JSenderCase; +import com.epam.ta.reportportal.jooq.tables.JServerSettings; +import com.epam.ta.reportportal.jooq.tables.JShareableEntity; +import com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView; +import com.epam.ta.reportportal.jooq.tables.JStatistics; +import com.epam.ta.reportportal.jooq.tables.JStatisticsField; +import com.epam.ta.reportportal.jooq.tables.JTestItem; +import com.epam.ta.reportportal.jooq.tables.JTestItemResults; +import com.epam.ta.reportportal.jooq.tables.JTicket; +import com.epam.ta.reportportal.jooq.tables.JUserCreationBid; +import com.epam.ta.reportportal.jooq.tables.JUserPreference; +import com.epam.ta.reportportal.jooq.tables.JUsers; +import com.epam.ta.reportportal.jooq.tables.JWidget; +import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; +import com.epam.ta.reportportal.jooq.tables.records.JAclClassRecord; +import com.epam.ta.reportportal.jooq.tables.records.JAclEntryRecord; +import com.epam.ta.reportportal.jooq.tables.records.JAclObjectIdentityRecord; +import com.epam.ta.reportportal.jooq.tables.records.JAclSidRecord; +import com.epam.ta.reportportal.jooq.tables.records.JActivityRecord; +import com.epam.ta.reportportal.jooq.tables.records.JAttachmentDeletionRecord; +import com.epam.ta.reportportal.jooq.tables.records.JAttachmentRecord; +import com.epam.ta.reportportal.jooq.tables.records.JAttributeRecord; +import com.epam.ta.reportportal.jooq.tables.records.JClustersRecord; +import com.epam.ta.reportportal.jooq.tables.records.JClustersTestItemRecord; +import com.epam.ta.reportportal.jooq.tables.records.JContentFieldRecord; +import com.epam.ta.reportportal.jooq.tables.records.JDashboardRecord; +import com.epam.ta.reportportal.jooq.tables.records.JDashboardWidgetRecord; +import com.epam.ta.reportportal.jooq.tables.records.JFilterConditionRecord; +import com.epam.ta.reportportal.jooq.tables.records.JFilterRecord; +import com.epam.ta.reportportal.jooq.tables.records.JFilterSortRecord; +import com.epam.ta.reportportal.jooq.tables.records.JIntegrationRecord; +import com.epam.ta.reportportal.jooq.tables.records.JIntegrationTypeRecord; +import com.epam.ta.reportportal.jooq.tables.records.JIssueGroupRecord; +import com.epam.ta.reportportal.jooq.tables.records.JIssueRecord; +import com.epam.ta.reportportal.jooq.tables.records.JIssueTicketRecord; +import com.epam.ta.reportportal.jooq.tables.records.JIssueTypeProjectRecord; +import com.epam.ta.reportportal.jooq.tables.records.JIssueTypeRecord; +import com.epam.ta.reportportal.jooq.tables.records.JItemAttributeRecord; +import com.epam.ta.reportportal.jooq.tables.records.JLaunchAttributeRulesRecord; +import com.epam.ta.reportportal.jooq.tables.records.JLaunchNamesRecord; +import com.epam.ta.reportportal.jooq.tables.records.JLaunchNumberRecord; +import com.epam.ta.reportportal.jooq.tables.records.JLaunchRecord; +import com.epam.ta.reportportal.jooq.tables.records.JLogRecord; +import com.epam.ta.reportportal.jooq.tables.records.JOauthAccessTokenRecord; +import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationRecord; +import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationRestrictionRecord; +import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationScopeRecord; +import com.epam.ta.reportportal.jooq.tables.records.JOnboardingRecord; +import com.epam.ta.reportportal.jooq.tables.records.JParameterRecord; +import com.epam.ta.reportportal.jooq.tables.records.JPatternTemplateRecord; +import com.epam.ta.reportportal.jooq.tables.records.JPatternTemplateTestItemRecord; +import com.epam.ta.reportportal.jooq.tables.records.JProjectAttributeRecord; +import com.epam.ta.reportportal.jooq.tables.records.JProjectRecord; +import com.epam.ta.reportportal.jooq.tables.records.JProjectUserRecord; +import com.epam.ta.reportportal.jooq.tables.records.JRecipientsRecord; +import com.epam.ta.reportportal.jooq.tables.records.JRestorePasswordBidRecord; +import com.epam.ta.reportportal.jooq.tables.records.JSenderCaseRecord; +import com.epam.ta.reportportal.jooq.tables.records.JServerSettingsRecord; +import com.epam.ta.reportportal.jooq.tables.records.JShareableEntityRecord; +import com.epam.ta.reportportal.jooq.tables.records.JStaleMaterializedViewRecord; +import com.epam.ta.reportportal.jooq.tables.records.JStatisticsFieldRecord; +import com.epam.ta.reportportal.jooq.tables.records.JStatisticsRecord; +import com.epam.ta.reportportal.jooq.tables.records.JTestItemRecord; +import com.epam.ta.reportportal.jooq.tables.records.JTestItemResultsRecord; +import com.epam.ta.reportportal.jooq.tables.records.JTicketRecord; +import com.epam.ta.reportportal.jooq.tables.records.JUserCreationBidRecord; +import com.epam.ta.reportportal.jooq.tables.records.JUserPreferenceRecord; +import com.epam.ta.reportportal.jooq.tables.records.JUsersRecord; +import com.epam.ta.reportportal.jooq.tables.records.JWidgetFilterRecord; +import com.epam.ta.reportportal.jooq.tables.records.JWidgetRecord; +import javax.annotation.processing.Generated; import org.jooq.ForeignKey; import org.jooq.Identity; import org.jooq.UniqueKey; import org.jooq.impl.Internal; -import javax.annotation.processing.Generated; - /** - * A class modelling foreign key relationships and constraints of tables of - * the public schema. + * A class modelling foreign key relationships and constraints of tables of the public + * schema. */ @Generated( value = { @@ -25,390 +134,722 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class Keys { - // ------------------------------------------------------------------------- - // IDENTITY definitions - // ------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // IDENTITY definitions + // ------------------------------------------------------------------------- + + public static final Identity IDENTITY_ACL_CLASS = Identities0.IDENTITY_ACL_CLASS; + public static final Identity IDENTITY_ACL_ENTRY = Identities0.IDENTITY_ACL_ENTRY; + public static final Identity IDENTITY_ACL_OBJECT_IDENTITY = Identities0.IDENTITY_ACL_OBJECT_IDENTITY; + public static final Identity IDENTITY_ACL_SID = Identities0.IDENTITY_ACL_SID; + public static final Identity IDENTITY_ACTIVITY = Identities0.IDENTITY_ACTIVITY; + public static final Identity IDENTITY_ATTACHMENT = Identities0.IDENTITY_ATTACHMENT; + public static final Identity IDENTITY_ATTRIBUTE = Identities0.IDENTITY_ATTRIBUTE; + public static final Identity IDENTITY_CLUSTERS = Identities0.IDENTITY_CLUSTERS; + public static final Identity IDENTITY_FILTER_CONDITION = Identities0.IDENTITY_FILTER_CONDITION; + public static final Identity IDENTITY_FILTER_SORT = Identities0.IDENTITY_FILTER_SORT; + public static final Identity IDENTITY_INTEGRATION = Identities0.IDENTITY_INTEGRATION; + public static final Identity IDENTITY_INTEGRATION_TYPE = Identities0.IDENTITY_INTEGRATION_TYPE; + public static final Identity IDENTITY_ISSUE_GROUP = Identities0.IDENTITY_ISSUE_GROUP; + public static final Identity IDENTITY_ISSUE_TYPE = Identities0.IDENTITY_ISSUE_TYPE; + public static final Identity IDENTITY_ITEM_ATTRIBUTE = Identities0.IDENTITY_ITEM_ATTRIBUTE; + public static final Identity IDENTITY_LAUNCH = Identities0.IDENTITY_LAUNCH; + public static final Identity IDENTITY_LAUNCH_ATTRIBUTE_RULES = Identities0.IDENTITY_LAUNCH_ATTRIBUTE_RULES; + public static final Identity IDENTITY_LAUNCH_NUMBER = Identities0.IDENTITY_LAUNCH_NUMBER; + public static final Identity IDENTITY_LOG = Identities0.IDENTITY_LOG; + public static final Identity IDENTITY_OAUTH_ACCESS_TOKEN = Identities0.IDENTITY_OAUTH_ACCESS_TOKEN; + public static final Identity IDENTITY_OAUTH_REGISTRATION_RESTRICTION = Identities0.IDENTITY_OAUTH_REGISTRATION_RESTRICTION; + public static final Identity IDENTITY_OAUTH_REGISTRATION_SCOPE = Identities0.IDENTITY_OAUTH_REGISTRATION_SCOPE; + public static final Identity IDENTITY_ONBOARDING = Identities0.IDENTITY_ONBOARDING; + public static final Identity IDENTITY_PATTERN_TEMPLATE = Identities0.IDENTITY_PATTERN_TEMPLATE; + public static final Identity IDENTITY_PROJECT = Identities0.IDENTITY_PROJECT; + public static final Identity IDENTITY_PROJECT_ATTRIBUTE = Identities0.IDENTITY_PROJECT_ATTRIBUTE; + public static final Identity IDENTITY_SENDER_CASE = Identities0.IDENTITY_SENDER_CASE; + public static final Identity IDENTITY_SERVER_SETTINGS = Identities0.IDENTITY_SERVER_SETTINGS; + public static final Identity IDENTITY_SHAREABLE_ENTITY = Identities0.IDENTITY_SHAREABLE_ENTITY; + public static final Identity IDENTITY_STALE_MATERIALIZED_VIEW = Identities0.IDENTITY_STALE_MATERIALIZED_VIEW; + public static final Identity IDENTITY_STATISTICS = Identities0.IDENTITY_STATISTICS; + public static final Identity IDENTITY_STATISTICS_FIELD = Identities0.IDENTITY_STATISTICS_FIELD; + public static final Identity IDENTITY_TEST_ITEM = Identities0.IDENTITY_TEST_ITEM; + public static final Identity IDENTITY_TICKET = Identities0.IDENTITY_TICKET; + public static final Identity IDENTITY_USER_PREFERENCE = Identities0.IDENTITY_USER_PREFERENCE; + public static final Identity IDENTITY_USERS = Identities0.IDENTITY_USERS; + + // ------------------------------------------------------------------------- + // UNIQUE and PRIMARY KEY definitions + // ------------------------------------------------------------------------- + + public static final UniqueKey ACL_CLASS_PKEY = UniqueKeys0.ACL_CLASS_PKEY; + public static final UniqueKey UNIQUE_UK_2 = UniqueKeys0.UNIQUE_UK_2; + public static final UniqueKey ACL_ENTRY_PKEY = UniqueKeys0.ACL_ENTRY_PKEY; + public static final UniqueKey UNIQUE_UK_4 = UniqueKeys0.UNIQUE_UK_4; + public static final UniqueKey ACL_OBJECT_IDENTITY_PKEY = UniqueKeys0.ACL_OBJECT_IDENTITY_PKEY; + public static final UniqueKey UNIQUE_UK_3 = UniqueKeys0.UNIQUE_UK_3; + public static final UniqueKey ACL_SID_PKEY = UniqueKeys0.ACL_SID_PKEY; + public static final UniqueKey UNIQUE_UK_1 = UniqueKeys0.UNIQUE_UK_1; + public static final UniqueKey ACTIVITY_PK = UniqueKeys0.ACTIVITY_PK; + public static final UniqueKey ATTACHMENT_PK = UniqueKeys0.ATTACHMENT_PK; + public static final UniqueKey ATTACHMENT_DELETION_PKEY = UniqueKeys0.ATTACHMENT_DELETION_PKEY; + public static final UniqueKey ATTRIBUTE_PK = UniqueKeys0.ATTRIBUTE_PK; + public static final UniqueKey CLUSTERS_PK = UniqueKeys0.CLUSTERS_PK; + public static final UniqueKey INDEX_ID_LAUNCH_ID_UNQ = UniqueKeys0.INDEX_ID_LAUNCH_ID_UNQ; + public static final UniqueKey CLUSTER_ITEM_UNQ = UniqueKeys0.CLUSTER_ITEM_UNQ; + public static final UniqueKey DASHBOARD_PKEY = UniqueKeys0.DASHBOARD_PKEY; + public static final UniqueKey DASHBOARD_WIDGET_PK = UniqueKeys0.DASHBOARD_WIDGET_PK; + public static final UniqueKey WIDGET_ON_DASHBOARD_UNQ = UniqueKeys0.WIDGET_ON_DASHBOARD_UNQ; + public static final UniqueKey FILTER_PKEY = UniqueKeys0.FILTER_PKEY; + public static final UniqueKey FILTER_CONDITION_PK = UniqueKeys0.FILTER_CONDITION_PK; + public static final UniqueKey FILTER_SORT_PK = UniqueKeys0.FILTER_SORT_PK; + public static final UniqueKey INTEGRATION_PK = UniqueKeys0.INTEGRATION_PK; + public static final UniqueKey INTEGRATION_TYPE_PK = UniqueKeys0.INTEGRATION_TYPE_PK; + public static final UniqueKey INTEGRATION_TYPE_NAME_KEY = UniqueKeys0.INTEGRATION_TYPE_NAME_KEY; + public static final UniqueKey ISSUE_PK = UniqueKeys0.ISSUE_PK; + public static final UniqueKey ISSUE_GROUP_PK = UniqueKeys0.ISSUE_GROUP_PK; + public static final UniqueKey ISSUE_TICKET_PK = UniqueKeys0.ISSUE_TICKET_PK; + public static final UniqueKey ISSUE_TYPE_PK = UniqueKeys0.ISSUE_TYPE_PK; + public static final UniqueKey ISSUE_TYPE_LOCATOR_KEY = UniqueKeys0.ISSUE_TYPE_LOCATOR_KEY; + public static final UniqueKey ISSUE_TYPE_PROJECT_PK = UniqueKeys0.ISSUE_TYPE_PROJECT_PK; + public static final UniqueKey ITEM_ATTRIBUTE_PK = UniqueKeys0.ITEM_ATTRIBUTE_PK; + public static final UniqueKey LAUNCH_PK = UniqueKeys0.LAUNCH_PK; + public static final UniqueKey LAUNCH_UUID_KEY = UniqueKeys0.LAUNCH_UUID_KEY; + public static final UniqueKey UNQ_NAME_NUMBER = UniqueKeys0.UNQ_NAME_NUMBER; + public static final UniqueKey LAUNCH_ATTRIBUTE_RULES_PK = UniqueKeys0.LAUNCH_ATTRIBUTE_RULES_PK; + public static final UniqueKey LAUNCH_NUMBER_PK = UniqueKeys0.LAUNCH_NUMBER_PK; + public static final UniqueKey UNQ_PROJECT_NAME = UniqueKeys0.UNQ_PROJECT_NAME; + public static final UniqueKey LOG_PK = UniqueKeys0.LOG_PK; + public static final UniqueKey OAUTH_ACCESS_TOKEN_PKEY = UniqueKeys0.OAUTH_ACCESS_TOKEN_PKEY; + public static final UniqueKey USERS_ACCESS_TOKEN_UNIQUE = UniqueKeys0.USERS_ACCESS_TOKEN_UNIQUE; + public static final UniqueKey OAUTH_REGISTRATION_PKEY = UniqueKeys0.OAUTH_REGISTRATION_PKEY; + public static final UniqueKey OAUTH_REGISTRATION_CLIENT_ID_KEY = UniqueKeys0.OAUTH_REGISTRATION_CLIENT_ID_KEY; + public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_PK = UniqueKeys0.OAUTH_REGISTRATION_RESTRICTION_PK; + public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_UNIQUE = UniqueKeys0.OAUTH_REGISTRATION_RESTRICTION_UNIQUE; + public static final UniqueKey OAUTH_REGISTRATION_SCOPE_PK = UniqueKeys0.OAUTH_REGISTRATION_SCOPE_PK; + public static final UniqueKey OAUTH_REGISTRATION_SCOPE_UNIQUE = UniqueKeys0.OAUTH_REGISTRATION_SCOPE_UNIQUE; + public static final UniqueKey ONBOARDING_PK = UniqueKeys0.ONBOARDING_PK; + public static final UniqueKey PATTERN_TEMPLATE_PK = UniqueKeys0.PATTERN_TEMPLATE_PK; + public static final UniqueKey UNQ_NAME_PROJECTID = UniqueKeys0.UNQ_NAME_PROJECTID; + public static final UniqueKey PATTERN_ITEM_UNQ = UniqueKeys0.PATTERN_ITEM_UNQ; + public static final UniqueKey PROJECT_PK = UniqueKeys0.PROJECT_PK; + public static final UniqueKey PROJECT_NAME_KEY = UniqueKeys0.PROJECT_NAME_KEY; + public static final UniqueKey UNIQUE_ATTRIBUTE_PER_PROJECT = UniqueKeys0.UNIQUE_ATTRIBUTE_PER_PROJECT; + public static final UniqueKey USERS_PROJECT_PK = UniqueKeys0.USERS_PROJECT_PK; + public static final UniqueKey RESTORE_PASSWORD_BID_PK = UniqueKeys0.RESTORE_PASSWORD_BID_PK; + public static final UniqueKey RESTORE_PASSWORD_BID_EMAIL_KEY = UniqueKeys0.RESTORE_PASSWORD_BID_EMAIL_KEY; + public static final UniqueKey SENDER_CASE_PK = UniqueKeys0.SENDER_CASE_PK; + public static final UniqueKey SERVER_SETTINGS_ID = UniqueKeys0.SERVER_SETTINGS_ID; + public static final UniqueKey SERVER_SETTINGS_KEY_KEY = UniqueKeys0.SERVER_SETTINGS_KEY_KEY; + public static final UniqueKey SHAREABLE_PK = UniqueKeys0.SHAREABLE_PK; + public static final UniqueKey STALE_MATERIALIZED_VIEW_PKEY = UniqueKeys0.STALE_MATERIALIZED_VIEW_PKEY; + public static final UniqueKey STALE_MATERIALIZED_VIEW_NAME_KEY = UniqueKeys0.STALE_MATERIALIZED_VIEW_NAME_KEY; + public static final UniqueKey STATISTICS_PK = UniqueKeys0.STATISTICS_PK; + public static final UniqueKey UNIQUE_STATS_LAUNCH = UniqueKeys0.UNIQUE_STATS_LAUNCH; + public static final UniqueKey UNIQUE_STATS_ITEM = UniqueKeys0.UNIQUE_STATS_ITEM; + public static final UniqueKey STATISTICS_FIELD_PK = UniqueKeys0.STATISTICS_FIELD_PK; + public static final UniqueKey STATISTICS_FIELD_NAME_KEY = UniqueKeys0.STATISTICS_FIELD_NAME_KEY; + public static final UniqueKey TEST_ITEM_PK = UniqueKeys0.TEST_ITEM_PK; + public static final UniqueKey TEST_ITEM_UUID_KEY = UniqueKeys0.TEST_ITEM_UUID_KEY; + public static final UniqueKey TEST_ITEM_RESULTS_PK = UniqueKeys0.TEST_ITEM_RESULTS_PK; + public static final UniqueKey TICKET_PK = UniqueKeys0.TICKET_PK; + public static final UniqueKey USER_CREATION_BID_PK = UniqueKeys0.USER_CREATION_BID_PK; + public static final UniqueKey USER_PREFERENCE_PK = UniqueKeys0.USER_PREFERENCE_PK; + public static final UniqueKey USER_PREFERENCE_UQ = UniqueKeys0.USER_PREFERENCE_UQ; + public static final UniqueKey USERS_PK = UniqueKeys0.USERS_PK; + public static final UniqueKey USERS_LOGIN_KEY = UniqueKeys0.USERS_LOGIN_KEY; + public static final UniqueKey USERS_EMAIL_KEY = UniqueKeys0.USERS_EMAIL_KEY; + public static final UniqueKey WIDGET_PKEY = UniqueKeys0.WIDGET_PKEY; + public static final UniqueKey WIDGET_FILTER_PK = UniqueKeys0.WIDGET_FILTER_PK; - public static final Identity IDENTITY_ACL_CLASS = Identities0.IDENTITY_ACL_CLASS; - public static final Identity IDENTITY_ACL_ENTRY = Identities0.IDENTITY_ACL_ENTRY; - public static final Identity IDENTITY_ACL_OBJECT_IDENTITY = Identities0.IDENTITY_ACL_OBJECT_IDENTITY; - public static final Identity IDENTITY_ACL_SID = Identities0.IDENTITY_ACL_SID; - public static final Identity IDENTITY_ACTIVITY = Identities0.IDENTITY_ACTIVITY; - public static final Identity IDENTITY_ATTACHMENT = Identities0.IDENTITY_ATTACHMENT; - public static final Identity IDENTITY_ATTRIBUTE = Identities0.IDENTITY_ATTRIBUTE; - public static final Identity IDENTITY_CLUSTERS = Identities0.IDENTITY_CLUSTERS; - public static final Identity IDENTITY_FILTER_CONDITION = Identities0.IDENTITY_FILTER_CONDITION; - public static final Identity IDENTITY_FILTER_SORT = Identities0.IDENTITY_FILTER_SORT; - public static final Identity IDENTITY_INTEGRATION = Identities0.IDENTITY_INTEGRATION; - public static final Identity IDENTITY_INTEGRATION_TYPE = Identities0.IDENTITY_INTEGRATION_TYPE; - public static final Identity IDENTITY_ISSUE_GROUP = Identities0.IDENTITY_ISSUE_GROUP; - public static final Identity IDENTITY_ISSUE_TYPE = Identities0.IDENTITY_ISSUE_TYPE; - public static final Identity IDENTITY_ITEM_ATTRIBUTE = Identities0.IDENTITY_ITEM_ATTRIBUTE; - public static final Identity IDENTITY_LAUNCH = Identities0.IDENTITY_LAUNCH; - public static final Identity IDENTITY_LAUNCH_ATTRIBUTE_RULES = Identities0.IDENTITY_LAUNCH_ATTRIBUTE_RULES; - public static final Identity IDENTITY_LAUNCH_NUMBER = Identities0.IDENTITY_LAUNCH_NUMBER; - public static final Identity IDENTITY_LOG = Identities0.IDENTITY_LOG; - public static final Identity IDENTITY_OAUTH_ACCESS_TOKEN = Identities0.IDENTITY_OAUTH_ACCESS_TOKEN; - public static final Identity IDENTITY_OAUTH_REGISTRATION_RESTRICTION = Identities0.IDENTITY_OAUTH_REGISTRATION_RESTRICTION; - public static final Identity IDENTITY_OAUTH_REGISTRATION_SCOPE = Identities0.IDENTITY_OAUTH_REGISTRATION_SCOPE; - public static final Identity IDENTITY_ONBOARDING = Identities0.IDENTITY_ONBOARDING; - public static final Identity IDENTITY_PATTERN_TEMPLATE = Identities0.IDENTITY_PATTERN_TEMPLATE; - public static final Identity IDENTITY_PROJECT = Identities0.IDENTITY_PROJECT; - public static final Identity IDENTITY_PROJECT_ATTRIBUTE = Identities0.IDENTITY_PROJECT_ATTRIBUTE; - public static final Identity IDENTITY_SENDER_CASE = Identities0.IDENTITY_SENDER_CASE; - public static final Identity IDENTITY_SERVER_SETTINGS = Identities0.IDENTITY_SERVER_SETTINGS; - public static final Identity IDENTITY_SHAREABLE_ENTITY = Identities0.IDENTITY_SHAREABLE_ENTITY; - public static final Identity IDENTITY_STALE_MATERIALIZED_VIEW = Identities0.IDENTITY_STALE_MATERIALIZED_VIEW; - public static final Identity IDENTITY_STATISTICS = Identities0.IDENTITY_STATISTICS; - public static final Identity IDENTITY_STATISTICS_FIELD = Identities0.IDENTITY_STATISTICS_FIELD; - public static final Identity IDENTITY_TEST_ITEM = Identities0.IDENTITY_TEST_ITEM; - public static final Identity IDENTITY_TICKET = Identities0.IDENTITY_TICKET; - public static final Identity IDENTITY_USER_PREFERENCE = Identities0.IDENTITY_USER_PREFERENCE; - public static final Identity IDENTITY_USERS = Identities0.IDENTITY_USERS; + // ------------------------------------------------------------------------- + // FOREIGN KEY definitions + // ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- - // UNIQUE and PRIMARY KEY definitions - // ------------------------------------------------------------------------- + public static final ForeignKey ACL_ENTRY__FOREIGN_FK_4 = ForeignKeys0.ACL_ENTRY__FOREIGN_FK_4; + public static final ForeignKey ACL_ENTRY__FOREIGN_FK_5 = ForeignKeys0.ACL_ENTRY__FOREIGN_FK_5; + public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_2 = ForeignKeys0.ACL_OBJECT_IDENTITY__FOREIGN_FK_2; + public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_1 = ForeignKeys0.ACL_OBJECT_IDENTITY__FOREIGN_FK_1; + public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_3 = ForeignKeys0.ACL_OBJECT_IDENTITY__FOREIGN_FK_3; + public static final ForeignKey ACL_SID__ACL_SID_SID_FKEY = ForeignKeys0.ACL_SID__ACL_SID_SID_FKEY; + public static final ForeignKey ACTIVITY__ACTIVITY_USER_ID_FKEY = ForeignKeys0.ACTIVITY__ACTIVITY_USER_ID_FKEY; + public static final ForeignKey ACTIVITY__ACTIVITY_PROJECT_ID_FKEY = ForeignKeys0.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY; + public static final ForeignKey CONTENT_FIELD__CONTENT_FIELD_ID_FKEY = ForeignKeys0.CONTENT_FIELD__CONTENT_FIELD_ID_FKEY; + public static final ForeignKey DASHBOARD__DASHBOARD_ID_FK = ForeignKeys0.DASHBOARD__DASHBOARD_ID_FK; + public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY = ForeignKeys0.DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY; + public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY = ForeignKeys0.DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY; + public static final ForeignKey FILTER__FILTER_ID_FK = ForeignKeys0.FILTER__FILTER_ID_FK; + public static final ForeignKey FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY = ForeignKeys0.FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY; + public static final ForeignKey FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY = ForeignKeys0.FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY; + public static final ForeignKey INTEGRATION__INTEGRATION_PROJECT_ID_FKEY = ForeignKeys0.INTEGRATION__INTEGRATION_PROJECT_ID_FKEY; + public static final ForeignKey INTEGRATION__INTEGRATION_TYPE_FKEY = ForeignKeys0.INTEGRATION__INTEGRATION_TYPE_FKEY; + public static final ForeignKey ISSUE__ISSUE_ISSUE_ID_FKEY = ForeignKeys0.ISSUE__ISSUE_ISSUE_ID_FKEY; + public static final ForeignKey ISSUE__ISSUE_ISSUE_TYPE_FKEY = ForeignKeys0.ISSUE__ISSUE_ISSUE_TYPE_FKEY; + public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY = ForeignKeys0.ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY; + public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY = ForeignKeys0.ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY; + public static final ForeignKey ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY = ForeignKeys0.ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY; + public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY = ForeignKeys0.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY; + public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY = ForeignKeys0.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY; + public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY = ForeignKeys0.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY; + public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY = ForeignKeys0.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY; + public static final ForeignKey LAUNCH__LAUNCH_PROJECT_ID_FKEY = ForeignKeys0.LAUNCH__LAUNCH_PROJECT_ID_FKEY; + public static final ForeignKey LAUNCH__LAUNCH_USER_ID_FKEY = ForeignKeys0.LAUNCH__LAUNCH_USER_ID_FKEY; + public static final ForeignKey LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY = ForeignKeys0.LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY; + public static final ForeignKey LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY = ForeignKeys0.LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY; + public static final ForeignKey LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY = ForeignKeys0.LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY; + public static final ForeignKey LOG__LOG_ITEM_ID_FKEY = ForeignKeys0.LOG__LOG_ITEM_ID_FKEY; + public static final ForeignKey LOG__LOG_LAUNCH_ID_FKEY = ForeignKeys0.LOG__LOG_LAUNCH_ID_FKEY; + public static final ForeignKey LOG__LOG_ATTACHMENT_ID_FKEY = ForeignKeys0.LOG__LOG_ATTACHMENT_ID_FKEY; + public static final ForeignKey OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY = ForeignKeys0.OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY; + public static final ForeignKey OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY = ForeignKeys0.OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY; + public static final ForeignKey OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY = ForeignKeys0.OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY; + public static final ForeignKey PARAMETER__PARAMETER_ITEM_ID_FKEY = ForeignKeys0.PARAMETER__PARAMETER_ITEM_ID_FKEY; + public static final ForeignKey PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY = ForeignKeys0.PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY; + public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY = ForeignKeys0.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY; + public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY = ForeignKeys0.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY; + public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY = ForeignKeys0.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY; + public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY = ForeignKeys0.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY; + public static final ForeignKey PROJECT_USER__PROJECT_USER_USER_ID_FKEY = ForeignKeys0.PROJECT_USER__PROJECT_USER_USER_ID_FKEY; + public static final ForeignKey PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY = ForeignKeys0.PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY; + public static final ForeignKey RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY = ForeignKeys0.RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY; + public static final ForeignKey SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY = ForeignKeys0.SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY; + public static final ForeignKey SHAREABLE_ENTITY__SHAREABLE_ENTITY_OWNER_FKEY = ForeignKeys0.SHAREABLE_ENTITY__SHAREABLE_ENTITY_OWNER_FKEY; + public static final ForeignKey SHAREABLE_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY = ForeignKeys0.SHAREABLE_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY; + public static final ForeignKey STATISTICS__STATISTICS_LAUNCH_ID_FKEY = ForeignKeys0.STATISTICS__STATISTICS_LAUNCH_ID_FKEY; + public static final ForeignKey STATISTICS__STATISTICS_ITEM_ID_FKEY = ForeignKeys0.STATISTICS__STATISTICS_ITEM_ID_FKEY; + public static final ForeignKey STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY = ForeignKeys0.STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY; + public static final ForeignKey TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY = ForeignKeys0.TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY; + public static final ForeignKey TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY = ForeignKeys0.TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY; + public static final ForeignKey TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY = ForeignKeys0.TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY; + public static final ForeignKey TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY = ForeignKeys0.TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY; + public static final ForeignKey USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY = ForeignKeys0.USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY; + public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY = ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY; + public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY = ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY; + public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY = ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY; + public static final ForeignKey WIDGET__WIDGET_ID_FK = ForeignKeys0.WIDGET__WIDGET_ID_FK; + public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY = ForeignKeys0.WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY; + public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY = ForeignKeys0.WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY; - public static final UniqueKey ACL_CLASS_PKEY = UniqueKeys0.ACL_CLASS_PKEY; - public static final UniqueKey UNIQUE_UK_2 = UniqueKeys0.UNIQUE_UK_2; - public static final UniqueKey ACL_ENTRY_PKEY = UniqueKeys0.ACL_ENTRY_PKEY; - public static final UniqueKey UNIQUE_UK_4 = UniqueKeys0.UNIQUE_UK_4; - public static final UniqueKey ACL_OBJECT_IDENTITY_PKEY = UniqueKeys0.ACL_OBJECT_IDENTITY_PKEY; - public static final UniqueKey UNIQUE_UK_3 = UniqueKeys0.UNIQUE_UK_3; - public static final UniqueKey ACL_SID_PKEY = UniqueKeys0.ACL_SID_PKEY; - public static final UniqueKey UNIQUE_UK_1 = UniqueKeys0.UNIQUE_UK_1; - public static final UniqueKey ACTIVITY_PK = UniqueKeys0.ACTIVITY_PK; - public static final UniqueKey ATTACHMENT_PK = UniqueKeys0.ATTACHMENT_PK; - public static final UniqueKey ATTACHMENT_DELETION_PKEY = UniqueKeys0.ATTACHMENT_DELETION_PKEY; - public static final UniqueKey ATTRIBUTE_PK = UniqueKeys0.ATTRIBUTE_PK; - public static final UniqueKey CLUSTERS_PK = UniqueKeys0.CLUSTERS_PK; - public static final UniqueKey INDEX_ID_LAUNCH_ID_UNQ = UniqueKeys0.INDEX_ID_LAUNCH_ID_UNQ; - public static final UniqueKey CLUSTER_ITEM_UNQ = UniqueKeys0.CLUSTER_ITEM_UNQ; - public static final UniqueKey DASHBOARD_PKEY = UniqueKeys0.DASHBOARD_PKEY; - public static final UniqueKey DASHBOARD_WIDGET_PK = UniqueKeys0.DASHBOARD_WIDGET_PK; - public static final UniqueKey WIDGET_ON_DASHBOARD_UNQ = UniqueKeys0.WIDGET_ON_DASHBOARD_UNQ; - public static final UniqueKey FILTER_PKEY = UniqueKeys0.FILTER_PKEY; - public static final UniqueKey FILTER_CONDITION_PK = UniqueKeys0.FILTER_CONDITION_PK; - public static final UniqueKey FILTER_SORT_PK = UniqueKeys0.FILTER_SORT_PK; - public static final UniqueKey INTEGRATION_PK = UniqueKeys0.INTEGRATION_PK; - public static final UniqueKey INTEGRATION_TYPE_PK = UniqueKeys0.INTEGRATION_TYPE_PK; - public static final UniqueKey INTEGRATION_TYPE_NAME_KEY = UniqueKeys0.INTEGRATION_TYPE_NAME_KEY; - public static final UniqueKey ISSUE_PK = UniqueKeys0.ISSUE_PK; - public static final UniqueKey ISSUE_GROUP_PK = UniqueKeys0.ISSUE_GROUP_PK; - public static final UniqueKey ISSUE_TICKET_PK = UniqueKeys0.ISSUE_TICKET_PK; - public static final UniqueKey ISSUE_TYPE_PK = UniqueKeys0.ISSUE_TYPE_PK; - public static final UniqueKey ISSUE_TYPE_LOCATOR_KEY = UniqueKeys0.ISSUE_TYPE_LOCATOR_KEY; - public static final UniqueKey ISSUE_TYPE_PROJECT_PK = UniqueKeys0.ISSUE_TYPE_PROJECT_PK; - public static final UniqueKey ITEM_ATTRIBUTE_PK = UniqueKeys0.ITEM_ATTRIBUTE_PK; - public static final UniqueKey LAUNCH_PK = UniqueKeys0.LAUNCH_PK; - public static final UniqueKey LAUNCH_UUID_KEY = UniqueKeys0.LAUNCH_UUID_KEY; - public static final UniqueKey UNQ_NAME_NUMBER = UniqueKeys0.UNQ_NAME_NUMBER; - public static final UniqueKey LAUNCH_ATTRIBUTE_RULES_PK = UniqueKeys0.LAUNCH_ATTRIBUTE_RULES_PK; - public static final UniqueKey LAUNCH_NUMBER_PK = UniqueKeys0.LAUNCH_NUMBER_PK; - public static final UniqueKey UNQ_PROJECT_NAME = UniqueKeys0.UNQ_PROJECT_NAME; - public static final UniqueKey LOG_PK = UniqueKeys0.LOG_PK; - public static final UniqueKey OAUTH_ACCESS_TOKEN_PKEY = UniqueKeys0.OAUTH_ACCESS_TOKEN_PKEY; - public static final UniqueKey USERS_ACCESS_TOKEN_UNIQUE = UniqueKeys0.USERS_ACCESS_TOKEN_UNIQUE; - public static final UniqueKey OAUTH_REGISTRATION_PKEY = UniqueKeys0.OAUTH_REGISTRATION_PKEY; - public static final UniqueKey OAUTH_REGISTRATION_CLIENT_ID_KEY = UniqueKeys0.OAUTH_REGISTRATION_CLIENT_ID_KEY; - public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_PK = UniqueKeys0.OAUTH_REGISTRATION_RESTRICTION_PK; - public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_UNIQUE = UniqueKeys0.OAUTH_REGISTRATION_RESTRICTION_UNIQUE; - public static final UniqueKey OAUTH_REGISTRATION_SCOPE_PK = UniqueKeys0.OAUTH_REGISTRATION_SCOPE_PK; - public static final UniqueKey OAUTH_REGISTRATION_SCOPE_UNIQUE = UniqueKeys0.OAUTH_REGISTRATION_SCOPE_UNIQUE; - public static final UniqueKey ONBOARDING_PK = UniqueKeys0.ONBOARDING_PK; - public static final UniqueKey PATTERN_TEMPLATE_PK = UniqueKeys0.PATTERN_TEMPLATE_PK; - public static final UniqueKey UNQ_NAME_PROJECTID = UniqueKeys0.UNQ_NAME_PROJECTID; - public static final UniqueKey PATTERN_ITEM_UNQ = UniqueKeys0.PATTERN_ITEM_UNQ; - public static final UniqueKey PROJECT_PK = UniqueKeys0.PROJECT_PK; - public static final UniqueKey PROJECT_NAME_KEY = UniqueKeys0.PROJECT_NAME_KEY; - public static final UniqueKey UNIQUE_ATTRIBUTE_PER_PROJECT = UniqueKeys0.UNIQUE_ATTRIBUTE_PER_PROJECT; - public static final UniqueKey USERS_PROJECT_PK = UniqueKeys0.USERS_PROJECT_PK; - public static final UniqueKey RESTORE_PASSWORD_BID_PK = UniqueKeys0.RESTORE_PASSWORD_BID_PK; - public static final UniqueKey RESTORE_PASSWORD_BID_EMAIL_KEY = UniqueKeys0.RESTORE_PASSWORD_BID_EMAIL_KEY; - public static final UniqueKey SENDER_CASE_PK = UniqueKeys0.SENDER_CASE_PK; - public static final UniqueKey SERVER_SETTINGS_ID = UniqueKeys0.SERVER_SETTINGS_ID; - public static final UniqueKey SERVER_SETTINGS_KEY_KEY = UniqueKeys0.SERVER_SETTINGS_KEY_KEY; - public static final UniqueKey SHAREABLE_PK = UniqueKeys0.SHAREABLE_PK; - public static final UniqueKey STALE_MATERIALIZED_VIEW_PKEY = UniqueKeys0.STALE_MATERIALIZED_VIEW_PKEY; - public static final UniqueKey STALE_MATERIALIZED_VIEW_NAME_KEY = UniqueKeys0.STALE_MATERIALIZED_VIEW_NAME_KEY; - public static final UniqueKey STATISTICS_PK = UniqueKeys0.STATISTICS_PK; - public static final UniqueKey UNIQUE_STATS_LAUNCH = UniqueKeys0.UNIQUE_STATS_LAUNCH; - public static final UniqueKey UNIQUE_STATS_ITEM = UniqueKeys0.UNIQUE_STATS_ITEM; - public static final UniqueKey STATISTICS_FIELD_PK = UniqueKeys0.STATISTICS_FIELD_PK; - public static final UniqueKey STATISTICS_FIELD_NAME_KEY = UniqueKeys0.STATISTICS_FIELD_NAME_KEY; - public static final UniqueKey TEST_ITEM_PK = UniqueKeys0.TEST_ITEM_PK; - public static final UniqueKey TEST_ITEM_UUID_KEY = UniqueKeys0.TEST_ITEM_UUID_KEY; - public static final UniqueKey TEST_ITEM_RESULTS_PK = UniqueKeys0.TEST_ITEM_RESULTS_PK; - public static final UniqueKey TICKET_PK = UniqueKeys0.TICKET_PK; - public static final UniqueKey USER_CREATION_BID_PK = UniqueKeys0.USER_CREATION_BID_PK; - public static final UniqueKey USER_PREFERENCE_PK = UniqueKeys0.USER_PREFERENCE_PK; - public static final UniqueKey USER_PREFERENCE_UQ = UniqueKeys0.USER_PREFERENCE_UQ; - public static final UniqueKey USERS_PK = UniqueKeys0.USERS_PK; - public static final UniqueKey USERS_LOGIN_KEY = UniqueKeys0.USERS_LOGIN_KEY; - public static final UniqueKey USERS_EMAIL_KEY = UniqueKeys0.USERS_EMAIL_KEY; - public static final UniqueKey WIDGET_PKEY = UniqueKeys0.WIDGET_PKEY; - public static final UniqueKey WIDGET_FILTER_PK = UniqueKeys0.WIDGET_FILTER_PK; + // ------------------------------------------------------------------------- + // [#1459] distribute members to avoid static initialisers > 64kb + // ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- - // FOREIGN KEY definitions - // ------------------------------------------------------------------------- + private static class Identities0 { - public static final ForeignKey ACL_ENTRY__FOREIGN_FK_4 = ForeignKeys0.ACL_ENTRY__FOREIGN_FK_4; - public static final ForeignKey ACL_ENTRY__FOREIGN_FK_5 = ForeignKeys0.ACL_ENTRY__FOREIGN_FK_5; - public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_2 = ForeignKeys0.ACL_OBJECT_IDENTITY__FOREIGN_FK_2; - public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_1 = ForeignKeys0.ACL_OBJECT_IDENTITY__FOREIGN_FK_1; - public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_3 = ForeignKeys0.ACL_OBJECT_IDENTITY__FOREIGN_FK_3; - public static final ForeignKey ACL_SID__ACL_SID_SID_FKEY = ForeignKeys0.ACL_SID__ACL_SID_SID_FKEY; - public static final ForeignKey ACTIVITY__ACTIVITY_USER_ID_FKEY = ForeignKeys0.ACTIVITY__ACTIVITY_USER_ID_FKEY; - public static final ForeignKey ACTIVITY__ACTIVITY_PROJECT_ID_FKEY = ForeignKeys0.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY; - public static final ForeignKey CONTENT_FIELD__CONTENT_FIELD_ID_FKEY = ForeignKeys0.CONTENT_FIELD__CONTENT_FIELD_ID_FKEY; - public static final ForeignKey DASHBOARD__DASHBOARD_ID_FK = ForeignKeys0.DASHBOARD__DASHBOARD_ID_FK; - public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY = ForeignKeys0.DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY; - public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY = ForeignKeys0.DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY; - public static final ForeignKey FILTER__FILTER_ID_FK = ForeignKeys0.FILTER__FILTER_ID_FK; - public static final ForeignKey FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY = ForeignKeys0.FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY; - public static final ForeignKey FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY = ForeignKeys0.FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY; - public static final ForeignKey INTEGRATION__INTEGRATION_PROJECT_ID_FKEY = ForeignKeys0.INTEGRATION__INTEGRATION_PROJECT_ID_FKEY; - public static final ForeignKey INTEGRATION__INTEGRATION_TYPE_FKEY = ForeignKeys0.INTEGRATION__INTEGRATION_TYPE_FKEY; - public static final ForeignKey ISSUE__ISSUE_ISSUE_ID_FKEY = ForeignKeys0.ISSUE__ISSUE_ISSUE_ID_FKEY; - public static final ForeignKey ISSUE__ISSUE_ISSUE_TYPE_FKEY = ForeignKeys0.ISSUE__ISSUE_ISSUE_TYPE_FKEY; - public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY = ForeignKeys0.ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY; - public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY = ForeignKeys0.ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY; - public static final ForeignKey ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY = ForeignKeys0.ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY; - public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY = ForeignKeys0.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY; - public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY = ForeignKeys0.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY; - public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY = ForeignKeys0.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY; - public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY = ForeignKeys0.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY; - public static final ForeignKey LAUNCH__LAUNCH_PROJECT_ID_FKEY = ForeignKeys0.LAUNCH__LAUNCH_PROJECT_ID_FKEY; - public static final ForeignKey LAUNCH__LAUNCH_USER_ID_FKEY = ForeignKeys0.LAUNCH__LAUNCH_USER_ID_FKEY; - public static final ForeignKey LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY = ForeignKeys0.LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY; - public static final ForeignKey LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY = ForeignKeys0.LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY; - public static final ForeignKey LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY = ForeignKeys0.LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY; - public static final ForeignKey LOG__LOG_ITEM_ID_FKEY = ForeignKeys0.LOG__LOG_ITEM_ID_FKEY; - public static final ForeignKey LOG__LOG_LAUNCH_ID_FKEY = ForeignKeys0.LOG__LOG_LAUNCH_ID_FKEY; - public static final ForeignKey LOG__LOG_ATTACHMENT_ID_FKEY = ForeignKeys0.LOG__LOG_ATTACHMENT_ID_FKEY; - public static final ForeignKey OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY = ForeignKeys0.OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY; - public static final ForeignKey OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY = ForeignKeys0.OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY; - public static final ForeignKey OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY = ForeignKeys0.OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY; - public static final ForeignKey PARAMETER__PARAMETER_ITEM_ID_FKEY = ForeignKeys0.PARAMETER__PARAMETER_ITEM_ID_FKEY; - public static final ForeignKey PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY = ForeignKeys0.PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY; - public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY = ForeignKeys0.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY; - public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY = ForeignKeys0.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY; - public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY = ForeignKeys0.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY; - public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY = ForeignKeys0.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY; - public static final ForeignKey PROJECT_USER__PROJECT_USER_USER_ID_FKEY = ForeignKeys0.PROJECT_USER__PROJECT_USER_USER_ID_FKEY; - public static final ForeignKey PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY = ForeignKeys0.PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY; - public static final ForeignKey RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY = ForeignKeys0.RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY; - public static final ForeignKey SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY = ForeignKeys0.SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY; - public static final ForeignKey SHAREABLE_ENTITY__SHAREABLE_ENTITY_OWNER_FKEY = ForeignKeys0.SHAREABLE_ENTITY__SHAREABLE_ENTITY_OWNER_FKEY; - public static final ForeignKey SHAREABLE_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY = ForeignKeys0.SHAREABLE_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY; - public static final ForeignKey STATISTICS__STATISTICS_LAUNCH_ID_FKEY = ForeignKeys0.STATISTICS__STATISTICS_LAUNCH_ID_FKEY; - public static final ForeignKey STATISTICS__STATISTICS_ITEM_ID_FKEY = ForeignKeys0.STATISTICS__STATISTICS_ITEM_ID_FKEY; - public static final ForeignKey STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY = ForeignKeys0.STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY; - public static final ForeignKey TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY = ForeignKeys0.TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY; - public static final ForeignKey TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY = ForeignKeys0.TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY; - public static final ForeignKey TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY = ForeignKeys0.TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY; - public static final ForeignKey TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY = ForeignKeys0.TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY; - public static final ForeignKey USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY = ForeignKeys0.USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY; - public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY = ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY; - public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY = ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY; - public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY = ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY; - public static final ForeignKey WIDGET__WIDGET_ID_FK = ForeignKeys0.WIDGET__WIDGET_ID_FK; - public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY = ForeignKeys0.WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY; - public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY = ForeignKeys0.WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY; + public static Identity IDENTITY_ACL_CLASS = Internal.createIdentity( + JAclClass.ACL_CLASS, JAclClass.ACL_CLASS.ID); + public static Identity IDENTITY_ACL_ENTRY = Internal.createIdentity( + JAclEntry.ACL_ENTRY, JAclEntry.ACL_ENTRY.ID); + public static Identity IDENTITY_ACL_OBJECT_IDENTITY = Internal.createIdentity( + JAclObjectIdentity.ACL_OBJECT_IDENTITY, JAclObjectIdentity.ACL_OBJECT_IDENTITY.ID); + public static Identity IDENTITY_ACL_SID = Internal.createIdentity( + JAclSid.ACL_SID, JAclSid.ACL_SID.ID); + public static Identity IDENTITY_ACTIVITY = Internal.createIdentity( + JActivity.ACTIVITY, JActivity.ACTIVITY.ID); + public static Identity IDENTITY_ATTACHMENT = Internal.createIdentity( + JAttachment.ATTACHMENT, JAttachment.ATTACHMENT.ID); + public static Identity IDENTITY_ATTRIBUTE = Internal.createIdentity( + JAttribute.ATTRIBUTE, JAttribute.ATTRIBUTE.ID); + public static Identity IDENTITY_CLUSTERS = Internal.createIdentity( + JClusters.CLUSTERS, JClusters.CLUSTERS.ID); + public static Identity IDENTITY_FILTER_CONDITION = Internal.createIdentity( + JFilterCondition.FILTER_CONDITION, JFilterCondition.FILTER_CONDITION.ID); + public static Identity IDENTITY_FILTER_SORT = Internal.createIdentity( + JFilterSort.FILTER_SORT, JFilterSort.FILTER_SORT.ID); + public static Identity IDENTITY_INTEGRATION = Internal.createIdentity( + JIntegration.INTEGRATION, JIntegration.INTEGRATION.ID); + public static Identity IDENTITY_INTEGRATION_TYPE = Internal.createIdentity( + JIntegrationType.INTEGRATION_TYPE, JIntegrationType.INTEGRATION_TYPE.ID); + public static Identity IDENTITY_ISSUE_GROUP = Internal.createIdentity( + JIssueGroup.ISSUE_GROUP, JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID); + public static Identity IDENTITY_ISSUE_TYPE = Internal.createIdentity( + JIssueType.ISSUE_TYPE, JIssueType.ISSUE_TYPE.ID); + public static Identity IDENTITY_ITEM_ATTRIBUTE = Internal.createIdentity( + JItemAttribute.ITEM_ATTRIBUTE, JItemAttribute.ITEM_ATTRIBUTE.ID); + public static Identity IDENTITY_LAUNCH = Internal.createIdentity( + JLaunch.LAUNCH, JLaunch.LAUNCH.ID); + public static Identity IDENTITY_LAUNCH_ATTRIBUTE_RULES = Internal.createIdentity( + JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, + JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID); + public static Identity IDENTITY_LAUNCH_NUMBER = Internal.createIdentity( + JLaunchNumber.LAUNCH_NUMBER, JLaunchNumber.LAUNCH_NUMBER.ID); + public static Identity IDENTITY_LOG = Internal.createIdentity(JLog.LOG, + JLog.LOG.ID); + public static Identity IDENTITY_OAUTH_ACCESS_TOKEN = Internal.createIdentity( + JOauthAccessToken.OAUTH_ACCESS_TOKEN, JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID); + public static Identity IDENTITY_OAUTH_REGISTRATION_RESTRICTION = Internal.createIdentity( + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID); + public static Identity IDENTITY_OAUTH_REGISTRATION_SCOPE = Internal.createIdentity( + JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, + JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID); + public static Identity IDENTITY_ONBOARDING = Internal.createIdentity( + JOnboarding.ONBOARDING, JOnboarding.ONBOARDING.ID); + public static Identity IDENTITY_PATTERN_TEMPLATE = Internal.createIdentity( + JPatternTemplate.PATTERN_TEMPLATE, JPatternTemplate.PATTERN_TEMPLATE.ID); + public static Identity IDENTITY_PROJECT = Internal.createIdentity( + JProject.PROJECT, JProject.PROJECT.ID); + public static Identity IDENTITY_PROJECT_ATTRIBUTE = Internal.createIdentity( + JProjectAttribute.PROJECT_ATTRIBUTE, JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID); + public static Identity IDENTITY_SENDER_CASE = Internal.createIdentity( + JSenderCase.SENDER_CASE, JSenderCase.SENDER_CASE.ID); + public static Identity IDENTITY_SERVER_SETTINGS = Internal.createIdentity( + JServerSettings.SERVER_SETTINGS, JServerSettings.SERVER_SETTINGS.ID); + public static Identity IDENTITY_SHAREABLE_ENTITY = Internal.createIdentity( + JShareableEntity.SHAREABLE_ENTITY, JShareableEntity.SHAREABLE_ENTITY.ID); + public static Identity IDENTITY_STALE_MATERIALIZED_VIEW = Internal.createIdentity( + JStaleMaterializedView.STALE_MATERIALIZED_VIEW, + JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID); + public static Identity IDENTITY_STATISTICS = Internal.createIdentity( + JStatistics.STATISTICS, JStatistics.STATISTICS.S_ID); + public static Identity IDENTITY_STATISTICS_FIELD = Internal.createIdentity( + JStatisticsField.STATISTICS_FIELD, JStatisticsField.STATISTICS_FIELD.SF_ID); + public static Identity IDENTITY_TEST_ITEM = Internal.createIdentity( + JTestItem.TEST_ITEM, JTestItem.TEST_ITEM.ITEM_ID); + public static Identity IDENTITY_TICKET = Internal.createIdentity( + JTicket.TICKET, JTicket.TICKET.ID); + public static Identity IDENTITY_USER_PREFERENCE = Internal.createIdentity( + JUserPreference.USER_PREFERENCE, JUserPreference.USER_PREFERENCE.ID); + public static Identity IDENTITY_USERS = Internal.createIdentity( + JUsers.USERS, JUsers.USERS.ID); + } - // ------------------------------------------------------------------------- - // [#1459] distribute members to avoid static initialisers > 64kb - // ------------------------------------------------------------------------- + private static class UniqueKeys0 { - private static class Identities0 { - public static Identity IDENTITY_ACL_CLASS = Internal.createIdentity(JAclClass.ACL_CLASS, JAclClass.ACL_CLASS.ID); - public static Identity IDENTITY_ACL_ENTRY = Internal.createIdentity(JAclEntry.ACL_ENTRY, JAclEntry.ACL_ENTRY.ID); - public static Identity IDENTITY_ACL_OBJECT_IDENTITY = Internal.createIdentity(JAclObjectIdentity.ACL_OBJECT_IDENTITY, JAclObjectIdentity.ACL_OBJECT_IDENTITY.ID); - public static Identity IDENTITY_ACL_SID = Internal.createIdentity(JAclSid.ACL_SID, JAclSid.ACL_SID.ID); - public static Identity IDENTITY_ACTIVITY = Internal.createIdentity(JActivity.ACTIVITY, JActivity.ACTIVITY.ID); - public static Identity IDENTITY_ATTACHMENT = Internal.createIdentity(JAttachment.ATTACHMENT, JAttachment.ATTACHMENT.ID); - public static Identity IDENTITY_ATTRIBUTE = Internal.createIdentity(JAttribute.ATTRIBUTE, JAttribute.ATTRIBUTE.ID); - public static Identity IDENTITY_CLUSTERS = Internal.createIdentity(JClusters.CLUSTERS, JClusters.CLUSTERS.ID); - public static Identity IDENTITY_FILTER_CONDITION = Internal.createIdentity(JFilterCondition.FILTER_CONDITION, JFilterCondition.FILTER_CONDITION.ID); - public static Identity IDENTITY_FILTER_SORT = Internal.createIdentity(JFilterSort.FILTER_SORT, JFilterSort.FILTER_SORT.ID); - public static Identity IDENTITY_INTEGRATION = Internal.createIdentity(JIntegration.INTEGRATION, JIntegration.INTEGRATION.ID); - public static Identity IDENTITY_INTEGRATION_TYPE = Internal.createIdentity(JIntegrationType.INTEGRATION_TYPE, JIntegrationType.INTEGRATION_TYPE.ID); - public static Identity IDENTITY_ISSUE_GROUP = Internal.createIdentity(JIssueGroup.ISSUE_GROUP, JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID); - public static Identity IDENTITY_ISSUE_TYPE = Internal.createIdentity(JIssueType.ISSUE_TYPE, JIssueType.ISSUE_TYPE.ID); - public static Identity IDENTITY_ITEM_ATTRIBUTE = Internal.createIdentity(JItemAttribute.ITEM_ATTRIBUTE, JItemAttribute.ITEM_ATTRIBUTE.ID); - public static Identity IDENTITY_LAUNCH = Internal.createIdentity(JLaunch.LAUNCH, JLaunch.LAUNCH.ID); - public static Identity IDENTITY_LAUNCH_ATTRIBUTE_RULES = Internal.createIdentity(JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID); - public static Identity IDENTITY_LAUNCH_NUMBER = Internal.createIdentity(JLaunchNumber.LAUNCH_NUMBER, JLaunchNumber.LAUNCH_NUMBER.ID); - public static Identity IDENTITY_LOG = Internal.createIdentity(JLog.LOG, JLog.LOG.ID); - public static Identity IDENTITY_OAUTH_ACCESS_TOKEN = Internal.createIdentity(JOauthAccessToken.OAUTH_ACCESS_TOKEN, JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID); - public static Identity IDENTITY_OAUTH_REGISTRATION_RESTRICTION = Internal.createIdentity(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID); - public static Identity IDENTITY_OAUTH_REGISTRATION_SCOPE = Internal.createIdentity(JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID); - public static Identity IDENTITY_ONBOARDING = Internal.createIdentity(JOnboarding.ONBOARDING, JOnboarding.ONBOARDING.ID); - public static Identity IDENTITY_PATTERN_TEMPLATE = Internal.createIdentity(JPatternTemplate.PATTERN_TEMPLATE, JPatternTemplate.PATTERN_TEMPLATE.ID); - public static Identity IDENTITY_PROJECT = Internal.createIdentity(JProject.PROJECT, JProject.PROJECT.ID); - public static Identity IDENTITY_PROJECT_ATTRIBUTE = Internal.createIdentity(JProjectAttribute.PROJECT_ATTRIBUTE, JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID); - public static Identity IDENTITY_SENDER_CASE = Internal.createIdentity(JSenderCase.SENDER_CASE, JSenderCase.SENDER_CASE.ID); - public static Identity IDENTITY_SERVER_SETTINGS = Internal.createIdentity(JServerSettings.SERVER_SETTINGS, JServerSettings.SERVER_SETTINGS.ID); - public static Identity IDENTITY_SHAREABLE_ENTITY = Internal.createIdentity(JShareableEntity.SHAREABLE_ENTITY, JShareableEntity.SHAREABLE_ENTITY.ID); - public static Identity IDENTITY_STALE_MATERIALIZED_VIEW = Internal.createIdentity(JStaleMaterializedView.STALE_MATERIALIZED_VIEW, JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID); - public static Identity IDENTITY_STATISTICS = Internal.createIdentity(JStatistics.STATISTICS, JStatistics.STATISTICS.S_ID); - public static Identity IDENTITY_STATISTICS_FIELD = Internal.createIdentity(JStatisticsField.STATISTICS_FIELD, JStatisticsField.STATISTICS_FIELD.SF_ID); - public static Identity IDENTITY_TEST_ITEM = Internal.createIdentity(JTestItem.TEST_ITEM, JTestItem.TEST_ITEM.ITEM_ID); - public static Identity IDENTITY_TICKET = Internal.createIdentity(JTicket.TICKET, JTicket.TICKET.ID); - public static Identity IDENTITY_USER_PREFERENCE = Internal.createIdentity(JUserPreference.USER_PREFERENCE, JUserPreference.USER_PREFERENCE.ID); - public static Identity IDENTITY_USERS = Internal.createIdentity(JUsers.USERS, JUsers.USERS.ID); - } + public static final UniqueKey ACL_CLASS_PKEY = Internal.createUniqueKey( + JAclClass.ACL_CLASS, "acl_class_pkey", JAclClass.ACL_CLASS.ID); + public static final UniqueKey UNIQUE_UK_2 = Internal.createUniqueKey( + JAclClass.ACL_CLASS, "unique_uk_2", JAclClass.ACL_CLASS.CLASS); + public static final UniqueKey ACL_ENTRY_PKEY = Internal.createUniqueKey( + JAclEntry.ACL_ENTRY, "acl_entry_pkey", JAclEntry.ACL_ENTRY.ID); + public static final UniqueKey UNIQUE_UK_4 = Internal.createUniqueKey( + JAclEntry.ACL_ENTRY, "unique_uk_4", JAclEntry.ACL_ENTRY.ACL_OBJECT_IDENTITY, + JAclEntry.ACL_ENTRY.ACE_ORDER); + public static final UniqueKey ACL_OBJECT_IDENTITY_PKEY = Internal.createUniqueKey( + JAclObjectIdentity.ACL_OBJECT_IDENTITY, "acl_object_identity_pkey", + JAclObjectIdentity.ACL_OBJECT_IDENTITY.ID); + public static final UniqueKey UNIQUE_UK_3 = Internal.createUniqueKey( + JAclObjectIdentity.ACL_OBJECT_IDENTITY, "unique_uk_3", + JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS, + JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY); + public static final UniqueKey ACL_SID_PKEY = Internal.createUniqueKey( + JAclSid.ACL_SID, "acl_sid_pkey", JAclSid.ACL_SID.ID); + public static final UniqueKey UNIQUE_UK_1 = Internal.createUniqueKey( + JAclSid.ACL_SID, "unique_uk_1", JAclSid.ACL_SID.SID, JAclSid.ACL_SID.PRINCIPAL); + public static final UniqueKey ACTIVITY_PK = Internal.createUniqueKey( + JActivity.ACTIVITY, "activity_pk", JActivity.ACTIVITY.ID); + public static final UniqueKey ATTACHMENT_PK = Internal.createUniqueKey( + JAttachment.ATTACHMENT, "attachment_pk", JAttachment.ATTACHMENT.ID); + public static final UniqueKey ATTACHMENT_DELETION_PKEY = Internal.createUniqueKey( + JAttachmentDeletion.ATTACHMENT_DELETION, "attachment_deletion_pkey", + JAttachmentDeletion.ATTACHMENT_DELETION.ID); + public static final UniqueKey ATTRIBUTE_PK = Internal.createUniqueKey( + JAttribute.ATTRIBUTE, "attribute_pk", JAttribute.ATTRIBUTE.ID); + public static final UniqueKey CLUSTERS_PK = Internal.createUniqueKey( + JClusters.CLUSTERS, "clusters_pk", JClusters.CLUSTERS.ID); + public static final UniqueKey INDEX_ID_LAUNCH_ID_UNQ = Internal.createUniqueKey( + JClusters.CLUSTERS, "index_id_launch_id_unq", JClusters.CLUSTERS.INDEX_ID, + JClusters.CLUSTERS.LAUNCH_ID); + public static final UniqueKey CLUSTER_ITEM_UNQ = Internal.createUniqueKey( + JClustersTestItem.CLUSTERS_TEST_ITEM, "cluster_item_unq", + JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID, + JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID); + public static final UniqueKey DASHBOARD_PKEY = Internal.createUniqueKey( + JDashboard.DASHBOARD, "dashboard_pkey", JDashboard.DASHBOARD.ID); + public static final UniqueKey DASHBOARD_WIDGET_PK = Internal.createUniqueKey( + JDashboardWidget.DASHBOARD_WIDGET, "dashboard_widget_pk", + JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, + JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID); + public static final UniqueKey WIDGET_ON_DASHBOARD_UNQ = Internal.createUniqueKey( + JDashboardWidget.DASHBOARD_WIDGET, "widget_on_dashboard_unq", + JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, + JDashboardWidget.DASHBOARD_WIDGET.WIDGET_NAME, + JDashboardWidget.DASHBOARD_WIDGET.WIDGET_OWNER); + public static final UniqueKey FILTER_PKEY = Internal.createUniqueKey( + JFilter.FILTER, "filter_pkey", JFilter.FILTER.ID); + public static final UniqueKey FILTER_CONDITION_PK = Internal.createUniqueKey( + JFilterCondition.FILTER_CONDITION, "filter_condition_pk", + JFilterCondition.FILTER_CONDITION.ID); + public static final UniqueKey FILTER_SORT_PK = Internal.createUniqueKey( + JFilterSort.FILTER_SORT, "filter_sort_pk", JFilterSort.FILTER_SORT.ID); + public static final UniqueKey INTEGRATION_PK = Internal.createUniqueKey( + JIntegration.INTEGRATION, "integration_pk", JIntegration.INTEGRATION.ID); + public static final UniqueKey INTEGRATION_TYPE_PK = Internal.createUniqueKey( + JIntegrationType.INTEGRATION_TYPE, "integration_type_pk", + JIntegrationType.INTEGRATION_TYPE.ID); + public static final UniqueKey INTEGRATION_TYPE_NAME_KEY = Internal.createUniqueKey( + JIntegrationType.INTEGRATION_TYPE, "integration_type_name_key", + JIntegrationType.INTEGRATION_TYPE.NAME); + public static final UniqueKey ISSUE_PK = Internal.createUniqueKey(JIssue.ISSUE, + "issue_pk", JIssue.ISSUE.ISSUE_ID); + public static final UniqueKey ISSUE_GROUP_PK = Internal.createUniqueKey( + JIssueGroup.ISSUE_GROUP, "issue_group_pk", JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID); + public static final UniqueKey ISSUE_TICKET_PK = Internal.createUniqueKey( + JIssueTicket.ISSUE_TICKET, "issue_ticket_pk", JIssueTicket.ISSUE_TICKET.ISSUE_ID, + JIssueTicket.ISSUE_TICKET.TICKET_ID); + public static final UniqueKey ISSUE_TYPE_PK = Internal.createUniqueKey( + JIssueType.ISSUE_TYPE, "issue_type_pk", JIssueType.ISSUE_TYPE.ID); + public static final UniqueKey ISSUE_TYPE_LOCATOR_KEY = Internal.createUniqueKey( + JIssueType.ISSUE_TYPE, "issue_type_locator_key", JIssueType.ISSUE_TYPE.LOCATOR); + public static final UniqueKey ISSUE_TYPE_PROJECT_PK = Internal.createUniqueKey( + JIssueTypeProject.ISSUE_TYPE_PROJECT, "issue_type_project_pk", + JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID, + JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID); + public static final UniqueKey ITEM_ATTRIBUTE_PK = Internal.createUniqueKey( + JItemAttribute.ITEM_ATTRIBUTE, "item_attribute_pk", JItemAttribute.ITEM_ATTRIBUTE.ID); + public static final UniqueKey LAUNCH_PK = Internal.createUniqueKey( + JLaunch.LAUNCH, "launch_pk", JLaunch.LAUNCH.ID); + public static final UniqueKey LAUNCH_UUID_KEY = Internal.createUniqueKey( + JLaunch.LAUNCH, "launch_uuid_key", JLaunch.LAUNCH.UUID); + public static final UniqueKey UNQ_NAME_NUMBER = Internal.createUniqueKey( + JLaunch.LAUNCH, "unq_name_number", JLaunch.LAUNCH.NAME, JLaunch.LAUNCH.NUMBER, + JLaunch.LAUNCH.PROJECT_ID); + public static final UniqueKey LAUNCH_ATTRIBUTE_RULES_PK = Internal.createUniqueKey( + JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, "launch_attribute_rules_pk", + JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID); + public static final UniqueKey LAUNCH_NUMBER_PK = Internal.createUniqueKey( + JLaunchNumber.LAUNCH_NUMBER, "launch_number_pk", JLaunchNumber.LAUNCH_NUMBER.ID); + public static final UniqueKey UNQ_PROJECT_NAME = Internal.createUniqueKey( + JLaunchNumber.LAUNCH_NUMBER, "unq_project_name", JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID, + JLaunchNumber.LAUNCH_NUMBER.LAUNCH_NAME); + public static final UniqueKey LOG_PK = Internal.createUniqueKey(JLog.LOG, "log_pk", + JLog.LOG.ID); + public static final UniqueKey OAUTH_ACCESS_TOKEN_PKEY = Internal.createUniqueKey( + JOauthAccessToken.OAUTH_ACCESS_TOKEN, "oauth_access_token_pkey", + JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID); + public static final UniqueKey USERS_ACCESS_TOKEN_UNIQUE = Internal.createUniqueKey( + JOauthAccessToken.OAUTH_ACCESS_TOKEN, "users_access_token_unique", + JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN_ID, + JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID); + public static final UniqueKey OAUTH_REGISTRATION_PKEY = Internal.createUniqueKey( + JOauthRegistration.OAUTH_REGISTRATION, "oauth_registration_pkey", + JOauthRegistration.OAUTH_REGISTRATION.ID); + public static final UniqueKey OAUTH_REGISTRATION_CLIENT_ID_KEY = Internal.createUniqueKey( + JOauthRegistration.OAUTH_REGISTRATION, "oauth_registration_client_id_key", + JOauthRegistration.OAUTH_REGISTRATION.CLIENT_ID); + public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_PK = Internal.createUniqueKey( + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, + "oauth_registration_restriction_pk", + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID); + public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_UNIQUE = Internal.createUniqueKey( + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, + "oauth_registration_restriction_unique", + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.TYPE, + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.VALUE, + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK); + public static final UniqueKey OAUTH_REGISTRATION_SCOPE_PK = Internal.createUniqueKey( + JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, "oauth_registration_scope_pk", + JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID); + public static final UniqueKey OAUTH_REGISTRATION_SCOPE_UNIQUE = Internal.createUniqueKey( + JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, "oauth_registration_scope_unique", + JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.SCOPE, + JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK); + public static final UniqueKey ONBOARDING_PK = Internal.createUniqueKey( + JOnboarding.ONBOARDING, "onboarding_pk", JOnboarding.ONBOARDING.ID); + public static final UniqueKey PATTERN_TEMPLATE_PK = Internal.createUniqueKey( + JPatternTemplate.PATTERN_TEMPLATE, "pattern_template_pk", + JPatternTemplate.PATTERN_TEMPLATE.ID); + public static final UniqueKey UNQ_NAME_PROJECTID = Internal.createUniqueKey( + JPatternTemplate.PATTERN_TEMPLATE, "unq_name_projectid", + JPatternTemplate.PATTERN_TEMPLATE.NAME, JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID); + public static final UniqueKey PATTERN_ITEM_UNQ = Internal.createUniqueKey( + JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, "pattern_item_unq", + JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID, + JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID); + public static final UniqueKey PROJECT_PK = Internal.createUniqueKey( + JProject.PROJECT, "project_pk", JProject.PROJECT.ID); + public static final UniqueKey PROJECT_NAME_KEY = Internal.createUniqueKey( + JProject.PROJECT, "project_name_key", JProject.PROJECT.NAME); + public static final UniqueKey UNIQUE_ATTRIBUTE_PER_PROJECT = Internal.createUniqueKey( + JProjectAttribute.PROJECT_ATTRIBUTE, "unique_attribute_per_project", + JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID, + JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID); + public static final UniqueKey USERS_PROJECT_PK = Internal.createUniqueKey( + JProjectUser.PROJECT_USER, "users_project_pk", JProjectUser.PROJECT_USER.USER_ID, + JProjectUser.PROJECT_USER.PROJECT_ID); + public static final UniqueKey RESTORE_PASSWORD_BID_PK = Internal.createUniqueKey( + JRestorePasswordBid.RESTORE_PASSWORD_BID, "restore_password_bid_pk", + JRestorePasswordBid.RESTORE_PASSWORD_BID.UUID); + public static final UniqueKey RESTORE_PASSWORD_BID_EMAIL_KEY = Internal.createUniqueKey( + JRestorePasswordBid.RESTORE_PASSWORD_BID, "restore_password_bid_email_key", + JRestorePasswordBid.RESTORE_PASSWORD_BID.EMAIL); + public static final UniqueKey SENDER_CASE_PK = Internal.createUniqueKey( + JSenderCase.SENDER_CASE, "sender_case_pk", JSenderCase.SENDER_CASE.ID); + public static final UniqueKey SERVER_SETTINGS_ID = Internal.createUniqueKey( + JServerSettings.SERVER_SETTINGS, "server_settings_id", JServerSettings.SERVER_SETTINGS.ID); + public static final UniqueKey SERVER_SETTINGS_KEY_KEY = Internal.createUniqueKey( + JServerSettings.SERVER_SETTINGS, "server_settings_key_key", + JServerSettings.SERVER_SETTINGS.KEY); + public static final UniqueKey SHAREABLE_PK = Internal.createUniqueKey( + JShareableEntity.SHAREABLE_ENTITY, "shareable_pk", JShareableEntity.SHAREABLE_ENTITY.ID); + public static final UniqueKey STALE_MATERIALIZED_VIEW_PKEY = Internal.createUniqueKey( + JStaleMaterializedView.STALE_MATERIALIZED_VIEW, "stale_materialized_view_pkey", + JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID); + public static final UniqueKey STALE_MATERIALIZED_VIEW_NAME_KEY = Internal.createUniqueKey( + JStaleMaterializedView.STALE_MATERIALIZED_VIEW, "stale_materialized_view_name_key", + JStaleMaterializedView.STALE_MATERIALIZED_VIEW.NAME); + public static final UniqueKey STATISTICS_PK = Internal.createUniqueKey( + JStatistics.STATISTICS, "statistics_pk", JStatistics.STATISTICS.S_ID); + public static final UniqueKey UNIQUE_STATS_LAUNCH = Internal.createUniqueKey( + JStatistics.STATISTICS, "unique_stats_launch", JStatistics.STATISTICS.STATISTICS_FIELD_ID, + JStatistics.STATISTICS.LAUNCH_ID); + public static final UniqueKey UNIQUE_STATS_ITEM = Internal.createUniqueKey( + JStatistics.STATISTICS, "unique_stats_item", JStatistics.STATISTICS.STATISTICS_FIELD_ID, + JStatistics.STATISTICS.ITEM_ID); + public static final UniqueKey STATISTICS_FIELD_PK = Internal.createUniqueKey( + JStatisticsField.STATISTICS_FIELD, "statistics_field_pk", + JStatisticsField.STATISTICS_FIELD.SF_ID); + public static final UniqueKey STATISTICS_FIELD_NAME_KEY = Internal.createUniqueKey( + JStatisticsField.STATISTICS_FIELD, "statistics_field_name_key", + JStatisticsField.STATISTICS_FIELD.NAME); + public static final UniqueKey TEST_ITEM_PK = Internal.createUniqueKey( + JTestItem.TEST_ITEM, "test_item_pk", JTestItem.TEST_ITEM.ITEM_ID); + public static final UniqueKey TEST_ITEM_UUID_KEY = Internal.createUniqueKey( + JTestItem.TEST_ITEM, "test_item_uuid_key", JTestItem.TEST_ITEM.UUID); + public static final UniqueKey TEST_ITEM_RESULTS_PK = Internal.createUniqueKey( + JTestItemResults.TEST_ITEM_RESULTS, "test_item_results_pk", + JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID); + public static final UniqueKey TICKET_PK = Internal.createUniqueKey( + JTicket.TICKET, "ticket_pk", JTicket.TICKET.ID); + public static final UniqueKey USER_CREATION_BID_PK = Internal.createUniqueKey( + JUserCreationBid.USER_CREATION_BID, "user_creation_bid_pk", + JUserCreationBid.USER_CREATION_BID.UUID); + public static final UniqueKey USER_PREFERENCE_PK = Internal.createUniqueKey( + JUserPreference.USER_PREFERENCE, "user_preference_pk", JUserPreference.USER_PREFERENCE.ID); + public static final UniqueKey USER_PREFERENCE_UQ = Internal.createUniqueKey( + JUserPreference.USER_PREFERENCE, "user_preference_uq", + JUserPreference.USER_PREFERENCE.PROJECT_ID, JUserPreference.USER_PREFERENCE.USER_ID, + JUserPreference.USER_PREFERENCE.FILTER_ID); + public static final UniqueKey USERS_PK = Internal.createUniqueKey(JUsers.USERS, + "users_pk", JUsers.USERS.ID); + public static final UniqueKey USERS_LOGIN_KEY = Internal.createUniqueKey( + JUsers.USERS, "users_login_key", JUsers.USERS.LOGIN); + public static final UniqueKey USERS_EMAIL_KEY = Internal.createUniqueKey( + JUsers.USERS, "users_email_key", JUsers.USERS.EMAIL); + public static final UniqueKey WIDGET_PKEY = Internal.createUniqueKey( + JWidget.WIDGET, "widget_pkey", JWidget.WIDGET.ID); + public static final UniqueKey WIDGET_FILTER_PK = Internal.createUniqueKey( + JWidgetFilter.WIDGET_FILTER, "widget_filter_pk", JWidgetFilter.WIDGET_FILTER.WIDGET_ID, + JWidgetFilter.WIDGET_FILTER.FILTER_ID); + } - private static class UniqueKeys0 { - public static final UniqueKey ACL_CLASS_PKEY = Internal.createUniqueKey(JAclClass.ACL_CLASS, "acl_class_pkey", JAclClass.ACL_CLASS.ID); - public static final UniqueKey UNIQUE_UK_2 = Internal.createUniqueKey(JAclClass.ACL_CLASS, "unique_uk_2", JAclClass.ACL_CLASS.CLASS); - public static final UniqueKey ACL_ENTRY_PKEY = Internal.createUniqueKey(JAclEntry.ACL_ENTRY, "acl_entry_pkey", JAclEntry.ACL_ENTRY.ID); - public static final UniqueKey UNIQUE_UK_4 = Internal.createUniqueKey(JAclEntry.ACL_ENTRY, "unique_uk_4", JAclEntry.ACL_ENTRY.ACL_OBJECT_IDENTITY, JAclEntry.ACL_ENTRY.ACE_ORDER); - public static final UniqueKey ACL_OBJECT_IDENTITY_PKEY = Internal.createUniqueKey(JAclObjectIdentity.ACL_OBJECT_IDENTITY, "acl_object_identity_pkey", JAclObjectIdentity.ACL_OBJECT_IDENTITY.ID); - public static final UniqueKey UNIQUE_UK_3 = Internal.createUniqueKey(JAclObjectIdentity.ACL_OBJECT_IDENTITY, "unique_uk_3", JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS, JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY); - public static final UniqueKey ACL_SID_PKEY = Internal.createUniqueKey(JAclSid.ACL_SID, "acl_sid_pkey", JAclSid.ACL_SID.ID); - public static final UniqueKey UNIQUE_UK_1 = Internal.createUniqueKey(JAclSid.ACL_SID, "unique_uk_1", JAclSid.ACL_SID.SID, JAclSid.ACL_SID.PRINCIPAL); - public static final UniqueKey ACTIVITY_PK = Internal.createUniqueKey(JActivity.ACTIVITY, "activity_pk", JActivity.ACTIVITY.ID); - public static final UniqueKey ATTACHMENT_PK = Internal.createUniqueKey(JAttachment.ATTACHMENT, "attachment_pk", JAttachment.ATTACHMENT.ID); - public static final UniqueKey ATTACHMENT_DELETION_PKEY = Internal.createUniqueKey(JAttachmentDeletion.ATTACHMENT_DELETION, "attachment_deletion_pkey", JAttachmentDeletion.ATTACHMENT_DELETION.ID); - public static final UniqueKey ATTRIBUTE_PK = Internal.createUniqueKey(JAttribute.ATTRIBUTE, "attribute_pk", JAttribute.ATTRIBUTE.ID); - public static final UniqueKey CLUSTERS_PK = Internal.createUniqueKey(JClusters.CLUSTERS, "clusters_pk", JClusters.CLUSTERS.ID); - public static final UniqueKey INDEX_ID_LAUNCH_ID_UNQ = Internal.createUniqueKey(JClusters.CLUSTERS, "index_id_launch_id_unq", JClusters.CLUSTERS.INDEX_ID, JClusters.CLUSTERS.LAUNCH_ID); - public static final UniqueKey CLUSTER_ITEM_UNQ = Internal.createUniqueKey(JClustersTestItem.CLUSTERS_TEST_ITEM, "cluster_item_unq", JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID, JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID); - public static final UniqueKey DASHBOARD_PKEY = Internal.createUniqueKey(JDashboard.DASHBOARD, "dashboard_pkey", JDashboard.DASHBOARD.ID); - public static final UniqueKey DASHBOARD_WIDGET_PK = Internal.createUniqueKey(JDashboardWidget.DASHBOARD_WIDGET, "dashboard_widget_pk", JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID); - public static final UniqueKey WIDGET_ON_DASHBOARD_UNQ = Internal.createUniqueKey(JDashboardWidget.DASHBOARD_WIDGET, "widget_on_dashboard_unq", JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, JDashboardWidget.DASHBOARD_WIDGET.WIDGET_NAME, JDashboardWidget.DASHBOARD_WIDGET.WIDGET_OWNER); - public static final UniqueKey FILTER_PKEY = Internal.createUniqueKey(JFilter.FILTER, "filter_pkey", JFilter.FILTER.ID); - public static final UniqueKey FILTER_CONDITION_PK = Internal.createUniqueKey(JFilterCondition.FILTER_CONDITION, "filter_condition_pk", JFilterCondition.FILTER_CONDITION.ID); - public static final UniqueKey FILTER_SORT_PK = Internal.createUniqueKey(JFilterSort.FILTER_SORT, "filter_sort_pk", JFilterSort.FILTER_SORT.ID); - public static final UniqueKey INTEGRATION_PK = Internal.createUniqueKey(JIntegration.INTEGRATION, "integration_pk", JIntegration.INTEGRATION.ID); - public static final UniqueKey INTEGRATION_TYPE_PK = Internal.createUniqueKey(JIntegrationType.INTEGRATION_TYPE, "integration_type_pk", JIntegrationType.INTEGRATION_TYPE.ID); - public static final UniqueKey INTEGRATION_TYPE_NAME_KEY = Internal.createUniqueKey(JIntegrationType.INTEGRATION_TYPE, "integration_type_name_key", JIntegrationType.INTEGRATION_TYPE.NAME); - public static final UniqueKey ISSUE_PK = Internal.createUniqueKey(JIssue.ISSUE, "issue_pk", JIssue.ISSUE.ISSUE_ID); - public static final UniqueKey ISSUE_GROUP_PK = Internal.createUniqueKey(JIssueGroup.ISSUE_GROUP, "issue_group_pk", JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID); - public static final UniqueKey ISSUE_TICKET_PK = Internal.createUniqueKey(JIssueTicket.ISSUE_TICKET, "issue_ticket_pk", JIssueTicket.ISSUE_TICKET.ISSUE_ID, JIssueTicket.ISSUE_TICKET.TICKET_ID); - public static final UniqueKey ISSUE_TYPE_PK = Internal.createUniqueKey(JIssueType.ISSUE_TYPE, "issue_type_pk", JIssueType.ISSUE_TYPE.ID); - public static final UniqueKey ISSUE_TYPE_LOCATOR_KEY = Internal.createUniqueKey(JIssueType.ISSUE_TYPE, "issue_type_locator_key", JIssueType.ISSUE_TYPE.LOCATOR); - public static final UniqueKey ISSUE_TYPE_PROJECT_PK = Internal.createUniqueKey(JIssueTypeProject.ISSUE_TYPE_PROJECT, "issue_type_project_pk", JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID, JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID); - public static final UniqueKey ITEM_ATTRIBUTE_PK = Internal.createUniqueKey(JItemAttribute.ITEM_ATTRIBUTE, "item_attribute_pk", JItemAttribute.ITEM_ATTRIBUTE.ID); - public static final UniqueKey LAUNCH_PK = Internal.createUniqueKey(JLaunch.LAUNCH, "launch_pk", JLaunch.LAUNCH.ID); - public static final UniqueKey LAUNCH_UUID_KEY = Internal.createUniqueKey(JLaunch.LAUNCH, "launch_uuid_key", JLaunch.LAUNCH.UUID); - public static final UniqueKey UNQ_NAME_NUMBER = Internal.createUniqueKey(JLaunch.LAUNCH, "unq_name_number", JLaunch.LAUNCH.NAME, JLaunch.LAUNCH.NUMBER, JLaunch.LAUNCH.PROJECT_ID); - public static final UniqueKey LAUNCH_ATTRIBUTE_RULES_PK = Internal.createUniqueKey(JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, "launch_attribute_rules_pk", JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID); - public static final UniqueKey LAUNCH_NUMBER_PK = Internal.createUniqueKey(JLaunchNumber.LAUNCH_NUMBER, "launch_number_pk", JLaunchNumber.LAUNCH_NUMBER.ID); - public static final UniqueKey UNQ_PROJECT_NAME = Internal.createUniqueKey(JLaunchNumber.LAUNCH_NUMBER, "unq_project_name", JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID, JLaunchNumber.LAUNCH_NUMBER.LAUNCH_NAME); - public static final UniqueKey LOG_PK = Internal.createUniqueKey(JLog.LOG, "log_pk", JLog.LOG.ID); - public static final UniqueKey OAUTH_ACCESS_TOKEN_PKEY = Internal.createUniqueKey(JOauthAccessToken.OAUTH_ACCESS_TOKEN, "oauth_access_token_pkey", JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID); - public static final UniqueKey USERS_ACCESS_TOKEN_UNIQUE = Internal.createUniqueKey(JOauthAccessToken.OAUTH_ACCESS_TOKEN, "users_access_token_unique", JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN_ID, JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID); - public static final UniqueKey OAUTH_REGISTRATION_PKEY = Internal.createUniqueKey(JOauthRegistration.OAUTH_REGISTRATION, "oauth_registration_pkey", JOauthRegistration.OAUTH_REGISTRATION.ID); - public static final UniqueKey OAUTH_REGISTRATION_CLIENT_ID_KEY = Internal.createUniqueKey(JOauthRegistration.OAUTH_REGISTRATION, "oauth_registration_client_id_key", JOauthRegistration.OAUTH_REGISTRATION.CLIENT_ID); - public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_PK = Internal.createUniqueKey(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, "oauth_registration_restriction_pk", JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID); - public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_UNIQUE = Internal.createUniqueKey(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, "oauth_registration_restriction_unique", JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.TYPE, JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.VALUE, JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK); - public static final UniqueKey OAUTH_REGISTRATION_SCOPE_PK = Internal.createUniqueKey(JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, "oauth_registration_scope_pk", JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID); - public static final UniqueKey OAUTH_REGISTRATION_SCOPE_UNIQUE = Internal.createUniqueKey(JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, "oauth_registration_scope_unique", JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.SCOPE, JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK); - public static final UniqueKey ONBOARDING_PK = Internal.createUniqueKey(JOnboarding.ONBOARDING, "onboarding_pk", JOnboarding.ONBOARDING.ID); - public static final UniqueKey PATTERN_TEMPLATE_PK = Internal.createUniqueKey(JPatternTemplate.PATTERN_TEMPLATE, "pattern_template_pk", JPatternTemplate.PATTERN_TEMPLATE.ID); - public static final UniqueKey UNQ_NAME_PROJECTID = Internal.createUniqueKey(JPatternTemplate.PATTERN_TEMPLATE, "unq_name_projectid", JPatternTemplate.PATTERN_TEMPLATE.NAME, JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID); - public static final UniqueKey PATTERN_ITEM_UNQ = Internal.createUniqueKey(JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, "pattern_item_unq", JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID, JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID); - public static final UniqueKey PROJECT_PK = Internal.createUniqueKey(JProject.PROJECT, "project_pk", JProject.PROJECT.ID); - public static final UniqueKey PROJECT_NAME_KEY = Internal.createUniqueKey(JProject.PROJECT, "project_name_key", JProject.PROJECT.NAME); - public static final UniqueKey UNIQUE_ATTRIBUTE_PER_PROJECT = Internal.createUniqueKey(JProjectAttribute.PROJECT_ATTRIBUTE, "unique_attribute_per_project", JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID, JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID); - public static final UniqueKey USERS_PROJECT_PK = Internal.createUniqueKey(JProjectUser.PROJECT_USER, "users_project_pk", JProjectUser.PROJECT_USER.USER_ID, JProjectUser.PROJECT_USER.PROJECT_ID); - public static final UniqueKey RESTORE_PASSWORD_BID_PK = Internal.createUniqueKey(JRestorePasswordBid.RESTORE_PASSWORD_BID, "restore_password_bid_pk", JRestorePasswordBid.RESTORE_PASSWORD_BID.UUID); - public static final UniqueKey RESTORE_PASSWORD_BID_EMAIL_KEY = Internal.createUniqueKey(JRestorePasswordBid.RESTORE_PASSWORD_BID, "restore_password_bid_email_key", JRestorePasswordBid.RESTORE_PASSWORD_BID.EMAIL); - public static final UniqueKey SENDER_CASE_PK = Internal.createUniqueKey(JSenderCase.SENDER_CASE, "sender_case_pk", JSenderCase.SENDER_CASE.ID); - public static final UniqueKey SERVER_SETTINGS_ID = Internal.createUniqueKey(JServerSettings.SERVER_SETTINGS, "server_settings_id", JServerSettings.SERVER_SETTINGS.ID); - public static final UniqueKey SERVER_SETTINGS_KEY_KEY = Internal.createUniqueKey(JServerSettings.SERVER_SETTINGS, "server_settings_key_key", JServerSettings.SERVER_SETTINGS.KEY); - public static final UniqueKey SHAREABLE_PK = Internal.createUniqueKey(JShareableEntity.SHAREABLE_ENTITY, "shareable_pk", JShareableEntity.SHAREABLE_ENTITY.ID); - public static final UniqueKey STALE_MATERIALIZED_VIEW_PKEY = Internal.createUniqueKey(JStaleMaterializedView.STALE_MATERIALIZED_VIEW, "stale_materialized_view_pkey", JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID); - public static final UniqueKey STALE_MATERIALIZED_VIEW_NAME_KEY = Internal.createUniqueKey(JStaleMaterializedView.STALE_MATERIALIZED_VIEW, "stale_materialized_view_name_key", JStaleMaterializedView.STALE_MATERIALIZED_VIEW.NAME); - public static final UniqueKey STATISTICS_PK = Internal.createUniqueKey(JStatistics.STATISTICS, "statistics_pk", JStatistics.STATISTICS.S_ID); - public static final UniqueKey UNIQUE_STATS_LAUNCH = Internal.createUniqueKey(JStatistics.STATISTICS, "unique_stats_launch", JStatistics.STATISTICS.STATISTICS_FIELD_ID, JStatistics.STATISTICS.LAUNCH_ID); - public static final UniqueKey UNIQUE_STATS_ITEM = Internal.createUniqueKey(JStatistics.STATISTICS, "unique_stats_item", JStatistics.STATISTICS.STATISTICS_FIELD_ID, JStatistics.STATISTICS.ITEM_ID); - public static final UniqueKey STATISTICS_FIELD_PK = Internal.createUniqueKey(JStatisticsField.STATISTICS_FIELD, "statistics_field_pk", JStatisticsField.STATISTICS_FIELD.SF_ID); - public static final UniqueKey STATISTICS_FIELD_NAME_KEY = Internal.createUniqueKey(JStatisticsField.STATISTICS_FIELD, "statistics_field_name_key", JStatisticsField.STATISTICS_FIELD.NAME); - public static final UniqueKey TEST_ITEM_PK = Internal.createUniqueKey(JTestItem.TEST_ITEM, "test_item_pk", JTestItem.TEST_ITEM.ITEM_ID); - public static final UniqueKey TEST_ITEM_UUID_KEY = Internal.createUniqueKey(JTestItem.TEST_ITEM, "test_item_uuid_key", JTestItem.TEST_ITEM.UUID); - public static final UniqueKey TEST_ITEM_RESULTS_PK = Internal.createUniqueKey(JTestItemResults.TEST_ITEM_RESULTS, "test_item_results_pk", JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID); - public static final UniqueKey TICKET_PK = Internal.createUniqueKey(JTicket.TICKET, "ticket_pk", JTicket.TICKET.ID); - public static final UniqueKey USER_CREATION_BID_PK = Internal.createUniqueKey(JUserCreationBid.USER_CREATION_BID, "user_creation_bid_pk", JUserCreationBid.USER_CREATION_BID.UUID); - public static final UniqueKey USER_PREFERENCE_PK = Internal.createUniqueKey(JUserPreference.USER_PREFERENCE, "user_preference_pk", JUserPreference.USER_PREFERENCE.ID); - public static final UniqueKey USER_PREFERENCE_UQ = Internal.createUniqueKey(JUserPreference.USER_PREFERENCE, "user_preference_uq", JUserPreference.USER_PREFERENCE.PROJECT_ID, JUserPreference.USER_PREFERENCE.USER_ID, JUserPreference.USER_PREFERENCE.FILTER_ID); - public static final UniqueKey USERS_PK = Internal.createUniqueKey(JUsers.USERS, "users_pk", JUsers.USERS.ID); - public static final UniqueKey USERS_LOGIN_KEY = Internal.createUniqueKey(JUsers.USERS, "users_login_key", JUsers.USERS.LOGIN); - public static final UniqueKey USERS_EMAIL_KEY = Internal.createUniqueKey(JUsers.USERS, "users_email_key", JUsers.USERS.EMAIL); - public static final UniqueKey WIDGET_PKEY = Internal.createUniqueKey(JWidget.WIDGET, "widget_pkey", JWidget.WIDGET.ID); - public static final UniqueKey WIDGET_FILTER_PK = Internal.createUniqueKey(JWidgetFilter.WIDGET_FILTER, "widget_filter_pk", JWidgetFilter.WIDGET_FILTER.WIDGET_ID, JWidgetFilter.WIDGET_FILTER.FILTER_ID); - } + private static class ForeignKeys0 { - private static class ForeignKeys0 { - public static final ForeignKey ACL_ENTRY__FOREIGN_FK_4 = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ACL_OBJECT_IDENTITY_PKEY, JAclEntry.ACL_ENTRY, "acl_entry__foreign_fk_4", JAclEntry.ACL_ENTRY.ACL_OBJECT_IDENTITY); - public static final ForeignKey ACL_ENTRY__FOREIGN_FK_5 = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ACL_SID_PKEY, JAclEntry.ACL_ENTRY, "acl_entry__foreign_fk_5", JAclEntry.ACL_ENTRY.SID); - public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_2 = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ACL_CLASS_PKEY, JAclObjectIdentity.ACL_OBJECT_IDENTITY, "acl_object_identity__foreign_fk_2", JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS); - public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_1 = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ACL_OBJECT_IDENTITY_PKEY, JAclObjectIdentity.ACL_OBJECT_IDENTITY, "acl_object_identity__foreign_fk_1", JAclObjectIdentity.ACL_OBJECT_IDENTITY.PARENT_OBJECT); - public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_3 = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ACL_SID_PKEY, JAclObjectIdentity.ACL_OBJECT_IDENTITY, "acl_object_identity__foreign_fk_3", JAclObjectIdentity.ACL_OBJECT_IDENTITY.OWNER_SID); - public static final ForeignKey ACL_SID__ACL_SID_SID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_LOGIN_KEY, JAclSid.ACL_SID, "acl_sid__acl_sid_sid_fkey", JAclSid.ACL_SID.SID); - public static final ForeignKey ACTIVITY__ACTIVITY_USER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_PK, JActivity.ACTIVITY, "activity__activity_user_id_fkey", JActivity.ACTIVITY.USER_ID); - public static final ForeignKey ACTIVITY__ACTIVITY_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JActivity.ACTIVITY, "activity__activity_project_id_fkey", JActivity.ACTIVITY.PROJECT_ID); - public static final ForeignKey CONTENT_FIELD__CONTENT_FIELD_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.WIDGET_PKEY, JContentField.CONTENT_FIELD, "content_field__content_field_id_fkey", JContentField.CONTENT_FIELD.ID); - public static final ForeignKey DASHBOARD__DASHBOARD_ID_FK = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.SHAREABLE_PK, JDashboard.DASHBOARD, "dashboard__dashboard_id_fk", JDashboard.DASHBOARD.ID); - public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.DASHBOARD_PKEY, JDashboardWidget.DASHBOARD_WIDGET, "dashboard_widget__dashboard_widget_dashboard_id_fkey", JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID); - public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.WIDGET_PKEY, JDashboardWidget.DASHBOARD_WIDGET, "dashboard_widget__dashboard_widget_widget_id_fkey", JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID); - public static final ForeignKey FILTER__FILTER_ID_FK = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.SHAREABLE_PK, JFilter.FILTER, "filter__filter_id_fk", JFilter.FILTER.ID); - public static final ForeignKey FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JFilterCondition.FILTER_CONDITION, "filter_condition__filter_condition_filter_id_fkey", JFilterCondition.FILTER_CONDITION.FILTER_ID); - public static final ForeignKey FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JFilterSort.FILTER_SORT, "filter_sort__filter_sort_filter_id_fkey", JFilterSort.FILTER_SORT.FILTER_ID); - public static final ForeignKey INTEGRATION__INTEGRATION_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JIntegration.INTEGRATION, "integration__integration_project_id_fkey", JIntegration.INTEGRATION.PROJECT_ID); - public static final ForeignKey INTEGRATION__INTEGRATION_TYPE_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.INTEGRATION_TYPE_PK, JIntegration.INTEGRATION, "integration__integration_type_fkey", JIntegration.INTEGRATION.TYPE); - public static final ForeignKey ISSUE__ISSUE_ISSUE_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_RESULTS_PK, JIssue.ISSUE, "issue__issue_issue_id_fkey", JIssue.ISSUE.ISSUE_ID); - public static final ForeignKey ISSUE__ISSUE_ISSUE_TYPE_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ISSUE_TYPE_PK, JIssue.ISSUE, "issue__issue_issue_type_fkey", JIssue.ISSUE.ISSUE_TYPE); - public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ISSUE_PK, JIssueTicket.ISSUE_TICKET, "issue_ticket__issue_ticket_issue_id_fkey", JIssueTicket.ISSUE_TICKET.ISSUE_ID); - public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TICKET_PK, JIssueTicket.ISSUE_TICKET, "issue_ticket__issue_ticket_ticket_id_fkey", JIssueTicket.ISSUE_TICKET.TICKET_ID); - public static final ForeignKey ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ISSUE_GROUP_PK, JIssueType.ISSUE_TYPE, "issue_type__issue_type_issue_group_id_fkey", JIssueType.ISSUE_TYPE.ISSUE_GROUP_ID); - public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JIssueTypeProject.ISSUE_TYPE_PROJECT, "issue_type_project__issue_type_project_project_id_fkey", JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID); - public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ISSUE_TYPE_PK, JIssueTypeProject.ISSUE_TYPE_PROJECT, "issue_type_project__issue_type_project_issue_type_id_fkey", JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID); - public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JItemAttribute.ITEM_ATTRIBUTE, "item_attribute__item_attribute_item_id_fkey", JItemAttribute.ITEM_ATTRIBUTE.ITEM_ID); - public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JItemAttribute.ITEM_ATTRIBUTE, "item_attribute__item_attribute_launch_id_fkey", JItemAttribute.ITEM_ATTRIBUTE.LAUNCH_ID); - public static final ForeignKey LAUNCH__LAUNCH_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JLaunch.LAUNCH, "launch__launch_project_id_fkey", JLaunch.LAUNCH.PROJECT_ID); - public static final ForeignKey LAUNCH__LAUNCH_USER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_PK, JLaunch.LAUNCH, "launch__launch_user_id_fkey", JLaunch.LAUNCH.USER_ID); - public static final ForeignKey LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.SENDER_CASE_PK, JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, "launch_attribute_rules__launch_attribute_rules_sender_case_id_fkey", JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.SENDER_CASE_ID); - public static final ForeignKey LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.SENDER_CASE_PK, JLaunchNames.LAUNCH_NAMES, "launch_names__launch_names_sender_case_id_fkey", JLaunchNames.LAUNCH_NAMES.SENDER_CASE_ID); - public static final ForeignKey LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JLaunchNumber.LAUNCH_NUMBER, "launch_number__launch_number_project_id_fkey", JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID); - public static final ForeignKey LOG__LOG_ITEM_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JLog.LOG, "log__log_item_id_fkey", JLog.LOG.ITEM_ID); - public static final ForeignKey LOG__LOG_LAUNCH_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JLog.LOG, "log__log_launch_id_fkey", JLog.LOG.LAUNCH_ID); - public static final ForeignKey LOG__LOG_ATTACHMENT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ATTACHMENT_PK, JLog.LOG, "log__log_attachment_id_fkey", JLog.LOG.ATTACHMENT_ID); - public static final ForeignKey OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_PK, JOauthAccessToken.OAUTH_ACCESS_TOKEN, "oauth_access_token__oauth_access_token_user_id_fkey", JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID); - public static final ForeignKey OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.OAUTH_REGISTRATION_PKEY, JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, "oauth_registration_restriction__oauth_registration_restriction_oauth_registration_fk_fkey", JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK); - public static final ForeignKey OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.OAUTH_REGISTRATION_PKEY, JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, "oauth_registration_scope__oauth_registration_scope_oauth_registration_fk_fkey", JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK); - public static final ForeignKey PARAMETER__PARAMETER_ITEM_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JParameter.PARAMETER, "parameter__parameter_item_id_fkey", JParameter.PARAMETER.ITEM_ID); - public static final ForeignKey PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JPatternTemplate.PATTERN_TEMPLATE, "pattern_template__pattern_template_project_id_fkey", JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID); - public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PATTERN_TEMPLATE_PK, JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, "pattern_template_test_item__pattern_template_test_item_pattern_id_fkey", JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID); - public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, "pattern_template_test_item__pattern_template_test_item_item_id_fkey", JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID); - public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ATTRIBUTE_PK, JProjectAttribute.PROJECT_ATTRIBUTE, "project_attribute__project_attribute_attribute_id_fkey", JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID); - public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JProjectAttribute.PROJECT_ATTRIBUTE, "project_attribute__project_attribute_project_id_fkey", JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID); - public static final ForeignKey PROJECT_USER__PROJECT_USER_USER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_PK, JProjectUser.PROJECT_USER, "project_user__project_user_user_id_fkey", JProjectUser.PROJECT_USER.USER_ID); - public static final ForeignKey PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JProjectUser.PROJECT_USER, "project_user__project_user_project_id_fkey", JProjectUser.PROJECT_USER.PROJECT_ID); - public static final ForeignKey RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.SENDER_CASE_PK, JRecipients.RECIPIENTS, "recipients__recipients_sender_case_id_fkey", JRecipients.RECIPIENTS.SENDER_CASE_ID); - public static final ForeignKey SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JSenderCase.SENDER_CASE, "sender_case__sender_case_project_id_fkey", JSenderCase.SENDER_CASE.PROJECT_ID); - public static final ForeignKey SHAREABLE_ENTITY__SHAREABLE_ENTITY_OWNER_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_LOGIN_KEY, JShareableEntity.SHAREABLE_ENTITY, "shareable_entity__shareable_entity_owner_fkey", JShareableEntity.SHAREABLE_ENTITY.OWNER); - public static final ForeignKey SHAREABLE_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JShareableEntity.SHAREABLE_ENTITY, "shareable_entity__shareable_entity_project_id_fkey", JShareableEntity.SHAREABLE_ENTITY.PROJECT_ID); - public static final ForeignKey STATISTICS__STATISTICS_LAUNCH_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JStatistics.STATISTICS, "statistics__statistics_launch_id_fkey", JStatistics.STATISTICS.LAUNCH_ID); - public static final ForeignKey STATISTICS__STATISTICS_ITEM_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JStatistics.STATISTICS, "statistics__statistics_item_id_fkey", JStatistics.STATISTICS.ITEM_ID); - public static final ForeignKey STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.STATISTICS_FIELD_PK, JStatistics.STATISTICS, "statistics__statistics_statistics_field_id_fkey", JStatistics.STATISTICS.STATISTICS_FIELD_ID); - public static final ForeignKey TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JTestItem.TEST_ITEM, "test_item__test_item_parent_id_fkey", JTestItem.TEST_ITEM.PARENT_ID); - public static final ForeignKey TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JTestItem.TEST_ITEM, "test_item__test_item_retry_of_fkey", JTestItem.TEST_ITEM.RETRY_OF); - public static final ForeignKey TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JTestItem.TEST_ITEM, "test_item__test_item_launch_id_fkey", JTestItem.TEST_ITEM.LAUNCH_ID); - public static final ForeignKey TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JTestItemResults.TEST_ITEM_RESULTS, "test_item_results__test_item_results_result_id_fkey", JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID); - public static final ForeignKey USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JUserCreationBid.USER_CREATION_BID, "user_creation_bid__user_creation_bid_default_project_id_fkey", JUserCreationBid.USER_CREATION_BID.DEFAULT_PROJECT_ID); - public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JUserPreference.USER_PREFERENCE, "user_preference__user_preference_project_id_fkey", JUserPreference.USER_PREFERENCE.PROJECT_ID); - public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_PK, JUserPreference.USER_PREFERENCE, "user_preference__user_preference_user_id_fkey", JUserPreference.USER_PREFERENCE.USER_ID); - public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JUserPreference.USER_PREFERENCE, "user_preference__user_preference_filter_id_fkey", JUserPreference.USER_PREFERENCE.FILTER_ID); - public static final ForeignKey WIDGET__WIDGET_ID_FK = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.SHAREABLE_PK, JWidget.WIDGET, "widget__widget_id_fk", JWidget.WIDGET.ID); - public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.WIDGET_PKEY, JWidgetFilter.WIDGET_FILTER, "widget_filter__widget_filter_widget_id_fkey", JWidgetFilter.WIDGET_FILTER.WIDGET_ID); - public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JWidgetFilter.WIDGET_FILTER, "widget_filter__widget_filter_filter_id_fkey", JWidgetFilter.WIDGET_FILTER.FILTER_ID); - } + public static final ForeignKey ACL_ENTRY__FOREIGN_FK_4 = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.ACL_OBJECT_IDENTITY_PKEY, JAclEntry.ACL_ENTRY, + "acl_entry__foreign_fk_4", JAclEntry.ACL_ENTRY.ACL_OBJECT_IDENTITY); + public static final ForeignKey ACL_ENTRY__FOREIGN_FK_5 = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.ACL_SID_PKEY, JAclEntry.ACL_ENTRY, + "acl_entry__foreign_fk_5", JAclEntry.ACL_ENTRY.SID); + public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_2 = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.ACL_CLASS_PKEY, JAclObjectIdentity.ACL_OBJECT_IDENTITY, + "acl_object_identity__foreign_fk_2", + JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS); + public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_1 = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.ACL_OBJECT_IDENTITY_PKEY, + JAclObjectIdentity.ACL_OBJECT_IDENTITY, "acl_object_identity__foreign_fk_1", + JAclObjectIdentity.ACL_OBJECT_IDENTITY.PARENT_OBJECT); + public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_3 = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.ACL_SID_PKEY, JAclObjectIdentity.ACL_OBJECT_IDENTITY, + "acl_object_identity__foreign_fk_3", JAclObjectIdentity.ACL_OBJECT_IDENTITY.OWNER_SID); + public static final ForeignKey ACL_SID__ACL_SID_SID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.USERS_LOGIN_KEY, JAclSid.ACL_SID, + "acl_sid__acl_sid_sid_fkey", JAclSid.ACL_SID.SID); + public static final ForeignKey ACTIVITY__ACTIVITY_USER_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.USERS_PK, JActivity.ACTIVITY, + "activity__activity_user_id_fkey", JActivity.ACTIVITY.USER_ID); + public static final ForeignKey ACTIVITY__ACTIVITY_PROJECT_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JActivity.ACTIVITY, + "activity__activity_project_id_fkey", JActivity.ACTIVITY.PROJECT_ID); + public static final ForeignKey CONTENT_FIELD__CONTENT_FIELD_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.WIDGET_PKEY, JContentField.CONTENT_FIELD, + "content_field__content_field_id_fkey", JContentField.CONTENT_FIELD.ID); + public static final ForeignKey DASHBOARD__DASHBOARD_ID_FK = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.SHAREABLE_PK, JDashboard.DASHBOARD, + "dashboard__dashboard_id_fk", JDashboard.DASHBOARD.ID); + public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.DASHBOARD_PKEY, JDashboardWidget.DASHBOARD_WIDGET, + "dashboard_widget__dashboard_widget_dashboard_id_fkey", + JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID); + public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.WIDGET_PKEY, JDashboardWidget.DASHBOARD_WIDGET, + "dashboard_widget__dashboard_widget_widget_id_fkey", + JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID); + public static final ForeignKey FILTER__FILTER_ID_FK = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.SHAREABLE_PK, JFilter.FILTER, "filter__filter_id_fk", + JFilter.FILTER.ID); + public static final ForeignKey FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JFilterCondition.FILTER_CONDITION, + "filter_condition__filter_condition_filter_id_fkey", + JFilterCondition.FILTER_CONDITION.FILTER_ID); + public static final ForeignKey FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JFilterSort.FILTER_SORT, + "filter_sort__filter_sort_filter_id_fkey", JFilterSort.FILTER_SORT.FILTER_ID); + public static final ForeignKey INTEGRATION__INTEGRATION_PROJECT_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JIntegration.INTEGRATION, + "integration__integration_project_id_fkey", JIntegration.INTEGRATION.PROJECT_ID); + public static final ForeignKey INTEGRATION__INTEGRATION_TYPE_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.INTEGRATION_TYPE_PK, JIntegration.INTEGRATION, + "integration__integration_type_fkey", JIntegration.INTEGRATION.TYPE); + public static final ForeignKey ISSUE__ISSUE_ISSUE_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_RESULTS_PK, JIssue.ISSUE, + "issue__issue_issue_id_fkey", JIssue.ISSUE.ISSUE_ID); + public static final ForeignKey ISSUE__ISSUE_ISSUE_TYPE_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.ISSUE_TYPE_PK, JIssue.ISSUE, + "issue__issue_issue_type_fkey", JIssue.ISSUE.ISSUE_TYPE); + public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.ISSUE_PK, JIssueTicket.ISSUE_TICKET, + "issue_ticket__issue_ticket_issue_id_fkey", JIssueTicket.ISSUE_TICKET.ISSUE_ID); + public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.TICKET_PK, JIssueTicket.ISSUE_TICKET, + "issue_ticket__issue_ticket_ticket_id_fkey", JIssueTicket.ISSUE_TICKET.TICKET_ID); + public static final ForeignKey ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.ISSUE_GROUP_PK, JIssueType.ISSUE_TYPE, + "issue_type__issue_type_issue_group_id_fkey", JIssueType.ISSUE_TYPE.ISSUE_GROUP_ID); + public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JIssueTypeProject.ISSUE_TYPE_PROJECT, + "issue_type_project__issue_type_project_project_id_fkey", + JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID); + public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.ISSUE_TYPE_PK, JIssueTypeProject.ISSUE_TYPE_PROJECT, + "issue_type_project__issue_type_project_issue_type_id_fkey", + JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID); + public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JItemAttribute.ITEM_ATTRIBUTE, + "item_attribute__item_attribute_item_id_fkey", JItemAttribute.ITEM_ATTRIBUTE.ITEM_ID); + public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JItemAttribute.ITEM_ATTRIBUTE, + "item_attribute__item_attribute_launch_id_fkey", JItemAttribute.ITEM_ATTRIBUTE.LAUNCH_ID); + public static final ForeignKey LAUNCH__LAUNCH_PROJECT_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JLaunch.LAUNCH, + "launch__launch_project_id_fkey", JLaunch.LAUNCH.PROJECT_ID); + public static final ForeignKey LAUNCH__LAUNCH_USER_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.USERS_PK, JLaunch.LAUNCH, "launch__launch_user_id_fkey", + JLaunch.LAUNCH.USER_ID); + public static final ForeignKey LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.SENDER_CASE_PK, + JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, + "launch_attribute_rules__launch_attribute_rules_sender_case_id_fkey", + JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.SENDER_CASE_ID); + public static final ForeignKey LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.SENDER_CASE_PK, JLaunchNames.LAUNCH_NAMES, + "launch_names__launch_names_sender_case_id_fkey", JLaunchNames.LAUNCH_NAMES.SENDER_CASE_ID); + public static final ForeignKey LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JLaunchNumber.LAUNCH_NUMBER, + "launch_number__launch_number_project_id_fkey", JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID); + public static final ForeignKey LOG__LOG_ITEM_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JLog.LOG, "log__log_item_id_fkey", + JLog.LOG.ITEM_ID); + public static final ForeignKey LOG__LOG_LAUNCH_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JLog.LOG, "log__log_launch_id_fkey", + JLog.LOG.LAUNCH_ID); + public static final ForeignKey LOG__LOG_ATTACHMENT_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.ATTACHMENT_PK, JLog.LOG, "log__log_attachment_id_fkey", + JLog.LOG.ATTACHMENT_ID); + public static final ForeignKey OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.USERS_PK, JOauthAccessToken.OAUTH_ACCESS_TOKEN, + "oauth_access_token__oauth_access_token_user_id_fkey", + JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID); + public static final ForeignKey OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.OAUTH_REGISTRATION_PKEY, + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, + "oauth_registration_restriction__oauth_registration_restriction_oauth_registration_fk_fkey", + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK); + public static final ForeignKey OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.OAUTH_REGISTRATION_PKEY, + JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, + "oauth_registration_scope__oauth_registration_scope_oauth_registration_fk_fkey", + JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK); + public static final ForeignKey PARAMETER__PARAMETER_ITEM_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JParameter.PARAMETER, + "parameter__parameter_item_id_fkey", JParameter.PARAMETER.ITEM_ID); + public static final ForeignKey PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JPatternTemplate.PATTERN_TEMPLATE, + "pattern_template__pattern_template_project_id_fkey", + JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID); + public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.PATTERN_TEMPLATE_PK, + JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, + "pattern_template_test_item__pattern_template_test_item_pattern_id_fkey", + JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID); + public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, + JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, + "pattern_template_test_item__pattern_template_test_item_item_id_fkey", + JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID); + public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.ATTRIBUTE_PK, JProjectAttribute.PROJECT_ATTRIBUTE, + "project_attribute__project_attribute_attribute_id_fkey", + JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID); + public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JProjectAttribute.PROJECT_ATTRIBUTE, + "project_attribute__project_attribute_project_id_fkey", + JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID); + public static final ForeignKey PROJECT_USER__PROJECT_USER_USER_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.USERS_PK, JProjectUser.PROJECT_USER, + "project_user__project_user_user_id_fkey", JProjectUser.PROJECT_USER.USER_ID); + public static final ForeignKey PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JProjectUser.PROJECT_USER, + "project_user__project_user_project_id_fkey", JProjectUser.PROJECT_USER.PROJECT_ID); + public static final ForeignKey RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.SENDER_CASE_PK, JRecipients.RECIPIENTS, + "recipients__recipients_sender_case_id_fkey", JRecipients.RECIPIENTS.SENDER_CASE_ID); + public static final ForeignKey SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JSenderCase.SENDER_CASE, + "sender_case__sender_case_project_id_fkey", JSenderCase.SENDER_CASE.PROJECT_ID); + public static final ForeignKey SHAREABLE_ENTITY__SHAREABLE_ENTITY_OWNER_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.USERS_LOGIN_KEY, JShareableEntity.SHAREABLE_ENTITY, + "shareable_entity__shareable_entity_owner_fkey", JShareableEntity.SHAREABLE_ENTITY.OWNER); + public static final ForeignKey SHAREABLE_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JShareableEntity.SHAREABLE_ENTITY, + "shareable_entity__shareable_entity_project_id_fkey", + JShareableEntity.SHAREABLE_ENTITY.PROJECT_ID); + public static final ForeignKey STATISTICS__STATISTICS_LAUNCH_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JStatistics.STATISTICS, + "statistics__statistics_launch_id_fkey", JStatistics.STATISTICS.LAUNCH_ID); + public static final ForeignKey STATISTICS__STATISTICS_ITEM_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JStatistics.STATISTICS, + "statistics__statistics_item_id_fkey", JStatistics.STATISTICS.ITEM_ID); + public static final ForeignKey STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.STATISTICS_FIELD_PK, JStatistics.STATISTICS, + "statistics__statistics_statistics_field_id_fkey", + JStatistics.STATISTICS.STATISTICS_FIELD_ID); + public static final ForeignKey TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JTestItem.TEST_ITEM, + "test_item__test_item_parent_id_fkey", JTestItem.TEST_ITEM.PARENT_ID); + public static final ForeignKey TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JTestItem.TEST_ITEM, + "test_item__test_item_retry_of_fkey", JTestItem.TEST_ITEM.RETRY_OF); + public static final ForeignKey TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JTestItem.TEST_ITEM, + "test_item__test_item_launch_id_fkey", JTestItem.TEST_ITEM.LAUNCH_ID); + public static final ForeignKey TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JTestItemResults.TEST_ITEM_RESULTS, + "test_item_results__test_item_results_result_id_fkey", + JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID); + public static final ForeignKey USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JUserCreationBid.USER_CREATION_BID, + "user_creation_bid__user_creation_bid_default_project_id_fkey", + JUserCreationBid.USER_CREATION_BID.DEFAULT_PROJECT_ID); + public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JUserPreference.USER_PREFERENCE, + "user_preference__user_preference_project_id_fkey", + JUserPreference.USER_PREFERENCE.PROJECT_ID); + public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.USERS_PK, JUserPreference.USER_PREFERENCE, + "user_preference__user_preference_user_id_fkey", JUserPreference.USER_PREFERENCE.USER_ID); + public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JUserPreference.USER_PREFERENCE, + "user_preference__user_preference_filter_id_fkey", + JUserPreference.USER_PREFERENCE.FILTER_ID); + public static final ForeignKey WIDGET__WIDGET_ID_FK = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.SHAREABLE_PK, JWidget.WIDGET, "widget__widget_id_fk", + JWidget.WIDGET.ID); + public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.WIDGET_PKEY, JWidgetFilter.WIDGET_FILTER, + "widget_filter__widget_filter_widget_id_fkey", JWidgetFilter.WIDGET_FILTER.WIDGET_ID); + public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY = Internal.createForeignKey( + com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JWidgetFilter.WIDGET_FILTER, + "widget_filter__widget_filter_filter_id_fkey", JWidgetFilter.WIDGET_FILTER.FILTER_ID); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java b/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java index 5ce18a0b2..e9c01edf1 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java @@ -4,11 +4,10 @@ package com.epam.ta.reportportal.jooq; +import javax.annotation.processing.Generated; import org.jooq.Sequence; import org.jooq.impl.SequenceImpl; -import javax.annotation.processing.Generated; - /** * Convenience access to all sequences in public @@ -20,196 +19,245 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class Sequences { - /** - * The sequence public.acl_class_id_seq - */ - public static final Sequence ACL_CLASS_ID_SEQ = new SequenceImpl("acl_class_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.acl_entry_id_seq - */ - public static final Sequence ACL_ENTRY_ID_SEQ = new SequenceImpl("acl_entry_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.acl_object_identity_id_seq - */ - public static final Sequence ACL_OBJECT_IDENTITY_ID_SEQ = new SequenceImpl("acl_object_identity_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.acl_sid_id_seq - */ - public static final Sequence ACL_SID_ID_SEQ = new SequenceImpl("acl_sid_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.activity_id_seq - */ - public static final Sequence ACTIVITY_ID_SEQ = new SequenceImpl("activity_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.attachment_id_seq - */ - public static final Sequence ATTACHMENT_ID_SEQ = new SequenceImpl("attachment_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.attribute_id_seq - */ - public static final Sequence ATTRIBUTE_ID_SEQ = new SequenceImpl("attribute_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.clusters_id_seq - */ - public static final Sequence CLUSTERS_ID_SEQ = new SequenceImpl("clusters_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.filter_condition_id_seq - */ - public static final Sequence FILTER_CONDITION_ID_SEQ = new SequenceImpl("filter_condition_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.filter_sort_id_seq - */ - public static final Sequence FILTER_SORT_ID_SEQ = new SequenceImpl("filter_sort_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.integration_id_seq - */ - public static final Sequence INTEGRATION_ID_SEQ = new SequenceImpl("integration_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.INTEGER.nullable(false)); - - /** - * The sequence public.integration_type_id_seq - */ - public static final Sequence INTEGRATION_TYPE_ID_SEQ = new SequenceImpl("integration_type_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.INTEGER.nullable(false)); - - /** - * The sequence public.issue_group_issue_group_id_seq - */ - public static final Sequence ISSUE_GROUP_ISSUE_GROUP_ID_SEQ = new SequenceImpl("issue_group_issue_group_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.SMALLINT.nullable(false)); - - /** - * The sequence public.issue_type_id_seq - */ - public static final Sequence ISSUE_TYPE_ID_SEQ = new SequenceImpl("issue_type_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.item_attribute_id_seq - */ - public static final Sequence ITEM_ATTRIBUTE_ID_SEQ = new SequenceImpl("item_attribute_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.launch_attribute_rules_id_seq - */ - public static final Sequence LAUNCH_ATTRIBUTE_RULES_ID_SEQ = new SequenceImpl("launch_attribute_rules_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.launch_id_seq - */ - public static final Sequence LAUNCH_ID_SEQ = new SequenceImpl("launch_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.launch_number_id_seq - */ - public static final Sequence LAUNCH_NUMBER_ID_SEQ = new SequenceImpl("launch_number_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.log_id_seq - */ - public static final Sequence LOG_ID_SEQ = new SequenceImpl("log_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.oauth_access_token_id_seq - */ - public static final Sequence OAUTH_ACCESS_TOKEN_ID_SEQ = new SequenceImpl("oauth_access_token_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.oauth_registration_restriction_id_seq - */ - public static final Sequence OAUTH_REGISTRATION_RESTRICTION_ID_SEQ = new SequenceImpl("oauth_registration_restriction_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.INTEGER.nullable(false)); - - /** - * The sequence public.oauth_registration_scope_id_seq - */ - public static final Sequence OAUTH_REGISTRATION_SCOPE_ID_SEQ = new SequenceImpl("oauth_registration_scope_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.INTEGER.nullable(false)); - - /** - * The sequence public.onboarding_id_seq - */ - public static final Sequence ONBOARDING_ID_SEQ = new SequenceImpl("onboarding_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.SMALLINT.nullable(false)); - - /** - * The sequence public.pattern_template_id_seq - */ - public static final Sequence PATTERN_TEMPLATE_ID_SEQ = new SequenceImpl("pattern_template_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.project_attribute_attribute_id_seq - */ - public static final Sequence PROJECT_ATTRIBUTE_ATTRIBUTE_ID_SEQ = new SequenceImpl("project_attribute_attribute_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.project_attribute_project_id_seq - */ - public static final Sequence PROJECT_ATTRIBUTE_PROJECT_ID_SEQ = new SequenceImpl("project_attribute_project_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.project_id_seq - */ - public static final Sequence PROJECT_ID_SEQ = new SequenceImpl("project_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.sender_case_id_seq - */ - public static final Sequence SENDER_CASE_ID_SEQ = new SequenceImpl("sender_case_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.sender_case_project_id_seq - */ - public static final Sequence SENDER_CASE_PROJECT_ID_SEQ = new SequenceImpl("sender_case_project_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.server_settings_id_seq - */ - public static final Sequence SERVER_SETTINGS_ID_SEQ = new SequenceImpl("server_settings_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.SMALLINT.nullable(false)); - - /** - * The sequence public.shareable_entity_id_seq - */ - public static final Sequence SHAREABLE_ENTITY_ID_SEQ = new SequenceImpl("shareable_entity_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.stale_materialized_view_id_seq - */ - public static final Sequence STALE_MATERIALIZED_VIEW_ID_SEQ = new SequenceImpl("stale_materialized_view_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.statistics_field_sf_id_seq - */ - public static final Sequence STATISTICS_FIELD_SF_ID_SEQ = new SequenceImpl("statistics_field_sf_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.statistics_s_id_seq - */ - public static final Sequence STATISTICS_S_ID_SEQ = new SequenceImpl("statistics_s_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.test_item_item_id_seq - */ - public static final Sequence TEST_ITEM_ITEM_ID_SEQ = new SequenceImpl("test_item_item_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.ticket_id_seq - */ - public static final Sequence TICKET_ID_SEQ = new SequenceImpl("ticket_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.user_preference_id_seq - */ - public static final Sequence USER_PREFERENCE_ID_SEQ = new SequenceImpl("user_preference_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.users_id_seq - */ - public static final Sequence USERS_ID_SEQ = new SequenceImpl("users_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + /** + * The sequence public.acl_class_id_seq + */ + public static final Sequence ACL_CLASS_ID_SEQ = new SequenceImpl("acl_class_id_seq", + JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.acl_entry_id_seq + */ + public static final Sequence ACL_ENTRY_ID_SEQ = new SequenceImpl("acl_entry_id_seq", + JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.acl_object_identity_id_seq + */ + public static final Sequence ACL_OBJECT_IDENTITY_ID_SEQ = new SequenceImpl( + "acl_object_identity_id_seq", JPublic.PUBLIC, + org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.acl_sid_id_seq + */ + public static final Sequence ACL_SID_ID_SEQ = new SequenceImpl("acl_sid_id_seq", + JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.activity_id_seq + */ + public static final Sequence ACTIVITY_ID_SEQ = new SequenceImpl("activity_id_seq", + JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.attachment_id_seq + */ + public static final Sequence ATTACHMENT_ID_SEQ = new SequenceImpl("attachment_id_seq", + JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.attribute_id_seq + */ + public static final Sequence ATTRIBUTE_ID_SEQ = new SequenceImpl("attribute_id_seq", + JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.clusters_id_seq + */ + public static final Sequence CLUSTERS_ID_SEQ = new SequenceImpl("clusters_id_seq", + JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.filter_condition_id_seq + */ + public static final Sequence FILTER_CONDITION_ID_SEQ = new SequenceImpl( + "filter_condition_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.filter_sort_id_seq + */ + public static final Sequence FILTER_SORT_ID_SEQ = new SequenceImpl( + "filter_sort_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.integration_id_seq + */ + public static final Sequence INTEGRATION_ID_SEQ = new SequenceImpl( + "integration_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.INTEGER.nullable(false)); + + /** + * The sequence public.integration_type_id_seq + */ + public static final Sequence INTEGRATION_TYPE_ID_SEQ = new SequenceImpl( + "integration_type_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.INTEGER.nullable(false)); + + /** + * The sequence public.issue_group_issue_group_id_seq + */ + public static final Sequence ISSUE_GROUP_ISSUE_GROUP_ID_SEQ = new SequenceImpl( + "issue_group_issue_group_id_seq", JPublic.PUBLIC, + org.jooq.impl.SQLDataType.SMALLINT.nullable(false)); + + /** + * The sequence public.issue_type_id_seq + */ + public static final Sequence ISSUE_TYPE_ID_SEQ = new SequenceImpl("issue_type_id_seq", + JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.item_attribute_id_seq + */ + public static final Sequence ITEM_ATTRIBUTE_ID_SEQ = new SequenceImpl( + "item_attribute_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.launch_attribute_rules_id_seq + */ + public static final Sequence LAUNCH_ATTRIBUTE_RULES_ID_SEQ = new SequenceImpl( + "launch_attribute_rules_id_seq", JPublic.PUBLIC, + org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.launch_id_seq + */ + public static final Sequence LAUNCH_ID_SEQ = new SequenceImpl("launch_id_seq", + JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.launch_number_id_seq + */ + public static final Sequence LAUNCH_NUMBER_ID_SEQ = new SequenceImpl( + "launch_number_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.log_id_seq + */ + public static final Sequence LOG_ID_SEQ = new SequenceImpl("log_id_seq", + JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.oauth_access_token_id_seq + */ + public static final Sequence OAUTH_ACCESS_TOKEN_ID_SEQ = new SequenceImpl( + "oauth_access_token_id_seq", JPublic.PUBLIC, + org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.oauth_registration_restriction_id_seq + */ + public static final Sequence OAUTH_REGISTRATION_RESTRICTION_ID_SEQ = new SequenceImpl( + "oauth_registration_restriction_id_seq", JPublic.PUBLIC, + org.jooq.impl.SQLDataType.INTEGER.nullable(false)); + + /** + * The sequence public.oauth_registration_scope_id_seq + */ + public static final Sequence OAUTH_REGISTRATION_SCOPE_ID_SEQ = new SequenceImpl( + "oauth_registration_scope_id_seq", JPublic.PUBLIC, + org.jooq.impl.SQLDataType.INTEGER.nullable(false)); + + /** + * The sequence public.onboarding_id_seq + */ + public static final Sequence ONBOARDING_ID_SEQ = new SequenceImpl( + "onboarding_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.SMALLINT.nullable(false)); + + /** + * The sequence public.pattern_template_id_seq + */ + public static final Sequence PATTERN_TEMPLATE_ID_SEQ = new SequenceImpl( + "pattern_template_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.project_attribute_attribute_id_seq + */ + public static final Sequence PROJECT_ATTRIBUTE_ATTRIBUTE_ID_SEQ = new SequenceImpl( + "project_attribute_attribute_id_seq", JPublic.PUBLIC, + org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.project_attribute_project_id_seq + */ + public static final Sequence PROJECT_ATTRIBUTE_PROJECT_ID_SEQ = new SequenceImpl( + "project_attribute_project_id_seq", JPublic.PUBLIC, + org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.project_id_seq + */ + public static final Sequence PROJECT_ID_SEQ = new SequenceImpl("project_id_seq", + JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.sender_case_id_seq + */ + public static final Sequence SENDER_CASE_ID_SEQ = new SequenceImpl( + "sender_case_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.sender_case_project_id_seq + */ + public static final Sequence SENDER_CASE_PROJECT_ID_SEQ = new SequenceImpl( + "sender_case_project_id_seq", JPublic.PUBLIC, + org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.server_settings_id_seq + */ + public static final Sequence SERVER_SETTINGS_ID_SEQ = new SequenceImpl( + "server_settings_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.SMALLINT.nullable(false)); + + /** + * The sequence public.shareable_entity_id_seq + */ + public static final Sequence SHAREABLE_ENTITY_ID_SEQ = new SequenceImpl( + "shareable_entity_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.stale_materialized_view_id_seq + */ + public static final Sequence STALE_MATERIALIZED_VIEW_ID_SEQ = new SequenceImpl( + "stale_materialized_view_id_seq", JPublic.PUBLIC, + org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.statistics_field_sf_id_seq + */ + public static final Sequence STATISTICS_FIELD_SF_ID_SEQ = new SequenceImpl( + "statistics_field_sf_id_seq", JPublic.PUBLIC, + org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.statistics_s_id_seq + */ + public static final Sequence STATISTICS_S_ID_SEQ = new SequenceImpl( + "statistics_s_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.test_item_item_id_seq + */ + public static final Sequence TEST_ITEM_ITEM_ID_SEQ = new SequenceImpl( + "test_item_item_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.ticket_id_seq + */ + public static final Sequence TICKET_ID_SEQ = new SequenceImpl("ticket_id_seq", + JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.user_preference_id_seq + */ + public static final Sequence USER_PREFERENCE_ID_SEQ = new SequenceImpl( + "user_preference_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.users_id_seq + */ + public static final Sequence USERS_ID_SEQ = new SequenceImpl("users_id_seq", + JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Tables.java b/src/main/java/com/epam/ta/reportportal/jooq/Tables.java index 725c8a244..249dae9cb 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/Tables.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Tables.java @@ -4,14 +4,69 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.*; +import com.epam.ta.reportportal.jooq.tables.JAclClass; +import com.epam.ta.reportportal.jooq.tables.JAclEntry; +import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; +import com.epam.ta.reportportal.jooq.tables.JAclSid; +import com.epam.ta.reportportal.jooq.tables.JActivity; +import com.epam.ta.reportportal.jooq.tables.JAttachment; +import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; +import com.epam.ta.reportportal.jooq.tables.JAttribute; +import com.epam.ta.reportportal.jooq.tables.JClusters; +import com.epam.ta.reportportal.jooq.tables.JClustersTestItem; +import com.epam.ta.reportportal.jooq.tables.JContentField; +import com.epam.ta.reportportal.jooq.tables.JDashboard; +import com.epam.ta.reportportal.jooq.tables.JDashboardWidget; +import com.epam.ta.reportportal.jooq.tables.JFilter; +import com.epam.ta.reportportal.jooq.tables.JFilterCondition; +import com.epam.ta.reportportal.jooq.tables.JFilterSort; +import com.epam.ta.reportportal.jooq.tables.JIntegration; +import com.epam.ta.reportportal.jooq.tables.JIntegrationType; +import com.epam.ta.reportportal.jooq.tables.JIssue; +import com.epam.ta.reportportal.jooq.tables.JIssueGroup; +import com.epam.ta.reportportal.jooq.tables.JIssueTicket; +import com.epam.ta.reportportal.jooq.tables.JIssueType; +import com.epam.ta.reportportal.jooq.tables.JIssueTypeProject; +import com.epam.ta.reportportal.jooq.tables.JItemAttribute; +import com.epam.ta.reportportal.jooq.tables.JLaunch; +import com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules; +import com.epam.ta.reportportal.jooq.tables.JLaunchNames; +import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; +import com.epam.ta.reportportal.jooq.tables.JLog; +import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; +import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; +import com.epam.ta.reportportal.jooq.tables.JOnboarding; +import com.epam.ta.reportportal.jooq.tables.JParameter; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; +import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; +import com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders; +import com.epam.ta.reportportal.jooq.tables.JProject; +import com.epam.ta.reportportal.jooq.tables.JProjectAttribute; +import com.epam.ta.reportportal.jooq.tables.JProjectUser; +import com.epam.ta.reportportal.jooq.tables.JRecipients; +import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; +import com.epam.ta.reportportal.jooq.tables.JSenderCase; +import com.epam.ta.reportportal.jooq.tables.JServerSettings; +import com.epam.ta.reportportal.jooq.tables.JShareableEntity; +import com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView; +import com.epam.ta.reportportal.jooq.tables.JStatistics; +import com.epam.ta.reportportal.jooq.tables.JStatisticsField; +import com.epam.ta.reportportal.jooq.tables.JTestItem; +import com.epam.ta.reportportal.jooq.tables.JTestItemResults; +import com.epam.ta.reportportal.jooq.tables.JTicket; +import com.epam.ta.reportportal.jooq.tables.JUserCreationBid; +import com.epam.ta.reportportal.jooq.tables.JUserPreference; +import com.epam.ta.reportportal.jooq.tables.JUsers; +import com.epam.ta.reportportal.jooq.tables.JWidget; +import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; import com.epam.ta.reportportal.jooq.tables.records.JPgpArmorHeadersRecord; +import javax.annotation.processing.Generated; import org.jooq.Configuration; import org.jooq.Field; import org.jooq.Result; -import javax.annotation.processing.Generated; - /** * Convenience access to all tables in public @@ -23,312 +78,295 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class Tables { - /** - * The table public.acl_class. - */ - public static final JAclClass ACL_CLASS = JAclClass.ACL_CLASS; - - /** - * The table public.acl_entry. - */ - public static final JAclEntry ACL_ENTRY = JAclEntry.ACL_ENTRY; - - /** - * The table public.acl_object_identity. - */ - public static final JAclObjectIdentity ACL_OBJECT_IDENTITY = JAclObjectIdentity.ACL_OBJECT_IDENTITY; - - /** - * The table public.acl_sid. - */ - public static final JAclSid ACL_SID = JAclSid.ACL_SID; - - /** - * The table public.activity. - */ - public static final JActivity ACTIVITY = JActivity.ACTIVITY; - - /** - * The table public.attachment. - */ - public static final JAttachment ATTACHMENT = JAttachment.ATTACHMENT; - - /** - * The table public.attachment_deletion. - */ - public static final JAttachmentDeletion ATTACHMENT_DELETION = JAttachmentDeletion.ATTACHMENT_DELETION; - - /** - * The table public.attribute. - */ - public static final JAttribute ATTRIBUTE = JAttribute.ATTRIBUTE; - - /** - * The table public.clusters. - */ - public static final JClusters CLUSTERS = JClusters.CLUSTERS; - - /** - * The table public.clusters_test_item. - */ - public static final JClustersTestItem CLUSTERS_TEST_ITEM = JClustersTestItem.CLUSTERS_TEST_ITEM; - - /** - * The table public.content_field. - */ - public static final JContentField CONTENT_FIELD = JContentField.CONTENT_FIELD; - - /** - * The table public.dashboard. - */ - public static final JDashboard DASHBOARD = JDashboard.DASHBOARD; - - /** - * The table public.dashboard_widget. - */ - public static final JDashboardWidget DASHBOARD_WIDGET = JDashboardWidget.DASHBOARD_WIDGET; - - /** - * The table public.filter. - */ - public static final JFilter FILTER = JFilter.FILTER; - - /** - * The table public.filter_condition. - */ - public static final JFilterCondition FILTER_CONDITION = JFilterCondition.FILTER_CONDITION; - - /** - * The table public.filter_sort. - */ - public static final JFilterSort FILTER_SORT = JFilterSort.FILTER_SORT; - - /** - * The table public.integration. - */ - public static final JIntegration INTEGRATION = JIntegration.INTEGRATION; - - /** - * The table public.integration_type. - */ - public static final JIntegrationType INTEGRATION_TYPE = JIntegrationType.INTEGRATION_TYPE; - - /** - * The table public.issue. - */ - public static final JIssue ISSUE = JIssue.ISSUE; - - /** - * The table public.issue_group. - */ - public static final JIssueGroup ISSUE_GROUP = JIssueGroup.ISSUE_GROUP; - - /** - * The table public.issue_ticket. - */ - public static final JIssueTicket ISSUE_TICKET = JIssueTicket.ISSUE_TICKET; - - /** - * The table public.issue_type. - */ - public static final JIssueType ISSUE_TYPE = JIssueType.ISSUE_TYPE; - - /** - * The table public.issue_type_project. - */ - public static final JIssueTypeProject ISSUE_TYPE_PROJECT = JIssueTypeProject.ISSUE_TYPE_PROJECT; - - /** - * The table public.item_attribute. - */ - public static final JItemAttribute ITEM_ATTRIBUTE = JItemAttribute.ITEM_ATTRIBUTE; - - /** - * The table public.launch. - */ - public static final JLaunch LAUNCH = JLaunch.LAUNCH; - - /** - * The table public.launch_attribute_rules. - */ - public static final JLaunchAttributeRules LAUNCH_ATTRIBUTE_RULES = JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES; - - /** - * The table public.launch_names. - */ - public static final JLaunchNames LAUNCH_NAMES = JLaunchNames.LAUNCH_NAMES; - - /** - * The table public.launch_number. - */ - public static final JLaunchNumber LAUNCH_NUMBER = JLaunchNumber.LAUNCH_NUMBER; - - /** - * The table public.log. - */ - public static final JLog LOG = JLog.LOG; - - /** - * The table public.oauth_access_token. - */ - public static final JOauthAccessToken OAUTH_ACCESS_TOKEN = JOauthAccessToken.OAUTH_ACCESS_TOKEN; - - /** - * The table public.oauth_registration. - */ - public static final JOauthRegistration OAUTH_REGISTRATION = JOauthRegistration.OAUTH_REGISTRATION; - - /** - * The table public.oauth_registration_restriction. - */ - public static final JOauthRegistrationRestriction OAUTH_REGISTRATION_RESTRICTION = JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION; - - /** - * The table public.oauth_registration_scope. - */ - public static final JOauthRegistrationScope OAUTH_REGISTRATION_SCOPE = JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE; - - /** - * The table public.onboarding. - */ - public static final JOnboarding ONBOARDING = JOnboarding.ONBOARDING; - - /** - * The table public.parameter. - */ - public static final JParameter PARAMETER = JParameter.PARAMETER; - - /** - * The table public.pattern_template. - */ - public static final JPatternTemplate PATTERN_TEMPLATE = JPatternTemplate.PATTERN_TEMPLATE; - - /** - * The table public.pattern_template_test_item. - */ - public static final JPatternTemplateTestItem PATTERN_TEMPLATE_TEST_ITEM = JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM; - - /** - * The table public.pgp_armor_headers. - */ - public static final JPgpArmorHeaders PGP_ARMOR_HEADERS = JPgpArmorHeaders.PGP_ARMOR_HEADERS; - - /** - * Call public.pgp_armor_headers. - */ - public static Result PGP_ARMOR_HEADERS(Configuration configuration, String __1) { - return configuration.dsl().selectFrom(com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1)).fetch(); - } - - /** - * Get public.pgp_armor_headers as a table. - */ - public static JPgpArmorHeaders PGP_ARMOR_HEADERS(String __1) { - return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); - } - - /** - * Get public.pgp_armor_headers as a table. - */ - public static JPgpArmorHeaders PGP_ARMOR_HEADERS(Field __1) { - return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); - } - - /** - * The table public.project. - */ - public static final JProject PROJECT = JProject.PROJECT; - - /** - * The table public.project_attribute. - */ - public static final JProjectAttribute PROJECT_ATTRIBUTE = JProjectAttribute.PROJECT_ATTRIBUTE; - - /** - * The table public.project_user. - */ - public static final JProjectUser PROJECT_USER = JProjectUser.PROJECT_USER; - - /** - * The table public.recipients. - */ - public static final JRecipients RECIPIENTS = JRecipients.RECIPIENTS; - - /** - * The table public.restore_password_bid. - */ - public static final JRestorePasswordBid RESTORE_PASSWORD_BID = JRestorePasswordBid.RESTORE_PASSWORD_BID; - - /** - * The table public.sender_case. - */ - public static final JSenderCase SENDER_CASE = JSenderCase.SENDER_CASE; - - /** - * The table public.server_settings. - */ - public static final JServerSettings SERVER_SETTINGS = JServerSettings.SERVER_SETTINGS; - - /** - * The table public.shareable_entity. - */ - public static final JShareableEntity SHAREABLE_ENTITY = JShareableEntity.SHAREABLE_ENTITY; - - /** - * The table public.stale_materialized_view. - */ - public static final JStaleMaterializedView STALE_MATERIALIZED_VIEW = JStaleMaterializedView.STALE_MATERIALIZED_VIEW; - - /** - * The table public.statistics. - */ - public static final JStatistics STATISTICS = JStatistics.STATISTICS; - - /** - * The table public.statistics_field. - */ - public static final JStatisticsField STATISTICS_FIELD = JStatisticsField.STATISTICS_FIELD; - - /** - * The table public.test_item. - */ - public static final JTestItem TEST_ITEM = JTestItem.TEST_ITEM; - - /** - * The table public.test_item_results. - */ - public static final JTestItemResults TEST_ITEM_RESULTS = JTestItemResults.TEST_ITEM_RESULTS; - - /** - * The table public.ticket. - */ - public static final JTicket TICKET = JTicket.TICKET; - - /** - * The table public.user_creation_bid. - */ - public static final JUserCreationBid USER_CREATION_BID = JUserCreationBid.USER_CREATION_BID; - - /** - * The table public.user_preference. - */ - public static final JUserPreference USER_PREFERENCE = JUserPreference.USER_PREFERENCE; - - /** - * The table public.users. - */ - public static final JUsers USERS = JUsers.USERS; - - /** - * The table public.widget. - */ - public static final JWidget WIDGET = JWidget.WIDGET; - - /** - * The table public.widget_filter. - */ - public static final JWidgetFilter WIDGET_FILTER = JWidgetFilter.WIDGET_FILTER; + /** + * The table public.acl_class. + */ + public static final JAclClass ACL_CLASS = JAclClass.ACL_CLASS; + + /** + * The table public.acl_entry. + */ + public static final JAclEntry ACL_ENTRY = JAclEntry.ACL_ENTRY; + + /** + * The table public.acl_object_identity. + */ + public static final JAclObjectIdentity ACL_OBJECT_IDENTITY = JAclObjectIdentity.ACL_OBJECT_IDENTITY; + + /** + * The table public.acl_sid. + */ + public static final JAclSid ACL_SID = JAclSid.ACL_SID; + + /** + * The table public.activity. + */ + public static final JActivity ACTIVITY = JActivity.ACTIVITY; + + /** + * The table public.attachment. + */ + public static final JAttachment ATTACHMENT = JAttachment.ATTACHMENT; + + /** + * The table public.attachment_deletion. + */ + public static final JAttachmentDeletion ATTACHMENT_DELETION = JAttachmentDeletion.ATTACHMENT_DELETION; + + /** + * The table public.attribute. + */ + public static final JAttribute ATTRIBUTE = JAttribute.ATTRIBUTE; + + /** + * The table public.clusters. + */ + public static final JClusters CLUSTERS = JClusters.CLUSTERS; + + /** + * The table public.clusters_test_item. + */ + public static final JClustersTestItem CLUSTERS_TEST_ITEM = JClustersTestItem.CLUSTERS_TEST_ITEM; + + /** + * The table public.content_field. + */ + public static final JContentField CONTENT_FIELD = JContentField.CONTENT_FIELD; + + /** + * The table public.dashboard. + */ + public static final JDashboard DASHBOARD = JDashboard.DASHBOARD; + + /** + * The table public.dashboard_widget. + */ + public static final JDashboardWidget DASHBOARD_WIDGET = JDashboardWidget.DASHBOARD_WIDGET; + + /** + * The table public.filter. + */ + public static final JFilter FILTER = JFilter.FILTER; + + /** + * The table public.filter_condition. + */ + public static final JFilterCondition FILTER_CONDITION = JFilterCondition.FILTER_CONDITION; + + /** + * The table public.filter_sort. + */ + public static final JFilterSort FILTER_SORT = JFilterSort.FILTER_SORT; + + /** + * The table public.integration. + */ + public static final JIntegration INTEGRATION = JIntegration.INTEGRATION; + + /** + * The table public.integration_type. + */ + public static final JIntegrationType INTEGRATION_TYPE = JIntegrationType.INTEGRATION_TYPE; + + /** + * The table public.issue. + */ + public static final JIssue ISSUE = JIssue.ISSUE; + + /** + * The table public.issue_group. + */ + public static final JIssueGroup ISSUE_GROUP = JIssueGroup.ISSUE_GROUP; + + /** + * The table public.issue_ticket. + */ + public static final JIssueTicket ISSUE_TICKET = JIssueTicket.ISSUE_TICKET; + + /** + * The table public.issue_type. + */ + public static final JIssueType ISSUE_TYPE = JIssueType.ISSUE_TYPE; + + /** + * The table public.issue_type_project. + */ + public static final JIssueTypeProject ISSUE_TYPE_PROJECT = JIssueTypeProject.ISSUE_TYPE_PROJECT; + + /** + * The table public.item_attribute. + */ + public static final JItemAttribute ITEM_ATTRIBUTE = JItemAttribute.ITEM_ATTRIBUTE; + + /** + * The table public.launch. + */ + public static final JLaunch LAUNCH = JLaunch.LAUNCH; + + /** + * The table public.launch_attribute_rules. + */ + public static final JLaunchAttributeRules LAUNCH_ATTRIBUTE_RULES = JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES; + + /** + * The table public.launch_names. + */ + public static final JLaunchNames LAUNCH_NAMES = JLaunchNames.LAUNCH_NAMES; + + /** + * The table public.launch_number. + */ + public static final JLaunchNumber LAUNCH_NUMBER = JLaunchNumber.LAUNCH_NUMBER; + + /** + * The table public.log. + */ + public static final JLog LOG = JLog.LOG; + + /** + * The table public.oauth_access_token. + */ + public static final JOauthAccessToken OAUTH_ACCESS_TOKEN = JOauthAccessToken.OAUTH_ACCESS_TOKEN; + + /** + * The table public.oauth_registration. + */ + public static final JOauthRegistration OAUTH_REGISTRATION = JOauthRegistration.OAUTH_REGISTRATION; + + /** + * The table public.oauth_registration_restriction. + */ + public static final JOauthRegistrationRestriction OAUTH_REGISTRATION_RESTRICTION = JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION; + + /** + * The table public.oauth_registration_scope. + */ + public static final JOauthRegistrationScope OAUTH_REGISTRATION_SCOPE = JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE; + + /** + * The table public.onboarding. + */ + public static final JOnboarding ONBOARDING = JOnboarding.ONBOARDING; + + /** + * The table public.parameter. + */ + public static final JParameter PARAMETER = JParameter.PARAMETER; + + /** + * The table public.pattern_template. + */ + public static final JPatternTemplate PATTERN_TEMPLATE = JPatternTemplate.PATTERN_TEMPLATE; + + /** + * The table public.pattern_template_test_item. + */ + public static final JPatternTemplateTestItem PATTERN_TEMPLATE_TEST_ITEM = JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM; + + /** + * The table public.pgp_armor_headers. + */ + public static final JPgpArmorHeaders PGP_ARMOR_HEADERS = JPgpArmorHeaders.PGP_ARMOR_HEADERS; + /** + * The table public.project. + */ + public static final JProject PROJECT = JProject.PROJECT; + /** + * The table public.project_attribute. + */ + public static final JProjectAttribute PROJECT_ATTRIBUTE = JProjectAttribute.PROJECT_ATTRIBUTE; + /** + * The table public.project_user. + */ + public static final JProjectUser PROJECT_USER = JProjectUser.PROJECT_USER; + /** + * The table public.recipients. + */ + public static final JRecipients RECIPIENTS = JRecipients.RECIPIENTS; + /** + * The table public.restore_password_bid. + */ + public static final JRestorePasswordBid RESTORE_PASSWORD_BID = JRestorePasswordBid.RESTORE_PASSWORD_BID; + /** + * The table public.sender_case. + */ + public static final JSenderCase SENDER_CASE = JSenderCase.SENDER_CASE; + /** + * The table public.server_settings. + */ + public static final JServerSettings SERVER_SETTINGS = JServerSettings.SERVER_SETTINGS; + /** + * The table public.shareable_entity. + */ + public static final JShareableEntity SHAREABLE_ENTITY = JShareableEntity.SHAREABLE_ENTITY; + /** + * The table public.stale_materialized_view. + */ + public static final JStaleMaterializedView STALE_MATERIALIZED_VIEW = JStaleMaterializedView.STALE_MATERIALIZED_VIEW; + /** + * The table public.statistics. + */ + public static final JStatistics STATISTICS = JStatistics.STATISTICS; + /** + * The table public.statistics_field. + */ + public static final JStatisticsField STATISTICS_FIELD = JStatisticsField.STATISTICS_FIELD; + /** + * The table public.test_item. + */ + public static final JTestItem TEST_ITEM = JTestItem.TEST_ITEM; + /** + * The table public.test_item_results. + */ + public static final JTestItemResults TEST_ITEM_RESULTS = JTestItemResults.TEST_ITEM_RESULTS; + /** + * The table public.ticket. + */ + public static final JTicket TICKET = JTicket.TICKET; + /** + * The table public.user_creation_bid. + */ + public static final JUserCreationBid USER_CREATION_BID = JUserCreationBid.USER_CREATION_BID; + /** + * The table public.user_preference. + */ + public static final JUserPreference USER_PREFERENCE = JUserPreference.USER_PREFERENCE; + /** + * The table public.users. + */ + public static final JUsers USERS = JUsers.USERS; + /** + * The table public.widget. + */ + public static final JWidget WIDGET = JWidget.WIDGET; + /** + * The table public.widget_filter. + */ + public static final JWidgetFilter WIDGET_FILTER = JWidgetFilter.WIDGET_FILTER; + + /** + * Call public.pgp_armor_headers. + */ + public static Result PGP_ARMOR_HEADERS(Configuration configuration, + String __1) { + return configuration.dsl().selectFrom( + com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1)).fetch(); + } + + /** + * Get public.pgp_armor_headers as a table. + */ + public static JPgpArmorHeaders PGP_ARMOR_HEADERS(String __1) { + return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); + } + + /** + * Get public.pgp_armor_headers as a table. + */ + public static JPgpArmorHeaders PGP_ARMOR_HEADERS(Field __1) { + return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JAccessTokenTypeEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JAccessTokenTypeEnum.java index aa9293ca3..fa8d20227 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JAccessTokenTypeEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JAccessTokenTypeEnum.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.JPublic; - import javax.annotation.processing.Generated; - import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -23,40 +21,40 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public enum JAccessTokenTypeEnum implements EnumType { - OAUTH("OAUTH"), + OAUTH("OAUTH"), - NTLM("NTLM"), + NTLM("NTLM"), - APIKEY("APIKEY"), + APIKEY("APIKEY"), - BASIC("BASIC"); + BASIC("BASIC"); - private final String literal; + private final String literal; - private JAccessTokenTypeEnum(String literal) { - this.literal = literal; - } + private JAccessTokenTypeEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "access_token_type_enum"; - } + @Override + public String getName() { + return "access_token_type_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JAuthTypeEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JAuthTypeEnum.java index b1d17d910..fe9b5ae34 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JAuthTypeEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JAuthTypeEnum.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.JPublic; - import javax.annotation.processing.Generated; - import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -23,40 +21,40 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public enum JAuthTypeEnum implements EnumType { - OAUTH("OAUTH"), + OAUTH("OAUTH"), - NTLM("NTLM"), + NTLM("NTLM"), - APIKEY("APIKEY"), + APIKEY("APIKEY"), - BASIC("BASIC"); + BASIC("BASIC"); - private final String literal; + private final String literal; - private JAuthTypeEnum(String literal) { - this.literal = literal; - } + private JAuthTypeEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "auth_type_enum"; - } + @Override + public String getName() { + return "auth_type_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JFilterConditionEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JFilterConditionEnum.java index 8d2af3a71..0d16a047a 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JFilterConditionEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JFilterConditionEnum.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.JPublic; - import javax.annotation.processing.Generated; - import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -23,56 +21,56 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public enum JFilterConditionEnum implements EnumType { - EQUALS("EQUALS"), + EQUALS("EQUALS"), - NOT_EQUALS("NOT_EQUALS"), + NOT_EQUALS("NOT_EQUALS"), - CONTAINS("CONTAINS"), + CONTAINS("CONTAINS"), - EXISTS("EXISTS"), + EXISTS("EXISTS"), - IN("IN"), + IN("IN"), - HAS("HAS"), + HAS("HAS"), - GREATER_THAN("GREATER_THAN"), + GREATER_THAN("GREATER_THAN"), - GREATER_THAN_OR_EQUALS("GREATER_THAN_OR_EQUALS"), + GREATER_THAN_OR_EQUALS("GREATER_THAN_OR_EQUALS"), - LOWER_THAN("LOWER_THAN"), + LOWER_THAN("LOWER_THAN"), - LOWER_THAN_OR_EQUALS("LOWER_THAN_OR_EQUALS"), + LOWER_THAN_OR_EQUALS("LOWER_THAN_OR_EQUALS"), - BETWEEN("BETWEEN"), + BETWEEN("BETWEEN"), - ANY("ANY"); + ANY("ANY"); - private final String literal; + private final String literal; - private JFilterConditionEnum(String literal) { - this.literal = literal; - } + private JFilterConditionEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "filter_condition_enum"; - } + @Override + public String getName() { + return "filter_condition_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationAuthFlowEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationAuthFlowEnum.java index e03b48f97..35de465f3 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationAuthFlowEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationAuthFlowEnum.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.JPublic; - import javax.annotation.processing.Generated; - import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -23,42 +21,42 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public enum JIntegrationAuthFlowEnum implements EnumType { - OAUTH("OAUTH"), + OAUTH("OAUTH"), - BASIC("BASIC"), + BASIC("BASIC"), - TOKEN("TOKEN"), + TOKEN("TOKEN"), - FORM("FORM"), + FORM("FORM"), - LDAP("LDAP"); + LDAP("LDAP"); - private final String literal; + private final String literal; - private JIntegrationAuthFlowEnum(String literal) { - this.literal = literal; - } + private JIntegrationAuthFlowEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "integration_auth_flow_enum"; - } + @Override + public String getName() { + return "integration_auth_flow_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationGroupEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationGroupEnum.java index cfc69d36b..8446426a9 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationGroupEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationGroupEnum.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.JPublic; - import javax.annotation.processing.Generated; - import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -23,40 +21,40 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public enum JIntegrationGroupEnum implements EnumType { - BTS("BTS"), + BTS("BTS"), - NOTIFICATION("NOTIFICATION"), + NOTIFICATION("NOTIFICATION"), - AUTH("AUTH"), + AUTH("AUTH"), - OTHER("OTHER"); + OTHER("OTHER"); - private final String literal; + private final String literal; - private JIntegrationGroupEnum(String literal) { - this.literal = literal; - } + private JIntegrationGroupEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "integration_group_enum"; - } + @Override + public String getName() { + return "integration_group_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JIssueGroupEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JIssueGroupEnum.java index c0ed38f2d..86661b5ed 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JIssueGroupEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JIssueGroupEnum.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.JPublic; - import javax.annotation.processing.Generated; - import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -23,42 +21,42 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public enum JIssueGroupEnum implements EnumType { - PRODUCT_BUG("PRODUCT_BUG"), + PRODUCT_BUG("PRODUCT_BUG"), - AUTOMATION_BUG("AUTOMATION_BUG"), + AUTOMATION_BUG("AUTOMATION_BUG"), - SYSTEM_ISSUE("SYSTEM_ISSUE"), + SYSTEM_ISSUE("SYSTEM_ISSUE"), - TO_INVESTIGATE("TO_INVESTIGATE"), + TO_INVESTIGATE("TO_INVESTIGATE"), - NO_DEFECT("NO_DEFECT"); + NO_DEFECT("NO_DEFECT"); - private final String literal; + private final String literal; - private JIssueGroupEnum(String literal) { - this.literal = literal; - } + private JIssueGroupEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "issue_group_enum"; - } + @Override + public String getName() { + return "issue_group_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JLaunchModeEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JLaunchModeEnum.java index 3a8a1e391..3e14ed76a 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JLaunchModeEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JLaunchModeEnum.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.JPublic; - import javax.annotation.processing.Generated; - import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -23,36 +21,36 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public enum JLaunchModeEnum implements EnumType { - DEFAULT("DEFAULT"), + DEFAULT("DEFAULT"), - DEBUG("DEBUG"); + DEBUG("DEBUG"); - private final String literal; + private final String literal; - private JLaunchModeEnum(String literal) { - this.literal = literal; - } + private JLaunchModeEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "launch_mode_enum"; - } + @Override + public String getName() { + return "launch_mode_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JPasswordEncoderType.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JPasswordEncoderType.java index 6c9b84ef2..e7ed7cbd7 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JPasswordEncoderType.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JPasswordEncoderType.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.JPublic; - import javax.annotation.processing.Generated; - import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -23,42 +21,42 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public enum JPasswordEncoderType implements EnumType { - PLAIN("PLAIN"), + PLAIN("PLAIN"), - SHA("SHA"), + SHA("SHA"), - LDAP_SHA("LDAP_SHA"), + LDAP_SHA("LDAP_SHA"), - MD4("MD4"), + MD4("MD4"), - MD5("MD5"); + MD5("MD5"); - private final String literal; + private final String literal; - private JPasswordEncoderType(String literal) { - this.literal = literal; - } + private JPasswordEncoderType(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "password_encoder_type"; - } + @Override + public String getName() { + return "password_encoder_type"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JProjectRoleEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JProjectRoleEnum.java index 0be0d7121..6ae4cbc41 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JProjectRoleEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JProjectRoleEnum.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.JPublic; - import javax.annotation.processing.Generated; - import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -23,40 +21,40 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public enum JProjectRoleEnum implements EnumType { - OPERATOR("OPERATOR"), + OPERATOR("OPERATOR"), - CUSTOMER("CUSTOMER"), + CUSTOMER("CUSTOMER"), - MEMBER("MEMBER"), + MEMBER("MEMBER"), - PROJECT_MANAGER("PROJECT_MANAGER"); + PROJECT_MANAGER("PROJECT_MANAGER"); - private final String literal; + private final String literal; - private JProjectRoleEnum(String literal) { - this.literal = literal; - } + private JProjectRoleEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "project_role_enum"; - } + @Override + public String getName() { + return "project_role_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JSortDirectionEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JSortDirectionEnum.java index 983fbf9c8..2fca2e39d 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JSortDirectionEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JSortDirectionEnum.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.JPublic; - import javax.annotation.processing.Generated; - import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -23,36 +21,36 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public enum JSortDirectionEnum implements EnumType { - ASC("ASC"), + ASC("ASC"), - DESC("DESC"); + DESC("DESC"); - private final String literal; + private final String literal; - private JSortDirectionEnum(String literal) { - this.literal = literal; - } + private JSortDirectionEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "sort_direction_enum"; - } + @Override + public String getName() { + return "sort_direction_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JStatusEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JStatusEnum.java index de5198b17..7d7bf50ff 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JStatusEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JStatusEnum.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.JPublic; - import javax.annotation.processing.Generated; - import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -23,52 +21,52 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public enum JStatusEnum implements EnumType { - CANCELLED("CANCELLED"), + CANCELLED("CANCELLED"), - FAILED("FAILED"), + FAILED("FAILED"), - INTERRUPTED("INTERRUPTED"), + INTERRUPTED("INTERRUPTED"), - IN_PROGRESS("IN_PROGRESS"), + IN_PROGRESS("IN_PROGRESS"), - PASSED("PASSED"), + PASSED("PASSED"), - RESETED("RESETED"), + RESETED("RESETED"), - SKIPPED("SKIPPED"), + SKIPPED("SKIPPED"), - STOPPED("STOPPED"), + STOPPED("STOPPED"), - INFO("INFO"), + INFO("INFO"), - WARN("WARN"); + WARN("WARN"); - private final String literal; + private final String literal; - private JStatusEnum(String literal) { - this.literal = literal; - } + private JStatusEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "status_enum"; - } + @Override + public String getName() { + return "status_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JTestItemTypeEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JTestItemTypeEnum.java index a0ae5219a..43a874cfd 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JTestItemTypeEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JTestItemTypeEnum.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.JPublic; - import javax.annotation.processing.Generated; - import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -23,62 +21,62 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public enum JTestItemTypeEnum implements EnumType { - AFTER_CLASS("AFTER_CLASS"), + AFTER_CLASS("AFTER_CLASS"), - AFTER_GROUPS("AFTER_GROUPS"), + AFTER_GROUPS("AFTER_GROUPS"), - AFTER_METHOD("AFTER_METHOD"), + AFTER_METHOD("AFTER_METHOD"), - AFTER_SUITE("AFTER_SUITE"), + AFTER_SUITE("AFTER_SUITE"), - AFTER_TEST("AFTER_TEST"), + AFTER_TEST("AFTER_TEST"), - BEFORE_CLASS("BEFORE_CLASS"), + BEFORE_CLASS("BEFORE_CLASS"), - BEFORE_GROUPS("BEFORE_GROUPS"), + BEFORE_GROUPS("BEFORE_GROUPS"), - BEFORE_METHOD("BEFORE_METHOD"), + BEFORE_METHOD("BEFORE_METHOD"), - BEFORE_SUITE("BEFORE_SUITE"), + BEFORE_SUITE("BEFORE_SUITE"), - BEFORE_TEST("BEFORE_TEST"), + BEFORE_TEST("BEFORE_TEST"), - SCENARIO("SCENARIO"), + SCENARIO("SCENARIO"), - STEP("STEP"), + STEP("STEP"), - STORY("STORY"), + STORY("STORY"), - SUITE("SUITE"), + SUITE("SUITE"), - TEST("TEST"); + TEST("TEST"); - private final String literal; + private final String literal; - private JTestItemTypeEnum(String literal) { - this.literal = literal; - } + private JTestItemTypeEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "test_item_type_enum"; - } + @Override + public String getName() { + return "test_item_type_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclClass.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclClass.java index e96a2cab2..96992fa6a 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclClass.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclClass.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JAclClassRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,129 +36,130 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JAclClass extends TableImpl { - private static final long serialVersionUID = -211706799; - - /** - * The reference instance of public.acl_class - */ - public static final JAclClass ACL_CLASS = new JAclClass(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JAclClassRecord.class; - } - - /** - * The column public.acl_class.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('acl_class_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.acl_class.class. - */ - public final TableField CLASS = createField(DSL.name("class"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - - /** - * The column public.acl_class.class_id_type. - */ - public final TableField CLASS_ID_TYPE = createField(DSL.name("class_id_type"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); - - /** - * Create a public.acl_class table reference - */ - public JAclClass() { - this(DSL.name("acl_class"), null); - } - - /** - * Create an aliased public.acl_class table reference - */ - public JAclClass(String alias) { - this(DSL.name(alias), ACL_CLASS); - } - - /** - * Create an aliased public.acl_class table reference - */ - public JAclClass(Name alias) { - this(alias, ACL_CLASS); - } - - private JAclClass(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JAclClass(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JAclClass(Table child, ForeignKey key) { - super(child, key, ACL_CLASS); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ACL_CLASS_PKEY, Indexes.UNIQUE_UK_2); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ACL_CLASS; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ACL_CLASS_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ACL_CLASS_PKEY, Keys.UNIQUE_UK_2); - } - - @Override - public JAclClass as(String alias) { - return new JAclClass(DSL.name(alias), this); - } - - @Override - public JAclClass as(Name alias) { - return new JAclClass(alias, this); - } - - /** - * Rename this table - */ - @Override - public JAclClass rename(String name) { - return new JAclClass(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JAclClass rename(Name name) { - return new JAclClass(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + /** + * The reference instance of public.acl_class + */ + public static final JAclClass ACL_CLASS = new JAclClass(); + private static final long serialVersionUID = -211706799; + /** + * The column public.acl_class.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('acl_class_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.acl_class.class. + */ + public final TableField CLASS = createField(DSL.name("class"), + org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); + /** + * The column public.acl_class.class_id_type. + */ + public final TableField CLASS_ID_TYPE = createField( + DSL.name("class_id_type"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); + + /** + * Create a public.acl_class table reference + */ + public JAclClass() { + this(DSL.name("acl_class"), null); + } + + /** + * Create an aliased public.acl_class table reference + */ + public JAclClass(String alias) { + this(DSL.name(alias), ACL_CLASS); + } + + /** + * Create an aliased public.acl_class table reference + */ + public JAclClass(Name alias) { + this(alias, ACL_CLASS); + } + + private JAclClass(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JAclClass(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JAclClass(Table child, ForeignKey key) { + super(child, key, ACL_CLASS); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JAclClassRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ACL_CLASS_PKEY, Indexes.UNIQUE_UK_2); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ACL_CLASS; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ACL_CLASS_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ACL_CLASS_PKEY, Keys.UNIQUE_UK_2); + } + + @Override + public JAclClass as(String alias) { + return new JAclClass(DSL.name(alias), this); + } + + @Override + public JAclClass as(Name alias) { + return new JAclClass(alias, this); + } + + /** + * Rename this table + */ + @Override + public JAclClass rename(String name) { + return new JAclClass(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JAclClass rename(Name name) { + return new JAclClass(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclEntry.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclEntry.java index 967e7759c..78c4cd6c9 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclEntry.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclEntry.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JAclEntryRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,167 +36,169 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JAclEntry extends TableImpl { - private static final long serialVersionUID = 300624344; - - /** - * The reference instance of public.acl_entry - */ - public static final JAclEntry ACL_ENTRY = new JAclEntry(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JAclEntryRecord.class; - } - - /** - * The column public.acl_entry.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('acl_entry_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.acl_entry.acl_object_identity. - */ - public final TableField ACL_OBJECT_IDENTITY = createField(DSL.name("acl_object_identity"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.acl_entry.ace_order. - */ - public final TableField ACE_ORDER = createField(DSL.name("ace_order"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column public.acl_entry.sid. - */ - public final TableField SID = createField(DSL.name("sid"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.acl_entry.mask. - */ - public final TableField MASK = createField(DSL.name("mask"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column public.acl_entry.granting. - */ - public final TableField GRANTING = createField(DSL.name("granting"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - - /** - * The column public.acl_entry.audit_success. - */ - public final TableField AUDIT_SUCCESS = createField(DSL.name("audit_success"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - - /** - * The column public.acl_entry.audit_failure. - */ - public final TableField AUDIT_FAILURE = createField(DSL.name("audit_failure"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - - /** - * Create a public.acl_entry table reference - */ - public JAclEntry() { - this(DSL.name("acl_entry"), null); - } - - /** - * Create an aliased public.acl_entry table reference - */ - public JAclEntry(String alias) { - this(DSL.name(alias), ACL_ENTRY); - } - - /** - * Create an aliased public.acl_entry table reference - */ - public JAclEntry(Name alias) { - this(alias, ACL_ENTRY); - } - - private JAclEntry(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JAclEntry(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JAclEntry(Table child, ForeignKey key) { - super(child, key, ACL_ENTRY); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ACL_ENTRY_PKEY, Indexes.UNIQUE_UK_4); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ACL_ENTRY; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ACL_ENTRY_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ACL_ENTRY_PKEY, Keys.UNIQUE_UK_4); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ACL_ENTRY__FOREIGN_FK_4, Keys.ACL_ENTRY__FOREIGN_FK_5); - } - - public JAclObjectIdentity aclObjectIdentity() { - return new JAclObjectIdentity(this, Keys.ACL_ENTRY__FOREIGN_FK_4); - } - - public JAclSid aclSid() { - return new JAclSid(this, Keys.ACL_ENTRY__FOREIGN_FK_5); - } - - @Override - public JAclEntry as(String alias) { - return new JAclEntry(DSL.name(alias), this); - } - - @Override - public JAclEntry as(Name alias) { - return new JAclEntry(alias, this); - } - - /** - * Rename this table - */ - @Override - public JAclEntry rename(String name) { - return new JAclEntry(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JAclEntry rename(Name name) { - return new JAclEntry(name, null); - } - - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } + /** + * The reference instance of public.acl_entry + */ + public static final JAclEntry ACL_ENTRY = new JAclEntry(); + private static final long serialVersionUID = 300624344; + /** + * The column public.acl_entry.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('acl_entry_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.acl_entry.acl_object_identity. + */ + public final TableField ACL_OBJECT_IDENTITY = createField( + DSL.name("acl_object_identity"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.acl_entry.ace_order. + */ + public final TableField ACE_ORDER = createField(DSL.name("ace_order"), + org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + /** + * The column public.acl_entry.sid. + */ + public final TableField SID = createField(DSL.name("sid"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.acl_entry.mask. + */ + public final TableField MASK = createField(DSL.name("mask"), + org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + /** + * The column public.acl_entry.granting. + */ + public final TableField GRANTING = createField(DSL.name("granting"), + org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); + /** + * The column public.acl_entry.audit_success. + */ + public final TableField AUDIT_SUCCESS = createField( + DSL.name("audit_success"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); + /** + * The column public.acl_entry.audit_failure. + */ + public final TableField AUDIT_FAILURE = createField( + DSL.name("audit_failure"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); + + /** + * Create a public.acl_entry table reference + */ + public JAclEntry() { + this(DSL.name("acl_entry"), null); + } + + /** + * Create an aliased public.acl_entry table reference + */ + public JAclEntry(String alias) { + this(DSL.name(alias), ACL_ENTRY); + } + + /** + * Create an aliased public.acl_entry table reference + */ + public JAclEntry(Name alias) { + this(alias, ACL_ENTRY); + } + + private JAclEntry(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JAclEntry(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JAclEntry(Table child, ForeignKey key) { + super(child, key, ACL_ENTRY); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JAclEntryRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ACL_ENTRY_PKEY, Indexes.UNIQUE_UK_4); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ACL_ENTRY; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ACL_ENTRY_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ACL_ENTRY_PKEY, Keys.UNIQUE_UK_4); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ACL_ENTRY__FOREIGN_FK_4, + Keys.ACL_ENTRY__FOREIGN_FK_5); + } + + public JAclObjectIdentity aclObjectIdentity() { + return new JAclObjectIdentity(this, Keys.ACL_ENTRY__FOREIGN_FK_4); + } + + public JAclSid aclSid() { + return new JAclSid(this, Keys.ACL_ENTRY__FOREIGN_FK_5); + } + + @Override + public JAclEntry as(String alias) { + return new JAclEntry(DSL.name(alias), this); + } + + @Override + public JAclEntry as(Name alias) { + return new JAclEntry(alias, this); + } + + /** + * Rename this table + */ + @Override + public JAclEntry rename(String name) { + return new JAclEntry(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JAclEntry rename(Name name) { + return new JAclEntry(name, null); + } + + // ------------------------------------------------------------------------- + // Row8 type methods + // ------------------------------------------------------------------------- + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclObjectIdentity.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclObjectIdentity.java index 60968661a..e31fd8c41 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclObjectIdentity.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclObjectIdentity.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JAclObjectIdentityRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,161 +36,169 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JAclObjectIdentity extends TableImpl { - private static final long serialVersionUID = -275800054; - - /** - * The reference instance of public.acl_object_identity - */ - public static final JAclObjectIdentity ACL_OBJECT_IDENTITY = new JAclObjectIdentity(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JAclObjectIdentityRecord.class; - } - - /** - * The column public.acl_object_identity.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('acl_object_identity_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.acl_object_identity.object_id_class. - */ - public final TableField OBJECT_ID_CLASS = createField(DSL.name("object_id_class"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.acl_object_identity.object_id_identity. - */ - public final TableField OBJECT_ID_IDENTITY = createField(DSL.name("object_id_identity"), org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, ""); - - /** - * The column public.acl_object_identity.parent_object. - */ - public final TableField PARENT_OBJECT = createField(DSL.name("parent_object"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.acl_object_identity.owner_sid. - */ - public final TableField OWNER_SID = createField(DSL.name("owner_sid"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.acl_object_identity.entries_inheriting. - */ - public final TableField ENTRIES_INHERITING = createField(DSL.name("entries_inheriting"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - - /** - * Create a public.acl_object_identity table reference - */ - public JAclObjectIdentity() { - this(DSL.name("acl_object_identity"), null); - } - - /** - * Create an aliased public.acl_object_identity table reference - */ - public JAclObjectIdentity(String alias) { - this(DSL.name(alias), ACL_OBJECT_IDENTITY); - } - - /** - * Create an aliased public.acl_object_identity table reference - */ - public JAclObjectIdentity(Name alias) { - this(alias, ACL_OBJECT_IDENTITY); - } - - private JAclObjectIdentity(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JAclObjectIdentity(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JAclObjectIdentity(Table child, ForeignKey key) { - super(child, key, ACL_OBJECT_IDENTITY); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ACL_OBJECT_IDENTITY_PKEY, Indexes.UNIQUE_UK_3); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ACL_OBJECT_IDENTITY; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ACL_OBJECT_IDENTITY_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ACL_OBJECT_IDENTITY_PKEY, Keys.UNIQUE_UK_3); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_2, Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_1, Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_3); - } - - public JAclClass aclClass() { - return new JAclClass(this, Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_2); - } - - public com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity aclObjectIdentity() { - return new com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity(this, Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_1); - } - - public JAclSid aclSid() { - return new JAclSid(this, Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_3); - } - - @Override - public JAclObjectIdentity as(String alias) { - return new JAclObjectIdentity(DSL.name(alias), this); - } - - @Override - public JAclObjectIdentity as(Name alias) { - return new JAclObjectIdentity(alias, this); - } - - /** - * Rename this table - */ - @Override - public JAclObjectIdentity rename(String name) { - return new JAclObjectIdentity(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JAclObjectIdentity rename(Name name) { - return new JAclObjectIdentity(name, null); - } - - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } + /** + * The reference instance of public.acl_object_identity + */ + public static final JAclObjectIdentity ACL_OBJECT_IDENTITY = new JAclObjectIdentity(); + private static final long serialVersionUID = -275800054; + /** + * The column public.acl_object_identity.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('acl_object_identity_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.acl_object_identity.object_id_class. + */ + public final TableField OBJECT_ID_CLASS = createField( + DSL.name("object_id_class"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.acl_object_identity.object_id_identity. + */ + public final TableField OBJECT_ID_IDENTITY = createField( + DSL.name("object_id_identity"), org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, + ""); + /** + * The column public.acl_object_identity.parent_object. + */ + public final TableField PARENT_OBJECT = createField( + DSL.name("parent_object"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.acl_object_identity.owner_sid. + */ + public final TableField OWNER_SID = createField( + DSL.name("owner_sid"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.acl_object_identity.entries_inheriting. + */ + public final TableField ENTRIES_INHERITING = createField( + DSL.name("entries_inheriting"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); + + /** + * Create a public.acl_object_identity table reference + */ + public JAclObjectIdentity() { + this(DSL.name("acl_object_identity"), null); + } + + /** + * Create an aliased public.acl_object_identity table reference + */ + public JAclObjectIdentity(String alias) { + this(DSL.name(alias), ACL_OBJECT_IDENTITY); + } + + /** + * Create an aliased public.acl_object_identity table reference + */ + public JAclObjectIdentity(Name alias) { + this(alias, ACL_OBJECT_IDENTITY); + } + + private JAclObjectIdentity(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JAclObjectIdentity(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JAclObjectIdentity(Table child, + ForeignKey key) { + super(child, key, ACL_OBJECT_IDENTITY); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JAclObjectIdentityRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ACL_OBJECT_IDENTITY_PKEY, Indexes.UNIQUE_UK_3); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ACL_OBJECT_IDENTITY; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ACL_OBJECT_IDENTITY_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ACL_OBJECT_IDENTITY_PKEY, + Keys.UNIQUE_UK_3); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_2, Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_1, + Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_3); + } + + public JAclClass aclClass() { + return new JAclClass(this, Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_2); + } + + public com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity aclObjectIdentity() { + return new com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity(this, + Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_1); + } + + public JAclSid aclSid() { + return new JAclSid(this, Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_3); + } + + @Override + public JAclObjectIdentity as(String alias) { + return new JAclObjectIdentity(DSL.name(alias), this); + } + + @Override + public JAclObjectIdentity as(Name alias) { + return new JAclObjectIdentity(alias, this); + } + + /** + * Rename this table + */ + @Override + public JAclObjectIdentity rename(String name) { + return new JAclObjectIdentity(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JAclObjectIdentity rename(Name name) { + return new JAclObjectIdentity(name, null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclSid.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclSid.java index 5c7769440..6d0aa4d75 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclSid.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclSid.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JAclSidRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,138 +36,139 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JAclSid extends TableImpl { - private static final long serialVersionUID = 1699356761; - - /** - * The reference instance of public.acl_sid - */ - public static final JAclSid ACL_SID = new JAclSid(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JAclSidRecord.class; - } - - /** - * The column public.acl_sid.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('acl_sid_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.acl_sid.principal. - */ - public final TableField PRINCIPAL = createField(DSL.name("principal"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - - /** - * The column public.acl_sid.sid. - */ - public final TableField SID = createField(DSL.name("sid"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - - /** - * Create a public.acl_sid table reference - */ - public JAclSid() { - this(DSL.name("acl_sid"), null); - } - - /** - * Create an aliased public.acl_sid table reference - */ - public JAclSid(String alias) { - this(DSL.name(alias), ACL_SID); - } - - /** - * Create an aliased public.acl_sid table reference - */ - public JAclSid(Name alias) { - this(alias, ACL_SID); - } - - private JAclSid(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JAclSid(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JAclSid(Table child, ForeignKey key) { - super(child, key, ACL_SID); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ACL_SID_IDX, Indexes.ACL_SID_PKEY, Indexes.UNIQUE_UK_1); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ACL_SID; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ACL_SID_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ACL_SID_PKEY, Keys.UNIQUE_UK_1); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ACL_SID__ACL_SID_SID_FKEY); - } - - public JUsers users() { - return new JUsers(this, Keys.ACL_SID__ACL_SID_SID_FKEY); - } - - @Override - public JAclSid as(String alias) { - return new JAclSid(DSL.name(alias), this); - } - - @Override - public JAclSid as(Name alias) { - return new JAclSid(alias, this); - } - - /** - * Rename this table - */ - @Override - public JAclSid rename(String name) { - return new JAclSid(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JAclSid rename(Name name) { - return new JAclSid(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + /** + * The reference instance of public.acl_sid + */ + public static final JAclSid ACL_SID = new JAclSid(); + private static final long serialVersionUID = 1699356761; + /** + * The column public.acl_sid.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('acl_sid_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.acl_sid.principal. + */ + public final TableField PRINCIPAL = createField(DSL.name("principal"), + org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); + /** + * The column public.acl_sid.sid. + */ + public final TableField SID = createField(DSL.name("sid"), + org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); + + /** + * Create a public.acl_sid table reference + */ + public JAclSid() { + this(DSL.name("acl_sid"), null); + } + + /** + * Create an aliased public.acl_sid table reference + */ + public JAclSid(String alias) { + this(DSL.name(alias), ACL_SID); + } + + /** + * Create an aliased public.acl_sid table reference + */ + public JAclSid(Name alias) { + this(alias, ACL_SID); + } + + private JAclSid(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JAclSid(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JAclSid(Table child, ForeignKey key) { + super(child, key, ACL_SID); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JAclSidRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ACL_SID_IDX, Indexes.ACL_SID_PKEY, Indexes.UNIQUE_UK_1); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ACL_SID; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ACL_SID_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ACL_SID_PKEY, Keys.UNIQUE_UK_1); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ACL_SID__ACL_SID_SID_FKEY); + } + + public JUsers users() { + return new JUsers(this, Keys.ACL_SID__ACL_SID_SID_FKEY); + } + + @Override + public JAclSid as(String alias) { + return new JAclSid(DSL.name(alias), this); + } + + @Override + public JAclSid as(Name alias) { + return new JAclSid(alias, this); + } + + /** + * Rename this table + */ + @Override + public JAclSid rename(String name) { + return new JAclSid(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JAclSid rename(Name name) { + return new JAclSid(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JActivity.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JActivity.java index f837a1059..a825ce21f 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JActivity.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JActivity.java @@ -8,13 +8,10 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JActivityRecord; - import java.sql.Timestamp; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -41,172 +38,175 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JActivity extends TableImpl { - private static final long serialVersionUID = 152202898; - - /** - * The reference instance of public.activity - */ - public static final JActivity ACTIVITY = new JActivity(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JActivityRecord.class; - } - - /** - * The column public.activity.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('activity_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.activity.user_id. - */ - public final TableField USER_ID = createField(DSL.name("user_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.activity.username. - */ - public final TableField USERNAME = createField(DSL.name("username"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - - /** - * The column public.activity.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.activity.entity. - */ - public final TableField ENTITY = createField(DSL.name("entity"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - - /** - * The column public.activity.action. - */ - public final TableField ACTION = createField(DSL.name("action"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - - /** - * The column public.activity.details. - */ - public final TableField DETAILS = createField(DSL.name("details"), org.jooq.impl.SQLDataType.JSONB, this, ""); - - /** - * The column public.activity.creation_date. - */ - public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - - /** - * The column public.activity.object_id. - */ - public final TableField OBJECT_ID = createField(DSL.name("object_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * Create a public.activity table reference - */ - public JActivity() { - this(DSL.name("activity"), null); - } - - /** - * Create an aliased public.activity table reference - */ - public JActivity(String alias) { - this(DSL.name(alias), ACTIVITY); - } - - /** - * Create an aliased public.activity table reference - */ - public JActivity(Name alias) { - this(alias, ACTIVITY); - } - - private JActivity(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JActivity(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JActivity(Table child, ForeignKey key) { - super(child, key, ACTIVITY); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ACTIVITY_CREATION_DATE_IDX, Indexes.ACTIVITY_OBJECT_IDX, Indexes.ACTIVITY_PK, Indexes.ACTIVITY_PROJECT_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ACTIVITY; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ACTIVITY_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ACTIVITY_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ACTIVITY__ACTIVITY_USER_ID_FKEY, Keys.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY); - } - - public JUsers users() { - return new JUsers(this, Keys.ACTIVITY__ACTIVITY_USER_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY); - } - - @Override - public JActivity as(String alias) { - return new JActivity(DSL.name(alias), this); - } - - @Override - public JActivity as(Name alias) { - return new JActivity(alias, this); - } - - /** - * Rename this table - */ - @Override - public JActivity rename(String name) { - return new JActivity(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JActivity rename(Name name) { - return new JActivity(name, null); - } - - // ------------------------------------------------------------------------- - // Row9 type methods - // ------------------------------------------------------------------------- - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } + /** + * The reference instance of public.activity + */ + public static final JActivity ACTIVITY = new JActivity(); + private static final long serialVersionUID = 152202898; + /** + * The column public.activity.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('activity_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.activity.user_id. + */ + public final TableField USER_ID = createField(DSL.name("user_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.activity.username. + */ + public final TableField USERNAME = createField(DSL.name("username"), + org.jooq.impl.SQLDataType.VARCHAR, this, ""); + /** + * The column public.activity.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.activity.entity. + */ + public final TableField ENTITY = createField(DSL.name("entity"), + org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); + /** + * The column public.activity.action. + */ + public final TableField ACTION = createField(DSL.name("action"), + org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); + /** + * The column public.activity.details. + */ + public final TableField DETAILS = createField(DSL.name("details"), + org.jooq.impl.SQLDataType.JSONB, this, ""); + /** + * The column public.activity.creation_date. + */ + public final TableField CREATION_DATE = createField( + DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + /** + * The column public.activity.object_id. + */ + public final TableField OBJECT_ID = createField(DSL.name("object_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * Create a public.activity table reference + */ + public JActivity() { + this(DSL.name("activity"), null); + } + + /** + * Create an aliased public.activity table reference + */ + public JActivity(String alias) { + this(DSL.name(alias), ACTIVITY); + } + + /** + * Create an aliased public.activity table reference + */ + public JActivity(Name alias) { + this(alias, ACTIVITY); + } + + private JActivity(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JActivity(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JActivity(Table child, ForeignKey key) { + super(child, key, ACTIVITY); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JActivityRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ACTIVITY_CREATION_DATE_IDX, Indexes.ACTIVITY_OBJECT_IDX, + Indexes.ACTIVITY_PK, Indexes.ACTIVITY_PROJECT_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ACTIVITY; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ACTIVITY_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ACTIVITY_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ACTIVITY__ACTIVITY_USER_ID_FKEY, + Keys.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY); + } + + public JUsers users() { + return new JUsers(this, Keys.ACTIVITY__ACTIVITY_USER_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY); + } + + @Override + public JActivity as(String alias) { + return new JActivity(DSL.name(alias), this); + } + + @Override + public JActivity as(Name alias) { + return new JActivity(alias, this); + } + + /** + * Rename this table + */ + @Override + public JActivity rename(String name) { + return new JActivity(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JActivity rename(Name name) { + return new JActivity(name, null); + } + + // ------------------------------------------------------------------------- + // Row9 type methods + // ------------------------------------------------------------------------- + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java index 17b911178..e3b277c5f 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java @@ -8,13 +8,10 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JAttachmentRecord; - import java.sql.Timestamp; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -40,159 +37,163 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JAttachment extends TableImpl { - private static final long serialVersionUID = -1988681978; - - /** - * The reference instance of public.attachment - */ - public static final JAttachment ATTACHMENT = new JAttachment(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JAttachmentRecord.class; - } - - /** - * The column public.attachment.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('attachment_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.attachment.file_id. - */ - public final TableField FILE_ID = createField(DSL.name("file_id"), org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); - - /** - * The column public.attachment.thumbnail_id. - */ - public final TableField THUMBNAIL_ID = createField(DSL.name("thumbnail_id"), org.jooq.impl.SQLDataType.CLOB, this, ""); - - /** - * The column public.attachment.content_type. - */ - public final TableField CONTENT_TYPE = createField(DSL.name("content_type"), org.jooq.impl.SQLDataType.CLOB, this, ""); - - /** - * The column public.attachment.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.attachment.launch_id. - */ - public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.attachment.item_id. - */ - public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.attachment.file_size. - */ - public final TableField FILE_SIZE = createField(DSL.name("file_size"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("0", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.attachment.creation_date. - */ - public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - - /** - * Create a public.attachment table reference - */ - public JAttachment() { - this(DSL.name("attachment"), null); - } - - /** - * Create an aliased public.attachment table reference - */ - public JAttachment(String alias) { - this(DSL.name(alias), ATTACHMENT); - } - - /** - * Create an aliased public.attachment table reference - */ - public JAttachment(Name alias) { - this(alias, ATTACHMENT); - } - - private JAttachment(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JAttachment(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JAttachment(Table child, ForeignKey key) { - super(child, key, ATTACHMENT); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ATT_ITEM_IDX, Indexes.ATT_LAUNCH_IDX, Indexes.ATT_PROJECT_IDX, Indexes.ATTACHMENT_PK, Indexes.ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ATTACHMENT; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ATTACHMENT_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ATTACHMENT_PK); - } - - @Override - public JAttachment as(String alias) { - return new JAttachment(DSL.name(alias), this); - } - - @Override - public JAttachment as(Name alias) { - return new JAttachment(alias, this); - } - - /** - * Rename this table - */ - @Override - public JAttachment rename(String name) { - return new JAttachment(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JAttachment rename(Name name) { - return new JAttachment(name, null); - } - - // ------------------------------------------------------------------------- - // Row9 type methods - // ------------------------------------------------------------------------- - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } + /** + * The reference instance of public.attachment + */ + public static final JAttachment ATTACHMENT = new JAttachment(); + private static final long serialVersionUID = -1988681978; + /** + * The column public.attachment.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('attachment_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.attachment.file_id. + */ + public final TableField FILE_ID = createField(DSL.name("file_id"), + org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + /** + * The column public.attachment.thumbnail_id. + */ + public final TableField THUMBNAIL_ID = createField( + DSL.name("thumbnail_id"), org.jooq.impl.SQLDataType.CLOB, this, ""); + /** + * The column public.attachment.content_type. + */ + public final TableField CONTENT_TYPE = createField( + DSL.name("content_type"), org.jooq.impl.SQLDataType.CLOB, this, ""); + /** + * The column public.attachment.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.attachment.launch_id. + */ + public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.attachment.item_id. + */ + public final TableField ITEM_ID = createField(DSL.name("item_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.attachment.file_size. + */ + public final TableField FILE_SIZE = createField(DSL.name("file_size"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false) + .defaultValue(org.jooq.impl.DSL.field("0", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.attachment.creation_date. + */ + public final TableField CREATION_DATE = createField( + DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * Create a public.attachment table reference + */ + public JAttachment() { + this(DSL.name("attachment"), null); + } + + /** + * Create an aliased public.attachment table reference + */ + public JAttachment(String alias) { + this(DSL.name(alias), ATTACHMENT); + } + + /** + * Create an aliased public.attachment table reference + */ + public JAttachment(Name alias) { + this(alias, ATTACHMENT); + } + + private JAttachment(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JAttachment(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JAttachment(Table child, ForeignKey key) { + super(child, key, ATTACHMENT); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JAttachmentRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ATT_ITEM_IDX, Indexes.ATT_LAUNCH_IDX, + Indexes.ATT_PROJECT_IDX, Indexes.ATTACHMENT_PK, + Indexes.ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ATTACHMENT; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ATTACHMENT_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ATTACHMENT_PK); + } + + @Override + public JAttachment as(String alias) { + return new JAttachment(DSL.name(alias), this); + } + + @Override + public JAttachment as(Name alias) { + return new JAttachment(alias, this); + } + + /** + * Rename this table + */ + @Override + public JAttachment rename(String name) { + return new JAttachment(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JAttachment rename(Name name) { + return new JAttachment(name, null); + } + + // ------------------------------------------------------------------------- + // Row9 type methods + // ------------------------------------------------------------------------- + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachmentDeletion.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachmentDeletion.java index 6d09bc3a2..669301225 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachmentDeletion.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachmentDeletion.java @@ -8,13 +8,10 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JAttachmentDeletionRecord; - import java.sql.Timestamp; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -39,134 +36,135 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JAttachmentDeletion extends TableImpl { - private static final long serialVersionUID = -2120808493; - - /** - * The reference instance of public.attachment_deletion - */ - public static final JAttachmentDeletion ATTACHMENT_DELETION = new JAttachmentDeletion(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JAttachmentDeletionRecord.class; - } - - /** - * The column public.attachment_deletion.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.attachment_deletion.file_id. - */ - public final TableField FILE_ID = createField(DSL.name("file_id"), org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); - - /** - * The column public.attachment_deletion.thumbnail_id. - */ - public final TableField THUMBNAIL_ID = createField(DSL.name("thumbnail_id"), org.jooq.impl.SQLDataType.CLOB, this, ""); - - /** - * The column public.attachment_deletion.creation_attachment_date. - */ - public final TableField CREATION_ATTACHMENT_DATE = createField(DSL.name("creation_attachment_date"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * The column public.attachment_deletion.deletion_date. - */ - public final TableField DELETION_DATE = createField(DSL.name("deletion_date"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * Create a public.attachment_deletion table reference - */ - public JAttachmentDeletion() { - this(DSL.name("attachment_deletion"), null); - } - - /** - * Create an aliased public.attachment_deletion table reference - */ - public JAttachmentDeletion(String alias) { - this(DSL.name(alias), ATTACHMENT_DELETION); - } - - /** - * Create an aliased public.attachment_deletion table reference - */ - public JAttachmentDeletion(Name alias) { - this(alias, ATTACHMENT_DELETION); - } - - private JAttachmentDeletion(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JAttachmentDeletion(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JAttachmentDeletion(Table child, ForeignKey key) { - super(child, key, ATTACHMENT_DELETION); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ATTACHMENT_DELETION_PKEY); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ATTACHMENT_DELETION_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ATTACHMENT_DELETION_PKEY); - } - - @Override - public JAttachmentDeletion as(String alias) { - return new JAttachmentDeletion(DSL.name(alias), this); - } - - @Override - public JAttachmentDeletion as(Name alias) { - return new JAttachmentDeletion(alias, this); - } - - /** - * Rename this table - */ - @Override - public JAttachmentDeletion rename(String name) { - return new JAttachmentDeletion(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JAttachmentDeletion rename(Name name) { - return new JAttachmentDeletion(name, null); - } - - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } + /** + * The reference instance of public.attachment_deletion + */ + public static final JAttachmentDeletion ATTACHMENT_DELETION = new JAttachmentDeletion(); + private static final long serialVersionUID = -2120808493; + /** + * The column public.attachment_deletion.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.attachment_deletion.file_id. + */ + public final TableField FILE_ID = createField( + DSL.name("file_id"), org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + /** + * The column public.attachment_deletion.thumbnail_id. + */ + public final TableField THUMBNAIL_ID = createField( + DSL.name("thumbnail_id"), org.jooq.impl.SQLDataType.CLOB, this, ""); + /** + * The column public.attachment_deletion.creation_attachment_date. + */ + public final TableField CREATION_ATTACHMENT_DATE = createField( + DSL.name("creation_attachment_date"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + /** + * The column public.attachment_deletion.deletion_date. + */ + public final TableField DELETION_DATE = createField( + DSL.name("deletion_date"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + + /** + * Create a public.attachment_deletion table reference + */ + public JAttachmentDeletion() { + this(DSL.name("attachment_deletion"), null); + } + + /** + * Create an aliased public.attachment_deletion table reference + */ + public JAttachmentDeletion(String alias) { + this(DSL.name(alias), ATTACHMENT_DELETION); + } + + /** + * Create an aliased public.attachment_deletion table reference + */ + public JAttachmentDeletion(Name alias) { + this(alias, ATTACHMENT_DELETION); + } + + private JAttachmentDeletion(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JAttachmentDeletion(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JAttachmentDeletion(Table child, + ForeignKey key) { + super(child, key, ATTACHMENT_DELETION); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JAttachmentDeletionRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ATTACHMENT_DELETION_PKEY); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ATTACHMENT_DELETION_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ATTACHMENT_DELETION_PKEY); + } + + @Override + public JAttachmentDeletion as(String alias) { + return new JAttachmentDeletion(DSL.name(alias), this); + } + + @Override + public JAttachmentDeletion as(Name alias) { + return new JAttachmentDeletion(alias, this); + } + + /** + * Rename this table + */ + @Override + public JAttachmentDeletion rename(String name) { + return new JAttachmentDeletion(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JAttachmentDeletion rename(Name name) { + return new JAttachmentDeletion(name, null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttribute.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttribute.java index 547091d40..8cb82c402 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttribute.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttribute.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JAttributeRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,124 +36,125 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JAttribute extends TableImpl { - private static final long serialVersionUID = -720380676; - - /** - * The reference instance of public.attribute - */ - public static final JAttribute ATTRIBUTE = new JAttribute(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JAttributeRecord.class; - } - - /** - * The column public.attribute.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('attribute_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.attribute.name. - */ - public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * Create a public.attribute table reference - */ - public JAttribute() { - this(DSL.name("attribute"), null); - } - - /** - * Create an aliased public.attribute table reference - */ - public JAttribute(String alias) { - this(DSL.name(alias), ATTRIBUTE); - } - - /** - * Create an aliased public.attribute table reference - */ - public JAttribute(Name alias) { - this(alias, ATTRIBUTE); - } - - private JAttribute(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JAttribute(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JAttribute(Table child, ForeignKey key) { - super(child, key, ATTRIBUTE); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ATTRIBUTE_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ATTRIBUTE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ATTRIBUTE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ATTRIBUTE_PK); - } - - @Override - public JAttribute as(String alias) { - return new JAttribute(DSL.name(alias), this); - } - - @Override - public JAttribute as(Name alias) { - return new JAttribute(alias, this); - } - - /** - * Rename this table - */ - @Override - public JAttribute rename(String name) { - return new JAttribute(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JAttribute rename(Name name) { - return new JAttribute(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + /** + * The reference instance of public.attribute + */ + public static final JAttribute ATTRIBUTE = new JAttribute(); + private static final long serialVersionUID = -720380676; + /** + * The column public.attribute.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('attribute_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.attribute.name. + */ + public final TableField NAME = createField(DSL.name("name"), + org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + + /** + * Create a public.attribute table reference + */ + public JAttribute() { + this(DSL.name("attribute"), null); + } + + /** + * Create an aliased public.attribute table reference + */ + public JAttribute(String alias) { + this(DSL.name(alias), ATTRIBUTE); + } + + /** + * Create an aliased public.attribute table reference + */ + public JAttribute(Name alias) { + this(alias, ATTRIBUTE); + } + + private JAttribute(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JAttribute(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JAttribute(Table child, ForeignKey key) { + super(child, key, ATTRIBUTE); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JAttributeRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ATTRIBUTE_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ATTRIBUTE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ATTRIBUTE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ATTRIBUTE_PK); + } + + @Override + public JAttribute as(String alias) { + return new JAttribute(DSL.name(alias), this); + } + + @Override + public JAttribute as(Name alias) { + return new JAttribute(alias, this); + } + + /** + * Rename this table + */ + @Override + public JAttribute rename(String name) { + return new JAttribute(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JAttribute rename(Name name) { + return new JAttribute(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JClusters.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JClusters.java index 5d8ab0c83..9697adcb3 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JClusters.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JClusters.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JClustersRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,139 +36,141 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JClusters extends TableImpl { - private static final long serialVersionUID = -1432286641; - - /** - * The reference instance of public.clusters - */ - public static final JClusters CLUSTERS = new JClusters(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JClustersRecord.class; - } - - /** - * The column public.clusters.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('clusters_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.clusters.index_id. - */ - public final TableField INDEX_ID = createField(DSL.name("index_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.clusters.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.clusters.launch_id. - */ - public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.clusters.message. - */ - public final TableField MESSAGE = createField(DSL.name("message"), org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); - - /** - * Create a public.clusters table reference - */ - public JClusters() { - this(DSL.name("clusters"), null); - } - - /** - * Create an aliased public.clusters table reference - */ - public JClusters(String alias) { - this(DSL.name(alias), CLUSTERS); - } - - /** - * Create an aliased public.clusters table reference - */ - public JClusters(Name alias) { - this(alias, CLUSTERS); - } - - private JClusters(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JClusters(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JClusters(Table child, ForeignKey key) { - super(child, key, CLUSTERS); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.CLUSTER_INDEX_ID_IDX, Indexes.CLUSTER_LAUNCH_IDX, Indexes.CLUSTER_PROJECT_IDX, Indexes.CLUSTERS_PK, Indexes.INDEX_ID_LAUNCH_ID_UNQ); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_CLUSTERS; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.CLUSTERS_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.CLUSTERS_PK, Keys.INDEX_ID_LAUNCH_ID_UNQ); - } - - @Override - public JClusters as(String alias) { - return new JClusters(DSL.name(alias), this); - } - - @Override - public JClusters as(Name alias) { - return new JClusters(alias, this); - } - - /** - * Rename this table - */ - @Override - public JClusters rename(String name) { - return new JClusters(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JClusters rename(Name name) { - return new JClusters(name, null); - } - - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } + /** + * The reference instance of public.clusters + */ + public static final JClusters CLUSTERS = new JClusters(); + private static final long serialVersionUID = -1432286641; + /** + * The column public.clusters.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('clusters_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.clusters.index_id. + */ + public final TableField INDEX_ID = createField(DSL.name("index_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.clusters.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.clusters.launch_id. + */ + public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.clusters.message. + */ + public final TableField MESSAGE = createField(DSL.name("message"), + org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * Create a public.clusters table reference + */ + public JClusters() { + this(DSL.name("clusters"), null); + } + + /** + * Create an aliased public.clusters table reference + */ + public JClusters(String alias) { + this(DSL.name(alias), CLUSTERS); + } + + /** + * Create an aliased public.clusters table reference + */ + public JClusters(Name alias) { + this(alias, CLUSTERS); + } + + private JClusters(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JClusters(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JClusters(Table child, ForeignKey key) { + super(child, key, CLUSTERS); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JClustersRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.CLUSTER_INDEX_ID_IDX, Indexes.CLUSTER_LAUNCH_IDX, + Indexes.CLUSTER_PROJECT_IDX, Indexes.CLUSTERS_PK, Indexes.INDEX_ID_LAUNCH_ID_UNQ); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_CLUSTERS; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.CLUSTERS_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.CLUSTERS_PK, Keys.INDEX_ID_LAUNCH_ID_UNQ); + } + + @Override + public JClusters as(String alias) { + return new JClusters(DSL.name(alias), this); + } + + @Override + public JClusters as(Name alias) { + return new JClusters(alias, this); + } + + /** + * Rename this table + */ + @Override + public JClusters rename(String name) { + return new JClusters(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JClusters rename(Name name) { + return new JClusters(name, null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JClustersTestItem.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JClustersTestItem.java index 98498d548..add77055e 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JClustersTestItem.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JClustersTestItem.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JClustersTestItemRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -38,114 +35,116 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JClustersTestItem extends TableImpl { - private static final long serialVersionUID = -1374737681; - - /** - * The reference instance of public.clusters_test_item - */ - public static final JClustersTestItem CLUSTERS_TEST_ITEM = new JClustersTestItem(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JClustersTestItemRecord.class; - } - - /** - * The column public.clusters_test_item.cluster_id. - */ - public final TableField CLUSTER_ID = createField(DSL.name("cluster_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.clusters_test_item.item_id. - */ - public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.clusters_test_item table reference - */ - public JClustersTestItem() { - this(DSL.name("clusters_test_item"), null); - } - - /** - * Create an aliased public.clusters_test_item table reference - */ - public JClustersTestItem(String alias) { - this(DSL.name(alias), CLUSTERS_TEST_ITEM); - } - - /** - * Create an aliased public.clusters_test_item table reference - */ - public JClustersTestItem(Name alias) { - this(alias, CLUSTERS_TEST_ITEM); - } - - private JClustersTestItem(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JClustersTestItem(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JClustersTestItem(Table child, ForeignKey key) { - super(child, key, CLUSTERS_TEST_ITEM); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.CLUSTER_ITEM_CLUSTER_IDX, Indexes.CLUSTER_ITEM_ITEM_IDX, Indexes.CLUSTER_ITEM_UNQ); - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.CLUSTER_ITEM_UNQ); - } - - @Override - public JClustersTestItem as(String alias) { - return new JClustersTestItem(DSL.name(alias), this); - } - - @Override - public JClustersTestItem as(Name alias) { - return new JClustersTestItem(alias, this); - } - - /** - * Rename this table - */ - @Override - public JClustersTestItem rename(String name) { - return new JClustersTestItem(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JClustersTestItem rename(Name name) { - return new JClustersTestItem(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + /** + * The reference instance of public.clusters_test_item + */ + public static final JClustersTestItem CLUSTERS_TEST_ITEM = new JClustersTestItem(); + private static final long serialVersionUID = -1374737681; + /** + * The column public.clusters_test_item.cluster_id. + */ + public final TableField CLUSTER_ID = createField( + DSL.name("cluster_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.clusters_test_item.item_id. + */ + public final TableField ITEM_ID = createField(DSL.name("item_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.clusters_test_item table reference + */ + public JClustersTestItem() { + this(DSL.name("clusters_test_item"), null); + } + + /** + * Create an aliased public.clusters_test_item table reference + */ + public JClustersTestItem(String alias) { + this(DSL.name(alias), CLUSTERS_TEST_ITEM); + } + + /** + * Create an aliased public.clusters_test_item table reference + */ + public JClustersTestItem(Name alias) { + this(alias, CLUSTERS_TEST_ITEM); + } + + private JClustersTestItem(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JClustersTestItem(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JClustersTestItem(Table child, + ForeignKey key) { + super(child, key, CLUSTERS_TEST_ITEM); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JClustersTestItemRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.CLUSTER_ITEM_CLUSTER_IDX, Indexes.CLUSTER_ITEM_ITEM_IDX, + Indexes.CLUSTER_ITEM_UNQ); + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.CLUSTER_ITEM_UNQ); + } + + @Override + public JClustersTestItem as(String alias) { + return new JClustersTestItem(DSL.name(alias), this); + } + + @Override + public JClustersTestItem as(Name alias) { + return new JClustersTestItem(alias, this); + } + + /** + * Rename this table + */ + @Override + public JClustersTestItem rename(String name) { + return new JClustersTestItem(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JClustersTestItem rename(Name name) { + return new JClustersTestItem(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JContentField.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JContentField.java index f180cdba0..2753751b0 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JContentField.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JContentField.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JContentFieldRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -37,118 +34,118 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JContentField extends TableImpl { - private static final long serialVersionUID = 840904857; - - /** - * The reference instance of public.content_field - */ - public static final JContentField CONTENT_FIELD = new JContentField(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JContentFieldRecord.class; - } - - /** - * The column public.content_field.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.content_field.field. - */ - public final TableField FIELD = createField(DSL.name("field"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * Create a public.content_field table reference - */ - public JContentField() { - this(DSL.name("content_field"), null); - } - - /** - * Create an aliased public.content_field table reference - */ - public JContentField(String alias) { - this(DSL.name(alias), CONTENT_FIELD); - } - - /** - * Create an aliased public.content_field table reference - */ - public JContentField(Name alias) { - this(alias, CONTENT_FIELD); - } - - private JContentField(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JContentField(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JContentField(Table child, ForeignKey key) { - super(child, key, CONTENT_FIELD); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.CONTENT_FIELD_IDX, Indexes.CONTENT_FIELD_WIDGET_IDX); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.CONTENT_FIELD__CONTENT_FIELD_ID_FKEY); - } - - public JWidget widget() { - return new JWidget(this, Keys.CONTENT_FIELD__CONTENT_FIELD_ID_FKEY); - } - - @Override - public JContentField as(String alias) { - return new JContentField(DSL.name(alias), this); - } - - @Override - public JContentField as(Name alias) { - return new JContentField(alias, this); - } - - /** - * Rename this table - */ - @Override - public JContentField rename(String name) { - return new JContentField(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JContentField rename(Name name) { - return new JContentField(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + /** + * The reference instance of public.content_field + */ + public static final JContentField CONTENT_FIELD = new JContentField(); + private static final long serialVersionUID = 840904857; + /** + * The column public.content_field.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.content_field.field. + */ + public final TableField FIELD = createField(DSL.name("field"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * Create a public.content_field table reference + */ + public JContentField() { + this(DSL.name("content_field"), null); + } + + /** + * Create an aliased public.content_field table reference + */ + public JContentField(String alias) { + this(DSL.name(alias), CONTENT_FIELD); + } + + /** + * Create an aliased public.content_field table reference + */ + public JContentField(Name alias) { + this(alias, CONTENT_FIELD); + } + + private JContentField(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JContentField(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JContentField(Table child, ForeignKey key) { + super(child, key, CONTENT_FIELD); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JContentFieldRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.CONTENT_FIELD_IDX, Indexes.CONTENT_FIELD_WIDGET_IDX); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.CONTENT_FIELD__CONTENT_FIELD_ID_FKEY); + } + + public JWidget widget() { + return new JWidget(this, Keys.CONTENT_FIELD__CONTENT_FIELD_ID_FKEY); + } + + @Override + public JContentField as(String alias) { + return new JContentField(DSL.name(alias), this); + } + + @Override + public JContentField as(Name alias) { + return new JContentField(alias, this); + } + + /** + * Rename this table + */ + @Override + public JContentField rename(String name) { + return new JContentField(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JContentField rename(Name name) { + return new JContentField(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboard.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboard.java index 023f565c5..882c133aa 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboard.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboard.java @@ -8,13 +8,10 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JDashboardRecord; - import java.sql.Timestamp; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -39,138 +36,139 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JDashboard extends TableImpl { - private static final long serialVersionUID = 282960554; - - /** - * The reference instance of public.dashboard - */ - public static final JDashboard DASHBOARD = new JDashboard(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JDashboardRecord.class; - } - - /** - * The column public.dashboard.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.dashboard.name. - */ - public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.dashboard.description. - */ - public final TableField DESCRIPTION = createField(DSL.name("description"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - - /** - * The column public.dashboard.creation_date. - */ - public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * Create a public.dashboard table reference - */ - public JDashboard() { - this(DSL.name("dashboard"), null); - } - - /** - * Create an aliased public.dashboard table reference - */ - public JDashboard(String alias) { - this(DSL.name(alias), DASHBOARD); - } - - /** - * Create an aliased public.dashboard table reference - */ - public JDashboard(Name alias) { - this(alias, DASHBOARD); - } - - private JDashboard(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JDashboard(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JDashboard(Table child, ForeignKey key) { - super(child, key, DASHBOARD); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.DASHBOARD_PKEY); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.DASHBOARD_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.DASHBOARD_PKEY); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.DASHBOARD__DASHBOARD_ID_FK); - } - - public JShareableEntity shareableEntity() { - return new JShareableEntity(this, Keys.DASHBOARD__DASHBOARD_ID_FK); - } - - @Override - public JDashboard as(String alias) { - return new JDashboard(DSL.name(alias), this); - } - - @Override - public JDashboard as(Name alias) { - return new JDashboard(alias, this); - } - - /** - * Rename this table - */ - @Override - public JDashboard rename(String name) { - return new JDashboard(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JDashboard rename(Name name) { - return new JDashboard(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + /** + * The reference instance of public.dashboard + */ + public static final JDashboard DASHBOARD = new JDashboard(); + private static final long serialVersionUID = 282960554; + /** + * The column public.dashboard.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.dashboard.name. + */ + public final TableField NAME = createField(DSL.name("name"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.dashboard.description. + */ + public final TableField DESCRIPTION = createField( + DSL.name("description"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + /** + * The column public.dashboard.creation_date. + */ + public final TableField CREATION_DATE = createField( + DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false) + .defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), + this, ""); + + /** + * Create a public.dashboard table reference + */ + public JDashboard() { + this(DSL.name("dashboard"), null); + } + + /** + * Create an aliased public.dashboard table reference + */ + public JDashboard(String alias) { + this(DSL.name(alias), DASHBOARD); + } + + /** + * Create an aliased public.dashboard table reference + */ + public JDashboard(Name alias) { + this(alias, DASHBOARD); + } + + private JDashboard(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JDashboard(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JDashboard(Table child, ForeignKey key) { + super(child, key, DASHBOARD); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JDashboardRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.DASHBOARD_PKEY); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.DASHBOARD_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.DASHBOARD_PKEY); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.DASHBOARD__DASHBOARD_ID_FK); + } + + public JShareableEntity shareableEntity() { + return new JShareableEntity(this, Keys.DASHBOARD__DASHBOARD_ID_FK); + } + + @Override + public JDashboard as(String alias) { + return new JDashboard(DSL.name(alias), this); + } + + @Override + public JDashboard as(Name alias) { + return new JDashboard(alias, this); + } + + /** + * Rename this table + */ + @Override + public JDashboard rename(String name) { + return new JDashboard(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JDashboard rename(Name name) { + return new JDashboard(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboardWidget.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboardWidget.java index 4f12dd6f1..f2aa7df8e 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboardWidget.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboardWidget.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JDashboardWidgetRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -38,177 +35,185 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JDashboardWidget extends TableImpl { - private static final long serialVersionUID = -1430378404; - - /** - * The reference instance of public.dashboard_widget - */ - public static final JDashboardWidget DASHBOARD_WIDGET = new JDashboardWidget(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JDashboardWidgetRecord.class; - } - - /** - * The column public.dashboard_widget.dashboard_id. - */ - public final TableField DASHBOARD_ID = createField(DSL.name("dashboard_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.dashboard_widget.widget_id. - */ - public final TableField WIDGET_ID = createField(DSL.name("widget_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.dashboard_widget.widget_name. - */ - public final TableField WIDGET_NAME = createField(DSL.name("widget_name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.dashboard_widget.widget_owner. - */ - public final TableField WIDGET_OWNER = createField(DSL.name("widget_owner"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.dashboard_widget.widget_type. - */ - public final TableField WIDGET_TYPE = createField(DSL.name("widget_type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.dashboard_widget.widget_width. - */ - public final TableField WIDGET_WIDTH = createField(DSL.name("widget_width"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column public.dashboard_widget.widget_height. - */ - public final TableField WIDGET_HEIGHT = createField(DSL.name("widget_height"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column public.dashboard_widget.widget_position_x. - */ - public final TableField WIDGET_POSITION_X = createField(DSL.name("widget_position_x"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column public.dashboard_widget.widget_position_y. - */ - public final TableField WIDGET_POSITION_Y = createField(DSL.name("widget_position_y"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column public.dashboard_widget.is_created_on. - */ - public final TableField IS_CREATED_ON = createField(DSL.name("is_created_on"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false).defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - - /** - * The column public.dashboard_widget.share. - */ - public final TableField SHARE = createField(DSL.name("share"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false).defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - - /** - * Create a public.dashboard_widget table reference - */ - public JDashboardWidget() { - this(DSL.name("dashboard_widget"), null); - } - - /** - * Create an aliased public.dashboard_widget table reference - */ - public JDashboardWidget(String alias) { - this(DSL.name(alias), DASHBOARD_WIDGET); - } - - /** - * Create an aliased public.dashboard_widget table reference - */ - public JDashboardWidget(Name alias) { - this(alias, DASHBOARD_WIDGET); - } - - private JDashboardWidget(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JDashboardWidget(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JDashboardWidget(Table child, ForeignKey key) { - super(child, key, DASHBOARD_WIDGET); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.DASHBOARD_WIDGET_PK, Indexes.WIDGET_ON_DASHBOARD_UNQ); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.DASHBOARD_WIDGET_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.DASHBOARD_WIDGET_PK, Keys.WIDGET_ON_DASHBOARD_UNQ); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY, Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY); - } - - public JDashboard dashboard() { - return new JDashboard(this, Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY); - } - - public JWidget widget() { - return new JWidget(this, Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY); - } - - @Override - public JDashboardWidget as(String alias) { - return new JDashboardWidget(DSL.name(alias), this); - } - - @Override - public JDashboardWidget as(Name alias) { - return new JDashboardWidget(alias, this); - } - - /** - * Rename this table - */ - @Override - public JDashboardWidget rename(String name) { - return new JDashboardWidget(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JDashboardWidget rename(Name name) { - return new JDashboardWidget(name, null); - } - - // ------------------------------------------------------------------------- - // Row11 type methods - // ------------------------------------------------------------------------- - - @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); - } + /** + * The reference instance of public.dashboard_widget + */ + public static final JDashboardWidget DASHBOARD_WIDGET = new JDashboardWidget(); + private static final long serialVersionUID = -1430378404; + /** + * The column public.dashboard_widget.dashboard_id. + */ + public final TableField DASHBOARD_ID = createField( + DSL.name("dashboard_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.dashboard_widget.widget_id. + */ + public final TableField WIDGET_ID = createField( + DSL.name("widget_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.dashboard_widget.widget_name. + */ + public final TableField WIDGET_NAME = createField( + DSL.name("widget_name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.dashboard_widget.widget_owner. + */ + public final TableField WIDGET_OWNER = createField( + DSL.name("widget_owner"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.dashboard_widget.widget_type. + */ + public final TableField WIDGET_TYPE = createField( + DSL.name("widget_type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.dashboard_widget.widget_width. + */ + public final TableField WIDGET_WIDTH = createField( + DSL.name("widget_width"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + /** + * The column public.dashboard_widget.widget_height. + */ + public final TableField WIDGET_HEIGHT = createField( + DSL.name("widget_height"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + /** + * The column public.dashboard_widget.widget_position_x. + */ + public final TableField WIDGET_POSITION_X = createField( + DSL.name("widget_position_x"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + /** + * The column public.dashboard_widget.widget_position_y. + */ + public final TableField WIDGET_POSITION_Y = createField( + DSL.name("widget_position_y"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + /** + * The column public.dashboard_widget.is_created_on. + */ + public final TableField IS_CREATED_ON = createField( + DSL.name("is_created_on"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false) + .defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, + ""); + /** + * The column public.dashboard_widget.share. + */ + public final TableField SHARE = createField(DSL.name("share"), + org.jooq.impl.SQLDataType.BOOLEAN.nullable(false) + .defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, + ""); + + /** + * Create a public.dashboard_widget table reference + */ + public JDashboardWidget() { + this(DSL.name("dashboard_widget"), null); + } + + /** + * Create an aliased public.dashboard_widget table reference + */ + public JDashboardWidget(String alias) { + this(DSL.name(alias), DASHBOARD_WIDGET); + } + + /** + * Create an aliased public.dashboard_widget table reference + */ + public JDashboardWidget(Name alias) { + this(alias, DASHBOARD_WIDGET); + } + + private JDashboardWidget(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JDashboardWidget(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JDashboardWidget(Table child, + ForeignKey key) { + super(child, key, DASHBOARD_WIDGET); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JDashboardWidgetRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.DASHBOARD_WIDGET_PK, Indexes.WIDGET_ON_DASHBOARD_UNQ); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.DASHBOARD_WIDGET_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.DASHBOARD_WIDGET_PK, + Keys.WIDGET_ON_DASHBOARD_UNQ); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY, + Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY); + } + + public JDashboard dashboard() { + return new JDashboard(this, Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY); + } + + public JWidget widget() { + return new JWidget(this, Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY); + } + + @Override + public JDashboardWidget as(String alias) { + return new JDashboardWidget(DSL.name(alias), this); + } + + @Override + public JDashboardWidget as(Name alias) { + return new JDashboardWidget(alias, this); + } + + /** + * Rename this table + */ + @Override + public JDashboardWidget rename(String name) { + return new JDashboardWidget(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JDashboardWidget rename(Name name) { + return new JDashboardWidget(name, null); + } + + // ------------------------------------------------------------------------- + // Row11 type methods + // ------------------------------------------------------------------------- + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilter.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilter.java index a9e033769..f13b84ebf 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilter.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilter.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JFilterRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -38,138 +35,137 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JFilter extends TableImpl { - private static final long serialVersionUID = 991147208; - - /** - * The reference instance of public.filter - */ - public static final JFilter FILTER = new JFilter(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JFilterRecord.class; - } - - /** - * The column public.filter.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.filter.name. - */ - public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.filter.target. - */ - public final TableField TARGET = createField(DSL.name("target"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.filter.description. - */ - public final TableField DESCRIPTION = createField(DSL.name("description"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - - /** - * Create a public.filter table reference - */ - public JFilter() { - this(DSL.name("filter"), null); - } - - /** - * Create an aliased public.filter table reference - */ - public JFilter(String alias) { - this(DSL.name(alias), FILTER); - } - - /** - * Create an aliased public.filter table reference - */ - public JFilter(Name alias) { - this(alias, FILTER); - } - - private JFilter(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JFilter(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JFilter(Table child, ForeignKey key) { - super(child, key, FILTER); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.FILTER_PKEY); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.FILTER_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.FILTER_PKEY); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.FILTER__FILTER_ID_FK); - } - - public JShareableEntity shareableEntity() { - return new JShareableEntity(this, Keys.FILTER__FILTER_ID_FK); - } - - @Override - public JFilter as(String alias) { - return new JFilter(DSL.name(alias), this); - } - - @Override - public JFilter as(Name alias) { - return new JFilter(alias, this); - } - - /** - * Rename this table - */ - @Override - public JFilter rename(String name) { - return new JFilter(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JFilter rename(Name name) { - return new JFilter(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + /** + * The reference instance of public.filter + */ + public static final JFilter FILTER = new JFilter(); + private static final long serialVersionUID = 991147208; + /** + * The column public.filter.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.filter.name. + */ + public final TableField NAME = createField(DSL.name("name"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.filter.target. + */ + public final TableField TARGET = createField(DSL.name("target"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.filter.description. + */ + public final TableField DESCRIPTION = createField(DSL.name("description"), + org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * Create a public.filter table reference + */ + public JFilter() { + this(DSL.name("filter"), null); + } + + /** + * Create an aliased public.filter table reference + */ + public JFilter(String alias) { + this(DSL.name(alias), FILTER); + } + + /** + * Create an aliased public.filter table reference + */ + public JFilter(Name alias) { + this(alias, FILTER); + } + + private JFilter(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JFilter(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JFilter(Table child, ForeignKey key) { + super(child, key, FILTER); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JFilterRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.FILTER_PKEY); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.FILTER_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.FILTER_PKEY); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.FILTER__FILTER_ID_FK); + } + + public JShareableEntity shareableEntity() { + return new JShareableEntity(this, Keys.FILTER__FILTER_ID_FK); + } + + @Override + public JFilter as(String alias) { + return new JFilter(DSL.name(alias), this); + } + + @Override + public JFilter as(Name alias) { + return new JFilter(alias, this); + } + + /** + * Rename this table + */ + @Override + public JFilter rename(String name) { + return new JFilter(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JFilter rename(Name name) { + return new JFilter(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterCondition.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterCondition.java index a37b4c452..5008c50af 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterCondition.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterCondition.java @@ -9,12 +9,9 @@ import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.enums.JFilterConditionEnum; import com.epam.ta.reportportal.jooq.tables.records.JFilterConditionRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -40,153 +37,159 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JFilterCondition extends TableImpl { - private static final long serialVersionUID = 1735686331; - - /** - * The reference instance of public.filter_condition - */ - public static final JFilterCondition FILTER_CONDITION = new JFilterCondition(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JFilterConditionRecord.class; - } - - /** - * The column public.filter_condition.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('filter_condition_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.filter_condition.filter_id. - */ - public final TableField FILTER_ID = createField(DSL.name("filter_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.filter_condition.condition. - */ - public final TableField CONDITION = createField(DSL.name("condition"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JFilterConditionEnum.class), this, ""); - - /** - * The column public.filter_condition.value. - */ - public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.filter_condition.search_criteria. - */ - public final TableField SEARCH_CRITERIA = createField(DSL.name("search_criteria"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.filter_condition.negative. - */ - public final TableField NEGATIVE = createField(DSL.name("negative"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - - /** - * Create a public.filter_condition table reference - */ - public JFilterCondition() { - this(DSL.name("filter_condition"), null); - } - - /** - * Create an aliased public.filter_condition table reference - */ - public JFilterCondition(String alias) { - this(DSL.name(alias), FILTER_CONDITION); - } - - /** - * Create an aliased public.filter_condition table reference - */ - public JFilterCondition(Name alias) { - this(alias, FILTER_CONDITION); - } - - private JFilterCondition(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JFilterCondition(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JFilterCondition(Table child, ForeignKey key) { - super(child, key, FILTER_CONDITION); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.FILTER_COND_FILTER_IDX, Indexes.FILTER_CONDITION_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_FILTER_CONDITION; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.FILTER_CONDITION_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.FILTER_CONDITION_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY); - } - - public JFilter filter() { - return new JFilter(this, Keys.FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY); - } - - @Override - public JFilterCondition as(String alias) { - return new JFilterCondition(DSL.name(alias), this); - } - - @Override - public JFilterCondition as(Name alias) { - return new JFilterCondition(alias, this); - } - - /** - * Rename this table - */ - @Override - public JFilterCondition rename(String name) { - return new JFilterCondition(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JFilterCondition rename(Name name) { - return new JFilterCondition(name, null); - } - - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } + /** + * The reference instance of public.filter_condition + */ + public static final JFilterCondition FILTER_CONDITION = new JFilterCondition(); + private static final long serialVersionUID = 1735686331; + /** + * The column public.filter_condition.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('filter_condition_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.filter_condition.filter_id. + */ + public final TableField FILTER_ID = createField( + DSL.name("filter_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.filter_condition.condition. + */ + public final TableField CONDITION = createField( + DSL.name("condition"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false) + .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JFilterConditionEnum.class), this, + ""); + /** + * The column public.filter_condition.value. + */ + public final TableField VALUE = createField(DSL.name("value"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.filter_condition.search_criteria. + */ + public final TableField SEARCH_CRITERIA = createField( + DSL.name("search_criteria"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.filter_condition.negative. + */ + public final TableField NEGATIVE = createField( + DSL.name("negative"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); + + /** + * Create a public.filter_condition table reference + */ + public JFilterCondition() { + this(DSL.name("filter_condition"), null); + } + + /** + * Create an aliased public.filter_condition table reference + */ + public JFilterCondition(String alias) { + this(DSL.name(alias), FILTER_CONDITION); + } + + /** + * Create an aliased public.filter_condition table reference + */ + public JFilterCondition(Name alias) { + this(alias, FILTER_CONDITION); + } + + private JFilterCondition(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JFilterCondition(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JFilterCondition(Table child, + ForeignKey key) { + super(child, key, FILTER_CONDITION); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JFilterConditionRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.FILTER_COND_FILTER_IDX, Indexes.FILTER_CONDITION_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_FILTER_CONDITION; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.FILTER_CONDITION_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.FILTER_CONDITION_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY); + } + + public JFilter filter() { + return new JFilter(this, Keys.FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY); + } + + @Override + public JFilterCondition as(String alias) { + return new JFilterCondition(DSL.name(alias), this); + } + + @Override + public JFilterCondition as(Name alias) { + return new JFilterCondition(alias, this); + } + + /** + * Rename this table + */ + @Override + public JFilterCondition rename(String name) { + return new JFilterCondition(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JFilterCondition rename(Name name) { + return new JFilterCondition(name, null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterSort.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterSort.java index 9ceedb7f7..f42176568 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterSort.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterSort.java @@ -9,12 +9,9 @@ import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.enums.JSortDirectionEnum; import com.epam.ta.reportportal.jooq.tables.records.JFilterSortRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -40,143 +37,147 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JFilterSort extends TableImpl { - private static final long serialVersionUID = -796123697; - - /** - * The reference instance of public.filter_sort - */ - public static final JFilterSort FILTER_SORT = new JFilterSort(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JFilterSortRecord.class; - } - - /** - * The column public.filter_sort.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('filter_sort_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.filter_sort.filter_id. - */ - public final TableField FILTER_ID = createField(DSL.name("filter_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.filter_sort.field. - */ - public final TableField FIELD = createField(DSL.name("field"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.filter_sort.direction. - */ - public final TableField DIRECTION = createField(DSL.name("direction"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).defaultValue(org.jooq.impl.DSL.field("'ASC'::sort_direction_enum", org.jooq.impl.SQLDataType.VARCHAR)).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JSortDirectionEnum.class), this, ""); - - /** - * Create a public.filter_sort table reference - */ - public JFilterSort() { - this(DSL.name("filter_sort"), null); - } - - /** - * Create an aliased public.filter_sort table reference - */ - public JFilterSort(String alias) { - this(DSL.name(alias), FILTER_SORT); - } - - /** - * Create an aliased public.filter_sort table reference - */ - public JFilterSort(Name alias) { - this(alias, FILTER_SORT); - } - - private JFilterSort(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JFilterSort(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JFilterSort(Table child, ForeignKey key) { - super(child, key, FILTER_SORT); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.FILTER_SORT_FILTER_IDX, Indexes.FILTER_SORT_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_FILTER_SORT; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.FILTER_SORT_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.FILTER_SORT_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY); - } - - public JFilter filter() { - return new JFilter(this, Keys.FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY); - } - - @Override - public JFilterSort as(String alias) { - return new JFilterSort(DSL.name(alias), this); - } - - @Override - public JFilterSort as(Name alias) { - return new JFilterSort(alias, this); - } - - /** - * Rename this table - */ - @Override - public JFilterSort rename(String name) { - return new JFilterSort(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JFilterSort rename(Name name) { - return new JFilterSort(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + /** + * The reference instance of public.filter_sort + */ + public static final JFilterSort FILTER_SORT = new JFilterSort(); + private static final long serialVersionUID = -796123697; + /** + * The column public.filter_sort.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('filter_sort_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.filter_sort.filter_id. + */ + public final TableField FILTER_ID = createField(DSL.name("filter_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.filter_sort.field. + */ + public final TableField FIELD = createField(DSL.name("field"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.filter_sort.direction. + */ + public final TableField DIRECTION = createField( + DSL.name("direction"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).defaultValue( + org.jooq.impl.DSL.field("'ASC'::sort_direction_enum", org.jooq.impl.SQLDataType.VARCHAR)) + .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JSortDirectionEnum.class), this, ""); + + /** + * Create a public.filter_sort table reference + */ + public JFilterSort() { + this(DSL.name("filter_sort"), null); + } + + /** + * Create an aliased public.filter_sort table reference + */ + public JFilterSort(String alias) { + this(DSL.name(alias), FILTER_SORT); + } + + /** + * Create an aliased public.filter_sort table reference + */ + public JFilterSort(Name alias) { + this(alias, FILTER_SORT); + } + + private JFilterSort(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JFilterSort(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JFilterSort(Table child, ForeignKey key) { + super(child, key, FILTER_SORT); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JFilterSortRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.FILTER_SORT_FILTER_IDX, Indexes.FILTER_SORT_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_FILTER_SORT; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.FILTER_SORT_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.FILTER_SORT_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY); + } + + public JFilter filter() { + return new JFilter(this, Keys.FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY); + } + + @Override + public JFilterSort as(String alias) { + return new JFilterSort(DSL.name(alias), this); + } + + @Override + public JFilterSort as(Name alias) { + return new JFilterSort(alias, this); + } + + /** + * Rename this table + */ + @Override + public JFilterSort rename(String name) { + return new JFilterSort(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JFilterSort rename(Name name) { + return new JFilterSort(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegration.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegration.java index 106417a11..906be0511 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegration.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegration.java @@ -8,13 +8,10 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JIntegrationRecord; - import java.sql.Timestamp; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -41,167 +38,172 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JIntegration extends TableImpl { - private static final long serialVersionUID = 429690557; - - /** - * The reference instance of public.integration - */ - public static final JIntegration INTEGRATION = new JIntegration(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JIntegrationRecord.class; - } - - /** - * The column public.integration.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('integration_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); - - /** - * The column public.integration.name. - */ - public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.integration.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.integration.type. - */ - public final TableField TYPE = createField(DSL.name("type"), org.jooq.impl.SQLDataType.INTEGER, this, ""); - - /** - * The column public.integration.enabled. - */ - public final TableField ENABLED = createField(DSL.name("enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - - /** - * The column public.integration.params. - */ - public final TableField PARAMS = createField(DSL.name("params"), org.jooq.impl.SQLDataType.JSONB, this, ""); - - /** - * The column public.integration.creator. - */ - public final TableField CREATOR = createField(DSL.name("creator"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.integration.creation_date. - */ - public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * Create a public.integration table reference - */ - public JIntegration() { - this(DSL.name("integration"), null); - } - - /** - * Create an aliased public.integration table reference - */ - public JIntegration(String alias) { - this(DSL.name(alias), INTEGRATION); - } - - /** - * Create an aliased public.integration table reference - */ - public JIntegration(Name alias) { - this(alias, INTEGRATION); - } - - private JIntegration(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JIntegration(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JIntegration(Table child, ForeignKey key) { - super(child, key, INTEGRATION); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.INTEGR_PROJECT_IDX, Indexes.INTEGRATION_PK, Indexes.UNIQUE_GLOBAL_INTEGRATION_NAME, Indexes.UNIQUE_PROJECT_INTEGRATION_NAME); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_INTEGRATION; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.INTEGRATION_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.INTEGRATION_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.INTEGRATION__INTEGRATION_PROJECT_ID_FKEY, Keys.INTEGRATION__INTEGRATION_TYPE_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.INTEGRATION__INTEGRATION_PROJECT_ID_FKEY); - } - - public JIntegrationType integrationType() { - return new JIntegrationType(this, Keys.INTEGRATION__INTEGRATION_TYPE_FKEY); - } - - @Override - public JIntegration as(String alias) { - return new JIntegration(DSL.name(alias), this); - } - - @Override - public JIntegration as(Name alias) { - return new JIntegration(alias, this); - } - - /** - * Rename this table - */ - @Override - public JIntegration rename(String name) { - return new JIntegration(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JIntegration rename(Name name) { - return new JIntegration(name, null); - } - - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } + /** + * The reference instance of public.integration + */ + public static final JIntegration INTEGRATION = new JIntegration(); + private static final long serialVersionUID = 429690557; + /** + * The column public.integration.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('integration_id_seq'::regclass)", + org.jooq.impl.SQLDataType.INTEGER)), this, ""); + /** + * The column public.integration.name. + */ + public final TableField NAME = createField(DSL.name("name"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.integration.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.integration.type. + */ + public final TableField TYPE = createField(DSL.name("type"), + org.jooq.impl.SQLDataType.INTEGER, this, ""); + /** + * The column public.integration.enabled. + */ + public final TableField ENABLED = createField(DSL.name("enabled"), + org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); + /** + * The column public.integration.params. + */ + public final TableField PARAMS = createField(DSL.name("params"), + org.jooq.impl.SQLDataType.JSONB, this, ""); + /** + * The column public.integration.creator. + */ + public final TableField CREATOR = createField(DSL.name("creator"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.integration.creation_date. + */ + public final TableField CREATION_DATE = createField( + DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false) + .defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), + this, ""); + + /** + * Create a public.integration table reference + */ + public JIntegration() { + this(DSL.name("integration"), null); + } + + /** + * Create an aliased public.integration table reference + */ + public JIntegration(String alias) { + this(DSL.name(alias), INTEGRATION); + } + + /** + * Create an aliased public.integration table reference + */ + public JIntegration(Name alias) { + this(alias, INTEGRATION); + } + + private JIntegration(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JIntegration(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JIntegration(Table child, ForeignKey key) { + super(child, key, INTEGRATION); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JIntegrationRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.INTEGR_PROJECT_IDX, Indexes.INTEGRATION_PK, + Indexes.UNIQUE_GLOBAL_INTEGRATION_NAME, Indexes.UNIQUE_PROJECT_INTEGRATION_NAME); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_INTEGRATION; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.INTEGRATION_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.INTEGRATION_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.INTEGRATION__INTEGRATION_PROJECT_ID_FKEY, Keys.INTEGRATION__INTEGRATION_TYPE_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.INTEGRATION__INTEGRATION_PROJECT_ID_FKEY); + } + + public JIntegrationType integrationType() { + return new JIntegrationType(this, Keys.INTEGRATION__INTEGRATION_TYPE_FKEY); + } + + @Override + public JIntegration as(String alias) { + return new JIntegration(DSL.name(alias), this); + } + + @Override + public JIntegration as(Name alias) { + return new JIntegration(alias, this); + } + + /** + * Rename this table + */ + @Override + public JIntegration rename(String name) { + return new JIntegration(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JIntegration rename(Name name) { + return new JIntegration(name, null); + } + + // ------------------------------------------------------------------------- + // Row8 type methods + // ------------------------------------------------------------------------- + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegrationType.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegrationType.java index 50ce2d789..d6ac6bf74 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegrationType.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegrationType.java @@ -10,13 +10,10 @@ import com.epam.ta.reportportal.jooq.enums.JIntegrationAuthFlowEnum; import com.epam.ta.reportportal.jooq.enums.JIntegrationGroupEnum; import com.epam.ta.reportportal.jooq.tables.records.JIntegrationTypeRecord; - import java.sql.Timestamp; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -43,149 +40,158 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JIntegrationType extends TableImpl { - private static final long serialVersionUID = -1051931010; - - /** - * The reference instance of public.integration_type - */ - public static final JIntegrationType INTEGRATION_TYPE = new JIntegrationType(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JIntegrationTypeRecord.class; - } - - /** - * The column public.integration_type.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('integration_type_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); - - /** - * The column public.integration_type.name. - */ - public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - - /** - * The column public.integration_type.auth_flow. - */ - public final TableField AUTH_FLOW = createField(DSL.name("auth_flow"), org.jooq.impl.SQLDataType.VARCHAR.asEnumDataType(com.epam.ta.reportportal.jooq.enums.JIntegrationAuthFlowEnum.class), this, ""); - - /** - * The column public.integration_type.creation_date. - */ - public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * The column public.integration_type.group_type. - */ - public final TableField GROUP_TYPE = createField(DSL.name("group_type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JIntegrationGroupEnum.class), this, ""); - - /** - * The column public.integration_type.enabled. - */ - public final TableField ENABLED = createField(DSL.name("enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - - /** - * The column public.integration_type.details. - */ - public final TableField DETAILS = createField(DSL.name("details"), org.jooq.impl.SQLDataType.JSONB, this, ""); - - /** - * Create a public.integration_type table reference - */ - public JIntegrationType() { - this(DSL.name("integration_type"), null); - } - - /** - * Create an aliased public.integration_type table reference - */ - public JIntegrationType(String alias) { - this(DSL.name(alias), INTEGRATION_TYPE); - } - - /** - * Create an aliased public.integration_type table reference - */ - public JIntegrationType(Name alias) { - this(alias, INTEGRATION_TYPE); - } - - private JIntegrationType(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JIntegrationType(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JIntegrationType(Table child, ForeignKey key) { - super(child, key, INTEGRATION_TYPE); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.INTEGRATION_TYPE_NAME_KEY, Indexes.INTEGRATION_TYPE_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_INTEGRATION_TYPE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.INTEGRATION_TYPE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.INTEGRATION_TYPE_PK, Keys.INTEGRATION_TYPE_NAME_KEY); - } - - @Override - public JIntegrationType as(String alias) { - return new JIntegrationType(DSL.name(alias), this); - } - - @Override - public JIntegrationType as(Name alias) { - return new JIntegrationType(alias, this); - } - - /** - * Rename this table - */ - @Override - public JIntegrationType rename(String name) { - return new JIntegrationType(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JIntegrationType rename(Name name) { - return new JIntegrationType(name, null); - } - - // ------------------------------------------------------------------------- - // Row7 type methods - // ------------------------------------------------------------------------- - - @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); - } + /** + * The reference instance of public.integration_type + */ + public static final JIntegrationType INTEGRATION_TYPE = new JIntegrationType(); + private static final long serialVersionUID = -1051931010; + /** + * The column public.integration_type.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('integration_type_id_seq'::regclass)", + org.jooq.impl.SQLDataType.INTEGER)), this, ""); + /** + * The column public.integration_type.name. + */ + public final TableField NAME = createField(DSL.name("name"), + org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); + /** + * The column public.integration_type.auth_flow. + */ + public final TableField AUTH_FLOW = createField( + DSL.name("auth_flow"), org.jooq.impl.SQLDataType.VARCHAR.asEnumDataType( + com.epam.ta.reportportal.jooq.enums.JIntegrationAuthFlowEnum.class), this, ""); + /** + * The column public.integration_type.creation_date. + */ + public final TableField CREATION_DATE = createField( + DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false) + .defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), + this, ""); + /** + * The column public.integration_type.group_type. + */ + public final TableField GROUP_TYPE = createField( + DSL.name("group_type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false) + .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JIntegrationGroupEnum.class), this, + ""); + /** + * The column public.integration_type.enabled. + */ + public final TableField ENABLED = createField( + DSL.name("enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); + /** + * The column public.integration_type.details. + */ + public final TableField DETAILS = createField(DSL.name("details"), + org.jooq.impl.SQLDataType.JSONB, this, ""); + + /** + * Create a public.integration_type table reference + */ + public JIntegrationType() { + this(DSL.name("integration_type"), null); + } + + /** + * Create an aliased public.integration_type table reference + */ + public JIntegrationType(String alias) { + this(DSL.name(alias), INTEGRATION_TYPE); + } + + /** + * Create an aliased public.integration_type table reference + */ + public JIntegrationType(Name alias) { + this(alias, INTEGRATION_TYPE); + } + + private JIntegrationType(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JIntegrationType(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JIntegrationType(Table child, + ForeignKey key) { + super(child, key, INTEGRATION_TYPE); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JIntegrationTypeRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.INTEGRATION_TYPE_NAME_KEY, Indexes.INTEGRATION_TYPE_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_INTEGRATION_TYPE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.INTEGRATION_TYPE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.INTEGRATION_TYPE_PK, + Keys.INTEGRATION_TYPE_NAME_KEY); + } + + @Override + public JIntegrationType as(String alias) { + return new JIntegrationType(DSL.name(alias), this); + } + + @Override + public JIntegrationType as(Name alias) { + return new JIntegrationType(alias, this); + } + + /** + * Rename this table + */ + @Override + public JIntegrationType rename(String name) { + return new JIntegrationType(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JIntegrationType rename(Name name) { + return new JIntegrationType(name, null); + } + + // ------------------------------------------------------------------------- + // Row7 type methods + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssue.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssue.java index a555c4326..55c7f0b72 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssue.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssue.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JIssueRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -38,147 +35,149 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JIssue extends TableImpl { - private static final long serialVersionUID = -877705555; - - /** - * The reference instance of public.issue - */ - public static final JIssue ISSUE = new JIssue(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JIssueRecord.class; - } - - /** - * The column public.issue.issue_id. - */ - public final TableField ISSUE_ID = createField(DSL.name("issue_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.issue.issue_type. - */ - public final TableField ISSUE_TYPE = createField(DSL.name("issue_type"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.issue.issue_description. - */ - public final TableField ISSUE_DESCRIPTION = createField(DSL.name("issue_description"), org.jooq.impl.SQLDataType.CLOB, this, ""); - - /** - * The column public.issue.auto_analyzed. - */ - public final TableField AUTO_ANALYZED = createField(DSL.name("auto_analyzed"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - - /** - * The column public.issue.ignore_analyzer. - */ - public final TableField IGNORE_ANALYZER = createField(DSL.name("ignore_analyzer"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - - /** - * Create a public.issue table reference - */ - public JIssue() { - this(DSL.name("issue"), null); - } - - /** - * Create an aliased public.issue table reference - */ - public JIssue(String alias) { - this(DSL.name(alias), ISSUE); - } - - /** - * Create an aliased public.issue table reference - */ - public JIssue(Name alias) { - this(alias, ISSUE); - } - - private JIssue(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JIssue(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JIssue(Table child, ForeignKey key) { - super(child, key, ISSUE); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ISSUE_IT_IDX, Indexes.ISSUE_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ISSUE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ISSUE_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ISSUE__ISSUE_ISSUE_ID_FKEY, Keys.ISSUE__ISSUE_ISSUE_TYPE_FKEY); - } - - public JTestItemResults testItemResults() { - return new JTestItemResults(this, Keys.ISSUE__ISSUE_ISSUE_ID_FKEY); - } - - public JIssueType issueType() { - return new JIssueType(this, Keys.ISSUE__ISSUE_ISSUE_TYPE_FKEY); - } - - @Override - public JIssue as(String alias) { - return new JIssue(DSL.name(alias), this); - } - - @Override - public JIssue as(Name alias) { - return new JIssue(alias, this); - } - - /** - * Rename this table - */ - @Override - public JIssue rename(String name) { - return new JIssue(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JIssue rename(Name name) { - return new JIssue(name, null); - } - - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } + /** + * The reference instance of public.issue + */ + public static final JIssue ISSUE = new JIssue(); + private static final long serialVersionUID = -877705555; + /** + * The column public.issue.issue_id. + */ + public final TableField ISSUE_ID = createField(DSL.name("issue_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.issue.issue_type. + */ + public final TableField ISSUE_TYPE = createField(DSL.name("issue_type"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.issue.issue_description. + */ + public final TableField ISSUE_DESCRIPTION = createField( + DSL.name("issue_description"), org.jooq.impl.SQLDataType.CLOB, this, ""); + /** + * The column public.issue.auto_analyzed. + */ + public final TableField AUTO_ANALYZED = createField( + DSL.name("auto_analyzed"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue( + org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + /** + * The column public.issue.ignore_analyzer. + */ + public final TableField IGNORE_ANALYZER = createField( + DSL.name("ignore_analyzer"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue( + org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + + /** + * Create a public.issue table reference + */ + public JIssue() { + this(DSL.name("issue"), null); + } + + /** + * Create an aliased public.issue table reference + */ + public JIssue(String alias) { + this(DSL.name(alias), ISSUE); + } + + /** + * Create an aliased public.issue table reference + */ + public JIssue(Name alias) { + this(alias, ISSUE); + } + + private JIssue(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JIssue(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JIssue(Table child, ForeignKey key) { + super(child, key, ISSUE); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JIssueRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ISSUE_IT_IDX, Indexes.ISSUE_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ISSUE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ISSUE_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ISSUE__ISSUE_ISSUE_ID_FKEY, + Keys.ISSUE__ISSUE_ISSUE_TYPE_FKEY); + } + + public JTestItemResults testItemResults() { + return new JTestItemResults(this, Keys.ISSUE__ISSUE_ISSUE_ID_FKEY); + } + + public JIssueType issueType() { + return new JIssueType(this, Keys.ISSUE__ISSUE_ISSUE_TYPE_FKEY); + } + + @Override + public JIssue as(String alias) { + return new JIssue(DSL.name(alias), this); + } + + @Override + public JIssue as(Name alias) { + return new JIssue(alias, this); + } + + /** + * Rename this table + */ + @Override + public JIssue rename(String name) { + return new JIssue(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JIssue rename(Name name) { + return new JIssue(name, null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueGroup.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueGroup.java index 832c0dd4d..18b8891bf 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueGroup.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueGroup.java @@ -9,12 +9,9 @@ import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.enums.JIssueGroupEnum; import com.epam.ta.reportportal.jooq.tables.records.JIssueGroupRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -40,124 +37,126 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JIssueGroup extends TableImpl { - private static final long serialVersionUID = -124161300; - - /** - * The reference instance of public.issue_group - */ - public static final JIssueGroup ISSUE_GROUP = new JIssueGroup(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JIssueGroupRecord.class; - } - - /** - * The column public.issue_group.issue_group_id. - */ - public final TableField ISSUE_GROUP_ID = createField(DSL.name("issue_group_id"), org.jooq.impl.SQLDataType.SMALLINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('issue_group_issue_group_id_seq'::regclass)", org.jooq.impl.SQLDataType.SMALLINT)), this, ""); - - /** - * The column public.issue_group.issue_group. - */ - public final TableField ISSUE_GROUP_ = createField(DSL.name("issue_group"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JIssueGroupEnum.class), this, ""); - - /** - * Create a public.issue_group table reference - */ - public JIssueGroup() { - this(DSL.name("issue_group"), null); - } - - /** - * Create an aliased public.issue_group table reference - */ - public JIssueGroup(String alias) { - this(DSL.name(alias), ISSUE_GROUP); - } - - /** - * Create an aliased public.issue_group table reference - */ - public JIssueGroup(Name alias) { - this(alias, ISSUE_GROUP); - } - - private JIssueGroup(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JIssueGroup(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JIssueGroup(Table child, ForeignKey key) { - super(child, key, ISSUE_GROUP); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ISSUE_GROUP_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ISSUE_GROUP; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ISSUE_GROUP_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ISSUE_GROUP_PK); - } - - @Override - public JIssueGroup as(String alias) { - return new JIssueGroup(DSL.name(alias), this); - } - - @Override - public JIssueGroup as(Name alias) { - return new JIssueGroup(alias, this); - } - - /** - * Rename this table - */ - @Override - public JIssueGroup rename(String name) { - return new JIssueGroup(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JIssueGroup rename(Name name) { - return new JIssueGroup(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + /** + * The reference instance of public.issue_group + */ + public static final JIssueGroup ISSUE_GROUP = new JIssueGroup(); + private static final long serialVersionUID = -124161300; + /** + * The column public.issue_group.issue_group_id. + */ + public final TableField ISSUE_GROUP_ID = createField( + DSL.name("issue_group_id"), org.jooq.impl.SQLDataType.SMALLINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('issue_group_issue_group_id_seq'::regclass)", + org.jooq.impl.SQLDataType.SMALLINT)), this, ""); + /** + * The column public.issue_group.issue_group. + */ + public final TableField ISSUE_GROUP_ = createField( + DSL.name("issue_group"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false) + .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JIssueGroupEnum.class), this, ""); + + /** + * Create a public.issue_group table reference + */ + public JIssueGroup() { + this(DSL.name("issue_group"), null); + } + + /** + * Create an aliased public.issue_group table reference + */ + public JIssueGroup(String alias) { + this(DSL.name(alias), ISSUE_GROUP); + } + + /** + * Create an aliased public.issue_group table reference + */ + public JIssueGroup(Name alias) { + this(alias, ISSUE_GROUP); + } + + private JIssueGroup(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JIssueGroup(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JIssueGroup(Table child, ForeignKey key) { + super(child, key, ISSUE_GROUP); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JIssueGroupRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ISSUE_GROUP_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ISSUE_GROUP; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ISSUE_GROUP_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ISSUE_GROUP_PK); + } + + @Override + public JIssueGroup as(String alias) { + return new JIssueGroup(DSL.name(alias), this); + } + + @Override + public JIssueGroup as(Name alias) { + return new JIssueGroup(alias, this); + } + + /** + * Rename this table + */ + @Override + public JIssueGroup rename(String name) { + return new JIssueGroup(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JIssueGroup rename(Name name) { + return new JIssueGroup(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTicket.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTicket.java index 8c46bcd46..119ed94cf 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTicket.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTicket.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JIssueTicketRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -38,132 +35,133 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JIssueTicket extends TableImpl { - private static final long serialVersionUID = -1026586967; - - /** - * The reference instance of public.issue_ticket - */ - public static final JIssueTicket ISSUE_TICKET = new JIssueTicket(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JIssueTicketRecord.class; - } - - /** - * The column public.issue_ticket.issue_id. - */ - public final TableField ISSUE_ID = createField(DSL.name("issue_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.issue_ticket.ticket_id. - */ - public final TableField TICKET_ID = createField(DSL.name("ticket_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.issue_ticket table reference - */ - public JIssueTicket() { - this(DSL.name("issue_ticket"), null); - } - - /** - * Create an aliased public.issue_ticket table reference - */ - public JIssueTicket(String alias) { - this(DSL.name(alias), ISSUE_TICKET); - } - - /** - * Create an aliased public.issue_ticket table reference - */ - public JIssueTicket(Name alias) { - this(alias, ISSUE_TICKET); - } - - private JIssueTicket(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JIssueTicket(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JIssueTicket(Table child, ForeignKey key) { - super(child, key, ISSUE_TICKET); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ISSUE_TICKET_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ISSUE_TICKET_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ISSUE_TICKET_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY, Keys.ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY); - } - - public JIssue issue() { - return new JIssue(this, Keys.ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY); - } - - public JTicket ticket() { - return new JTicket(this, Keys.ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY); - } - - @Override - public JIssueTicket as(String alias) { - return new JIssueTicket(DSL.name(alias), this); - } - - @Override - public JIssueTicket as(Name alias) { - return new JIssueTicket(alias, this); - } - - /** - * Rename this table - */ - @Override - public JIssueTicket rename(String name) { - return new JIssueTicket(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JIssueTicket rename(Name name) { - return new JIssueTicket(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + /** + * The reference instance of public.issue_ticket + */ + public static final JIssueTicket ISSUE_TICKET = new JIssueTicket(); + private static final long serialVersionUID = -1026586967; + /** + * The column public.issue_ticket.issue_id. + */ + public final TableField ISSUE_ID = createField(DSL.name("issue_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.issue_ticket.ticket_id. + */ + public final TableField TICKET_ID = createField(DSL.name("ticket_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.issue_ticket table reference + */ + public JIssueTicket() { + this(DSL.name("issue_ticket"), null); + } + + /** + * Create an aliased public.issue_ticket table reference + */ + public JIssueTicket(String alias) { + this(DSL.name(alias), ISSUE_TICKET); + } + + /** + * Create an aliased public.issue_ticket table reference + */ + public JIssueTicket(Name alias) { + this(alias, ISSUE_TICKET); + } + + private JIssueTicket(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JIssueTicket(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JIssueTicket(Table child, ForeignKey key) { + super(child, key, ISSUE_TICKET); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JIssueTicketRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ISSUE_TICKET_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ISSUE_TICKET_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ISSUE_TICKET_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY, + Keys.ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY); + } + + public JIssue issue() { + return new JIssue(this, Keys.ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY); + } + + public JTicket ticket() { + return new JTicket(this, Keys.ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY); + } + + @Override + public JIssueTicket as(String alias) { + return new JIssueTicket(DSL.name(alias), this); + } + + @Override + public JIssueTicket as(Name alias) { + return new JIssueTicket(alias, this); + } + + /** + * Rename this table + */ + @Override + public JIssueTicket rename(String name) { + return new JIssueTicket(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JIssueTicket rename(Name name) { + return new JIssueTicket(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueType.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueType.java index b8b906523..c6c991979 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueType.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueType.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JIssueTypeRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,153 +36,157 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JIssueType extends TableImpl { - private static final long serialVersionUID = -1978728165; - - /** - * The reference instance of public.issue_type - */ - public static final JIssueType ISSUE_TYPE = new JIssueType(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JIssueTypeRecord.class; - } - - /** - * The column public.issue_type.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('issue_type_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.issue_type.issue_group_id. - */ - public final TableField ISSUE_GROUP_ID = createField(DSL.name("issue_group_id"), org.jooq.impl.SQLDataType.SMALLINT, this, ""); - - /** - * The column public.issue_type.locator. - */ - public final TableField LOCATOR = createField(DSL.name("locator"), org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, ""); - - /** - * The column public.issue_type.issue_name. - */ - public final TableField ISSUE_NAME = createField(DSL.name("issue_name"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - - /** - * The column public.issue_type.abbreviation. - */ - public final TableField ABBREVIATION = createField(DSL.name("abbreviation"), org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, ""); - - /** - * The column public.issue_type.hex_color. - */ - public final TableField HEX_COLOR = createField(DSL.name("hex_color"), org.jooq.impl.SQLDataType.VARCHAR(7).nullable(false), this, ""); - - /** - * Create a public.issue_type table reference - */ - public JIssueType() { - this(DSL.name("issue_type"), null); - } - - /** - * Create an aliased public.issue_type table reference - */ - public JIssueType(String alias) { - this(DSL.name(alias), ISSUE_TYPE); - } - - /** - * Create an aliased public.issue_type table reference - */ - public JIssueType(Name alias) { - this(alias, ISSUE_TYPE); - } - - private JIssueType(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JIssueType(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JIssueType(Table child, ForeignKey key) { - super(child, key, ISSUE_TYPE); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ISSUE_TYPE_GROUP_IDX, Indexes.ISSUE_TYPE_LOCATOR_KEY, Indexes.ISSUE_TYPE_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ISSUE_TYPE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ISSUE_TYPE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ISSUE_TYPE_PK, Keys.ISSUE_TYPE_LOCATOR_KEY); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY); - } - - public JIssueGroup issueGroup() { - return new JIssueGroup(this, Keys.ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY); - } - - @Override - public JIssueType as(String alias) { - return new JIssueType(DSL.name(alias), this); - } - - @Override - public JIssueType as(Name alias) { - return new JIssueType(alias, this); - } - - /** - * Rename this table - */ - @Override - public JIssueType rename(String name) { - return new JIssueType(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JIssueType rename(Name name) { - return new JIssueType(name, null); - } - - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } + /** + * The reference instance of public.issue_type + */ + public static final JIssueType ISSUE_TYPE = new JIssueType(); + private static final long serialVersionUID = -1978728165; + /** + * The column public.issue_type.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('issue_type_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.issue_type.issue_group_id. + */ + public final TableField ISSUE_GROUP_ID = createField( + DSL.name("issue_group_id"), org.jooq.impl.SQLDataType.SMALLINT, this, ""); + /** + * The column public.issue_type.locator. + */ + public final TableField LOCATOR = createField(DSL.name("locator"), + org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, ""); + /** + * The column public.issue_type.issue_name. + */ + public final TableField ISSUE_NAME = createField(DSL.name("issue_name"), + org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + /** + * The column public.issue_type.abbreviation. + */ + public final TableField ABBREVIATION = createField( + DSL.name("abbreviation"), org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, ""); + /** + * The column public.issue_type.hex_color. + */ + public final TableField HEX_COLOR = createField(DSL.name("hex_color"), + org.jooq.impl.SQLDataType.VARCHAR(7).nullable(false), this, ""); + + /** + * Create a public.issue_type table reference + */ + public JIssueType() { + this(DSL.name("issue_type"), null); + } + + /** + * Create an aliased public.issue_type table reference + */ + public JIssueType(String alias) { + this(DSL.name(alias), ISSUE_TYPE); + } + + /** + * Create an aliased public.issue_type table reference + */ + public JIssueType(Name alias) { + this(alias, ISSUE_TYPE); + } + + private JIssueType(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JIssueType(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JIssueType(Table child, ForeignKey key) { + super(child, key, ISSUE_TYPE); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JIssueTypeRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ISSUE_TYPE_GROUP_IDX, Indexes.ISSUE_TYPE_LOCATOR_KEY, + Indexes.ISSUE_TYPE_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ISSUE_TYPE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ISSUE_TYPE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ISSUE_TYPE_PK, + Keys.ISSUE_TYPE_LOCATOR_KEY); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY); + } + + public JIssueGroup issueGroup() { + return new JIssueGroup(this, Keys.ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY); + } + + @Override + public JIssueType as(String alias) { + return new JIssueType(DSL.name(alias), this); + } + + @Override + public JIssueType as(Name alias) { + return new JIssueType(alias, this); + } + + /** + * Rename this table + */ + @Override + public JIssueType rename(String name) { + return new JIssueType(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JIssueType rename(Name name) { + return new JIssueType(name, null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTypeProject.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTypeProject.java index 4ecdc5792..a96f5ab4f 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTypeProject.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTypeProject.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JIssueTypeProjectRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -38,132 +35,135 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JIssueTypeProject extends TableImpl { - private static final long serialVersionUID = -184496297; - - /** - * The reference instance of public.issue_type_project - */ - public static final JIssueTypeProject ISSUE_TYPE_PROJECT = new JIssueTypeProject(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JIssueTypeProjectRecord.class; - } - - /** - * The column public.issue_type_project.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.issue_type_project.issue_type_id. - */ - public final TableField ISSUE_TYPE_ID = createField(DSL.name("issue_type_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.issue_type_project table reference - */ - public JIssueTypeProject() { - this(DSL.name("issue_type_project"), null); - } - - /** - * Create an aliased public.issue_type_project table reference - */ - public JIssueTypeProject(String alias) { - this(DSL.name(alias), ISSUE_TYPE_PROJECT); - } - - /** - * Create an aliased public.issue_type_project table reference - */ - public JIssueTypeProject(Name alias) { - this(alias, ISSUE_TYPE_PROJECT); - } - - private JIssueTypeProject(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JIssueTypeProject(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JIssueTypeProject(Table child, ForeignKey key) { - super(child, key, ISSUE_TYPE_PROJECT); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ISSUE_TYPE_PROJECT_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ISSUE_TYPE_PROJECT_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ISSUE_TYPE_PROJECT_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY, Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY); - } - - public JIssueType issueType() { - return new JIssueType(this, Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY); - } - - @Override - public JIssueTypeProject as(String alias) { - return new JIssueTypeProject(DSL.name(alias), this); - } - - @Override - public JIssueTypeProject as(Name alias) { - return new JIssueTypeProject(alias, this); - } - - /** - * Rename this table - */ - @Override - public JIssueTypeProject rename(String name) { - return new JIssueTypeProject(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JIssueTypeProject rename(Name name) { - return new JIssueTypeProject(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + /** + * The reference instance of public.issue_type_project + */ + public static final JIssueTypeProject ISSUE_TYPE_PROJECT = new JIssueTypeProject(); + private static final long serialVersionUID = -184496297; + /** + * The column public.issue_type_project.project_id. + */ + public final TableField PROJECT_ID = createField( + DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.issue_type_project.issue_type_id. + */ + public final TableField ISSUE_TYPE_ID = createField( + DSL.name("issue_type_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.issue_type_project table reference + */ + public JIssueTypeProject() { + this(DSL.name("issue_type_project"), null); + } + + /** + * Create an aliased public.issue_type_project table reference + */ + public JIssueTypeProject(String alias) { + this(DSL.name(alias), ISSUE_TYPE_PROJECT); + } + + /** + * Create an aliased public.issue_type_project table reference + */ + public JIssueTypeProject(Name alias) { + this(alias, ISSUE_TYPE_PROJECT); + } + + private JIssueTypeProject(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JIssueTypeProject(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JIssueTypeProject(Table child, + ForeignKey key) { + super(child, key, ISSUE_TYPE_PROJECT); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JIssueTypeProjectRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ISSUE_TYPE_PROJECT_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ISSUE_TYPE_PROJECT_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ISSUE_TYPE_PROJECT_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY, + Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY); + } + + public JIssueType issueType() { + return new JIssueType(this, Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY); + } + + @Override + public JIssueTypeProject as(String alias) { + return new JIssueTypeProject(DSL.name(alias), this); + } + + @Override + public JIssueTypeProject as(Name alias) { + return new JIssueTypeProject(alias, this); + } + + /** + * Rename this table + */ + @Override + public JIssueTypeProject rename(String name) { + return new JIssueTypeProject(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JIssueTypeProject rename(Name name) { + return new JIssueTypeProject(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JItemAttribute.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JItemAttribute.java index 28fb6cedb..708fee273 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JItemAttribute.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JItemAttribute.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JItemAttributeRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,157 +36,163 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JItemAttribute extends TableImpl { - private static final long serialVersionUID = -425535120; - - /** - * The reference instance of public.item_attribute - */ - public static final JItemAttribute ITEM_ATTRIBUTE = new JItemAttribute(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JItemAttributeRecord.class; - } - - /** - * The column public.item_attribute.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('item_attribute_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.item_attribute.key. - */ - public final TableField KEY = createField(DSL.name("key"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - - /** - * The column public.item_attribute.value. - */ - public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.item_attribute.item_id. - */ - public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.item_attribute.launch_id. - */ - public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.item_attribute.system. - */ - public final TableField SYSTEM = createField(DSL.name("system"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - - /** - * Create a public.item_attribute table reference - */ - public JItemAttribute() { - this(DSL.name("item_attribute"), null); - } - - /** - * Create an aliased public.item_attribute table reference - */ - public JItemAttribute(String alias) { - this(DSL.name(alias), ITEM_ATTRIBUTE); - } - - /** - * Create an aliased public.item_attribute table reference - */ - public JItemAttribute(Name alias) { - this(alias, ITEM_ATTRIBUTE); - } - - private JItemAttribute(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JItemAttribute(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JItemAttribute(Table child, ForeignKey key) { - super(child, key, ITEM_ATTRIBUTE); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ITEM_ATTR_LAUNCH_IDX, Indexes.ITEM_ATTR_TI_IDX, Indexes.ITEM_ATTRIBUTE_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ITEM_ATTRIBUTE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ITEM_ATTRIBUTE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ITEM_ATTRIBUTE_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY, Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY); - } - - public JTestItem testItem() { - return new JTestItem(this, Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY); - } - - public JLaunch launch() { - return new JLaunch(this, Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY); - } - - @Override - public JItemAttribute as(String alias) { - return new JItemAttribute(DSL.name(alias), this); - } - - @Override - public JItemAttribute as(Name alias) { - return new JItemAttribute(alias, this); - } - - /** - * Rename this table - */ - @Override - public JItemAttribute rename(String name) { - return new JItemAttribute(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JItemAttribute rename(Name name) { - return new JItemAttribute(name, null); - } - - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } + /** + * The reference instance of public.item_attribute + */ + public static final JItemAttribute ITEM_ATTRIBUTE = new JItemAttribute(); + private static final long serialVersionUID = -425535120; + /** + * The column public.item_attribute.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('item_attribute_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.item_attribute.key. + */ + public final TableField KEY = createField(DSL.name("key"), + org.jooq.impl.SQLDataType.VARCHAR, this, ""); + /** + * The column public.item_attribute.value. + */ + public final TableField VALUE = createField(DSL.name("value"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.item_attribute.item_id. + */ + public final TableField ITEM_ID = createField(DSL.name("item_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.item_attribute.launch_id. + */ + public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.item_attribute.system. + */ + public final TableField SYSTEM = createField(DSL.name("system"), + org.jooq.impl.SQLDataType.BOOLEAN.defaultValue( + org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + + /** + * Create a public.item_attribute table reference + */ + public JItemAttribute() { + this(DSL.name("item_attribute"), null); + } + + /** + * Create an aliased public.item_attribute table reference + */ + public JItemAttribute(String alias) { + this(DSL.name(alias), ITEM_ATTRIBUTE); + } + + /** + * Create an aliased public.item_attribute table reference + */ + public JItemAttribute(Name alias) { + this(alias, ITEM_ATTRIBUTE); + } + + private JItemAttribute(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JItemAttribute(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JItemAttribute(Table child, + ForeignKey key) { + super(child, key, ITEM_ATTRIBUTE); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JItemAttributeRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ITEM_ATTR_LAUNCH_IDX, Indexes.ITEM_ATTR_TI_IDX, + Indexes.ITEM_ATTRIBUTE_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ITEM_ATTRIBUTE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ITEM_ATTRIBUTE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ITEM_ATTRIBUTE_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY, + Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY); + } + + public JTestItem testItem() { + return new JTestItem(this, Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY); + } + + public JLaunch launch() { + return new JLaunch(this, Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY); + } + + @Override + public JItemAttribute as(String alias) { + return new JItemAttribute(DSL.name(alias), this); + } + + @Override + public JItemAttribute as(Name alias) { + return new JItemAttribute(alias, this); + } + + /** + * Rename this table + */ + @Override + public JItemAttribute rename(String name) { + return new JItemAttribute(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JItemAttribute rename(Name name) { + return new JItemAttribute(name, null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunch.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunch.java index 38a03ae90..c687439b4 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunch.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunch.java @@ -10,13 +10,10 @@ import com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum; import com.epam.ta.reportportal.jooq.enums.JStatusEnum; import com.epam.ta.reportportal.jooq.tables.records.JLaunchRecord; - import java.sql.Timestamp; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -42,202 +39,215 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JLaunch extends TableImpl { - private static final long serialVersionUID = 1513226778; - - /** - * The reference instance of public.launch - */ - public static final JLaunch LAUNCH = new JLaunch(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JLaunchRecord.class; - } - - /** - * The column public.launch.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('launch_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.launch.uuid. - */ - public final TableField UUID = createField(DSL.name("uuid"), org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, ""); - - /** - * The column public.launch.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.launch.user_id. - */ - public final TableField USER_ID = createField(DSL.name("user_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.launch.name. - */ - public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - - /** - * The column public.launch.description. - */ - public final TableField DESCRIPTION = createField(DSL.name("description"), org.jooq.impl.SQLDataType.CLOB, this, ""); - - /** - * The column public.launch.start_time. - */ - public final TableField START_TIME = createField(DSL.name("start_time"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - - /** - * The column public.launch.end_time. - */ - public final TableField END_TIME = createField(DSL.name("end_time"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * The column public.launch.number. - */ - public final TableField NUMBER = createField(DSL.name("number"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column public.launch.last_modified. - */ - public final TableField LAST_MODIFIED = createField(DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * The column public.launch.mode. - */ - public final TableField MODE = createField(DSL.name("mode"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum.class), this, ""); - - /** - * The column public.launch.status. - */ - public final TableField STATUS = createField(DSL.name("status"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JStatusEnum.class), this, ""); - - /** - * The column public.launch.has_retries. - */ - public final TableField HAS_RETRIES = createField(DSL.name("has_retries"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false).defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - - /** - * The column public.launch.rerun. - */ - public final TableField RERUN = createField(DSL.name("rerun"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false).defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - - /** - * The column public.launch.approximate_duration. - */ - public final TableField APPROXIMATE_DURATION = createField(DSL.name("approximate_duration"), org.jooq.impl.SQLDataType.DOUBLE.defaultValue(org.jooq.impl.DSL.field("0.0", org.jooq.impl.SQLDataType.DOUBLE)), this, ""); - - /** - * Create a public.launch table reference - */ - public JLaunch() { - this(DSL.name("launch"), null); - } - - /** - * Create an aliased public.launch table reference - */ - public JLaunch(String alias) { - this(DSL.name(alias), LAUNCH); - } - - /** - * Create an aliased public.launch table reference - */ - public JLaunch(Name alias) { - this(alias, LAUNCH); - } - - private JLaunch(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JLaunch(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JLaunch(Table child, ForeignKey key) { - super(child, key, LAUNCH); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.LAUNCH_PK, Indexes.LAUNCH_PROJECT_START_TIME_IDX, Indexes.LAUNCH_USER_IDX, Indexes.LAUNCH_UUID_KEY, Indexes.UNQ_NAME_NUMBER); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_LAUNCH; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.LAUNCH_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.LAUNCH_PK, Keys.LAUNCH_UUID_KEY, Keys.UNQ_NAME_NUMBER); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.LAUNCH__LAUNCH_PROJECT_ID_FKEY, Keys.LAUNCH__LAUNCH_USER_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.LAUNCH__LAUNCH_PROJECT_ID_FKEY); - } - - public JUsers users() { - return new JUsers(this, Keys.LAUNCH__LAUNCH_USER_ID_FKEY); - } - - @Override - public JLaunch as(String alias) { - return new JLaunch(DSL.name(alias), this); - } - - @Override - public JLaunch as(Name alias) { - return new JLaunch(alias, this); - } - - /** - * Rename this table - */ - @Override - public JLaunch rename(String name) { - return new JLaunch(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JLaunch rename(Name name) { - return new JLaunch(name, null); - } - - // ------------------------------------------------------------------------- - // Row15 type methods - // ------------------------------------------------------------------------- - - @Override - public Row15 fieldsRow() { - return (Row15) super.fieldsRow(); - } + /** + * The reference instance of public.launch + */ + public static final JLaunch LAUNCH = new JLaunch(); + private static final long serialVersionUID = 1513226778; + /** + * The column public.launch.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('launch_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.launch.uuid. + */ + public final TableField UUID = createField(DSL.name("uuid"), + org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, ""); + /** + * The column public.launch.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.launch.user_id. + */ + public final TableField USER_ID = createField(DSL.name("user_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.launch.name. + */ + public final TableField NAME = createField(DSL.name("name"), + org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + /** + * The column public.launch.description. + */ + public final TableField DESCRIPTION = createField(DSL.name("description"), + org.jooq.impl.SQLDataType.CLOB, this, ""); + /** + * The column public.launch.start_time. + */ + public final TableField START_TIME = createField(DSL.name("start_time"), + org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + /** + * The column public.launch.end_time. + */ + public final TableField END_TIME = createField(DSL.name("end_time"), + org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + /** + * The column public.launch.number. + */ + public final TableField NUMBER = createField(DSL.name("number"), + org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + /** + * The column public.launch.last_modified. + */ + public final TableField LAST_MODIFIED = createField( + DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false) + .defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), + this, ""); + /** + * The column public.launch.mode. + */ + public final TableField MODE = createField(DSL.name("mode"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false) + .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum.class), this, ""); + /** + * The column public.launch.status. + */ + public final TableField STATUS = createField(DSL.name("status"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false) + .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JStatusEnum.class), this, ""); + /** + * The column public.launch.has_retries. + */ + public final TableField HAS_RETRIES = createField(DSL.name("has_retries"), + org.jooq.impl.SQLDataType.BOOLEAN.nullable(false) + .defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, + ""); + /** + * The column public.launch.rerun. + */ + public final TableField RERUN = createField(DSL.name("rerun"), + org.jooq.impl.SQLDataType.BOOLEAN.nullable(false) + .defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, + ""); + /** + * The column public.launch.approximate_duration. + */ + public final TableField APPROXIMATE_DURATION = createField( + DSL.name("approximate_duration"), org.jooq.impl.SQLDataType.DOUBLE.defaultValue( + org.jooq.impl.DSL.field("0.0", org.jooq.impl.SQLDataType.DOUBLE)), this, ""); + + /** + * Create a public.launch table reference + */ + public JLaunch() { + this(DSL.name("launch"), null); + } + + /** + * Create an aliased public.launch table reference + */ + public JLaunch(String alias) { + this(DSL.name(alias), LAUNCH); + } + + /** + * Create an aliased public.launch table reference + */ + public JLaunch(Name alias) { + this(alias, LAUNCH); + } + + private JLaunch(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JLaunch(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JLaunch(Table child, ForeignKey key) { + super(child, key, LAUNCH); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JLaunchRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.LAUNCH_PK, Indexes.LAUNCH_PROJECT_START_TIME_IDX, + Indexes.LAUNCH_USER_IDX, Indexes.LAUNCH_UUID_KEY, Indexes.UNQ_NAME_NUMBER); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_LAUNCH; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.LAUNCH_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.LAUNCH_PK, Keys.LAUNCH_UUID_KEY, + Keys.UNQ_NAME_NUMBER); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.LAUNCH__LAUNCH_PROJECT_ID_FKEY, + Keys.LAUNCH__LAUNCH_USER_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.LAUNCH__LAUNCH_PROJECT_ID_FKEY); + } + + public JUsers users() { + return new JUsers(this, Keys.LAUNCH__LAUNCH_USER_ID_FKEY); + } + + @Override + public JLaunch as(String alias) { + return new JLaunch(DSL.name(alias), this); + } + + @Override + public JLaunch as(Name alias) { + return new JLaunch(alias, this); + } + + /** + * Rename this table + */ + @Override + public JLaunch rename(String name) { + return new JLaunch(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JLaunch rename(Name name) { + return new JLaunch(name, null); + } + + // ------------------------------------------------------------------------- + // Row15 type methods + // ------------------------------------------------------------------------- + + @Override + public Row15 fieldsRow() { + return (Row15) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchAttributeRules.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchAttributeRules.java index 52588cca7..833b28127 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchAttributeRules.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchAttributeRules.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JLaunchAttributeRulesRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,143 +36,148 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JLaunchAttributeRules extends TableImpl { - private static final long serialVersionUID = 1128795973; - - /** - * The reference instance of public.launch_attribute_rules - */ - public static final JLaunchAttributeRules LAUNCH_ATTRIBUTE_RULES = new JLaunchAttributeRules(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JLaunchAttributeRulesRecord.class; - } - - /** - * The column public.launch_attribute_rules.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('launch_attribute_rules_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.launch_attribute_rules.sender_case_id. - */ - public final TableField SENDER_CASE_ID = createField(DSL.name("sender_case_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.launch_attribute_rules.key. - */ - public final TableField KEY = createField(DSL.name("key"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * The column public.launch_attribute_rules.value. - */ - public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - - /** - * Create a public.launch_attribute_rules table reference - */ - public JLaunchAttributeRules() { - this(DSL.name("launch_attribute_rules"), null); - } - - /** - * Create an aliased public.launch_attribute_rules table reference - */ - public JLaunchAttributeRules(String alias) { - this(DSL.name(alias), LAUNCH_ATTRIBUTE_RULES); - } - - /** - * Create an aliased public.launch_attribute_rules table reference - */ - public JLaunchAttributeRules(Name alias) { - this(alias, LAUNCH_ATTRIBUTE_RULES); - } - - private JLaunchAttributeRules(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JLaunchAttributeRules(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JLaunchAttributeRules(Table child, ForeignKey key) { - super(child, key, LAUNCH_ATTRIBUTE_RULES); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.L_ATTR_RL_SEND_CASE_IDX, Indexes.LAUNCH_ATTRIBUTE_RULES_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_LAUNCH_ATTRIBUTE_RULES; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.LAUNCH_ATTRIBUTE_RULES_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.LAUNCH_ATTRIBUTE_RULES_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY); - } - - public JSenderCase senderCase() { - return new JSenderCase(this, Keys.LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY); - } - - @Override - public JLaunchAttributeRules as(String alias) { - return new JLaunchAttributeRules(DSL.name(alias), this); - } - - @Override - public JLaunchAttributeRules as(Name alias) { - return new JLaunchAttributeRules(alias, this); - } - - /** - * Rename this table - */ - @Override - public JLaunchAttributeRules rename(String name) { - return new JLaunchAttributeRules(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JLaunchAttributeRules rename(Name name) { - return new JLaunchAttributeRules(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + /** + * The reference instance of public.launch_attribute_rules + */ + public static final JLaunchAttributeRules LAUNCH_ATTRIBUTE_RULES = new JLaunchAttributeRules(); + private static final long serialVersionUID = 1128795973; + /** + * The column public.launch_attribute_rules.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('launch_attribute_rules_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.launch_attribute_rules.sender_case_id. + */ + public final TableField SENDER_CASE_ID = createField( + DSL.name("sender_case_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.launch_attribute_rules.key. + */ + public final TableField KEY = createField(DSL.name("key"), + org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + /** + * The column public.launch_attribute_rules.value. + */ + public final TableField VALUE = createField( + DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + + /** + * Create a public.launch_attribute_rules table reference + */ + public JLaunchAttributeRules() { + this(DSL.name("launch_attribute_rules"), null); + } + + /** + * Create an aliased public.launch_attribute_rules table reference + */ + public JLaunchAttributeRules(String alias) { + this(DSL.name(alias), LAUNCH_ATTRIBUTE_RULES); + } + + /** + * Create an aliased public.launch_attribute_rules table reference + */ + public JLaunchAttributeRules(Name alias) { + this(alias, LAUNCH_ATTRIBUTE_RULES); + } + + private JLaunchAttributeRules(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JLaunchAttributeRules(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JLaunchAttributeRules(Table child, + ForeignKey key) { + super(child, key, LAUNCH_ATTRIBUTE_RULES); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JLaunchAttributeRulesRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.L_ATTR_RL_SEND_CASE_IDX, Indexes.LAUNCH_ATTRIBUTE_RULES_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_LAUNCH_ATTRIBUTE_RULES; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.LAUNCH_ATTRIBUTE_RULES_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.LAUNCH_ATTRIBUTE_RULES_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY); + } + + public JSenderCase senderCase() { + return new JSenderCase(this, + Keys.LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY); + } + + @Override + public JLaunchAttributeRules as(String alias) { + return new JLaunchAttributeRules(DSL.name(alias), this); + } + + @Override + public JLaunchAttributeRules as(Name alias) { + return new JLaunchAttributeRules(alias, this); + } + + /** + * Rename this table + */ + @Override + public JLaunchAttributeRules rename(String name) { + return new JLaunchAttributeRules(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JLaunchAttributeRules rename(Name name) { + return new JLaunchAttributeRules(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNames.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNames.java index 0488fb931..d680d6a80 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNames.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNames.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JLaunchNamesRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -37,118 +34,118 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JLaunchNames extends TableImpl { - private static final long serialVersionUID = 2113925870; - - /** - * The reference instance of public.launch_names - */ - public static final JLaunchNames LAUNCH_NAMES = new JLaunchNames(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JLaunchNamesRecord.class; - } - - /** - * The column public.launch_names.sender_case_id. - */ - public final TableField SENDER_CASE_ID = createField(DSL.name("sender_case_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.launch_names.launch_name. - */ - public final TableField LAUNCH_NAME = createField(DSL.name("launch_name"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * Create a public.launch_names table reference - */ - public JLaunchNames() { - this(DSL.name("launch_names"), null); - } - - /** - * Create an aliased public.launch_names table reference - */ - public JLaunchNames(String alias) { - this(DSL.name(alias), LAUNCH_NAMES); - } - - /** - * Create an aliased public.launch_names table reference - */ - public JLaunchNames(Name alias) { - this(alias, LAUNCH_NAMES); - } - - private JLaunchNames(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JLaunchNames(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JLaunchNames(Table child, ForeignKey key) { - super(child, key, LAUNCH_NAMES); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.LN_SEND_CASE_IDX); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY); - } - - public JSenderCase senderCase() { - return new JSenderCase(this, Keys.LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY); - } - - @Override - public JLaunchNames as(String alias) { - return new JLaunchNames(DSL.name(alias), this); - } - - @Override - public JLaunchNames as(Name alias) { - return new JLaunchNames(alias, this); - } - - /** - * Rename this table - */ - @Override - public JLaunchNames rename(String name) { - return new JLaunchNames(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JLaunchNames rename(Name name) { - return new JLaunchNames(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + /** + * The reference instance of public.launch_names + */ + public static final JLaunchNames LAUNCH_NAMES = new JLaunchNames(); + private static final long serialVersionUID = 2113925870; + /** + * The column public.launch_names.sender_case_id. + */ + public final TableField SENDER_CASE_ID = createField( + DSL.name("sender_case_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.launch_names.launch_name. + */ + public final TableField LAUNCH_NAME = createField( + DSL.name("launch_name"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + + /** + * Create a public.launch_names table reference + */ + public JLaunchNames() { + this(DSL.name("launch_names"), null); + } + + /** + * Create an aliased public.launch_names table reference + */ + public JLaunchNames(String alias) { + this(DSL.name(alias), LAUNCH_NAMES); + } + + /** + * Create an aliased public.launch_names table reference + */ + public JLaunchNames(Name alias) { + this(alias, LAUNCH_NAMES); + } + + private JLaunchNames(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JLaunchNames(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JLaunchNames(Table child, ForeignKey key) { + super(child, key, LAUNCH_NAMES); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JLaunchNamesRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.LN_SEND_CASE_IDX); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY); + } + + public JSenderCase senderCase() { + return new JSenderCase(this, Keys.LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY); + } + + @Override + public JLaunchNames as(String alias) { + return new JLaunchNames(DSL.name(alias), this); + } + + @Override + public JLaunchNames as(Name alias) { + return new JLaunchNames(alias, this); + } + + /** + * Rename this table + */ + @Override + public JLaunchNames rename(String name) { + return new JLaunchNames(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JLaunchNames rename(Name name) { + return new JLaunchNames(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNumber.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNumber.java index 55e1583b5..d007ac2b3 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNumber.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNumber.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JLaunchNumberRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,143 +36,146 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JLaunchNumber extends TableImpl { - private static final long serialVersionUID = 1327480379; - - /** - * The reference instance of public.launch_number - */ - public static final JLaunchNumber LAUNCH_NUMBER = new JLaunchNumber(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JLaunchNumberRecord.class; - } - - /** - * The column public.launch_number.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('launch_number_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.launch_number.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.launch_number.launch_name. - */ - public final TableField LAUNCH_NAME = createField(DSL.name("launch_name"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - - /** - * The column public.launch_number.number. - */ - public final TableField NUMBER = createField(DSL.name("number"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * Create a public.launch_number table reference - */ - public JLaunchNumber() { - this(DSL.name("launch_number"), null); - } - - /** - * Create an aliased public.launch_number table reference - */ - public JLaunchNumber(String alias) { - this(DSL.name(alias), LAUNCH_NUMBER); - } - - /** - * Create an aliased public.launch_number table reference - */ - public JLaunchNumber(Name alias) { - this(alias, LAUNCH_NUMBER); - } - - private JLaunchNumber(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JLaunchNumber(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JLaunchNumber(Table child, ForeignKey key) { - super(child, key, LAUNCH_NUMBER); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.LAUNCH_NUMBER_PK, Indexes.UNQ_PROJECT_NAME); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_LAUNCH_NUMBER; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.LAUNCH_NUMBER_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.LAUNCH_NUMBER_PK, Keys.UNQ_PROJECT_NAME); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY); - } - - @Override - public JLaunchNumber as(String alias) { - return new JLaunchNumber(DSL.name(alias), this); - } - - @Override - public JLaunchNumber as(Name alias) { - return new JLaunchNumber(alias, this); - } - - /** - * Rename this table - */ - @Override - public JLaunchNumber rename(String name) { - return new JLaunchNumber(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JLaunchNumber rename(Name name) { - return new JLaunchNumber(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + /** + * The reference instance of public.launch_number + */ + public static final JLaunchNumber LAUNCH_NUMBER = new JLaunchNumber(); + private static final long serialVersionUID = 1327480379; + /** + * The column public.launch_number.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('launch_number_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.launch_number.project_id. + */ + public final TableField PROJECT_ID = createField( + DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.launch_number.launch_name. + */ + public final TableField LAUNCH_NAME = createField( + DSL.name("launch_name"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + /** + * The column public.launch_number.number. + */ + public final TableField NUMBER = createField(DSL.name("number"), + org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * Create a public.launch_number table reference + */ + public JLaunchNumber() { + this(DSL.name("launch_number"), null); + } + + /** + * Create an aliased public.launch_number table reference + */ + public JLaunchNumber(String alias) { + this(DSL.name(alias), LAUNCH_NUMBER); + } + + /** + * Create an aliased public.launch_number table reference + */ + public JLaunchNumber(Name alias) { + this(alias, LAUNCH_NUMBER); + } + + private JLaunchNumber(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JLaunchNumber(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JLaunchNumber(Table child, ForeignKey key) { + super(child, key, LAUNCH_NUMBER); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JLaunchNumberRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.LAUNCH_NUMBER_PK, Indexes.UNQ_PROJECT_NAME); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_LAUNCH_NUMBER; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.LAUNCH_NUMBER_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.LAUNCH_NUMBER_PK, + Keys.UNQ_PROJECT_NAME); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY); + } + + @Override + public JLaunchNumber as(String alias) { + return new JLaunchNumber(DSL.name(alias), this); + } + + @Override + public JLaunchNumber as(Name alias) { + return new JLaunchNumber(alias, this); + } + + /** + * Rename this table + */ + @Override + public JLaunchNumber rename(String name) { + return new JLaunchNumber(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JLaunchNumber rename(Name name) { + return new JLaunchNumber(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLog.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLog.java index 023f79df7..ff8235a97 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLog.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLog.java @@ -8,13 +8,10 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JLogRecord; - import java.sql.Timestamp; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -40,186 +37,190 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JLog extends TableImpl { - private static final long serialVersionUID = -198837446; - - /** - * The reference instance of public.log - */ - public static final JLog LOG = new JLog(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JLogRecord.class; - } - - /** - * The column public.log.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('log_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.log.uuid. - */ - public final TableField UUID = createField(DSL.name("uuid"), org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, ""); - - /** - * The column public.log.log_time. - */ - public final TableField LOG_TIME = createField(DSL.name("log_time"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - - /** - * The column public.log.log_message. - */ - public final TableField LOG_MESSAGE = createField(DSL.name("log_message"), org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); - - /** - * The column public.log.item_id. - */ - public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.log.launch_id. - */ - public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.log.last_modified. - */ - public final TableField LAST_MODIFIED = createField(DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - - /** - * The column public.log.log_level. - */ - public final TableField LOG_LEVEL = createField(DSL.name("log_level"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * The column public.log.attachment_id. - */ - public final TableField ATTACHMENT_ID = createField(DSL.name("attachment_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.log.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.log.cluster_id. - */ - public final TableField CLUSTER_ID = createField(DSL.name("cluster_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * Create a public.log table reference - */ - public JLog() { - this(DSL.name("log"), null); - } - - /** - * Create an aliased public.log table reference - */ - public JLog(String alias) { - this(DSL.name(alias), LOG); - } - - /** - * Create an aliased public.log table reference - */ - public JLog(Name alias) { - this(alias, LOG); - } - - private JLog(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JLog(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JLog(Table child, ForeignKey key) { - super(child, key, LOG); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.LOG_ATTACH_ID_IDX, Indexes.LOG_CLUSTER_IDX, Indexes.LOG_LAUNCH_ID_IDX, Indexes.LOG_MESSAGE_TRGM_IDX, Indexes.LOG_PK, Indexes.LOG_PROJECT_ID_LOG_TIME_IDX, Indexes.LOG_PROJECT_IDX, Indexes.LOG_TI_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_LOG; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.LOG_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.LOG_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.LOG__LOG_ITEM_ID_FKEY, Keys.LOG__LOG_LAUNCH_ID_FKEY, Keys.LOG__LOG_ATTACHMENT_ID_FKEY); - } - - public JTestItem testItem() { - return new JTestItem(this, Keys.LOG__LOG_ITEM_ID_FKEY); - } - - public JLaunch launch() { - return new JLaunch(this, Keys.LOG__LOG_LAUNCH_ID_FKEY); - } - - public JAttachment attachment() { - return new JAttachment(this, Keys.LOG__LOG_ATTACHMENT_ID_FKEY); - } - - @Override - public JLog as(String alias) { - return new JLog(DSL.name(alias), this); - } - - @Override - public JLog as(Name alias) { - return new JLog(alias, this); - } - - /** - * Rename this table - */ - @Override - public JLog rename(String name) { - return new JLog(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JLog rename(Name name) { - return new JLog(name, null); - } - - // ------------------------------------------------------------------------- - // Row11 type methods - // ------------------------------------------------------------------------- - - @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); - } + /** + * The reference instance of public.log + */ + public static final JLog LOG = new JLog(); + private static final long serialVersionUID = -198837446; + /** + * The column public.log.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('log_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.log.uuid. + */ + public final TableField UUID = createField(DSL.name("uuid"), + org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, ""); + /** + * The column public.log.log_time. + */ + public final TableField LOG_TIME = createField(DSL.name("log_time"), + org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + /** + * The column public.log.log_message. + */ + public final TableField LOG_MESSAGE = createField(DSL.name("log_message"), + org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + /** + * The column public.log.item_id. + */ + public final TableField ITEM_ID = createField(DSL.name("item_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.log.launch_id. + */ + public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.log.last_modified. + */ + public final TableField LAST_MODIFIED = createField( + DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + /** + * The column public.log.log_level. + */ + public final TableField LOG_LEVEL = createField(DSL.name("log_level"), + org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + /** + * The column public.log.attachment_id. + */ + public final TableField ATTACHMENT_ID = createField(DSL.name("attachment_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.log.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.log.cluster_id. + */ + public final TableField CLUSTER_ID = createField(DSL.name("cluster_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * Create a public.log table reference + */ + public JLog() { + this(DSL.name("log"), null); + } + + /** + * Create an aliased public.log table reference + */ + public JLog(String alias) { + this(DSL.name(alias), LOG); + } + + /** + * Create an aliased public.log table reference + */ + public JLog(Name alias) { + this(alias, LOG); + } + + private JLog(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JLog(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JLog(Table child, ForeignKey key) { + super(child, key, LOG); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JLogRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.LOG_ATTACH_ID_IDX, Indexes.LOG_CLUSTER_IDX, + Indexes.LOG_LAUNCH_ID_IDX, Indexes.LOG_MESSAGE_TRGM_IDX, Indexes.LOG_PK, + Indexes.LOG_PROJECT_ID_LOG_TIME_IDX, Indexes.LOG_PROJECT_IDX, Indexes.LOG_TI_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_LOG; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.LOG_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.LOG_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.LOG__LOG_ITEM_ID_FKEY, + Keys.LOG__LOG_LAUNCH_ID_FKEY, Keys.LOG__LOG_ATTACHMENT_ID_FKEY); + } + + public JTestItem testItem() { + return new JTestItem(this, Keys.LOG__LOG_ITEM_ID_FKEY); + } + + public JLaunch launch() { + return new JLaunch(this, Keys.LOG__LOG_LAUNCH_ID_FKEY); + } + + public JAttachment attachment() { + return new JAttachment(this, Keys.LOG__LOG_ATTACHMENT_ID_FKEY); + } + + @Override + public JLog as(String alias) { + return new JLog(DSL.name(alias), this); + } + + @Override + public JLog as(Name alias) { + return new JLog(alias, this); + } + + /** + * Rename this table + */ + @Override + public JLog rename(String name) { + return new JLog(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JLog rename(Name name) { + return new JLog(name, null); + } + + // ------------------------------------------------------------------------- + // Row11 type methods + // ------------------------------------------------------------------------- + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthAccessToken.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthAccessToken.java index 3153ca63c..8d278e1c3 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthAccessToken.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthAccessToken.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JOauthAccessTokenRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,168 +36,174 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JOauthAccessToken extends TableImpl { - private static final long serialVersionUID = -1465585063; - - /** - * The reference instance of public.oauth_access_token - */ - public static final JOauthAccessToken OAUTH_ACCESS_TOKEN = new JOauthAccessToken(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JOauthAccessTokenRecord.class; - } - - /** - * The column public.oauth_access_token.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('oauth_access_token_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.oauth_access_token.token_id. - */ - public final TableField TOKEN_ID = createField(DSL.name("token_id"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - - /** - * The column public.oauth_access_token.token. - */ - public final TableField TOKEN = createField(DSL.name("token"), org.jooq.impl.SQLDataType.BLOB, this, ""); - - /** - * The column public.oauth_access_token.authentication_id. - */ - public final TableField AUTHENTICATION_ID = createField(DSL.name("authentication_id"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - - /** - * The column public.oauth_access_token.username. - */ - public final TableField USERNAME = createField(DSL.name("username"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - - /** - * The column public.oauth_access_token.user_id. - */ - public final TableField USER_ID = createField(DSL.name("user_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.oauth_access_token.client_id. - */ - public final TableField CLIENT_ID = createField(DSL.name("client_id"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - - /** - * The column public.oauth_access_token.authentication. - */ - public final TableField AUTHENTICATION = createField(DSL.name("authentication"), org.jooq.impl.SQLDataType.BLOB, this, ""); - - /** - * The column public.oauth_access_token.refresh_token. - */ - public final TableField REFRESH_TOKEN = createField(DSL.name("refresh_token"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - - /** - * Create a public.oauth_access_token table reference - */ - public JOauthAccessToken() { - this(DSL.name("oauth_access_token"), null); - } - - /** - * Create an aliased public.oauth_access_token table reference - */ - public JOauthAccessToken(String alias) { - this(DSL.name(alias), OAUTH_ACCESS_TOKEN); - } - - /** - * Create an aliased public.oauth_access_token table reference - */ - public JOauthAccessToken(Name alias) { - this(alias, OAUTH_ACCESS_TOKEN); - } - - private JOauthAccessToken(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JOauthAccessToken(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JOauthAccessToken(Table child, ForeignKey key) { - super(child, key, OAUTH_ACCESS_TOKEN); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.OAUTH_ACCESS_TOKEN_PKEY, Indexes.OAUTH_AT_USER_IDX, Indexes.USERS_ACCESS_TOKEN_UNIQUE); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_OAUTH_ACCESS_TOKEN; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.OAUTH_ACCESS_TOKEN_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.OAUTH_ACCESS_TOKEN_PKEY, Keys.USERS_ACCESS_TOKEN_UNIQUE); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY); - } - - public JUsers users() { - return new JUsers(this, Keys.OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY); - } - - @Override - public JOauthAccessToken as(String alias) { - return new JOauthAccessToken(DSL.name(alias), this); - } - - @Override - public JOauthAccessToken as(Name alias) { - return new JOauthAccessToken(alias, this); - } - - /** - * Rename this table - */ - @Override - public JOauthAccessToken rename(String name) { - return new JOauthAccessToken(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JOauthAccessToken rename(Name name) { - return new JOauthAccessToken(name, null); - } - - // ------------------------------------------------------------------------- - // Row9 type methods - // ------------------------------------------------------------------------- - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } + /** + * The reference instance of public.oauth_access_token + */ + public static final JOauthAccessToken OAUTH_ACCESS_TOKEN = new JOauthAccessToken(); + private static final long serialVersionUID = -1465585063; + /** + * The column public.oauth_access_token.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('oauth_access_token_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.oauth_access_token.token_id. + */ + public final TableField TOKEN_ID = createField( + DSL.name("token_id"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); + /** + * The column public.oauth_access_token.token. + */ + public final TableField TOKEN = createField(DSL.name("token"), + org.jooq.impl.SQLDataType.BLOB, this, ""); + /** + * The column public.oauth_access_token.authentication_id. + */ + public final TableField AUTHENTICATION_ID = createField( + DSL.name("authentication_id"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); + /** + * The column public.oauth_access_token.username. + */ + public final TableField USERNAME = createField( + DSL.name("username"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); + /** + * The column public.oauth_access_token.user_id. + */ + public final TableField USER_ID = createField(DSL.name("user_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.oauth_access_token.client_id. + */ + public final TableField CLIENT_ID = createField( + DSL.name("client_id"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); + /** + * The column public.oauth_access_token.authentication. + */ + public final TableField AUTHENTICATION = createField( + DSL.name("authentication"), org.jooq.impl.SQLDataType.BLOB, this, ""); + /** + * The column public.oauth_access_token.refresh_token. + */ + public final TableField REFRESH_TOKEN = createField( + DSL.name("refresh_token"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); + + /** + * Create a public.oauth_access_token table reference + */ + public JOauthAccessToken() { + this(DSL.name("oauth_access_token"), null); + } + + /** + * Create an aliased public.oauth_access_token table reference + */ + public JOauthAccessToken(String alias) { + this(DSL.name(alias), OAUTH_ACCESS_TOKEN); + } + + /** + * Create an aliased public.oauth_access_token table reference + */ + public JOauthAccessToken(Name alias) { + this(alias, OAUTH_ACCESS_TOKEN); + } + + private JOauthAccessToken(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JOauthAccessToken(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JOauthAccessToken(Table child, + ForeignKey key) { + super(child, key, OAUTH_ACCESS_TOKEN); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JOauthAccessTokenRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.OAUTH_ACCESS_TOKEN_PKEY, Indexes.OAUTH_AT_USER_IDX, + Indexes.USERS_ACCESS_TOKEN_UNIQUE); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_OAUTH_ACCESS_TOKEN; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.OAUTH_ACCESS_TOKEN_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.OAUTH_ACCESS_TOKEN_PKEY, + Keys.USERS_ACCESS_TOKEN_UNIQUE); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY); + } + + public JUsers users() { + return new JUsers(this, Keys.OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY); + } + + @Override + public JOauthAccessToken as(String alias) { + return new JOauthAccessToken(DSL.name(alias), this); + } + + @Override + public JOauthAccessToken as(Name alias) { + return new JOauthAccessToken(alias, this); + } + + /** + * Rename this table + */ + @Override + public JOauthAccessToken rename(String name) { + return new JOauthAccessToken(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JOauthAccessToken rename(Name name) { + return new JOauthAccessToken(name, null); + } + + // ------------------------------------------------------------------------- + // Row9 type methods + // ------------------------------------------------------------------------- + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistration.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistration.java index 8aa550cad..172c17220 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistration.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistration.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -38,169 +35,173 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JOauthRegistration extends TableImpl { - private static final long serialVersionUID = -982956746; - - /** - * The reference instance of public.oauth_registration - */ - public static final JOauthRegistration OAUTH_REGISTRATION = new JOauthRegistration(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JOauthRegistrationRecord.class; - } - - /** - * The column public.oauth_registration.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, ""); - - /** - * The column public.oauth_registration.client_id. - */ - public final TableField CLIENT_ID = createField(DSL.name("client_id"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - - /** - * The column public.oauth_registration.client_secret. - */ - public final TableField CLIENT_SECRET = createField(DSL.name("client_secret"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * The column public.oauth_registration.client_auth_method. - */ - public final TableField CLIENT_AUTH_METHOD = createField(DSL.name("client_auth_method"), org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, ""); - - /** - * The column public.oauth_registration.auth_grant_type. - */ - public final TableField AUTH_GRANT_TYPE = createField(DSL.name("auth_grant_type"), org.jooq.impl.SQLDataType.VARCHAR(64), this, ""); - - /** - * The column public.oauth_registration.redirect_uri_template. - */ - public final TableField REDIRECT_URI_TEMPLATE = createField(DSL.name("redirect_uri_template"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * The column public.oauth_registration.authorization_uri. - */ - public final TableField AUTHORIZATION_URI = createField(DSL.name("authorization_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * The column public.oauth_registration.token_uri. - */ - public final TableField TOKEN_URI = createField(DSL.name("token_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * The column public.oauth_registration.user_info_endpoint_uri. - */ - public final TableField USER_INFO_ENDPOINT_URI = createField(DSL.name("user_info_endpoint_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * The column public.oauth_registration.user_info_endpoint_name_attr. - */ - public final TableField USER_INFO_ENDPOINT_NAME_ATTR = createField(DSL.name("user_info_endpoint_name_attr"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * The column public.oauth_registration.jwk_set_uri. - */ - public final TableField JWK_SET_URI = createField(DSL.name("jwk_set_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * The column public.oauth_registration.client_name. - */ - public final TableField CLIENT_NAME = createField(DSL.name("client_name"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); - - /** - * Create a public.oauth_registration table reference - */ - public JOauthRegistration() { - this(DSL.name("oauth_registration"), null); - } - - /** - * Create an aliased public.oauth_registration table reference - */ - public JOauthRegistration(String alias) { - this(DSL.name(alias), OAUTH_REGISTRATION); - } - - /** - * Create an aliased public.oauth_registration table reference - */ - public JOauthRegistration(Name alias) { - this(alias, OAUTH_REGISTRATION); - } - - private JOauthRegistration(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JOauthRegistration(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JOauthRegistration(Table child, ForeignKey key) { - super(child, key, OAUTH_REGISTRATION); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.OAUTH_REGISTRATION_CLIENT_ID_KEY, Indexes.OAUTH_REGISTRATION_PKEY); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.OAUTH_REGISTRATION_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.OAUTH_REGISTRATION_PKEY, Keys.OAUTH_REGISTRATION_CLIENT_ID_KEY); - } - - @Override - public JOauthRegistration as(String alias) { - return new JOauthRegistration(DSL.name(alias), this); - } - - @Override - public JOauthRegistration as(Name alias) { - return new JOauthRegistration(alias, this); - } - - /** - * Rename this table - */ - @Override - public JOauthRegistration rename(String name) { - return new JOauthRegistration(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JOauthRegistration rename(Name name) { - return new JOauthRegistration(name, null); - } - - // ------------------------------------------------------------------------- - // Row12 type methods - // ------------------------------------------------------------------------- - - @Override - public Row12 fieldsRow() { - return (Row12) super.fieldsRow(); - } + /** + * The reference instance of public.oauth_registration + */ + public static final JOauthRegistration OAUTH_REGISTRATION = new JOauthRegistration(); + private static final long serialVersionUID = -982956746; + /** + * The column public.oauth_registration.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, ""); + /** + * The column public.oauth_registration.client_id. + */ + public final TableField CLIENT_ID = createField( + DSL.name("client_id"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); + /** + * The column public.oauth_registration.client_secret. + */ + public final TableField CLIENT_SECRET = createField( + DSL.name("client_secret"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + /** + * The column public.oauth_registration.client_auth_method. + */ + public final TableField CLIENT_AUTH_METHOD = createField( + DSL.name("client_auth_method"), org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, + ""); + /** + * The column public.oauth_registration.auth_grant_type. + */ + public final TableField AUTH_GRANT_TYPE = createField( + DSL.name("auth_grant_type"), org.jooq.impl.SQLDataType.VARCHAR(64), this, ""); + /** + * The column public.oauth_registration.redirect_uri_template. + */ + public final TableField REDIRECT_URI_TEMPLATE = createField( + DSL.name("redirect_uri_template"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + /** + * The column public.oauth_registration.authorization_uri. + */ + public final TableField AUTHORIZATION_URI = createField( + DSL.name("authorization_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + /** + * The column public.oauth_registration.token_uri. + */ + public final TableField TOKEN_URI = createField( + DSL.name("token_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + /** + * The column public.oauth_registration.user_info_endpoint_uri. + */ + public final TableField USER_INFO_ENDPOINT_URI = createField( + DSL.name("user_info_endpoint_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + /** + * The column public.oauth_registration.user_info_endpoint_name_attr. + */ + public final TableField USER_INFO_ENDPOINT_NAME_ATTR = createField( + DSL.name("user_info_endpoint_name_attr"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + /** + * The column public.oauth_registration.jwk_set_uri. + */ + public final TableField JWK_SET_URI = createField( + DSL.name("jwk_set_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + /** + * The column public.oauth_registration.client_name. + */ + public final TableField CLIENT_NAME = createField( + DSL.name("client_name"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); + + /** + * Create a public.oauth_registration table reference + */ + public JOauthRegistration() { + this(DSL.name("oauth_registration"), null); + } + + /** + * Create an aliased public.oauth_registration table reference + */ + public JOauthRegistration(String alias) { + this(DSL.name(alias), OAUTH_REGISTRATION); + } + + /** + * Create an aliased public.oauth_registration table reference + */ + public JOauthRegistration(Name alias) { + this(alias, OAUTH_REGISTRATION); + } + + private JOauthRegistration(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JOauthRegistration(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JOauthRegistration(Table child, + ForeignKey key) { + super(child, key, OAUTH_REGISTRATION); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JOauthRegistrationRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.OAUTH_REGISTRATION_CLIENT_ID_KEY, + Indexes.OAUTH_REGISTRATION_PKEY); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.OAUTH_REGISTRATION_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.OAUTH_REGISTRATION_PKEY, + Keys.OAUTH_REGISTRATION_CLIENT_ID_KEY); + } + + @Override + public JOauthRegistration as(String alias) { + return new JOauthRegistration(DSL.name(alias), this); + } + + @Override + public JOauthRegistration as(Name alias) { + return new JOauthRegistration(alias, this); + } + + /** + * Rename this table + */ + @Override + public JOauthRegistration rename(String name) { + return new JOauthRegistration(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JOauthRegistration rename(Name name) { + return new JOauthRegistration(name, null); + } + + // ------------------------------------------------------------------------- + // Row12 type methods + // ------------------------------------------------------------------------- + + @Override + public Row12 fieldsRow() { + return (Row12) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationRestriction.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationRestriction.java index 63d523eb2..8da01d6ac 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationRestriction.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationRestriction.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationRestrictionRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,143 +36,151 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JOauthRegistrationRestriction extends TableImpl { - private static final long serialVersionUID = -973937527; - - /** - * The reference instance of public.oauth_registration_restriction - */ - public static final JOauthRegistrationRestriction OAUTH_REGISTRATION_RESTRICTION = new JOauthRegistrationRestriction(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JOauthRegistrationRestrictionRecord.class; - } - - /** - * The column public.oauth_registration_restriction.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('oauth_registration_restriction_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); - - /** - * The column public.oauth_registration_restriction.oauth_registration_fk. - */ - public final TableField OAUTH_REGISTRATION_FK = createField(DSL.name("oauth_registration_fk"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); - - /** - * The column public.oauth_registration_restriction.type. - */ - public final TableField TYPE = createField(DSL.name("type"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - - /** - * The column public.oauth_registration_restriction.value. - */ - public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - - /** - * Create a public.oauth_registration_restriction table reference - */ - public JOauthRegistrationRestriction() { - this(DSL.name("oauth_registration_restriction"), null); - } - - /** - * Create an aliased public.oauth_registration_restriction table reference - */ - public JOauthRegistrationRestriction(String alias) { - this(DSL.name(alias), OAUTH_REGISTRATION_RESTRICTION); - } - - /** - * Create an aliased public.oauth_registration_restriction table reference - */ - public JOauthRegistrationRestriction(Name alias) { - this(alias, OAUTH_REGISTRATION_RESTRICTION); - } - - private JOauthRegistrationRestriction(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JOauthRegistrationRestriction(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JOauthRegistrationRestriction(Table child, ForeignKey key) { - super(child, key, OAUTH_REGISTRATION_RESTRICTION); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.OAUTH_REGISTRATION_RESTRICTION_PK, Indexes.OAUTH_REGISTRATION_RESTRICTION_UNIQUE); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_OAUTH_REGISTRATION_RESTRICTION; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.OAUTH_REGISTRATION_RESTRICTION_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.OAUTH_REGISTRATION_RESTRICTION_PK, Keys.OAUTH_REGISTRATION_RESTRICTION_UNIQUE); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY); - } - - public JOauthRegistration oauthRegistration() { - return new JOauthRegistration(this, Keys.OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY); - } - - @Override - public JOauthRegistrationRestriction as(String alias) { - return new JOauthRegistrationRestriction(DSL.name(alias), this); - } - - @Override - public JOauthRegistrationRestriction as(Name alias) { - return new JOauthRegistrationRestriction(alias, this); - } - - /** - * Rename this table - */ - @Override - public JOauthRegistrationRestriction rename(String name) { - return new JOauthRegistrationRestriction(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JOauthRegistrationRestriction rename(Name name) { - return new JOauthRegistrationRestriction(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + /** + * The reference instance of public.oauth_registration_restriction + */ + public static final JOauthRegistrationRestriction OAUTH_REGISTRATION_RESTRICTION = new JOauthRegistrationRestriction(); + private static final long serialVersionUID = -973937527; + /** + * The column public.oauth_registration_restriction.id. + */ + public final TableField ID = createField( + DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('oauth_registration_restriction_id_seq'::regclass)", + org.jooq.impl.SQLDataType.INTEGER)), this, ""); + /** + * The column public.oauth_registration_restriction.oauth_registration_fk. + */ + public final TableField OAUTH_REGISTRATION_FK = createField( + DSL.name("oauth_registration_fk"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); + /** + * The column public.oauth_registration_restriction.type. + */ + public final TableField TYPE = createField( + DSL.name("type"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + /** + * The column public.oauth_registration_restriction.value. + */ + public final TableField VALUE = createField( + DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + + /** + * Create a public.oauth_registration_restriction table reference + */ + public JOauthRegistrationRestriction() { + this(DSL.name("oauth_registration_restriction"), null); + } + + /** + * Create an aliased public.oauth_registration_restriction table reference + */ + public JOauthRegistrationRestriction(String alias) { + this(DSL.name(alias), OAUTH_REGISTRATION_RESTRICTION); + } + + /** + * Create an aliased public.oauth_registration_restriction table reference + */ + public JOauthRegistrationRestriction(Name alias) { + this(alias, OAUTH_REGISTRATION_RESTRICTION); + } + + private JOauthRegistrationRestriction(Name alias, + Table aliased) { + this(alias, aliased, null); + } + + private JOauthRegistrationRestriction(Name alias, + Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JOauthRegistrationRestriction(Table child, + ForeignKey key) { + super(child, key, OAUTH_REGISTRATION_RESTRICTION); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JOauthRegistrationRestrictionRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.OAUTH_REGISTRATION_RESTRICTION_PK, + Indexes.OAUTH_REGISTRATION_RESTRICTION_UNIQUE); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_OAUTH_REGISTRATION_RESTRICTION; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.OAUTH_REGISTRATION_RESTRICTION_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList( + Keys.OAUTH_REGISTRATION_RESTRICTION_PK, Keys.OAUTH_REGISTRATION_RESTRICTION_UNIQUE); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY); + } + + public JOauthRegistration oauthRegistration() { + return new JOauthRegistration(this, + Keys.OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY); + } + + @Override + public JOauthRegistrationRestriction as(String alias) { + return new JOauthRegistrationRestriction(DSL.name(alias), this); + } + + @Override + public JOauthRegistrationRestriction as(Name alias) { + return new JOauthRegistrationRestriction(alias, this); + } + + /** + * Rename this table + */ + @Override + public JOauthRegistrationRestriction rename(String name) { + return new JOauthRegistrationRestriction(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JOauthRegistrationRestriction rename(Name name) { + return new JOauthRegistrationRestriction(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationScope.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationScope.java index f5ea776bd..dec7c213c 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationScope.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationScope.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationScopeRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,138 +36,145 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JOauthRegistrationScope extends TableImpl { - private static final long serialVersionUID = -729490491; - - /** - * The reference instance of public.oauth_registration_scope - */ - public static final JOauthRegistrationScope OAUTH_REGISTRATION_SCOPE = new JOauthRegistrationScope(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JOauthRegistrationScopeRecord.class; - } - - /** - * The column public.oauth_registration_scope.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('oauth_registration_scope_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); - - /** - * The column public.oauth_registration_scope.oauth_registration_fk. - */ - public final TableField OAUTH_REGISTRATION_FK = createField(DSL.name("oauth_registration_fk"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); - - /** - * The column public.oauth_registration_scope.scope. - */ - public final TableField SCOPE = createField(DSL.name("scope"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * Create a public.oauth_registration_scope table reference - */ - public JOauthRegistrationScope() { - this(DSL.name("oauth_registration_scope"), null); - } - - /** - * Create an aliased public.oauth_registration_scope table reference - */ - public JOauthRegistrationScope(String alias) { - this(DSL.name(alias), OAUTH_REGISTRATION_SCOPE); - } - - /** - * Create an aliased public.oauth_registration_scope table reference - */ - public JOauthRegistrationScope(Name alias) { - this(alias, OAUTH_REGISTRATION_SCOPE); - } - - private JOauthRegistrationScope(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JOauthRegistrationScope(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JOauthRegistrationScope(Table child, ForeignKey key) { - super(child, key, OAUTH_REGISTRATION_SCOPE); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.OAUTH_REGISTRATION_SCOPE_PK, Indexes.OAUTH_REGISTRATION_SCOPE_UNIQUE); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_OAUTH_REGISTRATION_SCOPE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.OAUTH_REGISTRATION_SCOPE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.OAUTH_REGISTRATION_SCOPE_PK, Keys.OAUTH_REGISTRATION_SCOPE_UNIQUE); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY); - } - - public JOauthRegistration oauthRegistration() { - return new JOauthRegistration(this, Keys.OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY); - } - - @Override - public JOauthRegistrationScope as(String alias) { - return new JOauthRegistrationScope(DSL.name(alias), this); - } - - @Override - public JOauthRegistrationScope as(Name alias) { - return new JOauthRegistrationScope(alias, this); - } - - /** - * Rename this table - */ - @Override - public JOauthRegistrationScope rename(String name) { - return new JOauthRegistrationScope(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JOauthRegistrationScope rename(Name name) { - return new JOauthRegistrationScope(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + /** + * The reference instance of public.oauth_registration_scope + */ + public static final JOauthRegistrationScope OAUTH_REGISTRATION_SCOPE = new JOauthRegistrationScope(); + private static final long serialVersionUID = -729490491; + /** + * The column public.oauth_registration_scope.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('oauth_registration_scope_id_seq'::regclass)", + org.jooq.impl.SQLDataType.INTEGER)), this, ""); + /** + * The column public.oauth_registration_scope.oauth_registration_fk. + */ + public final TableField OAUTH_REGISTRATION_FK = createField( + DSL.name("oauth_registration_fk"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); + /** + * The column public.oauth_registration_scope.scope. + */ + public final TableField SCOPE = createField( + DSL.name("scope"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + + /** + * Create a public.oauth_registration_scope table reference + */ + public JOauthRegistrationScope() { + this(DSL.name("oauth_registration_scope"), null); + } + + /** + * Create an aliased public.oauth_registration_scope table reference + */ + public JOauthRegistrationScope(String alias) { + this(DSL.name(alias), OAUTH_REGISTRATION_SCOPE); + } + + /** + * Create an aliased public.oauth_registration_scope table reference + */ + public JOauthRegistrationScope(Name alias) { + this(alias, OAUTH_REGISTRATION_SCOPE); + } + + private JOauthRegistrationScope(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JOauthRegistrationScope(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JOauthRegistrationScope(Table child, + ForeignKey key) { + super(child, key, OAUTH_REGISTRATION_SCOPE); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JOauthRegistrationScopeRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.OAUTH_REGISTRATION_SCOPE_PK, + Indexes.OAUTH_REGISTRATION_SCOPE_UNIQUE); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_OAUTH_REGISTRATION_SCOPE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.OAUTH_REGISTRATION_SCOPE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.OAUTH_REGISTRATION_SCOPE_PK, + Keys.OAUTH_REGISTRATION_SCOPE_UNIQUE); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY); + } + + public JOauthRegistration oauthRegistration() { + return new JOauthRegistration(this, + Keys.OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY); + } + + @Override + public JOauthRegistrationScope as(String alias) { + return new JOauthRegistrationScope(DSL.name(alias), this); + } + + @Override + public JOauthRegistrationScope as(Name alias) { + return new JOauthRegistrationScope(alias, this); + } + + /** + * Rename this table + */ + @Override + public JOauthRegistrationScope rename(String name) { + return new JOauthRegistrationScope(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JOauthRegistrationScope rename(Name name) { + return new JOauthRegistrationScope(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOnboarding.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOnboarding.java index da8518405..debed3b2f 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOnboarding.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOnboarding.java @@ -8,13 +8,10 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JOnboardingRecord; - import java.sql.Timestamp; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -40,139 +37,140 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JOnboarding extends TableImpl { - private static final long serialVersionUID = -1798770038; - - /** - * The reference instance of public.onboarding - */ - public static final JOnboarding ONBOARDING = new JOnboarding(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JOnboardingRecord.class; - } - - /** - * The column public.onboarding.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.SMALLINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('onboarding_id_seq'::regclass)", org.jooq.impl.SQLDataType.SMALLINT)), this, ""); - - /** - * The column public.onboarding.data. - */ - public final TableField DATA = createField(DSL.name("data"), org.jooq.impl.SQLDataType.CLOB, this, ""); - - /** - * The column public.onboarding.page. - */ - public final TableField PAGE = createField(DSL.name("page"), org.jooq.impl.SQLDataType.VARCHAR(50).nullable(false), this, ""); - - /** - * The column public.onboarding.available_from. - */ - public final TableField AVAILABLE_FROM = createField(DSL.name("available_from"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * The column public.onboarding.available_to. - */ - public final TableField AVAILABLE_TO = createField(DSL.name("available_to"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * Create a public.onboarding table reference - */ - public JOnboarding() { - this(DSL.name("onboarding"), null); - } - - /** - * Create an aliased public.onboarding table reference - */ - public JOnboarding(String alias) { - this(DSL.name(alias), ONBOARDING); - } - - /** - * Create an aliased public.onboarding table reference - */ - public JOnboarding(Name alias) { - this(alias, ONBOARDING); - } - - private JOnboarding(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JOnboarding(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JOnboarding(Table child, ForeignKey key) { - super(child, key, ONBOARDING); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ONBOARDING_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ONBOARDING; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ONBOARDING_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ONBOARDING_PK); - } - - @Override - public JOnboarding as(String alias) { - return new JOnboarding(DSL.name(alias), this); - } - - @Override - public JOnboarding as(Name alias) { - return new JOnboarding(alias, this); - } - - /** - * Rename this table - */ - @Override - public JOnboarding rename(String name) { - return new JOnboarding(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JOnboarding rename(Name name) { - return new JOnboarding(name, null); - } - - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } + /** + * The reference instance of public.onboarding + */ + public static final JOnboarding ONBOARDING = new JOnboarding(); + private static final long serialVersionUID = -1798770038; + /** + * The column public.onboarding.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.SMALLINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('onboarding_id_seq'::regclass)", + org.jooq.impl.SQLDataType.SMALLINT)), this, ""); + /** + * The column public.onboarding.data. + */ + public final TableField DATA = createField(DSL.name("data"), + org.jooq.impl.SQLDataType.CLOB, this, ""); + /** + * The column public.onboarding.page. + */ + public final TableField PAGE = createField(DSL.name("page"), + org.jooq.impl.SQLDataType.VARCHAR(50).nullable(false), this, ""); + /** + * The column public.onboarding.available_from. + */ + public final TableField AVAILABLE_FROM = createField( + DSL.name("available_from"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + /** + * The column public.onboarding.available_to. + */ + public final TableField AVAILABLE_TO = createField( + DSL.name("available_to"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + + /** + * Create a public.onboarding table reference + */ + public JOnboarding() { + this(DSL.name("onboarding"), null); + } + + /** + * Create an aliased public.onboarding table reference + */ + public JOnboarding(String alias) { + this(DSL.name(alias), ONBOARDING); + } + + /** + * Create an aliased public.onboarding table reference + */ + public JOnboarding(Name alias) { + this(alias, ONBOARDING); + } + + private JOnboarding(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JOnboarding(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JOnboarding(Table child, ForeignKey key) { + super(child, key, ONBOARDING); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JOnboardingRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ONBOARDING_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ONBOARDING; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ONBOARDING_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ONBOARDING_PK); + } + + @Override + public JOnboarding as(String alias) { + return new JOnboarding(DSL.name(alias), this); + } + + @Override + public JOnboarding as(Name alias) { + return new JOnboarding(alias, this); + } + + /** + * Rename this table + */ + @Override + public JOnboarding rename(String name) { + return new JOnboarding(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JOnboarding rename(Name name) { + return new JOnboarding(name, null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JParameter.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JParameter.java index 83a277958..f52b1b9c3 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JParameter.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JParameter.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JParameterRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -37,123 +34,122 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JParameter extends TableImpl { - private static final long serialVersionUID = 870603839; - - /** - * The reference instance of public.parameter - */ - public static final JParameter PARAMETER = new JParameter(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JParameterRecord.class; - } - - /** - * The column public.parameter.item_id. - */ - public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.parameter.key. - */ - public final TableField KEY = createField(DSL.name("key"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.parameter.value. - */ - public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * Create a public.parameter table reference - */ - public JParameter() { - this(DSL.name("parameter"), null); - } - - /** - * Create an aliased public.parameter table reference - */ - public JParameter(String alias) { - this(DSL.name(alias), PARAMETER); - } - - /** - * Create an aliased public.parameter table reference - */ - public JParameter(Name alias) { - this(alias, PARAMETER); - } - - private JParameter(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JParameter(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JParameter(Table child, ForeignKey key) { - super(child, key, PARAMETER); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.PARAMETER_TI_IDX); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.PARAMETER__PARAMETER_ITEM_ID_FKEY); - } - - public JTestItem testItem() { - return new JTestItem(this, Keys.PARAMETER__PARAMETER_ITEM_ID_FKEY); - } - - @Override - public JParameter as(String alias) { - return new JParameter(DSL.name(alias), this); - } - - @Override - public JParameter as(Name alias) { - return new JParameter(alias, this); - } - - /** - * Rename this table - */ - @Override - public JParameter rename(String name) { - return new JParameter(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JParameter rename(Name name) { - return new JParameter(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + /** + * The reference instance of public.parameter + */ + public static final JParameter PARAMETER = new JParameter(); + private static final long serialVersionUID = 870603839; + /** + * The column public.parameter.item_id. + */ + public final TableField ITEM_ID = createField(DSL.name("item_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.parameter.key. + */ + public final TableField KEY = createField(DSL.name("key"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.parameter.value. + */ + public final TableField VALUE = createField(DSL.name("value"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * Create a public.parameter table reference + */ + public JParameter() { + this(DSL.name("parameter"), null); + } + + /** + * Create an aliased public.parameter table reference + */ + public JParameter(String alias) { + this(DSL.name(alias), PARAMETER); + } + + /** + * Create an aliased public.parameter table reference + */ + public JParameter(Name alias) { + this(alias, PARAMETER); + } + + private JParameter(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JParameter(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JParameter(Table child, ForeignKey key) { + super(child, key, PARAMETER); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JParameterRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.PARAMETER_TI_IDX); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.PARAMETER__PARAMETER_ITEM_ID_FKEY); + } + + public JTestItem testItem() { + return new JTestItem(this, Keys.PARAMETER__PARAMETER_ITEM_ID_FKEY); + } + + @Override + public JParameter as(String alias) { + return new JParameter(DSL.name(alias), this); + } + + @Override + public JParameter as(Name alias) { + return new JParameter(alias, this); + } + + /** + * Rename this table + */ + @Override + public JParameter rename(String name) { + return new JParameter(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JParameter rename(Name name) { + return new JParameter(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplate.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplate.java index 899ff846a..2ca6d9203 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplate.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplate.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JPatternTemplateRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,153 +36,158 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JPatternTemplate extends TableImpl { - private static final long serialVersionUID = 505397920; - - /** - * The reference instance of public.pattern_template - */ - public static final JPatternTemplate PATTERN_TEMPLATE = new JPatternTemplate(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JPatternTemplateRecord.class; - } - - /** - * The column public.pattern_template.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('pattern_template_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.pattern_template.name. - */ - public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.pattern_template.value. - */ - public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.pattern_template.type. - */ - public final TableField TYPE = createField(DSL.name("type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.pattern_template.enabled. - */ - public final TableField ENABLED = createField(DSL.name("enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - - /** - * The column public.pattern_template.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.pattern_template table reference - */ - public JPatternTemplate() { - this(DSL.name("pattern_template"), null); - } - - /** - * Create an aliased public.pattern_template table reference - */ - public JPatternTemplate(String alias) { - this(DSL.name(alias), PATTERN_TEMPLATE); - } - - /** - * Create an aliased public.pattern_template table reference - */ - public JPatternTemplate(Name alias) { - this(alias, PATTERN_TEMPLATE); - } - - private JPatternTemplate(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JPatternTemplate(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JPatternTemplate(Table child, ForeignKey key) { - super(child, key, PATTERN_TEMPLATE); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.PATTERN_TEMPLATE_PK, Indexes.UNQ_NAME_PROJECTID); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_PATTERN_TEMPLATE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.PATTERN_TEMPLATE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.PATTERN_TEMPLATE_PK, Keys.UNQ_NAME_PROJECTID); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY); - } - - @Override - public JPatternTemplate as(String alias) { - return new JPatternTemplate(DSL.name(alias), this); - } - - @Override - public JPatternTemplate as(Name alias) { - return new JPatternTemplate(alias, this); - } - - /** - * Rename this table - */ - @Override - public JPatternTemplate rename(String name) { - return new JPatternTemplate(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JPatternTemplate rename(Name name) { - return new JPatternTemplate(name, null); - } - - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } + /** + * The reference instance of public.pattern_template + */ + public static final JPatternTemplate PATTERN_TEMPLATE = new JPatternTemplate(); + private static final long serialVersionUID = 505397920; + /** + * The column public.pattern_template.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('pattern_template_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.pattern_template.name. + */ + public final TableField NAME = createField(DSL.name("name"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.pattern_template.value. + */ + public final TableField VALUE = createField(DSL.name("value"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.pattern_template.type. + */ + public final TableField TYPE = createField(DSL.name("type"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.pattern_template.enabled. + */ + public final TableField ENABLED = createField( + DSL.name("enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); + /** + * The column public.pattern_template.project_id. + */ + public final TableField PROJECT_ID = createField( + DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.pattern_template table reference + */ + public JPatternTemplate() { + this(DSL.name("pattern_template"), null); + } + + /** + * Create an aliased public.pattern_template table reference + */ + public JPatternTemplate(String alias) { + this(DSL.name(alias), PATTERN_TEMPLATE); + } + + /** + * Create an aliased public.pattern_template table reference + */ + public JPatternTemplate(Name alias) { + this(alias, PATTERN_TEMPLATE); + } + + private JPatternTemplate(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JPatternTemplate(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JPatternTemplate(Table child, + ForeignKey key) { + super(child, key, PATTERN_TEMPLATE); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JPatternTemplateRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.PATTERN_TEMPLATE_PK, Indexes.UNQ_NAME_PROJECTID); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_PATTERN_TEMPLATE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PATTERN_TEMPLATE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.PATTERN_TEMPLATE_PK, + Keys.UNQ_NAME_PROJECTID); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY); + } + + @Override + public JPatternTemplate as(String alias) { + return new JPatternTemplate(DSL.name(alias), this); + } + + @Override + public JPatternTemplate as(Name alias) { + return new JPatternTemplate(alias, this); + } + + /** + * Rename this table + */ + @Override + public JPatternTemplate rename(String name) { + return new JPatternTemplate(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JPatternTemplate rename(Name name) { + return new JPatternTemplate(name, null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplateTestItem.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplateTestItem.java index 588acea06..211e69c14 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplateTestItem.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplateTestItem.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JPatternTemplateTestItemRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -38,132 +35,137 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JPatternTemplateTestItem extends TableImpl { - private static final long serialVersionUID = 1502918772; - - /** - * The reference instance of public.pattern_template_test_item - */ - public static final JPatternTemplateTestItem PATTERN_TEMPLATE_TEST_ITEM = new JPatternTemplateTestItem(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JPatternTemplateTestItemRecord.class; - } - - /** - * The column public.pattern_template_test_item.pattern_id. - */ - public final TableField PATTERN_ID = createField(DSL.name("pattern_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.pattern_template_test_item.item_id. - */ - public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.pattern_template_test_item table reference - */ - public JPatternTemplateTestItem() { - this(DSL.name("pattern_template_test_item"), null); - } - - /** - * Create an aliased public.pattern_template_test_item table reference - */ - public JPatternTemplateTestItem(String alias) { - this(DSL.name(alias), PATTERN_TEMPLATE_TEST_ITEM); - } - - /** - * Create an aliased public.pattern_template_test_item table reference - */ - public JPatternTemplateTestItem(Name alias) { - this(alias, PATTERN_TEMPLATE_TEST_ITEM); - } - - private JPatternTemplateTestItem(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JPatternTemplateTestItem(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JPatternTemplateTestItem(Table child, ForeignKey key) { - super(child, key, PATTERN_TEMPLATE_TEST_ITEM); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.PATTERN_ITEM_ITEM_ID_IDX, Indexes.PATTERN_ITEM_UNQ); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.PATTERN_ITEM_UNQ; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.PATTERN_ITEM_UNQ); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY, Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY); - } - - public JPatternTemplate patternTemplate() { - return new JPatternTemplate(this, Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY); - } - - public JTestItem testItem() { - return new JTestItem(this, Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY); - } - - @Override - public JPatternTemplateTestItem as(String alias) { - return new JPatternTemplateTestItem(DSL.name(alias), this); - } - - @Override - public JPatternTemplateTestItem as(Name alias) { - return new JPatternTemplateTestItem(alias, this); - } - - /** - * Rename this table - */ - @Override - public JPatternTemplateTestItem rename(String name) { - return new JPatternTemplateTestItem(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JPatternTemplateTestItem rename(Name name) { - return new JPatternTemplateTestItem(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + /** + * The reference instance of public.pattern_template_test_item + */ + public static final JPatternTemplateTestItem PATTERN_TEMPLATE_TEST_ITEM = new JPatternTemplateTestItem(); + private static final long serialVersionUID = 1502918772; + /** + * The column public.pattern_template_test_item.pattern_id. + */ + public final TableField PATTERN_ID = createField( + DSL.name("pattern_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.pattern_template_test_item.item_id. + */ + public final TableField ITEM_ID = createField( + DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.pattern_template_test_item table reference + */ + public JPatternTemplateTestItem() { + this(DSL.name("pattern_template_test_item"), null); + } + + /** + * Create an aliased public.pattern_template_test_item table reference + */ + public JPatternTemplateTestItem(String alias) { + this(DSL.name(alias), PATTERN_TEMPLATE_TEST_ITEM); + } + + /** + * Create an aliased public.pattern_template_test_item table reference + */ + public JPatternTemplateTestItem(Name alias) { + this(alias, PATTERN_TEMPLATE_TEST_ITEM); + } + + private JPatternTemplateTestItem(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JPatternTemplateTestItem(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JPatternTemplateTestItem(Table child, + ForeignKey key) { + super(child, key, PATTERN_TEMPLATE_TEST_ITEM); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JPatternTemplateTestItemRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.PATTERN_ITEM_ITEM_ID_IDX, Indexes.PATTERN_ITEM_UNQ); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PATTERN_ITEM_UNQ; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.PATTERN_ITEM_UNQ); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY, + Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY); + } + + public JPatternTemplate patternTemplate() { + return new JPatternTemplate(this, + Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY); + } + + public JTestItem testItem() { + return new JTestItem(this, + Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY); + } + + @Override + public JPatternTemplateTestItem as(String alias) { + return new JPatternTemplateTestItem(DSL.name(alias), this); + } + + @Override + public JPatternTemplateTestItem as(Name alias) { + return new JPatternTemplateTestItem(alias, this); + } + + /** + * Rename this table + */ + @Override + public JPatternTemplateTestItem rename(String name) { + return new JPatternTemplateTestItem(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JPatternTemplateTestItem rename(Name name) { + return new JPatternTemplateTestItem(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JPgpArmorHeaders.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JPgpArmorHeaders.java index c8a9b346f..7973bfc30 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JPgpArmorHeaders.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JPgpArmorHeaders.java @@ -6,9 +6,7 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.tables.records.JPgpArmorHeadersRecord; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Name; @@ -31,122 +29,123 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JPgpArmorHeaders extends TableImpl { - private static final long serialVersionUID = -689424105; - - /** - * The reference instance of public.pgp_armor_headers - */ - public static final JPgpArmorHeaders PGP_ARMOR_HEADERS = new JPgpArmorHeaders(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JPgpArmorHeadersRecord.class; - } - - /** - * The column public.pgp_armor_headers.key. - */ - public final TableField KEY = createField(DSL.name("key"), org.jooq.impl.SQLDataType.CLOB, this, ""); - - /** - * The column public.pgp_armor_headers.value. - */ - public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.CLOB, this, ""); - - /** - * Create a public.pgp_armor_headers table reference - */ - public JPgpArmorHeaders() { - this(DSL.name("pgp_armor_headers"), null); - } - - /** - * Create an aliased public.pgp_armor_headers table reference - */ - public JPgpArmorHeaders(String alias) { - this(DSL.name(alias), PGP_ARMOR_HEADERS); - } - - /** - * Create an aliased public.pgp_armor_headers table reference - */ - public JPgpArmorHeaders(Name alias) { - this(alias, PGP_ARMOR_HEADERS); - } - - private JPgpArmorHeaders(Name alias, Table aliased) { - this(alias, aliased, new Field[1]); - } - - private JPgpArmorHeaders(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JPgpArmorHeaders(Table child, ForeignKey key) { - super(child, key, PGP_ARMOR_HEADERS); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public JPgpArmorHeaders as(String alias) { - return new JPgpArmorHeaders(DSL.name(alias), this, parameters); - } - - @Override - public JPgpArmorHeaders as(Name alias) { - return new JPgpArmorHeaders(alias, this, parameters); - } - - /** - * Rename this table - */ - @Override - public JPgpArmorHeaders rename(String name) { - return new JPgpArmorHeaders(DSL.name(name), null, parameters); - } - - /** - * Rename this table - */ - @Override - public JPgpArmorHeaders rename(Name name) { - return new JPgpArmorHeaders(name, null, parameters); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - /** - * Call this table-valued function - */ - public JPgpArmorHeaders call(String __1) { - return new JPgpArmorHeaders(DSL.name(getName()), null, new Field[] { - DSL.val(__1, org.jooq.impl.SQLDataType.CLOB) - }); - } - - /** - * Call this table-valued function - */ - public JPgpArmorHeaders call(Field __1) { - return new JPgpArmorHeaders(DSL.name(getName()), null, new Field[] { - __1 - }); - } + /** + * The reference instance of public.pgp_armor_headers + */ + public static final JPgpArmorHeaders PGP_ARMOR_HEADERS = new JPgpArmorHeaders(); + private static final long serialVersionUID = -689424105; + /** + * The column public.pgp_armor_headers.key. + */ + public final TableField KEY = createField(DSL.name("key"), + org.jooq.impl.SQLDataType.CLOB, this, ""); + /** + * The column public.pgp_armor_headers.value. + */ + public final TableField VALUE = createField(DSL.name("value"), + org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * Create a public.pgp_armor_headers table reference + */ + public JPgpArmorHeaders() { + this(DSL.name("pgp_armor_headers"), null); + } + + /** + * Create an aliased public.pgp_armor_headers table reference + */ + public JPgpArmorHeaders(String alias) { + this(DSL.name(alias), PGP_ARMOR_HEADERS); + } + + /** + * Create an aliased public.pgp_armor_headers table reference + */ + public JPgpArmorHeaders(Name alias) { + this(alias, PGP_ARMOR_HEADERS); + } + + private JPgpArmorHeaders(Name alias, Table aliased) { + this(alias, aliased, new Field[1]); + } + + private JPgpArmorHeaders(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JPgpArmorHeaders(Table child, + ForeignKey key) { + super(child, key, PGP_ARMOR_HEADERS); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JPgpArmorHeadersRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public JPgpArmorHeaders as(String alias) { + return new JPgpArmorHeaders(DSL.name(alias), this, parameters); + } + + @Override + public JPgpArmorHeaders as(Name alias) { + return new JPgpArmorHeaders(alias, this, parameters); + } + + /** + * Rename this table + */ + @Override + public JPgpArmorHeaders rename(String name) { + return new JPgpArmorHeaders(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public JPgpArmorHeaders rename(Name name) { + return new JPgpArmorHeaders(name, null, parameters); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public JPgpArmorHeaders call(String __1) { + return new JPgpArmorHeaders(DSL.name(getName()), null, new Field[]{ + DSL.val(__1, org.jooq.impl.SQLDataType.CLOB) + }); + } + + /** + * Call this table-valued function + */ + public JPgpArmorHeaders call(Field __1) { + return new JPgpArmorHeaders(DSL.name(getName()), null, new Field[]{ + __1 + }); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JProject.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JProject.java index 4f07f222f..7d1b4e8c1 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JProject.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JProject.java @@ -8,13 +8,10 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JProjectRecord; - import java.sql.Timestamp; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -41,149 +38,153 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JProject extends TableImpl { - private static final long serialVersionUID = 1584335243; - - /** - * The reference instance of public.project - */ - public static final JProject PROJECT = new JProject(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JProjectRecord.class; - } - - /** - * The column public.project.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('project_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.project.name. - */ - public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.project.project_type. - */ - public final TableField PROJECT_TYPE = createField(DSL.name("project_type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.project.organization. - */ - public final TableField ORGANIZATION = createField(DSL.name("organization"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - - /** - * The column public.project.creation_date. - */ - public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * The column public.project.metadata. - */ - public final TableField METADATA = createField(DSL.name("metadata"), org.jooq.impl.SQLDataType.JSONB, this, ""); - - /** - * The column public.project.allocated_storage. - */ - public final TableField ALLOCATED_STORAGE = createField(DSL.name("allocated_storage"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("0", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * Create a public.project table reference - */ - public JProject() { - this(DSL.name("project"), null); - } - - /** - * Create an aliased public.project table reference - */ - public JProject(String alias) { - this(DSL.name(alias), PROJECT); - } - - /** - * Create an aliased public.project table reference - */ - public JProject(Name alias) { - this(alias, PROJECT); - } - - private JProject(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JProject(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JProject(Table child, ForeignKey key) { - super(child, key, PROJECT); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.PROJECT_NAME_KEY, Indexes.PROJECT_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_PROJECT; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.PROJECT_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.PROJECT_PK, Keys.PROJECT_NAME_KEY); - } - - @Override - public JProject as(String alias) { - return new JProject(DSL.name(alias), this); - } - - @Override - public JProject as(Name alias) { - return new JProject(alias, this); - } - - /** - * Rename this table - */ - @Override - public JProject rename(String name) { - return new JProject(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JProject rename(Name name) { - return new JProject(name, null); - } - - // ------------------------------------------------------------------------- - // Row7 type methods - // ------------------------------------------------------------------------- - - @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); - } + /** + * The reference instance of public.project + */ + public static final JProject PROJECT = new JProject(); + private static final long serialVersionUID = 1584335243; + /** + * The column public.project.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('project_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.project.name. + */ + public final TableField NAME = createField(DSL.name("name"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.project.project_type. + */ + public final TableField PROJECT_TYPE = createField( + DSL.name("project_type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.project.organization. + */ + public final TableField ORGANIZATION = createField( + DSL.name("organization"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + /** + * The column public.project.creation_date. + */ + public final TableField CREATION_DATE = createField( + DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false) + .defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), + this, ""); + /** + * The column public.project.metadata. + */ + public final TableField METADATA = createField(DSL.name("metadata"), + org.jooq.impl.SQLDataType.JSONB, this, ""); + /** + * The column public.project.allocated_storage. + */ + public final TableField ALLOCATED_STORAGE = createField( + DSL.name("allocated_storage"), org.jooq.impl.SQLDataType.BIGINT.nullable(false) + .defaultValue(org.jooq.impl.DSL.field("0", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * Create a public.project table reference + */ + public JProject() { + this(DSL.name("project"), null); + } + + /** + * Create an aliased public.project table reference + */ + public JProject(String alias) { + this(DSL.name(alias), PROJECT); + } + + /** + * Create an aliased public.project table reference + */ + public JProject(Name alias) { + this(alias, PROJECT); + } + + private JProject(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JProject(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JProject(Table child, ForeignKey key) { + super(child, key, PROJECT); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JProjectRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.PROJECT_NAME_KEY, Indexes.PROJECT_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_PROJECT; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PROJECT_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.PROJECT_PK, Keys.PROJECT_NAME_KEY); + } + + @Override + public JProject as(String alias) { + return new JProject(DSL.name(alias), this); + } + + @Override + public JProject as(Name alias) { + return new JProject(alias, this); + } + + /** + * Rename this table + */ + @Override + public JProject rename(String name) { + return new JProject(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JProject rename(Name name) { + return new JProject(name, null); + } + + // ------------------------------------------------------------------------- + // Row7 type methods + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectAttribute.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectAttribute.java index db1892c07..2559d44d3 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectAttribute.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectAttribute.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JProjectAttributeRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,142 +36,149 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JProjectAttribute extends TableImpl { - private static final long serialVersionUID = -860086297; - - /** - * The reference instance of public.project_attribute - */ - public static final JProjectAttribute PROJECT_ATTRIBUTE = new JProjectAttribute(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JProjectAttributeRecord.class; - } - - /** - * The column public.project_attribute.attribute_id. - */ - public final TableField ATTRIBUTE_ID = createField(DSL.name("attribute_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('project_attribute_attribute_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.project_attribute.value. - */ - public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - - /** - * The column public.project_attribute.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('project_attribute_project_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * Create a public.project_attribute table reference - */ - public JProjectAttribute() { - this(DSL.name("project_attribute"), null); - } - - /** - * Create an aliased public.project_attribute table reference - */ - public JProjectAttribute(String alias) { - this(DSL.name(alias), PROJECT_ATTRIBUTE); - } - - /** - * Create an aliased public.project_attribute table reference - */ - public JProjectAttribute(Name alias) { - this(alias, PROJECT_ATTRIBUTE); - } - - private JProjectAttribute(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JProjectAttribute(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JProjectAttribute(Table child, ForeignKey key) { - super(child, key, PROJECT_ATTRIBUTE); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.UNIQUE_ATTRIBUTE_PER_PROJECT); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_PROJECT_ATTRIBUTE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.UNIQUE_ATTRIBUTE_PER_PROJECT; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.UNIQUE_ATTRIBUTE_PER_PROJECT); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY, Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY); - } - - public JAttribute attribute() { - return new JAttribute(this, Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY); - } - - @Override - public JProjectAttribute as(String alias) { - return new JProjectAttribute(DSL.name(alias), this); - } - - @Override - public JProjectAttribute as(Name alias) { - return new JProjectAttribute(alias, this); - } - - /** - * Rename this table - */ - @Override - public JProjectAttribute rename(String name) { - return new JProjectAttribute(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JProjectAttribute rename(Name name) { - return new JProjectAttribute(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + /** + * The reference instance of public.project_attribute + */ + public static final JProjectAttribute PROJECT_ATTRIBUTE = new JProjectAttribute(); + private static final long serialVersionUID = -860086297; + /** + * The column public.project_attribute.attribute_id. + */ + public final TableField ATTRIBUTE_ID = createField( + DSL.name("attribute_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('project_attribute_attribute_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.project_attribute.value. + */ + public final TableField VALUE = createField(DSL.name("value"), + org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + /** + * The column public.project_attribute.project_id. + */ + public final TableField PROJECT_ID = createField( + DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('project_attribute_project_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * Create a public.project_attribute table reference + */ + public JProjectAttribute() { + this(DSL.name("project_attribute"), null); + } + + /** + * Create an aliased public.project_attribute table reference + */ + public JProjectAttribute(String alias) { + this(DSL.name(alias), PROJECT_ATTRIBUTE); + } + + /** + * Create an aliased public.project_attribute table reference + */ + public JProjectAttribute(Name alias) { + this(alias, PROJECT_ATTRIBUTE); + } + + private JProjectAttribute(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JProjectAttribute(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JProjectAttribute(Table child, + ForeignKey key) { + super(child, key, PROJECT_ATTRIBUTE); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JProjectAttributeRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.UNIQUE_ATTRIBUTE_PER_PROJECT); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_PROJECT_ATTRIBUTE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.UNIQUE_ATTRIBUTE_PER_PROJECT; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.UNIQUE_ATTRIBUTE_PER_PROJECT); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY, + Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY); + } + + public JAttribute attribute() { + return new JAttribute(this, Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY); + } + + @Override + public JProjectAttribute as(String alias) { + return new JProjectAttribute(DSL.name(alias), this); + } + + @Override + public JProjectAttribute as(Name alias) { + return new JProjectAttribute(alias, this); + } + + /** + * Rename this table + */ + @Override + public JProjectAttribute rename(String name) { + return new JProjectAttribute(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JProjectAttribute rename(Name name) { + return new JProjectAttribute(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectUser.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectUser.java index c6142c102..c91af2dc1 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectUser.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectUser.java @@ -9,12 +9,9 @@ import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.enums.JProjectRoleEnum; import com.epam.ta.reportportal.jooq.tables.records.JProjectUserRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -39,137 +36,139 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JProjectUser extends TableImpl { - private static final long serialVersionUID = -877127631; - - /** - * The reference instance of public.project_user - */ - public static final JProjectUser PROJECT_USER = new JProjectUser(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JProjectUserRecord.class; - } - - /** - * The column public.project_user.user_id. - */ - public final TableField USER_ID = createField(DSL.name("user_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.project_user.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.project_user.project_role. - */ - public final TableField PROJECT_ROLE = createField(DSL.name("project_role"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JProjectRoleEnum.class), this, ""); - - /** - * Create a public.project_user table reference - */ - public JProjectUser() { - this(DSL.name("project_user"), null); - } - - /** - * Create an aliased public.project_user table reference - */ - public JProjectUser(String alias) { - this(DSL.name(alias), PROJECT_USER); - } - - /** - * Create an aliased public.project_user table reference - */ - public JProjectUser(Name alias) { - this(alias, PROJECT_USER); - } - - private JProjectUser(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JProjectUser(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JProjectUser(Table child, ForeignKey key) { - super(child, key, PROJECT_USER); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.USERS_PROJECT_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.USERS_PROJECT_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.USERS_PROJECT_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.PROJECT_USER__PROJECT_USER_USER_ID_FKEY, Keys.PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY); - } - - public JUsers users() { - return new JUsers(this, Keys.PROJECT_USER__PROJECT_USER_USER_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY); - } - - @Override - public JProjectUser as(String alias) { - return new JProjectUser(DSL.name(alias), this); - } - - @Override - public JProjectUser as(Name alias) { - return new JProjectUser(alias, this); - } - - /** - * Rename this table - */ - @Override - public JProjectUser rename(String name) { - return new JProjectUser(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JProjectUser rename(Name name) { - return new JProjectUser(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + /** + * The reference instance of public.project_user + */ + public static final JProjectUser PROJECT_USER = new JProjectUser(); + private static final long serialVersionUID = -877127631; + /** + * The column public.project_user.user_id. + */ + public final TableField USER_ID = createField(DSL.name("user_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.project_user.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.project_user.project_role. + */ + public final TableField PROJECT_ROLE = createField( + DSL.name("project_role"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false) + .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JProjectRoleEnum.class), this, ""); + + /** + * Create a public.project_user table reference + */ + public JProjectUser() { + this(DSL.name("project_user"), null); + } + + /** + * Create an aliased public.project_user table reference + */ + public JProjectUser(String alias) { + this(DSL.name(alias), PROJECT_USER); + } + + /** + * Create an aliased public.project_user table reference + */ + public JProjectUser(Name alias) { + this(alias, PROJECT_USER); + } + + private JProjectUser(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JProjectUser(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JProjectUser(Table child, ForeignKey key) { + super(child, key, PROJECT_USER); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JProjectUserRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.USERS_PROJECT_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.USERS_PROJECT_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.USERS_PROJECT_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.PROJECT_USER__PROJECT_USER_USER_ID_FKEY, + Keys.PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY); + } + + public JUsers users() { + return new JUsers(this, Keys.PROJECT_USER__PROJECT_USER_USER_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY); + } + + @Override + public JProjectUser as(String alias) { + return new JProjectUser(DSL.name(alias), this); + } + + @Override + public JProjectUser as(Name alias) { + return new JProjectUser(alias, this); + } + + /** + * Rename this table + */ + @Override + public JProjectUser rename(String name) { + return new JProjectUser(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JProjectUser rename(Name name) { + return new JProjectUser(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JRecipients.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JRecipients.java index 6ae881db0..77353bc64 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JRecipients.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JRecipients.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JRecipientsRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -37,118 +34,118 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JRecipients extends TableImpl { - private static final long serialVersionUID = -1755691325; - - /** - * The reference instance of public.recipients - */ - public static final JRecipients RECIPIENTS = new JRecipients(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JRecipientsRecord.class; - } - - /** - * The column public.recipients.sender_case_id. - */ - public final TableField SENDER_CASE_ID = createField(DSL.name("sender_case_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.recipients.recipient. - */ - public final TableField RECIPIENT = createField(DSL.name("recipient"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * Create a public.recipients table reference - */ - public JRecipients() { - this(DSL.name("recipients"), null); - } - - /** - * Create an aliased public.recipients table reference - */ - public JRecipients(String alias) { - this(DSL.name(alias), RECIPIENTS); - } - - /** - * Create an aliased public.recipients table reference - */ - public JRecipients(Name alias) { - this(alias, RECIPIENTS); - } - - private JRecipients(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JRecipients(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JRecipients(Table child, ForeignKey key) { - super(child, key, RECIPIENTS); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.RCPNT_SEND_CASE_IDX); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY); - } - - public JSenderCase senderCase() { - return new JSenderCase(this, Keys.RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY); - } - - @Override - public JRecipients as(String alias) { - return new JRecipients(DSL.name(alias), this); - } - - @Override - public JRecipients as(Name alias) { - return new JRecipients(alias, this); - } - - /** - * Rename this table - */ - @Override - public JRecipients rename(String name) { - return new JRecipients(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JRecipients rename(Name name) { - return new JRecipients(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + /** + * The reference instance of public.recipients + */ + public static final JRecipients RECIPIENTS = new JRecipients(); + private static final long serialVersionUID = -1755691325; + /** + * The column public.recipients.sender_case_id. + */ + public final TableField SENDER_CASE_ID = createField( + DSL.name("sender_case_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.recipients.recipient. + */ + public final TableField RECIPIENT = createField(DSL.name("recipient"), + org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + + /** + * Create a public.recipients table reference + */ + public JRecipients() { + this(DSL.name("recipients"), null); + } + + /** + * Create an aliased public.recipients table reference + */ + public JRecipients(String alias) { + this(DSL.name(alias), RECIPIENTS); + } + + /** + * Create an aliased public.recipients table reference + */ + public JRecipients(Name alias) { + this(alias, RECIPIENTS); + } + + private JRecipients(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JRecipients(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JRecipients(Table child, ForeignKey key) { + super(child, key, RECIPIENTS); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JRecipientsRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.RCPNT_SEND_CASE_IDX); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY); + } + + public JSenderCase senderCase() { + return new JSenderCase(this, Keys.RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY); + } + + @Override + public JRecipients as(String alias) { + return new JRecipients(DSL.name(alias), this); + } + + @Override + public JRecipients as(Name alias) { + return new JRecipients(alias, this); + } + + /** + * Rename this table + */ + @Override + public JRecipients rename(String name) { + return new JRecipients(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JRecipients rename(Name name) { + return new JRecipients(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JRestorePasswordBid.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JRestorePasswordBid.java index 31e1065d6..1e73d09d8 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JRestorePasswordBid.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JRestorePasswordBid.java @@ -8,13 +8,10 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JRestorePasswordBidRecord; - import java.sql.Timestamp; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -39,124 +36,128 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JRestorePasswordBid extends TableImpl { - private static final long serialVersionUID = -130391773; - - /** - * The reference instance of public.restore_password_bid - */ - public static final JRestorePasswordBid RESTORE_PASSWORD_BID = new JRestorePasswordBid(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JRestorePasswordBidRecord.class; - } - - /** - * The column public.restore_password_bid.uuid. - */ - public final TableField UUID = createField(DSL.name("uuid"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.restore_password_bid.last_modified. - */ - public final TableField LAST_MODIFIED = createField(DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * The column public.restore_password_bid.email. - */ - public final TableField EMAIL = createField(DSL.name("email"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * Create a public.restore_password_bid table reference - */ - public JRestorePasswordBid() { - this(DSL.name("restore_password_bid"), null); - } - - /** - * Create an aliased public.restore_password_bid table reference - */ - public JRestorePasswordBid(String alias) { - this(DSL.name(alias), RESTORE_PASSWORD_BID); - } - - /** - * Create an aliased public.restore_password_bid table reference - */ - public JRestorePasswordBid(Name alias) { - this(alias, RESTORE_PASSWORD_BID); - } - - private JRestorePasswordBid(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JRestorePasswordBid(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JRestorePasswordBid(Table child, ForeignKey key) { - super(child, key, RESTORE_PASSWORD_BID); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.RESTORE_PASSWORD_BID_EMAIL_KEY, Indexes.RESTORE_PASSWORD_BID_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.RESTORE_PASSWORD_BID_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.RESTORE_PASSWORD_BID_PK, Keys.RESTORE_PASSWORD_BID_EMAIL_KEY); - } - - @Override - public JRestorePasswordBid as(String alias) { - return new JRestorePasswordBid(DSL.name(alias), this); - } - - @Override - public JRestorePasswordBid as(Name alias) { - return new JRestorePasswordBid(alias, this); - } - - /** - * Rename this table - */ - @Override - public JRestorePasswordBid rename(String name) { - return new JRestorePasswordBid(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JRestorePasswordBid rename(Name name) { - return new JRestorePasswordBid(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + /** + * The reference instance of public.restore_password_bid + */ + public static final JRestorePasswordBid RESTORE_PASSWORD_BID = new JRestorePasswordBid(); + private static final long serialVersionUID = -130391773; + /** + * The column public.restore_password_bid.uuid. + */ + public final TableField UUID = createField(DSL.name("uuid"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.restore_password_bid.last_modified. + */ + public final TableField LAST_MODIFIED = createField( + DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue( + org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + /** + * The column public.restore_password_bid.email. + */ + public final TableField EMAIL = createField(DSL.name("email"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * Create a public.restore_password_bid table reference + */ + public JRestorePasswordBid() { + this(DSL.name("restore_password_bid"), null); + } + + /** + * Create an aliased public.restore_password_bid table reference + */ + public JRestorePasswordBid(String alias) { + this(DSL.name(alias), RESTORE_PASSWORD_BID); + } + + /** + * Create an aliased public.restore_password_bid table reference + */ + public JRestorePasswordBid(Name alias) { + this(alias, RESTORE_PASSWORD_BID); + } + + private JRestorePasswordBid(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JRestorePasswordBid(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JRestorePasswordBid(Table child, + ForeignKey key) { + super(child, key, RESTORE_PASSWORD_BID); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JRestorePasswordBidRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.RESTORE_PASSWORD_BID_EMAIL_KEY, + Indexes.RESTORE_PASSWORD_BID_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.RESTORE_PASSWORD_BID_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.RESTORE_PASSWORD_BID_PK, + Keys.RESTORE_PASSWORD_BID_EMAIL_KEY); + } + + @Override + public JRestorePasswordBid as(String alias) { + return new JRestorePasswordBid(DSL.name(alias), this); + } + + @Override + public JRestorePasswordBid as(Name alias) { + return new JRestorePasswordBid(alias, this); + } + + /** + * Rename this table + */ + @Override + public JRestorePasswordBid rename(String name) { + return new JRestorePasswordBid(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JRestorePasswordBid rename(Name name) { + return new JRestorePasswordBid(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JSenderCase.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JSenderCase.java index 5b272059f..3bbdaae1c 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JSenderCase.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JSenderCase.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JSenderCaseRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,143 +36,149 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JSenderCase extends TableImpl { - private static final long serialVersionUID = -964535423; - - /** - * The reference instance of public.sender_case - */ - public static final JSenderCase SENDER_CASE = new JSenderCase(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JSenderCaseRecord.class; - } - - /** - * The column public.sender_case.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('sender_case_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.sender_case.send_case. - */ - public final TableField SEND_CASE = createField(DSL.name("send_case"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - - /** - * The column public.sender_case.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('sender_case_project_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.sender_case.enabled. - */ - public final TableField ENABLED = createField(DSL.name("enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false).defaultValue(org.jooq.impl.DSL.field("true", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - - /** - * Create a public.sender_case table reference - */ - public JSenderCase() { - this(DSL.name("sender_case"), null); - } - - /** - * Create an aliased public.sender_case table reference - */ - public JSenderCase(String alias) { - this(DSL.name(alias), SENDER_CASE); - } - - /** - * Create an aliased public.sender_case table reference - */ - public JSenderCase(Name alias) { - this(alias, SENDER_CASE); - } - - private JSenderCase(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JSenderCase(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JSenderCase(Table child, ForeignKey key) { - super(child, key, SENDER_CASE); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.SENDER_CASE_PK, Indexes.SENDER_CASE_PROJECT_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_SENDER_CASE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.SENDER_CASE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.SENDER_CASE_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY); - } - - @Override - public JSenderCase as(String alias) { - return new JSenderCase(DSL.name(alias), this); - } - - @Override - public JSenderCase as(Name alias) { - return new JSenderCase(alias, this); - } - - /** - * Rename this table - */ - @Override - public JSenderCase rename(String name) { - return new JSenderCase(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JSenderCase rename(Name name) { - return new JSenderCase(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + /** + * The reference instance of public.sender_case + */ + public static final JSenderCase SENDER_CASE = new JSenderCase(); + private static final long serialVersionUID = -964535423; + /** + * The column public.sender_case.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('sender_case_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.sender_case.send_case. + */ + public final TableField SEND_CASE = createField(DSL.name("send_case"), + org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + /** + * The column public.sender_case.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('sender_case_project_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.sender_case.enabled. + */ + public final TableField ENABLED = createField(DSL.name("enabled"), + org.jooq.impl.SQLDataType.BOOLEAN.nullable(false) + .defaultValue(org.jooq.impl.DSL.field("true", org.jooq.impl.SQLDataType.BOOLEAN)), this, + ""); + + /** + * Create a public.sender_case table reference + */ + public JSenderCase() { + this(DSL.name("sender_case"), null); + } + + /** + * Create an aliased public.sender_case table reference + */ + public JSenderCase(String alias) { + this(DSL.name(alias), SENDER_CASE); + } + + /** + * Create an aliased public.sender_case table reference + */ + public JSenderCase(Name alias) { + this(alias, SENDER_CASE); + } + + private JSenderCase(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JSenderCase(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JSenderCase(Table child, ForeignKey key) { + super(child, key, SENDER_CASE); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JSenderCaseRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.SENDER_CASE_PK, Indexes.SENDER_CASE_PROJECT_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_SENDER_CASE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.SENDER_CASE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.SENDER_CASE_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY); + } + + @Override + public JSenderCase as(String alias) { + return new JSenderCase(DSL.name(alias), this); + } + + @Override + public JSenderCase as(Name alias) { + return new JSenderCase(alias, this); + } + + /** + * Rename this table + */ + @Override + public JSenderCase rename(String name) { + return new JSenderCase(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JSenderCase rename(Name name) { + return new JSenderCase(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JServerSettings.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JServerSettings.java index a25ae3e37..063c0e1ee 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JServerSettings.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JServerSettings.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JServerSettingsRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,129 +36,132 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JServerSettings extends TableImpl { - private static final long serialVersionUID = -628087328; - - /** - * The reference instance of public.server_settings - */ - public static final JServerSettings SERVER_SETTINGS = new JServerSettings(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JServerSettingsRecord.class; - } - - /** - * The column public.server_settings.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.SMALLINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('server_settings_id_seq'::regclass)", org.jooq.impl.SQLDataType.SMALLINT)), this, ""); - - /** - * The column public.server_settings.key. - */ - public final TableField KEY = createField(DSL.name("key"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.server_settings.value. - */ - public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - - /** - * Create a public.server_settings table reference - */ - public JServerSettings() { - this(DSL.name("server_settings"), null); - } - - /** - * Create an aliased public.server_settings table reference - */ - public JServerSettings(String alias) { - this(DSL.name(alias), SERVER_SETTINGS); - } - - /** - * Create an aliased public.server_settings table reference - */ - public JServerSettings(Name alias) { - this(alias, SERVER_SETTINGS); - } - - private JServerSettings(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JServerSettings(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JServerSettings(Table child, ForeignKey key) { - super(child, key, SERVER_SETTINGS); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.SERVER_SETTINGS_ID, Indexes.SERVER_SETTINGS_KEY_KEY); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_SERVER_SETTINGS; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.SERVER_SETTINGS_ID; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.SERVER_SETTINGS_ID, Keys.SERVER_SETTINGS_KEY_KEY); - } - - @Override - public JServerSettings as(String alias) { - return new JServerSettings(DSL.name(alias), this); - } - - @Override - public JServerSettings as(Name alias) { - return new JServerSettings(alias, this); - } - - /** - * Rename this table - */ - @Override - public JServerSettings rename(String name) { - return new JServerSettings(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JServerSettings rename(Name name) { - return new JServerSettings(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + /** + * The reference instance of public.server_settings + */ + public static final JServerSettings SERVER_SETTINGS = new JServerSettings(); + private static final long serialVersionUID = -628087328; + /** + * The column public.server_settings.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.SMALLINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('server_settings_id_seq'::regclass)", + org.jooq.impl.SQLDataType.SMALLINT)), this, ""); + /** + * The column public.server_settings.key. + */ + public final TableField KEY = createField(DSL.name("key"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.server_settings.value. + */ + public final TableField VALUE = createField(DSL.name("value"), + org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * Create a public.server_settings table reference + */ + public JServerSettings() { + this(DSL.name("server_settings"), null); + } + + /** + * Create an aliased public.server_settings table reference + */ + public JServerSettings(String alias) { + this(DSL.name(alias), SERVER_SETTINGS); + } + + /** + * Create an aliased public.server_settings table reference + */ + public JServerSettings(Name alias) { + this(alias, SERVER_SETTINGS); + } + + private JServerSettings(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JServerSettings(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JServerSettings(Table child, + ForeignKey key) { + super(child, key, SERVER_SETTINGS); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JServerSettingsRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.SERVER_SETTINGS_ID, Indexes.SERVER_SETTINGS_KEY_KEY); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_SERVER_SETTINGS; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.SERVER_SETTINGS_ID; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.SERVER_SETTINGS_ID, + Keys.SERVER_SETTINGS_KEY_KEY); + } + + @Override + public JServerSettings as(String alias) { + return new JServerSettings(DSL.name(alias), this); + } + + @Override + public JServerSettings as(Name alias) { + return new JServerSettings(alias, this); + } + + /** + * Rename this table + */ + @Override + public JServerSettings rename(String name) { + return new JServerSettings(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JServerSettings rename(Name name) { + return new JServerSettings(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JShareableEntity.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JShareableEntity.java index 738acc5d9..a15632d97 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JShareableEntity.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JShareableEntity.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JShareableEntityRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,147 +36,155 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JShareableEntity extends TableImpl { - private static final long serialVersionUID = 1299591789; - - /** - * The reference instance of public.shareable_entity - */ - public static final JShareableEntity SHAREABLE_ENTITY = new JShareableEntity(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JShareableEntityRecord.class; - } - - /** - * The column public.shareable_entity.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('shareable_entity_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.shareable_entity.shared. - */ - public final TableField SHARED = createField(DSL.name("shared"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false).defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - - /** - * The column public.shareable_entity.owner. - */ - public final TableField OWNER = createField(DSL.name("owner"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.shareable_entity.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.shareable_entity table reference - */ - public JShareableEntity() { - this(DSL.name("shareable_entity"), null); - } - - /** - * Create an aliased public.shareable_entity table reference - */ - public JShareableEntity(String alias) { - this(DSL.name(alias), SHAREABLE_ENTITY); - } - - /** - * Create an aliased public.shareable_entity table reference - */ - public JShareableEntity(Name alias) { - this(alias, SHAREABLE_ENTITY); - } - - private JShareableEntity(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JShareableEntity(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JShareableEntity(Table child, ForeignKey key) { - super(child, key, SHAREABLE_ENTITY); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.SHAREABLE_PK, Indexes.SHARED_ENTITY_OWNERX, Indexes.SHARED_ENTITY_PROJECT_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_SHAREABLE_ENTITY; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.SHAREABLE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.SHAREABLE_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.SHAREABLE_ENTITY__SHAREABLE_ENTITY_OWNER_FKEY, Keys.SHAREABLE_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY); - } - - public JUsers users() { - return new JUsers(this, Keys.SHAREABLE_ENTITY__SHAREABLE_ENTITY_OWNER_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.SHAREABLE_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY); - } - - @Override - public JShareableEntity as(String alias) { - return new JShareableEntity(DSL.name(alias), this); - } - - @Override - public JShareableEntity as(Name alias) { - return new JShareableEntity(alias, this); - } - - /** - * Rename this table - */ - @Override - public JShareableEntity rename(String name) { - return new JShareableEntity(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JShareableEntity rename(Name name) { - return new JShareableEntity(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + /** + * The reference instance of public.shareable_entity + */ + public static final JShareableEntity SHAREABLE_ENTITY = new JShareableEntity(); + private static final long serialVersionUID = 1299591789; + /** + * The column public.shareable_entity.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('shareable_entity_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.shareable_entity.shared. + */ + public final TableField SHARED = createField(DSL.name("shared"), + org.jooq.impl.SQLDataType.BOOLEAN.nullable(false) + .defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, + ""); + /** + * The column public.shareable_entity.owner. + */ + public final TableField OWNER = createField(DSL.name("owner"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.shareable_entity.project_id. + */ + public final TableField PROJECT_ID = createField( + DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.shareable_entity table reference + */ + public JShareableEntity() { + this(DSL.name("shareable_entity"), null); + } + + /** + * Create an aliased public.shareable_entity table reference + */ + public JShareableEntity(String alias) { + this(DSL.name(alias), SHAREABLE_ENTITY); + } + + /** + * Create an aliased public.shareable_entity table reference + */ + public JShareableEntity(Name alias) { + this(alias, SHAREABLE_ENTITY); + } + + private JShareableEntity(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JShareableEntity(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JShareableEntity(Table child, + ForeignKey key) { + super(child, key, SHAREABLE_ENTITY); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JShareableEntityRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.SHAREABLE_PK, Indexes.SHARED_ENTITY_OWNERX, + Indexes.SHARED_ENTITY_PROJECT_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_SHAREABLE_ENTITY; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.SHAREABLE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.SHAREABLE_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.SHAREABLE_ENTITY__SHAREABLE_ENTITY_OWNER_FKEY, + Keys.SHAREABLE_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY); + } + + public JUsers users() { + return new JUsers(this, Keys.SHAREABLE_ENTITY__SHAREABLE_ENTITY_OWNER_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.SHAREABLE_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY); + } + + @Override + public JShareableEntity as(String alias) { + return new JShareableEntity(DSL.name(alias), this); + } + + @Override + public JShareableEntity as(Name alias) { + return new JShareableEntity(alias, this); + } + + /** + * Rename this table + */ + @Override + public JShareableEntity rename(String name) { + return new JShareableEntity(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JShareableEntity rename(Name name) { + return new JShareableEntity(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JStaleMaterializedView.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JStaleMaterializedView.java index c8718b592..5e5a8629e 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JStaleMaterializedView.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JStaleMaterializedView.java @@ -8,14 +8,23 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JStaleMaterializedViewRecord; -import org.jooq.*; -import org.jooq.impl.DSL; -import org.jooq.impl.TableImpl; - -import javax.annotation.processing.Generated; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; +import javax.annotation.processing.Generated; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row3; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; /** @@ -28,129 +37,134 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JStaleMaterializedView extends TableImpl { - private static final long serialVersionUID = 964883742; - - /** - * The reference instance of public.stale_materialized_view - */ - public static final JStaleMaterializedView STALE_MATERIALIZED_VIEW = new JStaleMaterializedView(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JStaleMaterializedViewRecord.class; - } - - /** - * The column public.stale_materialized_view.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('stale_materialized_view_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.stale_materialized_view.name. - */ - public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - - /** - * The column public.stale_materialized_view.creation_date. - */ - public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - - /** - * Create a public.stale_materialized_view table reference - */ - public JStaleMaterializedView() { - this(DSL.name("stale_materialized_view"), null); - } - - /** - * Create an aliased public.stale_materialized_view table reference - */ - public JStaleMaterializedView(String alias) { - this(DSL.name(alias), STALE_MATERIALIZED_VIEW); - } - - /** - * Create an aliased public.stale_materialized_view table reference - */ - public JStaleMaterializedView(Name alias) { - this(alias, STALE_MATERIALIZED_VIEW); - } - - private JStaleMaterializedView(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JStaleMaterializedView(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JStaleMaterializedView(Table child, ForeignKey key) { - super(child, key, STALE_MATERIALIZED_VIEW); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.STALE_MATERIALIZED_VIEW_NAME_KEY, Indexes.STALE_MATERIALIZED_VIEW_PKEY, Indexes.STALE_MV_CREATION_DATE_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_STALE_MATERIALIZED_VIEW; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.STALE_MATERIALIZED_VIEW_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.STALE_MATERIALIZED_VIEW_PKEY, Keys.STALE_MATERIALIZED_VIEW_NAME_KEY); - } - - @Override - public JStaleMaterializedView as(String alias) { - return new JStaleMaterializedView(DSL.name(alias), this); - } - - @Override - public JStaleMaterializedView as(Name alias) { - return new JStaleMaterializedView(alias, this); - } - - /** - * Rename this table - */ - @Override - public JStaleMaterializedView rename(String name) { - return new JStaleMaterializedView(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JStaleMaterializedView rename(Name name) { - return new JStaleMaterializedView(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + /** + * The reference instance of public.stale_materialized_view + */ + public static final JStaleMaterializedView STALE_MATERIALIZED_VIEW = new JStaleMaterializedView(); + private static final long serialVersionUID = 964883742; + /** + * The column public.stale_materialized_view.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('stale_materialized_view_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.stale_materialized_view.name. + */ + public final TableField NAME = createField(DSL.name("name"), + org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); + /** + * The column public.stale_materialized_view.creation_date. + */ + public final TableField CREATION_DATE = createField( + DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * Create a public.stale_materialized_view table reference + */ + public JStaleMaterializedView() { + this(DSL.name("stale_materialized_view"), null); + } + + /** + * Create an aliased public.stale_materialized_view table reference + */ + public JStaleMaterializedView(String alias) { + this(DSL.name(alias), STALE_MATERIALIZED_VIEW); + } + + /** + * Create an aliased public.stale_materialized_view table reference + */ + public JStaleMaterializedView(Name alias) { + this(alias, STALE_MATERIALIZED_VIEW); + } + + private JStaleMaterializedView(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JStaleMaterializedView(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JStaleMaterializedView(Table child, + ForeignKey key) { + super(child, key, STALE_MATERIALIZED_VIEW); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JStaleMaterializedViewRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.STALE_MATERIALIZED_VIEW_NAME_KEY, + Indexes.STALE_MATERIALIZED_VIEW_PKEY, Indexes.STALE_MV_CREATION_DATE_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_STALE_MATERIALIZED_VIEW; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.STALE_MATERIALIZED_VIEW_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.STALE_MATERIALIZED_VIEW_PKEY, + Keys.STALE_MATERIALIZED_VIEW_NAME_KEY); + } + + @Override + public JStaleMaterializedView as(String alias) { + return new JStaleMaterializedView(DSL.name(alias), this); + } + + @Override + public JStaleMaterializedView as(Name alias) { + return new JStaleMaterializedView(alias, this); + } + + /** + * Rename this table + */ + @Override + public JStaleMaterializedView rename(String name) { + return new JStaleMaterializedView(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JStaleMaterializedView rename(Name name) { + return new JStaleMaterializedView(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatistics.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatistics.java index c2fbd62de..31ba30fe3 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatistics.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatistics.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JStatisticsRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,156 +36,162 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JStatistics extends TableImpl { - private static final long serialVersionUID = -879938205; - - /** - * The reference instance of public.statistics - */ - public static final JStatistics STATISTICS = new JStatistics(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JStatisticsRecord.class; - } - - /** - * The column public.statistics.s_id. - */ - public final TableField S_ID = createField(DSL.name("s_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('statistics_s_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.statistics.s_counter. - */ - public final TableField S_COUNTER = createField(DSL.name("s_counter"), org.jooq.impl.SQLDataType.INTEGER.defaultValue(org.jooq.impl.DSL.field("0", org.jooq.impl.SQLDataType.INTEGER)), this, ""); - - /** - * The column public.statistics.launch_id. - */ - public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.statistics.item_id. - */ - public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.statistics.statistics_field_id. - */ - public final TableField STATISTICS_FIELD_ID = createField(DSL.name("statistics_field_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * Create a public.statistics table reference - */ - public JStatistics() { - this(DSL.name("statistics"), null); - } - - /** - * Create an aliased public.statistics table reference - */ - public JStatistics(String alias) { - this(DSL.name(alias), STATISTICS); - } - - /** - * Create an aliased public.statistics table reference - */ - public JStatistics(Name alias) { - this(alias, STATISTICS); - } - - private JStatistics(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JStatistics(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JStatistics(Table child, ForeignKey key) { - super(child, key, STATISTICS); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.STATISTICS_LAUNCH_IDX, Indexes.STATISTICS_PK, Indexes.STATISTICS_TI_IDX, Indexes.UNIQUE_STATS_ITEM, Indexes.UNIQUE_STATS_LAUNCH); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_STATISTICS; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.STATISTICS_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.STATISTICS_PK, Keys.UNIQUE_STATS_LAUNCH, Keys.UNIQUE_STATS_ITEM); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.STATISTICS__STATISTICS_LAUNCH_ID_FKEY, Keys.STATISTICS__STATISTICS_ITEM_ID_FKEY, Keys.STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY); - } - - public JLaunch launch() { - return new JLaunch(this, Keys.STATISTICS__STATISTICS_LAUNCH_ID_FKEY); - } - - public JTestItem testItem() { - return new JTestItem(this, Keys.STATISTICS__STATISTICS_ITEM_ID_FKEY); - } - - public JStatisticsField statisticsField() { - return new JStatisticsField(this, Keys.STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY); - } - - @Override - public JStatistics as(String alias) { - return new JStatistics(DSL.name(alias), this); - } - - @Override - public JStatistics as(Name alias) { - return new JStatistics(alias, this); - } - - /** - * Rename this table - */ - @Override - public JStatistics rename(String name) { - return new JStatistics(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JStatistics rename(Name name) { - return new JStatistics(name, null); - } - - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } + /** + * The reference instance of public.statistics + */ + public static final JStatistics STATISTICS = new JStatistics(); + private static final long serialVersionUID = -879938205; + /** + * The column public.statistics.s_id. + */ + public final TableField S_ID = createField(DSL.name("s_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('statistics_s_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.statistics.s_counter. + */ + public final TableField S_COUNTER = createField(DSL.name("s_counter"), + org.jooq.impl.SQLDataType.INTEGER.defaultValue( + org.jooq.impl.DSL.field("0", org.jooq.impl.SQLDataType.INTEGER)), this, ""); + /** + * The column public.statistics.launch_id. + */ + public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.statistics.item_id. + */ + public final TableField ITEM_ID = createField(DSL.name("item_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.statistics.statistics_field_id. + */ + public final TableField STATISTICS_FIELD_ID = createField( + DSL.name("statistics_field_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * Create a public.statistics table reference + */ + public JStatistics() { + this(DSL.name("statistics"), null); + } + + /** + * Create an aliased public.statistics table reference + */ + public JStatistics(String alias) { + this(DSL.name(alias), STATISTICS); + } + + /** + * Create an aliased public.statistics table reference + */ + public JStatistics(Name alias) { + this(alias, STATISTICS); + } + + private JStatistics(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JStatistics(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JStatistics(Table child, ForeignKey key) { + super(child, key, STATISTICS); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JStatisticsRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.STATISTICS_LAUNCH_IDX, Indexes.STATISTICS_PK, + Indexes.STATISTICS_TI_IDX, Indexes.UNIQUE_STATS_ITEM, Indexes.UNIQUE_STATS_LAUNCH); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_STATISTICS; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.STATISTICS_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.STATISTICS_PK, Keys.UNIQUE_STATS_LAUNCH, + Keys.UNIQUE_STATS_ITEM); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.STATISTICS__STATISTICS_LAUNCH_ID_FKEY, Keys.STATISTICS__STATISTICS_ITEM_ID_FKEY, + Keys.STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY); + } + + public JLaunch launch() { + return new JLaunch(this, Keys.STATISTICS__STATISTICS_LAUNCH_ID_FKEY); + } + + public JTestItem testItem() { + return new JTestItem(this, Keys.STATISTICS__STATISTICS_ITEM_ID_FKEY); + } + + public JStatisticsField statisticsField() { + return new JStatisticsField(this, Keys.STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY); + } + + @Override + public JStatistics as(String alias) { + return new JStatistics(DSL.name(alias), this); + } + + @Override + public JStatistics as(Name alias) { + return new JStatistics(alias, this); + } + + /** + * Rename this table + */ + @Override + public JStatistics rename(String name) { + return new JStatistics(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JStatistics rename(Name name) { + return new JStatistics(name, null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatisticsField.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatisticsField.java index ba03c618b..a5a96bf8c 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatisticsField.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatisticsField.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JStatisticsFieldRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,124 +36,128 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JStatisticsField extends TableImpl { - private static final long serialVersionUID = 1631655273; - - /** - * The reference instance of public.statistics_field - */ - public static final JStatisticsField STATISTICS_FIELD = new JStatisticsField(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JStatisticsFieldRecord.class; - } - - /** - * The column public.statistics_field.sf_id. - */ - public final TableField SF_ID = createField(DSL.name("sf_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('statistics_field_sf_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.statistics_field.name. - */ - public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - - /** - * Create a public.statistics_field table reference - */ - public JStatisticsField() { - this(DSL.name("statistics_field"), null); - } - - /** - * Create an aliased public.statistics_field table reference - */ - public JStatisticsField(String alias) { - this(DSL.name(alias), STATISTICS_FIELD); - } - - /** - * Create an aliased public.statistics_field table reference - */ - public JStatisticsField(Name alias) { - this(alias, STATISTICS_FIELD); - } - - private JStatisticsField(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JStatisticsField(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JStatisticsField(Table child, ForeignKey key) { - super(child, key, STATISTICS_FIELD); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.STATISTICS_FIELD_NAME_KEY, Indexes.STATISTICS_FIELD_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_STATISTICS_FIELD; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.STATISTICS_FIELD_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.STATISTICS_FIELD_PK, Keys.STATISTICS_FIELD_NAME_KEY); - } - - @Override - public JStatisticsField as(String alias) { - return new JStatisticsField(DSL.name(alias), this); - } - - @Override - public JStatisticsField as(Name alias) { - return new JStatisticsField(alias, this); - } - - /** - * Rename this table - */ - @Override - public JStatisticsField rename(String name) { - return new JStatisticsField(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JStatisticsField rename(Name name) { - return new JStatisticsField(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + /** + * The reference instance of public.statistics_field + */ + public static final JStatisticsField STATISTICS_FIELD = new JStatisticsField(); + private static final long serialVersionUID = 1631655273; + /** + * The column public.statistics_field.sf_id. + */ + public final TableField SF_ID = createField(DSL.name("sf_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('statistics_field_sf_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.statistics_field.name. + */ + public final TableField NAME = createField(DSL.name("name"), + org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + + /** + * Create a public.statistics_field table reference + */ + public JStatisticsField() { + this(DSL.name("statistics_field"), null); + } + + /** + * Create an aliased public.statistics_field table reference + */ + public JStatisticsField(String alias) { + this(DSL.name(alias), STATISTICS_FIELD); + } + + /** + * Create an aliased public.statistics_field table reference + */ + public JStatisticsField(Name alias) { + this(alias, STATISTICS_FIELD); + } + + private JStatisticsField(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JStatisticsField(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JStatisticsField(Table child, + ForeignKey key) { + super(child, key, STATISTICS_FIELD); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JStatisticsFieldRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.STATISTICS_FIELD_NAME_KEY, Indexes.STATISTICS_FIELD_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_STATISTICS_FIELD; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.STATISTICS_FIELD_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.STATISTICS_FIELD_PK, + Keys.STATISTICS_FIELD_NAME_KEY); + } + + @Override + public JStatisticsField as(String alias) { + return new JStatisticsField(DSL.name(alias), this); + } + + @Override + public JStatisticsField as(Name alias) { + return new JStatisticsField(alias, this); + } + + /** + * Rename this table + */ + @Override + public JStatisticsField rename(String name) { + return new JStatisticsField(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JStatisticsField rename(Name name) { + return new JStatisticsField(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItem.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItem.java index 54aee9985..f70d13c44 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItem.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItem.java @@ -9,13 +9,10 @@ import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum; import com.epam.ta.reportportal.jooq.tables.records.JTestItemRecord; - import java.sql.Timestamp; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -41,221 +38,232 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JTestItem extends TableImpl { - private static final long serialVersionUID = 1848873064; - - /** - * The reference instance of public.test_item - */ - public static final JTestItem TEST_ITEM = new JTestItem(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JTestItemRecord.class; - } - - /** - * The column public.test_item.item_id. - */ - public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('test_item_item_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.test_item.uuid. - */ - public final TableField UUID = createField(DSL.name("uuid"), org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, ""); - - /** - * The column public.test_item.name. - */ - public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(1024), this, ""); - - /** - * The column public.test_item.code_ref. - */ - public final TableField CODE_REF = createField(DSL.name("code_ref"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - - /** - * The column public.test_item.type. - */ - public final TableField TYPE = createField(DSL.name("type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum.class), this, ""); - - /** - * The column public.test_item.start_time. - */ - public final TableField START_TIME = createField(DSL.name("start_time"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - - /** - * The column public.test_item.description. - */ - public final TableField DESCRIPTION = createField(DSL.name("description"), org.jooq.impl.SQLDataType.CLOB, this, ""); - - /** - * The column public.test_item.last_modified. - */ - public final TableField LAST_MODIFIED = createField(DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - - /** - * The column public.test_item.path. - */ - public final TableField PATH = createField(DSL.name("path"), org.jooq.impl.DefaultDataType.getDefaultDataType("\"public\".\"ltree\""), this, ""); - - /** - * The column public.test_item.unique_id. - */ - public final TableField UNIQUE_ID = createField(DSL.name("unique_id"), org.jooq.impl.SQLDataType.VARCHAR(1024), this, ""); - - /** - * The column public.test_item.test_case_id. - */ - public final TableField TEST_CASE_ID = createField(DSL.name("test_case_id"), org.jooq.impl.SQLDataType.VARCHAR(1024), this, ""); - - /** - * The column public.test_item.has_children. - */ - public final TableField HAS_CHILDREN = createField(DSL.name("has_children"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - - /** - * The column public.test_item.has_retries. - */ - public final TableField HAS_RETRIES = createField(DSL.name("has_retries"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - - /** - * The column public.test_item.has_stats. - */ - public final TableField HAS_STATS = createField(DSL.name("has_stats"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue(org.jooq.impl.DSL.field("true", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - - /** - * The column public.test_item.parent_id. - */ - public final TableField PARENT_ID = createField(DSL.name("parent_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.test_item.retry_of. - */ - public final TableField RETRY_OF = createField(DSL.name("retry_of"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.test_item.launch_id. - */ - public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.test_item.test_case_hash. - */ - public final TableField TEST_CASE_HASH = createField(DSL.name("test_case_hash"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * Create a public.test_item table reference - */ - public JTestItem() { - this(DSL.name("test_item"), null); - } - - /** - * Create an aliased public.test_item table reference - */ - public JTestItem(String alias) { - this(DSL.name(alias), TEST_ITEM); - } - - /** - * Create an aliased public.test_item table reference - */ - public JTestItem(Name alias) { - this(alias, TEST_ITEM); - } - - private JTestItem(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JTestItem(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JTestItem(Table child, ForeignKey key) { - super(child, key, TEST_ITEM); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ITEM_TEST_CASE_ID_LAUNCH_ID_IDX, Indexes.PATH_GIST_IDX, Indexes.PATH_IDX, Indexes.TEST_CASE_HASH_LAUNCH_ID_IDX, Indexes.TEST_ITEM_PK, Indexes.TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX, Indexes.TEST_ITEM_UUID_KEY, Indexes.TI_LAUNCH_IDX, Indexes.TI_PARENT_IDX, Indexes.TI_RETRY_OF_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_TEST_ITEM; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.TEST_ITEM_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.TEST_ITEM_PK, Keys.TEST_ITEM_UUID_KEY); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY, Keys.TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY, Keys.TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY); - } - - public com.epam.ta.reportportal.jooq.tables.JTestItem testItem_TestItemParentIdFkey() { - return new com.epam.ta.reportportal.jooq.tables.JTestItem(this, Keys.TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY); - } - - public com.epam.ta.reportportal.jooq.tables.JTestItem testItem_TestItemRetryOfFkey() { - return new com.epam.ta.reportportal.jooq.tables.JTestItem(this, Keys.TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY); - } - - public JLaunch launch() { - return new JLaunch(this, Keys.TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY); - } - - @Override - public JTestItem as(String alias) { - return new JTestItem(DSL.name(alias), this); - } - - @Override - public JTestItem as(Name alias) { - return new JTestItem(alias, this); - } - - /** - * Rename this table - */ - @Override - public JTestItem rename(String name) { - return new JTestItem(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JTestItem rename(Name name) { - return new JTestItem(name, null); - } - - // ------------------------------------------------------------------------- - // Row18 type methods - // ------------------------------------------------------------------------- - - @Override - public Row18 fieldsRow() { - return (Row18) super.fieldsRow(); - } + /** + * The reference instance of public.test_item + */ + public static final JTestItem TEST_ITEM = new JTestItem(); + private static final long serialVersionUID = 1848873064; + /** + * The column public.test_item.item_id. + */ + public final TableField ITEM_ID = createField(DSL.name("item_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('test_item_item_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.test_item.uuid. + */ + public final TableField UUID = createField(DSL.name("uuid"), + org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, ""); + /** + * The column public.test_item.name. + */ + public final TableField NAME = createField(DSL.name("name"), + org.jooq.impl.SQLDataType.VARCHAR(1024), this, ""); + /** + * The column public.test_item.code_ref. + */ + public final TableField CODE_REF = createField(DSL.name("code_ref"), + org.jooq.impl.SQLDataType.VARCHAR, this, ""); + /** + * The column public.test_item.type. + */ + public final TableField TYPE = createField(DSL.name("type"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false) + .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum.class), this, ""); + /** + * The column public.test_item.start_time. + */ + public final TableField START_TIME = createField( + DSL.name("start_time"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + /** + * The column public.test_item.description. + */ + public final TableField DESCRIPTION = createField( + DSL.name("description"), org.jooq.impl.SQLDataType.CLOB, this, ""); + /** + * The column public.test_item.last_modified. + */ + public final TableField LAST_MODIFIED = createField( + DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + /** + * The column public.test_item.path. + */ + public final TableField PATH = createField(DSL.name("path"), + org.jooq.impl.DefaultDataType.getDefaultDataType("\"public\".\"ltree\""), this, ""); + /** + * The column public.test_item.unique_id. + */ + public final TableField UNIQUE_ID = createField(DSL.name("unique_id"), + org.jooq.impl.SQLDataType.VARCHAR(1024), this, ""); + /** + * The column public.test_item.test_case_id. + */ + public final TableField TEST_CASE_ID = createField( + DSL.name("test_case_id"), org.jooq.impl.SQLDataType.VARCHAR(1024), this, ""); + /** + * The column public.test_item.has_children. + */ + public final TableField HAS_CHILDREN = createField( + DSL.name("has_children"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue( + org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + /** + * The column public.test_item.has_retries. + */ + public final TableField HAS_RETRIES = createField( + DSL.name("has_retries"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue( + org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + /** + * The column public.test_item.has_stats. + */ + public final TableField HAS_STATS = createField(DSL.name("has_stats"), + org.jooq.impl.SQLDataType.BOOLEAN.defaultValue( + org.jooq.impl.DSL.field("true", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + /** + * The column public.test_item.parent_id. + */ + public final TableField PARENT_ID = createField(DSL.name("parent_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.test_item.retry_of. + */ + public final TableField RETRY_OF = createField(DSL.name("retry_of"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.test_item.launch_id. + */ + public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), + org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.test_item.test_case_hash. + */ + public final TableField TEST_CASE_HASH = createField( + DSL.name("test_case_hash"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * Create a public.test_item table reference + */ + public JTestItem() { + this(DSL.name("test_item"), null); + } + + /** + * Create an aliased public.test_item table reference + */ + public JTestItem(String alias) { + this(DSL.name(alias), TEST_ITEM); + } + + /** + * Create an aliased public.test_item table reference + */ + public JTestItem(Name alias) { + this(alias, TEST_ITEM); + } + + private JTestItem(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JTestItem(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JTestItem(Table child, ForeignKey key) { + super(child, key, TEST_ITEM); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JTestItemRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ITEM_TEST_CASE_ID_LAUNCH_ID_IDX, Indexes.PATH_GIST_IDX, + Indexes.PATH_IDX, Indexes.TEST_CASE_HASH_LAUNCH_ID_IDX, Indexes.TEST_ITEM_PK, + Indexes.TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX, Indexes.TEST_ITEM_UUID_KEY, + Indexes.TI_LAUNCH_IDX, Indexes.TI_PARENT_IDX, Indexes.TI_RETRY_OF_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_TEST_ITEM; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.TEST_ITEM_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.TEST_ITEM_PK, Keys.TEST_ITEM_UUID_KEY); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY, + Keys.TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY, Keys.TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY); + } + + public com.epam.ta.reportportal.jooq.tables.JTestItem testItem_TestItemParentIdFkey() { + return new com.epam.ta.reportportal.jooq.tables.JTestItem(this, + Keys.TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY); + } + + public com.epam.ta.reportportal.jooq.tables.JTestItem testItem_TestItemRetryOfFkey() { + return new com.epam.ta.reportportal.jooq.tables.JTestItem(this, + Keys.TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY); + } + + public JLaunch launch() { + return new JLaunch(this, Keys.TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY); + } + + @Override + public JTestItem as(String alias) { + return new JTestItem(DSL.name(alias), this); + } + + @Override + public JTestItem as(Name alias) { + return new JTestItem(alias, this); + } + + /** + * Rename this table + */ + @Override + public JTestItem rename(String name) { + return new JTestItem(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JTestItem rename(Name name) { + return new JTestItem(name, null); + } + + // ------------------------------------------------------------------------- + // Row18 type methods + // ------------------------------------------------------------------------- + + @Override + public Row18 fieldsRow() { + return (Row18) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItemResults.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItemResults.java index 81ec18eb1..78793f3ca 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItemResults.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItemResults.java @@ -9,13 +9,10 @@ import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.enums.JStatusEnum; import com.epam.ta.reportportal.jooq.tables.records.JTestItemResultsRecord; - import java.sql.Timestamp; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -40,138 +37,141 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JTestItemResults extends TableImpl { - private static final long serialVersionUID = 1284570207; - - /** - * The reference instance of public.test_item_results - */ - public static final JTestItemResults TEST_ITEM_RESULTS = new JTestItemResults(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JTestItemResultsRecord.class; - } - - /** - * The column public.test_item_results.result_id. - */ - public final TableField RESULT_ID = createField(DSL.name("result_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.test_item_results.status. - */ - public final TableField STATUS = createField(DSL.name("status"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JStatusEnum.class), this, ""); - - /** - * The column public.test_item_results.end_time. - */ - public final TableField END_TIME = createField(DSL.name("end_time"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * The column public.test_item_results.duration. - */ - public final TableField DURATION = createField(DSL.name("duration"), org.jooq.impl.SQLDataType.DOUBLE, this, ""); - - /** - * Create a public.test_item_results table reference - */ - public JTestItemResults() { - this(DSL.name("test_item_results"), null); - } - - /** - * Create an aliased public.test_item_results table reference - */ - public JTestItemResults(String alias) { - this(DSL.name(alias), TEST_ITEM_RESULTS); - } - - /** - * Create an aliased public.test_item_results table reference - */ - public JTestItemResults(Name alias) { - this(alias, TEST_ITEM_RESULTS); - } - - private JTestItemResults(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JTestItemResults(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JTestItemResults(Table child, ForeignKey key) { - super(child, key, TEST_ITEM_RESULTS); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.TEST_ITEM_RESULTS_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.TEST_ITEM_RESULTS_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.TEST_ITEM_RESULTS_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY); - } - - public JTestItem testItem() { - return new JTestItem(this, Keys.TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY); - } - - @Override - public JTestItemResults as(String alias) { - return new JTestItemResults(DSL.name(alias), this); - } - - @Override - public JTestItemResults as(Name alias) { - return new JTestItemResults(alias, this); - } - - /** - * Rename this table - */ - @Override - public JTestItemResults rename(String name) { - return new JTestItemResults(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JTestItemResults rename(Name name) { - return new JTestItemResults(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + /** + * The reference instance of public.test_item_results + */ + public static final JTestItemResults TEST_ITEM_RESULTS = new JTestItemResults(); + private static final long serialVersionUID = 1284570207; + /** + * The column public.test_item_results.result_id. + */ + public final TableField RESULT_ID = createField( + DSL.name("result_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.test_item_results.status. + */ + public final TableField STATUS = createField( + DSL.name("status"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false) + .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JStatusEnum.class), this, ""); + /** + * The column public.test_item_results.end_time. + */ + public final TableField END_TIME = createField( + DSL.name("end_time"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + /** + * The column public.test_item_results.duration. + */ + public final TableField DURATION = createField( + DSL.name("duration"), org.jooq.impl.SQLDataType.DOUBLE, this, ""); + + /** + * Create a public.test_item_results table reference + */ + public JTestItemResults() { + this(DSL.name("test_item_results"), null); + } + + /** + * Create an aliased public.test_item_results table reference + */ + public JTestItemResults(String alias) { + this(DSL.name(alias), TEST_ITEM_RESULTS); + } + + /** + * Create an aliased public.test_item_results table reference + */ + public JTestItemResults(Name alias) { + this(alias, TEST_ITEM_RESULTS); + } + + private JTestItemResults(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JTestItemResults(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JTestItemResults(Table child, + ForeignKey key) { + super(child, key, TEST_ITEM_RESULTS); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JTestItemResultsRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.TEST_ITEM_RESULTS_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.TEST_ITEM_RESULTS_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.TEST_ITEM_RESULTS_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY); + } + + public JTestItem testItem() { + return new JTestItem(this, Keys.TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY); + } + + @Override + public JTestItemResults as(String alias) { + return new JTestItemResults(DSL.name(alias), this); + } + + @Override + public JTestItemResults as(Name alias) { + return new JTestItemResults(alias, this); + } + + /** + * Rename this table + */ + @Override + public JTestItemResults rename(String name) { + return new JTestItemResults(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JTestItemResults rename(Name name) { + return new JTestItemResults(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTicket.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTicket.java index 0520aa80f..4ac4c6f6f 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTicket.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTicket.java @@ -8,13 +8,10 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JTicketRecord; - import java.sql.Timestamp; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -40,154 +37,158 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JTicket extends TableImpl { - private static final long serialVersionUID = -119397332; - - /** - * The reference instance of public.ticket - */ - public static final JTicket TICKET = new JTicket(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JTicketRecord.class; - } - - /** - * The column public.ticket.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('ticket_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.ticket.ticket_id. - */ - public final TableField TICKET_ID = createField(DSL.name("ticket_id"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - - /** - * The column public.ticket.submitter. - */ - public final TableField SUBMITTER = createField(DSL.name("submitter"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.ticket.submit_date. - */ - public final TableField SUBMIT_DATE = createField(DSL.name("submit_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * The column public.ticket.bts_url. - */ - public final TableField BTS_URL = createField(DSL.name("bts_url"), org.jooq.impl.SQLDataType.VARCHAR(1024).nullable(false), this, ""); - - /** - * The column public.ticket.bts_project. - */ - public final TableField BTS_PROJECT = createField(DSL.name("bts_project"), org.jooq.impl.SQLDataType.VARCHAR(1024).nullable(false), this, ""); - - /** - * The column public.ticket.url. - */ - public final TableField URL = createField(DSL.name("url"), org.jooq.impl.SQLDataType.VARCHAR(1024).nullable(false), this, ""); - - /** - * The column public.ticket.plugin_name. - */ - public final TableField PLUGIN_NAME = createField(DSL.name("plugin_name"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); - - /** - * Create a public.ticket table reference - */ - public JTicket() { - this(DSL.name("ticket"), null); - } - - /** - * Create an aliased public.ticket table reference - */ - public JTicket(String alias) { - this(DSL.name(alias), TICKET); - } - - /** - * Create an aliased public.ticket table reference - */ - public JTicket(Name alias) { - this(alias, TICKET); - } - - private JTicket(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JTicket(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JTicket(Table child, ForeignKey key) { - super(child, key, TICKET); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.TICKET_ID_IDX, Indexes.TICKET_PK, Indexes.TICKET_SUBMITTER_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_TICKET; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.TICKET_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.TICKET_PK); - } - - @Override - public JTicket as(String alias) { - return new JTicket(DSL.name(alias), this); - } - - @Override - public JTicket as(Name alias) { - return new JTicket(alias, this); - } - - /** - * Rename this table - */ - @Override - public JTicket rename(String name) { - return new JTicket(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JTicket rename(Name name) { - return new JTicket(name, null); - } - - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } + /** + * The reference instance of public.ticket + */ + public static final JTicket TICKET = new JTicket(); + private static final long serialVersionUID = -119397332; + /** + * The column public.ticket.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('ticket_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.ticket.ticket_id. + */ + public final TableField TICKET_ID = createField(DSL.name("ticket_id"), + org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + /** + * The column public.ticket.submitter. + */ + public final TableField SUBMITTER = createField(DSL.name("submitter"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.ticket.submit_date. + */ + public final TableField SUBMIT_DATE = createField( + DSL.name("submit_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false) + .defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), + this, ""); + /** + * The column public.ticket.bts_url. + */ + public final TableField BTS_URL = createField(DSL.name("bts_url"), + org.jooq.impl.SQLDataType.VARCHAR(1024).nullable(false), this, ""); + /** + * The column public.ticket.bts_project. + */ + public final TableField BTS_PROJECT = createField(DSL.name("bts_project"), + org.jooq.impl.SQLDataType.VARCHAR(1024).nullable(false), this, ""); + /** + * The column public.ticket.url. + */ + public final TableField URL = createField(DSL.name("url"), + org.jooq.impl.SQLDataType.VARCHAR(1024).nullable(false), this, ""); + /** + * The column public.ticket.plugin_name. + */ + public final TableField PLUGIN_NAME = createField(DSL.name("plugin_name"), + org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); + + /** + * Create a public.ticket table reference + */ + public JTicket() { + this(DSL.name("ticket"), null); + } + + /** + * Create an aliased public.ticket table reference + */ + public JTicket(String alias) { + this(DSL.name(alias), TICKET); + } + + /** + * Create an aliased public.ticket table reference + */ + public JTicket(Name alias) { + this(alias, TICKET); + } + + private JTicket(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JTicket(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JTicket(Table child, ForeignKey key) { + super(child, key, TICKET); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JTicketRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.TICKET_ID_IDX, Indexes.TICKET_PK, + Indexes.TICKET_SUBMITTER_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_TICKET; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.TICKET_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.TICKET_PK); + } + + @Override + public JTicket as(String alias) { + return new JTicket(DSL.name(alias), this); + } + + @Override + public JTicket as(Name alias) { + return new JTicket(alias, this); + } + + /** + * Rename this table + */ + @Override + public JTicket rename(String name) { + return new JTicket(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JTicket rename(Name name) { + return new JTicket(name, null); + } + + // ------------------------------------------------------------------------- + // Row8 type methods + // ------------------------------------------------------------------------- + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserCreationBid.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserCreationBid.java index e9e503adc..5754e0beb 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserCreationBid.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserCreationBid.java @@ -8,13 +8,10 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JUserCreationBidRecord; - import java.sql.Timestamp; import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -39,143 +36,146 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JUserCreationBid extends TableImpl { - private static final long serialVersionUID = 1036111992; - - /** - * The reference instance of public.user_creation_bid - */ - public static final JUserCreationBid USER_CREATION_BID = new JUserCreationBid(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JUserCreationBidRecord.class; - } - - /** - * The column public.user_creation_bid.uuid. - */ - public final TableField UUID = createField(DSL.name("uuid"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.user_creation_bid.last_modified. - */ - public final TableField LAST_MODIFIED = createField(DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - - /** - * The column public.user_creation_bid.email. - */ - public final TableField EMAIL = createField(DSL.name("email"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.user_creation_bid.default_project_id. - */ - public final TableField DEFAULT_PROJECT_ID = createField(DSL.name("default_project_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.user_creation_bid.role. - */ - public final TableField ROLE = createField(DSL.name("role"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * Create a public.user_creation_bid table reference - */ - public JUserCreationBid() { - this(DSL.name("user_creation_bid"), null); - } - - /** - * Create an aliased public.user_creation_bid table reference - */ - public JUserCreationBid(String alias) { - this(DSL.name(alias), USER_CREATION_BID); - } - - /** - * Create an aliased public.user_creation_bid table reference - */ - public JUserCreationBid(Name alias) { - this(alias, USER_CREATION_BID); - } - - private JUserCreationBid(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JUserCreationBid(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JUserCreationBid(Table child, ForeignKey key) { - super(child, key, USER_CREATION_BID); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.USER_BID_PROJECT_IDX, Indexes.USER_CREATION_BID_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.USER_CREATION_BID_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.USER_CREATION_BID_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY); - } - - @Override - public JUserCreationBid as(String alias) { - return new JUserCreationBid(DSL.name(alias), this); - } - - @Override - public JUserCreationBid as(Name alias) { - return new JUserCreationBid(alias, this); - } - - /** - * Rename this table - */ - @Override - public JUserCreationBid rename(String name) { - return new JUserCreationBid(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JUserCreationBid rename(Name name) { - return new JUserCreationBid(name, null); - } - - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } + /** + * The reference instance of public.user_creation_bid + */ + public static final JUserCreationBid USER_CREATION_BID = new JUserCreationBid(); + private static final long serialVersionUID = 1036111992; + /** + * The column public.user_creation_bid.uuid. + */ + public final TableField UUID = createField(DSL.name("uuid"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.user_creation_bid.last_modified. + */ + public final TableField LAST_MODIFIED = createField( + DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue( + org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + /** + * The column public.user_creation_bid.email. + */ + public final TableField EMAIL = createField(DSL.name("email"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.user_creation_bid.default_project_id. + */ + public final TableField DEFAULT_PROJECT_ID = createField( + DSL.name("default_project_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.user_creation_bid.role. + */ + public final TableField ROLE = createField(DSL.name("role"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * Create a public.user_creation_bid table reference + */ + public JUserCreationBid() { + this(DSL.name("user_creation_bid"), null); + } + + /** + * Create an aliased public.user_creation_bid table reference + */ + public JUserCreationBid(String alias) { + this(DSL.name(alias), USER_CREATION_BID); + } + + /** + * Create an aliased public.user_creation_bid table reference + */ + public JUserCreationBid(Name alias) { + this(alias, USER_CREATION_BID); + } + + private JUserCreationBid(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JUserCreationBid(Name alias, Table aliased, + Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JUserCreationBid(Table child, + ForeignKey key) { + super(child, key, USER_CREATION_BID); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JUserCreationBidRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.USER_BID_PROJECT_IDX, Indexes.USER_CREATION_BID_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.USER_CREATION_BID_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.USER_CREATION_BID_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY); + } + + @Override + public JUserCreationBid as(String alias) { + return new JUserCreationBid(DSL.name(alias), this); + } + + @Override + public JUserCreationBid as(Name alias) { + return new JUserCreationBid(alias, this); + } + + /** + * Rename this table + */ + @Override + public JUserCreationBid rename(String name) { + return new JUserCreationBid(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JUserCreationBid rename(Name name) { + return new JUserCreationBid(name, null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserPreference.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserPreference.java index 9640cdd36..391f703d5 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserPreference.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserPreference.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JUserPreferenceRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,151 +36,157 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JUserPreference extends TableImpl { - private static final long serialVersionUID = 732684537; - - /** - * The reference instance of public.user_preference - */ - public static final JUserPreference USER_PREFERENCE = new JUserPreference(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JUserPreferenceRecord.class; - } - - /** - * The column public.user_preference.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('user_preference_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.user_preference.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.user_preference.user_id. - */ - public final TableField USER_ID = createField(DSL.name("user_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.user_preference.filter_id. - */ - public final TableField FILTER_ID = createField(DSL.name("filter_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.user_preference table reference - */ - public JUserPreference() { - this(DSL.name("user_preference"), null); - } - - /** - * Create an aliased public.user_preference table reference - */ - public JUserPreference(String alias) { - this(DSL.name(alias), USER_PREFERENCE); - } - - /** - * Create an aliased public.user_preference table reference - */ - public JUserPreference(Name alias) { - this(alias, USER_PREFERENCE); - } - - private JUserPreference(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JUserPreference(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JUserPreference(Table child, ForeignKey key) { - super(child, key, USER_PREFERENCE); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.USER_PREFERENCE_PK, Indexes.USER_PREFERENCE_UQ); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_USER_PREFERENCE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.USER_PREFERENCE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.USER_PREFERENCE_PK, Keys.USER_PREFERENCE_UQ); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY, Keys.USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY, Keys.USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY); - } - - public JUsers users() { - return new JUsers(this, Keys.USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY); - } - - public JFilter filter() { - return new JFilter(this, Keys.USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY); - } - - @Override - public JUserPreference as(String alias) { - return new JUserPreference(DSL.name(alias), this); - } - - @Override - public JUserPreference as(Name alias) { - return new JUserPreference(alias, this); - } - - /** - * Rename this table - */ - @Override - public JUserPreference rename(String name) { - return new JUserPreference(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JUserPreference rename(Name name) { - return new JUserPreference(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + /** + * The reference instance of public.user_preference + */ + public static final JUserPreference USER_PREFERENCE = new JUserPreference(); + private static final long serialVersionUID = 732684537; + /** + * The column public.user_preference.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('user_preference_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.user_preference.project_id. + */ + public final TableField PROJECT_ID = createField( + DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.user_preference.user_id. + */ + public final TableField USER_ID = createField(DSL.name("user_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.user_preference.filter_id. + */ + public final TableField FILTER_ID = createField( + DSL.name("filter_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.user_preference table reference + */ + public JUserPreference() { + this(DSL.name("user_preference"), null); + } + + /** + * Create an aliased public.user_preference table reference + */ + public JUserPreference(String alias) { + this(DSL.name(alias), USER_PREFERENCE); + } + + /** + * Create an aliased public.user_preference table reference + */ + public JUserPreference(Name alias) { + this(alias, USER_PREFERENCE); + } + + private JUserPreference(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JUserPreference(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JUserPreference(Table child, + ForeignKey key) { + super(child, key, USER_PREFERENCE); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JUserPreferenceRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.USER_PREFERENCE_PK, Indexes.USER_PREFERENCE_UQ); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_USER_PREFERENCE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.USER_PREFERENCE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.USER_PREFERENCE_PK, + Keys.USER_PREFERENCE_UQ); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY, + Keys.USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY, + Keys.USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY); + } + + public JUsers users() { + return new JUsers(this, Keys.USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY); + } + + public JFilter filter() { + return new JFilter(this, Keys.USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY); + } + + @Override + public JUserPreference as(String alias) { + return new JUserPreference(DSL.name(alias), this); + } + + @Override + public JUserPreference as(Name alias) { + return new JUserPreference(alias, this); + } + + /** + * Rename this table + */ + @Override + public JUserPreference rename(String name) { + return new JUserPreference(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JUserPreference rename(Name name) { + return new JUserPreference(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JUsers.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JUsers.java index 64bfc9264..46dda6173 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JUsers.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JUsers.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JUsersRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -40,169 +37,171 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JUsers extends TableImpl { - private static final long serialVersionUID = 2058736098; - - /** - * The reference instance of public.users - */ - public static final JUsers USERS = new JUsers(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JUsersRecord.class; - } - - /** - * The column public.users.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('users_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.users.login. - */ - public final TableField LOGIN = createField(DSL.name("login"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.users.password. - */ - public final TableField PASSWORD = createField(DSL.name("password"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - - /** - * The column public.users.email. - */ - public final TableField EMAIL = createField(DSL.name("email"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.users.attachment. - */ - public final TableField ATTACHMENT = createField(DSL.name("attachment"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - - /** - * The column public.users.attachment_thumbnail. - */ - public final TableField ATTACHMENT_THUMBNAIL = createField(DSL.name("attachment_thumbnail"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - - /** - * The column public.users.role. - */ - public final TableField ROLE = createField(DSL.name("role"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.users.type. - */ - public final TableField TYPE = createField(DSL.name("type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.users.expired. - */ - public final TableField EXPIRED = createField(DSL.name("expired"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - - /** - * The column public.users.full_name. - */ - public final TableField FULL_NAME = createField(DSL.name("full_name"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - - /** - * The column public.users.metadata. - */ - public final TableField METADATA = createField(DSL.name("metadata"), org.jooq.impl.SQLDataType.JSONB, this, ""); - - /** - * Create a public.users table reference - */ - public JUsers() { - this(DSL.name("users"), null); - } - - /** - * Create an aliased public.users table reference - */ - public JUsers(String alias) { - this(DSL.name(alias), USERS); - } - - /** - * Create an aliased public.users table reference - */ - public JUsers(Name alias) { - this(alias, USERS); - } - - private JUsers(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JUsers(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JUsers(Table child, ForeignKey key) { - super(child, key, USERS); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.USERS_EMAIL_KEY, Indexes.USERS_LOGIN_KEY, Indexes.USERS_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_USERS; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.USERS_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.USERS_PK, Keys.USERS_LOGIN_KEY, Keys.USERS_EMAIL_KEY); - } - - @Override - public JUsers as(String alias) { - return new JUsers(DSL.name(alias), this); - } - - @Override - public JUsers as(Name alias) { - return new JUsers(alias, this); - } - - /** - * Rename this table - */ - @Override - public JUsers rename(String name) { - return new JUsers(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JUsers rename(Name name) { - return new JUsers(name, null); - } - - // ------------------------------------------------------------------------- - // Row11 type methods - // ------------------------------------------------------------------------- - - @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); - } + /** + * The reference instance of public.users + */ + public static final JUsers USERS = new JUsers(); + private static final long serialVersionUID = 2058736098; + /** + * The column public.users.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( + org.jooq.impl.DSL.field("nextval('users_id_seq'::regclass)", + org.jooq.impl.SQLDataType.BIGINT)), this, ""); + /** + * The column public.users.login. + */ + public final TableField LOGIN = createField(DSL.name("login"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.users.password. + */ + public final TableField PASSWORD = createField(DSL.name("password"), + org.jooq.impl.SQLDataType.VARCHAR, this, ""); + /** + * The column public.users.email. + */ + public final TableField EMAIL = createField(DSL.name("email"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.users.attachment. + */ + public final TableField ATTACHMENT = createField(DSL.name("attachment"), + org.jooq.impl.SQLDataType.VARCHAR, this, ""); + /** + * The column public.users.attachment_thumbnail. + */ + public final TableField ATTACHMENT_THUMBNAIL = createField( + DSL.name("attachment_thumbnail"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + /** + * The column public.users.role. + */ + public final TableField ROLE = createField(DSL.name("role"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.users.type. + */ + public final TableField TYPE = createField(DSL.name("type"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.users.expired. + */ + public final TableField EXPIRED = createField(DSL.name("expired"), + org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); + /** + * The column public.users.full_name. + */ + public final TableField FULL_NAME = createField(DSL.name("full_name"), + org.jooq.impl.SQLDataType.VARCHAR, this, ""); + /** + * The column public.users.metadata. + */ + public final TableField METADATA = createField(DSL.name("metadata"), + org.jooq.impl.SQLDataType.JSONB, this, ""); + + /** + * Create a public.users table reference + */ + public JUsers() { + this(DSL.name("users"), null); + } + + /** + * Create an aliased public.users table reference + */ + public JUsers(String alias) { + this(DSL.name(alias), USERS); + } + + /** + * Create an aliased public.users table reference + */ + public JUsers(Name alias) { + this(alias, USERS); + } + + private JUsers(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JUsers(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JUsers(Table child, ForeignKey key) { + super(child, key, USERS); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JUsersRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.USERS_EMAIL_KEY, Indexes.USERS_LOGIN_KEY, Indexes.USERS_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_USERS; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.USERS_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.USERS_PK, Keys.USERS_LOGIN_KEY, + Keys.USERS_EMAIL_KEY); + } + + @Override + public JUsers as(String alias) { + return new JUsers(DSL.name(alias), this); + } + + @Override + public JUsers as(Name alias) { + return new JUsers(alias, this); + } + + /** + * Rename this table + */ + @Override + public JUsers rename(String name) { + return new JUsers(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JUsers rename(Name name) { + return new JUsers(name, null); + } + + // ------------------------------------------------------------------------- + // Row11 type methods + // ------------------------------------------------------------------------- + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidget.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidget.java index b337b0ff2..3819bb92d 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidget.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidget.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JWidgetRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -39,148 +36,147 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JWidget extends TableImpl { - private static final long serialVersionUID = -796307886; - - /** - * The reference instance of public.widget - */ - public static final JWidget WIDGET = new JWidget(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JWidgetRecord.class; - } - - /** - * The column public.widget.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.widget.name. - */ - public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.widget.description. - */ - public final TableField DESCRIPTION = createField(DSL.name("description"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - - /** - * The column public.widget.widget_type. - */ - public final TableField WIDGET_TYPE = createField(DSL.name("widget_type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * The column public.widget.items_count. - */ - public final TableField ITEMS_COUNT = createField(DSL.name("items_count"), org.jooq.impl.SQLDataType.SMALLINT, this, ""); - - /** - * The column public.widget.widget_options. - */ - public final TableField WIDGET_OPTIONS = createField(DSL.name("widget_options"), org.jooq.impl.SQLDataType.JSONB, this, ""); - - /** - * Create a public.widget table reference - */ - public JWidget() { - this(DSL.name("widget"), null); - } - - /** - * Create an aliased public.widget table reference - */ - public JWidget(String alias) { - this(DSL.name(alias), WIDGET); - } - - /** - * Create an aliased public.widget table reference - */ - public JWidget(Name alias) { - this(alias, WIDGET); - } - - private JWidget(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JWidget(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JWidget(Table child, ForeignKey key) { - super(child, key, WIDGET); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.WIDGET_PKEY); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.WIDGET_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.WIDGET_PKEY); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.WIDGET__WIDGET_ID_FK); - } - - public JShareableEntity shareableEntity() { - return new JShareableEntity(this, Keys.WIDGET__WIDGET_ID_FK); - } - - @Override - public JWidget as(String alias) { - return new JWidget(DSL.name(alias), this); - } - - @Override - public JWidget as(Name alias) { - return new JWidget(alias, this); - } - - /** - * Rename this table - */ - @Override - public JWidget rename(String name) { - return new JWidget(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JWidget rename(Name name) { - return new JWidget(name, null); - } - - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } + /** + * The reference instance of public.widget + */ + public static final JWidget WIDGET = new JWidget(); + private static final long serialVersionUID = -796307886; + /** + * The column public.widget.id. + */ + public final TableField ID = createField(DSL.name("id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.widget.name. + */ + public final TableField NAME = createField(DSL.name("name"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.widget.description. + */ + public final TableField DESCRIPTION = createField(DSL.name("description"), + org.jooq.impl.SQLDataType.VARCHAR, this, ""); + /** + * The column public.widget.widget_type. + */ + public final TableField WIDGET_TYPE = createField(DSL.name("widget_type"), + org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + /** + * The column public.widget.items_count. + */ + public final TableField ITEMS_COUNT = createField(DSL.name("items_count"), + org.jooq.impl.SQLDataType.SMALLINT, this, ""); + /** + * The column public.widget.widget_options. + */ + public final TableField WIDGET_OPTIONS = createField( + DSL.name("widget_options"), org.jooq.impl.SQLDataType.JSONB, this, ""); + + /** + * Create a public.widget table reference + */ + public JWidget() { + this(DSL.name("widget"), null); + } + + /** + * Create an aliased public.widget table reference + */ + public JWidget(String alias) { + this(DSL.name(alias), WIDGET); + } + + /** + * Create an aliased public.widget table reference + */ + public JWidget(Name alias) { + this(alias, WIDGET); + } + + private JWidget(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JWidget(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JWidget(Table child, ForeignKey key) { + super(child, key, WIDGET); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JWidgetRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.WIDGET_PKEY); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.WIDGET_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.WIDGET_PKEY); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.WIDGET__WIDGET_ID_FK); + } + + public JShareableEntity shareableEntity() { + return new JShareableEntity(this, Keys.WIDGET__WIDGET_ID_FK); + } + + @Override + public JWidget as(String alias) { + return new JWidget(DSL.name(alias), this); + } + + @Override + public JWidget as(Name alias) { + return new JWidget(alias, this); + } + + /** + * Rename this table + */ + @Override + public JWidget rename(String name) { + return new JWidget(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JWidget rename(Name name) { + return new JWidget(name, null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidgetFilter.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidgetFilter.java index 4efca3481..182586658 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidgetFilter.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidgetFilter.java @@ -8,12 +8,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JWidgetFilterRecord; - import java.util.Arrays; import java.util.List; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -38,132 +35,133 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({"all", "unchecked", "rawtypes"}) public class JWidgetFilter extends TableImpl { - private static final long serialVersionUID = 456969536; - - /** - * The reference instance of public.widget_filter - */ - public static final JWidgetFilter WIDGET_FILTER = new JWidgetFilter(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JWidgetFilterRecord.class; - } - - /** - * The column public.widget_filter.widget_id. - */ - public final TableField WIDGET_ID = createField(DSL.name("widget_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.widget_filter.filter_id. - */ - public final TableField FILTER_ID = createField(DSL.name("filter_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.widget_filter table reference - */ - public JWidgetFilter() { - this(DSL.name("widget_filter"), null); - } - - /** - * Create an aliased public.widget_filter table reference - */ - public JWidgetFilter(String alias) { - this(DSL.name(alias), WIDGET_FILTER); - } - - /** - * Create an aliased public.widget_filter table reference - */ - public JWidgetFilter(Name alias) { - this(alias, WIDGET_FILTER); - } - - private JWidgetFilter(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JWidgetFilter(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JWidgetFilter(Table child, ForeignKey key) { - super(child, key, WIDGET_FILTER); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.WIDGET_FILTER_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.WIDGET_FILTER_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.WIDGET_FILTER_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY, Keys.WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY); - } - - public JWidget widget() { - return new JWidget(this, Keys.WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY); - } - - public JFilter filter() { - return new JFilter(this, Keys.WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY); - } - - @Override - public JWidgetFilter as(String alias) { - return new JWidgetFilter(DSL.name(alias), this); - } - - @Override - public JWidgetFilter as(Name alias) { - return new JWidgetFilter(alias, this); - } - - /** - * Rename this table - */ - @Override - public JWidgetFilter rename(String name) { - return new JWidgetFilter(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JWidgetFilter rename(Name name) { - return new JWidgetFilter(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + /** + * The reference instance of public.widget_filter + */ + public static final JWidgetFilter WIDGET_FILTER = new JWidgetFilter(); + private static final long serialVersionUID = 456969536; + /** + * The column public.widget_filter.widget_id. + */ + public final TableField WIDGET_ID = createField(DSL.name("widget_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + /** + * The column public.widget_filter.filter_id. + */ + public final TableField FILTER_ID = createField(DSL.name("filter_id"), + org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.widget_filter table reference + */ + public JWidgetFilter() { + this(DSL.name("widget_filter"), null); + } + + /** + * Create an aliased public.widget_filter table reference + */ + public JWidgetFilter(String alias) { + this(DSL.name(alias), WIDGET_FILTER); + } + + /** + * Create an aliased public.widget_filter table reference + */ + public JWidgetFilter(Name alias) { + this(alias, WIDGET_FILTER); + } + + private JWidgetFilter(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JWidgetFilter(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JWidgetFilter(Table child, ForeignKey key) { + super(child, key, WIDGET_FILTER); + } + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JWidgetFilterRecord.class; + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.WIDGET_FILTER_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.WIDGET_FILTER_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.WIDGET_FILTER_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList( + Keys.WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY, + Keys.WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY); + } + + public JWidget widget() { + return new JWidget(this, Keys.WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY); + } + + public JFilter filter() { + return new JFilter(this, Keys.WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY); + } + + @Override + public JWidgetFilter as(String alias) { + return new JWidgetFilter(DSL.name(alias), this); + } + + @Override + public JWidgetFilter as(Name alias) { + return new JWidgetFilter(alias, this); + } + + /** + * Rename this table + */ + @Override + public JWidgetFilter rename(String name) { + return new JWidgetFilter(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JWidgetFilter rename(Name name) { + return new JWidgetFilter(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclClassRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclClassRecord.java index 73b7962e4..6a8669962 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclClassRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclClassRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JAclClass; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record3; @@ -25,166 +23,167 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JAclClassRecord extends UpdatableRecordImpl implements Record3 { - - private static final long serialVersionUID = 832162643; - - /** - * Setter for public.acl_class.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.acl_class.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.acl_class.class. - */ - public void setClass_(String value) { - set(1, value); - } - - /** - * Getter for public.acl_class.class. - */ - public String getClass_() { - return (String) get(1); - } - - /** - * Setter for public.acl_class.class_id_type. - */ - public void setClassIdType(String value) { - set(2, value); - } - - /** - * Getter for public.acl_class.class_id_type. - */ - public String getClassIdType() { - return (String) get(2); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JAclClass.ACL_CLASS.ID; - } - - @Override - public Field field2() { - return JAclClass.ACL_CLASS.CLASS; - } - - @Override - public Field field3() { - return JAclClass.ACL_CLASS.CLASS_ID_TYPE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getClass_(); - } - - @Override - public String component3() { - return getClassIdType(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getClass_(); - } - - @Override - public String value3() { - return getClassIdType(); - } - - @Override - public JAclClassRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JAclClassRecord value2(String value) { - setClass_(value); - return this; - } - - @Override - public JAclClassRecord value3(String value) { - setClassIdType(value); - return this; - } - - @Override - public JAclClassRecord values(Long value1, String value2, String value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JAclClassRecord - */ - public JAclClassRecord() { - super(JAclClass.ACL_CLASS); - } - - /** - * Create a detached, initialised JAclClassRecord - */ - public JAclClassRecord(Long id, String class_, String classIdType) { - super(JAclClass.ACL_CLASS); - - set(0, id); - set(1, class_); - set(2, classIdType); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JAclClassRecord extends UpdatableRecordImpl implements + Record3 { + + private static final long serialVersionUID = 832162643; + + /** + * Create a detached JAclClassRecord + */ + public JAclClassRecord() { + super(JAclClass.ACL_CLASS); + } + + /** + * Create a detached, initialised JAclClassRecord + */ + public JAclClassRecord(Long id, String class_, String classIdType) { + super(JAclClass.ACL_CLASS); + + set(0, id); + set(1, class_); + set(2, classIdType); + } + + /** + * Getter for public.acl_class.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.acl_class.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.acl_class.class. + */ + public String getClass_() { + return (String) get(1); + } + + /** + * Setter for public.acl_class.class. + */ + public void setClass_(String value) { + set(1, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.acl_class.class_id_type. + */ + public String getClassIdType() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.acl_class.class_id_type. + */ + public void setClassIdType(String value) { + set(2, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JAclClass.ACL_CLASS.ID; + } + + @Override + public Field field2() { + return JAclClass.ACL_CLASS.CLASS; + } + + @Override + public Field field3() { + return JAclClass.ACL_CLASS.CLASS_ID_TYPE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getClass_(); + } + + @Override + public String component3() { + return getClassIdType(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getClass_(); + } + + @Override + public String value3() { + return getClassIdType(); + } + + @Override + public JAclClassRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JAclClassRecord value2(String value) { + setClass_(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JAclClassRecord value3(String value) { + setClassIdType(value); + return this; + } + + @Override + public JAclClassRecord values(Long value1, String value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclEntryRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclEntryRecord.java index 11ca1d345..664ce11b1 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclEntryRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclEntryRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JAclEntry; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record8; @@ -25,351 +23,354 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JAclEntryRecord extends UpdatableRecordImpl implements Record8 { - - private static final long serialVersionUID = -1130110111; - - /** - * Setter for public.acl_entry.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.acl_entry.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.acl_entry.acl_object_identity. - */ - public void setAclObjectIdentity(Long value) { - set(1, value); - } - - /** - * Getter for public.acl_entry.acl_object_identity. - */ - public Long getAclObjectIdentity() { - return (Long) get(1); - } - - /** - * Setter for public.acl_entry.ace_order. - */ - public void setAceOrder(Integer value) { - set(2, value); - } - - /** - * Getter for public.acl_entry.ace_order. - */ - public Integer getAceOrder() { - return (Integer) get(2); - } - - /** - * Setter for public.acl_entry.sid. - */ - public void setSid(Long value) { - set(3, value); - } - - /** - * Getter for public.acl_entry.sid. - */ - public Long getSid() { - return (Long) get(3); - } - - /** - * Setter for public.acl_entry.mask. - */ - public void setMask(Integer value) { - set(4, value); - } - - /** - * Getter for public.acl_entry.mask. - */ - public Integer getMask() { - return (Integer) get(4); - } - - /** - * Setter for public.acl_entry.granting. - */ - public void setGranting(Boolean value) { - set(5, value); - } - - /** - * Getter for public.acl_entry.granting. - */ - public Boolean getGranting() { - return (Boolean) get(5); - } - - /** - * Setter for public.acl_entry.audit_success. - */ - public void setAuditSuccess(Boolean value) { - set(6, value); - } - - /** - * Getter for public.acl_entry.audit_success. - */ - public Boolean getAuditSuccess() { - return (Boolean) get(6); - } - - /** - * Setter for public.acl_entry.audit_failure. - */ - public void setAuditFailure(Boolean value) { - set(7, value); - } - - /** - * Getter for public.acl_entry.audit_failure. - */ - public Boolean getAuditFailure() { - return (Boolean) get(7); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - @Override - public Field field1() { - return JAclEntry.ACL_ENTRY.ID; - } - - @Override - public Field field2() { - return JAclEntry.ACL_ENTRY.ACL_OBJECT_IDENTITY; - } - - @Override - public Field field3() { - return JAclEntry.ACL_ENTRY.ACE_ORDER; - } - - @Override - public Field field4() { - return JAclEntry.ACL_ENTRY.SID; - } - - @Override - public Field field5() { - return JAclEntry.ACL_ENTRY.MASK; - } - - @Override - public Field field6() { - return JAclEntry.ACL_ENTRY.GRANTING; - } - - @Override - public Field field7() { - return JAclEntry.ACL_ENTRY.AUDIT_SUCCESS; - } - - @Override - public Field field8() { - return JAclEntry.ACL_ENTRY.AUDIT_FAILURE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getAclObjectIdentity(); - } - - @Override - public Integer component3() { - return getAceOrder(); - } - - @Override - public Long component4() { - return getSid(); - } - - @Override - public Integer component5() { - return getMask(); - } - - @Override - public Boolean component6() { - return getGranting(); - } - - @Override - public Boolean component7() { - return getAuditSuccess(); - } - - @Override - public Boolean component8() { - return getAuditFailure(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getAclObjectIdentity(); - } - - @Override - public Integer value3() { - return getAceOrder(); - } - - @Override - public Long value4() { - return getSid(); - } - - @Override - public Integer value5() { - return getMask(); - } - - @Override - public Boolean value6() { - return getGranting(); - } - - @Override - public Boolean value7() { - return getAuditSuccess(); - } - - @Override - public Boolean value8() { - return getAuditFailure(); - } - - @Override - public JAclEntryRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JAclEntryRecord value2(Long value) { - setAclObjectIdentity(value); - return this; - } - - @Override - public JAclEntryRecord value3(Integer value) { - setAceOrder(value); - return this; - } - - @Override - public JAclEntryRecord value4(Long value) { - setSid(value); - return this; - } - - @Override - public JAclEntryRecord value5(Integer value) { - setMask(value); - return this; - } - - @Override - public JAclEntryRecord value6(Boolean value) { - setGranting(value); - return this; - } - - @Override - public JAclEntryRecord value7(Boolean value) { - setAuditSuccess(value); - return this; - } - - @Override - public JAclEntryRecord value8(Boolean value) { - setAuditFailure(value); - return this; - } - - @Override - public JAclEntryRecord values(Long value1, Long value2, Integer value3, Long value4, Integer value5, Boolean value6, Boolean value7, Boolean value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JAclEntryRecord - */ - public JAclEntryRecord() { - super(JAclEntry.ACL_ENTRY); - } - - /** - * Create a detached, initialised JAclEntryRecord - */ - public JAclEntryRecord(Long id, Long aclObjectIdentity, Integer aceOrder, Long sid, Integer mask, Boolean granting, Boolean auditSuccess, Boolean auditFailure) { - super(JAclEntry.ACL_ENTRY); - - set(0, id); - set(1, aclObjectIdentity); - set(2, aceOrder); - set(3, sid); - set(4, mask); - set(5, granting); - set(6, auditSuccess); - set(7, auditFailure); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JAclEntryRecord extends UpdatableRecordImpl implements + Record8 { + + private static final long serialVersionUID = -1130110111; + + /** + * Create a detached JAclEntryRecord + */ + public JAclEntryRecord() { + super(JAclEntry.ACL_ENTRY); + } + + /** + * Create a detached, initialised JAclEntryRecord + */ + public JAclEntryRecord(Long id, Long aclObjectIdentity, Integer aceOrder, Long sid, Integer mask, + Boolean granting, Boolean auditSuccess, Boolean auditFailure) { + super(JAclEntry.ACL_ENTRY); + + set(0, id); + set(1, aclObjectIdentity); + set(2, aceOrder); + set(3, sid); + set(4, mask); + set(5, granting); + set(6, auditSuccess); + set(7, auditFailure); + } + + /** + * Getter for public.acl_entry.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.acl_entry.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.acl_entry.acl_object_identity. + */ + public Long getAclObjectIdentity() { + return (Long) get(1); + } + + /** + * Setter for public.acl_entry.acl_object_identity. + */ + public void setAclObjectIdentity(Long value) { + set(1, value); + } + + /** + * Getter for public.acl_entry.ace_order. + */ + public Integer getAceOrder() { + return (Integer) get(2); + } + + /** + * Setter for public.acl_entry.ace_order. + */ + public void setAceOrder(Integer value) { + set(2, value); + } + + /** + * Getter for public.acl_entry.sid. + */ + public Long getSid() { + return (Long) get(3); + } + + /** + * Setter for public.acl_entry.sid. + */ + public void setSid(Long value) { + set(3, value); + } + + /** + * Getter for public.acl_entry.mask. + */ + public Integer getMask() { + return (Integer) get(4); + } + + /** + * Setter for public.acl_entry.mask. + */ + public void setMask(Integer value) { + set(4, value); + } + + /** + * Getter for public.acl_entry.granting. + */ + public Boolean getGranting() { + return (Boolean) get(5); + } + + /** + * Setter for public.acl_entry.granting. + */ + public void setGranting(Boolean value) { + set(5, value); + } + + /** + * Getter for public.acl_entry.audit_success. + */ + public Boolean getAuditSuccess() { + return (Boolean) get(6); + } + + /** + * Setter for public.acl_entry.audit_success. + */ + public void setAuditSuccess(Boolean value) { + set(6, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.acl_entry.audit_failure. + */ + public Boolean getAuditFailure() { + return (Boolean) get(7); + } + + // ------------------------------------------------------------------------- + // Record8 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.acl_entry.audit_failure. + */ + public void setAuditFailure(Boolean value) { + set(7, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } + + @Override + public Row8 valuesRow() { + return (Row8) super.valuesRow(); + } + + @Override + public Field field1() { + return JAclEntry.ACL_ENTRY.ID; + } + + @Override + public Field field2() { + return JAclEntry.ACL_ENTRY.ACL_OBJECT_IDENTITY; + } + + @Override + public Field field3() { + return JAclEntry.ACL_ENTRY.ACE_ORDER; + } + + @Override + public Field field4() { + return JAclEntry.ACL_ENTRY.SID; + } + + @Override + public Field field5() { + return JAclEntry.ACL_ENTRY.MASK; + } + + @Override + public Field field6() { + return JAclEntry.ACL_ENTRY.GRANTING; + } + + @Override + public Field field7() { + return JAclEntry.ACL_ENTRY.AUDIT_SUCCESS; + } + + @Override + public Field field8() { + return JAclEntry.ACL_ENTRY.AUDIT_FAILURE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getAclObjectIdentity(); + } + + @Override + public Integer component3() { + return getAceOrder(); + } + + @Override + public Long component4() { + return getSid(); + } + + @Override + public Integer component5() { + return getMask(); + } + + @Override + public Boolean component6() { + return getGranting(); + } + + @Override + public Boolean component7() { + return getAuditSuccess(); + } + + @Override + public Boolean component8() { + return getAuditFailure(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getAclObjectIdentity(); + } + + @Override + public Integer value3() { + return getAceOrder(); + } + + @Override + public Long value4() { + return getSid(); + } + + @Override + public Integer value5() { + return getMask(); + } + + @Override + public Boolean value6() { + return getGranting(); + } + + @Override + public Boolean value7() { + return getAuditSuccess(); + } + + @Override + public Boolean value8() { + return getAuditFailure(); + } + + @Override + public JAclEntryRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JAclEntryRecord value2(Long value) { + setAclObjectIdentity(value); + return this; + } + + @Override + public JAclEntryRecord value3(Integer value) { + setAceOrder(value); + return this; + } + + @Override + public JAclEntryRecord value4(Long value) { + setSid(value); + return this; + } + + @Override + public JAclEntryRecord value5(Integer value) { + setMask(value); + return this; + } + + @Override + public JAclEntryRecord value6(Boolean value) { + setGranting(value); + return this; + } + + @Override + public JAclEntryRecord value7(Boolean value) { + setAuditSuccess(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JAclEntryRecord value8(Boolean value) { + setAuditFailure(value); + return this; + } + + @Override + public JAclEntryRecord values(Long value1, Long value2, Integer value3, Long value4, + Integer value5, Boolean value6, Boolean value7, Boolean value8) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclObjectIdentityRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclObjectIdentityRecord.java index 93b4f0213..39fb80faa 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclObjectIdentityRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclObjectIdentityRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record6; @@ -25,277 +23,281 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JAclObjectIdentityRecord extends UpdatableRecordImpl implements Record6 { - - private static final long serialVersionUID = 1370439583; - - /** - * Setter for public.acl_object_identity.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.acl_object_identity.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.acl_object_identity.object_id_class. - */ - public void setObjectIdClass(Long value) { - set(1, value); - } - - /** - * Getter for public.acl_object_identity.object_id_class. - */ - public Long getObjectIdClass() { - return (Long) get(1); - } - - /** - * Setter for public.acl_object_identity.object_id_identity. - */ - public void setObjectIdIdentity(String value) { - set(2, value); - } - - /** - * Getter for public.acl_object_identity.object_id_identity. - */ - public String getObjectIdIdentity() { - return (String) get(2); - } - - /** - * Setter for public.acl_object_identity.parent_object. - */ - public void setParentObject(Long value) { - set(3, value); - } - - /** - * Getter for public.acl_object_identity.parent_object. - */ - public Long getParentObject() { - return (Long) get(3); - } - - /** - * Setter for public.acl_object_identity.owner_sid. - */ - public void setOwnerSid(Long value) { - set(4, value); - } - - /** - * Getter for public.acl_object_identity.owner_sid. - */ - public Long getOwnerSid() { - return (Long) get(4); - } - - /** - * Setter for public.acl_object_identity.entries_inheriting. - */ - public void setEntriesInheriting(Boolean value) { - set(5, value); - } - - /** - * Getter for public.acl_object_identity.entries_inheriting. - */ - public Boolean getEntriesInheriting() { - return (Boolean) get(5); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return JAclObjectIdentity.ACL_OBJECT_IDENTITY.ID; - } - - @Override - public Field field2() { - return JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS; - } - - @Override - public Field field3() { - return JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY; - } - - @Override - public Field field4() { - return JAclObjectIdentity.ACL_OBJECT_IDENTITY.PARENT_OBJECT; - } - - @Override - public Field field5() { - return JAclObjectIdentity.ACL_OBJECT_IDENTITY.OWNER_SID; - } - - @Override - public Field field6() { - return JAclObjectIdentity.ACL_OBJECT_IDENTITY.ENTRIES_INHERITING; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getObjectIdClass(); - } - - @Override - public String component3() { - return getObjectIdIdentity(); - } - - @Override - public Long component4() { - return getParentObject(); - } - - @Override - public Long component5() { - return getOwnerSid(); - } - - @Override - public Boolean component6() { - return getEntriesInheriting(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getObjectIdClass(); - } - - @Override - public String value3() { - return getObjectIdIdentity(); - } - - @Override - public Long value4() { - return getParentObject(); - } - - @Override - public Long value5() { - return getOwnerSid(); - } - - @Override - public Boolean value6() { - return getEntriesInheriting(); - } - - @Override - public JAclObjectIdentityRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JAclObjectIdentityRecord value2(Long value) { - setObjectIdClass(value); - return this; - } - - @Override - public JAclObjectIdentityRecord value3(String value) { - setObjectIdIdentity(value); - return this; - } - - @Override - public JAclObjectIdentityRecord value4(Long value) { - setParentObject(value); - return this; - } - - @Override - public JAclObjectIdentityRecord value5(Long value) { - setOwnerSid(value); - return this; - } - - @Override - public JAclObjectIdentityRecord value6(Boolean value) { - setEntriesInheriting(value); - return this; - } - - @Override - public JAclObjectIdentityRecord values(Long value1, Long value2, String value3, Long value4, Long value5, Boolean value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JAclObjectIdentityRecord - */ - public JAclObjectIdentityRecord() { - super(JAclObjectIdentity.ACL_OBJECT_IDENTITY); - } - - /** - * Create a detached, initialised JAclObjectIdentityRecord - */ - public JAclObjectIdentityRecord(Long id, Long objectIdClass, String objectIdIdentity, Long parentObject, Long ownerSid, Boolean entriesInheriting) { - super(JAclObjectIdentity.ACL_OBJECT_IDENTITY); - - set(0, id); - set(1, objectIdClass); - set(2, objectIdIdentity); - set(3, parentObject); - set(4, ownerSid); - set(5, entriesInheriting); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JAclObjectIdentityRecord extends + UpdatableRecordImpl implements + Record6 { + + private static final long serialVersionUID = 1370439583; + + /** + * Create a detached JAclObjectIdentityRecord + */ + public JAclObjectIdentityRecord() { + super(JAclObjectIdentity.ACL_OBJECT_IDENTITY); + } + + /** + * Create a detached, initialised JAclObjectIdentityRecord + */ + public JAclObjectIdentityRecord(Long id, Long objectIdClass, String objectIdIdentity, + Long parentObject, Long ownerSid, Boolean entriesInheriting) { + super(JAclObjectIdentity.ACL_OBJECT_IDENTITY); + + set(0, id); + set(1, objectIdClass); + set(2, objectIdIdentity); + set(3, parentObject); + set(4, ownerSid); + set(5, entriesInheriting); + } + + /** + * Getter for public.acl_object_identity.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.acl_object_identity.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.acl_object_identity.object_id_class. + */ + public Long getObjectIdClass() { + return (Long) get(1); + } + + /** + * Setter for public.acl_object_identity.object_id_class. + */ + public void setObjectIdClass(Long value) { + set(1, value); + } + + /** + * Getter for public.acl_object_identity.object_id_identity. + */ + public String getObjectIdIdentity() { + return (String) get(2); + } + + /** + * Setter for public.acl_object_identity.object_id_identity. + */ + public void setObjectIdIdentity(String value) { + set(2, value); + } + + /** + * Getter for public.acl_object_identity.parent_object. + */ + public Long getParentObject() { + return (Long) get(3); + } + + /** + * Setter for public.acl_object_identity.parent_object. + */ + public void setParentObject(Long value) { + set(3, value); + } + + /** + * Getter for public.acl_object_identity.owner_sid. + */ + public Long getOwnerSid() { + return (Long) get(4); + } + + /** + * Setter for public.acl_object_identity.owner_sid. + */ + public void setOwnerSid(Long value) { + set(4, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.acl_object_identity.entries_inheriting. + */ + public Boolean getEntriesInheriting() { + return (Boolean) get(5); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.acl_object_identity.entries_inheriting. + */ + public void setEntriesInheriting(Boolean value) { + set(5, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return JAclObjectIdentity.ACL_OBJECT_IDENTITY.ID; + } + + @Override + public Field field2() { + return JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS; + } + + @Override + public Field field3() { + return JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY; + } + + @Override + public Field field4() { + return JAclObjectIdentity.ACL_OBJECT_IDENTITY.PARENT_OBJECT; + } + + @Override + public Field field5() { + return JAclObjectIdentity.ACL_OBJECT_IDENTITY.OWNER_SID; + } + + @Override + public Field field6() { + return JAclObjectIdentity.ACL_OBJECT_IDENTITY.ENTRIES_INHERITING; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getObjectIdClass(); + } + + @Override + public String component3() { + return getObjectIdIdentity(); + } + + @Override + public Long component4() { + return getParentObject(); + } + + @Override + public Long component5() { + return getOwnerSid(); + } + + @Override + public Boolean component6() { + return getEntriesInheriting(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getObjectIdClass(); + } + + @Override + public String value3() { + return getObjectIdIdentity(); + } + + @Override + public Long value4() { + return getParentObject(); + } + + @Override + public Long value5() { + return getOwnerSid(); + } + + @Override + public Boolean value6() { + return getEntriesInheriting(); + } + + @Override + public JAclObjectIdentityRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JAclObjectIdentityRecord value2(Long value) { + setObjectIdClass(value); + return this; + } + + @Override + public JAclObjectIdentityRecord value3(String value) { + setObjectIdIdentity(value); + return this; + } + + @Override + public JAclObjectIdentityRecord value4(Long value) { + setParentObject(value); + return this; + } + + @Override + public JAclObjectIdentityRecord value5(Long value) { + setOwnerSid(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JAclObjectIdentityRecord value6(Boolean value) { + setEntriesInheriting(value); + return this; + } + + @Override + public JAclObjectIdentityRecord values(Long value1, Long value2, String value3, Long value4, + Long value5, Boolean value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclSidRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclSidRecord.java index 0b27626c0..6e5e6a9c8 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclSidRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclSidRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JAclSid; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record3; @@ -25,166 +23,167 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JAclSidRecord extends UpdatableRecordImpl implements Record3 { - - private static final long serialVersionUID = -2019104834; - - /** - * Setter for public.acl_sid.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.acl_sid.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.acl_sid.principal. - */ - public void setPrincipal(Boolean value) { - set(1, value); - } - - /** - * Getter for public.acl_sid.principal. - */ - public Boolean getPrincipal() { - return (Boolean) get(1); - } - - /** - * Setter for public.acl_sid.sid. - */ - public void setSid(String value) { - set(2, value); - } - - /** - * Getter for public.acl_sid.sid. - */ - public String getSid() { - return (String) get(2); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JAclSid.ACL_SID.ID; - } - - @Override - public Field field2() { - return JAclSid.ACL_SID.PRINCIPAL; - } - - @Override - public Field field3() { - return JAclSid.ACL_SID.SID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Boolean component2() { - return getPrincipal(); - } - - @Override - public String component3() { - return getSid(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Boolean value2() { - return getPrincipal(); - } - - @Override - public String value3() { - return getSid(); - } - - @Override - public JAclSidRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JAclSidRecord value2(Boolean value) { - setPrincipal(value); - return this; - } - - @Override - public JAclSidRecord value3(String value) { - setSid(value); - return this; - } - - @Override - public JAclSidRecord values(Long value1, Boolean value2, String value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JAclSidRecord - */ - public JAclSidRecord() { - super(JAclSid.ACL_SID); - } - - /** - * Create a detached, initialised JAclSidRecord - */ - public JAclSidRecord(Long id, Boolean principal, String sid) { - super(JAclSid.ACL_SID); - - set(0, id); - set(1, principal); - set(2, sid); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JAclSidRecord extends UpdatableRecordImpl implements + Record3 { + + private static final long serialVersionUID = -2019104834; + + /** + * Create a detached JAclSidRecord + */ + public JAclSidRecord() { + super(JAclSid.ACL_SID); + } + + /** + * Create a detached, initialised JAclSidRecord + */ + public JAclSidRecord(Long id, Boolean principal, String sid) { + super(JAclSid.ACL_SID); + + set(0, id); + set(1, principal); + set(2, sid); + } + + /** + * Getter for public.acl_sid.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.acl_sid.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.acl_sid.principal. + */ + public Boolean getPrincipal() { + return (Boolean) get(1); + } + + /** + * Setter for public.acl_sid.principal. + */ + public void setPrincipal(Boolean value) { + set(1, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.acl_sid.sid. + */ + public String getSid() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.acl_sid.sid. + */ + public void setSid(String value) { + set(2, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JAclSid.ACL_SID.ID; + } + + @Override + public Field field2() { + return JAclSid.ACL_SID.PRINCIPAL; + } + + @Override + public Field field3() { + return JAclSid.ACL_SID.SID; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Boolean component2() { + return getPrincipal(); + } + + @Override + public String component3() { + return getSid(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Boolean value2() { + return getPrincipal(); + } + + @Override + public String value3() { + return getSid(); + } + + @Override + public JAclSidRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JAclSidRecord value2(Boolean value) { + setPrincipal(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JAclSidRecord value3(String value) { + setSid(value); + return this; + } + + @Override + public JAclSidRecord values(Long value1, Boolean value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JActivityRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JActivityRecord.java index 6f34fd512..f5cb05141 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JActivityRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JActivityRecord.java @@ -5,11 +5,8 @@ import com.epam.ta.reportportal.jooq.tables.JActivity; - import java.sql.Timestamp; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.JSONB; import org.jooq.Record1; @@ -28,388 +25,391 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JActivityRecord extends UpdatableRecordImpl implements Record9 { - - private static final long serialVersionUID = 1741928455; - - /** - * Setter for public.activity.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.activity.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.activity.user_id. - */ - public void setUserId(Long value) { - set(1, value); - } - - /** - * Getter for public.activity.user_id. - */ - public Long getUserId() { - return (Long) get(1); - } - - /** - * Setter for public.activity.username. - */ - public void setUsername(String value) { - set(2, value); - } - - /** - * Getter for public.activity.username. - */ - public String getUsername() { - return (String) get(2); - } - - /** - * Setter for public.activity.project_id. - */ - public void setProjectId(Long value) { - set(3, value); - } - - /** - * Getter for public.activity.project_id. - */ - public Long getProjectId() { - return (Long) get(3); - } - - /** - * Setter for public.activity.entity. - */ - public void setEntity(String value) { - set(4, value); - } - - /** - * Getter for public.activity.entity. - */ - public String getEntity() { - return (String) get(4); - } - - /** - * Setter for public.activity.action. - */ - public void setAction(String value) { - set(5, value); - } - - /** - * Getter for public.activity.action. - */ - public String getAction() { - return (String) get(5); - } - - /** - * Setter for public.activity.details. - */ - public void setDetails(JSONB value) { - set(6, value); - } - - /** - * Getter for public.activity.details. - */ - public JSONB getDetails() { - return (JSONB) get(6); - } - - /** - * Setter for public.activity.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(7, value); - } - - /** - * Getter for public.activity.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(7); - } - - /** - * Setter for public.activity.object_id. - */ - public void setObjectId(Long value) { - set(8, value); - } - - /** - * Getter for public.activity.object_id. - */ - public Long getObjectId() { - return (Long) get(8); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record9 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } - - @Override - public Row9 valuesRow() { - return (Row9) super.valuesRow(); - } - - @Override - public Field field1() { - return JActivity.ACTIVITY.ID; - } - - @Override - public Field field2() { - return JActivity.ACTIVITY.USER_ID; - } - - @Override - public Field field3() { - return JActivity.ACTIVITY.USERNAME; - } - - @Override - public Field field4() { - return JActivity.ACTIVITY.PROJECT_ID; - } - - @Override - public Field field5() { - return JActivity.ACTIVITY.ENTITY; - } - - @Override - public Field field6() { - return JActivity.ACTIVITY.ACTION; - } - - @Override - public Field field7() { - return JActivity.ACTIVITY.DETAILS; - } - - @Override - public Field field8() { - return JActivity.ACTIVITY.CREATION_DATE; - } - - @Override - public Field field9() { - return JActivity.ACTIVITY.OBJECT_ID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getUserId(); - } - - @Override - public String component3() { - return getUsername(); - } - - @Override - public Long component4() { - return getProjectId(); - } - - @Override - public String component5() { - return getEntity(); - } - - @Override - public String component6() { - return getAction(); - } - - @Override - public JSONB component7() { - return getDetails(); - } - - @Override - public Timestamp component8() { - return getCreationDate(); - } - - @Override - public Long component9() { - return getObjectId(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getUserId(); - } - - @Override - public String value3() { - return getUsername(); - } - - @Override - public Long value4() { - return getProjectId(); - } - - @Override - public String value5() { - return getEntity(); - } - - @Override - public String value6() { - return getAction(); - } - - @Override - public JSONB value7() { - return getDetails(); - } - - @Override - public Timestamp value8() { - return getCreationDate(); - } - - @Override - public Long value9() { - return getObjectId(); - } - - @Override - public JActivityRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JActivityRecord value2(Long value) { - setUserId(value); - return this; - } - - @Override - public JActivityRecord value3(String value) { - setUsername(value); - return this; - } - - @Override - public JActivityRecord value4(Long value) { - setProjectId(value); - return this; - } - - @Override - public JActivityRecord value5(String value) { - setEntity(value); - return this; - } - - @Override - public JActivityRecord value6(String value) { - setAction(value); - return this; - } - - @Override - public JActivityRecord value7(JSONB value) { - setDetails(value); - return this; - } - - @Override - public JActivityRecord value8(Timestamp value) { - setCreationDate(value); - return this; - } - - @Override - public JActivityRecord value9(Long value) { - setObjectId(value); - return this; - } - - @Override - public JActivityRecord values(Long value1, Long value2, String value3, Long value4, String value5, String value6, JSONB value7, Timestamp value8, Long value9) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JActivityRecord - */ - public JActivityRecord() { - super(JActivity.ACTIVITY); - } - - /** - * Create a detached, initialised JActivityRecord - */ - public JActivityRecord(Long id, Long userId, String username, Long projectId, String entity, String action, JSONB details, Timestamp creationDate, Long objectId) { - super(JActivity.ACTIVITY); - - set(0, id); - set(1, userId); - set(2, username); - set(3, projectId); - set(4, entity); - set(5, action); - set(6, details); - set(7, creationDate); - set(8, objectId); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JActivityRecord extends UpdatableRecordImpl implements + Record9 { + + private static final long serialVersionUID = 1741928455; + + /** + * Create a detached JActivityRecord + */ + public JActivityRecord() { + super(JActivity.ACTIVITY); + } + + /** + * Create a detached, initialised JActivityRecord + */ + public JActivityRecord(Long id, Long userId, String username, Long projectId, String entity, + String action, JSONB details, Timestamp creationDate, Long objectId) { + super(JActivity.ACTIVITY); + + set(0, id); + set(1, userId); + set(2, username); + set(3, projectId); + set(4, entity); + set(5, action); + set(6, details); + set(7, creationDate); + set(8, objectId); + } + + /** + * Getter for public.activity.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.activity.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.activity.user_id. + */ + public Long getUserId() { + return (Long) get(1); + } + + /** + * Setter for public.activity.user_id. + */ + public void setUserId(Long value) { + set(1, value); + } + + /** + * Getter for public.activity.username. + */ + public String getUsername() { + return (String) get(2); + } + + /** + * Setter for public.activity.username. + */ + public void setUsername(String value) { + set(2, value); + } + + /** + * Getter for public.activity.project_id. + */ + public Long getProjectId() { + return (Long) get(3); + } + + /** + * Setter for public.activity.project_id. + */ + public void setProjectId(Long value) { + set(3, value); + } + + /** + * Getter for public.activity.entity. + */ + public String getEntity() { + return (String) get(4); + } + + /** + * Setter for public.activity.entity. + */ + public void setEntity(String value) { + set(4, value); + } + + /** + * Getter for public.activity.action. + */ + public String getAction() { + return (String) get(5); + } + + /** + * Setter for public.activity.action. + */ + public void setAction(String value) { + set(5, value); + } + + /** + * Getter for public.activity.details. + */ + public JSONB getDetails() { + return (JSONB) get(6); + } + + /** + * Setter for public.activity.details. + */ + public void setDetails(JSONB value) { + set(6, value); + } + + /** + * Getter for public.activity.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(7); + } + + /** + * Setter for public.activity.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(7, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.activity.object_id. + */ + public Long getObjectId() { + return (Long) get(8); + } + + // ------------------------------------------------------------------------- + // Record9 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.activity.object_id. + */ + public void setObjectId(Long value) { + set(8, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } + + @Override + public Row9 valuesRow() { + return (Row9) super.valuesRow(); + } + + @Override + public Field field1() { + return JActivity.ACTIVITY.ID; + } + + @Override + public Field field2() { + return JActivity.ACTIVITY.USER_ID; + } + + @Override + public Field field3() { + return JActivity.ACTIVITY.USERNAME; + } + + @Override + public Field field4() { + return JActivity.ACTIVITY.PROJECT_ID; + } + + @Override + public Field field5() { + return JActivity.ACTIVITY.ENTITY; + } + + @Override + public Field field6() { + return JActivity.ACTIVITY.ACTION; + } + + @Override + public Field field7() { + return JActivity.ACTIVITY.DETAILS; + } + + @Override + public Field field8() { + return JActivity.ACTIVITY.CREATION_DATE; + } + + @Override + public Field field9() { + return JActivity.ACTIVITY.OBJECT_ID; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getUserId(); + } + + @Override + public String component3() { + return getUsername(); + } + + @Override + public Long component4() { + return getProjectId(); + } + + @Override + public String component5() { + return getEntity(); + } + + @Override + public String component6() { + return getAction(); + } + + @Override + public JSONB component7() { + return getDetails(); + } + + @Override + public Timestamp component8() { + return getCreationDate(); + } + + @Override + public Long component9() { + return getObjectId(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getUserId(); + } + + @Override + public String value3() { + return getUsername(); + } + + @Override + public Long value4() { + return getProjectId(); + } + + @Override + public String value5() { + return getEntity(); + } + + @Override + public String value6() { + return getAction(); + } + + @Override + public JSONB value7() { + return getDetails(); + } + + @Override + public Timestamp value8() { + return getCreationDate(); + } + + @Override + public Long value9() { + return getObjectId(); + } + + @Override + public JActivityRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JActivityRecord value2(Long value) { + setUserId(value); + return this; + } + + @Override + public JActivityRecord value3(String value) { + setUsername(value); + return this; + } + + @Override + public JActivityRecord value4(Long value) { + setProjectId(value); + return this; + } + + @Override + public JActivityRecord value5(String value) { + setEntity(value); + return this; + } + + @Override + public JActivityRecord value6(String value) { + setAction(value); + return this; + } + + @Override + public JActivityRecord value7(JSONB value) { + setDetails(value); + return this; + } + + @Override + public JActivityRecord value8(Timestamp value) { + setCreationDate(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JActivityRecord value9(Long value) { + setObjectId(value); + return this; + } + + @Override + public JActivityRecord values(Long value1, Long value2, String value3, Long value4, String value5, + String value6, JSONB value7, Timestamp value8, Long value9) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentDeletionRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentDeletionRecord.java index dc92a59ab..fca373375 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentDeletionRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentDeletionRecord.java @@ -5,11 +5,8 @@ import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; - import java.sql.Timestamp; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record5; @@ -27,240 +24,244 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JAttachmentDeletionRecord extends UpdatableRecordImpl implements Record5 { - - private static final long serialVersionUID = 1506388720; - - /** - * Setter for public.attachment_deletion.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.attachment_deletion.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.attachment_deletion.file_id. - */ - public void setFileId(String value) { - set(1, value); - } - - /** - * Getter for public.attachment_deletion.file_id. - */ - public String getFileId() { - return (String) get(1); - } - - /** - * Setter for public.attachment_deletion.thumbnail_id. - */ - public void setThumbnailId(String value) { - set(2, value); - } - - /** - * Getter for public.attachment_deletion.thumbnail_id. - */ - public String getThumbnailId() { - return (String) get(2); - } - - /** - * Setter for public.attachment_deletion.creation_attachment_date. - */ - public void setCreationAttachmentDate(Timestamp value) { - set(3, value); - } - - /** - * Getter for public.attachment_deletion.creation_attachment_date. - */ - public Timestamp getCreationAttachmentDate() { - return (Timestamp) get(3); - } - - /** - * Setter for public.attachment_deletion.deletion_date. - */ - public void setDeletionDate(Timestamp value) { - set(4, value); - } - - /** - * Getter for public.attachment_deletion.deletion_date. - */ - public Timestamp getDeletionDate() { - return (Timestamp) get(4); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } - - @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); - } - - @Override - public Field field1() { - return JAttachmentDeletion.ATTACHMENT_DELETION.ID; - } - - @Override - public Field field2() { - return JAttachmentDeletion.ATTACHMENT_DELETION.FILE_ID; - } - - @Override - public Field field3() { - return JAttachmentDeletion.ATTACHMENT_DELETION.THUMBNAIL_ID; - } - - @Override - public Field field4() { - return JAttachmentDeletion.ATTACHMENT_DELETION.CREATION_ATTACHMENT_DATE; - } - - @Override - public Field field5() { - return JAttachmentDeletion.ATTACHMENT_DELETION.DELETION_DATE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getFileId(); - } - - @Override - public String component3() { - return getThumbnailId(); - } - - @Override - public Timestamp component4() { - return getCreationAttachmentDate(); - } - - @Override - public Timestamp component5() { - return getDeletionDate(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getFileId(); - } - - @Override - public String value3() { - return getThumbnailId(); - } - - @Override - public Timestamp value4() { - return getCreationAttachmentDate(); - } - - @Override - public Timestamp value5() { - return getDeletionDate(); - } - - @Override - public JAttachmentDeletionRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JAttachmentDeletionRecord value2(String value) { - setFileId(value); - return this; - } - - @Override - public JAttachmentDeletionRecord value3(String value) { - setThumbnailId(value); - return this; - } - - @Override - public JAttachmentDeletionRecord value4(Timestamp value) { - setCreationAttachmentDate(value); - return this; - } - - @Override - public JAttachmentDeletionRecord value5(Timestamp value) { - setDeletionDate(value); - return this; - } - - @Override - public JAttachmentDeletionRecord values(Long value1, String value2, String value3, Timestamp value4, Timestamp value5) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JAttachmentDeletionRecord - */ - public JAttachmentDeletionRecord() { - super(JAttachmentDeletion.ATTACHMENT_DELETION); - } - - /** - * Create a detached, initialised JAttachmentDeletionRecord - */ - public JAttachmentDeletionRecord(Long id, String fileId, String thumbnailId, Timestamp creationAttachmentDate, Timestamp deletionDate) { - super(JAttachmentDeletion.ATTACHMENT_DELETION); - - set(0, id); - set(1, fileId); - set(2, thumbnailId); - set(3, creationAttachmentDate); - set(4, deletionDate); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JAttachmentDeletionRecord extends + UpdatableRecordImpl implements + Record5 { + + private static final long serialVersionUID = 1506388720; + + /** + * Create a detached JAttachmentDeletionRecord + */ + public JAttachmentDeletionRecord() { + super(JAttachmentDeletion.ATTACHMENT_DELETION); + } + + /** + * Create a detached, initialised JAttachmentDeletionRecord + */ + public JAttachmentDeletionRecord(Long id, String fileId, String thumbnailId, + Timestamp creationAttachmentDate, Timestamp deletionDate) { + super(JAttachmentDeletion.ATTACHMENT_DELETION); + + set(0, id); + set(1, fileId); + set(2, thumbnailId); + set(3, creationAttachmentDate); + set(4, deletionDate); + } + + /** + * Getter for public.attachment_deletion.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.attachment_deletion.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.attachment_deletion.file_id. + */ + public String getFileId() { + return (String) get(1); + } + + /** + * Setter for public.attachment_deletion.file_id. + */ + public void setFileId(String value) { + set(1, value); + } + + /** + * Getter for public.attachment_deletion.thumbnail_id. + */ + public String getThumbnailId() { + return (String) get(2); + } + + /** + * Setter for public.attachment_deletion.thumbnail_id. + */ + public void setThumbnailId(String value) { + set(2, value); + } + + /** + * Getter for public.attachment_deletion.creation_attachment_date. + */ + public Timestamp getCreationAttachmentDate() { + return (Timestamp) get(3); + } + + /** + * Setter for public.attachment_deletion.creation_attachment_date. + */ + public void setCreationAttachmentDate(Timestamp value) { + set(3, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.attachment_deletion.deletion_date. + */ + public Timestamp getDeletionDate() { + return (Timestamp) get(4); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.attachment_deletion.deletion_date. + */ + public void setDeletionDate(Timestamp value) { + set(4, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return JAttachmentDeletion.ATTACHMENT_DELETION.ID; + } + + @Override + public Field field2() { + return JAttachmentDeletion.ATTACHMENT_DELETION.FILE_ID; + } + + @Override + public Field field3() { + return JAttachmentDeletion.ATTACHMENT_DELETION.THUMBNAIL_ID; + } + + @Override + public Field field4() { + return JAttachmentDeletion.ATTACHMENT_DELETION.CREATION_ATTACHMENT_DATE; + } + + @Override + public Field field5() { + return JAttachmentDeletion.ATTACHMENT_DELETION.DELETION_DATE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getFileId(); + } + + @Override + public String component3() { + return getThumbnailId(); + } + + @Override + public Timestamp component4() { + return getCreationAttachmentDate(); + } + + @Override + public Timestamp component5() { + return getDeletionDate(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getFileId(); + } + + @Override + public String value3() { + return getThumbnailId(); + } + + @Override + public Timestamp value4() { + return getCreationAttachmentDate(); + } + + @Override + public Timestamp value5() { + return getDeletionDate(); + } + + @Override + public JAttachmentDeletionRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JAttachmentDeletionRecord value2(String value) { + setFileId(value); + return this; + } + + @Override + public JAttachmentDeletionRecord value3(String value) { + setThumbnailId(value); + return this; + } + + @Override + public JAttachmentDeletionRecord value4(Timestamp value) { + setCreationAttachmentDate(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JAttachmentDeletionRecord value5(Timestamp value) { + setDeletionDate(value); + return this; + } + + @Override + public JAttachmentDeletionRecord values(Long value1, String value2, String value3, + Timestamp value4, Timestamp value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentRecord.java index 1b6ad3d29..199aa2c54 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentRecord.java @@ -5,11 +5,8 @@ import com.epam.ta.reportportal.jooq.tables.JAttachment; - import java.sql.Timestamp; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record9; @@ -27,388 +24,391 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JAttachmentRecord extends UpdatableRecordImpl implements Record9 { - - private static final long serialVersionUID = 171693268; - - /** - * Setter for public.attachment.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.attachment.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.attachment.file_id. - */ - public void setFileId(String value) { - set(1, value); - } - - /** - * Getter for public.attachment.file_id. - */ - public String getFileId() { - return (String) get(1); - } - - /** - * Setter for public.attachment.thumbnail_id. - */ - public void setThumbnailId(String value) { - set(2, value); - } - - /** - * Getter for public.attachment.thumbnail_id. - */ - public String getThumbnailId() { - return (String) get(2); - } - - /** - * Setter for public.attachment.content_type. - */ - public void setContentType(String value) { - set(3, value); - } - - /** - * Getter for public.attachment.content_type. - */ - public String getContentType() { - return (String) get(3); - } - - /** - * Setter for public.attachment.project_id. - */ - public void setProjectId(Long value) { - set(4, value); - } - - /** - * Getter for public.attachment.project_id. - */ - public Long getProjectId() { - return (Long) get(4); - } - - /** - * Setter for public.attachment.launch_id. - */ - public void setLaunchId(Long value) { - set(5, value); - } - - /** - * Getter for public.attachment.launch_id. - */ - public Long getLaunchId() { - return (Long) get(5); - } - - /** - * Setter for public.attachment.item_id. - */ - public void setItemId(Long value) { - set(6, value); - } - - /** - * Getter for public.attachment.item_id. - */ - public Long getItemId() { - return (Long) get(6); - } - - /** - * Setter for public.attachment.file_size. - */ - public void setFileSize(Long value) { - set(7, value); - } - - /** - * Getter for public.attachment.file_size. - */ - public Long getFileSize() { - return (Long) get(7); - } - - /** - * Setter for public.attachment.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(8, value); - } - - /** - * Getter for public.attachment.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(8); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record9 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } - - @Override - public Row9 valuesRow() { - return (Row9) super.valuesRow(); - } - - @Override - public Field field1() { - return JAttachment.ATTACHMENT.ID; - } - - @Override - public Field field2() { - return JAttachment.ATTACHMENT.FILE_ID; - } - - @Override - public Field field3() { - return JAttachment.ATTACHMENT.THUMBNAIL_ID; - } - - @Override - public Field field4() { - return JAttachment.ATTACHMENT.CONTENT_TYPE; - } - - @Override - public Field field5() { - return JAttachment.ATTACHMENT.PROJECT_ID; - } - - @Override - public Field field6() { - return JAttachment.ATTACHMENT.LAUNCH_ID; - } - - @Override - public Field field7() { - return JAttachment.ATTACHMENT.ITEM_ID; - } - - @Override - public Field field8() { - return JAttachment.ATTACHMENT.FILE_SIZE; - } - - @Override - public Field field9() { - return JAttachment.ATTACHMENT.CREATION_DATE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getFileId(); - } - - @Override - public String component3() { - return getThumbnailId(); - } - - @Override - public String component4() { - return getContentType(); - } - - @Override - public Long component5() { - return getProjectId(); - } - - @Override - public Long component6() { - return getLaunchId(); - } - - @Override - public Long component7() { - return getItemId(); - } - - @Override - public Long component8() { - return getFileSize(); - } - - @Override - public Timestamp component9() { - return getCreationDate(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getFileId(); - } - - @Override - public String value3() { - return getThumbnailId(); - } - - @Override - public String value4() { - return getContentType(); - } - - @Override - public Long value5() { - return getProjectId(); - } - - @Override - public Long value6() { - return getLaunchId(); - } - - @Override - public Long value7() { - return getItemId(); - } - - @Override - public Long value8() { - return getFileSize(); - } - - @Override - public Timestamp value9() { - return getCreationDate(); - } - - @Override - public JAttachmentRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JAttachmentRecord value2(String value) { - setFileId(value); - return this; - } - - @Override - public JAttachmentRecord value3(String value) { - setThumbnailId(value); - return this; - } - - @Override - public JAttachmentRecord value4(String value) { - setContentType(value); - return this; - } - - @Override - public JAttachmentRecord value5(Long value) { - setProjectId(value); - return this; - } - - @Override - public JAttachmentRecord value6(Long value) { - setLaunchId(value); - return this; - } - - @Override - public JAttachmentRecord value7(Long value) { - setItemId(value); - return this; - } - - @Override - public JAttachmentRecord value8(Long value) { - setFileSize(value); - return this; - } - - @Override - public JAttachmentRecord value9(Timestamp value) { - setCreationDate(value); - return this; - } - - @Override - public JAttachmentRecord values(Long value1, String value2, String value3, String value4, Long value5, Long value6, Long value7, Long value8, Timestamp value9) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JAttachmentRecord - */ - public JAttachmentRecord() { - super(JAttachment.ATTACHMENT); - } - - /** - * Create a detached, initialised JAttachmentRecord - */ - public JAttachmentRecord(Long id, String fileId, String thumbnailId, String contentType, Long projectId, Long launchId, Long itemId, Long fileSize, Timestamp creationDate) { - super(JAttachment.ATTACHMENT); - - set(0, id); - set(1, fileId); - set(2, thumbnailId); - set(3, contentType); - set(4, projectId); - set(5, launchId); - set(6, itemId); - set(7, fileSize); - set(8, creationDate); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JAttachmentRecord extends UpdatableRecordImpl implements + Record9 { + + private static final long serialVersionUID = 171693268; + + /** + * Create a detached JAttachmentRecord + */ + public JAttachmentRecord() { + super(JAttachment.ATTACHMENT); + } + + /** + * Create a detached, initialised JAttachmentRecord + */ + public JAttachmentRecord(Long id, String fileId, String thumbnailId, String contentType, + Long projectId, Long launchId, Long itemId, Long fileSize, Timestamp creationDate) { + super(JAttachment.ATTACHMENT); + + set(0, id); + set(1, fileId); + set(2, thumbnailId); + set(3, contentType); + set(4, projectId); + set(5, launchId); + set(6, itemId); + set(7, fileSize); + set(8, creationDate); + } + + /** + * Getter for public.attachment.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.attachment.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.attachment.file_id. + */ + public String getFileId() { + return (String) get(1); + } + + /** + * Setter for public.attachment.file_id. + */ + public void setFileId(String value) { + set(1, value); + } + + /** + * Getter for public.attachment.thumbnail_id. + */ + public String getThumbnailId() { + return (String) get(2); + } + + /** + * Setter for public.attachment.thumbnail_id. + */ + public void setThumbnailId(String value) { + set(2, value); + } + + /** + * Getter for public.attachment.content_type. + */ + public String getContentType() { + return (String) get(3); + } + + /** + * Setter for public.attachment.content_type. + */ + public void setContentType(String value) { + set(3, value); + } + + /** + * Getter for public.attachment.project_id. + */ + public Long getProjectId() { + return (Long) get(4); + } + + /** + * Setter for public.attachment.project_id. + */ + public void setProjectId(Long value) { + set(4, value); + } + + /** + * Getter for public.attachment.launch_id. + */ + public Long getLaunchId() { + return (Long) get(5); + } + + /** + * Setter for public.attachment.launch_id. + */ + public void setLaunchId(Long value) { + set(5, value); + } + + /** + * Getter for public.attachment.item_id. + */ + public Long getItemId() { + return (Long) get(6); + } + + /** + * Setter for public.attachment.item_id. + */ + public void setItemId(Long value) { + set(6, value); + } + + /** + * Getter for public.attachment.file_size. + */ + public Long getFileSize() { + return (Long) get(7); + } + + /** + * Setter for public.attachment.file_size. + */ + public void setFileSize(Long value) { + set(7, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.attachment.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(8); + } + + // ------------------------------------------------------------------------- + // Record9 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.attachment.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(8, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } + + @Override + public Row9 valuesRow() { + return (Row9) super.valuesRow(); + } + + @Override + public Field field1() { + return JAttachment.ATTACHMENT.ID; + } + + @Override + public Field field2() { + return JAttachment.ATTACHMENT.FILE_ID; + } + + @Override + public Field field3() { + return JAttachment.ATTACHMENT.THUMBNAIL_ID; + } + + @Override + public Field field4() { + return JAttachment.ATTACHMENT.CONTENT_TYPE; + } + + @Override + public Field field5() { + return JAttachment.ATTACHMENT.PROJECT_ID; + } + + @Override + public Field field6() { + return JAttachment.ATTACHMENT.LAUNCH_ID; + } + + @Override + public Field field7() { + return JAttachment.ATTACHMENT.ITEM_ID; + } + + @Override + public Field field8() { + return JAttachment.ATTACHMENT.FILE_SIZE; + } + + @Override + public Field field9() { + return JAttachment.ATTACHMENT.CREATION_DATE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getFileId(); + } + + @Override + public String component3() { + return getThumbnailId(); + } + + @Override + public String component4() { + return getContentType(); + } + + @Override + public Long component5() { + return getProjectId(); + } + + @Override + public Long component6() { + return getLaunchId(); + } + + @Override + public Long component7() { + return getItemId(); + } + + @Override + public Long component8() { + return getFileSize(); + } + + @Override + public Timestamp component9() { + return getCreationDate(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getFileId(); + } + + @Override + public String value3() { + return getThumbnailId(); + } + + @Override + public String value4() { + return getContentType(); + } + + @Override + public Long value5() { + return getProjectId(); + } + + @Override + public Long value6() { + return getLaunchId(); + } + + @Override + public Long value7() { + return getItemId(); + } + + @Override + public Long value8() { + return getFileSize(); + } + + @Override + public Timestamp value9() { + return getCreationDate(); + } + + @Override + public JAttachmentRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JAttachmentRecord value2(String value) { + setFileId(value); + return this; + } + + @Override + public JAttachmentRecord value3(String value) { + setThumbnailId(value); + return this; + } + + @Override + public JAttachmentRecord value4(String value) { + setContentType(value); + return this; + } + + @Override + public JAttachmentRecord value5(Long value) { + setProjectId(value); + return this; + } + + @Override + public JAttachmentRecord value6(Long value) { + setLaunchId(value); + return this; + } + + @Override + public JAttachmentRecord value7(Long value) { + setItemId(value); + return this; + } + + @Override + public JAttachmentRecord value8(Long value) { + setFileSize(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JAttachmentRecord value9(Timestamp value) { + setCreationDate(value); + return this; + } + + @Override + public JAttachmentRecord values(Long value1, String value2, String value3, String value4, + Long value5, Long value6, Long value7, Long value8, Timestamp value9) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttributeRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttributeRecord.java index e89015d8b..ff92f4640 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttributeRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttributeRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JAttribute; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record2; @@ -25,129 +23,130 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JAttributeRecord extends UpdatableRecordImpl implements Record2 { - - private static final long serialVersionUID = -421000452; - - /** - * Setter for public.attribute.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.attribute.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.attribute.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.attribute.name. - */ - public String getName() { - return (String) get(1); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JAttribute.ATTRIBUTE.ID; - } - - @Override - public Field field2() { - return JAttribute.ATTRIBUTE.NAME; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public JAttributeRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JAttributeRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JAttributeRecord values(Long value1, String value2) { - value1(value1); - value2(value2); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JAttributeRecord - */ - public JAttributeRecord() { - super(JAttribute.ATTRIBUTE); - } - - /** - * Create a detached, initialised JAttributeRecord - */ - public JAttributeRecord(Long id, String name) { - super(JAttribute.ATTRIBUTE); - - set(0, id); - set(1, name); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JAttributeRecord extends UpdatableRecordImpl implements + Record2 { + + private static final long serialVersionUID = -421000452; + + /** + * Create a detached JAttributeRecord + */ + public JAttributeRecord() { + super(JAttribute.ATTRIBUTE); + } + + /** + * Create a detached, initialised JAttributeRecord + */ + public JAttributeRecord(Long id, String name) { + super(JAttribute.ATTRIBUTE); + + set(0, id); + set(1, name); + } + + /** + * Getter for public.attribute.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.attribute.id. + */ + public void setId(Long value) { + set(0, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.attribute.name. + */ + public String getName() { + return (String) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.attribute.name. + */ + public void setName(String value) { + set(1, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JAttribute.ATTRIBUTE.ID; + } + + @Override + public Field field2() { + return JAttribute.ATTRIBUTE.NAME; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public JAttributeRecord value1(Long value) { + setId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JAttributeRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JAttributeRecord values(Long value1, String value2) { + value1(value1); + value2(value2); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersRecord.java index e165b6b84..592630198 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JClusters; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record5; @@ -25,240 +23,241 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JClustersRecord extends UpdatableRecordImpl implements Record5 { - - private static final long serialVersionUID = -1880325859; - - /** - * Setter for public.clusters.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.clusters.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.clusters.index_id. - */ - public void setIndexId(Long value) { - set(1, value); - } - - /** - * Getter for public.clusters.index_id. - */ - public Long getIndexId() { - return (Long) get(1); - } - - /** - * Setter for public.clusters.project_id. - */ - public void setProjectId(Long value) { - set(2, value); - } - - /** - * Getter for public.clusters.project_id. - */ - public Long getProjectId() { - return (Long) get(2); - } - - /** - * Setter for public.clusters.launch_id. - */ - public void setLaunchId(Long value) { - set(3, value); - } - - /** - * Getter for public.clusters.launch_id. - */ - public Long getLaunchId() { - return (Long) get(3); - } - - /** - * Setter for public.clusters.message. - */ - public void setMessage(String value) { - set(4, value); - } - - /** - * Getter for public.clusters.message. - */ - public String getMessage() { - return (String) get(4); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } - - @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); - } - - @Override - public Field field1() { - return JClusters.CLUSTERS.ID; - } - - @Override - public Field field2() { - return JClusters.CLUSTERS.INDEX_ID; - } - - @Override - public Field field3() { - return JClusters.CLUSTERS.PROJECT_ID; - } - - @Override - public Field field4() { - return JClusters.CLUSTERS.LAUNCH_ID; - } - - @Override - public Field field5() { - return JClusters.CLUSTERS.MESSAGE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getIndexId(); - } - - @Override - public Long component3() { - return getProjectId(); - } - - @Override - public Long component4() { - return getLaunchId(); - } - - @Override - public String component5() { - return getMessage(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getIndexId(); - } - - @Override - public Long value3() { - return getProjectId(); - } - - @Override - public Long value4() { - return getLaunchId(); - } - - @Override - public String value5() { - return getMessage(); - } - - @Override - public JClustersRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JClustersRecord value2(Long value) { - setIndexId(value); - return this; - } - - @Override - public JClustersRecord value3(Long value) { - setProjectId(value); - return this; - } - - @Override - public JClustersRecord value4(Long value) { - setLaunchId(value); - return this; - } - - @Override - public JClustersRecord value5(String value) { - setMessage(value); - return this; - } - - @Override - public JClustersRecord values(Long value1, Long value2, Long value3, Long value4, String value5) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JClustersRecord - */ - public JClustersRecord() { - super(JClusters.CLUSTERS); - } - - /** - * Create a detached, initialised JClustersRecord - */ - public JClustersRecord(Long id, Long indexId, Long projectId, Long launchId, String message) { - super(JClusters.CLUSTERS); - - set(0, id); - set(1, indexId); - set(2, projectId); - set(3, launchId); - set(4, message); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JClustersRecord extends UpdatableRecordImpl implements + Record5 { + + private static final long serialVersionUID = -1880325859; + + /** + * Create a detached JClustersRecord + */ + public JClustersRecord() { + super(JClusters.CLUSTERS); + } + + /** + * Create a detached, initialised JClustersRecord + */ + public JClustersRecord(Long id, Long indexId, Long projectId, Long launchId, String message) { + super(JClusters.CLUSTERS); + + set(0, id); + set(1, indexId); + set(2, projectId); + set(3, launchId); + set(4, message); + } + + /** + * Getter for public.clusters.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.clusters.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.clusters.index_id. + */ + public Long getIndexId() { + return (Long) get(1); + } + + /** + * Setter for public.clusters.index_id. + */ + public void setIndexId(Long value) { + set(1, value); + } + + /** + * Getter for public.clusters.project_id. + */ + public Long getProjectId() { + return (Long) get(2); + } + + /** + * Setter for public.clusters.project_id. + */ + public void setProjectId(Long value) { + set(2, value); + } + + /** + * Getter for public.clusters.launch_id. + */ + public Long getLaunchId() { + return (Long) get(3); + } + + /** + * Setter for public.clusters.launch_id. + */ + public void setLaunchId(Long value) { + set(3, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.clusters.message. + */ + public String getMessage() { + return (String) get(4); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.clusters.message. + */ + public void setMessage(String value) { + set(4, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return JClusters.CLUSTERS.ID; + } + + @Override + public Field field2() { + return JClusters.CLUSTERS.INDEX_ID; + } + + @Override + public Field field3() { + return JClusters.CLUSTERS.PROJECT_ID; + } + + @Override + public Field field4() { + return JClusters.CLUSTERS.LAUNCH_ID; + } + + @Override + public Field field5() { + return JClusters.CLUSTERS.MESSAGE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getIndexId(); + } + + @Override + public Long component3() { + return getProjectId(); + } + + @Override + public Long component4() { + return getLaunchId(); + } + + @Override + public String component5() { + return getMessage(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getIndexId(); + } + + @Override + public Long value3() { + return getProjectId(); + } + + @Override + public Long value4() { + return getLaunchId(); + } + + @Override + public String value5() { + return getMessage(); + } + + @Override + public JClustersRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JClustersRecord value2(Long value) { + setIndexId(value); + return this; + } + + @Override + public JClustersRecord value3(Long value) { + setProjectId(value); + return this; + } + + @Override + public JClustersRecord value4(Long value) { + setLaunchId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JClustersRecord value5(String value) { + setMessage(value); + return this; + } + + @Override + public JClustersRecord values(Long value1, Long value2, Long value3, Long value4, String value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersTestItemRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersTestItemRecord.java index c020b3db7..3c3b7abf8 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersTestItemRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersTestItemRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JClustersTestItem; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -24,120 +22,121 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JClustersTestItemRecord extends TableRecordImpl implements Record2 { - - private static final long serialVersionUID = -1142553978; - - /** - * Setter for public.clusters_test_item.cluster_id. - */ - public void setClusterId(Long value) { - set(0, value); - } - - /** - * Getter for public.clusters_test_item.cluster_id. - */ - public Long getClusterId() { - return (Long) get(0); - } - - /** - * Setter for public.clusters_test_item.item_id. - */ - public void setItemId(Long value) { - set(1, value); - } - - /** - * Getter for public.clusters_test_item.item_id. - */ - public Long getItemId() { - return (Long) get(1); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID; - } - - @Override - public Field field2() { - return JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID; - } - - @Override - public Long component1() { - return getClusterId(); - } - - @Override - public Long component2() { - return getItemId(); - } - - @Override - public Long value1() { - return getClusterId(); - } - - @Override - public Long value2() { - return getItemId(); - } - - @Override - public JClustersTestItemRecord value1(Long value) { - setClusterId(value); - return this; - } - - @Override - public JClustersTestItemRecord value2(Long value) { - setItemId(value); - return this; - } - - @Override - public JClustersTestItemRecord values(Long value1, Long value2) { - value1(value1); - value2(value2); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JClustersTestItemRecord - */ - public JClustersTestItemRecord() { - super(JClustersTestItem.CLUSTERS_TEST_ITEM); - } - - /** - * Create a detached, initialised JClustersTestItemRecord - */ - public JClustersTestItemRecord(Long clusterId, Long itemId) { - super(JClustersTestItem.CLUSTERS_TEST_ITEM); - - set(0, clusterId); - set(1, itemId); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JClustersTestItemRecord extends TableRecordImpl implements + Record2 { + + private static final long serialVersionUID = -1142553978; + + /** + * Create a detached JClustersTestItemRecord + */ + public JClustersTestItemRecord() { + super(JClustersTestItem.CLUSTERS_TEST_ITEM); + } + + /** + * Create a detached, initialised JClustersTestItemRecord + */ + public JClustersTestItemRecord(Long clusterId, Long itemId) { + super(JClustersTestItem.CLUSTERS_TEST_ITEM); + + set(0, clusterId); + set(1, itemId); + } + + /** + * Getter for public.clusters_test_item.cluster_id. + */ + public Long getClusterId() { + return (Long) get(0); + } + + /** + * Setter for public.clusters_test_item.cluster_id. + */ + public void setClusterId(Long value) { + set(0, value); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + /** + * Getter for public.clusters_test_item.item_id. + */ + public Long getItemId() { + return (Long) get(1); + } + + /** + * Setter for public.clusters_test_item.item_id. + */ + public void setItemId(Long value) { + set(1, value); + } + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID; + } + + @Override + public Field field2() { + return JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID; + } + + @Override + public Long component1() { + return getClusterId(); + } + + @Override + public Long component2() { + return getItemId(); + } + + @Override + public Long value1() { + return getClusterId(); + } + + @Override + public Long value2() { + return getItemId(); + } + + @Override + public JClustersTestItemRecord value1(Long value) { + setClusterId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JClustersTestItemRecord value2(Long value) { + setItemId(value); + return this; + } + + @Override + public JClustersTestItemRecord values(Long value1, Long value2) { + value1(value1); + value2(value2); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JContentFieldRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JContentFieldRecord.java index c9e701c30..6da181dc8 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JContentFieldRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JContentFieldRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JContentField; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -24,120 +22,121 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JContentFieldRecord extends TableRecordImpl implements Record2 { - - private static final long serialVersionUID = -1854921726; - - /** - * Setter for public.content_field.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.content_field.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.content_field.field. - */ - public void setField(String value) { - set(1, value); - } - - /** - * Getter for public.content_field.field. - */ - public String getField() { - return (String) get(1); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JContentField.CONTENT_FIELD.ID; - } - - @Override - public Field field2() { - return JContentField.CONTENT_FIELD.FIELD; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getField(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getField(); - } - - @Override - public JContentFieldRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JContentFieldRecord value2(String value) { - setField(value); - return this; - } - - @Override - public JContentFieldRecord values(Long value1, String value2) { - value1(value1); - value2(value2); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JContentFieldRecord - */ - public JContentFieldRecord() { - super(JContentField.CONTENT_FIELD); - } - - /** - * Create a detached, initialised JContentFieldRecord - */ - public JContentFieldRecord(Long id, String field) { - super(JContentField.CONTENT_FIELD); - - set(0, id); - set(1, field); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JContentFieldRecord extends TableRecordImpl implements + Record2 { + + private static final long serialVersionUID = -1854921726; + + /** + * Create a detached JContentFieldRecord + */ + public JContentFieldRecord() { + super(JContentField.CONTENT_FIELD); + } + + /** + * Create a detached, initialised JContentFieldRecord + */ + public JContentFieldRecord(Long id, String field) { + super(JContentField.CONTENT_FIELD); + + set(0, id); + set(1, field); + } + + /** + * Getter for public.content_field.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.content_field.id. + */ + public void setId(Long value) { + set(0, value); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + /** + * Getter for public.content_field.field. + */ + public String getField() { + return (String) get(1); + } + + /** + * Setter for public.content_field.field. + */ + public void setField(String value) { + set(1, value); + } + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JContentField.CONTENT_FIELD.ID; + } + + @Override + public Field field2() { + return JContentField.CONTENT_FIELD.FIELD; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getField(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getField(); + } + + @Override + public JContentFieldRecord value1(Long value) { + setId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JContentFieldRecord value2(String value) { + setField(value); + return this; + } + + @Override + public JContentFieldRecord values(Long value1, String value2) { + value1(value1); + value2(value2); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardRecord.java index 5311875e9..8351bbfd0 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardRecord.java @@ -5,11 +5,8 @@ import com.epam.ta.reportportal.jooq.tables.JDashboard; - import java.sql.Timestamp; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -27,203 +24,204 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JDashboardRecord extends UpdatableRecordImpl implements Record4 { - - private static final long serialVersionUID = -2017006257; - - /** - * Setter for public.dashboard.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.dashboard.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.dashboard.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.dashboard.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.dashboard.description. - */ - public void setDescription(String value) { - set(2, value); - } - - /** - * Getter for public.dashboard.description. - */ - public String getDescription() { - return (String) get(2); - } - - /** - * Setter for public.dashboard.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(3, value); - } - - /** - * Getter for public.dashboard.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(3); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JDashboard.DASHBOARD.ID; - } - - @Override - public Field field2() { - return JDashboard.DASHBOARD.NAME; - } - - @Override - public Field field3() { - return JDashboard.DASHBOARD.DESCRIPTION; - } - - @Override - public Field field4() { - return JDashboard.DASHBOARD.CREATION_DATE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public String component3() { - return getDescription(); - } - - @Override - public Timestamp component4() { - return getCreationDate(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public String value3() { - return getDescription(); - } - - @Override - public Timestamp value4() { - return getCreationDate(); - } - - @Override - public JDashboardRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JDashboardRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JDashboardRecord value3(String value) { - setDescription(value); - return this; - } - - @Override - public JDashboardRecord value4(Timestamp value) { - setCreationDate(value); - return this; - } - - @Override - public JDashboardRecord values(Long value1, String value2, String value3, Timestamp value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JDashboardRecord - */ - public JDashboardRecord() { - super(JDashboard.DASHBOARD); - } - - /** - * Create a detached, initialised JDashboardRecord - */ - public JDashboardRecord(Long id, String name, String description, Timestamp creationDate) { - super(JDashboard.DASHBOARD); - - set(0, id); - set(1, name); - set(2, description); - set(3, creationDate); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JDashboardRecord extends UpdatableRecordImpl implements + Record4 { + + private static final long serialVersionUID = -2017006257; + + /** + * Create a detached JDashboardRecord + */ + public JDashboardRecord() { + super(JDashboard.DASHBOARD); + } + + /** + * Create a detached, initialised JDashboardRecord + */ + public JDashboardRecord(Long id, String name, String description, Timestamp creationDate) { + super(JDashboard.DASHBOARD); + + set(0, id); + set(1, name); + set(2, description); + set(3, creationDate); + } + + /** + * Getter for public.dashboard.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.dashboard.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.dashboard.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.dashboard.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.dashboard.description. + */ + public String getDescription() { + return (String) get(2); + } + + /** + * Setter for public.dashboard.description. + */ + public void setDescription(String value) { + set(2, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.dashboard.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(3); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.dashboard.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(3, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JDashboard.DASHBOARD.ID; + } + + @Override + public Field field2() { + return JDashboard.DASHBOARD.NAME; + } + + @Override + public Field field3() { + return JDashboard.DASHBOARD.DESCRIPTION; + } + + @Override + public Field field4() { + return JDashboard.DASHBOARD.CREATION_DATE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public String component3() { + return getDescription(); + } + + @Override + public Timestamp component4() { + return getCreationDate(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public String value3() { + return getDescription(); + } + + @Override + public Timestamp value4() { + return getCreationDate(); + } + + @Override + public JDashboardRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JDashboardRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JDashboardRecord value3(String value) { + setDescription(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JDashboardRecord value4(Timestamp value) { + setCreationDate(value); + return this; + } + + @Override + public JDashboardRecord values(Long value1, String value2, String value3, Timestamp value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardWidgetRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardWidgetRecord.java index 6a39b7e92..9bc41e2a8 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardWidgetRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardWidgetRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JDashboardWidget; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record11; import org.jooq.Record2; @@ -25,462 +23,467 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JDashboardWidgetRecord extends UpdatableRecordImpl implements Record11 { - - private static final long serialVersionUID = -1630807143; - - /** - * Setter for public.dashboard_widget.dashboard_id. - */ - public void setDashboardId(Long value) { - set(0, value); - } - - /** - * Getter for public.dashboard_widget.dashboard_id. - */ - public Long getDashboardId() { - return (Long) get(0); - } - - /** - * Setter for public.dashboard_widget.widget_id. - */ - public void setWidgetId(Long value) { - set(1, value); - } - - /** - * Getter for public.dashboard_widget.widget_id. - */ - public Long getWidgetId() { - return (Long) get(1); - } - - /** - * Setter for public.dashboard_widget.widget_name. - */ - public void setWidgetName(String value) { - set(2, value); - } - - /** - * Getter for public.dashboard_widget.widget_name. - */ - public String getWidgetName() { - return (String) get(2); - } - - /** - * Setter for public.dashboard_widget.widget_owner. - */ - public void setWidgetOwner(String value) { - set(3, value); - } - - /** - * Getter for public.dashboard_widget.widget_owner. - */ - public String getWidgetOwner() { - return (String) get(3); - } - - /** - * Setter for public.dashboard_widget.widget_type. - */ - public void setWidgetType(String value) { - set(4, value); - } - - /** - * Getter for public.dashboard_widget.widget_type. - */ - public String getWidgetType() { - return (String) get(4); - } - - /** - * Setter for public.dashboard_widget.widget_width. - */ - public void setWidgetWidth(Integer value) { - set(5, value); - } - - /** - * Getter for public.dashboard_widget.widget_width. - */ - public Integer getWidgetWidth() { - return (Integer) get(5); - } - - /** - * Setter for public.dashboard_widget.widget_height. - */ - public void setWidgetHeight(Integer value) { - set(6, value); - } - - /** - * Getter for public.dashboard_widget.widget_height. - */ - public Integer getWidgetHeight() { - return (Integer) get(6); - } - - /** - * Setter for public.dashboard_widget.widget_position_x. - */ - public void setWidgetPositionX(Integer value) { - set(7, value); - } - - /** - * Getter for public.dashboard_widget.widget_position_x. - */ - public Integer getWidgetPositionX() { - return (Integer) get(7); - } - - /** - * Setter for public.dashboard_widget.widget_position_y. - */ - public void setWidgetPositionY(Integer value) { - set(8, value); - } - - /** - * Getter for public.dashboard_widget.widget_position_y. - */ - public Integer getWidgetPositionY() { - return (Integer) get(8); - } - - /** - * Setter for public.dashboard_widget.is_created_on. - */ - public void setIsCreatedOn(Boolean value) { - set(9, value); - } - - /** - * Getter for public.dashboard_widget.is_created_on. - */ - public Boolean getIsCreatedOn() { - return (Boolean) get(9); - } - - /** - * Setter for public.dashboard_widget.share. - */ - public void setShare(Boolean value) { - set(10, value); - } - - /** - * Getter for public.dashboard_widget.share. - */ - public Boolean getShare() { - return (Boolean) get(10); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record2 key() { - return (Record2) super.key(); - } - - // ------------------------------------------------------------------------- - // Record11 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); - } - - @Override - public Row11 valuesRow() { - return (Row11) super.valuesRow(); - } - - @Override - public Field field1() { - return JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID; - } - - @Override - public Field field2() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID; - } - - @Override - public Field field3() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_NAME; - } - - @Override - public Field field4() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_OWNER; - } - - @Override - public Field field5() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_TYPE; - } - - @Override - public Field field6() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_WIDTH; - } - - @Override - public Field field7() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_HEIGHT; - } - - @Override - public Field field8() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_POSITION_X; - } - - @Override - public Field field9() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_POSITION_Y; - } - - @Override - public Field field10() { - return JDashboardWidget.DASHBOARD_WIDGET.IS_CREATED_ON; - } - - @Override - public Field field11() { - return JDashboardWidget.DASHBOARD_WIDGET.SHARE; - } - - @Override - public Long component1() { - return getDashboardId(); - } - - @Override - public Long component2() { - return getWidgetId(); - } - - @Override - public String component3() { - return getWidgetName(); - } - - @Override - public String component4() { - return getWidgetOwner(); - } - - @Override - public String component5() { - return getWidgetType(); - } - - @Override - public Integer component6() { - return getWidgetWidth(); - } - - @Override - public Integer component7() { - return getWidgetHeight(); - } - - @Override - public Integer component8() { - return getWidgetPositionX(); - } - - @Override - public Integer component9() { - return getWidgetPositionY(); - } - - @Override - public Boolean component10() { - return getIsCreatedOn(); - } - - @Override - public Boolean component11() { - return getShare(); - } - - @Override - public Long value1() { - return getDashboardId(); - } - - @Override - public Long value2() { - return getWidgetId(); - } - - @Override - public String value3() { - return getWidgetName(); - } - - @Override - public String value4() { - return getWidgetOwner(); - } - - @Override - public String value5() { - return getWidgetType(); - } - - @Override - public Integer value6() { - return getWidgetWidth(); - } - - @Override - public Integer value7() { - return getWidgetHeight(); - } - - @Override - public Integer value8() { - return getWidgetPositionX(); - } - - @Override - public Integer value9() { - return getWidgetPositionY(); - } - - @Override - public Boolean value10() { - return getIsCreatedOn(); - } - - @Override - public Boolean value11() { - return getShare(); - } - - @Override - public JDashboardWidgetRecord value1(Long value) { - setDashboardId(value); - return this; - } - - @Override - public JDashboardWidgetRecord value2(Long value) { - setWidgetId(value); - return this; - } - - @Override - public JDashboardWidgetRecord value3(String value) { - setWidgetName(value); - return this; - } - - @Override - public JDashboardWidgetRecord value4(String value) { - setWidgetOwner(value); - return this; - } - - @Override - public JDashboardWidgetRecord value5(String value) { - setWidgetType(value); - return this; - } - - @Override - public JDashboardWidgetRecord value6(Integer value) { - setWidgetWidth(value); - return this; - } - - @Override - public JDashboardWidgetRecord value7(Integer value) { - setWidgetHeight(value); - return this; - } - - @Override - public JDashboardWidgetRecord value8(Integer value) { - setWidgetPositionX(value); - return this; - } - - @Override - public JDashboardWidgetRecord value9(Integer value) { - setWidgetPositionY(value); - return this; - } - - @Override - public JDashboardWidgetRecord value10(Boolean value) { - setIsCreatedOn(value); - return this; - } - - @Override - public JDashboardWidgetRecord value11(Boolean value) { - setShare(value); - return this; - } - - @Override - public JDashboardWidgetRecord values(Long value1, Long value2, String value3, String value4, String value5, Integer value6, Integer value7, Integer value8, Integer value9, Boolean value10, Boolean value11) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JDashboardWidgetRecord - */ - public JDashboardWidgetRecord() { - super(JDashboardWidget.DASHBOARD_WIDGET); - } - - /** - * Create a detached, initialised JDashboardWidgetRecord - */ - public JDashboardWidgetRecord(Long dashboardId, Long widgetId, String widgetName, String widgetOwner, String widgetType, Integer widgetWidth, Integer widgetHeight, Integer widgetPositionX, Integer widgetPositionY, Boolean isCreatedOn, Boolean share) { - super(JDashboardWidget.DASHBOARD_WIDGET); - - set(0, dashboardId); - set(1, widgetId); - set(2, widgetName); - set(3, widgetOwner); - set(4, widgetType); - set(5, widgetWidth); - set(6, widgetHeight); - set(7, widgetPositionX); - set(8, widgetPositionY); - set(9, isCreatedOn); - set(10, share); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JDashboardWidgetRecord extends UpdatableRecordImpl implements + Record11 { + + private static final long serialVersionUID = -1630807143; + + /** + * Create a detached JDashboardWidgetRecord + */ + public JDashboardWidgetRecord() { + super(JDashboardWidget.DASHBOARD_WIDGET); + } + + /** + * Create a detached, initialised JDashboardWidgetRecord + */ + public JDashboardWidgetRecord(Long dashboardId, Long widgetId, String widgetName, + String widgetOwner, String widgetType, Integer widgetWidth, Integer widgetHeight, + Integer widgetPositionX, Integer widgetPositionY, Boolean isCreatedOn, Boolean share) { + super(JDashboardWidget.DASHBOARD_WIDGET); + + set(0, dashboardId); + set(1, widgetId); + set(2, widgetName); + set(3, widgetOwner); + set(4, widgetType); + set(5, widgetWidth); + set(6, widgetHeight); + set(7, widgetPositionX); + set(8, widgetPositionY); + set(9, isCreatedOn); + set(10, share); + } + + /** + * Getter for public.dashboard_widget.dashboard_id. + */ + public Long getDashboardId() { + return (Long) get(0); + } + + /** + * Setter for public.dashboard_widget.dashboard_id. + */ + public void setDashboardId(Long value) { + set(0, value); + } + + /** + * Getter for public.dashboard_widget.widget_id. + */ + public Long getWidgetId() { + return (Long) get(1); + } + + /** + * Setter for public.dashboard_widget.widget_id. + */ + public void setWidgetId(Long value) { + set(1, value); + } + + /** + * Getter for public.dashboard_widget.widget_name. + */ + public String getWidgetName() { + return (String) get(2); + } + + /** + * Setter for public.dashboard_widget.widget_name. + */ + public void setWidgetName(String value) { + set(2, value); + } + + /** + * Getter for public.dashboard_widget.widget_owner. + */ + public String getWidgetOwner() { + return (String) get(3); + } + + /** + * Setter for public.dashboard_widget.widget_owner. + */ + public void setWidgetOwner(String value) { + set(3, value); + } + + /** + * Getter for public.dashboard_widget.widget_type. + */ + public String getWidgetType() { + return (String) get(4); + } + + /** + * Setter for public.dashboard_widget.widget_type. + */ + public void setWidgetType(String value) { + set(4, value); + } + + /** + * Getter for public.dashboard_widget.widget_width. + */ + public Integer getWidgetWidth() { + return (Integer) get(5); + } + + /** + * Setter for public.dashboard_widget.widget_width. + */ + public void setWidgetWidth(Integer value) { + set(5, value); + } + + /** + * Getter for public.dashboard_widget.widget_height. + */ + public Integer getWidgetHeight() { + return (Integer) get(6); + } + + /** + * Setter for public.dashboard_widget.widget_height. + */ + public void setWidgetHeight(Integer value) { + set(6, value); + } + + /** + * Getter for public.dashboard_widget.widget_position_x. + */ + public Integer getWidgetPositionX() { + return (Integer) get(7); + } + + /** + * Setter for public.dashboard_widget.widget_position_x. + */ + public void setWidgetPositionX(Integer value) { + set(7, value); + } + + /** + * Getter for public.dashboard_widget.widget_position_y. + */ + public Integer getWidgetPositionY() { + return (Integer) get(8); + } + + /** + * Setter for public.dashboard_widget.widget_position_y. + */ + public void setWidgetPositionY(Integer value) { + set(8, value); + } + + /** + * Getter for public.dashboard_widget.is_created_on. + */ + public Boolean getIsCreatedOn() { + return (Boolean) get(9); + } + + /** + * Setter for public.dashboard_widget.is_created_on. + */ + public void setIsCreatedOn(Boolean value) { + set(9, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.dashboard_widget.share. + */ + public Boolean getShare() { + return (Boolean) get(10); + } + + // ------------------------------------------------------------------------- + // Record11 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.dashboard_widget.share. + */ + public void setShare(Boolean value) { + set(10, value); + } + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } + + @Override + public Row11 valuesRow() { + return (Row11) super.valuesRow(); + } + + @Override + public Field field1() { + return JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID; + } + + @Override + public Field field2() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID; + } + + @Override + public Field field3() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_NAME; + } + + @Override + public Field field4() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_OWNER; + } + + @Override + public Field field5() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_TYPE; + } + + @Override + public Field field6() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_WIDTH; + } + + @Override + public Field field7() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_HEIGHT; + } + + @Override + public Field field8() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_POSITION_X; + } + + @Override + public Field field9() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_POSITION_Y; + } + + @Override + public Field field10() { + return JDashboardWidget.DASHBOARD_WIDGET.IS_CREATED_ON; + } + + @Override + public Field field11() { + return JDashboardWidget.DASHBOARD_WIDGET.SHARE; + } + + @Override + public Long component1() { + return getDashboardId(); + } + + @Override + public Long component2() { + return getWidgetId(); + } + + @Override + public String component3() { + return getWidgetName(); + } + + @Override + public String component4() { + return getWidgetOwner(); + } + + @Override + public String component5() { + return getWidgetType(); + } + + @Override + public Integer component6() { + return getWidgetWidth(); + } + + @Override + public Integer component7() { + return getWidgetHeight(); + } + + @Override + public Integer component8() { + return getWidgetPositionX(); + } + + @Override + public Integer component9() { + return getWidgetPositionY(); + } + + @Override + public Boolean component10() { + return getIsCreatedOn(); + } + + @Override + public Boolean component11() { + return getShare(); + } + + @Override + public Long value1() { + return getDashboardId(); + } + + @Override + public Long value2() { + return getWidgetId(); + } + + @Override + public String value3() { + return getWidgetName(); + } + + @Override + public String value4() { + return getWidgetOwner(); + } + + @Override + public String value5() { + return getWidgetType(); + } + + @Override + public Integer value6() { + return getWidgetWidth(); + } + + @Override + public Integer value7() { + return getWidgetHeight(); + } + + @Override + public Integer value8() { + return getWidgetPositionX(); + } + + @Override + public Integer value9() { + return getWidgetPositionY(); + } + + @Override + public Boolean value10() { + return getIsCreatedOn(); + } + + @Override + public Boolean value11() { + return getShare(); + } + + @Override + public JDashboardWidgetRecord value1(Long value) { + setDashboardId(value); + return this; + } + + @Override + public JDashboardWidgetRecord value2(Long value) { + setWidgetId(value); + return this; + } + + @Override + public JDashboardWidgetRecord value3(String value) { + setWidgetName(value); + return this; + } + + @Override + public JDashboardWidgetRecord value4(String value) { + setWidgetOwner(value); + return this; + } + + @Override + public JDashboardWidgetRecord value5(String value) { + setWidgetType(value); + return this; + } + + @Override + public JDashboardWidgetRecord value6(Integer value) { + setWidgetWidth(value); + return this; + } + + @Override + public JDashboardWidgetRecord value7(Integer value) { + setWidgetHeight(value); + return this; + } + + @Override + public JDashboardWidgetRecord value8(Integer value) { + setWidgetPositionX(value); + return this; + } + + @Override + public JDashboardWidgetRecord value9(Integer value) { + setWidgetPositionY(value); + return this; + } + + @Override + public JDashboardWidgetRecord value10(Boolean value) { + setIsCreatedOn(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JDashboardWidgetRecord value11(Boolean value) { + setShare(value); + return this; + } + + @Override + public JDashboardWidgetRecord values(Long value1, Long value2, String value3, String value4, + String value5, Integer value6, Integer value7, Integer value8, Integer value9, + Boolean value10, Boolean value11) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterConditionRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterConditionRecord.java index 30d7abac7..a59178517 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterConditionRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterConditionRecord.java @@ -6,9 +6,7 @@ import com.epam.ta.reportportal.jooq.enums.JFilterConditionEnum; import com.epam.ta.reportportal.jooq.tables.JFilterCondition; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record6; @@ -26,277 +24,280 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JFilterConditionRecord extends UpdatableRecordImpl implements Record6 { - - private static final long serialVersionUID = 1436060418; - - /** - * Setter for public.filter_condition.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.filter_condition.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.filter_condition.filter_id. - */ - public void setFilterId(Long value) { - set(1, value); - } - - /** - * Getter for public.filter_condition.filter_id. - */ - public Long getFilterId() { - return (Long) get(1); - } - - /** - * Setter for public.filter_condition.condition. - */ - public void setCondition(JFilterConditionEnum value) { - set(2, value); - } - - /** - * Getter for public.filter_condition.condition. - */ - public JFilterConditionEnum getCondition() { - return (JFilterConditionEnum) get(2); - } - - /** - * Setter for public.filter_condition.value. - */ - public void setValue(String value) { - set(3, value); - } - - /** - * Getter for public.filter_condition.value. - */ - public String getValue() { - return (String) get(3); - } - - /** - * Setter for public.filter_condition.search_criteria. - */ - public void setSearchCriteria(String value) { - set(4, value); - } - - /** - * Getter for public.filter_condition.search_criteria. - */ - public String getSearchCriteria() { - return (String) get(4); - } - - /** - * Setter for public.filter_condition.negative. - */ - public void setNegative(Boolean value) { - set(5, value); - } - - /** - * Getter for public.filter_condition.negative. - */ - public Boolean getNegative() { - return (Boolean) get(5); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return JFilterCondition.FILTER_CONDITION.ID; - } - - @Override - public Field field2() { - return JFilterCondition.FILTER_CONDITION.FILTER_ID; - } - - @Override - public Field field3() { - return JFilterCondition.FILTER_CONDITION.CONDITION; - } - - @Override - public Field field4() { - return JFilterCondition.FILTER_CONDITION.VALUE; - } - - @Override - public Field field5() { - return JFilterCondition.FILTER_CONDITION.SEARCH_CRITERIA; - } - - @Override - public Field field6() { - return JFilterCondition.FILTER_CONDITION.NEGATIVE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getFilterId(); - } - - @Override - public JFilterConditionEnum component3() { - return getCondition(); - } - - @Override - public String component4() { - return getValue(); - } - - @Override - public String component5() { - return getSearchCriteria(); - } - - @Override - public Boolean component6() { - return getNegative(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getFilterId(); - } - - @Override - public JFilterConditionEnum value3() { - return getCondition(); - } - - @Override - public String value4() { - return getValue(); - } - - @Override - public String value5() { - return getSearchCriteria(); - } - - @Override - public Boolean value6() { - return getNegative(); - } - - @Override - public JFilterConditionRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JFilterConditionRecord value2(Long value) { - setFilterId(value); - return this; - } - - @Override - public JFilterConditionRecord value3(JFilterConditionEnum value) { - setCondition(value); - return this; - } - - @Override - public JFilterConditionRecord value4(String value) { - setValue(value); - return this; - } - - @Override - public JFilterConditionRecord value5(String value) { - setSearchCriteria(value); - return this; - } - - @Override - public JFilterConditionRecord value6(Boolean value) { - setNegative(value); - return this; - } - - @Override - public JFilterConditionRecord values(Long value1, Long value2, JFilterConditionEnum value3, String value4, String value5, Boolean value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JFilterConditionRecord - */ - public JFilterConditionRecord() { - super(JFilterCondition.FILTER_CONDITION); - } - - /** - * Create a detached, initialised JFilterConditionRecord - */ - public JFilterConditionRecord(Long id, Long filterId, JFilterConditionEnum condition, String value, String searchCriteria, Boolean negative) { - super(JFilterCondition.FILTER_CONDITION); - - set(0, id); - set(1, filterId); - set(2, condition); - set(3, value); - set(4, searchCriteria); - set(5, negative); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JFilterConditionRecord extends UpdatableRecordImpl implements + Record6 { + + private static final long serialVersionUID = 1436060418; + + /** + * Create a detached JFilterConditionRecord + */ + public JFilterConditionRecord() { + super(JFilterCondition.FILTER_CONDITION); + } + + /** + * Create a detached, initialised JFilterConditionRecord + */ + public JFilterConditionRecord(Long id, Long filterId, JFilterConditionEnum condition, + String value, String searchCriteria, Boolean negative) { + super(JFilterCondition.FILTER_CONDITION); + + set(0, id); + set(1, filterId); + set(2, condition); + set(3, value); + set(4, searchCriteria); + set(5, negative); + } + + /** + * Getter for public.filter_condition.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.filter_condition.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.filter_condition.filter_id. + */ + public Long getFilterId() { + return (Long) get(1); + } + + /** + * Setter for public.filter_condition.filter_id. + */ + public void setFilterId(Long value) { + set(1, value); + } + + /** + * Getter for public.filter_condition.condition. + */ + public JFilterConditionEnum getCondition() { + return (JFilterConditionEnum) get(2); + } + + /** + * Setter for public.filter_condition.condition. + */ + public void setCondition(JFilterConditionEnum value) { + set(2, value); + } + + /** + * Getter for public.filter_condition.value. + */ + public String getValue() { + return (String) get(3); + } + + /** + * Setter for public.filter_condition.value. + */ + public void setValue(String value) { + set(3, value); + } + + /** + * Getter for public.filter_condition.search_criteria. + */ + public String getSearchCriteria() { + return (String) get(4); + } + + /** + * Setter for public.filter_condition.search_criteria. + */ + public void setSearchCriteria(String value) { + set(4, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.filter_condition.negative. + */ + public Boolean getNegative() { + return (Boolean) get(5); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.filter_condition.negative. + */ + public void setNegative(Boolean value) { + set(5, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return JFilterCondition.FILTER_CONDITION.ID; + } + + @Override + public Field field2() { + return JFilterCondition.FILTER_CONDITION.FILTER_ID; + } + + @Override + public Field field3() { + return JFilterCondition.FILTER_CONDITION.CONDITION; + } + + @Override + public Field field4() { + return JFilterCondition.FILTER_CONDITION.VALUE; + } + + @Override + public Field field5() { + return JFilterCondition.FILTER_CONDITION.SEARCH_CRITERIA; + } + + @Override + public Field field6() { + return JFilterCondition.FILTER_CONDITION.NEGATIVE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getFilterId(); + } + + @Override + public JFilterConditionEnum component3() { + return getCondition(); + } + + @Override + public String component4() { + return getValue(); + } + + @Override + public String component5() { + return getSearchCriteria(); + } + + @Override + public Boolean component6() { + return getNegative(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getFilterId(); + } + + @Override + public JFilterConditionEnum value3() { + return getCondition(); + } + + @Override + public String value4() { + return getValue(); + } + + @Override + public String value5() { + return getSearchCriteria(); + } + + @Override + public Boolean value6() { + return getNegative(); + } + + @Override + public JFilterConditionRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JFilterConditionRecord value2(Long value) { + setFilterId(value); + return this; + } + + @Override + public JFilterConditionRecord value3(JFilterConditionEnum value) { + setCondition(value); + return this; + } + + @Override + public JFilterConditionRecord value4(String value) { + setValue(value); + return this; + } + + @Override + public JFilterConditionRecord value5(String value) { + setSearchCriteria(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JFilterConditionRecord value6(Boolean value) { + setNegative(value); + return this; + } + + @Override + public JFilterConditionRecord values(Long value1, Long value2, JFilterConditionEnum value3, + String value4, String value5, Boolean value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterRecord.java index d3d5052f7..561d292c4 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JFilter; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -25,203 +23,204 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JFilterRecord extends UpdatableRecordImpl implements Record4 { - - private static final long serialVersionUID = -1042860928; - - /** - * Setter for public.filter.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.filter.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.filter.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.filter.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.filter.target. - */ - public void setTarget(String value) { - set(2, value); - } - - /** - * Getter for public.filter.target. - */ - public String getTarget() { - return (String) get(2); - } - - /** - * Setter for public.filter.description. - */ - public void setDescription(String value) { - set(3, value); - } - - /** - * Getter for public.filter.description. - */ - public String getDescription() { - return (String) get(3); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JFilter.FILTER.ID; - } - - @Override - public Field field2() { - return JFilter.FILTER.NAME; - } - - @Override - public Field field3() { - return JFilter.FILTER.TARGET; - } - - @Override - public Field field4() { - return JFilter.FILTER.DESCRIPTION; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public String component3() { - return getTarget(); - } - - @Override - public String component4() { - return getDescription(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public String value3() { - return getTarget(); - } - - @Override - public String value4() { - return getDescription(); - } - - @Override - public JFilterRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JFilterRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JFilterRecord value3(String value) { - setTarget(value); - return this; - } - - @Override - public JFilterRecord value4(String value) { - setDescription(value); - return this; - } - - @Override - public JFilterRecord values(Long value1, String value2, String value3, String value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JFilterRecord - */ - public JFilterRecord() { - super(JFilter.FILTER); - } - - /** - * Create a detached, initialised JFilterRecord - */ - public JFilterRecord(Long id, String name, String target, String description) { - super(JFilter.FILTER); - - set(0, id); - set(1, name); - set(2, target); - set(3, description); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JFilterRecord extends UpdatableRecordImpl implements + Record4 { + + private static final long serialVersionUID = -1042860928; + + /** + * Create a detached JFilterRecord + */ + public JFilterRecord() { + super(JFilter.FILTER); + } + + /** + * Create a detached, initialised JFilterRecord + */ + public JFilterRecord(Long id, String name, String target, String description) { + super(JFilter.FILTER); + + set(0, id); + set(1, name); + set(2, target); + set(3, description); + } + + /** + * Getter for public.filter.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.filter.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.filter.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.filter.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.filter.target. + */ + public String getTarget() { + return (String) get(2); + } + + /** + * Setter for public.filter.target. + */ + public void setTarget(String value) { + set(2, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.filter.description. + */ + public String getDescription() { + return (String) get(3); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.filter.description. + */ + public void setDescription(String value) { + set(3, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JFilter.FILTER.ID; + } + + @Override + public Field field2() { + return JFilter.FILTER.NAME; + } + + @Override + public Field field3() { + return JFilter.FILTER.TARGET; + } + + @Override + public Field field4() { + return JFilter.FILTER.DESCRIPTION; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public String component3() { + return getTarget(); + } + + @Override + public String component4() { + return getDescription(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public String value3() { + return getTarget(); + } + + @Override + public String value4() { + return getDescription(); + } + + @Override + public JFilterRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JFilterRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JFilterRecord value3(String value) { + setTarget(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JFilterRecord value4(String value) { + setDescription(value); + return this; + } + + @Override + public JFilterRecord values(Long value1, String value2, String value3, String value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterSortRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterSortRecord.java index 362d482a7..942b8b914 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterSortRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterSortRecord.java @@ -6,9 +6,7 @@ import com.epam.ta.reportportal.jooq.enums.JSortDirectionEnum; import com.epam.ta.reportportal.jooq.tables.JFilterSort; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -26,203 +24,205 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JFilterSortRecord extends UpdatableRecordImpl implements Record4 { - - private static final long serialVersionUID = -758871639; - - /** - * Setter for public.filter_sort.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.filter_sort.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.filter_sort.filter_id. - */ - public void setFilterId(Long value) { - set(1, value); - } - - /** - * Getter for public.filter_sort.filter_id. - */ - public Long getFilterId() { - return (Long) get(1); - } - - /** - * Setter for public.filter_sort.field. - */ - public void setField(String value) { - set(2, value); - } - - /** - * Getter for public.filter_sort.field. - */ - public String getField() { - return (String) get(2); - } - - /** - * Setter for public.filter_sort.direction. - */ - public void setDirection(JSortDirectionEnum value) { - set(3, value); - } - - /** - * Getter for public.filter_sort.direction. - */ - public JSortDirectionEnum getDirection() { - return (JSortDirectionEnum) get(3); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JFilterSort.FILTER_SORT.ID; - } - - @Override - public Field field2() { - return JFilterSort.FILTER_SORT.FILTER_ID; - } - - @Override - public Field field3() { - return JFilterSort.FILTER_SORT.FIELD; - } - - @Override - public Field field4() { - return JFilterSort.FILTER_SORT.DIRECTION; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getFilterId(); - } - - @Override - public String component3() { - return getField(); - } - - @Override - public JSortDirectionEnum component4() { - return getDirection(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getFilterId(); - } - - @Override - public String value3() { - return getField(); - } - - @Override - public JSortDirectionEnum value4() { - return getDirection(); - } - - @Override - public JFilterSortRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JFilterSortRecord value2(Long value) { - setFilterId(value); - return this; - } - - @Override - public JFilterSortRecord value3(String value) { - setField(value); - return this; - } - - @Override - public JFilterSortRecord value4(JSortDirectionEnum value) { - setDirection(value); - return this; - } - - @Override - public JFilterSortRecord values(Long value1, Long value2, String value3, JSortDirectionEnum value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JFilterSortRecord - */ - public JFilterSortRecord() { - super(JFilterSort.FILTER_SORT); - } - - /** - * Create a detached, initialised JFilterSortRecord - */ - public JFilterSortRecord(Long id, Long filterId, String field, JSortDirectionEnum direction) { - super(JFilterSort.FILTER_SORT); - - set(0, id); - set(1, filterId); - set(2, field); - set(3, direction); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JFilterSortRecord extends UpdatableRecordImpl implements + Record4 { + + private static final long serialVersionUID = -758871639; + + /** + * Create a detached JFilterSortRecord + */ + public JFilterSortRecord() { + super(JFilterSort.FILTER_SORT); + } + + /** + * Create a detached, initialised JFilterSortRecord + */ + public JFilterSortRecord(Long id, Long filterId, String field, JSortDirectionEnum direction) { + super(JFilterSort.FILTER_SORT); + + set(0, id); + set(1, filterId); + set(2, field); + set(3, direction); + } + + /** + * Getter for public.filter_sort.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.filter_sort.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.filter_sort.filter_id. + */ + public Long getFilterId() { + return (Long) get(1); + } + + /** + * Setter for public.filter_sort.filter_id. + */ + public void setFilterId(Long value) { + set(1, value); + } + + /** + * Getter for public.filter_sort.field. + */ + public String getField() { + return (String) get(2); + } + + /** + * Setter for public.filter_sort.field. + */ + public void setField(String value) { + set(2, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.filter_sort.direction. + */ + public JSortDirectionEnum getDirection() { + return (JSortDirectionEnum) get(3); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.filter_sort.direction. + */ + public void setDirection(JSortDirectionEnum value) { + set(3, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JFilterSort.FILTER_SORT.ID; + } + + @Override + public Field field2() { + return JFilterSort.FILTER_SORT.FILTER_ID; + } + + @Override + public Field field3() { + return JFilterSort.FILTER_SORT.FIELD; + } + + @Override + public Field field4() { + return JFilterSort.FILTER_SORT.DIRECTION; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getFilterId(); + } + + @Override + public String component3() { + return getField(); + } + + @Override + public JSortDirectionEnum component4() { + return getDirection(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getFilterId(); + } + + @Override + public String value3() { + return getField(); + } + + @Override + public JSortDirectionEnum value4() { + return getDirection(); + } + + @Override + public JFilterSortRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JFilterSortRecord value2(Long value) { + setFilterId(value); + return this; + } + + @Override + public JFilterSortRecord value3(String value) { + setField(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JFilterSortRecord value4(JSortDirectionEnum value) { + setDirection(value); + return this; + } + + @Override + public JFilterSortRecord values(Long value1, Long value2, String value3, + JSortDirectionEnum value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationRecord.java index 636128fa1..92486873d 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationRecord.java @@ -5,11 +5,8 @@ import com.epam.ta.reportportal.jooq.tables.JIntegration; - import java.sql.Timestamp; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.JSONB; import org.jooq.Record1; @@ -28,351 +25,354 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JIntegrationRecord extends UpdatableRecordImpl implements Record8 { - - private static final long serialVersionUID = 760916157; - - /** - * Setter for public.integration.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for public.integration.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for public.integration.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.integration.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.integration.project_id. - */ - public void setProjectId(Long value) { - set(2, value); - } - - /** - * Getter for public.integration.project_id. - */ - public Long getProjectId() { - return (Long) get(2); - } - - /** - * Setter for public.integration.type. - */ - public void setType(Integer value) { - set(3, value); - } - - /** - * Getter for public.integration.type. - */ - public Integer getType() { - return (Integer) get(3); - } - - /** - * Setter for public.integration.enabled. - */ - public void setEnabled(Boolean value) { - set(4, value); - } - - /** - * Getter for public.integration.enabled. - */ - public Boolean getEnabled() { - return (Boolean) get(4); - } - - /** - * Setter for public.integration.params. - */ - public void setParams(JSONB value) { - set(5, value); - } - - /** - * Getter for public.integration.params. - */ - public JSONB getParams() { - return (JSONB) get(5); - } - - /** - * Setter for public.integration.creator. - */ - public void setCreator(String value) { - set(6, value); - } - - /** - * Getter for public.integration.creator. - */ - public String getCreator() { - return (String) get(6); - } - - /** - * Setter for public.integration.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(7, value); - } - - /** - * Getter for public.integration.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(7); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - @Override - public Field field1() { - return JIntegration.INTEGRATION.ID; - } - - @Override - public Field field2() { - return JIntegration.INTEGRATION.NAME; - } - - @Override - public Field field3() { - return JIntegration.INTEGRATION.PROJECT_ID; - } - - @Override - public Field field4() { - return JIntegration.INTEGRATION.TYPE; - } - - @Override - public Field field5() { - return JIntegration.INTEGRATION.ENABLED; - } - - @Override - public Field field6() { - return JIntegration.INTEGRATION.PARAMS; - } - - @Override - public Field field7() { - return JIntegration.INTEGRATION.CREATOR; - } - - @Override - public Field field8() { - return JIntegration.INTEGRATION.CREATION_DATE; - } - - @Override - public Integer component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public Long component3() { - return getProjectId(); - } - - @Override - public Integer component4() { - return getType(); - } - - @Override - public Boolean component5() { - return getEnabled(); - } - - @Override - public JSONB component6() { - return getParams(); - } - - @Override - public String component7() { - return getCreator(); - } - - @Override - public Timestamp component8() { - return getCreationDate(); - } - - @Override - public Integer value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public Long value3() { - return getProjectId(); - } - - @Override - public Integer value4() { - return getType(); - } - - @Override - public Boolean value5() { - return getEnabled(); - } - - @Override - public JSONB value6() { - return getParams(); - } - - @Override - public String value7() { - return getCreator(); - } - - @Override - public Timestamp value8() { - return getCreationDate(); - } - - @Override - public JIntegrationRecord value1(Integer value) { - setId(value); - return this; - } - - @Override - public JIntegrationRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JIntegrationRecord value3(Long value) { - setProjectId(value); - return this; - } - - @Override - public JIntegrationRecord value4(Integer value) { - setType(value); - return this; - } - - @Override - public JIntegrationRecord value5(Boolean value) { - setEnabled(value); - return this; - } - - @Override - public JIntegrationRecord value6(JSONB value) { - setParams(value); - return this; - } - - @Override - public JIntegrationRecord value7(String value) { - setCreator(value); - return this; - } - - @Override - public JIntegrationRecord value8(Timestamp value) { - setCreationDate(value); - return this; - } - - @Override - public JIntegrationRecord values(Integer value1, String value2, Long value3, Integer value4, Boolean value5, JSONB value6, String value7, Timestamp value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JIntegrationRecord - */ - public JIntegrationRecord() { - super(JIntegration.INTEGRATION); - } - - /** - * Create a detached, initialised JIntegrationRecord - */ - public JIntegrationRecord(Integer id, String name, Long projectId, Integer type, Boolean enabled, JSONB params, String creator, Timestamp creationDate) { - super(JIntegration.INTEGRATION); - - set(0, id); - set(1, name); - set(2, projectId); - set(3, type); - set(4, enabled); - set(5, params); - set(6, creator); - set(7, creationDate); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JIntegrationRecord extends UpdatableRecordImpl implements + Record8 { + + private static final long serialVersionUID = 760916157; + + /** + * Create a detached JIntegrationRecord + */ + public JIntegrationRecord() { + super(JIntegration.INTEGRATION); + } + + /** + * Create a detached, initialised JIntegrationRecord + */ + public JIntegrationRecord(Integer id, String name, Long projectId, Integer type, Boolean enabled, + JSONB params, String creator, Timestamp creationDate) { + super(JIntegration.INTEGRATION); + + set(0, id); + set(1, name); + set(2, projectId); + set(3, type); + set(4, enabled); + set(5, params); + set(6, creator); + set(7, creationDate); + } + + /** + * Getter for public.integration.id. + */ + public Integer getId() { + return (Integer) get(0); + } + + /** + * Setter for public.integration.id. + */ + public void setId(Integer value) { + set(0, value); + } + + /** + * Getter for public.integration.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.integration.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.integration.project_id. + */ + public Long getProjectId() { + return (Long) get(2); + } + + /** + * Setter for public.integration.project_id. + */ + public void setProjectId(Long value) { + set(2, value); + } + + /** + * Getter for public.integration.type. + */ + public Integer getType() { + return (Integer) get(3); + } + + /** + * Setter for public.integration.type. + */ + public void setType(Integer value) { + set(3, value); + } + + /** + * Getter for public.integration.enabled. + */ + public Boolean getEnabled() { + return (Boolean) get(4); + } + + /** + * Setter for public.integration.enabled. + */ + public void setEnabled(Boolean value) { + set(4, value); + } + + /** + * Getter for public.integration.params. + */ + public JSONB getParams() { + return (JSONB) get(5); + } + + /** + * Setter for public.integration.params. + */ + public void setParams(JSONB value) { + set(5, value); + } + + /** + * Getter for public.integration.creator. + */ + public String getCreator() { + return (String) get(6); + } + + /** + * Setter for public.integration.creator. + */ + public void setCreator(String value) { + set(6, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.integration.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(7); + } + + // ------------------------------------------------------------------------- + // Record8 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.integration.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(7, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } + + @Override + public Row8 valuesRow() { + return (Row8) super.valuesRow(); + } + + @Override + public Field field1() { + return JIntegration.INTEGRATION.ID; + } + + @Override + public Field field2() { + return JIntegration.INTEGRATION.NAME; + } + + @Override + public Field field3() { + return JIntegration.INTEGRATION.PROJECT_ID; + } + + @Override + public Field field4() { + return JIntegration.INTEGRATION.TYPE; + } + + @Override + public Field field5() { + return JIntegration.INTEGRATION.ENABLED; + } + + @Override + public Field field6() { + return JIntegration.INTEGRATION.PARAMS; + } + + @Override + public Field field7() { + return JIntegration.INTEGRATION.CREATOR; + } + + @Override + public Field field8() { + return JIntegration.INTEGRATION.CREATION_DATE; + } + + @Override + public Integer component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public Long component3() { + return getProjectId(); + } + + @Override + public Integer component4() { + return getType(); + } + + @Override + public Boolean component5() { + return getEnabled(); + } + + @Override + public JSONB component6() { + return getParams(); + } + + @Override + public String component7() { + return getCreator(); + } + + @Override + public Timestamp component8() { + return getCreationDate(); + } + + @Override + public Integer value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public Long value3() { + return getProjectId(); + } + + @Override + public Integer value4() { + return getType(); + } + + @Override + public Boolean value5() { + return getEnabled(); + } + + @Override + public JSONB value6() { + return getParams(); + } + + @Override + public String value7() { + return getCreator(); + } + + @Override + public Timestamp value8() { + return getCreationDate(); + } + + @Override + public JIntegrationRecord value1(Integer value) { + setId(value); + return this; + } + + @Override + public JIntegrationRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JIntegrationRecord value3(Long value) { + setProjectId(value); + return this; + } + + @Override + public JIntegrationRecord value4(Integer value) { + setType(value); + return this; + } + + @Override + public JIntegrationRecord value5(Boolean value) { + setEnabled(value); + return this; + } + + @Override + public JIntegrationRecord value6(JSONB value) { + setParams(value); + return this; + } + + @Override + public JIntegrationRecord value7(String value) { + setCreator(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JIntegrationRecord value8(Timestamp value) { + setCreationDate(value); + return this; + } + + @Override + public JIntegrationRecord values(Integer value1, String value2, Long value3, Integer value4, + Boolean value5, JSONB value6, String value7, Timestamp value8) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationTypeRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationTypeRecord.java index c4d03c99e..542775350 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationTypeRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationTypeRecord.java @@ -7,11 +7,8 @@ import com.epam.ta.reportportal.jooq.enums.JIntegrationAuthFlowEnum; import com.epam.ta.reportportal.jooq.enums.JIntegrationGroupEnum; import com.epam.ta.reportportal.jooq.tables.JIntegrationType; - import java.sql.Timestamp; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.JSONB; import org.jooq.Record1; @@ -30,314 +27,318 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JIntegrationTypeRecord extends UpdatableRecordImpl implements Record7 { - - private static final long serialVersionUID = -1999785253; - - /** - * Setter for public.integration_type.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for public.integration_type.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for public.integration_type.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.integration_type.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.integration_type.auth_flow. - */ - public void setAuthFlow(JIntegrationAuthFlowEnum value) { - set(2, value); - } - - /** - * Getter for public.integration_type.auth_flow. - */ - public JIntegrationAuthFlowEnum getAuthFlow() { - return (JIntegrationAuthFlowEnum) get(2); - } - - /** - * Setter for public.integration_type.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(3, value); - } - - /** - * Getter for public.integration_type.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(3); - } - - /** - * Setter for public.integration_type.group_type. - */ - public void setGroupType(JIntegrationGroupEnum value) { - set(4, value); - } - - /** - * Getter for public.integration_type.group_type. - */ - public JIntegrationGroupEnum getGroupType() { - return (JIntegrationGroupEnum) get(4); - } - - /** - * Setter for public.integration_type.enabled. - */ - public void setEnabled(Boolean value) { - set(5, value); - } - - /** - * Getter for public.integration_type.enabled. - */ - public Boolean getEnabled() { - return (Boolean) get(5); - } - - /** - * Setter for public.integration_type.details. - */ - public void setDetails(JSONB value) { - set(6, value); - } - - /** - * Getter for public.integration_type.details. - */ - public JSONB getDetails() { - return (JSONB) get(6); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record7 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); - } - - @Override - public Row7 valuesRow() { - return (Row7) super.valuesRow(); - } - - @Override - public Field field1() { - return JIntegrationType.INTEGRATION_TYPE.ID; - } - - @Override - public Field field2() { - return JIntegrationType.INTEGRATION_TYPE.NAME; - } - - @Override - public Field field3() { - return JIntegrationType.INTEGRATION_TYPE.AUTH_FLOW; - } - - @Override - public Field field4() { - return JIntegrationType.INTEGRATION_TYPE.CREATION_DATE; - } - - @Override - public Field field5() { - return JIntegrationType.INTEGRATION_TYPE.GROUP_TYPE; - } - - @Override - public Field field6() { - return JIntegrationType.INTEGRATION_TYPE.ENABLED; - } - - @Override - public Field field7() { - return JIntegrationType.INTEGRATION_TYPE.DETAILS; - } - - @Override - public Integer component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public JIntegrationAuthFlowEnum component3() { - return getAuthFlow(); - } - - @Override - public Timestamp component4() { - return getCreationDate(); - } - - @Override - public JIntegrationGroupEnum component5() { - return getGroupType(); - } - - @Override - public Boolean component6() { - return getEnabled(); - } - - @Override - public JSONB component7() { - return getDetails(); - } - - @Override - public Integer value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public JIntegrationAuthFlowEnum value3() { - return getAuthFlow(); - } - - @Override - public Timestamp value4() { - return getCreationDate(); - } - - @Override - public JIntegrationGroupEnum value5() { - return getGroupType(); - } - - @Override - public Boolean value6() { - return getEnabled(); - } - - @Override - public JSONB value7() { - return getDetails(); - } - - @Override - public JIntegrationTypeRecord value1(Integer value) { - setId(value); - return this; - } - - @Override - public JIntegrationTypeRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JIntegrationTypeRecord value3(JIntegrationAuthFlowEnum value) { - setAuthFlow(value); - return this; - } - - @Override - public JIntegrationTypeRecord value4(Timestamp value) { - setCreationDate(value); - return this; - } - - @Override - public JIntegrationTypeRecord value5(JIntegrationGroupEnum value) { - setGroupType(value); - return this; - } - - @Override - public JIntegrationTypeRecord value6(Boolean value) { - setEnabled(value); - return this; - } - - @Override - public JIntegrationTypeRecord value7(JSONB value) { - setDetails(value); - return this; - } - - @Override - public JIntegrationTypeRecord values(Integer value1, String value2, JIntegrationAuthFlowEnum value3, Timestamp value4, JIntegrationGroupEnum value5, Boolean value6, JSONB value7) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JIntegrationTypeRecord - */ - public JIntegrationTypeRecord() { - super(JIntegrationType.INTEGRATION_TYPE); - } - - /** - * Create a detached, initialised JIntegrationTypeRecord - */ - public JIntegrationTypeRecord(Integer id, String name, JIntegrationAuthFlowEnum authFlow, Timestamp creationDate, JIntegrationGroupEnum groupType, Boolean enabled, JSONB details) { - super(JIntegrationType.INTEGRATION_TYPE); - - set(0, id); - set(1, name); - set(2, authFlow); - set(3, creationDate); - set(4, groupType); - set(5, enabled); - set(6, details); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JIntegrationTypeRecord extends UpdatableRecordImpl implements + Record7 { + + private static final long serialVersionUID = -1999785253; + + /** + * Create a detached JIntegrationTypeRecord + */ + public JIntegrationTypeRecord() { + super(JIntegrationType.INTEGRATION_TYPE); + } + + /** + * Create a detached, initialised JIntegrationTypeRecord + */ + public JIntegrationTypeRecord(Integer id, String name, JIntegrationAuthFlowEnum authFlow, + Timestamp creationDate, JIntegrationGroupEnum groupType, Boolean enabled, JSONB details) { + super(JIntegrationType.INTEGRATION_TYPE); + + set(0, id); + set(1, name); + set(2, authFlow); + set(3, creationDate); + set(4, groupType); + set(5, enabled); + set(6, details); + } + + /** + * Getter for public.integration_type.id. + */ + public Integer getId() { + return (Integer) get(0); + } + + /** + * Setter for public.integration_type.id. + */ + public void setId(Integer value) { + set(0, value); + } + + /** + * Getter for public.integration_type.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.integration_type.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.integration_type.auth_flow. + */ + public JIntegrationAuthFlowEnum getAuthFlow() { + return (JIntegrationAuthFlowEnum) get(2); + } + + /** + * Setter for public.integration_type.auth_flow. + */ + public void setAuthFlow(JIntegrationAuthFlowEnum value) { + set(2, value); + } + + /** + * Getter for public.integration_type.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(3); + } + + /** + * Setter for public.integration_type.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(3, value); + } + + /** + * Getter for public.integration_type.group_type. + */ + public JIntegrationGroupEnum getGroupType() { + return (JIntegrationGroupEnum) get(4); + } + + /** + * Setter for public.integration_type.group_type. + */ + public void setGroupType(JIntegrationGroupEnum value) { + set(4, value); + } + + /** + * Getter for public.integration_type.enabled. + */ + public Boolean getEnabled() { + return (Boolean) get(5); + } + + /** + * Setter for public.integration_type.enabled. + */ + public void setEnabled(Boolean value) { + set(5, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.integration_type.details. + */ + public JSONB getDetails() { + return (JSONB) get(6); + } + + // ------------------------------------------------------------------------- + // Record7 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.integration_type.details. + */ + public void setDetails(JSONB value) { + set(6, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + @Override + public Row7 valuesRow() { + return (Row7) super.valuesRow(); + } + + @Override + public Field field1() { + return JIntegrationType.INTEGRATION_TYPE.ID; + } + + @Override + public Field field2() { + return JIntegrationType.INTEGRATION_TYPE.NAME; + } + + @Override + public Field field3() { + return JIntegrationType.INTEGRATION_TYPE.AUTH_FLOW; + } + + @Override + public Field field4() { + return JIntegrationType.INTEGRATION_TYPE.CREATION_DATE; + } + + @Override + public Field field5() { + return JIntegrationType.INTEGRATION_TYPE.GROUP_TYPE; + } + + @Override + public Field field6() { + return JIntegrationType.INTEGRATION_TYPE.ENABLED; + } + + @Override + public Field field7() { + return JIntegrationType.INTEGRATION_TYPE.DETAILS; + } + + @Override + public Integer component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public JIntegrationAuthFlowEnum component3() { + return getAuthFlow(); + } + + @Override + public Timestamp component4() { + return getCreationDate(); + } + + @Override + public JIntegrationGroupEnum component5() { + return getGroupType(); + } + + @Override + public Boolean component6() { + return getEnabled(); + } + + @Override + public JSONB component7() { + return getDetails(); + } + + @Override + public Integer value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public JIntegrationAuthFlowEnum value3() { + return getAuthFlow(); + } + + @Override + public Timestamp value4() { + return getCreationDate(); + } + + @Override + public JIntegrationGroupEnum value5() { + return getGroupType(); + } + + @Override + public Boolean value6() { + return getEnabled(); + } + + @Override + public JSONB value7() { + return getDetails(); + } + + @Override + public JIntegrationTypeRecord value1(Integer value) { + setId(value); + return this; + } + + @Override + public JIntegrationTypeRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JIntegrationTypeRecord value3(JIntegrationAuthFlowEnum value) { + setAuthFlow(value); + return this; + } + + @Override + public JIntegrationTypeRecord value4(Timestamp value) { + setCreationDate(value); + return this; + } + + @Override + public JIntegrationTypeRecord value5(JIntegrationGroupEnum value) { + setGroupType(value); + return this; + } + + @Override + public JIntegrationTypeRecord value6(Boolean value) { + setEnabled(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JIntegrationTypeRecord value7(JSONB value) { + setDetails(value); + return this; + } + + @Override + public JIntegrationTypeRecord values(Integer value1, String value2, + JIntegrationAuthFlowEnum value3, Timestamp value4, JIntegrationGroupEnum value5, + Boolean value6, JSONB value7) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueGroupRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueGroupRecord.java index 23af40700..281d97f44 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueGroupRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueGroupRecord.java @@ -6,9 +6,7 @@ import com.epam.ta.reportportal.jooq.enums.JIssueGroupEnum; import com.epam.ta.reportportal.jooq.tables.JIssueGroup; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record2; @@ -26,129 +24,130 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JIssueGroupRecord extends UpdatableRecordImpl implements Record2 { - - private static final long serialVersionUID = 706892897; - - /** - * Setter for public.issue_group.issue_group_id. - */ - public void setIssueGroupId(Short value) { - set(0, value); - } - - /** - * Getter for public.issue_group.issue_group_id. - */ - public Short getIssueGroupId() { - return (Short) get(0); - } - - /** - * Setter for public.issue_group.issue_group. - */ - public void setIssueGroup(JIssueGroupEnum value) { - set(1, value); - } - - /** - * Getter for public.issue_group.issue_group. - */ - public JIssueGroupEnum getIssueGroup() { - return (JIssueGroupEnum) get(1); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID; - } - - @Override - public Field field2() { - return JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_; - } - - @Override - public Short component1() { - return getIssueGroupId(); - } - - @Override - public JIssueGroupEnum component2() { - return getIssueGroup(); - } - - @Override - public Short value1() { - return getIssueGroupId(); - } - - @Override - public JIssueGroupEnum value2() { - return getIssueGroup(); - } - - @Override - public JIssueGroupRecord value1(Short value) { - setIssueGroupId(value); - return this; - } - - @Override - public JIssueGroupRecord value2(JIssueGroupEnum value) { - setIssueGroup(value); - return this; - } - - @Override - public JIssueGroupRecord values(Short value1, JIssueGroupEnum value2) { - value1(value1); - value2(value2); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JIssueGroupRecord - */ - public JIssueGroupRecord() { - super(JIssueGroup.ISSUE_GROUP); - } - - /** - * Create a detached, initialised JIssueGroupRecord - */ - public JIssueGroupRecord(Short issueGroupId, JIssueGroupEnum issueGroup) { - super(JIssueGroup.ISSUE_GROUP); - - set(0, issueGroupId); - set(1, issueGroup); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JIssueGroupRecord extends UpdatableRecordImpl implements + Record2 { + + private static final long serialVersionUID = 706892897; + + /** + * Create a detached JIssueGroupRecord + */ + public JIssueGroupRecord() { + super(JIssueGroup.ISSUE_GROUP); + } + + /** + * Create a detached, initialised JIssueGroupRecord + */ + public JIssueGroupRecord(Short issueGroupId, JIssueGroupEnum issueGroup) { + super(JIssueGroup.ISSUE_GROUP); + + set(0, issueGroupId); + set(1, issueGroup); + } + + /** + * Getter for public.issue_group.issue_group_id. + */ + public Short getIssueGroupId() { + return (Short) get(0); + } + + /** + * Setter for public.issue_group.issue_group_id. + */ + public void setIssueGroupId(Short value) { + set(0, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.issue_group.issue_group. + */ + public JIssueGroupEnum getIssueGroup() { + return (JIssueGroupEnum) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.issue_group.issue_group. + */ + public void setIssueGroup(JIssueGroupEnum value) { + set(1, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID; + } + + @Override + public Field field2() { + return JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_; + } + + @Override + public Short component1() { + return getIssueGroupId(); + } + + @Override + public JIssueGroupEnum component2() { + return getIssueGroup(); + } + + @Override + public Short value1() { + return getIssueGroupId(); + } + + @Override + public JIssueGroupEnum value2() { + return getIssueGroup(); + } + + @Override + public JIssueGroupRecord value1(Short value) { + setIssueGroupId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JIssueGroupRecord value2(JIssueGroupEnum value) { + setIssueGroup(value); + return this; + } + + @Override + public JIssueGroupRecord values(Short value1, JIssueGroupEnum value2) { + value1(value1); + value2(value2); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueRecord.java index eaab83c61..223cbe2de 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JIssue; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record5; @@ -25,240 +23,243 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JIssueRecord extends UpdatableRecordImpl implements Record5 { - - private static final long serialVersionUID = -1357499849; - - /** - * Setter for public.issue.issue_id. - */ - public void setIssueId(Long value) { - set(0, value); - } - - /** - * Getter for public.issue.issue_id. - */ - public Long getIssueId() { - return (Long) get(0); - } - - /** - * Setter for public.issue.issue_type. - */ - public void setIssueType(Long value) { - set(1, value); - } - - /** - * Getter for public.issue.issue_type. - */ - public Long getIssueType() { - return (Long) get(1); - } - - /** - * Setter for public.issue.issue_description. - */ - public void setIssueDescription(String value) { - set(2, value); - } - - /** - * Getter for public.issue.issue_description. - */ - public String getIssueDescription() { - return (String) get(2); - } - - /** - * Setter for public.issue.auto_analyzed. - */ - public void setAutoAnalyzed(Boolean value) { - set(3, value); - } - - /** - * Getter for public.issue.auto_analyzed. - */ - public Boolean getAutoAnalyzed() { - return (Boolean) get(3); - } - - /** - * Setter for public.issue.ignore_analyzer. - */ - public void setIgnoreAnalyzer(Boolean value) { - set(4, value); - } - - /** - * Getter for public.issue.ignore_analyzer. - */ - public Boolean getIgnoreAnalyzer() { - return (Boolean) get(4); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } - - @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); - } - - @Override - public Field field1() { - return JIssue.ISSUE.ISSUE_ID; - } - - @Override - public Field field2() { - return JIssue.ISSUE.ISSUE_TYPE; - } - - @Override - public Field field3() { - return JIssue.ISSUE.ISSUE_DESCRIPTION; - } - - @Override - public Field field4() { - return JIssue.ISSUE.AUTO_ANALYZED; - } - - @Override - public Field field5() { - return JIssue.ISSUE.IGNORE_ANALYZER; - } - - @Override - public Long component1() { - return getIssueId(); - } - - @Override - public Long component2() { - return getIssueType(); - } - - @Override - public String component3() { - return getIssueDescription(); - } - - @Override - public Boolean component4() { - return getAutoAnalyzed(); - } - - @Override - public Boolean component5() { - return getIgnoreAnalyzer(); - } - - @Override - public Long value1() { - return getIssueId(); - } - - @Override - public Long value2() { - return getIssueType(); - } - - @Override - public String value3() { - return getIssueDescription(); - } - - @Override - public Boolean value4() { - return getAutoAnalyzed(); - } - - @Override - public Boolean value5() { - return getIgnoreAnalyzer(); - } - - @Override - public JIssueRecord value1(Long value) { - setIssueId(value); - return this; - } - - @Override - public JIssueRecord value2(Long value) { - setIssueType(value); - return this; - } - - @Override - public JIssueRecord value3(String value) { - setIssueDescription(value); - return this; - } - - @Override - public JIssueRecord value4(Boolean value) { - setAutoAnalyzed(value); - return this; - } - - @Override - public JIssueRecord value5(Boolean value) { - setIgnoreAnalyzer(value); - return this; - } - - @Override - public JIssueRecord values(Long value1, Long value2, String value3, Boolean value4, Boolean value5) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JIssueRecord - */ - public JIssueRecord() { - super(JIssue.ISSUE); - } - - /** - * Create a detached, initialised JIssueRecord - */ - public JIssueRecord(Long issueId, Long issueType, String issueDescription, Boolean autoAnalyzed, Boolean ignoreAnalyzer) { - super(JIssue.ISSUE); - - set(0, issueId); - set(1, issueType); - set(2, issueDescription); - set(3, autoAnalyzed); - set(4, ignoreAnalyzer); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JIssueRecord extends UpdatableRecordImpl implements + Record5 { + + private static final long serialVersionUID = -1357499849; + + /** + * Create a detached JIssueRecord + */ + public JIssueRecord() { + super(JIssue.ISSUE); + } + + /** + * Create a detached, initialised JIssueRecord + */ + public JIssueRecord(Long issueId, Long issueType, String issueDescription, Boolean autoAnalyzed, + Boolean ignoreAnalyzer) { + super(JIssue.ISSUE); + + set(0, issueId); + set(1, issueType); + set(2, issueDescription); + set(3, autoAnalyzed); + set(4, ignoreAnalyzer); + } + + /** + * Getter for public.issue.issue_id. + */ + public Long getIssueId() { + return (Long) get(0); + } + + /** + * Setter for public.issue.issue_id. + */ + public void setIssueId(Long value) { + set(0, value); + } + + /** + * Getter for public.issue.issue_type. + */ + public Long getIssueType() { + return (Long) get(1); + } + + /** + * Setter for public.issue.issue_type. + */ + public void setIssueType(Long value) { + set(1, value); + } + + /** + * Getter for public.issue.issue_description. + */ + public String getIssueDescription() { + return (String) get(2); + } + + /** + * Setter for public.issue.issue_description. + */ + public void setIssueDescription(String value) { + set(2, value); + } + + /** + * Getter for public.issue.auto_analyzed. + */ + public Boolean getAutoAnalyzed() { + return (Boolean) get(3); + } + + /** + * Setter for public.issue.auto_analyzed. + */ + public void setAutoAnalyzed(Boolean value) { + set(3, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.issue.ignore_analyzer. + */ + public Boolean getIgnoreAnalyzer() { + return (Boolean) get(4); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.issue.ignore_analyzer. + */ + public void setIgnoreAnalyzer(Boolean value) { + set(4, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return JIssue.ISSUE.ISSUE_ID; + } + + @Override + public Field field2() { + return JIssue.ISSUE.ISSUE_TYPE; + } + + @Override + public Field field3() { + return JIssue.ISSUE.ISSUE_DESCRIPTION; + } + + @Override + public Field field4() { + return JIssue.ISSUE.AUTO_ANALYZED; + } + + @Override + public Field field5() { + return JIssue.ISSUE.IGNORE_ANALYZER; + } + + @Override + public Long component1() { + return getIssueId(); + } + + @Override + public Long component2() { + return getIssueType(); + } + + @Override + public String component3() { + return getIssueDescription(); + } + + @Override + public Boolean component4() { + return getAutoAnalyzed(); + } + + @Override + public Boolean component5() { + return getIgnoreAnalyzer(); + } + + @Override + public Long value1() { + return getIssueId(); + } + + @Override + public Long value2() { + return getIssueType(); + } + + @Override + public String value3() { + return getIssueDescription(); + } + + @Override + public Boolean value4() { + return getAutoAnalyzed(); + } + + @Override + public Boolean value5() { + return getIgnoreAnalyzer(); + } + + @Override + public JIssueRecord value1(Long value) { + setIssueId(value); + return this; + } + + @Override + public JIssueRecord value2(Long value) { + setIssueType(value); + return this; + } + + @Override + public JIssueRecord value3(String value) { + setIssueDescription(value); + return this; + } + + @Override + public JIssueRecord value4(Boolean value) { + setAutoAnalyzed(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JIssueRecord value5(Boolean value) { + setIgnoreAnalyzer(value); + return this; + } + + @Override + public JIssueRecord values(Long value1, Long value2, String value3, Boolean value4, + Boolean value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTicketRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTicketRecord.java index 7f7b3719e..3828dd97f 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTicketRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTicketRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JIssueTicket; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -24,129 +22,130 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JIssueTicketRecord extends UpdatableRecordImpl implements Record2 { - - private static final long serialVersionUID = -755638091; - - /** - * Setter for public.issue_ticket.issue_id. - */ - public void setIssueId(Long value) { - set(0, value); - } - - /** - * Getter for public.issue_ticket.issue_id. - */ - public Long getIssueId() { - return (Long) get(0); - } - - /** - * Setter for public.issue_ticket.ticket_id. - */ - public void setTicketId(Long value) { - set(1, value); - } - - /** - * Getter for public.issue_ticket.ticket_id. - */ - public Long getTicketId() { - return (Long) get(1); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record2 key() { - return (Record2) super.key(); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JIssueTicket.ISSUE_TICKET.ISSUE_ID; - } - - @Override - public Field field2() { - return JIssueTicket.ISSUE_TICKET.TICKET_ID; - } - - @Override - public Long component1() { - return getIssueId(); - } - - @Override - public Long component2() { - return getTicketId(); - } - - @Override - public Long value1() { - return getIssueId(); - } - - @Override - public Long value2() { - return getTicketId(); - } - - @Override - public JIssueTicketRecord value1(Long value) { - setIssueId(value); - return this; - } - - @Override - public JIssueTicketRecord value2(Long value) { - setTicketId(value); - return this; - } - - @Override - public JIssueTicketRecord values(Long value1, Long value2) { - value1(value1); - value2(value2); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JIssueTicketRecord - */ - public JIssueTicketRecord() { - super(JIssueTicket.ISSUE_TICKET); - } - - /** - * Create a detached, initialised JIssueTicketRecord - */ - public JIssueTicketRecord(Long issueId, Long ticketId) { - super(JIssueTicket.ISSUE_TICKET); - - set(0, issueId); - set(1, ticketId); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JIssueTicketRecord extends UpdatableRecordImpl implements + Record2 { + + private static final long serialVersionUID = -755638091; + + /** + * Create a detached JIssueTicketRecord + */ + public JIssueTicketRecord() { + super(JIssueTicket.ISSUE_TICKET); + } + + /** + * Create a detached, initialised JIssueTicketRecord + */ + public JIssueTicketRecord(Long issueId, Long ticketId) { + super(JIssueTicket.ISSUE_TICKET); + + set(0, issueId); + set(1, ticketId); + } + + /** + * Getter for public.issue_ticket.issue_id. + */ + public Long getIssueId() { + return (Long) get(0); + } + + /** + * Setter for public.issue_ticket.issue_id. + */ + public void setIssueId(Long value) { + set(0, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.issue_ticket.ticket_id. + */ + public Long getTicketId() { + return (Long) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.issue_ticket.ticket_id. + */ + public void setTicketId(Long value) { + set(1, value); + } + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JIssueTicket.ISSUE_TICKET.ISSUE_ID; + } + + @Override + public Field field2() { + return JIssueTicket.ISSUE_TICKET.TICKET_ID; + } + + @Override + public Long component1() { + return getIssueId(); + } + + @Override + public Long component2() { + return getTicketId(); + } + + @Override + public Long value1() { + return getIssueId(); + } + + @Override + public Long value2() { + return getTicketId(); + } + + @Override + public JIssueTicketRecord value1(Long value) { + setIssueId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JIssueTicketRecord value2(Long value) { + setTicketId(value); + return this; + } + + @Override + public JIssueTicketRecord values(Long value1, Long value2) { + value1(value1); + value2(value2); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeProjectRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeProjectRecord.java index f9d621758..a8ff40847 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeProjectRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeProjectRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JIssueTypeProject; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -24,129 +22,130 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JIssueTypeProjectRecord extends UpdatableRecordImpl implements Record2 { - - private static final long serialVersionUID = -272281122; - - /** - * Setter for public.issue_type_project.project_id. - */ - public void setProjectId(Long value) { - set(0, value); - } - - /** - * Getter for public.issue_type_project.project_id. - */ - public Long getProjectId() { - return (Long) get(0); - } - - /** - * Setter for public.issue_type_project.issue_type_id. - */ - public void setIssueTypeId(Long value) { - set(1, value); - } - - /** - * Getter for public.issue_type_project.issue_type_id. - */ - public Long getIssueTypeId() { - return (Long) get(1); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record2 key() { - return (Record2) super.key(); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID; - } - - @Override - public Field field2() { - return JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID; - } - - @Override - public Long component1() { - return getProjectId(); - } - - @Override - public Long component2() { - return getIssueTypeId(); - } - - @Override - public Long value1() { - return getProjectId(); - } - - @Override - public Long value2() { - return getIssueTypeId(); - } - - @Override - public JIssueTypeProjectRecord value1(Long value) { - setProjectId(value); - return this; - } - - @Override - public JIssueTypeProjectRecord value2(Long value) { - setIssueTypeId(value); - return this; - } - - @Override - public JIssueTypeProjectRecord values(Long value1, Long value2) { - value1(value1); - value2(value2); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JIssueTypeProjectRecord - */ - public JIssueTypeProjectRecord() { - super(JIssueTypeProject.ISSUE_TYPE_PROJECT); - } - - /** - * Create a detached, initialised JIssueTypeProjectRecord - */ - public JIssueTypeProjectRecord(Long projectId, Long issueTypeId) { - super(JIssueTypeProject.ISSUE_TYPE_PROJECT); - - set(0, projectId); - set(1, issueTypeId); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JIssueTypeProjectRecord extends UpdatableRecordImpl implements + Record2 { + + private static final long serialVersionUID = -272281122; + + /** + * Create a detached JIssueTypeProjectRecord + */ + public JIssueTypeProjectRecord() { + super(JIssueTypeProject.ISSUE_TYPE_PROJECT); + } + + /** + * Create a detached, initialised JIssueTypeProjectRecord + */ + public JIssueTypeProjectRecord(Long projectId, Long issueTypeId) { + super(JIssueTypeProject.ISSUE_TYPE_PROJECT); + + set(0, projectId); + set(1, issueTypeId); + } + + /** + * Getter for public.issue_type_project.project_id. + */ + public Long getProjectId() { + return (Long) get(0); + } + + /** + * Setter for public.issue_type_project.project_id. + */ + public void setProjectId(Long value) { + set(0, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.issue_type_project.issue_type_id. + */ + public Long getIssueTypeId() { + return (Long) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.issue_type_project.issue_type_id. + */ + public void setIssueTypeId(Long value) { + set(1, value); + } + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID; + } + + @Override + public Field field2() { + return JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID; + } + + @Override + public Long component1() { + return getProjectId(); + } + + @Override + public Long component2() { + return getIssueTypeId(); + } + + @Override + public Long value1() { + return getProjectId(); + } + + @Override + public Long value2() { + return getIssueTypeId(); + } + + @Override + public JIssueTypeProjectRecord value1(Long value) { + setProjectId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JIssueTypeProjectRecord value2(Long value) { + setIssueTypeId(value); + return this; + } + + @Override + public JIssueTypeProjectRecord values(Long value1, Long value2) { + value1(value1); + value2(value2); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeRecord.java index 6cb851de7..eea23b87b 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JIssueType; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record6; @@ -25,277 +23,280 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JIssueTypeRecord extends UpdatableRecordImpl implements Record6 { - - private static final long serialVersionUID = -1954908516; - - /** - * Setter for public.issue_type.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.issue_type.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.issue_type.issue_group_id. - */ - public void setIssueGroupId(Short value) { - set(1, value); - } - - /** - * Getter for public.issue_type.issue_group_id. - */ - public Short getIssueGroupId() { - return (Short) get(1); - } - - /** - * Setter for public.issue_type.locator. - */ - public void setLocator(String value) { - set(2, value); - } - - /** - * Getter for public.issue_type.locator. - */ - public String getLocator() { - return (String) get(2); - } - - /** - * Setter for public.issue_type.issue_name. - */ - public void setIssueName(String value) { - set(3, value); - } - - /** - * Getter for public.issue_type.issue_name. - */ - public String getIssueName() { - return (String) get(3); - } - - /** - * Setter for public.issue_type.abbreviation. - */ - public void setAbbreviation(String value) { - set(4, value); - } - - /** - * Getter for public.issue_type.abbreviation. - */ - public String getAbbreviation() { - return (String) get(4); - } - - /** - * Setter for public.issue_type.hex_color. - */ - public void setHexColor(String value) { - set(5, value); - } - - /** - * Getter for public.issue_type.hex_color. - */ - public String getHexColor() { - return (String) get(5); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return JIssueType.ISSUE_TYPE.ID; - } - - @Override - public Field field2() { - return JIssueType.ISSUE_TYPE.ISSUE_GROUP_ID; - } - - @Override - public Field field3() { - return JIssueType.ISSUE_TYPE.LOCATOR; - } - - @Override - public Field field4() { - return JIssueType.ISSUE_TYPE.ISSUE_NAME; - } - - @Override - public Field field5() { - return JIssueType.ISSUE_TYPE.ABBREVIATION; - } - - @Override - public Field field6() { - return JIssueType.ISSUE_TYPE.HEX_COLOR; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Short component2() { - return getIssueGroupId(); - } - - @Override - public String component3() { - return getLocator(); - } - - @Override - public String component4() { - return getIssueName(); - } - - @Override - public String component5() { - return getAbbreviation(); - } - - @Override - public String component6() { - return getHexColor(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Short value2() { - return getIssueGroupId(); - } - - @Override - public String value3() { - return getLocator(); - } - - @Override - public String value4() { - return getIssueName(); - } - - @Override - public String value5() { - return getAbbreviation(); - } - - @Override - public String value6() { - return getHexColor(); - } - - @Override - public JIssueTypeRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JIssueTypeRecord value2(Short value) { - setIssueGroupId(value); - return this; - } - - @Override - public JIssueTypeRecord value3(String value) { - setLocator(value); - return this; - } - - @Override - public JIssueTypeRecord value4(String value) { - setIssueName(value); - return this; - } - - @Override - public JIssueTypeRecord value5(String value) { - setAbbreviation(value); - return this; - } - - @Override - public JIssueTypeRecord value6(String value) { - setHexColor(value); - return this; - } - - @Override - public JIssueTypeRecord values(Long value1, Short value2, String value3, String value4, String value5, String value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JIssueTypeRecord - */ - public JIssueTypeRecord() { - super(JIssueType.ISSUE_TYPE); - } - - /** - * Create a detached, initialised JIssueTypeRecord - */ - public JIssueTypeRecord(Long id, Short issueGroupId, String locator, String issueName, String abbreviation, String hexColor) { - super(JIssueType.ISSUE_TYPE); - - set(0, id); - set(1, issueGroupId); - set(2, locator); - set(3, issueName); - set(4, abbreviation); - set(5, hexColor); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JIssueTypeRecord extends UpdatableRecordImpl implements + Record6 { + + private static final long serialVersionUID = -1954908516; + + /** + * Create a detached JIssueTypeRecord + */ + public JIssueTypeRecord() { + super(JIssueType.ISSUE_TYPE); + } + + /** + * Create a detached, initialised JIssueTypeRecord + */ + public JIssueTypeRecord(Long id, Short issueGroupId, String locator, String issueName, + String abbreviation, String hexColor) { + super(JIssueType.ISSUE_TYPE); + + set(0, id); + set(1, issueGroupId); + set(2, locator); + set(3, issueName); + set(4, abbreviation); + set(5, hexColor); + } + + /** + * Getter for public.issue_type.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.issue_type.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.issue_type.issue_group_id. + */ + public Short getIssueGroupId() { + return (Short) get(1); + } + + /** + * Setter for public.issue_type.issue_group_id. + */ + public void setIssueGroupId(Short value) { + set(1, value); + } + + /** + * Getter for public.issue_type.locator. + */ + public String getLocator() { + return (String) get(2); + } + + /** + * Setter for public.issue_type.locator. + */ + public void setLocator(String value) { + set(2, value); + } + + /** + * Getter for public.issue_type.issue_name. + */ + public String getIssueName() { + return (String) get(3); + } + + /** + * Setter for public.issue_type.issue_name. + */ + public void setIssueName(String value) { + set(3, value); + } + + /** + * Getter for public.issue_type.abbreviation. + */ + public String getAbbreviation() { + return (String) get(4); + } + + /** + * Setter for public.issue_type.abbreviation. + */ + public void setAbbreviation(String value) { + set(4, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.issue_type.hex_color. + */ + public String getHexColor() { + return (String) get(5); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.issue_type.hex_color. + */ + public void setHexColor(String value) { + set(5, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return JIssueType.ISSUE_TYPE.ID; + } + + @Override + public Field field2() { + return JIssueType.ISSUE_TYPE.ISSUE_GROUP_ID; + } + + @Override + public Field field3() { + return JIssueType.ISSUE_TYPE.LOCATOR; + } + + @Override + public Field field4() { + return JIssueType.ISSUE_TYPE.ISSUE_NAME; + } + + @Override + public Field field5() { + return JIssueType.ISSUE_TYPE.ABBREVIATION; + } + + @Override + public Field field6() { + return JIssueType.ISSUE_TYPE.HEX_COLOR; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Short component2() { + return getIssueGroupId(); + } + + @Override + public String component3() { + return getLocator(); + } + + @Override + public String component4() { + return getIssueName(); + } + + @Override + public String component5() { + return getAbbreviation(); + } + + @Override + public String component6() { + return getHexColor(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Short value2() { + return getIssueGroupId(); + } + + @Override + public String value3() { + return getLocator(); + } + + @Override + public String value4() { + return getIssueName(); + } + + @Override + public String value5() { + return getAbbreviation(); + } + + @Override + public String value6() { + return getHexColor(); + } + + @Override + public JIssueTypeRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JIssueTypeRecord value2(Short value) { + setIssueGroupId(value); + return this; + } + + @Override + public JIssueTypeRecord value3(String value) { + setLocator(value); + return this; + } + + @Override + public JIssueTypeRecord value4(String value) { + setIssueName(value); + return this; + } + + @Override + public JIssueTypeRecord value5(String value) { + setAbbreviation(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JIssueTypeRecord value6(String value) { + setHexColor(value); + return this; + } + + @Override + public JIssueTypeRecord values(Long value1, Short value2, String value3, String value4, + String value5, String value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JItemAttributeRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JItemAttributeRecord.java index 1c979a008..29055fe44 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JItemAttributeRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JItemAttributeRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JItemAttribute; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record6; @@ -25,277 +23,280 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JItemAttributeRecord extends UpdatableRecordImpl implements Record6 { - - private static final long serialVersionUID = 1975199970; - - /** - * Setter for public.item_attribute.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.item_attribute.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.item_attribute.key. - */ - public void setKey(String value) { - set(1, value); - } - - /** - * Getter for public.item_attribute.key. - */ - public String getKey() { - return (String) get(1); - } - - /** - * Setter for public.item_attribute.value. - */ - public void setValue(String value) { - set(2, value); - } - - /** - * Getter for public.item_attribute.value. - */ - public String getValue() { - return (String) get(2); - } - - /** - * Setter for public.item_attribute.item_id. - */ - public void setItemId(Long value) { - set(3, value); - } - - /** - * Getter for public.item_attribute.item_id. - */ - public Long getItemId() { - return (Long) get(3); - } - - /** - * Setter for public.item_attribute.launch_id. - */ - public void setLaunchId(Long value) { - set(4, value); - } - - /** - * Getter for public.item_attribute.launch_id. - */ - public Long getLaunchId() { - return (Long) get(4); - } - - /** - * Setter for public.item_attribute.system. - */ - public void setSystem(Boolean value) { - set(5, value); - } - - /** - * Getter for public.item_attribute.system. - */ - public Boolean getSystem() { - return (Boolean) get(5); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return JItemAttribute.ITEM_ATTRIBUTE.ID; - } - - @Override - public Field field2() { - return JItemAttribute.ITEM_ATTRIBUTE.KEY; - } - - @Override - public Field field3() { - return JItemAttribute.ITEM_ATTRIBUTE.VALUE; - } - - @Override - public Field field4() { - return JItemAttribute.ITEM_ATTRIBUTE.ITEM_ID; - } - - @Override - public Field field5() { - return JItemAttribute.ITEM_ATTRIBUTE.LAUNCH_ID; - } - - @Override - public Field field6() { - return JItemAttribute.ITEM_ATTRIBUTE.SYSTEM; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getKey(); - } - - @Override - public String component3() { - return getValue(); - } - - @Override - public Long component4() { - return getItemId(); - } - - @Override - public Long component5() { - return getLaunchId(); - } - - @Override - public Boolean component6() { - return getSystem(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getKey(); - } - - @Override - public String value3() { - return getValue(); - } - - @Override - public Long value4() { - return getItemId(); - } - - @Override - public Long value5() { - return getLaunchId(); - } - - @Override - public Boolean value6() { - return getSystem(); - } - - @Override - public JItemAttributeRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JItemAttributeRecord value2(String value) { - setKey(value); - return this; - } - - @Override - public JItemAttributeRecord value3(String value) { - setValue(value); - return this; - } - - @Override - public JItemAttributeRecord value4(Long value) { - setItemId(value); - return this; - } - - @Override - public JItemAttributeRecord value5(Long value) { - setLaunchId(value); - return this; - } - - @Override - public JItemAttributeRecord value6(Boolean value) { - setSystem(value); - return this; - } - - @Override - public JItemAttributeRecord values(Long value1, String value2, String value3, Long value4, Long value5, Boolean value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JItemAttributeRecord - */ - public JItemAttributeRecord() { - super(JItemAttribute.ITEM_ATTRIBUTE); - } - - /** - * Create a detached, initialised JItemAttributeRecord - */ - public JItemAttributeRecord(Long id, String key, String value, Long itemId, Long launchId, Boolean system) { - super(JItemAttribute.ITEM_ATTRIBUTE); - - set(0, id); - set(1, key); - set(2, value); - set(3, itemId); - set(4, launchId); - set(5, system); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JItemAttributeRecord extends UpdatableRecordImpl implements + Record6 { + + private static final long serialVersionUID = 1975199970; + + /** + * Create a detached JItemAttributeRecord + */ + public JItemAttributeRecord() { + super(JItemAttribute.ITEM_ATTRIBUTE); + } + + /** + * Create a detached, initialised JItemAttributeRecord + */ + public JItemAttributeRecord(Long id, String key, String value, Long itemId, Long launchId, + Boolean system) { + super(JItemAttribute.ITEM_ATTRIBUTE); + + set(0, id); + set(1, key); + set(2, value); + set(3, itemId); + set(4, launchId); + set(5, system); + } + + /** + * Getter for public.item_attribute.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.item_attribute.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.item_attribute.key. + */ + public String getKey() { + return (String) get(1); + } + + /** + * Setter for public.item_attribute.key. + */ + public void setKey(String value) { + set(1, value); + } + + /** + * Getter for public.item_attribute.value. + */ + public String getValue() { + return (String) get(2); + } + + /** + * Setter for public.item_attribute.value. + */ + public void setValue(String value) { + set(2, value); + } + + /** + * Getter for public.item_attribute.item_id. + */ + public Long getItemId() { + return (Long) get(3); + } + + /** + * Setter for public.item_attribute.item_id. + */ + public void setItemId(Long value) { + set(3, value); + } + + /** + * Getter for public.item_attribute.launch_id. + */ + public Long getLaunchId() { + return (Long) get(4); + } + + /** + * Setter for public.item_attribute.launch_id. + */ + public void setLaunchId(Long value) { + set(4, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.item_attribute.system. + */ + public Boolean getSystem() { + return (Boolean) get(5); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.item_attribute.system. + */ + public void setSystem(Boolean value) { + set(5, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return JItemAttribute.ITEM_ATTRIBUTE.ID; + } + + @Override + public Field field2() { + return JItemAttribute.ITEM_ATTRIBUTE.KEY; + } + + @Override + public Field field3() { + return JItemAttribute.ITEM_ATTRIBUTE.VALUE; + } + + @Override + public Field field4() { + return JItemAttribute.ITEM_ATTRIBUTE.ITEM_ID; + } + + @Override + public Field field5() { + return JItemAttribute.ITEM_ATTRIBUTE.LAUNCH_ID; + } + + @Override + public Field field6() { + return JItemAttribute.ITEM_ATTRIBUTE.SYSTEM; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getKey(); + } + + @Override + public String component3() { + return getValue(); + } + + @Override + public Long component4() { + return getItemId(); + } + + @Override + public Long component5() { + return getLaunchId(); + } + + @Override + public Boolean component6() { + return getSystem(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getKey(); + } + + @Override + public String value3() { + return getValue(); + } + + @Override + public Long value4() { + return getItemId(); + } + + @Override + public Long value5() { + return getLaunchId(); + } + + @Override + public Boolean value6() { + return getSystem(); + } + + @Override + public JItemAttributeRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JItemAttributeRecord value2(String value) { + setKey(value); + return this; + } + + @Override + public JItemAttributeRecord value3(String value) { + setValue(value); + return this; + } + + @Override + public JItemAttributeRecord value4(Long value) { + setItemId(value); + return this; + } + + @Override + public JItemAttributeRecord value5(Long value) { + setLaunchId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JItemAttributeRecord value6(Boolean value) { + setSystem(value); + return this; + } + + @Override + public JItemAttributeRecord values(Long value1, String value2, String value3, Long value4, + Long value5, Boolean value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchAttributeRulesRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchAttributeRulesRecord.java index 5b7d4ae19..204bf45a5 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchAttributeRulesRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchAttributeRulesRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -25,203 +23,206 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JLaunchAttributeRulesRecord extends UpdatableRecordImpl implements Record4 { - - private static final long serialVersionUID = -95178244; - - /** - * Setter for public.launch_attribute_rules.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.launch_attribute_rules.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.launch_attribute_rules.sender_case_id. - */ - public void setSenderCaseId(Long value) { - set(1, value); - } - - /** - * Getter for public.launch_attribute_rules.sender_case_id. - */ - public Long getSenderCaseId() { - return (Long) get(1); - } - - /** - * Setter for public.launch_attribute_rules.key. - */ - public void setKey(String value) { - set(2, value); - } - - /** - * Getter for public.launch_attribute_rules.key. - */ - public String getKey() { - return (String) get(2); - } - - /** - * Setter for public.launch_attribute_rules.value. - */ - public void setValue(String value) { - set(3, value); - } - - /** - * Getter for public.launch_attribute_rules.value. - */ - public String getValue() { - return (String) get(3); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID; - } - - @Override - public Field field2() { - return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.SENDER_CASE_ID; - } - - @Override - public Field field3() { - return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.KEY; - } - - @Override - public Field field4() { - return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.VALUE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getSenderCaseId(); - } - - @Override - public String component3() { - return getKey(); - } - - @Override - public String component4() { - return getValue(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getSenderCaseId(); - } - - @Override - public String value3() { - return getKey(); - } - - @Override - public String value4() { - return getValue(); - } - - @Override - public JLaunchAttributeRulesRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JLaunchAttributeRulesRecord value2(Long value) { - setSenderCaseId(value); - return this; - } - - @Override - public JLaunchAttributeRulesRecord value3(String value) { - setKey(value); - return this; - } - - @Override - public JLaunchAttributeRulesRecord value4(String value) { - setValue(value); - return this; - } - - @Override - public JLaunchAttributeRulesRecord values(Long value1, Long value2, String value3, String value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JLaunchAttributeRulesRecord - */ - public JLaunchAttributeRulesRecord() { - super(JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES); - } - - /** - * Create a detached, initialised JLaunchAttributeRulesRecord - */ - public JLaunchAttributeRulesRecord(Long id, Long senderCaseId, String key, String value) { - super(JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES); - - set(0, id); - set(1, senderCaseId); - set(2, key); - set(3, value); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JLaunchAttributeRulesRecord extends + UpdatableRecordImpl implements + Record4 { + + private static final long serialVersionUID = -95178244; + + /** + * Create a detached JLaunchAttributeRulesRecord + */ + public JLaunchAttributeRulesRecord() { + super(JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES); + } + + /** + * Create a detached, initialised JLaunchAttributeRulesRecord + */ + public JLaunchAttributeRulesRecord(Long id, Long senderCaseId, String key, String value) { + super(JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES); + + set(0, id); + set(1, senderCaseId); + set(2, key); + set(3, value); + } + + /** + * Getter for public.launch_attribute_rules.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.launch_attribute_rules.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.launch_attribute_rules.sender_case_id. + */ + public Long getSenderCaseId() { + return (Long) get(1); + } + + /** + * Setter for public.launch_attribute_rules.sender_case_id. + */ + public void setSenderCaseId(Long value) { + set(1, value); + } + + /** + * Getter for public.launch_attribute_rules.key. + */ + public String getKey() { + return (String) get(2); + } + + /** + * Setter for public.launch_attribute_rules.key. + */ + public void setKey(String value) { + set(2, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.launch_attribute_rules.value. + */ + public String getValue() { + return (String) get(3); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.launch_attribute_rules.value. + */ + public void setValue(String value) { + set(3, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID; + } + + @Override + public Field field2() { + return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.SENDER_CASE_ID; + } + + @Override + public Field field3() { + return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.KEY; + } + + @Override + public Field field4() { + return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.VALUE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getSenderCaseId(); + } + + @Override + public String component3() { + return getKey(); + } + + @Override + public String component4() { + return getValue(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getSenderCaseId(); + } + + @Override + public String value3() { + return getKey(); + } + + @Override + public String value4() { + return getValue(); + } + + @Override + public JLaunchAttributeRulesRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JLaunchAttributeRulesRecord value2(Long value) { + setSenderCaseId(value); + return this; + } + + @Override + public JLaunchAttributeRulesRecord value3(String value) { + setKey(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JLaunchAttributeRulesRecord value4(String value) { + setValue(value); + return this; + } + + @Override + public JLaunchAttributeRulesRecord values(Long value1, Long value2, String value3, + String value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNamesRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNamesRecord.java index 7e2283a23..c045d55b3 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNamesRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNamesRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JLaunchNames; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -24,120 +22,121 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JLaunchNamesRecord extends TableRecordImpl implements Record2 { - - private static final long serialVersionUID = -1168746037; - - /** - * Setter for public.launch_names.sender_case_id. - */ - public void setSenderCaseId(Long value) { - set(0, value); - } - - /** - * Getter for public.launch_names.sender_case_id. - */ - public Long getSenderCaseId() { - return (Long) get(0); - } - - /** - * Setter for public.launch_names.launch_name. - */ - public void setLaunchName(String value) { - set(1, value); - } - - /** - * Getter for public.launch_names.launch_name. - */ - public String getLaunchName() { - return (String) get(1); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JLaunchNames.LAUNCH_NAMES.SENDER_CASE_ID; - } - - @Override - public Field field2() { - return JLaunchNames.LAUNCH_NAMES.LAUNCH_NAME; - } - - @Override - public Long component1() { - return getSenderCaseId(); - } - - @Override - public String component2() { - return getLaunchName(); - } - - @Override - public Long value1() { - return getSenderCaseId(); - } - - @Override - public String value2() { - return getLaunchName(); - } - - @Override - public JLaunchNamesRecord value1(Long value) { - setSenderCaseId(value); - return this; - } - - @Override - public JLaunchNamesRecord value2(String value) { - setLaunchName(value); - return this; - } - - @Override - public JLaunchNamesRecord values(Long value1, String value2) { - value1(value1); - value2(value2); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JLaunchNamesRecord - */ - public JLaunchNamesRecord() { - super(JLaunchNames.LAUNCH_NAMES); - } - - /** - * Create a detached, initialised JLaunchNamesRecord - */ - public JLaunchNamesRecord(Long senderCaseId, String launchName) { - super(JLaunchNames.LAUNCH_NAMES); - - set(0, senderCaseId); - set(1, launchName); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JLaunchNamesRecord extends TableRecordImpl implements + Record2 { + + private static final long serialVersionUID = -1168746037; + + /** + * Create a detached JLaunchNamesRecord + */ + public JLaunchNamesRecord() { + super(JLaunchNames.LAUNCH_NAMES); + } + + /** + * Create a detached, initialised JLaunchNamesRecord + */ + public JLaunchNamesRecord(Long senderCaseId, String launchName) { + super(JLaunchNames.LAUNCH_NAMES); + + set(0, senderCaseId); + set(1, launchName); + } + + /** + * Getter for public.launch_names.sender_case_id. + */ + public Long getSenderCaseId() { + return (Long) get(0); + } + + /** + * Setter for public.launch_names.sender_case_id. + */ + public void setSenderCaseId(Long value) { + set(0, value); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + /** + * Getter for public.launch_names.launch_name. + */ + public String getLaunchName() { + return (String) get(1); + } + + /** + * Setter for public.launch_names.launch_name. + */ + public void setLaunchName(String value) { + set(1, value); + } + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JLaunchNames.LAUNCH_NAMES.SENDER_CASE_ID; + } + + @Override + public Field field2() { + return JLaunchNames.LAUNCH_NAMES.LAUNCH_NAME; + } + + @Override + public Long component1() { + return getSenderCaseId(); + } + + @Override + public String component2() { + return getLaunchName(); + } + + @Override + public Long value1() { + return getSenderCaseId(); + } + + @Override + public String value2() { + return getLaunchName(); + } + + @Override + public JLaunchNamesRecord value1(Long value) { + setSenderCaseId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JLaunchNamesRecord value2(String value) { + setLaunchName(value); + return this; + } + + @Override + public JLaunchNamesRecord values(Long value1, String value2) { + value1(value1); + value2(value2); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNumberRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNumberRecord.java index fba7c8831..86c37d81b 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNumberRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNumberRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -25,203 +23,204 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JLaunchNumberRecord extends UpdatableRecordImpl implements Record4 { - - private static final long serialVersionUID = -1978268674; - - /** - * Setter for public.launch_number.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.launch_number.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.launch_number.project_id. - */ - public void setProjectId(Long value) { - set(1, value); - } - - /** - * Getter for public.launch_number.project_id. - */ - public Long getProjectId() { - return (Long) get(1); - } - - /** - * Setter for public.launch_number.launch_name. - */ - public void setLaunchName(String value) { - set(2, value); - } - - /** - * Getter for public.launch_number.launch_name. - */ - public String getLaunchName() { - return (String) get(2); - } - - /** - * Setter for public.launch_number.number. - */ - public void setNumber(Integer value) { - set(3, value); - } - - /** - * Getter for public.launch_number.number. - */ - public Integer getNumber() { - return (Integer) get(3); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JLaunchNumber.LAUNCH_NUMBER.ID; - } - - @Override - public Field field2() { - return JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID; - } - - @Override - public Field field3() { - return JLaunchNumber.LAUNCH_NUMBER.LAUNCH_NAME; - } - - @Override - public Field field4() { - return JLaunchNumber.LAUNCH_NUMBER.NUMBER; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getProjectId(); - } - - @Override - public String component3() { - return getLaunchName(); - } - - @Override - public Integer component4() { - return getNumber(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getProjectId(); - } - - @Override - public String value3() { - return getLaunchName(); - } - - @Override - public Integer value4() { - return getNumber(); - } - - @Override - public JLaunchNumberRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JLaunchNumberRecord value2(Long value) { - setProjectId(value); - return this; - } - - @Override - public JLaunchNumberRecord value3(String value) { - setLaunchName(value); - return this; - } - - @Override - public JLaunchNumberRecord value4(Integer value) { - setNumber(value); - return this; - } - - @Override - public JLaunchNumberRecord values(Long value1, Long value2, String value3, Integer value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JLaunchNumberRecord - */ - public JLaunchNumberRecord() { - super(JLaunchNumber.LAUNCH_NUMBER); - } - - /** - * Create a detached, initialised JLaunchNumberRecord - */ - public JLaunchNumberRecord(Long id, Long projectId, String launchName, Integer number) { - super(JLaunchNumber.LAUNCH_NUMBER); - - set(0, id); - set(1, projectId); - set(2, launchName); - set(3, number); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JLaunchNumberRecord extends UpdatableRecordImpl implements + Record4 { + + private static final long serialVersionUID = -1978268674; + + /** + * Create a detached JLaunchNumberRecord + */ + public JLaunchNumberRecord() { + super(JLaunchNumber.LAUNCH_NUMBER); + } + + /** + * Create a detached, initialised JLaunchNumberRecord + */ + public JLaunchNumberRecord(Long id, Long projectId, String launchName, Integer number) { + super(JLaunchNumber.LAUNCH_NUMBER); + + set(0, id); + set(1, projectId); + set(2, launchName); + set(3, number); + } + + /** + * Getter for public.launch_number.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.launch_number.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.launch_number.project_id. + */ + public Long getProjectId() { + return (Long) get(1); + } + + /** + * Setter for public.launch_number.project_id. + */ + public void setProjectId(Long value) { + set(1, value); + } + + /** + * Getter for public.launch_number.launch_name. + */ + public String getLaunchName() { + return (String) get(2); + } + + /** + * Setter for public.launch_number.launch_name. + */ + public void setLaunchName(String value) { + set(2, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.launch_number.number. + */ + public Integer getNumber() { + return (Integer) get(3); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.launch_number.number. + */ + public void setNumber(Integer value) { + set(3, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JLaunchNumber.LAUNCH_NUMBER.ID; + } + + @Override + public Field field2() { + return JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID; + } + + @Override + public Field field3() { + return JLaunchNumber.LAUNCH_NUMBER.LAUNCH_NAME; + } + + @Override + public Field field4() { + return JLaunchNumber.LAUNCH_NUMBER.NUMBER; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getProjectId(); + } + + @Override + public String component3() { + return getLaunchName(); + } + + @Override + public Integer component4() { + return getNumber(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getProjectId(); + } + + @Override + public String value3() { + return getLaunchName(); + } + + @Override + public Integer value4() { + return getNumber(); + } + + @Override + public JLaunchNumberRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JLaunchNumberRecord value2(Long value) { + setProjectId(value); + return this; + } + + @Override + public JLaunchNumberRecord value3(String value) { + setLaunchName(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JLaunchNumberRecord value4(Integer value) { + setNumber(value); + return this; + } + + @Override + public JLaunchNumberRecord values(Long value1, Long value2, String value3, Integer value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchRecord.java index 836b343c3..c7ac0a183 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchRecord.java @@ -7,11 +7,8 @@ import com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum; import com.epam.ta.reportportal.jooq.enums.JStatusEnum; import com.epam.ta.reportportal.jooq.tables.JLaunch; - import java.sql.Timestamp; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record15; @@ -29,610 +26,617 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JLaunchRecord extends UpdatableRecordImpl implements Record15 { - - private static final long serialVersionUID = 2143234608; - - /** - * Setter for public.launch.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.launch.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.launch.uuid. - */ - public void setUuid(String value) { - set(1, value); - } - - /** - * Getter for public.launch.uuid. - */ - public String getUuid() { - return (String) get(1); - } - - /** - * Setter for public.launch.project_id. - */ - public void setProjectId(Long value) { - set(2, value); - } - - /** - * Getter for public.launch.project_id. - */ - public Long getProjectId() { - return (Long) get(2); - } - - /** - * Setter for public.launch.user_id. - */ - public void setUserId(Long value) { - set(3, value); - } - - /** - * Getter for public.launch.user_id. - */ - public Long getUserId() { - return (Long) get(3); - } - - /** - * Setter for public.launch.name. - */ - public void setName(String value) { - set(4, value); - } - - /** - * Getter for public.launch.name. - */ - public String getName() { - return (String) get(4); - } - - /** - * Setter for public.launch.description. - */ - public void setDescription(String value) { - set(5, value); - } - - /** - * Getter for public.launch.description. - */ - public String getDescription() { - return (String) get(5); - } - - /** - * Setter for public.launch.start_time. - */ - public void setStartTime(Timestamp value) { - set(6, value); - } - - /** - * Getter for public.launch.start_time. - */ - public Timestamp getStartTime() { - return (Timestamp) get(6); - } - - /** - * Setter for public.launch.end_time. - */ - public void setEndTime(Timestamp value) { - set(7, value); - } - - /** - * Getter for public.launch.end_time. - */ - public Timestamp getEndTime() { - return (Timestamp) get(7); - } - - /** - * Setter for public.launch.number. - */ - public void setNumber(Integer value) { - set(8, value); - } - - /** - * Getter for public.launch.number. - */ - public Integer getNumber() { - return (Integer) get(8); - } - - /** - * Setter for public.launch.last_modified. - */ - public void setLastModified(Timestamp value) { - set(9, value); - } - - /** - * Getter for public.launch.last_modified. - */ - public Timestamp getLastModified() { - return (Timestamp) get(9); - } - - /** - * Setter for public.launch.mode. - */ - public void setMode(JLaunchModeEnum value) { - set(10, value); - } - - /** - * Getter for public.launch.mode. - */ - public JLaunchModeEnum getMode() { - return (JLaunchModeEnum) get(10); - } - - /** - * Setter for public.launch.status. - */ - public void setStatus(JStatusEnum value) { - set(11, value); - } - - /** - * Getter for public.launch.status. - */ - public JStatusEnum getStatus() { - return (JStatusEnum) get(11); - } - - /** - * Setter for public.launch.has_retries. - */ - public void setHasRetries(Boolean value) { - set(12, value); - } - - /** - * Getter for public.launch.has_retries. - */ - public Boolean getHasRetries() { - return (Boolean) get(12); - } - - /** - * Setter for public.launch.rerun. - */ - public void setRerun(Boolean value) { - set(13, value); - } - - /** - * Getter for public.launch.rerun. - */ - public Boolean getRerun() { - return (Boolean) get(13); - } - - /** - * Setter for public.launch.approximate_duration. - */ - public void setApproximateDuration(Double value) { - set(14, value); - } - - /** - * Getter for public.launch.approximate_duration. - */ - public Double getApproximateDuration() { - return (Double) get(14); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record15 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row15 fieldsRow() { - return (Row15) super.fieldsRow(); - } - - @Override - public Row15 valuesRow() { - return (Row15) super.valuesRow(); - } - - @Override - public Field field1() { - return JLaunch.LAUNCH.ID; - } - - @Override - public Field field2() { - return JLaunch.LAUNCH.UUID; - } - - @Override - public Field field3() { - return JLaunch.LAUNCH.PROJECT_ID; - } - - @Override - public Field field4() { - return JLaunch.LAUNCH.USER_ID; - } - - @Override - public Field field5() { - return JLaunch.LAUNCH.NAME; - } - - @Override - public Field field6() { - return JLaunch.LAUNCH.DESCRIPTION; - } - - @Override - public Field field7() { - return JLaunch.LAUNCH.START_TIME; - } - - @Override - public Field field8() { - return JLaunch.LAUNCH.END_TIME; - } - - @Override - public Field field9() { - return JLaunch.LAUNCH.NUMBER; - } - - @Override - public Field field10() { - return JLaunch.LAUNCH.LAST_MODIFIED; - } - - @Override - public Field field11() { - return JLaunch.LAUNCH.MODE; - } - - @Override - public Field field12() { - return JLaunch.LAUNCH.STATUS; - } - - @Override - public Field field13() { - return JLaunch.LAUNCH.HAS_RETRIES; - } - - @Override - public Field field14() { - return JLaunch.LAUNCH.RERUN; - } - - @Override - public Field field15() { - return JLaunch.LAUNCH.APPROXIMATE_DURATION; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getUuid(); - } - - @Override - public Long component3() { - return getProjectId(); - } - - @Override - public Long component4() { - return getUserId(); - } - - @Override - public String component5() { - return getName(); - } - - @Override - public String component6() { - return getDescription(); - } - - @Override - public Timestamp component7() { - return getStartTime(); - } - - @Override - public Timestamp component8() { - return getEndTime(); - } - - @Override - public Integer component9() { - return getNumber(); - } - - @Override - public Timestamp component10() { - return getLastModified(); - } - - @Override - public JLaunchModeEnum component11() { - return getMode(); - } - - @Override - public JStatusEnum component12() { - return getStatus(); - } - - @Override - public Boolean component13() { - return getHasRetries(); - } - - @Override - public Boolean component14() { - return getRerun(); - } - - @Override - public Double component15() { - return getApproximateDuration(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getUuid(); - } - - @Override - public Long value3() { - return getProjectId(); - } - - @Override - public Long value4() { - return getUserId(); - } - - @Override - public String value5() { - return getName(); - } - - @Override - public String value6() { - return getDescription(); - } - - @Override - public Timestamp value7() { - return getStartTime(); - } - - @Override - public Timestamp value8() { - return getEndTime(); - } - - @Override - public Integer value9() { - return getNumber(); - } - - @Override - public Timestamp value10() { - return getLastModified(); - } - - @Override - public JLaunchModeEnum value11() { - return getMode(); - } - - @Override - public JStatusEnum value12() { - return getStatus(); - } - - @Override - public Boolean value13() { - return getHasRetries(); - } - - @Override - public Boolean value14() { - return getRerun(); - } - - @Override - public Double value15() { - return getApproximateDuration(); - } - - @Override - public JLaunchRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JLaunchRecord value2(String value) { - setUuid(value); - return this; - } - - @Override - public JLaunchRecord value3(Long value) { - setProjectId(value); - return this; - } - - @Override - public JLaunchRecord value4(Long value) { - setUserId(value); - return this; - } - - @Override - public JLaunchRecord value5(String value) { - setName(value); - return this; - } - - @Override - public JLaunchRecord value6(String value) { - setDescription(value); - return this; - } - - @Override - public JLaunchRecord value7(Timestamp value) { - setStartTime(value); - return this; - } - - @Override - public JLaunchRecord value8(Timestamp value) { - setEndTime(value); - return this; - } - - @Override - public JLaunchRecord value9(Integer value) { - setNumber(value); - return this; - } - - @Override - public JLaunchRecord value10(Timestamp value) { - setLastModified(value); - return this; - } - - @Override - public JLaunchRecord value11(JLaunchModeEnum value) { - setMode(value); - return this; - } - - @Override - public JLaunchRecord value12(JStatusEnum value) { - setStatus(value); - return this; - } - - @Override - public JLaunchRecord value13(Boolean value) { - setHasRetries(value); - return this; - } - - @Override - public JLaunchRecord value14(Boolean value) { - setRerun(value); - return this; - } - - @Override - public JLaunchRecord value15(Double value) { - setApproximateDuration(value); - return this; - } - - @Override - public JLaunchRecord values(Long value1, String value2, Long value3, Long value4, String value5, String value6, Timestamp value7, Timestamp value8, Integer value9, Timestamp value10, JLaunchModeEnum value11, JStatusEnum value12, Boolean value13, Boolean value14, Double value15) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - value12(value12); - value13(value13); - value14(value14); - value15(value15); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JLaunchRecord - */ - public JLaunchRecord() { - super(JLaunch.LAUNCH); - } - - /** - * Create a detached, initialised JLaunchRecord - */ - public JLaunchRecord(Long id, String uuid, Long projectId, Long userId, String name, String description, Timestamp startTime, Timestamp endTime, Integer number, Timestamp lastModified, JLaunchModeEnum mode, JStatusEnum status, Boolean hasRetries, Boolean rerun, Double approximateDuration) { - super(JLaunch.LAUNCH); - - set(0, id); - set(1, uuid); - set(2, projectId); - set(3, userId); - set(4, name); - set(5, description); - set(6, startTime); - set(7, endTime); - set(8, number); - set(9, lastModified); - set(10, mode); - set(11, status); - set(12, hasRetries); - set(13, rerun); - set(14, approximateDuration); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JLaunchRecord extends UpdatableRecordImpl implements + Record15 { + + private static final long serialVersionUID = 2143234608; + + /** + * Create a detached JLaunchRecord + */ + public JLaunchRecord() { + super(JLaunch.LAUNCH); + } + + /** + * Create a detached, initialised JLaunchRecord + */ + public JLaunchRecord(Long id, String uuid, Long projectId, Long userId, String name, + String description, Timestamp startTime, Timestamp endTime, Integer number, + Timestamp lastModified, JLaunchModeEnum mode, JStatusEnum status, Boolean hasRetries, + Boolean rerun, Double approximateDuration) { + super(JLaunch.LAUNCH); + + set(0, id); + set(1, uuid); + set(2, projectId); + set(3, userId); + set(4, name); + set(5, description); + set(6, startTime); + set(7, endTime); + set(8, number); + set(9, lastModified); + set(10, mode); + set(11, status); + set(12, hasRetries); + set(13, rerun); + set(14, approximateDuration); + } + + /** + * Getter for public.launch.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.launch.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.launch.uuid. + */ + public String getUuid() { + return (String) get(1); + } + + /** + * Setter for public.launch.uuid. + */ + public void setUuid(String value) { + set(1, value); + } + + /** + * Getter for public.launch.project_id. + */ + public Long getProjectId() { + return (Long) get(2); + } + + /** + * Setter for public.launch.project_id. + */ + public void setProjectId(Long value) { + set(2, value); + } + + /** + * Getter for public.launch.user_id. + */ + public Long getUserId() { + return (Long) get(3); + } + + /** + * Setter for public.launch.user_id. + */ + public void setUserId(Long value) { + set(3, value); + } + + /** + * Getter for public.launch.name. + */ + public String getName() { + return (String) get(4); + } + + /** + * Setter for public.launch.name. + */ + public void setName(String value) { + set(4, value); + } + + /** + * Getter for public.launch.description. + */ + public String getDescription() { + return (String) get(5); + } + + /** + * Setter for public.launch.description. + */ + public void setDescription(String value) { + set(5, value); + } + + /** + * Getter for public.launch.start_time. + */ + public Timestamp getStartTime() { + return (Timestamp) get(6); + } + + /** + * Setter for public.launch.start_time. + */ + public void setStartTime(Timestamp value) { + set(6, value); + } + + /** + * Getter for public.launch.end_time. + */ + public Timestamp getEndTime() { + return (Timestamp) get(7); + } + + /** + * Setter for public.launch.end_time. + */ + public void setEndTime(Timestamp value) { + set(7, value); + } + + /** + * Getter for public.launch.number. + */ + public Integer getNumber() { + return (Integer) get(8); + } + + /** + * Setter for public.launch.number. + */ + public void setNumber(Integer value) { + set(8, value); + } + + /** + * Getter for public.launch.last_modified. + */ + public Timestamp getLastModified() { + return (Timestamp) get(9); + } + + /** + * Setter for public.launch.last_modified. + */ + public void setLastModified(Timestamp value) { + set(9, value); + } + + /** + * Getter for public.launch.mode. + */ + public JLaunchModeEnum getMode() { + return (JLaunchModeEnum) get(10); + } + + /** + * Setter for public.launch.mode. + */ + public void setMode(JLaunchModeEnum value) { + set(10, value); + } + + /** + * Getter for public.launch.status. + */ + public JStatusEnum getStatus() { + return (JStatusEnum) get(11); + } + + /** + * Setter for public.launch.status. + */ + public void setStatus(JStatusEnum value) { + set(11, value); + } + + /** + * Getter for public.launch.has_retries. + */ + public Boolean getHasRetries() { + return (Boolean) get(12); + } + + /** + * Setter for public.launch.has_retries. + */ + public void setHasRetries(Boolean value) { + set(12, value); + } + + /** + * Getter for public.launch.rerun. + */ + public Boolean getRerun() { + return (Boolean) get(13); + } + + /** + * Setter for public.launch.rerun. + */ + public void setRerun(Boolean value) { + set(13, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.launch.approximate_duration. + */ + public Double getApproximateDuration() { + return (Double) get(14); + } + + // ------------------------------------------------------------------------- + // Record15 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.launch.approximate_duration. + */ + public void setApproximateDuration(Double value) { + set(14, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row15 fieldsRow() { + return (Row15) super.fieldsRow(); + } + + @Override + public Row15 valuesRow() { + return (Row15) super.valuesRow(); + } + + @Override + public Field field1() { + return JLaunch.LAUNCH.ID; + } + + @Override + public Field field2() { + return JLaunch.LAUNCH.UUID; + } + + @Override + public Field field3() { + return JLaunch.LAUNCH.PROJECT_ID; + } + + @Override + public Field field4() { + return JLaunch.LAUNCH.USER_ID; + } + + @Override + public Field field5() { + return JLaunch.LAUNCH.NAME; + } + + @Override + public Field field6() { + return JLaunch.LAUNCH.DESCRIPTION; + } + + @Override + public Field field7() { + return JLaunch.LAUNCH.START_TIME; + } + + @Override + public Field field8() { + return JLaunch.LAUNCH.END_TIME; + } + + @Override + public Field field9() { + return JLaunch.LAUNCH.NUMBER; + } + + @Override + public Field field10() { + return JLaunch.LAUNCH.LAST_MODIFIED; + } + + @Override + public Field field11() { + return JLaunch.LAUNCH.MODE; + } + + @Override + public Field field12() { + return JLaunch.LAUNCH.STATUS; + } + + @Override + public Field field13() { + return JLaunch.LAUNCH.HAS_RETRIES; + } + + @Override + public Field field14() { + return JLaunch.LAUNCH.RERUN; + } + + @Override + public Field field15() { + return JLaunch.LAUNCH.APPROXIMATE_DURATION; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getUuid(); + } + + @Override + public Long component3() { + return getProjectId(); + } + + @Override + public Long component4() { + return getUserId(); + } + + @Override + public String component5() { + return getName(); + } + + @Override + public String component6() { + return getDescription(); + } + + @Override + public Timestamp component7() { + return getStartTime(); + } + + @Override + public Timestamp component8() { + return getEndTime(); + } + + @Override + public Integer component9() { + return getNumber(); + } + + @Override + public Timestamp component10() { + return getLastModified(); + } + + @Override + public JLaunchModeEnum component11() { + return getMode(); + } + + @Override + public JStatusEnum component12() { + return getStatus(); + } + + @Override + public Boolean component13() { + return getHasRetries(); + } + + @Override + public Boolean component14() { + return getRerun(); + } + + @Override + public Double component15() { + return getApproximateDuration(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getUuid(); + } + + @Override + public Long value3() { + return getProjectId(); + } + + @Override + public Long value4() { + return getUserId(); + } + + @Override + public String value5() { + return getName(); + } + + @Override + public String value6() { + return getDescription(); + } + + @Override + public Timestamp value7() { + return getStartTime(); + } + + @Override + public Timestamp value8() { + return getEndTime(); + } + + @Override + public Integer value9() { + return getNumber(); + } + + @Override + public Timestamp value10() { + return getLastModified(); + } + + @Override + public JLaunchModeEnum value11() { + return getMode(); + } + + @Override + public JStatusEnum value12() { + return getStatus(); + } + + @Override + public Boolean value13() { + return getHasRetries(); + } + + @Override + public Boolean value14() { + return getRerun(); + } + + @Override + public Double value15() { + return getApproximateDuration(); + } + + @Override + public JLaunchRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JLaunchRecord value2(String value) { + setUuid(value); + return this; + } + + @Override + public JLaunchRecord value3(Long value) { + setProjectId(value); + return this; + } + + @Override + public JLaunchRecord value4(Long value) { + setUserId(value); + return this; + } + + @Override + public JLaunchRecord value5(String value) { + setName(value); + return this; + } + + @Override + public JLaunchRecord value6(String value) { + setDescription(value); + return this; + } + + @Override + public JLaunchRecord value7(Timestamp value) { + setStartTime(value); + return this; + } + + @Override + public JLaunchRecord value8(Timestamp value) { + setEndTime(value); + return this; + } + + @Override + public JLaunchRecord value9(Integer value) { + setNumber(value); + return this; + } + + @Override + public JLaunchRecord value10(Timestamp value) { + setLastModified(value); + return this; + } + + @Override + public JLaunchRecord value11(JLaunchModeEnum value) { + setMode(value); + return this; + } + + @Override + public JLaunchRecord value12(JStatusEnum value) { + setStatus(value); + return this; + } + + @Override + public JLaunchRecord value13(Boolean value) { + setHasRetries(value); + return this; + } + + @Override + public JLaunchRecord value14(Boolean value) { + setRerun(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JLaunchRecord value15(Double value) { + setApproximateDuration(value); + return this; + } + + @Override + public JLaunchRecord values(Long value1, String value2, Long value3, Long value4, String value5, + String value6, Timestamp value7, Timestamp value8, Integer value9, Timestamp value10, + JLaunchModeEnum value11, JStatusEnum value12, Boolean value13, Boolean value14, + Double value15) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + value15(value15); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLogRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLogRecord.java index 7b0c6c5f3..2b1c88c41 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLogRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLogRecord.java @@ -5,11 +5,8 @@ import com.epam.ta.reportportal.jooq.tables.JLog; - import java.sql.Timestamp; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record11; @@ -27,462 +24,466 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JLogRecord extends UpdatableRecordImpl implements Record11 { - - private static final long serialVersionUID = 560244651; - - /** - * Setter for public.log.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.log.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.log.uuid. - */ - public void setUuid(String value) { - set(1, value); - } - - /** - * Getter for public.log.uuid. - */ - public String getUuid() { - return (String) get(1); - } - - /** - * Setter for public.log.log_time. - */ - public void setLogTime(Timestamp value) { - set(2, value); - } - - /** - * Getter for public.log.log_time. - */ - public Timestamp getLogTime() { - return (Timestamp) get(2); - } - - /** - * Setter for public.log.log_message. - */ - public void setLogMessage(String value) { - set(3, value); - } - - /** - * Getter for public.log.log_message. - */ - public String getLogMessage() { - return (String) get(3); - } - - /** - * Setter for public.log.item_id. - */ - public void setItemId(Long value) { - set(4, value); - } - - /** - * Getter for public.log.item_id. - */ - public Long getItemId() { - return (Long) get(4); - } - - /** - * Setter for public.log.launch_id. - */ - public void setLaunchId(Long value) { - set(5, value); - } - - /** - * Getter for public.log.launch_id. - */ - public Long getLaunchId() { - return (Long) get(5); - } - - /** - * Setter for public.log.last_modified. - */ - public void setLastModified(Timestamp value) { - set(6, value); - } - - /** - * Getter for public.log.last_modified. - */ - public Timestamp getLastModified() { - return (Timestamp) get(6); - } - - /** - * Setter for public.log.log_level. - */ - public void setLogLevel(Integer value) { - set(7, value); - } - - /** - * Getter for public.log.log_level. - */ - public Integer getLogLevel() { - return (Integer) get(7); - } - - /** - * Setter for public.log.attachment_id. - */ - public void setAttachmentId(Long value) { - set(8, value); - } - - /** - * Getter for public.log.attachment_id. - */ - public Long getAttachmentId() { - return (Long) get(8); - } - - /** - * Setter for public.log.project_id. - */ - public void setProjectId(Long value) { - set(9, value); - } - - /** - * Getter for public.log.project_id. - */ - public Long getProjectId() { - return (Long) get(9); - } - - /** - * Setter for public.log.cluster_id. - */ - public void setClusterId(Long value) { - set(10, value); - } - - /** - * Getter for public.log.cluster_id. - */ - public Long getClusterId() { - return (Long) get(10); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record11 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); - } - - @Override - public Row11 valuesRow() { - return (Row11) super.valuesRow(); - } - - @Override - public Field field1() { - return JLog.LOG.ID; - } - - @Override - public Field field2() { - return JLog.LOG.UUID; - } - - @Override - public Field field3() { - return JLog.LOG.LOG_TIME; - } - - @Override - public Field field4() { - return JLog.LOG.LOG_MESSAGE; - } - - @Override - public Field field5() { - return JLog.LOG.ITEM_ID; - } - - @Override - public Field field6() { - return JLog.LOG.LAUNCH_ID; - } - - @Override - public Field field7() { - return JLog.LOG.LAST_MODIFIED; - } - - @Override - public Field field8() { - return JLog.LOG.LOG_LEVEL; - } - - @Override - public Field field9() { - return JLog.LOG.ATTACHMENT_ID; - } - - @Override - public Field field10() { - return JLog.LOG.PROJECT_ID; - } - - @Override - public Field field11() { - return JLog.LOG.CLUSTER_ID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getUuid(); - } - - @Override - public Timestamp component3() { - return getLogTime(); - } - - @Override - public String component4() { - return getLogMessage(); - } - - @Override - public Long component5() { - return getItemId(); - } - - @Override - public Long component6() { - return getLaunchId(); - } - - @Override - public Timestamp component7() { - return getLastModified(); - } - - @Override - public Integer component8() { - return getLogLevel(); - } - - @Override - public Long component9() { - return getAttachmentId(); - } - - @Override - public Long component10() { - return getProjectId(); - } - - @Override - public Long component11() { - return getClusterId(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getUuid(); - } - - @Override - public Timestamp value3() { - return getLogTime(); - } - - @Override - public String value4() { - return getLogMessage(); - } - - @Override - public Long value5() { - return getItemId(); - } - - @Override - public Long value6() { - return getLaunchId(); - } - - @Override - public Timestamp value7() { - return getLastModified(); - } - - @Override - public Integer value8() { - return getLogLevel(); - } - - @Override - public Long value9() { - return getAttachmentId(); - } - - @Override - public Long value10() { - return getProjectId(); - } - - @Override - public Long value11() { - return getClusterId(); - } - - @Override - public JLogRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JLogRecord value2(String value) { - setUuid(value); - return this; - } - - @Override - public JLogRecord value3(Timestamp value) { - setLogTime(value); - return this; - } - - @Override - public JLogRecord value4(String value) { - setLogMessage(value); - return this; - } - - @Override - public JLogRecord value5(Long value) { - setItemId(value); - return this; - } - - @Override - public JLogRecord value6(Long value) { - setLaunchId(value); - return this; - } - - @Override - public JLogRecord value7(Timestamp value) { - setLastModified(value); - return this; - } - - @Override - public JLogRecord value8(Integer value) { - setLogLevel(value); - return this; - } - - @Override - public JLogRecord value9(Long value) { - setAttachmentId(value); - return this; - } - - @Override - public JLogRecord value10(Long value) { - setProjectId(value); - return this; - } - - @Override - public JLogRecord value11(Long value) { - setClusterId(value); - return this; - } - - @Override - public JLogRecord values(Long value1, String value2, Timestamp value3, String value4, Long value5, Long value6, Timestamp value7, Integer value8, Long value9, Long value10, Long value11) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JLogRecord - */ - public JLogRecord() { - super(JLog.LOG); - } - - /** - * Create a detached, initialised JLogRecord - */ - public JLogRecord(Long id, String uuid, Timestamp logTime, String logMessage, Long itemId, Long launchId, Timestamp lastModified, Integer logLevel, Long attachmentId, Long projectId, Long clusterId) { - super(JLog.LOG); - - set(0, id); - set(1, uuid); - set(2, logTime); - set(3, logMessage); - set(4, itemId); - set(5, launchId); - set(6, lastModified); - set(7, logLevel); - set(8, attachmentId); - set(9, projectId); - set(10, clusterId); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JLogRecord extends UpdatableRecordImpl implements + Record11 { + + private static final long serialVersionUID = 560244651; + + /** + * Create a detached JLogRecord + */ + public JLogRecord() { + super(JLog.LOG); + } + + /** + * Create a detached, initialised JLogRecord + */ + public JLogRecord(Long id, String uuid, Timestamp logTime, String logMessage, Long itemId, + Long launchId, Timestamp lastModified, Integer logLevel, Long attachmentId, Long projectId, + Long clusterId) { + super(JLog.LOG); + + set(0, id); + set(1, uuid); + set(2, logTime); + set(3, logMessage); + set(4, itemId); + set(5, launchId); + set(6, lastModified); + set(7, logLevel); + set(8, attachmentId); + set(9, projectId); + set(10, clusterId); + } + + /** + * Getter for public.log.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.log.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.log.uuid. + */ + public String getUuid() { + return (String) get(1); + } + + /** + * Setter for public.log.uuid. + */ + public void setUuid(String value) { + set(1, value); + } + + /** + * Getter for public.log.log_time. + */ + public Timestamp getLogTime() { + return (Timestamp) get(2); + } + + /** + * Setter for public.log.log_time. + */ + public void setLogTime(Timestamp value) { + set(2, value); + } + + /** + * Getter for public.log.log_message. + */ + public String getLogMessage() { + return (String) get(3); + } + + /** + * Setter for public.log.log_message. + */ + public void setLogMessage(String value) { + set(3, value); + } + + /** + * Getter for public.log.item_id. + */ + public Long getItemId() { + return (Long) get(4); + } + + /** + * Setter for public.log.item_id. + */ + public void setItemId(Long value) { + set(4, value); + } + + /** + * Getter for public.log.launch_id. + */ + public Long getLaunchId() { + return (Long) get(5); + } + + /** + * Setter for public.log.launch_id. + */ + public void setLaunchId(Long value) { + set(5, value); + } + + /** + * Getter for public.log.last_modified. + */ + public Timestamp getLastModified() { + return (Timestamp) get(6); + } + + /** + * Setter for public.log.last_modified. + */ + public void setLastModified(Timestamp value) { + set(6, value); + } + + /** + * Getter for public.log.log_level. + */ + public Integer getLogLevel() { + return (Integer) get(7); + } + + /** + * Setter for public.log.log_level. + */ + public void setLogLevel(Integer value) { + set(7, value); + } + + /** + * Getter for public.log.attachment_id. + */ + public Long getAttachmentId() { + return (Long) get(8); + } + + /** + * Setter for public.log.attachment_id. + */ + public void setAttachmentId(Long value) { + set(8, value); + } + + /** + * Getter for public.log.project_id. + */ + public Long getProjectId() { + return (Long) get(9); + } + + /** + * Setter for public.log.project_id. + */ + public void setProjectId(Long value) { + set(9, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.log.cluster_id. + */ + public Long getClusterId() { + return (Long) get(10); + } + + // ------------------------------------------------------------------------- + // Record11 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.log.cluster_id. + */ + public void setClusterId(Long value) { + set(10, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } + + @Override + public Row11 valuesRow() { + return (Row11) super.valuesRow(); + } + + @Override + public Field field1() { + return JLog.LOG.ID; + } + + @Override + public Field field2() { + return JLog.LOG.UUID; + } + + @Override + public Field field3() { + return JLog.LOG.LOG_TIME; + } + + @Override + public Field field4() { + return JLog.LOG.LOG_MESSAGE; + } + + @Override + public Field field5() { + return JLog.LOG.ITEM_ID; + } + + @Override + public Field field6() { + return JLog.LOG.LAUNCH_ID; + } + + @Override + public Field field7() { + return JLog.LOG.LAST_MODIFIED; + } + + @Override + public Field field8() { + return JLog.LOG.LOG_LEVEL; + } + + @Override + public Field field9() { + return JLog.LOG.ATTACHMENT_ID; + } + + @Override + public Field field10() { + return JLog.LOG.PROJECT_ID; + } + + @Override + public Field field11() { + return JLog.LOG.CLUSTER_ID; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getUuid(); + } + + @Override + public Timestamp component3() { + return getLogTime(); + } + + @Override + public String component4() { + return getLogMessage(); + } + + @Override + public Long component5() { + return getItemId(); + } + + @Override + public Long component6() { + return getLaunchId(); + } + + @Override + public Timestamp component7() { + return getLastModified(); + } + + @Override + public Integer component8() { + return getLogLevel(); + } + + @Override + public Long component9() { + return getAttachmentId(); + } + + @Override + public Long component10() { + return getProjectId(); + } + + @Override + public Long component11() { + return getClusterId(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getUuid(); + } + + @Override + public Timestamp value3() { + return getLogTime(); + } + + @Override + public String value4() { + return getLogMessage(); + } + + @Override + public Long value5() { + return getItemId(); + } + + @Override + public Long value6() { + return getLaunchId(); + } + + @Override + public Timestamp value7() { + return getLastModified(); + } + + @Override + public Integer value8() { + return getLogLevel(); + } + + @Override + public Long value9() { + return getAttachmentId(); + } + + @Override + public Long value10() { + return getProjectId(); + } + + @Override + public Long value11() { + return getClusterId(); + } + + @Override + public JLogRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JLogRecord value2(String value) { + setUuid(value); + return this; + } + + @Override + public JLogRecord value3(Timestamp value) { + setLogTime(value); + return this; + } + + @Override + public JLogRecord value4(String value) { + setLogMessage(value); + return this; + } + + @Override + public JLogRecord value5(Long value) { + setItemId(value); + return this; + } + + @Override + public JLogRecord value6(Long value) { + setLaunchId(value); + return this; + } + + @Override + public JLogRecord value7(Timestamp value) { + setLastModified(value); + return this; + } + + @Override + public JLogRecord value8(Integer value) { + setLogLevel(value); + return this; + } + + @Override + public JLogRecord value9(Long value) { + setAttachmentId(value); + return this; + } + + @Override + public JLogRecord value10(Long value) { + setProjectId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JLogRecord value11(Long value) { + setClusterId(value); + return this; + } + + @Override + public JLogRecord values(Long value1, String value2, Timestamp value3, String value4, Long value5, + Long value6, Timestamp value7, Integer value8, Long value9, Long value10, Long value11) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthAccessTokenRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthAccessTokenRecord.java index 6ed08ed2d..ec91d18b5 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthAccessTokenRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthAccessTokenRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record9; @@ -25,388 +23,391 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JOauthAccessTokenRecord extends UpdatableRecordImpl implements Record9 { - - private static final long serialVersionUID = 1312835184; - - /** - * Setter for public.oauth_access_token.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.oauth_access_token.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.oauth_access_token.token_id. - */ - public void setTokenId(String value) { - set(1, value); - } - - /** - * Getter for public.oauth_access_token.token_id. - */ - public String getTokenId() { - return (String) get(1); - } - - /** - * Setter for public.oauth_access_token.token. - */ - public void setToken(byte... value) { - set(2, value); - } - - /** - * Getter for public.oauth_access_token.token. - */ - public byte[] getToken() { - return (byte[]) get(2); - } - - /** - * Setter for public.oauth_access_token.authentication_id. - */ - public void setAuthenticationId(String value) { - set(3, value); - } - - /** - * Getter for public.oauth_access_token.authentication_id. - */ - public String getAuthenticationId() { - return (String) get(3); - } - - /** - * Setter for public.oauth_access_token.username. - */ - public void setUsername(String value) { - set(4, value); - } - - /** - * Getter for public.oauth_access_token.username. - */ - public String getUsername() { - return (String) get(4); - } - - /** - * Setter for public.oauth_access_token.user_id. - */ - public void setUserId(Long value) { - set(5, value); - } - - /** - * Getter for public.oauth_access_token.user_id. - */ - public Long getUserId() { - return (Long) get(5); - } - - /** - * Setter for public.oauth_access_token.client_id. - */ - public void setClientId(String value) { - set(6, value); - } - - /** - * Getter for public.oauth_access_token.client_id. - */ - public String getClientId() { - return (String) get(6); - } - - /** - * Setter for public.oauth_access_token.authentication. - */ - public void setAuthentication(byte... value) { - set(7, value); - } - - /** - * Getter for public.oauth_access_token.authentication. - */ - public byte[] getAuthentication() { - return (byte[]) get(7); - } - - /** - * Setter for public.oauth_access_token.refresh_token. - */ - public void setRefreshToken(String value) { - set(8, value); - } - - /** - * Getter for public.oauth_access_token.refresh_token. - */ - public String getRefreshToken() { - return (String) get(8); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record9 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } - - @Override - public Row9 valuesRow() { - return (Row9) super.valuesRow(); - } - - @Override - public Field field1() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID; - } - - @Override - public Field field2() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN_ID; - } - - @Override - public Field field3() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN; - } - - @Override - public Field field4() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.AUTHENTICATION_ID; - } - - @Override - public Field field5() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.USERNAME; - } - - @Override - public Field field6() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID; - } - - @Override - public Field field7() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.CLIENT_ID; - } - - @Override - public Field field8() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.AUTHENTICATION; - } - - @Override - public Field field9() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.REFRESH_TOKEN; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getTokenId(); - } - - @Override - public byte[] component3() { - return getToken(); - } - - @Override - public String component4() { - return getAuthenticationId(); - } - - @Override - public String component5() { - return getUsername(); - } - - @Override - public Long component6() { - return getUserId(); - } - - @Override - public String component7() { - return getClientId(); - } - - @Override - public byte[] component8() { - return getAuthentication(); - } - - @Override - public String component9() { - return getRefreshToken(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getTokenId(); - } - - @Override - public byte[] value3() { - return getToken(); - } - - @Override - public String value4() { - return getAuthenticationId(); - } - - @Override - public String value5() { - return getUsername(); - } - - @Override - public Long value6() { - return getUserId(); - } - - @Override - public String value7() { - return getClientId(); - } - - @Override - public byte[] value8() { - return getAuthentication(); - } - - @Override - public String value9() { - return getRefreshToken(); - } - - @Override - public JOauthAccessTokenRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value2(String value) { - setTokenId(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value3(byte... value) { - setToken(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value4(String value) { - setAuthenticationId(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value5(String value) { - setUsername(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value6(Long value) { - setUserId(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value7(String value) { - setClientId(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value8(byte... value) { - setAuthentication(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value9(String value) { - setRefreshToken(value); - return this; - } - - @Override - public JOauthAccessTokenRecord values(Long value1, String value2, byte[] value3, String value4, String value5, Long value6, String value7, byte[] value8, String value9) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JOauthAccessTokenRecord - */ - public JOauthAccessTokenRecord() { - super(JOauthAccessToken.OAUTH_ACCESS_TOKEN); - } - - /** - * Create a detached, initialised JOauthAccessTokenRecord - */ - public JOauthAccessTokenRecord(Long id, String tokenId, byte[] token, String authenticationId, String username, Long userId, String clientId, byte[] authentication, String refreshToken) { - super(JOauthAccessToken.OAUTH_ACCESS_TOKEN); - - set(0, id); - set(1, tokenId); - set(2, token); - set(3, authenticationId); - set(4, username); - set(5, userId); - set(6, clientId); - set(7, authentication); - set(8, refreshToken); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JOauthAccessTokenRecord extends UpdatableRecordImpl implements + Record9 { + + private static final long serialVersionUID = 1312835184; + + /** + * Create a detached JOauthAccessTokenRecord + */ + public JOauthAccessTokenRecord() { + super(JOauthAccessToken.OAUTH_ACCESS_TOKEN); + } + + /** + * Create a detached, initialised JOauthAccessTokenRecord + */ + public JOauthAccessTokenRecord(Long id, String tokenId, byte[] token, String authenticationId, + String username, Long userId, String clientId, byte[] authentication, String refreshToken) { + super(JOauthAccessToken.OAUTH_ACCESS_TOKEN); + + set(0, id); + set(1, tokenId); + set(2, token); + set(3, authenticationId); + set(4, username); + set(5, userId); + set(6, clientId); + set(7, authentication); + set(8, refreshToken); + } + + /** + * Getter for public.oauth_access_token.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.oauth_access_token.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.oauth_access_token.token_id. + */ + public String getTokenId() { + return (String) get(1); + } + + /** + * Setter for public.oauth_access_token.token_id. + */ + public void setTokenId(String value) { + set(1, value); + } + + /** + * Getter for public.oauth_access_token.token. + */ + public byte[] getToken() { + return (byte[]) get(2); + } + + /** + * Setter for public.oauth_access_token.token. + */ + public void setToken(byte... value) { + set(2, value); + } + + /** + * Getter for public.oauth_access_token.authentication_id. + */ + public String getAuthenticationId() { + return (String) get(3); + } + + /** + * Setter for public.oauth_access_token.authentication_id. + */ + public void setAuthenticationId(String value) { + set(3, value); + } + + /** + * Getter for public.oauth_access_token.username. + */ + public String getUsername() { + return (String) get(4); + } + + /** + * Setter for public.oauth_access_token.username. + */ + public void setUsername(String value) { + set(4, value); + } + + /** + * Getter for public.oauth_access_token.user_id. + */ + public Long getUserId() { + return (Long) get(5); + } + + /** + * Setter for public.oauth_access_token.user_id. + */ + public void setUserId(Long value) { + set(5, value); + } + + /** + * Getter for public.oauth_access_token.client_id. + */ + public String getClientId() { + return (String) get(6); + } + + /** + * Setter for public.oauth_access_token.client_id. + */ + public void setClientId(String value) { + set(6, value); + } + + /** + * Getter for public.oauth_access_token.authentication. + */ + public byte[] getAuthentication() { + return (byte[]) get(7); + } + + /** + * Setter for public.oauth_access_token.authentication. + */ + public void setAuthentication(byte... value) { + set(7, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.oauth_access_token.refresh_token. + */ + public String getRefreshToken() { + return (String) get(8); + } + + // ------------------------------------------------------------------------- + // Record9 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.oauth_access_token.refresh_token. + */ + public void setRefreshToken(String value) { + set(8, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } + + @Override + public Row9 valuesRow() { + return (Row9) super.valuesRow(); + } + + @Override + public Field field1() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID; + } + + @Override + public Field field2() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN_ID; + } + + @Override + public Field field3() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN; + } + + @Override + public Field field4() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.AUTHENTICATION_ID; + } + + @Override + public Field field5() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.USERNAME; + } + + @Override + public Field field6() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID; + } + + @Override + public Field field7() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.CLIENT_ID; + } + + @Override + public Field field8() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.AUTHENTICATION; + } + + @Override + public Field field9() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.REFRESH_TOKEN; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getTokenId(); + } + + @Override + public byte[] component3() { + return getToken(); + } + + @Override + public String component4() { + return getAuthenticationId(); + } + + @Override + public String component5() { + return getUsername(); + } + + @Override + public Long component6() { + return getUserId(); + } + + @Override + public String component7() { + return getClientId(); + } + + @Override + public byte[] component8() { + return getAuthentication(); + } + + @Override + public String component9() { + return getRefreshToken(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getTokenId(); + } + + @Override + public byte[] value3() { + return getToken(); + } + + @Override + public String value4() { + return getAuthenticationId(); + } + + @Override + public String value5() { + return getUsername(); + } + + @Override + public Long value6() { + return getUserId(); + } + + @Override + public String value7() { + return getClientId(); + } + + @Override + public byte[] value8() { + return getAuthentication(); + } + + @Override + public String value9() { + return getRefreshToken(); + } + + @Override + public JOauthAccessTokenRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JOauthAccessTokenRecord value2(String value) { + setTokenId(value); + return this; + } + + @Override + public JOauthAccessTokenRecord value3(byte... value) { + setToken(value); + return this; + } + + @Override + public JOauthAccessTokenRecord value4(String value) { + setAuthenticationId(value); + return this; + } + + @Override + public JOauthAccessTokenRecord value5(String value) { + setUsername(value); + return this; + } + + @Override + public JOauthAccessTokenRecord value6(Long value) { + setUserId(value); + return this; + } + + @Override + public JOauthAccessTokenRecord value7(String value) { + setClientId(value); + return this; + } + + @Override + public JOauthAccessTokenRecord value8(byte... value) { + setAuthentication(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JOauthAccessTokenRecord value9(String value) { + setRefreshToken(value); + return this; + } + + @Override + public JOauthAccessTokenRecord values(Long value1, String value2, byte[] value3, String value4, + String value5, Long value6, String value7, byte[] value8, String value9) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRecord.java index 83e6c4926..8575e8bc7 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record12; @@ -25,499 +23,506 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JOauthRegistrationRecord extends UpdatableRecordImpl implements Record12 { - - private static final long serialVersionUID = -1760457440; - - /** - * Setter for public.oauth_registration.id. - */ - public void setId(String value) { - set(0, value); - } - - /** - * Getter for public.oauth_registration.id. - */ - public String getId() { - return (String) get(0); - } - - /** - * Setter for public.oauth_registration.client_id. - */ - public void setClientId(String value) { - set(1, value); - } - - /** - * Getter for public.oauth_registration.client_id. - */ - public String getClientId() { - return (String) get(1); - } - - /** - * Setter for public.oauth_registration.client_secret. - */ - public void setClientSecret(String value) { - set(2, value); - } - - /** - * Getter for public.oauth_registration.client_secret. - */ - public String getClientSecret() { - return (String) get(2); - } - - /** - * Setter for public.oauth_registration.client_auth_method. - */ - public void setClientAuthMethod(String value) { - set(3, value); - } - - /** - * Getter for public.oauth_registration.client_auth_method. - */ - public String getClientAuthMethod() { - return (String) get(3); - } - - /** - * Setter for public.oauth_registration.auth_grant_type. - */ - public void setAuthGrantType(String value) { - set(4, value); - } - - /** - * Getter for public.oauth_registration.auth_grant_type. - */ - public String getAuthGrantType() { - return (String) get(4); - } - - /** - * Setter for public.oauth_registration.redirect_uri_template. - */ - public void setRedirectUriTemplate(String value) { - set(5, value); - } - - /** - * Getter for public.oauth_registration.redirect_uri_template. - */ - public String getRedirectUriTemplate() { - return (String) get(5); - } - - /** - * Setter for public.oauth_registration.authorization_uri. - */ - public void setAuthorizationUri(String value) { - set(6, value); - } - - /** - * Getter for public.oauth_registration.authorization_uri. - */ - public String getAuthorizationUri() { - return (String) get(6); - } - - /** - * Setter for public.oauth_registration.token_uri. - */ - public void setTokenUri(String value) { - set(7, value); - } - - /** - * Getter for public.oauth_registration.token_uri. - */ - public String getTokenUri() { - return (String) get(7); - } - - /** - * Setter for public.oauth_registration.user_info_endpoint_uri. - */ - public void setUserInfoEndpointUri(String value) { - set(8, value); - } - - /** - * Getter for public.oauth_registration.user_info_endpoint_uri. - */ - public String getUserInfoEndpointUri() { - return (String) get(8); - } - - /** - * Setter for public.oauth_registration.user_info_endpoint_name_attr. - */ - public void setUserInfoEndpointNameAttr(String value) { - set(9, value); - } - - /** - * Getter for public.oauth_registration.user_info_endpoint_name_attr. - */ - public String getUserInfoEndpointNameAttr() { - return (String) get(9); - } - - /** - * Setter for public.oauth_registration.jwk_set_uri. - */ - public void setJwkSetUri(String value) { - set(10, value); - } - - /** - * Getter for public.oauth_registration.jwk_set_uri. - */ - public String getJwkSetUri() { - return (String) get(10); - } - - /** - * Setter for public.oauth_registration.client_name. - */ - public void setClientName(String value) { - set(11, value); - } - - /** - * Getter for public.oauth_registration.client_name. - */ - public String getClientName() { - return (String) get(11); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record12 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row12 fieldsRow() { - return (Row12) super.fieldsRow(); - } - - @Override - public Row12 valuesRow() { - return (Row12) super.valuesRow(); - } - - @Override - public Field field1() { - return JOauthRegistration.OAUTH_REGISTRATION.ID; - } - - @Override - public Field field2() { - return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_ID; - } - - @Override - public Field field3() { - return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_SECRET; - } - - @Override - public Field field4() { - return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_AUTH_METHOD; - } - - @Override - public Field field5() { - return JOauthRegistration.OAUTH_REGISTRATION.AUTH_GRANT_TYPE; - } - - @Override - public Field field6() { - return JOauthRegistration.OAUTH_REGISTRATION.REDIRECT_URI_TEMPLATE; - } - - @Override - public Field field7() { - return JOauthRegistration.OAUTH_REGISTRATION.AUTHORIZATION_URI; - } - - @Override - public Field field8() { - return JOauthRegistration.OAUTH_REGISTRATION.TOKEN_URI; - } - - @Override - public Field field9() { - return JOauthRegistration.OAUTH_REGISTRATION.USER_INFO_ENDPOINT_URI; - } - - @Override - public Field field10() { - return JOauthRegistration.OAUTH_REGISTRATION.USER_INFO_ENDPOINT_NAME_ATTR; - } - - @Override - public Field field11() { - return JOauthRegistration.OAUTH_REGISTRATION.JWK_SET_URI; - } - - @Override - public Field field12() { - return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_NAME; - } - - @Override - public String component1() { - return getId(); - } - - @Override - public String component2() { - return getClientId(); - } - - @Override - public String component3() { - return getClientSecret(); - } - - @Override - public String component4() { - return getClientAuthMethod(); - } - - @Override - public String component5() { - return getAuthGrantType(); - } - - @Override - public String component6() { - return getRedirectUriTemplate(); - } - - @Override - public String component7() { - return getAuthorizationUri(); - } - - @Override - public String component8() { - return getTokenUri(); - } - - @Override - public String component9() { - return getUserInfoEndpointUri(); - } - - @Override - public String component10() { - return getUserInfoEndpointNameAttr(); - } - - @Override - public String component11() { - return getJwkSetUri(); - } - - @Override - public String component12() { - return getClientName(); - } - - @Override - public String value1() { - return getId(); - } - - @Override - public String value2() { - return getClientId(); - } - - @Override - public String value3() { - return getClientSecret(); - } - - @Override - public String value4() { - return getClientAuthMethod(); - } - - @Override - public String value5() { - return getAuthGrantType(); - } - - @Override - public String value6() { - return getRedirectUriTemplate(); - } - - @Override - public String value7() { - return getAuthorizationUri(); - } - - @Override - public String value8() { - return getTokenUri(); - } - - @Override - public String value9() { - return getUserInfoEndpointUri(); - } - - @Override - public String value10() { - return getUserInfoEndpointNameAttr(); - } - - @Override - public String value11() { - return getJwkSetUri(); - } - - @Override - public String value12() { - return getClientName(); - } - - @Override - public JOauthRegistrationRecord value1(String value) { - setId(value); - return this; - } - - @Override - public JOauthRegistrationRecord value2(String value) { - setClientId(value); - return this; - } - - @Override - public JOauthRegistrationRecord value3(String value) { - setClientSecret(value); - return this; - } - - @Override - public JOauthRegistrationRecord value4(String value) { - setClientAuthMethod(value); - return this; - } - - @Override - public JOauthRegistrationRecord value5(String value) { - setAuthGrantType(value); - return this; - } - - @Override - public JOauthRegistrationRecord value6(String value) { - setRedirectUriTemplate(value); - return this; - } - - @Override - public JOauthRegistrationRecord value7(String value) { - setAuthorizationUri(value); - return this; - } - - @Override - public JOauthRegistrationRecord value8(String value) { - setTokenUri(value); - return this; - } - - @Override - public JOauthRegistrationRecord value9(String value) { - setUserInfoEndpointUri(value); - return this; - } - - @Override - public JOauthRegistrationRecord value10(String value) { - setUserInfoEndpointNameAttr(value); - return this; - } - - @Override - public JOauthRegistrationRecord value11(String value) { - setJwkSetUri(value); - return this; - } - - @Override - public JOauthRegistrationRecord value12(String value) { - setClientName(value); - return this; - } - - @Override - public JOauthRegistrationRecord values(String value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, String value9, String value10, String value11, String value12) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - value12(value12); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JOauthRegistrationRecord - */ - public JOauthRegistrationRecord() { - super(JOauthRegistration.OAUTH_REGISTRATION); - } - - /** - * Create a detached, initialised JOauthRegistrationRecord - */ - public JOauthRegistrationRecord(String id, String clientId, String clientSecret, String clientAuthMethod, String authGrantType, String redirectUriTemplate, String authorizationUri, String tokenUri, String userInfoEndpointUri, String userInfoEndpointNameAttr, String jwkSetUri, String clientName) { - super(JOauthRegistration.OAUTH_REGISTRATION); - - set(0, id); - set(1, clientId); - set(2, clientSecret); - set(3, clientAuthMethod); - set(4, authGrantType); - set(5, redirectUriTemplate); - set(6, authorizationUri); - set(7, tokenUri); - set(8, userInfoEndpointUri); - set(9, userInfoEndpointNameAttr); - set(10, jwkSetUri); - set(11, clientName); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JOauthRegistrationRecord extends + UpdatableRecordImpl implements + Record12 { + + private static final long serialVersionUID = -1760457440; + + /** + * Create a detached JOauthRegistrationRecord + */ + public JOauthRegistrationRecord() { + super(JOauthRegistration.OAUTH_REGISTRATION); + } + + /** + * Create a detached, initialised JOauthRegistrationRecord + */ + public JOauthRegistrationRecord(String id, String clientId, String clientSecret, + String clientAuthMethod, String authGrantType, String redirectUriTemplate, + String authorizationUri, String tokenUri, String userInfoEndpointUri, + String userInfoEndpointNameAttr, String jwkSetUri, String clientName) { + super(JOauthRegistration.OAUTH_REGISTRATION); + + set(0, id); + set(1, clientId); + set(2, clientSecret); + set(3, clientAuthMethod); + set(4, authGrantType); + set(5, redirectUriTemplate); + set(6, authorizationUri); + set(7, tokenUri); + set(8, userInfoEndpointUri); + set(9, userInfoEndpointNameAttr); + set(10, jwkSetUri); + set(11, clientName); + } + + /** + * Getter for public.oauth_registration.id. + */ + public String getId() { + return (String) get(0); + } + + /** + * Setter for public.oauth_registration.id. + */ + public void setId(String value) { + set(0, value); + } + + /** + * Getter for public.oauth_registration.client_id. + */ + public String getClientId() { + return (String) get(1); + } + + /** + * Setter for public.oauth_registration.client_id. + */ + public void setClientId(String value) { + set(1, value); + } + + /** + * Getter for public.oauth_registration.client_secret. + */ + public String getClientSecret() { + return (String) get(2); + } + + /** + * Setter for public.oauth_registration.client_secret. + */ + public void setClientSecret(String value) { + set(2, value); + } + + /** + * Getter for public.oauth_registration.client_auth_method. + */ + public String getClientAuthMethod() { + return (String) get(3); + } + + /** + * Setter for public.oauth_registration.client_auth_method. + */ + public void setClientAuthMethod(String value) { + set(3, value); + } + + /** + * Getter for public.oauth_registration.auth_grant_type. + */ + public String getAuthGrantType() { + return (String) get(4); + } + + /** + * Setter for public.oauth_registration.auth_grant_type. + */ + public void setAuthGrantType(String value) { + set(4, value); + } + + /** + * Getter for public.oauth_registration.redirect_uri_template. + */ + public String getRedirectUriTemplate() { + return (String) get(5); + } + + /** + * Setter for public.oauth_registration.redirect_uri_template. + */ + public void setRedirectUriTemplate(String value) { + set(5, value); + } + + /** + * Getter for public.oauth_registration.authorization_uri. + */ + public String getAuthorizationUri() { + return (String) get(6); + } + + /** + * Setter for public.oauth_registration.authorization_uri. + */ + public void setAuthorizationUri(String value) { + set(6, value); + } + + /** + * Getter for public.oauth_registration.token_uri. + */ + public String getTokenUri() { + return (String) get(7); + } + + /** + * Setter for public.oauth_registration.token_uri. + */ + public void setTokenUri(String value) { + set(7, value); + } + + /** + * Getter for public.oauth_registration.user_info_endpoint_uri. + */ + public String getUserInfoEndpointUri() { + return (String) get(8); + } + + /** + * Setter for public.oauth_registration.user_info_endpoint_uri. + */ + public void setUserInfoEndpointUri(String value) { + set(8, value); + } + + /** + * Getter for public.oauth_registration.user_info_endpoint_name_attr. + */ + public String getUserInfoEndpointNameAttr() { + return (String) get(9); + } + + /** + * Setter for public.oauth_registration.user_info_endpoint_name_attr. + */ + public void setUserInfoEndpointNameAttr(String value) { + set(9, value); + } + + /** + * Getter for public.oauth_registration.jwk_set_uri. + */ + public String getJwkSetUri() { + return (String) get(10); + } + + /** + * Setter for public.oauth_registration.jwk_set_uri. + */ + public void setJwkSetUri(String value) { + set(10, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.oauth_registration.client_name. + */ + public String getClientName() { + return (String) get(11); + } + + // ------------------------------------------------------------------------- + // Record12 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.oauth_registration.client_name. + */ + public void setClientName(String value) { + set(11, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row12 fieldsRow() { + return (Row12) super.fieldsRow(); + } + + @Override + public Row12 valuesRow() { + return (Row12) super.valuesRow(); + } + + @Override + public Field field1() { + return JOauthRegistration.OAUTH_REGISTRATION.ID; + } + + @Override + public Field field2() { + return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_ID; + } + + @Override + public Field field3() { + return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_SECRET; + } + + @Override + public Field field4() { + return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_AUTH_METHOD; + } + + @Override + public Field field5() { + return JOauthRegistration.OAUTH_REGISTRATION.AUTH_GRANT_TYPE; + } + + @Override + public Field field6() { + return JOauthRegistration.OAUTH_REGISTRATION.REDIRECT_URI_TEMPLATE; + } + + @Override + public Field field7() { + return JOauthRegistration.OAUTH_REGISTRATION.AUTHORIZATION_URI; + } + + @Override + public Field field8() { + return JOauthRegistration.OAUTH_REGISTRATION.TOKEN_URI; + } + + @Override + public Field field9() { + return JOauthRegistration.OAUTH_REGISTRATION.USER_INFO_ENDPOINT_URI; + } + + @Override + public Field field10() { + return JOauthRegistration.OAUTH_REGISTRATION.USER_INFO_ENDPOINT_NAME_ATTR; + } + + @Override + public Field field11() { + return JOauthRegistration.OAUTH_REGISTRATION.JWK_SET_URI; + } + + @Override + public Field field12() { + return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_NAME; + } + + @Override + public String component1() { + return getId(); + } + + @Override + public String component2() { + return getClientId(); + } + + @Override + public String component3() { + return getClientSecret(); + } + + @Override + public String component4() { + return getClientAuthMethod(); + } + + @Override + public String component5() { + return getAuthGrantType(); + } + + @Override + public String component6() { + return getRedirectUriTemplate(); + } + + @Override + public String component7() { + return getAuthorizationUri(); + } + + @Override + public String component8() { + return getTokenUri(); + } + + @Override + public String component9() { + return getUserInfoEndpointUri(); + } + + @Override + public String component10() { + return getUserInfoEndpointNameAttr(); + } + + @Override + public String component11() { + return getJwkSetUri(); + } + + @Override + public String component12() { + return getClientName(); + } + + @Override + public String value1() { + return getId(); + } + + @Override + public String value2() { + return getClientId(); + } + + @Override + public String value3() { + return getClientSecret(); + } + + @Override + public String value4() { + return getClientAuthMethod(); + } + + @Override + public String value5() { + return getAuthGrantType(); + } + + @Override + public String value6() { + return getRedirectUriTemplate(); + } + + @Override + public String value7() { + return getAuthorizationUri(); + } + + @Override + public String value8() { + return getTokenUri(); + } + + @Override + public String value9() { + return getUserInfoEndpointUri(); + } + + @Override + public String value10() { + return getUserInfoEndpointNameAttr(); + } + + @Override + public String value11() { + return getJwkSetUri(); + } + + @Override + public String value12() { + return getClientName(); + } + + @Override + public JOauthRegistrationRecord value1(String value) { + setId(value); + return this; + } + + @Override + public JOauthRegistrationRecord value2(String value) { + setClientId(value); + return this; + } + + @Override + public JOauthRegistrationRecord value3(String value) { + setClientSecret(value); + return this; + } + + @Override + public JOauthRegistrationRecord value4(String value) { + setClientAuthMethod(value); + return this; + } + + @Override + public JOauthRegistrationRecord value5(String value) { + setAuthGrantType(value); + return this; + } + + @Override + public JOauthRegistrationRecord value6(String value) { + setRedirectUriTemplate(value); + return this; + } + + @Override + public JOauthRegistrationRecord value7(String value) { + setAuthorizationUri(value); + return this; + } + + @Override + public JOauthRegistrationRecord value8(String value) { + setTokenUri(value); + return this; + } + + @Override + public JOauthRegistrationRecord value9(String value) { + setUserInfoEndpointUri(value); + return this; + } + + @Override + public JOauthRegistrationRecord value10(String value) { + setUserInfoEndpointNameAttr(value); + return this; + } + + @Override + public JOauthRegistrationRecord value11(String value) { + setJwkSetUri(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JOauthRegistrationRecord value12(String value) { + setClientName(value); + return this; + } + + @Override + public JOauthRegistrationRecord values(String value1, String value2, String value3, String value4, + String value5, String value6, String value7, String value8, String value9, String value10, + String value11, String value12) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRestrictionRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRestrictionRecord.java index 9882acf6c..9b78187f6 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRestrictionRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRestrictionRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -25,203 +23,207 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JOauthRegistrationRestrictionRecord extends UpdatableRecordImpl implements Record4 { - - private static final long serialVersionUID = 335765148; - - /** - * Setter for public.oauth_registration_restriction.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for public.oauth_registration_restriction.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for public.oauth_registration_restriction.oauth_registration_fk. - */ - public void setOauthRegistrationFk(String value) { - set(1, value); - } - - /** - * Getter for public.oauth_registration_restriction.oauth_registration_fk. - */ - public String getOauthRegistrationFk() { - return (String) get(1); - } - - /** - * Setter for public.oauth_registration_restriction.type. - */ - public void setType(String value) { - set(2, value); - } - - /** - * Getter for public.oauth_registration_restriction.type. - */ - public String getType() { - return (String) get(2); - } - - /** - * Setter for public.oauth_registration_restriction.value. - */ - public void setValue(String value) { - set(3, value); - } - - /** - * Getter for public.oauth_registration_restriction.value. - */ - public String getValue() { - return (String) get(3); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID; - } - - @Override - public Field field2() { - return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK; - } - - @Override - public Field field3() { - return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.TYPE; - } - - @Override - public Field field4() { - return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.VALUE; - } - - @Override - public Integer component1() { - return getId(); - } - - @Override - public String component2() { - return getOauthRegistrationFk(); - } - - @Override - public String component3() { - return getType(); - } - - @Override - public String component4() { - return getValue(); - } - - @Override - public Integer value1() { - return getId(); - } - - @Override - public String value2() { - return getOauthRegistrationFk(); - } - - @Override - public String value3() { - return getType(); - } - - @Override - public String value4() { - return getValue(); - } - - @Override - public JOauthRegistrationRestrictionRecord value1(Integer value) { - setId(value); - return this; - } - - @Override - public JOauthRegistrationRestrictionRecord value2(String value) { - setOauthRegistrationFk(value); - return this; - } - - @Override - public JOauthRegistrationRestrictionRecord value3(String value) { - setType(value); - return this; - } - - @Override - public JOauthRegistrationRestrictionRecord value4(String value) { - setValue(value); - return this; - } - - @Override - public JOauthRegistrationRestrictionRecord values(Integer value1, String value2, String value3, String value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JOauthRegistrationRestrictionRecord - */ - public JOauthRegistrationRestrictionRecord() { - super(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION); - } - - /** - * Create a detached, initialised JOauthRegistrationRestrictionRecord - */ - public JOauthRegistrationRestrictionRecord(Integer id, String oauthRegistrationFk, String type, String value) { - super(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION); - - set(0, id); - set(1, oauthRegistrationFk); - set(2, type); - set(3, value); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JOauthRegistrationRestrictionRecord extends + UpdatableRecordImpl implements + Record4 { + + private static final long serialVersionUID = 335765148; + + /** + * Create a detached JOauthRegistrationRestrictionRecord + */ + public JOauthRegistrationRestrictionRecord() { + super(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION); + } + + /** + * Create a detached, initialised JOauthRegistrationRestrictionRecord + */ + public JOauthRegistrationRestrictionRecord(Integer id, String oauthRegistrationFk, String type, + String value) { + super(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION); + + set(0, id); + set(1, oauthRegistrationFk); + set(2, type); + set(3, value); + } + + /** + * Getter for public.oauth_registration_restriction.id. + */ + public Integer getId() { + return (Integer) get(0); + } + + /** + * Setter for public.oauth_registration_restriction.id. + */ + public void setId(Integer value) { + set(0, value); + } + + /** + * Getter for public.oauth_registration_restriction.oauth_registration_fk. + */ + public String getOauthRegistrationFk() { + return (String) get(1); + } + + /** + * Setter for public.oauth_registration_restriction.oauth_registration_fk. + */ + public void setOauthRegistrationFk(String value) { + set(1, value); + } + + /** + * Getter for public.oauth_registration_restriction.type. + */ + public String getType() { + return (String) get(2); + } + + /** + * Setter for public.oauth_registration_restriction.type. + */ + public void setType(String value) { + set(2, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.oauth_registration_restriction.value. + */ + public String getValue() { + return (String) get(3); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.oauth_registration_restriction.value. + */ + public void setValue(String value) { + set(3, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID; + } + + @Override + public Field field2() { + return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK; + } + + @Override + public Field field3() { + return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.TYPE; + } + + @Override + public Field field4() { + return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.VALUE; + } + + @Override + public Integer component1() { + return getId(); + } + + @Override + public String component2() { + return getOauthRegistrationFk(); + } + + @Override + public String component3() { + return getType(); + } + + @Override + public String component4() { + return getValue(); + } + + @Override + public Integer value1() { + return getId(); + } + + @Override + public String value2() { + return getOauthRegistrationFk(); + } + + @Override + public String value3() { + return getType(); + } + + @Override + public String value4() { + return getValue(); + } + + @Override + public JOauthRegistrationRestrictionRecord value1(Integer value) { + setId(value); + return this; + } + + @Override + public JOauthRegistrationRestrictionRecord value2(String value) { + setOauthRegistrationFk(value); + return this; + } + + @Override + public JOauthRegistrationRestrictionRecord value3(String value) { + setType(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JOauthRegistrationRestrictionRecord value4(String value) { + setValue(value); + return this; + } + + @Override + public JOauthRegistrationRestrictionRecord values(Integer value1, String value2, String value3, + String value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationScopeRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationScopeRecord.java index f514ad369..7516c99f0 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationScopeRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationScopeRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record3; @@ -25,166 +23,167 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JOauthRegistrationScopeRecord extends UpdatableRecordImpl implements Record3 { - - private static final long serialVersionUID = 688903255; - - /** - * Setter for public.oauth_registration_scope.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for public.oauth_registration_scope.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for public.oauth_registration_scope.oauth_registration_fk. - */ - public void setOauthRegistrationFk(String value) { - set(1, value); - } - - /** - * Getter for public.oauth_registration_scope.oauth_registration_fk. - */ - public String getOauthRegistrationFk() { - return (String) get(1); - } - - /** - * Setter for public.oauth_registration_scope.scope. - */ - public void setScope(String value) { - set(2, value); - } - - /** - * Getter for public.oauth_registration_scope.scope. - */ - public String getScope() { - return (String) get(2); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID; - } - - @Override - public Field field2() { - return JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK; - } - - @Override - public Field field3() { - return JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.SCOPE; - } - - @Override - public Integer component1() { - return getId(); - } - - @Override - public String component2() { - return getOauthRegistrationFk(); - } - - @Override - public String component3() { - return getScope(); - } - - @Override - public Integer value1() { - return getId(); - } - - @Override - public String value2() { - return getOauthRegistrationFk(); - } - - @Override - public String value3() { - return getScope(); - } - - @Override - public JOauthRegistrationScopeRecord value1(Integer value) { - setId(value); - return this; - } - - @Override - public JOauthRegistrationScopeRecord value2(String value) { - setOauthRegistrationFk(value); - return this; - } - - @Override - public JOauthRegistrationScopeRecord value3(String value) { - setScope(value); - return this; - } - - @Override - public JOauthRegistrationScopeRecord values(Integer value1, String value2, String value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JOauthRegistrationScopeRecord - */ - public JOauthRegistrationScopeRecord() { - super(JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE); - } - - /** - * Create a detached, initialised JOauthRegistrationScopeRecord - */ - public JOauthRegistrationScopeRecord(Integer id, String oauthRegistrationFk, String scope) { - super(JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE); - - set(0, id); - set(1, oauthRegistrationFk); - set(2, scope); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JOauthRegistrationScopeRecord extends + UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = 688903255; + + /** + * Create a detached JOauthRegistrationScopeRecord + */ + public JOauthRegistrationScopeRecord() { + super(JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE); + } + + /** + * Create a detached, initialised JOauthRegistrationScopeRecord + */ + public JOauthRegistrationScopeRecord(Integer id, String oauthRegistrationFk, String scope) { + super(JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE); + + set(0, id); + set(1, oauthRegistrationFk); + set(2, scope); + } + + /** + * Getter for public.oauth_registration_scope.id. + */ + public Integer getId() { + return (Integer) get(0); + } + + /** + * Setter for public.oauth_registration_scope.id. + */ + public void setId(Integer value) { + set(0, value); + } + + /** + * Getter for public.oauth_registration_scope.oauth_registration_fk. + */ + public String getOauthRegistrationFk() { + return (String) get(1); + } + + /** + * Setter for public.oauth_registration_scope.oauth_registration_fk. + */ + public void setOauthRegistrationFk(String value) { + set(1, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.oauth_registration_scope.scope. + */ + public String getScope() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.oauth_registration_scope.scope. + */ + public void setScope(String value) { + set(2, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID; + } + + @Override + public Field field2() { + return JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK; + } + + @Override + public Field field3() { + return JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.SCOPE; + } + + @Override + public Integer component1() { + return getId(); + } + + @Override + public String component2() { + return getOauthRegistrationFk(); + } + + @Override + public String component3() { + return getScope(); + } + + @Override + public Integer value1() { + return getId(); + } + + @Override + public String value2() { + return getOauthRegistrationFk(); + } + + @Override + public String value3() { + return getScope(); + } + + @Override + public JOauthRegistrationScopeRecord value1(Integer value) { + setId(value); + return this; + } + + @Override + public JOauthRegistrationScopeRecord value2(String value) { + setOauthRegistrationFk(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JOauthRegistrationScopeRecord value3(String value) { + setScope(value); + return this; + } + + @Override + public JOauthRegistrationScopeRecord values(Integer value1, String value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOnboardingRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOnboardingRecord.java index db749c19d..5c16f6986 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOnboardingRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOnboardingRecord.java @@ -5,11 +5,8 @@ import com.epam.ta.reportportal.jooq.tables.JOnboarding; - import java.sql.Timestamp; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record5; @@ -27,240 +24,243 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JOnboardingRecord extends UpdatableRecordImpl implements Record5 { - - private static final long serialVersionUID = -1405142552; - - /** - * Setter for public.onboarding.id. - */ - public void setId(Short value) { - set(0, value); - } - - /** - * Getter for public.onboarding.id. - */ - public Short getId() { - return (Short) get(0); - } - - /** - * Setter for public.onboarding.data. - */ - public void setData(String value) { - set(1, value); - } - - /** - * Getter for public.onboarding.data. - */ - public String getData() { - return (String) get(1); - } - - /** - * Setter for public.onboarding.page. - */ - public void setPage(String value) { - set(2, value); - } - - /** - * Getter for public.onboarding.page. - */ - public String getPage() { - return (String) get(2); - } - - /** - * Setter for public.onboarding.available_from. - */ - public void setAvailableFrom(Timestamp value) { - set(3, value); - } - - /** - * Getter for public.onboarding.available_from. - */ - public Timestamp getAvailableFrom() { - return (Timestamp) get(3); - } - - /** - * Setter for public.onboarding.available_to. - */ - public void setAvailableTo(Timestamp value) { - set(4, value); - } - - /** - * Getter for public.onboarding.available_to. - */ - public Timestamp getAvailableTo() { - return (Timestamp) get(4); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } - - @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); - } - - @Override - public Field field1() { - return JOnboarding.ONBOARDING.ID; - } - - @Override - public Field field2() { - return JOnboarding.ONBOARDING.DATA; - } - - @Override - public Field field3() { - return JOnboarding.ONBOARDING.PAGE; - } - - @Override - public Field field4() { - return JOnboarding.ONBOARDING.AVAILABLE_FROM; - } - - @Override - public Field field5() { - return JOnboarding.ONBOARDING.AVAILABLE_TO; - } - - @Override - public Short component1() { - return getId(); - } - - @Override - public String component2() { - return getData(); - } - - @Override - public String component3() { - return getPage(); - } - - @Override - public Timestamp component4() { - return getAvailableFrom(); - } - - @Override - public Timestamp component5() { - return getAvailableTo(); - } - - @Override - public Short value1() { - return getId(); - } - - @Override - public String value2() { - return getData(); - } - - @Override - public String value3() { - return getPage(); - } - - @Override - public Timestamp value4() { - return getAvailableFrom(); - } - - @Override - public Timestamp value5() { - return getAvailableTo(); - } - - @Override - public JOnboardingRecord value1(Short value) { - setId(value); - return this; - } - - @Override - public JOnboardingRecord value2(String value) { - setData(value); - return this; - } - - @Override - public JOnboardingRecord value3(String value) { - setPage(value); - return this; - } - - @Override - public JOnboardingRecord value4(Timestamp value) { - setAvailableFrom(value); - return this; - } - - @Override - public JOnboardingRecord value5(Timestamp value) { - setAvailableTo(value); - return this; - } - - @Override - public JOnboardingRecord values(Short value1, String value2, String value3, Timestamp value4, Timestamp value5) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JOnboardingRecord - */ - public JOnboardingRecord() { - super(JOnboarding.ONBOARDING); - } - - /** - * Create a detached, initialised JOnboardingRecord - */ - public JOnboardingRecord(Short id, String data, String page, Timestamp availableFrom, Timestamp availableTo) { - super(JOnboarding.ONBOARDING); - - set(0, id); - set(1, data); - set(2, page); - set(3, availableFrom); - set(4, availableTo); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JOnboardingRecord extends UpdatableRecordImpl implements + Record5 { + + private static final long serialVersionUID = -1405142552; + + /** + * Create a detached JOnboardingRecord + */ + public JOnboardingRecord() { + super(JOnboarding.ONBOARDING); + } + + /** + * Create a detached, initialised JOnboardingRecord + */ + public JOnboardingRecord(Short id, String data, String page, Timestamp availableFrom, + Timestamp availableTo) { + super(JOnboarding.ONBOARDING); + + set(0, id); + set(1, data); + set(2, page); + set(3, availableFrom); + set(4, availableTo); + } + + /** + * Getter for public.onboarding.id. + */ + public Short getId() { + return (Short) get(0); + } + + /** + * Setter for public.onboarding.id. + */ + public void setId(Short value) { + set(0, value); + } + + /** + * Getter for public.onboarding.data. + */ + public String getData() { + return (String) get(1); + } + + /** + * Setter for public.onboarding.data. + */ + public void setData(String value) { + set(1, value); + } + + /** + * Getter for public.onboarding.page. + */ + public String getPage() { + return (String) get(2); + } + + /** + * Setter for public.onboarding.page. + */ + public void setPage(String value) { + set(2, value); + } + + /** + * Getter for public.onboarding.available_from. + */ + public Timestamp getAvailableFrom() { + return (Timestamp) get(3); + } + + /** + * Setter for public.onboarding.available_from. + */ + public void setAvailableFrom(Timestamp value) { + set(3, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.onboarding.available_to. + */ + public Timestamp getAvailableTo() { + return (Timestamp) get(4); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.onboarding.available_to. + */ + public void setAvailableTo(Timestamp value) { + set(4, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return JOnboarding.ONBOARDING.ID; + } + + @Override + public Field field2() { + return JOnboarding.ONBOARDING.DATA; + } + + @Override + public Field field3() { + return JOnboarding.ONBOARDING.PAGE; + } + + @Override + public Field field4() { + return JOnboarding.ONBOARDING.AVAILABLE_FROM; + } + + @Override + public Field field5() { + return JOnboarding.ONBOARDING.AVAILABLE_TO; + } + + @Override + public Short component1() { + return getId(); + } + + @Override + public String component2() { + return getData(); + } + + @Override + public String component3() { + return getPage(); + } + + @Override + public Timestamp component4() { + return getAvailableFrom(); + } + + @Override + public Timestamp component5() { + return getAvailableTo(); + } + + @Override + public Short value1() { + return getId(); + } + + @Override + public String value2() { + return getData(); + } + + @Override + public String value3() { + return getPage(); + } + + @Override + public Timestamp value4() { + return getAvailableFrom(); + } + + @Override + public Timestamp value5() { + return getAvailableTo(); + } + + @Override + public JOnboardingRecord value1(Short value) { + setId(value); + return this; + } + + @Override + public JOnboardingRecord value2(String value) { + setData(value); + return this; + } + + @Override + public JOnboardingRecord value3(String value) { + setPage(value); + return this; + } + + @Override + public JOnboardingRecord value4(Timestamp value) { + setAvailableFrom(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JOnboardingRecord value5(Timestamp value) { + setAvailableTo(value); + return this; + } + + @Override + public JOnboardingRecord values(Short value1, String value2, String value3, Timestamp value4, + Timestamp value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JParameterRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JParameterRecord.java index 2778ef7b7..fff4862c3 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JParameterRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JParameterRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JParameter; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record3; import org.jooq.Row3; @@ -24,157 +22,158 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JParameterRecord extends TableRecordImpl implements Record3 { - - private static final long serialVersionUID = 607314343; - - /** - * Setter for public.parameter.item_id. - */ - public void setItemId(Long value) { - set(0, value); - } - - /** - * Getter for public.parameter.item_id. - */ - public Long getItemId() { - return (Long) get(0); - } - - /** - * Setter for public.parameter.key. - */ - public void setKey(String value) { - set(1, value); - } - - /** - * Getter for public.parameter.key. - */ - public String getKey() { - return (String) get(1); - } - - /** - * Setter for public.parameter.value. - */ - public void setValue(String value) { - set(2, value); - } - - /** - * Getter for public.parameter.value. - */ - public String getValue() { - return (String) get(2); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JParameter.PARAMETER.ITEM_ID; - } - - @Override - public Field field2() { - return JParameter.PARAMETER.KEY; - } - - @Override - public Field field3() { - return JParameter.PARAMETER.VALUE; - } - - @Override - public Long component1() { - return getItemId(); - } - - @Override - public String component2() { - return getKey(); - } - - @Override - public String component3() { - return getValue(); - } - - @Override - public Long value1() { - return getItemId(); - } - - @Override - public String value2() { - return getKey(); - } - - @Override - public String value3() { - return getValue(); - } - - @Override - public JParameterRecord value1(Long value) { - setItemId(value); - return this; - } - - @Override - public JParameterRecord value2(String value) { - setKey(value); - return this; - } - - @Override - public JParameterRecord value3(String value) { - setValue(value); - return this; - } - - @Override - public JParameterRecord values(Long value1, String value2, String value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JParameterRecord - */ - public JParameterRecord() { - super(JParameter.PARAMETER); - } - - /** - * Create a detached, initialised JParameterRecord - */ - public JParameterRecord(Long itemId, String key, String value) { - super(JParameter.PARAMETER); - - set(0, itemId); - set(1, key); - set(2, value); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JParameterRecord extends TableRecordImpl implements + Record3 { + + private static final long serialVersionUID = 607314343; + + /** + * Create a detached JParameterRecord + */ + public JParameterRecord() { + super(JParameter.PARAMETER); + } + + /** + * Create a detached, initialised JParameterRecord + */ + public JParameterRecord(Long itemId, String key, String value) { + super(JParameter.PARAMETER); + + set(0, itemId); + set(1, key); + set(2, value); + } + + /** + * Getter for public.parameter.item_id. + */ + public Long getItemId() { + return (Long) get(0); + } + + /** + * Setter for public.parameter.item_id. + */ + public void setItemId(Long value) { + set(0, value); + } + + /** + * Getter for public.parameter.key. + */ + public String getKey() { + return (String) get(1); + } + + /** + * Setter for public.parameter.key. + */ + public void setKey(String value) { + set(1, value); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + /** + * Getter for public.parameter.value. + */ + public String getValue() { + return (String) get(2); + } + + /** + * Setter for public.parameter.value. + */ + public void setValue(String value) { + set(2, value); + } + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JParameter.PARAMETER.ITEM_ID; + } + + @Override + public Field field2() { + return JParameter.PARAMETER.KEY; + } + + @Override + public Field field3() { + return JParameter.PARAMETER.VALUE; + } + + @Override + public Long component1() { + return getItemId(); + } + + @Override + public String component2() { + return getKey(); + } + + @Override + public String component3() { + return getValue(); + } + + @Override + public Long value1() { + return getItemId(); + } + + @Override + public String value2() { + return getKey(); + } + + @Override + public String value3() { + return getValue(); + } + + @Override + public JParameterRecord value1(Long value) { + setItemId(value); + return this; + } + + @Override + public JParameterRecord value2(String value) { + setKey(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JParameterRecord value3(String value) { + setValue(value); + return this; + } + + @Override + public JParameterRecord values(Long value1, String value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateRecord.java index acff7d0b0..4b489177c 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record6; @@ -25,277 +23,280 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JPatternTemplateRecord extends UpdatableRecordImpl implements Record6 { - - private static final long serialVersionUID = -264502879; - - /** - * Setter for public.pattern_template.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.pattern_template.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.pattern_template.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.pattern_template.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.pattern_template.value. - */ - public void setValue(String value) { - set(2, value); - } - - /** - * Getter for public.pattern_template.value. - */ - public String getValue() { - return (String) get(2); - } - - /** - * Setter for public.pattern_template.type. - */ - public void setType(String value) { - set(3, value); - } - - /** - * Getter for public.pattern_template.type. - */ - public String getType() { - return (String) get(3); - } - - /** - * Setter for public.pattern_template.enabled. - */ - public void setEnabled(Boolean value) { - set(4, value); - } - - /** - * Getter for public.pattern_template.enabled. - */ - public Boolean getEnabled() { - return (Boolean) get(4); - } - - /** - * Setter for public.pattern_template.project_id. - */ - public void setProjectId(Long value) { - set(5, value); - } - - /** - * Getter for public.pattern_template.project_id. - */ - public Long getProjectId() { - return (Long) get(5); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return JPatternTemplate.PATTERN_TEMPLATE.ID; - } - - @Override - public Field field2() { - return JPatternTemplate.PATTERN_TEMPLATE.NAME; - } - - @Override - public Field field3() { - return JPatternTemplate.PATTERN_TEMPLATE.VALUE; - } - - @Override - public Field field4() { - return JPatternTemplate.PATTERN_TEMPLATE.TYPE; - } - - @Override - public Field field5() { - return JPatternTemplate.PATTERN_TEMPLATE.ENABLED; - } - - @Override - public Field field6() { - return JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public String component3() { - return getValue(); - } - - @Override - public String component4() { - return getType(); - } - - @Override - public Boolean component5() { - return getEnabled(); - } - - @Override - public Long component6() { - return getProjectId(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public String value3() { - return getValue(); - } - - @Override - public String value4() { - return getType(); - } - - @Override - public Boolean value5() { - return getEnabled(); - } - - @Override - public Long value6() { - return getProjectId(); - } - - @Override - public JPatternTemplateRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JPatternTemplateRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JPatternTemplateRecord value3(String value) { - setValue(value); - return this; - } - - @Override - public JPatternTemplateRecord value4(String value) { - setType(value); - return this; - } - - @Override - public JPatternTemplateRecord value5(Boolean value) { - setEnabled(value); - return this; - } - - @Override - public JPatternTemplateRecord value6(Long value) { - setProjectId(value); - return this; - } - - @Override - public JPatternTemplateRecord values(Long value1, String value2, String value3, String value4, Boolean value5, Long value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JPatternTemplateRecord - */ - public JPatternTemplateRecord() { - super(JPatternTemplate.PATTERN_TEMPLATE); - } - - /** - * Create a detached, initialised JPatternTemplateRecord - */ - public JPatternTemplateRecord(Long id, String name, String value, String type, Boolean enabled, Long projectId) { - super(JPatternTemplate.PATTERN_TEMPLATE); - - set(0, id); - set(1, name); - set(2, value); - set(3, type); - set(4, enabled); - set(5, projectId); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JPatternTemplateRecord extends UpdatableRecordImpl implements + Record6 { + + private static final long serialVersionUID = -264502879; + + /** + * Create a detached JPatternTemplateRecord + */ + public JPatternTemplateRecord() { + super(JPatternTemplate.PATTERN_TEMPLATE); + } + + /** + * Create a detached, initialised JPatternTemplateRecord + */ + public JPatternTemplateRecord(Long id, String name, String value, String type, Boolean enabled, + Long projectId) { + super(JPatternTemplate.PATTERN_TEMPLATE); + + set(0, id); + set(1, name); + set(2, value); + set(3, type); + set(4, enabled); + set(5, projectId); + } + + /** + * Getter for public.pattern_template.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.pattern_template.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.pattern_template.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.pattern_template.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.pattern_template.value. + */ + public String getValue() { + return (String) get(2); + } + + /** + * Setter for public.pattern_template.value. + */ + public void setValue(String value) { + set(2, value); + } + + /** + * Getter for public.pattern_template.type. + */ + public String getType() { + return (String) get(3); + } + + /** + * Setter for public.pattern_template.type. + */ + public void setType(String value) { + set(3, value); + } + + /** + * Getter for public.pattern_template.enabled. + */ + public Boolean getEnabled() { + return (Boolean) get(4); + } + + /** + * Setter for public.pattern_template.enabled. + */ + public void setEnabled(Boolean value) { + set(4, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.pattern_template.project_id. + */ + public Long getProjectId() { + return (Long) get(5); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.pattern_template.project_id. + */ + public void setProjectId(Long value) { + set(5, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return JPatternTemplate.PATTERN_TEMPLATE.ID; + } + + @Override + public Field field2() { + return JPatternTemplate.PATTERN_TEMPLATE.NAME; + } + + @Override + public Field field3() { + return JPatternTemplate.PATTERN_TEMPLATE.VALUE; + } + + @Override + public Field field4() { + return JPatternTemplate.PATTERN_TEMPLATE.TYPE; + } + + @Override + public Field field5() { + return JPatternTemplate.PATTERN_TEMPLATE.ENABLED; + } + + @Override + public Field field6() { + return JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public String component3() { + return getValue(); + } + + @Override + public String component4() { + return getType(); + } + + @Override + public Boolean component5() { + return getEnabled(); + } + + @Override + public Long component6() { + return getProjectId(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public String value3() { + return getValue(); + } + + @Override + public String value4() { + return getType(); + } + + @Override + public Boolean value5() { + return getEnabled(); + } + + @Override + public Long value6() { + return getProjectId(); + } + + @Override + public JPatternTemplateRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JPatternTemplateRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JPatternTemplateRecord value3(String value) { + setValue(value); + return this; + } + + @Override + public JPatternTemplateRecord value4(String value) { + setType(value); + return this; + } + + @Override + public JPatternTemplateRecord value5(Boolean value) { + setEnabled(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JPatternTemplateRecord value6(Long value) { + setProjectId(value); + return this; + } + + @Override + public JPatternTemplateRecord values(Long value1, String value2, String value3, String value4, + Boolean value5, Long value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateTestItemRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateTestItemRecord.java index 67dabcd8a..d79a4236e 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateTestItemRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateTestItemRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -24,129 +22,130 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JPatternTemplateTestItemRecord extends UpdatableRecordImpl implements Record2 { - - private static final long serialVersionUID = 884087599; - - /** - * Setter for public.pattern_template_test_item.pattern_id. - */ - public void setPatternId(Long value) { - set(0, value); - } - - /** - * Getter for public.pattern_template_test_item.pattern_id. - */ - public Long getPatternId() { - return (Long) get(0); - } - - /** - * Setter for public.pattern_template_test_item.item_id. - */ - public void setItemId(Long value) { - set(1, value); - } - - /** - * Getter for public.pattern_template_test_item.item_id. - */ - public Long getItemId() { - return (Long) get(1); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record2 key() { - return (Record2) super.key(); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID; - } - - @Override - public Field field2() { - return JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID; - } - - @Override - public Long component1() { - return getPatternId(); - } - - @Override - public Long component2() { - return getItemId(); - } - - @Override - public Long value1() { - return getPatternId(); - } - - @Override - public Long value2() { - return getItemId(); - } - - @Override - public JPatternTemplateTestItemRecord value1(Long value) { - setPatternId(value); - return this; - } - - @Override - public JPatternTemplateTestItemRecord value2(Long value) { - setItemId(value); - return this; - } - - @Override - public JPatternTemplateTestItemRecord values(Long value1, Long value2) { - value1(value1); - value2(value2); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JPatternTemplateTestItemRecord - */ - public JPatternTemplateTestItemRecord() { - super(JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM); - } - - /** - * Create a detached, initialised JPatternTemplateTestItemRecord - */ - public JPatternTemplateTestItemRecord(Long patternId, Long itemId) { - super(JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM); - - set(0, patternId); - set(1, itemId); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JPatternTemplateTestItemRecord extends + UpdatableRecordImpl implements Record2 { + + private static final long serialVersionUID = 884087599; + + /** + * Create a detached JPatternTemplateTestItemRecord + */ + public JPatternTemplateTestItemRecord() { + super(JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM); + } + + /** + * Create a detached, initialised JPatternTemplateTestItemRecord + */ + public JPatternTemplateTestItemRecord(Long patternId, Long itemId) { + super(JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM); + + set(0, patternId); + set(1, itemId); + } + + /** + * Getter for public.pattern_template_test_item.pattern_id. + */ + public Long getPatternId() { + return (Long) get(0); + } + + /** + * Setter for public.pattern_template_test_item.pattern_id. + */ + public void setPatternId(Long value) { + set(0, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.pattern_template_test_item.item_id. + */ + public Long getItemId() { + return (Long) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.pattern_template_test_item.item_id. + */ + public void setItemId(Long value) { + set(1, value); + } + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID; + } + + @Override + public Field field2() { + return JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID; + } + + @Override + public Long component1() { + return getPatternId(); + } + + @Override + public Long component2() { + return getItemId(); + } + + @Override + public Long value1() { + return getPatternId(); + } + + @Override + public Long value2() { + return getItemId(); + } + + @Override + public JPatternTemplateTestItemRecord value1(Long value) { + setPatternId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JPatternTemplateTestItemRecord value2(Long value) { + setItemId(value); + return this; + } + + @Override + public JPatternTemplateTestItemRecord values(Long value1, Long value2) { + value1(value1); + value2(value2); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPgpArmorHeadersRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPgpArmorHeadersRecord.java index aebb70718..fd160b6d3 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPgpArmorHeadersRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPgpArmorHeadersRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -24,120 +22,121 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JPgpArmorHeadersRecord extends TableRecordImpl implements Record2 { - - private static final long serialVersionUID = 483081900; - - /** - * Setter for public.pgp_armor_headers.key. - */ - public void setKey(String value) { - set(0, value); - } - - /** - * Getter for public.pgp_armor_headers.key. - */ - public String getKey() { - return (String) get(0); - } - - /** - * Setter for public.pgp_armor_headers.value. - */ - public void setValue(String value) { - set(1, value); - } - - /** - * Getter for public.pgp_armor_headers.value. - */ - public String getValue() { - return (String) get(1); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JPgpArmorHeaders.PGP_ARMOR_HEADERS.KEY; - } - - @Override - public Field field2() { - return JPgpArmorHeaders.PGP_ARMOR_HEADERS.VALUE; - } - - @Override - public String component1() { - return getKey(); - } - - @Override - public String component2() { - return getValue(); - } - - @Override - public String value1() { - return getKey(); - } - - @Override - public String value2() { - return getValue(); - } - - @Override - public JPgpArmorHeadersRecord value1(String value) { - setKey(value); - return this; - } - - @Override - public JPgpArmorHeadersRecord value2(String value) { - setValue(value); - return this; - } - - @Override - public JPgpArmorHeadersRecord values(String value1, String value2) { - value1(value1); - value2(value2); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JPgpArmorHeadersRecord - */ - public JPgpArmorHeadersRecord() { - super(JPgpArmorHeaders.PGP_ARMOR_HEADERS); - } - - /** - * Create a detached, initialised JPgpArmorHeadersRecord - */ - public JPgpArmorHeadersRecord(String key, String value) { - super(JPgpArmorHeaders.PGP_ARMOR_HEADERS); - - set(0, key); - set(1, value); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JPgpArmorHeadersRecord extends TableRecordImpl implements + Record2 { + + private static final long serialVersionUID = 483081900; + + /** + * Create a detached JPgpArmorHeadersRecord + */ + public JPgpArmorHeadersRecord() { + super(JPgpArmorHeaders.PGP_ARMOR_HEADERS); + } + + /** + * Create a detached, initialised JPgpArmorHeadersRecord + */ + public JPgpArmorHeadersRecord(String key, String value) { + super(JPgpArmorHeaders.PGP_ARMOR_HEADERS); + + set(0, key); + set(1, value); + } + + /** + * Getter for public.pgp_armor_headers.key. + */ + public String getKey() { + return (String) get(0); + } + + /** + * Setter for public.pgp_armor_headers.key. + */ + public void setKey(String value) { + set(0, value); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + /** + * Getter for public.pgp_armor_headers.value. + */ + public String getValue() { + return (String) get(1); + } + + /** + * Setter for public.pgp_armor_headers.value. + */ + public void setValue(String value) { + set(1, value); + } + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JPgpArmorHeaders.PGP_ARMOR_HEADERS.KEY; + } + + @Override + public Field field2() { + return JPgpArmorHeaders.PGP_ARMOR_HEADERS.VALUE; + } + + @Override + public String component1() { + return getKey(); + } + + @Override + public String component2() { + return getValue(); + } + + @Override + public String value1() { + return getKey(); + } + + @Override + public String value2() { + return getValue(); + } + + @Override + public JPgpArmorHeadersRecord value1(String value) { + setKey(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JPgpArmorHeadersRecord value2(String value) { + setValue(value); + return this; + } + + @Override + public JPgpArmorHeadersRecord values(String value1, String value2) { + value1(value1); + value2(value2); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectAttributeRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectAttributeRecord.java index d3de3e2cb..dbf6ddc68 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectAttributeRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectAttributeRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JProjectAttribute; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record2; import org.jooq.Record3; @@ -25,166 +23,167 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JProjectAttributeRecord extends UpdatableRecordImpl implements Record3 { - - private static final long serialVersionUID = -1540669256; - - /** - * Setter for public.project_attribute.attribute_id. - */ - public void setAttributeId(Long value) { - set(0, value); - } - - /** - * Getter for public.project_attribute.attribute_id. - */ - public Long getAttributeId() { - return (Long) get(0); - } - - /** - * Setter for public.project_attribute.value. - */ - public void setValue(String value) { - set(1, value); - } - - /** - * Getter for public.project_attribute.value. - */ - public String getValue() { - return (String) get(1); - } - - /** - * Setter for public.project_attribute.project_id. - */ - public void setProjectId(Long value) { - set(2, value); - } - - /** - * Getter for public.project_attribute.project_id. - */ - public Long getProjectId() { - return (Long) get(2); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record2 key() { - return (Record2) super.key(); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID; - } - - @Override - public Field field2() { - return JProjectAttribute.PROJECT_ATTRIBUTE.VALUE; - } - - @Override - public Field field3() { - return JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID; - } - - @Override - public Long component1() { - return getAttributeId(); - } - - @Override - public String component2() { - return getValue(); - } - - @Override - public Long component3() { - return getProjectId(); - } - - @Override - public Long value1() { - return getAttributeId(); - } - - @Override - public String value2() { - return getValue(); - } - - @Override - public Long value3() { - return getProjectId(); - } - - @Override - public JProjectAttributeRecord value1(Long value) { - setAttributeId(value); - return this; - } - - @Override - public JProjectAttributeRecord value2(String value) { - setValue(value); - return this; - } - - @Override - public JProjectAttributeRecord value3(Long value) { - setProjectId(value); - return this; - } - - @Override - public JProjectAttributeRecord values(Long value1, String value2, Long value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JProjectAttributeRecord - */ - public JProjectAttributeRecord() { - super(JProjectAttribute.PROJECT_ATTRIBUTE); - } - - /** - * Create a detached, initialised JProjectAttributeRecord - */ - public JProjectAttributeRecord(Long attributeId, String value, Long projectId) { - super(JProjectAttribute.PROJECT_ATTRIBUTE); - - set(0, attributeId); - set(1, value); - set(2, projectId); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JProjectAttributeRecord extends UpdatableRecordImpl implements + Record3 { + + private static final long serialVersionUID = -1540669256; + + /** + * Create a detached JProjectAttributeRecord + */ + public JProjectAttributeRecord() { + super(JProjectAttribute.PROJECT_ATTRIBUTE); + } + + /** + * Create a detached, initialised JProjectAttributeRecord + */ + public JProjectAttributeRecord(Long attributeId, String value, Long projectId) { + super(JProjectAttribute.PROJECT_ATTRIBUTE); + + set(0, attributeId); + set(1, value); + set(2, projectId); + } + + /** + * Getter for public.project_attribute.attribute_id. + */ + public Long getAttributeId() { + return (Long) get(0); + } + + /** + * Setter for public.project_attribute.attribute_id. + */ + public void setAttributeId(Long value) { + set(0, value); + } + + /** + * Getter for public.project_attribute.value. + */ + public String getValue() { + return (String) get(1); + } + + /** + * Setter for public.project_attribute.value. + */ + public void setValue(String value) { + set(1, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.project_attribute.project_id. + */ + public Long getProjectId() { + return (Long) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.project_attribute.project_id. + */ + public void setProjectId(Long value) { + set(2, value); + } + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID; + } + + @Override + public Field field2() { + return JProjectAttribute.PROJECT_ATTRIBUTE.VALUE; + } + + @Override + public Field field3() { + return JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID; + } + + @Override + public Long component1() { + return getAttributeId(); + } + + @Override + public String component2() { + return getValue(); + } + + @Override + public Long component3() { + return getProjectId(); + } + + @Override + public Long value1() { + return getAttributeId(); + } + + @Override + public String value2() { + return getValue(); + } + + @Override + public Long value3() { + return getProjectId(); + } + + @Override + public JProjectAttributeRecord value1(Long value) { + setAttributeId(value); + return this; + } + + @Override + public JProjectAttributeRecord value2(String value) { + setValue(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JProjectAttributeRecord value3(Long value) { + setProjectId(value); + return this; + } + + @Override + public JProjectAttributeRecord values(Long value1, String value2, Long value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectRecord.java index 164b64e73..5185dfb46 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectRecord.java @@ -5,11 +5,8 @@ import com.epam.ta.reportportal.jooq.tables.JProject; - import java.sql.Timestamp; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.JSONB; import org.jooq.Record1; @@ -28,314 +25,317 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JProjectRecord extends UpdatableRecordImpl implements Record7 { - - private static final long serialVersionUID = 832057346; - - /** - * Setter for public.project.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.project.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.project.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.project.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.project.project_type. - */ - public void setProjectType(String value) { - set(2, value); - } - - /** - * Getter for public.project.project_type. - */ - public String getProjectType() { - return (String) get(2); - } - - /** - * Setter for public.project.organization. - */ - public void setOrganization(String value) { - set(3, value); - } - - /** - * Getter for public.project.organization. - */ - public String getOrganization() { - return (String) get(3); - } - - /** - * Setter for public.project.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(4, value); - } - - /** - * Getter for public.project.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(4); - } - - /** - * Setter for public.project.metadata. - */ - public void setMetadata(JSONB value) { - set(5, value); - } - - /** - * Getter for public.project.metadata. - */ - public JSONB getMetadata() { - return (JSONB) get(5); - } - - /** - * Setter for public.project.allocated_storage. - */ - public void setAllocatedStorage(Long value) { - set(6, value); - } - - /** - * Getter for public.project.allocated_storage. - */ - public Long getAllocatedStorage() { - return (Long) get(6); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record7 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); - } - - @Override - public Row7 valuesRow() { - return (Row7) super.valuesRow(); - } - - @Override - public Field field1() { - return JProject.PROJECT.ID; - } - - @Override - public Field field2() { - return JProject.PROJECT.NAME; - } - - @Override - public Field field3() { - return JProject.PROJECT.PROJECT_TYPE; - } - - @Override - public Field field4() { - return JProject.PROJECT.ORGANIZATION; - } - - @Override - public Field field5() { - return JProject.PROJECT.CREATION_DATE; - } - - @Override - public Field field6() { - return JProject.PROJECT.METADATA; - } - - @Override - public Field field7() { - return JProject.PROJECT.ALLOCATED_STORAGE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public String component3() { - return getProjectType(); - } - - @Override - public String component4() { - return getOrganization(); - } - - @Override - public Timestamp component5() { - return getCreationDate(); - } - - @Override - public JSONB component6() { - return getMetadata(); - } - - @Override - public Long component7() { - return getAllocatedStorage(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public String value3() { - return getProjectType(); - } - - @Override - public String value4() { - return getOrganization(); - } - - @Override - public Timestamp value5() { - return getCreationDate(); - } - - @Override - public JSONB value6() { - return getMetadata(); - } - - @Override - public Long value7() { - return getAllocatedStorage(); - } - - @Override - public JProjectRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JProjectRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JProjectRecord value3(String value) { - setProjectType(value); - return this; - } - - @Override - public JProjectRecord value4(String value) { - setOrganization(value); - return this; - } - - @Override - public JProjectRecord value5(Timestamp value) { - setCreationDate(value); - return this; - } - - @Override - public JProjectRecord value6(JSONB value) { - setMetadata(value); - return this; - } - - @Override - public JProjectRecord value7(Long value) { - setAllocatedStorage(value); - return this; - } - - @Override - public JProjectRecord values(Long value1, String value2, String value3, String value4, Timestamp value5, JSONB value6, Long value7) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JProjectRecord - */ - public JProjectRecord() { - super(JProject.PROJECT); - } - - /** - * Create a detached, initialised JProjectRecord - */ - public JProjectRecord(Long id, String name, String projectType, String organization, Timestamp creationDate, JSONB metadata, Long allocatedStorage) { - super(JProject.PROJECT); - - set(0, id); - set(1, name); - set(2, projectType); - set(3, organization); - set(4, creationDate); - set(5, metadata); - set(6, allocatedStorage); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JProjectRecord extends UpdatableRecordImpl implements + Record7 { + + private static final long serialVersionUID = 832057346; + + /** + * Create a detached JProjectRecord + */ + public JProjectRecord() { + super(JProject.PROJECT); + } + + /** + * Create a detached, initialised JProjectRecord + */ + public JProjectRecord(Long id, String name, String projectType, String organization, + Timestamp creationDate, JSONB metadata, Long allocatedStorage) { + super(JProject.PROJECT); + + set(0, id); + set(1, name); + set(2, projectType); + set(3, organization); + set(4, creationDate); + set(5, metadata); + set(6, allocatedStorage); + } + + /** + * Getter for public.project.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.project.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.project.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.project.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.project.project_type. + */ + public String getProjectType() { + return (String) get(2); + } + + /** + * Setter for public.project.project_type. + */ + public void setProjectType(String value) { + set(2, value); + } + + /** + * Getter for public.project.organization. + */ + public String getOrganization() { + return (String) get(3); + } + + /** + * Setter for public.project.organization. + */ + public void setOrganization(String value) { + set(3, value); + } + + /** + * Getter for public.project.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(4); + } + + /** + * Setter for public.project.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(4, value); + } + + /** + * Getter for public.project.metadata. + */ + public JSONB getMetadata() { + return (JSONB) get(5); + } + + /** + * Setter for public.project.metadata. + */ + public void setMetadata(JSONB value) { + set(5, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.project.allocated_storage. + */ + public Long getAllocatedStorage() { + return (Long) get(6); + } + + // ------------------------------------------------------------------------- + // Record7 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.project.allocated_storage. + */ + public void setAllocatedStorage(Long value) { + set(6, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + @Override + public Row7 valuesRow() { + return (Row7) super.valuesRow(); + } + + @Override + public Field field1() { + return JProject.PROJECT.ID; + } + + @Override + public Field field2() { + return JProject.PROJECT.NAME; + } + + @Override + public Field field3() { + return JProject.PROJECT.PROJECT_TYPE; + } + + @Override + public Field field4() { + return JProject.PROJECT.ORGANIZATION; + } + + @Override + public Field field5() { + return JProject.PROJECT.CREATION_DATE; + } + + @Override + public Field field6() { + return JProject.PROJECT.METADATA; + } + + @Override + public Field field7() { + return JProject.PROJECT.ALLOCATED_STORAGE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public String component3() { + return getProjectType(); + } + + @Override + public String component4() { + return getOrganization(); + } + + @Override + public Timestamp component5() { + return getCreationDate(); + } + + @Override + public JSONB component6() { + return getMetadata(); + } + + @Override + public Long component7() { + return getAllocatedStorage(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public String value3() { + return getProjectType(); + } + + @Override + public String value4() { + return getOrganization(); + } + + @Override + public Timestamp value5() { + return getCreationDate(); + } + + @Override + public JSONB value6() { + return getMetadata(); + } + + @Override + public Long value7() { + return getAllocatedStorage(); + } + + @Override + public JProjectRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JProjectRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JProjectRecord value3(String value) { + setProjectType(value); + return this; + } + + @Override + public JProjectRecord value4(String value) { + setOrganization(value); + return this; + } + + @Override + public JProjectRecord value5(Timestamp value) { + setCreationDate(value); + return this; + } + + @Override + public JProjectRecord value6(JSONB value) { + setMetadata(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JProjectRecord value7(Long value) { + setAllocatedStorage(value); + return this; + } + + @Override + public JProjectRecord values(Long value1, String value2, String value3, String value4, + Timestamp value5, JSONB value6, Long value7) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectUserRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectUserRecord.java index 6604b6c18..c87a5598d 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectUserRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectUserRecord.java @@ -6,9 +6,7 @@ import com.epam.ta.reportportal.jooq.enums.JProjectRoleEnum; import com.epam.ta.reportportal.jooq.tables.JProjectUser; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record2; import org.jooq.Record3; @@ -26,166 +24,167 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JProjectUserRecord extends UpdatableRecordImpl implements Record3 { - - private static final long serialVersionUID = -388211168; - - /** - * Setter for public.project_user.user_id. - */ - public void setUserId(Long value) { - set(0, value); - } - - /** - * Getter for public.project_user.user_id. - */ - public Long getUserId() { - return (Long) get(0); - } - - /** - * Setter for public.project_user.project_id. - */ - public void setProjectId(Long value) { - set(1, value); - } - - /** - * Getter for public.project_user.project_id. - */ - public Long getProjectId() { - return (Long) get(1); - } - - /** - * Setter for public.project_user.project_role. - */ - public void setProjectRole(JProjectRoleEnum value) { - set(2, value); - } - - /** - * Getter for public.project_user.project_role. - */ - public JProjectRoleEnum getProjectRole() { - return (JProjectRoleEnum) get(2); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record2 key() { - return (Record2) super.key(); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JProjectUser.PROJECT_USER.USER_ID; - } - - @Override - public Field field2() { - return JProjectUser.PROJECT_USER.PROJECT_ID; - } - - @Override - public Field field3() { - return JProjectUser.PROJECT_USER.PROJECT_ROLE; - } - - @Override - public Long component1() { - return getUserId(); - } - - @Override - public Long component2() { - return getProjectId(); - } - - @Override - public JProjectRoleEnum component3() { - return getProjectRole(); - } - - @Override - public Long value1() { - return getUserId(); - } - - @Override - public Long value2() { - return getProjectId(); - } - - @Override - public JProjectRoleEnum value3() { - return getProjectRole(); - } - - @Override - public JProjectUserRecord value1(Long value) { - setUserId(value); - return this; - } - - @Override - public JProjectUserRecord value2(Long value) { - setProjectId(value); - return this; - } - - @Override - public JProjectUserRecord value3(JProjectRoleEnum value) { - setProjectRole(value); - return this; - } - - @Override - public JProjectUserRecord values(Long value1, Long value2, JProjectRoleEnum value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JProjectUserRecord - */ - public JProjectUserRecord() { - super(JProjectUser.PROJECT_USER); - } - - /** - * Create a detached, initialised JProjectUserRecord - */ - public JProjectUserRecord(Long userId, Long projectId, JProjectRoleEnum projectRole) { - super(JProjectUser.PROJECT_USER); - - set(0, userId); - set(1, projectId); - set(2, projectRole); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JProjectUserRecord extends UpdatableRecordImpl implements + Record3 { + + private static final long serialVersionUID = -388211168; + + /** + * Create a detached JProjectUserRecord + */ + public JProjectUserRecord() { + super(JProjectUser.PROJECT_USER); + } + + /** + * Create a detached, initialised JProjectUserRecord + */ + public JProjectUserRecord(Long userId, Long projectId, JProjectRoleEnum projectRole) { + super(JProjectUser.PROJECT_USER); + + set(0, userId); + set(1, projectId); + set(2, projectRole); + } + + /** + * Getter for public.project_user.user_id. + */ + public Long getUserId() { + return (Long) get(0); + } + + /** + * Setter for public.project_user.user_id. + */ + public void setUserId(Long value) { + set(0, value); + } + + /** + * Getter for public.project_user.project_id. + */ + public Long getProjectId() { + return (Long) get(1); + } + + /** + * Setter for public.project_user.project_id. + */ + public void setProjectId(Long value) { + set(1, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.project_user.project_role. + */ + public JProjectRoleEnum getProjectRole() { + return (JProjectRoleEnum) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.project_user.project_role. + */ + public void setProjectRole(JProjectRoleEnum value) { + set(2, value); + } + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JProjectUser.PROJECT_USER.USER_ID; + } + + @Override + public Field field2() { + return JProjectUser.PROJECT_USER.PROJECT_ID; + } + + @Override + public Field field3() { + return JProjectUser.PROJECT_USER.PROJECT_ROLE; + } + + @Override + public Long component1() { + return getUserId(); + } + + @Override + public Long component2() { + return getProjectId(); + } + + @Override + public JProjectRoleEnum component3() { + return getProjectRole(); + } + + @Override + public Long value1() { + return getUserId(); + } + + @Override + public Long value2() { + return getProjectId(); + } + + @Override + public JProjectRoleEnum value3() { + return getProjectRole(); + } + + @Override + public JProjectUserRecord value1(Long value) { + setUserId(value); + return this; + } + + @Override + public JProjectUserRecord value2(Long value) { + setProjectId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JProjectUserRecord value3(JProjectRoleEnum value) { + setProjectRole(value); + return this; + } + + @Override + public JProjectUserRecord values(Long value1, Long value2, JProjectRoleEnum value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRecipientsRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRecipientsRecord.java index aee2b16d9..b824e5f0d 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRecipientsRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRecipientsRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JRecipients; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -24,120 +22,121 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JRecipientsRecord extends TableRecordImpl implements Record2 { - - private static final long serialVersionUID = 662647080; - - /** - * Setter for public.recipients.sender_case_id. - */ - public void setSenderCaseId(Long value) { - set(0, value); - } - - /** - * Getter for public.recipients.sender_case_id. - */ - public Long getSenderCaseId() { - return (Long) get(0); - } - - /** - * Setter for public.recipients.recipient. - */ - public void setRecipient(String value) { - set(1, value); - } - - /** - * Getter for public.recipients.recipient. - */ - public String getRecipient() { - return (String) get(1); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JRecipients.RECIPIENTS.SENDER_CASE_ID; - } - - @Override - public Field field2() { - return JRecipients.RECIPIENTS.RECIPIENT; - } - - @Override - public Long component1() { - return getSenderCaseId(); - } - - @Override - public String component2() { - return getRecipient(); - } - - @Override - public Long value1() { - return getSenderCaseId(); - } - - @Override - public String value2() { - return getRecipient(); - } - - @Override - public JRecipientsRecord value1(Long value) { - setSenderCaseId(value); - return this; - } - - @Override - public JRecipientsRecord value2(String value) { - setRecipient(value); - return this; - } - - @Override - public JRecipientsRecord values(Long value1, String value2) { - value1(value1); - value2(value2); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JRecipientsRecord - */ - public JRecipientsRecord() { - super(JRecipients.RECIPIENTS); - } - - /** - * Create a detached, initialised JRecipientsRecord - */ - public JRecipientsRecord(Long senderCaseId, String recipient) { - super(JRecipients.RECIPIENTS); - - set(0, senderCaseId); - set(1, recipient); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JRecipientsRecord extends TableRecordImpl implements + Record2 { + + private static final long serialVersionUID = 662647080; + + /** + * Create a detached JRecipientsRecord + */ + public JRecipientsRecord() { + super(JRecipients.RECIPIENTS); + } + + /** + * Create a detached, initialised JRecipientsRecord + */ + public JRecipientsRecord(Long senderCaseId, String recipient) { + super(JRecipients.RECIPIENTS); + + set(0, senderCaseId); + set(1, recipient); + } + + /** + * Getter for public.recipients.sender_case_id. + */ + public Long getSenderCaseId() { + return (Long) get(0); + } + + /** + * Setter for public.recipients.sender_case_id. + */ + public void setSenderCaseId(Long value) { + set(0, value); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + /** + * Getter for public.recipients.recipient. + */ + public String getRecipient() { + return (String) get(1); + } + + /** + * Setter for public.recipients.recipient. + */ + public void setRecipient(String value) { + set(1, value); + } + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JRecipients.RECIPIENTS.SENDER_CASE_ID; + } + + @Override + public Field field2() { + return JRecipients.RECIPIENTS.RECIPIENT; + } + + @Override + public Long component1() { + return getSenderCaseId(); + } + + @Override + public String component2() { + return getRecipient(); + } + + @Override + public Long value1() { + return getSenderCaseId(); + } + + @Override + public String value2() { + return getRecipient(); + } + + @Override + public JRecipientsRecord value1(Long value) { + setSenderCaseId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JRecipientsRecord value2(String value) { + setRecipient(value); + return this; + } + + @Override + public JRecipientsRecord values(Long value1, String value2) { + value1(value1); + value2(value2); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRestorePasswordBidRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRestorePasswordBidRecord.java index c62d12ce4..4620c9ece 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRestorePasswordBidRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRestorePasswordBidRecord.java @@ -5,11 +5,8 @@ import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; - import java.sql.Timestamp; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record3; @@ -27,166 +24,167 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JRestorePasswordBidRecord extends UpdatableRecordImpl implements Record3 { - - private static final long serialVersionUID = -2003482281; - - /** - * Setter for public.restore_password_bid.uuid. - */ - public void setUuid(String value) { - set(0, value); - } - - /** - * Getter for public.restore_password_bid.uuid. - */ - public String getUuid() { - return (String) get(0); - } - - /** - * Setter for public.restore_password_bid.last_modified. - */ - public void setLastModified(Timestamp value) { - set(1, value); - } - - /** - * Getter for public.restore_password_bid.last_modified. - */ - public Timestamp getLastModified() { - return (Timestamp) get(1); - } - - /** - * Setter for public.restore_password_bid.email. - */ - public void setEmail(String value) { - set(2, value); - } - - /** - * Getter for public.restore_password_bid.email. - */ - public String getEmail() { - return (String) get(2); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JRestorePasswordBid.RESTORE_PASSWORD_BID.UUID; - } - - @Override - public Field field2() { - return JRestorePasswordBid.RESTORE_PASSWORD_BID.LAST_MODIFIED; - } - - @Override - public Field field3() { - return JRestorePasswordBid.RESTORE_PASSWORD_BID.EMAIL; - } - - @Override - public String component1() { - return getUuid(); - } - - @Override - public Timestamp component2() { - return getLastModified(); - } - - @Override - public String component3() { - return getEmail(); - } - - @Override - public String value1() { - return getUuid(); - } - - @Override - public Timestamp value2() { - return getLastModified(); - } - - @Override - public String value3() { - return getEmail(); - } - - @Override - public JRestorePasswordBidRecord value1(String value) { - setUuid(value); - return this; - } - - @Override - public JRestorePasswordBidRecord value2(Timestamp value) { - setLastModified(value); - return this; - } - - @Override - public JRestorePasswordBidRecord value3(String value) { - setEmail(value); - return this; - } - - @Override - public JRestorePasswordBidRecord values(String value1, Timestamp value2, String value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JRestorePasswordBidRecord - */ - public JRestorePasswordBidRecord() { - super(JRestorePasswordBid.RESTORE_PASSWORD_BID); - } - - /** - * Create a detached, initialised JRestorePasswordBidRecord - */ - public JRestorePasswordBidRecord(String uuid, Timestamp lastModified, String email) { - super(JRestorePasswordBid.RESTORE_PASSWORD_BID); - - set(0, uuid); - set(1, lastModified); - set(2, email); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JRestorePasswordBidRecord extends + UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = -2003482281; + + /** + * Create a detached JRestorePasswordBidRecord + */ + public JRestorePasswordBidRecord() { + super(JRestorePasswordBid.RESTORE_PASSWORD_BID); + } + + /** + * Create a detached, initialised JRestorePasswordBidRecord + */ + public JRestorePasswordBidRecord(String uuid, Timestamp lastModified, String email) { + super(JRestorePasswordBid.RESTORE_PASSWORD_BID); + + set(0, uuid); + set(1, lastModified); + set(2, email); + } + + /** + * Getter for public.restore_password_bid.uuid. + */ + public String getUuid() { + return (String) get(0); + } + + /** + * Setter for public.restore_password_bid.uuid. + */ + public void setUuid(String value) { + set(0, value); + } + + /** + * Getter for public.restore_password_bid.last_modified. + */ + public Timestamp getLastModified() { + return (Timestamp) get(1); + } + + /** + * Setter for public.restore_password_bid.last_modified. + */ + public void setLastModified(Timestamp value) { + set(1, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.restore_password_bid.email. + */ + public String getEmail() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.restore_password_bid.email. + */ + public void setEmail(String value) { + set(2, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JRestorePasswordBid.RESTORE_PASSWORD_BID.UUID; + } + + @Override + public Field field2() { + return JRestorePasswordBid.RESTORE_PASSWORD_BID.LAST_MODIFIED; + } + + @Override + public Field field3() { + return JRestorePasswordBid.RESTORE_PASSWORD_BID.EMAIL; + } + + @Override + public String component1() { + return getUuid(); + } + + @Override + public Timestamp component2() { + return getLastModified(); + } + + @Override + public String component3() { + return getEmail(); + } + + @Override + public String value1() { + return getUuid(); + } + + @Override + public Timestamp value2() { + return getLastModified(); + } + + @Override + public String value3() { + return getEmail(); + } + + @Override + public JRestorePasswordBidRecord value1(String value) { + setUuid(value); + return this; + } + + @Override + public JRestorePasswordBidRecord value2(Timestamp value) { + setLastModified(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JRestorePasswordBidRecord value3(String value) { + setEmail(value); + return this; + } + + @Override + public JRestorePasswordBidRecord values(String value1, Timestamp value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JSenderCaseRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JSenderCaseRecord.java index 6da642300..352e48633 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JSenderCaseRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JSenderCaseRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JSenderCase; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -25,203 +23,204 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JSenderCaseRecord extends UpdatableRecordImpl implements Record4 { - - private static final long serialVersionUID = 794748140; - - /** - * Setter for public.sender_case.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.sender_case.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.sender_case.send_case. - */ - public void setSendCase(String value) { - set(1, value); - } - - /** - * Getter for public.sender_case.send_case. - */ - public String getSendCase() { - return (String) get(1); - } - - /** - * Setter for public.sender_case.project_id. - */ - public void setProjectId(Long value) { - set(2, value); - } - - /** - * Getter for public.sender_case.project_id. - */ - public Long getProjectId() { - return (Long) get(2); - } - - /** - * Setter for public.sender_case.enabled. - */ - public void setEnabled(Boolean value) { - set(3, value); - } - - /** - * Getter for public.sender_case.enabled. - */ - public Boolean getEnabled() { - return (Boolean) get(3); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JSenderCase.SENDER_CASE.ID; - } - - @Override - public Field field2() { - return JSenderCase.SENDER_CASE.SEND_CASE; - } - - @Override - public Field field3() { - return JSenderCase.SENDER_CASE.PROJECT_ID; - } - - @Override - public Field field4() { - return JSenderCase.SENDER_CASE.ENABLED; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getSendCase(); - } - - @Override - public Long component3() { - return getProjectId(); - } - - @Override - public Boolean component4() { - return getEnabled(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getSendCase(); - } - - @Override - public Long value3() { - return getProjectId(); - } - - @Override - public Boolean value4() { - return getEnabled(); - } - - @Override - public JSenderCaseRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JSenderCaseRecord value2(String value) { - setSendCase(value); - return this; - } - - @Override - public JSenderCaseRecord value3(Long value) { - setProjectId(value); - return this; - } - - @Override - public JSenderCaseRecord value4(Boolean value) { - setEnabled(value); - return this; - } - - @Override - public JSenderCaseRecord values(Long value1, String value2, Long value3, Boolean value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JSenderCaseRecord - */ - public JSenderCaseRecord() { - super(JSenderCase.SENDER_CASE); - } - - /** - * Create a detached, initialised JSenderCaseRecord - */ - public JSenderCaseRecord(Long id, String sendCase, Long projectId, Boolean enabled) { - super(JSenderCase.SENDER_CASE); - - set(0, id); - set(1, sendCase); - set(2, projectId); - set(3, enabled); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JSenderCaseRecord extends UpdatableRecordImpl implements + Record4 { + + private static final long serialVersionUID = 794748140; + + /** + * Create a detached JSenderCaseRecord + */ + public JSenderCaseRecord() { + super(JSenderCase.SENDER_CASE); + } + + /** + * Create a detached, initialised JSenderCaseRecord + */ + public JSenderCaseRecord(Long id, String sendCase, Long projectId, Boolean enabled) { + super(JSenderCase.SENDER_CASE); + + set(0, id); + set(1, sendCase); + set(2, projectId); + set(3, enabled); + } + + /** + * Getter for public.sender_case.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.sender_case.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.sender_case.send_case. + */ + public String getSendCase() { + return (String) get(1); + } + + /** + * Setter for public.sender_case.send_case. + */ + public void setSendCase(String value) { + set(1, value); + } + + /** + * Getter for public.sender_case.project_id. + */ + public Long getProjectId() { + return (Long) get(2); + } + + /** + * Setter for public.sender_case.project_id. + */ + public void setProjectId(Long value) { + set(2, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.sender_case.enabled. + */ + public Boolean getEnabled() { + return (Boolean) get(3); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.sender_case.enabled. + */ + public void setEnabled(Boolean value) { + set(3, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JSenderCase.SENDER_CASE.ID; + } + + @Override + public Field field2() { + return JSenderCase.SENDER_CASE.SEND_CASE; + } + + @Override + public Field field3() { + return JSenderCase.SENDER_CASE.PROJECT_ID; + } + + @Override + public Field field4() { + return JSenderCase.SENDER_CASE.ENABLED; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getSendCase(); + } + + @Override + public Long component3() { + return getProjectId(); + } + + @Override + public Boolean component4() { + return getEnabled(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getSendCase(); + } + + @Override + public Long value3() { + return getProjectId(); + } + + @Override + public Boolean value4() { + return getEnabled(); + } + + @Override + public JSenderCaseRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JSenderCaseRecord value2(String value) { + setSendCase(value); + return this; + } + + @Override + public JSenderCaseRecord value3(Long value) { + setProjectId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JSenderCaseRecord value4(Boolean value) { + setEnabled(value); + return this; + } + + @Override + public JSenderCaseRecord values(Long value1, String value2, Long value3, Boolean value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JServerSettingsRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JServerSettingsRecord.java index 7a7258660..66b6658c3 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JServerSettingsRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JServerSettingsRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JServerSettings; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record3; @@ -25,166 +23,167 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JServerSettingsRecord extends UpdatableRecordImpl implements Record3 { - - private static final long serialVersionUID = 1082773050; - - /** - * Setter for public.server_settings.id. - */ - public void setId(Short value) { - set(0, value); - } - - /** - * Getter for public.server_settings.id. - */ - public Short getId() { - return (Short) get(0); - } - - /** - * Setter for public.server_settings.key. - */ - public void setKey(String value) { - set(1, value); - } - - /** - * Getter for public.server_settings.key. - */ - public String getKey() { - return (String) get(1); - } - - /** - * Setter for public.server_settings.value. - */ - public void setValue(String value) { - set(2, value); - } - - /** - * Getter for public.server_settings.value. - */ - public String getValue() { - return (String) get(2); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JServerSettings.SERVER_SETTINGS.ID; - } - - @Override - public Field field2() { - return JServerSettings.SERVER_SETTINGS.KEY; - } - - @Override - public Field field3() { - return JServerSettings.SERVER_SETTINGS.VALUE; - } - - @Override - public Short component1() { - return getId(); - } - - @Override - public String component2() { - return getKey(); - } - - @Override - public String component3() { - return getValue(); - } - - @Override - public Short value1() { - return getId(); - } - - @Override - public String value2() { - return getKey(); - } - - @Override - public String value3() { - return getValue(); - } - - @Override - public JServerSettingsRecord value1(Short value) { - setId(value); - return this; - } - - @Override - public JServerSettingsRecord value2(String value) { - setKey(value); - return this; - } - - @Override - public JServerSettingsRecord value3(String value) { - setValue(value); - return this; - } - - @Override - public JServerSettingsRecord values(Short value1, String value2, String value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JServerSettingsRecord - */ - public JServerSettingsRecord() { - super(JServerSettings.SERVER_SETTINGS); - } - - /** - * Create a detached, initialised JServerSettingsRecord - */ - public JServerSettingsRecord(Short id, String key, String value) { - super(JServerSettings.SERVER_SETTINGS); - - set(0, id); - set(1, key); - set(2, value); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JServerSettingsRecord extends UpdatableRecordImpl implements + Record3 { + + private static final long serialVersionUID = 1082773050; + + /** + * Create a detached JServerSettingsRecord + */ + public JServerSettingsRecord() { + super(JServerSettings.SERVER_SETTINGS); + } + + /** + * Create a detached, initialised JServerSettingsRecord + */ + public JServerSettingsRecord(Short id, String key, String value) { + super(JServerSettings.SERVER_SETTINGS); + + set(0, id); + set(1, key); + set(2, value); + } + + /** + * Getter for public.server_settings.id. + */ + public Short getId() { + return (Short) get(0); + } + + /** + * Setter for public.server_settings.id. + */ + public void setId(Short value) { + set(0, value); + } + + /** + * Getter for public.server_settings.key. + */ + public String getKey() { + return (String) get(1); + } + + /** + * Setter for public.server_settings.key. + */ + public void setKey(String value) { + set(1, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.server_settings.value. + */ + public String getValue() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.server_settings.value. + */ + public void setValue(String value) { + set(2, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JServerSettings.SERVER_SETTINGS.ID; + } + + @Override + public Field field2() { + return JServerSettings.SERVER_SETTINGS.KEY; + } + + @Override + public Field field3() { + return JServerSettings.SERVER_SETTINGS.VALUE; + } + + @Override + public Short component1() { + return getId(); + } + + @Override + public String component2() { + return getKey(); + } + + @Override + public String component3() { + return getValue(); + } + + @Override + public Short value1() { + return getId(); + } + + @Override + public String value2() { + return getKey(); + } + + @Override + public String value3() { + return getValue(); + } + + @Override + public JServerSettingsRecord value1(Short value) { + setId(value); + return this; + } + + @Override + public JServerSettingsRecord value2(String value) { + setKey(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JServerSettingsRecord value3(String value) { + setValue(value); + return this; + } + + @Override + public JServerSettingsRecord values(Short value1, String value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JShareableEntityRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JShareableEntityRecord.java index 2f3263ba0..d40dda66f 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JShareableEntityRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JShareableEntityRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JShareableEntity; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -25,203 +23,204 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JShareableEntityRecord extends UpdatableRecordImpl implements Record4 { - - private static final long serialVersionUID = -423678501; - - /** - * Setter for public.shareable_entity.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.shareable_entity.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.shareable_entity.shared. - */ - public void setShared(Boolean value) { - set(1, value); - } - - /** - * Getter for public.shareable_entity.shared. - */ - public Boolean getShared() { - return (Boolean) get(1); - } - - /** - * Setter for public.shareable_entity.owner. - */ - public void setOwner(String value) { - set(2, value); - } - - /** - * Getter for public.shareable_entity.owner. - */ - public String getOwner() { - return (String) get(2); - } - - /** - * Setter for public.shareable_entity.project_id. - */ - public void setProjectId(Long value) { - set(3, value); - } - - /** - * Getter for public.shareable_entity.project_id. - */ - public Long getProjectId() { - return (Long) get(3); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JShareableEntity.SHAREABLE_ENTITY.ID; - } - - @Override - public Field field2() { - return JShareableEntity.SHAREABLE_ENTITY.SHARED; - } - - @Override - public Field field3() { - return JShareableEntity.SHAREABLE_ENTITY.OWNER; - } - - @Override - public Field field4() { - return JShareableEntity.SHAREABLE_ENTITY.PROJECT_ID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Boolean component2() { - return getShared(); - } - - @Override - public String component3() { - return getOwner(); - } - - @Override - public Long component4() { - return getProjectId(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Boolean value2() { - return getShared(); - } - - @Override - public String value3() { - return getOwner(); - } - - @Override - public Long value4() { - return getProjectId(); - } - - @Override - public JShareableEntityRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JShareableEntityRecord value2(Boolean value) { - setShared(value); - return this; - } - - @Override - public JShareableEntityRecord value3(String value) { - setOwner(value); - return this; - } - - @Override - public JShareableEntityRecord value4(Long value) { - setProjectId(value); - return this; - } - - @Override - public JShareableEntityRecord values(Long value1, Boolean value2, String value3, Long value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JShareableEntityRecord - */ - public JShareableEntityRecord() { - super(JShareableEntity.SHAREABLE_ENTITY); - } - - /** - * Create a detached, initialised JShareableEntityRecord - */ - public JShareableEntityRecord(Long id, Boolean shared, String owner, Long projectId) { - super(JShareableEntity.SHAREABLE_ENTITY); - - set(0, id); - set(1, shared); - set(2, owner); - set(3, projectId); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JShareableEntityRecord extends UpdatableRecordImpl implements + Record4 { + + private static final long serialVersionUID = -423678501; + + /** + * Create a detached JShareableEntityRecord + */ + public JShareableEntityRecord() { + super(JShareableEntity.SHAREABLE_ENTITY); + } + + /** + * Create a detached, initialised JShareableEntityRecord + */ + public JShareableEntityRecord(Long id, Boolean shared, String owner, Long projectId) { + super(JShareableEntity.SHAREABLE_ENTITY); + + set(0, id); + set(1, shared); + set(2, owner); + set(3, projectId); + } + + /** + * Getter for public.shareable_entity.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.shareable_entity.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.shareable_entity.shared. + */ + public Boolean getShared() { + return (Boolean) get(1); + } + + /** + * Setter for public.shareable_entity.shared. + */ + public void setShared(Boolean value) { + set(1, value); + } + + /** + * Getter for public.shareable_entity.owner. + */ + public String getOwner() { + return (String) get(2); + } + + /** + * Setter for public.shareable_entity.owner. + */ + public void setOwner(String value) { + set(2, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.shareable_entity.project_id. + */ + public Long getProjectId() { + return (Long) get(3); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.shareable_entity.project_id. + */ + public void setProjectId(Long value) { + set(3, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JShareableEntity.SHAREABLE_ENTITY.ID; + } + + @Override + public Field field2() { + return JShareableEntity.SHAREABLE_ENTITY.SHARED; + } + + @Override + public Field field3() { + return JShareableEntity.SHAREABLE_ENTITY.OWNER; + } + + @Override + public Field field4() { + return JShareableEntity.SHAREABLE_ENTITY.PROJECT_ID; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Boolean component2() { + return getShared(); + } + + @Override + public String component3() { + return getOwner(); + } + + @Override + public Long component4() { + return getProjectId(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Boolean value2() { + return getShared(); + } + + @Override + public String value3() { + return getOwner(); + } + + @Override + public Long value4() { + return getProjectId(); + } + + @Override + public JShareableEntityRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JShareableEntityRecord value2(Boolean value) { + setShared(value); + return this; + } + + @Override + public JShareableEntityRecord value3(String value) { + setOwner(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JShareableEntityRecord value4(Long value) { + setProjectId(value); + return this; + } + + @Override + public JShareableEntityRecord values(Long value1, Boolean value2, String value3, Long value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStaleMaterializedViewRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStaleMaterializedViewRecord.java index 04e5c8aa8..42e84abef 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStaleMaterializedViewRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStaleMaterializedViewRecord.java @@ -5,15 +5,14 @@ import com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView; +import java.sql.Timestamp; +import javax.annotation.processing.Generated; import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record3; import org.jooq.Row3; import org.jooq.impl.UpdatableRecordImpl; -import javax.annotation.processing.Generated; -import java.sql.Timestamp; - /** * This class is generated by jOOQ. @@ -25,166 +24,167 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JStaleMaterializedViewRecord extends UpdatableRecordImpl implements Record3 { - - private static final long serialVersionUID = -1478372239; - - /** - * Setter for public.stale_materialized_view.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.stale_materialized_view.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.stale_materialized_view.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.stale_materialized_view.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.stale_materialized_view.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(2, value); - } - - /** - * Getter for public.stale_materialized_view.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(2); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID; - } - - @Override - public Field field2() { - return JStaleMaterializedView.STALE_MATERIALIZED_VIEW.NAME; - } - - @Override - public Field field3() { - return JStaleMaterializedView.STALE_MATERIALIZED_VIEW.CREATION_DATE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public Timestamp component3() { - return getCreationDate(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public Timestamp value3() { - return getCreationDate(); - } - - @Override - public JStaleMaterializedViewRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JStaleMaterializedViewRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JStaleMaterializedViewRecord value3(Timestamp value) { - setCreationDate(value); - return this; - } - - @Override - public JStaleMaterializedViewRecord values(Long value1, String value2, Timestamp value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JStaleMaterializedViewRecord - */ - public JStaleMaterializedViewRecord() { - super(JStaleMaterializedView.STALE_MATERIALIZED_VIEW); - } - - /** - * Create a detached, initialised JStaleMaterializedViewRecord - */ - public JStaleMaterializedViewRecord(Long id, String name, Timestamp creationDate) { - super(JStaleMaterializedView.STALE_MATERIALIZED_VIEW); - - set(0, id); - set(1, name); - set(2, creationDate); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JStaleMaterializedViewRecord extends + UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = -1478372239; + + /** + * Create a detached JStaleMaterializedViewRecord + */ + public JStaleMaterializedViewRecord() { + super(JStaleMaterializedView.STALE_MATERIALIZED_VIEW); + } + + /** + * Create a detached, initialised JStaleMaterializedViewRecord + */ + public JStaleMaterializedViewRecord(Long id, String name, Timestamp creationDate) { + super(JStaleMaterializedView.STALE_MATERIALIZED_VIEW); + + set(0, id); + set(1, name); + set(2, creationDate); + } + + /** + * Getter for public.stale_materialized_view.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.stale_materialized_view.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.stale_materialized_view.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.stale_materialized_view.name. + */ + public void setName(String value) { + set(1, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.stale_materialized_view.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.stale_materialized_view.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(2, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID; + } + + @Override + public Field field2() { + return JStaleMaterializedView.STALE_MATERIALIZED_VIEW.NAME; + } + + @Override + public Field field3() { + return JStaleMaterializedView.STALE_MATERIALIZED_VIEW.CREATION_DATE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public Timestamp component3() { + return getCreationDate(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public Timestamp value3() { + return getCreationDate(); + } + + @Override + public JStaleMaterializedViewRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JStaleMaterializedViewRecord value2(String value) { + setName(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JStaleMaterializedViewRecord value3(Timestamp value) { + setCreationDate(value); + return this; + } + + @Override + public JStaleMaterializedViewRecord values(Long value1, String value2, Timestamp value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsFieldRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsFieldRecord.java index 55ac7fb6e..bf93afea4 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsFieldRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsFieldRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JStatisticsField; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record2; @@ -25,129 +23,130 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JStatisticsFieldRecord extends UpdatableRecordImpl implements Record2 { - - private static final long serialVersionUID = 1879883941; - - /** - * Setter for public.statistics_field.sf_id. - */ - public void setSfId(Long value) { - set(0, value); - } - - /** - * Getter for public.statistics_field.sf_id. - */ - public Long getSfId() { - return (Long) get(0); - } - - /** - * Setter for public.statistics_field.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.statistics_field.name. - */ - public String getName() { - return (String) get(1); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JStatisticsField.STATISTICS_FIELD.SF_ID; - } - - @Override - public Field field2() { - return JStatisticsField.STATISTICS_FIELD.NAME; - } - - @Override - public Long component1() { - return getSfId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public Long value1() { - return getSfId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public JStatisticsFieldRecord value1(Long value) { - setSfId(value); - return this; - } - - @Override - public JStatisticsFieldRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JStatisticsFieldRecord values(Long value1, String value2) { - value1(value1); - value2(value2); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JStatisticsFieldRecord - */ - public JStatisticsFieldRecord() { - super(JStatisticsField.STATISTICS_FIELD); - } - - /** - * Create a detached, initialised JStatisticsFieldRecord - */ - public JStatisticsFieldRecord(Long sfId, String name) { - super(JStatisticsField.STATISTICS_FIELD); - - set(0, sfId); - set(1, name); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JStatisticsFieldRecord extends UpdatableRecordImpl implements + Record2 { + + private static final long serialVersionUID = 1879883941; + + /** + * Create a detached JStatisticsFieldRecord + */ + public JStatisticsFieldRecord() { + super(JStatisticsField.STATISTICS_FIELD); + } + + /** + * Create a detached, initialised JStatisticsFieldRecord + */ + public JStatisticsFieldRecord(Long sfId, String name) { + super(JStatisticsField.STATISTICS_FIELD); + + set(0, sfId); + set(1, name); + } + + /** + * Getter for public.statistics_field.sf_id. + */ + public Long getSfId() { + return (Long) get(0); + } + + /** + * Setter for public.statistics_field.sf_id. + */ + public void setSfId(Long value) { + set(0, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.statistics_field.name. + */ + public String getName() { + return (String) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.statistics_field.name. + */ + public void setName(String value) { + set(1, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JStatisticsField.STATISTICS_FIELD.SF_ID; + } + + @Override + public Field field2() { + return JStatisticsField.STATISTICS_FIELD.NAME; + } + + @Override + public Long component1() { + return getSfId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public Long value1() { + return getSfId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public JStatisticsFieldRecord value1(Long value) { + setSfId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JStatisticsFieldRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JStatisticsFieldRecord values(Long value1, String value2) { + value1(value1); + value2(value2); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsRecord.java index 4c78a3450..2ddf99fee 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JStatistics; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record5; @@ -25,240 +23,243 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JStatisticsRecord extends UpdatableRecordImpl implements Record5 { - - private static final long serialVersionUID = 1301927224; - - /** - * Setter for public.statistics.s_id. - */ - public void setSId(Long value) { - set(0, value); - } - - /** - * Getter for public.statistics.s_id. - */ - public Long getSId() { - return (Long) get(0); - } - - /** - * Setter for public.statistics.s_counter. - */ - public void setSCounter(Integer value) { - set(1, value); - } - - /** - * Getter for public.statistics.s_counter. - */ - public Integer getSCounter() { - return (Integer) get(1); - } - - /** - * Setter for public.statistics.launch_id. - */ - public void setLaunchId(Long value) { - set(2, value); - } - - /** - * Getter for public.statistics.launch_id. - */ - public Long getLaunchId() { - return (Long) get(2); - } - - /** - * Setter for public.statistics.item_id. - */ - public void setItemId(Long value) { - set(3, value); - } - - /** - * Getter for public.statistics.item_id. - */ - public Long getItemId() { - return (Long) get(3); - } - - /** - * Setter for public.statistics.statistics_field_id. - */ - public void setStatisticsFieldId(Long value) { - set(4, value); - } - - /** - * Getter for public.statistics.statistics_field_id. - */ - public Long getStatisticsFieldId() { - return (Long) get(4); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } - - @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); - } - - @Override - public Field field1() { - return JStatistics.STATISTICS.S_ID; - } - - @Override - public Field field2() { - return JStatistics.STATISTICS.S_COUNTER; - } - - @Override - public Field field3() { - return JStatistics.STATISTICS.LAUNCH_ID; - } - - @Override - public Field field4() { - return JStatistics.STATISTICS.ITEM_ID; - } - - @Override - public Field field5() { - return JStatistics.STATISTICS.STATISTICS_FIELD_ID; - } - - @Override - public Long component1() { - return getSId(); - } - - @Override - public Integer component2() { - return getSCounter(); - } - - @Override - public Long component3() { - return getLaunchId(); - } - - @Override - public Long component4() { - return getItemId(); - } - - @Override - public Long component5() { - return getStatisticsFieldId(); - } - - @Override - public Long value1() { - return getSId(); - } - - @Override - public Integer value2() { - return getSCounter(); - } - - @Override - public Long value3() { - return getLaunchId(); - } - - @Override - public Long value4() { - return getItemId(); - } - - @Override - public Long value5() { - return getStatisticsFieldId(); - } - - @Override - public JStatisticsRecord value1(Long value) { - setSId(value); - return this; - } - - @Override - public JStatisticsRecord value2(Integer value) { - setSCounter(value); - return this; - } - - @Override - public JStatisticsRecord value3(Long value) { - setLaunchId(value); - return this; - } - - @Override - public JStatisticsRecord value4(Long value) { - setItemId(value); - return this; - } - - @Override - public JStatisticsRecord value5(Long value) { - setStatisticsFieldId(value); - return this; - } - - @Override - public JStatisticsRecord values(Long value1, Integer value2, Long value3, Long value4, Long value5) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JStatisticsRecord - */ - public JStatisticsRecord() { - super(JStatistics.STATISTICS); - } - - /** - * Create a detached, initialised JStatisticsRecord - */ - public JStatisticsRecord(Long sId, Integer sCounter, Long launchId, Long itemId, Long statisticsFieldId) { - super(JStatistics.STATISTICS); - - set(0, sId); - set(1, sCounter); - set(2, launchId); - set(3, itemId); - set(4, statisticsFieldId); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JStatisticsRecord extends UpdatableRecordImpl implements + Record5 { + + private static final long serialVersionUID = 1301927224; + + /** + * Create a detached JStatisticsRecord + */ + public JStatisticsRecord() { + super(JStatistics.STATISTICS); + } + + /** + * Create a detached, initialised JStatisticsRecord + */ + public JStatisticsRecord(Long sId, Integer sCounter, Long launchId, Long itemId, + Long statisticsFieldId) { + super(JStatistics.STATISTICS); + + set(0, sId); + set(1, sCounter); + set(2, launchId); + set(3, itemId); + set(4, statisticsFieldId); + } + + /** + * Getter for public.statistics.s_id. + */ + public Long getSId() { + return (Long) get(0); + } + + /** + * Setter for public.statistics.s_id. + */ + public void setSId(Long value) { + set(0, value); + } + + /** + * Getter for public.statistics.s_counter. + */ + public Integer getSCounter() { + return (Integer) get(1); + } + + /** + * Setter for public.statistics.s_counter. + */ + public void setSCounter(Integer value) { + set(1, value); + } + + /** + * Getter for public.statistics.launch_id. + */ + public Long getLaunchId() { + return (Long) get(2); + } + + /** + * Setter for public.statistics.launch_id. + */ + public void setLaunchId(Long value) { + set(2, value); + } + + /** + * Getter for public.statistics.item_id. + */ + public Long getItemId() { + return (Long) get(3); + } + + /** + * Setter for public.statistics.item_id. + */ + public void setItemId(Long value) { + set(3, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.statistics.statistics_field_id. + */ + public Long getStatisticsFieldId() { + return (Long) get(4); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.statistics.statistics_field_id. + */ + public void setStatisticsFieldId(Long value) { + set(4, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return JStatistics.STATISTICS.S_ID; + } + + @Override + public Field field2() { + return JStatistics.STATISTICS.S_COUNTER; + } + + @Override + public Field field3() { + return JStatistics.STATISTICS.LAUNCH_ID; + } + + @Override + public Field field4() { + return JStatistics.STATISTICS.ITEM_ID; + } + + @Override + public Field field5() { + return JStatistics.STATISTICS.STATISTICS_FIELD_ID; + } + + @Override + public Long component1() { + return getSId(); + } + + @Override + public Integer component2() { + return getSCounter(); + } + + @Override + public Long component3() { + return getLaunchId(); + } + + @Override + public Long component4() { + return getItemId(); + } + + @Override + public Long component5() { + return getStatisticsFieldId(); + } + + @Override + public Long value1() { + return getSId(); + } + + @Override + public Integer value2() { + return getSCounter(); + } + + @Override + public Long value3() { + return getLaunchId(); + } + + @Override + public Long value4() { + return getItemId(); + } + + @Override + public Long value5() { + return getStatisticsFieldId(); + } + + @Override + public JStatisticsRecord value1(Long value) { + setSId(value); + return this; + } + + @Override + public JStatisticsRecord value2(Integer value) { + setSCounter(value); + return this; + } + + @Override + public JStatisticsRecord value3(Long value) { + setLaunchId(value); + return this; + } + + @Override + public JStatisticsRecord value4(Long value) { + setItemId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JStatisticsRecord value5(Long value) { + setStatisticsFieldId(value); + return this; + } + + @Override + public JStatisticsRecord values(Long value1, Integer value2, Long value3, Long value4, + Long value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemRecord.java index f4f8dce36..729695368 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemRecord.java @@ -6,11 +6,8 @@ import com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum; import com.epam.ta.reportportal.jooq.tables.JTestItem; - import java.sql.Timestamp; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record18; @@ -28,721 +25,728 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JTestItemRecord extends UpdatableRecordImpl implements Record18 { - - private static final long serialVersionUID = -759970468; - - /** - * Setter for public.test_item.item_id. - */ - public void setItemId(Long value) { - set(0, value); - } - - /** - * Getter for public.test_item.item_id. - */ - public Long getItemId() { - return (Long) get(0); - } - - /** - * Setter for public.test_item.uuid. - */ - public void setUuid(String value) { - set(1, value); - } - - /** - * Getter for public.test_item.uuid. - */ - public String getUuid() { - return (String) get(1); - } - - /** - * Setter for public.test_item.name. - */ - public void setName(String value) { - set(2, value); - } - - /** - * Getter for public.test_item.name. - */ - public String getName() { - return (String) get(2); - } - - /** - * Setter for public.test_item.code_ref. - */ - public void setCodeRef(String value) { - set(3, value); - } - - /** - * Getter for public.test_item.code_ref. - */ - public String getCodeRef() { - return (String) get(3); - } - - /** - * Setter for public.test_item.type. - */ - public void setType(JTestItemTypeEnum value) { - set(4, value); - } - - /** - * Getter for public.test_item.type. - */ - public JTestItemTypeEnum getType() { - return (JTestItemTypeEnum) get(4); - } - - /** - * Setter for public.test_item.start_time. - */ - public void setStartTime(Timestamp value) { - set(5, value); - } - - /** - * Getter for public.test_item.start_time. - */ - public Timestamp getStartTime() { - return (Timestamp) get(5); - } - - /** - * Setter for public.test_item.description. - */ - public void setDescription(String value) { - set(6, value); - } - - /** - * Getter for public.test_item.description. - */ - public String getDescription() { - return (String) get(6); - } - - /** - * Setter for public.test_item.last_modified. - */ - public void setLastModified(Timestamp value) { - set(7, value); - } - - /** - * Getter for public.test_item.last_modified. - */ - public Timestamp getLastModified() { - return (Timestamp) get(7); - } - - /** - * Setter for public.test_item.path. - */ - public void setPath(Object value) { - set(8, value); - } - - /** - * Getter for public.test_item.path. - */ - public Object getPath() { - return get(8); - } - - /** - * Setter for public.test_item.unique_id. - */ - public void setUniqueId(String value) { - set(9, value); - } - - /** - * Getter for public.test_item.unique_id. - */ - public String getUniqueId() { - return (String) get(9); - } - - /** - * Setter for public.test_item.test_case_id. - */ - public void setTestCaseId(String value) { - set(10, value); - } - - /** - * Getter for public.test_item.test_case_id. - */ - public String getTestCaseId() { - return (String) get(10); - } - - /** - * Setter for public.test_item.has_children. - */ - public void setHasChildren(Boolean value) { - set(11, value); - } - - /** - * Getter for public.test_item.has_children. - */ - public Boolean getHasChildren() { - return (Boolean) get(11); - } - - /** - * Setter for public.test_item.has_retries. - */ - public void setHasRetries(Boolean value) { - set(12, value); - } - - /** - * Getter for public.test_item.has_retries. - */ - public Boolean getHasRetries() { - return (Boolean) get(12); - } - - /** - * Setter for public.test_item.has_stats. - */ - public void setHasStats(Boolean value) { - set(13, value); - } - - /** - * Getter for public.test_item.has_stats. - */ - public Boolean getHasStats() { - return (Boolean) get(13); - } - - /** - * Setter for public.test_item.parent_id. - */ - public void setParentId(Long value) { - set(14, value); - } - - /** - * Getter for public.test_item.parent_id. - */ - public Long getParentId() { - return (Long) get(14); - } - - /** - * Setter for public.test_item.retry_of. - */ - public void setRetryOf(Long value) { - set(15, value); - } - - /** - * Getter for public.test_item.retry_of. - */ - public Long getRetryOf() { - return (Long) get(15); - } - - /** - * Setter for public.test_item.launch_id. - */ - public void setLaunchId(Long value) { - set(16, value); - } - - /** - * Getter for public.test_item.launch_id. - */ - public Long getLaunchId() { - return (Long) get(16); - } - - /** - * Setter for public.test_item.test_case_hash. - */ - public void setTestCaseHash(Integer value) { - set(17, value); - } - - /** - * Getter for public.test_item.test_case_hash. - */ - public Integer getTestCaseHash() { - return (Integer) get(17); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record18 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row18 fieldsRow() { - return (Row18) super.fieldsRow(); - } - - @Override - public Row18 valuesRow() { - return (Row18) super.valuesRow(); - } - - @Override - public Field field1() { - return JTestItem.TEST_ITEM.ITEM_ID; - } - - @Override - public Field field2() { - return JTestItem.TEST_ITEM.UUID; - } - - @Override - public Field field3() { - return JTestItem.TEST_ITEM.NAME; - } - - @Override - public Field field4() { - return JTestItem.TEST_ITEM.CODE_REF; - } - - @Override - public Field field5() { - return JTestItem.TEST_ITEM.TYPE; - } - - @Override - public Field field6() { - return JTestItem.TEST_ITEM.START_TIME; - } - - @Override - public Field field7() { - return JTestItem.TEST_ITEM.DESCRIPTION; - } - - @Override - public Field field8() { - return JTestItem.TEST_ITEM.LAST_MODIFIED; - } - - @Override - public Field field9() { - return JTestItem.TEST_ITEM.PATH; - } - - @Override - public Field field10() { - return JTestItem.TEST_ITEM.UNIQUE_ID; - } - - @Override - public Field field11() { - return JTestItem.TEST_ITEM.TEST_CASE_ID; - } - - @Override - public Field field12() { - return JTestItem.TEST_ITEM.HAS_CHILDREN; - } - - @Override - public Field field13() { - return JTestItem.TEST_ITEM.HAS_RETRIES; - } - - @Override - public Field field14() { - return JTestItem.TEST_ITEM.HAS_STATS; - } - - @Override - public Field field15() { - return JTestItem.TEST_ITEM.PARENT_ID; - } - - @Override - public Field field16() { - return JTestItem.TEST_ITEM.RETRY_OF; - } - - @Override - public Field field17() { - return JTestItem.TEST_ITEM.LAUNCH_ID; - } - - @Override - public Field field18() { - return JTestItem.TEST_ITEM.TEST_CASE_HASH; - } - - @Override - public Long component1() { - return getItemId(); - } - - @Override - public String component2() { - return getUuid(); - } - - @Override - public String component3() { - return getName(); - } - - @Override - public String component4() { - return getCodeRef(); - } - - @Override - public JTestItemTypeEnum component5() { - return getType(); - } - - @Override - public Timestamp component6() { - return getStartTime(); - } - - @Override - public String component7() { - return getDescription(); - } - - @Override - public Timestamp component8() { - return getLastModified(); - } - - @Override - public Object component9() { - return getPath(); - } - - @Override - public String component10() { - return getUniqueId(); - } - - @Override - public String component11() { - return getTestCaseId(); - } - - @Override - public Boolean component12() { - return getHasChildren(); - } - - @Override - public Boolean component13() { - return getHasRetries(); - } - - @Override - public Boolean component14() { - return getHasStats(); - } - - @Override - public Long component15() { - return getParentId(); - } - - @Override - public Long component16() { - return getRetryOf(); - } - - @Override - public Long component17() { - return getLaunchId(); - } - - @Override - public Integer component18() { - return getTestCaseHash(); - } - - @Override - public Long value1() { - return getItemId(); - } - - @Override - public String value2() { - return getUuid(); - } - - @Override - public String value3() { - return getName(); - } - - @Override - public String value4() { - return getCodeRef(); - } - - @Override - public JTestItemTypeEnum value5() { - return getType(); - } - - @Override - public Timestamp value6() { - return getStartTime(); - } - - @Override - public String value7() { - return getDescription(); - } - - @Override - public Timestamp value8() { - return getLastModified(); - } - - @Override - public Object value9() { - return getPath(); - } - - @Override - public String value10() { - return getUniqueId(); - } - - @Override - public String value11() { - return getTestCaseId(); - } - - @Override - public Boolean value12() { - return getHasChildren(); - } - - @Override - public Boolean value13() { - return getHasRetries(); - } - - @Override - public Boolean value14() { - return getHasStats(); - } - - @Override - public Long value15() { - return getParentId(); - } - - @Override - public Long value16() { - return getRetryOf(); - } - - @Override - public Long value17() { - return getLaunchId(); - } - - @Override - public Integer value18() { - return getTestCaseHash(); - } - - @Override - public JTestItemRecord value1(Long value) { - setItemId(value); - return this; - } - - @Override - public JTestItemRecord value2(String value) { - setUuid(value); - return this; - } - - @Override - public JTestItemRecord value3(String value) { - setName(value); - return this; - } - - @Override - public JTestItemRecord value4(String value) { - setCodeRef(value); - return this; - } - - @Override - public JTestItemRecord value5(JTestItemTypeEnum value) { - setType(value); - return this; - } - - @Override - public JTestItemRecord value6(Timestamp value) { - setStartTime(value); - return this; - } - - @Override - public JTestItemRecord value7(String value) { - setDescription(value); - return this; - } - - @Override - public JTestItemRecord value8(Timestamp value) { - setLastModified(value); - return this; - } - - @Override - public JTestItemRecord value9(Object value) { - setPath(value); - return this; - } - - @Override - public JTestItemRecord value10(String value) { - setUniqueId(value); - return this; - } - - @Override - public JTestItemRecord value11(String value) { - setTestCaseId(value); - return this; - } - - @Override - public JTestItemRecord value12(Boolean value) { - setHasChildren(value); - return this; - } - - @Override - public JTestItemRecord value13(Boolean value) { - setHasRetries(value); - return this; - } - - @Override - public JTestItemRecord value14(Boolean value) { - setHasStats(value); - return this; - } - - @Override - public JTestItemRecord value15(Long value) { - setParentId(value); - return this; - } - - @Override - public JTestItemRecord value16(Long value) { - setRetryOf(value); - return this; - } - - @Override - public JTestItemRecord value17(Long value) { - setLaunchId(value); - return this; - } - - @Override - public JTestItemRecord value18(Integer value) { - setTestCaseHash(value); - return this; - } - - @Override - public JTestItemRecord values(Long value1, String value2, String value3, String value4, JTestItemTypeEnum value5, Timestamp value6, String value7, Timestamp value8, Object value9, String value10, String value11, Boolean value12, Boolean value13, Boolean value14, Long value15, Long value16, Long value17, Integer value18) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - value12(value12); - value13(value13); - value14(value14); - value15(value15); - value16(value16); - value17(value17); - value18(value18); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JTestItemRecord - */ - public JTestItemRecord() { - super(JTestItem.TEST_ITEM); - } - - /** - * Create a detached, initialised JTestItemRecord - */ - public JTestItemRecord(Long itemId, String uuid, String name, String codeRef, JTestItemTypeEnum type, Timestamp startTime, String description, Timestamp lastModified, Object path, String uniqueId, String testCaseId, Boolean hasChildren, Boolean hasRetries, Boolean hasStats, Long parentId, Long retryOf, Long launchId, Integer testCaseHash) { - super(JTestItem.TEST_ITEM); - - set(0, itemId); - set(1, uuid); - set(2, name); - set(3, codeRef); - set(4, type); - set(5, startTime); - set(6, description); - set(7, lastModified); - set(8, path); - set(9, uniqueId); - set(10, testCaseId); - set(11, hasChildren); - set(12, hasRetries); - set(13, hasStats); - set(14, parentId); - set(15, retryOf); - set(16, launchId); - set(17, testCaseHash); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JTestItemRecord extends UpdatableRecordImpl implements + Record18 { + + private static final long serialVersionUID = -759970468; + + /** + * Create a detached JTestItemRecord + */ + public JTestItemRecord() { + super(JTestItem.TEST_ITEM); + } + + /** + * Create a detached, initialised JTestItemRecord + */ + public JTestItemRecord(Long itemId, String uuid, String name, String codeRef, + JTestItemTypeEnum type, Timestamp startTime, String description, Timestamp lastModified, + Object path, String uniqueId, String testCaseId, Boolean hasChildren, Boolean hasRetries, + Boolean hasStats, Long parentId, Long retryOf, Long launchId, Integer testCaseHash) { + super(JTestItem.TEST_ITEM); + + set(0, itemId); + set(1, uuid); + set(2, name); + set(3, codeRef); + set(4, type); + set(5, startTime); + set(6, description); + set(7, lastModified); + set(8, path); + set(9, uniqueId); + set(10, testCaseId); + set(11, hasChildren); + set(12, hasRetries); + set(13, hasStats); + set(14, parentId); + set(15, retryOf); + set(16, launchId); + set(17, testCaseHash); + } + + /** + * Getter for public.test_item.item_id. + */ + public Long getItemId() { + return (Long) get(0); + } + + /** + * Setter for public.test_item.item_id. + */ + public void setItemId(Long value) { + set(0, value); + } + + /** + * Getter for public.test_item.uuid. + */ + public String getUuid() { + return (String) get(1); + } + + /** + * Setter for public.test_item.uuid. + */ + public void setUuid(String value) { + set(1, value); + } + + /** + * Getter for public.test_item.name. + */ + public String getName() { + return (String) get(2); + } + + /** + * Setter for public.test_item.name. + */ + public void setName(String value) { + set(2, value); + } + + /** + * Getter for public.test_item.code_ref. + */ + public String getCodeRef() { + return (String) get(3); + } + + /** + * Setter for public.test_item.code_ref. + */ + public void setCodeRef(String value) { + set(3, value); + } + + /** + * Getter for public.test_item.type. + */ + public JTestItemTypeEnum getType() { + return (JTestItemTypeEnum) get(4); + } + + /** + * Setter for public.test_item.type. + */ + public void setType(JTestItemTypeEnum value) { + set(4, value); + } + + /** + * Getter for public.test_item.start_time. + */ + public Timestamp getStartTime() { + return (Timestamp) get(5); + } + + /** + * Setter for public.test_item.start_time. + */ + public void setStartTime(Timestamp value) { + set(5, value); + } + + /** + * Getter for public.test_item.description. + */ + public String getDescription() { + return (String) get(6); + } + + /** + * Setter for public.test_item.description. + */ + public void setDescription(String value) { + set(6, value); + } + + /** + * Getter for public.test_item.last_modified. + */ + public Timestamp getLastModified() { + return (Timestamp) get(7); + } + + /** + * Setter for public.test_item.last_modified. + */ + public void setLastModified(Timestamp value) { + set(7, value); + } + + /** + * Getter for public.test_item.path. + */ + public Object getPath() { + return get(8); + } + + /** + * Setter for public.test_item.path. + */ + public void setPath(Object value) { + set(8, value); + } + + /** + * Getter for public.test_item.unique_id. + */ + public String getUniqueId() { + return (String) get(9); + } + + /** + * Setter for public.test_item.unique_id. + */ + public void setUniqueId(String value) { + set(9, value); + } + + /** + * Getter for public.test_item.test_case_id. + */ + public String getTestCaseId() { + return (String) get(10); + } + + /** + * Setter for public.test_item.test_case_id. + */ + public void setTestCaseId(String value) { + set(10, value); + } + + /** + * Getter for public.test_item.has_children. + */ + public Boolean getHasChildren() { + return (Boolean) get(11); + } + + /** + * Setter for public.test_item.has_children. + */ + public void setHasChildren(Boolean value) { + set(11, value); + } + + /** + * Getter for public.test_item.has_retries. + */ + public Boolean getHasRetries() { + return (Boolean) get(12); + } + + /** + * Setter for public.test_item.has_retries. + */ + public void setHasRetries(Boolean value) { + set(12, value); + } + + /** + * Getter for public.test_item.has_stats. + */ + public Boolean getHasStats() { + return (Boolean) get(13); + } + + /** + * Setter for public.test_item.has_stats. + */ + public void setHasStats(Boolean value) { + set(13, value); + } + + /** + * Getter for public.test_item.parent_id. + */ + public Long getParentId() { + return (Long) get(14); + } + + /** + * Setter for public.test_item.parent_id. + */ + public void setParentId(Long value) { + set(14, value); + } + + /** + * Getter for public.test_item.retry_of. + */ + public Long getRetryOf() { + return (Long) get(15); + } + + /** + * Setter for public.test_item.retry_of. + */ + public void setRetryOf(Long value) { + set(15, value); + } + + /** + * Getter for public.test_item.launch_id. + */ + public Long getLaunchId() { + return (Long) get(16); + } + + /** + * Setter for public.test_item.launch_id. + */ + public void setLaunchId(Long value) { + set(16, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.test_item.test_case_hash. + */ + public Integer getTestCaseHash() { + return (Integer) get(17); + } + + // ------------------------------------------------------------------------- + // Record18 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.test_item.test_case_hash. + */ + public void setTestCaseHash(Integer value) { + set(17, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row18 fieldsRow() { + return (Row18) super.fieldsRow(); + } + + @Override + public Row18 valuesRow() { + return (Row18) super.valuesRow(); + } + + @Override + public Field field1() { + return JTestItem.TEST_ITEM.ITEM_ID; + } + + @Override + public Field field2() { + return JTestItem.TEST_ITEM.UUID; + } + + @Override + public Field field3() { + return JTestItem.TEST_ITEM.NAME; + } + + @Override + public Field field4() { + return JTestItem.TEST_ITEM.CODE_REF; + } + + @Override + public Field field5() { + return JTestItem.TEST_ITEM.TYPE; + } + + @Override + public Field field6() { + return JTestItem.TEST_ITEM.START_TIME; + } + + @Override + public Field field7() { + return JTestItem.TEST_ITEM.DESCRIPTION; + } + + @Override + public Field field8() { + return JTestItem.TEST_ITEM.LAST_MODIFIED; + } + + @Override + public Field field9() { + return JTestItem.TEST_ITEM.PATH; + } + + @Override + public Field field10() { + return JTestItem.TEST_ITEM.UNIQUE_ID; + } + + @Override + public Field field11() { + return JTestItem.TEST_ITEM.TEST_CASE_ID; + } + + @Override + public Field field12() { + return JTestItem.TEST_ITEM.HAS_CHILDREN; + } + + @Override + public Field field13() { + return JTestItem.TEST_ITEM.HAS_RETRIES; + } + + @Override + public Field field14() { + return JTestItem.TEST_ITEM.HAS_STATS; + } + + @Override + public Field field15() { + return JTestItem.TEST_ITEM.PARENT_ID; + } + + @Override + public Field field16() { + return JTestItem.TEST_ITEM.RETRY_OF; + } + + @Override + public Field field17() { + return JTestItem.TEST_ITEM.LAUNCH_ID; + } + + @Override + public Field field18() { + return JTestItem.TEST_ITEM.TEST_CASE_HASH; + } + + @Override + public Long component1() { + return getItemId(); + } + + @Override + public String component2() { + return getUuid(); + } + + @Override + public String component3() { + return getName(); + } + + @Override + public String component4() { + return getCodeRef(); + } + + @Override + public JTestItemTypeEnum component5() { + return getType(); + } + + @Override + public Timestamp component6() { + return getStartTime(); + } + + @Override + public String component7() { + return getDescription(); + } + + @Override + public Timestamp component8() { + return getLastModified(); + } + + @Override + public Object component9() { + return getPath(); + } + + @Override + public String component10() { + return getUniqueId(); + } + + @Override + public String component11() { + return getTestCaseId(); + } + + @Override + public Boolean component12() { + return getHasChildren(); + } + + @Override + public Boolean component13() { + return getHasRetries(); + } + + @Override + public Boolean component14() { + return getHasStats(); + } + + @Override + public Long component15() { + return getParentId(); + } + + @Override + public Long component16() { + return getRetryOf(); + } + + @Override + public Long component17() { + return getLaunchId(); + } + + @Override + public Integer component18() { + return getTestCaseHash(); + } + + @Override + public Long value1() { + return getItemId(); + } + + @Override + public String value2() { + return getUuid(); + } + + @Override + public String value3() { + return getName(); + } + + @Override + public String value4() { + return getCodeRef(); + } + + @Override + public JTestItemTypeEnum value5() { + return getType(); + } + + @Override + public Timestamp value6() { + return getStartTime(); + } + + @Override + public String value7() { + return getDescription(); + } + + @Override + public Timestamp value8() { + return getLastModified(); + } + + @Override + public Object value9() { + return getPath(); + } + + @Override + public String value10() { + return getUniqueId(); + } + + @Override + public String value11() { + return getTestCaseId(); + } + + @Override + public Boolean value12() { + return getHasChildren(); + } + + @Override + public Boolean value13() { + return getHasRetries(); + } + + @Override + public Boolean value14() { + return getHasStats(); + } + + @Override + public Long value15() { + return getParentId(); + } + + @Override + public Long value16() { + return getRetryOf(); + } + + @Override + public Long value17() { + return getLaunchId(); + } + + @Override + public Integer value18() { + return getTestCaseHash(); + } + + @Override + public JTestItemRecord value1(Long value) { + setItemId(value); + return this; + } + + @Override + public JTestItemRecord value2(String value) { + setUuid(value); + return this; + } + + @Override + public JTestItemRecord value3(String value) { + setName(value); + return this; + } + + @Override + public JTestItemRecord value4(String value) { + setCodeRef(value); + return this; + } + + @Override + public JTestItemRecord value5(JTestItemTypeEnum value) { + setType(value); + return this; + } + + @Override + public JTestItemRecord value6(Timestamp value) { + setStartTime(value); + return this; + } + + @Override + public JTestItemRecord value7(String value) { + setDescription(value); + return this; + } + + @Override + public JTestItemRecord value8(Timestamp value) { + setLastModified(value); + return this; + } + + @Override + public JTestItemRecord value9(Object value) { + setPath(value); + return this; + } + + @Override + public JTestItemRecord value10(String value) { + setUniqueId(value); + return this; + } + + @Override + public JTestItemRecord value11(String value) { + setTestCaseId(value); + return this; + } + + @Override + public JTestItemRecord value12(Boolean value) { + setHasChildren(value); + return this; + } + + @Override + public JTestItemRecord value13(Boolean value) { + setHasRetries(value); + return this; + } + + @Override + public JTestItemRecord value14(Boolean value) { + setHasStats(value); + return this; + } + + @Override + public JTestItemRecord value15(Long value) { + setParentId(value); + return this; + } + + @Override + public JTestItemRecord value16(Long value) { + setRetryOf(value); + return this; + } + + @Override + public JTestItemRecord value17(Long value) { + setLaunchId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JTestItemRecord value18(Integer value) { + setTestCaseHash(value); + return this; + } + + @Override + public JTestItemRecord values(Long value1, String value2, String value3, String value4, + JTestItemTypeEnum value5, Timestamp value6, String value7, Timestamp value8, Object value9, + String value10, String value11, Boolean value12, Boolean value13, Boolean value14, + Long value15, Long value16, Long value17, Integer value18) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + value15(value15); + value16(value16); + value17(value17); + value18(value18); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemResultsRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemResultsRecord.java index 3b8dc81f7..407842718 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemResultsRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemResultsRecord.java @@ -6,11 +6,8 @@ import com.epam.ta.reportportal.jooq.enums.JStatusEnum; import com.epam.ta.reportportal.jooq.tables.JTestItemResults; - import java.sql.Timestamp; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -28,203 +25,206 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JTestItemResultsRecord extends UpdatableRecordImpl implements Record4 { - - private static final long serialVersionUID = 188670853; - - /** - * Setter for public.test_item_results.result_id. - */ - public void setResultId(Long value) { - set(0, value); - } - - /** - * Getter for public.test_item_results.result_id. - */ - public Long getResultId() { - return (Long) get(0); - } - - /** - * Setter for public.test_item_results.status. - */ - public void setStatus(JStatusEnum value) { - set(1, value); - } - - /** - * Getter for public.test_item_results.status. - */ - public JStatusEnum getStatus() { - return (JStatusEnum) get(1); - } - - /** - * Setter for public.test_item_results.end_time. - */ - public void setEndTime(Timestamp value) { - set(2, value); - } - - /** - * Getter for public.test_item_results.end_time. - */ - public Timestamp getEndTime() { - return (Timestamp) get(2); - } - - /** - * Setter for public.test_item_results.duration. - */ - public void setDuration(Double value) { - set(3, value); - } - - /** - * Getter for public.test_item_results.duration. - */ - public Double getDuration() { - return (Double) get(3); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID; - } - - @Override - public Field field2() { - return JTestItemResults.TEST_ITEM_RESULTS.STATUS; - } - - @Override - public Field field3() { - return JTestItemResults.TEST_ITEM_RESULTS.END_TIME; - } - - @Override - public Field field4() { - return JTestItemResults.TEST_ITEM_RESULTS.DURATION; - } - - @Override - public Long component1() { - return getResultId(); - } - - @Override - public JStatusEnum component2() { - return getStatus(); - } - - @Override - public Timestamp component3() { - return getEndTime(); - } - - @Override - public Double component4() { - return getDuration(); - } - - @Override - public Long value1() { - return getResultId(); - } - - @Override - public JStatusEnum value2() { - return getStatus(); - } - - @Override - public Timestamp value3() { - return getEndTime(); - } - - @Override - public Double value4() { - return getDuration(); - } - - @Override - public JTestItemResultsRecord value1(Long value) { - setResultId(value); - return this; - } - - @Override - public JTestItemResultsRecord value2(JStatusEnum value) { - setStatus(value); - return this; - } - - @Override - public JTestItemResultsRecord value3(Timestamp value) { - setEndTime(value); - return this; - } - - @Override - public JTestItemResultsRecord value4(Double value) { - setDuration(value); - return this; - } - - @Override - public JTestItemResultsRecord values(Long value1, JStatusEnum value2, Timestamp value3, Double value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JTestItemResultsRecord - */ - public JTestItemResultsRecord() { - super(JTestItemResults.TEST_ITEM_RESULTS); - } - - /** - * Create a detached, initialised JTestItemResultsRecord - */ - public JTestItemResultsRecord(Long resultId, JStatusEnum status, Timestamp endTime, Double duration) { - super(JTestItemResults.TEST_ITEM_RESULTS); - - set(0, resultId); - set(1, status); - set(2, endTime); - set(3, duration); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JTestItemResultsRecord extends UpdatableRecordImpl implements + Record4 { + + private static final long serialVersionUID = 188670853; + + /** + * Create a detached JTestItemResultsRecord + */ + public JTestItemResultsRecord() { + super(JTestItemResults.TEST_ITEM_RESULTS); + } + + /** + * Create a detached, initialised JTestItemResultsRecord + */ + public JTestItemResultsRecord(Long resultId, JStatusEnum status, Timestamp endTime, + Double duration) { + super(JTestItemResults.TEST_ITEM_RESULTS); + + set(0, resultId); + set(1, status); + set(2, endTime); + set(3, duration); + } + + /** + * Getter for public.test_item_results.result_id. + */ + public Long getResultId() { + return (Long) get(0); + } + + /** + * Setter for public.test_item_results.result_id. + */ + public void setResultId(Long value) { + set(0, value); + } + + /** + * Getter for public.test_item_results.status. + */ + public JStatusEnum getStatus() { + return (JStatusEnum) get(1); + } + + /** + * Setter for public.test_item_results.status. + */ + public void setStatus(JStatusEnum value) { + set(1, value); + } + + /** + * Getter for public.test_item_results.end_time. + */ + public Timestamp getEndTime() { + return (Timestamp) get(2); + } + + /** + * Setter for public.test_item_results.end_time. + */ + public void setEndTime(Timestamp value) { + set(2, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.test_item_results.duration. + */ + public Double getDuration() { + return (Double) get(3); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.test_item_results.duration. + */ + public void setDuration(Double value) { + set(3, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID; + } + + @Override + public Field field2() { + return JTestItemResults.TEST_ITEM_RESULTS.STATUS; + } + + @Override + public Field field3() { + return JTestItemResults.TEST_ITEM_RESULTS.END_TIME; + } + + @Override + public Field field4() { + return JTestItemResults.TEST_ITEM_RESULTS.DURATION; + } + + @Override + public Long component1() { + return getResultId(); + } + + @Override + public JStatusEnum component2() { + return getStatus(); + } + + @Override + public Timestamp component3() { + return getEndTime(); + } + + @Override + public Double component4() { + return getDuration(); + } + + @Override + public Long value1() { + return getResultId(); + } + + @Override + public JStatusEnum value2() { + return getStatus(); + } + + @Override + public Timestamp value3() { + return getEndTime(); + } + + @Override + public Double value4() { + return getDuration(); + } + + @Override + public JTestItemResultsRecord value1(Long value) { + setResultId(value); + return this; + } + + @Override + public JTestItemResultsRecord value2(JStatusEnum value) { + setStatus(value); + return this; + } + + @Override + public JTestItemResultsRecord value3(Timestamp value) { + setEndTime(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JTestItemResultsRecord value4(Double value) { + setDuration(value); + return this; + } + + @Override + public JTestItemResultsRecord values(Long value1, JStatusEnum value2, Timestamp value3, + Double value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTicketRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTicketRecord.java index 8891add6c..04bd43d9a 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTicketRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTicketRecord.java @@ -5,11 +5,8 @@ import com.epam.ta.reportportal.jooq.tables.JTicket; - import java.sql.Timestamp; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record8; @@ -27,351 +24,354 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JTicketRecord extends UpdatableRecordImpl implements Record8 { - - private static final long serialVersionUID = 2136482225; - - /** - * Setter for public.ticket.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.ticket.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.ticket.ticket_id. - */ - public void setTicketId(String value) { - set(1, value); - } - - /** - * Getter for public.ticket.ticket_id. - */ - public String getTicketId() { - return (String) get(1); - } - - /** - * Setter for public.ticket.submitter. - */ - public void setSubmitter(String value) { - set(2, value); - } - - /** - * Getter for public.ticket.submitter. - */ - public String getSubmitter() { - return (String) get(2); - } - - /** - * Setter for public.ticket.submit_date. - */ - public void setSubmitDate(Timestamp value) { - set(3, value); - } - - /** - * Getter for public.ticket.submit_date. - */ - public Timestamp getSubmitDate() { - return (Timestamp) get(3); - } - - /** - * Setter for public.ticket.bts_url. - */ - public void setBtsUrl(String value) { - set(4, value); - } - - /** - * Getter for public.ticket.bts_url. - */ - public String getBtsUrl() { - return (String) get(4); - } - - /** - * Setter for public.ticket.bts_project. - */ - public void setBtsProject(String value) { - set(5, value); - } - - /** - * Getter for public.ticket.bts_project. - */ - public String getBtsProject() { - return (String) get(5); - } - - /** - * Setter for public.ticket.url. - */ - public void setUrl(String value) { - set(6, value); - } - - /** - * Getter for public.ticket.url. - */ - public String getUrl() { - return (String) get(6); - } - - /** - * Setter for public.ticket.plugin_name. - */ - public void setPluginName(String value) { - set(7, value); - } - - /** - * Getter for public.ticket.plugin_name. - */ - public String getPluginName() { - return (String) get(7); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - @Override - public Field field1() { - return JTicket.TICKET.ID; - } - - @Override - public Field field2() { - return JTicket.TICKET.TICKET_ID; - } - - @Override - public Field field3() { - return JTicket.TICKET.SUBMITTER; - } - - @Override - public Field field4() { - return JTicket.TICKET.SUBMIT_DATE; - } - - @Override - public Field field5() { - return JTicket.TICKET.BTS_URL; - } - - @Override - public Field field6() { - return JTicket.TICKET.BTS_PROJECT; - } - - @Override - public Field field7() { - return JTicket.TICKET.URL; - } - - @Override - public Field field8() { - return JTicket.TICKET.PLUGIN_NAME; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getTicketId(); - } - - @Override - public String component3() { - return getSubmitter(); - } - - @Override - public Timestamp component4() { - return getSubmitDate(); - } - - @Override - public String component5() { - return getBtsUrl(); - } - - @Override - public String component6() { - return getBtsProject(); - } - - @Override - public String component7() { - return getUrl(); - } - - @Override - public String component8() { - return getPluginName(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getTicketId(); - } - - @Override - public String value3() { - return getSubmitter(); - } - - @Override - public Timestamp value4() { - return getSubmitDate(); - } - - @Override - public String value5() { - return getBtsUrl(); - } - - @Override - public String value6() { - return getBtsProject(); - } - - @Override - public String value7() { - return getUrl(); - } - - @Override - public String value8() { - return getPluginName(); - } - - @Override - public JTicketRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JTicketRecord value2(String value) { - setTicketId(value); - return this; - } - - @Override - public JTicketRecord value3(String value) { - setSubmitter(value); - return this; - } - - @Override - public JTicketRecord value4(Timestamp value) { - setSubmitDate(value); - return this; - } - - @Override - public JTicketRecord value5(String value) { - setBtsUrl(value); - return this; - } - - @Override - public JTicketRecord value6(String value) { - setBtsProject(value); - return this; - } - - @Override - public JTicketRecord value7(String value) { - setUrl(value); - return this; - } - - @Override - public JTicketRecord value8(String value) { - setPluginName(value); - return this; - } - - @Override - public JTicketRecord values(Long value1, String value2, String value3, Timestamp value4, String value5, String value6, String value7, String value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JTicketRecord - */ - public JTicketRecord() { - super(JTicket.TICKET); - } - - /** - * Create a detached, initialised JTicketRecord - */ - public JTicketRecord(Long id, String ticketId, String submitter, Timestamp submitDate, String btsUrl, String btsProject, String url, String pluginName) { - super(JTicket.TICKET); - - set(0, id); - set(1, ticketId); - set(2, submitter); - set(3, submitDate); - set(4, btsUrl); - set(5, btsProject); - set(6, url); - set(7, pluginName); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JTicketRecord extends UpdatableRecordImpl implements + Record8 { + + private static final long serialVersionUID = 2136482225; + + /** + * Create a detached JTicketRecord + */ + public JTicketRecord() { + super(JTicket.TICKET); + } + + /** + * Create a detached, initialised JTicketRecord + */ + public JTicketRecord(Long id, String ticketId, String submitter, Timestamp submitDate, + String btsUrl, String btsProject, String url, String pluginName) { + super(JTicket.TICKET); + + set(0, id); + set(1, ticketId); + set(2, submitter); + set(3, submitDate); + set(4, btsUrl); + set(5, btsProject); + set(6, url); + set(7, pluginName); + } + + /** + * Getter for public.ticket.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.ticket.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.ticket.ticket_id. + */ + public String getTicketId() { + return (String) get(1); + } + + /** + * Setter for public.ticket.ticket_id. + */ + public void setTicketId(String value) { + set(1, value); + } + + /** + * Getter for public.ticket.submitter. + */ + public String getSubmitter() { + return (String) get(2); + } + + /** + * Setter for public.ticket.submitter. + */ + public void setSubmitter(String value) { + set(2, value); + } + + /** + * Getter for public.ticket.submit_date. + */ + public Timestamp getSubmitDate() { + return (Timestamp) get(3); + } + + /** + * Setter for public.ticket.submit_date. + */ + public void setSubmitDate(Timestamp value) { + set(3, value); + } + + /** + * Getter for public.ticket.bts_url. + */ + public String getBtsUrl() { + return (String) get(4); + } + + /** + * Setter for public.ticket.bts_url. + */ + public void setBtsUrl(String value) { + set(4, value); + } + + /** + * Getter for public.ticket.bts_project. + */ + public String getBtsProject() { + return (String) get(5); + } + + /** + * Setter for public.ticket.bts_project. + */ + public void setBtsProject(String value) { + set(5, value); + } + + /** + * Getter for public.ticket.url. + */ + public String getUrl() { + return (String) get(6); + } + + /** + * Setter for public.ticket.url. + */ + public void setUrl(String value) { + set(6, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.ticket.plugin_name. + */ + public String getPluginName() { + return (String) get(7); + } + + // ------------------------------------------------------------------------- + // Record8 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.ticket.plugin_name. + */ + public void setPluginName(String value) { + set(7, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } + + @Override + public Row8 valuesRow() { + return (Row8) super.valuesRow(); + } + + @Override + public Field field1() { + return JTicket.TICKET.ID; + } + + @Override + public Field field2() { + return JTicket.TICKET.TICKET_ID; + } + + @Override + public Field field3() { + return JTicket.TICKET.SUBMITTER; + } + + @Override + public Field field4() { + return JTicket.TICKET.SUBMIT_DATE; + } + + @Override + public Field field5() { + return JTicket.TICKET.BTS_URL; + } + + @Override + public Field field6() { + return JTicket.TICKET.BTS_PROJECT; + } + + @Override + public Field field7() { + return JTicket.TICKET.URL; + } + + @Override + public Field field8() { + return JTicket.TICKET.PLUGIN_NAME; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getTicketId(); + } + + @Override + public String component3() { + return getSubmitter(); + } + + @Override + public Timestamp component4() { + return getSubmitDate(); + } + + @Override + public String component5() { + return getBtsUrl(); + } + + @Override + public String component6() { + return getBtsProject(); + } + + @Override + public String component7() { + return getUrl(); + } + + @Override + public String component8() { + return getPluginName(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getTicketId(); + } + + @Override + public String value3() { + return getSubmitter(); + } + + @Override + public Timestamp value4() { + return getSubmitDate(); + } + + @Override + public String value5() { + return getBtsUrl(); + } + + @Override + public String value6() { + return getBtsProject(); + } + + @Override + public String value7() { + return getUrl(); + } + + @Override + public String value8() { + return getPluginName(); + } + + @Override + public JTicketRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JTicketRecord value2(String value) { + setTicketId(value); + return this; + } + + @Override + public JTicketRecord value3(String value) { + setSubmitter(value); + return this; + } + + @Override + public JTicketRecord value4(Timestamp value) { + setSubmitDate(value); + return this; + } + + @Override + public JTicketRecord value5(String value) { + setBtsUrl(value); + return this; + } + + @Override + public JTicketRecord value6(String value) { + setBtsProject(value); + return this; + } + + @Override + public JTicketRecord value7(String value) { + setUrl(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JTicketRecord value8(String value) { + setPluginName(value); + return this; + } + + @Override + public JTicketRecord values(Long value1, String value2, String value3, Timestamp value4, + String value5, String value6, String value7, String value8) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserCreationBidRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserCreationBidRecord.java index 441f83c7a..2bc6f6eaf 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserCreationBidRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserCreationBidRecord.java @@ -5,11 +5,8 @@ import com.epam.ta.reportportal.jooq.tables.JUserCreationBid; - import java.sql.Timestamp; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record5; @@ -27,240 +24,243 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JUserCreationBidRecord extends UpdatableRecordImpl implements Record5 { - - private static final long serialVersionUID = 503171682; - - /** - * Setter for public.user_creation_bid.uuid. - */ - public void setUuid(String value) { - set(0, value); - } - - /** - * Getter for public.user_creation_bid.uuid. - */ - public String getUuid() { - return (String) get(0); - } - - /** - * Setter for public.user_creation_bid.last_modified. - */ - public void setLastModified(Timestamp value) { - set(1, value); - } - - /** - * Getter for public.user_creation_bid.last_modified. - */ - public Timestamp getLastModified() { - return (Timestamp) get(1); - } - - /** - * Setter for public.user_creation_bid.email. - */ - public void setEmail(String value) { - set(2, value); - } - - /** - * Getter for public.user_creation_bid.email. - */ - public String getEmail() { - return (String) get(2); - } - - /** - * Setter for public.user_creation_bid.default_project_id. - */ - public void setDefaultProjectId(Long value) { - set(3, value); - } - - /** - * Getter for public.user_creation_bid.default_project_id. - */ - public Long getDefaultProjectId() { - return (Long) get(3); - } - - /** - * Setter for public.user_creation_bid.role. - */ - public void setRole(String value) { - set(4, value); - } - - /** - * Getter for public.user_creation_bid.role. - */ - public String getRole() { - return (String) get(4); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } - - @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); - } - - @Override - public Field field1() { - return JUserCreationBid.USER_CREATION_BID.UUID; - } - - @Override - public Field field2() { - return JUserCreationBid.USER_CREATION_BID.LAST_MODIFIED; - } - - @Override - public Field field3() { - return JUserCreationBid.USER_CREATION_BID.EMAIL; - } - - @Override - public Field field4() { - return JUserCreationBid.USER_CREATION_BID.DEFAULT_PROJECT_ID; - } - - @Override - public Field field5() { - return JUserCreationBid.USER_CREATION_BID.ROLE; - } - - @Override - public String component1() { - return getUuid(); - } - - @Override - public Timestamp component2() { - return getLastModified(); - } - - @Override - public String component3() { - return getEmail(); - } - - @Override - public Long component4() { - return getDefaultProjectId(); - } - - @Override - public String component5() { - return getRole(); - } - - @Override - public String value1() { - return getUuid(); - } - - @Override - public Timestamp value2() { - return getLastModified(); - } - - @Override - public String value3() { - return getEmail(); - } - - @Override - public Long value4() { - return getDefaultProjectId(); - } - - @Override - public String value5() { - return getRole(); - } - - @Override - public JUserCreationBidRecord value1(String value) { - setUuid(value); - return this; - } - - @Override - public JUserCreationBidRecord value2(Timestamp value) { - setLastModified(value); - return this; - } - - @Override - public JUserCreationBidRecord value3(String value) { - setEmail(value); - return this; - } - - @Override - public JUserCreationBidRecord value4(Long value) { - setDefaultProjectId(value); - return this; - } - - @Override - public JUserCreationBidRecord value5(String value) { - setRole(value); - return this; - } - - @Override - public JUserCreationBidRecord values(String value1, Timestamp value2, String value3, Long value4, String value5) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JUserCreationBidRecord - */ - public JUserCreationBidRecord() { - super(JUserCreationBid.USER_CREATION_BID); - } - - /** - * Create a detached, initialised JUserCreationBidRecord - */ - public JUserCreationBidRecord(String uuid, Timestamp lastModified, String email, Long defaultProjectId, String role) { - super(JUserCreationBid.USER_CREATION_BID); - - set(0, uuid); - set(1, lastModified); - set(2, email); - set(3, defaultProjectId); - set(4, role); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JUserCreationBidRecord extends UpdatableRecordImpl implements + Record5 { + + private static final long serialVersionUID = 503171682; + + /** + * Create a detached JUserCreationBidRecord + */ + public JUserCreationBidRecord() { + super(JUserCreationBid.USER_CREATION_BID); + } + + /** + * Create a detached, initialised JUserCreationBidRecord + */ + public JUserCreationBidRecord(String uuid, Timestamp lastModified, String email, + Long defaultProjectId, String role) { + super(JUserCreationBid.USER_CREATION_BID); + + set(0, uuid); + set(1, lastModified); + set(2, email); + set(3, defaultProjectId); + set(4, role); + } + + /** + * Getter for public.user_creation_bid.uuid. + */ + public String getUuid() { + return (String) get(0); + } + + /** + * Setter for public.user_creation_bid.uuid. + */ + public void setUuid(String value) { + set(0, value); + } + + /** + * Getter for public.user_creation_bid.last_modified. + */ + public Timestamp getLastModified() { + return (Timestamp) get(1); + } + + /** + * Setter for public.user_creation_bid.last_modified. + */ + public void setLastModified(Timestamp value) { + set(1, value); + } + + /** + * Getter for public.user_creation_bid.email. + */ + public String getEmail() { + return (String) get(2); + } + + /** + * Setter for public.user_creation_bid.email. + */ + public void setEmail(String value) { + set(2, value); + } + + /** + * Getter for public.user_creation_bid.default_project_id. + */ + public Long getDefaultProjectId() { + return (Long) get(3); + } + + /** + * Setter for public.user_creation_bid.default_project_id. + */ + public void setDefaultProjectId(Long value) { + set(3, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.user_creation_bid.role. + */ + public String getRole() { + return (String) get(4); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.user_creation_bid.role. + */ + public void setRole(String value) { + set(4, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return JUserCreationBid.USER_CREATION_BID.UUID; + } + + @Override + public Field field2() { + return JUserCreationBid.USER_CREATION_BID.LAST_MODIFIED; + } + + @Override + public Field field3() { + return JUserCreationBid.USER_CREATION_BID.EMAIL; + } + + @Override + public Field field4() { + return JUserCreationBid.USER_CREATION_BID.DEFAULT_PROJECT_ID; + } + + @Override + public Field field5() { + return JUserCreationBid.USER_CREATION_BID.ROLE; + } + + @Override + public String component1() { + return getUuid(); + } + + @Override + public Timestamp component2() { + return getLastModified(); + } + + @Override + public String component3() { + return getEmail(); + } + + @Override + public Long component4() { + return getDefaultProjectId(); + } + + @Override + public String component5() { + return getRole(); + } + + @Override + public String value1() { + return getUuid(); + } + + @Override + public Timestamp value2() { + return getLastModified(); + } + + @Override + public String value3() { + return getEmail(); + } + + @Override + public Long value4() { + return getDefaultProjectId(); + } + + @Override + public String value5() { + return getRole(); + } + + @Override + public JUserCreationBidRecord value1(String value) { + setUuid(value); + return this; + } + + @Override + public JUserCreationBidRecord value2(Timestamp value) { + setLastModified(value); + return this; + } + + @Override + public JUserCreationBidRecord value3(String value) { + setEmail(value); + return this; + } + + @Override + public JUserCreationBidRecord value4(Long value) { + setDefaultProjectId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JUserCreationBidRecord value5(String value) { + setRole(value); + return this; + } + + @Override + public JUserCreationBidRecord values(String value1, Timestamp value2, String value3, Long value4, + String value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserPreferenceRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserPreferenceRecord.java index ea8b61038..cf7565694 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserPreferenceRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserPreferenceRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JUserPreference; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -25,203 +23,204 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JUserPreferenceRecord extends UpdatableRecordImpl implements Record4 { - - private static final long serialVersionUID = 1708369277; - - /** - * Setter for public.user_preference.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.user_preference.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.user_preference.project_id. - */ - public void setProjectId(Long value) { - set(1, value); - } - - /** - * Getter for public.user_preference.project_id. - */ - public Long getProjectId() { - return (Long) get(1); - } - - /** - * Setter for public.user_preference.user_id. - */ - public void setUserId(Long value) { - set(2, value); - } - - /** - * Getter for public.user_preference.user_id. - */ - public Long getUserId() { - return (Long) get(2); - } - - /** - * Setter for public.user_preference.filter_id. - */ - public void setFilterId(Long value) { - set(3, value); - } - - /** - * Getter for public.user_preference.filter_id. - */ - public Long getFilterId() { - return (Long) get(3); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JUserPreference.USER_PREFERENCE.ID; - } - - @Override - public Field field2() { - return JUserPreference.USER_PREFERENCE.PROJECT_ID; - } - - @Override - public Field field3() { - return JUserPreference.USER_PREFERENCE.USER_ID; - } - - @Override - public Field field4() { - return JUserPreference.USER_PREFERENCE.FILTER_ID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getProjectId(); - } - - @Override - public Long component3() { - return getUserId(); - } - - @Override - public Long component4() { - return getFilterId(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getProjectId(); - } - - @Override - public Long value3() { - return getUserId(); - } - - @Override - public Long value4() { - return getFilterId(); - } - - @Override - public JUserPreferenceRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JUserPreferenceRecord value2(Long value) { - setProjectId(value); - return this; - } - - @Override - public JUserPreferenceRecord value3(Long value) { - setUserId(value); - return this; - } - - @Override - public JUserPreferenceRecord value4(Long value) { - setFilterId(value); - return this; - } - - @Override - public JUserPreferenceRecord values(Long value1, Long value2, Long value3, Long value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JUserPreferenceRecord - */ - public JUserPreferenceRecord() { - super(JUserPreference.USER_PREFERENCE); - } - - /** - * Create a detached, initialised JUserPreferenceRecord - */ - public JUserPreferenceRecord(Long id, Long projectId, Long userId, Long filterId) { - super(JUserPreference.USER_PREFERENCE); - - set(0, id); - set(1, projectId); - set(2, userId); - set(3, filterId); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JUserPreferenceRecord extends UpdatableRecordImpl implements + Record4 { + + private static final long serialVersionUID = 1708369277; + + /** + * Create a detached JUserPreferenceRecord + */ + public JUserPreferenceRecord() { + super(JUserPreference.USER_PREFERENCE); + } + + /** + * Create a detached, initialised JUserPreferenceRecord + */ + public JUserPreferenceRecord(Long id, Long projectId, Long userId, Long filterId) { + super(JUserPreference.USER_PREFERENCE); + + set(0, id); + set(1, projectId); + set(2, userId); + set(3, filterId); + } + + /** + * Getter for public.user_preference.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.user_preference.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.user_preference.project_id. + */ + public Long getProjectId() { + return (Long) get(1); + } + + /** + * Setter for public.user_preference.project_id. + */ + public void setProjectId(Long value) { + set(1, value); + } + + /** + * Getter for public.user_preference.user_id. + */ + public Long getUserId() { + return (Long) get(2); + } + + /** + * Setter for public.user_preference.user_id. + */ + public void setUserId(Long value) { + set(2, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.user_preference.filter_id. + */ + public Long getFilterId() { + return (Long) get(3); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.user_preference.filter_id. + */ + public void setFilterId(Long value) { + set(3, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JUserPreference.USER_PREFERENCE.ID; + } + + @Override + public Field field2() { + return JUserPreference.USER_PREFERENCE.PROJECT_ID; + } + + @Override + public Field field3() { + return JUserPreference.USER_PREFERENCE.USER_ID; + } + + @Override + public Field field4() { + return JUserPreference.USER_PREFERENCE.FILTER_ID; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getProjectId(); + } + + @Override + public Long component3() { + return getUserId(); + } + + @Override + public Long component4() { + return getFilterId(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getProjectId(); + } + + @Override + public Long value3() { + return getUserId(); + } + + @Override + public Long value4() { + return getFilterId(); + } + + @Override + public JUserPreferenceRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JUserPreferenceRecord value2(Long value) { + setProjectId(value); + return this; + } + + @Override + public JUserPreferenceRecord value3(Long value) { + setUserId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JUserPreferenceRecord value4(Long value) { + setFilterId(value); + return this; + } + + @Override + public JUserPreferenceRecord values(Long value1, Long value2, Long value3, Long value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUsersRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUsersRecord.java index 4dffd9558..0dbe9ed12 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUsersRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUsersRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JUsers; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.JSONB; import org.jooq.Record1; @@ -26,462 +24,467 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JUsersRecord extends UpdatableRecordImpl implements Record11 { - - private static final long serialVersionUID = -329787849; - - /** - * Setter for public.users.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.users.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.users.login. - */ - public void setLogin(String value) { - set(1, value); - } - - /** - * Getter for public.users.login. - */ - public String getLogin() { - return (String) get(1); - } - - /** - * Setter for public.users.password. - */ - public void setPassword(String value) { - set(2, value); - } - - /** - * Getter for public.users.password. - */ - public String getPassword() { - return (String) get(2); - } - - /** - * Setter for public.users.email. - */ - public void setEmail(String value) { - set(3, value); - } - - /** - * Getter for public.users.email. - */ - public String getEmail() { - return (String) get(3); - } - - /** - * Setter for public.users.attachment. - */ - public void setAttachment(String value) { - set(4, value); - } - - /** - * Getter for public.users.attachment. - */ - public String getAttachment() { - return (String) get(4); - } - - /** - * Setter for public.users.attachment_thumbnail. - */ - public void setAttachmentThumbnail(String value) { - set(5, value); - } - - /** - * Getter for public.users.attachment_thumbnail. - */ - public String getAttachmentThumbnail() { - return (String) get(5); - } - - /** - * Setter for public.users.role. - */ - public void setRole(String value) { - set(6, value); - } - - /** - * Getter for public.users.role. - */ - public String getRole() { - return (String) get(6); - } - - /** - * Setter for public.users.type. - */ - public void setType(String value) { - set(7, value); - } - - /** - * Getter for public.users.type. - */ - public String getType() { - return (String) get(7); - } - - /** - * Setter for public.users.expired. - */ - public void setExpired(Boolean value) { - set(8, value); - } - - /** - * Getter for public.users.expired. - */ - public Boolean getExpired() { - return (Boolean) get(8); - } - - /** - * Setter for public.users.full_name. - */ - public void setFullName(String value) { - set(9, value); - } - - /** - * Getter for public.users.full_name. - */ - public String getFullName() { - return (String) get(9); - } - - /** - * Setter for public.users.metadata. - */ - public void setMetadata(JSONB value) { - set(10, value); - } - - /** - * Getter for public.users.metadata. - */ - public JSONB getMetadata() { - return (JSONB) get(10); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record11 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); - } - - @Override - public Row11 valuesRow() { - return (Row11) super.valuesRow(); - } - - @Override - public Field field1() { - return JUsers.USERS.ID; - } - - @Override - public Field field2() { - return JUsers.USERS.LOGIN; - } - - @Override - public Field field3() { - return JUsers.USERS.PASSWORD; - } - - @Override - public Field field4() { - return JUsers.USERS.EMAIL; - } - - @Override - public Field field5() { - return JUsers.USERS.ATTACHMENT; - } - - @Override - public Field field6() { - return JUsers.USERS.ATTACHMENT_THUMBNAIL; - } - - @Override - public Field field7() { - return JUsers.USERS.ROLE; - } - - @Override - public Field field8() { - return JUsers.USERS.TYPE; - } - - @Override - public Field field9() { - return JUsers.USERS.EXPIRED; - } - - @Override - public Field field10() { - return JUsers.USERS.FULL_NAME; - } - - @Override - public Field field11() { - return JUsers.USERS.METADATA; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getLogin(); - } - - @Override - public String component3() { - return getPassword(); - } - - @Override - public String component4() { - return getEmail(); - } - - @Override - public String component5() { - return getAttachment(); - } - - @Override - public String component6() { - return getAttachmentThumbnail(); - } - - @Override - public String component7() { - return getRole(); - } - - @Override - public String component8() { - return getType(); - } - - @Override - public Boolean component9() { - return getExpired(); - } - - @Override - public String component10() { - return getFullName(); - } - - @Override - public JSONB component11() { - return getMetadata(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getLogin(); - } - - @Override - public String value3() { - return getPassword(); - } - - @Override - public String value4() { - return getEmail(); - } - - @Override - public String value5() { - return getAttachment(); - } - - @Override - public String value6() { - return getAttachmentThumbnail(); - } - - @Override - public String value7() { - return getRole(); - } - - @Override - public String value8() { - return getType(); - } - - @Override - public Boolean value9() { - return getExpired(); - } - - @Override - public String value10() { - return getFullName(); - } - - @Override - public JSONB value11() { - return getMetadata(); - } - - @Override - public JUsersRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JUsersRecord value2(String value) { - setLogin(value); - return this; - } - - @Override - public JUsersRecord value3(String value) { - setPassword(value); - return this; - } - - @Override - public JUsersRecord value4(String value) { - setEmail(value); - return this; - } - - @Override - public JUsersRecord value5(String value) { - setAttachment(value); - return this; - } - - @Override - public JUsersRecord value6(String value) { - setAttachmentThumbnail(value); - return this; - } - - @Override - public JUsersRecord value7(String value) { - setRole(value); - return this; - } - - @Override - public JUsersRecord value8(String value) { - setType(value); - return this; - } - - @Override - public JUsersRecord value9(Boolean value) { - setExpired(value); - return this; - } - - @Override - public JUsersRecord value10(String value) { - setFullName(value); - return this; - } - - @Override - public JUsersRecord value11(JSONB value) { - setMetadata(value); - return this; - } - - @Override - public JUsersRecord values(Long value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, Boolean value9, String value10, JSONB value11) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JUsersRecord - */ - public JUsersRecord() { - super(JUsers.USERS); - } - - /** - * Create a detached, initialised JUsersRecord - */ - public JUsersRecord(Long id, String login, String password, String email, String attachment, String attachmentThumbnail, String role, String type, Boolean expired, String fullName, JSONB metadata) { - super(JUsers.USERS); - - set(0, id); - set(1, login); - set(2, password); - set(3, email); - set(4, attachment); - set(5, attachmentThumbnail); - set(6, role); - set(7, type); - set(8, expired); - set(9, fullName); - set(10, metadata); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JUsersRecord extends UpdatableRecordImpl implements + Record11 { + + private static final long serialVersionUID = -329787849; + + /** + * Create a detached JUsersRecord + */ + public JUsersRecord() { + super(JUsers.USERS); + } + + /** + * Create a detached, initialised JUsersRecord + */ + public JUsersRecord(Long id, String login, String password, String email, String attachment, + String attachmentThumbnail, String role, String type, Boolean expired, String fullName, + JSONB metadata) { + super(JUsers.USERS); + + set(0, id); + set(1, login); + set(2, password); + set(3, email); + set(4, attachment); + set(5, attachmentThumbnail); + set(6, role); + set(7, type); + set(8, expired); + set(9, fullName); + set(10, metadata); + } + + /** + * Getter for public.users.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.users.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.users.login. + */ + public String getLogin() { + return (String) get(1); + } + + /** + * Setter for public.users.login. + */ + public void setLogin(String value) { + set(1, value); + } + + /** + * Getter for public.users.password. + */ + public String getPassword() { + return (String) get(2); + } + + /** + * Setter for public.users.password. + */ + public void setPassword(String value) { + set(2, value); + } + + /** + * Getter for public.users.email. + */ + public String getEmail() { + return (String) get(3); + } + + /** + * Setter for public.users.email. + */ + public void setEmail(String value) { + set(3, value); + } + + /** + * Getter for public.users.attachment. + */ + public String getAttachment() { + return (String) get(4); + } + + /** + * Setter for public.users.attachment. + */ + public void setAttachment(String value) { + set(4, value); + } + + /** + * Getter for public.users.attachment_thumbnail. + */ + public String getAttachmentThumbnail() { + return (String) get(5); + } + + /** + * Setter for public.users.attachment_thumbnail. + */ + public void setAttachmentThumbnail(String value) { + set(5, value); + } + + /** + * Getter for public.users.role. + */ + public String getRole() { + return (String) get(6); + } + + /** + * Setter for public.users.role. + */ + public void setRole(String value) { + set(6, value); + } + + /** + * Getter for public.users.type. + */ + public String getType() { + return (String) get(7); + } + + /** + * Setter for public.users.type. + */ + public void setType(String value) { + set(7, value); + } + + /** + * Getter for public.users.expired. + */ + public Boolean getExpired() { + return (Boolean) get(8); + } + + /** + * Setter for public.users.expired. + */ + public void setExpired(Boolean value) { + set(8, value); + } + + /** + * Getter for public.users.full_name. + */ + public String getFullName() { + return (String) get(9); + } + + /** + * Setter for public.users.full_name. + */ + public void setFullName(String value) { + set(9, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.users.metadata. + */ + public JSONB getMetadata() { + return (JSONB) get(10); + } + + // ------------------------------------------------------------------------- + // Record11 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.users.metadata. + */ + public void setMetadata(JSONB value) { + set(10, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } + + @Override + public Row11 valuesRow() { + return (Row11) super.valuesRow(); + } + + @Override + public Field field1() { + return JUsers.USERS.ID; + } + + @Override + public Field field2() { + return JUsers.USERS.LOGIN; + } + + @Override + public Field field3() { + return JUsers.USERS.PASSWORD; + } + + @Override + public Field field4() { + return JUsers.USERS.EMAIL; + } + + @Override + public Field field5() { + return JUsers.USERS.ATTACHMENT; + } + + @Override + public Field field6() { + return JUsers.USERS.ATTACHMENT_THUMBNAIL; + } + + @Override + public Field field7() { + return JUsers.USERS.ROLE; + } + + @Override + public Field field8() { + return JUsers.USERS.TYPE; + } + + @Override + public Field field9() { + return JUsers.USERS.EXPIRED; + } + + @Override + public Field field10() { + return JUsers.USERS.FULL_NAME; + } + + @Override + public Field field11() { + return JUsers.USERS.METADATA; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getLogin(); + } + + @Override + public String component3() { + return getPassword(); + } + + @Override + public String component4() { + return getEmail(); + } + + @Override + public String component5() { + return getAttachment(); + } + + @Override + public String component6() { + return getAttachmentThumbnail(); + } + + @Override + public String component7() { + return getRole(); + } + + @Override + public String component8() { + return getType(); + } + + @Override + public Boolean component9() { + return getExpired(); + } + + @Override + public String component10() { + return getFullName(); + } + + @Override + public JSONB component11() { + return getMetadata(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getLogin(); + } + + @Override + public String value3() { + return getPassword(); + } + + @Override + public String value4() { + return getEmail(); + } + + @Override + public String value5() { + return getAttachment(); + } + + @Override + public String value6() { + return getAttachmentThumbnail(); + } + + @Override + public String value7() { + return getRole(); + } + + @Override + public String value8() { + return getType(); + } + + @Override + public Boolean value9() { + return getExpired(); + } + + @Override + public String value10() { + return getFullName(); + } + + @Override + public JSONB value11() { + return getMetadata(); + } + + @Override + public JUsersRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JUsersRecord value2(String value) { + setLogin(value); + return this; + } + + @Override + public JUsersRecord value3(String value) { + setPassword(value); + return this; + } + + @Override + public JUsersRecord value4(String value) { + setEmail(value); + return this; + } + + @Override + public JUsersRecord value5(String value) { + setAttachment(value); + return this; + } + + @Override + public JUsersRecord value6(String value) { + setAttachmentThumbnail(value); + return this; + } + + @Override + public JUsersRecord value7(String value) { + setRole(value); + return this; + } + + @Override + public JUsersRecord value8(String value) { + setType(value); + return this; + } + + @Override + public JUsersRecord value9(Boolean value) { + setExpired(value); + return this; + } + + @Override + public JUsersRecord value10(String value) { + setFullName(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JUsersRecord value11(JSONB value) { + setMetadata(value); + return this; + } + + @Override + public JUsersRecord values(Long value1, String value2, String value3, String value4, + String value5, String value6, String value7, String value8, Boolean value9, String value10, + JSONB value11) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetFilterRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetFilterRecord.java index e4f6db2ab..7f8a0fa40 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetFilterRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetFilterRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -24,129 +22,130 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JWidgetFilterRecord extends UpdatableRecordImpl implements Record2 { - - private static final long serialVersionUID = 618192211; - - /** - * Setter for public.widget_filter.widget_id. - */ - public void setWidgetId(Long value) { - set(0, value); - } - - /** - * Getter for public.widget_filter.widget_id. - */ - public Long getWidgetId() { - return (Long) get(0); - } - - /** - * Setter for public.widget_filter.filter_id. - */ - public void setFilterId(Long value) { - set(1, value); - } - - /** - * Getter for public.widget_filter.filter_id. - */ - public Long getFilterId() { - return (Long) get(1); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record2 key() { - return (Record2) super.key(); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JWidgetFilter.WIDGET_FILTER.WIDGET_ID; - } - - @Override - public Field field2() { - return JWidgetFilter.WIDGET_FILTER.FILTER_ID; - } - - @Override - public Long component1() { - return getWidgetId(); - } - - @Override - public Long component2() { - return getFilterId(); - } - - @Override - public Long value1() { - return getWidgetId(); - } - - @Override - public Long value2() { - return getFilterId(); - } - - @Override - public JWidgetFilterRecord value1(Long value) { - setWidgetId(value); - return this; - } - - @Override - public JWidgetFilterRecord value2(Long value) { - setFilterId(value); - return this; - } - - @Override - public JWidgetFilterRecord values(Long value1, Long value2) { - value1(value1); - value2(value2); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JWidgetFilterRecord - */ - public JWidgetFilterRecord() { - super(JWidgetFilter.WIDGET_FILTER); - } - - /** - * Create a detached, initialised JWidgetFilterRecord - */ - public JWidgetFilterRecord(Long widgetId, Long filterId) { - super(JWidgetFilter.WIDGET_FILTER); - - set(0, widgetId); - set(1, filterId); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JWidgetFilterRecord extends UpdatableRecordImpl implements + Record2 { + + private static final long serialVersionUID = 618192211; + + /** + * Create a detached JWidgetFilterRecord + */ + public JWidgetFilterRecord() { + super(JWidgetFilter.WIDGET_FILTER); + } + + /** + * Create a detached, initialised JWidgetFilterRecord + */ + public JWidgetFilterRecord(Long widgetId, Long filterId) { + super(JWidgetFilter.WIDGET_FILTER); + + set(0, widgetId); + set(1, filterId); + } + + /** + * Getter for public.widget_filter.widget_id. + */ + public Long getWidgetId() { + return (Long) get(0); + } + + /** + * Setter for public.widget_filter.widget_id. + */ + public void setWidgetId(Long value) { + set(0, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.widget_filter.filter_id. + */ + public Long getFilterId() { + return (Long) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.widget_filter.filter_id. + */ + public void setFilterId(Long value) { + set(1, value); + } + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JWidgetFilter.WIDGET_FILTER.WIDGET_ID; + } + + @Override + public Field field2() { + return JWidgetFilter.WIDGET_FILTER.FILTER_ID; + } + + @Override + public Long component1() { + return getWidgetId(); + } + + @Override + public Long component2() { + return getFilterId(); + } + + @Override + public Long value1() { + return getWidgetId(); + } + + @Override + public Long value2() { + return getFilterId(); + } + + @Override + public JWidgetFilterRecord value1(Long value) { + setWidgetId(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JWidgetFilterRecord value2(Long value) { + setFilterId(value); + return this; + } + + @Override + public JWidgetFilterRecord values(Long value1, Long value2) { + value1(value1); + value2(value2); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetRecord.java index c582c2f56..fd8e2648c 100755 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetRecord.java @@ -5,9 +5,7 @@ import com.epam.ta.reportportal.jooq.tables.JWidget; - import javax.annotation.processing.Generated; - import org.jooq.Field; import org.jooq.JSONB; import org.jooq.Record1; @@ -26,277 +24,280 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JWidgetRecord extends UpdatableRecordImpl implements Record6 { - - private static final long serialVersionUID = 716998638; - - /** - * Setter for public.widget.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.widget.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.widget.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.widget.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.widget.description. - */ - public void setDescription(String value) { - set(2, value); - } - - /** - * Getter for public.widget.description. - */ - public String getDescription() { - return (String) get(2); - } - - /** - * Setter for public.widget.widget_type. - */ - public void setWidgetType(String value) { - set(3, value); - } - - /** - * Getter for public.widget.widget_type. - */ - public String getWidgetType() { - return (String) get(3); - } - - /** - * Setter for public.widget.items_count. - */ - public void setItemsCount(Short value) { - set(4, value); - } - - /** - * Getter for public.widget.items_count. - */ - public Short getItemsCount() { - return (Short) get(4); - } - - /** - * Setter for public.widget.widget_options. - */ - public void setWidgetOptions(JSONB value) { - set(5, value); - } - - /** - * Getter for public.widget.widget_options. - */ - public JSONB getWidgetOptions() { - return (JSONB) get(5); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return JWidget.WIDGET.ID; - } - - @Override - public Field field2() { - return JWidget.WIDGET.NAME; - } - - @Override - public Field field3() { - return JWidget.WIDGET.DESCRIPTION; - } - - @Override - public Field field4() { - return JWidget.WIDGET.WIDGET_TYPE; - } - - @Override - public Field field5() { - return JWidget.WIDGET.ITEMS_COUNT; - } - - @Override - public Field field6() { - return JWidget.WIDGET.WIDGET_OPTIONS; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public String component3() { - return getDescription(); - } - - @Override - public String component4() { - return getWidgetType(); - } - - @Override - public Short component5() { - return getItemsCount(); - } - - @Override - public JSONB component6() { - return getWidgetOptions(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public String value3() { - return getDescription(); - } - - @Override - public String value4() { - return getWidgetType(); - } - - @Override - public Short value5() { - return getItemsCount(); - } - - @Override - public JSONB value6() { - return getWidgetOptions(); - } - - @Override - public JWidgetRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JWidgetRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JWidgetRecord value3(String value) { - setDescription(value); - return this; - } - - @Override - public JWidgetRecord value4(String value) { - setWidgetType(value); - return this; - } - - @Override - public JWidgetRecord value5(Short value) { - setItemsCount(value); - return this; - } - - @Override - public JWidgetRecord value6(JSONB value) { - setWidgetOptions(value); - return this; - } - - @Override - public JWidgetRecord values(Long value1, String value2, String value3, String value4, Short value5, JSONB value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JWidgetRecord - */ - public JWidgetRecord() { - super(JWidget.WIDGET); - } - - /** - * Create a detached, initialised JWidgetRecord - */ - public JWidgetRecord(Long id, String name, String description, String widgetType, Short itemsCount, JSONB widgetOptions) { - super(JWidget.WIDGET); - - set(0, id); - set(1, name); - set(2, description); - set(3, widgetType); - set(4, itemsCount); - set(5, widgetOptions); - } +@SuppressWarnings({"all", "unchecked", "rawtypes"}) +public class JWidgetRecord extends UpdatableRecordImpl implements + Record6 { + + private static final long serialVersionUID = 716998638; + + /** + * Create a detached JWidgetRecord + */ + public JWidgetRecord() { + super(JWidget.WIDGET); + } + + /** + * Create a detached, initialised JWidgetRecord + */ + public JWidgetRecord(Long id, String name, String description, String widgetType, + Short itemsCount, JSONB widgetOptions) { + super(JWidget.WIDGET); + + set(0, id); + set(1, name); + set(2, description); + set(3, widgetType); + set(4, itemsCount); + set(5, widgetOptions); + } + + /** + * Getter for public.widget.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.widget.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.widget.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.widget.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.widget.description. + */ + public String getDescription() { + return (String) get(2); + } + + /** + * Setter for public.widget.description. + */ + public void setDescription(String value) { + set(2, value); + } + + /** + * Getter for public.widget.widget_type. + */ + public String getWidgetType() { + return (String) get(3); + } + + /** + * Setter for public.widget.widget_type. + */ + public void setWidgetType(String value) { + set(3, value); + } + + /** + * Getter for public.widget.items_count. + */ + public Short getItemsCount() { + return (Short) get(4); + } + + /** + * Setter for public.widget.items_count. + */ + public void setItemsCount(Short value) { + set(4, value); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + /** + * Getter for public.widget.widget_options. + */ + public JSONB getWidgetOptions() { + return (JSONB) get(5); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + /** + * Setter for public.widget.widget_options. + */ + public void setWidgetOptions(JSONB value) { + set(5, value); + } + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return JWidget.WIDGET.ID; + } + + @Override + public Field field2() { + return JWidget.WIDGET.NAME; + } + + @Override + public Field field3() { + return JWidget.WIDGET.DESCRIPTION; + } + + @Override + public Field field4() { + return JWidget.WIDGET.WIDGET_TYPE; + } + + @Override + public Field field5() { + return JWidget.WIDGET.ITEMS_COUNT; + } + + @Override + public Field field6() { + return JWidget.WIDGET.WIDGET_OPTIONS; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public String component3() { + return getDescription(); + } + + @Override + public String component4() { + return getWidgetType(); + } + + @Override + public Short component5() { + return getItemsCount(); + } + + @Override + public JSONB component6() { + return getWidgetOptions(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public String value3() { + return getDescription(); + } + + @Override + public String value4() { + return getWidgetType(); + } + + @Override + public Short value5() { + return getItemsCount(); + } + + @Override + public JSONB value6() { + return getWidgetOptions(); + } + + @Override + public JWidgetRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JWidgetRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JWidgetRecord value3(String value) { + setDescription(value); + return this; + } + + @Override + public JWidgetRecord value4(String value) { + setWidgetType(value); + return this; + } + + @Override + public JWidgetRecord value5(Short value) { + setItemsCount(value); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + @Override + public JWidgetRecord value6(JSONB value) { + setWidgetOptions(value); + return this; + } + + @Override + public JWidgetRecord values(Long value1, String value2, String value3, String value4, + Short value5, JSONB value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } } diff --git a/src/main/java/com/epam/ta/reportportal/util/DateTimeProvider.java b/src/main/java/com/epam/ta/reportportal/util/DateTimeProvider.java index ab4faf975..db9b4ffad 100644 --- a/src/main/java/com/epam/ta/reportportal/util/DateTimeProvider.java +++ b/src/main/java/com/epam/ta/reportportal/util/DateTimeProvider.java @@ -16,9 +16,8 @@ package com.epam.ta.reportportal.util; -import org.springframework.stereotype.Component; - import java.time.LocalDateTime; +import org.springframework.stereotype.Component; /** * Class to ease writing/testing of date-based logic. @@ -28,7 +27,7 @@ @Component public class DateTimeProvider { - public LocalDateTime localDateTimeNow() { - return LocalDateTime.now(); - } + public LocalDateTime localDateTimeNow() { + return LocalDateTime.now(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/util/PersonalProjectService.java b/src/main/java/com/epam/ta/reportportal/util/PersonalProjectService.java index dd5c606f6..f814fb6bb 100644 --- a/src/main/java/com/epam/ta/reportportal/util/PersonalProjectService.java +++ b/src/main/java/com/epam/ta/reportportal/util/PersonalProjectService.java @@ -16,6 +16,10 @@ package com.epam.ta.reportportal.util; +import static com.epam.ta.reportportal.entity.project.ProjectUtils.defaultIssueTypes; +import static com.epam.ta.reportportal.entity.project.ProjectUtils.defaultProjectAttributes; +import static com.google.common.base.Strings.isNullOrEmpty; + import com.epam.ta.reportportal.dao.AttributeRepository; import com.epam.ta.reportportal.dao.IssueTypeRepository; import com.epam.ta.reportportal.dao.ProjectRepository; @@ -27,16 +31,11 @@ import com.epam.ta.reportportal.entity.user.User; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Sets; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - import java.sql.Date; import java.time.ZonedDateTime; import java.util.Collections; - -import static com.epam.ta.reportportal.entity.project.ProjectUtils.defaultIssueTypes; -import static com.epam.ta.reportportal.entity.project.ProjectUtils.defaultProjectAttributes; -import static com.google.common.base.Strings.isNullOrEmpty; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; /** * Generates Personal project for provided user @@ -46,71 +45,76 @@ @Service public final class PersonalProjectService { - public static final String PERSONAL_PROJECT_POSTFIX = "_personal"; - private final ProjectRepository projectRepository; - private final AttributeRepository attributeRepository; - private final IssueTypeRepository issueTypeRepository; - - @Autowired - public PersonalProjectService(ProjectRepository projectRepository, AttributeRepository attributeRepository, - IssueTypeRepository issueTypeRepository) { - this.projectRepository = projectRepository; - this.attributeRepository = attributeRepository; - this.issueTypeRepository = issueTypeRepository; - } - - /** - * Prefix from username with replaced dots as underscores - * - * @param username Name of user - * @return Corresponding personal project name - */ - @VisibleForTesting - private String generatePersonalProjectName(String username) { - String initialName = getProjectPrefix(username); - - String name = initialName; - //iterate until we find free project name - for (int i = 1; projectRepository.existsByName(name); i++) { - name = initialName + "_" + i; - } - - return name; - } - - /** - * Generates personal project for provided user - * - * @param user User project should be created for - * @return Built Project object - */ - public Project generatePersonalProject(User user) { - Project project = new Project(); - project.setName(generatePersonalProjectName(user.getLogin())); - project.setCreationDate(Date.from(ZonedDateTime.now().toInstant())); - project.setProjectType(ProjectType.PERSONAL); - - ProjectUser projectUser = new ProjectUser().withUser(user).withProjectRole(ProjectRole.PROJECT_MANAGER).withProject(project); - project.setUsers(Sets.newHashSet(projectUser)); - - project.setMetadata(new Metadata(Collections.singletonMap("additional_info", - "Personal project of " + (isNullOrEmpty(user.getFullName()) ? user.getLogin() : user.getFullName()) - ))); - - project.setProjectAttributes(defaultProjectAttributes(project, attributeRepository.getDefaultProjectAttributes())); - project.setProjectIssueTypes(defaultIssueTypes(project, issueTypeRepository.getDefaultIssueTypes())); - - return project; - } - - /** - * Generates prefix for personal project - * - * @param username Name of user - * @return Prefix - */ - public String getProjectPrefix(String username) { - String projectName = username.replaceAll("\\.", "_"); - return (projectName + PERSONAL_PROJECT_POSTFIX).toLowerCase(); - } + public static final String PERSONAL_PROJECT_POSTFIX = "_personal"; + private final ProjectRepository projectRepository; + private final AttributeRepository attributeRepository; + private final IssueTypeRepository issueTypeRepository; + + @Autowired + public PersonalProjectService(ProjectRepository projectRepository, + AttributeRepository attributeRepository, + IssueTypeRepository issueTypeRepository) { + this.projectRepository = projectRepository; + this.attributeRepository = attributeRepository; + this.issueTypeRepository = issueTypeRepository; + } + + /** + * Prefix from username with replaced dots as underscores + * + * @param username Name of user + * @return Corresponding personal project name + */ + @VisibleForTesting + private String generatePersonalProjectName(String username) { + String initialName = getProjectPrefix(username); + + String name = initialName; + //iterate until we find free project name + for (int i = 1; projectRepository.existsByName(name); i++) { + name = initialName + "_" + i; + } + + return name; + } + + /** + * Generates personal project for provided user + * + * @param user User project should be created for + * @return Built Project object + */ + public Project generatePersonalProject(User user) { + Project project = new Project(); + project.setName(generatePersonalProjectName(user.getLogin())); + project.setCreationDate(Date.from(ZonedDateTime.now().toInstant())); + project.setProjectType(ProjectType.PERSONAL); + + ProjectUser projectUser = new ProjectUser().withUser(user) + .withProjectRole(ProjectRole.PROJECT_MANAGER).withProject(project); + project.setUsers(Sets.newHashSet(projectUser)); + + project.setMetadata(new Metadata(Collections.singletonMap("additional_info", + "Personal project of " + (isNullOrEmpty(user.getFullName()) ? user.getLogin() + : user.getFullName()) + ))); + + project.setProjectAttributes( + defaultProjectAttributes(project, attributeRepository.getDefaultProjectAttributes())); + project.setProjectIssueTypes( + defaultIssueTypes(project, issueTypeRepository.getDefaultIssueTypes())); + + return project; + } + + /** + * Generates prefix for personal project + * + * @param username Name of user + * @return Prefix + */ + public String getProjectPrefix(String username) { + String projectName = username.replaceAll("\\.", "_"); + return (projectName + PERSONAL_PROJECT_POSTFIX).toLowerCase(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/util/SortUtils.java b/src/main/java/com/epam/ta/reportportal/util/SortUtils.java index 11330a9ba..056e761dc 100644 --- a/src/main/java/com/epam/ta/reportportal/util/SortUtils.java +++ b/src/main/java/com/epam/ta/reportportal/util/SortUtils.java @@ -16,52 +16,55 @@ package com.epam.ta.reportportal.util; +import static com.epam.ta.reportportal.commons.querygen.FilterTarget.FILTERED_QUERY; +import static com.epam.ta.reportportal.commons.querygen.QueryBuilder.STATISTICS_KEY; +import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; +import static java.util.Optional.ofNullable; +import static java.util.stream.Collectors.toList; +import static org.jooq.impl.DSL.field; + import com.epam.ta.reportportal.commons.querygen.CriteriaHolder; import com.epam.ta.reportportal.commons.querygen.FilterTarget; import com.epam.ta.reportportal.commons.validation.BusinessRule; import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.ws.model.ErrorType; -import org.jooq.SortField; -import org.jooq.SortOrder; -import org.springframework.data.domain.Sort; - import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.function.BiFunction; import java.util.stream.StreamSupport; - -import static com.epam.ta.reportportal.commons.querygen.FilterTarget.FILTERED_QUERY; -import static com.epam.ta.reportportal.commons.querygen.QueryBuilder.STATISTICS_KEY; -import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; -import static java.util.Optional.ofNullable; -import static java.util.stream.Collectors.toList; -import static org.jooq.impl.DSL.field; +import org.jooq.SortField; +import org.jooq.SortOrder; +import org.springframework.data.domain.Sort; /** * @author Pavel Bortnik */ public final class SortUtils { - private SortUtils() { - //static only - } + public static final BiFunction>> TO_SORT_FIELDS = (sort, filterTarget) -> ofNullable( + sort).map(s -> StreamSupport + .stream(s.spliterator(), false) + .map(order -> { + BusinessRule.expect(filterTarget, Objects::nonNull) + .verify(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, "Provided value shouldn't be null"); + CriteriaHolder criteria = filterTarget.getCriteriaByFilter(order.getProperty()) + .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_SORTING_PARAMETERS, + order.getProperty())); - public static final BiFunction>> TO_SORT_FIELDS = (sort, filterTarget) -> ofNullable(sort).map(s -> StreamSupport - .stream(s.spliterator(), false) - .map(order -> { - BusinessRule.expect(filterTarget, Objects::nonNull) - .verify(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, "Provided value shouldn't be null"); - CriteriaHolder criteria = filterTarget.getCriteriaByFilter(order.getProperty()) - .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_SORTING_PARAMETERS, order.getProperty())); + if (criteria.getFilterCriteria().startsWith(STATISTICS_KEY)) { + return fieldName(FILTERED_QUERY, criteria.getFilterCriteria()).sort( + order.getDirection().isDescending() ? + SortOrder.DESC : + SortOrder.ASC); + } else { + return field(criteria.getQueryCriteria()).sort( + order.getDirection().isDescending() ? SortOrder.DESC : SortOrder.ASC); + } + }) + .collect(toList())).orElseGet(Collections::emptyList); - if (criteria.getFilterCriteria().startsWith(STATISTICS_KEY)) { - return fieldName(FILTERED_QUERY, criteria.getFilterCriteria()).sort(order.getDirection().isDescending() ? - SortOrder.DESC : - SortOrder.ASC); - } else { - return field(criteria.getQueryCriteria()).sort(order.getDirection().isDescending() ? SortOrder.DESC : SortOrder.ASC); - } - }) - .collect(toList())).orElseGet(Collections::emptyList); + private SortUtils() { + //static only + } } diff --git a/src/main/java/com/epam/ta/reportportal/util/UserUtils.java b/src/main/java/com/epam/ta/reportportal/util/UserUtils.java index 8602cc43c..79ced450d 100644 --- a/src/main/java/com/epam/ta/reportportal/util/UserUtils.java +++ b/src/main/java/com/epam/ta/reportportal/util/UserUtils.java @@ -23,17 +23,17 @@ */ public final class UserUtils { - private UserUtils() { - //static only - } + private UserUtils() { + //static only + } - /** - * Validate email format against RFC822 - * - * @param email Email to be validated - * @return TRUE of email is valid - */ - public static boolean isEmailValid(String email) { - return EmailValidator.getInstance().isValid(email); - } + /** + * Validate email format against RFC822 + * + * @param email Email to be validated + * @return TRUE of email is valid + */ + public static boolean isEmailValid(String email) { + return EmailValidator.getInstance().isValid(email); + } } diff --git a/src/main/java/com/epam/ta/reportportal/util/WidgetSortUtils.java b/src/main/java/com/epam/ta/reportportal/util/WidgetSortUtils.java index 6c9bd8721..bb4d4e5c3 100644 --- a/src/main/java/com/epam/ta/reportportal/util/WidgetSortUtils.java +++ b/src/main/java/com/epam/ta/reportportal/util/WidgetSortUtils.java @@ -16,106 +16,117 @@ package com.epam.ta.reportportal.util; +import static com.epam.ta.reportportal.commons.querygen.QueryBuilder.STATISTICS_KEY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.SF_NAME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATISTICS_COUNTER; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATISTICS_TABLE; +import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; +import static java.util.Optional.ofNullable; +import static java.util.stream.Collectors.toList; +import static org.jooq.impl.DSL.field; +import static org.jooq.impl.DSL.name; + import com.epam.ta.reportportal.commons.querygen.CriteriaHolder; import com.epam.ta.reportportal.commons.querygen.FilterTarget; import com.epam.ta.reportportal.commons.validation.BusinessRule; import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.ws.model.ErrorType; -import org.apache.commons.lang3.StringUtils; -import org.jooq.Field; -import org.jooq.SortField; -import org.jooq.SortOrder; -import org.jooq.impl.DSL; -import org.springframework.data.domain.Sort; - import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.function.BiFunction; import java.util.stream.Collectors; import java.util.stream.StreamSupport; - -import static com.epam.ta.reportportal.commons.querygen.QueryBuilder.STATISTICS_KEY; -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; -import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; -import static java.util.Optional.ofNullable; -import static java.util.stream.Collectors.toList; -import static org.jooq.impl.DSL.field; -import static org.jooq.impl.DSL.name; +import org.apache.commons.lang3.StringUtils; +import org.jooq.Field; +import org.jooq.SortField; +import org.jooq.SortOrder; +import org.jooq.impl.DSL; +import org.springframework.data.domain.Sort; /** * @author Ivan Budayeu */ public final class WidgetSortUtils { - private WidgetSortUtils() { - - //static only - } - - public static BiFunction>> sortingTransformer(FilterTarget filterTarget) { - return (sort, tableName) -> ofNullable(sort).map(s -> StreamSupport.stream(sort.spliterator(), false) - .map(order -> transformToField(filterTarget, order, tableName).sort(order.getDirection().isDescending() ? - SortOrder.DESC : - SortOrder.ASC)) - .collect(Collectors.toList())).orElseGet(Collections::emptyList); - } - - public static BiFunction>> fieldTransformer(FilterTarget filterTarget) { - return (sort, tableName) -> ofNullable(sort).map(s -> StreamSupport.stream(sort.spliterator(), false) - .map(order -> transformToField(filterTarget, order, tableName)) - .collect(Collectors.toList())).orElseGet(Collections::emptyList); - } - - private static Field transformToField(FilterTarget filterTarget, Sort.Order order, String tableName) { - BusinessRule.expect(filterTarget, Objects::nonNull) - .verify(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, "Provided value shouldn't be null"); - - String filterCriteria; - - if (order.getProperty().startsWith(STATISTICS_KEY)) { - filterCriteria = order.getProperty(); - } else { - filterCriteria = filterTarget.getCriteriaByFilter(order.getProperty()) - .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_SORTING_PARAMETERS, order.getProperty())) - .getFilterCriteria(); - } - - return field(name(tableName, filterCriteria)); - } - - public static final BiFunction>> TO_SORT_FIELDS = (sort, filterTarget) -> ofNullable(sort).map( - s -> StreamSupport.stream(s.spliterator(), false).map(order -> { - BusinessRule.expect(filterTarget, Objects::nonNull) - .verify(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, "Provided value shouldn't be null"); - - CriteriaHolder criteria; - - if (order.getProperty().startsWith(STATISTICS_KEY)) { - criteria = new CriteriaHolder( - order.getProperty(), - DSL.coalesce(DSL.max(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER)) - .filterWhere(fieldName(STATISTICS_TABLE, SF_NAME).cast(String.class).eq(order.getProperty())), 0) - .toString(), - Long.class - ); - } else { - criteria = filterTarget.getCriteriaByFilter(order.getProperty()) - .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_SORTING_PARAMETERS, order.getProperty())); - } - - return field(criteria.getQueryCriteria()).sort(order.getDirection().isDescending() ? SortOrder.DESC : SortOrder.ASC); - }).collect(toList())).orElseGet(Collections::emptyList); - - public static final BiFunction, SortField> CUSTOM_TABLE_SORT_CONVERTER = (table, sort) -> { - - if (sort.getName().contains(STATISTICS_TABLE)) { - return sort; - } - String[] qualifiedName = sort.getName().split("\\."); - String sortField = StringUtils.remove(qualifiedName[qualifiedName.length - 1], '"'); - - return field(name(table, sortField)).sort(sort.getOrder()); - - }; + public static final BiFunction>> TO_SORT_FIELDS = (sort, filterTarget) -> ofNullable( + sort).map( + s -> StreamSupport.stream(s.spliterator(), false).map(order -> { + BusinessRule.expect(filterTarget, Objects::nonNull) + .verify(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, "Provided value shouldn't be null"); + + CriteriaHolder criteria; + + if (order.getProperty().startsWith(STATISTICS_KEY)) { + criteria = new CriteriaHolder( + order.getProperty(), + DSL.coalesce(DSL.max(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER)) + .filterWhere(fieldName(STATISTICS_TABLE, SF_NAME).cast(String.class) + .eq(order.getProperty())), 0) + .toString(), + Long.class + ); + } else { + criteria = filterTarget.getCriteriaByFilter(order.getProperty()) + .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_SORTING_PARAMETERS, + order.getProperty())); + } + + return field(criteria.getQueryCriteria()).sort( + order.getDirection().isDescending() ? SortOrder.DESC : SortOrder.ASC); + }).collect(toList())).orElseGet(Collections::emptyList); + public static final BiFunction, SortField> CUSTOM_TABLE_SORT_CONVERTER = (table, sort) -> { + + if (sort.getName().contains(STATISTICS_TABLE)) { + return sort; + } + String[] qualifiedName = sort.getName().split("\\."); + String sortField = StringUtils.remove(qualifiedName[qualifiedName.length - 1], '"'); + + return field(name(table, sortField)).sort(sort.getOrder()); + + }; + + private WidgetSortUtils() { + + //static only + } + + public static BiFunction>> sortingTransformer( + FilterTarget filterTarget) { + return (sort, tableName) -> ofNullable(sort).map( + s -> StreamSupport.stream(sort.spliterator(), false) + .map(order -> transformToField(filterTarget, order, tableName).sort( + order.getDirection().isDescending() ? + SortOrder.DESC : + SortOrder.ASC)) + .collect(Collectors.toList())).orElseGet(Collections::emptyList); + } + + public static BiFunction>> fieldTransformer( + FilterTarget filterTarget) { + return (sort, tableName) -> ofNullable(sort).map( + s -> StreamSupport.stream(sort.spliterator(), false) + .map(order -> transformToField(filterTarget, order, tableName)) + .collect(Collectors.toList())).orElseGet(Collections::emptyList); + } + + private static Field transformToField(FilterTarget filterTarget, Sort.Order order, + String tableName) { + BusinessRule.expect(filterTarget, Objects::nonNull) + .verify(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, "Provided value shouldn't be null"); + + String filterCriteria; + + if (order.getProperty().startsWith(STATISTICS_KEY)) { + filterCriteria = order.getProperty(); + } else { + filterCriteria = filterTarget.getCriteriaByFilter(order.getProperty()) + .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_SORTING_PARAMETERS, + order.getProperty())) + .getFilterCriteria(); + } + + return field(name(tableName, filterCriteria)); + } } diff --git a/src/test/java/com/epam/ta/reportportal/BaseTest.java b/src/test/java/com/epam/ta/reportportal/BaseTest.java index cf6915dc6..fcc62c717 100644 --- a/src/test/java/com/epam/ta/reportportal/BaseTest.java +++ b/src/test/java/com/epam/ta/reportportal/BaseTest.java @@ -33,14 +33,16 @@ * @author Pavel Bortnik */ @ExtendWith(SpringExtension.class) -@ContextConfiguration(classes = { DataSourceConfig.class, DatabaseConfiguration.class, TestConfiguration.class }) +@ContextConfiguration(classes = {DataSourceConfig.class, DatabaseConfiguration.class, + TestConfiguration.class}) @Transactional @ActiveProfiles("unittest") -@TestExecutionListeners(listeners = { FlywayTestExecutionListener.class }, mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS) +@TestExecutionListeners(listeners = { + FlywayTestExecutionListener.class}, mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS) public abstract class BaseTest { - @FlywayTest - @BeforeAll - static void setUp() { - } + @FlywayTest + @BeforeAll + static void setUp() { + } } diff --git a/src/test/java/com/epam/ta/reportportal/binary/CreateLogAttachmentServiceTest.java b/src/test/java/com/epam/ta/reportportal/binary/CreateLogAttachmentServiceTest.java index 02dff9a91..e53ffc13a 100644 --- a/src/test/java/com/epam/ta/reportportal/binary/CreateLogAttachmentServiceTest.java +++ b/src/test/java/com/epam/ta/reportportal/binary/CreateLogAttachmentServiceTest.java @@ -16,76 +16,78 @@ package com.epam.ta.reportportal.binary; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + import com.epam.ta.reportportal.dao.LogRepository; import com.epam.ta.reportportal.entity.attachment.Attachment; import com.epam.ta.reportportal.entity.item.TestItem; import com.epam.ta.reportportal.entity.launch.Launch; import com.epam.ta.reportportal.entity.log.Log; import com.epam.ta.reportportal.exception.ReportPortalException; +import java.time.LocalDateTime; +import java.util.Optional; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import java.time.LocalDateTime; -import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.Mockito.*; - /** * @author Ihar Kahadouski */ @ExtendWith(MockitoExtension.class) class CreateLogAttachmentServiceTest { - @Mock - private LogRepository logRepository; + @Mock + private LogRepository logRepository; - @InjectMocks - private CreateLogAttachmentService createLogAttachmentService; + @InjectMocks + private CreateLogAttachmentService createLogAttachmentService; - @Test - void createAttachmentPositive() { - Log log = getLogWithoutAttachment(); - Attachment attachment = getAttachment(); - when(logRepository.findById(1L)).thenReturn(Optional.of(log)); + @Test + void createAttachmentPositive() { + Log log = getLogWithoutAttachment(); + Attachment attachment = getAttachment(); + when(logRepository.findById(1L)).thenReturn(Optional.of(log)); - createLogAttachmentService.create(attachment, 1L); + createLogAttachmentService.create(attachment, 1L); - verify(logRepository, times(1)).save(log); + verify(logRepository, times(1)).save(log); - assertEquals(log.getAttachment().getFileId(), attachment.getFileId()); - assertEquals(log.getAttachment().getThumbnailId(), attachment.getThumbnailId()); - assertEquals(log.getAttachment().getContentType(), attachment.getContentType()); - } + assertEquals(log.getAttachment().getFileId(), attachment.getFileId()); + assertEquals(log.getAttachment().getThumbnailId(), attachment.getThumbnailId()); + assertEquals(log.getAttachment().getContentType(), attachment.getContentType()); + } - @Test - void createAttachmentOnNotExistLog() { - long logId = 1L; - when(logRepository.findById(logId)).thenReturn(Optional.empty()); + @Test + void createAttachmentOnNotExistLog() { + long logId = 1L; + when(logRepository.findById(logId)).thenReturn(Optional.empty()); - assertThrows(ReportPortalException.class, () -> createLogAttachmentService.create(getAttachment(), logId)); - } + assertThrows(ReportPortalException.class, + () -> createLogAttachmentService.create(getAttachment(), logId)); + } - private Log getLogWithoutAttachment() { - Log log = new Log(); - log.setId(1L); - log.setLaunch(new Launch(2L)); - log.setTestItem(new TestItem(3L)); - log.setLogLevel(4000); - log.setLogMessage("message"); - log.setLogTime(LocalDateTime.now()); - return log; - } + private Log getLogWithoutAttachment() { + Log log = new Log(); + log.setId(1L); + log.setLaunch(new Launch(2L)); + log.setTestItem(new TestItem(3L)); + log.setLogLevel(4000); + log.setLogMessage("message"); + log.setLogTime(LocalDateTime.now()); + return log; + } - private Attachment getAttachment() { - Attachment attachment = new Attachment(); - attachment.setFileId("fileId"); - attachment.setThumbnailId("thumbnailId"); - attachment.setContentType("contentType"); - return attachment; - } + private Attachment getAttachment() { + Attachment attachment = new Attachment(); + attachment.setFileId("fileId"); + attachment.setThumbnailId("thumbnailId"); + attachment.setContentType("contentType"); + return attachment; + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentCommonDataStoreServiceTest.java b/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentCommonDataStoreServiceTest.java index b7bb58b74..2d9729dbf 100644 --- a/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentCommonDataStoreServiceTest.java +++ b/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentCommonDataStoreServiceTest.java @@ -16,71 +16,70 @@ package com.epam.ta.reportportal.binary.impl; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.binary.AttachmentBinaryDataService; import com.epam.ta.reportportal.commons.BinaryDataMetaInfo; import com.epam.ta.reportportal.dao.AttachmentRepository; import com.epam.ta.reportportal.entity.attachment.Attachment; import com.epam.ta.reportportal.entity.attachment.AttachmentMetaInfo; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.jdbc.Sql; - import java.time.LocalDateTime; import java.time.Month; import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.jdbc.Sql; /** * @author Ihar Kahadouski */ class AttachmentCommonDataStoreServiceTest extends BaseTest { - @Autowired - private AttachmentBinaryDataService attachmentBinaryDataService; + @Autowired + private AttachmentBinaryDataService attachmentBinaryDataService; - @Autowired - private AttachmentRepository attachmentRepository; + @Autowired + private AttachmentRepository attachmentRepository; - @Test - @Sql("/db/fill/data-store/data-store-fill.sql") - void AttachFileToExistingLogTest() { - String fileID = "fileID"; - String thumbnailID = "thumbnailID"; - String contentType = "content-type"; - long fileSize = 1024; - final LocalDateTime creationDate = LocalDateTime.of(2020, Month.JANUARY, 1, 1, 1); + @Test + @Sql("/db/fill/data-store/data-store-fill.sql") + void AttachFileToExistingLogTest() { + String fileID = "fileID"; + String thumbnailID = "thumbnailID"; + String contentType = "content-type"; + long fileSize = 1024; + final LocalDateTime creationDate = LocalDateTime.of(2020, Month.JANUARY, 1, 1, 1); - BinaryDataMetaInfo binaryDataMetaInfo = new BinaryDataMetaInfo(); - binaryDataMetaInfo.setFileId(fileID); - binaryDataMetaInfo.setThumbnailFileId(thumbnailID); - binaryDataMetaInfo.setContentType(contentType); - binaryDataMetaInfo.setFileSize(fileSize); + BinaryDataMetaInfo binaryDataMetaInfo = new BinaryDataMetaInfo(); + binaryDataMetaInfo.setFileId(fileID); + binaryDataMetaInfo.setThumbnailFileId(thumbnailID); + binaryDataMetaInfo.setContentType(contentType); + binaryDataMetaInfo.setFileSize(fileSize); - Long projectId = 1L; - Long itemId = 1L; - AttachmentMetaInfo attachmentMetaInfo = AttachmentMetaInfo.builder() - .withProjectId(projectId) - .withLaunchId(1L) - .withItemId(itemId) - .withLogId(1L) - .withCreationDate(creationDate) - .build(); + Long projectId = 1L; + Long itemId = 1L; + AttachmentMetaInfo attachmentMetaInfo = AttachmentMetaInfo.builder() + .withProjectId(projectId) + .withLaunchId(1L) + .withItemId(itemId) + .withLogId(1L) + .withCreationDate(creationDate) + .build(); - attachmentBinaryDataService.attachToLog(binaryDataMetaInfo, attachmentMetaInfo); + attachmentBinaryDataService.attachToLog(binaryDataMetaInfo, attachmentMetaInfo); - Optional attachment = attachmentRepository.findByFileId(fileID); + Optional attachment = attachmentRepository.findByFileId(fileID); - assertTrue(attachment.isPresent()); + assertTrue(attachment.isPresent()); - assertEquals(projectId, attachment.get().getProjectId()); - assertEquals(itemId, attachment.get().getItemId()); - assertEquals(fileID, attachment.get().getFileId()); - assertEquals(thumbnailID, attachment.get().getThumbnailId()); - assertEquals(contentType, attachment.get().getContentType()); - assertEquals(fileSize, attachment.get().getFileSize()); - assertEquals(creationDate, attachment.get().getCreationDate()); - } + assertEquals(projectId, attachment.get().getProjectId()); + assertEquals(itemId, attachment.get().getItemId()); + assertEquals(fileID, attachment.get().getFileId()); + assertEquals(thumbnailID, attachment.get().getThumbnailId()); + assertEquals(contentType, attachment.get().getContentType()); + assertEquals(fileSize, attachment.get().getFileSize()); + assertEquals(creationDate, attachment.get().getCreationDate()); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java b/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java index 561d549ce..42984efc6 100644 --- a/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java +++ b/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java @@ -16,68 +16,75 @@ package com.epam.ta.reportportal.binary.impl; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.exception.ReportPortalException; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.io.ClassPathResource; - import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Optional; import java.util.Random; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.ClassPathResource; /** * @author Ihar Kahadouski */ class AttachmentDataStoreServiceTest extends BaseTest { - @Autowired - private AttachmentDataStoreService attachmentDataStoreService; - - @Value("${datastore.default.path:/data/store}") - private String storageRootPath; - - private static Random random = new Random(); + private static Random random = new Random(); + @Autowired + private AttachmentDataStoreService attachmentDataStoreService; + @Value("${datastore.default.path:/data/store}") + private String storageRootPath; - @Test - void saveLoadAndDeleteTest() throws IOException { - InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); + @Test + void saveLoadAndDeleteTest() throws IOException { + InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); - String fileId = attachmentDataStoreService.save(random.nextLong() + "meh.jpg", inputStream); + String fileId = attachmentDataStoreService.save(random.nextLong() + "meh.jpg", inputStream); - Optional loadedData = attachmentDataStoreService.load(fileId); + Optional loadedData = attachmentDataStoreService.load(fileId); - assertTrue(loadedData.isPresent()); - assertTrue(Files.exists(Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(fileId)))); + assertTrue(loadedData.isPresent()); + assertTrue(Files.exists( + Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(fileId)))); - attachmentDataStoreService.delete(fileId); + attachmentDataStoreService.delete(fileId); - ReportPortalException exception = assertThrows(ReportPortalException.class, () -> attachmentDataStoreService.load(fileId)); - assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); - assertFalse(Files.exists(Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(fileId)))); - } + ReportPortalException exception = assertThrows(ReportPortalException.class, + () -> attachmentDataStoreService.load(fileId)); + assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); + assertFalse(Files.exists( + Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(fileId)))); + } - @Test - void saveLoadAndDeleteThumbnailTest() throws IOException { - InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); + @Test + void saveLoadAndDeleteThumbnailTest() throws IOException { + InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); - String thumbnailId = attachmentDataStoreService.saveThumbnail(random.nextLong() + "thumbnail.jpg", inputStream); + String thumbnailId = attachmentDataStoreService.saveThumbnail( + random.nextLong() + "thumbnail.jpg", inputStream); - Optional loadedData = attachmentDataStoreService.load(thumbnailId); + Optional loadedData = attachmentDataStoreService.load(thumbnailId); - assertTrue(loadedData.isPresent()); - assertTrue(Files.exists(Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(thumbnailId)))); + assertTrue(loadedData.isPresent()); + assertTrue(Files.exists( + Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(thumbnailId)))); - attachmentDataStoreService.delete(thumbnailId); + attachmentDataStoreService.delete(thumbnailId); - ReportPortalException exception = assertThrows(ReportPortalException.class, () -> attachmentDataStoreService.load(thumbnailId)); - assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); - assertFalse(Files.exists(Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(thumbnailId)))); - } + ReportPortalException exception = assertThrows(ReportPortalException.class, + () -> attachmentDataStoreService.load(thumbnailId)); + assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); + assertFalse(Files.exists( + Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(thumbnailId)))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java b/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java index 477db322d..347a91422 100644 --- a/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java +++ b/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java @@ -16,9 +16,21 @@ package com.epam.ta.reportportal.binary.impl; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.binary.DataStoreService; import com.epam.ta.reportportal.filesystem.DataEncoder; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Optional; +import java.util.Random; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.disk.DiskFileItem; import org.apache.commons.io.IOUtils; @@ -29,84 +41,77 @@ import org.springframework.core.io.ClassPathResource; import org.springframework.web.multipart.commons.CommonsMultipartFile; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.Optional; -import java.util.Random; - -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ihar Kahadouski */ class CommonDataStoreServiceTest extends BaseTest { - @Autowired - @Qualifier("userDataStoreService") - private DataStoreService dataStoreService; - - @Autowired - private DataEncoder dataEncoder; - - @Value("${datastore.default.path:/data/store}") - private String storageRootPath; - - @Test - void saveTest() throws IOException { - CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); - String fileId = dataStoreService.save(multipartFile.getOriginalFilename(), multipartFile.getInputStream()); - assertNotNull(fileId); - assertTrue(Files.exists(Paths.get(storageRootPath, dataEncoder.decode(fileId)))); - dataStoreService.delete(fileId); - } - - @Test - void saveThumbnailTest() throws IOException { - CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); - String fileId = dataStoreService.saveThumbnail(multipartFile.getOriginalFilename(), multipartFile.getInputStream()); - assertNotNull(fileId); - assertTrue(Files.exists(Paths.get(storageRootPath, dataEncoder.decode(fileId)))); - dataStoreService.delete(fileId); - } - - @Test - void saveAndLoadTest() throws IOException { - CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); - String fileId = dataStoreService.saveThumbnail(multipartFile.getOriginalFilename(), multipartFile.getInputStream()); - - Optional content = dataStoreService.load(fileId); - - assertTrue(content.isPresent()); - dataStoreService.delete(fileId); - } - - @Test - void saveAndDeleteTest() throws IOException { - CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); - Random random = new Random(); - String fileId = dataStoreService.save(random.nextLong() + "/" + multipartFile.getOriginalFilename(), - multipartFile.getInputStream() - ); - - dataStoreService.delete(fileId); - - assertFalse(Files.exists(Paths.get(dataEncoder.decode(fileId)))); - } - - public static CommonsMultipartFile getMultipartFile(String path) throws IOException { - File file = new ClassPathResource(path).getFile(); - FileItem fileItem = new DiskFileItem("mainFile", - Files.probeContentType(file.toPath()), - false, - file.getName(), - (int) file.length(), - file.getParentFile() - ); - IOUtils.copy(new FileInputStream(file), fileItem.getOutputStream()); - return new CommonsMultipartFile(fileItem); - } + @Autowired + @Qualifier("userDataStoreService") + private DataStoreService dataStoreService; + + @Autowired + private DataEncoder dataEncoder; + + @Value("${datastore.default.path:/data/store}") + private String storageRootPath; + + public static CommonsMultipartFile getMultipartFile(String path) throws IOException { + File file = new ClassPathResource(path).getFile(); + FileItem fileItem = new DiskFileItem("mainFile", + Files.probeContentType(file.toPath()), + false, + file.getName(), + (int) file.length(), + file.getParentFile() + ); + IOUtils.copy(new FileInputStream(file), fileItem.getOutputStream()); + return new CommonsMultipartFile(fileItem); + } + + @Test + void saveTest() throws IOException { + CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); + String fileId = dataStoreService.save(multipartFile.getOriginalFilename(), + multipartFile.getInputStream()); + assertNotNull(fileId); + assertTrue(Files.exists(Paths.get(storageRootPath, dataEncoder.decode(fileId)))); + dataStoreService.delete(fileId); + } + + @Test + void saveThumbnailTest() throws IOException { + CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); + String fileId = dataStoreService.saveThumbnail(multipartFile.getOriginalFilename(), + multipartFile.getInputStream()); + assertNotNull(fileId); + assertTrue(Files.exists(Paths.get(storageRootPath, dataEncoder.decode(fileId)))); + dataStoreService.delete(fileId); + } + + @Test + void saveAndLoadTest() throws IOException { + CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); + String fileId = dataStoreService.saveThumbnail(multipartFile.getOriginalFilename(), + multipartFile.getInputStream()); + + Optional content = dataStoreService.load(fileId); + + assertTrue(content.isPresent()); + dataStoreService.delete(fileId); + } + + @Test + void saveAndDeleteTest() throws IOException { + CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); + Random random = new Random(); + String fileId = dataStoreService.save( + random.nextLong() + "/" + multipartFile.getOriginalFilename(), + multipartFile.getInputStream() + ); + + dataStoreService.delete(fileId); + + assertFalse(Files.exists(Paths.get(dataEncoder.decode(fileId)))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/binary/impl/UserCommonDataStoreServiceTest.java b/src/test/java/com/epam/ta/reportportal/binary/impl/UserCommonDataStoreServiceTest.java index 716b48f94..c7940319f 100644 --- a/src/test/java/com/epam/ta/reportportal/binary/impl/UserCommonDataStoreServiceTest.java +++ b/src/test/java/com/epam/ta/reportportal/binary/impl/UserCommonDataStoreServiceTest.java @@ -16,53 +16,53 @@ package com.epam.ta.reportportal.binary.impl; +import static com.epam.ta.reportportal.binary.impl.CommonDataStoreServiceTest.getMultipartFile; +import static org.assertj.core.api.Assertions.assertThat; + import com.epam.reportportal.commons.Thumbnailator; import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.binary.UserBinaryDataService; import com.epam.ta.reportportal.dao.UserRepository; import com.epam.ta.reportportal.entity.attachment.BinaryData; import com.epam.ta.reportportal.entity.user.User; +import java.io.IOException; import org.apache.commons.io.IOUtils; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.web.multipart.commons.CommonsMultipartFile; -import java.io.IOException; - -import static com.epam.ta.reportportal.binary.impl.CommonDataStoreServiceTest.getMultipartFile; -import static org.assertj.core.api.Assertions.assertThat; - /** * @author Pavel Bortnik */ class UserCommonDataStoreServiceTest extends BaseTest { - @Autowired - private UserBinaryDataService userDataStoreService; + @Autowired + private UserBinaryDataService userDataStoreService; - @Autowired - private UserRepository userRepository; + @Autowired + private UserRepository userRepository; - @Autowired - @Qualifier("userPhotoThumbnailator") - private Thumbnailator thumbnailator; + @Autowired + @Qualifier("userPhotoThumbnailator") + private Thumbnailator thumbnailator; - @Test - void saveUserPhoto() throws IOException { - CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); - User user = userRepository.findByLogin("default").get(); + @Test + void saveUserPhoto() throws IOException { + CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); + User user = userRepository.findByLogin("default").get(); - userDataStoreService.saveUserPhoto(user, multipartFile); - user = userRepository.findByLogin("default").get(); + userDataStoreService.saveUserPhoto(user, multipartFile); + user = userRepository.findByLogin("default").get(); - BinaryData binaryData = userDataStoreService.loadUserPhoto(user, false); - assertThat(IOUtils.contentEquals(multipartFile.getInputStream(), binaryData.getInputStream())).isTrue(); + BinaryData binaryData = userDataStoreService.loadUserPhoto(user, false); + assertThat(IOUtils.contentEquals(multipartFile.getInputStream(), + binaryData.getInputStream())).isTrue(); - BinaryData binaryDataThumbnail = userDataStoreService.loadUserPhoto(user, true); - assertThat(IOUtils.contentEquals(thumbnailator.createThumbnail(multipartFile.getInputStream()), - binaryDataThumbnail.getInputStream() - )).isTrue(); - } + BinaryData binaryDataThumbnail = userDataStoreService.loadUserPhoto(user, true); + assertThat(IOUtils.contentEquals(thumbnailator.createThumbnail(multipartFile.getInputStream()), + binaryDataThumbnail.getInputStream() + )).isTrue(); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java b/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java index f4876c243..b1713d597 100644 --- a/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java +++ b/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java @@ -16,68 +16,75 @@ package com.epam.ta.reportportal.binary.impl; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.exception.ReportPortalException; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.io.ClassPathResource; - import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Optional; import java.util.Random; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.ClassPathResource; /** * @author Ihar Kahadouski */ class UserDataStoreServiceTest extends BaseTest { - @Autowired - private UserDataStoreService userDataStoreService; - - @Value("${datastore.default.path:/data/store}") - private String storageRootPath; - - private static Random random = new Random(); + private static Random random = new Random(); + @Autowired + private UserDataStoreService userDataStoreService; + @Value("${datastore.default.path:/data/store}") + private String storageRootPath; - @Test - void saveLoadAndDeleteTest() throws IOException { - InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); + @Test + void saveLoadAndDeleteTest() throws IOException { + InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); - String fileId = userDataStoreService.save(random.nextLong() + "meh.jpg", inputStream); + String fileId = userDataStoreService.save(random.nextLong() + "meh.jpg", inputStream); - Optional loadedData = userDataStoreService.load(fileId); + Optional loadedData = userDataStoreService.load(fileId); - assertTrue(loadedData.isPresent()); - assertTrue(Files.exists(Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(fileId)))); + assertTrue(loadedData.isPresent()); + assertTrue( + Files.exists(Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(fileId)))); - userDataStoreService.delete(fileId); + userDataStoreService.delete(fileId); - ReportPortalException exception = assertThrows(ReportPortalException.class, () -> userDataStoreService.load(fileId)); - assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); - assertFalse(Files.exists(Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(fileId)))); - } + ReportPortalException exception = assertThrows(ReportPortalException.class, + () -> userDataStoreService.load(fileId)); + assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); + assertFalse( + Files.exists(Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(fileId)))); + } - @Test - void saveLoadAndDeleteThumbnailTest() throws IOException { - InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); + @Test + void saveLoadAndDeleteThumbnailTest() throws IOException { + InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); - String thumbnailId = userDataStoreService.saveThumbnail(random.nextLong() + "thmbnail.jpg", inputStream); + String thumbnailId = userDataStoreService.saveThumbnail(random.nextLong() + "thmbnail.jpg", + inputStream); - Optional loadedData = userDataStoreService.load(thumbnailId); + Optional loadedData = userDataStoreService.load(thumbnailId); - assertTrue(loadedData.isPresent()); - assertTrue(Files.exists(Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(thumbnailId)))); + assertTrue(loadedData.isPresent()); + assertTrue(Files.exists( + Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(thumbnailId)))); - userDataStoreService.delete(thumbnailId); + userDataStoreService.delete(thumbnailId); - ReportPortalException exception = assertThrows(ReportPortalException.class, () -> userDataStoreService.load(thumbnailId)); - assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); - assertFalse(Files.exists(Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(thumbnailId)))); - } + ReportPortalException exception = assertThrows(ReportPortalException.class, + () -> userDataStoreService.load(thumbnailId)); + assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); + assertFalse(Files.exists( + Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(thumbnailId)))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/commons/EntityUtilsTest.java b/src/test/java/com/epam/ta/reportportal/commons/EntityUtilsTest.java index 4e9f71292..8f1b2b2af 100644 --- a/src/test/java/com/epam/ta/reportportal/commons/EntityUtilsTest.java +++ b/src/test/java/com/epam/ta/reportportal/commons/EntityUtilsTest.java @@ -16,12 +16,20 @@ package com.epam.ta.reportportal.commons; +import static com.epam.ta.reportportal.commons.EntityUtils.NOT_EMPTY; +import static com.epam.ta.reportportal.commons.EntityUtils.REPLACE_SEPARATOR; +import static com.epam.ta.reportportal.commons.EntityUtils.TO_DATE; +import static com.epam.ta.reportportal.commons.EntityUtils.TO_LOCAL_DATE_TIME; +import static com.epam.ta.reportportal.commons.EntityUtils.TRIM_FUNCTION; +import static com.epam.ta.reportportal.commons.EntityUtils.normalizeId; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneOffset; @@ -30,81 +38,85 @@ import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; - -import static com.epam.ta.reportportal.commons.EntityUtils.*; -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class EntityUtilsTest { - private static final String EXPECTED_STRING = "test"; - private static final String NORMALIZED_STRING = "strange_string"; - - private static Map dates; - private static List strings; - private static List toNormalize; - - @BeforeAll - static void setUp() throws Exception { - dates = ImmutableMap.copyOf(Stream.of(1544994000000L, 1545044400000L, 739971000000L, 1539975900000L) - .collect(Collectors.toMap(Date::new, it -> LocalDateTime.ofInstant(Instant.ofEpochMilli(it), ZoneOffset.UTC)))); - strings = ImmutableList.of(" test", "test ", " test ", "\ntest", "test\n", "\ttest", "test\t", "\rtest", "test\r"); - toNormalize = ImmutableList.of("STRANGE_STRING", "StranGe_StrInG", "Strange_String", "Strange_strinG"); - } - - @AfterAll - static void tearDown() throws Exception { - dates = null; - strings = null; - } - - @Test - void toLocalDateTimeTest() { - assertNull(TO_LOCAL_DATE_TIME.apply(null)); - dates.forEach((key, value) -> assertEquals(value, TO_LOCAL_DATE_TIME.apply(key))); - } - - @Test - void toDateTest() { - assertNull(TO_DATE.apply(null)); - dates.forEach((key, value) -> assertEquals(key, TO_DATE.apply(value))); - } - - @Test - void trimTest() { - assertNull(TRIM_FUNCTION.apply(null)); - assertEquals("", TRIM_FUNCTION.apply("")); - assertEquals("", TRIM_FUNCTION.apply(" ")); - assertEquals("", TRIM_FUNCTION.apply("\t")); - assertEquals("", TRIM_FUNCTION.apply("\n")); - assertEquals("", TRIM_FUNCTION.apply("\r")); - strings.forEach(it -> assertEquals(EXPECTED_STRING, TRIM_FUNCTION.apply(it))); - } - - @Test - void notEmptyTest() { - assertFalse(NOT_EMPTY.test("")); - assertTrue(NOT_EMPTY.test(" ")); - assertFalse(NOT_EMPTY.test(null)); - } - - @Test - void replaceSeparatorTest() { - assertNull(REPLACE_SEPARATOR.apply(null)); - assertEquals("one_ two_ three", REPLACE_SEPARATOR.apply("one, two, three")); - assertEquals("___", REPLACE_SEPARATOR.apply(",,,")); - assertEquals("_ te_st_ _", REPLACE_SEPARATOR.apply(", te,st, ,")); - } - - @Test - void normalizeIdTest() { - toNormalize.forEach(it -> assertEquals(NORMALIZED_STRING, normalizeId(it))); - } - - @Test - void normalizeIdFail() { - assertThrows(NullPointerException.class, () -> normalizeId(null)); - } + private static final String EXPECTED_STRING = "test"; + private static final String NORMALIZED_STRING = "strange_string"; + + private static Map dates; + private static List strings; + private static List toNormalize; + + @BeforeAll + static void setUp() throws Exception { + dates = ImmutableMap.copyOf( + Stream.of(1544994000000L, 1545044400000L, 739971000000L, 1539975900000L) + .collect(Collectors.toMap(Date::new, + it -> LocalDateTime.ofInstant(Instant.ofEpochMilli(it), ZoneOffset.UTC)))); + strings = ImmutableList.of(" test", "test ", " test ", "\ntest", "test\n", "\ttest", "test\t", + "\rtest", "test\r"); + toNormalize = ImmutableList.of("STRANGE_STRING", "StranGe_StrInG", "Strange_String", + "Strange_strinG"); + } + + @AfterAll + static void tearDown() throws Exception { + dates = null; + strings = null; + } + + @Test + void toLocalDateTimeTest() { + assertNull(TO_LOCAL_DATE_TIME.apply(null)); + dates.forEach((key, value) -> assertEquals(value, TO_LOCAL_DATE_TIME.apply(key))); + } + + @Test + void toDateTest() { + assertNull(TO_DATE.apply(null)); + dates.forEach((key, value) -> assertEquals(key, TO_DATE.apply(value))); + } + + @Test + void trimTest() { + assertNull(TRIM_FUNCTION.apply(null)); + assertEquals("", TRIM_FUNCTION.apply("")); + assertEquals("", TRIM_FUNCTION.apply(" ")); + assertEquals("", TRIM_FUNCTION.apply("\t")); + assertEquals("", TRIM_FUNCTION.apply("\n")); + assertEquals("", TRIM_FUNCTION.apply("\r")); + strings.forEach(it -> assertEquals(EXPECTED_STRING, TRIM_FUNCTION.apply(it))); + } + + @Test + void notEmptyTest() { + assertFalse(NOT_EMPTY.test("")); + assertTrue(NOT_EMPTY.test(" ")); + assertFalse(NOT_EMPTY.test(null)); + } + + @Test + void replaceSeparatorTest() { + assertNull(REPLACE_SEPARATOR.apply(null)); + assertEquals("one_ two_ three", REPLACE_SEPARATOR.apply("one, two, three")); + assertEquals("___", REPLACE_SEPARATOR.apply(",,,")); + assertEquals("_ te_st_ _", REPLACE_SEPARATOR.apply(", te,st, ,")); + } + + @Test + void normalizeIdTest() { + toNormalize.forEach(it -> assertEquals(NORMALIZED_STRING, normalizeId(it))); + } + + @Test + void normalizeIdFail() { + assertThrows(NullPointerException.class, () -> normalizeId(null)); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/commons/PreconditionsTest.java b/src/test/java/com/epam/ta/reportportal/commons/PreconditionsTest.java index 2b1a16470..5111d7b2b 100644 --- a/src/test/java/com/epam/ta/reportportal/commons/PreconditionsTest.java +++ b/src/test/java/com/epam/ta/reportportal/commons/PreconditionsTest.java @@ -16,80 +16,82 @@ package com.epam.ta.reportportal.commons; +import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.epam.ta.reportportal.commons.querygen.Condition; import com.epam.ta.reportportal.commons.querygen.FilterCondition; import com.epam.ta.reportportal.ws.model.launch.Mode; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - import java.time.LocalDateTime; import java.time.ZoneOffset; import java.util.Date; - -import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; -import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * @author Ivan Budayeu */ class PreconditionsTest { - @Test - void hasModePositive() { + @Test + void hasModePositive() { - Mode mode = Mode.DEFAULT; + Mode mode = Mode.DEFAULT; - Assertions.assertTrue(Preconditions.hasMode(mode).test(filterConditionWithMode(mode))); - } + Assertions.assertTrue(Preconditions.hasMode(mode).test(filterConditionWithMode(mode))); + } - @Test - void hasModeNegative() { + @Test + void hasModeNegative() { - Mode mode = Mode.DEFAULT; - Mode anotherMode = Mode.DEBUG; + Mode mode = Mode.DEFAULT; + Mode anotherMode = Mode.DEBUG; - Assertions.assertFalse(Preconditions.hasMode(mode).test(filterConditionWithMode(anotherMode))); - } + Assertions.assertFalse(Preconditions.hasMode(mode).test(filterConditionWithMode(anotherMode))); + } - @Test - void sameTime() { + @Test + void sameTime() { - Date date = new Date(); + Date date = new Date(); - LocalDateTime sameTime = LocalDateTime.from(date.toInstant().atZone(ZoneOffset.UTC)); + LocalDateTime sameTime = LocalDateTime.from(date.toInstant().atZone(ZoneOffset.UTC)); - Assertions.assertTrue(Preconditions.sameTimeOrLater(sameTime).test(date)); - } + Assertions.assertTrue(Preconditions.sameTimeOrLater(sameTime).test(date)); + } - @Test - void laterTime() { + @Test + void laterTime() { - Date date = new Date(); + Date date = new Date(); - LocalDateTime laterTime = LocalDateTime.from(date.toInstant().atZone(ZoneOffset.UTC)).minusSeconds(1L); + LocalDateTime laterTime = LocalDateTime.from(date.toInstant().atZone(ZoneOffset.UTC)) + .minusSeconds(1L); - Assertions.assertTrue(Preconditions.sameTimeOrLater(laterTime).test(date)); - } + Assertions.assertTrue(Preconditions.sameTimeOrLater(laterTime).test(date)); + } - @Test - void beforeTime() { + @Test + void beforeTime() { - Date date = new Date(); + Date date = new Date(); - LocalDateTime beforeTime = LocalDateTime.from(date.toInstant().atZone(ZoneOffset.UTC)).plusSeconds(1L); + LocalDateTime beforeTime = LocalDateTime.from(date.toInstant().atZone(ZoneOffset.UTC)) + .plusSeconds(1L); - Assertions.assertFalse(Preconditions.sameTimeOrLater(beforeTime).test(date)); - } + Assertions.assertFalse(Preconditions.sameTimeOrLater(beforeTime).test(date)); + } - @Test - void validateNullValue() { + @Test + void validateNullValue() { - assertThrows(NullPointerException.class, () -> Preconditions.sameTimeOrLater(null).test(new Date())); - } + assertThrows(NullPointerException.class, + () -> Preconditions.sameTimeOrLater(null).test(new Date())); + } - private FilterCondition filterConditionWithMode(Mode mode) { + private FilterCondition filterConditionWithMode(Mode mode) { - return new FilterCondition(Condition.EQUALS, false, mode.name(), CRITERIA_LAUNCH_MODE); - } + return new FilterCondition(Condition.EQUALS, false, mode.name(), CRITERIA_LAUNCH_MODE); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/commons/querygen/CompositeFilterTest.java b/src/test/java/com/epam/ta/reportportal/commons/querygen/CompositeFilterTest.java index 57fd557ac..3f0a20104 100644 --- a/src/test/java/com/epam/ta/reportportal/commons/querygen/CompositeFilterTest.java +++ b/src/test/java/com/epam/ta/reportportal/commons/querygen/CompositeFilterTest.java @@ -18,92 +18,105 @@ import com.epam.ta.reportportal.entity.launch.Launch; import com.google.common.collect.Lists; +import java.util.List; import org.jooq.Operator; import org.jooq.Record; import org.jooq.SelectQuery; import org.junit.jupiter.api.Test; -import java.util.List; - /** * @author Ivan Budayeu */ public class CompositeFilterTest { - @Test - void test() { - - FilterCondition condition = FilterCondition.builder() - .withCondition(Condition.EQUALS) - .withValue("1") - .withSearchCriteria("name") - .withOperator(Operator.OR) - .build(); - - FilterCondition condition1 = FilterCondition.builder() - .withCondition(Condition.EQUALS) - .withValue("2") - .withSearchCriteria("name") - .withOperator(Operator.OR) - .build(); - - FilterCondition condition2 = FilterCondition.builder() - .withCondition(Condition.EQUALS) - .withValue("3") - .withSearchCriteria("name") - .withOperator(Operator.AND) - .build(); - - FilterCondition condition3 = FilterCondition.builder() - .withCondition(Condition.EQUALS) - .withValue("4") - .withSearchCriteria("name") - .withOperator(Operator.AND) - .build(); - - CompositeFilterCondition firstCompositeCondition = new CompositeFilterCondition(Lists.newArrayList(condition, condition1), - Operator.OR - ); - - System.err.println( QueryBuilder.newBuilder(Filter.builder().withTarget(Launch.class).withCondition(firstCompositeCondition).build()).build()); - System.err.println(); - System.err.println(); - System.err.println(); - - CompositeFilterCondition secondCompositeCondition = new CompositeFilterCondition(Lists.newArrayList(condition2, condition3), - Operator.OR - ); - - System.err.println( QueryBuilder.newBuilder(Filter.builder().withTarget(Launch.class).withCondition(secondCompositeCondition).build()).build()); - System.err.println(); - System.err.println(); - System.err.println(); - - CompositeFilterCondition compositeFilterCondition1 = new CompositeFilterCondition(Lists.newArrayList(firstCompositeCondition, - secondCompositeCondition - ), Operator.OR); - - System.err.println( QueryBuilder.newBuilder(Filter.builder().withTarget(Launch.class).withCondition(compositeFilterCondition1).build()).build()); - System.err.println(); - System.err.println(); - System.err.println(); - - CompositeFilterCondition compositeFilterCondition2 = new CompositeFilterCondition(Lists.newArrayList(firstCompositeCondition, - secondCompositeCondition - ), Operator.AND); - - System.err.println( QueryBuilder.newBuilder(Filter.builder().withTarget(Launch.class).withCondition(compositeFilterCondition2).build()).build()); - System.err.println(); - System.err.println(); - System.err.println(); - - List conditions = Lists.newArrayList(compositeFilterCondition1, compositeFilterCondition2); - ConvertibleCondition filterCondition = new CompositeFilterCondition(conditions, Operator.AND); - - Filter filter = Filter.builder().withTarget(Launch.class).withCondition(filterCondition).build(); - - SelectQuery build = QueryBuilder.newBuilder(filter).build(); - - System.err.println(build); - } + @Test + void test() { + + FilterCondition condition = FilterCondition.builder() + .withCondition(Condition.EQUALS) + .withValue("1") + .withSearchCriteria("name") + .withOperator(Operator.OR) + .build(); + + FilterCondition condition1 = FilterCondition.builder() + .withCondition(Condition.EQUALS) + .withValue("2") + .withSearchCriteria("name") + .withOperator(Operator.OR) + .build(); + + FilterCondition condition2 = FilterCondition.builder() + .withCondition(Condition.EQUALS) + .withValue("3") + .withSearchCriteria("name") + .withOperator(Operator.AND) + .build(); + + FilterCondition condition3 = FilterCondition.builder() + .withCondition(Condition.EQUALS) + .withValue("4") + .withSearchCriteria("name") + .withOperator(Operator.AND) + .build(); + + CompositeFilterCondition firstCompositeCondition = new CompositeFilterCondition( + Lists.newArrayList(condition, condition1), + Operator.OR + ); + + System.err.println(QueryBuilder.newBuilder( + Filter.builder().withTarget(Launch.class).withCondition(firstCompositeCondition).build()) + .build()); + System.err.println(); + System.err.println(); + System.err.println(); + + CompositeFilterCondition secondCompositeCondition = new CompositeFilterCondition( + Lists.newArrayList(condition2, condition3), + Operator.OR + ); + + System.err.println(QueryBuilder.newBuilder( + Filter.builder().withTarget(Launch.class).withCondition(secondCompositeCondition).build()) + .build()); + System.err.println(); + System.err.println(); + System.err.println(); + + CompositeFilterCondition compositeFilterCondition1 = new CompositeFilterCondition( + Lists.newArrayList(firstCompositeCondition, + secondCompositeCondition + ), Operator.OR); + + System.err.println(QueryBuilder.newBuilder( + Filter.builder().withTarget(Launch.class).withCondition(compositeFilterCondition1).build()) + .build()); + System.err.println(); + System.err.println(); + System.err.println(); + + CompositeFilterCondition compositeFilterCondition2 = new CompositeFilterCondition( + Lists.newArrayList(firstCompositeCondition, + secondCompositeCondition + ), Operator.AND); + + System.err.println(QueryBuilder.newBuilder( + Filter.builder().withTarget(Launch.class).withCondition(compositeFilterCondition2).build()) + .build()); + System.err.println(); + System.err.println(); + System.err.println(); + + List conditions = Lists.newArrayList(compositeFilterCondition1, + compositeFilterCondition2); + ConvertibleCondition filterCondition = new CompositeFilterCondition(conditions, Operator.AND); + + Filter filter = Filter.builder().withTarget(Launch.class).withCondition(filterCondition) + .build(); + + SelectQuery build = QueryBuilder.newBuilder(filter).build(); + + System.err.println(build); + } } diff --git a/src/test/java/com/epam/ta/reportportal/commons/querygen/FilterConditionTest.java b/src/test/java/com/epam/ta/reportportal/commons/querygen/FilterConditionTest.java index 8ac4dfcba..f336ad720 100644 --- a/src/test/java/com/epam/ta/reportportal/commons/querygen/FilterConditionTest.java +++ b/src/test/java/com/epam/ta/reportportal/commons/querygen/FilterConditionTest.java @@ -1,30 +1,31 @@ package com.epam.ta.reportportal.commons.querygen; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.google.common.collect.Lists; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; - /** * @author Pavel Bortnik */ class FilterConditionTest { - @Test - public void testInBuilder() { - FilterCondition condition = FilterCondition.builder().in("criteria", Lists.newArrayList(1, 2, 3)).build(); - assertEquals("criteria", condition.getSearchCriteria()); - assertEquals(Condition.IN, condition.getCondition()); - assertEquals("1,2,3", condition.getValue()); - } + @Test + public void testInBuilder() { + FilterCondition condition = FilterCondition.builder() + .in("criteria", Lists.newArrayList(1, 2, 3)).build(); + assertEquals("criteria", condition.getSearchCriteria()); + assertEquals(Condition.IN, condition.getCondition()); + assertEquals("1,2,3", condition.getValue()); + } - @Test - public void testEqBuilder() { - FilterCondition condition = FilterCondition.builder().eq("criteria", "value").build(); - assertEquals("criteria", condition.getSearchCriteria()); - assertEquals(Condition.EQUALS, condition.getCondition()); - assertEquals("value", condition.getValue()); - } + @Test + public void testEqBuilder() { + FilterCondition condition = FilterCondition.builder().eq("criteria", "value").build(); + assertEquals("criteria", condition.getSearchCriteria()); + assertEquals(Condition.EQUALS, condition.getCondition()); + assertEquals("value", condition.getValue()); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/commons/querygen/FilterRulesTest.java b/src/test/java/com/epam/ta/reportportal/commons/querygen/FilterRulesTest.java index 4d383a267..19776a24b 100644 --- a/src/test/java/com/epam/ta/reportportal/commons/querygen/FilterRulesTest.java +++ b/src/test/java/com/epam/ta/reportportal/commons/querygen/FilterRulesTest.java @@ -16,181 +16,182 @@ package com.epam.ta.reportportal.commons.querygen; -import com.epam.ta.reportportal.entity.enums.LogLevel; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import com.epam.ta.reportportal.entity.enums.LogLevel; import java.util.Date; import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; /** * @author Pavel Bortnik */ class FilterRulesTest { - @Test - void filterForString() { - CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", java.lang.String.class); - assertTrue(FilterRules.filterForString().test(criteriaHolder)); - } - - @Test - void filterForStringNegative() { - CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", Number.class); - assertFalse(FilterRules.filterForString().test(criteriaHolder)); - } - - @Test - void filterForBoolean() { - CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", Boolean.class); - assertTrue(FilterRules.filterForBoolean().test(criteriaHolder)); - } - - @Test - void filterForBooleanNegative() { - CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", String.class); - assertFalse(FilterRules.filterForBoolean().test(criteriaHolder)); - } - - @Test - void filterForLogLevel() { - CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", LogLevel.class); - assertTrue(FilterRules.filterForLogLevel().test(criteriaHolder)); - } - - @Test - void filterForLogLevelNegative() { - CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", Number.class); - assertFalse(FilterRules.filterForLogLevel().test(criteriaHolder)); - } - - @Test - void filterForNumbers() { - CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", Long.class); - assertTrue(FilterRules.filterForNumbers().test(criteriaHolder)); - } - - @Test - void filterForNumbersNegative() { - CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", String.class); - assertFalse(FilterRules.filterForNumbers().test(criteriaHolder)); - } - - @Test - void filterForLtree() { - CriteriaHolder criteriaHolder = new CriteriaHolder("path", "string", String.class); - assertTrue(FilterRules.filterForLtree().test(criteriaHolder)); - } - - @Test - void filterForLtreeNegative() { - CriteriaHolder criteriaHolder = new CriteriaHolder("notPath", "string", String.class); - assertFalse(FilterRules.filterForLtree().test(criteriaHolder)); - } - - @Test - void filterForCollections() { - CriteriaHolder criteriaHolder = new CriteriaHolder("path", "string", List.class); - assertTrue(FilterRules.filterForCollections().test(criteriaHolder)); - } - - @Test - void filterForCollectionsNegative() { - CriteriaHolder criteriaHolder = new CriteriaHolder("path", "string", String.class); - assertFalse(FilterRules.filterForCollections().test(criteriaHolder)); - } - - @Test - void filterForAggregation() { - CriteriaHolder criteriaHolder = new CriteriaHolderBuilder().newBuilder("string", "string", String.class) - .withAggregateCriteria("array_agg(string)") - .get(); - assertTrue(FilterRules.filterForArrayAggregation().test(criteriaHolder)); - } - - @Test - void filterForAggregationNegative() { - CriteriaHolder criteriaHolder = new CriteriaHolderBuilder().newBuilder("string", "string", String.class).get(); - assertFalse(FilterRules.filterForArrayAggregation().test(criteriaHolder)); - } - - @Test - void numberIsPositive() { - assertTrue(FilterRules.numberIsPositive().test(2)); - } - - @Test - void numberIsPositiveNegative() { - assertFalse(FilterRules.numberIsPositive().test(-1)); - } - - @Test - void number() { - assertTrue(FilterRules.number().test("2")); - } - - @Test - void numberNegative() { - assertFalse(FilterRules.number().test("abc")); - } - - @Test - void dateInMillis() { - assertTrue(FilterRules.dateInMillis().test("12345")); - } - - @Test - void dateInMillisNegative() { - assertFalse(FilterRules.dateInMillis().test("abc")); - } - - @Test - void filterForDates() { - CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", Date.class); - assertTrue(FilterRules.filterForDates().test(criteriaHolder)); - } - - @Test - void filterForDatesNegative() { - CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", Long.class); - assertFalse(FilterRules.filterForDates().test(criteriaHolder)); - } - - @Test - void countOfValues() { - java.lang.String[] strings = new java.lang.String[2]; - strings[0] = "str"; - strings[1] = "str"; - assertTrue(FilterRules.countOfValues(2).test(strings)); - } - - @Test - void countOfValuesNegative() { - java.lang.String[] strings = new java.lang.String[2]; - strings[0] = "str"; - strings[1] = "str"; - assertFalse(FilterRules.countOfValues(3).test(strings)); - } - - @Test - void zoneOffset() { - assertTrue(FilterRules.zoneOffset().test("+0100")); - } - - @Test - void zoneOffsetNegative() { - assertFalse(FilterRules.zoneOffset().test("+abc")); - } - - @Test - void timeStamp() { - assertTrue(FilterRules.timeStamp().test("1550760664")); - } - - @Test - void timeStampNegative() { - assertFalse(FilterRules.timeStamp().test("abc")); - } + @Test + void filterForString() { + CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", java.lang.String.class); + assertTrue(FilterRules.filterForString().test(criteriaHolder)); + } + + @Test + void filterForStringNegative() { + CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", Number.class); + assertFalse(FilterRules.filterForString().test(criteriaHolder)); + } + + @Test + void filterForBoolean() { + CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", Boolean.class); + assertTrue(FilterRules.filterForBoolean().test(criteriaHolder)); + } + + @Test + void filterForBooleanNegative() { + CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", String.class); + assertFalse(FilterRules.filterForBoolean().test(criteriaHolder)); + } + + @Test + void filterForLogLevel() { + CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", LogLevel.class); + assertTrue(FilterRules.filterForLogLevel().test(criteriaHolder)); + } + + @Test + void filterForLogLevelNegative() { + CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", Number.class); + assertFalse(FilterRules.filterForLogLevel().test(criteriaHolder)); + } + + @Test + void filterForNumbers() { + CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", Long.class); + assertTrue(FilterRules.filterForNumbers().test(criteriaHolder)); + } + + @Test + void filterForNumbersNegative() { + CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", String.class); + assertFalse(FilterRules.filterForNumbers().test(criteriaHolder)); + } + + @Test + void filterForLtree() { + CriteriaHolder criteriaHolder = new CriteriaHolder("path", "string", String.class); + assertTrue(FilterRules.filterForLtree().test(criteriaHolder)); + } + + @Test + void filterForLtreeNegative() { + CriteriaHolder criteriaHolder = new CriteriaHolder("notPath", "string", String.class); + assertFalse(FilterRules.filterForLtree().test(criteriaHolder)); + } + + @Test + void filterForCollections() { + CriteriaHolder criteriaHolder = new CriteriaHolder("path", "string", List.class); + assertTrue(FilterRules.filterForCollections().test(criteriaHolder)); + } + + @Test + void filterForCollectionsNegative() { + CriteriaHolder criteriaHolder = new CriteriaHolder("path", "string", String.class); + assertFalse(FilterRules.filterForCollections().test(criteriaHolder)); + } + + @Test + void filterForAggregation() { + CriteriaHolder criteriaHolder = new CriteriaHolderBuilder().newBuilder("string", "string", + String.class) + .withAggregateCriteria("array_agg(string)") + .get(); + assertTrue(FilterRules.filterForArrayAggregation().test(criteriaHolder)); + } + + @Test + void filterForAggregationNegative() { + CriteriaHolder criteriaHolder = new CriteriaHolderBuilder().newBuilder("string", "string", + String.class).get(); + assertFalse(FilterRules.filterForArrayAggregation().test(criteriaHolder)); + } + + @Test + void numberIsPositive() { + assertTrue(FilterRules.numberIsPositive().test(2)); + } + + @Test + void numberIsPositiveNegative() { + assertFalse(FilterRules.numberIsPositive().test(-1)); + } + + @Test + void number() { + assertTrue(FilterRules.number().test("2")); + } + + @Test + void numberNegative() { + assertFalse(FilterRules.number().test("abc")); + } + + @Test + void dateInMillis() { + assertTrue(FilterRules.dateInMillis().test("12345")); + } + + @Test + void dateInMillisNegative() { + assertFalse(FilterRules.dateInMillis().test("abc")); + } + + @Test + void filterForDates() { + CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", Date.class); + assertTrue(FilterRules.filterForDates().test(criteriaHolder)); + } + + @Test + void filterForDatesNegative() { + CriteriaHolder criteriaHolder = new CriteriaHolder("string", "string", Long.class); + assertFalse(FilterRules.filterForDates().test(criteriaHolder)); + } + + @Test + void countOfValues() { + java.lang.String[] strings = new java.lang.String[2]; + strings[0] = "str"; + strings[1] = "str"; + assertTrue(FilterRules.countOfValues(2).test(strings)); + } + + @Test + void countOfValuesNegative() { + java.lang.String[] strings = new java.lang.String[2]; + strings[0] = "str"; + strings[1] = "str"; + assertFalse(FilterRules.countOfValues(3).test(strings)); + } + + @Test + void zoneOffset() { + assertTrue(FilterRules.zoneOffset().test("+0100")); + } + + @Test + void zoneOffsetNegative() { + assertFalse(FilterRules.zoneOffset().test("+abc")); + } + + @Test + void timeStamp() { + assertTrue(FilterRules.timeStamp().test("1550760664")); + } + + @Test + void timeStampNegative() { + assertFalse(FilterRules.timeStamp().test("abc")); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/config/EncryptConfigurationTest.java b/src/test/java/com/epam/ta/reportportal/config/EncryptConfigurationTest.java index 1ef9f0dec..54cd015be 100644 --- a/src/test/java/com/epam/ta/reportportal/config/EncryptConfigurationTest.java +++ b/src/test/java/com/epam/ta/reportportal/config/EncryptConfigurationTest.java @@ -1,38 +1,38 @@ package com.epam.ta.reportportal.config; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + import com.epam.ta.reportportal.BaseTest; import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; import org.jasypt.util.text.BasicTextEncryptor; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; - /** * @author Ihar Kahadouski */ class EncryptConfigurationTest extends BaseTest { - @Autowired - private BasicTextEncryptor basicTextEncryptor; + @Autowired + private BasicTextEncryptor basicTextEncryptor; - @Autowired - private StandardPBEStringEncryptor strongTextEncryptor; + @Autowired + private StandardPBEStringEncryptor strongTextEncryptor; - @Test - void basicEncryptionTest() { - String message = "sensitive data"; - String encrypted = basicTextEncryptor.encrypt(message); - assertNotEquals(message, encrypted); - assertEquals(message, basicTextEncryptor.decrypt(encrypted)); - } + @Test + void basicEncryptionTest() { + String message = "sensitive data"; + String encrypted = basicTextEncryptor.encrypt(message); + assertNotEquals(message, encrypted); + assertEquals(message, basicTextEncryptor.decrypt(encrypted)); + } - @Test - void strongEncryptionTest() { - String message = "sensitive data"; - String encrypted = strongTextEncryptor.encrypt(message); - assertNotEquals(message, encrypted); - assertEquals(message, strongTextEncryptor.decrypt(encrypted)); - } + @Test + void strongEncryptionTest() { + String message = "sensitive data"; + String encrypted = strongTextEncryptor.encrypt(message); + assertNotEquals(message, encrypted); + assertEquals(message, strongTextEncryptor.decrypt(encrypted)); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/config/TestConfiguration.java b/src/test/java/com/epam/ta/reportportal/config/TestConfiguration.java index ad9f33003..d01fbf3a8 100644 --- a/src/test/java/com/epam/ta/reportportal/config/TestConfiguration.java +++ b/src/test/java/com/epam/ta/reportportal/config/TestConfiguration.java @@ -34,29 +34,31 @@ @EnableConfigurationProperties @EnableAutoConfiguration(exclude = QuartzAutoConfiguration.class) @ComponentScan(basePackages = "com.epam.ta.reportportal") -@PropertySource({ "classpath:test-application.properties" }) +@PropertySource({"classpath:test-application.properties"}) public class TestConfiguration { - @Bean("attachmentThumbnailator") - public Thumbnailator attachmentThumbnailator(@Value("${datastore.thumbnail.attachment.width}") int width, - @Value("${datastore.thumbnail.attachment.height}") int height) { - return new ThumbnailatorImpl(width, height); - } - - @Bean("userPhotoThumbnailator") - public Thumbnailator userPhotoThumbnailator(@Value("${datastore.thumbnail.avatar.width}") int width, - @Value("${datastore.thumbnail.avatar.height}") int height) { - return new ThumbnailatorImpl(width, height); - } - - @Bean - public ContentTypeResolver contentTypeResolver() { - return new TikaContentTypeResolver(); - } - - @Bean - public DataEncoder dataEncoder() { - return new DataEncoder(); - } + @Bean("attachmentThumbnailator") + public Thumbnailator attachmentThumbnailator( + @Value("${datastore.thumbnail.attachment.width}") int width, + @Value("${datastore.thumbnail.attachment.height}") int height) { + return new ThumbnailatorImpl(width, height); + } + + @Bean("userPhotoThumbnailator") + public Thumbnailator userPhotoThumbnailator( + @Value("${datastore.thumbnail.avatar.width}") int width, + @Value("${datastore.thumbnail.avatar.height}") int height) { + return new ThumbnailatorImpl(width, height); + } + + @Bean + public ContentTypeResolver contentTypeResolver() { + return new TikaContentTypeResolver(); + } + + @Bean + public DataEncoder dataEncoder() { + return new DataEncoder(); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/ActivityRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/ActivityRepositoryTest.java index 9e6762056..ca03b948b 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/ActivityRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/ActivityRepositoryTest.java @@ -16,6 +16,19 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.CRITERIA_CREATION_DATE; +import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.CRITERIA_ENTITY; +import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.CRITERIA_OBJECT_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.CRITERIA_OBJECT_NAME; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_PROJECT_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_USER; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.commons.querygen.Condition; import com.epam.ta.reportportal.commons.querygen.Filter; @@ -24,6 +37,14 @@ import com.epam.ta.reportportal.entity.activity.ActivityDetails; import com.epam.ta.reportportal.entity.activity.HistoryField; import com.google.common.collect.Comparators; +import java.sql.Timestamp; +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; +import java.util.Optional; import org.apache.commons.compress.utils.Lists; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -32,257 +53,250 @@ import org.springframework.data.domain.Sort; import org.springframework.test.context.jdbc.Sql; -import java.sql.Timestamp; -import java.time.Duration; -import java.time.LocalDateTime; -import java.util.*; - -import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_PROJECT_ID; -import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_USER; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.*; - @Sql("/db/fill/activity/activities-fill.sql") class ActivityRepositoryTest extends BaseTest { - private static final int ACTIVITIES_COUNT = 7; - - @Autowired - private ActivityRepository repository; - - // JPA - - @Test - void findByIdTest() { - final Optional activityOptional = repository.findById(1L); - - assertTrue(activityOptional.isPresent()); - assertEquals(1L, (long) activityOptional.get().getId()); - } - - @Test - void findAllTest() { - final List activities = repository.findAll(); - - assertTrue(!activities.isEmpty()); - assertEquals(ACTIVITIES_COUNT, activities.size()); - } - - @Test - void createTest() { - final Activity entity = generateActivity(); - final Activity saved = repository.save(entity); - entity.setId(saved.getId()); - final List all = repository.findAll(); - - assertEquals(saved, entity); - assertEquals(ACTIVITIES_COUNT + 1, all.size()); - assertTrue(all.contains(entity)); - } - - @SuppressWarnings("OptionalGetWithoutIsPresent") - @Test - void updateTest() { - Activity activity = repository.findById(1L).get(); - final LocalDateTime now = LocalDateTime.now(); - final ActivityDetails details = generateDetails(); - final String action = "test"; - - activity.setCreatedAt(now); - activity.setAction(action); - activity.setDetails(details); - - final Activity updated = repository.save(activity); - - assertEquals(now, updated.getCreatedAt()); - assertThat(updated.getDetails()).isEqualToIgnoringGivenFields(details, "mapper"); - assertEquals(action, updated.getAction()); - } - - @SuppressWarnings("OptionalGetWithoutIsPresent") - @Test - void deleteTest() { - final Activity activity = repository.findById(1L).get(); - repository.delete(activity); - - assertEquals(ACTIVITIES_COUNT - 1, repository.findAll().size()); - } - - @Test - void deleteById() { - repository.deleteById(1L); - assertEquals(ACTIVITIES_COUNT - 1, repository.findAll().size()); - } - - @Test - void existsTest() { - assertTrue(repository.existsById(1L)); - assertFalse(repository.existsById(100L)); - assertTrue(repository.exists(defaultFilter())); - } - - // Custom Repositories - - @Test - void deleteModifiedLaterAgo() { - Duration period = Duration.ofDays(10); - LocalDateTime bound = LocalDateTime.now().minus(period); - - repository.deleteModifiedLaterAgo(1L, period); - List all = repository.findAll(); - all.stream().filter(a -> a.getProjectId().equals(1L)).forEach(a -> assertTrue(a.getCreatedAt().isAfter(bound))); - } - - @SuppressWarnings("OptionalGetWithoutIsPresent") - @Test - void findByFilterWithSortingAndLimit() { - List activities = repository.findByFilterWithSortingAndLimit(defaultFilter(), - Sort.by(Sort.Direction.DESC, CRITERIA_CREATION_DATE), - 2 - ); - - assertEquals(2, activities.size()); - final LocalDateTime first = activities.get(0).getCreatedAt(); - final LocalDateTime second = activities.get(1).getCreatedAt(); - assertTrue(first.isBefore(second) || first.isEqual(second)); - } - - @Test - void findByFilter() { - List activities = repository.findByFilter(filterById(1)); - - assertEquals(1, activities.size()); - assertNotNull(activities.get(0)); - } - - @Test - void findByFilterPageable() { - Page page = repository.findByFilter(filterById(1), PageRequest.of(0, 10)); - ArrayList activities = Lists.newArrayList(); - page.forEach(activities::add); - - assertEquals(1, activities.size()); - assertNotNull(activities.get(0)); - } - - @Test - void findByProjectId() { - final List activities = repository.findByFilter(new Filter(Activity.class, - Condition.EQUALS, - false, - String.valueOf(1), - CRITERIA_PROJECT_ID - )); - assertNotNull(activities); - assertTrue(!activities.isEmpty()); - activities.forEach(it -> assertEquals(1L, (long) it.getProjectId())); - } - - @Test - void findByEntityType() { - final List activities = repository.findByFilter(new Filter(Activity.class, - Condition.EQUALS, - false, - "launch", - CRITERIA_ENTITY - )); - assertNotNull(activities); - assertTrue(!activities.isEmpty()); - activities.forEach(it -> assertEquals(Activity.ActivityEntityType.LAUNCH.getValue(), it.getActivityEntityType())); - } - - @Test - void findByCreationDate() { - LocalDateTime to = LocalDateTime.now(); - LocalDateTime from = to.minusDays(7); - final List activities = repository.findByFilter(new Filter(Activity.class, - Condition.BETWEEN, - false, - Timestamp.valueOf(from).getTime() + "," + Timestamp.valueOf(to).getTime(), - CRITERIA_CREATION_DATE - )); - assertNotNull(activities); - assertTrue(!activities.isEmpty()); - activities.forEach(it -> assertTrue(it.getCreatedAt().isBefore(to) && it.getCreatedAt().isAfter(from))); - } - - @Test - void findByUserLogin() { - final List activities = repository.findByFilter(new Filter(Activity.class, - Condition.EQUALS, - false, - "superadmin", - CRITERIA_USER - )); - assertNotNull(activities); - assertTrue(!activities.isEmpty()); - activities.forEach(it -> assertEquals(1L, (long) it.getUserId())); - } - - @Test - void findByObjectIdTest() { - final List activities = repository.findByFilter(new Filter(Activity.class, - Condition.EQUALS, - false, - "4", - CRITERIA_OBJECT_ID - )); - assertNotNull(activities); - assertTrue(!activities.isEmpty()); - activities.forEach(it -> assertEquals(4L, (long) it.getObjectId())); - } - - @Test - void objectNameCriteriaTest() { - String term = "filter"; - - List activities = repository.findByFilter(Filter.builder() - .withTarget(Activity.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.CONTAINS) - .withSearchCriteria(CRITERIA_OBJECT_NAME) - .withValue(term) - .build()) - .build()); - - assertTrue(!activities.isEmpty()); - activities.forEach(it -> assertTrue(it.getDetails().getObjectName().contains(term))); - } - - private Activity generateActivity() { - Activity activity = new Activity(); - activity.setActivityEntityType(Activity.ActivityEntityType.DEFECT_TYPE.getValue()); - activity.setAction("create_defect"); - activity.setObjectId(11L); - activity.setCreatedAt(LocalDateTime.now()); - activity.setProjectId(1L); - activity.setUserId(1L); - activity.setDetails(new ActivityDetails("test defect name")); - return activity; - } - - private ActivityDetails generateDetails() { - ActivityDetails details = new ActivityDetails(); - details.setObjectName("test"); - details.setHistory((Arrays.asList(HistoryField.of("test field", "old", "new"), HistoryField.of("test field 2", "old", "new")))); - return details; - } - - @Test - void sortingByJoinedColumnTest() { - PageRequest pageRequest = PageRequest.of(0, 10, Sort.by(Sort.Direction.DESC, CRITERIA_USER)); - Page activitiesPage = repository.findByFilter(defaultFilter(), pageRequest); - - assertTrue(Comparators.isInOrder(activitiesPage.getContent(), Comparator.comparing(Activity::getUsername).reversed())); - } - - private Filter filterById(long id) { - return new Filter(Activity.class, Condition.EQUALS, false, String.valueOf(id), "id"); - } - - private Filter defaultFilter() { - return new Filter(Activity.class, Condition.LOWER_THAN, false, "100", CRITERIA_ID); - } + private static final int ACTIVITIES_COUNT = 7; + + @Autowired + private ActivityRepository repository; + + // JPA + + @Test + void findByIdTest() { + final Optional activityOptional = repository.findById(1L); + + assertTrue(activityOptional.isPresent()); + assertEquals(1L, (long) activityOptional.get().getId()); + } + + @Test + void findAllTest() { + final List activities = repository.findAll(); + + assertTrue(!activities.isEmpty()); + assertEquals(ACTIVITIES_COUNT, activities.size()); + } + + @Test + void createTest() { + final Activity entity = generateActivity(); + final Activity saved = repository.save(entity); + entity.setId(saved.getId()); + final List all = repository.findAll(); + + assertEquals(saved, entity); + assertEquals(ACTIVITIES_COUNT + 1, all.size()); + assertTrue(all.contains(entity)); + } + + @SuppressWarnings("OptionalGetWithoutIsPresent") + @Test + void updateTest() { + Activity activity = repository.findById(1L).get(); + final LocalDateTime now = LocalDateTime.now(); + final ActivityDetails details = generateDetails(); + final String action = "test"; + + activity.setCreatedAt(now); + activity.setAction(action); + activity.setDetails(details); + + final Activity updated = repository.save(activity); + + assertEquals(now, updated.getCreatedAt()); + assertThat(updated.getDetails()).isEqualToIgnoringGivenFields(details, "mapper"); + assertEquals(action, updated.getAction()); + } + + @SuppressWarnings("OptionalGetWithoutIsPresent") + @Test + void deleteTest() { + final Activity activity = repository.findById(1L).get(); + repository.delete(activity); + + assertEquals(ACTIVITIES_COUNT - 1, repository.findAll().size()); + } + + @Test + void deleteById() { + repository.deleteById(1L); + assertEquals(ACTIVITIES_COUNT - 1, repository.findAll().size()); + } + + @Test + void existsTest() { + assertTrue(repository.existsById(1L)); + assertFalse(repository.existsById(100L)); + assertTrue(repository.exists(defaultFilter())); + } + + // Custom Repositories + + @Test + void deleteModifiedLaterAgo() { + Duration period = Duration.ofDays(10); + LocalDateTime bound = LocalDateTime.now().minus(period); + + repository.deleteModifiedLaterAgo(1L, period); + List all = repository.findAll(); + all.stream().filter(a -> a.getProjectId().equals(1L)) + .forEach(a -> assertTrue(a.getCreatedAt().isAfter(bound))); + } + + @SuppressWarnings("OptionalGetWithoutIsPresent") + @Test + void findByFilterWithSortingAndLimit() { + List activities = repository.findByFilterWithSortingAndLimit(defaultFilter(), + Sort.by(Sort.Direction.DESC, CRITERIA_CREATION_DATE), + 2 + ); + + assertEquals(2, activities.size()); + final LocalDateTime first = activities.get(0).getCreatedAt(); + final LocalDateTime second = activities.get(1).getCreatedAt(); + assertTrue(first.isBefore(second) || first.isEqual(second)); + } + + @Test + void findByFilter() { + List activities = repository.findByFilter(filterById(1)); + + assertEquals(1, activities.size()); + assertNotNull(activities.get(0)); + } + + @Test + void findByFilterPageable() { + Page page = repository.findByFilter(filterById(1), PageRequest.of(0, 10)); + ArrayList activities = Lists.newArrayList(); + page.forEach(activities::add); + + assertEquals(1, activities.size()); + assertNotNull(activities.get(0)); + } + + @Test + void findByProjectId() { + final List activities = repository.findByFilter(new Filter(Activity.class, + Condition.EQUALS, + false, + String.valueOf(1), + CRITERIA_PROJECT_ID + )); + assertNotNull(activities); + assertTrue(!activities.isEmpty()); + activities.forEach(it -> assertEquals(1L, (long) it.getProjectId())); + } + + @Test + void findByEntityType() { + final List activities = repository.findByFilter(new Filter(Activity.class, + Condition.EQUALS, + false, + "launch", + CRITERIA_ENTITY + )); + assertNotNull(activities); + assertTrue(!activities.isEmpty()); + activities.forEach(it -> assertEquals(Activity.ActivityEntityType.LAUNCH.getValue(), + it.getActivityEntityType())); + } + + @Test + void findByCreationDate() { + LocalDateTime to = LocalDateTime.now(); + LocalDateTime from = to.minusDays(7); + final List activities = repository.findByFilter(new Filter(Activity.class, + Condition.BETWEEN, + false, + Timestamp.valueOf(from).getTime() + "," + Timestamp.valueOf(to).getTime(), + CRITERIA_CREATION_DATE + )); + assertNotNull(activities); + assertTrue(!activities.isEmpty()); + activities.forEach( + it -> assertTrue(it.getCreatedAt().isBefore(to) && it.getCreatedAt().isAfter(from))); + } + + @Test + void findByUserLogin() { + final List activities = repository.findByFilter(new Filter(Activity.class, + Condition.EQUALS, + false, + "superadmin", + CRITERIA_USER + )); + assertNotNull(activities); + assertTrue(!activities.isEmpty()); + activities.forEach(it -> assertEquals(1L, (long) it.getUserId())); + } + + @Test + void findByObjectIdTest() { + final List activities = repository.findByFilter(new Filter(Activity.class, + Condition.EQUALS, + false, + "4", + CRITERIA_OBJECT_ID + )); + assertNotNull(activities); + assertTrue(!activities.isEmpty()); + activities.forEach(it -> assertEquals(4L, (long) it.getObjectId())); + } + + @Test + void objectNameCriteriaTest() { + String term = "filter"; + + List activities = repository.findByFilter(Filter.builder() + .withTarget(Activity.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.CONTAINS) + .withSearchCriteria(CRITERIA_OBJECT_NAME) + .withValue(term) + .build()) + .build()); + + assertTrue(!activities.isEmpty()); + activities.forEach(it -> assertTrue(it.getDetails().getObjectName().contains(term))); + } + + private Activity generateActivity() { + Activity activity = new Activity(); + activity.setActivityEntityType(Activity.ActivityEntityType.DEFECT_TYPE.getValue()); + activity.setAction("create_defect"); + activity.setObjectId(11L); + activity.setCreatedAt(LocalDateTime.now()); + activity.setProjectId(1L); + activity.setUserId(1L); + activity.setDetails(new ActivityDetails("test defect name")); + return activity; + } + + private ActivityDetails generateDetails() { + ActivityDetails details = new ActivityDetails(); + details.setObjectName("test"); + details.setHistory((Arrays.asList(HistoryField.of("test field", "old", "new"), + HistoryField.of("test field 2", "old", "new")))); + return details; + } + + @Test + void sortingByJoinedColumnTest() { + PageRequest pageRequest = PageRequest.of(0, 10, Sort.by(Sort.Direction.DESC, CRITERIA_USER)); + Page activitiesPage = repository.findByFilter(defaultFilter(), pageRequest); + + assertTrue(Comparators.isInOrder(activitiesPage.getContent(), + Comparator.comparing(Activity::getUsername).reversed())); + } + + private Filter filterById(long id) { + return new Filter(Activity.class, Condition.EQUALS, false, String.valueOf(id), "id"); + } + + private Filter defaultFilter() { + return new Filter(Activity.class, Condition.LOWER_THAN, false, "100", CRITERIA_ID); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/dao/AttachmentRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/AttachmentRepositoryTest.java index b88b47063..a562952d7 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/AttachmentRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/AttachmentRepositoryTest.java @@ -16,16 +16,13 @@ package com.epam.ta.reportportal.dao; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.attachment.Attachment; import com.google.common.collect.Lists; -import org.apache.commons.collections4.CollectionUtils; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.PageRequest; -import org.springframework.test.context.jdbc.Sql; - import java.time.Duration; import java.time.LocalDateTime; import java.time.ZoneOffset; @@ -33,8 +30,12 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.apache.commons.collections4.CollectionUtils; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.PageRequest; +import org.springframework.test.context.jdbc.Sql; /** * @author Ivan Budayeu @@ -42,128 +43,142 @@ @Sql("/db/fill/item/items-fill.sql") class AttachmentRepositoryTest extends BaseTest { - @Autowired - private AttachmentRepository attachmentRepository; - - @Autowired - private ProjectRepository projectRepository; - - @Test - void updateLaunchIdByProjectIdAndLaunchId() { - final List firstLaunchAttachments = attachmentRepository.findAllByLaunchIdIn(Lists.newArrayList(1L)); - Assertions.assertFalse(firstLaunchAttachments.isEmpty()); - attachmentRepository.updateLaunchIdByProjectIdAndLaunchId(1L, 1L, 2L); - - final List secondLaunchAttachments = attachmentRepository.findAllByLaunchIdIn(Lists.newArrayList(2L)); + @Autowired + private AttachmentRepository attachmentRepository; - final List secondLaunchAttachmentsIds = secondLaunchAttachments.stream().map(Attachment::getId).collect(Collectors.toList()); - Assertions.assertFalse(secondLaunchAttachments.isEmpty()); - Assertions.assertTrue(secondLaunchAttachmentsIds.containsAll(firstLaunchAttachments.stream() - .map(Attachment::getId) - .collect(Collectors.toList()))); + @Autowired + private ProjectRepository projectRepository; - Assertions.assertTrue(attachmentRepository.findAllByLaunchIdIn(Lists.newArrayList(1L)).isEmpty()); - } + @Test + void updateLaunchIdByProjectIdAndLaunchId() { + final List firstLaunchAttachments = attachmentRepository.findAllByLaunchIdIn( + Lists.newArrayList(1L)); + Assertions.assertFalse(firstLaunchAttachments.isEmpty()); + attachmentRepository.updateLaunchIdByProjectIdAndLaunchId(1L, 1L, 2L); - @Test - void findAllByProjectId() { + final List secondLaunchAttachments = attachmentRepository.findAllByLaunchIdIn( + Lists.newArrayList(2L)); - List ids = attachmentRepository.findIdsByProjectId(1L, PageRequest.of(0, 50)).getContent(); + final List secondLaunchAttachmentsIds = secondLaunchAttachments.stream() + .map(Attachment::getId).collect(Collectors.toList()); + Assertions.assertFalse(secondLaunchAttachments.isEmpty()); + Assertions.assertTrue(secondLaunchAttachmentsIds.containsAll(firstLaunchAttachments.stream() + .map(Attachment::getId) + .collect(Collectors.toList()))); - Assertions.assertFalse(ids.isEmpty()); + Assertions.assertTrue( + attachmentRepository.findAllByLaunchIdIn(Lists.newArrayList(1L)).isEmpty()); + } - } + @Test + void findAllByProjectId() { - @Test - void findAllByLaunchId() { + List ids = attachmentRepository.findIdsByProjectId(1L, PageRequest.of(0, 50)) + .getContent(); - List ids = attachmentRepository.findIdsByLaunchId(1L, PageRequest.of(0, 50)).getContent(); + Assertions.assertFalse(ids.isEmpty()); - Assertions.assertFalse(ids.isEmpty()); + } - } + @Test + void findAllByLaunchId() { - @Test - void findAllByItemId() { + List ids = attachmentRepository.findIdsByLaunchId(1L, PageRequest.of(0, 50)).getContent(); - List ids = attachmentRepository.findIdsByTestItemId(Collections.singleton(3L), PageRequest.of(0, 50)).getContent(); + Assertions.assertFalse(ids.isEmpty()); - Assertions.assertFalse(ids.isEmpty()); + } - } + @Test + void findAllByItemId() { - @Test - void deleteAllByIds() { - List ids = attachmentRepository.findAll().stream().limit(4).map(Attachment::getId).collect(Collectors.toList()); + List ids = attachmentRepository.findIdsByTestItemId(Collections.singleton(3L), + PageRequest.of(0, 50)).getContent(); - int count = attachmentRepository.deleteAllByIds(ids); + Assertions.assertFalse(ids.isEmpty()); - assertEquals(ids.size(), count); - } + } - @Test - void findByItemIdsAndPeriodTest() { - Duration duration = Duration.ofDays(6).plusHours(23); - final Long itemId = 3L; + @Test + void deleteAllByIds() { + List ids = attachmentRepository.findAll().stream().limit(4).map(Attachment::getId) + .collect(Collectors.toList()); - List attachments = attachmentRepository.findByItemIdsAndLogTimeBefore(Collections.singletonList(itemId), - LocalDateTime.now(ZoneOffset.UTC).minus(duration) - ); + int count = attachmentRepository.deleteAllByIds(ids); - assertTrue(CollectionUtils.isNotEmpty(attachments), "Attachments should not be empty"); - assertEquals(3, attachments.size(), "Incorrect count of attachments"); - attachments.stream().map(it -> null != it.getFileId() || null != it.getThumbnailId()).forEach(Assertions::assertTrue); - attachments.stream().map(Attachment::getFileSize).forEach(size -> assertEquals(1024, size)); - } + assertEquals(ids.size(), count); + } - @Test - void findByLaunchIdsAndPeriodTest() { - Duration duration = Duration.ofDays(6).plusHours(23); - final Long launchId = 3L; + @Test + void findByItemIdsAndPeriodTest() { + Duration duration = Duration.ofDays(6).plusHours(23); + final Long itemId = 3L; - List attachments = attachmentRepository.findByLaunchIdsAndLogTimeBefore(Collections.singletonList(launchId), - LocalDateTime.now(ZoneOffset.UTC).minus(duration) - ); + List attachments = attachmentRepository.findByItemIdsAndLogTimeBefore( + Collections.singletonList(itemId), + LocalDateTime.now(ZoneOffset.UTC).minus(duration) + ); - assertTrue(CollectionUtils.isNotEmpty(attachments), "Attachments should not be empty"); - assertEquals(1, attachments.size(), "Incorrect count of attachments"); - attachments.stream().map(it -> null != it.getFileId() || null != it.getThumbnailId()).forEach(Assertions::assertTrue); - attachments.stream().map(Attachment::getFileSize).forEach(size -> assertEquals(1024, size)); - } + assertTrue(CollectionUtils.isNotEmpty(attachments), "Attachments should not be empty"); + assertEquals(3, attachments.size(), "Incorrect count of attachments"); + attachments.stream().map(it -> null != it.getFileId() || null != it.getThumbnailId()) + .forEach(Assertions::assertTrue); + attachments.stream().map(Attachment::getFileSize).forEach(size -> assertEquals(1024, size)); + } - @Test - void shouldNotFindByLaunchIdsWhenLessThenPeriod() { - Duration duration = Duration.ofDays(14).plusHours(23); - final Long launchId = 3L; + @Test + void findByLaunchIdsAndPeriodTest() { + Duration duration = Duration.ofDays(6).plusHours(23); + final Long launchId = 3L; - List attachments = attachmentRepository.findByLaunchIdsAndLogTimeBefore(Collections.singletonList(launchId), - LocalDateTime.now(ZoneOffset.UTC).minus(duration) - ); + List attachments = attachmentRepository.findByLaunchIdsAndLogTimeBefore( + Collections.singletonList(launchId), + LocalDateTime.now(ZoneOffset.UTC).minus(duration) + ); - assertTrue(CollectionUtils.isEmpty(attachments), "Attachments should be empty"); - } + assertTrue(CollectionUtils.isNotEmpty(attachments), "Attachments should not be empty"); + assertEquals(1, attachments.size(), "Incorrect count of attachments"); + attachments.stream().map(it -> null != it.getFileId() || null != it.getThumbnailId()) + .forEach(Assertions::assertTrue); + attachments.stream().map(Attachment::getFileSize).forEach(size -> assertEquals(1024, size)); + } - @Test - void findByProjectIdsAndLogTimeBeforeTest() { - Duration duration = Duration.ofDays(6).plusHours(23); - final Long projectId = 1L; + @Test + void shouldNotFindByLaunchIdsWhenLessThenPeriod() { + Duration duration = Duration.ofDays(14).plusHours(23); + final Long launchId = 3L; + + List attachments = attachmentRepository.findByLaunchIdsAndLogTimeBefore( + Collections.singletonList(launchId), + LocalDateTime.now(ZoneOffset.UTC).minus(duration) + ); + + assertTrue(CollectionUtils.isEmpty(attachments), "Attachments should be empty"); + } - List attachments = attachmentRepository.findByProjectIdsAndLogTimeBefore(projectId, - LocalDateTime.now(ZoneOffset.UTC).minus(duration), 3, 6 - ); + @Test + void findByProjectIdsAndLogTimeBeforeTest() { + Duration duration = Duration.ofDays(6).plusHours(23); + final Long projectId = 1L; + + List attachments = attachmentRepository.findByProjectIdsAndLogTimeBefore(projectId, + LocalDateTime.now(ZoneOffset.UTC).minus(duration), 3, 6 + ); - assertTrue(CollectionUtils.isNotEmpty(attachments), "Attachments should not be empty"); - assertEquals(3, attachments.size(), "Incorrect count of attachments"); - attachments.stream().map(it -> null != it.getFileId() || null != it.getThumbnailId()).forEach(Assertions::assertTrue); - attachments.stream().map(Attachment::getFileSize).forEach(size -> assertEquals(1024, size)); - } + assertTrue(CollectionUtils.isNotEmpty(attachments), "Attachments should not be empty"); + assertEquals(3, attachments.size(), "Incorrect count of attachments"); + attachments.stream().map(it -> null != it.getFileId() || null != it.getThumbnailId()) + .forEach(Assertions::assertTrue); + attachments.stream().map(Attachment::getFileSize).forEach(size -> assertEquals(1024, size)); + } - @Test - void deleteAllByLaunchIdsIn() { - List launchIds = Arrays.asList(1L, 2L); - List attachments = attachmentRepository.findAllByLaunchIdIn(launchIds); - assertNotNull(attachments); - assertEquals(9, attachments.size()); - attachments.stream().map(Attachment::getLaunchId).distinct().map(launchIds::contains).forEach(Assertions::assertTrue); - } + @Test + void deleteAllByLaunchIdsIn() { + List launchIds = Arrays.asList(1L, 2L); + List attachments = attachmentRepository.findAllByLaunchIdIn(launchIds); + assertNotNull(attachments); + assertEquals(9, attachments.size()); + attachments.stream().map(Attachment::getLaunchId).distinct().map(launchIds::contains) + .forEach(Assertions::assertTrue); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/dao/AttributeRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/AttributeRepositoryTest.java index bf1bd6bfe..f789b2ea9 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/AttributeRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/AttributeRepositoryTest.java @@ -16,78 +16,77 @@ package com.epam.ta.reportportal.dao; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.springframework.test.util.AssertionErrors.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.attribute.Attribute; import com.epam.ta.reportportal.entity.enums.ProjectAttributeEnum; +import java.util.Optional; +import java.util.Set; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.jdbc.Sql; -import java.util.Optional; -import java.util.Set; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.springframework.test.util.AssertionErrors.assertTrue; - /** * @author Ivan Budaev */ @Sql("/db/fill/attributes/attributes-fill.sql") class AttributeRepositoryTest extends BaseTest { - @Autowired - private AttributeRepository attributeRepository; + @Autowired + private AttributeRepository attributeRepository; - @Test - void shouldFindWhenNameIsPresent() { + @Test + void shouldFindWhenNameIsPresent() { - //given - String name = "present"; + //given + String name = "present"; - //when - Optional attribute = attributeRepository.findByName(name); + //when + Optional attribute = attributeRepository.findByName(name); - //then - assertTrue("Attribute should exists", attribute.isPresent()); - } + //then + assertTrue("Attribute should exists", attribute.isPresent()); + } - @Test - void shouldNotFindWhenNameIsNotPresent() { + @Test + void shouldNotFindWhenNameIsNotPresent() { - //given - String name = "not present"; + //given + String name = "not present"; - //when - Optional attribute = attributeRepository.findByName(name); + //when + Optional attribute = attributeRepository.findByName(name); - //then - assertFalse(attribute.isPresent(), "Attribute should not exists"); - } + //then + assertFalse(attribute.isPresent(), "Attribute should not exists"); + } - @Test - void getDefaultProjectAttributesTest() { - final Set defaultProjectAttributes = attributeRepository.getDefaultProjectAttributes(); - defaultProjectAttributes.forEach(it -> assertTrue( - "Attribute should exists", - ProjectAttributeEnum.findByAttributeName(it.getName()).isPresent() - )); - } + @Test + void getDefaultProjectAttributesTest() { + final Set defaultProjectAttributes = attributeRepository.getDefaultProjectAttributes(); + defaultProjectAttributes.forEach(it -> assertTrue( + "Attribute should exists", + ProjectAttributeEnum.findByAttributeName(it.getName()).isPresent() + )); + } - @Test - void findById() { - final Long attrId = 100L; - final String attrName = "present"; + @Test + void findById() { + final Long attrId = 100L; + final String attrName = "present"; - final Optional attrOptional = attributeRepository.findById(attrId); - assertTrue("Attribute should exists", attrOptional.isPresent()); - assertEquals(attrName, attrOptional.get().getName(), "Incorrect attribute name"); - } + final Optional attrOptional = attributeRepository.findById(attrId); + assertTrue("Attribute should exists", attrOptional.isPresent()); + assertEquals(attrName, attrOptional.get().getName(), "Incorrect attribute name"); + } - @Test - void deleteById() { - final Long attrId = 100L; - attributeRepository.deleteById(attrId); - assertEquals(15, attributeRepository.findAll().size()); - } + @Test + void deleteById() { + final Long attrId = 100L; + attributeRepository.deleteById(attrId); + assertEquals(15, attributeRepository.findAll().size()); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/dao/ClusterRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/ClusterRepositoryTest.java index 52efab37e..412576cad 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/ClusterRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/ClusterRepositoryTest.java @@ -16,8 +16,20 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.cluster.Cluster; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.LongStream; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -28,137 +40,133 @@ import org.springframework.data.domain.Sort; import org.springframework.test.context.jdbc.Sql; -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.LongStream; - -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ivan Budayeu */ @Sql("/db/fill/launch/launch-fill.sql") class ClusterRepositoryTest extends BaseTest { - private static final long CLUSTER_ID_START_VALUE = 1L; - private static final long CLUSTER_ID_END_VALUE = 4L; - private static final long PROJECT_ID = 1L; - private static final long LAUNCH_ID = 1L; - - private final List savedIds = new ArrayList<>(); - - @Autowired - private ClusterRepository clusterRepository; - - @BeforeEach - void insertClusters() { - final List clusters = LongStream.range(CLUSTER_ID_START_VALUE, CLUSTER_ID_END_VALUE).mapToObj(id -> { - final Cluster cluster = new Cluster(); - cluster.setIndexId(id); - cluster.setProjectId(PROJECT_ID); - cluster.setLaunchId(LAUNCH_ID); - cluster.setMessage("Message"); - return cluster; - }).collect(Collectors.toList()); - clusterRepository.saveAll(clusters); - clusters.stream().map(Cluster::getId).forEach(savedIds::add); - } - - @AfterEach - void removeClusters() { - savedIds.stream().map(clusterRepository::findById).forEach(c -> c.ifPresent(clusterRepository::delete)); - savedIds.clear(); - } - - @Test - void shouldFindAllByLaunchId() { - final List clusters = clusterRepository.findAllByLaunchId(LAUNCH_ID); - assertFalse(clusters.isEmpty()); - assertEquals(3, clusters.size()); - clusters.forEach(cluster -> assertEquals(LAUNCH_ID, cluster.getLaunchId())); - } - - @Test - void shouldFindByLaunchId() { - - final Pageable pageable = PageRequest.of(0, 3, Sort.by(Sort.Order.by(CRITERIA_ID))); - final Page clusters = clusterRepository.findAllByLaunchId(LAUNCH_ID, pageable); - assertFalse(clusters.isEmpty()); - assertEquals(3, clusters.getContent().size()); - clusters.getContent().forEach(cluster -> assertEquals(LAUNCH_ID, cluster.getLaunchId())); - } - - @Test - void shouldDeleteByProjectId() { - final int removed = clusterRepository.deleteAllByProjectId(PROJECT_ID); - assertEquals(3, removed); - - final Pageable pageable = PageRequest.of(0, 3, Sort.by(Sort.Order.by(CRITERIA_ID))); - final Page clusters = clusterRepository.findAllByLaunchId(LAUNCH_ID, pageable); - assertTrue(clusters.isEmpty()); - } - - @Test - void shouldDeleteByLaunchId() { - final int removed = clusterRepository.deleteAllByLaunchId(LAUNCH_ID); - assertEquals(3, removed); - - final Pageable pageable = PageRequest.of(0, 3, Sort.by(Sort.Order.by(CRITERIA_ID))); - final Page clusters = clusterRepository.findAllByLaunchId(LAUNCH_ID, pageable); - assertTrue(clusters.isEmpty()); - } - - @Test - void shouldDeleteClusterTestItemsByProjectId() { - final Cluster cluster = clusterRepository.findByIndexIdAndLaunchId(1L, 1L).get(); - clusterRepository.saveClusterTestItems(cluster, Set.of(1L)); - - final int removed = clusterRepository.deleteClusterTestItemsByProjectId(1L); - assertEquals(1, removed); - } - - @Test - void shouldDeleteClusterTestItemsByLaunchId() { - final Cluster cluster = clusterRepository.findByIndexIdAndLaunchId(1L, 1L).get(); - clusterRepository.saveClusterTestItems(cluster, Set.of(1L)); - - final int removed = clusterRepository.deleteClusterTestItemsByLaunchId(1L); - assertEquals(1, removed); - } - - @Test - void shouldDeleteClusterTestItemsByItemId() { - final Cluster cluster = clusterRepository.findByIndexIdAndLaunchId(1L, 1L).get(); - clusterRepository.saveClusterTestItems(cluster, Set.of(1L)); - - final int removed = clusterRepository.deleteClusterTestItemsByItemId(1L); - assertEquals(1, removed); - } - - @Test - void shouldDeleteClusterTestItemsByItemIdIn() { - final Cluster cluster = clusterRepository.findByIndexIdAndLaunchId(1L, 1L).get(); - clusterRepository.saveClusterTestItems(cluster, Set.of(1L)); - - final int removed = clusterRepository.deleteClusterTestItemsByItemIds(List.of(1L)); - assertEquals(1, removed); - - final int zeroRemoved = clusterRepository.deleteClusterTestItemsByItemIds(Collections.emptyList()); - assertEquals(0, zeroRemoved); - } - - @Test - void shouldSaveClusterTestItems() { - final Cluster cluster = clusterRepository.findAllByLaunchId(LAUNCH_ID).get(0); - final int inserted = clusterRepository.saveClusterTestItems(cluster, Set.of(1L, 2L)); - assertEquals(2, inserted); - } - - @Test - void shouldFindByIndexAndLaunchId() { - final Optional cluster = clusterRepository.findByIndexIdAndLaunchId(1L, 1L); - assertTrue(cluster.isPresent()); - } + private static final long CLUSTER_ID_START_VALUE = 1L; + private static final long CLUSTER_ID_END_VALUE = 4L; + private static final long PROJECT_ID = 1L; + private static final long LAUNCH_ID = 1L; + + private final List savedIds = new ArrayList<>(); + + @Autowired + private ClusterRepository clusterRepository; + + @BeforeEach + void insertClusters() { + final List clusters = LongStream.range(CLUSTER_ID_START_VALUE, CLUSTER_ID_END_VALUE) + .mapToObj(id -> { + final Cluster cluster = new Cluster(); + cluster.setIndexId(id); + cluster.setProjectId(PROJECT_ID); + cluster.setLaunchId(LAUNCH_ID); + cluster.setMessage("Message"); + return cluster; + }).collect(Collectors.toList()); + clusterRepository.saveAll(clusters); + clusters.stream().map(Cluster::getId).forEach(savedIds::add); + } + + @AfterEach + void removeClusters() { + savedIds.stream().map(clusterRepository::findById) + .forEach(c -> c.ifPresent(clusterRepository::delete)); + savedIds.clear(); + } + + @Test + void shouldFindAllByLaunchId() { + final List clusters = clusterRepository.findAllByLaunchId(LAUNCH_ID); + assertFalse(clusters.isEmpty()); + assertEquals(3, clusters.size()); + clusters.forEach(cluster -> assertEquals(LAUNCH_ID, cluster.getLaunchId())); + } + + @Test + void shouldFindByLaunchId() { + + final Pageable pageable = PageRequest.of(0, 3, Sort.by(Sort.Order.by(CRITERIA_ID))); + final Page clusters = clusterRepository.findAllByLaunchId(LAUNCH_ID, pageable); + assertFalse(clusters.isEmpty()); + assertEquals(3, clusters.getContent().size()); + clusters.getContent().forEach(cluster -> assertEquals(LAUNCH_ID, cluster.getLaunchId())); + } + + @Test + void shouldDeleteByProjectId() { + final int removed = clusterRepository.deleteAllByProjectId(PROJECT_ID); + assertEquals(3, removed); + + final Pageable pageable = PageRequest.of(0, 3, Sort.by(Sort.Order.by(CRITERIA_ID))); + final Page clusters = clusterRepository.findAllByLaunchId(LAUNCH_ID, pageable); + assertTrue(clusters.isEmpty()); + } + + @Test + void shouldDeleteByLaunchId() { + final int removed = clusterRepository.deleteAllByLaunchId(LAUNCH_ID); + assertEquals(3, removed); + + final Pageable pageable = PageRequest.of(0, 3, Sort.by(Sort.Order.by(CRITERIA_ID))); + final Page clusters = clusterRepository.findAllByLaunchId(LAUNCH_ID, pageable); + assertTrue(clusters.isEmpty()); + } + + @Test + void shouldDeleteClusterTestItemsByProjectId() { + final Cluster cluster = clusterRepository.findByIndexIdAndLaunchId(1L, 1L).get(); + clusterRepository.saveClusterTestItems(cluster, Set.of(1L)); + + final int removed = clusterRepository.deleteClusterTestItemsByProjectId(1L); + assertEquals(1, removed); + } + + @Test + void shouldDeleteClusterTestItemsByLaunchId() { + final Cluster cluster = clusterRepository.findByIndexIdAndLaunchId(1L, 1L).get(); + clusterRepository.saveClusterTestItems(cluster, Set.of(1L)); + + final int removed = clusterRepository.deleteClusterTestItemsByLaunchId(1L); + assertEquals(1, removed); + } + + @Test + void shouldDeleteClusterTestItemsByItemId() { + final Cluster cluster = clusterRepository.findByIndexIdAndLaunchId(1L, 1L).get(); + clusterRepository.saveClusterTestItems(cluster, Set.of(1L)); + + final int removed = clusterRepository.deleteClusterTestItemsByItemId(1L); + assertEquals(1, removed); + } + + @Test + void shouldDeleteClusterTestItemsByItemIdIn() { + final Cluster cluster = clusterRepository.findByIndexIdAndLaunchId(1L, 1L).get(); + clusterRepository.saveClusterTestItems(cluster, Set.of(1L)); + + final int removed = clusterRepository.deleteClusterTestItemsByItemIds(List.of(1L)); + assertEquals(1, removed); + + final int zeroRemoved = clusterRepository.deleteClusterTestItemsByItemIds( + Collections.emptyList()); + assertEquals(0, zeroRemoved); + } + + @Test + void shouldSaveClusterTestItems() { + final Cluster cluster = clusterRepository.findAllByLaunchId(LAUNCH_ID).get(0); + final int inserted = clusterRepository.saveClusterTestItems(cluster, Set.of(1L, 2L)); + assertEquals(2, inserted); + } + + @Test + void shouldFindByIndexAndLaunchId() { + final Optional cluster = clusterRepository.findByIndexIdAndLaunchId(1L, 1L); + assertTrue(cluster.isPresent()); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/dao/DashboardRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/DashboardRepositoryTest.java index 98dd7d24e..76b389f69 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/DashboardRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/DashboardRepositoryTest.java @@ -16,12 +16,21 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_NAME; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.commons.querygen.Condition; import com.epam.ta.reportportal.commons.querygen.Filter; import com.epam.ta.reportportal.commons.querygen.FilterCondition; import com.epam.ta.reportportal.commons.querygen.ProjectFilter; import com.epam.ta.reportportal.entity.dashboard.Dashboard; +import java.util.List; +import java.util.Optional; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -29,151 +38,155 @@ import org.springframework.data.domain.Sort; import org.springframework.test.context.jdbc.Sql; -import java.util.List; -import java.util.Optional; - -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_NAME; -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ihar Kahadouski */ @Sql("/db/fill/shareable/shareable-fill.sql") class DashboardRepositoryTest extends BaseTest { - @Autowired - private DashboardRepository repository; - - @Test - public void shouldFindByIdAndProjectIdWhenExists() { - Optional dashboard = repository.findByIdAndProjectId(13L, 1L); - - assertTrue(dashboard.isPresent()); - } - - @Test - public void shouldNotFindByIdAndProjectIdWhenIdNotExists() { - Optional dashboard = repository.findByIdAndProjectId(55L, 1L); - - assertFalse(dashboard.isPresent()); - } - - @Test - public void shouldNotFindByIdAndProjectIdWhenProjectIdNotExists() { - Optional dashboard = repository.findByIdAndProjectId(5L, 11L); - - assertFalse(dashboard.isPresent()); - } - - @Test - public void shouldNotFindByIdAndProjectIdWhenIdAndProjectIdNotExist() { - Optional dashboard = repository.findByIdAndProjectId(55L, 11L); - - assertFalse(dashboard.isPresent()); - } - - @Test - void findAllByProjectId() { - final long superadminProjectId = 1L; - - final List dashboards = repository.findAllByProjectId(superadminProjectId); - - assertNotNull(dashboards, "Dashboards should not be null"); - assertEquals(4, dashboards.size(), "Unexpected dashboards size"); - dashboards.forEach(it -> assertEquals(superadminProjectId, (long) it.getProject().getId(), "Dashboard has incorrect project id")); - } - - @Test - void existsByNameAndOwnerAndProjectId() { - assertTrue(repository.existsByNameAndOwnerAndProjectId("test admin dashboard", "superadmin", 1L)); - assertFalse(repository.existsByNameAndOwnerAndProjectId("not exist name", "default", 2L)); - } - - @Test - void getPermitted() { - final String adminLogin = "superadmin"; - final Page superadminPermitted = repository.getPermitted(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), - adminLogin - ); - assertEquals(3, superadminPermitted.getTotalElements(), "Unexpected permitted dashboards count"); - - final String defaultLogin = "default"; - final Page defaultPermitted = repository.getPermitted(ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - defaultLogin - ); - assertEquals(2, defaultPermitted.getTotalElements(), "Unexpected permitted dashboards count"); - - final String jajaLogin = "jaja_user"; - final Page jajaPermitted = repository.getPermitted(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), - jajaLogin - ); - assertEquals(3, jajaPermitted.getTotalElements(), "Unexpected permitted dashboards count"); - } - - @Test - void getOwn() { - final String adminLogin = "superadmin"; - final Page superadminOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), - adminLogin - ); - assertEquals(2, superadminOwn.getTotalElements(), "Unexpected own dashboards count"); - superadminOwn.getContent().forEach(it -> assertEquals(adminLogin, it.getOwner())); - - final String defaultLogin = "default"; - final Page defaultOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - defaultLogin - ); - assertEquals(2, defaultOwn.getTotalElements(), "Unexpected own dashboards count"); - defaultOwn.getContent().forEach(it -> assertEquals(defaultLogin, it.getOwner())); - - final String jajaLogin = "jaja_user"; - final Page jajaOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 1L), PageRequest.of(0, 3), jajaLogin); - assertEquals(2, jajaOwn.getTotalElements(), "Unexpected own dashboards count"); - jajaOwn.getContent().forEach(it -> assertEquals(jajaLogin, it.getOwner())); - } - - @Test - void getShared() { - final String adminLogin = "superadmin"; - final Page superadminShared = repository.getShared(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), - adminLogin - ); - assertEquals(2, superadminShared.getTotalElements(), "Unexpected shared dashboards count"); - superadminShared.getContent().forEach(it -> assertTrue(it.isShared())); - - final String defaultLogin = "default"; - final Page defaultShared = repository.getShared(ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - defaultLogin - ); - assertEquals(1, defaultShared.getTotalElements(), "Unexpected shared dashboards count"); - defaultShared.getContent().forEach(it -> assertTrue(it.isShared())); - - final String jajaLogin = "jaja_user"; - final Page jajaShared = repository.getShared(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), - jajaLogin - ); - assertEquals(2, jajaShared.getTotalElements(), "Unexpected shared dashboards count"); - jajaShared.getContent().forEach(it -> assertTrue(it.isShared())); - } - - @Test - void shouldFindBySpecifiedNameAndProjectId() { - assertTrue(repository.existsByNameAndProjectId("test admin dashboard", 1L)); - } - - private Filter buildDefaultFilter() { - return Filter.builder() - .withTarget(Dashboard.class) - .withCondition(new FilterCondition(Condition.LOWER_THAN, false, "100", CRITERIA_ID)) - .build(); - } + @Autowired + private DashboardRepository repository; + + @Test + public void shouldFindByIdAndProjectIdWhenExists() { + Optional dashboard = repository.findByIdAndProjectId(13L, 1L); + + assertTrue(dashboard.isPresent()); + } + + @Test + public void shouldNotFindByIdAndProjectIdWhenIdNotExists() { + Optional dashboard = repository.findByIdAndProjectId(55L, 1L); + + assertFalse(dashboard.isPresent()); + } + + @Test + public void shouldNotFindByIdAndProjectIdWhenProjectIdNotExists() { + Optional dashboard = repository.findByIdAndProjectId(5L, 11L); + + assertFalse(dashboard.isPresent()); + } + + @Test + public void shouldNotFindByIdAndProjectIdWhenIdAndProjectIdNotExist() { + Optional dashboard = repository.findByIdAndProjectId(55L, 11L); + + assertFalse(dashboard.isPresent()); + } + + @Test + void findAllByProjectId() { + final long superadminProjectId = 1L; + + final List dashboards = repository.findAllByProjectId(superadminProjectId); + + assertNotNull(dashboards, "Dashboards should not be null"); + assertEquals(4, dashboards.size(), "Unexpected dashboards size"); + dashboards.forEach(it -> assertEquals(superadminProjectId, (long) it.getProject().getId(), + "Dashboard has incorrect project id")); + } + + @Test + void existsByNameAndOwnerAndProjectId() { + assertTrue( + repository.existsByNameAndOwnerAndProjectId("test admin dashboard", "superadmin", 1L)); + assertFalse(repository.existsByNameAndOwnerAndProjectId("not exist name", "default", 2L)); + } + + @Test + void getPermitted() { + final String adminLogin = "superadmin"; + final Page superadminPermitted = repository.getPermitted( + ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), + adminLogin + ); + assertEquals(3, superadminPermitted.getTotalElements(), + "Unexpected permitted dashboards count"); + + final String defaultLogin = "default"; + final Page defaultPermitted = repository.getPermitted( + ProjectFilter.of(buildDefaultFilter(), 2L), + PageRequest.of(0, 3), + defaultLogin + ); + assertEquals(2, defaultPermitted.getTotalElements(), "Unexpected permitted dashboards count"); + + final String jajaLogin = "jaja_user"; + final Page jajaPermitted = repository.getPermitted( + ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3), + jajaLogin + ); + assertEquals(3, jajaPermitted.getTotalElements(), "Unexpected permitted dashboards count"); + } + + @Test + void getOwn() { + final String adminLogin = "superadmin"; + final Page superadminOwn = repository.getOwn( + ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), + adminLogin + ); + assertEquals(2, superadminOwn.getTotalElements(), "Unexpected own dashboards count"); + superadminOwn.getContent().forEach(it -> assertEquals(adminLogin, it.getOwner())); + + final String defaultLogin = "default"; + final Page defaultOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 2L), + PageRequest.of(0, 3), + defaultLogin + ); + assertEquals(2, defaultOwn.getTotalElements(), "Unexpected own dashboards count"); + defaultOwn.getContent().forEach(it -> assertEquals(defaultLogin, it.getOwner())); + + final String jajaLogin = "jaja_user"; + final Page jajaOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3), jajaLogin); + assertEquals(2, jajaOwn.getTotalElements(), "Unexpected own dashboards count"); + jajaOwn.getContent().forEach(it -> assertEquals(jajaLogin, it.getOwner())); + } + + @Test + void getShared() { + final String adminLogin = "superadmin"; + final Page superadminShared = repository.getShared( + ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), + adminLogin + ); + assertEquals(2, superadminShared.getTotalElements(), "Unexpected shared dashboards count"); + superadminShared.getContent().forEach(it -> assertTrue(it.isShared())); + + final String defaultLogin = "default"; + final Page defaultShared = repository.getShared( + ProjectFilter.of(buildDefaultFilter(), 2L), + PageRequest.of(0, 3), + defaultLogin + ); + assertEquals(1, defaultShared.getTotalElements(), "Unexpected shared dashboards count"); + defaultShared.getContent().forEach(it -> assertTrue(it.isShared())); + + final String jajaLogin = "jaja_user"; + final Page jajaShared = repository.getShared( + ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3), + jajaLogin + ); + assertEquals(2, jajaShared.getTotalElements(), "Unexpected shared dashboards count"); + jajaShared.getContent().forEach(it -> assertTrue(it.isShared())); + } + + @Test + void shouldFindBySpecifiedNameAndProjectId() { + assertTrue(repository.existsByNameAndProjectId("test admin dashboard", 1L)); + } + + private Filter buildDefaultFilter() { + return Filter.builder() + .withTarget(Dashboard.class) + .withCondition(new FilterCondition(Condition.LOWER_THAN, false, "100", CRITERIA_ID)) + .build(); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/DashboardWidgetRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/DashboardWidgetRepositoryTest.java index 61cdc09ea..eb21f6f96 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/DashboardWidgetRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/DashboardWidgetRepositoryTest.java @@ -6,21 +6,19 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.jdbc.Sql; -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ivan Budayeu */ @Sql("/db/fill/dashboard-widget/dashboard-widget-fill.sql") class DashboardWidgetRepositoryTest extends BaseTest { - @Autowired - private DashboardWidgetRepository dashboardWidgetRepository; + @Autowired + private DashboardWidgetRepository dashboardWidgetRepository; - @Test - void countAllByWidgetId() { - Assertions.assertEquals(3,dashboardWidgetRepository.countAllByWidgetId(5L)); - Assertions.assertEquals(2,dashboardWidgetRepository.countAllByWidgetId(6L)); - } + @Test + void countAllByWidgetId() { + Assertions.assertEquals(3, dashboardWidgetRepository.countAllByWidgetId(5L)); + Assertions.assertEquals(2, dashboardWidgetRepository.countAllByWidgetId(6L)); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/dao/IntegrationRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/IntegrationRepositoryTest.java index 2a098e1c9..ecad47f5f 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/IntegrationRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/IntegrationRepositoryTest.java @@ -16,268 +16,305 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.dao.constant.TestConstants.DEFAULT_PERSONAL_PROJECT_ID; +import static com.epam.ta.reportportal.dao.constant.TestConstants.GLOBAL_EMAIL_INTEGRATION_ID; +import static com.epam.ta.reportportal.dao.constant.TestConstants.SUPERADMIN_PERSONAL_PROJECT_ID; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.not; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.enums.IntegrationGroupEnum; import com.epam.ta.reportportal.entity.integration.Integration; import com.epam.ta.reportportal.entity.integration.IntegrationType; import com.epam.ta.reportportal.entity.project.Project; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; import org.apache.commons.collections4.CollectionUtils; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.jdbc.Sql; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - -import static com.epam.ta.reportportal.dao.constant.TestConstants.*; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ivan Budayeu */ @Sql("/db/fill/integration/integrations-fill.sql") class IntegrationRepositoryTest extends BaseTest { - private static final long GLOBAL_EMAIL_INTEGRATIONS_COUNT = 1L; - private static final long SUPERADMIN_PROJECT_BTS_INTEGRATIONS_COUNT = 4L; - private static final int GLOBAL_BTS_INTEGRATIONS_COUNT = 3; - - private static final Long RALLY_INTEGRATION_TYPE_ID = 5L; - private static final Long JIRA_INTEGRATION_TYPE_ID = 6L; - - private static final Long RALLY_INTEGRATION_ID = 7L; - private static final Long JIRA_INTEGRATION_ID = 13L; - - @Autowired - private IntegrationRepository integrationRepository; - - @Autowired - private IntegrationTypeRepository integrationTypeRepository; - - @Test - void shouldUpdateEnabledStateByIntegrationId() { - - integrationRepository.updateEnabledStateById(true, RALLY_INTEGRATION_ID); - - Integration after = integrationRepository.findById(RALLY_INTEGRATION_ID).get(); - - assertTrue(after.isEnabled()); - - } - - @Test - void shouldUpdateEnabledStateByIntegrationTypeId() { - - IntegrationType integrationType = integrationTypeRepository.findById(JIRA_INTEGRATION_TYPE_ID).get(); - - integrationRepository.updateEnabledStateByIntegrationTypeId(true, integrationType.getId()); - - List enabledAfter = integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc(DEFAULT_PERSONAL_PROJECT_ID, integrationType); - - enabledAfter.forEach(integration -> assertTrue(integration.isEnabled())); - } - - @Test - void findByIdAndTypeId() { - final Integration jiraIntegration = integrationRepository.findByIdAndTypeIdAndProjectIdIsNull(JIRA_INTEGRATION_ID, JIRA_INTEGRATION_TYPE_ID).get(); - assertEquals("jira", jiraIntegration.getName()); - assertEquals(JIRA_INTEGRATION_ID, jiraIntegration.getId()); - assertEquals(JIRA_INTEGRATION_TYPE_ID, jiraIntegration.getType().getId()); - } - - @Test - void findByNameAndTypeId() { - final Integration jiraIntegration = integrationRepository.findByNameAndTypeIdAndProjectIdIsNull("jira", JIRA_INTEGRATION_TYPE_ID).get(); - assertEquals("jira", jiraIntegration.getName()); - assertEquals(JIRA_INTEGRATION_ID, jiraIntegration.getId()); - assertEquals(JIRA_INTEGRATION_TYPE_ID, jiraIntegration.getType().getId()); - } - - @Test - void shouldFindAllByProjectIdAndIntegrationTypeWhenExists() { - - IntegrationType integrationType = integrationTypeRepository.findById(JIRA_INTEGRATION_TYPE_ID).get(); - - List integrations = integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc(DEFAULT_PERSONAL_PROJECT_ID, integrationType); - - assertNotNull(integrations); - assertEquals(1L, integrations.size()); - } - - @Test - void shouldDeleteAllGlobalByIntegrationTypeId() { - - IntegrationType integrationType = integrationTypeRepository.findById(JIRA_INTEGRATION_TYPE_ID).get(); - - integrationRepository.deleteAllGlobalByIntegrationTypeId(integrationType.getId()); - - assertThat(integrationRepository.findAllGlobalByType(integrationType), is(empty())); - - assertThat(integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc(DEFAULT_PERSONAL_PROJECT_ID, integrationType), is(not(empty()))); - assertThat(integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc(SUPERADMIN_PERSONAL_PROJECT_ID, integrationType), is(not(empty()))); - } - - @Test - void shouldDeleteAllByProjectIdAndIntegrationTypeId() { + private static final long GLOBAL_EMAIL_INTEGRATIONS_COUNT = 1L; + private static final long SUPERADMIN_PROJECT_BTS_INTEGRATIONS_COUNT = 4L; + private static final int GLOBAL_BTS_INTEGRATIONS_COUNT = 3; - IntegrationType integrationType = integrationTypeRepository.findById(JIRA_INTEGRATION_TYPE_ID).get(); + private static final Long RALLY_INTEGRATION_TYPE_ID = 5L; + private static final Long JIRA_INTEGRATION_TYPE_ID = 6L; - integrationRepository.deleteAllByProjectIdAndIntegrationTypeId(SUPERADMIN_PERSONAL_PROJECT_ID, integrationType.getId()); + private static final Long RALLY_INTEGRATION_ID = 7L; + private static final Long JIRA_INTEGRATION_ID = 13L; - assertThat(integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc(SUPERADMIN_PERSONAL_PROJECT_ID, integrationType), is(empty())); - assertThat(integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc(DEFAULT_PERSONAL_PROJECT_ID, integrationType), is(not(empty()))); - } + @Autowired + private IntegrationRepository integrationRepository; - @Test - void findAllGlobal() { - List global = integrationRepository.findAllGlobal(); - assertThat(global, hasSize(4)); - global.forEach(it -> assertThat(it.getProject(), equalTo(null))); - } + @Autowired + private IntegrationTypeRepository integrationTypeRepository; - @Test - void existsByNameTypePositive() { - boolean exists = integrationRepository.existsByNameAndTypeIdAndProjectIdIsNull("jira", 6L); - assertTrue(exists); - } + @Test + void shouldUpdateEnabledStateByIntegrationId() { - @Test - void existsByNameTypeNegative() { - boolean exists = integrationRepository.existsByNameAndTypeIdAndProjectIdIsNull("jira1", 4L); - assertFalse(exists); - } + integrationRepository.updateEnabledStateById(true, RALLY_INTEGRATION_ID); - @Test - void existsByNameTypeProjectIdPositive() { - boolean exists = integrationRepository.existsByNameAndTypeIdAndProjectId("jira1", 6L, 1L); - assertTrue(exists); - } + Integration after = integrationRepository.findById(RALLY_INTEGRATION_ID).get(); - @Test - void existsByNameTypeProjectIdNegative() { - boolean exists = integrationRepository.existsByNameAndTypeIdAndProjectId("jira", 6L, 2L); - assertFalse(exists); - } + assertTrue(after.isEnabled()); - @Test - void findAllGlobalByIntegrationGroup() { - List integrations = integrationRepository.findAllGlobalByGroup(IntegrationGroupEnum.BTS); - assertThat(integrations, hasSize(GLOBAL_BTS_INTEGRATIONS_COUNT)); - integrations.forEach(it -> assertThat(it.getType().getIntegrationGroup(), equalTo(IntegrationGroupEnum.BTS))); - } + } - @Test - void findAllProjectByIntegrationGroup() { - Project project = new Project(); - project.setId(1L); - List integrations = integrationRepository.findAllProjectByGroup(project, IntegrationGroupEnum.BTS); - assertThat(integrations, hasSize(4)); - } + @Test + void shouldUpdateEnabledStateByIntegrationTypeId() { - @Test - void shouldFindAllGlobalByIntegrationType() { + IntegrationType integrationType = integrationTypeRepository.findById(JIRA_INTEGRATION_TYPE_ID) + .get(); - IntegrationType integrationType = integrationTypeRepository.findById(2L).get(); + integrationRepository.updateEnabledStateByIntegrationTypeId(true, integrationType.getId()); - List globalEmailIntegrations = integrationRepository.findAllGlobalByType(integrationType); + List enabledAfter = integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc( + DEFAULT_PERSONAL_PROJECT_ID, integrationType); - assertNotNull(globalEmailIntegrations); - assertEquals(GLOBAL_EMAIL_INTEGRATIONS_COUNT, globalEmailIntegrations.size()); + enabledAfter.forEach(integration -> assertTrue(integration.isEnabled())); + } - globalEmailIntegrations.forEach(i -> assertNull(i.getProject())); - } + @Test + void findByIdAndTypeId() { + final Integration jiraIntegration = integrationRepository.findByIdAndTypeIdAndProjectIdIsNull( + JIRA_INTEGRATION_ID, JIRA_INTEGRATION_TYPE_ID).get(); + assertEquals("jira", jiraIntegration.getName()); + assertEquals(JIRA_INTEGRATION_ID, jiraIntegration.getId()); + assertEquals(JIRA_INTEGRATION_TYPE_ID, jiraIntegration.getType().getId()); + } - @Test - void shouldFindGlobalBtsIntegrationByUrlAndLinkedProject() { + @Test + void findByNameAndTypeId() { + final Integration jiraIntegration = integrationRepository.findByNameAndTypeIdAndProjectIdIsNull( + "jira", JIRA_INTEGRATION_TYPE_ID).get(); + assertEquals("jira", jiraIntegration.getName()); + assertEquals(JIRA_INTEGRATION_ID, jiraIntegration.getId()); + assertEquals(JIRA_INTEGRATION_TYPE_ID, jiraIntegration.getType().getId()); + } - Optional globalBtsIntegration = integrationRepository.findGlobalBtsByUrlAndLinkedProject("bts.com", "bts_project"); + @Test + void shouldFindAllByProjectIdAndIntegrationTypeWhenExists() { - assertTrue(globalBtsIntegration.isPresent()); - assertNull(globalBtsIntegration.get().getProject()); - } + IntegrationType integrationType = integrationTypeRepository.findById(JIRA_INTEGRATION_TYPE_ID) + .get(); - @Test - void shouldFindProjectBtsIntegrationByUrlAndLinkedProject() { + List integrations = integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc( + DEFAULT_PERSONAL_PROJECT_ID, integrationType); - Optional projectBtsIntegration = integrationRepository.findProjectBtsByUrlAndLinkedProject("projectbts.com", - "project", - SUPERADMIN_PERSONAL_PROJECT_ID - ); + assertNotNull(integrations); + assertEquals(1L, integrations.size()); + } - assertTrue(projectBtsIntegration.isPresent()); - assertNotNull(projectBtsIntegration.get().getProject()); - } + @Test + void shouldDeleteAllGlobalByIntegrationTypeId() { - @Test - void shouldFindGlobalIntegrationById() { + IntegrationType integrationType = integrationTypeRepository.findById(JIRA_INTEGRATION_TYPE_ID) + .get(); - Optional globalIntegration = integrationRepository.findGlobalById(GLOBAL_EMAIL_INTEGRATION_ID); + integrationRepository.deleteAllGlobalByIntegrationTypeId(integrationType.getId()); - assertTrue(globalIntegration.isPresent()); - assertNull(globalIntegration.get().getProject()); - } + assertThat(integrationRepository.findAllGlobalByType(integrationType), is(empty())); - @Test - void shouldFindAllProjectIntegrationsByProjectIdAndIntegrationTypeIds() { + assertThat(integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc( + DEFAULT_PERSONAL_PROJECT_ID, integrationType), is(not(empty()))); + assertThat(integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc( + SUPERADMIN_PERSONAL_PROJECT_ID, integrationType), is(not(empty()))); + } - List integrationTypeIds = integrationTypeRepository.findAllByIntegrationGroup(IntegrationGroupEnum.BTS) - .stream() - .map(IntegrationType::getId) - .collect(Collectors.toList()); + @Test + void shouldDeleteAllByProjectIdAndIntegrationTypeId() { - List integrations = integrationRepository.findAllByProjectIdAndInIntegrationTypeIds(SUPERADMIN_PERSONAL_PROJECT_ID, - integrationTypeIds - ); + IntegrationType integrationType = integrationTypeRepository.findById(JIRA_INTEGRATION_TYPE_ID) + .get(); - assertNotNull(integrations); - assertEquals(SUPERADMIN_PROJECT_BTS_INTEGRATIONS_COUNT, integrations.size()); + integrationRepository.deleteAllByProjectIdAndIntegrationTypeId(SUPERADMIN_PERSONAL_PROJECT_ID, + integrationType.getId()); - integrations.forEach(i -> assertNotNull(i.getProject())); - } + assertThat(integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc( + SUPERADMIN_PERSONAL_PROJECT_ID, integrationType), is(empty())); + assertThat(integrationRepository.findAllByProjectIdAndTypeOrderByCreationDateDesc( + DEFAULT_PERSONAL_PROJECT_ID, integrationType), is(not(empty()))); + } - @Test - void shouldFindAllGlobalInIntegrationTypeIds() { + @Test + void findAllGlobal() { + List global = integrationRepository.findAllGlobal(); + assertThat(global, hasSize(4)); + global.forEach(it -> assertThat(it.getProject(), equalTo(null))); + } - List integrationTypeIds = integrationTypeRepository.findAllByIntegrationGroup(IntegrationGroupEnum.BTS) - .stream() - .map(IntegrationType::getId) - .collect(Collectors.toList()); + @Test + void existsByNameTypePositive() { + boolean exists = integrationRepository.existsByNameAndTypeIdAndProjectIdIsNull("jira", 6L); + assertTrue(exists); + } - List integrations = integrationRepository.findAllGlobalInIntegrationTypeIds(integrationTypeIds); + @Test + void existsByNameTypeNegative() { + boolean exists = integrationRepository.existsByNameAndTypeIdAndProjectIdIsNull("jira1", 4L); + assertFalse(exists); + } - assertNotNull(integrations); - assertEquals(GLOBAL_BTS_INTEGRATIONS_COUNT, integrations.size()); + @Test + void existsByNameTypeProjectIdPositive() { + boolean exists = integrationRepository.existsByNameAndTypeIdAndProjectId("jira1", 6L, 1L); + assertTrue(exists); + } + + @Test + void existsByNameTypeProjectIdNegative() { + boolean exists = integrationRepository.existsByNameAndTypeIdAndProjectId("jira", 6L, 2L); + assertFalse(exists); + } + + @Test + void findAllGlobalByIntegrationGroup() { + List integrations = integrationRepository.findAllGlobalByGroup( + IntegrationGroupEnum.BTS); + assertThat(integrations, hasSize(GLOBAL_BTS_INTEGRATIONS_COUNT)); + integrations.forEach( + it -> assertThat(it.getType().getIntegrationGroup(), equalTo(IntegrationGroupEnum.BTS))); + } + + @Test + void findAllProjectByIntegrationGroup() { + Project project = new Project(); + project.setId(1L); + List integrations = integrationRepository.findAllProjectByGroup(project, + IntegrationGroupEnum.BTS); + assertThat(integrations, hasSize(4)); + } + + @Test + void shouldFindAllGlobalByIntegrationType() { - integrations.forEach(i -> assertNull(i.getProject())); - } + IntegrationType integrationType = integrationTypeRepository.findById(2L).get(); - @Test - void shouldFindAllGlobalProjectIntegrationsNotInIntegrationTypeIds() { + List globalEmailIntegrations = integrationRepository.findAllGlobalByType( + integrationType); + + assertNotNull(globalEmailIntegrations); + assertEquals(GLOBAL_EMAIL_INTEGRATIONS_COUNT, globalEmailIntegrations.size()); + + globalEmailIntegrations.forEach(i -> assertNull(i.getProject())); + } + + @Test + void shouldFindGlobalBtsIntegrationByUrlAndLinkedProject() { + + Optional globalBtsIntegration = integrationRepository.findGlobalBtsByUrlAndLinkedProject( + "bts.com", "bts_project"); + + assertTrue(globalBtsIntegration.isPresent()); + assertNull(globalBtsIntegration.get().getProject()); + } + + @Test + void shouldFindProjectBtsIntegrationByUrlAndLinkedProject() { + + Optional projectBtsIntegration = integrationRepository.findProjectBtsByUrlAndLinkedProject( + "projectbts.com", + "project", + SUPERADMIN_PERSONAL_PROJECT_ID + ); + + assertTrue(projectBtsIntegration.isPresent()); + assertNotNull(projectBtsIntegration.get().getProject()); + } + + @Test + void shouldFindGlobalIntegrationById() { + + Optional globalIntegration = integrationRepository.findGlobalById( + GLOBAL_EMAIL_INTEGRATION_ID); + + assertTrue(globalIntegration.isPresent()); + assertNull(globalIntegration.get().getProject()); + } + + @Test + void shouldFindAllProjectIntegrationsByProjectIdAndIntegrationTypeIds() { + + List integrationTypeIds = integrationTypeRepository.findAllByIntegrationGroup( + IntegrationGroupEnum.BTS) + .stream() + .map(IntegrationType::getId) + .collect(Collectors.toList()); + + List integrations = integrationRepository.findAllByProjectIdAndInIntegrationTypeIds( + SUPERADMIN_PERSONAL_PROJECT_ID, + integrationTypeIds + ); + + assertNotNull(integrations); + assertEquals(SUPERADMIN_PROJECT_BTS_INTEGRATIONS_COUNT, integrations.size()); + + integrations.forEach(i -> assertNotNull(i.getProject())); + } + + @Test + void shouldFindAllGlobalInIntegrationTypeIds() { + + List integrationTypeIds = integrationTypeRepository.findAllByIntegrationGroup( + IntegrationGroupEnum.BTS) + .stream() + .map(IntegrationType::getId) + .collect(Collectors.toList()); + + List integrations = integrationRepository.findAllGlobalInIntegrationTypeIds( + integrationTypeIds); + + assertNotNull(integrations); + assertEquals(GLOBAL_BTS_INTEGRATIONS_COUNT, integrations.size()); + + integrations.forEach(i -> assertNull(i.getProject())); + } + + @Test + void shouldFindAllGlobalProjectIntegrationsNotInIntegrationTypeIds() { - List integrationTypeIds = integrationTypeRepository.findAllByIntegrationGroup(IntegrationGroupEnum.BTS) - .stream() - .map(IntegrationType::getId) - .collect(Collectors.toList()); + List integrationTypeIds = integrationTypeRepository.findAllByIntegrationGroup( + IntegrationGroupEnum.BTS) + .stream() + .map(IntegrationType::getId) + .collect(Collectors.toList()); - List integrations = integrationRepository.findAllGlobalNotInIntegrationTypeIds(integrationTypeIds); + List integrations = integrationRepository.findAllGlobalNotInIntegrationTypeIds( + integrationTypeIds); - assertNotNull(integrations); - assertEquals(GLOBAL_EMAIL_INTEGRATIONS_COUNT, integrations.size()); + assertNotNull(integrations); + assertEquals(GLOBAL_EMAIL_INTEGRATIONS_COUNT, integrations.size()); - integrations.forEach(i -> assertNull(i.getProject())); - } + integrations.forEach(i -> assertNull(i.getProject())); + } - @Test - void findAllPredefinedIntegrations() { - List predefinedIntegrationTypes = Arrays.asList("jira", "rally", "email", "saucelabs"); - List integrations = integrationRepository.findAllByTypeIn("jira", "rally", "email", "saucelabs"); - assertNotNull(integrations); - assertTrue(CollectionUtils.isNotEmpty(integrations)); - integrations.stream().map(it -> it.getType().getName()).map(predefinedIntegrationTypes::contains).forEach(Assertions::assertTrue); - } + @Test + void findAllPredefinedIntegrations() { + List predefinedIntegrationTypes = Arrays.asList("jira", "rally", "email", "saucelabs"); + List integrations = integrationRepository.findAllByTypeIn("jira", "rally", "email", + "saucelabs"); + assertNotNull(integrations); + assertTrue(CollectionUtils.isNotEmpty(integrations)); + integrations.stream().map(it -> it.getType().getName()) + .map(predefinedIntegrationTypes::contains).forEach(Assertions::assertTrue); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/IntegrationTypeRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/IntegrationTypeRepositoryTest.java index 85b4f5419..57ef0d8d1 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/IntegrationTypeRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/IntegrationTypeRepositoryTest.java @@ -16,58 +16,63 @@ package com.epam.ta.reportportal.dao; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.enums.IntegrationGroupEnum; import com.epam.ta.reportportal.entity.integration.IntegrationType; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; - import java.util.List; import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; /** * @author Ivan Budayeu */ class IntegrationTypeRepositoryTest extends BaseTest { - private final static String JIRA_INTEGRATION_TYPE_NAME = "jira"; - private final static String ACCESS_TYPE_NAME = "public"; - private final static String WRONG_INTEGRATION_TYPE_NAME = "WRONG"; - private static final long BTS_INTEGRATIONS_COUNT = 2L; - private static final long PUBLIC_INTEGRATIONS_COUNT = 1L; + private final static String JIRA_INTEGRATION_TYPE_NAME = "jira"; + private final static String ACCESS_TYPE_NAME = "public"; + private final static String WRONG_INTEGRATION_TYPE_NAME = "WRONG"; + private static final long BTS_INTEGRATIONS_COUNT = 2L; + private static final long PUBLIC_INTEGRATIONS_COUNT = 1L; - @Autowired - private IntegrationTypeRepository integrationTypeRepository; + @Autowired + private IntegrationTypeRepository integrationTypeRepository; - @Test - void shouldFindWhenNameExists() { - Optional byName = integrationTypeRepository.findByName(JIRA_INTEGRATION_TYPE_NAME); - assertTrue(byName.isPresent()); - } + @Test + void shouldFindWhenNameExists() { + Optional byName = integrationTypeRepository.findByName( + JIRA_INTEGRATION_TYPE_NAME); + assertTrue(byName.isPresent()); + } - @Test - void shouldFindAllOrderedByCreationDate() { - List integrationTypes = integrationTypeRepository.findAllByOrderByCreationDate(); - assertNotNull(integrationTypes); - assertFalse(integrationTypes.isEmpty()); - } + @Test + void shouldFindAllOrderedByCreationDate() { + List integrationTypes = integrationTypeRepository.findAllByOrderByCreationDate(); + assertNotNull(integrationTypes); + assertFalse(integrationTypes.isEmpty()); + } - @Test - void shouldFindAllByIntegrationGroup() { + @Test + void shouldFindAllByIntegrationGroup() { - List integrationTypes = integrationTypeRepository.findAllByIntegrationGroup(IntegrationGroupEnum.BTS); + List integrationTypes = integrationTypeRepository.findAllByIntegrationGroup( + IntegrationGroupEnum.BTS); - assertNotNull(integrationTypes); - assertEquals(BTS_INTEGRATIONS_COUNT, integrationTypes.size()); - } + assertNotNull(integrationTypes); + assertEquals(BTS_INTEGRATIONS_COUNT, integrationTypes.size()); + } - @Test - void shouldFindAllIntegrationTypesByAccessType() { - List integrationTypes = integrationTypeRepository.findAllByAccessType(ACCESS_TYPE_NAME); - assertNotNull(integrationTypes); - assertEquals(PUBLIC_INTEGRATIONS_COUNT, integrationTypes.size()); - } + @Test + void shouldFindAllIntegrationTypesByAccessType() { + List integrationTypes = integrationTypeRepository.findAllByAccessType( + ACCESS_TYPE_NAME); + assertNotNull(integrationTypes); + assertEquals(PUBLIC_INTEGRATIONS_COUNT, integrationTypes.size()); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryTest.java index 7ed26ba06..8efec7631 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/IssueEntityRepositoryTest.java @@ -16,50 +16,49 @@ package com.epam.ta.reportportal.dao; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.enums.TestItemIssueGroup; import com.epam.ta.reportportal.entity.item.issue.IssueEntity; import com.epam.ta.reportportal.entity.item.issue.IssueEntityPojo; import com.google.common.collect.Lists; +import java.util.List; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.jdbc.Sql; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertEquals; - /** * @author Ihar Kahadouski */ @Sql("/db/fill/item/items-fill.sql") class IssueEntityRepositoryTest extends BaseTest { - @Autowired - private IssueEntityRepository repository; + @Autowired + private IssueEntityRepository repository; - @Test - void findAllByIssueId() { - final Long automationBugTypeId = 2L; - final int expectedSize = 11; + @Test + void findAllByIssueId() { + final Long automationBugTypeId = 2L; + final int expectedSize = 11; - final List issueEntities = repository.findAllByIssueTypeId(automationBugTypeId); - assertEquals(expectedSize, issueEntities.size(), "Incorrect size of issue entities"); - issueEntities.forEach(it -> assertEquals(TestItemIssueGroup.AUTOMATION_BUG, - it.getIssueType().getIssueGroup().getTestItemIssueGroup(), - "Issue entities should be from 'automation bug' group" - )); + final List issueEntities = repository.findAllByIssueTypeId(automationBugTypeId); + assertEquals(expectedSize, issueEntities.size(), "Incorrect size of issue entities"); + issueEntities.forEach(it -> assertEquals(TestItemIssueGroup.AUTOMATION_BUG, + it.getIssueType().getIssueGroup().getTestItemIssueGroup(), + "Issue entities should be from 'automation bug' group" + )); - } + } - @Test - void insertByItemIdAndIssueTypeId() { - int result = repository.saveMultiple(Lists.newArrayList( - new IssueEntityPojo(1L, 1L, "description", false, false), - new IssueEntityPojo(2L, 1L, "description", false, false) - )); + @Test + void insertByItemIdAndIssueTypeId() { + int result = repository.saveMultiple(Lists.newArrayList( + new IssueEntityPojo(1L, 1L, "description", false, false), + new IssueEntityPojo(2L, 1L, "description", false, false) + )); - Assertions.assertEquals(2, result); - } + Assertions.assertEquals(2, result); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/IssueGroupRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/IssueGroupRepositoryTest.java index f06227181..790051c16 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/IssueGroupRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/IssueGroupRepositoryTest.java @@ -16,31 +16,31 @@ package com.epam.ta.reportportal.dao; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.enums.TestItemIssueGroup; import com.epam.ta.reportportal.entity.item.issue.IssueGroup; +import java.util.Arrays; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import java.util.Arrays; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - /** * @author Ihar Kahadouski */ class IssueGroupRepositoryTest extends BaseTest { - @Autowired - private IssueGroupRepository repository; + @Autowired + private IssueGroupRepository repository; - @Test - void findByTestItemIssueGroup() { - Arrays.stream(TestItemIssueGroup.values()).filter(it -> !it.equals(TestItemIssueGroup.NOT_ISSUE_FLAG)).forEach(it -> { - final IssueGroup issueGroup = repository.findByTestItemIssueGroup(it); - assertEquals(it, issueGroup.getTestItemIssueGroup(), "Incorrect issue group"); - assertNotNull(issueGroup.getId(), "Issue group should have id"); - }); - } + @Test + void findByTestItemIssueGroup() { + Arrays.stream(TestItemIssueGroup.values()) + .filter(it -> !it.equals(TestItemIssueGroup.NOT_ISSUE_FLAG)).forEach(it -> { + final IssueGroup issueGroup = repository.findByTestItemIssueGroup(it); + assertEquals(it, issueGroup.getTestItemIssueGroup(), "Incorrect issue group"); + assertNotNull(issueGroup.getId(), "Issue group should have id"); + }); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/IssueTypeRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/IssueTypeRepositoryTest.java index 98402b7c6..a28b42735 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/IssueTypeRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/IssueTypeRepositoryTest.java @@ -16,67 +16,67 @@ package com.epam.ta.reportportal.dao; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.enums.TestItemIssueGroup; import com.epam.ta.reportportal.entity.item.issue.IssueType; +import java.util.List; +import java.util.Optional; import org.hamcrest.Matchers; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.jdbc.Sql; -import java.util.List; -import java.util.Optional; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - /** * @author Ihar Kahadouski */ @Sql("/db/fill/issue-type/issue-type-fill.sql") class IssueTypeRepositoryTest extends BaseTest { - private static final int DEFAULT_ISSUE_TYPES_COUNT = TestItemIssueGroup.values().length - 1; + private static final int DEFAULT_ISSUE_TYPES_COUNT = TestItemIssueGroup.values().length - 1; - @Autowired - private IssueTypeRepository repository; + @Autowired + private IssueTypeRepository repository; - @Test - void findByLocator() { - final String customLocator = "pb_ajf7d5d"; - final Optional customIssueType = repository.findByLocator(customLocator); - assertThat("IssueType should exist", customIssueType.isPresent(), Matchers.is(true)); - assertIssueType(customIssueType.get()); - } + private static void assertIssueType(IssueType customIssueType) { + final String customLocator = "pb_ajf7d5d"; + final String customLongName = "Custom"; + final String customShortName = "CS"; + final String customHexColor = "#a3847e"; - @Test - void findById() { - final Long customId = 100L; + assertEquals(customLocator, customIssueType.getLocator(), "Incorrect locator"); + assertEquals(customLongName, customIssueType.getLongName(), "Incorrect long name"); + assertEquals(customShortName, customIssueType.getShortName(), "Incorrect short name"); + assertEquals(customHexColor, customIssueType.getHexColor(), "Incorrect hex color"); + assertEquals(TestItemIssueGroup.PRODUCT_BUG, + customIssueType.getIssueGroup().getTestItemIssueGroup(), "Unexpected issue group"); + } - final Optional issueTypeOptional = repository.findById(customId); - assertTrue(issueTypeOptional.isPresent()); - assertIssueType(issueTypeOptional.get()); - } + @Test + void findByLocator() { + final String customLocator = "pb_ajf7d5d"; + final Optional customIssueType = repository.findByLocator(customLocator); + assertThat("IssueType should exist", customIssueType.isPresent(), Matchers.is(true)); + assertIssueType(customIssueType.get()); + } - @Test - void defaultIssueTypes() { - final List defaultIssueTypes = repository.getDefaultIssueTypes(); - assertEquals(DEFAULT_ISSUE_TYPES_COUNT, defaultIssueTypes.size()); - defaultIssueTypes.forEach(Assertions::assertNotNull); - } + @Test + void findById() { + final Long customId = 100L; - private static void assertIssueType(IssueType customIssueType) { - final String customLocator = "pb_ajf7d5d"; - final String customLongName = "Custom"; - final String customShortName = "CS"; - final String customHexColor = "#a3847e"; + final Optional issueTypeOptional = repository.findById(customId); + assertTrue(issueTypeOptional.isPresent()); + assertIssueType(issueTypeOptional.get()); + } - assertEquals(customLocator, customIssueType.getLocator(), "Incorrect locator"); - assertEquals(customLongName, customIssueType.getLongName(), "Incorrect long name"); - assertEquals(customShortName, customIssueType.getShortName(), "Incorrect short name"); - assertEquals(customHexColor, customIssueType.getHexColor(), "Incorrect hex color"); - assertEquals(TestItemIssueGroup.PRODUCT_BUG, customIssueType.getIssueGroup().getTestItemIssueGroup(), "Unexpected issue group"); - } + @Test + void defaultIssueTypes() { + final List defaultIssueTypes = repository.getDefaultIssueTypes(); + assertEquals(DEFAULT_ISSUE_TYPES_COUNT, defaultIssueTypes.size()); + defaultIssueTypes.forEach(Assertions::assertNotNull); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryTest.java index ee4767d87..0a0725626 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/ItemAttributeRepositoryTest.java @@ -16,174 +16,187 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_PROJECT_ID; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.commons.querygen.Filter; import com.epam.ta.reportportal.commons.querygen.FilterCondition; import com.epam.ta.reportportal.entity.ItemAttribute; import com.epam.ta.reportportal.entity.launch.Launch; +import java.util.List; +import java.util.Optional; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.PageRequest; import org.springframework.test.context.jdbc.Sql; -import java.util.List; -import java.util.Optional; - -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_PROJECT_ID; -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ihar Kahadouski */ @Sql("/db/fill/item/items-fill.sql") class ItemAttributeRepositoryTest extends BaseTest { - @Autowired - private ItemAttributeRepository repository; - - @Test - void findAttributesByProjectId() { - - Filter filter = Filter.builder() - .withTarget(Launch.class) - .withCondition(FilterCondition.builder().eq(CRITERIA_PROJECT_ID, "1").build()) - .build(); - List keys = repository.findAllKeysByLaunchFilter(filter, PageRequest.of(0, 600), false, "step", false); - - assertFalse(keys.isEmpty()); - } - - @Test - void findByLaunchIdAndKeyAndSystem() { - final String launchKeyName = "key1"; - final Long launchId = 1L; - - final Optional optionalAttr = repository.findByLaunchIdAndKeyAndSystem(launchId, launchKeyName, false); - assertTrue(optionalAttr.isPresent(), "Should be present"); - assertEquals(launchId, optionalAttr.get().getLaunch().getId(), "Unexpected launch id"); - assertEquals(launchKeyName, optionalAttr.get().getKey(), "Unexpected key"); - } - - @Test - void findTestItemAttributeValues() { - final Long launchId = 1L; - final String stepKey = "step"; - final String partOfItemValue = "val"; - - final List values = repository.findTestItemAttributeValues(launchId, stepKey, partOfItemValue, false); - System.out.println(); - assertNotNull(values, "Should not be null"); - assertTrue(!values.isEmpty(), "Should not be empty"); - values.forEach(it -> assertTrue(it.contains(partOfItemValue), "Value not matches")); - } - - @Test - void findTestItemKeysByProjectId() { - final Long projectId = 1L; - final String launchName = "name 1"; - final String partOfItemKey = "st"; - - final List keys = repository.findTestItemKeysByProjectIdAndLaunchName(projectId, launchName, partOfItemKey, false); - assertNotNull(keys, "Should not be null"); - assertTrue(!keys.isEmpty(), "Should not be empty"); - keys.forEach(it -> assertTrue(it.contains(partOfItemKey), "Key not matches")); - } - - @Test - void findTestItemValuesByProjectId() { - final Long projectId = 1L; - final String launchName = "name 1"; - final String stepKey = "step"; - final String partOfItemValue = "val"; - - final List values = repository.findTestItemValuesByProjectIdAndLaunchName(projectId, launchName, stepKey, partOfItemValue, false); - assertNotNull(values, "Should not be null"); - assertTrue(!values.isEmpty(), "Should not be empty"); - values.forEach(it -> assertTrue(it.contains(partOfItemValue), "Value not matches")); - } - - @Test - void findTestItemAttributeKeys() { - final Long launchId = 1L; - final String partOfItemKey = "st"; - - final List keys = repository.findTestItemAttributeKeys(launchId, partOfItemKey, false); - assertNotNull(keys, "Should not be null"); - assertTrue(!keys.isEmpty(), "Should not be empty"); - keys.forEach(it -> assertTrue(it.contains(partOfItemKey), "Key not matches")); - } - - @Test - void findLaunchAttributeKeys() { - final Long projectId = 1L; - final String partOfLaunchKey = "ke"; - - final List keys = repository.findLaunchAttributeKeys(projectId, partOfLaunchKey, false); - assertNotNull(keys, "Should not be null"); - assertTrue(!keys.isEmpty(), "Should not be empty"); - keys.forEach(it -> assertTrue(it.contains(partOfLaunchKey), "Key not matches")); - } - - @Test - void findLaunchAttributeValues() { - final Long projectId = 1L; - final String launchKeyName = "key1"; - final String partOfItemValue = "val"; - - final List values = repository.findLaunchAttributeValues(projectId, launchKeyName, partOfItemValue, false); - assertNotNull(values, "Should not be null"); - assertTrue(!values.isEmpty(), "Should not be empty"); - values.forEach(it -> assertTrue(it.contains(partOfItemValue), "Value not matches")); - } - - @Test - void saveItemAttributeByItemId() { - int result = repository.saveByItemId(1L, "new key", "new value", false); - - Assertions.assertEquals(1, result); - - List attributeKeys = repository.findTestItemAttributeKeys(1L, "new", false); - - Assertions.assertNotNull(attributeKeys); - Assertions.assertFalse(attributeKeys.isEmpty()); - Assertions.assertTrue(attributeKeys.stream().anyMatch(k -> k.equals("new key"))); - } - - @Test - void saveItemAttributeByLaunchId() { - int result = repository.saveByLaunchId(1L, "new", "new value", false); - - Assertions.assertEquals(1, result); - - final Optional attribute = repository.findByLaunchIdAndKeyAndSystem(1L, "new", false); - - Assertions.assertTrue(attribute.isPresent()); - Assertions.assertEquals("new", attribute.get().getKey()); - Assertions.assertEquals("new value", attribute.get().getValue()); - Assertions.assertEquals(false, attribute.get().isSystem()); - } - - @Test - void deleteByKeyAndSystem() { - repository.saveByLaunchId(1L, "first", "first", true); - repository.saveByLaunchId(1L, "second", "second", false); - - final Optional first = repository.findByLaunchIdAndKeyAndSystem(1L, "first", true); - final Optional second = repository.findByLaunchIdAndKeyAndSystem(1L, "second", false); - - Assertions.assertTrue(first.isPresent()); - Assertions.assertTrue(second.isPresent()); - - repository.deleteAllByLaunchIdAndKeyAndSystem(1L, "first", true); - repository.deleteAllByLaunchIdAndKeyAndSystem(1L, "second", false); - - final Optional firstAfterRemove = repository.findByLaunchIdAndKeyAndSystem(1L, "first", true); - final Optional secondAfterRemove = repository.findByLaunchIdAndKeyAndSystem(1L, "second", false); - - Assertions.assertFalse(firstAfterRemove.isPresent()); - Assertions.assertFalse(secondAfterRemove.isPresent()); - - - } + @Autowired + private ItemAttributeRepository repository; + + @Test + void findAttributesByProjectId() { + + Filter filter = Filter.builder() + .withTarget(Launch.class) + .withCondition(FilterCondition.builder().eq(CRITERIA_PROJECT_ID, "1").build()) + .build(); + List keys = repository.findAllKeysByLaunchFilter(filter, PageRequest.of(0, 600), false, + "step", false); + + assertFalse(keys.isEmpty()); + } + + @Test + void findByLaunchIdAndKeyAndSystem() { + final String launchKeyName = "key1"; + final Long launchId = 1L; + + final Optional optionalAttr = repository.findByLaunchIdAndKeyAndSystem(launchId, + launchKeyName, false); + assertTrue(optionalAttr.isPresent(), "Should be present"); + assertEquals(launchId, optionalAttr.get().getLaunch().getId(), "Unexpected launch id"); + assertEquals(launchKeyName, optionalAttr.get().getKey(), "Unexpected key"); + } + + @Test + void findTestItemAttributeValues() { + final Long launchId = 1L; + final String stepKey = "step"; + final String partOfItemValue = "val"; + + final List values = repository.findTestItemAttributeValues(launchId, stepKey, + partOfItemValue, false); + System.out.println(); + assertNotNull(values, "Should not be null"); + assertTrue(!values.isEmpty(), "Should not be empty"); + values.forEach(it -> assertTrue(it.contains(partOfItemValue), "Value not matches")); + } + + @Test + void findTestItemKeysByProjectId() { + final Long projectId = 1L; + final String launchName = "name 1"; + final String partOfItemKey = "st"; + + final List keys = repository.findTestItemKeysByProjectIdAndLaunchName(projectId, + launchName, partOfItemKey, false); + assertNotNull(keys, "Should not be null"); + assertTrue(!keys.isEmpty(), "Should not be empty"); + keys.forEach(it -> assertTrue(it.contains(partOfItemKey), "Key not matches")); + } + + @Test + void findTestItemValuesByProjectId() { + final Long projectId = 1L; + final String launchName = "name 1"; + final String stepKey = "step"; + final String partOfItemValue = "val"; + + final List values = repository.findTestItemValuesByProjectIdAndLaunchName(projectId, + launchName, stepKey, partOfItemValue, false); + assertNotNull(values, "Should not be null"); + assertTrue(!values.isEmpty(), "Should not be empty"); + values.forEach(it -> assertTrue(it.contains(partOfItemValue), "Value not matches")); + } + + @Test + void findTestItemAttributeKeys() { + final Long launchId = 1L; + final String partOfItemKey = "st"; + + final List keys = repository.findTestItemAttributeKeys(launchId, partOfItemKey, false); + assertNotNull(keys, "Should not be null"); + assertTrue(!keys.isEmpty(), "Should not be empty"); + keys.forEach(it -> assertTrue(it.contains(partOfItemKey), "Key not matches")); + } + + @Test + void findLaunchAttributeKeys() { + final Long projectId = 1L; + final String partOfLaunchKey = "ke"; + + final List keys = repository.findLaunchAttributeKeys(projectId, partOfLaunchKey, false); + assertNotNull(keys, "Should not be null"); + assertTrue(!keys.isEmpty(), "Should not be empty"); + keys.forEach(it -> assertTrue(it.contains(partOfLaunchKey), "Key not matches")); + } + + @Test + void findLaunchAttributeValues() { + final Long projectId = 1L; + final String launchKeyName = "key1"; + final String partOfItemValue = "val"; + + final List values = repository.findLaunchAttributeValues(projectId, launchKeyName, + partOfItemValue, false); + assertNotNull(values, "Should not be null"); + assertTrue(!values.isEmpty(), "Should not be empty"); + values.forEach(it -> assertTrue(it.contains(partOfItemValue), "Value not matches")); + } + + @Test + void saveItemAttributeByItemId() { + int result = repository.saveByItemId(1L, "new key", "new value", false); + + Assertions.assertEquals(1, result); + + List attributeKeys = repository.findTestItemAttributeKeys(1L, "new", false); + + Assertions.assertNotNull(attributeKeys); + Assertions.assertFalse(attributeKeys.isEmpty()); + Assertions.assertTrue(attributeKeys.stream().anyMatch(k -> k.equals("new key"))); + } + + @Test + void saveItemAttributeByLaunchId() { + int result = repository.saveByLaunchId(1L, "new", "new value", false); + + Assertions.assertEquals(1, result); + + final Optional attribute = repository.findByLaunchIdAndKeyAndSystem(1L, "new", + false); + + Assertions.assertTrue(attribute.isPresent()); + Assertions.assertEquals("new", attribute.get().getKey()); + Assertions.assertEquals("new value", attribute.get().getValue()); + Assertions.assertEquals(false, attribute.get().isSystem()); + } + + @Test + void deleteByKeyAndSystem() { + repository.saveByLaunchId(1L, "first", "first", true); + repository.saveByLaunchId(1L, "second", "second", false); + + final Optional first = repository.findByLaunchIdAndKeyAndSystem(1L, "first", + true); + final Optional second = repository.findByLaunchIdAndKeyAndSystem(1L, "second", + false); + + Assertions.assertTrue(first.isPresent()); + Assertions.assertTrue(second.isPresent()); + + repository.deleteAllByLaunchIdAndKeyAndSystem(1L, "first", true); + repository.deleteAllByLaunchIdAndKeyAndSystem(1L, "second", false); + + final Optional firstAfterRemove = repository.findByLaunchIdAndKeyAndSystem(1L, + "first", true); + final Optional secondAfterRemove = repository.findByLaunchIdAndKeyAndSystem(1L, + "second", false); + + Assertions.assertFalse(firstAfterRemove.isPresent()); + Assertions.assertFalse(secondAfterRemove.isPresent()); + + + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/LaunchCompositeAttributeFilteringTest.java b/src/test/java/com/epam/ta/reportportal/dao/LaunchCompositeAttributeFilteringTest.java index 9c7233529..883488e99 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/LaunchCompositeAttributeFilteringTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/LaunchCompositeAttributeFilteringTest.java @@ -1,123 +1,133 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_COMPOSITE_ATTRIBUTE; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.commons.querygen.Condition; import com.epam.ta.reportportal.commons.querygen.Filter; import com.epam.ta.reportportal.commons.querygen.FilterCondition; import com.epam.ta.reportportal.entity.launch.Launch; +import java.util.Arrays; +import java.util.List; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.jdbc.Sql; -import java.util.Arrays; -import java.util.List; - -import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_COMPOSITE_ATTRIBUTE; -import static org.junit.jupiter.api.Assertions.assertEquals; - /** * @author Ivan Budayeu */ @Sql("/db/fill/launch/launch-filtering-data.sql") public class LaunchCompositeAttributeFilteringTest extends BaseTest { - @Autowired - private LaunchRepository launchRepository; - - @Test - void compositeAttributeHas() { - List launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.HAS, - "key1:value1,key2:value2", - false - ))); - - assertEquals(2, launches.size()); - - launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.HAS, - "key1:value1,key2:value2,key3:value3", - false - ))); - - assertEquals(1, launches.size()); - assertEquals(1L, launches.get(0).getId()); - } - - @Test - void compositeAttributeHasNegative() { - List launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.HAS, - "key1:value1,key2:value2", - true - ))); - - assertEquals(0, launches.size()); - - launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.HAS, - "key1:value1,key2:value2,key3:value3", - true - ))); - - assertEquals(1, launches.size()); - assertEquals(2L, launches.get(0).getId()); - } - - @Test - void compositeAttributeAny() { - List launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, - "key1:value1,key2:value2,key3:value3", - false - ))); - - assertEquals(2, launches.size()); - - launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, "key1:value1,key3:value3", - false - ))); - - assertEquals(2, launches.size()); - - launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, "key3:value3", - false - ))); - - assertEquals(1, launches.size()); - assertEquals(1L, launches.get(0).getId()); - } - - @Test - void compositeAttributeAnyNegative() { - List launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, - "key1:value1,key2:value2,key3:value3", - true - ))); - - assertEquals(0, launches.size()); - - launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, "key1:value1,key3:value3", - true - ))); - - assertEquals(0, launches.size()); - - launches = launchRepository.findByFilter(buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, "key3:value3", - true - ))); - - assertEquals(1, launches.size()); - assertEquals(2L, launches.get(0).getId()); - } - - private FilterCondition buildCompositeAttributeCondition(Condition condition, String value, boolean negative) { - return FilterCondition.builder() - .withCondition(condition) - .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) - .withValue(value) - .withNegative(negative) - .build(); - } - - private Filter buildFilterWithConditions(FilterCondition... conditions) { - final Filter.FilterBuilder builder = Filter.builder().withTarget(Launch.class); - Arrays.stream(conditions).forEach(builder::withCondition); - return builder.build(); - } + @Autowired + private LaunchRepository launchRepository; + + @Test + void compositeAttributeHas() { + List launches = launchRepository.findByFilter( + buildFilterWithConditions(buildCompositeAttributeCondition(Condition.HAS, + "key1:value1,key2:value2", + false + ))); + + assertEquals(2, launches.size()); + + launches = launchRepository.findByFilter( + buildFilterWithConditions(buildCompositeAttributeCondition(Condition.HAS, + "key1:value1,key2:value2,key3:value3", + false + ))); + + assertEquals(1, launches.size()); + assertEquals(1L, launches.get(0).getId()); + } + + @Test + void compositeAttributeHasNegative() { + List launches = launchRepository.findByFilter( + buildFilterWithConditions(buildCompositeAttributeCondition(Condition.HAS, + "key1:value1,key2:value2", + true + ))); + + assertEquals(0, launches.size()); + + launches = launchRepository.findByFilter( + buildFilterWithConditions(buildCompositeAttributeCondition(Condition.HAS, + "key1:value1,key2:value2,key3:value3", + true + ))); + + assertEquals(1, launches.size()); + assertEquals(2L, launches.get(0).getId()); + } + + @Test + void compositeAttributeAny() { + List launches = launchRepository.findByFilter( + buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, + "key1:value1,key2:value2,key3:value3", + false + ))); + + assertEquals(2, launches.size()); + + launches = launchRepository.findByFilter(buildFilterWithConditions( + buildCompositeAttributeCondition(Condition.ANY, "key1:value1,key3:value3", + false + ))); + + assertEquals(2, launches.size()); + + launches = launchRepository.findByFilter( + buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, "key3:value3", + false + ))); + + assertEquals(1, launches.size()); + assertEquals(1L, launches.get(0).getId()); + } + + @Test + void compositeAttributeAnyNegative() { + List launches = launchRepository.findByFilter( + buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, + "key1:value1,key2:value2,key3:value3", + true + ))); + + assertEquals(0, launches.size()); + + launches = launchRepository.findByFilter(buildFilterWithConditions( + buildCompositeAttributeCondition(Condition.ANY, "key1:value1,key3:value3", + true + ))); + + assertEquals(0, launches.size()); + + launches = launchRepository.findByFilter( + buildFilterWithConditions(buildCompositeAttributeCondition(Condition.ANY, "key3:value3", + true + ))); + + assertEquals(1, launches.size()); + assertEquals(2L, launches.get(0).getId()); + } + + private FilterCondition buildCompositeAttributeCondition(Condition condition, String value, + boolean negative) { + return FilterCondition.builder() + .withCondition(condition) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue(value) + .withNegative(negative) + .build(); + } + + private Filter buildFilterWithConditions(FilterCondition... conditions) { + final Filter.FilterBuilder builder = Filter.builder().withTarget(Launch.class); + Arrays.stream(conditions).forEach(builder::withCondition); + return builder.build(); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java index 780c89e2e..e4e71dd00 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java @@ -16,8 +16,28 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_DESCRIPTION; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_LAST_MODIFIED; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_PROJECT_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_ITEM_ATTRIBUTE_KEY; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_ITEM_ATTRIBUTE_VALUE; +import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; +import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_UUID; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_USER; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; -import com.epam.ta.reportportal.commons.querygen.*; +import com.epam.ta.reportportal.commons.querygen.CompositeFilter; +import com.epam.ta.reportportal.commons.querygen.Condition; +import com.epam.ta.reportportal.commons.querygen.ConvertibleCondition; +import com.epam.ta.reportportal.commons.querygen.Filter; +import com.epam.ta.reportportal.commons.querygen.FilterCondition; import com.epam.ta.reportportal.entity.enums.LaunchModeEnum; import com.epam.ta.reportportal.entity.enums.StatusEnum; import com.epam.ta.reportportal.entity.launch.Launch; @@ -27,6 +47,15 @@ import com.epam.ta.reportportal.ws.model.analyzer.IndexLaunch; import com.epam.ta.reportportal.ws.model.launch.Mode; import com.google.common.collect.Comparators; +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.apache.commons.collections4.CollectionUtils; import org.assertj.core.util.Lists; import org.hamcrest.Matchers; @@ -38,393 +67,397 @@ import org.springframework.data.domain.Sort; import org.springframework.test.context.jdbc.Sql; -import java.time.Duration; -import java.time.LocalDateTime; -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; -import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_UUID; -import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_USER; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ivan Budaev */ @Sql("/db/fill/launch/launch-fill.sql") class LaunchRepositoryTest extends BaseTest { - @Autowired - private LaunchRepository launchRepository; - - @Test - void deleteByProjectId() { - final Long projectId = 1L; - launchRepository.deleteByProjectId(projectId); - final List launches = launchRepository.findAll(); - launches.forEach(it -> assertNotEquals(projectId, it.getProjectId())); - } - - @Test - void findAllByName() { - final String launchName = "launch name 1"; - final List launches = launchRepository.findAllByName(launchName); - assertNotNull(launches); - assertTrue(!launches.isEmpty()); - launches.forEach(it -> assertEquals(launchName, it.getName())); - } - - @Test - void findByUuid() { - final String uuid = "uuid 11"; - final Optional launch = launchRepository.findByUuid(uuid); - assertNotNull(launch); - assertTrue(launch.isPresent()); - assertEquals(uuid, launch.get().getUuid()); - } - - @Test - void findLaunchIdsByProjectId() { - final List ids = launchRepository.findLaunchIdsByProjectId(1L); - assertNotNull(ids); - assertEquals(12, ids.size()); - assertThat(ids.get(0), Matchers.instanceOf(Long.class)); - } - - @Test - void findIdsByProjectIdAndStartTimeBeforeLimit() { - List ids = launchRepository.findIdsByProjectIdAndStartTimeBefore(1L, - LocalDateTime.now().minusSeconds(Duration.ofDays(13).getSeconds()), - 5 - ); - assertEquals(5, ids.size()); - } - - @Test - void findIdsByProjectIdAndStartTimeBeforeLimitWithOffset() { - List ids = launchRepository.findIdsByProjectIdAndStartTimeBefore(1L, - LocalDateTime.now().minusSeconds(Duration.ofDays(13).getSeconds()), - 3, - 10L - ); - assertEquals(2, ids.size()); - } - - @Test - void deleteAllByIds() { - int removedCount = launchRepository.deleteAllByIdIn(Arrays.asList(1L, 2L, 3L)); - assertEquals(3, removedCount); - } - - @Test - void streamLaunchIdsWithStatusTest() { - - Stream stream = launchRepository.streamIdsWithStatusAndStartTimeBefore(1L, - StatusEnum.IN_PROGRESS, - LocalDateTime.now().minusSeconds(Duration.ofDays(13).getSeconds()) - ); - - assertNotNull(stream); - List ids = stream.collect(Collectors.toList()); - assertTrue(CollectionUtils.isNotEmpty(ids)); - assertEquals(12L, ids.size()); - } - - @Test - void streamLaunchIdsTest() { - - Stream stream = launchRepository.streamIdsByStartTimeBefore(1L, - LocalDateTime.now().minusSeconds(Duration.ofDays(13).getSeconds()) - ); - - assertNotNull(stream); - List ids = stream.collect(Collectors.toList()); - assertTrue(CollectionUtils.isNotEmpty(ids)); - assertEquals(12L, ids.size()); - } - - @Test - void findByProjectIdAndStartTimeGreaterThanAndMode() { - List launches = launchRepository.findByProjectIdAndStartTimeGreaterThanAndMode(1L, - LocalDateTime.now().minusMonths(1), - LaunchModeEnum.DEFAULT - ); - assertEquals(12, launches.size()); - } - - @Test - void loadLaunchesHistory() { - final String launchName = "launch name 1"; - final long projectId = 1L; - final long startingLaunchId = 2L; - final int historyDepth = 2; - - List launches = launchRepository.findLaunchesHistory(historyDepth, startingLaunchId, launchName, projectId); - assertNotNull(launches); - assertEquals(historyDepth, launches.size()); - launches.forEach(it -> { - assertThat(it.getName(), Matchers.equalToIgnoringCase(launchName)); - assertEquals(projectId, (long) it.getProjectId()); - assertTrue(it.getId() <= startingLaunchId); - }); - } - - @Test - void findAllLatestLaunchesTest() { - Page allLatestByFilter = launchRepository.findAllLatestByFilter(buildDefaultFilter(1L), - PageRequest.of(0, 2, Sort.by(Sort.Direction.ASC, "number")) - ); - assertNotNull(allLatestByFilter); - assertEquals(2, allLatestByFilter.getNumberOfElements()); - } - - @Test - void getLaunchNamesTest() { - final String value = "launch"; - List launchNames = launchRepository.getLaunchNamesByModeExcludedByStatus(1L, - value, - LaunchModeEnum.DEFAULT, - StatusEnum.CANCELLED - ); - - assertNotNull(launchNames); - assertTrue(CollectionUtils.isNotEmpty(launchNames)); - launchNames.forEach(it -> assertTrue(it.contains(value))); - } - - @Test - void findLaunchByFilterTest() { - Sort sort = Sort.by(Sort.Direction.ASC, CRITERIA_LAST_MODIFIED); - Page launches = launchRepository.findByFilter(new CompositeFilter(Operator.AND, - buildDefaultFilter(1L), - buildDefaultFilter2() - ), PageRequest.of(0, 2, sort)); - assertNotNull(launches); - assertEquals(1, launches.getTotalElements()); - } - - @Test - void getOwnerNames() { - final List ownerNames = launchRepository.getOwnerNames(1L, "sup", Mode.DEFAULT.name()); - assertNotNull(ownerNames); - assertEquals(1, ownerNames.size()); - assertTrue(ownerNames.contains("superadmin")); - } - - @Test - void findLastRun() { - final Optional lastRun = launchRepository.findLastRun(2L, Mode.DEFAULT.name()); - assertTrue(lastRun.isPresent()); - } - - @Test - void countLaunches() { - final Integer count = launchRepository.countLaunches(2L, Mode.DEFAULT.name(), LocalDateTime.now().minusDays(5)); - assertNotNull(count); - assertEquals(3, (int) count); - } - - @Test - void countLaunchesGroupedByOwner() { - final Map map = launchRepository.countLaunchesGroupedByOwner(2L, - Mode.DEFAULT.name(), - LocalDateTime.now().minusDays(5) - ); - assertNotNull(map.get("default")); - assertEquals(3, (int) map.get("default")); - } - - @Test - void findIndexLaunchByProjectId() { - final List result = launchRepository.findIdsByProjectIdAndModeAndStatusNotEq(2L, - JLaunchModeEnum.DEFAULT, - JStatusEnum.PASSED, - 1 - ); - assertEquals(1, result.size()); - - final List secondResult = launchRepository.findIdsByProjectIdAndModeAndStatusNotEq(2L, - JLaunchModeEnum.DEFAULT, - JStatusEnum.PASSED, - 2 - ); - assertEquals(2, secondResult.size()); - } - - @Test - void findIndexLaunchByProjectIdAfterId() { - final List result = launchRepository.findIdsByProjectIdAndModeAndStatusNotEqAfterId(2L, - JLaunchModeEnum.DEFAULT, - JStatusEnum.PASSED, - 1L, - 3 - ); - assertEquals(3, result.size()); - - final List secondResult = launchRepository.findIdsByProjectIdAndModeAndStatusNotEqAfterId(2L, - JLaunchModeEnum.DEFAULT, - JStatusEnum.PASSED, - 100L, - 2 - ); - assertEquals(2, secondResult.size()); - - final List thirdResult = launchRepository.findIdsByProjectIdAndModeAndStatusNotEqAfterId(2L, - JLaunchModeEnum.DEFAULT, - JStatusEnum.PASSED, - 200L, - 2 - ); - assertEquals(1, thirdResult.size()); - } - - @Test - void hasItemsWithLogsWithLogLevel() { - assertTrue(launchRepository.hasItemsWithLogsWithLogLevel(100L, List.of(JTestItemTypeEnum.STEP, JTestItemTypeEnum.TEST), 0)); - assertTrue(launchRepository.hasItemsWithLogsWithLogLevel(200L, List.of(JTestItemTypeEnum.STEP, JTestItemTypeEnum.TEST), 0)); - assertFalse(launchRepository.hasItemsWithLogsWithLogLevel(300L, List.of(JTestItemTypeEnum.STEP, JTestItemTypeEnum.TEST), 0)); - } - - @Test - void findIndexLaunchByIds() { - final List result = launchRepository.findIndexLaunchByIds(List.of(100L, 200L, 300L)); - assertEquals(3, result.size()); - } - - @Test - void hasItemsInStatuses() { - final boolean hasItemsInStatuses = launchRepository.hasItemsInStatuses(100L, - Lists.newArrayList(JStatusEnum.FAILED, JStatusEnum.SKIPPED) - ); - assertTrue(hasItemsInStatuses); - } - - @Test - void hasItemsWithStatusNotEqual() { - final boolean hasItemsWithStatusNotEqual = launchRepository.hasRootItemsWithStatusNotEqual(100L, StatusEnum.PASSED.name()); - assertTrue(hasItemsWithStatusNotEqual); - assertFalse(launchRepository.hasRootItemsWithStatusNotEqual(100L, StatusEnum.PASSED.name(), StatusEnum.FAILED.name())); - } - - @Test - void hasItemsWithStatusEqual() { - boolean hasItemsWithStatusEqual = launchRepository.hasItemsWithStatusEqual(100L, StatusEnum.IN_PROGRESS); - assertFalse(hasItemsWithStatusEqual); - - hasItemsWithStatusEqual = launchRepository.hasItemsWithStatusEqual(200L, StatusEnum.IN_PROGRESS); - assertTrue(hasItemsWithStatusEqual); - } - - @Test - void hasItems() { - boolean hasItems = launchRepository.hasItems(300L); - assertFalse(hasItems); - - hasItems = launchRepository.hasItems(200L); - assertTrue(hasItems); - } - - @Test - void hasRetries() { - final boolean hasRetries = launchRepository.hasRetries(100L); - assertTrue(hasRetries); - - } - - @Test - void hasRetriesNegative() { - - final Long firstLaunchId = 1L; - - final boolean hasRetries = launchRepository.hasRetries(firstLaunchId); - assertFalse(hasRetries); - - } - - @Test - void sortingByJoinedColumnTest() { - PageRequest pageRequest = PageRequest.of(0, 10, Sort.by(Sort.Direction.ASC, CRITERIA_USER)); - Page launchesPage = launchRepository.findByFilter(Filter.builder() - .withTarget(Launch.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.LOWER_THAN) - .withSearchCriteria(CRITERIA_ID) - .withValue("100") - .build()) - .build(), pageRequest); - - assertTrue(Comparators.isInOrder(launchesPage.getContent(), Comparator.comparing(Launch::getUserId))); - } - - @Test - void sortingByJoinedColumnLatestTest() { - PageRequest pageRequest = PageRequest.of(0, 10, Sort.by(Sort.Direction.ASC, "statistics$defects$product_bug$pb001")); - Page launchesPage = launchRepository.findAllLatestByFilter(Filter.builder() - .withTarget(Launch.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.LOWER_THAN) - .withSearchCriteria(CRITERIA_ID) - .withValue("100") - .build()) - .build(), pageRequest); - - assertTrue(Comparators.isInOrder(launchesPage.getContent(), Comparator.comparing(Launch::getUserId))); - } - - @Test - void testNegativeContainConditionNullDescription() { - List launch = launchRepository.findByFilter(Filter.builder() - .withTarget(Launch.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.CONTAINS) - .withNegative(true) - .withSearchCriteria(CRITERIA_DESCRIPTION) - .withValue("description") - .build()) - .build()); - assertThat(launch, Matchers.hasSize(3)); - assertThat(launch.get(0).getDescription(), Matchers.nullValue()); - } - - @Test - void shouldNotFindLaunchesWithSystemAttributes() { - List launches = launchRepository.findByFilter(Filter.builder() - .withTarget(Launch.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.HAS) - .withSearchCriteria(CRITERIA_ITEM_ATTRIBUTE_KEY) - .withValue("systemKey") - .build()) - .build()); - - assertTrue(launches.isEmpty()); - - launches = launchRepository.findByFilter(Filter.builder() - .withTarget(Launch.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.HAS) - .withSearchCriteria(CRITERIA_ITEM_ATTRIBUTE_VALUE) - .withValue("systemValue") - .build()) - .build()); - - assertTrue(launches.isEmpty()); - } - - private Filter buildDefaultFilter(Long projectId) { - List conditionList = Lists.newArrayList(new FilterCondition(Condition.EQUALS, - false, - String.valueOf(projectId), - CRITERIA_PROJECT_ID - ), new FilterCondition(Condition.EQUALS, false, Mode.DEFAULT.toString(), CRITERIA_LAUNCH_MODE)); - return new Filter(Launch.class, conditionList); - } - - private Filter buildDefaultFilter2() { - return new Filter(Launch.class, Lists.newArrayList(new FilterCondition(Condition.EQUALS, false, "uuid 11", CRITERIA_LAUNCH_UUID))); - } + @Autowired + private LaunchRepository launchRepository; + + @Test + void deleteByProjectId() { + final Long projectId = 1L; + launchRepository.deleteByProjectId(projectId); + final List launches = launchRepository.findAll(); + launches.forEach(it -> assertNotEquals(projectId, it.getProjectId())); + } + + @Test + void findAllByName() { + final String launchName = "launch name 1"; + final List launches = launchRepository.findAllByName(launchName); + assertNotNull(launches); + assertTrue(!launches.isEmpty()); + launches.forEach(it -> assertEquals(launchName, it.getName())); + } + + @Test + void findByUuid() { + final String uuid = "uuid 11"; + final Optional launch = launchRepository.findByUuid(uuid); + assertNotNull(launch); + assertTrue(launch.isPresent()); + assertEquals(uuid, launch.get().getUuid()); + } + + @Test + void findLaunchIdsByProjectId() { + final List ids = launchRepository.findLaunchIdsByProjectId(1L); + assertNotNull(ids); + assertEquals(12, ids.size()); + assertThat(ids.get(0), Matchers.instanceOf(Long.class)); + } + + @Test + void findIdsByProjectIdAndStartTimeBeforeLimit() { + List ids = launchRepository.findIdsByProjectIdAndStartTimeBefore(1L, + LocalDateTime.now().minusSeconds(Duration.ofDays(13).getSeconds()), + 5 + ); + assertEquals(5, ids.size()); + } + + @Test + void findIdsByProjectIdAndStartTimeBeforeLimitWithOffset() { + List ids = launchRepository.findIdsByProjectIdAndStartTimeBefore(1L, + LocalDateTime.now().minusSeconds(Duration.ofDays(13).getSeconds()), + 3, + 10L + ); + assertEquals(2, ids.size()); + } + + @Test + void deleteAllByIds() { + int removedCount = launchRepository.deleteAllByIdIn(Arrays.asList(1L, 2L, 3L)); + assertEquals(3, removedCount); + } + + @Test + void streamLaunchIdsWithStatusTest() { + + Stream stream = launchRepository.streamIdsWithStatusAndStartTimeBefore(1L, + StatusEnum.IN_PROGRESS, + LocalDateTime.now().minusSeconds(Duration.ofDays(13).getSeconds()) + ); + + assertNotNull(stream); + List ids = stream.collect(Collectors.toList()); + assertTrue(CollectionUtils.isNotEmpty(ids)); + assertEquals(12L, ids.size()); + } + + @Test + void streamLaunchIdsTest() { + + Stream stream = launchRepository.streamIdsByStartTimeBefore(1L, + LocalDateTime.now().minusSeconds(Duration.ofDays(13).getSeconds()) + ); + + assertNotNull(stream); + List ids = stream.collect(Collectors.toList()); + assertTrue(CollectionUtils.isNotEmpty(ids)); + assertEquals(12L, ids.size()); + } + + @Test + void findByProjectIdAndStartTimeGreaterThanAndMode() { + List launches = launchRepository.findByProjectIdAndStartTimeGreaterThanAndMode(1L, + LocalDateTime.now().minusMonths(1), + LaunchModeEnum.DEFAULT + ); + assertEquals(12, launches.size()); + } + + @Test + void loadLaunchesHistory() { + final String launchName = "launch name 1"; + final long projectId = 1L; + final long startingLaunchId = 2L; + final int historyDepth = 2; + + List launches = launchRepository.findLaunchesHistory(historyDepth, startingLaunchId, + launchName, projectId); + assertNotNull(launches); + assertEquals(historyDepth, launches.size()); + launches.forEach(it -> { + assertThat(it.getName(), Matchers.equalToIgnoringCase(launchName)); + assertEquals(projectId, (long) it.getProjectId()); + assertTrue(it.getId() <= startingLaunchId); + }); + } + + @Test + void findAllLatestLaunchesTest() { + Page allLatestByFilter = launchRepository.findAllLatestByFilter(buildDefaultFilter(1L), + PageRequest.of(0, 2, Sort.by(Sort.Direction.ASC, "number")) + ); + assertNotNull(allLatestByFilter); + assertEquals(2, allLatestByFilter.getNumberOfElements()); + } + + @Test + void getLaunchNamesTest() { + final String value = "launch"; + List launchNames = launchRepository.getLaunchNamesByModeExcludedByStatus(1L, + value, + LaunchModeEnum.DEFAULT, + StatusEnum.CANCELLED + ); + + assertNotNull(launchNames); + assertTrue(CollectionUtils.isNotEmpty(launchNames)); + launchNames.forEach(it -> assertTrue(it.contains(value))); + } + + @Test + void findLaunchByFilterTest() { + Sort sort = Sort.by(Sort.Direction.ASC, CRITERIA_LAST_MODIFIED); + Page launches = launchRepository.findByFilter(new CompositeFilter(Operator.AND, + buildDefaultFilter(1L), + buildDefaultFilter2() + ), PageRequest.of(0, 2, sort)); + assertNotNull(launches); + assertEquals(1, launches.getTotalElements()); + } + + @Test + void getOwnerNames() { + final List ownerNames = launchRepository.getOwnerNames(1L, "sup", Mode.DEFAULT.name()); + assertNotNull(ownerNames); + assertEquals(1, ownerNames.size()); + assertTrue(ownerNames.contains("superadmin")); + } + + @Test + void findLastRun() { + final Optional lastRun = launchRepository.findLastRun(2L, Mode.DEFAULT.name()); + assertTrue(lastRun.isPresent()); + } + + @Test + void countLaunches() { + final Integer count = launchRepository.countLaunches(2L, Mode.DEFAULT.name(), + LocalDateTime.now().minusDays(5)); + assertNotNull(count); + assertEquals(3, (int) count); + } + + @Test + void countLaunchesGroupedByOwner() { + final Map map = launchRepository.countLaunchesGroupedByOwner(2L, + Mode.DEFAULT.name(), + LocalDateTime.now().minusDays(5) + ); + assertNotNull(map.get("default")); + assertEquals(3, (int) map.get("default")); + } + + @Test + void findIndexLaunchByProjectId() { + final List result = launchRepository.findIdsByProjectIdAndModeAndStatusNotEq(2L, + JLaunchModeEnum.DEFAULT, + JStatusEnum.PASSED, + 1 + ); + assertEquals(1, result.size()); + + final List secondResult = launchRepository.findIdsByProjectIdAndModeAndStatusNotEq(2L, + JLaunchModeEnum.DEFAULT, + JStatusEnum.PASSED, + 2 + ); + assertEquals(2, secondResult.size()); + } + + @Test + void findIndexLaunchByProjectIdAfterId() { + final List result = launchRepository.findIdsByProjectIdAndModeAndStatusNotEqAfterId(2L, + JLaunchModeEnum.DEFAULT, + JStatusEnum.PASSED, + 1L, + 3 + ); + assertEquals(3, result.size()); + + final List secondResult = launchRepository.findIdsByProjectIdAndModeAndStatusNotEqAfterId( + 2L, + JLaunchModeEnum.DEFAULT, + JStatusEnum.PASSED, + 100L, + 2 + ); + assertEquals(2, secondResult.size()); + + final List thirdResult = launchRepository.findIdsByProjectIdAndModeAndStatusNotEqAfterId( + 2L, + JLaunchModeEnum.DEFAULT, + JStatusEnum.PASSED, + 200L, + 2 + ); + assertEquals(1, thirdResult.size()); + } + + @Test + void hasItemsWithLogsWithLogLevel() { + assertTrue(launchRepository.hasItemsWithLogsWithLogLevel(100L, + List.of(JTestItemTypeEnum.STEP, JTestItemTypeEnum.TEST), 0)); + assertTrue(launchRepository.hasItemsWithLogsWithLogLevel(200L, + List.of(JTestItemTypeEnum.STEP, JTestItemTypeEnum.TEST), 0)); + assertFalse(launchRepository.hasItemsWithLogsWithLogLevel(300L, + List.of(JTestItemTypeEnum.STEP, JTestItemTypeEnum.TEST), 0)); + } + + @Test + void findIndexLaunchByIds() { + final List result = launchRepository.findIndexLaunchByIds( + List.of(100L, 200L, 300L)); + assertEquals(3, result.size()); + } + + @Test + void hasItemsInStatuses() { + final boolean hasItemsInStatuses = launchRepository.hasItemsInStatuses(100L, + Lists.newArrayList(JStatusEnum.FAILED, JStatusEnum.SKIPPED) + ); + assertTrue(hasItemsInStatuses); + } + + @Test + void hasItemsWithStatusNotEqual() { + final boolean hasItemsWithStatusNotEqual = launchRepository.hasRootItemsWithStatusNotEqual(100L, + StatusEnum.PASSED.name()); + assertTrue(hasItemsWithStatusNotEqual); + assertFalse(launchRepository.hasRootItemsWithStatusNotEqual(100L, StatusEnum.PASSED.name(), + StatusEnum.FAILED.name())); + } + + @Test + void hasItemsWithStatusEqual() { + boolean hasItemsWithStatusEqual = launchRepository.hasItemsWithStatusEqual(100L, + StatusEnum.IN_PROGRESS); + assertFalse(hasItemsWithStatusEqual); + + hasItemsWithStatusEqual = launchRepository.hasItemsWithStatusEqual(200L, + StatusEnum.IN_PROGRESS); + assertTrue(hasItemsWithStatusEqual); + } + + @Test + void hasItems() { + boolean hasItems = launchRepository.hasItems(300L); + assertFalse(hasItems); + + hasItems = launchRepository.hasItems(200L); + assertTrue(hasItems); + } + + @Test + void hasRetries() { + final boolean hasRetries = launchRepository.hasRetries(100L); + assertTrue(hasRetries); + + } + + @Test + void hasRetriesNegative() { + + final Long firstLaunchId = 1L; + + final boolean hasRetries = launchRepository.hasRetries(firstLaunchId); + assertFalse(hasRetries); + + } + + @Test + void sortingByJoinedColumnTest() { + PageRequest pageRequest = PageRequest.of(0, 10, Sort.by(Sort.Direction.ASC, CRITERIA_USER)); + Page launchesPage = launchRepository.findByFilter(Filter.builder() + .withTarget(Launch.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.LOWER_THAN) + .withSearchCriteria(CRITERIA_ID) + .withValue("100") + .build()) + .build(), pageRequest); + + assertTrue( + Comparators.isInOrder(launchesPage.getContent(), Comparator.comparing(Launch::getUserId))); + } + + @Test + void sortingByJoinedColumnLatestTest() { + PageRequest pageRequest = PageRequest.of(0, 10, + Sort.by(Sort.Direction.ASC, "statistics$defects$product_bug$pb001")); + Page launchesPage = launchRepository.findAllLatestByFilter(Filter.builder() + .withTarget(Launch.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.LOWER_THAN) + .withSearchCriteria(CRITERIA_ID) + .withValue("100") + .build()) + .build(), pageRequest); + + assertTrue( + Comparators.isInOrder(launchesPage.getContent(), Comparator.comparing(Launch::getUserId))); + } + + @Test + void testNegativeContainConditionNullDescription() { + List launch = launchRepository.findByFilter(Filter.builder() + .withTarget(Launch.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.CONTAINS) + .withNegative(true) + .withSearchCriteria(CRITERIA_DESCRIPTION) + .withValue("description") + .build()) + .build()); + assertThat(launch, Matchers.hasSize(3)); + assertThat(launch.get(0).getDescription(), Matchers.nullValue()); + } + + @Test + void shouldNotFindLaunchesWithSystemAttributes() { + List launches = launchRepository.findByFilter(Filter.builder() + .withTarget(Launch.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.HAS) + .withSearchCriteria(CRITERIA_ITEM_ATTRIBUTE_KEY) + .withValue("systemKey") + .build()) + .build()); + + assertTrue(launches.isEmpty()); + + launches = launchRepository.findByFilter(Filter.builder() + .withTarget(Launch.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.HAS) + .withSearchCriteria(CRITERIA_ITEM_ATTRIBUTE_VALUE) + .withValue("systemValue") + .build()) + .build()); + + assertTrue(launches.isEmpty()); + } + + private Filter buildDefaultFilter(Long projectId) { + List conditionList = Lists.newArrayList( + new FilterCondition(Condition.EQUALS, + false, + String.valueOf(projectId), + CRITERIA_PROJECT_ID + ), new FilterCondition(Condition.EQUALS, false, Mode.DEFAULT.toString(), + CRITERIA_LAUNCH_MODE)); + return new Filter(Launch.class, conditionList); + } + + private Filter buildDefaultFilter2() { + return new Filter(Launch.class, Lists.newArrayList( + new FilterCondition(Condition.EQUALS, false, "uuid 11", CRITERIA_LAUNCH_UUID))); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/LogRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/LogRepositoryTest.java index f3522052d..a18f356e6 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/LogRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/LogRepositoryTest.java @@ -16,6 +16,19 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_ITEM_LAUNCH_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_BINARY_CONTENT; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_LAUNCH_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_TIME; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_TEST_ITEM_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_RETRY_PARENT_LAUNCH_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_STATUS; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.commons.querygen.CompositeFilterCondition; import com.epam.ta.reportportal.commons.querygen.Condition; @@ -28,6 +41,12 @@ import com.epam.ta.reportportal.entity.log.Log; import com.epam.ta.reportportal.ws.model.analyzer.IndexLog; import com.google.common.collect.Lists; +import java.time.Duration; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; import org.apache.commons.collections4.CollectionUtils; import org.jooq.Operator; import org.junit.jupiter.api.Assertions; @@ -38,402 +57,416 @@ import org.springframework.data.domain.Sort; import org.springframework.test.context.jdbc.Sql; -import java.time.Duration; -import java.util.*; - -import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_RETRY_PARENT_LAUNCH_ID; -import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_STATUS; -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ivan Budaev */ @Sql("/db/fill/item/items-fill.sql") class LogRepositoryTest extends BaseTest { - @Autowired - private TestItemRepository testItemRepository; - - @Autowired - private LogRepository logRepository; - - @Test - void updateLaunchIdByLaunchId() { - - final Filter firstLaunchFilter = Filter.builder() - .withTarget(Log.class) - .withCondition(FilterCondition.builder().eq(CRITERIA_LOG_LAUNCH_ID, String.valueOf(1L)).build()) - .build(); - - final Filter secondLaunchFilter = Filter.builder() - .withTarget(Log.class) - .withCondition(FilterCondition.builder().eq(CRITERIA_LOG_LAUNCH_ID, String.valueOf(2L)).build()) - .build(); + @Autowired + private TestItemRepository testItemRepository; - final List firstLaunchLogIds = logRepository.findIdsByFilter(firstLaunchFilter); - Assertions.assertFalse(firstLaunchLogIds.isEmpty()); - logRepository.updateLaunchIdByLaunchId(1L, 2L); + @Autowired + private LogRepository logRepository; - final List secondLaunchLogIds = logRepository.findIdsByFilter(secondLaunchFilter); + @Test + void updateLaunchIdByLaunchId() { - Assertions.assertFalse(secondLaunchLogIds.isEmpty()); - Assertions.assertTrue(secondLaunchLogIds.containsAll(firstLaunchLogIds)); + final Filter firstLaunchFilter = Filter.builder() + .withTarget(Log.class) + .withCondition( + FilterCondition.builder().eq(CRITERIA_LOG_LAUNCH_ID, String.valueOf(1L)).build()) + .build(); - Assertions.assertTrue(logRepository.findIdsByFilter(firstLaunchFilter).isEmpty()); - } + final Filter secondLaunchFilter = Filter.builder() + .withTarget(Log.class) + .withCondition( + FilterCondition.builder().eq(CRITERIA_LOG_LAUNCH_ID, String.valueOf(2L)).build()) + .build(); - @Test - void updateClusterIdByIds() { + final List firstLaunchLogIds = logRepository.findIdsByFilter(firstLaunchFilter); + Assertions.assertFalse(firstLaunchLogIds.isEmpty()); + logRepository.updateLaunchIdByLaunchId(1L, 2L); - final List logIds = List.of(1L, 2L, 3L); + final List secondLaunchLogIds = logRepository.findIdsByFilter(secondLaunchFilter); - final int updated = logRepository.updateClusterIdByIdIn(1L, logIds); + Assertions.assertFalse(secondLaunchLogIds.isEmpty()); + Assertions.assertTrue(secondLaunchLogIds.containsAll(firstLaunchLogIds)); - assertEquals(3, updated); + Assertions.assertTrue(logRepository.findIdsByFilter(firstLaunchFilter).isEmpty()); + } - final List logs = logRepository.findAllById(logIds); + @Test + void updateClusterIdByIds() { - logs.forEach(l -> assertEquals(1L, l.getClusterId())); - } + final List logIds = List.of(1L, 2L, 3L); - @Test - void updateClusterIdSetNullByLaunchId() { + final int updated = logRepository.updateClusterIdByIdIn(1L, logIds); - final List logIds = List.of(1L, 2L, 3L); + assertEquals(3, updated); - final int updated = logRepository.updateClusterIdByIdIn(1L, logIds); + final List logs = logRepository.findAllById(logIds); - assertEquals(3, updated); + logs.forEach(l -> assertEquals(1L, l.getClusterId())); + } - final int nullUpdated = logRepository.updateClusterIdSetNullByLaunchId(1L); + @Test + void updateClusterIdSetNullByLaunchId() { - assertEquals(6, nullUpdated); + final List logIds = List.of(1L, 2L, 3L); - final List logs = logRepository.findAllById(logIds); + final int updated = logRepository.updateClusterIdByIdIn(1L, logIds); - logs.forEach(l -> assertNull(l.getClusterId())); - } + assertEquals(3, updated); - @Test - void updateClusterIdSetNullByItemIds() { + final int nullUpdated = logRepository.updateClusterIdSetNullByLaunchId(1L); - final List logIds = List.of(1L, 2L, 3L); + assertEquals(6, nullUpdated); - final int updated = logRepository.updateClusterIdByIdIn(1L, logIds); + final List logs = logRepository.findAllById(logIds); - assertEquals(3, updated); + logs.forEach(l -> assertNull(l.getClusterId())); + } - final List itemIds = List.of(3L, 4L, 5L); - final int nullUpdated = logRepository.updateClusterIdSetNullByItemIds(itemIds); + @Test + void updateClusterIdSetNullByItemIds() { - assertEquals(6, nullUpdated); + final List logIds = List.of(1L, 2L, 3L); - final List logs = logRepository.findAllById(logIds); + final int updated = logRepository.updateClusterIdByIdIn(1L, logIds); - logs.forEach(l -> assertNull(l.getClusterId())); - } + assertEquals(3, updated); - @Test - void getPageNumberTest() { - Filter filter = Filter.builder() - .withTarget(Log.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "3", CRITERIA_TEST_ITEM_ID)) - .build(); + final List itemIds = List.of(3L, 4L, 5L); + final int nullUpdated = logRepository.updateClusterIdSetNullByItemIds(itemIds); - Integer number = logRepository.getPageNumber(1L, filter, PageRequest.of(0, 10, Sort.by(Sort.Direction.ASC, CRITERIA_LOG_TIME))); - assertEquals(1L, (long) number, "Unexpected log page number"); - } + assertEquals(6, nullUpdated); - @Test - void hasLogsAddedLatelyTest() { - assertTrue(logRepository.hasLogsAddedLately(Duration.ofDays(13).plusHours(23), 1L, StatusEnum.FAILED)); - } + final List logs = logRepository.findAllById(logIds); - @Test - void deleteByPeriodAndTestItemIdsTest() { - int removedLogsCount = logRepository.deleteByPeriodAndTestItemIds(Duration.ofDays(13).plusHours(20), Collections.singleton(3L)); - assertEquals(3, removedLogsCount, "Incorrect count of deleted logs"); - } + logs.forEach(l -> assertNull(l.getClusterId())); + } - @Test - void deleteByPeriodAndLaunchIdsTest() { - int removedLogsCount = logRepository.deleteByPeriodAndLaunchIds(Duration.ofDays(13).plusHours(20), Collections.singleton(3L)); - assertEquals(1, removedLogsCount, "Incorrect count of deleted logs"); - } + @Test + void getPageNumberTest() { + Filter filter = Filter.builder() + .withTarget(Log.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "3", CRITERIA_TEST_ITEM_ID)) + .build(); - @Test - void hasLogsTest() { - assertTrue(logRepository.hasLogs(3L)); - assertFalse(logRepository.hasLogs(100L)); - } + Integer number = logRepository.getPageNumber(1L, filter, + PageRequest.of(0, 10, Sort.by(Sort.Direction.ASC, CRITERIA_LOG_TIME))); + assertEquals(1L, (long) number, "Unexpected log page number"); + } - @Test - void findByTestItemIdWithLimitTest() { - final long itemId = 3L; + @Test + void hasLogsAddedLatelyTest() { + assertTrue( + logRepository.hasLogsAddedLately(Duration.ofDays(13).plusHours(23), 1L, StatusEnum.FAILED)); + } - final List logs = logRepository.findByTestItemId(itemId, 2); + @Test + void deleteByPeriodAndTestItemIdsTest() { + int removedLogsCount = logRepository.deleteByPeriodAndTestItemIds( + Duration.ofDays(13).plusHours(20), Collections.singleton(3L)); + assertEquals(3, removedLogsCount, "Incorrect count of deleted logs"); + } - assertNotNull(logs, "Logs should not be null"); - assertEquals(2, logs.size(), "Unexpected logs count"); - logs.forEach(it -> assertEquals(itemId, (long) it.getTestItem().getItemId(), "Log has incorrect item id")); - } + @Test + void deleteByPeriodAndLaunchIdsTest() { + int removedLogsCount = logRepository.deleteByPeriodAndLaunchIds( + Duration.ofDays(13).plusHours(20), Collections.singleton(3L)); + assertEquals(1, removedLogsCount, "Incorrect count of deleted logs"); + } - @Test - void findByTestItemId() { - final Long itemId = 3L; + @Test + void hasLogsTest() { + assertTrue(logRepository.hasLogs(3L)); + assertFalse(logRepository.hasLogs(100L)); + } - final List logs = logRepository.findByTestItemId(itemId); + @Test + void findByTestItemIdWithLimitTest() { + final long itemId = 3L; - assertNotNull(logs, "Logs should not be null"); - assertTrue(!logs.isEmpty(), "Logs should not be empty"); - logs.forEach(it -> assertEquals(itemId, it.getTestItem().getItemId(), "Log has incorrect item id")); - } + final List logs = logRepository.findByTestItemId(itemId, 2); - @Test - void findIdsByTestItemId() { - final long itemId = 3L; + assertNotNull(logs, "Logs should not be null"); + assertEquals(2, logs.size(), "Unexpected logs count"); + logs.forEach(it -> assertEquals(itemId, (long) it.getTestItem().getItemId(), + "Log has incorrect item id")); + } - final List logIds = logRepository.findIdsByTestItemId(itemId); - - assertNotNull(logIds, "Log ids should not be null"); - assertTrue(!logIds.isEmpty(), "Log ids should not be empty"); - assertEquals(7, logIds.size()); - } - - @Test - void findItemLogIdsByLaunchId() { - List logIdsByLaunch = logRepository.findItemLogIdsByLaunchIdAndLogLevelGte(1L, LogLevel.DEBUG.toInt()); - assertEquals(7, logIdsByLaunch.size()); - } - - @Test - void findItemLogIdsByLaunchIds() { - List logIds = logRepository.findItemLogIdsByLaunchIdsAndLogLevelGte(Arrays.asList(1L, 2L), LogLevel.DEBUG.toInt()); - assertEquals(7, logIds.size()); - } - - @Test - void findIdsByItemIds() { - List errorIds = logRepository.findIdsUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(1L, - Arrays.asList(1L, 2L, 3L), - LogLevel.DEBUG.toInt() - ); - List errorLogs = logRepository.findAllById(errorIds); - errorLogs.forEach(log -> assertEquals(40000, log.getLogLevel())); - assertEquals(7, errorIds.size()); - assertEquals(7, errorLogs.size()); - - List ids = logRepository.findIdsByTestItemIdsAndLogLevelGte(Arrays.asList(1L, 2L, 3L), LogLevel.FATAL.toInt()); - assertEquals(0, ids.size()); - } - - @Test - void findIdsByItemIdsAndLogLevelGte() { - List errorIds = logRepository.findIdsByTestItemIdsAndLogLevelGte(Arrays.asList(1L, 2L, 3L), LogLevel.DEBUG.toInt()); - List errorLogs = logRepository.findAllById(errorIds); - errorLogs.forEach(log -> assertEquals(40000, log.getLogLevel())); - assertEquals(7, errorIds.size()); - assertEquals(7, errorLogs.size()); - - List ids = logRepository.findIdsByTestItemIdsAndLogLevelGte(Arrays.asList(1L, 2L, 3L), LogLevel.FATAL.toInt()); - assertEquals(0, ids.size()); - } - - @Test - void findAllUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte() { - - int logLevel = LogLevel.WARN_INT; - - List itemIds = Arrays.asList(1L, 2L, 3L); - List logs = logRepository.findAllUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(1L, itemIds, logLevel); - - assertTrue(logs != null && logs.size() != 0, "Logs should be not null or empty"); - logs.forEach(log -> { - Long itemId = log.getTestItem().getItemId(); - assertNotNull(itemId); - assertTrue(itemIds.contains(itemId), "Incorrect item id"); - assertTrue(log.getLogLevel() >= logLevel, "Unexpected log level"); - }); - } - - @Test - void findAllIndexUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte() { - int logLevel = LogLevel.WARN_INT; - - final Set logsWithCluster = Set.of(4L, 5L, 6L); - - List itemIds = Arrays.asList(1L, 2L, 3L); - final Map> logMapping = logRepository.findAllIndexUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(1L, - itemIds, - logLevel - ); - - assertFalse(logMapping.isEmpty(), "Logs should be not empty"); - logMapping.forEach((itemId, logs) -> { - assertNotNull(itemId); - assertTrue(itemIds.contains(itemId), "Incorrect item id"); - logs.forEach(logIndex -> { - if (logsWithCluster.contains(logIndex.getLogId())) { - assertNotNull(logIndex.getClusterId()); - } - assertTrue(logIndex.getLogLevel() >= logLevel, "Unexpected log level"); - }); - }); - } - - @Test - void findLatestUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte() { - - int logLevel = LogLevel.WARN_INT; - - Long itemId = 1L; - List logs = logRepository.findLatestUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(1L, itemId, logLevel, 3); - - assertTrue(logs != null && logs.size() == 3, "Logs should be not null or empty"); - logs.forEach(log -> { - Long id = log.getTestItem().getItemId(); - assertNotNull(id); - assertEquals(itemId, id, "Incorrect item id"); - assertTrue(log.getLogLevel() >= logLevel, "Unexpected log level"); - }); - } - - @Test - void findAllUnderTestItemByLaunchIdAndTestItemIdsWithLimit() { - - List itemIds = Arrays.asList(1L, 2L, 3L); - List logs = logRepository.findAllUnderTestItemByLaunchIdAndTestItemIdsWithLimit(1L, itemIds, 4); - - assertTrue(logs != null && logs.size() != 0, "Logs should be not null or empty"); - assertEquals(4, logs.size()); - logs.forEach(log -> { - Long itemId = log.getTestItem().getItemId(); - assertNotNull(itemId); - assertNotNull(log.getAttachment()); - assertTrue(itemIds.contains(itemId), "Incorrect item id"); - }); - } - - @Test - void findNestedItemsTest() { - - Filter filter = Filter.builder() - .withTarget(Log.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "2", CRITERIA_TEST_ITEM_ID)) - .withCondition(new FilterCondition(Condition.IN, false, "FAILED, PASSED", CRITERIA_STATUS)) - .build(); - - logRepository.findNestedItems(2L, false, false, filter, PageRequest.of(2, 1)); - } - - @Test - void findIdsByFilter() { - - Filter failedStatusFilter = Filter.builder() - .withTarget(Log.class) - .withCondition(FilterCondition.builder().eq(CRITERIA_STATUS, "FAILED").build()) - .build(); - - List ids = logRepository.findIdsByFilter(failedStatusFilter); - - assertEquals(7, ids.size()); - } - - @Test - void findAllWithAttachment() { - Filter logWithAttachmentsFilter = Filter.builder() - .withTarget(Log.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.EXISTS) - .withSearchCriteria(CRITERIA_LOG_BINARY_CONTENT) - .withValue("1") - .build()) - .build(); - - Page logPage = logRepository.findByFilter(logWithAttachmentsFilter, PageRequest.of(0, 10)); - - List logs = logPage.getContent(); - assertFalse(logs.isEmpty()); - - logs.forEach(log -> { - Attachment attachment = log.getAttachment(); - assertNotNull(attachment); - assertNotNull(attachment.getId()); - assertNotNull(attachment.getFileId()); - assertNotNull(attachment.getContentType()); - assertNotNull(attachment.getThumbnailId()); - }); - - assertEquals(10, logs.size()); - } - - @Test - void findAllWithAttachmentOfRetries() { - - Filter logWithAttachmentsFilter = Filter.builder() - .withTarget(Log.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.EXISTS) - .withSearchCriteria(CRITERIA_LOG_BINARY_CONTENT) - .withValue("1") - .build()) - .withCondition(new CompositeFilterCondition(Lists.newArrayList(FilterCondition.builder() - .eq(CRITERIA_RETRY_PARENT_LAUNCH_ID, String.valueOf(1L)) - .build(), - FilterCondition.builder().eq(CRITERIA_ITEM_LAUNCH_ID, String.valueOf(1L)).withOperator(Operator.OR).build() - ))) - .build(); - - Page logPage = logRepository.findByFilter(logWithAttachmentsFilter, PageRequest.of(0, 10)); - - List logs = logPage.getContent(); - assertFalse(logs.isEmpty()); - - logs.forEach(log -> { - Attachment attachment = log.getAttachment(); - assertNotNull(attachment); - assertNotNull(attachment.getId()); - assertNotNull(attachment.getFileId()); - assertNotNull(attachment.getContentType()); - assertNotNull(attachment.getThumbnailId()); - }); - - assertEquals(7, logs.size()); - } - - @Sql("/db/fill/item/items-with-nested-steps.sql") - @Test - void findLogMessagesByItemIdAndLogLevelNestedTest() { - - TestItem testItem = testItemRepository.findById(132L).get(); - - List messagesByItemIdAndLevelGte = logRepository.findMessagesByLaunchIdAndItemIdAndPathAndLevelGte(testItem.getLaunchId(), - testItem.getItemId(), - testItem.getPath(), - LogLevel.ERROR.toInt() - ); - assertTrue(CollectionUtils.isNotEmpty(messagesByItemIdAndLevelGte)); - assertEquals(1, messagesByItemIdAndLevelGte.size()); - assertEquals("java.lang.NullPointerException: Oops\n" - + "\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" - + "\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n" - + "\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" - + "\tat java.base/java.lang.reflect.Method.invoke(Method.java:566)\n", messagesByItemIdAndLevelGte.get(0)); - } - - @Test - void findLogMessagesByItemIdAndLoLevelGteTest() { - - TestItem testItem = testItemRepository.findById(3L).get(); - - List messagesByItemIdAndLevelGte = logRepository.findMessagesByLaunchIdAndItemIdAndPathAndLevelGte(testItem.getLaunchId(), - testItem.getItemId(), - testItem.getPath(), - LogLevel.WARN.toInt() - ); - assertTrue(CollectionUtils.isNotEmpty(messagesByItemIdAndLevelGte)); - assertEquals(7, messagesByItemIdAndLevelGte.size()); - messagesByItemIdAndLevelGte.forEach(it -> assertEquals("log", it)); - } + @Test + void findByTestItemId() { + final Long itemId = 3L; + + final List logs = logRepository.findByTestItemId(itemId); + + assertNotNull(logs, "Logs should not be null"); + assertTrue(!logs.isEmpty(), "Logs should not be empty"); + logs.forEach( + it -> assertEquals(itemId, it.getTestItem().getItemId(), "Log has incorrect item id")); + } + + @Test + void findIdsByTestItemId() { + final long itemId = 3L; + + final List logIds = logRepository.findIdsByTestItemId(itemId); + + assertNotNull(logIds, "Log ids should not be null"); + assertTrue(!logIds.isEmpty(), "Log ids should not be empty"); + assertEquals(7, logIds.size()); + } + + @Test + void findItemLogIdsByLaunchId() { + List logIdsByLaunch = logRepository.findItemLogIdsByLaunchIdAndLogLevelGte(1L, + LogLevel.DEBUG.toInt()); + assertEquals(7, logIdsByLaunch.size()); + } + + @Test + void findItemLogIdsByLaunchIds() { + List logIds = logRepository.findItemLogIdsByLaunchIdsAndLogLevelGte(Arrays.asList(1L, 2L), + LogLevel.DEBUG.toInt()); + assertEquals(7, logIds.size()); + } + + @Test + void findIdsByItemIds() { + List errorIds = logRepository.findIdsUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte( + 1L, + Arrays.asList(1L, 2L, 3L), + LogLevel.DEBUG.toInt() + ); + List errorLogs = logRepository.findAllById(errorIds); + errorLogs.forEach(log -> assertEquals(40000, log.getLogLevel())); + assertEquals(7, errorIds.size()); + assertEquals(7, errorLogs.size()); + + List ids = logRepository.findIdsByTestItemIdsAndLogLevelGte(Arrays.asList(1L, 2L, 3L), + LogLevel.FATAL.toInt()); + assertEquals(0, ids.size()); + } + + @Test + void findIdsByItemIdsAndLogLevelGte() { + List errorIds = logRepository.findIdsByTestItemIdsAndLogLevelGte( + Arrays.asList(1L, 2L, 3L), LogLevel.DEBUG.toInt()); + List errorLogs = logRepository.findAllById(errorIds); + errorLogs.forEach(log -> assertEquals(40000, log.getLogLevel())); + assertEquals(7, errorIds.size()); + assertEquals(7, errorLogs.size()); + + List ids = logRepository.findIdsByTestItemIdsAndLogLevelGte(Arrays.asList(1L, 2L, 3L), + LogLevel.FATAL.toInt()); + assertEquals(0, ids.size()); + } + + @Test + void findAllUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte() { + + int logLevel = LogLevel.WARN_INT; + + List itemIds = Arrays.asList(1L, 2L, 3L); + List logs = logRepository.findAllUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(1L, + itemIds, logLevel); + + assertTrue(logs != null && logs.size() != 0, "Logs should be not null or empty"); + logs.forEach(log -> { + Long itemId = log.getTestItem().getItemId(); + assertNotNull(itemId); + assertTrue(itemIds.contains(itemId), "Incorrect item id"); + assertTrue(log.getLogLevel() >= logLevel, "Unexpected log level"); + }); + } + + @Test + void findAllIndexUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte() { + int logLevel = LogLevel.WARN_INT; + + final Set logsWithCluster = Set.of(4L, 5L, 6L); + + List itemIds = Arrays.asList(1L, 2L, 3L); + final Map> logMapping = logRepository.findAllIndexUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte( + 1L, + itemIds, + logLevel + ); + + assertFalse(logMapping.isEmpty(), "Logs should be not empty"); + logMapping.forEach((itemId, logs) -> { + assertNotNull(itemId); + assertTrue(itemIds.contains(itemId), "Incorrect item id"); + logs.forEach(logIndex -> { + if (logsWithCluster.contains(logIndex.getLogId())) { + assertNotNull(logIndex.getClusterId()); + } + assertTrue(logIndex.getLogLevel() >= logLevel, "Unexpected log level"); + }); + }); + } + + @Test + void findLatestUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte() { + + int logLevel = LogLevel.WARN_INT; + + Long itemId = 1L; + List logs = logRepository.findLatestUnderTestItemByLaunchIdAndTestItemIdsAndLogLevelGte(1L, + itemId, logLevel, 3); + + assertTrue(logs != null && logs.size() == 3, "Logs should be not null or empty"); + logs.forEach(log -> { + Long id = log.getTestItem().getItemId(); + assertNotNull(id); + assertEquals(itemId, id, "Incorrect item id"); + assertTrue(log.getLogLevel() >= logLevel, "Unexpected log level"); + }); + } + + @Test + void findAllUnderTestItemByLaunchIdAndTestItemIdsWithLimit() { + + List itemIds = Arrays.asList(1L, 2L, 3L); + List logs = logRepository.findAllUnderTestItemByLaunchIdAndTestItemIdsWithLimit(1L, + itemIds, 4); + + assertTrue(logs != null && logs.size() != 0, "Logs should be not null or empty"); + assertEquals(4, logs.size()); + logs.forEach(log -> { + Long itemId = log.getTestItem().getItemId(); + assertNotNull(itemId); + assertNotNull(log.getAttachment()); + assertTrue(itemIds.contains(itemId), "Incorrect item id"); + }); + } + + @Test + void findNestedItemsTest() { + + Filter filter = Filter.builder() + .withTarget(Log.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "2", CRITERIA_TEST_ITEM_ID)) + .withCondition(new FilterCondition(Condition.IN, false, "FAILED, PASSED", CRITERIA_STATUS)) + .build(); + + logRepository.findNestedItems(2L, false, false, filter, PageRequest.of(2, 1)); + } + + @Test + void findIdsByFilter() { + + Filter failedStatusFilter = Filter.builder() + .withTarget(Log.class) + .withCondition(FilterCondition.builder().eq(CRITERIA_STATUS, "FAILED").build()) + .build(); + + List ids = logRepository.findIdsByFilter(failedStatusFilter); + + assertEquals(7, ids.size()); + } + + @Test + void findAllWithAttachment() { + Filter logWithAttachmentsFilter = Filter.builder() + .withTarget(Log.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.EXISTS) + .withSearchCriteria(CRITERIA_LOG_BINARY_CONTENT) + .withValue("1") + .build()) + .build(); + + Page logPage = logRepository.findByFilter(logWithAttachmentsFilter, PageRequest.of(0, 10)); + + List logs = logPage.getContent(); + assertFalse(logs.isEmpty()); + + logs.forEach(log -> { + Attachment attachment = log.getAttachment(); + assertNotNull(attachment); + assertNotNull(attachment.getId()); + assertNotNull(attachment.getFileId()); + assertNotNull(attachment.getContentType()); + assertNotNull(attachment.getThumbnailId()); + }); + + assertEquals(10, logs.size()); + } + + @Test + void findAllWithAttachmentOfRetries() { + + Filter logWithAttachmentsFilter = Filter.builder() + .withTarget(Log.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.EXISTS) + .withSearchCriteria(CRITERIA_LOG_BINARY_CONTENT) + .withValue("1") + .build()) + .withCondition(new CompositeFilterCondition(Lists.newArrayList(FilterCondition.builder() + .eq(CRITERIA_RETRY_PARENT_LAUNCH_ID, String.valueOf(1L)) + .build(), + FilterCondition.builder().eq(CRITERIA_ITEM_LAUNCH_ID, String.valueOf(1L)) + .withOperator(Operator.OR).build() + ))) + .build(); + + Page logPage = logRepository.findByFilter(logWithAttachmentsFilter, PageRequest.of(0, 10)); + + List logs = logPage.getContent(); + assertFalse(logs.isEmpty()); + + logs.forEach(log -> { + Attachment attachment = log.getAttachment(); + assertNotNull(attachment); + assertNotNull(attachment.getId()); + assertNotNull(attachment.getFileId()); + assertNotNull(attachment.getContentType()); + assertNotNull(attachment.getThumbnailId()); + }); + + assertEquals(7, logs.size()); + } + + @Sql("/db/fill/item/items-with-nested-steps.sql") + @Test + void findLogMessagesByItemIdAndLogLevelNestedTest() { + + TestItem testItem = testItemRepository.findById(132L).get(); + + List messagesByItemIdAndLevelGte = logRepository.findMessagesByLaunchIdAndItemIdAndPathAndLevelGte( + testItem.getLaunchId(), + testItem.getItemId(), + testItem.getPath(), + LogLevel.ERROR.toInt() + ); + assertTrue(CollectionUtils.isNotEmpty(messagesByItemIdAndLevelGte)); + assertEquals(1, messagesByItemIdAndLevelGte.size()); + assertEquals("java.lang.NullPointerException: Oops\n" + + "\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + + "\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n" + + "\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" + + "\tat java.base/java.lang.reflect.Method.invoke(Method.java:566)\n", + messagesByItemIdAndLevelGte.get(0)); + } + + @Test + void findLogMessagesByItemIdAndLoLevelGteTest() { + + TestItem testItem = testItemRepository.findById(3L).get(); + + List messagesByItemIdAndLevelGte = logRepository.findMessagesByLaunchIdAndItemIdAndPathAndLevelGte( + testItem.getLaunchId(), + testItem.getItemId(), + testItem.getPath(), + LogLevel.WARN.toInt() + ); + assertTrue(CollectionUtils.isNotEmpty(messagesByItemIdAndLevelGte)); + assertEquals(7, messagesByItemIdAndLevelGte.size()); + messagesByItemIdAndLevelGte.forEach(it -> assertEquals("log", it)); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryTest.java index 216da5716..854e81a64 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryTest.java @@ -16,64 +16,65 @@ package com.epam.ta.reportportal.dao; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.pattern.PatternTemplate; +import java.util.List; +import java.util.Optional; +import javax.persistence.PersistenceException; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.jdbc.Sql; -import javax.persistence.PersistenceException; -import java.util.List; -import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.assertThrows; - /** * @author Ivan Budayeu */ @Sql("/db/fill/pattern/pattern-fill.sql") class PatternTemplateRepositoryTest extends BaseTest { - @Autowired - private PatternTemplateRepository patternTemplateRepository; + @Autowired + private PatternTemplateRepository patternTemplateRepository; - @Test - void findByIdAndProjectId() { + @Test + void findByIdAndProjectId() { - Optional patternTemplate = patternTemplateRepository.findByIdAndProjectId(5L, 2L); + Optional patternTemplate = patternTemplateRepository.findByIdAndProjectId(5L, + 2L); - Assertions.assertTrue(patternTemplate.isPresent()); - } + Assertions.assertTrue(patternTemplate.isPresent()); + } - @Test - void findAllByProjectIdAndEnabled() { + @Test + void findAllByProjectIdAndEnabled() { - List allByProjectIdAndEnabled = patternTemplateRepository.findAllByProjectIdAndEnabled(1L, true); + List allByProjectIdAndEnabled = patternTemplateRepository.findAllByProjectIdAndEnabled( + 1L, true); - Assertions.assertNotNull(allByProjectIdAndEnabled); - Assertions.assertEquals(2, allByProjectIdAndEnabled.size()); - } + Assertions.assertNotNull(allByProjectIdAndEnabled); + Assertions.assertEquals(2, allByProjectIdAndEnabled.size()); + } - @Test - void existsByProjectIdAndNameIgnoreCasePositive() { + @Test + void existsByProjectIdAndNameIgnoreCasePositive() { - boolean exists = patternTemplateRepository.existsByProjectIdAndNameIgnoreCase(1L, "nAmE1"); + boolean exists = patternTemplateRepository.existsByProjectIdAndNameIgnoreCase(1L, "nAmE1"); - Assertions.assertTrue(exists); - } + Assertions.assertTrue(exists); + } - @Test - void existsByProjectIdAndNameIgnoreCaseNagative() { + @Test + void existsByProjectIdAndNameIgnoreCaseNagative() { - boolean exists = patternTemplateRepository.existsByProjectIdAndNameIgnoreCase(1L, "name1 "); + boolean exists = patternTemplateRepository.existsByProjectIdAndNameIgnoreCase(1L, "name1 "); - Assertions.assertFalse(exists); - } + Assertions.assertFalse(exists); + } - @Test - void validateWrongRegex() { + @Test + void validateWrongRegex() { - assertThrows(PersistenceException.class, () -> patternTemplateRepository.validateRegex("{1,}")); - } + assertThrows(PersistenceException.class, () -> patternTemplateRepository.validateRegex("{1,}")); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/dao/ProjectRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/ProjectRepositoryTest.java index 77c136087..574815abd 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/ProjectRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/ProjectRepositoryTest.java @@ -16,6 +16,15 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.commons.querygen.constant.ProjectCriteriaConstant.CRITERIA_PROJECT_NAME; +import static com.epam.ta.reportportal.entity.project.ProjectInfo.USERS_QUANTITY; +import static java.util.Optional.ofNullable; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.commons.querygen.Condition; import com.epam.ta.reportportal.commons.querygen.Filter; @@ -23,6 +32,9 @@ import com.epam.ta.reportportal.entity.enums.ProjectType; import com.epam.ta.reportportal.entity.project.Project; import com.epam.ta.reportportal.entity.project.ProjectInfo; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Optional; import org.apache.commons.collections4.CollectionUtils; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; @@ -31,135 +43,130 @@ import org.springframework.data.domain.PageRequest; import org.springframework.test.context.jdbc.Sql; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Optional; - -import static com.epam.ta.reportportal.commons.querygen.constant.ProjectCriteriaConstant.CRITERIA_PROJECT_NAME; -import static com.epam.ta.reportportal.entity.project.ProjectInfo.USERS_QUANTITY; -import static java.util.Optional.ofNullable; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ivan Budaev */ class ProjectRepositoryTest extends BaseTest { - @Autowired - private ProjectRepository projectRepository; - - @Test - void findAllIdsAndProjectAttributesTest() { - - Page projects = projectRepository.findAllIdsAndProjectAttributes(PageRequest.of(0, 2)); - - assertNotNull(projects); - assertTrue(CollectionUtils.isNotEmpty(projects.getContent())); - projects.getContent().forEach(project -> { - assertNotNull(project.getId()); - assertTrue(CollectionUtils.isNotEmpty(project.getProjectAttributes())); - assertEquals(15, project.getProjectAttributes().size()); - assertTrue(project.getProjectAttributes() - .stream() - .anyMatch(pa -> ofNullable(pa.getValue()).isPresent() && pa.getAttribute() - .getName() - .equals(ProjectAttributeEnum.KEEP_LOGS.getAttribute()))); - }); - } - - @Test - void findByName() { - final String projectName = "default_personal"; - - final Optional projectOptional = projectRepository.findByName(projectName); - - assertTrue(projectOptional.isPresent()); - assertEquals(projectName, projectOptional.get().getName()); - } - - @Test - void existsByName() { - assertTrue(projectRepository.existsByName("default_personal")); - assertTrue(projectRepository.existsByName("superadmin_personal")); - assertFalse(projectRepository.existsByName("not_existed")); - } - - @Test - void findAllProjectNames() { - List names = projectRepository.findAllProjectNames(); - assertThat("Incorrect projects size", names, Matchers.hasSize(2)); - assertThat("Results don't contain all project", names, Matchers.hasItems("default_personal", "superadmin_personal")); - } - - @Test - void findAllProjectNamesByTerm() { - List names = projectRepository.findAllProjectNamesByTerm("UpEr"); - assertThat("Incorrect projects size", names, Matchers.hasSize(1)); - assertThat("Results don't contain all project", names, Matchers.hasItems("superadmin_personal")); - } - - @Test - void findUserProjectsTest() { - List projects = projectRepository.findUserProjects("default"); - assertNotNull(projects); - assertEquals(1, projects.size()); - } - - @Test - void findAllByUserLogin() { - List projects = projectRepository.findAllByUserLogin("default"); - assertNotNull(projects); - assertEquals(1, projects.size()); - } - - @Test - void findUserProjectByLoginAndType() { - List userProjects = projectRepository.findUserProjects("superadmin", "PERSONAL"); - assertNotNull(userProjects); - assertEquals(1, userProjects.size()); - assertEquals(ProjectType.PERSONAL, userProjects.get(0).getProjectType()); - } - - @Test - void shouldFindProjectByName() { - final Optional project = projectRepository.findRawByName("superadmin_personal"); - assertTrue(project.isPresent()); - } - - @Test - void shouldNotFindProjectByName() { - final Optional project = projectRepository.findRawByName("some_random_name"); - assertFalse(project.isPresent()); - } - - @Test - void findProjectInfoByFilter() { - final List projectInfos = projectRepository.findProjectInfoByFilter(new Filter(ProjectInfo.class, - Condition.GREATER_THAN_OR_EQUALS, - false, - "1", - USERS_QUANTITY - )); - assertEquals(2, projectInfos.size()); - } - - @Test - void findProjectInfoByFilterWithPagination() { - final Page projectInfoPage = projectRepository.findProjectInfoByFilter(new Filter(ProjectInfo.class, - Condition.EQUALS, - false, - "default_personal", - CRITERIA_PROJECT_NAME - ), PageRequest.of(0, 10)); - assertEquals(1, projectInfoPage.getTotalElements()); - } - - @Sql("/db/fill/project/expired-project-fill.sql") - @Test - void deleteOneByTypeAndLastRunBefore() { - int count = projectRepository.deleteByTypeAndLastLaunchRunBefore(ProjectType.UPSA, LocalDateTime.now().minusDays(11), 1); - assertEquals(count, 1); - assertFalse(projectRepository.findById(100L).isPresent()); - } + @Autowired + private ProjectRepository projectRepository; + + @Test + void findAllIdsAndProjectAttributesTest() { + + Page projects = projectRepository.findAllIdsAndProjectAttributes(PageRequest.of(0, 2)); + + assertNotNull(projects); + assertTrue(CollectionUtils.isNotEmpty(projects.getContent())); + projects.getContent().forEach(project -> { + assertNotNull(project.getId()); + assertTrue(CollectionUtils.isNotEmpty(project.getProjectAttributes())); + assertEquals(15, project.getProjectAttributes().size()); + assertTrue(project.getProjectAttributes() + .stream() + .anyMatch(pa -> ofNullable(pa.getValue()).isPresent() && pa.getAttribute() + .getName() + .equals(ProjectAttributeEnum.KEEP_LOGS.getAttribute()))); + }); + } + + @Test + void findByName() { + final String projectName = "default_personal"; + + final Optional projectOptional = projectRepository.findByName(projectName); + + assertTrue(projectOptional.isPresent()); + assertEquals(projectName, projectOptional.get().getName()); + } + + @Test + void existsByName() { + assertTrue(projectRepository.existsByName("default_personal")); + assertTrue(projectRepository.existsByName("superadmin_personal")); + assertFalse(projectRepository.existsByName("not_existed")); + } + + @Test + void findAllProjectNames() { + List names = projectRepository.findAllProjectNames(); + assertThat("Incorrect projects size", names, Matchers.hasSize(2)); + assertThat("Results don't contain all project", names, + Matchers.hasItems("default_personal", "superadmin_personal")); + } + + @Test + void findAllProjectNamesByTerm() { + List names = projectRepository.findAllProjectNamesByTerm("UpEr"); + assertThat("Incorrect projects size", names, Matchers.hasSize(1)); + assertThat("Results don't contain all project", names, + Matchers.hasItems("superadmin_personal")); + } + + @Test + void findUserProjectsTest() { + List projects = projectRepository.findUserProjects("default"); + assertNotNull(projects); + assertEquals(1, projects.size()); + } + + @Test + void findAllByUserLogin() { + List projects = projectRepository.findAllByUserLogin("default"); + assertNotNull(projects); + assertEquals(1, projects.size()); + } + + @Test + void findUserProjectByLoginAndType() { + List userProjects = projectRepository.findUserProjects("superadmin", "PERSONAL"); + assertNotNull(userProjects); + assertEquals(1, userProjects.size()); + assertEquals(ProjectType.PERSONAL, userProjects.get(0).getProjectType()); + } + + @Test + void shouldFindProjectByName() { + final Optional project = projectRepository.findRawByName("superadmin_personal"); + assertTrue(project.isPresent()); + } + + @Test + void shouldNotFindProjectByName() { + final Optional project = projectRepository.findRawByName("some_random_name"); + assertFalse(project.isPresent()); + } + + @Test + void findProjectInfoByFilter() { + final List projectInfos = projectRepository.findProjectInfoByFilter( + new Filter(ProjectInfo.class, + Condition.GREATER_THAN_OR_EQUALS, + false, + "1", + USERS_QUANTITY + )); + assertEquals(2, projectInfos.size()); + } + + @Test + void findProjectInfoByFilterWithPagination() { + final Page projectInfoPage = projectRepository.findProjectInfoByFilter( + new Filter(ProjectInfo.class, + Condition.EQUALS, + false, + "default_personal", + CRITERIA_PROJECT_NAME + ), PageRequest.of(0, 10)); + assertEquals(1, projectInfoPage.getTotalElements()); + } + + @Sql("/db/fill/project/expired-project-fill.sql") + @Test + void deleteOneByTypeAndLastRunBefore() { + int count = projectRepository.deleteByTypeAndLastLaunchRunBefore(ProjectType.UPSA, + LocalDateTime.now().minusDays(11), 1); + assertEquals(count, 1); + assertFalse(projectRepository.findById(100L).isPresent()); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/ProjectUserRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/ProjectUserRepositoryTest.java index aeb501239..0a64cfd29 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/ProjectUserRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/ProjectUserRepositoryTest.java @@ -3,43 +3,42 @@ import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.commons.ReportPortalUser; import com.epam.ta.reportportal.entity.project.ProjectRole; +import java.util.Optional; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.*; - public class ProjectUserRepositoryTest extends BaseTest { - @Autowired - private ProjectUserRepository projectUserRepository; + @Autowired + private ProjectUserRepository projectUserRepository; - @Test - void shouldFindDetailsByUserIdAndProjectName() { + @Test + void shouldFindDetailsByUserIdAndProjectName() { - final String projectName = "superadmin_personal"; - final Optional projectDetails = projectUserRepository.findDetailsByUserIdAndProjectName(1L, - projectName - ); + final String projectName = "superadmin_personal"; + final Optional projectDetails = projectUserRepository.findDetailsByUserIdAndProjectName( + 1L, + projectName + ); - Assertions.assertTrue(projectDetails.isPresent()); + Assertions.assertTrue(projectDetails.isPresent()); - Assertions.assertEquals(projectName, projectDetails.get().getProjectName()); - Assertions.assertEquals(1L, projectDetails.get().getProjectId()); - Assertions.assertEquals(ProjectRole.PROJECT_MANAGER, projectDetails.get().getProjectRole()); - } + Assertions.assertEquals(projectName, projectDetails.get().getProjectName()); + Assertions.assertEquals(1L, projectDetails.get().getProjectId()); + Assertions.assertEquals(ProjectRole.PROJECT_MANAGER, projectDetails.get().getProjectRole()); + } - @Test - void shouldNotFindDetailsByUserIdAndProjectNameWhenNotExists() { + @Test + void shouldNotFindDetailsByUserIdAndProjectNameWhenNotExists() { - final String projectName = "superadmin_personal"; - final Optional projectDetails = projectUserRepository.findDetailsByUserIdAndProjectName(2L, - projectName - ); + final String projectName = "superadmin_personal"; + final Optional projectDetails = projectUserRepository.findDetailsByUserIdAndProjectName( + 2L, + projectName + ); - Assertions.assertFalse(projectDetails.isPresent()); - } + Assertions.assertFalse(projectDetails.isPresent()); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/dao/RestorePasswordBidRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/RestorePasswordBidRepositoryTest.java index 6bc122722..dc8b0eacb 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/RestorePasswordBidRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/RestorePasswordBidRepositoryTest.java @@ -16,39 +16,40 @@ package com.epam.ta.reportportal.dao; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.user.RestorePasswordBid; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; - import java.util.Date; import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; /** * @author Pavel Bortnik */ class RestorePasswordBidRepositoryTest extends BaseTest { - @Autowired - private RestorePasswordBidRepository restorePasswordBidRepository; - - @Test - void findByEmail() { - Optional bid = restorePasswordBidRepository.findByEmail("notexisted@email.com"); - assertFalse(bid.isPresent()); - } - - @Test - void findByExistedEmail() { - RestorePasswordBid restorePasswordBid = new RestorePasswordBid(); - restorePasswordBid.setUuid("uuid"); - restorePasswordBid.setEmail("existed@email.com"); - restorePasswordBid.setLastModifiedDate(new Date()); - restorePasswordBidRepository.save(restorePasswordBid); - Optional bid = restorePasswordBidRepository.findByEmail("existed@email.com"); - assertTrue(bid.isPresent()); - } + @Autowired + private RestorePasswordBidRepository restorePasswordBidRepository; + + @Test + void findByEmail() { + Optional bid = restorePasswordBidRepository.findByEmail( + "notexisted@email.com"); + assertFalse(bid.isPresent()); + } + + @Test + void findByExistedEmail() { + RestorePasswordBid restorePasswordBid = new RestorePasswordBid(); + restorePasswordBid.setUuid("uuid"); + restorePasswordBid.setEmail("existed@email.com"); + restorePasswordBid.setLastModifiedDate(new Date()); + restorePasswordBidRepository.save(restorePasswordBid); + Optional bid = restorePasswordBidRepository.findByEmail( + "existed@email.com"); + assertTrue(bid.isPresent()); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/dao/SenderCaseRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/SenderCaseRepositoryTest.java index dac59149b..565df4c5d 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/SenderCaseRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/SenderCaseRepositoryTest.java @@ -3,64 +3,69 @@ import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.project.email.LaunchAttributeRule; import com.epam.ta.reportportal.entity.project.email.SenderCase; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.Set; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.jdbc.Sql; -import java.util.*; - @Sql("/db/fill/sendercase/sender-case-fill.sql") public class SenderCaseRepositoryTest extends BaseTest { - @Autowired - private SenderCaseRepository senderCaseRepository; + @Autowired + private SenderCaseRepository senderCaseRepository; - @Test - void findAllByProjectId() { - final List senderCases = senderCaseRepository.findAllByProjectId(1L); - Assertions.assertFalse(senderCases.isEmpty()); - } + @Test + void findAllByProjectId() { + final List senderCases = senderCaseRepository.findAllByProjectId(1L); + Assertions.assertFalse(senderCases.isEmpty()); + } - @Test - void findAllByProjectIdAndRuleNameIgnoreCase() { - final Optional senderCases = senderCaseRepository.findByProjectIdAndRuleNameIgnoreCase(1L, "rule1"); - Assertions.assertTrue(senderCases.isPresent()); - } + @Test + void findAllByProjectIdAndRuleNameIgnoreCase() { + final Optional senderCases = senderCaseRepository.findByProjectIdAndRuleNameIgnoreCase( + 1L, "rule1"); + Assertions.assertTrue(senderCases.isPresent()); + } - @Test - void deleteRecipients() { - final int removed = senderCaseRepository.deleteRecipients(1L, Collections.singleton("first")); - Assertions.assertEquals(1, removed); + @Test + void deleteRecipients() { + final int removed = senderCaseRepository.deleteRecipients(1L, Collections.singleton("first")); + Assertions.assertEquals(1, removed); - final SenderCase updated = senderCaseRepository.findById(1L).get(); - Assertions.assertEquals(1, updated.getRecipients().size()); - Assertions.assertFalse(updated.getRecipients().contains("first")); - } + final SenderCase updated = senderCaseRepository.findById(1L).get(); + Assertions.assertEquals(1, updated.getRecipients().size()); + Assertions.assertFalse(updated.getRecipients().contains("first")); + } - @Test - void saveAttributeRules() { - final Optional senderCases = senderCaseRepository.findByProjectIdAndRuleNameIgnoreCase(1L, "rule1"); - Assertions.assertTrue(senderCases.isPresent()); + @Test + void saveAttributeRules() { + final Optional senderCases = senderCaseRepository.findByProjectIdAndRuleNameIgnoreCase( + 1L, "rule1"); + Assertions.assertTrue(senderCases.isPresent()); - final SenderCase senderCaseDb = senderCases.get(); - final SenderCase senderCase = new SenderCase(); - senderCase.setId(senderCaseDb.getId()); - senderCase.setRuleName(senderCaseDb.getRuleName()); - senderCase.setProject(senderCase.getProject()); - senderCase.setEnabled(senderCaseDb.isEnabled()); - senderCase.setLaunchNames(senderCaseDb.getLaunchNames()); - senderCase.setSendCase(senderCaseDb.getSendCase()); - senderCase.setRecipients(senderCaseDb.getRecipients()); - final LaunchAttributeRule attributeRule = new LaunchAttributeRule(); - attributeRule.setValue("v1"); - attributeRule.setSenderCase(senderCase); - Set rules = new HashSet<>(); - rules.add(attributeRule); - senderCase.setLaunchAttributeRules(rules); - senderCaseRepository.save(senderCase); - final SenderCase found = senderCaseRepository.findById(senderCaseDb.getId()).get(); + final SenderCase senderCaseDb = senderCases.get(); + final SenderCase senderCase = new SenderCase(); + senderCase.setId(senderCaseDb.getId()); + senderCase.setRuleName(senderCaseDb.getRuleName()); + senderCase.setProject(senderCase.getProject()); + senderCase.setEnabled(senderCaseDb.isEnabled()); + senderCase.setLaunchNames(senderCaseDb.getLaunchNames()); + senderCase.setSendCase(senderCaseDb.getSendCase()); + senderCase.setRecipients(senderCaseDb.getRecipients()); + final LaunchAttributeRule attributeRule = new LaunchAttributeRule(); + attributeRule.setValue("v1"); + attributeRule.setSenderCase(senderCase); + Set rules = new HashSet<>(); + rules.add(attributeRule); + senderCase.setLaunchAttributeRules(rules); + senderCaseRepository.save(senderCase); + final SenderCase found = senderCaseRepository.findById(senderCaseDb.getId()).get(); - Assertions.assertFalse(found.getLaunchAttributeRules().isEmpty()); - } + Assertions.assertFalse(found.getLaunchAttributeRules().isEmpty()); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/ServerSettingsRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/ServerSettingsRepositoryTest.java index 7fdab37a9..2716619a2 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/ServerSettingsRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/ServerSettingsRepositoryTest.java @@ -16,38 +16,37 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.dao.ServerSettingsRepositoryCustomImpl.SERVER_SETTING_KEY; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.ServerSettings; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; - import java.util.List; import java.util.Optional; - -import static com.epam.ta.reportportal.dao.ServerSettingsRepositoryCustomImpl.SERVER_SETTING_KEY; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; /** * @author Ihar Kahadouski */ class ServerSettingsRepositoryTest extends BaseTest { - @Autowired - private ServerSettingsRepository repository; - - @Test - public void findSettings() { - final List settings = repository.selectServerSettings(); - assertEquals(2L, settings.size()); - settings.forEach(setting -> assertTrue(setting.getKey().startsWith(SERVER_SETTING_KEY))); - } - - @Test - public void generateSecret() { - final String s = repository.generateSecret(); - final Optional byKey = repository.findByKey("secret.key"); - assertTrue(byKey.isPresent()); - assertEquals(s, byKey.get().getValue()); - } + @Autowired + private ServerSettingsRepository repository; + + @Test + public void findSettings() { + final List settings = repository.selectServerSettings(); + assertEquals(2L, settings.size()); + settings.forEach(setting -> assertTrue(setting.getKey().startsWith(SERVER_SETTING_KEY))); + } + + @Test + public void generateSecret() { + final String s = repository.generateSecret(); + final Optional byKey = repository.findByKey("secret.key"); + assertTrue(byKey.isPresent()); + assertEquals(s, byKey.get().getValue()); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryTest.java index 7a59c7282..b707e3bfb 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/StaleMaterializedViewRepositoryTest.java @@ -1,43 +1,45 @@ package com.epam.ta.reportportal.dao; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.materialized.StaleMaterializedView; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; - import java.time.LocalDateTime; import java.time.ZoneOffset; import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; /** * @author Ivan Budayeu */ class StaleMaterializedViewRepositoryTest extends BaseTest { - @Autowired - private StaleMaterializedViewRepository staleMaterializedViewRepository; + @Autowired + private StaleMaterializedViewRepository staleMaterializedViewRepository; - @Test - void shouldInsertAndSetId() { + @Test + void shouldInsertAndSetId() { - final StaleMaterializedView staleMaterializedView = new StaleMaterializedView(); - staleMaterializedView.setName("test"); - staleMaterializedView.setCreationDate(LocalDateTime.now(ZoneOffset.UTC)); + final StaleMaterializedView staleMaterializedView = new StaleMaterializedView(); + staleMaterializedView.setName("test"); + staleMaterializedView.setCreationDate(LocalDateTime.now(ZoneOffset.UTC)); - final StaleMaterializedView result = staleMaterializedViewRepository.insert(staleMaterializedView); + final StaleMaterializedView result = staleMaterializedViewRepository.insert( + staleMaterializedView); - assertNotNull(staleMaterializedView.getId()); - assertNotNull(result.getId()); - assertEquals(result.getId(), staleMaterializedView.getId()); + assertNotNull(staleMaterializedView.getId()); + assertNotNull(result.getId()); + assertEquals(result.getId(), staleMaterializedView.getId()); - final Optional found = staleMaterializedViewRepository.findById(1L); - assertTrue(found.isPresent()); + final Optional found = staleMaterializedViewRepository.findById(1L); + assertTrue(found.isPresent()); - final Optional notFound = staleMaterializedViewRepository.findById(2L); - assertTrue(notFound.isEmpty()); + final Optional notFound = staleMaterializedViewRepository.findById(2L); + assertTrue(notFound.isEmpty()); - } + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/dao/StatisticsFieldRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/StatisticsFieldRepositoryTest.java index 57e78954f..ce4e5d6b8 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/StatisticsFieldRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/StatisticsFieldRepositoryTest.java @@ -16,35 +16,33 @@ package com.epam.ta.reportportal.dao; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.statistics.StatisticsField; +import java.util.List; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.jdbc.Sql; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; - /** - * * @author Ihar Kahadouski */ @Sql("/db/fill/item/items-fill.sql") class StatisticsFieldRepositoryTest extends BaseTest { - @Autowired - private StatisticsFieldRepository repository; + @Autowired + private StatisticsFieldRepository repository; - @Test - void deleteByName() { - final String fieldName = "statistics$executions$failed"; + @Test + void deleteByName() { + final String fieldName = "statistics$executions$failed"; - repository.deleteByName(fieldName); - final List statisticsField = repository.findAll(); + repository.deleteByName(fieldName); + final List statisticsField = repository.findAll(); - assertEquals(13, statisticsField.size()); - statisticsField.forEach(it -> assertNotEquals(fieldName, it.getName())); - } + assertEquals(13, statisticsField.size()); + statisticsField.forEach(it -> assertNotEquals(fieldName, it.getName())); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java index 1d9042e44..76c5a2b34 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java @@ -16,8 +16,44 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_LAUNCH_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_PROJECT_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_START_TIME; +import static com.epam.ta.reportportal.commons.querygen.constant.IssueCriteriaConstant.CRITERIA_ISSUE_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_COMPOSITE_ATTRIBUTE; +import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_MESSAGE; +import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_TEST_ITEM_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_CLUSTER_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_HAS_CHILDREN; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_HAS_RETRIES; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_HAS_STATS; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_ISSUE_GROUP_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_PARENT_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_PATTERN_TEMPLATE_NAME; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_STATUS; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_TEST_CASE_HASH; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_TICKET_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_TYPE; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; +import static java.util.stream.Collectors.toList; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.anyOf; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.is; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; -import com.epam.ta.reportportal.commons.querygen.*; +import com.epam.ta.reportportal.commons.querygen.Condition; +import com.epam.ta.reportportal.commons.querygen.ConvertibleCondition; +import com.epam.ta.reportportal.commons.querygen.Filter; +import com.epam.ta.reportportal.commons.querygen.FilterCondition; +import com.epam.ta.reportportal.commons.querygen.FilterTarget; import com.epam.ta.reportportal.entity.enums.LogLevel; import com.epam.ta.reportportal.entity.enums.StatusEnum; import com.epam.ta.reportportal.entity.enums.TestItemIssueGroup; @@ -38,6 +74,17 @@ import com.epam.ta.reportportal.ws.model.ErrorType; import com.epam.ta.reportportal.ws.model.analyzer.IndexTestItem; import com.google.common.collect.Comparators; +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; import org.apache.commons.collections4.CollectionUtils; import org.assertj.core.util.Lists; import org.assertj.core.util.Sets; @@ -51,1210 +98,1270 @@ import org.springframework.data.util.Pair; import org.springframework.test.context.jdbc.Sql; -import java.time.Duration; -import java.time.LocalDateTime; -import java.util.*; - -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.IssueCriteriaConstant.CRITERIA_ISSUE_ID; -import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_COMPOSITE_ATTRIBUTE; -import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; -import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_MESSAGE; -import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_TEST_ITEM_ID; -import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.*; -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; -import static java.util.stream.Collectors.toList; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ivan Budaev */ -@Sql({ "/db/fill/item/items-fill.sql", "/db/fill/issue/issue-fill.sql" }) +@Sql({"/db/fill/item/items-fill.sql", "/db/fill/issue/issue-fill.sql"}) class TestItemRepositoryTest extends BaseTest { - @Autowired - private TestItemRepository testItemRepository; - - @Autowired - private IssueTypeRepository issueTypeRepository; - - @Autowired - private TicketRepository ticketRepository; - - @Test - void findTicketsByTerm() { - List tickets = ticketRepository.findByLaunchIdAndTerm(1L, "ticket"); - Assertions.assertFalse(tickets.isEmpty()); - } - - @Test - void findTicketsByTermNegative() { - List tickets = ticketRepository.findByLaunchIdAndTerm(1L, "unknown"); - Assertions.assertTrue(tickets.isEmpty()); - } - - @Test - void findTicketsByProjectIdAndTerm() { - List tickets = ticketRepository.findByProjectIdAndTerm(1L, "ticket"); - Assertions.assertFalse(tickets.isEmpty()); - } - - @Test - void findTicketsByProjectIdAndTermNegative() { - List tickets = ticketRepository.findByProjectIdAndTerm(1L, "unknown"); - Assertions.assertTrue(tickets.isEmpty()); - } - - @Test - void findTestItemIdsByLaunchId() { - - List ids = testItemRepository.findTestItemIdsByLaunchId(12L, PageRequest.of(0, 14)); - - assertTrue(CollectionUtils.isNotEmpty(ids), "Ids not found"); - assertEquals(14, ids.size(), "Incorrect ids size"); - assertEquals(91, ids.get(0)); - assertEquals(102, ids.get(11)); - - List retries = testItemRepository.findAllById(Lists.newArrayList(ids.get(12), ids.get(13))); - assertEquals(2, retries.size(), "Incorrect ids size"); - - retries.stream().map(TestItem::getRetryOf).forEach(Assertions::assertNotNull); - } - - @Test - void hasItemsInStatusAddedLatelyTest() { - Duration duration = Duration.ofHours(1); - assertTrue(testItemRepository.hasItemsInStatusAddedLately(1L, duration, StatusEnum.FAILED)); - } - - @Test - void hasLogsTest() { - assertFalse(testItemRepository.hasLogs(1L, Duration.ofDays(12).plusHours(23), StatusEnum.IN_PROGRESS)); - } - - private void assertGroupedItems(Long launchId, Map> itemsGroupedByLaunch, int itemsLimitPerLaunch) { - List items = itemsGroupedByLaunch.get(launchId); - assertEquals(itemsLimitPerLaunch, items.size()); - - items.forEach(item -> assertEquals(launchId, item.getLaunchId())); - } - - @Test - void findTestItemsByLaunchId() { - final long launchId = 1L; - - List items = testItemRepository.findTestItemsByLaunchId(launchId); - assertNotNull(items, "Items should not be null"); - assertEquals(6, items.size(), "Incorrect items size"); - items.forEach(it -> assertEquals(launchId, (long) it.getLaunchId())); - } - - @Test - void findByUuid() { - final String uuid = "uuid 1_1"; - final Optional item = testItemRepository.findByUuid(uuid); - assertTrue(item.isPresent(), "Item should not be empty"); - assertEquals(uuid, item.get().getUuid(), "Incorrect uniqueId"); - } - - @Test - void findTestItemsByUniqueId() { - final String uniqueId = "unqIdSTEP1"; - final List items = testItemRepository.findTestItemsByUniqueId(uniqueId); - assertNotNull(items, "Items should not be null"); - assertTrue(!items.isEmpty(), "Items should not be empty"); - items.forEach(it -> assertEquals(uniqueId, it.getUniqueId(), "Incorrect uniqueId")); - } - - @Test - void findTestItemsByLaunchIdOrderByStartTimeAsc() { - final Long launchId = 1L; - final List items = testItemRepository.findTestItemsByLaunchIdOrderByStartTimeAsc(launchId); - assertNotNull(items, "Items should not be null"); - assertTrue(!items.isEmpty(), "Items should not be empty"); - assertTrue(Comparators.isInOrder(items, Comparator.comparing(TestItem::getStartTime)), "Incorrect order"); - } - - @Test - void hasChildren() { - assertTrue(testItemRepository.hasChildren(1L, "1")); - assertFalse(testItemRepository.hasChildren(3L, "1.2.3")); - } - - @Test - void hasChildrenWithStats() { - assertTrue(testItemRepository.hasChildrenWithStats(1L)); - assertFalse(testItemRepository.hasChildrenWithStats(3L)); - } - - @Test - void selectPathName() { - final Optional> pathName = testItemRepository.selectPath("uuid 1_1"); - assertTrue(pathName.isPresent()); - } - - @Test - void interruptInProgressItems() { - final Long launchId = 1L; - testItemRepository.interruptInProgressItems(launchId); - final List items = testItemRepository.findTestItemsByLaunchId(launchId); - items.forEach(it -> assertNotEquals(StatusEnum.IN_PROGRESS, it.getItemResults().getStatus(), "Incorrect status")); - } - - @Test - void hasStatusNotEqualsWithoutStepItem() { - assertTrue(testItemRepository.hasDescendantsNotInStatusExcludingById(1L, 4L, StatusEnum.IN_PROGRESS.name())); - } - - @Test - void findByPath() { - TestItem testItem = testItemRepository.findById(1L).orElseThrow(() -> new ReportPortalException(ErrorType.TEST_ITEM_NOT_FOUND, 1L)); - assertTrue(testItemRepository.findByPath(testItem.getPath()).isPresent()); - } - - @Test - void findLatestByUniqueIdAndLaunchIdAndParentId() { - final Optional latestItem = testItemRepository.findLatestIdByUniqueIdAndLaunchIdAndParentId("unqIdSTEP_R12", 12L, 101L); - assertTrue(latestItem.isPresent()); - } - - @Test - void findLatestIdByUniqueIdAndLaunchIdAndParentIdAndItemIdNotEqual() { - final Optional latestItem = testItemRepository.findLatestIdByUniqueIdAndLaunchIdAndParentIdAndItemIdNotEqual( - "unqIdSTEP_R12", - 12L, - 101L, - 100L - ); - assertTrue(latestItem.isPresent()); - } - - @Test - void selectIdsByFilter() { - Filter filter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_LAUNCH_ID)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "2", CRITERIA_ISSUE_GROUP_ID)) - .build(); - - List itemIds = testItemRepository.selectIdsByFilter(1L, filter, 1, 0); - - Assertions.assertEquals(1, itemIds.size()); - } - - @Sql("/db/fill/item/items-with-nested-steps.sql") - @Test - void selectIdsByHasDescendants() { - final List itemIds = testItemRepository.selectIdsByHasDescendants(List.of(130L, 131L, 132L, 133L)); - Assertions.assertEquals(3, itemIds.size()); - } - - @Sql("/db/fill/item/items-with-nested-steps.sql") - @Test - void selectIdsByStringLogMessage() { - final List result = testItemRepository.selectIdsByStringLogMessage(List.of(130L, 132L), LogLevel.ERROR_INT, "NullPointer"); - Assertions.assertEquals(1, result.size()); - Assertions.assertEquals(130L, result.get(0)); - } - - @Sql("/db/fill/item/items-with-nested-steps.sql") - @Test - void selectIdsByPatternLogMessage() { - final List result = testItemRepository.selectIdsByRegexLogMessage(List.of(130L, 132L), LogLevel.ERROR_INT, "[A-Za-z]*"); - Assertions.assertEquals(1, result.size()); - Assertions.assertEquals(130L, result.get(0)); - } - - @Sql("/db/fill/item/items-with-nested-steps.sql") - @Test - void selectIdsUnderByStringLogMessage() { - final List result = testItemRepository.selectIdsUnderByStringLogMessage( - 10L, - List.of(132L, 133L), - LogLevel.ERROR_INT, - "NullPointer" - ); - Assertions.assertEquals(1, result.size()); - Assertions.assertEquals(132L, result.get(0)); - } - - @Sql("/db/fill/item/items-with-nested-steps.sql") - @Test - void selectIdsUnderByRegexLogMessage() { - final List result = testItemRepository.selectIdsUnderByRegexLogMessage( - 10L, - List.of(132L, 133L), - LogLevel.ERROR_INT, - "[A-Za-z]*" - ); - Assertions.assertEquals(1, result.size()); - Assertions.assertEquals(132L, result.get(0)); - } - - @Test - void selectAllDescendants() { - final Long itemId = 2L; - final List items = testItemRepository.selectAllDescendants(itemId); - assertNotNull(items, "Items should not be null"); - assertTrue(!items.isEmpty(), "Items should not be empty"); - items.forEach(it -> assertEquals(itemId, it.getParentId(), "Item has incorrect parent id")); - } - - @Test - void deleteByIdTest() { - testItemRepository.deleteById(1L); - } - - @Test - void selectAllDescendantsWithChildren() { - final Long itemId = 1L; - final List items = testItemRepository.selectAllDescendantsWithChildren(itemId); - assertNotNull(items, "Items should not be null"); - assertTrue(!items.isEmpty(), "Items should not be empty"); - items.forEach(it -> assertEquals(itemId, it.getParentId())); - } - - @Test - void selectAllDescendantsWithChildrenNegative() { - final Long itemId = 3L; - final List items = testItemRepository.selectAllDescendantsWithChildren(itemId); - assertNotNull(items, "Items should not be null"); - assertTrue(items.isEmpty(), "Items should be empty"); - } - - @Test - void selectItemsInStatusByLaunch() { - final Long launchId = 1L; - final StatusEnum failedStatus = StatusEnum.FAILED; - final List items = testItemRepository.selectItemsInStatusByLaunch(launchId, failedStatus); - assertNotNull(items, "Items should not be null"); - assertTrue(!items.isEmpty(), "Items should not be empty"); - items.forEach(it -> { - assertEquals(launchId, it.getLaunchId(), "Incorrect launch id"); - assertEquals(failedStatus, it.getItemResults().getStatus(), "Incorrect launch status"); - }); - } - - @Test - void selectItemsInStatusByParent() { - final Long parentId = 2L; - final StatusEnum failedStatus = StatusEnum.FAILED; - final List items = testItemRepository.selectItemsInStatusByParent(parentId, failedStatus); - assertNotNull(items, "Items should not be null"); - assertFalse(items.isEmpty(), "Items should not be empty"); - items.forEach(it -> { - assertEquals(parentId, it.getParentId(), "Incorrect parent id"); - assertEquals(failedStatus, it.getItemResults().getStatus(), "Incorrect launch status"); - }); - } - - @Test - void hasItemsInStatusByLaunch() { - assertTrue(testItemRepository.hasItemsInStatusByLaunch(1L, StatusEnum.FAILED)); - } - - @Test - void hasItemsWithIssueByLaunch() { - assertTrue(testItemRepository.hasItemsWithIssueByLaunch(1L)); - } - - @Test - void hasItemsInStatusByParent() { - assertTrue(testItemRepository.hasItemsInStatusByParent(2L, "1.2", StatusEnum.FAILED.name())); - } - - @Test - void hasItemsInStatusByParentNegative() { - assertFalse(testItemRepository.hasItemsInStatusByParent(2L, "1.2", StatusEnum.SKIPPED.name(), StatusEnum.PASSED.name())); - } - - @Test - void findAllNotInIssueByLaunch() { - final List testItems = testItemRepository.findAllNotInIssueByLaunch(1L, "pb001"); - assertNotNull(testItems, "Ids should not be null"); - assertTrue(!testItems.isEmpty(), "Ids should not be empty"); - testItems.forEach(it -> assertThat("Issue locator shouldn't be 'pb001'", - it.getItemResults().getIssue().getIssueType().getLocator(), - Matchers.not(Matchers.equalTo("pb001")) - )); - } - - @Test - void selectIdsNotInIssueByLaunch() { - final List itemIds = testItemRepository.selectIdsNotInIssueByLaunch(1L, "pb001"); - assertNotNull(itemIds, "Ids should not be null"); - assertTrue(!itemIds.isEmpty(), "Ids should not be empty"); - } - - @Test - void selectByAutoAnalyzedStatusNotIgnoreAnalyzer() { - final IssueType abIssueType = issueTypeRepository.findById(2L).get(); - - List itemIds = testItemRepository.selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(false, - false, - 1L, - LogLevel.ERROR.toInt(), - List.of(abIssueType) - ); - assertNotNull(itemIds); - assertTrue(itemIds.isEmpty()); - - final IssueType tiIssueType = issueTypeRepository.findById(1L).get(); - itemIds = testItemRepository.selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(false, - false, - 1L, - LogLevel.ERROR.toInt(), - List.of(tiIssueType) - ); - assertNotNull(itemIds); - assertThat(itemIds, hasSize(1)); - - } - - @Test - void selectByAutoAnalyzedStatusIgnoreAnalyzer() { - List itemIds = testItemRepository.selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(false, - true, - 1L, - LogLevel.ERROR.toInt(), - Collections.emptyList() - ); - assertTrue(itemIds.isEmpty()); - } - - @Test - void streamIdsByNotHasChildrenAndLaunchIdAndStatus() { - - List itemIds = testItemRepository.findIdsByNotHasChildrenAndLaunchIdAndStatus(1L, StatusEnum.FAILED, 1, 0L); - Assertions.assertEquals(1, itemIds.size()); - - itemIds = testItemRepository.findIdsByNotHasChildrenAndLaunchIdAndStatus(1L, StatusEnum.FAILED, 1, 1L); - Assertions.assertEquals(1, itemIds.size()); - - itemIds = testItemRepository.findIdsByNotHasChildrenAndLaunchIdAndStatus(1L, StatusEnum.FAILED, 2, 0L); - Assertions.assertEquals(2, itemIds.size()); - } - - @Test - void streamIdsByHasChildrenAndLaunchIdAndStatusOrderedByPathLevel() { - - List itemIds = testItemRepository.findIdsByHasChildrenAndLaunchIdAndStatusOrderedByPathLevel(1L, StatusEnum.FAILED, 1, 0L); - Assertions.assertEquals(1, itemIds.size()); - - itemIds = testItemRepository.findIdsByHasChildrenAndLaunchIdAndStatusOrderedByPathLevel(1L, StatusEnum.FAILED, 3, 1L); - Assertions.assertEquals(2, itemIds.size()); - - itemIds = testItemRepository.findIdsByHasChildrenAndLaunchIdAndStatusOrderedByPathLevel(1L, StatusEnum.FAILED, 3, 0L); - Assertions.assertEquals(3, itemIds.size()); - } - - @Test - void streamIdsByNotHasChildrenAndParentPathAndStatus() { - - List itemIds = testItemRepository.findIdsByNotHasChildrenAndParentPathAndStatus("1.2", StatusEnum.FAILED, 1, 0L); - Assertions.assertEquals(1, itemIds.size()); - - itemIds = testItemRepository.findIdsByNotHasChildrenAndParentPathAndStatus("1.2", StatusEnum.FAILED, 1, 1L); - Assertions.assertEquals(1, itemIds.size()); - - itemIds = testItemRepository.findIdsByNotHasChildrenAndParentPathAndStatus("1.2", StatusEnum.FAILED, 2, 0L); - Assertions.assertEquals(2, itemIds.size()); - } - - @Test - void streamIdsByHasChildrenAndParentPathAndStatusOrderedByPathLevel() { - - List itemIds = testItemRepository.findIdsByHasChildrenAndParentPathAndStatusOrderedByPathLevel("1", StatusEnum.FAILED, 1, 0L); - Assertions.assertEquals(1, itemIds.size()); - - itemIds = testItemRepository.findIdsByHasChildrenAndParentPathAndStatusOrderedByPathLevel("1", StatusEnum.FAILED, 1, 1L); - Assertions.assertEquals(1, itemIds.size()); - - itemIds = testItemRepository.findIdsByHasChildrenAndParentPathAndStatusOrderedByPathLevel("1", StatusEnum.FAILED, 2, 0L); - Assertions.assertEquals(2, itemIds.size()); - } - - @Test - void selectItemsInIssueByLaunch() { - final Long launchId = 1L; - final String issueType = "ab001"; - final List items = testItemRepository.selectItemsInIssueByLaunch(launchId, issueType); - assertNotNull(items, "Items should not be null"); - assertTrue(!items.isEmpty(), "Items should not be empty"); - items.forEach(it -> { - assertEquals(launchId, it.getLaunchId(), "Incorrect launch id"); - assertThat(it.getItemResults().getIssue().getIssueType().getId(), anyOf(is(1L), is(2L))); - }); - } - - @Test - void hasDescendantsWithStatusNotEqual() { - assertTrue(testItemRepository.hasDescendantsNotInStatus(1L, StatusEnum.PASSED.name()), "Incorrect status"); - assertFalse(testItemRepository.hasDescendantsNotInStatus(1L, StatusEnum.FAILED.name(), StatusEnum.PASSED.name()), - "Incorrect status" - ); - } - - @Test - void selectIssueLocatorsByProject() { - final List issueTypes = testItemRepository.selectIssueLocatorsByProject(1L); - assertNotNull(issueTypes, "IssueTypes should not be null"); - assertEquals(5, issueTypes.size(), "Incorrect size"); - } - - @Test - void selectIssueTypeByLocator() { - final String locator = "pb001"; - final Optional issueType = testItemRepository.selectIssueTypeByLocator(1L, locator); - assertTrue(issueType.isPresent(), "IssueType should be present"); - assertEquals(locator, issueType.get().getLocator(), "Incorrect locator"); - } - - @Test - void selectRetriesTest() { - - Filter filter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, String.valueOf(12L), CRITERIA_LAUNCH_ID)) - .withCondition(new FilterCondition(Condition.EQUALS, false, String.valueOf(true), CRITERIA_HAS_RETRIES)) - .build(); - - List items = testItemRepository.findByFilter(filter, PageRequest.of(0, 1)).getContent(); - - TestItem item = items.get(0); - - List retries = testItemRepository.selectRetries(Lists.newArrayList(item.getItemId())); - assertEquals(3, retries.size()); - retries.forEach(retry -> { - assertNotNull(retry.getRetryOf()); - assertEquals(item.getItemId(), retry.getRetryOf()); - assertFalse(retry.getParameters().isEmpty()); - assertEquals(3, retry.getParameters().size()); - }); - } - - @Test - void updateStatusAndEndTimeAndDurationById() { - - int result = testItemRepository.updateStatusAndEndTimeById(1L, JStatusEnum.CANCELLED, LocalDateTime.now()); - - Assertions.assertEquals(1, result); - - Assertions.assertEquals(StatusEnum.CANCELLED, testItemRepository.findById(1L).get().getItemResults().getStatus()); - } - - @Test - void updateStatusAndEndTimeByRetryOfId() { - - final LocalDateTime endTime = LocalDateTime.now(); - int passedUpdated = testItemRepository.updateStatusAndEndTimeByRetryOfId(102L, JStatusEnum.PASSED, JStatusEnum.FAILED, endTime); - int inProgressUpdated = testItemRepository.updateStatusAndEndTimeByRetryOfId(102L, - JStatusEnum.IN_PROGRESS, - JStatusEnum.FAILED, - endTime - ); - - Assertions.assertEquals(0, passedUpdated); - Assertions.assertEquals(3, inProgressUpdated); - - final List retries = testItemRepository.selectRetries(Collections.singletonList(102L)); - assertFalse(retries.isEmpty()); - retries.forEach(retry -> assertEquals(StatusEnum.FAILED, retry.getItemResults().getStatus())); - } - - @Test - void getStatusByItemId() { - - TestItemTypeEnum type = testItemRepository.getTypeByItemId(1L); - - Assertions.assertEquals(TestItemTypeEnum.SUITE, type); - } - - @Test - void findOrderedByStatus() { - Filter filter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "3", CRITERIA_LAUNCH_ID)) - .build(); - - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, CRITERIA_STATUS))); - - List testItems = testItemRepository.findByFilter(filter, PageRequest.of(0, 20, sort)).getContent(); - - assertThat(testItems.get(0).getItemResults().getStatus().name(), - Matchers.greaterThan(testItems.get(testItems.size() - 1).getItemResults().getStatus().name()) - ); - } - - @Test - void findByClusterId() { - Filter filter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.ANY, false, "1", CRITERIA_CLUSTER_ID)) - .build(); - - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, CRITERIA_CLUSTER_ID))); - - List testItems = testItemRepository.findByFilter(filter, PageRequest.of(0, 20, sort)).getContent(); - - assertEquals(4, testItems.size()); - } - - @Test - void hasParentWithStatus() { - - boolean hasParentWithStatus = testItemRepository.hasParentWithStatus(3L, "1.2.3", StatusEnum.FAILED); - - Assertions.assertTrue(hasParentWithStatus); - } - - @Test - void findAllNotInIssueGroupByLaunch() { - List withoutProductBug = testItemRepository.findAllNotInIssueGroupByLaunch(3L, TestItemIssueGroup.PRODUCT_BUG); - withoutProductBug.forEach(it -> assertNotEquals(TestItemIssueGroup.PRODUCT_BUG, - it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() - )); - - List withoutAutomationBug = testItemRepository.findAllNotInIssueGroupByLaunch(3L, TestItemIssueGroup.AUTOMATION_BUG); - withoutAutomationBug.forEach(it -> assertNotEquals(TestItemIssueGroup.AUTOMATION_BUG, - it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() - )); - - List withoutSystemIssue = testItemRepository.findAllNotInIssueGroupByLaunch(3L, TestItemIssueGroup.SYSTEM_ISSUE); - withoutSystemIssue.forEach(it -> assertNotEquals(TestItemIssueGroup.SYSTEM_ISSUE, - it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() - )); - - List withoutToInvestigate = testItemRepository.findAllNotInIssueGroupByLaunch(3L, TestItemIssueGroup.TO_INVESTIGATE); - withoutToInvestigate.forEach(it -> assertNotEquals(TestItemIssueGroup.TO_INVESTIGATE, - it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() - )); - - List withoutNoDefect = testItemRepository.findAllNotInIssueGroupByLaunch(3L, TestItemIssueGroup.NO_DEFECT); - withoutNoDefect.forEach(it -> assertNotEquals(TestItemIssueGroup.NO_DEFECT, - it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() - )); - } - - @Test - void selectIdsNotInIssueGroupByLaunch() { - List withoutProductBug = testItemRepository.selectIdsNotInIssueGroupByLaunch(3L, TestItemIssueGroup.PRODUCT_BUG); - testItemRepository.findAllById(withoutProductBug) - .forEach(it -> assertNotEquals(TestItemIssueGroup.PRODUCT_BUG, - it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() - )); - - List withoutAutomationBug = testItemRepository.selectIdsNotInIssueGroupByLaunch(3L, TestItemIssueGroup.AUTOMATION_BUG); - testItemRepository.findAllById(withoutAutomationBug) - .forEach(it -> assertNotEquals(TestItemIssueGroup.AUTOMATION_BUG, - it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() - )); - - List withoutSystemIssue = testItemRepository.selectIdsNotInIssueGroupByLaunch(3L, TestItemIssueGroup.SYSTEM_ISSUE); - testItemRepository.findAllById(withoutSystemIssue) - .forEach(it -> assertNotEquals(TestItemIssueGroup.SYSTEM_ISSUE, - it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() - )); - - List withoutToInvestigate = testItemRepository.selectIdsNotInIssueGroupByLaunch(3L, TestItemIssueGroup.TO_INVESTIGATE); - testItemRepository.findAllById(withoutToInvestigate) - .forEach(it -> assertNotEquals(TestItemIssueGroup.TO_INVESTIGATE, - it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() - )); - - List withoutNoDefect = testItemRepository.selectIdsNotInIssueGroupByLaunch(3L, TestItemIssueGroup.NO_DEFECT); - testItemRepository.findAllById(withoutNoDefect) - .forEach(it -> assertNotEquals(TestItemIssueGroup.NO_DEFECT, - it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() - )); - } - - @Test - void selectIdsWithIssueByLaunchTest() { - final long launchId = 1L; - - List ids = testItemRepository.selectIdsWithIssueByLaunch(launchId); - - assertFalse(ids.isEmpty()); - - Set distinctIds = new HashSet<>(ids); - assertEquals(ids.size(), distinctIds.size()); - - testItemRepository.findAllById(ids).forEach(item -> assertNotNull(item.getItemResults().getIssue())); - - List itemsWithIssue = testItemRepository.findTestItemsByLaunchId(launchId) - .stream() - .filter(item -> Objects.nonNull(item.getItemResults().getIssue())) - .collect(toList()); - - assertEquals(itemsWithIssue.size(), ids.size()); - } - - @Test - void findAllInIssueGroupByLaunch() { - List withToInvestigate = testItemRepository.findAllInIssueGroupByLaunch(3L, TestItemIssueGroup.TO_INVESTIGATE); - withToInvestigate.forEach(it -> assertEquals(TestItemIssueGroup.TO_INVESTIGATE, - it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() - )); - - List withProductBug = testItemRepository.findAllInIssueGroupByLaunch(3L, TestItemIssueGroup.PRODUCT_BUG); - withProductBug.forEach(it -> assertEquals(TestItemIssueGroup.PRODUCT_BUG, - it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() - )); - } - - @Test - void searchByPatternNameTest() { - - Filter filter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.ANY, false, "name2, name3, name4", CRITERIA_PATTERN_TEMPLATE_NAME)) - .build(); - - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_PATTERN_TEMPLATE_NAME))); - - List items = testItemRepository.findByFilter(filter, PageRequest.of(0, 20, sort)).getContent(); - - assertNotNull(items); - assertEquals(20L, items.size()); - - } - - @Test - void patternTemplateFilteringTest() { - - List collect = testItemRepository.findAll() - .stream() - .filter(i -> CollectionUtils.isNotEmpty(i.getPatternTemplateTestItems())) - .collect(toList()); - - Assertions.assertTrue(CollectionUtils.isNotEmpty(collect)); - } - - @Test - void findParentByChildIdTest() { - Optional parent = testItemRepository.findParentByChildId(2L); - - Assertions.assertTrue(parent.isPresent()); - Assertions.assertEquals(1L, (long) parent.get().getItemId()); - } - - @Test - void searchTicket() { - Filter filter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.ANY, false, "ticket_id_3", CRITERIA_TICKET_ID)) - .build(); - List items = testItemRepository.findByFilter(filter); - assertNotNull(items); - assertEquals(1L, items.size()); - - } - - @Test - void accumulateStatisticsByFilter() { - Filter itemFilter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) - .build(); - final Set statistics = testItemRepository.accumulateStatisticsByFilter(itemFilter); - assertNotNull(statistics); - } - - @Test - void accumulateStatisticsByFilterNotFromBaseline() { - Filter itemFilter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "true", CRITERIA_HAS_STATS)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "false", CRITERIA_HAS_CHILDREN)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "STEP", CRITERIA_TYPE)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_LAUNCH_ID)) - .build(); - - Filter baseline = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "true", CRITERIA_HAS_STATS)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "false", CRITERIA_HAS_CHILDREN)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "STEP", CRITERIA_TYPE)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "3", CRITERIA_LAUNCH_ID)) - .build(); - - final Set result = testItemRepository.accumulateStatisticsByFilterNotFromBaseline(itemFilter, baseline); - assertFalse(result.isEmpty()); - assertEquals(2, result.size()); - } - - @Test - void findAllNestedStepsByIds() { - - Filter logFilter = Filter.builder() - .withTarget(Log.class) - .withCondition(new FilterCondition(Condition.IN, false, "1,2,3", CRITERIA_TEST_ITEM_ID)) - .withCondition(new FilterCondition(Condition.CONTAINS, false, "a", CRITERIA_LOG_MESSAGE)) - .build(); - - List allNestedStepsByIds = testItemRepository.findAllNestedStepsByIds(Lists.newArrayList(1L, 2L, 3L), logFilter, false); - assertNotNull(allNestedStepsByIds); - assertFalse(allNestedStepsByIds.isEmpty()); - assertEquals(3, allNestedStepsByIds.size()); - } - - @Test - void findIndexTestItemByLaunchId() { - final List items = testItemRepository.findIndexTestItemByLaunchId(1L, List.of(JTestItemTypeEnum.STEP)); - assertEquals(3, items.size()); - items.forEach(it -> assertNotNull(it.getTestItemName())); - } - - @Test - void findOneByFilterTest() { - final Filter itemFilter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_TEST_CASE_HASH)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_LAUNCH_ID)) - .withCondition(new FilterCondition(Condition.EXISTS, true, "1", CRITERIA_PARENT_ID)) - .build(); - - final Sort sort = Sort.by(Sort.Order.desc(CRITERIA_START_TIME)); - - final Optional foundId = testItemRepository.findIdByFilter(itemFilter, sort); - - assertTrue(foundId.isPresent()); - - } - - @Test - void findByLaunchAndTestItemFiltersTest() { - - Filter launchFilter = Filter.builder() - .withTarget(Launch.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_ID)) - .build(); - - Filter itemFilter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) - .build(); - - Page testItems = testItemRepository.findByFilter(false, - launchFilter, - itemFilter, - PageRequest.of(0, 1), - PageRequest.of(0, 100) - ); - - List content = testItems.getContent(); - - Assertions.assertFalse(content.isEmpty()); - Assertions.assertEquals(5, content.size()); - } - - @Test - void findAllNotFromBaseline() { - - Filter itemFilter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "true", CRITERIA_HAS_STATS)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "false", CRITERIA_HAS_CHILDREN)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "STEP", CRITERIA_TYPE)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_LAUNCH_ID)) - .build(); - - Filter baseline = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "true", CRITERIA_HAS_STATS)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "false", CRITERIA_HAS_CHILDREN)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "STEP", CRITERIA_TYPE)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "3", CRITERIA_LAUNCH_ID)) - .build(); - - final Page result = testItemRepository.findAllNotFromBaseline(itemFilter, - baseline, - PageRequest.of(0, 20, Sort.by(Sort.Order.asc("name"))) - ); - - assertEquals(1, result.getNumberOfElements()); - assertEquals(1, result.getTotalElements()); - } - - @Test - void testItemHistoryPage() { - Filter itemFilter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) - .build(); - - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); - - Page testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, - PageRequest.of(0, 2, sort), - 1L, - 5, - true - ); - - assertFalse(testItemHistories.isEmpty()); - - testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, PageRequest.of(0, 2, sort), 1L, 5, false); - - assertFalse(testItemHistories.isEmpty()); - } - - @Test - void testItemHistoryEmptyPage() { - Filter itemFilter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "28933", CRITERIA_PARENT_ID)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "DEFAULT", CRITERIA_LAUNCH_MODE)) - .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_PROJECT_ID)) - .build(); - - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, ID))); - - Page testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, - PageRequest.of(0, 20, sort), - 1L, - 5, - true - ); - - assertTrue(testItemHistories.isEmpty()); - - testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, PageRequest.of(0, 20, sort), 1L, 5, false); - - assertTrue(testItemHistories.isEmpty()); - } - - @Test - void testItemHistoryPageWithLaunchName() { - Filter itemFilter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) - .build(); - - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); - - Page testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, - PageRequest.of(0, 2, sort), - 1L, - "launch name 1", - 5, - true - ); - - assertTrue(testItemHistories.isEmpty()); - - testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, PageRequest.of(0, 2, sort), 1L, "launch name 1", 5, false); - - assertTrue(testItemHistories.isEmpty()); - } - - @Test - void testItemHistoryPageWithLaunchIds() { - Filter itemFilter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) - .build(); - - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); - - Page testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, - PageRequest.of(0, 2, sort), - 1L, - com.google.common.collect.Lists.newArrayList(1L, 2L, 3L), - 5, - true - ); - - assertFalse(testItemHistories.isEmpty()); - - testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, - PageRequest.of(0, 2, sort), - 1L, - com.google.common.collect.Lists.newArrayList(1L, 2L, 3L), - 5, - false - ); - - assertFalse(testItemHistories.isEmpty()); - } - - @Test - void testItemHistoryPageWithLaunchFilter() { - Filter itemFilter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) - .build(); - - Filter launchFilter = Filter.builder() - .withTarget(Launch.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) - .build(); - - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); - - Page testItemHistories = testItemRepository.loadItemsHistoryPage(false, - launchFilter, - itemFilter, - PageRequest.of(0, 5), - PageRequest.of(0, 2, sort), - 1L, - 5, - true - ); - - assertTrue(testItemHistories.isEmpty()); - - testItemHistories = testItemRepository.loadItemsHistoryPage(false, - launchFilter, - itemFilter, - PageRequest.of(0, 5), - PageRequest.of(0, 2, sort), - 1L, - 5, - false - ); - - assertTrue(testItemHistories.isEmpty()); - } - - @Test - void testItemHistoryPageWithLaunchFilterAndLaunchName() { - Filter itemFilter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) - .build(); - - Filter launchFilter = Filter.builder() - .withTarget(Launch.class) - .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) - .build(); - - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); - - Page testItemHistories = testItemRepository.loadItemsHistoryPage(false, - launchFilter, - itemFilter, - PageRequest.of(0, 5), - PageRequest.of(0, 2, sort), - 1L, - "launch name 1", - 5, - true - ); - - assertTrue(testItemHistories.isEmpty()); - - testItemHistories = testItemRepository.loadItemsHistoryPage(false, - launchFilter, - itemFilter, - PageRequest.of(0, 5), - PageRequest.of(0, 2, sort), - 1L, - "launch name 1", - 5, - false - ); - - assertTrue(testItemHistories.isEmpty()); - } - - @Autowired - private TestItemRepositoryCustomImpl custom; - - @Test - void stepHistoryWithUniqueIdTest() { - - List commonConditions = Lists.newArrayList(FilterCondition.builder().eq(CRITERIA_HAS_STATS, "true").build(), - FilterCondition.builder().eq(CRITERIA_HAS_CHILDREN, "false").build(), - FilterCondition.builder().eq(CRITERIA_TYPE, "STEP").build(), - FilterCondition.builder().eq(CRITERIA_LAUNCH_ID, "1").build() - ); - - Filter baseFilter = new Filter(FilterTarget.TEST_ITEM_TARGET.getClazz(), commonConditions); - - PageRequest pageable = PageRequest.of(0, 20, Sort.by(CRITERIA_ID)); - List content = custom.loadItemsHistoryPage(baseFilter, pageable, 1L, 30, false).getContent(); - - assertFalse(content.isEmpty()); - - } - - @Test - void stepHistoryWithTestCaseHashTest() { - - List commonConditions = Lists.newArrayList(FilterCondition.builder().eq(CRITERIA_HAS_STATS, "true").build(), - FilterCondition.builder().eq(CRITERIA_HAS_CHILDREN, "false").build(), - FilterCondition.builder().eq(CRITERIA_TYPE, "STEP").build(), - FilterCondition.builder().eq(CRITERIA_LAUNCH_ID, "1").build() - ); - - Filter baseFilter = new Filter(FilterTarget.TEST_ITEM_TARGET.getClazz(), commonConditions); - - PageRequest pageable = PageRequest.of(0, 20, Sort.by(CRITERIA_ID)); - List content = custom.loadItemsHistoryPage(baseFilter, pageable, 1L, 30, true).getContent(); - - assertFalse(content.isEmpty()); - } - - @Test - void findByFilterShouldReturnItemsWithIssueAndWithoutTicketsWhenIssueExistsAndTicketsNotExistFiltersAreSelected() { - //GIVEN - Filter filter = Filter.builder() - .withTarget(TestItem.class) - .withCondition(new FilterCondition(Condition.EXISTS, false, "TRUE", CRITERIA_ISSUE_ID)) - .withCondition(new FilterCondition(Condition.EXISTS, false, "FALSE", CRITERIA_TICKET_ID)) - .build(); - - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); - - //WHEN - List testItems = testItemRepository.findByFilter(filter, PageRequest.of(0, 20, sort)).getContent(); - - //THEN - assertEquals(2, testItems.size()); - - TestItem firstTestItem = testItems.get(0); - TestItem secondTestItem = testItems.get(1); - - Long expectedFirstTestItemId = 5L; - assertIssueExistsAndTicketsEmpty(firstTestItem, expectedFirstTestItemId); - Long expectedSecondTestItemId = 106L; - assertIssueExistsAndTicketsEmpty(secondTestItem, expectedSecondTestItemId); - } - - @Test - void selectAllDescendantsIdsTest() { - TestItem item = testItemRepository.findById(1L).get(); - List ids = testItemRepository.selectAllDescendantsIds(item.getPath()); - - testItemRepository.findAllById(ids).stream().map(TestItem::getPath).forEach(it -> assertTrue(it.startsWith("1"))); - } - - @Test - void deleteAllByItemIdTest() { - ArrayList ids = Lists.newArrayList(1L, 10L); - testItemRepository.deleteAllByItemIdIn(ids); - - assertEquals(0, testItemRepository.findAllById(ids).size()); - } - - @Test - void saveItemWith700CharsParam() { - String longParam = "pQJlVldHAf4vmEhm9PemBRGjHUCHixdkCfaSpzsPJKWUS29W0wygKgVjiuvu9xe3G4mBcUjjNeOUBqe1ZvM5A9GXYp15NcoVJDrgSBaIJoBdeZId2EEkxGKh0GrL7WMkCAZ36QlzA4JQg52sQgv2S9gdxCc0RteMuau1lxLdzvP8GqRldpvhsYHEBzKhhnes4KcmkLP20zV6nIIj7hdxGRZEPsqKI8vZWcX23P6FQxKtJN3OPVG8wxNekaCAD9e4aOV7XQhHgMk7mx3QCFK4u4KjQv5QF7BKUB4isQM1pMX0gysu6tj5Ss0eWI8Mg6JVb88bm61ByS08indxu7hqefBcLwL3CX6zTAEmeNn2c0BxI06RUFBwZxoa6durIomVhie4JwarzA5dB3qQ9H4UEH6lWqKO95FDH7yYH5CoMDdMCMXwoBnd8Fu61t9KIKrTk06IW1zSaPAPFq00bq2J2cEZk3ybaraMqaNepHX3huw4u7sYxCAXVZnb4COMkXwsFQ5V7ptCiuG4k7ZVgRg1vtQ7WmqbArL86tjGkUSh0f49wkcg2N6eYdBcGC1QNZZoGDQWJzIwydfnoRmGi4Utzt05erQeHa5XpKC05Iii6ZrT6Ib4sZ0QdhCUy8SEuKFxOzcGv7CRenv44Nhv0SdPjEuZ5BEKgAPkIuBknokoOgXAtdL7BFtMwu0IzH7U"; - TestItem item = new TestItem(); - item.setStartTime(LocalDateTime.now()); - item.setName("item"); - item.setPath("1.2.3"); - item.setUniqueId("uniqueID"); - item.setUuid("uuid"); - item.setTestCaseHash(123); - TestItemResults itemResults = new TestItemResults(); - itemResults.setTestItem(item); - itemResults.setStatus(StatusEnum.IN_PROGRESS); - item.setItemResults(itemResults); - item.setLaunchId(1L); - item.setType(TestItemTypeEnum.STEP); - Parameter parameter = new Parameter(); - parameter.setKey(longParam); - parameter.setValue(longParam); - item.setParameters(Sets.newLinkedHashSet(parameter)); - - testItemRepository.save(item); - } - - @Test - void saveItemWith700CharsTestCaseId() { - String longParam = "pQJlVldHAf4vmEhm9PemBRGjHUCHixdkCfaSpzsPJKWUS29W0wygKgVjiuvu9xe3G4mBcUjjNeOUBqe1ZvM5A9GXYp15NcoVJDrgSBaIJoBdeZId2EEkxGKh0GrL7WMkCAZ36QlzA4JQg52sQgv2S9gdxCc0RteMuau1lxLdzvP8GqRldpvhsYHEBzKhhnes4KcmkLP20zV6nIIj7hdxGRZEPsqKI8vZWcX23P6FQxKtJN3OPVG8wxNekaCAD9e4aOV7XQhHgMk7mx3QCFK4u4KjQv5QF7BKUB4isQM1pMX0gysu6tj5Ss0eWI8Mg6JVb88bm61ByS08indxu7hqefBcLwL3CX6zTAEmeNn2c0BxI06RUFBwZxoa6durIomVhie4JwarzA5dB3qQ9H4UEH6lWqKO95FDH7yYH5CoMDdMCMXwoBnd8Fu61t9KIKrTk06IW1zSaPAPFq00bq2J2cEZk3ybaraMqaNepHX3huw4u7sYxCAXVZnb4COMkXwsFQ5V7ptCiuG4k7ZVgRg1vtQ7WmqbArL86tjGkUSh0f49wkcg2N6eYdBcGC1QNZZoGDQWJzIwydfnoRmGi4Utzt05erQeHa5XpKC05Iii6ZrT6Ib4sZ0QdhCUy8SEuKFxOzcGv7CRenv44Nhv0SdPjEuZ5BEKgAPkIuBknokoOgXAtdL7BFtMwu0IzH7U"; - TestItem item = new TestItem(); - item.setStartTime(LocalDateTime.now()); - item.setName("item"); - item.setPath("1.2.3"); - item.setUniqueId("uniqueID"); - item.setUuid("uuid"); - item.setTestCaseHash(123); - item.setTestCaseId(longParam); - TestItemResults itemResults = new TestItemResults(); - itemResults.setTestItem(item); - itemResults.setStatus(StatusEnum.IN_PROGRESS); - item.setItemResults(itemResults); - item.setLaunchId(1L); - item.setType(TestItemTypeEnum.STEP); - Parameter parameter = new Parameter(); - item.setParameters(Sets.newLinkedHashSet(parameter)); - - testItemRepository.save(item); - } - - @Test - void compositeAttributeHas() { - List items = testItemRepository.findByFilter(Filter.builder() - .withTarget(TestItem.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.HAS) - .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) - .withValue("suite:value1") - .build()) - .build()); - - assertFalse(items.isEmpty()); - } - - @Test - void compositeAttributeHasNegative() { - List items = testItemRepository.findByFilter(Filter.builder() - .withTarget(TestItem.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.HAS) - .withNegative(true) - .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) - .withValue("suite:value1") - .build()) - .build()); - - assertFalse(items.isEmpty()); - } - - @Test - void compositeAttributeAny() { - List items = testItemRepository.findByFilter(Filter.builder() - .withTarget(TestItem.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.ANY) - .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) - .withValue("suite:value1") - .build()) - .build()); - - assertFalse(items.isEmpty()); - } - - @Test - void compositeAttributeAnyNegative() { - List items = testItemRepository.findByFilter(Filter.builder() - .withTarget(TestItem.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.ANY) - .withNegative(true) - .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) - .withValue("suite:value1") - .build()) - .build()); - - assertFalse(items.isEmpty()); - } - - private void assertIssueExistsAndTicketsEmpty(TestItem testItem, Long expectedId) { - assertEquals(expectedId, testItem.getItemId()); - - IssueEntity issue = testItem.getItemResults().getIssue(); - assertNotEquals(null, issue); - assertEquals(0, issue.getTickets().size()); - } + @Autowired + private TestItemRepository testItemRepository; + + @Autowired + private IssueTypeRepository issueTypeRepository; + + @Autowired + private TicketRepository ticketRepository; + @Autowired + private TestItemRepositoryCustomImpl custom; + + @Test + void findTicketsByTerm() { + List tickets = ticketRepository.findByLaunchIdAndTerm(1L, "ticket"); + Assertions.assertFalse(tickets.isEmpty()); + } + + @Test + void findTicketsByTermNegative() { + List tickets = ticketRepository.findByLaunchIdAndTerm(1L, "unknown"); + Assertions.assertTrue(tickets.isEmpty()); + } + + @Test + void findTicketsByProjectIdAndTerm() { + List tickets = ticketRepository.findByProjectIdAndTerm(1L, "ticket"); + Assertions.assertFalse(tickets.isEmpty()); + } + + @Test + void findTicketsByProjectIdAndTermNegative() { + List tickets = ticketRepository.findByProjectIdAndTerm(1L, "unknown"); + Assertions.assertTrue(tickets.isEmpty()); + } + + @Test + void findTestItemIdsByLaunchId() { + + List ids = testItemRepository.findTestItemIdsByLaunchId(12L, PageRequest.of(0, 14)); + + assertTrue(CollectionUtils.isNotEmpty(ids), "Ids not found"); + assertEquals(14, ids.size(), "Incorrect ids size"); + assertEquals(91, ids.get(0)); + assertEquals(102, ids.get(11)); + + List retries = testItemRepository.findAllById( + Lists.newArrayList(ids.get(12), ids.get(13))); + assertEquals(2, retries.size(), "Incorrect ids size"); + + retries.stream().map(TestItem::getRetryOf).forEach(Assertions::assertNotNull); + } + + @Test + void hasItemsInStatusAddedLatelyTest() { + Duration duration = Duration.ofHours(1); + assertTrue(testItemRepository.hasItemsInStatusAddedLately(1L, duration, StatusEnum.FAILED)); + } + + @Test + void hasLogsTest() { + assertFalse( + testItemRepository.hasLogs(1L, Duration.ofDays(12).plusHours(23), StatusEnum.IN_PROGRESS)); + } + + private void assertGroupedItems(Long launchId, Map> itemsGroupedByLaunch, + int itemsLimitPerLaunch) { + List items = itemsGroupedByLaunch.get(launchId); + assertEquals(itemsLimitPerLaunch, items.size()); + + items.forEach(item -> assertEquals(launchId, item.getLaunchId())); + } + + @Test + void findTestItemsByLaunchId() { + final long launchId = 1L; + + List items = testItemRepository.findTestItemsByLaunchId(launchId); + assertNotNull(items, "Items should not be null"); + assertEquals(6, items.size(), "Incorrect items size"); + items.forEach(it -> assertEquals(launchId, (long) it.getLaunchId())); + } + + @Test + void findByUuid() { + final String uuid = "uuid 1_1"; + final Optional item = testItemRepository.findByUuid(uuid); + assertTrue(item.isPresent(), "Item should not be empty"); + assertEquals(uuid, item.get().getUuid(), "Incorrect uniqueId"); + } + + @Test + void findTestItemsByUniqueId() { + final String uniqueId = "unqIdSTEP1"; + final List items = testItemRepository.findTestItemsByUniqueId(uniqueId); + assertNotNull(items, "Items should not be null"); + assertTrue(!items.isEmpty(), "Items should not be empty"); + items.forEach(it -> assertEquals(uniqueId, it.getUniqueId(), "Incorrect uniqueId")); + } + + @Test + void findTestItemsByLaunchIdOrderByStartTimeAsc() { + final Long launchId = 1L; + final List items = testItemRepository.findTestItemsByLaunchIdOrderByStartTimeAsc( + launchId); + assertNotNull(items, "Items should not be null"); + assertTrue(!items.isEmpty(), "Items should not be empty"); + assertTrue(Comparators.isInOrder(items, Comparator.comparing(TestItem::getStartTime)), + "Incorrect order"); + } + + @Test + void hasChildren() { + assertTrue(testItemRepository.hasChildren(1L, "1")); + assertFalse(testItemRepository.hasChildren(3L, "1.2.3")); + } + + @Test + void hasChildrenWithStats() { + assertTrue(testItemRepository.hasChildrenWithStats(1L)); + assertFalse(testItemRepository.hasChildrenWithStats(3L)); + } + + @Test + void selectPathName() { + final Optional> pathName = testItemRepository.selectPath("uuid 1_1"); + assertTrue(pathName.isPresent()); + } + + @Test + void interruptInProgressItems() { + final Long launchId = 1L; + testItemRepository.interruptInProgressItems(launchId); + final List items = testItemRepository.findTestItemsByLaunchId(launchId); + items.forEach(it -> assertNotEquals(StatusEnum.IN_PROGRESS, it.getItemResults().getStatus(), + "Incorrect status")); + } + + @Test + void hasStatusNotEqualsWithoutStepItem() { + assertTrue(testItemRepository.hasDescendantsNotInStatusExcludingById(1L, 4L, + StatusEnum.IN_PROGRESS.name())); + } + + @Test + void findByPath() { + TestItem testItem = testItemRepository.findById(1L) + .orElseThrow(() -> new ReportPortalException(ErrorType.TEST_ITEM_NOT_FOUND, 1L)); + assertTrue(testItemRepository.findByPath(testItem.getPath()).isPresent()); + } + + @Test + void findLatestByUniqueIdAndLaunchIdAndParentId() { + final Optional latestItem = testItemRepository.findLatestIdByUniqueIdAndLaunchIdAndParentId( + "unqIdSTEP_R12", 12L, 101L); + assertTrue(latestItem.isPresent()); + } + + @Test + void findLatestIdByUniqueIdAndLaunchIdAndParentIdAndItemIdNotEqual() { + final Optional latestItem = testItemRepository.findLatestIdByUniqueIdAndLaunchIdAndParentIdAndItemIdNotEqual( + "unqIdSTEP_R12", + 12L, + 101L, + 100L + ); + assertTrue(latestItem.isPresent()); + } + + @Test + void selectIdsByFilter() { + Filter filter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_LAUNCH_ID)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "2", CRITERIA_ISSUE_GROUP_ID)) + .build(); + + List itemIds = testItemRepository.selectIdsByFilter(1L, filter, 1, 0); + + Assertions.assertEquals(1, itemIds.size()); + } + + @Sql("/db/fill/item/items-with-nested-steps.sql") + @Test + void selectIdsByHasDescendants() { + final List itemIds = testItemRepository.selectIdsByHasDescendants( + List.of(130L, 131L, 132L, 133L)); + Assertions.assertEquals(3, itemIds.size()); + } + + @Sql("/db/fill/item/items-with-nested-steps.sql") + @Test + void selectIdsByStringLogMessage() { + final List result = testItemRepository.selectIdsByStringLogMessage(List.of(130L, 132L), + LogLevel.ERROR_INT, "NullPointer"); + Assertions.assertEquals(1, result.size()); + Assertions.assertEquals(130L, result.get(0)); + } + + @Sql("/db/fill/item/items-with-nested-steps.sql") + @Test + void selectIdsByPatternLogMessage() { + final List result = testItemRepository.selectIdsByRegexLogMessage(List.of(130L, 132L), + LogLevel.ERROR_INT, "[A-Za-z]*"); + Assertions.assertEquals(1, result.size()); + Assertions.assertEquals(130L, result.get(0)); + } + + @Sql("/db/fill/item/items-with-nested-steps.sql") + @Test + void selectIdsUnderByStringLogMessage() { + final List result = testItemRepository.selectIdsUnderByStringLogMessage( + 10L, + List.of(132L, 133L), + LogLevel.ERROR_INT, + "NullPointer" + ); + Assertions.assertEquals(1, result.size()); + Assertions.assertEquals(132L, result.get(0)); + } + + @Sql("/db/fill/item/items-with-nested-steps.sql") + @Test + void selectIdsUnderByRegexLogMessage() { + final List result = testItemRepository.selectIdsUnderByRegexLogMessage( + 10L, + List.of(132L, 133L), + LogLevel.ERROR_INT, + "[A-Za-z]*" + ); + Assertions.assertEquals(1, result.size()); + Assertions.assertEquals(132L, result.get(0)); + } + + @Test + void selectAllDescendants() { + final Long itemId = 2L; + final List items = testItemRepository.selectAllDescendants(itemId); + assertNotNull(items, "Items should not be null"); + assertTrue(!items.isEmpty(), "Items should not be empty"); + items.forEach(it -> assertEquals(itemId, it.getParentId(), "Item has incorrect parent id")); + } + + @Test + void deleteByIdTest() { + testItemRepository.deleteById(1L); + } + + @Test + void selectAllDescendantsWithChildren() { + final Long itemId = 1L; + final List items = testItemRepository.selectAllDescendantsWithChildren(itemId); + assertNotNull(items, "Items should not be null"); + assertTrue(!items.isEmpty(), "Items should not be empty"); + items.forEach(it -> assertEquals(itemId, it.getParentId())); + } + + @Test + void selectAllDescendantsWithChildrenNegative() { + final Long itemId = 3L; + final List items = testItemRepository.selectAllDescendantsWithChildren(itemId); + assertNotNull(items, "Items should not be null"); + assertTrue(items.isEmpty(), "Items should be empty"); + } + + @Test + void selectItemsInStatusByLaunch() { + final Long launchId = 1L; + final StatusEnum failedStatus = StatusEnum.FAILED; + final List items = testItemRepository.selectItemsInStatusByLaunch(launchId, + failedStatus); + assertNotNull(items, "Items should not be null"); + assertTrue(!items.isEmpty(), "Items should not be empty"); + items.forEach(it -> { + assertEquals(launchId, it.getLaunchId(), "Incorrect launch id"); + assertEquals(failedStatus, it.getItemResults().getStatus(), "Incorrect launch status"); + }); + } + + @Test + void selectItemsInStatusByParent() { + final Long parentId = 2L; + final StatusEnum failedStatus = StatusEnum.FAILED; + final List items = testItemRepository.selectItemsInStatusByParent(parentId, + failedStatus); + assertNotNull(items, "Items should not be null"); + assertFalse(items.isEmpty(), "Items should not be empty"); + items.forEach(it -> { + assertEquals(parentId, it.getParentId(), "Incorrect parent id"); + assertEquals(failedStatus, it.getItemResults().getStatus(), "Incorrect launch status"); + }); + } + + @Test + void hasItemsInStatusByLaunch() { + assertTrue(testItemRepository.hasItemsInStatusByLaunch(1L, StatusEnum.FAILED)); + } + + @Test + void hasItemsWithIssueByLaunch() { + assertTrue(testItemRepository.hasItemsWithIssueByLaunch(1L)); + } + + @Test + void hasItemsInStatusByParent() { + assertTrue(testItemRepository.hasItemsInStatusByParent(2L, "1.2", StatusEnum.FAILED.name())); + } + + @Test + void hasItemsInStatusByParentNegative() { + assertFalse(testItemRepository.hasItemsInStatusByParent(2L, "1.2", StatusEnum.SKIPPED.name(), + StatusEnum.PASSED.name())); + } + + @Test + void findAllNotInIssueByLaunch() { + final List testItems = testItemRepository.findAllNotInIssueByLaunch(1L, "pb001"); + assertNotNull(testItems, "Ids should not be null"); + assertTrue(!testItems.isEmpty(), "Ids should not be empty"); + testItems.forEach(it -> assertThat("Issue locator shouldn't be 'pb001'", + it.getItemResults().getIssue().getIssueType().getLocator(), + Matchers.not(Matchers.equalTo("pb001")) + )); + } + + @Test + void selectIdsNotInIssueByLaunch() { + final List itemIds = testItemRepository.selectIdsNotInIssueByLaunch(1L, "pb001"); + assertNotNull(itemIds, "Ids should not be null"); + assertTrue(!itemIds.isEmpty(), "Ids should not be empty"); + } + + @Test + void selectByAutoAnalyzedStatusNotIgnoreAnalyzer() { + final IssueType abIssueType = issueTypeRepository.findById(2L).get(); + + List itemIds = testItemRepository.selectIdsByAnalyzedWithLevelGteExcludingIssueTypes( + false, + false, + 1L, + LogLevel.ERROR.toInt(), + List.of(abIssueType) + ); + assertNotNull(itemIds); + assertTrue(itemIds.isEmpty()); + + final IssueType tiIssueType = issueTypeRepository.findById(1L).get(); + itemIds = testItemRepository.selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(false, + false, + 1L, + LogLevel.ERROR.toInt(), + List.of(tiIssueType) + ); + assertNotNull(itemIds); + assertThat(itemIds, hasSize(1)); + + } + + @Test + void selectByAutoAnalyzedStatusIgnoreAnalyzer() { + List itemIds = testItemRepository.selectIdsByAnalyzedWithLevelGteExcludingIssueTypes( + false, + true, + 1L, + LogLevel.ERROR.toInt(), + Collections.emptyList() + ); + assertTrue(itemIds.isEmpty()); + } + + @Test + void streamIdsByNotHasChildrenAndLaunchIdAndStatus() { + + List itemIds = testItemRepository.findIdsByNotHasChildrenAndLaunchIdAndStatus(1L, + StatusEnum.FAILED, 1, 0L); + Assertions.assertEquals(1, itemIds.size()); + + itemIds = testItemRepository.findIdsByNotHasChildrenAndLaunchIdAndStatus(1L, StatusEnum.FAILED, + 1, 1L); + Assertions.assertEquals(1, itemIds.size()); + + itemIds = testItemRepository.findIdsByNotHasChildrenAndLaunchIdAndStatus(1L, StatusEnum.FAILED, + 2, 0L); + Assertions.assertEquals(2, itemIds.size()); + } + + @Test + void streamIdsByHasChildrenAndLaunchIdAndStatusOrderedByPathLevel() { + + List itemIds = testItemRepository.findIdsByHasChildrenAndLaunchIdAndStatusOrderedByPathLevel( + 1L, StatusEnum.FAILED, 1, 0L); + Assertions.assertEquals(1, itemIds.size()); + + itemIds = testItemRepository.findIdsByHasChildrenAndLaunchIdAndStatusOrderedByPathLevel(1L, + StatusEnum.FAILED, 3, 1L); + Assertions.assertEquals(2, itemIds.size()); + + itemIds = testItemRepository.findIdsByHasChildrenAndLaunchIdAndStatusOrderedByPathLevel(1L, + StatusEnum.FAILED, 3, 0L); + Assertions.assertEquals(3, itemIds.size()); + } + + @Test + void streamIdsByNotHasChildrenAndParentPathAndStatus() { + + List itemIds = testItemRepository.findIdsByNotHasChildrenAndParentPathAndStatus("1.2", + StatusEnum.FAILED, 1, 0L); + Assertions.assertEquals(1, itemIds.size()); + + itemIds = testItemRepository.findIdsByNotHasChildrenAndParentPathAndStatus("1.2", + StatusEnum.FAILED, 1, 1L); + Assertions.assertEquals(1, itemIds.size()); + + itemIds = testItemRepository.findIdsByNotHasChildrenAndParentPathAndStatus("1.2", + StatusEnum.FAILED, 2, 0L); + Assertions.assertEquals(2, itemIds.size()); + } + + @Test + void streamIdsByHasChildrenAndParentPathAndStatusOrderedByPathLevel() { + + List itemIds = testItemRepository.findIdsByHasChildrenAndParentPathAndStatusOrderedByPathLevel( + "1", StatusEnum.FAILED, 1, 0L); + Assertions.assertEquals(1, itemIds.size()); + + itemIds = testItemRepository.findIdsByHasChildrenAndParentPathAndStatusOrderedByPathLevel("1", + StatusEnum.FAILED, 1, 1L); + Assertions.assertEquals(1, itemIds.size()); + + itemIds = testItemRepository.findIdsByHasChildrenAndParentPathAndStatusOrderedByPathLevel("1", + StatusEnum.FAILED, 2, 0L); + Assertions.assertEquals(2, itemIds.size()); + } + + @Test + void selectItemsInIssueByLaunch() { + final Long launchId = 1L; + final String issueType = "ab001"; + final List items = testItemRepository.selectItemsInIssueByLaunch(launchId, issueType); + assertNotNull(items, "Items should not be null"); + assertTrue(!items.isEmpty(), "Items should not be empty"); + items.forEach(it -> { + assertEquals(launchId, it.getLaunchId(), "Incorrect launch id"); + assertThat(it.getItemResults().getIssue().getIssueType().getId(), anyOf(is(1L), is(2L))); + }); + } + + @Test + void hasDescendantsWithStatusNotEqual() { + assertTrue(testItemRepository.hasDescendantsNotInStatus(1L, StatusEnum.PASSED.name()), + "Incorrect status"); + assertFalse(testItemRepository.hasDescendantsNotInStatus(1L, StatusEnum.FAILED.name(), + StatusEnum.PASSED.name()), + "Incorrect status" + ); + } + + @Test + void selectIssueLocatorsByProject() { + final List issueTypes = testItemRepository.selectIssueLocatorsByProject(1L); + assertNotNull(issueTypes, "IssueTypes should not be null"); + assertEquals(5, issueTypes.size(), "Incorrect size"); + } + + @Test + void selectIssueTypeByLocator() { + final String locator = "pb001"; + final Optional issueType = testItemRepository.selectIssueTypeByLocator(1L, locator); + assertTrue(issueType.isPresent(), "IssueType should be present"); + assertEquals(locator, issueType.get().getLocator(), "Incorrect locator"); + } + + @Test + void selectRetriesTest() { + + Filter filter = Filter.builder() + .withTarget(TestItem.class) + .withCondition( + new FilterCondition(Condition.EQUALS, false, String.valueOf(12L), CRITERIA_LAUNCH_ID)) + .withCondition(new FilterCondition(Condition.EQUALS, false, String.valueOf(true), + CRITERIA_HAS_RETRIES)) + .build(); + + List items = testItemRepository.findByFilter(filter, PageRequest.of(0, 1)) + .getContent(); + + TestItem item = items.get(0); + + List retries = testItemRepository.selectRetries(Lists.newArrayList(item.getItemId())); + assertEquals(3, retries.size()); + retries.forEach(retry -> { + assertNotNull(retry.getRetryOf()); + assertEquals(item.getItemId(), retry.getRetryOf()); + assertFalse(retry.getParameters().isEmpty()); + assertEquals(3, retry.getParameters().size()); + }); + } + + @Test + void updateStatusAndEndTimeAndDurationById() { + + int result = testItemRepository.updateStatusAndEndTimeById(1L, JStatusEnum.CANCELLED, + LocalDateTime.now()); + + Assertions.assertEquals(1, result); + + Assertions.assertEquals(StatusEnum.CANCELLED, + testItemRepository.findById(1L).get().getItemResults().getStatus()); + } + + @Test + void updateStatusAndEndTimeByRetryOfId() { + + final LocalDateTime endTime = LocalDateTime.now(); + int passedUpdated = testItemRepository.updateStatusAndEndTimeByRetryOfId(102L, + JStatusEnum.PASSED, JStatusEnum.FAILED, endTime); + int inProgressUpdated = testItemRepository.updateStatusAndEndTimeByRetryOfId(102L, + JStatusEnum.IN_PROGRESS, + JStatusEnum.FAILED, + endTime + ); + + Assertions.assertEquals(0, passedUpdated); + Assertions.assertEquals(3, inProgressUpdated); + + final List retries = testItemRepository.selectRetries( + Collections.singletonList(102L)); + assertFalse(retries.isEmpty()); + retries.forEach(retry -> assertEquals(StatusEnum.FAILED, retry.getItemResults().getStatus())); + } + + @Test + void getStatusByItemId() { + + TestItemTypeEnum type = testItemRepository.getTypeByItemId(1L); + + Assertions.assertEquals(TestItemTypeEnum.SUITE, type); + } + + @Test + void findOrderedByStatus() { + Filter filter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "3", CRITERIA_LAUNCH_ID)) + .build(); + + Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, CRITERIA_STATUS))); + + List testItems = testItemRepository.findByFilter(filter, PageRequest.of(0, 20, sort)) + .getContent(); + + assertThat(testItems.get(0).getItemResults().getStatus().name(), + Matchers.greaterThan( + testItems.get(testItems.size() - 1).getItemResults().getStatus().name()) + ); + } + + @Test + void findByClusterId() { + Filter filter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.ANY, false, "1", CRITERIA_CLUSTER_ID)) + .build(); + + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, CRITERIA_CLUSTER_ID))); + + List testItems = testItemRepository.findByFilter(filter, PageRequest.of(0, 20, sort)) + .getContent(); + + assertEquals(4, testItems.size()); + } + + @Test + void hasParentWithStatus() { + + boolean hasParentWithStatus = testItemRepository.hasParentWithStatus(3L, "1.2.3", + StatusEnum.FAILED); + + Assertions.assertTrue(hasParentWithStatus); + } + + @Test + void findAllNotInIssueGroupByLaunch() { + List withoutProductBug = testItemRepository.findAllNotInIssueGroupByLaunch(3L, + TestItemIssueGroup.PRODUCT_BUG); + withoutProductBug.forEach(it -> assertNotEquals(TestItemIssueGroup.PRODUCT_BUG, + it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() + )); + + List withoutAutomationBug = testItemRepository.findAllNotInIssueGroupByLaunch(3L, + TestItemIssueGroup.AUTOMATION_BUG); + withoutAutomationBug.forEach(it -> assertNotEquals(TestItemIssueGroup.AUTOMATION_BUG, + it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() + )); + + List withoutSystemIssue = testItemRepository.findAllNotInIssueGroupByLaunch(3L, + TestItemIssueGroup.SYSTEM_ISSUE); + withoutSystemIssue.forEach(it -> assertNotEquals(TestItemIssueGroup.SYSTEM_ISSUE, + it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() + )); + + List withoutToInvestigate = testItemRepository.findAllNotInIssueGroupByLaunch(3L, + TestItemIssueGroup.TO_INVESTIGATE); + withoutToInvestigate.forEach(it -> assertNotEquals(TestItemIssueGroup.TO_INVESTIGATE, + it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() + )); + + List withoutNoDefect = testItemRepository.findAllNotInIssueGroupByLaunch(3L, + TestItemIssueGroup.NO_DEFECT); + withoutNoDefect.forEach(it -> assertNotEquals(TestItemIssueGroup.NO_DEFECT, + it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() + )); + } + + @Test + void selectIdsNotInIssueGroupByLaunch() { + List withoutProductBug = testItemRepository.selectIdsNotInIssueGroupByLaunch(3L, + TestItemIssueGroup.PRODUCT_BUG); + testItemRepository.findAllById(withoutProductBug) + .forEach(it -> assertNotEquals(TestItemIssueGroup.PRODUCT_BUG, + it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() + )); + + List withoutAutomationBug = testItemRepository.selectIdsNotInIssueGroupByLaunch(3L, + TestItemIssueGroup.AUTOMATION_BUG); + testItemRepository.findAllById(withoutAutomationBug) + .forEach(it -> assertNotEquals(TestItemIssueGroup.AUTOMATION_BUG, + it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() + )); + + List withoutSystemIssue = testItemRepository.selectIdsNotInIssueGroupByLaunch(3L, + TestItemIssueGroup.SYSTEM_ISSUE); + testItemRepository.findAllById(withoutSystemIssue) + .forEach(it -> assertNotEquals(TestItemIssueGroup.SYSTEM_ISSUE, + it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() + )); + + List withoutToInvestigate = testItemRepository.selectIdsNotInIssueGroupByLaunch(3L, + TestItemIssueGroup.TO_INVESTIGATE); + testItemRepository.findAllById(withoutToInvestigate) + .forEach(it -> assertNotEquals(TestItemIssueGroup.TO_INVESTIGATE, + it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() + )); + + List withoutNoDefect = testItemRepository.selectIdsNotInIssueGroupByLaunch(3L, + TestItemIssueGroup.NO_DEFECT); + testItemRepository.findAllById(withoutNoDefect) + .forEach(it -> assertNotEquals(TestItemIssueGroup.NO_DEFECT, + it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() + )); + } + + @Test + void selectIdsWithIssueByLaunchTest() { + final long launchId = 1L; + + List ids = testItemRepository.selectIdsWithIssueByLaunch(launchId); + + assertFalse(ids.isEmpty()); + + Set distinctIds = new HashSet<>(ids); + assertEquals(ids.size(), distinctIds.size()); + + testItemRepository.findAllById(ids) + .forEach(item -> assertNotNull(item.getItemResults().getIssue())); + + List itemsWithIssue = testItemRepository.findTestItemsByLaunchId(launchId) + .stream() + .filter(item -> Objects.nonNull(item.getItemResults().getIssue())) + .collect(toList()); + + assertEquals(itemsWithIssue.size(), ids.size()); + } + + @Test + void findAllInIssueGroupByLaunch() { + List withToInvestigate = testItemRepository.findAllInIssueGroupByLaunch(3L, + TestItemIssueGroup.TO_INVESTIGATE); + withToInvestigate.forEach(it -> assertEquals(TestItemIssueGroup.TO_INVESTIGATE, + it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() + )); + + List withProductBug = testItemRepository.findAllInIssueGroupByLaunch(3L, + TestItemIssueGroup.PRODUCT_BUG); + withProductBug.forEach(it -> assertEquals(TestItemIssueGroup.PRODUCT_BUG, + it.getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup() + )); + } + + @Test + void searchByPatternNameTest() { + + Filter filter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.ANY, false, "name2, name3, name4", + CRITERIA_PATTERN_TEMPLATE_NAME)) + .build(); + + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_PATTERN_TEMPLATE_NAME))); + + List items = testItemRepository.findByFilter(filter, PageRequest.of(0, 20, sort)) + .getContent(); + + assertNotNull(items); + assertEquals(20L, items.size()); + + } + + @Test + void patternTemplateFilteringTest() { + + List collect = testItemRepository.findAll() + .stream() + .filter(i -> CollectionUtils.isNotEmpty(i.getPatternTemplateTestItems())) + .collect(toList()); + + Assertions.assertTrue(CollectionUtils.isNotEmpty(collect)); + } + + @Test + void findParentByChildIdTest() { + Optional parent = testItemRepository.findParentByChildId(2L); + + Assertions.assertTrue(parent.isPresent()); + Assertions.assertEquals(1L, (long) parent.get().getItemId()); + } + + @Test + void searchTicket() { + Filter filter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.ANY, false, "ticket_id_3", CRITERIA_TICKET_ID)) + .build(); + List items = testItemRepository.findByFilter(filter); + assertNotNull(items); + assertEquals(1L, items.size()); + + } + + @Test + void accumulateStatisticsByFilter() { + Filter itemFilter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .build(); + final Set statistics = testItemRepository.accumulateStatisticsByFilter(itemFilter); + assertNotNull(statistics); + } + + @Test + void accumulateStatisticsByFilterNotFromBaseline() { + Filter itemFilter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "true", CRITERIA_HAS_STATS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "false", CRITERIA_HAS_CHILDREN)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "STEP", CRITERIA_TYPE)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_LAUNCH_ID)) + .build(); + + Filter baseline = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "true", CRITERIA_HAS_STATS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "false", CRITERIA_HAS_CHILDREN)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "STEP", CRITERIA_TYPE)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "3", CRITERIA_LAUNCH_ID)) + .build(); + + final Set result = testItemRepository.accumulateStatisticsByFilterNotFromBaseline( + itemFilter, baseline); + assertFalse(result.isEmpty()); + assertEquals(2, result.size()); + } + + @Test + void findAllNestedStepsByIds() { + + Filter logFilter = Filter.builder() + .withTarget(Log.class) + .withCondition(new FilterCondition(Condition.IN, false, "1,2,3", CRITERIA_TEST_ITEM_ID)) + .withCondition(new FilterCondition(Condition.CONTAINS, false, "a", CRITERIA_LOG_MESSAGE)) + .build(); + + List allNestedStepsByIds = testItemRepository.findAllNestedStepsByIds( + Lists.newArrayList(1L, 2L, 3L), logFilter, false); + assertNotNull(allNestedStepsByIds); + assertFalse(allNestedStepsByIds.isEmpty()); + assertEquals(3, allNestedStepsByIds.size()); + } + + @Test + void findIndexTestItemByLaunchId() { + final List items = testItemRepository.findIndexTestItemByLaunchId(1L, + List.of(JTestItemTypeEnum.STEP)); + assertEquals(3, items.size()); + items.forEach(it -> assertNotNull(it.getTestItemName())); + } + + @Test + void findOneByFilterTest() { + final Filter itemFilter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_TEST_CASE_HASH)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_LAUNCH_ID)) + .withCondition(new FilterCondition(Condition.EXISTS, true, "1", CRITERIA_PARENT_ID)) + .build(); + + final Sort sort = Sort.by(Sort.Order.desc(CRITERIA_START_TIME)); + + final Optional foundId = testItemRepository.findIdByFilter(itemFilter, sort); + + assertTrue(foundId.isPresent()); + + } + + @Test + void findByLaunchAndTestItemFiltersTest() { + + Filter launchFilter = Filter.builder() + .withTarget(Launch.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_ID)) + .build(); + + Filter itemFilter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .build(); + + Page testItems = testItemRepository.findByFilter(false, + launchFilter, + itemFilter, + PageRequest.of(0, 1), + PageRequest.of(0, 100) + ); + + List content = testItems.getContent(); + + Assertions.assertFalse(content.isEmpty()); + Assertions.assertEquals(5, content.size()); + } + + @Test + void findAllNotFromBaseline() { + + Filter itemFilter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "true", CRITERIA_HAS_STATS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "false", CRITERIA_HAS_CHILDREN)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "STEP", CRITERIA_TYPE)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_LAUNCH_ID)) + .build(); + + Filter baseline = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "true", CRITERIA_HAS_STATS)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "false", CRITERIA_HAS_CHILDREN)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "STEP", CRITERIA_TYPE)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "3", CRITERIA_LAUNCH_ID)) + .build(); + + final Page result = testItemRepository.findAllNotFromBaseline(itemFilter, + baseline, + PageRequest.of(0, 20, Sort.by(Sort.Order.asc("name"))) + ); + + assertEquals(1, result.getNumberOfElements()); + assertEquals(1, result.getTotalElements()); + } + + @Test + void testItemHistoryPage() { + Filter itemFilter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .build(); + + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); + + Page testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, + PageRequest.of(0, 2, sort), + 1L, + 5, + true + ); + + assertFalse(testItemHistories.isEmpty()); + + testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, + PageRequest.of(0, 2, sort), 1L, 5, false); + + assertFalse(testItemHistories.isEmpty()); + } + + @Test + void testItemHistoryEmptyPage() { + Filter itemFilter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "28933", CRITERIA_PARENT_ID)) + .withCondition( + new FilterCondition(Condition.EQUALS, false, "DEFAULT", CRITERIA_LAUNCH_MODE)) + .withCondition(new FilterCondition(Condition.EQUALS, false, "1", CRITERIA_PROJECT_ID)) + .build(); + + Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, ID))); + + Page testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, + PageRequest.of(0, 20, sort), + 1L, + 5, + true + ); + + assertTrue(testItemHistories.isEmpty()); + + testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, + PageRequest.of(0, 20, sort), 1L, 5, false); + + assertTrue(testItemHistories.isEmpty()); + } + + @Test + void testItemHistoryPageWithLaunchName() { + Filter itemFilter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .build(); + + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); + + Page testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, + PageRequest.of(0, 2, sort), + 1L, + "launch name 1", + 5, + true + ); + + assertTrue(testItemHistories.isEmpty()); + + testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, + PageRequest.of(0, 2, sort), 1L, "launch name 1", 5, false); + + assertTrue(testItemHistories.isEmpty()); + } + + @Test + void testItemHistoryPageWithLaunchIds() { + Filter itemFilter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .build(); + + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); + + Page testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, + PageRequest.of(0, 2, sort), + 1L, + com.google.common.collect.Lists.newArrayList(1L, 2L, 3L), + 5, + true + ); + + assertFalse(testItemHistories.isEmpty()); + + testItemHistories = testItemRepository.loadItemsHistoryPage(itemFilter, + PageRequest.of(0, 2, sort), + 1L, + com.google.common.collect.Lists.newArrayList(1L, 2L, 3L), + 5, + false + ); + + assertFalse(testItemHistories.isEmpty()); + } + + @Test + void testItemHistoryPageWithLaunchFilter() { + Filter itemFilter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .build(); + + Filter launchFilter = Filter.builder() + .withTarget(Launch.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .build(); + + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); + + Page testItemHistories = testItemRepository.loadItemsHistoryPage(false, + launchFilter, + itemFilter, + PageRequest.of(0, 5), + PageRequest.of(0, 2, sort), + 1L, + 5, + true + ); + + assertTrue(testItemHistories.isEmpty()); + + testItemHistories = testItemRepository.loadItemsHistoryPage(false, + launchFilter, + itemFilter, + PageRequest.of(0, 5), + PageRequest.of(0, 2, sort), + 1L, + 5, + false + ); + + assertTrue(testItemHistories.isEmpty()); + } + + @Test + void testItemHistoryPageWithLaunchFilterAndLaunchName() { + Filter itemFilter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .build(); + + Filter launchFilter = Filter.builder() + .withTarget(Launch.class) + .withCondition(new FilterCondition(Condition.EQUALS, false, "FAILED", CRITERIA_STATUS)) + .build(); + + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); + + Page testItemHistories = testItemRepository.loadItemsHistoryPage(false, + launchFilter, + itemFilter, + PageRequest.of(0, 5), + PageRequest.of(0, 2, sort), + 1L, + "launch name 1", + 5, + true + ); + + assertTrue(testItemHistories.isEmpty()); + + testItemHistories = testItemRepository.loadItemsHistoryPage(false, + launchFilter, + itemFilter, + PageRequest.of(0, 5), + PageRequest.of(0, 2, sort), + 1L, + "launch name 1", + 5, + false + ); + + assertTrue(testItemHistories.isEmpty()); + } + + @Test + void stepHistoryWithUniqueIdTest() { + + List commonConditions = Lists.newArrayList( + FilterCondition.builder().eq(CRITERIA_HAS_STATS, "true").build(), + FilterCondition.builder().eq(CRITERIA_HAS_CHILDREN, "false").build(), + FilterCondition.builder().eq(CRITERIA_TYPE, "STEP").build(), + FilterCondition.builder().eq(CRITERIA_LAUNCH_ID, "1").build() + ); + + Filter baseFilter = new Filter(FilterTarget.TEST_ITEM_TARGET.getClazz(), commonConditions); + + PageRequest pageable = PageRequest.of(0, 20, Sort.by(CRITERIA_ID)); + List content = custom.loadItemsHistoryPage(baseFilter, pageable, 1L, 30, false) + .getContent(); + + assertFalse(content.isEmpty()); + + } + + @Test + void stepHistoryWithTestCaseHashTest() { + + List commonConditions = Lists.newArrayList( + FilterCondition.builder().eq(CRITERIA_HAS_STATS, "true").build(), + FilterCondition.builder().eq(CRITERIA_HAS_CHILDREN, "false").build(), + FilterCondition.builder().eq(CRITERIA_TYPE, "STEP").build(), + FilterCondition.builder().eq(CRITERIA_LAUNCH_ID, "1").build() + ); + + Filter baseFilter = new Filter(FilterTarget.TEST_ITEM_TARGET.getClazz(), commonConditions); + + PageRequest pageable = PageRequest.of(0, 20, Sort.by(CRITERIA_ID)); + List content = custom.loadItemsHistoryPage(baseFilter, pageable, 1L, 30, true) + .getContent(); + + assertFalse(content.isEmpty()); + } + + @Test + void findByFilterShouldReturnItemsWithIssueAndWithoutTicketsWhenIssueExistsAndTicketsNotExistFiltersAreSelected() { + //GIVEN + Filter filter = Filter.builder() + .withTarget(TestItem.class) + .withCondition(new FilterCondition(Condition.EXISTS, false, "TRUE", CRITERIA_ISSUE_ID)) + .withCondition(new FilterCondition(Condition.EXISTS, false, "FALSE", CRITERIA_TICKET_ID)) + .build(); + + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); + + //WHEN + List testItems = testItemRepository.findByFilter(filter, PageRequest.of(0, 20, sort)) + .getContent(); + + //THEN + assertEquals(2, testItems.size()); + + TestItem firstTestItem = testItems.get(0); + TestItem secondTestItem = testItems.get(1); + + Long expectedFirstTestItemId = 5L; + assertIssueExistsAndTicketsEmpty(firstTestItem, expectedFirstTestItemId); + Long expectedSecondTestItemId = 106L; + assertIssueExistsAndTicketsEmpty(secondTestItem, expectedSecondTestItemId); + } + + @Test + void selectAllDescendantsIdsTest() { + TestItem item = testItemRepository.findById(1L).get(); + List ids = testItemRepository.selectAllDescendantsIds(item.getPath()); + + testItemRepository.findAllById(ids).stream().map(TestItem::getPath) + .forEach(it -> assertTrue(it.startsWith("1"))); + } + + @Test + void deleteAllByItemIdTest() { + ArrayList ids = Lists.newArrayList(1L, 10L); + testItemRepository.deleteAllByItemIdIn(ids); + + assertEquals(0, testItemRepository.findAllById(ids).size()); + } + + @Test + void saveItemWith700CharsParam() { + String longParam = "pQJlVldHAf4vmEhm9PemBRGjHUCHixdkCfaSpzsPJKWUS29W0wygKgVjiuvu9xe3G4mBcUjjNeOUBqe1ZvM5A9GXYp15NcoVJDrgSBaIJoBdeZId2EEkxGKh0GrL7WMkCAZ36QlzA4JQg52sQgv2S9gdxCc0RteMuau1lxLdzvP8GqRldpvhsYHEBzKhhnes4KcmkLP20zV6nIIj7hdxGRZEPsqKI8vZWcX23P6FQxKtJN3OPVG8wxNekaCAD9e4aOV7XQhHgMk7mx3QCFK4u4KjQv5QF7BKUB4isQM1pMX0gysu6tj5Ss0eWI8Mg6JVb88bm61ByS08indxu7hqefBcLwL3CX6zTAEmeNn2c0BxI06RUFBwZxoa6durIomVhie4JwarzA5dB3qQ9H4UEH6lWqKO95FDH7yYH5CoMDdMCMXwoBnd8Fu61t9KIKrTk06IW1zSaPAPFq00bq2J2cEZk3ybaraMqaNepHX3huw4u7sYxCAXVZnb4COMkXwsFQ5V7ptCiuG4k7ZVgRg1vtQ7WmqbArL86tjGkUSh0f49wkcg2N6eYdBcGC1QNZZoGDQWJzIwydfnoRmGi4Utzt05erQeHa5XpKC05Iii6ZrT6Ib4sZ0QdhCUy8SEuKFxOzcGv7CRenv44Nhv0SdPjEuZ5BEKgAPkIuBknokoOgXAtdL7BFtMwu0IzH7U"; + TestItem item = new TestItem(); + item.setStartTime(LocalDateTime.now()); + item.setName("item"); + item.setPath("1.2.3"); + item.setUniqueId("uniqueID"); + item.setUuid("uuid"); + item.setTestCaseHash(123); + TestItemResults itemResults = new TestItemResults(); + itemResults.setTestItem(item); + itemResults.setStatus(StatusEnum.IN_PROGRESS); + item.setItemResults(itemResults); + item.setLaunchId(1L); + item.setType(TestItemTypeEnum.STEP); + Parameter parameter = new Parameter(); + parameter.setKey(longParam); + parameter.setValue(longParam); + item.setParameters(Sets.newLinkedHashSet(parameter)); + + testItemRepository.save(item); + } + + @Test + void saveItemWith700CharsTestCaseId() { + String longParam = "pQJlVldHAf4vmEhm9PemBRGjHUCHixdkCfaSpzsPJKWUS29W0wygKgVjiuvu9xe3G4mBcUjjNeOUBqe1ZvM5A9GXYp15NcoVJDrgSBaIJoBdeZId2EEkxGKh0GrL7WMkCAZ36QlzA4JQg52sQgv2S9gdxCc0RteMuau1lxLdzvP8GqRldpvhsYHEBzKhhnes4KcmkLP20zV6nIIj7hdxGRZEPsqKI8vZWcX23P6FQxKtJN3OPVG8wxNekaCAD9e4aOV7XQhHgMk7mx3QCFK4u4KjQv5QF7BKUB4isQM1pMX0gysu6tj5Ss0eWI8Mg6JVb88bm61ByS08indxu7hqefBcLwL3CX6zTAEmeNn2c0BxI06RUFBwZxoa6durIomVhie4JwarzA5dB3qQ9H4UEH6lWqKO95FDH7yYH5CoMDdMCMXwoBnd8Fu61t9KIKrTk06IW1zSaPAPFq00bq2J2cEZk3ybaraMqaNepHX3huw4u7sYxCAXVZnb4COMkXwsFQ5V7ptCiuG4k7ZVgRg1vtQ7WmqbArL86tjGkUSh0f49wkcg2N6eYdBcGC1QNZZoGDQWJzIwydfnoRmGi4Utzt05erQeHa5XpKC05Iii6ZrT6Ib4sZ0QdhCUy8SEuKFxOzcGv7CRenv44Nhv0SdPjEuZ5BEKgAPkIuBknokoOgXAtdL7BFtMwu0IzH7U"; + TestItem item = new TestItem(); + item.setStartTime(LocalDateTime.now()); + item.setName("item"); + item.setPath("1.2.3"); + item.setUniqueId("uniqueID"); + item.setUuid("uuid"); + item.setTestCaseHash(123); + item.setTestCaseId(longParam); + TestItemResults itemResults = new TestItemResults(); + itemResults.setTestItem(item); + itemResults.setStatus(StatusEnum.IN_PROGRESS); + item.setItemResults(itemResults); + item.setLaunchId(1L); + item.setType(TestItemTypeEnum.STEP); + Parameter parameter = new Parameter(); + item.setParameters(Sets.newLinkedHashSet(parameter)); + + testItemRepository.save(item); + } + + @Test + void compositeAttributeHas() { + List items = testItemRepository.findByFilter(Filter.builder() + .withTarget(TestItem.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.HAS) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue("suite:value1") + .build()) + .build()); + + assertFalse(items.isEmpty()); + } + + @Test + void compositeAttributeHasNegative() { + List items = testItemRepository.findByFilter(Filter.builder() + .withTarget(TestItem.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.HAS) + .withNegative(true) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue("suite:value1") + .build()) + .build()); + + assertFalse(items.isEmpty()); + } + + @Test + void compositeAttributeAny() { + List items = testItemRepository.findByFilter(Filter.builder() + .withTarget(TestItem.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.ANY) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue("suite:value1") + .build()) + .build()); + + assertFalse(items.isEmpty()); + } + + @Test + void compositeAttributeAnyNegative() { + List items = testItemRepository.findByFilter(Filter.builder() + .withTarget(TestItem.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.ANY) + .withNegative(true) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue("suite:value1") + .build()) + .build()); + + assertFalse(items.isEmpty()); + } + + private void assertIssueExistsAndTicketsEmpty(TestItem testItem, Long expectedId) { + assertEquals(expectedId, testItem.getItemId()); + + IssueEntity issue = testItem.getItemResults().getIssue(); + assertNotEquals(null, issue); + assertEquals(0, issue.getTickets().size()); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/TicketRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/TicketRepositoryTest.java index 71ed808a8..9287f8dca 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/TicketRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/TicketRepositoryTest.java @@ -16,20 +16,21 @@ package com.epam.ta.reportportal.dao; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.bts.Ticket; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.jdbc.Sql; - import java.time.LocalDateTime; import java.util.Arrays; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.jdbc.Sql; /** * @author Ihar Kahadouski @@ -37,43 +38,46 @@ @Sql("/db/fill/ticket/ticket-fill.sql") class TicketRepositoryTest extends BaseTest { - @Autowired - private TicketRepository repository; + @Autowired + private TicketRepository repository; - @Test - void findByTicketId() { - final String ticketId = "ticket_id_1"; + @Test + void findByTicketId() { + final String ticketId = "ticket_id_1"; - final Optional ticketOptional = repository.findByTicketId(ticketId); + final Optional ticketOptional = repository.findByTicketId(ticketId); - assertTrue(ticketOptional.isPresent(), "Ticket not found"); - assertEquals(ticketId, ticketOptional.get().getTicketId(), "Incorrect ticket id"); - } + assertTrue(ticketOptional.isPresent(), "Ticket not found"); + assertEquals(ticketId, ticketOptional.get().getTicketId(), "Incorrect ticket id"); + } - @Test - void findByTicketIdIn() { - List ids = Arrays.asList("ticket_id_1", "ticket_id_3"); + @Test + void findByTicketIdIn() { + List ids = Arrays.asList("ticket_id_1", "ticket_id_3"); - final List tickets = repository.findByTicketIdIn(ids); + final List tickets = repository.findByTicketIdIn(ids); - assertNotNull(tickets, "Tickets not found"); - assertEquals(2, tickets.size(), "Incorrect tickets count"); - assertThat(tickets.stream().map(Ticket::getTicketId).collect(Collectors.toList())).containsExactlyInAnyOrder(ids.get(0), - ids.get(1) - ); - } + assertNotNull(tickets, "Tickets not found"); + assertEquals(2, tickets.size(), "Incorrect tickets count"); + assertThat(tickets.stream().map(Ticket::getTicketId) + .collect(Collectors.toList())).containsExactlyInAnyOrder(ids.get(0), + ids.get(1) + ); + } - @Test - void deleteById() { - repository.deleteById(2L); - final List tickets = repository.findAll(); + @Test + void deleteById() { + repository.deleteById(2L); + final List tickets = repository.findAll(); - assertEquals(2, tickets.size()); - } + assertEquals(2, tickets.size()); + } - @Test - void findUniqueTicketsCountBefore() { - assertEquals(1, repository.findUniqueCountByProjectBefore(1L, LocalDateTime.now().minusDays(2))); - assertEquals(0, repository.findUniqueCountByProjectBefore(2L, LocalDateTime.now().minusDays(2))); - } + @Test + void findUniqueTicketsCountBefore() { + assertEquals(1, + repository.findUniqueCountByProjectBefore(1L, LocalDateTime.now().minusDays(2))); + assertEquals(0, + repository.findUniqueCountByProjectBefore(2L, LocalDateTime.now().minusDays(2))); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryTest.java index f3c83bb72..f6013f388 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryTest.java @@ -16,20 +16,19 @@ package com.epam.ta.reportportal.dao; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.user.UserCreationBid; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.jdbc.Sql; - import java.sql.Date; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.List; import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.jdbc.Sql; /** * @author Ihar Kahadouski @@ -37,57 +36,59 @@ @Sql("/db/fill/user-bid/user-bid-fill.sql") class UserCreationBidRepositoryTest extends BaseTest { - public static final String INTERNAL_TYPE = "internal"; - public static final String UNKNOWN_TYPE = "unknown"; + public static final String INTERNAL_TYPE = "internal"; + public static final String UNKNOWN_TYPE = "unknown"; - @Autowired - private UserCreationBidRepository repository; + @Autowired + private UserCreationBidRepository repository; - @Test - void findByUuidAndType() { - final String adminUuid = "0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb"; + @Test + void findByUuidAndType() { + final String adminUuid = "0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb"; - final Optional userBid = repository.findByUuidAndType(adminUuid, INTERNAL_TYPE); + final Optional userBid = repository.findByUuidAndType(adminUuid, + INTERNAL_TYPE); - assertTrue(userBid.isPresent(), "User bid should exists"); - assertEquals(adminUuid, userBid.get().getUuid(), "Incorrect uuid"); - assertEquals("superadminemail@domain.com", userBid.get().getEmail(), "Incorrect email"); - } + assertTrue(userBid.isPresent(), "User bid should exists"); + assertEquals(adminUuid, userBid.get().getUuid(), "Incorrect uuid"); + assertEquals("superadminemail@domain.com", userBid.get().getEmail(), "Incorrect email"); + } - @Test - void shouldNotFindByUuidAndTypeWhenTypeNotMatched() { - final String adminUuid = "0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb"; + @Test + void shouldNotFindByUuidAndTypeWhenTypeNotMatched() { + final String adminUuid = "0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb"; - final Optional userBid = repository.findByUuidAndType(adminUuid, UNKNOWN_TYPE); + final Optional userBid = repository.findByUuidAndType(adminUuid, UNKNOWN_TYPE); - assertTrue(userBid.isEmpty(), "User bid should not exists"); - } + assertTrue(userBid.isEmpty(), "User bid should not exists"); + } - @Test - void expireBidsOlderThan() { - final java.util.Date date = Date.from(LocalDateTime.now().minusDays(20).atZone(ZoneId.systemDefault()).toInstant()); + @Test + void expireBidsOlderThan() { + final java.util.Date date = Date.from( + LocalDateTime.now().minusDays(20).atZone(ZoneId.systemDefault()).toInstant()); - int deletedCount = repository.expireBidsOlderThan(date); - final List bids = repository.findAll(); + int deletedCount = repository.expireBidsOlderThan(date); + final List bids = repository.findAll(); - assertEquals(1, deletedCount); - bids.forEach(it -> assertTrue(it.getLastModified().after(date), "Incorrect date")); - } + assertEquals(1, deletedCount); + bids.forEach(it -> assertTrue(it.getLastModified().after(date), "Incorrect date")); + } - @Test - void findById() { - final String adminUuid = "0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb"; + @Test + void findById() { + final String adminUuid = "0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb"; - final Optional bid = repository.findById(adminUuid); + final Optional bid = repository.findById(adminUuid); - assertTrue(bid.isPresent(), "User bid should exists"); - assertEquals(adminUuid, bid.get().getUuid(), "Incorrect uuid"); - assertEquals("superadminemail@domain.com", bid.get().getEmail(), "Incorrect email"); - } + assertTrue(bid.isPresent(), "User bid should exists"); + assertEquals(adminUuid, bid.get().getUuid(), "Incorrect uuid"); + assertEquals("superadminemail@domain.com", bid.get().getEmail(), "Incorrect email"); + } - @Test - void deleteAllByEmail() { - int deletedCount = repository.deleteAllByEmail("defaultemail@domain.com"); - assertEquals(2, deletedCount); - } + @Test + void deleteAllByEmail() { + int deletedCount = repository.deleteAllByEmail("defaultemail@domain.com"); + assertEquals(2, deletedCount); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/UserFilterRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/UserFilterRepositoryTest.java index a7c644b72..ad931a9d8 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/UserFilterRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/UserFilterRepositoryTest.java @@ -16,6 +16,13 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_NAME; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.commons.querygen.Condition; import com.epam.ta.reportportal.commons.querygen.Filter; @@ -23,6 +30,8 @@ import com.epam.ta.reportportal.commons.querygen.ProjectFilter; import com.epam.ta.reportportal.entity.filter.UserFilter; import com.google.common.collect.Lists; +import java.util.List; +import java.util.Optional; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -30,163 +39,173 @@ import org.springframework.data.domain.Sort; import org.springframework.test.context.jdbc.Sql; -import java.util.List; -import java.util.Optional; - -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_NAME; -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ivan Nikitsenka */ @Sql("/db/fill/shareable/shareable-fill.sql") class UserFilterRepositoryTest extends BaseTest { - @Autowired - private UserFilterRepository userFilterRepository; - - @Test - public void updateSharing() { - userFilterRepository.updateSharingFlag(Lists.newArrayList(1L), true); - final Optional filter = userFilterRepository.findById(1L); - assertTrue(filter.get().isShared()); - } - - @Test - public void shouldFindByIdAndProjectIdWhenExists() { - Optional userFilter = userFilterRepository.findByIdAndProjectId(1L, 1L); - - assertTrue(userFilter.isPresent()); - } - - @Test - public void shouldNotFindByIdAndProjectIdWhenIdNotExists() { - Optional userFilter = userFilterRepository.findByIdAndProjectId(55L, 1L); - - assertFalse(userFilter.isPresent()); - } - - @Test - public void shouldNotFindByIdAndProjectIdWhenProjectIdNotExists() { - Optional userFilter = userFilterRepository.findByIdAndProjectId(5L, 11L); - - assertFalse(userFilter.isPresent()); - } - - @Test - public void shouldNotFindByIdAndProjectIdWhenIdAndProjectIdNotExist() { - Optional userFilter = userFilterRepository.findByIdAndProjectId(55L, 11L); - - assertFalse(userFilter.isPresent()); - } - - @Test - public void shouldFindByIdsAndProjectIdWhenExists() { - List userFilters = userFilterRepository.findAllByIdInAndProjectId(Lists.newArrayList(1L, 2L), 1L); - - assertNotNull(userFilters); - assertEquals(2L, userFilters.size()); - } - - @Test - public void shouldNotFindByIdsAndProjectIdWhenProjectIdNotExists() { - List userFilters = userFilterRepository.findAllByIdInAndProjectId(Lists.newArrayList(1L, 2L), 2L); - - assertNotNull(userFilters); - assertTrue(userFilters.isEmpty()); - } - - @Test - void getSharedFilters() { - Page superadminSharedFilters = userFilterRepository.getShared(ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - "superadmin" - ); - assertEquals(0, superadminSharedFilters.getTotalElements(), "Unexpected shared filters count"); - - Page result2 = userFilterRepository.getShared(ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - "default" - ); - assertEquals(1, result2.getTotalElements(), "Unexpected shared filters count"); - - final Page jajaSharedFilters = userFilterRepository.getShared(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), - "jaja_user" - ); - assertEquals(1, jajaSharedFilters.getTotalElements(), "Unexpected shared filters count"); - } - - @Test - void getPermittedFilters() { - Page adminPermittedFilters = userFilterRepository.getPermitted(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), - "superadmin" - ); - assertEquals(2, adminPermittedFilters.getTotalElements(), "Unexpected shared filters count"); - - Page defaultPermittedFilters = userFilterRepository.getPermitted(ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - "default" - ); - assertEquals(2, defaultPermittedFilters.getTotalElements(), "Unexpected shared filters count"); - - final Page jajaPermittedFilters = userFilterRepository.getPermitted(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), - "jaja_user" - ); - assertEquals(1, jajaPermittedFilters.getTotalElements(), "Unexpected shared filters count"); - } - - @Test - void getOwnFilters() { - Page superadminOwnFilters = userFilterRepository.getOwn(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), - "superadmin" - ); - assertEquals(2, superadminOwnFilters.getTotalElements()); - - Page defaultOwnFilters = userFilterRepository.getOwn(ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - "default" - ); - assertEquals(2, defaultOwnFilters.getTotalElements(), "Unexpected shared filters count"); - - final Page jajaOwnFilters = userFilterRepository.getOwn(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), - "jaja_user" - ); - assertEquals(0, jajaOwnFilters.getTotalElements(), "Unexpected shared filters count"); - - final Page jajaOwnFiltersOnForeingProject = userFilterRepository.getOwn(ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - "jaja_user" - ); - assertEquals(0, jajaOwnFiltersOnForeingProject.getTotalElements(), "Unexpected shared filters count"); - } - - @Test - void existsByNameAndOwnerAndProjectIdTest() { - assertTrue(userFilterRepository.existsByNameAndOwnerAndProjectId("Admin Filter", "superadmin", 1L)); - assertTrue(userFilterRepository.existsByNameAndOwnerAndProjectId("Default Shared Filter", "default", 2L)); - assertFalse(userFilterRepository.existsByNameAndOwnerAndProjectId("DEMO_FILTER", "yahoo", 1L)); - assertFalse(userFilterRepository.existsByNameAndOwnerAndProjectId("Admin Filter", "superadmin", 2L)); - } - - @Test - void findAllByProjectId() { - final Long projectId = 1L; - final List filters = userFilterRepository.findAllByProjectId(projectId); - assertNotNull(filters, "Filters not found"); - assertTrue(!filters.isEmpty(), "Filters should not be empty"); - filters.forEach(it -> assertEquals(projectId, it.getProject().getId())); - } - - private Filter buildDefaultFilter() { - return Filter.builder() - .withTarget(UserFilter.class) - .withCondition(new FilterCondition(Condition.LOWER_THAN, false, "1000", CRITERIA_ID)) - .build(); - } + @Autowired + private UserFilterRepository userFilterRepository; + + @Test + public void updateSharing() { + userFilterRepository.updateSharingFlag(Lists.newArrayList(1L), true); + final Optional filter = userFilterRepository.findById(1L); + assertTrue(filter.get().isShared()); + } + + @Test + public void shouldFindByIdAndProjectIdWhenExists() { + Optional userFilter = userFilterRepository.findByIdAndProjectId(1L, 1L); + + assertTrue(userFilter.isPresent()); + } + + @Test + public void shouldNotFindByIdAndProjectIdWhenIdNotExists() { + Optional userFilter = userFilterRepository.findByIdAndProjectId(55L, 1L); + + assertFalse(userFilter.isPresent()); + } + + @Test + public void shouldNotFindByIdAndProjectIdWhenProjectIdNotExists() { + Optional userFilter = userFilterRepository.findByIdAndProjectId(5L, 11L); + + assertFalse(userFilter.isPresent()); + } + + @Test + public void shouldNotFindByIdAndProjectIdWhenIdAndProjectIdNotExist() { + Optional userFilter = userFilterRepository.findByIdAndProjectId(55L, 11L); + + assertFalse(userFilter.isPresent()); + } + + @Test + public void shouldFindByIdsAndProjectIdWhenExists() { + List userFilters = userFilterRepository.findAllByIdInAndProjectId( + Lists.newArrayList(1L, 2L), 1L); + + assertNotNull(userFilters); + assertEquals(2L, userFilters.size()); + } + + @Test + public void shouldNotFindByIdsAndProjectIdWhenProjectIdNotExists() { + List userFilters = userFilterRepository.findAllByIdInAndProjectId( + Lists.newArrayList(1L, 2L), 2L); + + assertNotNull(userFilters); + assertTrue(userFilters.isEmpty()); + } + + @Test + void getSharedFilters() { + Page superadminSharedFilters = userFilterRepository.getShared( + ProjectFilter.of(buildDefaultFilter(), 2L), + PageRequest.of(0, 3), + "superadmin" + ); + assertEquals(0, superadminSharedFilters.getTotalElements(), "Unexpected shared filters count"); + + Page result2 = userFilterRepository.getShared( + ProjectFilter.of(buildDefaultFilter(), 2L), + PageRequest.of(0, 3), + "default" + ); + assertEquals(1, result2.getTotalElements(), "Unexpected shared filters count"); + + final Page jajaSharedFilters = userFilterRepository.getShared( + ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3), + "jaja_user" + ); + assertEquals(1, jajaSharedFilters.getTotalElements(), "Unexpected shared filters count"); + } + + @Test + void getPermittedFilters() { + Page adminPermittedFilters = userFilterRepository.getPermitted( + ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), + "superadmin" + ); + assertEquals(2, adminPermittedFilters.getTotalElements(), "Unexpected shared filters count"); + + Page defaultPermittedFilters = userFilterRepository.getPermitted( + ProjectFilter.of(buildDefaultFilter(), 2L), + PageRequest.of(0, 3), + "default" + ); + assertEquals(2, defaultPermittedFilters.getTotalElements(), "Unexpected shared filters count"); + + final Page jajaPermittedFilters = userFilterRepository.getPermitted( + ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3), + "jaja_user" + ); + assertEquals(1, jajaPermittedFilters.getTotalElements(), "Unexpected shared filters count"); + } + + @Test + void getOwnFilters() { + Page superadminOwnFilters = userFilterRepository.getOwn( + ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3), + "superadmin" + ); + assertEquals(2, superadminOwnFilters.getTotalElements()); + + Page defaultOwnFilters = userFilterRepository.getOwn( + ProjectFilter.of(buildDefaultFilter(), 2L), + PageRequest.of(0, 3), + "default" + ); + assertEquals(2, defaultOwnFilters.getTotalElements(), "Unexpected shared filters count"); + + final Page jajaOwnFilters = userFilterRepository.getOwn( + ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3), + "jaja_user" + ); + assertEquals(0, jajaOwnFilters.getTotalElements(), "Unexpected shared filters count"); + + final Page jajaOwnFiltersOnForeingProject = userFilterRepository.getOwn( + ProjectFilter.of(buildDefaultFilter(), 2L), + PageRequest.of(0, 3), + "jaja_user" + ); + assertEquals(0, jajaOwnFiltersOnForeingProject.getTotalElements(), + "Unexpected shared filters count"); + } + + @Test + void existsByNameAndOwnerAndProjectIdTest() { + assertTrue( + userFilterRepository.existsByNameAndOwnerAndProjectId("Admin Filter", "superadmin", 1L)); + assertTrue( + userFilterRepository.existsByNameAndOwnerAndProjectId("Default Shared Filter", "default", + 2L)); + assertFalse(userFilterRepository.existsByNameAndOwnerAndProjectId("DEMO_FILTER", "yahoo", 1L)); + assertFalse( + userFilterRepository.existsByNameAndOwnerAndProjectId("Admin Filter", "superadmin", 2L)); + } + + @Test + void findAllByProjectId() { + final Long projectId = 1L; + final List filters = userFilterRepository.findAllByProjectId(projectId); + assertNotNull(filters, "Filters not found"); + assertTrue(!filters.isEmpty(), "Filters should not be empty"); + filters.forEach(it -> assertEquals(projectId, it.getProject().getId())); + } + + private Filter buildDefaultFilter() { + return Filter.builder() + .withTarget(UserFilter.class) + .withCondition(new FilterCondition(Condition.LOWER_THAN, false, "1000", CRITERIA_ID)) + .build(); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/dao/UserPreferenceRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/UserPreferenceRepositoryTest.java index 6f269884d..f8e7bcf22 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/UserPreferenceRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/UserPreferenceRepositoryTest.java @@ -16,73 +16,80 @@ package com.epam.ta.reportportal.dao; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.preference.UserPreference; +import java.util.List; +import java.util.Optional; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.jdbc.Sql; -import java.util.List; -import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ihar Kahadouski */ @Sql("/db/fill/shareable/shareable-fill.sql") class UserPreferenceRepositoryTest extends BaseTest { - @Autowired - private UserPreferenceRepository repository; - - @Test - void findByProjectIdAndUserId() { - final Long adminProjectId = 1L; - final Long adminId = 1L; - - final List adminPreferences = repository.findByProjectIdAndUserId(adminProjectId, adminId); - - assertNotNull(adminPreferences); - assertTrue(!adminPreferences.isEmpty()); - adminPreferences.forEach(it -> { - assertEquals(adminId, it.getUser().getId()); - assertEquals(adminProjectId, it.getProject().getId()); - }); - - final Long defaultId = 2L; - final Long defaultProjectId = 2L; - - final List defaultPreferences = repository.findByProjectIdAndUserId(defaultProjectId, defaultId); - - assertNotNull(defaultPreferences); - assertTrue(!defaultPreferences.isEmpty()); - defaultPreferences.forEach(it -> { - assertEquals(defaultId, it.getUser().getId()); - assertEquals(defaultProjectId, it.getProject().getId()); - }); - } - - @Test - void findByProjectIdAndUserIdAndFilterId() { - Optional userPreference = repository.findByProjectIdAndUserIdAndFilterId(1L, 1L, 1L); - assertTrue(userPreference.isPresent()); - } - - @Test - void findByProjectIdAndUserIdAndFilterIdNegative() { - Optional userPreference = repository.findByProjectIdAndUserIdAndFilterId(1L, 1L, 101L); - assertFalse(userPreference.isPresent()); - } - - @Test - void removeByProjectIdAndUserId() { - final Long defaultId = 2L; - final Long defaultProjectId = 2L; - - repository.removeByProjectIdAndUserId(defaultProjectId, defaultId); - - final List defaultPreferences = repository.findByProjectIdAndUserId(defaultProjectId, defaultId); - assertTrue(defaultPreferences.isEmpty()); - } + @Autowired + private UserPreferenceRepository repository; + + @Test + void findByProjectIdAndUserId() { + final Long adminProjectId = 1L; + final Long adminId = 1L; + + final List adminPreferences = repository.findByProjectIdAndUserId( + adminProjectId, adminId); + + assertNotNull(adminPreferences); + assertTrue(!adminPreferences.isEmpty()); + adminPreferences.forEach(it -> { + assertEquals(adminId, it.getUser().getId()); + assertEquals(adminProjectId, it.getProject().getId()); + }); + + final Long defaultId = 2L; + final Long defaultProjectId = 2L; + + final List defaultPreferences = repository.findByProjectIdAndUserId( + defaultProjectId, defaultId); + + assertNotNull(defaultPreferences); + assertTrue(!defaultPreferences.isEmpty()); + defaultPreferences.forEach(it -> { + assertEquals(defaultId, it.getUser().getId()); + assertEquals(defaultProjectId, it.getProject().getId()); + }); + } + + @Test + void findByProjectIdAndUserIdAndFilterId() { + Optional userPreference = repository.findByProjectIdAndUserIdAndFilterId(1L, 1L, + 1L); + assertTrue(userPreference.isPresent()); + } + + @Test + void findByProjectIdAndUserIdAndFilterIdNegative() { + Optional userPreference = repository.findByProjectIdAndUserIdAndFilterId(1L, 1L, + 101L); + assertFalse(userPreference.isPresent()); + } + + @Test + void removeByProjectIdAndUserId() { + final Long defaultId = 2L; + final Long defaultProjectId = 2L; + + repository.removeByProjectIdAndUserId(defaultProjectId, defaultId); + + final List defaultPreferences = repository.findByProjectIdAndUserId( + defaultProjectId, defaultId); + assertTrue(defaultPreferences.isEmpty()); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/UserRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/UserRepositoryTest.java index d2ded2c93..c3b3ffb8b 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/UserRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/UserRepositoryTest.java @@ -16,6 +16,20 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_PROJECT; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_PROJECT_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_EMAIL; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_FULL_NAME; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_LAST_LOGIN; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_USER; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.commons.ReportPortalUser; import com.epam.ta.reportportal.commons.querygen.CompositeFilterCondition; @@ -29,6 +43,13 @@ import com.epam.ta.reportportal.entity.user.User; import com.epam.ta.reportportal.entity.user.UserRole; import com.epam.ta.reportportal.entity.user.UserType; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; import org.assertj.core.util.Sets; import org.hamcrest.Matchers; import org.jooq.Operator; @@ -41,354 +62,362 @@ import org.springframework.data.domain.Sort; import org.springframework.test.context.jdbc.Sql; -import java.util.*; - -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_EMAIL; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ivan Budaev */ @Sql("/db/fill/user/user-fill.sql") class UserRepositoryTest extends BaseTest { - @Autowired - private UserRepository userRepository; - - @Autowired - private ProjectRepository projectRepository; - - @Test - void loadUserByLastLogin() { - //given - long now = new Date().getTime(); - Filter filter = Filter.builder() - .withTarget(User.class) - .withCondition(FilterCondition.builder() - .withCondition(Condition.LOWER_THAN) - .withSearchCriteria(CRITERIA_LAST_LOGIN) - .withValue(String.valueOf(now)) - .build()) - .withCondition(FilterCondition.builder().eq(CRITERIA_PROJECT_ID, "3").build()) - .build(); - //when - List users = userRepository.findByFilter(filter); - //then - assertThat("Users should exist", users.size(), Matchers.greaterThan(0)); - users.forEach(user -> assertThat("Last login should be lower than in the filer", - Long.parseLong((String) user.getMetadata().getMetadata().get("last_login")), - Matchers.lessThan(now) - )); - } - - @Test - void loadUserNameByProject() { - //given - String term = "admin"; - //when - List userNames = userRepository.findNamesByProject(1L, term); - //then - assertThat("User names not found", userNames, Matchers.notNullValue()); - assertThat("Incorrect size of user names", userNames, Matchers.hasSize(1)); - userNames.forEach(name -> assertThat("Name doesn't contain specified 'admin' term", name, Matchers.containsString(term))); - } - - @Test - void negativeLoadUserNamesByProject() { - //given - String term = "negative"; - //when - List userNames = userRepository.findNamesByProject(1L, term); - //then - assertThat("Result contains user names", userNames, Matchers.empty()); - } - - @Test - void loadUsersByFilterForProject() { - //given - Filter filter = buildDefaultUserFilter(); - filter.withCondition(new FilterCondition(Condition.EQUALS, false, "3", CRITERIA_PROJECT_ID)); - //when - List users = userRepository.findByFilterExcluding(filter, PageRequest.of(0, 5), "email").getContent(); - //then - assertThat("Users not found", users, Matchers.notNullValue()); - assertThat("Incorrect size of founded users", users, Matchers.hasSize(3)); - users.forEach(it -> assertNull(it.getEmail())); - } - - @Test - void findByEmail() { - final String email = "chybaka@domain.com"; - - Optional user = userRepository.findByEmail(email); - - assertTrue(user.isPresent(), "User not found"); - assertThat("Emails are not equal", user.get().getEmail(), Matchers.equalTo(email)); - } - - @Test - void findIdByLogin() { - - Optional userId = userRepository.findIdByLoginForUpdate("han_solo"); - assertTrue(userId.isPresent(), "User not found"); - } - - @Test - void findUserDetailsInfoByLogin() { - Optional chubaka = userRepository.findUserDetails("chubaka"); - assertTrue(chubaka.isPresent(), "User not found"); - assertThat(chubaka.get().getUsername(), Matchers.equalTo("chubaka")); - assertThat(chubaka.get().getUserId(), Matchers.notNullValue()); - assertThat(chubaka.get().getPassword(), Matchers.equalTo("601c4731aeff3b84f76672ad024bb2a0")); - assertThat(chubaka.get().getEmail(), Matchers.equalTo("chybaka@domain.com")); - assertThat(chubaka.get().getUserRole(), Matchers.equalTo(UserRole.USER)); - assertThat(chubaka.get().getProjectDetails(), Matchers.hasKey("millennium_falcon")); - ReportPortalUser.ProjectDetails project = chubaka.get().getProjectDetails().get("millennium_falcon"); - assertThat(project.getProjectId(), Matchers.equalTo(3L)); - assertThat(project.getProjectName(), Matchers.equalTo("millennium_falcon")); - assertThat(project.getProjectRole(), Matchers.equalTo(ProjectRole.MEMBER)); - } - - @Test - void shouldFindReportPortalUserByLogin() { - Optional chubaka = userRepository.findReportPortalUser("chubaka"); - assertTrue(chubaka.isPresent(), "User not found"); - assertThat(chubaka.get().getUsername(), Matchers.equalTo("chubaka")); - assertThat(chubaka.get().getUserId(), Matchers.notNullValue()); - assertThat(chubaka.get().getPassword(), Matchers.equalTo("601c4731aeff3b84f76672ad024bb2a0")); - assertThat(chubaka.get().getEmail(), Matchers.equalTo("chybaka@domain.com")); - assertThat(chubaka.get().getUserRole(), Matchers.equalTo(UserRole.USER)); - } - - @Test - void shouldNotFindReportPortalUserByLoginWhenNotExists() { - Optional user = userRepository.findReportPortalUser("not existing user"); - assertFalse(user.isPresent(), "User found"); - } - - @Test - void findByLogin() { - final String login = "han_solo"; - - Optional user = userRepository.findByLogin(login); - - assertTrue(user.isPresent(), "User not found"); - assertThat("Emails are not equal", user.get().getLogin(), Matchers.equalTo(login)); - } - - @Test - void findAllByEmailIn() { - List emails = Arrays.asList("han_solo@domain.com", "chybaka@domain.com"); - - List users = userRepository.findAllByEmailIn(emails); - - assertThat("Users not found", users, Matchers.notNullValue()); - assertThat("Incorrect size of users", users, Matchers.hasSize(2)); - assertTrue(users.stream().anyMatch(u -> u.getEmail().equalsIgnoreCase(emails.get(0))), "Incorrect user email"); - assertTrue(users.stream().anyMatch(u -> u.getEmail().equalsIgnoreCase(emails.get(1))), "Incorrect user email"); - } - - @Test - void findAllByLoginIn() { - final String hanLogin = "han_solo"; - final String defaultLogin = "default"; - Set logins = Sets.newHashSet(Arrays.asList(hanLogin, defaultLogin)); - - List users = userRepository.findAllByLoginIn(logins); - - assertThat("Users not found", users, Matchers.notNullValue()); - assertThat("Incorrect size of users", users, Matchers.hasSize(2)); - assertTrue(users.stream().anyMatch(u -> u.getLogin().equalsIgnoreCase(hanLogin)), "Incorrect user login"); - assertTrue(users.stream().anyMatch(u -> u.getLogin().equalsIgnoreCase(defaultLogin)), "Incorrect user login"); - } - - @Test - void findAllByRole() { - List users = userRepository.findAllByRole(UserRole.USER); - - assertEquals(4, users.size()); - users.forEach(it -> assertEquals(UserRole.USER, it.getRole())); - } - - @Test - void findAllByUserTypeAndExpired() { - Page users = userRepository.findAllByUserTypeAndExpired(UserType.INTERNAL, false, Pageable.unpaged()); - - assertNotNull(users); - assertEquals(6, users.getNumberOfElements()); - } - - @Test - void searchForUserTest() { - Filter filter = Filter.builder() - .withTarget(User.class) - .withCondition(new FilterCondition(Condition.CONTAINS, false, "chuba", CRITERIA_USER)) - .build(); - Page users = userRepository.findByFilter(filter, PageRequest.of(0, 5)); - assertEquals(2, users.getTotalElements()); - } - - @Test - void searchForUserTestWithNoResults() { - Filter filter = Filter.builder() - .withTarget(User.class) - .withCondition(new FilterCondition(Condition.CONTAINS, false, "_ub", CRITERIA_USER)) - .build(); - Page users = userRepository.findByFilter(filter, PageRequest.of(0, 5)); - assertEquals(0, users.getTotalElements()); - } - - @Test - void usersWithProjectSort() { - Filter filter = Filter.builder() - .withTarget(User.class) - .withCondition(new FilterCondition(Condition.CONTAINS, false, "chuba", CRITERIA_USER)) - .build(); - PageRequest pageRequest = PageRequest.of(0, 5, Sort.Direction.ASC, CRITERIA_PROJECT); - Page result = userRepository.findByFilter(filter, pageRequest); - assertEquals(2, result.getTotalElements()); - } - - @Test - void findByFilterExcludingProjects() { - final CompositeFilterCondition userCondition = new CompositeFilterCondition(List.of(new FilterCondition(Operator.OR, - Condition.CONTAINS, - false, - "ch", - CRITERIA_USER - ), - new FilterCondition(Operator.OR, Condition.CONTAINS, false, "ch", CRITERIA_FULL_NAME), - new FilterCondition(Operator.OR, Condition.CONTAINS, false, "ch", CRITERIA_EMAIL) - ), Operator.AND); - - Filter filter = Filter.builder() - .withTarget(User.class) - .withCondition(userCondition) - .withCondition(new FilterCondition(Operator.AND, Condition.ANY, true, "superadmin_personal", CRITERIA_PROJECT)) - .build(); - - Page users = userRepository.findByFilterExcludingProjects(filter, PageRequest.of(0, 5)); - assertEquals(3, users.getTotalElements()); - } - - @Test - void shouldNotFindByFilterExcludingProjects() { - final CompositeFilterCondition userCondition = new CompositeFilterCondition(List.of(new FilterCondition(Operator.OR, - Condition.CONTAINS, - false, - "ch", - CRITERIA_USER - ), - new FilterCondition(Operator.OR, Condition.CONTAINS, false, "ch", CRITERIA_FULL_NAME), - new FilterCondition(Operator.OR, Condition.CONTAINS, false, "ch", CRITERIA_EMAIL) - ), Operator.AND); - - Filter filter = Filter.builder() - .withTarget(User.class) - .withCondition(userCondition) - .withCondition(new FilterCondition(Operator.AND, Condition.ANY, true, "millennium_falcon", CRITERIA_PROJECT)) - .build(); - - Page users = userRepository.findByFilterExcludingProjects(filter, PageRequest.of(0, 5)); - assertEquals(1, users.getTotalElements()); - } - - @Test - void shouldFindRawById() { - final Optional user = userRepository.findRawById(1L); - assertTrue(user.isPresent()); - assertEquals(1L, user.get().getId()); - assertEquals("superadmin", user.get().getLogin()); - assertTrue(user.get().getProjects().isEmpty()); - } - - @Test - void shouldNotFindRawById() { - final Optional user = userRepository.findRawById(123L); - assertTrue(user.isEmpty()); - } - - @SuppressWarnings("OptionalGetWithoutIsPresent") - @Test - void createUserTest() { - User reg = new User(); - - reg.setEmail("email.com"); - reg.setFullName("test"); - reg.setLogin("created"); - reg.setPassword("new"); - reg.setUserType(UserType.INTERNAL); - reg.setRole(UserRole.USER); - - Map map = new HashMap<>(); - map.put("last_login", new Date()); - reg.setMetadata(new Metadata(map)); - - Project defaultProject = projectRepository.findByName("superadmin_personal").get(); - Set projectUsers = defaultProject.getUsers(); - - projectUsers.add(new ProjectUser().withProjectRole(ProjectRole.CUSTOMER).withUser(reg).withProject(defaultProject)); - defaultProject.setUsers(projectUsers); - - userRepository.save(reg); - - final Optional created = userRepository.findByLogin("created"); - assertTrue(created.isPresent()); - } - - @Test - void findUsernamesWithProjectRolesByProjectIdTest() { - - Map usernamesWithProjectRoles = userRepository.findUsernamesWithProjectRolesByProjectId(3L); - - assertNotNull(usernamesWithProjectRoles); - assertFalse(usernamesWithProjectRoles.isEmpty()); - assertEquals(3L, usernamesWithProjectRoles.size()); - - usernamesWithProjectRoles.values().forEach(Assertions::assertNotNull); - } - - @Test - void findAllMembersByProjectManagerRole() { - List emails = userRepository.findEmailsByProjectAndRole(1L, ProjectRole.PROJECT_MANAGER); - - assertFalse(emails.isEmpty()); - - emails.forEach(e -> { - User user = userRepository.findByEmail(e).get(); - assertEquals(ProjectRole.PROJECT_MANAGER, - user.getProjects() - .stream() - .filter(it -> it.getId().getProjectId().equals(1L)) - .map(ProjectUser::getProjectRole) - .findFirst() - .get() - ); - }); - } - - @Test - void findAllMembersByMemberRole() { - List emails = userRepository.findEmailsByProjectAndRole(1L, ProjectRole.MEMBER); - - assertTrue(emails.isEmpty()); - } - - @Test - void findAllMembersByProject() { - List emails = userRepository.findEmailsByProject(1L); - - assertFalse(emails.isEmpty()); - assertEquals(1, emails.size()); - } - - private Filter buildDefaultUserFilter() { - return Filter.builder() - .withTarget(User.class) - .withCondition(new FilterCondition(Condition.LOWER_THAN_OR_EQUALS, false, "1000", CRITERIA_ID)) - .build(); - } + @Autowired + private UserRepository userRepository; + + @Autowired + private ProjectRepository projectRepository; + + @Test + void loadUserByLastLogin() { + //given + long now = new Date().getTime(); + Filter filter = Filter.builder() + .withTarget(User.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.LOWER_THAN) + .withSearchCriteria(CRITERIA_LAST_LOGIN) + .withValue(String.valueOf(now)) + .build()) + .withCondition(FilterCondition.builder().eq(CRITERIA_PROJECT_ID, "3").build()) + .build(); + //when + List users = userRepository.findByFilter(filter); + //then + assertThat("Users should exist", users.size(), Matchers.greaterThan(0)); + users.forEach(user -> assertThat("Last login should be lower than in the filer", + Long.parseLong((String) user.getMetadata().getMetadata().get("last_login")), + Matchers.lessThan(now) + )); + } + + @Test + void loadUserNameByProject() { + //given + String term = "admin"; + //when + List userNames = userRepository.findNamesByProject(1L, term); + //then + assertThat("User names not found", userNames, Matchers.notNullValue()); + assertThat("Incorrect size of user names", userNames, Matchers.hasSize(1)); + userNames.forEach(name -> assertThat("Name doesn't contain specified 'admin' term", name, + Matchers.containsString(term))); + } + + @Test + void negativeLoadUserNamesByProject() { + //given + String term = "negative"; + //when + List userNames = userRepository.findNamesByProject(1L, term); + //then + assertThat("Result contains user names", userNames, Matchers.empty()); + } + + @Test + void loadUsersByFilterForProject() { + //given + Filter filter = buildDefaultUserFilter(); + filter.withCondition(new FilterCondition(Condition.EQUALS, false, "3", CRITERIA_PROJECT_ID)); + //when + List users = userRepository.findByFilterExcluding(filter, PageRequest.of(0, 5), "email") + .getContent(); + //then + assertThat("Users not found", users, Matchers.notNullValue()); + assertThat("Incorrect size of founded users", users, Matchers.hasSize(3)); + users.forEach(it -> assertNull(it.getEmail())); + } + + @Test + void findByEmail() { + final String email = "chybaka@domain.com"; + + Optional user = userRepository.findByEmail(email); + + assertTrue(user.isPresent(), "User not found"); + assertThat("Emails are not equal", user.get().getEmail(), Matchers.equalTo(email)); + } + + @Test + void findIdByLogin() { + + Optional userId = userRepository.findIdByLoginForUpdate("han_solo"); + assertTrue(userId.isPresent(), "User not found"); + } + + @Test + void findUserDetailsInfoByLogin() { + Optional chubaka = userRepository.findUserDetails("chubaka"); + assertTrue(chubaka.isPresent(), "User not found"); + assertThat(chubaka.get().getUsername(), Matchers.equalTo("chubaka")); + assertThat(chubaka.get().getUserId(), Matchers.notNullValue()); + assertThat(chubaka.get().getPassword(), Matchers.equalTo("601c4731aeff3b84f76672ad024bb2a0")); + assertThat(chubaka.get().getEmail(), Matchers.equalTo("chybaka@domain.com")); + assertThat(chubaka.get().getUserRole(), Matchers.equalTo(UserRole.USER)); + assertThat(chubaka.get().getProjectDetails(), Matchers.hasKey("millennium_falcon")); + ReportPortalUser.ProjectDetails project = chubaka.get().getProjectDetails() + .get("millennium_falcon"); + assertThat(project.getProjectId(), Matchers.equalTo(3L)); + assertThat(project.getProjectName(), Matchers.equalTo("millennium_falcon")); + assertThat(project.getProjectRole(), Matchers.equalTo(ProjectRole.MEMBER)); + } + + @Test + void shouldFindReportPortalUserByLogin() { + Optional chubaka = userRepository.findReportPortalUser("chubaka"); + assertTrue(chubaka.isPresent(), "User not found"); + assertThat(chubaka.get().getUsername(), Matchers.equalTo("chubaka")); + assertThat(chubaka.get().getUserId(), Matchers.notNullValue()); + assertThat(chubaka.get().getPassword(), Matchers.equalTo("601c4731aeff3b84f76672ad024bb2a0")); + assertThat(chubaka.get().getEmail(), Matchers.equalTo("chybaka@domain.com")); + assertThat(chubaka.get().getUserRole(), Matchers.equalTo(UserRole.USER)); + } + + @Test + void shouldNotFindReportPortalUserByLoginWhenNotExists() { + Optional user = userRepository.findReportPortalUser("not existing user"); + assertFalse(user.isPresent(), "User found"); + } + + @Test + void findByLogin() { + final String login = "han_solo"; + + Optional user = userRepository.findByLogin(login); + + assertTrue(user.isPresent(), "User not found"); + assertThat("Emails are not equal", user.get().getLogin(), Matchers.equalTo(login)); + } + + @Test + void findAllByEmailIn() { + List emails = Arrays.asList("han_solo@domain.com", "chybaka@domain.com"); + + List users = userRepository.findAllByEmailIn(emails); + + assertThat("Users not found", users, Matchers.notNullValue()); + assertThat("Incorrect size of users", users, Matchers.hasSize(2)); + assertTrue(users.stream().anyMatch(u -> u.getEmail().equalsIgnoreCase(emails.get(0))), + "Incorrect user email"); + assertTrue(users.stream().anyMatch(u -> u.getEmail().equalsIgnoreCase(emails.get(1))), + "Incorrect user email"); + } + + @Test + void findAllByLoginIn() { + final String hanLogin = "han_solo"; + final String defaultLogin = "default"; + Set logins = Sets.newHashSet(Arrays.asList(hanLogin, defaultLogin)); + + List users = userRepository.findAllByLoginIn(logins); + + assertThat("Users not found", users, Matchers.notNullValue()); + assertThat("Incorrect size of users", users, Matchers.hasSize(2)); + assertTrue(users.stream().anyMatch(u -> u.getLogin().equalsIgnoreCase(hanLogin)), + "Incorrect user login"); + assertTrue(users.stream().anyMatch(u -> u.getLogin().equalsIgnoreCase(defaultLogin)), + "Incorrect user login"); + } + + @Test + void findAllByRole() { + List users = userRepository.findAllByRole(UserRole.USER); + + assertEquals(4, users.size()); + users.forEach(it -> assertEquals(UserRole.USER, it.getRole())); + } + + @Test + void findAllByUserTypeAndExpired() { + Page users = userRepository.findAllByUserTypeAndExpired(UserType.INTERNAL, false, + Pageable.unpaged()); + + assertNotNull(users); + assertEquals(6, users.getNumberOfElements()); + } + + @Test + void searchForUserTest() { + Filter filter = Filter.builder() + .withTarget(User.class) + .withCondition(new FilterCondition(Condition.CONTAINS, false, "chuba", CRITERIA_USER)) + .build(); + Page users = userRepository.findByFilter(filter, PageRequest.of(0, 5)); + assertEquals(2, users.getTotalElements()); + } + + @Test + void searchForUserTestWithNoResults() { + Filter filter = Filter.builder() + .withTarget(User.class) + .withCondition(new FilterCondition(Condition.CONTAINS, false, "_ub", CRITERIA_USER)) + .build(); + Page users = userRepository.findByFilter(filter, PageRequest.of(0, 5)); + assertEquals(0, users.getTotalElements()); + } + + @Test + void usersWithProjectSort() { + Filter filter = Filter.builder() + .withTarget(User.class) + .withCondition(new FilterCondition(Condition.CONTAINS, false, "chuba", CRITERIA_USER)) + .build(); + PageRequest pageRequest = PageRequest.of(0, 5, Sort.Direction.ASC, CRITERIA_PROJECT); + Page result = userRepository.findByFilter(filter, pageRequest); + assertEquals(2, result.getTotalElements()); + } + + @Test + void findByFilterExcludingProjects() { + final CompositeFilterCondition userCondition = new CompositeFilterCondition( + List.of(new FilterCondition(Operator.OR, + Condition.CONTAINS, + false, + "ch", + CRITERIA_USER + ), + new FilterCondition(Operator.OR, Condition.CONTAINS, false, "ch", CRITERIA_FULL_NAME), + new FilterCondition(Operator.OR, Condition.CONTAINS, false, "ch", CRITERIA_EMAIL) + ), Operator.AND); + + Filter filter = Filter.builder() + .withTarget(User.class) + .withCondition(userCondition) + .withCondition(new FilterCondition(Operator.AND, Condition.ANY, true, "superadmin_personal", + CRITERIA_PROJECT)) + .build(); + + Page users = userRepository.findByFilterExcludingProjects(filter, PageRequest.of(0, 5)); + assertEquals(3, users.getTotalElements()); + } + + @Test + void shouldNotFindByFilterExcludingProjects() { + final CompositeFilterCondition userCondition = new CompositeFilterCondition( + List.of(new FilterCondition(Operator.OR, + Condition.CONTAINS, + false, + "ch", + CRITERIA_USER + ), + new FilterCondition(Operator.OR, Condition.CONTAINS, false, "ch", CRITERIA_FULL_NAME), + new FilterCondition(Operator.OR, Condition.CONTAINS, false, "ch", CRITERIA_EMAIL) + ), Operator.AND); + + Filter filter = Filter.builder() + .withTarget(User.class) + .withCondition(userCondition) + .withCondition(new FilterCondition(Operator.AND, Condition.ANY, true, "millennium_falcon", + CRITERIA_PROJECT)) + .build(); + + Page users = userRepository.findByFilterExcludingProjects(filter, PageRequest.of(0, 5)); + assertEquals(1, users.getTotalElements()); + } + + @Test + void shouldFindRawById() { + final Optional user = userRepository.findRawById(1L); + assertTrue(user.isPresent()); + assertEquals(1L, user.get().getId()); + assertEquals("superadmin", user.get().getLogin()); + assertTrue(user.get().getProjects().isEmpty()); + } + + @Test + void shouldNotFindRawById() { + final Optional user = userRepository.findRawById(123L); + assertTrue(user.isEmpty()); + } + + @SuppressWarnings("OptionalGetWithoutIsPresent") + @Test + void createUserTest() { + User reg = new User(); + + reg.setEmail("email.com"); + reg.setFullName("test"); + reg.setLogin("created"); + reg.setPassword("new"); + reg.setUserType(UserType.INTERNAL); + reg.setRole(UserRole.USER); + + Map map = new HashMap<>(); + map.put("last_login", new Date()); + reg.setMetadata(new Metadata(map)); + + Project defaultProject = projectRepository.findByName("superadmin_personal").get(); + Set projectUsers = defaultProject.getUsers(); + + projectUsers.add(new ProjectUser().withProjectRole(ProjectRole.CUSTOMER).withUser(reg) + .withProject(defaultProject)); + defaultProject.setUsers(projectUsers); + + userRepository.save(reg); + + final Optional created = userRepository.findByLogin("created"); + assertTrue(created.isPresent()); + } + + @Test + void findUsernamesWithProjectRolesByProjectIdTest() { + + Map usernamesWithProjectRoles = userRepository.findUsernamesWithProjectRolesByProjectId( + 3L); + + assertNotNull(usernamesWithProjectRoles); + assertFalse(usernamesWithProjectRoles.isEmpty()); + assertEquals(3L, usernamesWithProjectRoles.size()); + + usernamesWithProjectRoles.values().forEach(Assertions::assertNotNull); + } + + @Test + void findAllMembersByProjectManagerRole() { + List emails = userRepository.findEmailsByProjectAndRole(1L, + ProjectRole.PROJECT_MANAGER); + + assertFalse(emails.isEmpty()); + + emails.forEach(e -> { + User user = userRepository.findByEmail(e).get(); + assertEquals(ProjectRole.PROJECT_MANAGER, + user.getProjects() + .stream() + .filter(it -> it.getId().getProjectId().equals(1L)) + .map(ProjectUser::getProjectRole) + .findFirst() + .get() + ); + }); + } + + @Test + void findAllMembersByMemberRole() { + List emails = userRepository.findEmailsByProjectAndRole(1L, ProjectRole.MEMBER); + + assertTrue(emails.isEmpty()); + } + + @Test + void findAllMembersByProject() { + List emails = userRepository.findEmailsByProject(1L); + + assertFalse(emails.isEmpty()); + assertEquals(1, emails.size()); + } + + private Filter buildDefaultUserFilter() { + return Filter.builder() + .withTarget(User.class) + .withCondition( + new FilterCondition(Condition.LOWER_THAN_OR_EQUALS, false, "1000", CRITERIA_ID)) + .build(); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java index 577df604c..c2f789269 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java @@ -15,6 +15,37 @@ */ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.CRITERIA_ACTION; +import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.CRITERIA_CREATION_DATE; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_DESCRIPTION; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_END_TIME; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_LAST_MODIFIED; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_LAUNCH_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_NAME; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_PROJECT_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_START_TIME; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_COMPOSITE_ATTRIBUTE; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_ITEM_ATTRIBUTE_KEY; +import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; +import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_STATUS; +import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_USER; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.DEFECTS_KEY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.DELTA; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.EXECUTIONS_KEY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.EXECUTIONS_TOTAL; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.INVESTIGATED; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.NAME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.NOT_PASSED_STATISTICS_KEY; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.TOTAL; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.TO_INVESTIGATE; +import static com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum.AFTER_METHOD; +import static com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum.BEFORE_METHOD; +import static com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum.STEP; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.commons.querygen.Condition; import com.epam.ta.reportportal.commons.querygen.ConvertibleCondition; @@ -24,13 +55,36 @@ import com.epam.ta.reportportal.entity.enums.StatusEnum; import com.epam.ta.reportportal.entity.item.TestItem; import com.epam.ta.reportportal.entity.launch.Launch; -import com.epam.ta.reportportal.entity.widget.content.*; -import com.epam.ta.reportportal.entity.widget.content.healthcheck.*; +import com.epam.ta.reportportal.entity.widget.content.ChartStatisticsContent; +import com.epam.ta.reportportal.entity.widget.content.CriteriaHistoryItem; +import com.epam.ta.reportportal.entity.widget.content.FlakyCasesTableContent; +import com.epam.ta.reportportal.entity.widget.content.LaunchesDurationContent; +import com.epam.ta.reportportal.entity.widget.content.LaunchesTableContent; +import com.epam.ta.reportportal.entity.widget.content.MostTimeConsumingTestCasesContent; +import com.epam.ta.reportportal.entity.widget.content.NotPassedCasesContent; +import com.epam.ta.reportportal.entity.widget.content.OverallStatisticsContent; +import com.epam.ta.reportportal.entity.widget.content.PassingRateStatisticsResult; +import com.epam.ta.reportportal.entity.widget.content.ProductStatusStatisticsContent; +import com.epam.ta.reportportal.entity.widget.content.TopPatternTemplatesContent; +import com.epam.ta.reportportal.entity.widget.content.UniqueBugContent; +import com.epam.ta.reportportal.entity.widget.content.healthcheck.ComponentHealthCheckContent; +import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableContent; +import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableGetParams; +import com.epam.ta.reportportal.entity.widget.content.healthcheck.HealthCheckTableInitParams; +import com.epam.ta.reportportal.entity.widget.content.healthcheck.LevelEntry; import com.epam.ta.reportportal.jooq.enums.JStatusEnum; import com.epam.ta.reportportal.ws.model.ActivityResource; import com.epam.ta.reportportal.ws.model.launch.Mode; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; import org.assertj.core.util.Lists; import org.jooq.DSLContext; import org.jooq.Record; @@ -41,1239 +95,1329 @@ import org.springframework.data.domain.Sort; import org.springframework.test.context.jdbc.Sql; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.CRITERIA_ACTION; -import static com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant.CRITERIA_CREATION_DATE; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.*; -import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_COMPOSITE_ATTRIBUTE; -import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_ITEM_ATTRIBUTE_KEY; -import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; -import static com.epam.ta.reportportal.commons.querygen.constant.TestItemCriteriaConstant.CRITERIA_STATUS; -import static com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_USER; -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; -import static com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum.*; -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ivan Budayeu */ @Sql("/db/fill/widget-content/widget-content-fill.sql") class WidgetContentRepositoryTest extends BaseTest { - @Autowired - private LaunchRepository launchRepository; - - @Autowired - private WidgetContentRepository widgetContentRepository; - - @Autowired - private DSLContext dslContext; - - @Test - void overallStatisticsContent() { - String sortingColumn = "statistics$defects$no_defect$nd001"; - Filter filter = buildDefaultFilter(1L); - List contentFields = buildContentFields(); - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, sortingColumn))); - - OverallStatisticsContent overallStatisticsContent = widgetContentRepository.overallStatisticsContent(filter, - sort, - contentFields, - false, - 4 - ); - - assertEquals(48, (long) overallStatisticsContent.getValues().get("statistics$executions$total")); - assertEquals(13, (long) overallStatisticsContent.getValues().get("statistics$executions$passed")); - assertEquals(13, (long) overallStatisticsContent.getValues().get("statistics$executions$skipped")); - assertEquals(22, (long) overallStatisticsContent.getValues().get("statistics$executions$failed")); - assertEquals(9, (long) overallStatisticsContent.getValues().get("statistics$defects$to_investigate$total")); - assertEquals(16, (long) overallStatisticsContent.getValues().get("statistics$defects$system_issue$total")); - assertEquals(11, (long) overallStatisticsContent.getValues().get("statistics$defects$automation_bug$total")); - assertEquals(17, (long) overallStatisticsContent.getValues().get("statistics$defects$product_bug$total")); - assertEquals(11, (long) overallStatisticsContent.getValues().get("statistics$defects$no_defect$total")); - assertEquals(9, (long) overallStatisticsContent.getValues().get("statistics$defects$to_investigate$ti001")); - assertEquals(16, (long) overallStatisticsContent.getValues().get("statistics$defects$system_issue$si001")); - assertEquals(11, (long) overallStatisticsContent.getValues().get("statistics$defects$automation_bug$ab001")); - assertEquals(17, (long) overallStatisticsContent.getValues().get("statistics$defects$product_bug$pb001")); - assertEquals(11, (long) overallStatisticsContent.getValues().get("statistics$defects$no_defect$nd001")); - } - - @Test - void mostFailedByDefectCriteria() { - - String defect = "statistics$executions$failed"; - - Filter filter = buildDefaultFilter(1L); - - List criteriaHistoryItems = widgetContentRepository.topItemsByCriteria(filter, defect, 10, false); - - assertNotNull(criteriaHistoryItems); - assertEquals(1, criteriaHistoryItems.size()); - } - - @Test - void launchStatistics() { - - String sortingColumn = "statistics$defects$no_defect$nd001"; - - Filter filter = buildDefaultFilter(1L); - List contentFields = buildContentFields(); - - List orderings = Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, sortingColumn), - new Sort.Order(Sort.Direction.DESC, CRITERIA_START_TIME) - ); - - Sort sort = Sort.by(orderings); - - List chartStatisticsContents = widgetContentRepository.launchStatistics(filter, contentFields, sort, 4); - assertNotNull(chartStatisticsContents); - assertEquals(4, chartStatisticsContents.size()); - - assertEquals(chartStatisticsContents.get(0).getValues().get(sortingColumn), String.valueOf(6)); - assertEquals(chartStatisticsContents.get(chartStatisticsContents.size() - 1).getValues().get(sortingColumn), String.valueOf(1)); - } - - @Test - void investigatedStatistics() { - - Map> statistics = buildTotalDefectsMap(); - - String sortingColumn = "statistics$defects$no_defect$nd001"; - - Filter filter = buildDefaultFilter(1L); - - List orderings = Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, sortingColumn)); - - Sort sort = Sort.by(orderings); - - List chartStatisticsContents = widgetContentRepository.investigatedStatistics(filter, sort, 4); - assertNotNull(chartStatisticsContents); - assertEquals(4, chartStatisticsContents.size()); - - chartStatisticsContents.forEach(res -> { - Map stats = statistics.get(res.getId()); - int sum = stats.values().stream().mapToInt(Integer::intValue).sum(); - assertEquals(100.0, - Double.parseDouble(res.getValues().get(TO_INVESTIGATE)) + Double.parseDouble(res.getValues().get(INVESTIGATED)), - 0.01 - ); - assertEquals(Double.parseDouble(res.getValues().get(TO_INVESTIGATE)), - BigDecimal.valueOf((double) 100 * stats.get("statistics$defects$to_investigate$total") / sum) - .setScale(2, RoundingMode.HALF_UP) - .doubleValue(), - 0.01 - ); - }); - } - - @Test - void timelineInvestigatedStatistics() { - - Filter filter = buildDefaultFilter(1L); - - List orderings = Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, CRITERIA_ITEM_ATTRIBUTE_KEY)); - - Sort sort = Sort.by(orderings); - - List chartStatisticsContents = widgetContentRepository.timelineInvestigatedStatistics(filter, sort, 4); - assertNotNull(chartStatisticsContents); - assertEquals(4, chartStatisticsContents.size()); - } - - @Test - void launchPassPerLaunchStatistics() { - Filter filter = buildDefaultFilter(1L); - - filter.withCondition(new FilterCondition(Condition.EQUALS, false, "launch name 1", CRITERIA_NAME)); - - final Launch launch = launchRepository.findLatestByFilter(filter).get(); - - PassingRateStatisticsResult passStatisticsResult = widgetContentRepository.passingRatePerLaunchStatistics(launch.getId()); - - assertNotNull(passStatisticsResult); - assertEquals(4L, passStatisticsResult.getId()); - assertEquals(4, passStatisticsResult.getNumber()); - assertEquals(3, passStatisticsResult.getPassed()); - assertEquals(12, passStatisticsResult.getTotal()); - } - - @Test - void summaryPassStatistics() { - Filter filter = buildDefaultFilter(1L); - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); - - PassingRateStatisticsResult passStatisticsResult = widgetContentRepository.summaryPassingRateStatistics(filter, sort, 4); - - assertNotNull(passStatisticsResult); - assertEquals(4, passStatisticsResult.getNumber()); - assertEquals(13, passStatisticsResult.getPassed()); - assertEquals(48, passStatisticsResult.getTotal()); - } - - @Test - void casesTrendStatistics() { - Filter filter = buildDefaultFilter(1L); - String executionContentField = "statistics$executions$total"; - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); - - List chartStatisticsContents = widgetContentRepository.casesTrendStatistics(filter, - executionContentField, - sort, - 4 - ); - - assertNotNull(chartStatisticsContents); - assertEquals(4, chartStatisticsContents.size()); - - int firstElementDelta = Integer.parseInt(chartStatisticsContents.get(0).getValues().get(DELTA)); - int secondElementDelta = Integer.parseInt(chartStatisticsContents.get(1).getValues().get(executionContentField)) - Integer.parseInt( - chartStatisticsContents.get(0).getValues().get(executionContentField)); - int thirdElementDelta = Integer.parseInt(chartStatisticsContents.get(2).getValues().get(executionContentField)) - Integer.parseInt( - chartStatisticsContents.get(1).getValues().get(executionContentField)); - int fourthElementDelta = Integer.parseInt(chartStatisticsContents.get(3).getValues().get(executionContentField)) - Integer.parseInt( - chartStatisticsContents.get(2).getValues().get(executionContentField)); - - assertEquals(0, firstElementDelta); - assertEquals(1, secondElementDelta); - assertEquals(4, thirdElementDelta); - assertEquals(-3, fourthElementDelta); - - } - - @Test - void bugTrendStatistics() { - Map> statistics = buildTotalDefectsMap(); - Filter filter = buildDefaultFilter(1L); - List contentFields = buildTotalDefectsContentFields(); - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); - - List chartStatisticsContents = widgetContentRepository.bugTrendStatistics(filter, contentFields, sort, 4); - - assertNotNull(chartStatisticsContents); - assertEquals(4, chartStatisticsContents.size()); - - chartStatisticsContents.forEach(res -> { - Map stats = statistics.get(res.getId()); - Map resStatistics = res.getValues(); - - long total = stats.values().stream().mapToInt(Integer::intValue).sum(); - - stats.keySet().forEach(key -> assertEquals((long) stats.get(key), (long) Integer.parseInt(resStatistics.get(key)))); - - assertEquals(String.valueOf(total), resStatistics.get(TOTAL)); - }); - } - - @Test - void launchesComparisonStatistics() { - Filter filter = buildDefaultFilter(1L); - List contentFields = buildTotalContentFields(); - filter = filter.withConditions(Lists.newArrayList(new FilterCondition(Condition.EQUALS, false, "launch name 1", NAME))); - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); - - List chartStatisticsContents = widgetContentRepository.launchesComparisonStatistics(filter, - contentFields, - sort, - 2 - ); - - assertNotNull(chartStatisticsContents); - assertEquals(2, chartStatisticsContents.size()); - - chartStatisticsContents.forEach(res -> { - Map currStatistics = res.getValues(); - Map> preDefinedStatistics = buildLaunchesComparisonStatistics(); - - Map testStatistics = preDefinedStatistics.get(res.getId()); - int executionsSum = testStatistics.entrySet() - .stream() - .filter(entry -> entry.getKey().contains(EXECUTIONS_KEY) && !entry.getKey().equalsIgnoreCase(EXECUTIONS_TOTAL)) - .mapToInt(Map.Entry::getValue) - .sum(); - int defectsSum = testStatistics.entrySet() - .stream() - .filter(entry -> entry.getKey().contains(DEFECTS_KEY)) - .mapToInt(Map.Entry::getValue) - .sum(); - - currStatistics.keySet() - .stream() - .filter(key -> key.contains(EXECUTIONS_KEY) && !key.equalsIgnoreCase(EXECUTIONS_TOTAL)) - .forEach(key -> assertEquals(Double.parseDouble(currStatistics.get(key)), - BigDecimal.valueOf((double) 100 * testStatistics.get(key) / executionsSum) - .setScale(2, RoundingMode.HALF_UP) - .doubleValue(), - 0.01 - )); - - assertEquals((double) testStatistics.get(EXECUTIONS_TOTAL), Double.parseDouble(currStatistics.get(EXECUTIONS_TOTAL)), 0.01); - - currStatistics.keySet() - .stream() - .filter(key -> key.contains(DEFECTS_KEY)) - .forEach(key -> assertEquals(Double.parseDouble(currStatistics.get(key)), - BigDecimal.valueOf((double) 100 * testStatistics.get(key) / defectsSum) - .setScale(2, RoundingMode.HALF_UP) - .doubleValue(), - 0.01 - )); - }); - } - - @Test - void launchesDurationStatistics() { - Filter filter = buildDefaultFilter(1L); - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); - - List launchesDurationContents = widgetContentRepository.launchesDurationStatistics(filter, sort, false, 4); - - assertNotNull(launchesDurationContents); - assertEquals(4, launchesDurationContents.size()); - - launchesDurationContents.forEach(content -> { - Timestamp endTime = content.getEndTime(); - Timestamp startTime = content.getStartTime(); - if (startTime.before(endTime)) { - long duration = content.getDuration(); - assertTrue(duration > 0 && duration == endTime.getTime() - startTime.getTime()); - } - }); - - } - - @Test - void notPassedCasesStatistics() { - Filter filter = buildDefaultFilter(1L); - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); - - List notPassedCasesContents = widgetContentRepository.notPassedCasesStatistics(filter, sort, 3); - - assertNotNull(notPassedCasesContents); - assertEquals(3, notPassedCasesContents.size()); - - notPassedCasesContents.forEach(content -> { - Map currentStatistics = content.getValues(); - Map> preDefinedStatistics = buildNotPassedCasesStatistics(); - - Map testStatistics = preDefinedStatistics.get(content.getId()); - int executionsSum = testStatistics.values().stream().mapToInt(i -> i).sum(); - - assertEquals(Double.parseDouble(currentStatistics.get(NOT_PASSED_STATISTICS_KEY)), - BigDecimal.valueOf((double) 100 * (testStatistics.get("statistics$executions$skipped") + testStatistics.get( - "statistics$executions$failed")) / executionsSum).setScale(2, RoundingMode.HALF_UP).doubleValue(), - 0.01 - ); - }); - } - - @Test - void launchesTableStatistics() { - Filter filter = buildDefaultFilter(1L); - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); - List contentFields = buildLaunchesTableContentFields(); - - List launchStatisticsContents = widgetContentRepository.launchesTableStatistics(filter, - contentFields, - sort, - 3 - ); - assertNotNull(launchStatisticsContents); - assertEquals(3, launchStatisticsContents.size()); - - List tableContentFields = Lists.newArrayList(CRITERIA_END_TIME, - CRITERIA_LAST_MODIFIED, - CRITERIA_USER - ); - - launchStatisticsContents.forEach(content -> { - Map values = content.getValues(); - tableContentFields.forEach(tcf -> { - assertTrue(values.containsKey(tcf)); - assertNotNull(values.get(tcf)); - }); - }); - - } - - @Test - void activityStatistics() { - Filter filter = buildDefaultActivityFilter(1L); - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, CRITERIA_CREATION_DATE))); - List contentFields = buildActivityContentFields(); - - filter.withCondition(new FilterCondition(Condition.EQUALS, false, "superadmin", CRITERIA_USER)) - .withCondition(new FilterCondition(Condition.IN, false, String.join(",", contentFields), CRITERIA_ACTION)); - - List activityContentList = widgetContentRepository.activityStatistics(filter, sort, 4); - - assertNotNull(activityContentList); - assertEquals(4, activityContentList.size()); - } - - @Test - void uniqueBugStatistics() { - Filter filter = buildDefaultFilter(1L); - List orderings = Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME)); - Sort sort = Sort.by(orderings); - - Map uniqueBugStatistics = widgetContentRepository.uniqueBugStatistics(filter, sort, true, 5); - - assertNotNull(uniqueBugStatistics); - assertEquals(2, uniqueBugStatistics.size()); - - assertTrue(uniqueBugStatistics.containsKey("EPMRPP-322")); - assertTrue(uniqueBugStatistics.containsKey("EPMRPP-123")); - - assertEquals(2, uniqueBugStatistics.get("EPMRPP-322").getItems().size()); - assertEquals(1, uniqueBugStatistics.get("EPMRPP-123").getItems().size()); - } - - @Test - void flakyCasesStatistics() { - Filter filter = buildDefaultFilter(1L); - - List flakyCasesStatistics = widgetContentRepository.flakyCasesStatistics(filter, false, 4); - - assertNotNull(flakyCasesStatistics); - assertTrue(flakyCasesStatistics.isEmpty()); - } - - @Test - void productStatusFilterGroupedWidget() { - - List firstOrdering = Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, "statistics$defects$product_bug$pb001")); - List secondOrdering = Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, "statistics$defects$automation_bug$ab001")); - - Sort firstSort = Sort.by(firstOrdering); - Sort secondSort = Sort.by(secondOrdering); - - Map filterSortMapping = Maps.newLinkedHashMap(); - filterSortMapping.put(buildDefaultFilter(1L), firstSort); - filterSortMapping.put(buildDefaultTestFilter(1L), secondSort); - - Map tags = new LinkedHashMap<>(); - tags.put("firstColumn", "build"); - tags.put("secondColumn", "hello"); - - Map> result = widgetContentRepository.productStatusGroupedByFilterStatistics(filterSortMapping, - buildProductStatusContentFields(), - tags, - false, - 10 - ); - - assertNotNull(result); - } - - @Test - void productStatusLaunchGroupedWidget() { - Filter filter = buildDefaultTestFilter(1L); - Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, CRITERIA_START_TIME))); - Map tags = new LinkedHashMap<>(); - tags.put("firstColumn", "build"); - tags.put("secondColumn", "hello"); - - List result = widgetContentRepository.productStatusGroupedByLaunchesStatistics(filter, - buildProductStatusContentFields(), - tags, - sort, - false, - 10 - ); - - assertNotNull(result); - } - - @Test - void mostTimeConsumingTestCases() { - Filter filter = buildMostTimeConsumingFilter(1L); - filter = updateFilter(filter, "launch name 1", 1L, true); - List mostTimeConsumingTestCasesContents = widgetContentRepository.mostTimeConsumingTestCasesStatistics(filter, - 3 - ); - - assertNotNull(mostTimeConsumingTestCasesContents); - assertEquals(3, mostTimeConsumingTestCasesContents.size()); - - mostTimeConsumingTestCasesContents.stream().reduce((prev, current) -> { - assertTrue(current.getDuration() < prev.getDuration()); - return current; - }).get(); - } - - @Test - void patternTemplate() { - Filter filter = buildDefaultFilter(1L); - List topPatternTemplatesContents = widgetContentRepository.patternTemplate(filter, - Sort.unsorted(), - "build", - "FIRST PATTERN", - false, - 600, - 15 - ); - - assertNotNull(topPatternTemplatesContents); - assertFalse(topPatternTemplatesContents.isEmpty()); - } - - @Test - void overallStatisticsContentSorting() { - String sortingColumn = "statistics$defects$no_defect$nd001"; - Filter filter = buildDefaultFilter(1L); - List contentFields = buildContentFields(); - List orders = filter.getTarget() - .getCriteriaHolders() - .stream() - .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) - .collect(Collectors.toList()); - orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); - Sort sort = Sort.by(orders); - - OverallStatisticsContent overallStatisticsContent = widgetContentRepository.overallStatisticsContent(filter, - sort, - contentFields, - false, - 4 - ); - - assertNotNull(overallStatisticsContent); - } - - @Test - void launchStatisticsSorting() { - - String sortingColumn = "statistics$defects$no_defect$nd001"; - - Filter filter = buildDefaultFilter(1L); - List contentFields = buildContentFields(); - - List orders = filter.getTarget() - .getCriteriaHolders() - .stream() - .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) - .collect(Collectors.toList()); - orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); - Sort sort = Sort.by(orders); - - List chartStatisticsContents = widgetContentRepository.launchStatistics(filter, contentFields, sort, 4); - assertNotNull(chartStatisticsContents); - assertEquals(4, chartStatisticsContents.size()); - } - - @Test - void investigatedStatisticsSorting() { - - String sortingColumn = "statistics$defects$no_defect$nd001"; - - Filter filter = buildDefaultFilter(1L); - - List orders = filter.getTarget() - .getCriteriaHolders() - .stream() - .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) - .collect(Collectors.toList()); - orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); - Sort sort = Sort.by(orders); - - List chartStatisticsContents = widgetContentRepository.investigatedStatistics(filter, sort, 4); - assertNotNull(chartStatisticsContents); - assertEquals(4, chartStatisticsContents.size()); - } - - @Test - void timelineInvestigatedStatisticsSorting() { - String sortingColumn = "statistics$defects$no_defect$nd001"; - - Filter filter = buildDefaultFilter(1L); - - List orders = filter.getTarget() - .getCriteriaHolders() - .stream() - .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) - .collect(Collectors.toList()); - orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); - Sort sort = Sort.by(orders); - - List chartStatisticsContents = widgetContentRepository.timelineInvestigatedStatistics(filter, sort, 4); - assertNotNull(chartStatisticsContents); - assertEquals(4, chartStatisticsContents.size()); - } - - @Test - void summaryPassStatisticsSorting() { - String sortingColumn = "statistics$defects$no_defect$nd001"; - Filter filter = buildDefaultFilter(1L); - List orders = filter.getTarget() - .getCriteriaHolders() - .stream() - .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) - .collect(Collectors.toList()); - orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); - Sort sort = Sort.by(orders); - - PassingRateStatisticsResult passStatisticsResult = widgetContentRepository.summaryPassingRateStatistics(filter, sort, 4); - - assertNotNull(passStatisticsResult); - } - - @Test - void casesTrendStatisticsSorting() { - String sortingColumn = "statistics$defects$no_defect$nd001"; - Filter filter = buildDefaultFilter(1L); - String executionContentField = "statistics$executions$total"; - List orders = filter.getTarget() - .getCriteriaHolders() - .stream() - .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) - .collect(Collectors.toList()); - orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); - Sort sort = Sort.by(orders); - - List chartStatisticsContents = widgetContentRepository.casesTrendStatistics(filter, - executionContentField, - sort, - 4 - ); - - assertNotNull(chartStatisticsContents); - assertEquals(4, chartStatisticsContents.size()); - - } - - @Test - void bugTrendStatisticsSorting() { - String sortingColumn = "statistics$defects$no_defect$nd001"; - Filter filter = buildDefaultFilter(1L); - List contentFields = buildTotalDefectsContentFields(); - List orders = filter.getTarget() - .getCriteriaHolders() - .stream() - .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) - .collect(Collectors.toList()); - orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); - Sort sort = Sort.by(orders); - - List chartStatisticsContents = widgetContentRepository.bugTrendStatistics(filter, contentFields, sort, 4); - - assertNotNull(chartStatisticsContents); - assertEquals(4, chartStatisticsContents.size()); - } - - @Test - void launchesComparisonStatisticsSorting() { - String sortingColumn = "statistics$defects$no_defect$nd001"; - Filter filter = buildDefaultFilter(1L); - List contentFields = buildTotalContentFields(); - filter = filter.withConditions(Lists.newArrayList(new FilterCondition(Condition.EQUALS, false, "launch name 1", NAME))); - List orders = filter.getTarget() - .getCriteriaHolders() - .stream() - .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) - .collect(Collectors.toList()); - orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); - Sort sort = Sort.by(orders); - - List chartStatisticsContents = widgetContentRepository.launchesComparisonStatistics(filter, - contentFields, - sort, - 2 - ); - - assertNotNull(chartStatisticsContents); - assertEquals(2, chartStatisticsContents.size()); - - } - - @Test - void launchesDurationStatisticsSorting() { - String sortingColumn = "statistics$defects$no_defect$nd001"; - Filter filter = buildDefaultFilter(1L); - List orders = filter.getTarget() - .getCriteriaHolders() - .stream() - .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) - .collect(Collectors.toList()); - orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); - Sort sort = Sort.by(orders); - - List launchesDurationContents = widgetContentRepository.launchesDurationStatistics(filter, sort, false, 4); - - assertNotNull(launchesDurationContents); - assertEquals(4, launchesDurationContents.size()); - - } - - @Test - void notPassedCasesStatisticsSorting() { - String sortingColumn = "statistics$defects$no_defect$nd001"; - Filter filter = buildDefaultFilter(1L); - List orders = filter.getTarget() - .getCriteriaHolders() - .stream() - .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) - .collect(Collectors.toList()); - orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); - Sort sort = Sort.by(orders); - - List notPassedCasesContents = widgetContentRepository.notPassedCasesStatistics(filter, sort, 3); - - assertNotNull(notPassedCasesContents); - assertEquals(3, notPassedCasesContents.size()); - } - - @Test - void launchesTableStatisticsSorting() { - String sortingColumn = "statistics$defects$no_defect$nd001"; - Filter filter = buildDefaultFilter(1L); - List orders = filter.getTarget() - .getCriteriaHolders() - .stream() - .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) - .collect(Collectors.toList()); - orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); - Sort sort = Sort.by(orders); - List contentFields = buildLaunchesTableContentFields(); - - List launchStatisticsContents = widgetContentRepository.launchesTableStatistics(filter, - contentFields, - sort, - 3 - ); - assertNotNull(launchStatisticsContents); - assertEquals(3, launchStatisticsContents.size()); - - } - - @Test - void activityStatisticsSorting() { - Filter filter = buildDefaultActivityFilter(1L); - List orders = filter.getTarget() - .getCriteriaHolders() - .stream() - .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) - .collect(Collectors.toList()); - Sort sort = Sort.by(orders); - List contentFields = buildActivityContentFields(); - - filter.withCondition(new FilterCondition(Condition.EQUALS, false, "superadmin", CRITERIA_USER)) - .withCondition(new FilterCondition(Condition.IN, false, String.join(",", contentFields), CRITERIA_ACTION)); - - List activityContentList = widgetContentRepository.activityStatistics(filter, sort, 4); - - assertNotNull(activityContentList); - assertEquals(4, activityContentList.size()); - } - - @Test - void uniqueBugStatisticsSorting() { - String sortingColumn = "statistics$defects$no_defect$nd001"; - Filter filter = buildDefaultFilter(1L); - - List orders = filter.getTarget() - .getCriteriaHolders() - .stream() - .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) - .collect(Collectors.toList()); - orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); - Sort sort = Sort.by(orders); - - Map uniqueBugStatistics = widgetContentRepository.uniqueBugStatistics(filter, sort, true, 5); - - assertNotNull(uniqueBugStatistics); - assertEquals(2, uniqueBugStatistics.size()); - } - - @Test - void productStatusFilterGroupedWidgetSorting() { - - String sortingColumn = "statistics$defects$no_defect$nd001"; - - Filter filter = buildDefaultFilter(1L); - - List orders = filter.getTarget() - .getCriteriaHolders() - .stream() - .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) - .collect(Collectors.toList()); - orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); - Sort sort = Sort.by(orders); - Map filterSortMapping = Maps.newLinkedHashMap(); - - filterSortMapping.put(buildDefaultFilter(1L), sort); - filterSortMapping.put(buildDefaultTestFilter(1L), sort); - - Map tags = new LinkedHashMap<>(); - tags.put("firstColumn", "build"); - tags.put("secondColumn", "hello"); - - Map> result = widgetContentRepository.productStatusGroupedByFilterStatistics(filterSortMapping, - buildProductStatusContentFields(), - tags, - false, - 10 - ); - - assertNotNull(result); - } - - @Test - void productStatusLaunchGroupedWidgetSorting() { - String sortingColumn = "statistics$defects$no_defect$nd001"; - Filter filter = buildDefaultTestFilter(1L); - List orders = filter.getTarget() - .getCriteriaHolders() - .stream() - .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) - .collect(Collectors.toList()); - orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); - Sort sort = Sort.by(orders); - Map tags = new LinkedHashMap<>(); - tags.put("firstColumn", "build"); - tags.put("secondColumn", "hello"); - - List result = widgetContentRepository.productStatusGroupedByLaunchesStatistics(filter, - buildProductStatusContentFields(), - tags, - sort, - false, - 10 - ); - - assertNotNull(result); - } - - private Filter buildDefaultFilter(Long projectId) { - - List conditionList = Lists.newArrayList(new FilterCondition(Condition.EQUALS, - false, - String.valueOf(projectId), - CRITERIA_PROJECT_ID - ), - new FilterCondition(Condition.NOT_EQUALS, false, StatusEnum.IN_PROGRESS.name(), CRITERIA_STATUS), - new FilterCondition(Condition.EQUALS, false, Mode.DEFAULT.toString(), CRITERIA_LAUNCH_MODE) - ); - return new Filter(1L, Launch.class, conditionList); - } - - private Filter buildDefaultTestFilter(Long projectId) { - List conditionList = Lists.newArrayList(new FilterCondition(Condition.EQUALS, - false, - String.valueOf(projectId), - CRITERIA_PROJECT_ID - ), - new FilterCondition(Condition.NOT_EQUALS, false, StatusEnum.IN_PROGRESS.name(), CRITERIA_STATUS), - new FilterCondition(Condition.EQUALS, false, Mode.DEFAULT.toString(), CRITERIA_LAUNCH_MODE), - new FilterCondition(Condition.findByMarker("lte").get(), false, "12", "statistics$executions$total") - ); - return new Filter(2L, Launch.class, conditionList); - } - - private Filter buildDefaultActivityFilter(Long projectId) { - List conditionList = Lists.newArrayList(new FilterCondition(Condition.EQUALS, - false, - String.valueOf(projectId), - CRITERIA_PROJECT_ID - )); - return new Filter(1L, Activity.class, conditionList); - } - - private Filter buildMostTimeConsumingFilter(Long projectId) { - List conditionList = Lists.newArrayList(new FilterCondition(Condition.EQUALS, - false, - String.valueOf(projectId), - CRITERIA_PROJECT_ID - ), new FilterCondition(Condition.EQUALS_ANY, - false, - String.join(",", JStatusEnum.PASSED.getLiteral(), JStatusEnum.FAILED.getLiteral()), - CRITERIA_STATUS - )); - - return new Filter(1L, TestItem.class, conditionList); - } - - private Filter updateFilter(Filter filter, String launchName, Long projectId, boolean includeMethodsFlag) { - filter = updateFilterWithLaunchName(filter, launchName, projectId); - filter = updateFilterWithTestItemTypes(filter, includeMethodsFlag); - return filter; - } - - private Filter updateFilterWithLaunchName(Filter filter, String launchName, Long projectId) { - return filter.withCondition(new FilterCondition(Condition.EQUALS, false, String.valueOf(1L), CRITERIA_LAUNCH_ID)); - } - - private Filter updateFilterWithTestItemTypes(Filter filter, boolean includeMethodsFlag) { - if (includeMethodsFlag) { - return updateFilterWithStepAndBeforeAfterMethods(filter); - } else { - return updateFilterWithStepTestItem(filter); - } - } - - private Filter updateFilterWithStepTestItem(Filter filter) { - return filter.withCondition(new FilterCondition(Condition.EQUALS, false, STEP.getLiteral(), "type")); - } - - private Filter updateFilterWithStepAndBeforeAfterMethods(Filter filter) { - return filter.withCondition(new FilterCondition(Condition.EQUALS_ANY, - false, - String.join(",", STEP.getLiteral(), BEFORE_METHOD.getLiteral(), AFTER_METHOD.getLiteral()), - "type" - )); - } - - private List buildMostTimeConsumingTestCases() { - return Lists.newArrayList("statistics$executions$failed", "statistics$executions$passed"); - } - - private List buildLaunchesTableContentFields() { - return Lists.newArrayList("statistics$defects$no_defect$nd001", - "statistics$defects$product_bug$pb001", - "statistics$defects$automation_bug$ab001", - "statistics$defects$system_issue$si001", - "statistics$defects$to_investigate$ti001", - CRITERIA_END_TIME, - CRITERIA_DESCRIPTION, - CRITERIA_LAST_MODIFIED, - CRITERIA_USER, - "number", - "name", - "startTime", - "attributes", - "statistics$executions$total", - "statistics$executions$failed", - "statistics$executions$passed", - "statistics$executions$skipped" - ); - } - - private List buildContentFields() { - - return Lists.newArrayList("statistics$defects$no_defect$nd001", - "statistics$defects$product_bug$pb001", - "statistics$defects$automation_bug$ab001", - "statistics$defects$system_issue$si001", - "statistics$defects$to_investigate$ti001", - "statistics$executions$failed", - "statistics$executions$skipped", - "statistics$executions$passed", - "statistics$executions$total", - "statistics$defects$no_defect$total", - "statistics$defects$product_bug$total", - "statistics$defects$automation_bug$total", - "statistics$defects$system_issue$total", - "statistics$defects$to_investigate$total" - - ); - } - - private List buildTotalDefectsContentFields() { - return Lists.newArrayList("statistics$defects$to_investigate$total", - "statistics$defects$product_bug$total", - "statistics$defects$automation_bug$total", - "statistics$defects$system_issue$total", - "statistics$defects$no_defect$total" - ); - } - - private List buildTotalContentFields() { - return Lists.newArrayList("statistics$defects$no_defect$total", - "statistics$defects$product_bug$total", - "statistics$defects$automation_bug$total", - "statistics$defects$system_issue$total", - "statistics$defects$to_investigate$total", - "statistics$executions$failed", - "statistics$executions$skipped", - "statistics$executions$passed", - "statistics$executions$total" - ); - } - - private List buildProductStatusContentFields() { - return Lists.newArrayList("statistics$defects$no_defect$nd001", - "statistics$defects$product_bug$pb001", - "statistics$defects$automation_bug$ab001", - "statistics$defects$system_issue$si001", - "statistics$defects$to_investigate$ti001", - "statistics$executions$failed", - "statistics$executions$skipped", - "statistics$executions$total", - "startTime", - "status", - "statistics$defects$no_defect$total", - "statistics$defects$product_bug$total", - "statistics$defects$automation_bug$total", - "statistics$defects$system_issue$total", - "statistics$defects$to_investigate$total" - - ); - } - - private List buildActivityContentFields() { - return Lists.newArrayList("createLaunch", "createItem"); - } - - private Map> buildTotalDefectsMap() { - Map> investigatedTrendMap = Maps.newLinkedHashMap(); - - investigatedTrendMap.put(1L, - ImmutableMap.builder().put("statistics$defects$to_investigate$total", 2) - .put("statistics$defects$system_issue$total", 8) - .put("statistics$defects$automation_bug$total", 7) - .put("statistics$defects$product_bug$total", 13) - .put("statistics$defects$no_defect$total", 2) - .build() - ); - investigatedTrendMap.put(2L, - ImmutableMap.builder().put("statistics$defects$to_investigate$total", 3) - .put("statistics$defects$system_issue$total", 3) - .put("statistics$defects$automation_bug$total", 1) - .put("statistics$defects$product_bug$total", 1) - .put("statistics$defects$no_defect$total", 2) - .build() - ); - investigatedTrendMap.put(3L, - ImmutableMap.builder().put("statistics$defects$to_investigate$total", 1) - .put("statistics$defects$system_issue$total", 1) - .put("statistics$defects$automation_bug$total", 1) - .put("statistics$defects$product_bug$total", 1) - .put("statistics$defects$no_defect$total", 1) - .build() - ); - investigatedTrendMap.put(4L, - ImmutableMap.builder().put("statistics$defects$to_investigate$total", 3) - .put("statistics$defects$system_issue$total", 4) - .put("statistics$defects$automation_bug$total", 2) - .put("statistics$defects$product_bug$total", 2) - .put("statistics$defects$no_defect$total", 6) - .build() - ); - - return investigatedTrendMap; - - } - - private Map> buildLaunchesComparisonStatistics() { - Map> predefinedLaunchesComparisonStatistics = Maps.newLinkedHashMap(); - - predefinedLaunchesComparisonStatistics.put(1L, - ImmutableMap.builder().put("statistics$defects$to_investigate$total", 2) - .put("statistics$defects$system_issue$total", 8) - .put("statistics$defects$automation_bug$total", 7) - .put("statistics$defects$product_bug$total", 13) - .put("statistics$defects$no_defect$total", 2) - .put("statistics$executions$passed", 3) - .put("statistics$executions$skipped", 4) - .put("statistics$executions$failed", 3) - .put("statistics$executions$total", 10) - .build() - ); - predefinedLaunchesComparisonStatistics.put(2L, - ImmutableMap.builder().put("statistics$defects$to_investigate$total", 3) - .put("statistics$defects$system_issue$total", 3) - .put("statistics$defects$automation_bug$total", 1) - .put("statistics$defects$product_bug$total", 1) - .put("statistics$defects$no_defect$total", 2) - .put("statistics$executions$passed", 2) - .put("statistics$executions$skipped", 3) - .put("statistics$executions$failed", 6) - .put("statistics$executions$total", 11) - .build() - ); - - return predefinedLaunchesComparisonStatistics; - - } - - private Map> buildNotPassedCasesStatistics() { - Map> investigatedTrendMap = Maps.newLinkedHashMap(); - - investigatedTrendMap.put(1L, - ImmutableMap.builder().put("statistics$executions$passed", 3) - .put("statistics$executions$skipped", 4) - .put("statistics$executions$failed", 3) - .build() - ); - investigatedTrendMap.put(2L, - ImmutableMap.builder().put("statistics$executions$passed", 2) - .put("statistics$executions$skipped", 3) - .put("statistics$executions$failed", 6) - .build() - ); - investigatedTrendMap.put(3L, - ImmutableMap.builder().put("statistics$executions$passed", 5) - .put("statistics$executions$skipped", 5) - .put("statistics$executions$failed", 5) - .build() - ); - - return investigatedTrendMap; - - } - - @Test - void componentHealthCheck() { - - String sortingColumn = "statistics$defects$no_defect$nd001"; - - Filter launchFilter = buildDefaultFilter(1L); - List orderings = Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, sortingColumn), - new Sort.Order(Sort.Direction.DESC, CRITERIA_START_TIME) - ); - Sort sort = Sort.by(orderings); - - Filter itemsFilter = new Filter(1L, - TestItem.class, - Lists.newArrayList(FilterCondition.builder() - .withCondition(Condition.HAS) - .withNegative(false) - .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) - .withValue("new:os") - .build()) - ); - - List contents = widgetContentRepository.componentHealthCheck(launchFilter, - sort, - false, - 600, - itemsFilter, - "new" - ); - - assertTrue(contents.isEmpty()); - } - - @Test - void componentHealthCheckTable() { - - String sortingColumn = "statistics$defects$no_defect$nd001"; - - Filter launchFilter = buildDefaultFilter(1L); - List orderings = Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, sortingColumn), - new Sort.Order(Sort.Direction.DESC, CRITERIA_START_TIME) - ); - Sort sort = Sort.by(orderings); - - HealthCheckTableInitParams initParams = HealthCheckTableInitParams.of("first", - com.google.common.collect.Lists.newArrayList("build") - ); - - initParams.setCustomKey("build"); - - launchFilter.withCondition(FilterCondition.builder() - .withCondition(Condition.ANY) - .withSearchCriteria(CRITERIA_ITEM_ATTRIBUTE_KEY) - .withValue("build") - .build()); - - widgetContentRepository.generateComponentHealthCheckTable(false, initParams, launchFilter, sort, 600, false); - - List healthCheckTableContents = widgetContentRepository.componentHealthCheckTable(HealthCheckTableGetParams - .of("first", "build", Sort.by(Sort.Direction.DESC, "customColumn"), true, new ArrayList<>())); - - assertFalse(healthCheckTableContents.isEmpty()); - - initParams = HealthCheckTableInitParams.of("hello", com.google.common.collect.Lists.newArrayList("build")); - - widgetContentRepository.generateComponentHealthCheckTable(false, initParams, launchFilter, sort, 600, false); - widgetContentRepository.generateComponentHealthCheckTable(true, initParams, launchFilter, sort, 600, false); - - healthCheckTableContents = widgetContentRepository.componentHealthCheckTable(HealthCheckTableGetParams.of("hello", - "hello", - Sort.by(Sort.Direction.DESC, "passingRate"), - false, - com.google.common.collect.Lists.newArrayList(LevelEntry.of("k1", "v1"), LevelEntry.of("k2", "v2")) - )); - - assertTrue(healthCheckTableContents.isEmpty()); - - healthCheckTableContents = widgetContentRepository.componentHealthCheckTable(HealthCheckTableGetParams.of("hello", - "build", - Sort.by(Sort.Direction.ASC, "passingRate"), - false, - new ArrayList<>() - )); - - assertTrue(healthCheckTableContents.isEmpty()); - - healthCheckTableContents = widgetContentRepository.componentHealthCheckTable(HealthCheckTableGetParams.of("hello", - "build", - Sort.by(Sort.Direction.DESC, "statistics$executions$total"), - false, - new ArrayList<>() - )); - - assertTrue(healthCheckTableContents.isEmpty()); - - healthCheckTableContents = widgetContentRepository.componentHealthCheckTable(HealthCheckTableGetParams.of("hello", - "build", - Sort.by(Sort.Direction.DESC, "statistics$executions$failed"), - false, - com.google.common.collect.Lists.newArrayList(LevelEntry.of("k1", "v1"), LevelEntry.of("k2", "v2")) - )); - - assertTrue(healthCheckTableContents.isEmpty()); - - Result fetch = dslContext.fetch(DSL.sql("SELECT * FROM pg_matviews")); + @Autowired + private LaunchRepository launchRepository; + + @Autowired + private WidgetContentRepository widgetContentRepository; + + @Autowired + private DSLContext dslContext; + + @Test + void overallStatisticsContent() { + String sortingColumn = "statistics$defects$no_defect$nd001"; + Filter filter = buildDefaultFilter(1L); + List contentFields = buildContentFields(); + Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, sortingColumn))); + + OverallStatisticsContent overallStatisticsContent = widgetContentRepository.overallStatisticsContent( + filter, + sort, + contentFields, + false, + 4 + ); + + assertEquals(48, + (long) overallStatisticsContent.getValues().get("statistics$executions$total")); + assertEquals(13, + (long) overallStatisticsContent.getValues().get("statistics$executions$passed")); + assertEquals(13, + (long) overallStatisticsContent.getValues().get("statistics$executions$skipped")); + assertEquals(22, + (long) overallStatisticsContent.getValues().get("statistics$executions$failed")); + assertEquals(9, + (long) overallStatisticsContent.getValues().get("statistics$defects$to_investigate$total")); + assertEquals(16, + (long) overallStatisticsContent.getValues().get("statistics$defects$system_issue$total")); + assertEquals(11, + (long) overallStatisticsContent.getValues().get("statistics$defects$automation_bug$total")); + assertEquals(17, + (long) overallStatisticsContent.getValues().get("statistics$defects$product_bug$total")); + assertEquals(11, + (long) overallStatisticsContent.getValues().get("statistics$defects$no_defect$total")); + assertEquals(9, + (long) overallStatisticsContent.getValues().get("statistics$defects$to_investigate$ti001")); + assertEquals(16, + (long) overallStatisticsContent.getValues().get("statistics$defects$system_issue$si001")); + assertEquals(11, + (long) overallStatisticsContent.getValues().get("statistics$defects$automation_bug$ab001")); + assertEquals(17, + (long) overallStatisticsContent.getValues().get("statistics$defects$product_bug$pb001")); + assertEquals(11, + (long) overallStatisticsContent.getValues().get("statistics$defects$no_defect$nd001")); + } + + @Test + void mostFailedByDefectCriteria() { + + String defect = "statistics$executions$failed"; + + Filter filter = buildDefaultFilter(1L); + + List criteriaHistoryItems = widgetContentRepository.topItemsByCriteria( + filter, defect, 10, false); + + assertNotNull(criteriaHistoryItems); + assertEquals(1, criteriaHistoryItems.size()); + } + + @Test + void launchStatistics() { + + String sortingColumn = "statistics$defects$no_defect$nd001"; + + Filter filter = buildDefaultFilter(1L); + List contentFields = buildContentFields(); + + List orderings = Lists.newArrayList( + new Sort.Order(Sort.Direction.DESC, sortingColumn), + new Sort.Order(Sort.Direction.DESC, CRITERIA_START_TIME) + ); + + Sort sort = Sort.by(orderings); + + List chartStatisticsContents = widgetContentRepository.launchStatistics( + filter, contentFields, sort, 4); + assertNotNull(chartStatisticsContents); + assertEquals(4, chartStatisticsContents.size()); + + assertEquals(chartStatisticsContents.get(0).getValues().get(sortingColumn), String.valueOf(6)); + assertEquals(chartStatisticsContents.get(chartStatisticsContents.size() - 1).getValues() + .get(sortingColumn), String.valueOf(1)); + } + + @Test + void investigatedStatistics() { + + Map> statistics = buildTotalDefectsMap(); + + String sortingColumn = "statistics$defects$no_defect$nd001"; + + Filter filter = buildDefaultFilter(1L); + + List orderings = Lists.newArrayList( + new Sort.Order(Sort.Direction.DESC, sortingColumn)); + + Sort sort = Sort.by(orderings); + + List chartStatisticsContents = widgetContentRepository.investigatedStatistics( + filter, sort, 4); + assertNotNull(chartStatisticsContents); + assertEquals(4, chartStatisticsContents.size()); + + chartStatisticsContents.forEach(res -> { + Map stats = statistics.get(res.getId()); + int sum = stats.values().stream().mapToInt(Integer::intValue).sum(); + assertEquals(100.0, + Double.parseDouble(res.getValues().get(TO_INVESTIGATE)) + Double.parseDouble( + res.getValues().get(INVESTIGATED)), + 0.01 + ); + assertEquals(Double.parseDouble(res.getValues().get(TO_INVESTIGATE)), + BigDecimal.valueOf( + (double) 100 * stats.get("statistics$defects$to_investigate$total") / sum) + .setScale(2, RoundingMode.HALF_UP) + .doubleValue(), + 0.01 + ); + }); + } + + @Test + void timelineInvestigatedStatistics() { + + Filter filter = buildDefaultFilter(1L); + + List orderings = Lists.newArrayList( + new Sort.Order(Sort.Direction.DESC, CRITERIA_ITEM_ATTRIBUTE_KEY)); + + Sort sort = Sort.by(orderings); + + List chartStatisticsContents = widgetContentRepository.timelineInvestigatedStatistics( + filter, sort, 4); + assertNotNull(chartStatisticsContents); + assertEquals(4, chartStatisticsContents.size()); + } + + @Test + void launchPassPerLaunchStatistics() { + Filter filter = buildDefaultFilter(1L); + + filter.withCondition( + new FilterCondition(Condition.EQUALS, false, "launch name 1", CRITERIA_NAME)); + + final Launch launch = launchRepository.findLatestByFilter(filter).get(); + + PassingRateStatisticsResult passStatisticsResult = widgetContentRepository.passingRatePerLaunchStatistics( + launch.getId()); + + assertNotNull(passStatisticsResult); + assertEquals(4L, passStatisticsResult.getId()); + assertEquals(4, passStatisticsResult.getNumber()); + assertEquals(3, passStatisticsResult.getPassed()); + assertEquals(12, passStatisticsResult.getTotal()); + } + + @Test + void summaryPassStatistics() { + Filter filter = buildDefaultFilter(1L); + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); + + PassingRateStatisticsResult passStatisticsResult = widgetContentRepository.summaryPassingRateStatistics( + filter, sort, 4); + + assertNotNull(passStatisticsResult); + assertEquals(4, passStatisticsResult.getNumber()); + assertEquals(13, passStatisticsResult.getPassed()); + assertEquals(48, passStatisticsResult.getTotal()); + } + + @Test + void casesTrendStatistics() { + Filter filter = buildDefaultFilter(1L); + String executionContentField = "statistics$executions$total"; + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); + + List chartStatisticsContents = widgetContentRepository.casesTrendStatistics( + filter, + executionContentField, + sort, + 4 + ); + + assertNotNull(chartStatisticsContents); + assertEquals(4, chartStatisticsContents.size()); + + int firstElementDelta = Integer.parseInt(chartStatisticsContents.get(0).getValues().get(DELTA)); + int secondElementDelta = + Integer.parseInt(chartStatisticsContents.get(1).getValues().get(executionContentField)) + - Integer.parseInt( + chartStatisticsContents.get(0).getValues().get(executionContentField)); + int thirdElementDelta = + Integer.parseInt(chartStatisticsContents.get(2).getValues().get(executionContentField)) + - Integer.parseInt( + chartStatisticsContents.get(1).getValues().get(executionContentField)); + int fourthElementDelta = + Integer.parseInt(chartStatisticsContents.get(3).getValues().get(executionContentField)) + - Integer.parseInt( + chartStatisticsContents.get(2).getValues().get(executionContentField)); + + assertEquals(0, firstElementDelta); + assertEquals(1, secondElementDelta); + assertEquals(4, thirdElementDelta); + assertEquals(-3, fourthElementDelta); + + } + + @Test + void bugTrendStatistics() { + Map> statistics = buildTotalDefectsMap(); + Filter filter = buildDefaultFilter(1L); + List contentFields = buildTotalDefectsContentFields(); + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); + + List chartStatisticsContents = widgetContentRepository.bugTrendStatistics( + filter, contentFields, sort, 4); + + assertNotNull(chartStatisticsContents); + assertEquals(4, chartStatisticsContents.size()); + + chartStatisticsContents.forEach(res -> { + Map stats = statistics.get(res.getId()); + Map resStatistics = res.getValues(); + + long total = stats.values().stream().mapToInt(Integer::intValue).sum(); + + stats.keySet().forEach(key -> assertEquals((long) stats.get(key), + (long) Integer.parseInt(resStatistics.get(key)))); + + assertEquals(String.valueOf(total), resStatistics.get(TOTAL)); + }); + } + + @Test + void launchesComparisonStatistics() { + Filter filter = buildDefaultFilter(1L); + List contentFields = buildTotalContentFields(); + filter = filter.withConditions( + Lists.newArrayList(new FilterCondition(Condition.EQUALS, false, "launch name 1", NAME))); + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); + + List chartStatisticsContents = widgetContentRepository.launchesComparisonStatistics( + filter, + contentFields, + sort, + 2 + ); + + assertNotNull(chartStatisticsContents); + assertEquals(2, chartStatisticsContents.size()); + + chartStatisticsContents.forEach(res -> { + Map currStatistics = res.getValues(); + Map> preDefinedStatistics = buildLaunchesComparisonStatistics(); + + Map testStatistics = preDefinedStatistics.get(res.getId()); + int executionsSum = testStatistics.entrySet() + .stream() + .filter(entry -> entry.getKey().contains(EXECUTIONS_KEY) && !entry.getKey() + .equalsIgnoreCase(EXECUTIONS_TOTAL)) + .mapToInt(Map.Entry::getValue) + .sum(); + int defectsSum = testStatistics.entrySet() + .stream() + .filter(entry -> entry.getKey().contains(DEFECTS_KEY)) + .mapToInt(Map.Entry::getValue) + .sum(); + + currStatistics.keySet() + .stream() + .filter(key -> key.contains(EXECUTIONS_KEY) && !key.equalsIgnoreCase(EXECUTIONS_TOTAL)) + .forEach(key -> assertEquals(Double.parseDouble(currStatistics.get(key)), + BigDecimal.valueOf((double) 100 * testStatistics.get(key) / executionsSum) + .setScale(2, RoundingMode.HALF_UP) + .doubleValue(), + 0.01 + )); + + assertEquals((double) testStatistics.get(EXECUTIONS_TOTAL), + Double.parseDouble(currStatistics.get(EXECUTIONS_TOTAL)), 0.01); + + currStatistics.keySet() + .stream() + .filter(key -> key.contains(DEFECTS_KEY)) + .forEach(key -> assertEquals(Double.parseDouble(currStatistics.get(key)), + BigDecimal.valueOf((double) 100 * testStatistics.get(key) / defectsSum) + .setScale(2, RoundingMode.HALF_UP) + .doubleValue(), + 0.01 + )); + }); + } + + @Test + void launchesDurationStatistics() { + Filter filter = buildDefaultFilter(1L); + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); + + List launchesDurationContents = widgetContentRepository.launchesDurationStatistics( + filter, sort, false, 4); + + assertNotNull(launchesDurationContents); + assertEquals(4, launchesDurationContents.size()); + + launchesDurationContents.forEach(content -> { + Timestamp endTime = content.getEndTime(); + Timestamp startTime = content.getStartTime(); + if (startTime.before(endTime)) { + long duration = content.getDuration(); + assertTrue(duration > 0 && duration == endTime.getTime() - startTime.getTime()); + } + }); + + } + + @Test + void notPassedCasesStatistics() { + Filter filter = buildDefaultFilter(1L); + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); + + List notPassedCasesContents = widgetContentRepository.notPassedCasesStatistics( + filter, sort, 3); + + assertNotNull(notPassedCasesContents); + assertEquals(3, notPassedCasesContents.size()); + + notPassedCasesContents.forEach(content -> { + Map currentStatistics = content.getValues(); + Map> preDefinedStatistics = buildNotPassedCasesStatistics(); + + Map testStatistics = preDefinedStatistics.get(content.getId()); + int executionsSum = testStatistics.values().stream().mapToInt(i -> i).sum(); + + assertEquals(Double.parseDouble(currentStatistics.get(NOT_PASSED_STATISTICS_KEY)), + BigDecimal.valueOf((double) 100 * (testStatistics.get("statistics$executions$skipped") + + testStatistics.get( + "statistics$executions$failed")) / executionsSum).setScale(2, RoundingMode.HALF_UP) + .doubleValue(), + 0.01 + ); + }); + } + + @Test + void launchesTableStatistics() { + Filter filter = buildDefaultFilter(1L); + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); + List contentFields = buildLaunchesTableContentFields(); + + List launchStatisticsContents = widgetContentRepository.launchesTableStatistics( + filter, + contentFields, + sort, + 3 + ); + assertNotNull(launchStatisticsContents); + assertEquals(3, launchStatisticsContents.size()); + + List tableContentFields = Lists.newArrayList(CRITERIA_END_TIME, + CRITERIA_LAST_MODIFIED, + CRITERIA_USER + ); + + launchStatisticsContents.forEach(content -> { + Map values = content.getValues(); + tableContentFields.forEach(tcf -> { + assertTrue(values.containsKey(tcf)); + assertNotNull(values.get(tcf)); + }); + }); + + } + + @Test + void activityStatistics() { + Filter filter = buildDefaultActivityFilter(1L); + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, CRITERIA_CREATION_DATE))); + List contentFields = buildActivityContentFields(); + + filter.withCondition(new FilterCondition(Condition.EQUALS, false, "superadmin", CRITERIA_USER)) + .withCondition(new FilterCondition(Condition.IN, false, String.join(",", contentFields), + CRITERIA_ACTION)); + + List activityContentList = widgetContentRepository.activityStatistics(filter, + sort, 4); + + assertNotNull(activityContentList); + assertEquals(4, activityContentList.size()); + } + + @Test + void uniqueBugStatistics() { + Filter filter = buildDefaultFilter(1L); + List orderings = Lists.newArrayList( + new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME)); + Sort sort = Sort.by(orderings); + + Map uniqueBugStatistics = widgetContentRepository.uniqueBugStatistics( + filter, sort, true, 5); + + assertNotNull(uniqueBugStatistics); + assertEquals(2, uniqueBugStatistics.size()); + + assertTrue(uniqueBugStatistics.containsKey("EPMRPP-322")); + assertTrue(uniqueBugStatistics.containsKey("EPMRPP-123")); + + assertEquals(2, uniqueBugStatistics.get("EPMRPP-322").getItems().size()); + assertEquals(1, uniqueBugStatistics.get("EPMRPP-123").getItems().size()); + } + + @Test + void flakyCasesStatistics() { + Filter filter = buildDefaultFilter(1L); + + List flakyCasesStatistics = widgetContentRepository.flakyCasesStatistics( + filter, false, 4); + + assertNotNull(flakyCasesStatistics); + assertTrue(flakyCasesStatistics.isEmpty()); + } + + @Test + void productStatusFilterGroupedWidget() { + + List firstOrdering = Lists.newArrayList( + new Sort.Order(Sort.Direction.DESC, "statistics$defects$product_bug$pb001")); + List secondOrdering = Lists.newArrayList( + new Sort.Order(Sort.Direction.ASC, "statistics$defects$automation_bug$ab001")); + + Sort firstSort = Sort.by(firstOrdering); + Sort secondSort = Sort.by(secondOrdering); + + Map filterSortMapping = Maps.newLinkedHashMap(); + filterSortMapping.put(buildDefaultFilter(1L), firstSort); + filterSortMapping.put(buildDefaultTestFilter(1L), secondSort); + + Map tags = new LinkedHashMap<>(); + tags.put("firstColumn", "build"); + tags.put("secondColumn", "hello"); + + Map> result = widgetContentRepository.productStatusGroupedByFilterStatistics( + filterSortMapping, + buildProductStatusContentFields(), + tags, + false, + 10 + ); + + assertNotNull(result); + } + + @Test + void productStatusLaunchGroupedWidget() { + Filter filter = buildDefaultTestFilter(1L); + Sort sort = Sort.by( + Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, CRITERIA_START_TIME))); + Map tags = new LinkedHashMap<>(); + tags.put("firstColumn", "build"); + tags.put("secondColumn", "hello"); + + List result = widgetContentRepository.productStatusGroupedByLaunchesStatistics( + filter, + buildProductStatusContentFields(), + tags, + sort, + false, + 10 + ); + + assertNotNull(result); + } + + @Test + void mostTimeConsumingTestCases() { + Filter filter = buildMostTimeConsumingFilter(1L); + filter = updateFilter(filter, "launch name 1", 1L, true); + List mostTimeConsumingTestCasesContents = widgetContentRepository.mostTimeConsumingTestCasesStatistics( + filter, + 3 + ); + + assertNotNull(mostTimeConsumingTestCasesContents); + assertEquals(3, mostTimeConsumingTestCasesContents.size()); + + mostTimeConsumingTestCasesContents.stream().reduce((prev, current) -> { + assertTrue(current.getDuration() < prev.getDuration()); + return current; + }).get(); + } + + @Test + void patternTemplate() { + Filter filter = buildDefaultFilter(1L); + List topPatternTemplatesContents = widgetContentRepository.patternTemplate( + filter, + Sort.unsorted(), + "build", + "FIRST PATTERN", + false, + 600, + 15 + ); + + assertNotNull(topPatternTemplatesContents); + assertFalse(topPatternTemplatesContents.isEmpty()); + } + + @Test + void overallStatisticsContentSorting() { + String sortingColumn = "statistics$defects$no_defect$nd001"; + Filter filter = buildDefaultFilter(1L); + List contentFields = buildContentFields(); + List orders = filter.getTarget() + .getCriteriaHolders() + .stream() + .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) + .collect(Collectors.toList()); + orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); + Sort sort = Sort.by(orders); + + OverallStatisticsContent overallStatisticsContent = widgetContentRepository.overallStatisticsContent( + filter, + sort, + contentFields, + false, + 4 + ); + + assertNotNull(overallStatisticsContent); + } + + @Test + void launchStatisticsSorting() { + + String sortingColumn = "statistics$defects$no_defect$nd001"; + + Filter filter = buildDefaultFilter(1L); + List contentFields = buildContentFields(); + + List orders = filter.getTarget() + .getCriteriaHolders() + .stream() + .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) + .collect(Collectors.toList()); + orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); + Sort sort = Sort.by(orders); + + List chartStatisticsContents = widgetContentRepository.launchStatistics( + filter, contentFields, sort, 4); + assertNotNull(chartStatisticsContents); + assertEquals(4, chartStatisticsContents.size()); + } + + @Test + void investigatedStatisticsSorting() { + + String sortingColumn = "statistics$defects$no_defect$nd001"; + + Filter filter = buildDefaultFilter(1L); + + List orders = filter.getTarget() + .getCriteriaHolders() + .stream() + .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) + .collect(Collectors.toList()); + orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); + Sort sort = Sort.by(orders); + + List chartStatisticsContents = widgetContentRepository.investigatedStatistics( + filter, sort, 4); + assertNotNull(chartStatisticsContents); + assertEquals(4, chartStatisticsContents.size()); + } + + @Test + void timelineInvestigatedStatisticsSorting() { + String sortingColumn = "statistics$defects$no_defect$nd001"; + + Filter filter = buildDefaultFilter(1L); + + List orders = filter.getTarget() + .getCriteriaHolders() + .stream() + .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) + .collect(Collectors.toList()); + orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); + Sort sort = Sort.by(orders); + + List chartStatisticsContents = widgetContentRepository.timelineInvestigatedStatistics( + filter, sort, 4); + assertNotNull(chartStatisticsContents); + assertEquals(4, chartStatisticsContents.size()); + } + + @Test + void summaryPassStatisticsSorting() { + String sortingColumn = "statistics$defects$no_defect$nd001"; + Filter filter = buildDefaultFilter(1L); + List orders = filter.getTarget() + .getCriteriaHolders() + .stream() + .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) + .collect(Collectors.toList()); + orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); + Sort sort = Sort.by(orders); + + PassingRateStatisticsResult passStatisticsResult = widgetContentRepository.summaryPassingRateStatistics( + filter, sort, 4); + + assertNotNull(passStatisticsResult); + } + + @Test + void casesTrendStatisticsSorting() { + String sortingColumn = "statistics$defects$no_defect$nd001"; + Filter filter = buildDefaultFilter(1L); + String executionContentField = "statistics$executions$total"; + List orders = filter.getTarget() + .getCriteriaHolders() + .stream() + .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) + .collect(Collectors.toList()); + orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); + Sort sort = Sort.by(orders); + + List chartStatisticsContents = widgetContentRepository.casesTrendStatistics( + filter, + executionContentField, + sort, + 4 + ); + + assertNotNull(chartStatisticsContents); + assertEquals(4, chartStatisticsContents.size()); + + } + + @Test + void bugTrendStatisticsSorting() { + String sortingColumn = "statistics$defects$no_defect$nd001"; + Filter filter = buildDefaultFilter(1L); + List contentFields = buildTotalDefectsContentFields(); + List orders = filter.getTarget() + .getCriteriaHolders() + .stream() + .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) + .collect(Collectors.toList()); + orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); + Sort sort = Sort.by(orders); + + List chartStatisticsContents = widgetContentRepository.bugTrendStatistics( + filter, contentFields, sort, 4); + + assertNotNull(chartStatisticsContents); + assertEquals(4, chartStatisticsContents.size()); + } + + @Test + void launchesComparisonStatisticsSorting() { + String sortingColumn = "statistics$defects$no_defect$nd001"; + Filter filter = buildDefaultFilter(1L); + List contentFields = buildTotalContentFields(); + filter = filter.withConditions( + Lists.newArrayList(new FilterCondition(Condition.EQUALS, false, "launch name 1", NAME))); + List orders = filter.getTarget() + .getCriteriaHolders() + .stream() + .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) + .collect(Collectors.toList()); + orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); + Sort sort = Sort.by(orders); + + List chartStatisticsContents = widgetContentRepository.launchesComparisonStatistics( + filter, + contentFields, + sort, + 2 + ); + + assertNotNull(chartStatisticsContents); + assertEquals(2, chartStatisticsContents.size()); + + } + + @Test + void launchesDurationStatisticsSorting() { + String sortingColumn = "statistics$defects$no_defect$nd001"; + Filter filter = buildDefaultFilter(1L); + List orders = filter.getTarget() + .getCriteriaHolders() + .stream() + .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) + .collect(Collectors.toList()); + orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); + Sort sort = Sort.by(orders); + + List launchesDurationContents = widgetContentRepository.launchesDurationStatistics( + filter, sort, false, 4); + + assertNotNull(launchesDurationContents); + assertEquals(4, launchesDurationContents.size()); + + } + + @Test + void notPassedCasesStatisticsSorting() { + String sortingColumn = "statistics$defects$no_defect$nd001"; + Filter filter = buildDefaultFilter(1L); + List orders = filter.getTarget() + .getCriteriaHolders() + .stream() + .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) + .collect(Collectors.toList()); + orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); + Sort sort = Sort.by(orders); + + List notPassedCasesContents = widgetContentRepository.notPassedCasesStatistics( + filter, sort, 3); + + assertNotNull(notPassedCasesContents); + assertEquals(3, notPassedCasesContents.size()); + } + + @Test + void launchesTableStatisticsSorting() { + String sortingColumn = "statistics$defects$no_defect$nd001"; + Filter filter = buildDefaultFilter(1L); + List orders = filter.getTarget() + .getCriteriaHolders() + .stream() + .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) + .collect(Collectors.toList()); + orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); + Sort sort = Sort.by(orders); + List contentFields = buildLaunchesTableContentFields(); + + List launchStatisticsContents = widgetContentRepository.launchesTableStatistics( + filter, + contentFields, + sort, + 3 + ); + assertNotNull(launchStatisticsContents); + assertEquals(3, launchStatisticsContents.size()); + + } + + @Test + void activityStatisticsSorting() { + Filter filter = buildDefaultActivityFilter(1L); + List orders = filter.getTarget() + .getCriteriaHolders() + .stream() + .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) + .collect(Collectors.toList()); + Sort sort = Sort.by(orders); + List contentFields = buildActivityContentFields(); + + filter.withCondition(new FilterCondition(Condition.EQUALS, false, "superadmin", CRITERIA_USER)) + .withCondition(new FilterCondition(Condition.IN, false, String.join(",", contentFields), + CRITERIA_ACTION)); + + List activityContentList = widgetContentRepository.activityStatistics(filter, + sort, 4); + + assertNotNull(activityContentList); + assertEquals(4, activityContentList.size()); + } + + @Test + void uniqueBugStatisticsSorting() { + String sortingColumn = "statistics$defects$no_defect$nd001"; + Filter filter = buildDefaultFilter(1L); + + List orders = filter.getTarget() + .getCriteriaHolders() + .stream() + .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) + .collect(Collectors.toList()); + orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); + Sort sort = Sort.by(orders); + + Map uniqueBugStatistics = widgetContentRepository.uniqueBugStatistics( + filter, sort, true, 5); + + assertNotNull(uniqueBugStatistics); + assertEquals(2, uniqueBugStatistics.size()); + } + + @Test + void productStatusFilterGroupedWidgetSorting() { + + String sortingColumn = "statistics$defects$no_defect$nd001"; + + Filter filter = buildDefaultFilter(1L); + + List orders = filter.getTarget() + .getCriteriaHolders() + .stream() + .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) + .collect(Collectors.toList()); + orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); + Sort sort = Sort.by(orders); + Map filterSortMapping = Maps.newLinkedHashMap(); + + filterSortMapping.put(buildDefaultFilter(1L), sort); + filterSortMapping.put(buildDefaultTestFilter(1L), sort); + + Map tags = new LinkedHashMap<>(); + tags.put("firstColumn", "build"); + tags.put("secondColumn", "hello"); + + Map> result = widgetContentRepository.productStatusGroupedByFilterStatistics( + filterSortMapping, + buildProductStatusContentFields(), + tags, + false, + 10 + ); + + assertNotNull(result); + } + + @Test + void productStatusLaunchGroupedWidgetSorting() { + String sortingColumn = "statistics$defects$no_defect$nd001"; + Filter filter = buildDefaultTestFilter(1L); + List orders = filter.getTarget() + .getCriteriaHolders() + .stream() + .map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())) + .collect(Collectors.toList()); + orders.add(new Sort.Order(Sort.Direction.DESC, sortingColumn)); + Sort sort = Sort.by(orders); + Map tags = new LinkedHashMap<>(); + tags.put("firstColumn", "build"); + tags.put("secondColumn", "hello"); + + List result = widgetContentRepository.productStatusGroupedByLaunchesStatistics( + filter, + buildProductStatusContentFields(), + tags, + sort, + false, + 10 + ); + + assertNotNull(result); + } + + private Filter buildDefaultFilter(Long projectId) { + + List conditionList = Lists.newArrayList( + new FilterCondition(Condition.EQUALS, + false, + String.valueOf(projectId), + CRITERIA_PROJECT_ID + ), + new FilterCondition(Condition.NOT_EQUALS, false, StatusEnum.IN_PROGRESS.name(), + CRITERIA_STATUS), + new FilterCondition(Condition.EQUALS, false, Mode.DEFAULT.toString(), CRITERIA_LAUNCH_MODE) + ); + return new Filter(1L, Launch.class, conditionList); + } + + private Filter buildDefaultTestFilter(Long projectId) { + List conditionList = Lists.newArrayList( + new FilterCondition(Condition.EQUALS, + false, + String.valueOf(projectId), + CRITERIA_PROJECT_ID + ), + new FilterCondition(Condition.NOT_EQUALS, false, StatusEnum.IN_PROGRESS.name(), + CRITERIA_STATUS), + new FilterCondition(Condition.EQUALS, false, Mode.DEFAULT.toString(), CRITERIA_LAUNCH_MODE), + new FilterCondition(Condition.findByMarker("lte").get(), false, "12", + "statistics$executions$total") + ); + return new Filter(2L, Launch.class, conditionList); + } + + private Filter buildDefaultActivityFilter(Long projectId) { + List conditionList = Lists.newArrayList( + new FilterCondition(Condition.EQUALS, + false, + String.valueOf(projectId), + CRITERIA_PROJECT_ID + )); + return new Filter(1L, Activity.class, conditionList); + } + + private Filter buildMostTimeConsumingFilter(Long projectId) { + List conditionList = Lists.newArrayList( + new FilterCondition(Condition.EQUALS, + false, + String.valueOf(projectId), + CRITERIA_PROJECT_ID + ), new FilterCondition(Condition.EQUALS_ANY, + false, + String.join(",", JStatusEnum.PASSED.getLiteral(), JStatusEnum.FAILED.getLiteral()), + CRITERIA_STATUS + )); + + return new Filter(1L, TestItem.class, conditionList); + } + + private Filter updateFilter(Filter filter, String launchName, Long projectId, + boolean includeMethodsFlag) { + filter = updateFilterWithLaunchName(filter, launchName, projectId); + filter = updateFilterWithTestItemTypes(filter, includeMethodsFlag); + return filter; + } + + private Filter updateFilterWithLaunchName(Filter filter, String launchName, Long projectId) { + return filter.withCondition( + new FilterCondition(Condition.EQUALS, false, String.valueOf(1L), CRITERIA_LAUNCH_ID)); + } + + private Filter updateFilterWithTestItemTypes(Filter filter, boolean includeMethodsFlag) { + if (includeMethodsFlag) { + return updateFilterWithStepAndBeforeAfterMethods(filter); + } else { + return updateFilterWithStepTestItem(filter); + } + } + + private Filter updateFilterWithStepTestItem(Filter filter) { + return filter.withCondition( + new FilterCondition(Condition.EQUALS, false, STEP.getLiteral(), "type")); + } + + private Filter updateFilterWithStepAndBeforeAfterMethods(Filter filter) { + return filter.withCondition(new FilterCondition(Condition.EQUALS_ANY, + false, + String.join(",", STEP.getLiteral(), BEFORE_METHOD.getLiteral(), AFTER_METHOD.getLiteral()), + "type" + )); + } + + private List buildMostTimeConsumingTestCases() { + return Lists.newArrayList("statistics$executions$failed", "statistics$executions$passed"); + } + + private List buildLaunchesTableContentFields() { + return Lists.newArrayList("statistics$defects$no_defect$nd001", + "statistics$defects$product_bug$pb001", + "statistics$defects$automation_bug$ab001", + "statistics$defects$system_issue$si001", + "statistics$defects$to_investigate$ti001", + CRITERIA_END_TIME, + CRITERIA_DESCRIPTION, + CRITERIA_LAST_MODIFIED, + CRITERIA_USER, + "number", + "name", + "startTime", + "attributes", + "statistics$executions$total", + "statistics$executions$failed", + "statistics$executions$passed", + "statistics$executions$skipped" + ); + } + + private List buildContentFields() { + + return Lists.newArrayList("statistics$defects$no_defect$nd001", + "statistics$defects$product_bug$pb001", + "statistics$defects$automation_bug$ab001", + "statistics$defects$system_issue$si001", + "statistics$defects$to_investigate$ti001", + "statistics$executions$failed", + "statistics$executions$skipped", + "statistics$executions$passed", + "statistics$executions$total", + "statistics$defects$no_defect$total", + "statistics$defects$product_bug$total", + "statistics$defects$automation_bug$total", + "statistics$defects$system_issue$total", + "statistics$defects$to_investigate$total" + + ); + } + + private List buildTotalDefectsContentFields() { + return Lists.newArrayList("statistics$defects$to_investigate$total", + "statistics$defects$product_bug$total", + "statistics$defects$automation_bug$total", + "statistics$defects$system_issue$total", + "statistics$defects$no_defect$total" + ); + } + + private List buildTotalContentFields() { + return Lists.newArrayList("statistics$defects$no_defect$total", + "statistics$defects$product_bug$total", + "statistics$defects$automation_bug$total", + "statistics$defects$system_issue$total", + "statistics$defects$to_investigate$total", + "statistics$executions$failed", + "statistics$executions$skipped", + "statistics$executions$passed", + "statistics$executions$total" + ); + } + + private List buildProductStatusContentFields() { + return Lists.newArrayList("statistics$defects$no_defect$nd001", + "statistics$defects$product_bug$pb001", + "statistics$defects$automation_bug$ab001", + "statistics$defects$system_issue$si001", + "statistics$defects$to_investigate$ti001", + "statistics$executions$failed", + "statistics$executions$skipped", + "statistics$executions$total", + "startTime", + "status", + "statistics$defects$no_defect$total", + "statistics$defects$product_bug$total", + "statistics$defects$automation_bug$total", + "statistics$defects$system_issue$total", + "statistics$defects$to_investigate$total" + + ); + } + + private List buildActivityContentFields() { + return Lists.newArrayList("createLaunch", "createItem"); + } + + private Map> buildTotalDefectsMap() { + Map> investigatedTrendMap = Maps.newLinkedHashMap(); + + investigatedTrendMap.put(1L, + ImmutableMap.builder().put("statistics$defects$to_investigate$total", 2) + .put("statistics$defects$system_issue$total", 8) + .put("statistics$defects$automation_bug$total", 7) + .put("statistics$defects$product_bug$total", 13) + .put("statistics$defects$no_defect$total", 2) + .build() + ); + investigatedTrendMap.put(2L, + ImmutableMap.builder().put("statistics$defects$to_investigate$total", 3) + .put("statistics$defects$system_issue$total", 3) + .put("statistics$defects$automation_bug$total", 1) + .put("statistics$defects$product_bug$total", 1) + .put("statistics$defects$no_defect$total", 2) + .build() + ); + investigatedTrendMap.put(3L, + ImmutableMap.builder().put("statistics$defects$to_investigate$total", 1) + .put("statistics$defects$system_issue$total", 1) + .put("statistics$defects$automation_bug$total", 1) + .put("statistics$defects$product_bug$total", 1) + .put("statistics$defects$no_defect$total", 1) + .build() + ); + investigatedTrendMap.put(4L, + ImmutableMap.builder().put("statistics$defects$to_investigate$total", 3) + .put("statistics$defects$system_issue$total", 4) + .put("statistics$defects$automation_bug$total", 2) + .put("statistics$defects$product_bug$total", 2) + .put("statistics$defects$no_defect$total", 6) + .build() + ); + + return investigatedTrendMap; + + } + + private Map> buildLaunchesComparisonStatistics() { + Map> predefinedLaunchesComparisonStatistics = Maps.newLinkedHashMap(); + + predefinedLaunchesComparisonStatistics.put(1L, + ImmutableMap.builder().put("statistics$defects$to_investigate$total", 2) + .put("statistics$defects$system_issue$total", 8) + .put("statistics$defects$automation_bug$total", 7) + .put("statistics$defects$product_bug$total", 13) + .put("statistics$defects$no_defect$total", 2) + .put("statistics$executions$passed", 3) + .put("statistics$executions$skipped", 4) + .put("statistics$executions$failed", 3) + .put("statistics$executions$total", 10) + .build() + ); + predefinedLaunchesComparisonStatistics.put(2L, + ImmutableMap.builder().put("statistics$defects$to_investigate$total", 3) + .put("statistics$defects$system_issue$total", 3) + .put("statistics$defects$automation_bug$total", 1) + .put("statistics$defects$product_bug$total", 1) + .put("statistics$defects$no_defect$total", 2) + .put("statistics$executions$passed", 2) + .put("statistics$executions$skipped", 3) + .put("statistics$executions$failed", 6) + .put("statistics$executions$total", 11) + .build() + ); + + return predefinedLaunchesComparisonStatistics; + + } + + private Map> buildNotPassedCasesStatistics() { + Map> investigatedTrendMap = Maps.newLinkedHashMap(); + + investigatedTrendMap.put(1L, + ImmutableMap.builder().put("statistics$executions$passed", 3) + .put("statistics$executions$skipped", 4) + .put("statistics$executions$failed", 3) + .build() + ); + investigatedTrendMap.put(2L, + ImmutableMap.builder().put("statistics$executions$passed", 2) + .put("statistics$executions$skipped", 3) + .put("statistics$executions$failed", 6) + .build() + ); + investigatedTrendMap.put(3L, + ImmutableMap.builder().put("statistics$executions$passed", 5) + .put("statistics$executions$skipped", 5) + .put("statistics$executions$failed", 5) + .build() + ); + + return investigatedTrendMap; + + } + + @Test + void componentHealthCheck() { + + String sortingColumn = "statistics$defects$no_defect$nd001"; + + Filter launchFilter = buildDefaultFilter(1L); + List orderings = Lists.newArrayList( + new Sort.Order(Sort.Direction.DESC, sortingColumn), + new Sort.Order(Sort.Direction.DESC, CRITERIA_START_TIME) + ); + Sort sort = Sort.by(orderings); + + Filter itemsFilter = new Filter(1L, + TestItem.class, + Lists.newArrayList(FilterCondition.builder() + .withCondition(Condition.HAS) + .withNegative(false) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue("new:os") + .build()) + ); + + List contents = widgetContentRepository.componentHealthCheck( + launchFilter, + sort, + false, + 600, + itemsFilter, + "new" + ); + + assertTrue(contents.isEmpty()); + } + + @Test + void componentHealthCheckTable() { + + String sortingColumn = "statistics$defects$no_defect$nd001"; + + Filter launchFilter = buildDefaultFilter(1L); + List orderings = Lists.newArrayList( + new Sort.Order(Sort.Direction.DESC, sortingColumn), + new Sort.Order(Sort.Direction.DESC, CRITERIA_START_TIME) + ); + Sort sort = Sort.by(orderings); + + HealthCheckTableInitParams initParams = HealthCheckTableInitParams.of("first", + com.google.common.collect.Lists.newArrayList("build") + ); + + initParams.setCustomKey("build"); + + launchFilter.withCondition(FilterCondition.builder() + .withCondition(Condition.ANY) + .withSearchCriteria(CRITERIA_ITEM_ATTRIBUTE_KEY) + .withValue("build") + .build()); + + widgetContentRepository.generateComponentHealthCheckTable(false, initParams, launchFilter, sort, + 600, false); + + List healthCheckTableContents = widgetContentRepository.componentHealthCheckTable( + HealthCheckTableGetParams + .of("first", "build", Sort.by(Sort.Direction.DESC, "customColumn"), true, + new ArrayList<>())); + + assertFalse(healthCheckTableContents.isEmpty()); + + initParams = HealthCheckTableInitParams.of("hello", + com.google.common.collect.Lists.newArrayList("build")); + + widgetContentRepository.generateComponentHealthCheckTable(false, initParams, launchFilter, sort, + 600, false); + widgetContentRepository.generateComponentHealthCheckTable(true, initParams, launchFilter, sort, + 600, false); + + healthCheckTableContents = widgetContentRepository.componentHealthCheckTable( + HealthCheckTableGetParams.of("hello", + "hello", + Sort.by(Sort.Direction.DESC, "passingRate"), + false, + com.google.common.collect.Lists.newArrayList(LevelEntry.of("k1", "v1"), + LevelEntry.of("k2", "v2")) + )); + + assertTrue(healthCheckTableContents.isEmpty()); + + healthCheckTableContents = widgetContentRepository.componentHealthCheckTable( + HealthCheckTableGetParams.of("hello", + "build", + Sort.by(Sort.Direction.ASC, "passingRate"), + false, + new ArrayList<>() + )); + + assertTrue(healthCheckTableContents.isEmpty()); + + healthCheckTableContents = widgetContentRepository.componentHealthCheckTable( + HealthCheckTableGetParams.of("hello", + "build", + Sort.by(Sort.Direction.DESC, "statistics$executions$total"), + false, + new ArrayList<>() + )); + + assertTrue(healthCheckTableContents.isEmpty()); + + healthCheckTableContents = widgetContentRepository.componentHealthCheckTable( + HealthCheckTableGetParams.of("hello", + "build", + Sort.by(Sort.Direction.DESC, "statistics$executions$failed"), + false, + com.google.common.collect.Lists.newArrayList(LevelEntry.of("k1", "v1"), + LevelEntry.of("k2", "v2")) + )); + + assertTrue(healthCheckTableContents.isEmpty()); + + Result fetch = dslContext.fetch(DSL.sql("SELECT * FROM pg_matviews")); - assertTrue(fetch.isNotEmpty()); + assertTrue(fetch.isNotEmpty()); - widgetContentRepository.removeWidgetView("hello"); - widgetContentRepository.removeWidgetView("first"); - widgetContentRepository.removeWidgetView("not_existing_view"); + widgetContentRepository.removeWidgetView("hello"); + widgetContentRepository.removeWidgetView("first"); + widgetContentRepository.removeWidgetView("not_existing_view"); - Result fetch1 = dslContext.fetch(DSL.sql("SELECT * FROM pg_matviews")); + Result fetch1 = dslContext.fetch(DSL.sql("SELECT * FROM pg_matviews")); - assertTrue(fetch1.isEmpty()); + assertTrue(fetch1.isEmpty()); - } + } - @Test - void componentHealthCheckTableCompositeAttributeWithoutAny() { + @Test + void componentHealthCheckTableCompositeAttributeWithoutAny() { - String sortingColumn = "statistics$defects$no_defect$nd001"; + String sortingColumn = "statistics$defects$no_defect$nd001"; - Filter launchFilter = buildDefaultFilter(1L); - List orderings = Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, sortingColumn), - new Sort.Order(Sort.Direction.DESC, CRITERIA_START_TIME) - ); - Sort sort = Sort.by(orderings); + Filter launchFilter = buildDefaultFilter(1L); + List orderings = Lists.newArrayList( + new Sort.Order(Sort.Direction.DESC, sortingColumn), + new Sort.Order(Sort.Direction.DESC, CRITERIA_START_TIME) + ); + Sort sort = Sort.by(orderings); - HealthCheckTableInitParams initParams = HealthCheckTableInitParams.of("test_view", - com.google.common.collect.Lists.newArrayList("build") - ); + HealthCheckTableInitParams initParams = HealthCheckTableInitParams.of("test_view", + com.google.common.collect.Lists.newArrayList("build") + ); - initParams.setCustomKey("build"); + initParams.setCustomKey("build"); - launchFilter.withCondition(FilterCondition.builder() - .withCondition(Condition.ANY) - .withNegative(true) - .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) - .withValue("build:1") - .build()); + launchFilter.withCondition(FilterCondition.builder() + .withCondition(Condition.ANY) + .withNegative(true) + .withSearchCriteria(CRITERIA_COMPOSITE_ATTRIBUTE) + .withValue("build:1") + .build()); - widgetContentRepository.generateComponentHealthCheckTable(false, initParams, launchFilter, sort, 600, false); + widgetContentRepository.generateComponentHealthCheckTable(false, initParams, launchFilter, sort, + 600, false); - List healthCheckTableContents = widgetContentRepository.componentHealthCheckTable(HealthCheckTableGetParams.of( - initParams.getViewName(), - "build", - Sort.by(Sort.Direction.DESC, "customColumn"), - true, - new ArrayList<>() - )); + List healthCheckTableContents = widgetContentRepository.componentHealthCheckTable( + HealthCheckTableGetParams.of( + initParams.getViewName(), + "build", + Sort.by(Sort.Direction.DESC, "customColumn"), + true, + new ArrayList<>() + )); - assertFalse(healthCheckTableContents.isEmpty()); + assertFalse(healthCheckTableContents.isEmpty()); - widgetContentRepository.removeWidgetView(initParams.getViewName()); + widgetContentRepository.removeWidgetView(initParams.getViewName()); - } + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/dao/WidgetRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/WidgetRepositoryTest.java index 9ede84aa0..0a26a68c0 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/WidgetRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/WidgetRepositoryTest.java @@ -16,6 +16,13 @@ package com.epam.ta.reportportal.dao; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_NAME; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.commons.querygen.Condition; import com.epam.ta.reportportal.commons.querygen.Filter; @@ -24,6 +31,10 @@ import com.epam.ta.reportportal.entity.widget.Widget; import com.epam.ta.reportportal.entity.widget.WidgetType; import com.google.common.collect.Lists; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -32,15 +43,6 @@ import org.springframework.data.domain.Sort; import org.springframework.test.context.jdbc.Sql; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_NAME; -import static org.junit.jupiter.api.Assertions.*; - /** * Uses script from * @@ -49,203 +51,213 @@ @Sql("/db/fill/shareable/shareable-fill.sql") public class WidgetRepositoryTest extends BaseTest { - @Autowired - private WidgetRepository repository; - - @Test - void findAllByProjectId() { - final long superadminProjectId = 1L; - - final List widgets = repository.findAllByProjectId(superadminProjectId); - - assertNotNull(widgets, "Widgets not found"); - assertEquals(5, widgets.size(), "Unexpected widgets size"); - widgets.forEach(it -> assertEquals(superadminProjectId, (long) it.getProject().getId(), "Widget has incorrect project id")); - } - - @Test - public void shouldFindByIdAndProjectIdWhenExists() { - Optional widget = repository.findByIdAndProjectId(5L, 1L); - - assertTrue(widget.isPresent()); - } - - @Test - public void shouldNotFindByIdAndProjectIdWhenIdNotExists() { - Optional widget = repository.findByIdAndProjectId(55L, 1L); - - assertFalse(widget.isPresent()); - } - - @Test - public void shouldNotFindByIdAndProjectIdWhenProjectIdNotExists() { - Optional widget = repository.findByIdAndProjectId(5L, 11L); - - assertFalse(widget.isPresent()); - } - - @Test - public void shouldNotFindByIdAndProjectIdWhenIdAndProjectIdNotExist() { - Optional widget = repository.findByIdAndProjectId(55L, 11L); - - assertFalse(widget.isPresent()); - } - - @Test - void existsByNameAndOwnerAndProjectId() { - assertTrue(repository.existsByNameAndOwnerAndProjectId("INVESTIGATED PERCENTAGE OF LAUNCHES", "superadmin", 1L)); - assertFalse(repository.existsByNameAndOwnerAndProjectId("not exist name", "default", 2L)); - } - - @Test - void getPermitted() { - final String adminLogin = "superadmin"; - final Page superadminPermitted = repository.getPermitted(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), - adminLogin - ); - assertEquals(4, superadminPermitted.getTotalElements(), "Unexpected permitted widgets count"); - - final String defaultLogin = "default"; - final Page defaultPermitted = repository.getPermitted(ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - defaultLogin - ); - assertEquals(3, defaultPermitted.getTotalElements(), "Unexpected permitted widgets count"); - - final String jajaLogin = "jaja_user"; - final Page jajaPermitted = repository.getPermitted(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), - jajaLogin - ); - assertEquals(4, jajaPermitted.getTotalElements(), "Unexpected permitted widgets count"); - } - - @Test - void getOwn() { - final String adminLogin = "superadmin"; - final Page superadminOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), - adminLogin - ); - assertEquals(3, superadminOwn.getTotalElements(), "Unexpected own widgets count"); - superadminOwn.getContent().forEach(it -> assertEquals(adminLogin, it.getOwner())); - - final String defaultLogin = "default"; - final Page defaultOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 2L), PageRequest.of(0, 3), defaultLogin); - assertEquals(3, defaultOwn.getTotalElements(), "Unexpected own widgets count"); - defaultOwn.getContent().forEach(it -> assertEquals(defaultLogin, it.getOwner())); - - final String jajaLogin = "jaja_user"; - final Page jajaOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 1L), PageRequest.of(0, 3), jajaLogin); - assertEquals(2, jajaOwn.getTotalElements(), "Unexpected own widgets count"); - jajaOwn.getContent().forEach(it -> assertEquals(jajaLogin, it.getOwner())); - } - - @Test - void getShared() { - final String adminLogin = "superadmin"; - final Page superadminShared = repository.getShared(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), - adminLogin - ); - assertEquals(3, superadminShared.getTotalElements(), "Unexpected shared widgets count"); - superadminShared.getContent().forEach(it -> assertTrue(it.isShared())); - - final String defaultLogin = "default"; - final Page defaultShared = repository.getShared(ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - defaultLogin - ); - assertEquals(1, defaultShared.getTotalElements(), "Unexpected shared widgets count"); - defaultShared.getContent().forEach(it -> assertTrue(it.isShared())); - - final String jajaLogin = "jaja_user"; - final Page jajaShared = repository.getShared(ProjectFilter.of(buildDefaultFilter(), 1L), PageRequest.of(0, 3), jajaLogin); - assertEquals(3, jajaShared.getTotalElements(), "Unexpected shared widgets count"); - jajaShared.getContent().forEach(it -> assertTrue(it.isShared())); - } - - @Test - void deleteRelationByFilterIdAndNotOwnerTest() { - - int removedCount = repository.deleteRelationByFilterIdAndNotOwner(2L, "superadmin"); - - Assertions.assertEquals(1, removedCount); - } - - @Test - void findAllByProjectIdAndWidgetTypeInTest() { - List widgets = repository.findAllByProjectIdAndWidgetTypeIn(1L, - Lists.newArrayList(WidgetType.LAUNCH_STATISTICS, WidgetType.CASES_TREND) - .stream() - .map(WidgetType::getType) - .collect(Collectors.toList()) - ); - - assertFalse(widgets.isEmpty()); - assertEquals(2, widgets.size()); - - List moreWidgets = repository.findAllByProjectIdAndWidgetTypeIn(1L, - Collections.singletonList(WidgetType.CASES_TREND.getType()) - ); - - assertFalse(moreWidgets.isEmpty()); - assertEquals(1, moreWidgets.size()); - } - - @Test - void findAllByOwnerAndWidgetTypeInTest() { - List widgets = repository.findAllByOwnerAndWidgetTypeIn("superadmin", - Lists.newArrayList(WidgetType.LAUNCH_STATISTICS, WidgetType.ACTIVITY) - .stream() - .map(WidgetType::getType) - .collect(Collectors.toList()) - ); - - assertFalse(widgets.isEmpty()); - assertEquals(2, widgets.size()); - - List moreWidgets = repository.findAllByOwnerAndWidgetTypeIn("superadmin", - Collections.singletonList(WidgetType.LAUNCH_STATISTICS.getType()) - ); - - assertFalse(moreWidgets.isEmpty()); - assertEquals(1, moreWidgets.size()); - } - - @Test - void findAllByWidgetTypeInAndContentFieldsContainsTest() { - List widgets = repository.findAllByProjectIdAndWidgetTypeInAndContentFieldsContains(1L, - Lists.newArrayList(WidgetType.LAUNCH_STATISTICS, WidgetType.LAUNCHES_TABLE) - .stream() - .map(WidgetType::getType) - .collect(Collectors.toList()), - "statistics$product_bug$pb001" - ); - - assertFalse(widgets.isEmpty()); - assertEquals(1, widgets.size()); - } - - @Test - void findAllByProjectIdWidgetTypeInAndContentFieldContainingTest() { - List widgets = repository.findAllByProjectIdAndWidgetTypeInAndContentFieldContaining(1L, - Lists.newArrayList(WidgetType.LAUNCH_STATISTICS, WidgetType.LAUNCHES_TABLE) - .stream() - .map(WidgetType::getType) - .collect(Collectors.toList()), - "statistics$product_bug" - ); - - assertFalse(widgets.isEmpty()); - assertEquals(1, widgets.size()); - } - - private Filter buildDefaultFilter() { - return Filter.builder() - .withTarget(Widget.class) - .withCondition(new FilterCondition(Condition.LOWER_THAN, false, "100", CRITERIA_ID)) - .build(); - } + @Autowired + private WidgetRepository repository; + + @Test + void findAllByProjectId() { + final long superadminProjectId = 1L; + + final List widgets = repository.findAllByProjectId(superadminProjectId); + + assertNotNull(widgets, "Widgets not found"); + assertEquals(5, widgets.size(), "Unexpected widgets size"); + widgets.forEach(it -> assertEquals(superadminProjectId, (long) it.getProject().getId(), + "Widget has incorrect project id")); + } + + @Test + public void shouldFindByIdAndProjectIdWhenExists() { + Optional widget = repository.findByIdAndProjectId(5L, 1L); + + assertTrue(widget.isPresent()); + } + + @Test + public void shouldNotFindByIdAndProjectIdWhenIdNotExists() { + Optional widget = repository.findByIdAndProjectId(55L, 1L); + + assertFalse(widget.isPresent()); + } + + @Test + public void shouldNotFindByIdAndProjectIdWhenProjectIdNotExists() { + Optional widget = repository.findByIdAndProjectId(5L, 11L); + + assertFalse(widget.isPresent()); + } + + @Test + public void shouldNotFindByIdAndProjectIdWhenIdAndProjectIdNotExist() { + Optional widget = repository.findByIdAndProjectId(55L, 11L); + + assertFalse(widget.isPresent()); + } + + @Test + void existsByNameAndOwnerAndProjectId() { + assertTrue(repository.existsByNameAndOwnerAndProjectId("INVESTIGATED PERCENTAGE OF LAUNCHES", + "superadmin", 1L)); + assertFalse(repository.existsByNameAndOwnerAndProjectId("not exist name", "default", 2L)); + } + + @Test + void getPermitted() { + final String adminLogin = "superadmin"; + final Page superadminPermitted = repository.getPermitted( + ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), + adminLogin + ); + assertEquals(4, superadminPermitted.getTotalElements(), "Unexpected permitted widgets count"); + + final String defaultLogin = "default"; + final Page defaultPermitted = repository.getPermitted( + ProjectFilter.of(buildDefaultFilter(), 2L), + PageRequest.of(0, 3), + defaultLogin + ); + assertEquals(3, defaultPermitted.getTotalElements(), "Unexpected permitted widgets count"); + + final String jajaLogin = "jaja_user"; + final Page jajaPermitted = repository.getPermitted( + ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3), + jajaLogin + ); + assertEquals(4, jajaPermitted.getTotalElements(), "Unexpected permitted widgets count"); + } + + @Test + void getOwn() { + final String adminLogin = "superadmin"; + final Page superadminOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), + adminLogin + ); + assertEquals(3, superadminOwn.getTotalElements(), "Unexpected own widgets count"); + superadminOwn.getContent().forEach(it -> assertEquals(adminLogin, it.getOwner())); + + final String defaultLogin = "default"; + final Page defaultOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 2L), + PageRequest.of(0, 3), defaultLogin); + assertEquals(3, defaultOwn.getTotalElements(), "Unexpected own widgets count"); + defaultOwn.getContent().forEach(it -> assertEquals(defaultLogin, it.getOwner())); + + final String jajaLogin = "jaja_user"; + final Page jajaOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3), jajaLogin); + assertEquals(2, jajaOwn.getTotalElements(), "Unexpected own widgets count"); + jajaOwn.getContent().forEach(it -> assertEquals(jajaLogin, it.getOwner())); + } + + @Test + void getShared() { + final String adminLogin = "superadmin"; + final Page superadminShared = repository.getShared( + ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), + adminLogin + ); + assertEquals(3, superadminShared.getTotalElements(), "Unexpected shared widgets count"); + superadminShared.getContent().forEach(it -> assertTrue(it.isShared())); + + final String defaultLogin = "default"; + final Page defaultShared = repository.getShared( + ProjectFilter.of(buildDefaultFilter(), 2L), + PageRequest.of(0, 3), + defaultLogin + ); + assertEquals(1, defaultShared.getTotalElements(), "Unexpected shared widgets count"); + defaultShared.getContent().forEach(it -> assertTrue(it.isShared())); + + final String jajaLogin = "jaja_user"; + final Page jajaShared = repository.getShared(ProjectFilter.of(buildDefaultFilter(), 1L), + PageRequest.of(0, 3), jajaLogin); + assertEquals(3, jajaShared.getTotalElements(), "Unexpected shared widgets count"); + jajaShared.getContent().forEach(it -> assertTrue(it.isShared())); + } + + @Test + void deleteRelationByFilterIdAndNotOwnerTest() { + + int removedCount = repository.deleteRelationByFilterIdAndNotOwner(2L, "superadmin"); + + Assertions.assertEquals(1, removedCount); + } + + @Test + void findAllByProjectIdAndWidgetTypeInTest() { + List widgets = repository.findAllByProjectIdAndWidgetTypeIn(1L, + Lists.newArrayList(WidgetType.LAUNCH_STATISTICS, WidgetType.CASES_TREND) + .stream() + .map(WidgetType::getType) + .collect(Collectors.toList()) + ); + + assertFalse(widgets.isEmpty()); + assertEquals(2, widgets.size()); + + List moreWidgets = repository.findAllByProjectIdAndWidgetTypeIn(1L, + Collections.singletonList(WidgetType.CASES_TREND.getType()) + ); + + assertFalse(moreWidgets.isEmpty()); + assertEquals(1, moreWidgets.size()); + } + + @Test + void findAllByOwnerAndWidgetTypeInTest() { + List widgets = repository.findAllByOwnerAndWidgetTypeIn("superadmin", + Lists.newArrayList(WidgetType.LAUNCH_STATISTICS, WidgetType.ACTIVITY) + .stream() + .map(WidgetType::getType) + .collect(Collectors.toList()) + ); + + assertFalse(widgets.isEmpty()); + assertEquals(2, widgets.size()); + + List moreWidgets = repository.findAllByOwnerAndWidgetTypeIn("superadmin", + Collections.singletonList(WidgetType.LAUNCH_STATISTICS.getType()) + ); + + assertFalse(moreWidgets.isEmpty()); + assertEquals(1, moreWidgets.size()); + } + + @Test + void findAllByWidgetTypeInAndContentFieldsContainsTest() { + List widgets = repository.findAllByProjectIdAndWidgetTypeInAndContentFieldsContains(1L, + Lists.newArrayList(WidgetType.LAUNCH_STATISTICS, WidgetType.LAUNCHES_TABLE) + .stream() + .map(WidgetType::getType) + .collect(Collectors.toList()), + "statistics$product_bug$pb001" + ); + + assertFalse(widgets.isEmpty()); + assertEquals(1, widgets.size()); + } + + @Test + void findAllByProjectIdWidgetTypeInAndContentFieldContainingTest() { + List widgets = repository.findAllByProjectIdAndWidgetTypeInAndContentFieldContaining(1L, + Lists.newArrayList(WidgetType.LAUNCH_STATISTICS, WidgetType.LAUNCHES_TABLE) + .stream() + .map(WidgetType::getType) + .collect(Collectors.toList()), + "statistics$product_bug" + ); + + assertFalse(widgets.isEmpty()); + assertEquals(1, widgets.size()); + } + + private Filter buildDefaultFilter() { + return Filter.builder() + .withTarget(Widget.class) + .withCondition(new FilterCondition(Condition.LOWER_THAN, false, "100", CRITERIA_ID)) + .build(); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/dao/constant/TestConstants.java b/src/test/java/com/epam/ta/reportportal/dao/constant/TestConstants.java index da654130f..c901730b3 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/constant/TestConstants.java +++ b/src/test/java/com/epam/ta/reportportal/dao/constant/TestConstants.java @@ -21,21 +21,19 @@ */ public final class TestConstants { - private TestConstants() { - //static only - } + public static final Long SUPERADMIN_ID = 1L; + public static final Long SUPERADMIN_PERSONAL_PROJECT_ID = 1L; + public static final Long DEFAULT_PERSONAL_PROJECT_ID = 2L; + public static final String SUPERADMIN_LOGIN = "superadmin"; + public static final Long STEP_ITEM_WITH_LOGS_ID = 1L; + public static final Long RALLY_INTEGRATION_TYPE_ID = 2L; + public static final Long JIRA_INTEGRATION_TYPE_ID = 3L; + public static final Long EMAIL_INTEGRATION_TYPE_ID = 4L; + public static final Long GLOBAL_EMAIL_INTEGRATION_ID = 17L; + public static final Long RALLY_INTEGRATION_ID = 1L; + public static final Long JIRA_INTEGRATION_ID = 2L; - public static final Long SUPERADMIN_ID = 1L; - public static final Long SUPERADMIN_PERSONAL_PROJECT_ID = 1L; - public static final Long DEFAULT_PERSONAL_PROJECT_ID = 2L; - public static final String SUPERADMIN_LOGIN = "superadmin"; - public static final Long STEP_ITEM_WITH_LOGS_ID = 1L; - - public static final Long RALLY_INTEGRATION_TYPE_ID = 2L; - public static final Long JIRA_INTEGRATION_TYPE_ID = 3L; - public static final Long EMAIL_INTEGRATION_TYPE_ID = 4L; - public static final Long GLOBAL_EMAIL_INTEGRATION_ID = 17L; - - public static final Long RALLY_INTEGRATION_ID = 1L; - public static final Long JIRA_INTEGRATION_ID = 2L; + private TestConstants() { + //static only + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/util/RecordMapperUtilsTest.java b/src/test/java/com/epam/ta/reportportal/dao/util/RecordMapperUtilsTest.java index a08f60868..e9c838b29 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/util/RecordMapperUtilsTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/util/RecordMapperUtilsTest.java @@ -16,21 +16,23 @@ package com.epam.ta.reportportal.dao.util; -import org.junit.jupiter.api.Test; - import static com.epam.ta.reportportal.jooq.tables.JUsers.USERS; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; + /** * @author Ivan Budayeu */ class RecordMapperUtilsTest { - @Test - void fieldExcludingPredicate() { + @Test + void fieldExcludingPredicate() { - assertFalse(RecordMapperUtils.fieldExcludingPredicate(USERS.LOGIN, USERS.EMAIL).test(USERS.LOGIN)); - assertTrue(RecordMapperUtils.fieldExcludingPredicate(USERS.LOGIN, USERS.EMAIL).test(USERS.FULL_NAME)); - } + assertFalse( + RecordMapperUtils.fieldExcludingPredicate(USERS.LOGIN, USERS.EMAIL).test(USERS.LOGIN)); + assertTrue( + RecordMapperUtils.fieldExcludingPredicate(USERS.LOGIN, USERS.EMAIL).test(USERS.FULL_NAME)); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/ActivityEntityTypeTest.java b/src/test/java/com/epam/ta/reportportal/entity/ActivityEntityTypeTest.java index 73c685271..723d4cd27 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/ActivityEntityTypeTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/ActivityEntityTypeTest.java @@ -16,42 +16,45 @@ package com.epam.ta.reportportal.entity; -import com.epam.ta.reportportal.entity.activity.Activity; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import com.epam.ta.reportportal.entity.activity.Activity; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class ActivityEntityTypeTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() throws Exception { - allowed = Arrays.stream(Activity.ActivityEntityType.values()) - .collect(Collectors.toMap(it -> it, - it -> Arrays.asList(it.getValue(), it.getValue().toUpperCase(), it.getValue().toLowerCase()) - )); - disallowed = Arrays.asList("noSuchMode", "", " ", null); - } - - @Test - void fromStringTest() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = Activity.ActivityEntityType.fromString(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(Activity.ActivityEntityType.fromString(it).isPresent())); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() throws Exception { + allowed = Arrays.stream(Activity.ActivityEntityType.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.getValue(), it.getValue().toUpperCase(), + it.getValue().toLowerCase()) + )); + disallowed = Arrays.asList("noSuchMode", "", " ", null); + } + + @Test + void fromStringTest() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = Activity.ActivityEntityType.fromString( + val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(Activity.ActivityEntityType.fromString(it).isPresent())); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/AnalyzeModeTest.java b/src/test/java/com/epam/ta/reportportal/entity/AnalyzeModeTest.java index 025a0516c..f34b51951 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/AnalyzeModeTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/AnalyzeModeTest.java @@ -16,41 +16,43 @@ package com.epam.ta.reportportal.entity; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class AnalyzeModeTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() throws Exception { - allowed = Arrays.stream(AnalyzeMode.values()) - .collect(Collectors.toMap(it -> it, - it -> Arrays.asList(it.getValue(), it.getValue().toUpperCase(), it.getValue().toLowerCase()) - )); - disallowed = Arrays.asList("noSuchMode", "", " ", null); - } - - @Test - void fromString() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = AnalyzeMode.fromString(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(AnalyzeMode.fromString(it).isPresent())); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() throws Exception { + allowed = Arrays.stream(AnalyzeMode.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.getValue(), it.getValue().toUpperCase(), + it.getValue().toLowerCase()) + )); + disallowed = Arrays.asList("noSuchMode", "", " ", null); + } + + @Test + void fromString() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = AnalyzeMode.fromString(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(AnalyzeMode.fromString(it).isPresent())); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/EmailSettingsEnumTest.java b/src/test/java/com/epam/ta/reportportal/entity/EmailSettingsEnumTest.java index 9fc64d632..0251dd508 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/EmailSettingsEnumTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/EmailSettingsEnumTest.java @@ -16,48 +16,51 @@ package com.epam.ta.reportportal.entity; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ivan Budayeu */ class EmailSettingsEnumTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() throws Exception { - allowed = Arrays.stream(EmailSettingsEnum.values()) - .collect(Collectors.toMap(it -> it, - it -> Arrays.asList(it.getAttribute(), it.getAttribute().toUpperCase(), it.getAttribute().toLowerCase()) - )); - disallowed = Arrays.asList("noSuchAttribute", "", " ", null); - } - - @Test - void findByAttribute() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = EmailSettingsEnum.findByAttribute(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(EmailSettingsEnum.findByAttribute(it).isPresent())); - } - - @Test - void isPresent() { - allowed.entrySet().stream().flatMap(it -> it.getValue().stream()).forEach(it -> assertTrue(EmailSettingsEnum.isPresent(it))); - disallowed.forEach(it -> assertFalse(EmailSettingsEnum.isPresent(it))); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() throws Exception { + allowed = Arrays.stream(EmailSettingsEnum.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.getAttribute(), it.getAttribute().toUpperCase(), + it.getAttribute().toLowerCase()) + )); + disallowed = Arrays.asList("noSuchAttribute", "", " ", null); + } + + @Test + void findByAttribute() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = EmailSettingsEnum.findByAttribute(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(EmailSettingsEnum.findByAttribute(it).isPresent())); + } + + @Test + void isPresent() { + allowed.entrySet().stream().flatMap(it -> it.getValue().stream()) + .forEach(it -> assertTrue(EmailSettingsEnum.isPresent(it))); + disallowed.forEach(it -> assertFalse(EmailSettingsEnum.isPresent(it))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/ItemAttributeTest.java b/src/test/java/com/epam/ta/reportportal/entity/ItemAttributeTest.java index 39999fc38..345b52bf9 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/ItemAttributeTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/ItemAttributeTest.java @@ -16,79 +16,79 @@ package com.epam.ta.reportportal.entity; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + import com.epam.ta.reportportal.entity.item.TestItem; import com.epam.ta.reportportal.entity.launch.Launch; import com.google.common.collect.Sets; -import org.junit.jupiter.api.Test; - import java.util.HashSet; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class ItemAttributeTest { - @Test - void equals() { - final ItemAttribute one = getAttribute(1L, "key", "val", false, 1L, null); - final ItemAttribute two = getAttribute(2L, "key", "val", false, 1L, null); - final ItemAttribute three = getAttribute(3L, "key", "newVal", false, 1L, null); - assertEquals(one, two); - assertNotEquals(one, three); + @Test + void equals() { + final ItemAttribute one = getAttribute(1L, "key", "val", false, 1L, null); + final ItemAttribute two = getAttribute(2L, "key", "val", false, 1L, null); + final ItemAttribute three = getAttribute(3L, "key", "newVal", false, 1L, null); + assertEquals(one, two); + assertNotEquals(one, three); - final ItemAttribute four = getAttribute(4L, "key", "val", false, 2L, null); - assertNotEquals(one, four); + final ItemAttribute four = getAttribute(4L, "key", "val", false, 2L, null); + assertNotEquals(one, four); - final ItemAttribute five = getAttribute(5L, "key", "val", false, null, 1L); - assertNotEquals(one, five); - } + final ItemAttribute five = getAttribute(5L, "key", "val", false, null, 1L); + assertNotEquals(one, five); + } - @Test - void hashCodeTest() { - final ItemAttribute one = getAttribute(1L, "key", "val", false, 1L, null); - final ItemAttribute two = getAttribute(2L, "key", "val", false, 1L, null); - final ItemAttribute three = getAttribute(3L, "key", "newVal", false, 1L, null); - assertEquals(one.hashCode(), two.hashCode()); - assertNotEquals(one.hashCode(), three.hashCode()); + @Test + void hashCodeTest() { + final ItemAttribute one = getAttribute(1L, "key", "val", false, 1L, null); + final ItemAttribute two = getAttribute(2L, "key", "val", false, 1L, null); + final ItemAttribute three = getAttribute(3L, "key", "newVal", false, 1L, null); + assertEquals(one.hashCode(), two.hashCode()); + assertNotEquals(one.hashCode(), three.hashCode()); - final ItemAttribute four = getAttribute(4L, "key", "val", false, 2L, null); - assertNotEquals(one.hashCode(), four.hashCode()); + final ItemAttribute four = getAttribute(4L, "key", "val", false, 2L, null); + assertNotEquals(one.hashCode(), four.hashCode()); - final ItemAttribute five = getAttribute(5L, "key", "val", false, null, 1L); - assertNotEquals(one.hashCode(), five.hashCode()); - } + final ItemAttribute five = getAttribute(5L, "key", "val", false, null, 1L); + assertNotEquals(one.hashCode(), five.hashCode()); + } - @Test - void setTest() { - final ItemAttribute one = getAttribute(1L, "key", "val", false, 1L, null); - final ItemAttribute two = getAttribute(2L, "key", "val", false, 1L, null); - final ItemAttribute three = getAttribute(3L, "key", "newVal", false, 1L, null); - final ItemAttribute four = getAttribute(4L, "key", "val", false, 2L, null); - final ItemAttribute five = getAttribute(5L, "key", "val", false, null, 1L); + @Test + void setTest() { + final ItemAttribute one = getAttribute(1L, "key", "val", false, 1L, null); + final ItemAttribute two = getAttribute(2L, "key", "val", false, 1L, null); + final ItemAttribute three = getAttribute(3L, "key", "newVal", false, 1L, null); + final ItemAttribute four = getAttribute(4L, "key", "val", false, 2L, null); + final ItemAttribute five = getAttribute(5L, "key", "val", false, null, 1L); - final HashSet attrSet = Sets.newHashSet(one, two, three, four, five); - assertEquals(4, attrSet.size()); - } + final HashSet attrSet = Sets.newHashSet(one, two, three, four, five); + assertEquals(4, attrSet.size()); + } - private ItemAttribute getAttribute(Long id, String key, String value, boolean system, Long launchId, Long itemId) { - ItemAttribute attr = new ItemAttribute(); - attr.setId(id); - attr.setKey(key); - attr.setValue(value); - attr.setSystem(system); - if (launchId != null) { - Launch launch = new Launch(); - launch.setId(launchId); - attr.setLaunch(launch); - } - if (itemId != null) { - TestItem item = new TestItem(); - item.setItemId(itemId); - attr.setTestItem(item); - } - return attr; - } + private ItemAttribute getAttribute(Long id, String key, String value, boolean system, + Long launchId, Long itemId) { + ItemAttribute attr = new ItemAttribute(); + attr.setId(id); + attr.setKey(key); + attr.setValue(value); + attr.setSystem(system); + if (launchId != null) { + Launch launch = new Launch(); + launch.setId(launchId); + attr.setLaunch(launch); + } + if (itemId != null) { + TestItem item = new TestItem(); + item.setItemId(itemId); + attr.setTestItem(item); + } + return attr; + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/ServerSettingsEnumTest.java b/src/test/java/com/epam/ta/reportportal/entity/ServerSettingsEnumTest.java index cffa3fb70..4ec04e2a4 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/ServerSettingsEnumTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/ServerSettingsEnumTest.java @@ -16,47 +16,50 @@ package com.epam.ta.reportportal.entity; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class ServerSettingsEnumTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() { - allowed = Arrays.stream(ServerSettingsEnum.values()) - .collect(Collectors.toMap(it -> it, - it -> Arrays.asList(it.getAttribute(), it.getAttribute().toUpperCase(), it.getAttribute().toLowerCase()) - )); - disallowed = Arrays.asList("noSuchAttribute", "", " ", null); - } - - @Test - void findByAttribute() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = ServerSettingsEnum.findByAttribute(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(ServerSettingsEnum.findByAttribute(it).isPresent())); - } - - @Test - void isPresent() { - allowed.entrySet().stream().flatMap(it -> it.getValue().stream()).forEach(it -> assertTrue(ServerSettingsEnum.isPresent(it))); - disallowed.forEach(it -> assertFalse(ServerSettingsEnum.isPresent(it))); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() { + allowed = Arrays.stream(ServerSettingsEnum.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.getAttribute(), it.getAttribute().toUpperCase(), + it.getAttribute().toLowerCase()) + )); + disallowed = Arrays.asList("noSuchAttribute", "", " ", null); + } + + @Test + void findByAttribute() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = ServerSettingsEnum.findByAttribute(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(ServerSettingsEnum.findByAttribute(it).isPresent())); + } + + @Test + void isPresent() { + allowed.entrySet().stream().flatMap(it -> it.getValue().stream()) + .forEach(it -> assertTrue(ServerSettingsEnum.isPresent(it))); + disallowed.forEach(it -> assertFalse(ServerSettingsEnum.isPresent(it))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/activity/ActivityActionTest.java b/src/test/java/com/epam/ta/reportportal/entity/activity/ActivityActionTest.java index dc8ff9f91..d18e2a593 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/activity/ActivityActionTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/activity/ActivityActionTest.java @@ -16,41 +16,43 @@ package com.epam.ta.reportportal.entity.activity; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class ActivityActionTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() throws Exception { - allowed = Arrays.stream(ActivityAction.values()) - .collect(Collectors.toMap(it -> it, - it -> Arrays.asList(it.getValue(), it.getValue().toUpperCase(), it.getValue().toLowerCase()) - )); - disallowed = Arrays.asList("noSuchAction", "", " ", null); - } - - @Test - void fromString() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = ActivityAction.fromString(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(ActivityAction.fromString(it).isPresent())); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() throws Exception { + allowed = Arrays.stream(ActivityAction.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.getValue(), it.getValue().toUpperCase(), + it.getValue().toLowerCase()) + )); + disallowed = Arrays.asList("noSuchAction", "", " ", null); + } + + @Test + void fromString() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = ActivityAction.fromString(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(ActivityAction.fromString(it).isPresent())); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/ActivityEventTypeTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/ActivityEventTypeTest.java index 390d2d5a7..724a26ce9 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/ActivityEventTypeTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/ActivityEventTypeTest.java @@ -16,41 +16,43 @@ package com.epam.ta.reportportal.entity.enums; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class ActivityEventTypeTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() throws Exception { - allowed = Arrays.stream(ActivityEventType.values()) - .collect(Collectors.toMap(it -> it, - it -> Arrays.asList(it.getValue(), it.getValue().toUpperCase(), it.getValue().toLowerCase()) - )); - disallowed = Arrays.asList("bla", null, "", "noSuchActivityEventType"); - } - - @Test - void fromString() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = ActivityEventType.fromString(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(ActivityEventType.fromString(it).isPresent())); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() throws Exception { + allowed = Arrays.stream(ActivityEventType.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.getValue(), it.getValue().toUpperCase(), + it.getValue().toLowerCase()) + )); + disallowed = Arrays.asList("bla", null, "", "noSuchActivityEventType"); + } + + @Test + void fromString() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = ActivityEventType.fromString(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(ActivityEventType.fromString(it).isPresent())); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/AuthTypeTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/AuthTypeTest.java index c41d41d72..e1e1df1fb 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/AuthTypeTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/AuthTypeTest.java @@ -16,45 +16,48 @@ package com.epam.ta.reportportal.entity.enums; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class AuthTypeTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() throws Exception { - allowed = Arrays.stream(AuthType.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - disallowed = Arrays.asList("bla", "", null, " "); - } - - @Test - void findByName() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = AuthType.findByName(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(AuthType.findByName(it).isPresent())); - } - - @Test - void isPresent() { - allowed.entrySet().stream().flatMap(it -> it.getValue().stream()).forEach(it -> assertTrue(AuthType.isPresent(it))); - disallowed.forEach(it -> assertFalse(AuthType.isPresent(it))); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() throws Exception { + allowed = Arrays.stream(AuthType.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + disallowed = Arrays.asList("bla", "", null, " "); + } + + @Test + void findByName() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = AuthType.findByName(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(AuthType.findByName(it).isPresent())); + } + + @Test + void isPresent() { + allowed.entrySet().stream().flatMap(it -> it.getValue().stream()) + .forEach(it -> assertTrue(AuthType.isPresent(it))); + disallowed.forEach(it -> assertFalse(AuthType.isPresent(it))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/ExternalSystemTypeTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/ExternalSystemTypeTest.java index 00d4397d6..782f7bc25 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/ExternalSystemTypeTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/ExternalSystemTypeTest.java @@ -16,49 +16,52 @@ package com.epam.ta.reportportal.entity.enums; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class ExternalSystemTypeTest { - private Map> allowed; - private List disallowed; + private Map> allowed; + private List disallowed; - @BeforeEach - void setUp() { - allowed = Arrays.stream(ExternalSystemType.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - disallowed = Arrays.asList("noSuchType", " ", "", null); - } + @BeforeEach + void setUp() { + allowed = Arrays.stream(ExternalSystemType.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + disallowed = Arrays.asList("noSuchType", " ", "", null); + } - @Test - void knownIssue() { - } + @Test + void knownIssue() { + } - @Test - void findByName() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = ExternalSystemType.findByName(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(ExternalSystemType.findByName(it).isPresent())); - } + @Test + void findByName() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = ExternalSystemType.findByName(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(ExternalSystemType.findByName(it).isPresent())); + } - @Test - void isPresent() { - allowed.entrySet().stream().flatMap(it -> it.getValue().stream()).forEach(it -> assertTrue(ExternalSystemType.isPresent(it))); - disallowed.forEach(it -> assertFalse(ExternalSystemType.isPresent(it))); - } + @Test + void isPresent() { + allowed.entrySet().stream().flatMap(it -> it.getValue().stream()) + .forEach(it -> assertTrue(ExternalSystemType.isPresent(it))); + disallowed.forEach(it -> assertFalse(ExternalSystemType.isPresent(it))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/ImageFormatTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/ImageFormatTest.java index 4859ec473..035a696e6 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/ImageFormatTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/ImageFormatTest.java @@ -16,39 +16,41 @@ package com.epam.ta.reportportal.entity.enums; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class ImageFormatTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() { - allowed = Arrays.stream(ImageFormat.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - disallowed = Arrays.asList("noSuchType", "", " ", "", null); - } - - @Test - void fromValue() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = ImageFormat.fromValue(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(ImageFormat.fromValue(it).isPresent())); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() { + allowed = Arrays.stream(ImageFormat.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + disallowed = Arrays.asList("noSuchType", "", " ", "", null); + } + + @Test + void fromValue() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = ImageFormat.fromValue(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(ImageFormat.fromValue(it).isPresent())); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/InfoIntervalTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/InfoIntervalTest.java index ea2b19a72..39c1d3677 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/InfoIntervalTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/InfoIntervalTest.java @@ -16,41 +16,43 @@ package com.epam.ta.reportportal.entity.enums; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class InfoIntervalTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() { - allowed = Arrays.stream(InfoInterval.values()) - .collect(Collectors.toMap(it -> it, - it -> Arrays.asList(it.getInterval(), it.getInterval().toUpperCase(), it.getInterval().toLowerCase()) - )); - disallowed = Arrays.asList("noSuchType", "", " ", "", null); - } - - @Test - void findByInterval() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = InfoInterval.findByInterval(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(InfoInterval.findByInterval(it).isPresent())); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() { + allowed = Arrays.stream(InfoInterval.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.getInterval(), it.getInterval().toUpperCase(), + it.getInterval().toLowerCase()) + )); + disallowed = Arrays.asList("noSuchType", "", " ", "", null); + } + + @Test + void findByInterval() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = InfoInterval.findByInterval(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(InfoInterval.findByInterval(it).isPresent())); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/IntegrationAuthFlowEnumTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/IntegrationAuthFlowEnumTest.java index 1302c0ff4..c5ecdc2bd 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/IntegrationAuthFlowEnumTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/IntegrationAuthFlowEnumTest.java @@ -16,45 +16,48 @@ package com.epam.ta.reportportal.entity.enums; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class IntegrationAuthFlowEnumTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() { - allowed = Arrays.stream(IntegrationAuthFlowEnum.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - disallowed = Arrays.asList("noSuchType", "", " ", "", null); - } - - @Test - void findByName() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = IntegrationAuthFlowEnum.findByName(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(IntegrationAuthFlowEnum.findByName(it).isPresent())); - } - - @Test - void isPresent() { - allowed.entrySet().stream().flatMap(it -> it.getValue().stream()).forEach(it -> assertTrue(IntegrationAuthFlowEnum.isPresent(it))); - disallowed.forEach(it -> assertFalse(IntegrationAuthFlowEnum.isPresent(it))); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() { + allowed = Arrays.stream(IntegrationAuthFlowEnum.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + disallowed = Arrays.asList("noSuchType", "", " ", "", null); + } + + @Test + void findByName() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = IntegrationAuthFlowEnum.findByName(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(IntegrationAuthFlowEnum.findByName(it).isPresent())); + } + + @Test + void isPresent() { + allowed.entrySet().stream().flatMap(it -> it.getValue().stream()) + .forEach(it -> assertTrue(IntegrationAuthFlowEnum.isPresent(it))); + disallowed.forEach(it -> assertFalse(IntegrationAuthFlowEnum.isPresent(it))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/IntegrationGroupEnumTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/IntegrationGroupEnumTest.java index 8953152ae..d1372d87d 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/IntegrationGroupEnumTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/IntegrationGroupEnumTest.java @@ -16,45 +16,48 @@ package com.epam.ta.reportportal.entity.enums; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class IntegrationGroupEnumTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() { - allowed = Arrays.stream(IntegrationGroupEnum.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - disallowed = Arrays.asList("noSuchType", "", " ", "", null); - } - - @Test - void findByName() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = IntegrationGroupEnum.findByName(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(IntegrationGroupEnum.findByName(it).isPresent())); - } - - @Test - void isPresent() { - allowed.entrySet().stream().flatMap(it -> it.getValue().stream()).forEach(it -> assertTrue(IntegrationGroupEnum.isPresent(it))); - disallowed.forEach(it -> assertFalse(IntegrationGroupEnum.isPresent(it))); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() { + allowed = Arrays.stream(IntegrationGroupEnum.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + disallowed = Arrays.asList("noSuchType", "", " ", "", null); + } + + @Test + void findByName() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = IntegrationGroupEnum.findByName(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(IntegrationGroupEnum.findByName(it).isPresent())); + } + + @Test + void isPresent() { + allowed.entrySet().stream().flatMap(it -> it.getValue().stream()) + .forEach(it -> assertTrue(IntegrationGroupEnum.isPresent(it))); + disallowed.forEach(it -> assertFalse(IntegrationGroupEnum.isPresent(it))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/LaunchModeEnumTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/LaunchModeEnumTest.java index 50872eaf4..19cae3708 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/LaunchModeEnumTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/LaunchModeEnumTest.java @@ -16,39 +16,41 @@ package com.epam.ta.reportportal.entity.enums; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class LaunchModeEnumTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() { - allowed = Arrays.stream(LaunchModeEnum.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - disallowed = Arrays.asList("noSuchType", "", " ", "", null); - } - - @Test - void findByName() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = LaunchModeEnum.findByName(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(LaunchModeEnum.findByName(it).isPresent())); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() { + allowed = Arrays.stream(LaunchModeEnum.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + disallowed = Arrays.asList("noSuchType", "", " ", "", null); + } + + @Test + void findByName() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = LaunchModeEnum.findByName(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(LaunchModeEnum.findByName(it).isPresent())); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/LogLevelTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/LogLevelTest.java index da05a8385..b387ac88a 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/LogLevelTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/LogLevelTest.java @@ -16,94 +16,105 @@ package com.epam.ta.reportportal.entity.enums; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.exception.ReportPortalException; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import java.util.*; -import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ihar Kahadouski */ class LogLevelTest { - private Map> allowedNames; - private List disallowedNames; - private Map allowedCodes; - private List disallowedCodes; - - @BeforeEach - void setUp() throws Exception { - allowedNames = Arrays.stream(LogLevel.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - disallowedNames = Arrays.asList("NoSuchLogLevel", "", " ", "null", "warrrn"); - allowedCodes = Arrays.stream(LogLevel.values()).collect(Collectors.toMap(it -> it, LogLevel::toInt)); - disallowedCodes = Arrays.asList(0, 1500, 999, 7); - } - - @Test - void isGreaterOrEqual() { - final LogLevel warn = LogLevel.WARN; - final LogLevel trace = LogLevel.TRACE; - final LogLevel warnSecond = LogLevel.WARN; - final LogLevel fatal = LogLevel.FATAL; - - assertTrue(warn.isGreaterOrEqual(trace)); - assertTrue(warn.isGreaterOrEqual(warnSecond)); - assertFalse(warn.isGreaterOrEqual(fatal)); - } - - @Test - void toLevel() { - allowedNames.forEach((key, value) -> value.forEach(val -> { - final Optional optional = LogLevel.toLevel(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowedNames.forEach(it -> assertFalse(LogLevel.toLevel(it).isPresent())); - } - - @Test - void toLevelInt() { - allowedCodes.forEach((key, value) -> assertEquals(key, LogLevel.toLevel(value))); - } - - @Test - void toCustomLogLevel() { - allowedNames.forEach((key, value) -> value.forEach(val -> assertEquals(key.toInt(), LogLevel.toCustomLogLevel(val)))); - allowedCodes.forEach((key, val) -> assertEquals(key.toInt(), LogLevel.toCustomLogLevel(val.toString()))); - disallowedCodes.forEach(it -> { - if (it < LogLevel.TRACE_INT) { - assertEquals(LogLevel.TRACE_INT, LogLevel.toCustomLogLevel(it.toString())); - } else { - assertEquals(it.intValue(), LogLevel.toCustomLogLevel(it.toString())); - } - }); - } - - @Test - void toCustomLogLevelNames() { - Collections.shuffle(disallowedNames); - final String wrongLogName = disallowedNames.get(0); - assertEquals(LogLevel.UNKNOWN.toInt(), LogLevel.toCustomLogLevel(wrongLogName)); - } - - @Test - void toCustomLogLevelCodesFail() { - - final int i = LogLevel.toCustomLogLevel(disallowedCodes.get(0).toString()); - assertEquals(LogLevel.TRACE.toInt(), i); - } - - @Test - void toLevelIntFail() { - Collections.shuffle(disallowedCodes); - final Integer code = disallowedCodes.get(0); - - final ReportPortalException exception = assertThrows(ReportPortalException.class, () -> LogLevel.toLevel(code)); - assertEquals("Error in Save Log Request. Wrong level = " + code, exception.getMessage()); - } + private Map> allowedNames; + private List disallowedNames; + private Map allowedCodes; + private List disallowedCodes; + + @BeforeEach + void setUp() throws Exception { + allowedNames = Arrays.stream(LogLevel.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + disallowedNames = Arrays.asList("NoSuchLogLevel", "", " ", "null", "warrrn"); + allowedCodes = Arrays.stream(LogLevel.values()) + .collect(Collectors.toMap(it -> it, LogLevel::toInt)); + disallowedCodes = Arrays.asList(0, 1500, 999, 7); + } + + @Test + void isGreaterOrEqual() { + final LogLevel warn = LogLevel.WARN; + final LogLevel trace = LogLevel.TRACE; + final LogLevel warnSecond = LogLevel.WARN; + final LogLevel fatal = LogLevel.FATAL; + + assertTrue(warn.isGreaterOrEqual(trace)); + assertTrue(warn.isGreaterOrEqual(warnSecond)); + assertFalse(warn.isGreaterOrEqual(fatal)); + } + + @Test + void toLevel() { + allowedNames.forEach((key, value) -> value.forEach(val -> { + final Optional optional = LogLevel.toLevel(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowedNames.forEach(it -> assertFalse(LogLevel.toLevel(it).isPresent())); + } + + @Test + void toLevelInt() { + allowedCodes.forEach((key, value) -> assertEquals(key, LogLevel.toLevel(value))); + } + + @Test + void toCustomLogLevel() { + allowedNames.forEach((key, value) -> value.forEach( + val -> assertEquals(key.toInt(), LogLevel.toCustomLogLevel(val)))); + allowedCodes.forEach( + (key, val) -> assertEquals(key.toInt(), LogLevel.toCustomLogLevel(val.toString()))); + disallowedCodes.forEach(it -> { + if (it < LogLevel.TRACE_INT) { + assertEquals(LogLevel.TRACE_INT, LogLevel.toCustomLogLevel(it.toString())); + } else { + assertEquals(it.intValue(), LogLevel.toCustomLogLevel(it.toString())); + } + }); + } + + @Test + void toCustomLogLevelNames() { + Collections.shuffle(disallowedNames); + final String wrongLogName = disallowedNames.get(0); + assertEquals(LogLevel.UNKNOWN.toInt(), LogLevel.toCustomLogLevel(wrongLogName)); + } + + @Test + void toCustomLogLevelCodesFail() { + + final int i = LogLevel.toCustomLogLevel(disallowedCodes.get(0).toString()); + assertEquals(LogLevel.TRACE.toInt(), i); + } + + @Test + void toLevelIntFail() { + Collections.shuffle(disallowedCodes); + final Integer code = disallowedCodes.get(0); + + final ReportPortalException exception = assertThrows(ReportPortalException.class, + () -> LogLevel.toLevel(code)); + assertEquals("Error in Save Log Request. Wrong level = " + code, exception.getMessage()); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnumTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnumTest.java index 3396567ad..c8e0b4471 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnumTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnumTest.java @@ -16,47 +16,50 @@ package com.epam.ta.reportportal.entity.enums; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class ProjectAttributeEnumTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() { - allowed = Arrays.stream(ProjectAttributeEnum.values()) - .collect(Collectors.toMap(it -> it, - it -> Arrays.asList(it.getAttribute(), it.getAttribute().toUpperCase(), it.getAttribute().toLowerCase()) - )); - disallowed = Arrays.asList("noSuchAttribute", "", " ", null); - } - - @Test - void findByAttributeName() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = ProjectAttributeEnum.findByAttributeName(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(ProjectAttributeEnum.findByAttributeName(it).isPresent())); - } - - @Test - void isPresent() { - allowed.entrySet().stream().flatMap(it -> it.getValue().stream()).forEach(it -> assertTrue(ProjectAttributeEnum.isPresent(it))); - disallowed.forEach(it -> assertFalse(ProjectAttributeEnum.isPresent(it))); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() { + allowed = Arrays.stream(ProjectAttributeEnum.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.getAttribute(), it.getAttribute().toUpperCase(), + it.getAttribute().toLowerCase()) + )); + disallowed = Arrays.asList("noSuchAttribute", "", " ", null); + } + + @Test + void findByAttributeName() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = ProjectAttributeEnum.findByAttributeName(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(ProjectAttributeEnum.findByAttributeName(it).isPresent())); + } + + @Test + void isPresent() { + allowed.entrySet().stream().flatMap(it -> it.getValue().stream()) + .forEach(it -> assertTrue(ProjectAttributeEnum.isPresent(it))); + disallowed.forEach(it -> assertFalse(ProjectAttributeEnum.isPresent(it))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/ProjectTypeTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/ProjectTypeTest.java index 1bf774b15..87b3df7f7 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/ProjectTypeTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/ProjectTypeTest.java @@ -16,45 +16,48 @@ package com.epam.ta.reportportal.entity.enums; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class ProjectTypeTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() { - allowed = Arrays.stream(ProjectType.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - disallowed = Arrays.asList("noSuchType", "", " ", null); - } - - @Test - void findByName() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = ProjectType.findByName(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(ProjectType.findByName(it).isPresent())); - } - - @Test - void isPresent() { - allowed.entrySet().stream().flatMap(it -> it.getValue().stream()).forEach(it -> assertTrue(ProjectType.isPresent(it))); - disallowed.forEach(it -> assertFalse(ProjectType.isPresent(it))); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() { + allowed = Arrays.stream(ProjectType.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + disallowed = Arrays.asList("noSuchType", "", " ", null); + } + + @Test + void findByName() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = ProjectType.findByName(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(ProjectType.findByName(it).isPresent())); + } + + @Test + void isPresent() { + allowed.entrySet().stream().flatMap(it -> it.getValue().stream()) + .forEach(it -> assertTrue(ProjectType.isPresent(it))); + disallowed.forEach(it -> assertFalse(ProjectType.isPresent(it))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/StatusEnumTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/StatusEnumTest.java index d03f2264b..a9ee4174d 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/StatusEnumTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/StatusEnumTest.java @@ -16,45 +16,48 @@ package com.epam.ta.reportportal.entity.enums; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class StatusEnumTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() { - allowed = Arrays.stream(StatusEnum.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - disallowed = Arrays.asList("noSuchStatus", "", " ", null); - } - - @Test - void fromValue() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = StatusEnum.fromValue(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(StatusEnum.fromValue(it).isPresent())); - } - - @Test - void isPresent() { - allowed.entrySet().stream().flatMap(it -> it.getValue().stream()).forEach(it -> assertTrue(StatusEnum.isPresent(it))); - disallowed.forEach(it -> assertFalse(StatusEnum.isPresent(it))); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() { + allowed = Arrays.stream(StatusEnum.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + disallowed = Arrays.asList("noSuchStatus", "", " ", null); + } + + @Test + void fromValue() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = StatusEnum.fromValue(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(StatusEnum.fromValue(it).isPresent())); + } + + @Test + void isPresent() { + allowed.entrySet().stream().flatMap(it -> it.getValue().stream()) + .forEach(it -> assertTrue(StatusEnum.isPresent(it))); + disallowed.forEach(it -> assertFalse(StatusEnum.isPresent(it))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/TestItemIssueGroupTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/TestItemIssueGroupTest.java index e362bf061..a044d56eb 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/TestItemIssueGroupTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/TestItemIssueGroupTest.java @@ -16,53 +16,59 @@ package com.epam.ta.reportportal.entity.enums; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class TestItemIssueGroupTest { - private Map> allowed; - private List disallowed; + private Map> allowed; + private List disallowed; - @BeforeEach - void setUp() { - allowed = Arrays.stream(TestItemIssueGroup.values()) - .collect(Collectors.toMap(it -> it, - it -> Arrays.asList(it.getValue(), it.getValue().toUpperCase(), it.getValue().toLowerCase()) - )); - disallowed = Arrays.asList("noSuchIssueGroup", "", " ", null); - } + @BeforeEach + void setUp() { + allowed = Arrays.stream(TestItemIssueGroup.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.getValue(), it.getValue().toUpperCase(), + it.getValue().toLowerCase()) + )); + disallowed = Arrays.asList("noSuchIssueGroup", "", " ", null); + } - @Test - void fromValue() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = TestItemIssueGroup.fromValue(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(TestItemIssueGroup.fromValue(it).isPresent())); - } + @Test + void fromValue() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = TestItemIssueGroup.fromValue(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(TestItemIssueGroup.fromValue(it).isPresent())); + } - @Test - void validate() { - allowed.forEach((key, value) -> value.forEach(val -> assertEquals(key, TestItemIssueGroup.validate(val)))); - disallowed.forEach(it -> assertNull(TestItemIssueGroup.validate(it))); - } + @Test + void validate() { + allowed.forEach( + (key, value) -> value.forEach(val -> assertEquals(key, TestItemIssueGroup.validate(val)))); + disallowed.forEach(it -> assertNull(TestItemIssueGroup.validate(it))); + } - @Test - void validValues() { - final List strings = TestItemIssueGroup.validValues(); - assertEquals(strings, Arrays.stream(TestItemIssueGroup.values()).map(TestItemIssueGroup::getValue).collect(Collectors.toList())); - } + @Test + void validValues() { + final List strings = TestItemIssueGroup.validValues(); + assertEquals(strings, + Arrays.stream(TestItemIssueGroup.values()).map(TestItemIssueGroup::getValue) + .collect(Collectors.toList())); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/TestItemTypeEnumTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/TestItemTypeEnumTest.java index 5370e8ff1..46896b858 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/TestItemTypeEnumTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/TestItemTypeEnumTest.java @@ -16,76 +16,78 @@ package com.epam.ta.reportportal.entity.enums; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class TestItemTypeEnumTest { - private Map> allowed; - private List disallowed; + private Map> allowed; + private List disallowed; - @BeforeEach - void setUp() throws Exception { - allowed = Arrays.stream(TestItemTypeEnum.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - disallowed = Arrays.asList("noSuchIssueGroup", "", " ", null); - } + @BeforeEach + void setUp() throws Exception { + allowed = Arrays.stream(TestItemTypeEnum.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + disallowed = Arrays.asList("noSuchIssueGroup", "", " ", null); + } - @Test - void fromValue() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = TestItemTypeEnum.fromValue(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(TestItemTypeEnum.fromValue(it).isPresent())); - } + @Test + void fromValue() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = TestItemTypeEnum.fromValue(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(TestItemTypeEnum.fromValue(it).isPresent())); + } - @Test - void sameLevel() { - final TestItemTypeEnum suite = TestItemTypeEnum.SUITE; - final TestItemTypeEnum story = TestItemTypeEnum.STORY; - final TestItemTypeEnum scenario = TestItemTypeEnum.SCENARIO; - final TestItemTypeEnum step = TestItemTypeEnum.STEP; - assertTrue(suite.sameLevel(story)); - assertFalse(suite.sameLevel(scenario)); - assertFalse(suite.sameLevel(step)); + @Test + void sameLevel() { + final TestItemTypeEnum suite = TestItemTypeEnum.SUITE; + final TestItemTypeEnum story = TestItemTypeEnum.STORY; + final TestItemTypeEnum scenario = TestItemTypeEnum.SCENARIO; + final TestItemTypeEnum step = TestItemTypeEnum.STEP; + assertTrue(suite.sameLevel(story)); + assertFalse(suite.sameLevel(scenario)); + assertFalse(suite.sameLevel(step)); - } + } - @Test - void higherThan() { - final TestItemTypeEnum suite = TestItemTypeEnum.SUITE; - final TestItemTypeEnum story = TestItemTypeEnum.STORY; - final TestItemTypeEnum scenario = TestItemTypeEnum.SCENARIO; - final TestItemTypeEnum step = TestItemTypeEnum.STEP; - assertTrue(suite.higherThan(step)); - assertTrue(scenario.higherThan(step)); - assertFalse(suite.higherThan(story)); - assertFalse(step.higherThan(scenario)); - assertFalse(scenario.higherThan(story)); - } + @Test + void higherThan() { + final TestItemTypeEnum suite = TestItemTypeEnum.SUITE; + final TestItemTypeEnum story = TestItemTypeEnum.STORY; + final TestItemTypeEnum scenario = TestItemTypeEnum.SCENARIO; + final TestItemTypeEnum step = TestItemTypeEnum.STEP; + assertTrue(suite.higherThan(step)); + assertTrue(scenario.higherThan(step)); + assertFalse(suite.higherThan(story)); + assertFalse(step.higherThan(scenario)); + assertFalse(scenario.higherThan(story)); + } - @Test - void lowerThan() { - final TestItemTypeEnum suite = TestItemTypeEnum.SUITE; - final TestItemTypeEnum story = TestItemTypeEnum.STORY; - final TestItemTypeEnum scenario = TestItemTypeEnum.SCENARIO; - final TestItemTypeEnum step = TestItemTypeEnum.STEP; - assertTrue(step.lowerThan(scenario)); - assertTrue(scenario.lowerThan(story)); - assertFalse(story.lowerThan(suite)); - assertFalse(scenario.lowerThan(step)); - } + @Test + void lowerThan() { + final TestItemTypeEnum suite = TestItemTypeEnum.SUITE; + final TestItemTypeEnum story = TestItemTypeEnum.STORY; + final TestItemTypeEnum scenario = TestItemTypeEnum.SCENARIO; + final TestItemTypeEnum step = TestItemTypeEnum.STEP; + assertTrue(step.lowerThan(scenario)); + assertTrue(scenario.lowerThan(story)); + assertFalse(story.lowerThan(suite)); + assertFalse(scenario.lowerThan(step)); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/converter/AnalyzerModeConverterTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/converter/AnalyzerModeConverterTest.java index 6e7f7dc1a..21e275703 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/converter/AnalyzerModeConverterTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/converter/AnalyzerModeConverterTest.java @@ -16,30 +16,31 @@ package com.epam.ta.reportportal.entity.enums.converter; -import com.epam.ta.reportportal.entity.AnalyzeMode; -import org.junit.jupiter.api.BeforeEach; +import static org.junit.jupiter.api.Assertions.assertEquals; +import com.epam.ta.reportportal.entity.AnalyzeMode; import java.util.Arrays; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeEach; /** * @author Ihar Kahadouski */ public class AnalyzerModeConverterTest extends AttributeConverterTest { - @BeforeEach - void setUp() throws Exception { - this.converter = new AnalyzerModeConverter(); - allowedValues = Arrays.stream(AnalyzeMode.values()) - .collect(Collectors.toMap(it -> it, - it -> Arrays.asList(it.getValue(), it.getValue().toUpperCase(), it.getValue().toLowerCase()) - )); - } + @BeforeEach + void setUp() throws Exception { + this.converter = new AnalyzerModeConverter(); + allowedValues = Arrays.stream(AnalyzeMode.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.getValue(), it.getValue().toUpperCase(), + it.getValue().toLowerCase()) + )); + } - @Override - public void convertToColumnTest() { - Arrays.stream(AnalyzeMode.values()).forEach(it -> assertEquals(it.getValue(), converter.convertToDatabaseColumn(it))); - } + @Override + public void convertToColumnTest() { + Arrays.stream(AnalyzeMode.values()) + .forEach(it -> assertEquals(it.getValue(), converter.convertToDatabaseColumn(it))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/converter/AttributeConverterTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/converter/AttributeConverterTest.java index e8dbf35e9..5a2e24e4d 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/converter/AttributeConverterTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/converter/AttributeConverterTest.java @@ -16,39 +16,40 @@ package com.epam.ta.reportportal.entity.enums.converter; -import com.epam.ta.reportportal.exception.ReportPortalException; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; -import javax.persistence.AttributeConverter; +import com.epam.ta.reportportal.exception.ReportPortalException; import java.util.List; import java.util.Map; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; +import javax.persistence.AttributeConverter; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ public abstract class AttributeConverterTest { - protected AttributeConverter converter; - protected Map> allowedValues; + protected AttributeConverter converter; + protected Map> allowedValues; - @Test - void convertToDatabaseColumn() { - convertToColumnTest(); - } + @Test + void convertToDatabaseColumn() { + convertToColumnTest(); + } - @Test - void convertToEntityAttribute() { - allowedValues.forEach((key, value) -> value.forEach(it -> assertEquals(key, converter.convertToEntityAttribute(it)))); - } + @Test + void convertToEntityAttribute() { + allowedValues.forEach((key, value) -> value.forEach( + it -> assertEquals(key, converter.convertToEntityAttribute(it)))); + } - @Test - void convertToEntityAttributeFail() { + @Test + void convertToEntityAttributeFail() { - assertThrows(ReportPortalException.class, () -> converter.convertToEntityAttribute("wrong parameter")); - } + assertThrows(ReportPortalException.class, + () -> converter.convertToEntityAttribute("wrong parameter")); + } - protected abstract void convertToColumnTest(); + protected abstract void convertToColumnTest(); } diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/converter/LogLevelConverterTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/converter/LogLevelConverterTest.java index 5f9c933d9..efaf64bb6 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/converter/LogLevelConverterTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/converter/LogLevelConverterTest.java @@ -16,43 +16,45 @@ package com.epam.ta.reportportal.entity.enums.converter; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + import com.epam.ta.reportportal.entity.enums.LogLevel; import com.epam.ta.reportportal.exception.ReportPortalException; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - import java.util.Arrays; import java.util.Map; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class LogLevelConverterTest { - private LogLevelConverter converter = new LogLevelConverter(); - private Map allowedValues; - - @BeforeEach - void setUp() { - allowedValues = Arrays.stream(LogLevel.values()).collect(Collectors.toMap(it -> it, LogLevel::toInt)); - } - - @Test - void convertToDatabaseColumn() { - Arrays.stream(LogLevel.values()).forEach(it -> assertEquals(it.toInt(), (int) converter.convertToDatabaseColumn(it))); - } - - @Test - void convertToEntityAttribute() { - allowedValues.forEach((key, value) -> assertEquals(key, converter.convertToEntityAttribute(value))); - } - - @Test - void convertToEntityAttributeFail() { - assertThrows(ReportPortalException.class, () -> converter.convertToEntityAttribute(-100)); - } + private LogLevelConverter converter = new LogLevelConverter(); + private Map allowedValues; + + @BeforeEach + void setUp() { + allowedValues = Arrays.stream(LogLevel.values()) + .collect(Collectors.toMap(it -> it, LogLevel::toInt)); + } + + @Test + void convertToDatabaseColumn() { + Arrays.stream(LogLevel.values()) + .forEach(it -> assertEquals(it.toInt(), (int) converter.convertToDatabaseColumn(it))); + } + + @Test + void convertToEntityAttribute() { + allowedValues.forEach( + (key, value) -> assertEquals(key, converter.convertToEntityAttribute(value))); + } + + @Test + void convertToEntityAttributeFail() { + assertThrows(ReportPortalException.class, () -> converter.convertToEntityAttribute(-100)); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/converter/ProjectRoleConverterTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/converter/ProjectRoleConverterTest.java index 62c7e3ad3..cef1da3f7 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/converter/ProjectRoleConverterTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/converter/ProjectRoleConverterTest.java @@ -16,28 +16,29 @@ package com.epam.ta.reportportal.entity.enums.converter; -import com.epam.ta.reportportal.entity.project.ProjectRole; -import org.junit.jupiter.api.BeforeEach; +import static org.junit.jupiter.api.Assertions.assertEquals; +import com.epam.ta.reportportal.entity.project.ProjectRole; import java.util.Arrays; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeEach; /** * @author Ihar Kahadouski */ public class ProjectRoleConverterTest extends AttributeConverterTest { - @BeforeEach - void setUp() throws Exception { - this.converter = new ProjectRoleConverter(); - allowedValues = Arrays.stream(ProjectRole.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - } + @BeforeEach + void setUp() throws Exception { + this.converter = new ProjectRoleConverter(); + allowedValues = Arrays.stream(ProjectRole.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + } - @Override - protected void convertToColumnTest() { - Arrays.stream(ProjectRole.values()).forEach(it -> assertEquals(it.name(), converter.convertToDatabaseColumn(it))); - } + @Override + protected void convertToColumnTest() { + Arrays.stream(ProjectRole.values()) + .forEach(it -> assertEquals(it.name(), converter.convertToDatabaseColumn(it))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/converter/ProjectTypeConverterTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/converter/ProjectTypeConverterTest.java index aa1f17830..067319d16 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/converter/ProjectTypeConverterTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/converter/ProjectTypeConverterTest.java @@ -16,28 +16,29 @@ package com.epam.ta.reportportal.entity.enums.converter; -import com.epam.ta.reportportal.entity.enums.ProjectType; -import org.junit.jupiter.api.BeforeEach; +import static org.junit.jupiter.api.Assertions.assertEquals; +import com.epam.ta.reportportal.entity.enums.ProjectType; import java.util.Arrays; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeEach; /** * @author Ihar Kahadouski */ public class ProjectTypeConverterTest extends AttributeConverterTest { - @BeforeEach - void setUp() throws Exception { - this.converter = new ProjectTypeConverter(); - allowedValues = Arrays.stream(ProjectType.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - } + @BeforeEach + void setUp() throws Exception { + this.converter = new ProjectTypeConverter(); + allowedValues = Arrays.stream(ProjectType.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + } - @Override - protected void convertToColumnTest() { - Arrays.stream(ProjectType.values()).forEach(it -> assertEquals(it.name(), converter.convertToDatabaseColumn(it))); - } + @Override + protected void convertToColumnTest() { + Arrays.stream(ProjectType.values()) + .forEach(it -> assertEquals(it.name(), converter.convertToDatabaseColumn(it))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/enums/converter/UserTypeConverterTest.java b/src/test/java/com/epam/ta/reportportal/entity/enums/converter/UserTypeConverterTest.java index 7ae18916e..c311fc52a 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/enums/converter/UserTypeConverterTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/enums/converter/UserTypeConverterTest.java @@ -16,28 +16,29 @@ package com.epam.ta.reportportal.entity.enums.converter; -import com.epam.ta.reportportal.entity.user.UserType; -import org.junit.jupiter.api.BeforeEach; +import static org.junit.jupiter.api.Assertions.assertEquals; +import com.epam.ta.reportportal.entity.user.UserType; import java.util.Arrays; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeEach; /** * @author Ihar Kahadouski */ public class UserTypeConverterTest extends AttributeConverterTest { - @BeforeEach - void setUp() throws Exception { - this.converter = new UserTypeConverter(); - allowedValues = Arrays.stream(UserType.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - } + @BeforeEach + void setUp() throws Exception { + this.converter = new UserTypeConverter(); + allowedValues = Arrays.stream(UserType.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + } - @Override - protected void convertToColumnTest() { - Arrays.stream(UserType.values()).forEach(it -> assertEquals(it.name(), converter.convertToDatabaseColumn(it))); - } + @Override + protected void convertToColumnTest() { + Arrays.stream(UserType.values()) + .forEach(it -> assertEquals(it.name(), converter.convertToDatabaseColumn(it))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/filter/ObjectTypeTest.java b/src/test/java/com/epam/ta/reportportal/entity/filter/ObjectTypeTest.java index a82fba738..e26992d4d 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/filter/ObjectTypeTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/filter/ObjectTypeTest.java @@ -16,53 +16,56 @@ package com.epam.ta.reportportal.entity.filter; -import com.epam.ta.reportportal.exception.ReportPortalException; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import com.epam.ta.reportportal.exception.ReportPortalException; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class ObjectTypeTest { - private Map> allowed; - private List disallowed; + private Map> allowed; + private List disallowed; - @BeforeEach - void setUp() { - allowed = Arrays.stream(ObjectType.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - disallowed = Arrays.asList("noSuchObjectType", "", " ", null); - } + @BeforeEach + void setUp() { + allowed = Arrays.stream(ObjectType.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + disallowed = Arrays.asList("noSuchObjectType", "", " ", null); + } - @Test - void getObjectTypeByName() { - allowed.forEach((key, value) -> value.forEach(val -> assertEquals(key, ObjectType.getObjectTypeByName(val)))); - } + @Test + void getObjectTypeByName() { + allowed.forEach((key, value) -> value.forEach( + val -> assertEquals(key, ObjectType.getObjectTypeByName(val)))); + } - @Test - void getObjectTypeByNameFail() { - Collections.shuffle(disallowed); - assertThrows(ReportPortalException.class, () -> ObjectType.getObjectTypeByName(disallowed.get(0))); - } + @Test + void getObjectTypeByNameFail() { + Collections.shuffle(disallowed); + assertThrows(ReportPortalException.class, + () -> ObjectType.getObjectTypeByName(disallowed.get(0))); + } - @Test - void getTypeByName() { - allowed.forEach((key, value) -> value.forEach(val -> assertEquals(key.getClassObject(), ObjectType.getTypeByName(val)))); - } + @Test + void getTypeByName() { + allowed.forEach((key, value) -> value.forEach( + val -> assertEquals(key.getClassObject(), ObjectType.getTypeByName(val)))); + } - @Test - void getTypeByNameFail() { - Collections.shuffle(disallowed); - assertThrows(ReportPortalException.class, () -> ObjectType.getTypeByName(disallowed.get(0))); - } + @Test + void getTypeByNameFail() { + Collections.shuffle(disallowed); + assertThrows(ReportPortalException.class, () -> ObjectType.getTypeByName(disallowed.get(0))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/plugin/PluginFileExtensionTest.java b/src/test/java/com/epam/ta/reportportal/entity/plugin/PluginFileExtensionTest.java index 708f55dc2..4959493bf 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/plugin/PluginFileExtensionTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/plugin/PluginFileExtensionTest.java @@ -16,45 +16,47 @@ package com.epam.ta.reportportal.entity.plugin; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ivan Budayeu */ class PluginFileExtensionTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() throws Exception { - allowed = Arrays.stream(PluginFileExtension.values()) - .collect(Collectors.toMap(it -> it, - it -> Arrays.asList(it.getExtension(), it.getExtension().toUpperCase(), it.getExtension().toLowerCase()) - )); - disallowed = Arrays.asList("bla", null, "", "noSuchType"); - } - - @Test - void findByExtensionPositive() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = PluginFileExtension.findByExtension(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - } - - @Test - void findByExtensionNegative() { - disallowed.forEach(it -> assertFalse(PluginFileExtension.findByExtension(it).isPresent())); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() throws Exception { + allowed = Arrays.stream(PluginFileExtension.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.getExtension(), it.getExtension().toUpperCase(), + it.getExtension().toLowerCase()) + )); + disallowed = Arrays.asList("bla", null, "", "noSuchType"); + } + + @Test + void findByExtensionPositive() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = PluginFileExtension.findByExtension(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + } + + @Test + void findByExtensionNegative() { + disallowed.forEach(it -> assertFalse(PluginFileExtension.findByExtension(it).isPresent())); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/project/ProjectRoleTest.java b/src/test/java/com/epam/ta/reportportal/entity/project/ProjectRoleTest.java index ee36d5ad4..8622071b5 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/project/ProjectRoleTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/project/ProjectRoleTest.java @@ -16,72 +16,73 @@ package com.epam.ta.reportportal.entity.project; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class ProjectRoleTest { - private Map> allowed; - private List disallowed; - - private final ProjectRole OPERATOR = ProjectRole.OPERATOR; - private final ProjectRole CUSTOMER = ProjectRole.CUSTOMER; - private final ProjectRole MEMBER = ProjectRole.MEMBER; - private final ProjectRole PROJECT_MANAGER = ProjectRole.PROJECT_MANAGER; + private final ProjectRole OPERATOR = ProjectRole.OPERATOR; + private final ProjectRole CUSTOMER = ProjectRole.CUSTOMER; + private final ProjectRole MEMBER = ProjectRole.MEMBER; + private final ProjectRole PROJECT_MANAGER = ProjectRole.PROJECT_MANAGER; + private Map> allowed; + private List disallowed; - @BeforeEach - void setUp() { - allowed = Arrays.stream(ProjectRole.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - disallowed = Arrays.asList("noSuchObjectType", "", " ", null); - } + @BeforeEach + void setUp() { + allowed = Arrays.stream(ProjectRole.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + disallowed = Arrays.asList("noSuchObjectType", "", " ", null); + } - @Test - void higherThan() { - assertFalse(PROJECT_MANAGER.higherThan(PROJECT_MANAGER)); - assertTrue(PROJECT_MANAGER.higherThan(MEMBER)); - assertFalse(OPERATOR.higherThan(CUSTOMER)); - } + @Test + void higherThan() { + assertFalse(PROJECT_MANAGER.higherThan(PROJECT_MANAGER)); + assertTrue(PROJECT_MANAGER.higherThan(MEMBER)); + assertFalse(OPERATOR.higherThan(CUSTOMER)); + } - @Test - void lowerThan() { - assertFalse(PROJECT_MANAGER.lowerThan(PROJECT_MANAGER)); - assertTrue(MEMBER.lowerThan(PROJECT_MANAGER)); - assertTrue(CUSTOMER.lowerThan(PROJECT_MANAGER)); - } + @Test + void lowerThan() { + assertFalse(PROJECT_MANAGER.lowerThan(PROJECT_MANAGER)); + assertTrue(MEMBER.lowerThan(PROJECT_MANAGER)); + assertTrue(CUSTOMER.lowerThan(PROJECT_MANAGER)); + } - @Test - void sameOrHigherThan() { - assertTrue(PROJECT_MANAGER.sameOrHigherThan(PROJECT_MANAGER)); - assertTrue(MEMBER.sameOrHigherThan(CUSTOMER)); - assertFalse(MEMBER.sameOrHigherThan(PROJECT_MANAGER)); - } + @Test + void sameOrHigherThan() { + assertTrue(PROJECT_MANAGER.sameOrHigherThan(PROJECT_MANAGER)); + assertTrue(MEMBER.sameOrHigherThan(CUSTOMER)); + assertFalse(MEMBER.sameOrHigherThan(PROJECT_MANAGER)); + } - @Test - void sameOrLowerThan() { - assertTrue(PROJECT_MANAGER.sameOrLowerThan(PROJECT_MANAGER)); - assertTrue(CUSTOMER.sameOrLowerThan(MEMBER)); - assertFalse(PROJECT_MANAGER.sameOrLowerThan(MEMBER)); - } + @Test + void sameOrLowerThan() { + assertTrue(PROJECT_MANAGER.sameOrLowerThan(PROJECT_MANAGER)); + assertTrue(CUSTOMER.sameOrLowerThan(MEMBER)); + assertFalse(PROJECT_MANAGER.sameOrLowerThan(MEMBER)); + } - @Test - void forName() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = ProjectRole.forName(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(ProjectRole.forName(it).isPresent())); - } + @Test + void forName() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = ProjectRole.forName(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(ProjectRole.forName(it).isPresent())); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/project/ProjectUtilsTest.java b/src/test/java/com/epam/ta/reportportal/entity/project/ProjectUtilsTest.java index cd4e129c2..8b0a560fd 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/project/ProjectUtilsTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/project/ProjectUtilsTest.java @@ -16,6 +16,12 @@ package com.epam.ta.reportportal.entity.project; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.epam.ta.reportportal.entity.attribute.Attribute; import com.epam.ta.reportportal.entity.enums.ProjectAttributeEnum; import com.epam.ta.reportportal.entity.enums.ProjectType; @@ -26,350 +32,380 @@ import com.epam.ta.reportportal.entity.user.ProjectUser; import com.epam.ta.reportportal.entity.user.User; import com.google.common.collect.Sets; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Random; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.apache.commons.collections4.MapUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ihar Kahadouski */ class ProjectUtilsTest { - private Project project; - - private Set defaultAttributes; - - private String[] userLoginsToExclude; - private String[] userEmailsToExclude; - - private String[] userLoginsNotToExclude; - private String[] userEmailsNotToExclude; - - @BeforeEach - void setUp() { - project = getTestProject(); - defaultAttributes = getDefaultAttributes(); - userLoginsToExclude = new String[] { "exclude", "exclude1", "exclude2" }; - userEmailsToExclude = new String[] { "exclude@mail.com", "exclude1@mail.com", "exclude2@mail.com" }; - userLoginsNotToExclude = new String[] { "NOT_exclude", "NOT_exclude1", "NOT_exclude2" }; - userEmailsNotToExclude = new String[] { "NOT_exclude@mail.com", "NOT_exclude1@mail.com", "NOT_exclude2@mail.com" }; - } - - @Test - void defaultProjectAttributes() { - final Set projectAttributes = ProjectUtils.defaultProjectAttributes(project, defaultAttributes); - projectAttributes.forEach(it -> { - assertEquals(project, it.getProject()); - assertThat(it.getAttribute()).isIn(defaultAttributes); - assertEquals(it.getValue(), ProjectAttributeEnum.findByAttributeName(it.getAttribute().getName()).get().getDefaultValue()); - }); - } - - @Test - void defaultIssueTypes() { - final List defaultIssueTypes = getDefaultIssueTypes(); - final Set projectIssueTypes = ProjectUtils.defaultIssueTypes(project, defaultIssueTypes); - assertNotNull(projectIssueTypes); - assertEquals(defaultIssueTypes.size(), projectIssueTypes.size()); - projectIssueTypes.forEach(it -> { - assertEquals(project, it.getProject()); - assertThat(it.getIssueType()).isIn(defaultIssueTypes); - }); - } - - @Test - void doesHaveUser() { - assertTrue(ProjectUtils.doesHaveUser(project, "test_user")); - assertFalse(ProjectUtils.doesHaveUser(project, "darth_vader")); - } - - @Test - void findUserConfigByLogin() { - final ProjectUser projectUser = ProjectUtils.findUserConfigByLogin(project, "test_user"); - assertNotNull(projectUser); - assertEquals(getTestUser(), projectUser.getUser()); - assertEquals(project, projectUser.getProject()); - assertEquals(ProjectRole.PROJECT_MANAGER, projectUser.getProjectRole()); - } - - @Test - void getConfigParameters() { - final Map configParameters = ProjectUtils.getConfigParameters(getProjectAttributes()); - assertNotNull(configParameters); - assertTrue(!configParameters.isEmpty()); - assertThat(configParameters).isEqualTo(getAttributeWithValuesMap().entrySet() - .stream() - .collect(Collectors.toMap(it -> it.getKey().getName(), Map.Entry::getValue))); - } - - private static List getDefaultIssueTypes() { - IssueGroup tiGroup = new IssueGroup(); - tiGroup.setId(1); - tiGroup.setTestItemIssueGroup(TestItemIssueGroup.TO_INVESTIGATE); - IssueGroup abGroup = new IssueGroup(); - abGroup.setId(2); - abGroup.setTestItemIssueGroup(TestItemIssueGroup.AUTOMATION_BUG); - IssueGroup pbGroup = new IssueGroup(); - pbGroup.setId(3); - pbGroup.setTestItemIssueGroup(TestItemIssueGroup.PRODUCT_BUG); - IssueGroup ndGroup = new IssueGroup(); - ndGroup.setId(4); - ndGroup.setTestItemIssueGroup(TestItemIssueGroup.NO_DEFECT); - IssueGroup siGroup = new IssueGroup(); - siGroup.setId(5); - siGroup.setTestItemIssueGroup(TestItemIssueGroup.SYSTEM_ISSUE); - return Arrays.asList(new IssueType(tiGroup, "ti001", "To Investigate", "TI", "#ffb743"), - new IssueType(abGroup, "ab001", "Automation Bug", "AB", "#f7d63e"), - new IssueType(pbGroup, "pb001", "Product Bug", "PB", "#ec3900"), - new IssueType(ndGroup, "nd001", "No Defect", "ND", "#777777"), - new IssueType(siGroup, "si001", "System Issue", "SI", "#0274d1") - ); - } - - @Test - void excludeProjectRecipientsTest() { - - Project project = getProjectWithRecipients(); - project.setSenderCases(getEmailSenderCasesWithRecipientsOnly()); - - Set usersToExclude = project.getUsers().stream().map(ProjectUser::getUser).collect(Collectors.toSet()); - - ProjectUtils.excludeProjectRecipients(usersToExclude, project); - - project.getSenderCases().forEach(ec -> { - Arrays.stream(userLoginsNotToExclude).forEach(excludedLogin -> assertTrue(ec.getRecipients().contains(excludedLogin))); - Arrays.stream(userEmailsNotToExclude).forEach(excludedLogin -> assertTrue(ec.getRecipients().contains(excludedLogin))); - Arrays.stream(userLoginsToExclude).forEach(excludedLogin -> assertFalse(ec.getRecipients().contains(excludedLogin))); - Arrays.stream(userEmailsToExclude).forEach(excludedLogin -> assertFalse(ec.getRecipients().contains(excludedLogin))); - }); - } - - @Test - void updateProjectRecipientsTest() { - - final String newEmail = "new_email@mail.com"; - - Project project = new Project(); - - project.setSenderCases(getEmailSenderCasesWithRecipientsOnly()); - - ProjectUtils.updateProjectRecipients(userEmailsNotToExclude[0], newEmail, project); - - project.getSenderCases().forEach(ec -> { - assertTrue(ec.getRecipients().contains(newEmail)); - assertFalse(ec.getRecipients().contains(userEmailsNotToExclude[0])); - }); - - } - - @Test - void isPersonalForUserPositive() { - assertTrue(ProjectUtils.isPersonalForUser(ProjectType.PERSONAL, "qwe_personal_1234", "qwe")); - assertTrue(ProjectUtils.isPersonalForUser(ProjectType.PERSONAL, "qwe_personal", "qwe")); - } - - @Test - void isPersonalForUserNegative() { - assertFalse(ProjectUtils.isPersonalForUser(ProjectType.PERSONAL, "qwe_personal_1234", "qwe_personal")); - assertFalse(ProjectUtils.isPersonalForUser(ProjectType.PERSONAL, "qwe_personal_", "qwe")); - } - - @Test - void isPersonalForUserNegativeWithProjectType() { - boolean isPersonal = ProjectUtils.isPersonalForUser(ProjectType.INTERNAL, "qwe_personal_1234", "qwe"); - assertFalse(isPersonal); - } - - @Test - void isAssignedPositiveTest() { - User user = new User(); - ProjectUser projectUser = new ProjectUser(); - projectUser.setUser(user); - Project project = new Project(); - project.setId(1L); - projectUser.setProject(project); - user.setProjects(Sets.newHashSet(projectUser)); - - assertTrue(ProjectUtils.isAssignedToProject(user, 1L)); - } - - @Test - void isAssignedNegativeTest() { - User user = new User(); - ProjectUser projectUser = new ProjectUser(); - projectUser.setUser(user); - Project project = new Project(); - project.setId(1L); - projectUser.setProject(project); - user.setProjects(Sets.newHashSet(projectUser)); - - assertFalse(ProjectUtils.isAssignedToProject(user, 2L)); - } - - @Test - void extractProjectAttributesPositiveTest() { - Project testProject = getTestProject(); - testProject.setProjectAttributes(getProjectAttributes()); - - Optional projectAttribute = ProjectUtils.extractAttribute(testProject, ProjectAttributeEnum.KEEP_LOGS); - assertTrue(projectAttribute.isPresent()); - assertEquals(ProjectAttributeEnum.KEEP_LOGS.getAttribute(), projectAttribute.get().getAttribute().getName()); - assertEquals(ProjectAttributeEnum.KEEP_LOGS.getDefaultValue(), projectAttribute.get().getValue()); - } - - @Test - void extractProjectAttributesNegativeTest() { - Project testProject = getTestProject(); - testProject.setProjectAttributes(getProjectAttributes()); - - Optional projectAttribute = ProjectUtils.extractAttribute(testProject, ProjectAttributeEnum.KEEP_LAUNCHES); - assertTrue(projectAttribute.isEmpty()); - } - - @Test - void extractProjectAttributeValuePositiveTest() { - Project testProject = getTestProject(); - testProject.setProjectAttributes(getProjectAttributes()); - - Optional value = ProjectUtils.extractAttributeValue(testProject, ProjectAttributeEnum.KEEP_LOGS); - assertTrue(value.isPresent()); - assertEquals(ProjectAttributeEnum.KEEP_LOGS.getDefaultValue(), value.get()); - } - - @Test - void extractProjectAttributeValueNegativeTest() { - Project testProject = getTestProject(); - testProject.setProjectAttributes(getProjectAttributes()); - - Optional value = ProjectUtils.extractAttributeValue(testProject, ProjectAttributeEnum.KEEP_LAUNCHES); - assertTrue(value.isEmpty()); - } - - private static Project getTestProject() { - Project project = new Project(); - project.setId(1L); - project.setName("test_project"); - project.setProjectType(ProjectType.PERSONAL); - project.setCreationDate(new Date()); - project.setUsers(Sets.newHashSet(new ProjectUser().withUser(getTestUser()) - .withProject(project) - .withProjectRole(ProjectRole.PROJECT_MANAGER))); - return project; - } - - private static User getTestUser() { - User user = new User(); - user.setLogin("test_user"); - return user; - } - - private static Set getDefaultAttributes() { - return Arrays.stream(ProjectAttributeEnum.values()).map(it -> { - final Attribute attribute = new Attribute(); - attribute.setName(it.getAttribute()); - attribute.setId(new Random().nextLong()); - return attribute; - }).collect(Collectors.toSet()); - } - - private static Map getAttributeWithValuesMap() { - final Attribute attr1 = new Attribute(); - attr1.setId(1L); - attr1.setName("one"); - - final Attribute attr2 = new Attribute(); - attr2.setId(1L); - attr2.setName("two"); - - Attribute attr3 = new Attribute(); - attr3.setId(1L); - attr3.setName("analyzer.param"); - - Attribute keepLogs = new Attribute(); - keepLogs.setId(1L); - keepLogs.setName(ProjectAttributeEnum.KEEP_LOGS.getAttribute()); - - Map attributeMap = new HashMap<>(); - attributeMap.put(attr1, "valOne"); - attributeMap.put(attr2, "valTwo"); - attributeMap.put(attr3, "value"); - attributeMap.put(keepLogs, ProjectAttributeEnum.KEEP_LOGS.getDefaultValue()); - return attributeMap; - } - - private static Set getProjectAttributes() { - return getAttributeWithValuesMap().entrySet() - .stream() - .map(it -> new ProjectAttribute().withAttribute(it.getKey()).withProject(getTestProject()).withValue(it.getValue())) - .collect(Collectors.toSet()); - } - - @Test - void getConfigParametersByPrefix() { - Map configParameters = ProjectUtils.getConfigParametersByPrefix(getProjectAttributes(), - ProjectAttributeEnum.Prefix.ANALYZER - ); - - assertTrue(MapUtils.isNotEmpty(configParameters)); - configParameters.forEach((key, value) -> assertTrue(key.startsWith(ProjectAttributeEnum.Prefix.ANALYZER))); - } - - private Project getProjectWithRecipients() { - - User firstUser = new User(); - firstUser.setLogin(userLoginsToExclude[0]); - firstUser.setEmail(userEmailsToExclude[0]); - - User secondUser = new User(); - secondUser.setLogin(userLoginsToExclude[1]); - secondUser.setEmail(userEmailsToExclude[1]); - - User thirdUser = new User(); - thirdUser.setLogin(userLoginsToExclude[2]); - thirdUser.setEmail(userEmailsToExclude[2]); - - Set users = Sets.newHashSet(firstUser, secondUser, thirdUser); - - Project project = new Project(); - - Set projectUsers = users.stream().map(u -> { - ProjectUser projectUser = new ProjectUser(); - projectUser.setUser(u); - - projectUser.setProject(project); - - return projectUser; - }).collect(Collectors.toSet()); - - project.setUsers(projectUsers); - - return project; - - } - - private Set getEmailSenderCasesWithRecipientsOnly() { - - SenderCase firstSenderCase = new SenderCase(); - - firstSenderCase.setId(1L); - firstSenderCase.setRecipients((Stream.of(userLoginsToExclude, userEmailsToExclude, userLoginsNotToExclude, userEmailsNotToExclude) - .flatMap(Arrays::stream) - .collect(Collectors.toSet()))); + private Project project; + + private Set defaultAttributes; + + private String[] userLoginsToExclude; + private String[] userEmailsToExclude; + + private String[] userLoginsNotToExclude; + private String[] userEmailsNotToExclude; + + private static List getDefaultIssueTypes() { + IssueGroup tiGroup = new IssueGroup(); + tiGroup.setId(1); + tiGroup.setTestItemIssueGroup(TestItemIssueGroup.TO_INVESTIGATE); + IssueGroup abGroup = new IssueGroup(); + abGroup.setId(2); + abGroup.setTestItemIssueGroup(TestItemIssueGroup.AUTOMATION_BUG); + IssueGroup pbGroup = new IssueGroup(); + pbGroup.setId(3); + pbGroup.setTestItemIssueGroup(TestItemIssueGroup.PRODUCT_BUG); + IssueGroup ndGroup = new IssueGroup(); + ndGroup.setId(4); + ndGroup.setTestItemIssueGroup(TestItemIssueGroup.NO_DEFECT); + IssueGroup siGroup = new IssueGroup(); + siGroup.setId(5); + siGroup.setTestItemIssueGroup(TestItemIssueGroup.SYSTEM_ISSUE); + return Arrays.asList(new IssueType(tiGroup, "ti001", "To Investigate", "TI", "#ffb743"), + new IssueType(abGroup, "ab001", "Automation Bug", "AB", "#f7d63e"), + new IssueType(pbGroup, "pb001", "Product Bug", "PB", "#ec3900"), + new IssueType(ndGroup, "nd001", "No Defect", "ND", "#777777"), + new IssueType(siGroup, "si001", "System Issue", "SI", "#0274d1") + ); + } + + private static Project getTestProject() { + Project project = new Project(); + project.setId(1L); + project.setName("test_project"); + project.setProjectType(ProjectType.PERSONAL); + project.setCreationDate(new Date()); + project.setUsers(Sets.newHashSet(new ProjectUser().withUser(getTestUser()) + .withProject(project) + .withProjectRole(ProjectRole.PROJECT_MANAGER))); + return project; + } + + private static User getTestUser() { + User user = new User(); + user.setLogin("test_user"); + return user; + } + + private static Set getDefaultAttributes() { + return Arrays.stream(ProjectAttributeEnum.values()).map(it -> { + final Attribute attribute = new Attribute(); + attribute.setName(it.getAttribute()); + attribute.setId(new Random().nextLong()); + return attribute; + }).collect(Collectors.toSet()); + } + + private static Map getAttributeWithValuesMap() { + final Attribute attr1 = new Attribute(); + attr1.setId(1L); + attr1.setName("one"); + + final Attribute attr2 = new Attribute(); + attr2.setId(1L); + attr2.setName("two"); + + Attribute attr3 = new Attribute(); + attr3.setId(1L); + attr3.setName("analyzer.param"); + + Attribute keepLogs = new Attribute(); + keepLogs.setId(1L); + keepLogs.setName(ProjectAttributeEnum.KEEP_LOGS.getAttribute()); + + Map attributeMap = new HashMap<>(); + attributeMap.put(attr1, "valOne"); + attributeMap.put(attr2, "valTwo"); + attributeMap.put(attr3, "value"); + attributeMap.put(keepLogs, ProjectAttributeEnum.KEEP_LOGS.getDefaultValue()); + return attributeMap; + } + + private static Set getProjectAttributes() { + return getAttributeWithValuesMap().entrySet() + .stream() + .map(it -> new ProjectAttribute().withAttribute(it.getKey()).withProject(getTestProject()) + .withValue(it.getValue())) + .collect(Collectors.toSet()); + } + + @BeforeEach + void setUp() { + project = getTestProject(); + defaultAttributes = getDefaultAttributes(); + userLoginsToExclude = new String[]{"exclude", "exclude1", "exclude2"}; + userEmailsToExclude = new String[]{"exclude@mail.com", "exclude1@mail.com", + "exclude2@mail.com"}; + userLoginsNotToExclude = new String[]{"NOT_exclude", "NOT_exclude1", "NOT_exclude2"}; + userEmailsNotToExclude = new String[]{"NOT_exclude@mail.com", "NOT_exclude1@mail.com", + "NOT_exclude2@mail.com"}; + } + + @Test + void defaultProjectAttributes() { + final Set projectAttributes = ProjectUtils.defaultProjectAttributes(project, + defaultAttributes); + projectAttributes.forEach(it -> { + assertEquals(project, it.getProject()); + assertThat(it.getAttribute()).isIn(defaultAttributes); + assertEquals(it.getValue(), + ProjectAttributeEnum.findByAttributeName(it.getAttribute().getName()).get() + .getDefaultValue()); + }); + } + + @Test + void defaultIssueTypes() { + final List defaultIssueTypes = getDefaultIssueTypes(); + final Set projectIssueTypes = ProjectUtils.defaultIssueTypes(project, + defaultIssueTypes); + assertNotNull(projectIssueTypes); + assertEquals(defaultIssueTypes.size(), projectIssueTypes.size()); + projectIssueTypes.forEach(it -> { + assertEquals(project, it.getProject()); + assertThat(it.getIssueType()).isIn(defaultIssueTypes); + }); + } + + @Test + void doesHaveUser() { + assertTrue(ProjectUtils.doesHaveUser(project, "test_user")); + assertFalse(ProjectUtils.doesHaveUser(project, "darth_vader")); + } + + @Test + void findUserConfigByLogin() { + final ProjectUser projectUser = ProjectUtils.findUserConfigByLogin(project, "test_user"); + assertNotNull(projectUser); + assertEquals(getTestUser(), projectUser.getUser()); + assertEquals(project, projectUser.getProject()); + assertEquals(ProjectRole.PROJECT_MANAGER, projectUser.getProjectRole()); + } + + @Test + void getConfigParameters() { + final Map configParameters = ProjectUtils.getConfigParameters( + getProjectAttributes()); + assertNotNull(configParameters); + assertTrue(!configParameters.isEmpty()); + assertThat(configParameters).isEqualTo(getAttributeWithValuesMap().entrySet() + .stream() + .collect(Collectors.toMap(it -> it.getKey().getName(), Map.Entry::getValue))); + } + + @Test + void excludeProjectRecipientsTest() { + + Project project = getProjectWithRecipients(); + project.setSenderCases(getEmailSenderCasesWithRecipientsOnly()); + + Set usersToExclude = project.getUsers().stream().map(ProjectUser::getUser) + .collect(Collectors.toSet()); + + ProjectUtils.excludeProjectRecipients(usersToExclude, project); + + project.getSenderCases().forEach(ec -> { + Arrays.stream(userLoginsNotToExclude) + .forEach(excludedLogin -> assertTrue(ec.getRecipients().contains(excludedLogin))); + Arrays.stream(userEmailsNotToExclude) + .forEach(excludedLogin -> assertTrue(ec.getRecipients().contains(excludedLogin))); + Arrays.stream(userLoginsToExclude) + .forEach(excludedLogin -> assertFalse(ec.getRecipients().contains(excludedLogin))); + Arrays.stream(userEmailsToExclude) + .forEach(excludedLogin -> assertFalse(ec.getRecipients().contains(excludedLogin))); + }); + } + + @Test + void updateProjectRecipientsTest() { + + final String newEmail = "new_email@mail.com"; + + Project project = new Project(); + + project.setSenderCases(getEmailSenderCasesWithRecipientsOnly()); + + ProjectUtils.updateProjectRecipients(userEmailsNotToExclude[0], newEmail, project); + + project.getSenderCases().forEach(ec -> { + assertTrue(ec.getRecipients().contains(newEmail)); + assertFalse(ec.getRecipients().contains(userEmailsNotToExclude[0])); + }); + + } + + @Test + void isPersonalForUserPositive() { + assertTrue(ProjectUtils.isPersonalForUser(ProjectType.PERSONAL, "qwe_personal_1234", "qwe")); + assertTrue(ProjectUtils.isPersonalForUser(ProjectType.PERSONAL, "qwe_personal", "qwe")); + } + + @Test + void isPersonalForUserNegative() { + assertFalse( + ProjectUtils.isPersonalForUser(ProjectType.PERSONAL, "qwe_personal_1234", "qwe_personal")); + assertFalse(ProjectUtils.isPersonalForUser(ProjectType.PERSONAL, "qwe_personal_", "qwe")); + } + + @Test + void isPersonalForUserNegativeWithProjectType() { + boolean isPersonal = ProjectUtils.isPersonalForUser(ProjectType.INTERNAL, "qwe_personal_1234", + "qwe"); + assertFalse(isPersonal); + } + + @Test + void isAssignedPositiveTest() { + User user = new User(); + ProjectUser projectUser = new ProjectUser(); + projectUser.setUser(user); + Project project = new Project(); + project.setId(1L); + projectUser.setProject(project); + user.setProjects(Sets.newHashSet(projectUser)); + + assertTrue(ProjectUtils.isAssignedToProject(user, 1L)); + } + + @Test + void isAssignedNegativeTest() { + User user = new User(); + ProjectUser projectUser = new ProjectUser(); + projectUser.setUser(user); + Project project = new Project(); + project.setId(1L); + projectUser.setProject(project); + user.setProjects(Sets.newHashSet(projectUser)); + + assertFalse(ProjectUtils.isAssignedToProject(user, 2L)); + } + + @Test + void extractProjectAttributesPositiveTest() { + Project testProject = getTestProject(); + testProject.setProjectAttributes(getProjectAttributes()); + + Optional projectAttribute = ProjectUtils.extractAttribute(testProject, + ProjectAttributeEnum.KEEP_LOGS); + assertTrue(projectAttribute.isPresent()); + assertEquals(ProjectAttributeEnum.KEEP_LOGS.getAttribute(), + projectAttribute.get().getAttribute().getName()); + assertEquals(ProjectAttributeEnum.KEEP_LOGS.getDefaultValue(), + projectAttribute.get().getValue()); + } + + @Test + void extractProjectAttributesNegativeTest() { + Project testProject = getTestProject(); + testProject.setProjectAttributes(getProjectAttributes()); + + Optional projectAttribute = ProjectUtils.extractAttribute(testProject, + ProjectAttributeEnum.KEEP_LAUNCHES); + assertTrue(projectAttribute.isEmpty()); + } + + @Test + void extractProjectAttributeValuePositiveTest() { + Project testProject = getTestProject(); + testProject.setProjectAttributes(getProjectAttributes()); + + Optional value = ProjectUtils.extractAttributeValue(testProject, + ProjectAttributeEnum.KEEP_LOGS); + assertTrue(value.isPresent()); + assertEquals(ProjectAttributeEnum.KEEP_LOGS.getDefaultValue(), value.get()); + } + + @Test + void extractProjectAttributeValueNegativeTest() { + Project testProject = getTestProject(); + testProject.setProjectAttributes(getProjectAttributes()); + + Optional value = ProjectUtils.extractAttributeValue(testProject, + ProjectAttributeEnum.KEEP_LAUNCHES); + assertTrue(value.isEmpty()); + } + + @Test + void getConfigParametersByPrefix() { + Map configParameters = ProjectUtils.getConfigParametersByPrefix( + getProjectAttributes(), + ProjectAttributeEnum.Prefix.ANALYZER + ); + + assertTrue(MapUtils.isNotEmpty(configParameters)); + configParameters.forEach( + (key, value) -> assertTrue(key.startsWith(ProjectAttributeEnum.Prefix.ANALYZER))); + } + + private Project getProjectWithRecipients() { + + User firstUser = new User(); + firstUser.setLogin(userLoginsToExclude[0]); + firstUser.setEmail(userEmailsToExclude[0]); + + User secondUser = new User(); + secondUser.setLogin(userLoginsToExclude[1]); + secondUser.setEmail(userEmailsToExclude[1]); + + User thirdUser = new User(); + thirdUser.setLogin(userLoginsToExclude[2]); + thirdUser.setEmail(userEmailsToExclude[2]); + + Set users = Sets.newHashSet(firstUser, secondUser, thirdUser); + + Project project = new Project(); + + Set projectUsers = users.stream().map(u -> { + ProjectUser projectUser = new ProjectUser(); + projectUser.setUser(u); + + projectUser.setProject(project); + + return projectUser; + }).collect(Collectors.toSet()); + + project.setUsers(projectUsers); + + return project; + + } + + private Set getEmailSenderCasesWithRecipientsOnly() { + + SenderCase firstSenderCase = new SenderCase(); - SenderCase secondSenderCase = new SenderCase(); + firstSenderCase.setId(1L); + firstSenderCase.setRecipients( + (Stream.of(userLoginsToExclude, userEmailsToExclude, userLoginsNotToExclude, + userEmailsNotToExclude) + .flatMap(Arrays::stream) + .collect(Collectors.toSet()))); + + SenderCase secondSenderCase = new SenderCase(); - secondSenderCase.setId(2L); - secondSenderCase.setRecipients((Stream.of(userLoginsToExclude, userEmailsToExclude, userLoginsNotToExclude, userEmailsNotToExclude) - .flatMap(Arrays::stream) - .collect(Collectors.toSet()))); + secondSenderCase.setId(2L); + secondSenderCase.setRecipients( + (Stream.of(userLoginsToExclude, userEmailsToExclude, userLoginsNotToExclude, + userEmailsNotToExclude) + .flatMap(Arrays::stream) + .collect(Collectors.toSet()))); - return Sets.newHashSet(firstSenderCase, secondSenderCase); - } + return Sets.newHashSet(firstSenderCase, secondSenderCase); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/project/email/ProjectInfoWidgetTest.java b/src/test/java/com/epam/ta/reportportal/entity/project/email/ProjectInfoWidgetTest.java index 18258aa49..cdaf727ce 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/project/email/ProjectInfoWidgetTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/project/email/ProjectInfoWidgetTest.java @@ -16,41 +16,43 @@ package com.epam.ta.reportportal.entity.project.email; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class ProjectInfoWidgetTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() throws Exception { - allowed = Arrays.stream(ProjectInfoWidget.values()) - .collect(Collectors.toMap(it -> it, - it -> Arrays.asList(it.getWidgetCode(), it.getWidgetCode().toUpperCase(), it.getWidgetCode().toLowerCase()) - )); - disallowed = Arrays.asList("noSuchWidgetCode", "", " ", null); - } - - @Test - void findByCode() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = ProjectInfoWidget.findByCode(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(ProjectInfoWidget.findByCode(it).isPresent())); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() throws Exception { + allowed = Arrays.stream(ProjectInfoWidget.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.getWidgetCode(), it.getWidgetCode().toUpperCase(), + it.getWidgetCode().toLowerCase()) + )); + disallowed = Arrays.asList("noSuchWidgetCode", "", " ", null); + } + + @Test + void findByCode() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = ProjectInfoWidget.findByCode(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(ProjectInfoWidget.findByCode(it).isPresent())); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/project/email/SendCaseTest.java b/src/test/java/com/epam/ta/reportportal/entity/project/email/SendCaseTest.java index 295c22c5b..567d97490 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/project/email/SendCaseTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/project/email/SendCaseTest.java @@ -16,48 +16,51 @@ package com.epam.ta.reportportal.entity.project.email; -import com.epam.ta.reportportal.entity.enums.SendCase; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import com.epam.ta.reportportal.entity.enums.SendCase; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class SendCaseTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() throws Exception { - allowed = Arrays.stream(SendCase.values()) - .collect(Collectors.toMap(it -> it, - it -> Arrays.asList(it.getCaseString(), it.getCaseString().toUpperCase(), it.getCaseString().toLowerCase()) - )); - disallowed = Arrays.asList("noSuchSendCase", "", " ", null); - } - - @Test - void findByName() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = SendCase.findByName(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(SendCase.findByName(it).isPresent())); - } - - @Test - void isPresent() { - allowed.entrySet().stream().flatMap(it -> it.getValue().stream()).forEach(it -> assertTrue(SendCase.isPresent(it))); - disallowed.forEach(it -> assertFalse(SendCase.isPresent(it))); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() throws Exception { + allowed = Arrays.stream(SendCase.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.getCaseString(), it.getCaseString().toUpperCase(), + it.getCaseString().toLowerCase()) + )); + disallowed = Arrays.asList("noSuchSendCase", "", " ", null); + } + + @Test + void findByName() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = SendCase.findByName(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(SendCase.findByName(it).isPresent())); + } + + @Test + void isPresent() { + allowed.entrySet().stream().flatMap(it -> it.getValue().stream()) + .forEach(it -> assertTrue(SendCase.isPresent(it))); + disallowed.forEach(it -> assertFalse(SendCase.isPresent(it))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/user/UserRoleTest.java b/src/test/java/com/epam/ta/reportportal/entity/user/UserRoleTest.java index e6aee58c0..ade20f140 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/user/UserRoleTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/user/UserRoleTest.java @@ -16,48 +16,50 @@ package com.epam.ta.reportportal.entity.user; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class UserRoleTest { - private Map allowed; - private List disallowed; - - @BeforeEach - void setUp() { - allowed = Arrays.stream(UserRole.values()).collect(Collectors.toMap(it -> it, Enum::name)); - disallowed = Arrays.asList("MAINTAINER", "CUSTOMER"); - } - - @Test - void findByName() { - allowed.forEach((key, value) -> { - final Optional optional = UserRole.findByName(value); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - }); - disallowed.forEach(it -> assertFalse(UserRole.findByName(it).isPresent())); - } - - @Test - void findByAuthority() { - allowed.forEach((key, value) -> { - final Optional optional = UserRole.findByAuthority(UserRole.ROLE_PREFIX + value); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - }); - disallowed.forEach(it -> assertFalse(UserRole.findByAuthority(UserRole.ROLE_PREFIX + it).isPresent())); - } + private Map allowed; + private List disallowed; + + @BeforeEach + void setUp() { + allowed = Arrays.stream(UserRole.values()).collect(Collectors.toMap(it -> it, Enum::name)); + disallowed = Arrays.asList("MAINTAINER", "CUSTOMER"); + } + + @Test + void findByName() { + allowed.forEach((key, value) -> { + final Optional optional = UserRole.findByName(value); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + }); + disallowed.forEach(it -> assertFalse(UserRole.findByName(it).isPresent())); + } + + @Test + void findByAuthority() { + allowed.forEach((key, value) -> { + final Optional optional = UserRole.findByAuthority(UserRole.ROLE_PREFIX + value); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + }); + disallowed.forEach( + it -> assertFalse(UserRole.findByAuthority(UserRole.ROLE_PREFIX + it).isPresent())); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/entity/user/UserTypeTest.java b/src/test/java/com/epam/ta/reportportal/entity/user/UserTypeTest.java index 84654e0d5..35eb1d0fb 100644 --- a/src/test/java/com/epam/ta/reportportal/entity/user/UserTypeTest.java +++ b/src/test/java/com/epam/ta/reportportal/entity/user/UserTypeTest.java @@ -16,45 +16,48 @@ package com.epam.ta.reportportal.entity.user; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Ihar Kahadouski */ class UserTypeTest { - private Map> allowed; - private List disallowed; - - @BeforeEach - void setUp() { - allowed = Arrays.stream(UserType.values()) - .collect(Collectors.toMap(it -> it, it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); - disallowed = Arrays.asList("noSuchUserType", "", " ", null); - } - - @Test - void findByName() { - allowed.forEach((key, value) -> value.forEach(val -> { - final Optional optional = UserType.findByName(val); - assertTrue(optional.isPresent()); - assertEquals(key, optional.get()); - })); - disallowed.forEach(it -> assertFalse(UserType.findByName(it).isPresent())); - } - - @Test - void isPresent() { - allowed.entrySet().stream().flatMap(it -> it.getValue().stream()).forEach(it -> assertTrue(UserType.isPresent(it))); - disallowed.forEach(it -> assertFalse(UserType.isPresent(it))); - } + private Map> allowed; + private List disallowed; + + @BeforeEach + void setUp() { + allowed = Arrays.stream(UserType.values()) + .collect(Collectors.toMap(it -> it, + it -> Arrays.asList(it.name(), it.name().toUpperCase(), it.name().toLowerCase()))); + disallowed = Arrays.asList("noSuchUserType", "", " ", null); + } + + @Test + void findByName() { + allowed.forEach((key, value) -> value.forEach(val -> { + final Optional optional = UserType.findByName(val); + assertTrue(optional.isPresent()); + assertEquals(key, optional.get()); + })); + disallowed.forEach(it -> assertFalse(UserType.findByName(it).isPresent())); + } + + @Test + void isPresent() { + allowed.entrySet().stream().flatMap(it -> it.getValue().stream()) + .forEach(it -> assertTrue(UserType.isPresent(it))); + disallowed.forEach(it -> assertFalse(UserType.isPresent(it))); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/filesystem/DataEncoderTest.java b/src/test/java/com/epam/ta/reportportal/filesystem/DataEncoderTest.java index 0e627bfa7..3e4c3cb59 100644 --- a/src/test/java/com/epam/ta/reportportal/filesystem/DataEncoderTest.java +++ b/src/test/java/com/epam/ta/reportportal/filesystem/DataEncoderTest.java @@ -16,81 +16,84 @@ package com.epam.ta.reportportal.filesystem; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; - /** * @author Dzianis_Shybeka */ class DataEncoderTest { - private DataEncoder encoder; + private DataEncoder encoder; - @BeforeEach - void setUp() { - encoder = new DataEncoder(); - } + @BeforeEach + void setUp() { + encoder = new DataEncoder(); + } - @Test - void encode_decode_with_empty_input() throws Exception { - // given: - String input = ""; + @Test + void encode_decode_with_empty_input() throws Exception { + // given: + String input = ""; - // when: - String encoded = encoder.encode(input); + // when: + String encoded = encoder.encode(input); - // then: - assertTrue(encoded.isEmpty()); + // then: + assertTrue(encoded.isEmpty()); - // and: + // and: - // when: - String decoded = encoder.decode(encoded); + // when: + String decoded = encoder.decode(encoded); - // then: - assertTrue(decoded.isEmpty()); - } + // then: + assertTrue(decoded.isEmpty()); + } - @Test - void encode_decode_with_null_input() throws Exception { - // given: - String input = null; + @Test + void encode_decode_with_null_input() throws Exception { + // given: + String input = null; - // when: - String encoded = encoder.encode(input); + // when: + String encoded = encoder.encode(input); - // then: - assertNull(encoded); + // then: + assertNull(encoded); - // and: + // and: - // when: - String decoded = encoder.decode(encoded); + // when: + String decoded = encoder.decode(encoded); - // then: - assertNull(decoded); - } + // then: + assertNull(decoded); + } - @Test - void encode_decode() throws Exception { - // given: - String input = "/data/path/file.ext"; + @Test + void encode_decode() throws Exception { + // given: + String input = "/data/path/file.ext"; - // when: - String encoded = encoder.encode(input); + // when: + String encoded = encoder.encode(input); - // then: - assertFalse(encoded.isEmpty()); + // then: + assertFalse(encoded.isEmpty()); - // and: + // and: - // when: - String decoded = encoder.decode(encoded); + // when: + String decoded = encoder.decode(encoded); - // then: - assertFalse(decoded.isEmpty()); - assertEquals(input, decoded); - } + // then: + assertFalse(decoded.isEmpty()); + assertEquals(input, decoded); + } } diff --git a/src/test/java/com/epam/ta/reportportal/filesystem/FilePathGeneratorTest.java b/src/test/java/com/epam/ta/reportportal/filesystem/FilePathGeneratorTest.java index 7bd5c9817..c8975a49c 100644 --- a/src/test/java/com/epam/ta/reportportal/filesystem/FilePathGeneratorTest.java +++ b/src/test/java/com/epam/ta/reportportal/filesystem/FilePathGeneratorTest.java @@ -16,43 +16,43 @@ package com.epam.ta.reportportal.filesystem; +import static org.mockito.Mockito.when; + import com.epam.ta.reportportal.entity.attachment.AttachmentMetaInfo; import com.epam.ta.reportportal.util.DateTimeProvider; +import java.io.File; +import java.time.LocalDateTime; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import java.io.File; -import java.time.LocalDateTime; - -import static org.mockito.Mockito.when; - class FilePathGeneratorTest { - private DateTimeProvider dateTimeProvider; + private DateTimeProvider dateTimeProvider; - @BeforeEach - void setUp() { - dateTimeProvider = Mockito.mock(DateTimeProvider.class); - } + @BeforeEach + void setUp() { + dateTimeProvider = Mockito.mock(DateTimeProvider.class); + } - @Test - void generate_different_even_for_same_date() { + @Test + void generate_different_even_for_same_date() { - // given: - AttachmentMetaInfo metaInfo = AttachmentMetaInfo.builder() - .withProjectId(1L) - .withLaunchUuid("271b5881-9a62-4df4-b477-335a96acbe14") - .build(); + // given: + AttachmentMetaInfo metaInfo = AttachmentMetaInfo.builder() + .withProjectId(1L) + .withLaunchUuid("271b5881-9a62-4df4-b477-335a96acbe14") + .build(); - LocalDateTime date = LocalDateTime.of(2018, 5, 28, 3, 3); - when(dateTimeProvider.localDateTimeNow()).thenReturn(date); - // + LocalDateTime date = LocalDateTime.of(2018, 5, 28, 3, 3); + when(dateTimeProvider.localDateTimeNow()).thenReturn(date); + // - // when: - String pathOne = new FilePathGenerator(dateTimeProvider).generate(metaInfo); + // when: + String pathOne = new FilePathGenerator(dateTimeProvider).generate(metaInfo); - Assertions.assertThat(pathOne).isEqualTo("1" + File.separator +"2018-5" + File.separator + "271b5881-9a62-4df4-b477-335a96acbe14"); - } + Assertions.assertThat(pathOne).isEqualTo( + "1" + File.separator + "2018-5" + File.separator + "271b5881-9a62-4df4-b477-335a96acbe14"); + } } diff --git a/src/test/java/com/epam/ta/reportportal/filesystem/LocalDataStoreTest.java b/src/test/java/com/epam/ta/reportportal/filesystem/LocalDataStoreTest.java index 825b013e9..363c35316 100644 --- a/src/test/java/com/epam/ta/reportportal/filesystem/LocalDataStoreTest.java +++ b/src/test/java/com/epam/ta/reportportal/filesystem/LocalDataStoreTest.java @@ -16,80 +16,80 @@ package com.epam.ta.reportportal.filesystem; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.when; +import static org.springframework.test.util.AssertionErrors.assertTrue; + import com.epam.ta.reportportal.entity.attachment.AttachmentMetaInfo; import com.epam.ta.reportportal.exception.ReportPortalException; import com.google.common.base.Charsets; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.InputStream; +import java.nio.file.Paths; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mockito; -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.InputStream; -import java.nio.file.Paths; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.mockito.Mockito.when; -import static org.springframework.test.util.AssertionErrors.assertTrue; - class LocalDataStoreTest { - private static final String ROOT_PATH = System.getProperty("java.io.tmpdir"); - private static final String TEST_FILE = "test-file.txt"; + private static final String ROOT_PATH = System.getProperty("java.io.tmpdir"); + private static final String TEST_FILE = "test-file.txt"; - private LocalDataStore localDataStore; + private LocalDataStore localDataStore; - private FilePathGenerator fileNameGenerator; + private FilePathGenerator fileNameGenerator; - @BeforeEach - void setUp() { + @BeforeEach + void setUp() { - fileNameGenerator = Mockito.mock(FilePathGenerator.class); + fileNameGenerator = Mockito.mock(FilePathGenerator.class); - localDataStore = new LocalDataStore(ROOT_PATH); - } + localDataStore = new LocalDataStore(ROOT_PATH); + } - @Test - void save_load_delete() throws Exception { + @Test + void save_load_delete() throws Exception { - // given: - AttachmentMetaInfo attachmentMetaInfo = AttachmentMetaInfo.builder() - .withProjectId(1L) - .withLaunchId(2L) - .withItemId(3L) - .withLogId(4L) - .build(); - String generatedDirectory = "/test"; - when(fileNameGenerator.generate(attachmentMetaInfo)).thenReturn(generatedDirectory); - FileUtils.deleteDirectory(new File(Paths.get(ROOT_PATH, generatedDirectory).toUri())); + // given: + AttachmentMetaInfo attachmentMetaInfo = AttachmentMetaInfo.builder() + .withProjectId(1L) + .withLaunchId(2L) + .withItemId(3L) + .withLogId(4L) + .build(); + String generatedDirectory = "/test"; + when(fileNameGenerator.generate(attachmentMetaInfo)).thenReturn(generatedDirectory); + FileUtils.deleteDirectory(new File(Paths.get(ROOT_PATH, generatedDirectory).toUri())); - // when: save new file - String savedFilePath = localDataStore.save(TEST_FILE, new ByteArrayInputStream("test text".getBytes(Charsets.UTF_8))); + // when: save new file + String savedFilePath = localDataStore.save(TEST_FILE, + new ByteArrayInputStream("test text".getBytes(Charsets.UTF_8))); - // and: load it back - InputStream loaded = localDataStore.load(savedFilePath); + // and: load it back + InputStream loaded = localDataStore.load(savedFilePath); - // then: saved and loaded files should be the same - byte[] bytes = IOUtils.toByteArray(loaded); - String result = new String(bytes, Charsets.UTF_8); - assertEquals("test text", result, "saved and loaded files should be the same"); + // then: saved and loaded files should be the same + byte[] bytes = IOUtils.toByteArray(loaded); + String result = new String(bytes, Charsets.UTF_8); + assertEquals("test text", result, "saved and loaded files should be the same"); - // when: delete saved file - localDataStore.delete(savedFilePath); + // when: delete saved file + localDataStore.delete(savedFilePath); - // and: load file again - boolean isNotFound = false; - try { + // and: load file again + boolean isNotFound = false; + try { - localDataStore.load(savedFilePath); - } catch (ReportPortalException e) { + localDataStore.load(savedFilePath); + } catch (ReportPortalException e) { - isNotFound = true; - } + isNotFound = true; + } - // then: deleted file should not be found - assertTrue("deleted file should not be found", isNotFound); - } + // then: deleted file should not be found + assertTrue("deleted file should not be found", isNotFound); + } } diff --git a/src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java b/src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java index ec731b244..8fb173d51 100644 --- a/src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java +++ b/src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java @@ -16,6 +16,13 @@ package com.epam.ta.reportportal.filesystem.distributed.s3; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.io.InputStream; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.domain.Blob; import org.jclouds.blobstore.domain.BlobBuilder; @@ -23,67 +30,65 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.io.InputStream; - -import static org.mockito.Mockito.*; - /** * @author Ivan Budayeu */ class S3DataStoreTest { - private static final String FILE_PATH = "someFile"; - private static final String BUCKET_PREFIX = "prj-"; - private static final String DEFAULT_BUCKET_NAME = "rp-bucket"; - private static final String REGION = "us-east-1"; - private static final int ZERO = 0; + private static final String FILE_PATH = "someFile"; + private static final String BUCKET_PREFIX = "prj-"; + private static final String DEFAULT_BUCKET_NAME = "rp-bucket"; + private static final String REGION = "us-east-1"; + private static final int ZERO = 0; - private final BlobStore blobStore = mock(BlobStore.class); - private final InputStream inputStream = mock(InputStream.class); + private final BlobStore blobStore = mock(BlobStore.class); + private final InputStream inputStream = mock(InputStream.class); - private final S3DataStore s3DataStore = new S3DataStore(blobStore, BUCKET_PREFIX, DEFAULT_BUCKET_NAME, REGION); + private final S3DataStore s3DataStore = new S3DataStore(blobStore, BUCKET_PREFIX, + DEFAULT_BUCKET_NAME, REGION); - @Test - void save() throws Exception { + @Test + void save() throws Exception { - BlobBuilder blobBuilderMock = mock(BlobBuilder.class); - BlobBuilder.PayloadBlobBuilder payloadBlobBuilderMock = mock(BlobBuilder.PayloadBlobBuilder.class); - Blob blobMock = mock(Blob.class); + BlobBuilder blobBuilderMock = mock(BlobBuilder.class); + BlobBuilder.PayloadBlobBuilder payloadBlobBuilderMock = mock( + BlobBuilder.PayloadBlobBuilder.class); + Blob blobMock = mock(Blob.class); - when(inputStream.available()).thenReturn(ZERO); - when(payloadBlobBuilderMock.contentDisposition(FILE_PATH)).thenReturn(payloadBlobBuilderMock); - when(payloadBlobBuilderMock.contentLength(ZERO)).thenReturn(payloadBlobBuilderMock); - when(payloadBlobBuilderMock.build()).thenReturn(blobMock); - when(blobBuilderMock.payload(inputStream)).thenReturn(payloadBlobBuilderMock); + when(inputStream.available()).thenReturn(ZERO); + when(payloadBlobBuilderMock.contentDisposition(FILE_PATH)).thenReturn(payloadBlobBuilderMock); + when(payloadBlobBuilderMock.contentLength(ZERO)).thenReturn(payloadBlobBuilderMock); + when(payloadBlobBuilderMock.build()).thenReturn(blobMock); + when(blobBuilderMock.payload(inputStream)).thenReturn(payloadBlobBuilderMock); - when(blobStore.containerExists(any(String.class))).thenReturn(true); - when(blobStore.blobBuilder(FILE_PATH)).thenReturn(blobBuilderMock); + when(blobStore.containerExists(any(String.class))).thenReturn(true); + when(blobStore.blobBuilder(FILE_PATH)).thenReturn(blobBuilderMock); - s3DataStore.save(FILE_PATH, inputStream); + s3DataStore.save(FILE_PATH, inputStream); - verify(blobStore, times(1)).putBlob(DEFAULT_BUCKET_NAME, blobMock); - } + verify(blobStore, times(1)).putBlob(DEFAULT_BUCKET_NAME, blobMock); + } - @Test - void load() throws Exception { + @Test + void load() throws Exception { - Blob mockBlob = mock(Blob.class); - Payload mockPayload = mock(Payload.class); + Blob mockBlob = mock(Blob.class); + Payload mockPayload = mock(Payload.class); - when(mockPayload.openStream()).thenReturn(inputStream); - when(mockBlob.getPayload()).thenReturn(mockPayload); + when(mockPayload.openStream()).thenReturn(inputStream); + when(mockBlob.getPayload()).thenReturn(mockPayload); - when(blobStore.getBlob(DEFAULT_BUCKET_NAME, FILE_PATH)).thenReturn(mockBlob); - InputStream loaded = s3DataStore.load(FILE_PATH); + when(blobStore.getBlob(DEFAULT_BUCKET_NAME, FILE_PATH)).thenReturn(mockBlob); + InputStream loaded = s3DataStore.load(FILE_PATH); - Assertions.assertEquals(inputStream, loaded); - } + Assertions.assertEquals(inputStream, loaded); + } - @Test - void delete() throws Exception { + @Test + void delete() throws Exception { - s3DataStore.delete(FILE_PATH); + s3DataStore.delete(FILE_PATH); - verify(blobStore, times(1)).removeBlob(DEFAULT_BUCKET_NAME, FILE_PATH); - } + verify(blobStore, times(1)).removeBlob(DEFAULT_BUCKET_NAME, FILE_PATH); + } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/util/WidgetSortUtilsTest.java b/src/test/java/com/epam/ta/reportportal/util/WidgetSortUtilsTest.java index 94024efc4..49728c51b 100644 --- a/src/test/java/com/epam/ta/reportportal/util/WidgetSortUtilsTest.java +++ b/src/test/java/com/epam/ta/reportportal/util/WidgetSortUtilsTest.java @@ -16,49 +16,53 @@ package com.epam.ta.reportportal.util; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.SF_NAME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATISTICS_COUNTER; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATISTICS_TABLE; +import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; +import static com.epam.ta.reportportal.jooq.tables.JLaunch.LAUNCH; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.epam.ta.reportportal.commons.querygen.FilterTarget; +import java.util.List; import org.jooq.SortField; import org.jooq.impl.DSL; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.data.domain.Sort; -import java.util.List; - -import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*; -import static com.epam.ta.reportportal.dao.util.JooqFieldNameTransformer.fieldName; -import static com.epam.ta.reportportal.jooq.tables.JLaunch.LAUNCH; -import static org.junit.jupiter.api.Assertions.assertEquals; - /** * @author Ivan Budayeu */ class WidgetSortUtilsTest { - private Sort sort; - private FilterTarget filterTarget; + private Sort sort; + private FilterTarget filterTarget; - @BeforeEach - void setUp() { + @BeforeEach + void setUp() { - sort = Sort.by("startTime", "name", "statistics$defects$to_investigate$ti001", "statistics$defects$system_issue$si001"); - filterTarget = FilterTarget.LAUNCH_TARGET; - } + sort = Sort.by("startTime", "name", "statistics$defects$to_investigate$ti001", + "statistics$defects$system_issue$si001"); + filterTarget = FilterTarget.LAUNCH_TARGET; + } - @Test - void widgetSortTest() { - List> sortFields = WidgetSortUtils.TO_SORT_FIELDS.apply(sort, filterTarget); + @Test + void widgetSortTest() { + List> sortFields = WidgetSortUtils.TO_SORT_FIELDS.apply(sort, filterTarget); - assertEquals(LAUNCH.START_TIME.getQualifiedName().toString(), sortFields.get(0).getName()); - assertEquals(LAUNCH.NAME.getQualifiedName().toString(), sortFields.get(1).getName()); + assertEquals(LAUNCH.START_TIME.getQualifiedName().toString(), sortFields.get(0).getName()); + assertEquals(LAUNCH.NAME.getQualifiedName().toString(), sortFields.get(1).getName()); - assertEquals(DSL.coalesce(DSL.max(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER)) - .filterWhere(fieldName(STATISTICS_TABLE, SF_NAME).cast(String.class).eq("statistics$defects$to_investigate$ti001")), 0) - .toString(), sortFields.get(2).getName()); + assertEquals(DSL.coalesce(DSL.max(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER)) + .filterWhere(fieldName(STATISTICS_TABLE, SF_NAME).cast(String.class) + .eq("statistics$defects$to_investigate$ti001")), 0) + .toString(), sortFields.get(2).getName()); - assertEquals(DSL.coalesce(DSL.max(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER)) - .filterWhere(fieldName(STATISTICS_TABLE, SF_NAME).cast(String.class).eq("statistics$defects$system_issue$si001")), 0) - .toString(), sortFields.get(3).getName()); - } + assertEquals(DSL.coalesce(DSL.max(fieldName(STATISTICS_TABLE, STATISTICS_COUNTER)) + .filterWhere(fieldName(STATISTICS_TABLE, SF_NAME).cast(String.class) + .eq("statistics$defects$system_issue$si001")), 0) + .toString(), sortFields.get(3).getName()); + } } \ No newline at end of file diff --git a/src/test/resources/db/fill/attributes/attributes-fill.sql b/src/test/resources/db/fill/attributes/attributes-fill.sql index 300ca042b..7a319e821 100644 --- a/src/test/resources/db/fill/attributes/attributes-fill.sql +++ b/src/test/resources/db/fill/attributes/attributes-fill.sql @@ -1 +1,2 @@ -INSERT INTO attribute(id, name) VALUES (100, 'present'); \ No newline at end of file +INSERT INTO attribute(id, name) +VALUES (100, 'present'); \ No newline at end of file diff --git a/src/test/resources/db/fill/dashboard-widget/dashboard-widget-fill.sql b/src/test/resources/db/fill/dashboard-widget/dashboard-widget-fill.sql index 22b6f1922..a7b0d8ed3 100644 --- a/src/test/resources/db/fill/dashboard-widget/dashboard-widget-fill.sql +++ b/src/test/resources/db/fill/dashboard-widget/dashboard-widget-fill.sql @@ -1,34 +1,42 @@ -DELETE FROM public.users WHERE id = 3; +DELETE +FROM public.users +WHERE id = 3; -INSERT INTO public.users (id, login, password, email, attachment, attachment_thumbnail, role, type, expired, full_name, metadata) -VALUES (3, 'jaja_user', '7c381f9d81b0e438af4e7094c6cae203', 'jaja@mail.com', null, null, 'USER', 'INTERNAL', false, 'Jaja Juja', '{"metadata": {"last_login": 1546605767372}}'); +INSERT INTO public.users (id, login, password, email, attachment, attachment_thumbnail, role, type, + expired, full_name, metadata) +VALUES (3, 'jaja_user', '7c381f9d81b0e438af4e7094c6cae203', 'jaja@mail.com', null, null, 'USER', + 'INTERNAL', false, 'Jaja Juja', '{"metadata": {"last_login": 1546605767372}}'); -INSERT INTO public.project_user (user_id, project_id, project_role) VALUES (3, 1, 'MEMBER'); +INSERT INTO public.project_user (user_id, project_id, project_role) +VALUES (3, 1, 'MEMBER'); -INSERT INTO public.shareable_entity (id, shared, owner, project_id) VALUES - (5, true, 'superadmin', 1), - (6, false, 'superadmin', 1), - (13, true, 'superadmin', 1), - (14, false, 'superadmin', 1), - (15, true, 'jaja_user', 1), - (16, false, 'jaja_user', 1), - (17, true, 'default', 2), - (18, false, 'default', 2); +INSERT INTO public.shareable_entity (id, shared, owner, project_id) +VALUES (5, true, 'superadmin', 1), + (6, false, 'superadmin', 1), + (13, true, 'superadmin', 1), + (14, false, 'superadmin', 1), + (15, true, 'jaja_user', 1), + (16, false, 'jaja_user', 1), + (17, true, 'default', 2), + (18, false, 'default', 2); -INSERT INTO public.widget (id, name, description, widget_type, items_count, widget_options) VALUES - (5, 'activity stream12', null, 'activityStream', 50, '{"options": {"user": "superadmin", "actionType": ["startLaunch", "finishLaunch"]}}'), - (6, 'LAUNCH STATISTICS', null, 'launchStatistics', 10, '{"options": {"timeline": "WEEK"}}'); +INSERT INTO public.widget (id, name, description, widget_type, items_count, widget_options) +VALUES (5, 'activity stream12', null, 'activityStream', 50, + '{"options": {"user": "superadmin", "actionType": ["startLaunch", "finishLaunch"]}}'), + (6, 'LAUNCH STATISTICS', null, 'launchStatistics', 10, '{"options": {"timeline": "WEEK"}}'); -INSERT INTO public.dashboard (id, name, description, creation_date) VALUES - (13, 'test admin dashboard', 'admin shared dashboard', '2019-01-10 13:01:06.083000'), - (14, 'test admin private dashboard', 'admin dashboard', '2019-01-10 13:01:19.259000'), - (15, 'test jaja shared dashboard', 'jaja dashboard', '2019-01-10 13:01:51.417000'); +INSERT INTO public.dashboard (id, name, description, creation_date) +VALUES (13, 'test admin dashboard', 'admin shared dashboard', '2019-01-10 13:01:06.083000'), + (14, 'test admin private dashboard', 'admin dashboard', '2019-01-10 13:01:19.259000'), + (15, 'test jaja shared dashboard', 'jaja dashboard', '2019-01-10 13:01:51.417000'); -INSERT INTO public.dashboard_widget (dashboard_id, widget_id, widget_name, widget_owner, widget_type, widget_width, widget_height, +INSERT INTO public.dashboard_widget (dashboard_id, widget_id, widget_name, widget_owner, + widget_type, widget_width, widget_height, widget_position_x, widget_position_y) VALUES (13, 5, 'activity stream12', 'superadmin', 'activityStream', 5, 5, 0, 0), - (13, 6, 'INVESTIGATED PERCENTAGE OF LAUNCHES', 'superadmin', 'investigatedTrend', 6, 3, 0, 0), + (13, 6, 'INVESTIGATED PERCENTAGE OF LAUNCHES', 'superadmin', 'investigatedTrend', 6, 3, 0, + 0), (14, 5, 'activity stream12', 'superadmin', 'activityStream', 5, 5, 0, 0), (14, 6, 'LAUNCH STATISTICS', 'superadmin', 'launchStatistics', 4, 6, 0, 0), (15, 5, 'TEST CASES GROWTH TREND CHART', 'jaja_user', 'topTestCases', 7, 3, 0, 0); \ No newline at end of file diff --git a/src/test/resources/db/fill/data-store/data-store-fill.sql b/src/test/resources/db/fill/data-store/data-store-fill.sql index d062fc1f9..c3c892cad 100644 --- a/src/test/resources/db/fill/data-store/data-store-fill.sql +++ b/src/test/resources/db/fill/data-store/data-store-fill.sql @@ -1,10 +1,14 @@ -INSERT INTO launch(id, uuid, project_id, user_id, name, description, start_time, end_time, last_modified, mode, status, has_retries, +INSERT INTO launch(id, uuid, project_id, user_id, name, description, start_time, end_time, + last_modified, mode, status, has_retries, rerun, approximate_duration) -VALUES (1, 'uuid', 1, 1, 'launch', 'launch', now(), now(), now(), 'DEFAULT', 'FAILED', FALSE, FALSE, 0); +VALUES (1, 'uuid', 1, 1, 'launch', 'launch', now(), now(), now(), 'DEFAULT', 'FAILED', FALSE, FALSE, + 0); -INSERT INTO test_item(test_case_hash, item_id, uuid, name, type, start_time, description, last_modified, path, unique_id, has_children, +INSERT INTO test_item(test_case_hash, item_id, uuid, name, type, start_time, description, + last_modified, path, unique_id, has_children, has_retries, has_stats, parent_id, retry_of, launch_id) -VALUES (1, 1, 'uuid', 'item', 'STEP', now(), 'desc', now(), '1', 'uniqueId', FALSE, FALSE, TRUE, NULL, NULL, 1); +VALUES (1, 1, 'uuid', 'item', 'STEP', now(), 'desc', now(), '1', 'uniqueId', FALSE, FALSE, TRUE, + NULL, NULL, 1); INSERT INTO log(id, uuid, log_time, log_message, item_id, last_modified, log_level, project_id) VALUES (1, 'uuid', now(), 'msg', 1, now(), 40000, 1); \ No newline at end of file diff --git a/src/test/resources/db/fill/integration/integrations-fill.sql b/src/test/resources/db/fill/integration/integrations-fill.sql index 66bcfe9fe..e4d273638 100644 --- a/src/test/resources/db/fill/integration/integrations-fill.sql +++ b/src/test/resources/db/fill/integration/integrations-fill.sql @@ -40,7 +40,7 @@ VALUES (13, 'jira', 6, false, 'superadmin', now(), '{ } }'); -INSERT INTO integration (id, name, project_id, type, enabled, creator, creation_date, params)--integration id = 14 (superadmin project JIRA) +INSERT INTO integration (id, name, project_id, type, enabled, creator, creation_date, params)--integration id = 14 (superadmin project JIRA) VALUES (14, 'jira1', 1, 6, false, 'superadmin', now(), '{ "params": { "url" : "projectbts.com", diff --git a/src/test/resources/db/fill/issue-type/issue-type-fill.sql b/src/test/resources/db/fill/issue-type/issue-type-fill.sql index bc99afe37..75553a55d 100644 --- a/src/test/resources/db/fill/issue-type/issue-type-fill.sql +++ b/src/test/resources/db/fill/issue-type/issue-type-fill.sql @@ -1,3 +1,4 @@ -- Creates custom issue type -insert into issue_type(id, issue_group_id, locator, issue_name, abbreviation, hex_color) values (100, 3, 'pb_ajf7d5d', 'Custom', 'CS', '#a3847e'); \ No newline at end of file +insert into issue_type(id, issue_group_id, locator, issue_name, abbreviation, hex_color) +values (100, 3, 'pb_ajf7d5d', 'Custom', 'CS', '#a3847e'); \ No newline at end of file diff --git a/src/test/resources/db/fill/issue/issue-fill.sql b/src/test/resources/db/fill/issue/issue-fill.sql index 79badab7e..f43915a28 100644 --- a/src/test/resources/db/fill/issue/issue-fill.sql +++ b/src/test/resources/db/fill/issue/issue-fill.sql @@ -1,3 +1,5 @@ -INSERT INTO issue(issue_id, issue_type, issue_description, auto_analyzed, ignore_analyzer) VALUES (5, trunc(random() * 5 + 1), 'description', false, false); +INSERT INTO issue(issue_id, issue_type, issue_description, auto_analyzed, ignore_analyzer) +VALUES (5, trunc(random() * 5 + 1), 'description', false, false); -INSERT INTO issue(issue_id, issue_type, issue_description, auto_analyzed, ignore_analyzer) VALUES (106, trunc(random() * 5 + 1), 'description', false, false); \ No newline at end of file +INSERT INTO issue(issue_id, issue_type, issue_description, auto_analyzed, ignore_analyzer) +VALUES (106, trunc(random() * 5 + 1), 'description', false, false); \ No newline at end of file diff --git a/src/test/resources/db/fill/item/items-fill.sql b/src/test/resources/db/fill/item/items-fill.sql index eeed24410..a199502de 100644 --- a/src/test/resources/db/fill/item/items-fill.sql +++ b/src/test/resources/db/fill/item/items-fill.sql @@ -3,10 +3,14 @@ SELECT items_init(); INSERT INTO clusters(id, index_id, project_id, launch_id, message) VALUES (1, 1, 1, 1, 'Message'); -INSERT INTO clusters_test_item(cluster_id, item_id) VALUES (1, 3); -INSERT INTO clusters_test_item(cluster_id, item_id) VALUES (1, 4); -INSERT INTO clusters_test_item(cluster_id, item_id) VALUES (1, 5); -INSERT INTO clusters_test_item(cluster_id, item_id) VALUES (1, 6); +INSERT INTO clusters_test_item(cluster_id, item_id) +VALUES (1, 3); +INSERT INTO clusters_test_item(cluster_id, item_id) +VALUES (1, 4); +INSERT INTO clusters_test_item(cluster_id, item_id) +VALUES (1, 5); +INSERT INTO clusters_test_item(cluster_id, item_id) +VALUES (1, 6); UPDATE log SET cluster_id = 1 diff --git a/src/test/resources/db/fill/item/items-with-nested-steps.sql b/src/test/resources/db/fill/item/items-with-nested-steps.sql index ec5270517..861473181 100644 --- a/src/test/resources/db/fill/item/items-with-nested-steps.sql +++ b/src/test/resources/db/fill/item/items-with-nested-steps.sql @@ -1,99 +1,245 @@ -INSERT INTO public.launch (id, uuid, project_id, user_id, name, description, start_time, end_time, number, last_modified, mode, status, has_retries, rerun, approximate_duration) VALUES (10, '4c838392-ba6d-48b0-b3b2-213c3a5eeebf', 1, 1, 'superadmin_TEST_EXAMPLE', null, '2020-02-12 16:17:58.041000', '2020-02-12 16:18:00.141000', 2, '2020-02-12 19:21:00.758721', 'DEFAULT', 'FAILED', false, false, 0.924); +INSERT INTO public.launch (id, uuid, project_id, user_id, name, description, start_time, end_time, + number, last_modified, mode, status, has_retries, rerun, + approximate_duration) +VALUES (10, '4c838392-ba6d-48b0-b3b2-213c3a5eeebf', 1, 1, 'superadmin_TEST_EXAMPLE', null, + '2020-02-12 16:17:58.041000', '2020-02-12 16:18:00.141000', 2, '2020-02-12 19:21:00.758721', + 'DEFAULT', 'FAILED', false, false, 0.924); -INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, last_modified, path, unique_id, test_case_id, has_children, has_retries, has_stats, parent_id, retry_of, launch_id, test_case_hash) VALUES (130, '53e7a3b7-4c25-4948-8fd1-8078a105a912', 'Default Suite', null, 'SUITE', '2020-02-12 16:17:58.701000', null, '2020-02-12 19:20:59.069036', '130', 'auto:ac4756dc4f6593ae95b34f92d8190314', null, true, false, true, null, null, 10, -837850887); -INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, last_modified, path, unique_id, test_case_id, has_children, has_retries, has_stats, parent_id, retry_of, launch_id, test_case_hash) VALUES (131, '81a497ed-9889-41c7-bbf1-63c228118625', 'examples-java', 'com.epam.reportportal.example.testng.logback.step.NestedStepsTest', 'TEST', '2020-02-12 16:17:58.790000', null, '2020-02-12 19:20:59.100846', '130.131', 'auto:e4c9be3a695d687202ce46bb0248c3be', null, true, false, true, 130, null, 10, -535955601); -INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, last_modified, path, unique_id, test_case_id, has_children, has_retries, has_stats, parent_id, retry_of, launch_id, test_case_hash) VALUES (132, '2d497d02-0925-47d5-b8cf-7a7503a95e3a', 'orderProductsTest', 'com.epam.reportportal.example.testng.logback.step.NestedStepsTest.orderProductsTest', 'STEP', '2020-02-12 16:17:58.883000', '', '2020-02-12 19:20:59.101439', '130.131.132', 'auto:8cbc957f34516c324711053cd24070c9', 'com.epam.reportportal.example.testng.logback.step.NestedStepsTest.orderProductsTest[]', false, false, true, 131, null, 10, -186468562); -INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, last_modified, path, unique_id, test_case_id, has_children, has_retries, has_stats, parent_id, retry_of, launch_id, test_case_hash) VALUES (133, 'd82da671-4dac-46c6-884f-01527b58a2b7', 'navigateToMainPage', null, 'STEP', '2020-02-12 16:17:58.916000', null, '2020-02-12 19:20:59.134683', '130.131.132.133', 'auto:847af698ac7d55fdcdae9a992b40e476', null, false, false, false, 132, null, 10, 901412180); -INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, last_modified, path, unique_id, test_case_id, has_children, has_retries, has_stats, parent_id, retry_of, launch_id, test_case_hash) VALUES (134, '0d89cecd-0d60-4664-b55c-a7bf93d1d0fd', 'login', null, 'STEP', '2020-02-12 16:17:58.930000', null, '2020-02-12 19:20:59.169801', '130.131.132.134', 'auto:41ab6a490fe3702fad48163769f2e733', null, false, false, false, 132, null, 10, -375485253); -INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, last_modified, path, unique_id, test_case_id, has_children, has_retries, has_stats, parent_id, retry_of, launch_id, test_case_hash) VALUES (135, '63fef110-d983-45ec-a6a4-6141c5e50609', 'navigateToProductsPage', null, 'STEP', '2020-02-12 16:17:58.932000', null, '2020-02-12 19:20:59.190198', '130.131.132.135', 'auto:ba8e9eb5134bea607b54d6417f2d11ba', null, false, false, false, 132, null, 10, 1300291829); -INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, last_modified, path, unique_id, test_case_id, has_children, has_retries, has_stats, parent_id, retry_of, launch_id, test_case_hash) VALUES (136, '9f5cf143-f0b6-4b8d-845c-6431b3ed7c98', 'Add 5 products to the cart', null, 'STEP', '2020-02-12 16:17:58.951000', null, '2020-02-12 19:20:59.274305', '130.131.132.136', 'auto:1fcfd21fe319ea5d1ab8207434f1f166', null, false, false, false, 132, null, 10, -472716353); -INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, last_modified, path, unique_id, test_case_id, has_children, has_retries, has_stats, parent_id, retry_of, launch_id, test_case_hash) VALUES (137, 'ce28885c-ca32-4a1c-9ca4-5f12a5fe29b8', 'Payment step with price = 15.0', null, 'STEP', '2020-02-12 16:17:59.004000', null, '2020-02-12 19:20:59.293817', '130.131.132.137', 'auto:0da71f15f42cf1488de7f4b42258ba7d', null, false, false, false, 132, null, 10, 1121458889); -INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, last_modified, path, unique_id, test_case_id, has_children, has_retries, has_stats, parent_id, retry_of, launch_id, test_case_hash) VALUES (138, '7e54aa20-4fe3-4fa6-a181-7b4f00cd406e', 'logout', null, 'STEP', '2020-02-12 16:17:59.009000', null, '2020-02-12 19:20:59.374424', '130.131.132.138', 'auto:8a16491d5f008de1d9b9df9e2d60d94c', null, false, false, false, 132, null, 10, -125693020); +INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, + last_modified, path, unique_id, test_case_id, has_children, + has_retries, has_stats, parent_id, retry_of, launch_id, + test_case_hash) +VALUES (130, '53e7a3b7-4c25-4948-8fd1-8078a105a912', 'Default Suite', null, 'SUITE', + '2020-02-12 16:17:58.701000', null, '2020-02-12 19:20:59.069036', '130', + 'auto:ac4756dc4f6593ae95b34f92d8190314', null, true, false, true, null, null, 10, + -837850887); +INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, + last_modified, path, unique_id, test_case_id, has_children, + has_retries, has_stats, parent_id, retry_of, launch_id, + test_case_hash) +VALUES (131, '81a497ed-9889-41c7-bbf1-63c228118625', 'examples-java', + 'com.epam.reportportal.example.testng.logback.step.NestedStepsTest', 'TEST', + '2020-02-12 16:17:58.790000', null, '2020-02-12 19:20:59.100846', '130.131', + 'auto:e4c9be3a695d687202ce46bb0248c3be', null, true, false, true, 130, null, 10, + -535955601); +INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, + last_modified, path, unique_id, test_case_id, has_children, + has_retries, has_stats, parent_id, retry_of, launch_id, + test_case_hash) +VALUES (132, '2d497d02-0925-47d5-b8cf-7a7503a95e3a', 'orderProductsTest', + 'com.epam.reportportal.example.testng.logback.step.NestedStepsTest.orderProductsTest', + 'STEP', '2020-02-12 16:17:58.883000', '', '2020-02-12 19:20:59.101439', '130.131.132', + 'auto:8cbc957f34516c324711053cd24070c9', + 'com.epam.reportportal.example.testng.logback.step.NestedStepsTest.orderProductsTest[]', + false, false, true, 131, null, 10, -186468562); +INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, + last_modified, path, unique_id, test_case_id, has_children, + has_retries, has_stats, parent_id, retry_of, launch_id, + test_case_hash) +VALUES (133, 'd82da671-4dac-46c6-884f-01527b58a2b7', 'navigateToMainPage', null, 'STEP', + '2020-02-12 16:17:58.916000', null, '2020-02-12 19:20:59.134683', '130.131.132.133', + 'auto:847af698ac7d55fdcdae9a992b40e476', null, false, false, false, 132, null, 10, + 901412180); +INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, + last_modified, path, unique_id, test_case_id, has_children, + has_retries, has_stats, parent_id, retry_of, launch_id, + test_case_hash) +VALUES (134, '0d89cecd-0d60-4664-b55c-a7bf93d1d0fd', 'login', null, 'STEP', + '2020-02-12 16:17:58.930000', null, '2020-02-12 19:20:59.169801', '130.131.132.134', + 'auto:41ab6a490fe3702fad48163769f2e733', null, false, false, false, 132, null, 10, + -375485253); +INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, + last_modified, path, unique_id, test_case_id, has_children, + has_retries, has_stats, parent_id, retry_of, launch_id, + test_case_hash) +VALUES (135, '63fef110-d983-45ec-a6a4-6141c5e50609', 'navigateToProductsPage', null, 'STEP', + '2020-02-12 16:17:58.932000', null, '2020-02-12 19:20:59.190198', '130.131.132.135', + 'auto:ba8e9eb5134bea607b54d6417f2d11ba', null, false, false, false, 132, null, 10, + 1300291829); +INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, + last_modified, path, unique_id, test_case_id, has_children, + has_retries, has_stats, parent_id, retry_of, launch_id, + test_case_hash) +VALUES (136, '9f5cf143-f0b6-4b8d-845c-6431b3ed7c98', 'Add 5 products to the cart', null, 'STEP', + '2020-02-12 16:17:58.951000', null, '2020-02-12 19:20:59.274305', '130.131.132.136', + 'auto:1fcfd21fe319ea5d1ab8207434f1f166', null, false, false, false, 132, null, 10, + -472716353); +INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, + last_modified, path, unique_id, test_case_id, has_children, + has_retries, has_stats, parent_id, retry_of, launch_id, + test_case_hash) +VALUES (137, 'ce28885c-ca32-4a1c-9ca4-5f12a5fe29b8', 'Payment step with price = 15.0', null, 'STEP', + '2020-02-12 16:17:59.004000', null, '2020-02-12 19:20:59.293817', '130.131.132.137', + 'auto:0da71f15f42cf1488de7f4b42258ba7d', null, false, false, false, 132, null, 10, + 1121458889); +INSERT INTO public.test_item (item_id, uuid, name, code_ref, type, start_time, description, + last_modified, path, unique_id, test_case_id, has_children, + has_retries, has_stats, parent_id, retry_of, launch_id, + test_case_hash) +VALUES (138, '7e54aa20-4fe3-4fa6-a181-7b4f00cd406e', 'logout', null, 'STEP', + '2020-02-12 16:17:59.009000', null, '2020-02-12 19:20:59.374424', '130.131.132.138', + 'auto:8a16491d5f008de1d9b9df9e2d60d94c', null, false, false, false, 132, null, 10, + -125693020); -INSERT INTO public.test_item_results (result_id, status, end_time, duration) VALUES (131, 'FAILED', '2020-02-12 16:18:00.079000', 1.289); -INSERT INTO public.test_item_results (result_id, status, end_time, duration) VALUES (132, 'FAILED', '2020-02-12 16:17:59.027000', 0.144); -INSERT INTO public.test_item_results (result_id, status, end_time, duration) VALUES (133, 'PASSED', '2020-02-12 16:17:58.917000', 0.001); -INSERT INTO public.test_item_results (result_id, status, end_time, duration) VALUES (134, 'PASSED', '2020-02-12 16:17:58.931000', 0.001); -INSERT INTO public.test_item_results (result_id, status, end_time, duration) VALUES (135, 'PASSED', '2020-02-12 16:17:58.938000', 0.006); -INSERT INTO public.test_item_results (result_id, status, end_time, duration) VALUES (136, 'PASSED', '2020-02-12 16:17:58.992000', 0.041); -INSERT INTO public.test_item_results (result_id, status, end_time, duration) VALUES (137, 'PASSED', '2020-02-12 16:17:59.005000', 0.001); -INSERT INTO public.test_item_results (result_id, status, end_time, duration) VALUES (138, 'FAILED', '2020-02-12 16:17:59.022000', 0.013); +INSERT INTO public.test_item_results (result_id, status, end_time, duration) +VALUES (131, 'FAILED', '2020-02-12 16:18:00.079000', 1.289); +INSERT INTO public.test_item_results (result_id, status, end_time, duration) +VALUES (132, 'FAILED', '2020-02-12 16:17:59.027000', 0.144); +INSERT INTO public.test_item_results (result_id, status, end_time, duration) +VALUES (133, 'PASSED', '2020-02-12 16:17:58.917000', 0.001); +INSERT INTO public.test_item_results (result_id, status, end_time, duration) +VALUES (134, 'PASSED', '2020-02-12 16:17:58.931000', 0.001); +INSERT INTO public.test_item_results (result_id, status, end_time, duration) +VALUES (135, 'PASSED', '2020-02-12 16:17:58.938000', 0.006); +INSERT INTO public.test_item_results (result_id, status, end_time, duration) +VALUES (136, 'PASSED', '2020-02-12 16:17:58.992000', 0.041); +INSERT INTO public.test_item_results (result_id, status, end_time, duration) +VALUES (137, 'PASSED', '2020-02-12 16:17:59.005000', 0.001); +INSERT INTO public.test_item_results (result_id, status, end_time, duration) +VALUES (138, 'FAILED', '2020-02-12 16:17:59.022000', 0.013); -INSERT INTO public.issue (issue_id, issue_type, issue_description, auto_analyzed, ignore_analyzer) VALUES (132, 1, null, false, false); +INSERT INTO public.issue (issue_id, issue_type, issue_description, auto_analyzed, ignore_analyzer) +VALUES (132, 1, null, false, false); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (142, '0da5f29e-8b4d-45e6-b918-6720774a2386', '2020-02-12 16:17:59.142000', '[rp-io-7] - Start test item successfully completed +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (142, '0da5f29e-8b4d-45e6-b918-6720774a2386', '2020-02-12 16:17:59.142000', '[rp-io-7] - Start test item successfully completed ', 130, null, '2020-02-12 19:21:00.491728', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (44, '2c353d0d-405a-4326-8651-969b1fab118a', '2020-02-12 16:17:59.061000', '[rp-io-3] - Start test item successfully completed +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (44, '2c353d0d-405a-4326-8651-969b1fab118a', '2020-02-12 16:17:59.061000', '[rp-io-3] - Start test item successfully completed ', 130, null, '2020-02-12 19:20:59.326132', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (45, 'c1c07151-99b3-477c-bdfd-971f76615651', '2020-02-12 16:17:59.061000', '[rp-io-3] - Starting test item...rp-io-3 +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (45, 'c1c07151-99b3-477c-bdfd-971f76615651', '2020-02-12 16:17:59.061000', '[rp-io-3] - Starting test item...rp-io-3 ', 130, null, '2020-02-12 19:20:59.339195', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (46, '673679a3-92be-44ee-b87b-2a4abe0702a1', '2020-02-12 16:17:59.062000', '[rp-io-3] - Starting test item...rp-io-3 +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (46, '673679a3-92be-44ee-b87b-2a4abe0702a1', '2020-02-12 16:17:59.062000', '[rp-io-3] - Starting test item...rp-io-3 ', 130, null, '2020-02-12 19:20:59.351817', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (47, '95ac257a-dc8c-44f5-827f-639eb083f696', '2020-02-12 16:17:59.069000', '[rp-io-3] - Starting test item...rp-io-3 +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (47, '95ac257a-dc8c-44f5-827f-639eb083f696', '2020-02-12 16:17:59.069000', '[rp-io-3] - Starting test item...rp-io-3 ', 130, null, '2020-02-12 19:20:59.387035', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (48, '236406fe-4706-4ec5-9602-3eca7a972ab5', '2020-02-12 16:17:59.081000', '[rp-io-3] - Starting test item...rp-io-3 +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (48, '236406fe-4706-4ec5-9602-3eca7a972ab5', '2020-02-12 16:17:59.081000', '[rp-io-3] - Starting test item...rp-io-3 ', 130, null, '2020-02-12 19:20:59.400567', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (135, '19db17e3-045a-4bea-895d-ae4b68931585', '2020-02-12 16:17:59.120000', '[rp-io-6] - ReportPortal item with ID ''63fef110-d983-45ec-a6a4-6141c5e50609'' has been created +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (135, '19db17e3-045a-4bea-895d-ae4b68931585', '2020-02-12 16:17:59.120000', '[rp-io-6] - ReportPortal item with ID ''63fef110-d983-45ec-a6a4-6141c5e50609'' has been created ', 130, null, '2020-02-12 19:21:00.425099', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (136, '606c1696-14e1-4fde-9a1f-1eeed8cecf0f', '2020-02-12 16:17:59.141000', '[rp-io-3] - Starting test item...rp-io-3 +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (136, '606c1696-14e1-4fde-9a1f-1eeed8cecf0f', '2020-02-12 16:17:59.141000', '[rp-io-3] - Starting test item...rp-io-3 ', 130, null, '2020-02-12 19:21:00.432653', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (137, '0982b221-1bdd-4661-943b-bf7633fc8350', '2020-02-12 16:17:59.141000', '[rp-io-8] - ReportPortal item with ID ''ce28885c-ca32-4a1c-9ca4-5f12a5fe29b8'' has been created +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (137, '0982b221-1bdd-4661-943b-bf7633fc8350', '2020-02-12 16:17:59.141000', '[rp-io-8] - ReportPortal item with ID ''ce28885c-ca32-4a1c-9ca4-5f12a5fe29b8'' has been created ', 130, null, '2020-02-12 19:21:00.441895', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (138, '0e57bf38-4374-4d08-9790-70695aacce06', '2020-02-12 16:17:59.142000', '[rp-io-6] - Start test item successfully completed +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (138, '0e57bf38-4374-4d08-9790-70695aacce06', '2020-02-12 16:17:59.142000', '[rp-io-6] - Start test item successfully completed ', 130, null, '2020-02-12 19:21:00.452270', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (139, '7b72540e-f2a1-4d7d-a982-40353f86e492', '2020-02-12 16:17:59.142000', '[rp-io-8] - Start test item successfully completed +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (139, '7b72540e-f2a1-4d7d-a982-40353f86e492', '2020-02-12 16:17:59.142000', '[rp-io-8] - Start test item successfully completed ', 130, null, '2020-02-12 19:21:00.458125', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (140, 'f46438d9-5029-4e33-9f26-5d938f0adb8e', '2020-02-12 16:17:59.142000', '[rp-io-5] - Start test item successfully completed +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (140, 'f46438d9-5029-4e33-9f26-5d938f0adb8e', '2020-02-12 16:17:59.142000', '[rp-io-5] - Start test item successfully completed ', 130, null, '2020-02-12 19:21:00.462681', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (144, '2d469e6f-f292-43ff-8829-38abf2941906', '2020-02-12 16:17:59.939000', '[rp-io-59] - Starting test item...rp-io-59 +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (144, '2d469e6f-f292-43ff-8829-38abf2941906', '2020-02-12 16:17:59.939000', '[rp-io-59] - Starting test item...rp-io-59 ', 130, null, '2020-02-12 19:21:00.518662', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (43, '8bb0f8df-c45c-4e23-a899-cae4f6bc467c', '2020-02-12 16:17:59.060000', '[rp-io-3] - ReportPortal item with ID ''2d497d02-0925-47d5-b8cf-7a7503a95e3a'' has been created +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (43, '8bb0f8df-c45c-4e23-a899-cae4f6bc467c', '2020-02-12 16:17:59.060000', '[rp-io-3] - ReportPortal item with ID ''2d497d02-0925-47d5-b8cf-7a7503a95e3a'' has been created ', 130, null, '2020-02-12 19:20:59.314594', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (143, '51c21ea7-fb6d-4b5a-b9c4-3e7586e7cf0d', '2020-02-12 16:17:59.144000', '[rp-io-7] - Starting test item...rp-io-7 +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (143, '51c21ea7-fb6d-4b5a-b9c4-3e7586e7cf0d', '2020-02-12 16:17:59.144000', '[rp-io-7] - Starting test item...rp-io-7 ', 130, null, '2020-02-12 19:21:00.507512', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (56, 'e68e3e52-93b6-4444-a494-7eaefad0582a', '2020-02-12 16:17:59.115000', '[rp-io-5] - ReportPortal item with ID ''0d89cecd-0d60-4664-b55c-a7bf93d1d0fd'' has been created +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (56, 'e68e3e52-93b6-4444-a494-7eaefad0582a', '2020-02-12 16:17:59.115000', '[rp-io-5] - ReportPortal item with ID ''0d89cecd-0d60-4664-b55c-a7bf93d1d0fd'' has been created ', 130, null, '2020-02-12 19:20:59.482912', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (54, 'e5bc33aa-795f-416b-b4d5-f84ee3fade8c', '2020-02-12 16:17:59.098000', '[rp-io-4] - Start test item successfully completed +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (54, 'e5bc33aa-795f-416b-b4d5-f84ee3fade8c', '2020-02-12 16:17:59.098000', '[rp-io-4] - Start test item successfully completed ', 130, null, '2020-02-12 19:20:59.471961', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (52, '36102d3d-2db9-434d-8b12-d20a94cf966f', '2020-02-12 16:17:59.096000', '[rp-io-4] - ReportPortal item with ID ''d82da671-4dac-46c6-884f-01527b58a2b7'' has been created +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (52, '36102d3d-2db9-434d-8b12-d20a94cf966f', '2020-02-12 16:17:59.096000', '[rp-io-4] - ReportPortal item with ID ''d82da671-4dac-46c6-884f-01527b58a2b7'' has been created ', 130, null, '2020-02-12 19:20:59.453755', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (132, 'f280e4b6-dbc9-47f6-8a61-33a8b12b0f67', '2020-02-12 16:17:59.127000', '[rp-io-7] - ReportPortal item with ID ''9f5cf143-f0b6-4b8d-845c-6431b3ed7c98'' has been created +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (132, 'f280e4b6-dbc9-47f6-8a61-33a8b12b0f67', '2020-02-12 16:17:59.127000', '[rp-io-7] - ReportPortal item with ID ''9f5cf143-f0b6-4b8d-845c-6431b3ed7c98'' has been created ', 130, null, '2020-02-12 19:21:00.404225', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (133, '5f74f81e-2d72-4c61-af06-e303148d49bf', '2020-02-12 16:17:59.979000', 'java.lang.NullPointerException: Oops +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (133, '5f74f81e-2d72-4c61-af06-e303148d49bf', '2020-02-12 16:17:59.979000', 'java.lang.NullPointerException: Oops at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) ', 130, null, '2020-02-12 19:21:00.409335', 40000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (50, 'e731e69f-337a-45b7-a311-8dc02bc2a632', '2020-02-12 16:17:59.083000', '[rp-io-3] - Starting test item...rp-io-3 +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (50, 'e731e69f-337a-45b7-a311-8dc02bc2a632', '2020-02-12 16:17:59.083000', '[rp-io-3] - Starting test item...rp-io-3 ', 130, null, '2020-02-12 19:20:59.421944', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (62, 'cb0a02e8-bf83-4e81-8239-ed068a66bf5d', '2020-02-12 16:17:59.036000', 'java.lang.NullPointerException: Oops +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (62, 'cb0a02e8-bf83-4e81-8239-ed068a66bf5d', '2020-02-12 16:17:59.036000', 'java.lang.NullPointerException: Oops at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) ', 131, null, '2020-02-12 19:20:59.554493', 40000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (61, 'd91bf47c-8885-425f-ae68-293d15c7c88f', '2020-02-12 16:17:58.899000', '[rp-io-0] - ReportPortal launch with ID ''4c838392-ba6d-48b0-b3b2-213c3a5eeebf'' has been created +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (61, 'd91bf47c-8885-425f-ae68-293d15c7c88f', '2020-02-12 16:17:58.899000', '[rp-io-0] - ReportPortal launch with ID ''4c838392-ba6d-48b0-b3b2-213c3a5eeebf'' has been created ', 131, null, '2020-02-12 19:20:59.542107', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (58, '84da4033-b8c7-4124-90e5-7240f132fdeb', '2020-02-12 16:17:59.012000', '[rp-io-2] - Start test item successfully completed +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (58, '84da4033-b8c7-4124-90e5-7240f132fdeb', '2020-02-12 16:17:59.012000', '[rp-io-2] - Start test item successfully completed ', 132, null, '2020-02-12 19:20:59.494083', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (57, '7e514e2d-2c09-4e89-9bff-9a113d1d005a', '2020-02-12 16:17:59.012000', '[rp-io-2] - ReportPortal item with ID ''81a497ed-9889-41c7-bbf1-63c228118625'' has been created +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (57, '7e514e2d-2c09-4e89-9bff-9a113d1d005a', '2020-02-12 16:17:59.012000', '[rp-io-2] - ReportPortal item with ID ''81a497ed-9889-41c7-bbf1-63c228118625'' has been created ', 132, null, '2020-02-12 19:20:59.488275', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (53, '34072200-1894-48f6-ad21-6f62dc779ce7', '2020-02-12 16:17:58.905000', '[rp-io-0] - Launch start successfully completed +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (53, '34072200-1894-48f6-ad21-6f62dc779ce7', '2020-02-12 16:17:58.905000', '[rp-io-0] - Launch start successfully completed ', 132, null, '2020-02-12 19:20:59.460121', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (55, '3c14aa9f-8c8e-4e64-aa4c-b0fc79f1360a', '2020-02-12 16:17:58.997000', '[rp-io-17] - Logging context completed +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (55, '3c14aa9f-8c8e-4e64-aa4c-b0fc79f1360a', '2020-02-12 16:17:58.997000', '[rp-io-17] - Logging context completed ', 132, null, '2020-02-12 19:20:59.477828', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (59, 'a61a609e-b9f1-4d12-a4ae-ea98f98e2a15', '2020-02-12 16:17:59.013000', '[rp-io-2] - Starting test item...rp-io-2 +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (59, 'a61a609e-b9f1-4d12-a4ae-ea98f98e2a15', '2020-02-12 16:17:59.013000', '[rp-io-2] - Starting test item...rp-io-2 ', 132, null, '2020-02-12 19:20:59.498580', 10000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (42, 'ffc855e9-0e78-48da-bf49-c5a037a36eba', '2020-02-12 16:17:58.916000', '[main] - Main page displayed +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (42, 'ffc855e9-0e78-48da-bf49-c5a037a36eba', '2020-02-12 16:17:58.916000', '[main] - Main page displayed ', 133, null, '2020-02-12 19:20:59.305525', 20000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (51, '2b2d89bd-8ce4-4a25-b591-180276ebd08d', '2020-02-12 16:17:58.931000', '[main] - User logged in +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (51, '2b2d89bd-8ce4-4a25-b591-180276ebd08d', '2020-02-12 16:17:58.931000', '[main] - User logged in ', 134, null, '2020-02-12 19:20:59.441288', 20000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (60, 'a832ed04-1cac-4676-bf40-ae2e9ccfe734', '2020-02-12 16:17:58.935000', '[main] - Products page opened +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (60, 'a832ed04-1cac-4676-bf40-ae2e9ccfe734', '2020-02-12 16:17:58.935000', '[main] - Products page opened ', 135, null, '2020-02-12 19:20:59.513959', 20000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (49, '302e659a-f67f-410d-b28a-e65766d2a1e6', '2020-02-12 16:17:59.004000', '[main] - Successful payment +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (49, '302e659a-f67f-410d-b28a-e65766d2a1e6', '2020-02-12 16:17:59.004000', '[main] - Successful payment ', 137, null, '2020-02-12 19:20:59.409029', 20000, null, 1); -INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) VALUES (63, '3e6e5b42-9311-4417-afd4-f63241c55660', '2020-02-12 16:17:59.217000', 'java.lang.NullPointerException: Oops +INSERT INTO public.log (id, uuid, log_time, log_message, item_id, launch_id, last_modified, + log_level, attachment_id, project_id) +VALUES (63, '3e6e5b42-9311-4417-afd4-f63241c55660', '2020-02-12 16:17:59.217000', 'java.lang.NullPointerException: Oops at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) diff --git a/src/test/resources/db/fill/launch/launch-fill.sql b/src/test/resources/db/fill/launch/launch-fill.sql index f2f0f8ae9..2572d7d82 100644 --- a/src/test/resources/db/fill/launch/launch-fill.sql +++ b/src/test/resources/db/fill/launch/launch-fill.sql @@ -3,16 +3,19 @@ alter sequence test_item_item_id_seq restart with 1; SELECT launches_init(); -INSERT INTO public.launch(id, uuid, project_id, user_id, name, start_time, end_time, last_modified, mode, status) +INSERT INTO public.launch(id, uuid, project_id, user_id, name, start_time, end_time, last_modified, + mode, status) VALUES (100, 'uuid', 2, 2, 'finished launch', now(), now(), now(), 'DEFAULT', 'FAILED'); -INSERT INTO public.test_item(test_case_hash, item_id, uuid, type, start_time, last_modified, has_children, has_retries, parent_id, launch_id) +INSERT INTO public.test_item(test_case_hash, item_id, uuid, type, start_time, last_modified, + has_children, has_retries, parent_id, launch_id) VALUES (1, 1, 'uuid1', 'STEP', now(), now(), false, false, null, 100); INSERT INTO public.test_item_results(result_id, status, end_time, duration) VALUES (1, 'PASSED', now(), 1); -INSERT INTO public.test_item(test_case_hash, item_id, uuid, type, start_time, last_modified, has_children, has_retries, parent_id, launch_id) +INSERT INTO public.test_item(test_case_hash, item_id, uuid, type, start_time, last_modified, + has_children, has_retries, parent_id, launch_id) VALUES (2, 2, 'uuid2', 'STEP', now(), now(), false, true, null, 100); INSERT INTO public.test_item_results(result_id, status, end_time, duration) @@ -21,21 +24,26 @@ VALUES (2, 'FAILED', now(), 1); INSERT INTO public.issue(issue_id, issue_type, issue_description) VALUES (2, 1, 'fail'); -INSERT INTO public.log(uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) +INSERT INTO public.log(uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, + attachment_id, project_id) VALUES ('log uid', now(), 'message', 2, null, now(), 40000, null, 2); -INSERT INTO public.launch(id, uuid, project_id, user_id, name, start_time, end_time, last_modified, mode, status) +INSERT INTO public.launch(id, uuid, project_id, user_id, name, start_time, end_time, last_modified, + mode, status) VALUES (200, 'uuid3', 2, 2, 'finished launch', now(), now(), now(), 'DEFAULT', 'FAILED'); -INSERT INTO public.test_item(test_case_hash, item_id, uuid, type, start_time, last_modified, has_children, has_retries, parent_id, launch_id) +INSERT INTO public.test_item(test_case_hash, item_id, uuid, type, start_time, last_modified, + has_children, has_retries, parent_id, launch_id) VALUES (3, 3, 'uuid4', 'STEP', now(), now(), false, false, null, 200); INSERT INTO public.test_item_results(result_id, status, end_time, duration) VALUES (3, 'IN_PROGRESS', now(), 1); -INSERT INTO public.log(uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, attachment_id, project_id) +INSERT INTO public.log(uuid, log_time, log_message, item_id, launch_id, last_modified, log_level, + attachment_id, project_id) VALUES ('log uid', now(), 'message', 3, null, now(), 40000, null, 2); -INSERT INTO public.launch(id, uuid, project_id, user_id, name, start_time, end_time, last_modified, mode, status) +INSERT INTO public.launch(id, uuid, project_id, user_id, name, start_time, end_time, last_modified, + mode, status) VALUES (300, 'uuid5', 2, 2, 'finished launch', now(), now(), now(), 'DEFAULT', 'FAILED'); \ No newline at end of file diff --git a/src/test/resources/db/fill/launch/launch-filtering-data.sql b/src/test/resources/db/fill/launch/launch-filtering-data.sql index bc2eea10b..14acbff58 100644 --- a/src/test/resources/db/fill/launch/launch-filtering-data.sql +++ b/src/test/resources/db/fill/launch/launch-filtering-data.sql @@ -1,14 +1,21 @@ alter sequence launch_id_seq restart with 1; -INSERT INTO launch(id, uuid, project_id, user_id, name, start_time, end_time, last_modified, mode, status) +INSERT INTO launch(id, uuid, project_id, user_id, name, start_time, end_time, last_modified, mode, + status) VALUES (1, 'uuid-1', 2, 2, 'launch 1', now(), now(), now(), 'DEFAULT', 'FAILED'); -INSERT INTO item_attribute(key, value, launch_id) VALUES ('key1', 'value1', 1); -INSERT INTO item_attribute(key, value, launch_id) VALUES ('key2', 'value2', 1); -INSERT INTO item_attribute(key, value, launch_id) VALUES ('key3', 'value3', 1); +INSERT INTO item_attribute(key, value, launch_id) +VALUES ('key1', 'value1', 1); +INSERT INTO item_attribute(key, value, launch_id) +VALUES ('key2', 'value2', 1); +INSERT INTO item_attribute(key, value, launch_id) +VALUES ('key3', 'value3', 1); -INSERT INTO launch(id, uuid, project_id, user_id, name, start_time, end_time, last_modified, mode, status) +INSERT INTO launch(id, uuid, project_id, user_id, name, start_time, end_time, last_modified, mode, + status) VALUES (2, 'uuid-2', 2, 2, 'launch 2', now(), now(), now(), 'DEFAULT', 'FAILED'); -INSERT INTO item_attribute(key, value, launch_id) VALUES ('key1', 'value1', 2); -INSERT INTO item_attribute(key, value, launch_id) VALUES ('key2', 'value2', 2); +INSERT INTO item_attribute(key, value, launch_id) +VALUES ('key1', 'value1', 2); +INSERT INTO item_attribute(key, value, launch_id) +VALUES ('key2', 'value2', 2); diff --git a/src/test/resources/db/fill/pattern/pattern-fill.sql b/src/test/resources/db/fill/pattern/pattern-fill.sql index d36fa749a..914dcd524 100644 --- a/src/test/resources/db/fill/pattern/pattern-fill.sql +++ b/src/test/resources/db/fill/pattern/pattern-fill.sql @@ -1,5 +1,10 @@ -INSERT INTO pattern_template (id, name, value, type, enabled, project_id) VALUES (1,'name1', 'qwe', 'STRING', true, 1); -INSERT INTO pattern_template (id, name, value, type, enabled, project_id) VALUES (2,'name2', 'qw', 'STRING', true, 1); -INSERT INTO pattern_template (id, name, value, type, enabled, project_id) VALUES (3,'name3', 'qwee', 'STRING', false, 1); -INSERT INTO pattern_template (id, name, value, type, enabled, project_id) VALUES (4,'name4', '[a-z]{2,4}', 'REGEX', false, 1); -INSERT INTO pattern_template (id, name, value, type, enabled, project_id) VALUES (5,'name5_p2', '^*+', 'REGEX', true, 2); \ No newline at end of file +INSERT INTO pattern_template (id, name, value, type, enabled, project_id) +VALUES (1, 'name1', 'qwe', 'STRING', true, 1); +INSERT INTO pattern_template (id, name, value, type, enabled, project_id) +VALUES (2, 'name2', 'qw', 'STRING', true, 1); +INSERT INTO pattern_template (id, name, value, type, enabled, project_id) +VALUES (3, 'name3', 'qwee', 'STRING', false, 1); +INSERT INTO pattern_template (id, name, value, type, enabled, project_id) +VALUES (4, 'name4', '[a-z]{2,4}', 'REGEX', false, 1); +INSERT INTO pattern_template (id, name, value, type, enabled, project_id) +VALUES (5, 'name5_p2', '^*+', 'REGEX', true, 2); \ No newline at end of file diff --git a/src/test/resources/db/fill/project/expired-project-fill.sql b/src/test/resources/db/fill/project/expired-project-fill.sql index 9a0396555..b14d70d8b 100644 --- a/src/test/resources/db/fill/project/expired-project-fill.sql +++ b/src/test/resources/db/fill/project/expired-project-fill.sql @@ -1,7 +1,11 @@ insert into project(id, name, project_type, creation_date) values (100, 'toDelete', 'UPSA', now() - make_interval(days := 14)); -insert into launch(uuid, project_id, user_id, name, start_time, number, last_modified, mode, status, has_retries) -values ('uuid1', 100, 1, 'testLaunch1', now() - make_interval(days := 13), 1, now(), 'DEFAULT', 'FAILED', false), - ('uuid2', 100, 1, 'testLaunch2', now() - make_interval(days := 12), 1, now(), 'DEFAULT', 'FAILED', false), - ('uuid3', 100, 1, 'testLaunch3', now() - make_interval(days := 11), 1, now(), 'DEFAULT', 'FAILED', false); \ No newline at end of file +insert into launch(uuid, project_id, user_id, name, start_time, number, last_modified, mode, status, + has_retries) +values ('uuid1', 100, 1, 'testLaunch1', now() - make_interval(days := 13), 1, now(), 'DEFAULT', + 'FAILED', false), + ('uuid2', 100, 1, 'testLaunch2', now() - make_interval(days := 12), 1, now(), 'DEFAULT', + 'FAILED', false), + ('uuid3', 100, 1, 'testLaunch3', now() - make_interval(days := 11), 1, now(), 'DEFAULT', + 'FAILED', false); \ No newline at end of file diff --git a/src/test/resources/db/fill/sendercase/sender-case-fill.sql b/src/test/resources/db/fill/sendercase/sender-case-fill.sql index 73ce2d265..0bdc4a0d7 100644 --- a/src/test/resources/db/fill/sendercase/sender-case-fill.sql +++ b/src/test/resources/db/fill/sendercase/sender-case-fill.sql @@ -3,8 +3,10 @@ alter sequence sender_case_id_seq INSERT INTO sender_case (id, rule_name, send_case, project_id, enabled) VALUES (1, 'Rule1', 'ALWAYS', 1, true); -INSERT INTO recipients(sender_case_id, recipient) VALUES (1, 'first'); -INSERT INTO recipients(sender_case_id, recipient) VALUES (1, 'second'); +INSERT INTO recipients(sender_case_id, recipient) +VALUES (1, 'first'); +INSERT INTO recipients(sender_case_id, recipient) +VALUES (1, 'second'); INSERT INTO sender_case (id, rule_name, send_case, project_id, enabled) VALUES (2, 'Rule2', 'ALWAYS', 1, true); diff --git a/src/test/resources/db/fill/shareable/shareable-fill.sql b/src/test/resources/db/fill/shareable/shareable-fill.sql index 849d5216a..b202fcfa8 100644 --- a/src/test/resources/db/fill/shareable/shareable-fill.sql +++ b/src/test/resources/db/fill/shareable/shareable-fill.sql @@ -1,80 +1,91 @@ -DELETE FROM public.users WHERE id = 3; - -INSERT INTO public.users (id, login, password, email, attachment, attachment_thumbnail, role, type, expired, full_name, metadata) -VALUES (3, 'jaja_user', '7c381f9d81b0e438af4e7094c6cae203', 'jaja@mail.com', null, null, 'USER', 'INTERNAL', false, 'Jaja Juja', '{"metadata": {"last_login": 1546605767372}}'); - -INSERT INTO public.project_user (user_id, project_id, project_role) VALUES (3, 1, 'MEMBER'); - -INSERT INTO public.shareable_entity (id, shared, owner, project_id) VALUES -(1, false, 'superadmin', 1), -(2, true, 'superadmin', 1), -(3, false, 'default', 2), -(4, true, 'default', 2), -(5, true, 'superadmin', 1), -(6, false, 'superadmin', 1), -(7, true, 'superadmin', 1), -(8, true, 'jaja_user', 1), -(9, false, 'jaja_user', 1), -(10, false, 'default', 2), -(11, false, 'default', 2), -(12, true, 'default', 2), -(13, true, 'superadmin', 1), -(14, false, 'superadmin', 1), -(15, true, 'jaja_user', 1), -(16, false, 'jaja_user', 1), -(17, true, 'default', 2), -(18, false, 'default', 2); - -INSERT INTO public.filter (id, name, target, description) VALUES -(1, 'Admin Filter', 'Launch', null), -(2, 'Admin Shared Filter', 'Launch', null), -(3, 'Default Filter', 'Launch', null), -(4, 'Default Shared Filter', 'Launch', null); - -INSERT INTO public.filter_sort (id, filter_id, field, direction) VALUES -(1, 1, 'name', 'ASC'), -(2, 2, 'name', 'DESC'), -(3, 3, 'name', 'ASC'), -(4, 4, 'name', 'DESC'); - -INSERT INTO public.filter_condition (id, filter_id, condition, value, search_criteria, negative) VALUES -(1, 1, 'CONTAINS', 'asdf', 'name', false), -(2, 2, 'EQUALS', 'test', 'description', false), -(3, 3, 'EQUALS', 'juja', 'name', false), -(4, 4, 'EQUALS', 'qwerty', 'name', false); - -INSERT INTO public.widget (id, name, description, widget_type, items_count, widget_options) VALUES -(5, 'activity stream12', null, 'activityStream', 50, '{"options": {"user": "superadmin", "actionType": ["startLaunch", "finishLaunch"]}}'), -(7, 'INVESTIGATED PERCENTAGE OF LAUNCHES', null, 'investigatedTrend', 10, '{"options": {"timeline": "DAY"}}'), -(6, 'LAUNCH STATISTICS', null, 'launchStatistics', 10, '{"options": {"timeline": "WEEK"}}'), -(8, 'TEST CASES GROWTH TREND CHART', null, 'casesTrend', 10, '{"options": {}}'), -(9, 'LAUNCHES DURATION CHART', null, 'launchesDurationChart', 10, '{"options": {}}'), -(12, 'ACTIVITY STREAM', null, 'activityStream', 10, '{"options": {"user": "default", "actionType": ["startLaunch", "finishLaunch", "deleteLaunch"]}}'), -(10, 'FAILED CASES TREND CHART', null, 'bugTrend', 10, '{"options": {}}'), -(11, 'LAUNCH STATISTICS', null, 'launchStatistics', 10, '{"options": {"timeline": "WEEK"}}'); - -INSERT INTO public.content_field(id, field) VALUES (6, 'statistics$product_bug$pb001'); - -INSERT INTO public.widget_filter (widget_id, filter_id) VALUES -(6, 1), -(7, 2), -(8, 2), -(10, 3), -(11, 3); - -INSERT INTO public.dashboard (id, name, description, creation_date) VALUES -(13, 'test admin dashboard', 'admin shared dashboard', '2019-01-10 13:01:06.083000'), -(14, 'test admin private dashboard', 'admin dashboard', '2019-01-10 13:01:19.259000'), -(15, 'test jaja shared dashboard', 'jaja dashboard', '2019-01-10 13:01:51.417000'), -(16, 'test jaja private dashboard', 'jaja dashboard', '2019-01-10 13:01:59.015000'), -(17, 'test default shared dashboard', 'default dashboard', '2019-01-10 13:02:20.397000'), -(18, 'test default private dashboard', 'default dashboard', '2019-01-10 13:02:27.659000'); - -INSERT INTO public.dashboard_widget (dashboard_id, widget_id, widget_name, widget_owner, widget_type, widget_width, widget_height, +DELETE +FROM public.users +WHERE id = 3; + +INSERT INTO public.users (id, login, password, email, attachment, attachment_thumbnail, role, type, + expired, full_name, metadata) +VALUES (3, 'jaja_user', '7c381f9d81b0e438af4e7094c6cae203', 'jaja@mail.com', null, null, 'USER', + 'INTERNAL', false, 'Jaja Juja', '{"metadata": {"last_login": 1546605767372}}'); + +INSERT INTO public.project_user (user_id, project_id, project_role) +VALUES (3, 1, 'MEMBER'); + +INSERT INTO public.shareable_entity (id, shared, owner, project_id) +VALUES (1, false, 'superadmin', 1), + (2, true, 'superadmin', 1), + (3, false, 'default', 2), + (4, true, 'default', 2), + (5, true, 'superadmin', 1), + (6, false, 'superadmin', 1), + (7, true, 'superadmin', 1), + (8, true, 'jaja_user', 1), + (9, false, 'jaja_user', 1), + (10, false, 'default', 2), + (11, false, 'default', 2), + (12, true, 'default', 2), + (13, true, 'superadmin', 1), + (14, false, 'superadmin', 1), + (15, true, 'jaja_user', 1), + (16, false, 'jaja_user', 1), + (17, true, 'default', 2), + (18, false, 'default', 2); + +INSERT INTO public.filter (id, name, target, description) +VALUES (1, 'Admin Filter', 'Launch', null), + (2, 'Admin Shared Filter', 'Launch', null), + (3, 'Default Filter', 'Launch', null), + (4, 'Default Shared Filter', 'Launch', null); + +INSERT INTO public.filter_sort (id, filter_id, field, direction) +VALUES (1, 1, 'name', 'ASC'), + (2, 2, 'name', 'DESC'), + (3, 3, 'name', 'ASC'), + (4, 4, 'name', 'DESC'); + +INSERT INTO public.filter_condition (id, filter_id, condition, value, search_criteria, negative) +VALUES (1, 1, 'CONTAINS', 'asdf', 'name', false), + (2, 2, 'EQUALS', 'test', 'description', false), + (3, 3, 'EQUALS', 'juja', 'name', false), + (4, 4, 'EQUALS', 'qwerty', 'name', false); + +INSERT INTO public.widget (id, name, description, widget_type, items_count, widget_options) +VALUES (5, 'activity stream12', null, 'activityStream', 50, + '{"options": {"user": "superadmin", "actionType": ["startLaunch", "finishLaunch"]}}'), + (7, 'INVESTIGATED PERCENTAGE OF LAUNCHES', null, 'investigatedTrend', 10, + '{"options": {"timeline": "DAY"}}'), + (6, 'LAUNCH STATISTICS', null, 'launchStatistics', 10, '{"options": {"timeline": "WEEK"}}'), + (8, 'TEST CASES GROWTH TREND CHART', null, 'casesTrend', 10, '{"options": {}}'), + (9, 'LAUNCHES DURATION CHART', null, 'launchesDurationChart', 10, '{"options": {}}'), + (12, 'ACTIVITY STREAM', null, 'activityStream', 10, + '{"options": {"user": "default", "actionType": ["startLaunch", "finishLaunch", "deleteLaunch"]}}'), + (10, 'FAILED CASES TREND CHART', null, 'bugTrend', 10, '{"options": {}}'), + (11, 'LAUNCH STATISTICS', null, 'launchStatistics', 10, '{"options": {"timeline": "WEEK"}}'); + +INSERT INTO public.content_field(id, field) +VALUES (6, 'statistics$product_bug$pb001'); + +INSERT INTO public.widget_filter (widget_id, filter_id) +VALUES (6, 1), + (7, 2), + (8, 2), + (10, 3), + (11, 3); + +INSERT INTO public.dashboard (id, name, description, creation_date) +VALUES (13, 'test admin dashboard', 'admin shared dashboard', '2019-01-10 13:01:06.083000'), + (14, 'test admin private dashboard', 'admin dashboard', '2019-01-10 13:01:19.259000'), + (15, 'test jaja shared dashboard', 'jaja dashboard', '2019-01-10 13:01:51.417000'), + (16, 'test jaja private dashboard', 'jaja dashboard', '2019-01-10 13:01:59.015000'), + (17, 'test default shared dashboard', 'default dashboard', '2019-01-10 13:02:20.397000'), + (18, 'test default private dashboard', 'default dashboard', '2019-01-10 13:02:27.659000'); + +INSERT INTO public.dashboard_widget (dashboard_id, widget_id, widget_name, widget_owner, + widget_type, widget_width, widget_height, widget_position_x, widget_position_y) VALUES (13, 5, 'activity stream12', 'superadmin', 'activityStream', 5, 5, 0, 0), - (13, 7, 'INVESTIGATED PERCENTAGE OF LAUNCHES', 'superadmin', 'investigatedTrend', 6, 3, 0, 0), + (13, 7, 'INVESTIGATED PERCENTAGE OF LAUNCHES', 'superadmin', 'investigatedTrend', 6, 3, 0, + 0), (14, 5, 'activity stream12', 'superadmin', 'activityStream', 5, 5, 0, 0), (14, 6, 'LAUNCH STATISTICS', 'superadmin', 'launchStatistics', 4, 6, 0, 0), (15, 8, 'TEST CASES GROWTH TREND CHART', 'jaja_user', 'topTestCases', 7, 3, 0, 0), @@ -83,60 +94,66 @@ VALUES (13, 5, 'activity stream12', 'superadmin', 'activityStream', 5, 5, 0, 0), (18, 10, 'FAILED CASES TREND CHART', 'default', 'topTestCases', 6, 5, 0, 0), (18, 11, 'LAUNCH STATISTICS', 'default', 'launchStatistics', 5, 5, 0, 0); -INSERT INTO public.acl_sid (id, principal, sid) VALUES -(1, true, 'superadmin'), -(2, true, 'jaja_user'), -(3, true, 'default'); - -INSERT INTO public.acl_class (id, class, class_id_type) VALUES -(1, 'com.epam.ta.reportportal.entity.filter.UserFilter', 'java.lang.Long'), -(2, 'com.epam.ta.reportportal.entity.widget.Widget', 'java.lang.Long'), -(3, 'com.epam.ta.reportportal.entity.dashboard.Dashboard', 'java.lang.Long'); - -INSERT INTO public.acl_object_identity (id, object_id_class, object_id_identity, parent_object, owner_sid, entries_inheriting) VALUES -(1, 1, '1', null, 1, true), -(2, 1, '2', null, 1, true), -(3, 1, '3', null, 3, true), -(4, 1, '4', null, 3, true), -(5, 2, '5', null, 1, true), -(6, 2, '6', null, 1, true), -(7, 2, '7', null, 1, true), -(8, 2, '8', null, 2, true), -(9, 2, '9', null, 2, true), -(10, 2, '10', null, 3, true), -(11, 2, '11', null, 3, true), -(12, 2, '12', null, 3, true), -(13, 3, '13', null, 1, true), -(14, 3, '14', null, 1, true), -(15, 3, '15', null, 2, true), -(16, 3, '16', null, 2, true), -(17, 3, '17', null, 3, true), -(18, 3, '18', null, 3, true); - -INSERT INTO public.acl_entry (id, acl_object_identity, ace_order, sid, mask, granting, audit_success, audit_failure) VALUES -(1, 1, 0, 1, 16, true, false, false), -(3, 2, 0, 2, 1, true, false, false), -(4, 2, 1, 1, 16, true, false, false), -(5, 3, 0, 3, 16, true, false, false), -(6, 4, 0, 3, 16, true, false, false), -(8, 5, 0, 2, 1, true, false, false), -(9, 5, 1, 1, 16, true, false, false), -(10, 6, 0, 1, 16, true, false, false), -(12, 7, 0, 2, 1, true, false, false), -(13, 7, 1, 1, 16, true, false, false), -(15, 8, 0, 1, 1, true, false, false), -(16, 8, 1, 2, 16, true, false, false), -(17, 9, 0, 2, 16, true, false, false), -(18, 10, 0, 3, 16, true, false, false), -(19, 11, 0, 3, 16, true, false, false), -(20, 12, 0, 3, 16, true, false, false), -(22, 13, 0, 2, 1, true, false, false), -(23, 13, 1, 1, 16, true, false, false), -(24, 14, 0, 1, 16, true, false, false), -(26, 15, 0, 1, 1, true, false, false), -(27, 15, 1, 2, 16, true, false, false), -(28, 16, 0, 2, 16, true, false, false), -(29, 17, 0, 3, 16, true, false, false), -(30, 18, 0, 3, 16, true, false, false); - -INSERT INTO public.user_preference(project_id, user_id, filter_id) VALUES (1, 1, 1), (1, 1, 2), (1, 3, 2), (2, 2, 3); \ No newline at end of file +INSERT INTO public.acl_sid (id, principal, sid) +VALUES (1, true, 'superadmin'), + (2, true, 'jaja_user'), + (3, true, 'default'); + +INSERT INTO public.acl_class (id, class, class_id_type) +VALUES (1, 'com.epam.ta.reportportal.entity.filter.UserFilter', 'java.lang.Long'), + (2, 'com.epam.ta.reportportal.entity.widget.Widget', 'java.lang.Long'), + (3, 'com.epam.ta.reportportal.entity.dashboard.Dashboard', 'java.lang.Long'); + +INSERT INTO public.acl_object_identity (id, object_id_class, object_id_identity, parent_object, + owner_sid, entries_inheriting) +VALUES (1, 1, '1', null, 1, true), + (2, 1, '2', null, 1, true), + (3, 1, '3', null, 3, true), + (4, 1, '4', null, 3, true), + (5, 2, '5', null, 1, true), + (6, 2, '6', null, 1, true), + (7, 2, '7', null, 1, true), + (8, 2, '8', null, 2, true), + (9, 2, '9', null, 2, true), + (10, 2, '10', null, 3, true), + (11, 2, '11', null, 3, true), + (12, 2, '12', null, 3, true), + (13, 3, '13', null, 1, true), + (14, 3, '14', null, 1, true), + (15, 3, '15', null, 2, true), + (16, 3, '16', null, 2, true), + (17, 3, '17', null, 3, true), + (18, 3, '18', null, 3, true); + +INSERT INTO public.acl_entry (id, acl_object_identity, ace_order, sid, mask, granting, + audit_success, audit_failure) +VALUES (1, 1, 0, 1, 16, true, false, false), + (3, 2, 0, 2, 1, true, false, false), + (4, 2, 1, 1, 16, true, false, false), + (5, 3, 0, 3, 16, true, false, false), + (6, 4, 0, 3, 16, true, false, false), + (8, 5, 0, 2, 1, true, false, false), + (9, 5, 1, 1, 16, true, false, false), + (10, 6, 0, 1, 16, true, false, false), + (12, 7, 0, 2, 1, true, false, false), + (13, 7, 1, 1, 16, true, false, false), + (15, 8, 0, 1, 1, true, false, false), + (16, 8, 1, 2, 16, true, false, false), + (17, 9, 0, 2, 16, true, false, false), + (18, 10, 0, 3, 16, true, false, false), + (19, 11, 0, 3, 16, true, false, false), + (20, 12, 0, 3, 16, true, false, false), + (22, 13, 0, 2, 1, true, false, false), + (23, 13, 1, 1, 16, true, false, false), + (24, 14, 0, 1, 16, true, false, false), + (26, 15, 0, 1, 1, true, false, false), + (27, 15, 1, 2, 16, true, false, false), + (28, 16, 0, 2, 16, true, false, false), + (29, 17, 0, 3, 16, true, false, false), + (30, 18, 0, 3, 16, true, false, false); + +INSERT INTO public.user_preference(project_id, user_id, filter_id) +VALUES (1, 1, 1), + (1, 1, 2), + (1, 3, 2), + (2, 2, 3); \ No newline at end of file diff --git a/src/test/resources/db/fill/ticket/ticket-fill.sql b/src/test/resources/db/fill/ticket/ticket-fill.sql index 5be9c715c..9cb425d96 100644 --- a/src/test/resources/db/fill/ticket/ticket-fill.sql +++ b/src/test/resources/db/fill/ticket/ticket-fill.sql @@ -1,7 +1,10 @@ INSERT INTO ticket (id, ticket_id, submitter, submit_date, bts_url, bts_project, url) -VALUES (1, 'ticket_id_1', 'superadmin', now(), 'jira.com', 'project', 'http://example.com/tickets/ticket_id_1'), - (2, 'ticket_id_2', 'superadmin', now() - INTERVAL '2 day', 'jira.com', 'project', 'http://example.com/tickets/ticket_id_2'), - (3, 'ticket_id_3', 'superadmin', now() - INTERVAL '4 day', 'jira.com', 'project', 'http://example.com/tickets/ticket_id_3'); +VALUES (1, 'ticket_id_1', 'superadmin', now(), 'jira.com', 'project', + 'http://example.com/tickets/ticket_id_1'), + (2, 'ticket_id_2', 'superadmin', now() - INTERVAL '2 day', 'jira.com', 'project', + 'http://example.com/tickets/ticket_id_2'), + (3, 'ticket_id_3', 'superadmin', now() - INTERVAL '4 day', 'jira.com', 'project', + 'http://example.com/tickets/ticket_id_3'); INSERT INTO launch(uuid, project_id, user_id, name, start_time, last_modified, mode, status) VALUES ('uuid', 1, 1, 'launch', now(), now(), 'DEFAULT', 'FAILED'); diff --git a/src/test/resources/db/fill/user-bid/user-bid-fill.sql b/src/test/resources/db/fill/user-bid/user-bid-fill.sql index d4bb453dc..81ba42f38 100644 --- a/src/test/resources/db/fill/user-bid/user-bid-fill.sql +++ b/src/test/resources/db/fill/user-bid/user-bid-fill.sql @@ -1,16 +1,19 @@ INSERT INTO user_creation_bid(uuid, last_modified, email, project_name, role, metadata) -VALUES ('0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb', now(), 'superadminemail@domain.com', 1, 'PROJECT_MANAGER', '{ +VALUES ('0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb', now(), 'superadminemail@domain.com', 1, + 'PROJECT_MANAGER', '{ "metadata": { "type": "internal" } }'), - ('6cb0ce2a-e974-44d8-ae78-d86baa38c356', now() - interval '30 day', 'defaultemail@domain.com', 2, 'PROJECT_MANAGER', '{ + ('6cb0ce2a-e974-44d8-ae78-d86baa38c356', now() - interval '30 day', + 'defaultemail@domain.com', 2, 'PROJECT_MANAGER', '{ "metadata": { "type": "internal" } }'), - ('04ff29db-88ef-44c9-9273-5701f6969127', now() - interval '1 day', 'defaultemail@domain.com', 1, 'MEMBER', '{ + ('04ff29db-88ef-44c9-9273-5701f6969127', now() - interval '1 day', 'defaultemail@domain.com', + 1, 'MEMBER', '{ "metadata": { "type": "internal" } diff --git a/src/test/resources/db/migration/V001003__test_project_init.sql b/src/test/resources/db/migration/V001003__test_project_init.sql index 23a6c30c7..2c66ba0a2 100644 --- a/src/test/resources/db/migration/V001003__test_project_init.sql +++ b/src/test/resources/db/migration/V001003__test_project_init.sql @@ -1,56 +1,63 @@ CREATE OR REPLACE FUNCTION test_project_init() - RETURNS VOID AS + RETURNS VOID AS $$ DECLARE - falcon BIGINT; - han_solo BIGINT; - chubaka BIGINT; - fake_chubaka BIGINT; + falcon BIGINT; + han_solo BIGINT; + chubaka BIGINT; + fake_chubaka BIGINT; BEGIN - alter sequence project_id_seq restart with 3; + alter sequence project_id_seq restart with 3; - INSERT INTO project (name, project_type, creation_date) VALUES ('millennium_falcon', 'INTERNAL', now()); - falcon := (SELECT currval(pg_get_serial_sequence('project', 'id'))); + INSERT INTO project (name, project_type, creation_date) + VALUES ('millennium_falcon', 'INTERNAL', now()); + falcon := (SELECT currval(pg_get_serial_sequence('project', 'id'))); - INSERT INTO users (login, password, email, role, type, full_name, expired, metadata) - VALUES ('han_solo', '3531f6f9b0538fd347f4c95bd2af9d01', 'han_solo@domain.com', 'ADMINISTRATOR', 'INTERNAL', 'Han Solo', FALSE, - '{"metadata": {"last_login": "1551187023768"}}'); - han_solo := (SELECT currval(pg_get_serial_sequence('users', 'id'))); + INSERT INTO users (login, password, email, role, type, full_name, expired, metadata) + VALUES ('han_solo', '3531f6f9b0538fd347f4c95bd2af9d01', 'han_solo@domain.com', 'ADMINISTRATOR', + 'INTERNAL', 'Han Solo', FALSE, + '{"metadata": {"last_login": "1551187023768"}}'); + han_solo := (SELECT currval(pg_get_serial_sequence('users', 'id'))); - INSERT INTO project_user (user_id, project_id, project_role) VALUES (han_solo, falcon, 'PROJECT_MANAGER'); + INSERT INTO project_user (user_id, project_id, project_role) + VALUES (han_solo, falcon, 'PROJECT_MANAGER'); - INSERT INTO users (login, password, email, role, type, full_name, expired, metadata) - VALUES ('chubaka', '601c4731aeff3b84f76672ad024bb2a0', 'chybaka@domain.com', 'USER', 'INTERNAL', 'Chubaka', FALSE, - '{"metadata": {"last_login": "1551187023768"}}'); - chubaka := (SELECT currval(pg_get_serial_sequence('users', 'id'))); + INSERT INTO users (login, password, email, role, type, full_name, expired, metadata) + VALUES ('chubaka', '601c4731aeff3b84f76672ad024bb2a0', 'chybaka@domain.com', 'USER', 'INTERNAL', + 'Chubaka', FALSE, + '{"metadata": {"last_login": "1551187023768"}}'); + chubaka := (SELECT currval(pg_get_serial_sequence('users', 'id'))); - INSERT INTO project_user (user_id, project_id, project_role) VALUES (chubaka, falcon, 'MEMBER'); + INSERT INTO project_user (user_id, project_id, project_role) VALUES (chubaka, falcon, 'MEMBER'); - INSERT INTO users (login, password, email, role, type, full_name, expired, metadata) - VALUES ('fake_chubaka', '601c4731aeff3b84f76672ad024bb2a0', 'chybakafake@domain.com', 'USER', 'INTERNAL', 'Chubaka Fake', FALSE, - '{"metadata": {"last_login": "1551187023768"}}'); - fake_chubaka := (SELECT currval(pg_get_serial_sequence('users', 'id'))); + INSERT INTO users (login, password, email, role, type, full_name, expired, metadata) + VALUES ('fake_chubaka', '601c4731aeff3b84f76672ad024bb2a0', 'chybakafake@domain.com', 'USER', + 'INTERNAL', 'Chubaka Fake', FALSE, + '{"metadata": {"last_login": "1551187023768"}}'); + fake_chubaka := (SELECT currval(pg_get_serial_sequence('users', 'id'))); - INSERT INTO project_user (user_id, project_id, project_role) VALUES (fake_chubaka, falcon, 'MEMBER'); + INSERT INTO project_user (user_id, project_id, project_role) + VALUES (fake_chubaka, falcon, 'MEMBER'); - INSERT INTO users (login, password, email, role, type, full_name, expired, metadata) - VALUES ('ch_not_assigned', '601c4731aeff3b84f76672ad024bb2a0', 'ch_not_assigned@domain.com', 'USER', 'INTERNAL', 'Ch Not Assigned', FALSE, - '{"metadata": {"last_login": "1551187023768"}}'); + INSERT INTO users (login, password, email, role, type, full_name, expired, metadata) + VALUES ('ch_not_assigned', '601c4731aeff3b84f76672ad024bb2a0', 'ch_not_assigned@domain.com', + 'USER', 'INTERNAL', 'Ch Not Assigned', FALSE, + '{"metadata": {"last_login": "1551187023768"}}'); - INSERT INTO issue_type_project (project_id, issue_type_id) - VALUES (falcon, 1), - (falcon, 2), - (falcon, 3), - (falcon, 4), - (falcon, 5); + INSERT INTO issue_type_project (project_id, issue_type_id) + VALUES (falcon, 1), + (falcon, 2), + (falcon, 3), + (falcon, 4), + (falcon, 5); - INSERT INTO project_attribute (project_id, attribute_id, value) VALUES (falcon, 1, '1 hour'); - INSERT INTO project_attribute (project_id, attribute_id, value) VALUES (falcon, 2, '2 weeks'); - INSERT INTO project_attribute (project_id, attribute_id, value) VALUES (falcon, 3, '2 weeks'); - INSERT INTO project_attribute (project_id, attribute_id, value) VALUES (falcon, 4, '2 weeks'); + INSERT INTO project_attribute (project_id, attribute_id, value) VALUES (falcon, 1, '1 hour'); + INSERT INTO project_attribute (project_id, attribute_id, value) VALUES (falcon, 2, '2 weeks'); + INSERT INTO project_attribute (project_id, attribute_id, value) VALUES (falcon, 3, '2 weeks'); + INSERT INTO project_attribute (project_id, attribute_id, value) VALUES (falcon, 4, '2 weeks'); END; $$ - LANGUAGE plpgsql; \ No newline at end of file + LANGUAGE plpgsql; \ No newline at end of file diff --git a/src/test/resources/db/migration/V001004__items_init.sql b/src/test/resources/db/migration/V001004__items_init.sql index a8de6ee52..cdd716b15 100644 --- a/src/test/resources/db/migration/V001004__items_init.sql +++ b/src/test/resources/db/migration/V001004__items_init.sql @@ -24,19 +24,27 @@ BEGIN alter sequence pattern_template_id_seq restart with 1; - INSERT INTO pattern_template (id, name, value, type, enabled, project_id) VALUES (1, 'name1', 'qwe', 'STRING', true, 1); - INSERT INTO pattern_template (id, name, value, type, enabled, project_id) VALUES (2, 'name2', 'qw', 'STRING', true, 1); - INSERT INTO pattern_template (id, name, value, type, enabled, project_id) VALUES (3, 'name3', 'qwee', 'STRING', false, 1); - INSERT INTO pattern_template (id, name, value, type, enabled, project_id) VALUES (4, 'name4', '[a-z]{2,4}', 'REGEX', false, 1); - INSERT INTO pattern_template (id, name, value, type, enabled, project_id) VALUES (5, 'name5_p2', '^*+', 'REGEX', true, 2); + INSERT INTO pattern_template (id, name, value, type, enabled, project_id) + VALUES (1, 'name1', 'qwe', 'STRING', true, 1); + INSERT INTO pattern_template (id, name, value, type, enabled, project_id) + VALUES (2, 'name2', 'qw', 'STRING', true, 1); + INSERT INTO pattern_template (id, name, value, type, enabled, project_id) + VALUES (3, 'name3', 'qwee', 'STRING', false, 1); + INSERT INTO pattern_template (id, name, value, type, enabled, project_id) + VALUES (4, 'name4', '[a-z]{2,4}', 'REGEX', false, 1); + INSERT INTO pattern_template (id, name, value, type, enabled, project_id) + VALUES (5, 'name5_p2', '^*+', 'REGEX', true, 2); WHILE launchcounter < 13 LOOP - INSERT INTO launch (id, uuid, project_id, user_id, name, start_time, number, last_modified, mode, status) - VALUES (launchcounter, 'uuid ' || launchcounter, 1, 1, 'name ' || launchcounter, now(), 1, now(), 'DEFAULT', 'IN_PROGRESS'); + INSERT INTO launch (id, uuid, project_id, user_id, name, start_time, number, + last_modified, mode, status) + VALUES (launchcounter, 'uuid ' || launchcounter, 1, 1, 'name ' || launchcounter, now(), + 1, now(), 'DEFAULT', 'IN_PROGRESS'); INSERT INTO item_attribute (key, value, item_id, launch_id, system) - VALUES ('key' || launchcounter % 4, 'value' || launchcounter, NULL, launchcounter, FALSE); + VALUES ('key' || launchcounter % 4, 'value' || launchcounter, NULL, launchcounter, + FALSE); IF floor(random() * (3 - 1 + 1) + 1) = 2 THEN @@ -51,22 +59,29 @@ BEGIN WHILE launchcounter < 13 LOOP - INSERT INTO test_item (test_case_hash, has_children, name, uuid, type, start_time, description, last_modified, unique_id, + INSERT INTO test_item (test_case_hash, has_children, name, uuid, type, start_time, + description, last_modified, unique_id, launch_id) - VALUES (1, true, 'SUITE ' || launchcounter, 'uuid 1_' || launchcounter, 'SUITE', now(), 'description', now(), + VALUES (1, true, 'SUITE ' || launchcounter, 'uuid 1_' || launchcounter, 'SUITE', now(), + 'description', now(), 'unqIdSUITE' || launchcounter, launchcounter); cur_suite_id = (SELECT currval(pg_get_serial_sequence('test_item', 'item_id'))); INSERT INTO item_attribute (key, value, item_id, launch_id, system) VALUES ('suite', 'value' || cur_suite_id, cur_suite_id, NULL, FALSE); - UPDATE test_item SET path = cast(cast(cur_suite_id AS TEXT) AS LTREE) WHERE item_id = cur_suite_id; + UPDATE test_item + SET path = cast(cast(cur_suite_id AS TEXT) AS LTREE) + WHERE item_id = cur_suite_id; - INSERT INTO test_item_results (result_id, status, duration, end_time) VALUES (cur_suite_id, 'FAILED', 0.35, now()); + INSERT INTO test_item_results (result_id, status, duration, end_time) + VALUES (cur_suite_id, 'FAILED', 0.35, now()); -- - INSERT INTO test_item (test_case_hash, has_children, name, uuid, type, start_time, description, last_modified, unique_id, + INSERT INTO test_item (test_case_hash, has_children, name, uuid, type, start_time, + description, last_modified, unique_id, launch_id, parent_id) - VALUES (2, true, 'uuid 2_' || launchcounter, 'First test' || launchcounter, 'TEST', now(), 'description', now(), + VALUES (2, true, 'uuid 2_' || launchcounter, 'First test' || launchcounter, 'TEST', + now(), 'description', now(), 'unqIdTEST' || launchcounter, launchcounter, cur_suite_id); cur_item_id = (SELECT currval(pg_get_serial_sequence('test_item', 'item_id'))); @@ -78,7 +93,8 @@ BEGIN SET path = cast(cur_suite_id AS TEXT) || cast(cast(cur_item_id AS TEXT) AS LTREE) WHERE item_id = cur_item_id; - INSERT INTO test_item_results (result_id, status, duration, end_time) VALUES (cur_item_id, 'FAILED', 0.35, now()); + INSERT INTO test_item_results (result_id, status, duration, end_time) + VALUES (cur_item_id, 'FAILED', 0.35, now()); WHILE stepcounter < 8 LOOP @@ -90,9 +106,12 @@ BEGIN CONTINUE; END IF; - INSERT INTO test_item (test_case_hash, name, code_ref, uuid, type, start_time, description, last_modified, unique_id, + INSERT INTO test_item (test_case_hash, name, code_ref, uuid, type, start_time, + description, last_modified, unique_id, parent_id, launch_id) - VALUES (3, 'Step', 'package.Classname', 'uuid 3_' || launchcounter || stepcounter, 'STEP', now(), 'description', now(), + VALUES (3, 'Step', 'package.Classname', 'uuid 3_' || launchcounter || + stepcounter, 'STEP', now(), + 'description', now(), 'unqIdSTEP' || launchcounter, cur_item_id, launchcounter); cur_step_id = (SELECT currval(pg_get_serial_sequence('test_item', 'item_id'))); @@ -113,37 +132,52 @@ BEGIN END IF; UPDATE test_item - SET path = cast(cur_suite_id AS TEXT) || cast(cast(cur_item_id AS TEXT) AS LTREE) || cast(cur_step_id AS TEXT) + SET path = cast(cur_suite_id AS TEXT) || + cast(cast(cur_item_id AS TEXT) AS LTREE) || cast(cur_step_id AS TEXT) WHERE item_id = cur_step_id; - INSERT INTO test_item_results (result_id, status, duration, end_time) VALUES (cur_step_id, 'IN_PROGRESS', 0.35, now()); + INSERT INTO test_item_results (result_id, status, duration, end_time) + VALUES (cur_step_id, 'IN_PROGRESS', 0.35, now()); IF stepcounter = 1 THEN - UPDATE test_item_results SET status = 'FAILED' WHERE result_id = cur_step_id; + UPDATE test_item_results + SET status = 'FAILED' + WHERE result_id = cur_step_id; INSERT INTO issue (issue_id, issue_type, auto_analyzed, issue_description) VALUES (cur_step_id, 2, FALSE, 'issue description'); - INSERT INTO ticket (ticket_id, submitter, submit_date, bts_url, bts_project, url) - VALUES (concat('ticket_id_', cur_step_id), 'superadmin', now(), 'jira.com', 'project', + INSERT INTO ticket (ticket_id, submitter, submit_date, bts_url, bts_project, + url) + VALUES (concat('ticket_id_', cur_step_id), 'superadmin', now(), 'jira.com', + 'project', concat('http://example.com/tickets/ticket_id_', cur_step_id)); INSERT INTO issue_ticket (issue_id, ticket_id) - VALUES (cur_step_id, (SELECT currval(pg_get_serial_sequence('ticket', 'id')))); + VALUES (cur_step_id, + (SELECT currval(pg_get_serial_sequence('ticket', 'id')))); - INSERT INTO pattern_template_test_item (pattern_id, item_id) VALUES (1, cur_step_id); + INSERT INTO pattern_template_test_item (pattern_id, item_id) + VALUES (1, cur_step_id); END IF; IF stepcounter = 2 THEN - UPDATE test_item SET last_modified = '2018-11-08 12:00:00' WHERE item_id = cur_step_id; - INSERT INTO pattern_template_test_item (pattern_id, item_id) VALUES (2, cur_step_id); - INSERT INTO pattern_template_test_item (pattern_id, item_id) VALUES (3, cur_step_id); + UPDATE test_item + SET last_modified = '2018-11-08 12:00:00' + WHERE item_id = cur_step_id; + INSERT INTO pattern_template_test_item (pattern_id, item_id) + VALUES (2, cur_step_id); + INSERT INTO pattern_template_test_item (pattern_id, item_id) + VALUES (3, cur_step_id); END IF; IF stepcounter = 3 THEN - UPDATE test_item SET last_modified = now() - make_interval(days := 14) WHERE item_id = cur_step_id; - INSERT INTO pattern_template_test_item (pattern_id, item_id) VALUES (3, cur_step_id); + UPDATE test_item + SET last_modified = now() - make_interval(days := 14) + WHERE item_id = cur_step_id; + INSERT INTO pattern_template_test_item (pattern_id, item_id) + VALUES (3, cur_step_id); END IF; stepcounter = stepcounter + 1; END LOOP; @@ -161,7 +195,8 @@ BEGIN -- RETRIES -- - INSERT INTO test_item (test_case_hash, name, uuid, type, start_time, description, last_modified, unique_id, launch_id) + INSERT INTO test_item (test_case_hash, name, uuid, type, start_time, description, last_modified, + unique_id, launch_id) VALUES (4, 'SUITE ' || launchcounter - 1, 'uuid 4_' || launchcounter, 'SUITE', @@ -172,35 +207,48 @@ BEGIN launchcounter - 1); cur_suite_id = (SELECT currval(pg_get_serial_sequence('test_item', 'item_id'))); - UPDATE test_item SET path = cast(cast(cur_suite_id AS TEXT) AS LTREE) WHERE item_id = cur_suite_id; + UPDATE test_item + SET path = cast(cast(cur_suite_id AS TEXT) AS LTREE) + WHERE item_id = cur_suite_id; - INSERT INTO test_item_results (result_id, status, duration, end_time) VALUES (cur_suite_id, 'FAILED', 0.35, now()); + INSERT INTO test_item_results (result_id, status, duration, end_time) + VALUES (cur_suite_id, 'FAILED', 0.35, now()); -- - INSERT INTO test_item (test_case_hash, name, uuid, type, start_time, description, last_modified, unique_id, launch_id, parent_id) - VALUES (5, 'First test', 'uuid 5_' || launchcounter, 'TEST', now(), 'test with retries', now(), 'unqIdTEST_R' || launchcounter - 1, + INSERT INTO test_item (test_case_hash, name, uuid, type, start_time, description, last_modified, + unique_id, launch_id, parent_id) + VALUES (5, 'First test', 'uuid 5_' || launchcounter, 'TEST', now(), 'test with retries', now(), + 'unqIdTEST_R' || launchcounter - 1, launchcounter - 1, cur_suite_id); cur_item_id = (SELECT currval(pg_get_serial_sequence('test_item', 'item_id'))); - UPDATE test_item SET path = cast(cur_suite_id AS TEXT) || cast(cast(cur_item_id AS TEXT) AS LTREE) WHERE item_id = cur_item_id; + UPDATE test_item + SET path = cast(cur_suite_id AS TEXT) || cast(cast(cur_item_id AS TEXT) AS LTREE) + WHERE item_id = cur_item_id; - INSERT INTO test_item_results (result_id, status, duration, end_time) VALUES (cur_item_id, 'FAILED', 0.35, now()); + INSERT INTO test_item_results (result_id, status, duration, end_time) + VALUES (cur_item_id, 'FAILED', 0.35, now()); - INSERT INTO test_item (test_case_hash, name, uuid, type, start_time, description, last_modified, unique_id, parent_id, launch_id) - VALUES (6, 'Step', 'another uuid 6_' || launchcounter, 'STEP', now(), 'STEP WITH RETRIES', now(), 'unqIdSTEP_R' || launchcounter - 1, + INSERT INTO test_item (test_case_hash, name, uuid, type, start_time, description, last_modified, + unique_id, parent_id, launch_id) + VALUES (6, 'Step', 'another uuid 6_' || launchcounter, 'STEP', now(), 'STEP WITH RETRIES', + now(), 'unqIdSTEP_R' || launchcounter - 1, cur_item_id, launchcounter - 1); cur_step_id = (SELECT currval(pg_get_serial_sequence('test_item', 'item_id'))); UPDATE test_item - SET path = cast(cur_suite_id AS TEXT) || cast(cast(cur_item_id AS TEXT) AS LTREE) || cast(cur_step_id AS TEXT) + SET path = cast(cur_suite_id AS TEXT) || cast(cast(cur_item_id AS TEXT) AS LTREE) || + cast(cur_step_id AS TEXT) WHERE item_id = cur_step_id; - INSERT INTO test_item_results (result_id, status, duration, end_time) VALUES (cur_step_id, 'IN_PROGRESS', 0.35, now()); + INSERT INTO test_item_results (result_id, status, duration, end_time) + VALUES (cur_step_id, 'IN_PROGRESS', 0.35, now()); WHILE retriescounter < 4 LOOP - INSERT INTO test_item (test_case_hash, name, uuid, type, start_time, description, last_modified, unique_id, parent_id, + INSERT INTO test_item (test_case_hash, name, uuid, type, start_time, description, + last_modified, unique_id, parent_id, launch_id) VALUES (7, 'Step', 'uuid 7_' || launchcounter || retriescounter, @@ -214,14 +262,19 @@ BEGIN cur_step_id = (SELECT currval(pg_get_serial_sequence('test_item', 'item_id'))); UPDATE test_item - SET path = cast(cur_suite_id AS TEXT) || cast(cast(cur_item_id AS TEXT) AS LTREE) || cast(cur_step_id AS TEXT) + SET path = cast(cur_suite_id AS TEXT) || cast(cast(cur_item_id AS TEXT) AS LTREE) || + cast(cur_step_id AS TEXT) WHERE item_id = cur_step_id; - INSERT INTO test_item_results (result_id, status, duration, end_time) VALUES (cur_step_id, 'IN_PROGRESS', 0.35, now()); + INSERT INTO test_item_results (result_id, status, duration, end_time) + VALUES (cur_step_id, 'IN_PROGRESS', 0.35, now()); - INSERT INTO parameter (item_id, key, value) VALUES (cur_step_id, 'first key', 'first value'); - INSERT INTO parameter (item_id, key, value) VALUES (cur_step_id, 'second key', 'second value'); - INSERT INTO parameter (item_id, key, value) VALUES (cur_step_id, 'third key', 'third value'); + INSERT INTO parameter (item_id, key, value) + VALUES (cur_step_id, 'first key', 'first value'); + INSERT INTO parameter (item_id, key, value) + VALUES (cur_step_id, 'second key', 'second value'); + INSERT INTO parameter (item_id, key, value) + VALUES (cur_step_id, 'third key', 'third value'); functionresult := (SELECT handle_retries(cur_step_id)); @@ -231,14 +284,19 @@ BEGIN functionresult := (SELECT retries_statistics(launchcounter - 1)); - INSERT INTO test_item (test_case_hash, name, uuid, type, start_time, description, last_modified, unique_id, parent_id, launch_id) - VALUES (8, 'Step', 'some uuid 6_' || launchcounter, 'STEP', now(), 'Descendant', now(), 'unqIdSTEP_R' || launchcounter - 1, 5, 1); + INSERT INTO test_item (test_case_hash, name, uuid, type, start_time, description, last_modified, + unique_id, parent_id, launch_id) + VALUES (8, 'Step', 'some uuid 6_' || launchcounter, 'STEP', now(), 'Descendant', now(), + 'unqIdSTEP_R' || launchcounter - 1, 5, 1); cur_step_id = (SELECT currval(pg_get_serial_sequence('test_item', 'item_id'))); - UPDATE test_item SET path = cast('1.2.5.' || cast(cur_step_id AS TEXT) AS LTREE) WHERE item_id = cur_step_id; + UPDATE test_item + SET path = cast('1.2.5.' || cast(cur_step_id AS TEXT) AS LTREE) + WHERE item_id = cur_step_id; UPDATE test_item SET has_children = true WHERE item_id = 5; UPDATE test_item_results SET status = 'FAILED' WHERE result_id = 5; INSERT INTO test_item_results (result_id, status, duration, end_time) - VALUES ((SELECT currval(pg_get_serial_sequence('test_item', 'item_id'))), 'FAILED', 0.35, now()); + VALUES ((SELECT currval(pg_get_serial_sequence('test_item', 'item_id'))), 'FAILED', 0.35, + now()); END; $$ LANGUAGE plpgsql; @@ -254,11 +312,15 @@ BEGIN WHILE logscounter < 4 LOOP - INSERT INTO attachment (file_id, thumbnail_id, content_type, file_size, project_id, launch_id, item_id, creation_date) - VALUES ('attach ' || logscounter, 'attachThumb' || logscounter, 'MIME', 1024, 1, 1, stepid, now()); + INSERT INTO attachment (file_id, thumbnail_id, content_type, file_size, project_id, + launch_id, item_id, creation_date) + VALUES ('attach ' || logscounter, 'attachThumb' || logscounter, 'MIME', 1024, 1, 1, + stepid, now()); - INSERT INTO log (log_time, uuid, log_message, item_id, last_modified, log_level, attachment_id, project_id) - VALUES (now() - make_interval(days := 14), 'uuid' || logscounter, 'log', stepid, now() - make_interval(days := 14), 40000, + INSERT INTO log (log_time, uuid, log_message, item_id, last_modified, log_level, + attachment_id, project_id) + VALUES (now() - make_interval(days := 14), 'uuid' || logscounter, 'log', stepid, + now() - make_interval(days := 14), 40000, (SELECT currval(pg_get_serial_sequence('attachment', 'id'))), 1); logscounter = logscounter + 1; @@ -267,10 +329,13 @@ BEGIN WHILE logscounter > 0 LOOP - INSERT INTO attachment (file_id, thumbnail_id, content_type, file_size, project_id, launch_id, item_id, creation_date) - VALUES ('attach ' || logscounter, 'attachThumb' || logscounter, 'MIME', 1024, 1, 1, stepid, now()); + INSERT INTO attachment (file_id, thumbnail_id, content_type, file_size, project_id, + launch_id, item_id, creation_date) + VALUES ('attach ' || logscounter, 'attachThumb' || logscounter, 'MIME', 1024, 1, 1, + stepid, now()); - INSERT INTO log (uuid, log_time, log_message, item_id, last_modified, log_level, attachment_id, project_id) + INSERT INTO log (uuid, log_time, log_message, item_id, last_modified, log_level, + attachment_id, project_id) VALUES ('luuid' || logscounter, now(), 'log', stepid, now(), 40000, (SELECT currval(pg_get_serial_sequence('attachment', 'id'))), 1); @@ -279,11 +344,15 @@ BEGIN WHILE launchcounter < 7 LOOP - INSERT INTO attachment (file_id, thumbnail_id, content_type, project_id, file_size, launch_id, item_id, creation_date) - VALUES ('attach_log ' || launchcounter, 'attachThumb_log ' || launchcounter, 'MIME', 1, 1024, launchcounter, null, now()); - - INSERT INTO log (uuid, log_time, log_message, launch_id, last_modified, log_level, attachment_id, project_id) - VALUES ('lluuid' || launchcounter, now() - make_interval(days := 14), 'log', launchcounter, now() - make_interval(days := 14), + INSERT INTO attachment (file_id, thumbnail_id, content_type, project_id, file_size, + launch_id, item_id, creation_date) + VALUES ('attach_log ' || launchcounter, 'attachThumb_log ' || launchcounter, 'MIME', 1, + 1024, launchcounter, null, now()); + + INSERT INTO log (uuid, log_time, log_message, launch_id, last_modified, log_level, + attachment_id, project_id) + VALUES ('lluuid' || launchcounter, now() - make_interval(days := 14), 'log', + launchcounter, now() - make_interval(days := 14), 40000, (SELECT currval(pg_get_serial_sequence('attachment', 'id'))), 1); launchcounter = launchcounter + 1; diff --git a/src/test/resources/db/migration/V001005__widget_content_init.sql b/src/test/resources/db/migration/V001005__widget_content_init.sql index 94828d174..a56c4b518 100644 --- a/src/test/resources/db/migration/V001005__widget_content_init.sql +++ b/src/test/resources/db/migration/V001005__widget_content_init.sql @@ -21,7 +21,8 @@ BEGIN INSERT INTO public.filter (id, name, target, description) VALUES (1, 'filter name', 'Launch', 'filter for product status widget'); - INSERT INTO public.launch (uuid, project_id, user_id, name, description, start_time, end_time, number, last_modified, mode, status) + INSERT INTO public.launch (uuid, project_id, user_id, name, description, start_time, end_time, + number, last_modified, mode, status) VALUES ('aa848441-72a1-4192-a828-cd20b7fcbd31', 1, 1, @@ -35,7 +36,8 @@ BEGIN 'FAILED'); launch1 = (SELECT currval(pg_get_serial_sequence('launch', 'id'))); - INSERT INTO public.launch (uuid, project_id, user_id, name, description, start_time, end_time, number, last_modified, mode, status) + INSERT INTO public.launch (uuid, project_id, user_id, name, description, start_time, end_time, + number, last_modified, mode, status) VALUES ('aa848441-72a1-4192-a828-cd20b7fcbd32', 1, 1, @@ -49,7 +51,8 @@ BEGIN 'FAILED'); launch2 = (SELECT currval(pg_get_serial_sequence('launch', 'id'))); - INSERT INTO public.launch (uuid, project_id, user_id, name, description, start_time, end_time, number, last_modified, mode, status) + INSERT INTO public.launch (uuid, project_id, user_id, name, description, start_time, end_time, + number, last_modified, mode, status) VALUES ('aa848441-72a1-4192-a828-cd20b7fcbd33', 1, 1, @@ -63,7 +66,8 @@ BEGIN 'FAILED'); launch3 = (SELECT currval(pg_get_serial_sequence('launch', 'id'))); - INSERT INTO public.launch (uuid, project_id, user_id, name, description, start_time, end_time, number, last_modified, mode, status) + INSERT INTO public.launch (uuid, project_id, user_id, name, description, start_time, end_time, + number, last_modified, mode, status) VALUES ('aa848441-72a1-4192-a828-cd20b7fcbd34', 1, 1, @@ -77,107 +81,166 @@ BEGIN 'FAILED'); launch4 = (SELECT currval(pg_get_serial_sequence('launch', 'id'))); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '1.12.3', null, launch1, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('level', '1', null, launch1, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '3', null, launch1, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '1.9.1', null, launch2, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('level', '1', null, launch2, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('level', '2', null, launch2, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', 'passed', null, launch3, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '1.2.5', null, launch3, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('level', '2', null, launch3, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('level', '3', null, launch3, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '1', null, launch3, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '1.1.7.15.3', null, launch1, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '1.2.3', null, launch2, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '2', null, launch2, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '3.2.4.3', null, launch3, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', 'skipped', null, launch1, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '1.2.3', null, launch4, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', 'failed', null, launch2, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '1.3.2', null, launch2, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '1.9.1', null, launch3, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '3', null, launch4, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', '1.12.3', null, launch1, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('level', '1', null, launch1, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', '3', null, launch1, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', '1.9.1', null, launch2, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('level', '1', null, launch2, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('level', '2', null, launch2, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', 'passed', null, launch3, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', '1.2.5', null, launch3, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('level', '2', null, launch3, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('level', '3', null, launch3, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', '1', null, launch3, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', '1.1.7.15.3', null, launch1, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', '1.2.3', null, launch2, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', '2', null, launch2, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', '3.2.4.3', null, launch3, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', 'skipped', null, launch1, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', '1.2.3', null, launch4, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', 'failed', null, launch2, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', '1.3.2', null, launch2, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', '1.9.1', null, launch3, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES ('build', '3', null, launch4, false); INSERT INTO public.ticket (id, ticket_id, submitter, submit_date, bts_url, bts_project, url) - VALUES (1, 'EPMRPP-322', 'superadmin', '2018-09-28 12:38:24.374555', 'jira.com', 'project', 'epam.com'); + VALUES (1, 'EPMRPP-322', 'superadmin', '2018-09-28 12:38:24.374555', 'jira.com', 'project', + 'epam.com'); INSERT INTO public.ticket (id, ticket_id, submitter, submit_date, bts_url, bts_project, url) - VALUES (2, 'EPMRPP-123', 'superadmin', '2018-09-28 12:38:24.374555', 'jira.com', 'project', 'epam.com'); + VALUES (2, 'EPMRPP-123', 'superadmin', '2018-09-28 12:38:24.374555', 'jira.com', 'project', + 'epam.com'); INSERT INTO public.ticket (id, ticket_id, submitter, submit_date, bts_url, bts_project, url) - VALUES (3, 'QWERTY-100', 'superadmin', '2018-09-28 12:38:24.374555', 'jira.com', 'project', 'epam.com'); + VALUES (3, 'QWERTY-100', 'superadmin', '2018-09-28 12:38:24.374555', 'jira.com', 'project', + 'epam.com'); INSERT INTO public.pattern_template (id, name, "value", type, enabled, project_id) VALUES (1, 'FIRST PATTERN', 'aaaa', 'STRING', true, 1); INSERT INTO public.pattern_template (id, name, "value", type, enabled, project_id) VALUES (2, 'SECOND PATTERN', 'bbbb', 'STRING', true, 1); - INSERT INTO test_item (test_case_hash, NAME, uuid, TYPE, start_time, description, last_modified, unique_id, launch_id) + INSERT INTO test_item (test_case_hash, NAME, uuid, TYPE, start_time, description, last_modified, + unique_id, launch_id) VALUES (1, 'Step', 'uuid1', 'STEP', now(), 'description', now(), 'uniqueId', launch1); itemId = (SELECT (currval(pg_get_serial_sequence('test_item', 'item_id')))); - INSERT INTO test_item_results (result_id, status, duration, end_time) VALUES (itemId, 'FAILED', 0.35 + itemId, now()); + INSERT INTO test_item_results (result_id, status, duration, end_time) + VALUES (itemId, 'FAILED', 0.35 + itemId, now()); INSERT INTO public.pattern_template_test_item (pattern_id, item_id) VALUES (1, itemId); INSERT INTO public.pattern_template_test_item (pattern_id, item_id) VALUES (2, itemId); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES (null, 'test', itemId, null, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES (null, 'value', itemId, null, false); - - INSERT INTO test_item (test_case_hash, NAME, uuid, TYPE, start_time, description, last_modified, unique_id, launch_id) - VALUES (2, 'Step','uuid2', 'STEP', now(), 'description', now(), 'uniqueId', launch1); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES (null, 'test', itemId, null, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES (null, 'value', itemId, null, false); + + INSERT INTO test_item (test_case_hash, NAME, uuid, TYPE, start_time, description, last_modified, + unique_id, launch_id) + VALUES (2, 'Step', 'uuid2', 'STEP', now(), 'description', now(), 'uniqueId', launch1); itemId = (SELECT (currval(pg_get_serial_sequence('test_item', 'item_id')))); - INSERT INTO test_item_results (result_id, status, duration, end_time) VALUES (itemId, 'FAILED', 0.35 + itemId, now()); - INSERT INTO issue (issue_id, issue_type, issue_description) VALUES (itemId, floor(random() * 5 + 1), 'issue description'); + INSERT INTO test_item_results (result_id, status, duration, end_time) + VALUES (itemId, 'FAILED', 0.35 + itemId, now()); + INSERT INTO issue (issue_id, issue_type, issue_description) + VALUES (itemId, floor(random() * 5 + 1), 'issue description'); INSERT INTO issue_ticket (issue_id, ticket_id) VALUES (itemId, 3); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES (null, 'test', itemId, null, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES (null, 'value', itemId, null, false); - - INSERT INTO test_item (test_case_hash, NAME, uuid, TYPE, start_time, description, last_modified, unique_id, launch_id) - VALUES (3, 'Step','uuid3', 'STEP', now(), 'description', now(), 'uniqueId', launch1); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES (null, 'test', itemId, null, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES (null, 'value', itemId, null, false); + + INSERT INTO test_item (test_case_hash, NAME, uuid, TYPE, start_time, description, last_modified, + unique_id, launch_id) + VALUES (3, 'Step', 'uuid3', 'STEP', now(), 'description', now(), 'uniqueId', launch1); itemId = (SELECT (currval(pg_get_serial_sequence('test_item', 'item_id')))); - INSERT INTO test_item_results (result_id, status, duration, end_time) VALUES (itemId, 'FAILED', 0.35 + itemId, now()); - INSERT INTO issue (issue_id, issue_type, issue_description) VALUES (itemId, floor(random() * 5 + 1), 'issue description'); + INSERT INTO test_item_results (result_id, status, duration, end_time) + VALUES (itemId, 'FAILED', 0.35 + itemId, now()); + INSERT INTO issue (issue_id, issue_type, issue_description) + VALUES (itemId, floor(random() * 5 + 1), 'issue description'); INSERT INTO issue_ticket (issue_id, ticket_id) VALUES (itemId, 2); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES (null, 'test', itemId, null, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES (null, 'value', itemId, null, false); - - INSERT INTO test_item (test_case_hash, NAME, uuid, TYPE, start_time, description, last_modified, unique_id, launch_id) - VALUES (4, 'Step','uuid4', 'STEP', now(), 'description', now(), 'uniqueId', launch1); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES (null, 'test', itemId, null, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES (null, 'value', itemId, null, false); + + INSERT INTO test_item (test_case_hash, NAME, uuid, TYPE, start_time, description, last_modified, + unique_id, launch_id) + VALUES (4, 'Step', 'uuid4', 'STEP', now(), 'description', now(), 'uniqueId', launch1); itemId = (SELECT (currval(pg_get_serial_sequence('test_item', 'item_id')))); - INSERT INTO test_item_results (result_id, status, duration, end_time) VALUES (itemId, 'FAILED', 0.35 + itemId, now()); - INSERT INTO issue (issue_id, issue_type, issue_description) VALUES (itemId, floor(random() * 5 + 1), 'issue description'); + INSERT INTO test_item_results (result_id, status, duration, end_time) + VALUES (itemId, 'FAILED', 0.35 + itemId, now()); + INSERT INTO issue (issue_id, issue_type, issue_description) + VALUES (itemId, floor(random() * 5 + 1), 'issue description'); INSERT INTO issue_ticket (issue_id, ticket_id) VALUES (itemId, 1); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES (null, 'test', itemId, null, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES (null, 'value', itemId, null, false); - - INSERT INTO test_item (test_case_hash, NAME,uuid, TYPE, start_time, description, last_modified, unique_id, launch_id) - VALUES (5, 'Step','uuid5', 'STEP', now(), 'description', now(), 'uniqueId', launch4); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES (null, 'test', itemId, null, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES (null, 'value', itemId, null, false); + + INSERT INTO test_item (test_case_hash, NAME, uuid, TYPE, start_time, description, last_modified, + unique_id, launch_id) + VALUES (5, 'Step', 'uuid5', 'STEP', now(), 'description', now(), 'uniqueId', launch4); itemId = (SELECT (currval(pg_get_serial_sequence('test_item', 'item_id')))); - INSERT INTO test_item_results (result_id, status, duration, end_time) VALUES (itemId, 'FAILED', 0.35, now()); - INSERT INTO issue (issue_id, issue_type, issue_description) VALUES (itemId, floor(random() * 5 + 1), 'issue description'); + INSERT INTO test_item_results (result_id, status, duration, end_time) + VALUES (itemId, 'FAILED', 0.35, now()); + INSERT INTO issue (issue_id, issue_type, issue_description) + VALUES (itemId, floor(random() * 5 + 1), 'issue description'); INSERT INTO issue_ticket (issue_id, ticket_id) VALUES (itemId, 2); INSERT INTO public.pattern_template_test_item (pattern_id, item_id) VALUES (1, itemId); INSERT INTO public.pattern_template_test_item (pattern_id, item_id) VALUES (2, itemId); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES (null, 'test', itemId, null, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES (null, 'value', itemId, null, false); - - INSERT INTO test_item (test_case_hash, NAME, uuid, TYPE, start_time, description, last_modified, unique_id, launch_id) - VALUES (6, 'Step','uuid6','STEP', now(), 'description', now(), 'uniqueId', launch4); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES (null, 'test', itemId, null, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES (null, 'value', itemId, null, false); + + INSERT INTO test_item (test_case_hash, NAME, uuid, TYPE, start_time, description, last_modified, + unique_id, launch_id) + VALUES (6, 'Step', 'uuid6', 'STEP', now(), 'description', now(), 'uniqueId', launch4); itemId = (SELECT (currval(pg_get_serial_sequence('test_item', 'item_id')))); - INSERT INTO test_item_results (result_id, status, duration, end_time) VALUES (itemId, 'FAILED', 0.35, now()); - INSERT INTO issue (issue_id, issue_type, issue_description) VALUES (itemId, floor(random() * 5 + 1), 'issue description'); + INSERT INTO test_item_results (result_id, status, duration, end_time) + VALUES (itemId, 'FAILED', 0.35, now()); + INSERT INTO issue (issue_id, issue_type, issue_description) + VALUES (itemId, floor(random() * 5 + 1), 'issue description'); INSERT INTO issue_ticket (issue_id, ticket_id) VALUES (itemId, 1); INSERT INTO public.pattern_template_test_item (pattern_id, item_id) VALUES (2, itemId); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES (null, 'test', itemId, null, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES (null, 'value', itemId, null, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES (null, 'lol', itemId, null, false); - - INSERT INTO test_item (test_case_hash, NAME, uuid, TYPE, start_time, description, last_modified, unique_id, launch_id) + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES (null, 'test', itemId, null, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES (null, 'value', itemId, null, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES (null, 'lol', itemId, null, false); + + INSERT INTO test_item (test_case_hash, NAME, uuid, TYPE, start_time, description, last_modified, + unique_id, launch_id) VALUES (7, 'Step', 'uuid7', 'STEP', now(), 'description', now(), 'uniqueId', launch4); itemId = (SELECT (currval(pg_get_serial_sequence('test_item', 'item_id')))); - INSERT INTO test_item_results (result_id, status, duration, end_time) VALUES (itemId, 'FAILED', 0.35, now()); - INSERT INTO issue (issue_id, issue_type, issue_description) VALUES (itemId, floor(random() * 5 + 1), 'issue description'); + INSERT INTO test_item_results (result_id, status, duration, end_time) + VALUES (itemId, 'FAILED', 0.35, now()); + INSERT INTO issue (issue_id, issue_type, issue_description) + VALUES (itemId, floor(random() * 5 + 1), 'issue description'); INSERT INTO issue_ticket (issue_id, ticket_id) VALUES (itemId, 1); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES (null, 'test', itemId, null, false); - INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES (null, 'value', itemId, null, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES (null, 'test', itemId, null, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) + VALUES (null, 'value', itemId, null, false); ALTER SEQUENCE statistics_s_id_seq RESTART WITH 1; DELETE FROM statistics CASCADE; @@ -188,14 +251,18 @@ BEGIN INSERT INTO statistics_field (sf_id, name) VALUES (2, 'statistics$executions$passed'); INSERT INTO statistics_field (sf_id, name) VALUES (3, 'statistics$executions$skipped'); INSERT INTO statistics_field (sf_id, name) VALUES (4, 'statistics$executions$failed'); - INSERT INTO statistics_field (sf_id, name) VALUES (5, 'statistics$defects$to_investigate$total'); + INSERT INTO statistics_field (sf_id, name) + VALUES (5, 'statistics$defects$to_investigate$total'); INSERT INTO statistics_field (sf_id, name) VALUES (6, 'statistics$defects$system_issue$total'); - INSERT INTO statistics_field (sf_id, name) VALUES (7, 'statistics$defects$automation_bug$total'); + INSERT INTO statistics_field (sf_id, name) + VALUES (7, 'statistics$defects$automation_bug$total'); INSERT INTO statistics_field (sf_id, name) VALUES (8, 'statistics$defects$product_bug$total'); INSERT INTO statistics_field (sf_id, name) VALUES (9, 'statistics$defects$no_defect$total'); - INSERT INTO statistics_field (sf_id, name) VALUES (10, 'statistics$defects$to_investigate$ti001'); + INSERT INTO statistics_field (sf_id, name) + VALUES (10, 'statistics$defects$to_investigate$ti001'); INSERT INTO statistics_field (sf_id, name) VALUES (11, 'statistics$defects$system_issue$si001'); - INSERT INTO statistics_field (sf_id, name) VALUES (12, 'statistics$defects$automation_bug$ab001'); + INSERT INTO statistics_field (sf_id, name) + VALUES (12, 'statistics$defects$automation_bug$ab001'); INSERT INTO statistics_field (sf_id, name) VALUES (13, 'statistics$defects$product_bug$pb001'); INSERT INTO statistics_field (sf_id, name) VALUES (14, 'statistics$defects$no_defect$nd001'); diff --git a/src/test/resources/db/migration/V001006__launches_init.sql b/src/test/resources/db/migration/V001006__launches_init.sql index bfc136be7..7fd5ed170 100644 --- a/src/test/resources/db/migration/V001006__launches_init.sql +++ b/src/test/resources/db/migration/V001006__launches_init.sql @@ -1,41 +1,44 @@ -- Generates 12 launches in 'IN_PROGRESS' status on superadmin project and 1 launch with status 'FAILED' CREATE OR REPLACE FUNCTION launches_init() - RETURNS VOID AS + RETURNS VOID AS $$ DECLARE - differentLaunchesCounter INT = 1; DECLARE sameLaunchCounter INT = 1; + differentLaunchesCounter INT = 1; DECLARE sameLaunchCounter INT = 1; BEGIN - WHILE differentLaunchesCounter < 4 - LOOP - raise notice 'Value: %', differentLaunchesCounter; - WHILE sameLaunchCounter < 5 + WHILE differentLaunchesCounter < 4 LOOP - raise notice 'Value: %', sameLaunchCounter; - INSERT INTO public.launch (uuid, project_id, user_id, name, description, start_time, end_time, last_modified, mode, status) - VALUES ('uuid ' || differentLaunchesCounter || sameLaunchCounter, - 1, - 1, - 'launch name ' || differentLaunchesCounter, - 'description', - now() - make_interval(days := 14), - now() - make_interval(days := 14) + make_interval(mins := 1), - now() - make_interval(days := 14) + make_interval(mins := 1), - 'DEFAULT', - 'IN_PROGRESS'); - sameLaunchCounter = sameLaunchCounter + 1; - IF sameLaunchCounter % 4 = 0 - THEN - INSERT INTO item_attribute(key, value, system, launch_id) - VALUES ('key', 'value', true, currval(pg_get_serial_sequence('launch', 'id'))); - ELSE - INSERT INTO item_attribute(key, value, system, launch_id) - VALUES ('key', 'value', false, currval(pg_get_serial_sequence('launch', 'id'))); - END IF; + raise notice 'Value: %', differentLaunchesCounter; + WHILE sameLaunchCounter < 5 + LOOP + raise notice 'Value: %', sameLaunchCounter; + INSERT INTO public.launch (uuid, project_id, user_id, name, description, + start_time, end_time, last_modified, mode, status) + VALUES ('uuid ' || differentLaunchesCounter || sameLaunchCounter, + 1, + 1, + 'launch name ' || differentLaunchesCounter, + 'description', + now() - make_interval(days := 14), + now() - make_interval(days := 14) + make_interval(mins := 1), + now() - make_interval(days := 14) + make_interval(mins := 1), + 'DEFAULT', + 'IN_PROGRESS'); + sameLaunchCounter = sameLaunchCounter + 1; + IF sameLaunchCounter % 4 = 0 + THEN + INSERT INTO item_attribute(key, value, system, launch_id) + VALUES ('key', 'value', true, + currval(pg_get_serial_sequence('launch', 'id'))); + ELSE + INSERT INTO item_attribute(key, value, system, launch_id) + VALUES ('key', 'value', false, + currval(pg_get_serial_sequence('launch', 'id'))); + END IF; + END LOOP; + sameLaunchCounter = 1; + differentLaunchesCounter = differentLaunchesCounter + 1; END LOOP; - sameLaunchCounter = 1; - differentLaunchesCounter = differentLaunchesCounter + 1; - END LOOP; END; $$ - LANGUAGE plpgsql; \ No newline at end of file + LANGUAGE plpgsql; \ No newline at end of file diff --git a/src/test/resources/db/migration/V001007__integration_type.sql b/src/test/resources/db/migration/V001007__integration_type.sql index 5db41172d..6f27ea7c0 100644 --- a/src/test/resources/db/migration/V001007__integration_type.sql +++ b/src/test/resources/db/migration/V001007__integration_type.sql @@ -1,3 +1,6 @@ -INSERT INTO integration_type (enabled, name, auth_flow, creation_date, group_type) VALUES (TRUE, 'rally', 'OAUTH', now(), 'BTS') ; -INSERT INTO integration_type (enabled, name, auth_flow, creation_date, group_type) VALUES (TRUE, 'jira', 'BASIC', now(), 'BTS'); -INSERT INTO integration_type (enabled, name, auth_flow, creation_date, group_type, details) VALUES (TRUE, 'signup', null, now(), 'OTHER', '{"details": {"accessType": "public"}}'); +INSERT INTO integration_type (enabled, name, auth_flow, creation_date, group_type) +VALUES (TRUE, 'rally', 'OAUTH', now(), 'BTS'); +INSERT INTO integration_type (enabled, name, auth_flow, creation_date, group_type) +VALUES (TRUE, 'jira', 'BASIC', now(), 'BTS'); +INSERT INTO integration_type (enabled, name, auth_flow, creation_date, group_type, details) +VALUES (TRUE, 'signup', null, now(), 'OTHER', '{"details": {"accessType": "public"}}'); diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index abb6d61e2..fa7189aa9 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -1,15 +1,17 @@ - - - %d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) %logger{36}.%M - %msg%n - - + + + %d{dd-MM-yyyy HH:mm:ss.SSS} %magenta([%thread]) %highlight(%-5level) %logger{36}.%M - + %msg%n + + + - - + + - - - + + + \ No newline at end of file diff --git a/src/test/resources/test-application.properties b/src/test/resources/test-application.properties index 2673e6adc..93c4d9f5a 100644 --- a/src/test/resources/test-application.properties +++ b/src/test/resources/test-application.properties @@ -13,12 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # - embedded.datasource.dir=${java.io.tmpdir}/reportportal/embedded-postgres embedded.datasource.clean=true embedded.datasource.port=0 rp.binarystore.path=${java.io.tmpdir}/reportportal/datastore - datastore.default.path=${rp.binarystore.path:/data/storage} datastore.seaweed.master.host=${rp.binarystore.master.host:localhost} datastore.seaweed.master.port=${rp.binarystore.master.port:9333} From 6c2067fdcf322f52f0036915e19c7fddb44f2bb5 Mon Sep 17 00:00:00 2001 From: APiankouski <109206864+APiankouski@users.noreply.github.com> Date: Tue, 6 Jun 2023 14:41:02 +0300 Subject: [PATCH 063/110] Epmrpp 84251 || merge to develop (#889) * EPMRPP-80383 || Notifications. AND/OR attribute option * EPMRPP-80383 || Notifications. AND/OR attribute option * EPMRPP-80383 || Notifications. AND/OR attribute option * EPMRPP-81052 || Most failed test-cases table (TOP-20). Increase the amount of items to be displayed on widget from 20 to 50 or 100 * Update migrationsUrl * Merge master to 5.7.5 (#879) * EPMRPP-79211 || Change minio to Jcloud S3 Provider * EPMRPP-79211 || Return minio dependency * EPMRPP-79211 || Added api version * EPMRPP-79211 || Changed retrieving s3 location and changed provider to aws-s3 * EPMRPP-79211 || Added aws-s3 provider dependency * EPMRPP-79211 || Add logging for jcloud * EPMRPP-79211 || Adding multipart tu PutOptions * EPMRPP-79211 || Change bucketToRegion implementation to use custom location * EPMRPP-79211 || Remove logging module and add minio configuration * EPMRPP-79211 || Add documentation for custom module * EPMRPP-79211 || Remove multipart options * EPMRPP-80865 || Update bom and other versions * [Gradle Release Plugin] - new version commit: '5.7.5'. --------- Co-authored-by: miracle8484 <76156909+miracle8484@users.noreply.github.com> Co-authored-by: reportportal.io * Merge 23.1 (#880) * EPMRPP-81052 || Most failed test-cases table (TOP-20). Increase the amount of items to be displayed on widget from 20 to 50 or 100 * EPMRPP-81233 || Move ACL tasks from RP-23.3 to RP-23.1 (#868) * EPMRPP-81233 || Move ACL tasks from RP-23.3 to RP-23.1 * EPMRPP-72320 || Update model version * EPMRPP-72320 || Remove share flag from DashboardWidget * EPMRPP-81233 || Move ACL tasks from RP-23.3 to RP-23.1 * EPMRPP-81233 || decrease branch test limit --------- Co-authored-by: Pavel Bortnik Co-authored-by: Andrei Piankouski * EPMRPP-82300 Update dependency for common-models (#872) * EPMRPP-82300-dependency-update update commons-model dependency * EPMRPP-82300-dependency-update update commons-model dependency --------- Co-authored-by: Andrei Piankouski Co-authored-by: Pavel Bortnik Co-authored-by: rkukharenka <125865748+rkukharenka@users.noreply.github.com> * EPMRPP-82707 || Add single bucket configuration (#881) * EPMRPP-82707 || Add singleBucket configuration * EPMRPP-82707 || Add singleBucket feature flag * EPMRPP-82707 || Refactor FeatureFlagHandler * EPMRPP-82707 || Add singleBucket config for integrations secrets * EPMRPP-82707 || Refactor according to checkstyle * EPMRPP-82707 || Refactor according to checkstyle * EPMRPP-82707 || Refactor according to checkstyle * Merge master to hotfix/next (#885) * EPMRPP-79211 || Change minio to Jcloud S3 Provider * EPMRPP-79211 || Return minio dependency * EPMRPP-79211 || Added api version * EPMRPP-79211 || Changed retrieving s3 location and changed provider to aws-s3 * EPMRPP-79211 || Added aws-s3 provider dependency * EPMRPP-79211 || Add logging for jcloud * EPMRPP-79211 || Adding multipart tu PutOptions * EPMRPP-79211 || Change bucketToRegion implementation to use custom location * EPMRPP-79211 || Remove logging module and add minio configuration * EPMRPP-79211 || Add documentation for custom module * EPMRPP-79211 || Remove multipart options * EPMRPP-80865 || Update bom and other versions * [Gradle Release Plugin] - new version commit: '5.7.5'. * 5.8.0 || Release (#882) * EPMRPP-80383 || Notifications. AND/OR attribute option * EPMRPP-80383 || Notifications. AND/OR attribute option * EPMRPP-80383 || Notifications. AND/OR attribute option * EPMRPP-81052 || Most failed test-cases table (TOP-20). Increase the amount of items to be displayed on widget from 20 to 50 or 100 * Update migrationsUrl * Merge master to 5.7.5 (#879) * EPMRPP-79211 || Change minio to Jcloud S3 Provider * EPMRPP-79211 || Return minio dependency * EPMRPP-79211 || Added api version * EPMRPP-79211 || Changed retrieving s3 location and changed provider to aws-s3 * EPMRPP-79211 || Added aws-s3 provider dependency * EPMRPP-79211 || Add logging for jcloud * EPMRPP-79211 || Adding multipart tu PutOptions * EPMRPP-79211 || Change bucketToRegion implementation to use custom location * EPMRPP-79211 || Remove logging module and add minio configuration * EPMRPP-79211 || Add documentation for custom module * EPMRPP-79211 || Remove multipart options * EPMRPP-80865 || Update bom and other versions * [Gradle Release Plugin] - new version commit: '5.7.5'. --------- Co-authored-by: miracle8484 <76156909+miracle8484@users.noreply.github.com> Co-authored-by: reportportal.io * Merge 23.1 (#880) * EPMRPP-81052 || Most failed test-cases table (TOP-20). Increase the amount of items to be displayed on widget from 20 to 50 or 100 * EPMRPP-81233 || Move ACL tasks from RP-23.3 to RP-23.1 (#868) * EPMRPP-81233 || Move ACL tasks from RP-23.3 to RP-23.1 * EPMRPP-72320 || Update model version * EPMRPP-72320 || Remove share flag from DashboardWidget * EPMRPP-81233 || Move ACL tasks from RP-23.3 to RP-23.1 * EPMRPP-81233 || decrease branch test limit --------- Co-authored-by: Pavel Bortnik Co-authored-by: Andrei Piankouski * EPMRPP-82300 Update dependency for common-models (#872) * EPMRPP-82300-dependency-update update commons-model dependency * EPMRPP-82300-dependency-update update commons-model dependency --------- Co-authored-by: Andrei Piankouski Co-authored-by: Pavel Bortnik Co-authored-by: rkukharenka <125865748+rkukharenka@users.noreply.github.com> * Update version * EPMRPP-83280 || Update bom --------- Co-authored-by: Andrei Piankouski Co-authored-by: miracle8484 <76156909+miracle8484@users.noreply.github.com> Co-authored-by: Ivan_Kustau Co-authored-by: Ivan Kustau <86599591+IvanKustau@users.noreply.github.com> Co-authored-by: reportportal.io Co-authored-by: Pavel Bortnik Co-authored-by: rkukharenka <125865748+rkukharenka@users.noreply.github.com> * EPMRPP-78998 || Flaky test cases widget. Increase the amount of items to be displayed on widget from 20 to 50 (cherry picked from commit e3d92ce977bcb13e204008f24392d8668d3e9bb4) * Update release.yml * Update release.yml * [Gradle Release Plugin] - new version commit: '5.8.1'. * Resolve conflicts --------- Co-authored-by: Ivan_Kustau Co-authored-by: miracle8484 <76156909+miracle8484@users.noreply.github.com> Co-authored-by: Ivan Kustau <86599591+IvanKustau@users.noreply.github.com> Co-authored-by: reportportal.io Co-authored-by: Andrei Piankouski Co-authored-by: Pavel Bortnik Co-authored-by: rkukharenka <125865748+rkukharenka@users.noreply.github.com> * EPMRPP-83130 || Update the token generation and its storage (#883) * EPMRPP-83130 || Update the token generation and its storage * EPMRPP-83130 || Add findByUser * EPMRPP-83130 || Add java doc --------- Co-authored-by: Andrei Piankouski * EPMRPP-83098 || Update storage variable naming (#886) * EPMRPP-83098 || Update storage variables naming * EPMRPP-83098 || Refactor checkstyle * EPMRPP-83098 || Update storage variable naming (#887) * EPMRPP-83098 || Update storage variables naming * EPMRPP-83098 || Refactor checkstyle * EPMRPP-83098 || Update datastore variable naming * EPMRPP-83098 || Refactor checkstyle * EPMRPP-84251 || Merge hotfix/next branch into develop --------- Co-authored-by: Andrei Piankouski Co-authored-by: miracle8484 <76156909+miracle8484@users.noreply.github.com> Co-authored-by: Ivan_Kustau Co-authored-by: Ivan Kustau <86599591+IvanKustau@users.noreply.github.com> Co-authored-by: reportportal.io Co-authored-by: Pavel Bortnik Co-authored-by: rkukharenka <125865748+rkukharenka@users.noreply.github.com> --- .github/workflows/release.yml | 6 +- build.gradle | 2 +- gradle.properties | 2 +- project-properties.gradle | 12 +- .../impl/AttachmentBinaryDataServiceImpl.java | 50 +- .../binary/impl/DataStoreUtils.java | 22 +- .../impl/UserBinaryDataServiceImpl.java | 52 +- .../commons/querygen/FilterTarget.java | 92 +- .../config/DataStoreConfiguration.java | 171 +- .../config/EncryptConfiguration.java | 38 +- .../dao/AbstractShareableRepositoryImpl.java | 105 -- .../ta/reportportal/dao/ApiKeyRepository.java | 50 + .../dao/DashboardRepositoryCustom.java | 3 +- .../dao/DashboardRepositoryCustomImpl.java | 57 +- .../dao/ShareableEntityRepository.java | 36 - .../reportportal/dao/ShareableRepository.java | 50 - .../dao/UserFilterRepository.java | 1 + .../dao/UserFilterRepositoryCustom.java | 2 +- .../dao/UserFilterRepositoryCustomImpl.java | 57 +- .../ta/reportportal/dao/WidgetRepository.java | 9 +- .../dao/WidgetRepositoryCustom.java | 2 +- .../dao/WidgetRepositoryCustomImpl.java | 72 +- .../reportportal/dao/util/RecordMappers.java | 5 - .../reportportal/dao/util/ResultFetchers.java | 60 +- .../reportportal/dao/util/ShareableUtils.java | 69 - ...{ShareableEntity.java => OwnedEntity.java} | 26 +- .../entity/dashboard/Dashboard.java | 4 +- .../entity/dashboard/DashboardWidget.java | 29 +- .../entity/enums/FeatureFlag.java | 35 + .../entity/enums/LogicalOperator.java | 47 + .../entity/filter/UserFilter.java | 4 +- .../ta/reportportal/entity/user/ApiKey.java | 95 ++ .../ta/reportportal/entity/widget/Widget.java | 4 +- .../distributed/s3/S3DataStore.java | 46 +- .../ta/reportportal/jooq/DefaultCatalog.java | 62 +- .../epam/ta/reportportal/jooq/Indexes.java | 790 ++++----- .../epam/ta/reportportal/jooq/JPublic.java | 878 +++++----- .../com/epam/ta/reportportal/jooq/Keys.java | 1090 +++++-------- .../epam/ta/reportportal/jooq/Sequences.java | 425 +++-- .../com/epam/ta/reportportal/jooq/Tables.java | 607 +++---- .../jooq/enums/JAccessTokenTypeEnum.java | 52 +- .../jooq/enums/JAuthTypeEnum.java | 52 +- .../jooq/enums/JFilterConditionEnum.java | 68 +- .../jooq/enums/JIntegrationAuthFlowEnum.java | 54 +- .../jooq/enums/JIntegrationGroupEnum.java | 52 +- .../jooq/enums/JIssueGroupEnum.java | 54 +- .../jooq/enums/JLaunchModeEnum.java | 48 +- .../jooq/enums/JLogicalOperatorEnum.java | 58 + .../jooq/enums/JPasswordEncoderType.java | 54 +- .../jooq/enums/JProjectRoleEnum.java | 52 +- .../jooq/enums/JSortDirectionEnum.java | 48 +- .../reportportal/jooq/enums/JStatusEnum.java | 64 +- .../jooq/enums/JTestItemTypeEnum.java | 74 +- .../reportportal/jooq/tables/JAclClass.java | 165 -- .../reportportal/jooq/tables/JAclEntry.java | 204 --- .../jooq/tables/JAclObjectIdentity.java | 204 --- .../ta/reportportal/jooq/tables/JAclSid.java | 174 -- .../reportportal/jooq/tables/JActivity.java | 338 ++-- .../ta/reportportal/jooq/tables/JApiKeys.java | 187 +++ .../reportportal/jooq/tables/JAttachment.java | 313 ++-- .../jooq/tables/JAttachmentDeletion.java | 260 +-- .../reportportal/jooq/tables/JAttribute.java | 240 +-- .../reportportal/jooq/tables/JClusters.java | 271 ++-- .../jooq/tables/JClustersTestItem.java | 221 +-- .../jooq/tables/JContentField.java | 227 +-- .../reportportal/jooq/tables/JDashboard.java | 268 +-- .../jooq/tables/JDashboardWidget.java | 350 ++-- .../ta/reportportal/jooq/tables/JFilter.java | 266 +-- .../jooq/tables/JFilterCondition.java | 303 ++-- .../reportportal/jooq/tables/JFilterSort.java | 281 ++-- .../jooq/tables/JIntegration.java | 330 ++-- .../jooq/tables/JIntegrationType.java | 298 ++-- .../ta/reportportal/jooq/tables/JIssue.java | 287 ++-- .../reportportal/jooq/tables/JIssueGroup.java | 241 +-- .../jooq/tables/JIssueTicket.java | 256 +-- .../reportportal/jooq/tables/JIssueType.java | 301 ++-- .../jooq/tables/JIssueTypeProject.java | 258 +-- .../jooq/tables/JItemAttribute.java | 311 ++-- .../ta/reportportal/jooq/tables/JLaunch.java | 408 +++-- .../jooq/tables/JLaunchAttributeRules.java | 282 ++-- .../jooq/tables/JLaunchNames.java | 227 +-- .../jooq/tables/JLaunchNumber.java | 280 ++-- .../ta/reportportal/jooq/tables/JLog.java | 367 +++-- .../jooq/tables/JOauthAccessToken.java | 333 ++-- .../jooq/tables/JOauthRegistration.java | 333 ++-- .../tables/JOauthRegistrationRestriction.java | 285 ++-- .../jooq/tables/JOauthRegistrationScope.java | 274 ++-- .../reportportal/jooq/tables/JOnboarding.java | 270 +-- .../jooq/tables/JOrganization.java | 162 ++ .../jooq/tables/JOrganizationAttribute.java | 182 +++ .../jooq/tables/JOwnedEntity.java | 176 ++ .../reportportal/jooq/tables/JParameter.java | 236 +-- .../jooq/tables/JPatternTemplate.java | 302 ++-- .../jooq/tables/JPatternTemplateTestItem.java | 260 ++- .../jooq/tables/JPgpArmorHeaders.java | 235 +-- .../ta/reportportal/jooq/tables/JProject.java | 293 ++-- .../jooq/tables/JProjectAttribute.java | 282 ++-- .../jooq/tables/JProjectUser.java | 267 +-- .../reportportal/jooq/tables/JRecipients.java | 227 +-- .../jooq/tables/JRestorePasswordBid.java | 243 ++- .../reportportal/jooq/tables/JSenderCase.java | 296 ++-- .../jooq/tables/JServerSettings.java | 252 +-- .../jooq/tables/JShareableEntity.java | 190 --- .../reportportal/jooq/tables/JShedlock.java | 167 ++ .../jooq/tables/JStaleMaterializedView.java | 254 ++- .../reportportal/jooq/tables/JStatistics.java | 309 ++-- .../jooq/tables/JStatisticsField.java | 243 ++- .../reportportal/jooq/tables/JTestItem.java | 444 +++-- .../jooq/tables/JTestItemResults.java | 270 +-- .../ta/reportportal/jooq/tables/JTicket.java | 303 ++-- .../jooq/tables/JUserCreationBid.java | 293 ++-- .../jooq/tables/JUserPreference.java | 299 ++-- .../ta/reportportal/jooq/tables/JUsers.java | 331 ++-- .../ta/reportportal/jooq/tables/JWidget.java | 286 ++-- .../jooq/tables/JWidgetFilter.java | 256 +-- .../jooq/tables/records/JAclClassRecord.java | 189 --- .../jooq/tables/records/JAclEntryRecord.java | 376 ----- .../records/JAclObjectIdentityRecord.java | 303 ---- .../jooq/tables/records/JAclSidRecord.java | 189 --- .../jooq/tables/records/JActivityRecord.java | 774 ++++----- .../jooq/tables/records/JApiKeysRecord.java | 266 +++ .../records/JAttachmentDeletionRecord.java | 479 +++--- .../tables/records/JAttachmentRecord.java | 774 ++++----- .../jooq/tables/records/JAttributeRecord.java | 253 +-- .../jooq/tables/records/JClustersRecord.java | 475 +++--- .../records/JClustersTestItemRecord.java | 235 +-- .../tables/records/JContentFieldRecord.java | 235 +-- .../jooq/tables/records/JDashboardRecord.java | 402 ++--- .../records/JDashboardWidgetRecord.java | 890 +++++----- .../records/JFilterConditionRecord.java | 551 ++++--- .../jooq/tables/records/JFilterRecord.java | 401 ++--- .../tables/records/JFilterSortRecord.java | 402 ++--- .../tables/records/JIntegrationRecord.java | 700 ++++---- .../records/JIntegrationTypeRecord.java | 627 ++++--- .../tables/records/JIssueGroupRecord.java | 253 +-- .../jooq/tables/records/JIssueRecord.java | 477 +++--- .../tables/records/JIssueTicketRecord.java | 253 +-- .../records/JIssueTypeProjectRecord.java | 253 +-- .../jooq/tables/records/JIssueTypeRecord.java | 551 ++++--- .../tables/records/JItemAttributeRecord.java | 551 ++++--- .../records/JLaunchAttributeRulesRecord.java | 403 +++-- .../tables/records/JLaunchNamesRecord.java | 235 +-- .../tables/records/JLaunchNumberRecord.java | 401 ++--- .../jooq/tables/records/JLaunchRecord.java | 1222 +++++++------- .../jooq/tables/records/JLogRecord.java | 923 ++++++----- .../records/JOauthAccessTokenRecord.java | 773 +++++---- .../records/JOauthRegistrationRecord.java | 999 ++++++------ .../JOauthRegistrationRestrictionRecord.java | 404 +++-- .../JOauthRegistrationScopeRecord.java | 327 ++-- .../tables/records/JOnboardingRecord.java | 478 +++--- .../records/JOrganizationAttributeRecord.java | 264 +++ .../tables/records/JOrganizationRecord.java | 153 ++ .../tables/records/JOwnedEntityRecord.java | 190 +++ .../jooq/tables/records/JParameterRecord.java | 309 ++-- .../records/JPatternTemplateRecord.java | 551 ++++--- .../JPatternTemplateTestItemRecord.java | 253 +-- .../records/JPgpArmorHeadersRecord.java | 235 +-- .../records/JProjectAttributeRecord.java | 327 ++-- .../jooq/tables/records/JProjectRecord.java | 626 +++---- .../tables/records/JProjectUserRecord.java | 327 ++-- .../tables/records/JRecipientsRecord.java | 235 +-- .../records/JRestorePasswordBidRecord.java | 328 ++-- .../tables/records/JSenderCaseRecord.java | 480 +++--- .../tables/records/JServerSettingsRecord.java | 327 ++-- .../records/JShareableEntityRecord.java | 226 --- .../jooq/tables/records/JShedlockRecord.java | 229 +++ .../records/JStaleMaterializedViewRecord.java | 328 ++-- .../records/JStatisticsFieldRecord.java | 253 +-- .../tables/records/JStatisticsRecord.java | 477 +++--- .../jooq/tables/records/JTestItemRecord.java | 1444 ++++++++--------- .../records/JTestItemResultsRecord.java | 404 ++--- .../jooq/tables/records/JTicketRecord.java | 700 ++++---- .../records/JUserCreationBidRecord.java | 520 +++--- .../tables/records/JUserPreferenceRecord.java | 401 ++--- .../jooq/tables/records/JUsersRecord.java | 923 ++++++----- .../tables/records/JWidgetFilterRecord.java | 253 +-- .../jooq/tables/records/JWidgetRecord.java | 551 ++++--- .../reportportal/util/FeatureFlagHandler.java | 38 + .../impl/AttachmentDataStoreServiceTest.java | 14 +- .../impl/CommonDataStoreServiceTest.java | 24 +- .../binary/impl/UserDataStoreServiceTest.java | 17 +- .../config/TestConfiguration.java | 8 + .../dao/ApiKeyRepositoryTest.java | 48 + .../dao/DashboardRepositoryTest.java | 94 +- .../dao/UserFilterRepositoryTest.java | 105 +- .../dao/WidgetRepositoryTest.java | 100 +- .../filesystem/FilePathGeneratorTest.java | 10 +- .../distributed/s3/S3DataStoreTest.java | 16 +- .../dashboard-widget-fill.sql | 21 +- .../db/fill/shareable/shareable-fill.sql | 223 +-- .../V001005__widget_content_init.sql | 4 +- .../resources/test-application.properties | 6 +- 192 files changed, 25436 insertions(+), 26198 deletions(-) delete mode 100644 src/main/java/com/epam/ta/reportportal/dao/AbstractShareableRepositoryImpl.java create mode 100644 src/main/java/com/epam/ta/reportportal/dao/ApiKeyRepository.java delete mode 100644 src/main/java/com/epam/ta/reportportal/dao/ShareableEntityRepository.java delete mode 100644 src/main/java/com/epam/ta/reportportal/dao/ShareableRepository.java delete mode 100644 src/main/java/com/epam/ta/reportportal/dao/util/ShareableUtils.java rename src/main/java/com/epam/ta/reportportal/entity/{ShareableEntity.java => OwnedEntity.java} (82%) create mode 100644 src/main/java/com/epam/ta/reportportal/entity/enums/FeatureFlag.java create mode 100644 src/main/java/com/epam/ta/reportportal/entity/enums/LogicalOperator.java create mode 100644 src/main/java/com/epam/ta/reportportal/entity/user/ApiKey.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/DefaultCatalog.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/Indexes.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/Keys.java create mode 100644 src/main/java/com/epam/ta/reportportal/jooq/enums/JLogicalOperatorEnum.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/enums/JStatusEnum.java delete mode 100755 src/main/java/com/epam/ta/reportportal/jooq/tables/JAclClass.java delete mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JAclEntry.java delete mode 100755 src/main/java/com/epam/ta/reportportal/jooq/tables/JAclObjectIdentity.java delete mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JAclSid.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JActivity.java create mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JApiKeys.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JAttribute.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JContentField.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboard.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboardWidget.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JFilter.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterSort.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegration.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueGroup.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueType.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTypeProject.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JItemAttribute.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunch.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchAttributeRules.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNames.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JLog.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthAccessToken.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationScope.java create mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganization.java create mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganizationAttribute.java create mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JOwnedEntity.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JParameter.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplate.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplateTestItem.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JPgpArmorHeaders.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectAttribute.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JRecipients.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JServerSettings.java delete mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JShareableEntity.java create mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JShedlock.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JStatistics.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItem.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItemResults.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JUserPreference.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JWidgetFilter.java delete mode 100755 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclClassRecord.java delete mode 100755 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclEntryRecord.java delete mode 100755 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclObjectIdentityRecord.java delete mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclSidRecord.java create mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JApiKeysRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterConditionRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterSortRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationTypeRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueGroupRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTicketRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchAttributeRulesRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLogRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthAccessTokenRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationScopeRecord.java create mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationAttributeRecord.java create mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationRecord.java create mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOwnedEntityRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JParameterRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateTestItemRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectAttributeRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectUserRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRecipientsRecord.java delete mode 100755 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JShareableEntityRecord.java create mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JShedlockRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsFieldRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemResultsRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserCreationBidRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserPreferenceRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetFilterRecord.java mode change 100755 => 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetRecord.java create mode 100644 src/main/java/com/epam/ta/reportportal/util/FeatureFlagHandler.java create mode 100644 src/test/java/com/epam/ta/reportportal/dao/ApiKeyRepositoryTest.java diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3544a277f..e2860b9a5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,9 +12,9 @@ on: env: GH_USER_NAME: github.actor SCRIPTS_VERSION: 5.7.0 - BOM_VERSION: 5.7.4 - MIGRATIONS_VERSION: 5.7.3 - RELEASE_VERSION: 5.7.4 + BOM_VERSION: 5.7.5 + MIGRATIONS_VERSION: 5.8.0 + RELEASE_VERSION: 5.8.0 jobs: release: diff --git a/build.gradle b/build.gradle index e18fe8e81..e768b29e3 100644 --- a/build.gradle +++ b/build.gradle @@ -63,7 +63,7 @@ dependencies { } else { compile 'com.github.reportportal:commons:def053af' compile 'com.github.reportportal:commons-rules:5.3.0' - compile 'com.github.reportportal:commons-model:a0479c55' + compile 'com.github.reportportal:commons-model:a046458' } //https://nvd.nist.gov/vuln/detail/CVE-2020-10683 (dom4j 2.1.3 version dependency) AND https://nvd.nist.gov/vuln/detail/CVE-2019-14900 diff --git a/gradle.properties b/gradle.properties index 09ca0ec65..dfc09987a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=5.7.5 \ No newline at end of file +version=5.8.1 \ No newline at end of file diff --git a/project-properties.gradle b/project-properties.gradle index bfc93e038..a8df1836e 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -65,8 +65,14 @@ project.ext { (migrationsUrl + '/migrations/54_analyzer_unique_error_attribute.up.sql') : 'V054__analyzer_unique_error_attribute.sql', (migrationsUrl + '/migrations/58_alter_ticket.up.sql') : 'V058__alter_ticket.sql', (migrationsUrl + '/migrations/59_stale_materialized_view.up.sql') : 'V059__stale_materialized_view.sql', - (migrationsUrl + '/migrations/60_user_bid_extension.up.sql') : 'V060__user_bid_extension.up.sql', - (migrationsUrl + '/migrations/62_sender_case_rule_name.up.sql') : 'V062__sender_case_rule_name.up.sql', + (migrationsUrl + '/migrations/60_sender_case_operator.up.sql') : 'V060__sender_case_operator.sql', + (migrationsUrl + '/migrations/61_remove_acl.up.sql') : 'V061__remove_acl.sql', + (migrationsUrl + '/migrations/62_remove_dashboard_cascade_drop.up.sql') : 'V062__remove_dashboard_cascade_drop.sql', + (migrationsUrl + '/migrations/65_launch_attribute_rules_length.up.sql') : 'V065__launch_attribute_rules_length.sql', + (migrationsUrl + '/migrations/67_api_keys.up.sql') : 'V067__api_keys.sql', + (migrationsUrl + '/migrations/68_sender_case_rule_name.up.sql') : 'V068__sender_case_rule_name.sql', + (migrationsUrl + '/migrations/71_user_bid_extension.up.sql') : 'V071__user_bid_extension.up.sql', + (migrationsUrl + '/migrations/72_organization_tables.up.sql') : 'V072__organization_tables.up.sql', ] excludeTests = [ @@ -82,7 +88,7 @@ project.ext { ] limits = [ 'instruction': 70, - 'branch' : 36, + 'branch' : 34, 'line' : 60, 'complexity' : 49, 'method' : 55, diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java b/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java index 256b38cf9..80e63d229 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java @@ -16,6 +16,7 @@ package com.epam.ta.reportportal.binary.impl; +import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.PROJECT_PATH; import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.isContentTypePresent; import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.resolveExtension; import static com.epam.ta.reportportal.commons.validation.BusinessRule.expect; @@ -31,8 +32,10 @@ import com.epam.ta.reportportal.entity.attachment.Attachment; import com.epam.ta.reportportal.entity.attachment.AttachmentMetaInfo; import com.epam.ta.reportportal.entity.attachment.BinaryData; +import com.epam.ta.reportportal.entity.enums.FeatureFlag; import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.filesystem.FilePathGenerator; +import com.epam.ta.reportportal.util.FeatureFlagHandler; import com.epam.ta.reportportal.ws.model.ErrorType; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -56,8 +59,8 @@ @Service public class AttachmentBinaryDataServiceImpl implements AttachmentBinaryDataService { - private static final Logger LOGGER = LoggerFactory.getLogger( - AttachmentBinaryDataServiceImpl.class); + private static final Logger LOGGER = + LoggerFactory.getLogger(AttachmentBinaryDataServiceImpl.class); private final ContentTypeResolver contentTypeResolver; @@ -69,29 +72,49 @@ public class AttachmentBinaryDataServiceImpl implements AttachmentBinaryDataServ private final CreateLogAttachmentService createLogAttachmentService; + private final FeatureFlagHandler featureFlagHandler; + + /** + * Creates {@link AttachmentBinaryDataService}. + * + * @param contentTypeResolver {@link ContentTypeResolver} + * @param filePathGenerator {@link FilePathGenerator} + * @param dataStoreService {@link DataStoreService} + * @param attachmentRepository {@link AttachmentRepository} + * @param createLogAttachmentService {@link CreateLogAttachmentService} + * @param featureFlagHandler {@link FeatureFlagHandler} + */ @Autowired public AttachmentBinaryDataServiceImpl(ContentTypeResolver contentTypeResolver, FilePathGenerator filePathGenerator, @Qualifier("attachmentDataStoreService") DataStoreService dataStoreService, AttachmentRepository attachmentRepository, - CreateLogAttachmentService createLogAttachmentService) { + CreateLogAttachmentService createLogAttachmentService, + FeatureFlagHandler featureFlagHandler) { this.contentTypeResolver = contentTypeResolver; this.filePathGenerator = filePathGenerator; this.dataStoreService = dataStoreService; this.attachmentRepository = attachmentRepository; this.createLogAttachmentService = createLogAttachmentService; + this.featureFlagHandler = featureFlagHandler; } @Override public Optional saveAttachment(AttachmentMetaInfo metaInfo, MultipartFile file) { Optional result = Optional.empty(); - try (InputStream inputStream = file.getInputStream(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { + try (InputStream inputStream = file.getInputStream(); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { inputStream.transferTo(outputStream); String contentType = resolveContentType(file.getContentType(), outputStream); String fileName = resolveFileName(metaInfo, file, contentType); - String commonPath = filePathGenerator.generate(metaInfo); + String commonPath; + if (featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { + commonPath = Paths.get(PROJECT_PATH, filePathGenerator.generate(metaInfo)).toString(); + } else { + commonPath = filePathGenerator.generate(metaInfo); + } String targetPath = Paths.get(commonPath, fileName).toString(); String fileId; @@ -99,11 +122,9 @@ public Optional saveAttachment(AttachmentMetaInfo metaInfo, fileId = dataStoreService.save(targetPath, copy); } - result = Optional.of(BinaryDataMetaInfo.BinaryDataMetaInfoBuilder.aBinaryDataMetaInfo() - .withFileId(fileId) - .withContentType(contentType) - .withFileSize(file.getSize()) - .build()); + result = Optional.of( + BinaryDataMetaInfo.BinaryDataMetaInfoBuilder.aBinaryDataMetaInfo().withFileId(fileId) + .withContentType(contentType).withFileSize(file.getSize()).build()); } catch (IOException e) { LOGGER.error("Unable to save binary data", e); } finally { @@ -155,9 +176,8 @@ public BinaryData load(Long fileId, ReportPortalUser.ProjectDetails projectDetai try { Attachment attachment = attachmentRepository.findById(fileId) .orElseThrow(() -> new ReportPortalException(ErrorType.ATTACHMENT_NOT_FOUND, fileId)); - InputStream data = dataStoreService.load(attachment.getFileId()) - .orElseThrow( - () -> new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, fileId)); + InputStream data = dataStoreService.load(attachment.getFileId()).orElseThrow( + () -> new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, fileId)); expect(attachment.getProjectId(), Predicate.isEqual(projectDetails.getProjectId())).verify( ErrorType.ACCESS_DENIED, formattedSupplier("You are not assigned to project '{}'", projectDetails.getProjectName()) @@ -165,8 +185,8 @@ public BinaryData load(Long fileId, ReportPortalUser.ProjectDetails projectDetai return new BinaryData(attachment.getContentType(), (long) data.available(), data); } catch (IOException e) { LOGGER.error("Unable to load binary data", e); - throw new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, - "Unable to load binary data"); + throw new ReportPortalException( + ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, "Unable to load binary data"); } } diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/DataStoreUtils.java b/src/main/java/com/epam/ta/reportportal/binary/impl/DataStoreUtils.java index e719bbfd9..2876fb1eb 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/DataStoreUtils.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/DataStoreUtils.java @@ -33,16 +33,34 @@ */ public class DataStoreUtils { - static final String ROOT_USER_PHOTO_DIR = "users"; - static final String ATTACHMENT_CONTENT_TYPE = "attachmentContentType"; private static final Logger LOGGER = LoggerFactory.getLogger(DataStoreUtils.class); + private static final String THUMBNAIL_PREFIX = "thumbnail-"; + private static final String DOT = "."; + static final String ROOT_USER_PHOTO_DIR = "users"; + + static final String ATTACHMENT_CONTENT_TYPE = "attachmentContentType"; + + static final String PROJECT_PATH = "project-data"; + + static final String USER_DATA_PATH = "user-data"; + + static final String PHOTOS_PATH = "photos"; + + public static final String INTEGRATION_SECRETS_PATH = "integration-secrets"; + private DataStoreUtils() { //static only } + /** + * Returns {@link Optional} of extension by contentType. + * + * @param contentType Content type + * @return {@link Optional} of {@link String} + */ public static Optional resolveExtension(String contentType) { Optional result = Optional.empty(); try { diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/UserBinaryDataServiceImpl.java b/src/main/java/com/epam/ta/reportportal/binary/impl/UserBinaryDataServiceImpl.java index 79b09ce22..34151c1fc 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/UserBinaryDataServiceImpl.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/UserBinaryDataServiceImpl.java @@ -17,7 +17,9 @@ package com.epam.ta.reportportal.binary.impl; import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.ATTACHMENT_CONTENT_TYPE; +import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.PHOTOS_PATH; import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.ROOT_USER_PHOTO_DIR; +import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.USER_DATA_PATH; import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.buildThumbnailFileName; import static java.util.Optional.ofNullable; @@ -25,8 +27,10 @@ import com.epam.ta.reportportal.binary.UserBinaryDataService; import com.epam.ta.reportportal.entity.Metadata; import com.epam.ta.reportportal.entity.attachment.BinaryData; +import com.epam.ta.reportportal.entity.enums.FeatureFlag; import com.epam.ta.reportportal.entity.user.User; import com.epam.ta.reportportal.exception.ReportPortalException; +import com.epam.ta.reportportal.util.FeatureFlagHandler; import com.epam.ta.reportportal.ws.model.ErrorType; import com.google.common.collect.Maps; import java.io.ByteArrayInputStream; @@ -54,10 +58,14 @@ public class UserBinaryDataServiceImpl implements UserBinaryDataService { private static final String DEFAULT_USER_PHOTO = "image/defaultAvatar.png"; private DataStoreService dataStoreService; + private FeatureFlagHandler featureFlagHandler; + @Autowired public UserBinaryDataServiceImpl( - @Qualifier("userDataStoreService") DataStoreService dataStoreService) { + @Qualifier("userDataStoreService") DataStoreService dataStoreService, + FeatureFlagHandler featureFlagHandler) { this.dataStoreService = dataStoreService; + this.featureFlagHandler = featureFlagHandler; } @Override @@ -79,18 +87,25 @@ public void saveUserPhoto(User user, BinaryData binaryData) { public void saveUserPhoto(User user, InputStream inputStream, String contentType) { try { byte[] data = StreamUtils.copyToByteArray(inputStream); - try (InputStream userPhotoCopy = new ByteArrayInputStream( - data); InputStream thumbnailCopy = new ByteArrayInputStream(data)) { - user.setAttachment( - dataStoreService.save(Paths.get(ROOT_USER_PHOTO_DIR, user.getLogin()).toString(), - userPhotoCopy)); - user.setAttachmentThumbnail(dataStoreService.saveThumbnail( - buildThumbnailFileName(ROOT_USER_PHOTO_DIR, user.getLogin()), - thumbnailCopy - )); + try (InputStream userPhotoCopy = new ByteArrayInputStream(data); + InputStream thumbnailCopy = new ByteArrayInputStream(data)) { + if (featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { + user.setAttachment(dataStoreService.save( + Paths.get(USER_DATA_PATH, PHOTOS_PATH, user.getLogin()).toString(), userPhotoCopy)); + user.setAttachmentThumbnail(dataStoreService.saveThumbnail( + buildThumbnailFileName(Paths.get(USER_DATA_PATH, PHOTOS_PATH).toString(), + user.getLogin() + ), thumbnailCopy)); + } else { + user.setAttachment( + dataStoreService.save(Paths.get(ROOT_USER_PHOTO_DIR, user.getLogin()).toString(), + userPhotoCopy + )); + user.setAttachmentThumbnail(dataStoreService.saveThumbnail( + buildThumbnailFileName(ROOT_USER_PHOTO_DIR, user.getLogin()), thumbnailCopy)); + } } - ofNullable(user.getMetadata()).orElseGet(() -> new Metadata(Maps.newHashMap())) - .getMetadata() + ofNullable(user.getMetadata()).orElseGet(() -> new Metadata(Maps.newHashMap())).getMetadata() .put(ATTACHMENT_CONTENT_TYPE, contentType); } catch (IOException e) { LOGGER.error("Unable to save user photo", e); @@ -99,16 +114,15 @@ public void saveUserPhoto(User user, InputStream inputStream, String contentType @Override public BinaryData loadUserPhoto(User user, boolean loadThumbnail) { - Optional fileId = ofNullable( - loadThumbnail ? user.getAttachmentThumbnail() : user.getAttachment()); + Optional fileId = + ofNullable(loadThumbnail ? user.getAttachmentThumbnail() : user.getAttachment()); InputStream data; String contentType; try { if (fileId.isPresent()) { contentType = (String) user.getMetadata().getMetadata().get(ATTACHMENT_CONTENT_TYPE); - data = dataStoreService.load(fileId.get()) - .orElseThrow(() -> new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, - fileId.get())); + data = dataStoreService.load(fileId.get()).orElseThrow( + () -> new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, fileId.get())); } else { data = new ClassPathResource(DEFAULT_USER_PHOTO).getInputStream(); contentType = MimeTypeUtils.IMAGE_JPEG_VALUE; @@ -116,8 +130,8 @@ public BinaryData loadUserPhoto(User user, boolean loadThumbnail) { return new BinaryData(contentType, (long) data.available(), data); } catch (IOException e) { LOGGER.error("Unable to load user photo", e); - throw new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, - "Unable to load user photo"); + throw new ReportPortalException( + ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR, "Unable to load user photo"); } } diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java index 862bfe2ae..4ecb4ad95 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java @@ -32,7 +32,6 @@ import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_OWNER; import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_PROJECT; import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_PROJECT_ID; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_SHARED; import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_START_TIME; import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_USER_ID; import static com.epam.ta.reportportal.commons.querygen.constant.IntegrationCriteriaConstant.CRITERIA_INTEGRATION_TYPE; @@ -99,9 +98,6 @@ import static com.epam.ta.reportportal.entity.project.ProjectInfo.LAST_RUN; import static com.epam.ta.reportportal.entity.project.ProjectInfo.LAUNCHES_QUANTITY; import static com.epam.ta.reportportal.entity.project.ProjectInfo.USERS_QUANTITY; -import static com.epam.ta.reportportal.jooq.Tables.ACL_CLASS; -import static com.epam.ta.reportportal.jooq.Tables.ACL_ENTRY; -import static com.epam.ta.reportportal.jooq.Tables.ACL_OBJECT_IDENTITY; import static com.epam.ta.reportportal.jooq.Tables.ACTIVITY; import static com.epam.ta.reportportal.jooq.Tables.ATTACHMENT; import static com.epam.ta.reportportal.jooq.Tables.ATTRIBUTE; @@ -126,7 +122,6 @@ import static com.epam.ta.reportportal.jooq.Tables.PROJECT; import static com.epam.ta.reportportal.jooq.Tables.PROJECT_ATTRIBUTE; import static com.epam.ta.reportportal.jooq.Tables.PROJECT_USER; -import static com.epam.ta.reportportal.jooq.Tables.SHAREABLE_ENTITY; import static com.epam.ta.reportportal.jooq.Tables.STATISTICS; import static com.epam.ta.reportportal.jooq.Tables.STATISTICS_FIELD; import static com.epam.ta.reportportal.jooq.Tables.TEST_ITEM; @@ -134,6 +129,7 @@ import static com.epam.ta.reportportal.jooq.Tables.TICKET; import static com.epam.ta.reportportal.jooq.Tables.USERS; import static com.epam.ta.reportportal.jooq.Tables.WIDGET; +import static com.epam.ta.reportportal.jooq.tables.JOwnedEntity.OWNED_ENTITY; import static org.jooq.impl.DSL.choose; import static org.jooq.impl.DSL.field; @@ -1182,16 +1178,12 @@ protected Field idField() { new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, DASHBOARD.ID, Long.class).get(), new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, DASHBOARD.NAME, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_SHARED, SHAREABLE_ENTITY.SHARED, - Boolean.class) - .withAggregateCriteria(DSL.boolAnd(SHAREABLE_ENTITY.SHARED).toString()) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, SHAREABLE_ENTITY.PROJECT_ID, + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, OWNED_ENTITY.PROJECT_ID, Long.class) - .withAggregateCriteria(DSL.max(SHAREABLE_ENTITY.PROJECT_ID).toString()) + .withAggregateCriteria(DSL.max(OWNED_ENTITY.PROJECT_ID).toString()) .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, SHAREABLE_ENTITY.OWNER, String.class) - .withAggregateCriteria(DSL.max(SHAREABLE_ENTITY.OWNER).toString()) + new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, OWNED_ENTITY.OWNER, String.class) + .withAggregateCriteria(DSL.max(OWNED_ENTITY.OWNER).toString()) .get() )) { @Override @@ -1210,10 +1202,8 @@ protected Collection selectFields() { DASHBOARD_WIDGET.WIDGET_POSITION_X, DASHBOARD_WIDGET.WIDGET_POSITION_Y, WIDGET.WIDGET_OPTIONS, - DASHBOARD_WIDGET.SHARE, - SHAREABLE_ENTITY.SHARED, - SHAREABLE_ENTITY.PROJECT_ID, - SHAREABLE_ENTITY.OWNER + OWNED_ENTITY.PROJECT_ID, + OWNED_ENTITY.OWNER ); } @@ -1227,12 +1217,7 @@ protected void joinTables(QuerySupplier query) { query.addJoin(DASHBOARD_WIDGET, JoinType.LEFT_OUTER_JOIN, DASHBOARD.ID.eq(DASHBOARD_WIDGET.DASHBOARD_ID)); query.addJoin(WIDGET, JoinType.LEFT_OUTER_JOIN, DASHBOARD_WIDGET.WIDGET_ID.eq(WIDGET.ID)); - query.addJoin(SHAREABLE_ENTITY, JoinType.JOIN, DASHBOARD.ID.eq(SHAREABLE_ENTITY.ID)); - query.addJoin(ACL_OBJECT_IDENTITY, JoinType.JOIN, - DASHBOARD.ID.cast(String.class).eq(ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY)); - query.addJoin(ACL_CLASS, JoinType.JOIN, ACL_CLASS.ID.eq(ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS)); - query.addJoin(ACL_ENTRY, JoinType.JOIN, - ACL_ENTRY.ACL_OBJECT_IDENTITY.eq(ACL_OBJECT_IDENTITY.ID)); + query.addJoin(OWNED_ENTITY, JoinType.JOIN, DASHBOARD.ID.eq(OWNED_ENTITY.ID)); } @Override @@ -1249,14 +1234,10 @@ protected Field idField() { .get(), new CriteriaHolderBuilder().newBuilder(CRITERIA_DESCRIPTION, WIDGET.DESCRIPTION, String.class) .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_SHARED, SHAREABLE_ENTITY.SHARED, - Boolean.class) - .withAggregateCriteria(DSL.boolAnd(SHAREABLE_ENTITY.SHARED).toString()) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, SHAREABLE_ENTITY.PROJECT_ID, + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, OWNED_ENTITY.PROJECT_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, SHAREABLE_ENTITY.OWNER, String.class) - .withAggregateCriteria(DSL.max(SHAREABLE_ENTITY.OWNER).toString()) + new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, OWNED_ENTITY.OWNER, String.class) + .withAggregateCriteria(DSL.max(OWNED_ENTITY.OWNER).toString()) .get() )) { @@ -1267,9 +1248,8 @@ protected Collection selectFields() { WIDGET.WIDGET_TYPE, WIDGET.DESCRIPTION, WIDGET.ITEMS_COUNT, - SHAREABLE_ENTITY.PROJECT_ID, - SHAREABLE_ENTITY.SHARED, - SHAREABLE_ENTITY.OWNER + OWNED_ENTITY.PROJECT_ID, + OWNED_ENTITY.OWNER ); } @@ -1280,12 +1260,7 @@ protected void addFrom(SelectQuery query) { @Override protected void joinTables(QuerySupplier query) { - query.addJoin(SHAREABLE_ENTITY, JoinType.JOIN, WIDGET.ID.eq(SHAREABLE_ENTITY.ID)); - query.addJoin(ACL_OBJECT_IDENTITY, JoinType.JOIN, - WIDGET.ID.cast(String.class).eq(ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY)); - query.addJoin(ACL_CLASS, JoinType.JOIN, ACL_CLASS.ID.eq(ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS)); - query.addJoin(ACL_ENTRY, JoinType.JOIN, - ACL_ENTRY.ACL_OBJECT_IDENTITY.eq(ACL_OBJECT_IDENTITY.ID)); + query.addJoin(OWNED_ENTITY, JoinType.JOIN, WIDGET.ID.eq(OWNED_ENTITY.ID)); } @Override @@ -1294,23 +1269,17 @@ protected Field idField() { } }, - USER_FILTER_TARGET(UserFilter.class, - Arrays.asList( - new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, FILTER.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, FILTER.NAME, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_SHARED, SHAREABLE_ENTITY.SHARED, - Boolean.class) - .withAggregateCriteria(DSL.boolAnd(SHAREABLE_ENTITY.SHARED).toString()) - .get(), + USER_FILTER_TARGET(UserFilter.class, + Arrays.asList(new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, FILTER.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, FILTER.NAME, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, SHAREABLE_ENTITY.PROJECT_ID, - Long.class) - .withAggregateCriteria(DSL.max(SHAREABLE_ENTITY.PROJECT_ID).toString()) + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, OWNED_ENTITY.PROJECT_ID, Long.class) + .withAggregateCriteria(DSL.max(OWNED_ENTITY.PROJECT_ID).toString()) .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, SHAREABLE_ENTITY.OWNER, + new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, OWNED_ENTITY.OWNER, String.class) - .withAggregateCriteria(DSL.max(SHAREABLE_ENTITY.OWNER).toString()) + .withAggregateCriteria(DSL.max(OWNED_ENTITY.OWNER).toString()) .get() ) ) { @@ -1326,9 +1295,8 @@ protected Collection selectFields() { FILTER_CONDITION.NEGATIVE, FILTER_SORT.FIELD, FILTER_SORT.DIRECTION, - SHAREABLE_ENTITY.SHARED, - SHAREABLE_ENTITY.PROJECT_ID, - SHAREABLE_ENTITY.OWNER + OWNED_ENTITY.PROJECT_ID, + OWNED_ENTITY.OWNER ); } @@ -1339,16 +1307,10 @@ protected void addFrom(SelectQuery query) { @Override protected void joinTables(QuerySupplier query) { - query.addJoin(SHAREABLE_ENTITY, JoinType.JOIN, FILTER.ID.eq(SHAREABLE_ENTITY.ID)); - query.addJoin(FILTER_CONDITION, JoinType.LEFT_OUTER_JOIN, - FILTER.ID.eq(FILTER_CONDITION.FILTER_ID)); - query.addJoin(FILTER_SORT, JoinType.LEFT_OUTER_JOIN, FILTER.ID.eq(FILTER_SORT.FILTER_ID)); - query.addJoin(ACL_OBJECT_IDENTITY, JoinType.JOIN, - FILTER.ID.cast(String.class).eq(ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY)); - query.addJoin(ACL_CLASS, JoinType.JOIN, ACL_CLASS.ID.eq(ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS)); - query.addJoin(ACL_ENTRY, JoinType.JOIN, - ACL_ENTRY.ACL_OBJECT_IDENTITY.eq(ACL_OBJECT_IDENTITY.ID)); - } + query.addJoin(OWNED_ENTITY, JoinType.JOIN, FILTER.ID.eq(OWNED_ENTITY.ID)); + query.addJoin(FILTER_CONDITION, JoinType.LEFT_OUTER_JOIN, FILTER.ID.eq(FILTER_CONDITION.FILTER_ID)); + query.addJoin(FILTER_SORT, JoinType.LEFT_OUTER_JOIN, FILTER.ID.eq(FILTER_SORT.FILTER_ID)); + } @Override protected Field idField() { diff --git a/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java b/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java index ed43ce939..9167cb169 100644 --- a/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java +++ b/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java @@ -23,6 +23,7 @@ import com.epam.ta.reportportal.filesystem.DataStore; import com.epam.ta.reportportal.filesystem.LocalDataStore; import com.epam.ta.reportportal.filesystem.distributed.s3.S3DataStore; +import com.epam.ta.reportportal.util.FeatureFlagHandler; import com.google.common.base.Optional; import com.google.common.base.Supplier; import com.google.common.cache.CacheLoader; @@ -49,79 +50,6 @@ @Configuration public class DataStoreConfiguration { - @Bean - @ConditionalOnProperty(name = "datastore.type", havingValue = "filesystem") - public DataStore localDataStore( - @Value("${datastore.default.path:/data/store}") String storagePath) { - return new LocalDataStore(storagePath); - } - - @Bean - @ConditionalOnProperty(name = "datastore.type", havingValue = "minio") - public BlobStore minioBlobStore(@Value("${datastore.minio.accessKey}") String accessKey, - @Value("${datastore.minio.secretKey}") String secretKey, - @Value("${datastore.minio.endpoint}") String endpoint) { - - BlobStoreContext blobStoreContext = ContextBuilder.newBuilder("s3") - .endpoint(endpoint) - .credentials(accessKey, secretKey) - .buildView(BlobStoreContext.class); - - return blobStoreContext.getBlobStore(); - } - - @Bean - @ConditionalOnProperty(name = "datastore.type", havingValue = "minio") - public DataStore minioDataStore(@Autowired BlobStore blobStore, - @Value("${datastore.minio.bucketPrefix}") String bucketPrefix, - @Value("${datastore.minio.defaultBucketName}") String defaultBucketName, - @Value("${datastore.minio.region}") String region) { - return new S3DataStore(blobStore, bucketPrefix, defaultBucketName, region); - } - - @Bean - @ConditionalOnProperty(name = "datastore.type", havingValue = "s3") - public BlobStore s3BlobStore(@Value("${datastore.s3.accessKey}") String accessKey, - @Value("${datastore.s3.secretKey}") String secretKey, - @Value("${datastore.s3.region}") String region) { - Iterable modules = ImmutableSet.of(new CustomBucketToRegionModule(region)); - - BlobStoreContext blobStoreContext = ContextBuilder.newBuilder("aws-s3") - .modules(modules) - .credentials(accessKey, secretKey) - .buildView(BlobStoreContext.class); - - return blobStoreContext.getBlobStore(); - } - - @Bean - @ConditionalOnProperty(name = "datastore.type", havingValue = "s3") - public DataStore s3DataStore(@Autowired BlobStore blobStore, - @Value("${datastore.s3.bucketPrefix}") String bucketPrefix, - @Value("${datastore.s3.defaultBucketName}") String defaultBucketName, - @Value("${datastore.s3.region}") String region) { - return new S3DataStore(blobStore, bucketPrefix, defaultBucketName, region); - } - - @Bean("attachmentThumbnailator") - public Thumbnailator attachmentThumbnailator( - @Value("${datastore.thumbnail.attachment.width}") int width, - @Value("${datastore.thumbnail.attachment.height}") int height) { - return new ThumbnailatorImpl(width, height); - } - - @Bean("userPhotoThumbnailator") - public Thumbnailator userPhotoThumbnailator( - @Value("${datastore.thumbnail.avatar.width}") int width, - @Value("${datastore.thumbnail.avatar.height}") int height) { - return new ThumbnailatorImpl(width, height); - } - - @Bean - public ContentTypeResolver contentTypeResolver() { - return new TikaContentTypeResolver(); - } - /** * Amazon has a general work flow they publish that allows clients to always find the correct URL * endpoint for a given bucket: 1) ask s3.amazonaws.com for the bucket location 2) use the url @@ -204,4 +132,101 @@ public String toString() { } } } + + @Bean + @ConditionalOnProperty(name = "datastore.type", havingValue = "filesystem") + public DataStore localDataStore( + @Value("${datastore.path:/data/store}") String storagePath) { + return new LocalDataStore(storagePath); + } + + /** + * Creates BlobStore bean, that works with MinIO. + * + * @param accessKey accessKey to use + * @param secretKey secretKey to use + * @param endpoint MinIO endpoint + * @return {@link BlobStore} + */ + @Bean + @ConditionalOnProperty(name = "datastore.type", havingValue = "minio") + public BlobStore minioBlobStore(@Value("${datastore.accessKey}") String accessKey, + @Value("${datastore.secretKey}") String secretKey, + @Value("${datastore.endpoint}") String endpoint) { + + BlobStoreContext blobStoreContext = + ContextBuilder.newBuilder("s3").endpoint(endpoint).credentials(accessKey, secretKey) + .buildView(BlobStoreContext.class); + + return blobStoreContext.getBlobStore(); + } + + /** + * Creates DataStore bean to work with MinIO. + * + * @param blobStore {@link BlobStore} object + * @param bucketPrefix Prefix for bucket name + * @param defaultBucketName Name of default bucket to use + * @param region Region to store + * @param featureFlagHandler Instance of {@link FeatureFlagHandler} to check enabled features + * @return {@link DataStore} object + */ + @Bean + @ConditionalOnProperty(name = "datastore.type", havingValue = "minio") + public DataStore minioDataStore(@Autowired BlobStore blobStore, + @Value("${datastore.bucketPrefix}") String bucketPrefix, + @Value("${datastore.defaultBucketName}") String defaultBucketName, + @Value("${datastore.region}") String region, FeatureFlagHandler featureFlagHandler) { + return new S3DataStore(blobStore, bucketPrefix, defaultBucketName, region, featureFlagHandler); + } + + /** + * Creates BlobStore bean, that works with AWS S3. + * + * @param accessKey accessKey to use + * @param secretKey secretKey to use + * @param region AWS S3 region to use. + * @return {@link BlobStore} + */ + @Bean + @ConditionalOnProperty(name = "datastore.type", havingValue = "s3") + public BlobStore s3BlobStore(@Value("${datastore.accessKey}") String accessKey, + @Value("${datastore.secretKey}") String secretKey, + @Value("${datastore.region}") String region) { + Iterable modules = ImmutableSet.of(new CustomBucketToRegionModule(region)); + + BlobStoreContext blobStoreContext = + ContextBuilder.newBuilder("aws-s3").modules(modules).credentials(accessKey, secretKey) + .buildView(BlobStoreContext.class); + + return blobStoreContext.getBlobStore(); + } + + @Bean + @ConditionalOnProperty(name = "datastore.type", havingValue = "s3") + public DataStore s3DataStore(@Autowired BlobStore blobStore, + @Value("${datastore.bucketPrefix}") String bucketPrefix, + @Value("${datastore.defaultBucketName}") String defaultBucketName, + @Value("${datastore.region}") String region, FeatureFlagHandler featureFlagHandler) { + return new S3DataStore(blobStore, bucketPrefix, defaultBucketName, region, featureFlagHandler); + } + + @Bean("attachmentThumbnailator") + public Thumbnailator attachmentThumbnailator( + @Value("${datastore.thumbnail.attachment.width}") int width, + @Value("${datastore.thumbnail.attachment.height}") int height) { + return new ThumbnailatorImpl(width, height); + } + + @Bean("userPhotoThumbnailator") + public Thumbnailator userPhotoThumbnailator( + @Value("${datastore.thumbnail.avatar.width}") int width, + @Value("${datastore.thumbnail.avatar.height}") int height) { + return new ThumbnailatorImpl(width, height); + } + + @Bean + public ContentTypeResolver contentTypeResolver() { + return new TikaContentTypeResolver(); + } } \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java b/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java index 1d2d9b963..7b10d3536 100644 --- a/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java +++ b/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java @@ -16,6 +16,9 @@ package com.epam.ta.reportportal.config; +import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.INTEGRATION_SECRETS_PATH; + +import com.epam.ta.reportportal.entity.enums.FeatureFlag; import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.filesystem.DataStore; import java.io.ByteArrayInputStream; @@ -25,6 +28,15 @@ import java.nio.charset.StandardCharsets; import java.security.SecureRandom; import java.util.Base64; +import com.epam.ta.reportportal.util.FeatureFlagHandler; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.Paths; +import java.security.SecureRandom; +import java.util.Base64; import org.apache.commons.io.IOUtils; import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; import org.jasypt.util.text.BasicTextEncryptor; @@ -58,13 +70,21 @@ public class EncryptConfiguration implements InitializingBean { private String secretFilePath; private String migrationFilePath; - private DataStore dataStore; + private final DataStore dataStore; + + private final FeatureFlagHandler featureFlagHandler; @Autowired - public EncryptConfiguration(DataStore dataStore) { + public EncryptConfiguration(DataStore dataStore, FeatureFlagHandler featureFlagHandler) { this.dataStore = dataStore; + this.featureFlagHandler = featureFlagHandler; } + /** + * Creates bean of {@link BasicTextEncryptor} for encrypting purposes. + * + * @return {@link BasicTextEncryptor} instance + */ @Bean(name = "basicEncryptor") public BasicTextEncryptor getBasicEncrypt() throws IOException { BasicTextEncryptor basic = new BasicTextEncryptor(); @@ -72,6 +92,11 @@ public BasicTextEncryptor getBasicEncrypt() throws IOException { return basic; } + /** + * Creates bean of {@link StandardPBEStringEncryptor} for encrypting purposes. + * + * @return {@link StandardPBEStringEncryptor} instance + */ @Bean(name = "strongEncryptor") public StandardPBEStringEncryptor getStrongEncryptor() throws IOException { StandardPBEStringEncryptor strong = new StandardPBEStringEncryptor(); @@ -82,8 +107,13 @@ public StandardPBEStringEncryptor getStrongEncryptor() throws IOException { @Override public void afterPropertiesSet() throws Exception { - secretFilePath = integrationSaltPath + File.separator + integrationSaltFile; - migrationFilePath = integrationSaltPath + File.separator + migrationFile; + if (featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { + secretFilePath = Paths.get(INTEGRATION_SECRETS_PATH, integrationSaltFile).toString(); + migrationFilePath = Paths.get(INTEGRATION_SECRETS_PATH, migrationFile).toString(); + } else { + secretFilePath = integrationSaltPath + File.separator + integrationSaltFile; + migrationFilePath = integrationSaltPath + File.separator + migrationFile; + } loadOrGenerateIntegrationSalt(dataStore); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/AbstractShareableRepositoryImpl.java b/src/main/java/com/epam/ta/reportportal/dao/AbstractShareableRepositoryImpl.java deleted file mode 100644 index da0e3cc3c..000000000 --- a/src/main/java/com/epam/ta/reportportal/dao/AbstractShareableRepositoryImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.dao; - -import static com.epam.ta.reportportal.dao.util.ShareableUtils.ownCondition; -import static com.epam.ta.reportportal.dao.util.ShareableUtils.permittedCondition; -import static com.epam.ta.reportportal.dao.util.ShareableUtils.sharedCondition; -import static com.epam.ta.reportportal.jooq.Tables.SHAREABLE_ENTITY; - -import com.epam.ta.reportportal.commons.querygen.Filter; -import com.epam.ta.reportportal.commons.querygen.ProjectFilter; -import com.epam.ta.reportportal.commons.querygen.QueryBuilder; -import com.epam.ta.reportportal.entity.ShareableEntity; -import java.util.List; -import java.util.function.Function; -import org.jooq.DSLContext; -import org.jooq.Record; -import org.jooq.Result; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.repository.support.PageableExecutionUtils; - -/** - * @author Ivan Budayeu - */ -public abstract class AbstractShareableRepositoryImpl implements - ShareableRepository { - - protected DSLContext dsl; - - @Autowired - public void setDsl(DSLContext dsl) { - this.dsl = dsl; - } - - protected Page getPermitted(Function, List> fetcher, Filter filter, - Pageable pageable, String userName) { - - return PageableExecutionUtils.getPage( - fetcher.apply(dsl.fetch(QueryBuilder.newBuilder(filter) - .addCondition(permittedCondition(userName)) - .with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) - .build())), - pageable, - () -> dsl.fetchCount( - QueryBuilder.newBuilder(filter).addCondition(permittedCondition(userName)).build()) - ); - - } - - protected Page getOwn(Function, List> fetcher, - ProjectFilter filter, Pageable pageable, - String userName) { - return PageableExecutionUtils.getPage( - fetcher.apply(dsl.fetch(QueryBuilder.newBuilder(filter) - .addCondition(ownCondition(userName)) - .with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) - .build())), - pageable, - () -> dsl.fetchCount( - QueryBuilder.newBuilder(filter).addCondition(ownCondition(userName)).build()) - ); - } - - protected Page getShared(Function, List> fetcher, - ProjectFilter filter, Pageable pageable, - String userName) { - return PageableExecutionUtils.getPage( - fetcher.apply(dsl.fetch(QueryBuilder.newBuilder(filter) - .addCondition(sharedCondition(userName)) - .with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) - .build())), - pageable, - () -> dsl.fetchCount( - QueryBuilder.newBuilder(filter).addCondition(sharedCondition(userName)).build()) - ); - } - - @Override - public void updateSharingFlag(List ids, boolean isShared) { - dsl.update(SHAREABLE_ENTITY).set(SHAREABLE_ENTITY.SHARED, isShared) - .where(SHAREABLE_ENTITY.ID.in(ids)).execute(); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/dao/ApiKeyRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ApiKeyRepository.java new file mode 100644 index 000000000..a9e5961cd --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/dao/ApiKeyRepository.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 EPAM Systems + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.epam.ta.reportportal.dao; + +import com.epam.ta.reportportal.entity.user.ApiKey; +import java.util.List; + +/** + * ApiKey Repository + * + * @author Andrei Piankouski + */ +public interface ApiKeyRepository extends ReportPortalRepository { + + /** + * + * @param hash hash of api key + * @return {@link ApiKey} + */ + ApiKey findByHash(String hash); + + /** + * + * @param name name of user Api key + * @param userId {@link com.epam.ta.reportportal.entity.user.User#id} + * @return if exists 'true' else 'false' + */ + boolean existsByNameAndUserId(String name, Long userId); + + /** + * + * @param userId {@link com.epam.ta.reportportal.entity.user.User#id} + * @return list of user api keys + */ + List findByUserId(Long userId); +} diff --git a/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustom.java index f9d7fd5c6..ecdb48aaa 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustom.java @@ -21,6 +21,5 @@ /** * @author Pavel Bortnik */ -public interface DashboardRepositoryCustom extends ShareableRepository { - +public interface DashboardRepositoryCustom extends FilterableRepository { } diff --git a/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustomImpl.java index 81011957f..38069f183 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/DashboardRepositoryCustomImpl.java @@ -18,31 +18,66 @@ import static com.epam.ta.reportportal.dao.util.ResultFetchers.DASHBOARD_FETCHER; -import com.epam.ta.reportportal.commons.querygen.ProjectFilter; +import com.epam.ta.reportportal.commons.querygen.ConvertibleCondition; +import com.epam.ta.reportportal.commons.querygen.FilterCondition; +import com.epam.ta.reportportal.commons.querygen.QueryBuilder; +import com.epam.ta.reportportal.commons.querygen.Queryable; import com.epam.ta.reportportal.entity.dashboard.Dashboard; +import org.jooq.DSLContext; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.repository.support.PageableExecutionUtils; import org.springframework.stereotype.Repository; +import java.util.Collection; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import static com.epam.ta.reportportal.dao.util.ResultFetchers.DASHBOARD_FETCHER; + /** * @author Pavel Bortnik */ @Repository -public class DashboardRepositoryCustomImpl extends - AbstractShareableRepositoryImpl implements DashboardRepositoryCustom { +public class DashboardRepositoryCustomImpl implements DashboardRepositoryCustom { - @Override - public Page getPermitted(ProjectFilter filter, Pageable pageable, String userName) { - return getPermitted(DASHBOARD_FETCHER, filter, pageable, userName); - } + private DSLContext dsl; + + @Autowired + public void setDsl(DSLContext dsl) { + this.dsl = dsl; + } @Override - public Page getOwn(ProjectFilter filter, Pageable pageable, String userName) { - return getOwn(DASHBOARD_FETCHER, filter, pageable, userName); + public List findByFilter(Queryable filter) { + return DASHBOARD_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder( + filter, + filter.getFilterConditions() + .stream() + .map(ConvertibleCondition::getAllConditions) + .flatMap(Collection::stream) + .map(FilterCondition::getSearchCriteria) + .collect(Collectors.toSet()) + ).wrap().build())); } @Override - public Page getShared(ProjectFilter filter, Pageable pageable, String userName) { - return getShared(DASHBOARD_FETCHER, filter, pageable, userName); + public Page findByFilter(Queryable filter, Pageable pageable) { + Set fields = filter.getFilterConditions() + .stream() + .map(ConvertibleCondition::getAllConditions) + .flatMap(Collection::stream) + .map(FilterCondition::getSearchCriteria) + .collect(Collectors.toSet()); + fields.addAll(pageable.getSort().get().map(Sort.Order::getProperty).collect(Collectors.toSet())); + + return PageableExecutionUtils.getPage(DASHBOARD_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter, fields) + .with(pageable) + .wrap() + .withWrapperSort(pageable.getSort()) + .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter, fields).build())); } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/ShareableEntityRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ShareableEntityRepository.java deleted file mode 100644 index a2a4081c9..000000000 --- a/src/main/java/com/epam/ta/reportportal/dao/ShareableEntityRepository.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.dao; - -import com.epam.ta.reportportal.entity.ShareableEntity; -import java.util.List; - -/** - * @author Pavel Bortnik - */ -public interface ShareableEntityRepository extends ReportPortalRepository { - - /** - * Find all shareable entities on project with share status - * - * @param projectId Project id - * @param shared Shared or not - * @return List of shareable entities - */ - List findAllByProjectIdAndShared(Long projectId, boolean shared); - -} diff --git a/src/main/java/com/epam/ta/reportportal/dao/ShareableRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ShareableRepository.java deleted file mode 100644 index 01d524c89..000000000 --- a/src/main/java/com/epam/ta/reportportal/dao/ShareableRepository.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.dao; - -import com.epam.ta.reportportal.commons.querygen.ProjectFilter; -import com.epam.ta.reportportal.entity.ShareableEntity; -import java.util.List; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; - -/** - * @author Pavel Bortnik - */ -public interface ShareableRepository { - - /** - * Get all permitted objects for specified user - */ - Page getPermitted(ProjectFilter filter, Pageable pageable, String userName); - - /** - * Get only objects for which the user is owner - */ - Page getOwn(ProjectFilter filter, Pageable pageable, String userName); - - /** - * Get all shared objects user without own objects - */ - Page getShared(ProjectFilter filter, Pageable pageable, String userName); - - /** - * Update share flag for provided shareable entities ids. - */ - void updateSharingFlag(List ids, boolean isShared); - -} diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepository.java b/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepository.java index 4180488e3..521feff0f 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepository.java @@ -17,6 +17,7 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.filter.UserFilter; + import java.util.Collection; import java.util.List; import java.util.Optional; diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustom.java index ea8759255..9e851aa6f 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustom.java @@ -21,6 +21,6 @@ /** * @author Pavel Bortnik */ -public interface UserFilterRepositoryCustom extends ShareableRepository { +public interface UserFilterRepositoryCustom extends FilterableRepository { } diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustomImpl.java index 21e4cf8ea..c2d1e44a2 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustomImpl.java @@ -18,32 +18,67 @@ import static com.epam.ta.reportportal.dao.util.ResultFetchers.USER_FILTER_FETCHER; -import com.epam.ta.reportportal.commons.querygen.ProjectFilter; +import com.epam.ta.reportportal.commons.querygen.ConvertibleCondition; +import com.epam.ta.reportportal.commons.querygen.FilterCondition; +import com.epam.ta.reportportal.commons.querygen.QueryBuilder; +import com.epam.ta.reportportal.commons.querygen.Queryable; import com.epam.ta.reportportal.entity.filter.UserFilter; +import org.jooq.DSLContext; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.repository.support.PageableExecutionUtils; import org.springframework.stereotype.Repository; +import java.util.Collection; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import static com.epam.ta.reportportal.dao.util.ResultFetchers.USER_FILTER_FETCHER; + /** * @author Pavel Bortnik */ @Repository -public class UserFilterRepositoryCustomImpl extends - AbstractShareableRepositoryImpl implements UserFilterRepositoryCustom { +public class UserFilterRepositoryCustomImpl implements UserFilterRepositoryCustom { - @Override - public Page getPermitted(ProjectFilter filter, Pageable pageable, String userName) { - return getPermitted(USER_FILTER_FETCHER, filter, pageable, userName); - } + private DSLContext dsl; + + @Autowired + public void setDsl(DSLContext dsl) { + this.dsl = dsl; + } @Override - public Page getOwn(ProjectFilter filter, Pageable pageable, String userName) { - return getOwn(USER_FILTER_FETCHER, filter, pageable, userName); + public List findByFilter(Queryable filter) { + return USER_FILTER_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder( + filter, + filter.getFilterConditions() + .stream() + .map(ConvertibleCondition::getAllConditions) + .flatMap(Collection::stream) + .map(FilterCondition::getSearchCriteria) + .collect(Collectors.toSet()) + ).wrap().build())); } @Override - public Page getShared(ProjectFilter filter, Pageable pageable, String userName) { - return getShared(USER_FILTER_FETCHER, filter, pageable, userName); + public Page findByFilter(Queryable filter, Pageable pageable) { + Set fields = filter.getFilterConditions() + .stream() + .map(ConvertibleCondition::getAllConditions) + .flatMap(Collection::stream) + .map(FilterCondition::getSearchCriteria) + .collect(Collectors.toSet()); + fields.addAll(pageable.getSort().get().map(Sort.Order::getProperty).collect(Collectors.toSet())); + + return PageableExecutionUtils.getPage(USER_FILTER_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter, fields) + .with(pageable) + .wrap() + .withWrapperSort(pageable.getSort()) + .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter, fields).build())); } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetRepository.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetRepository.java index b2a336b2c..a734e1c80 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetRepository.java @@ -17,11 +17,12 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.widget.Widget; -import java.util.List; -import java.util.Optional; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; +import java.util.List; +import java.util.Optional; + /** * @author Pavel Bortnik */ @@ -70,10 +71,10 @@ List findAllByProjectIdAndWidgetTypeInAndContentFieldsContains( @Param("widgetTypes") List widgetTypes, @Param("contentField") String contentField); @Query(value = - "SELECT * FROM widget w JOIN shareable_entity se on w.id = se.id JOIN content_field cf on w.id = cf.id " + "SELECT * FROM widget w JOIN owned_entity se on w.id = se.id JOIN content_field cf on w.id = cf.id " + " WHERE se.project_id = :projectId AND w.widget_type IN :widgetTypes AND cf.field LIKE :contentFieldPart || '%'", nativeQuery = true) List findAllByProjectIdAndWidgetTypeInAndContentFieldContaining( @Param("projectId") Long projectId, @Param("widgetTypes") List widgetTypes, @Param("contentFieldPart") String contentFieldPart); -} +} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustom.java index 2be615c83..516db992a 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustom.java @@ -21,7 +21,7 @@ /** * @author Pavel Bortnik */ -public interface WidgetRepositoryCustom extends ShareableRepository { +public interface WidgetRepositoryCustom extends FilterableRepository { /** * Remove many to many relation between {@link com.epam.ta.reportportal.entity.filter.UserFilter} diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustomImpl.java index f3c82473d..f7867974e 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetRepositoryCustomImpl.java @@ -17,36 +17,39 @@ package com.epam.ta.reportportal.dao; import static com.epam.ta.reportportal.dao.util.ResultFetchers.WIDGET_FETCHER; -import static com.epam.ta.reportportal.jooq.tables.JShareableEntity.SHAREABLE_ENTITY; +import static com.epam.ta.reportportal.jooq.tables.JOwnedEntity.OWNED_ENTITY; import static com.epam.ta.reportportal.jooq.tables.JWidget.WIDGET; import static com.epam.ta.reportportal.jooq.tables.JWidgetFilter.WIDGET_FILTER; -import com.epam.ta.reportportal.commons.querygen.ProjectFilter; +import com.epam.ta.reportportal.commons.querygen.ConvertibleCondition; +import com.epam.ta.reportportal.commons.querygen.FilterCondition; +import com.epam.ta.reportportal.commons.querygen.QueryBuilder; +import com.epam.ta.reportportal.commons.querygen.Queryable; import com.epam.ta.reportportal.entity.widget.Widget; +import java.util.Collection; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import org.jooq.DSLContext; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.repository.support.PageableExecutionUtils; import org.springframework.stereotype.Repository; /** * @author Pavel Bortnik */ @Repository -public class WidgetRepositoryCustomImpl extends AbstractShareableRepositoryImpl implements +public class WidgetRepositoryCustomImpl implements WidgetRepositoryCustom { - @Override - public Page getPermitted(ProjectFilter filter, Pageable pageable, String userName) { - return getPermitted(WIDGET_FETCHER, filter, pageable, userName); - } + private final DSLContext dsl; - @Override - public Page getOwn(ProjectFilter filter, Pageable pageable, String userName) { - return getOwn(WIDGET_FETCHER, filter, pageable, userName); - } - - @Override - public Page getShared(ProjectFilter filter, Pageable pageable, String userName) { - return getShared(WIDGET_FETCHER, filter, pageable, userName); + @Autowired + public WidgetRepositoryCustomImpl(DSLContext dsl) { + this.dsl = dsl; } @Override @@ -56,10 +59,43 @@ public int deleteRelationByFilterIdAndNotOwner(Long filterId, String owner) { .from(WIDGET) .join(WIDGET_FILTER) .on(WIDGET.ID.eq(WIDGET_FILTER.WIDGET_ID)) - .join(SHAREABLE_ENTITY) - .on(WIDGET.ID.eq(SHAREABLE_ENTITY.ID)) + .join(OWNED_ENTITY) + .on(WIDGET.ID.eq(OWNED_ENTITY.ID)) .where(WIDGET_FILTER.FILTER_ID.eq(filterId)) - .and(SHAREABLE_ENTITY.OWNER.notEqual(owner)))) + .and(OWNED_ENTITY.OWNER.notEqual(owner)))) .execute(); } + + @Override + public List findByFilter(Queryable filter) { + return WIDGET_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder( + filter, + filter.getFilterConditions() + .stream() + .map(ConvertibleCondition::getAllConditions) + .flatMap(Collection::stream) + .map(FilterCondition::getSearchCriteria) + .collect(Collectors.toSet()) + ).wrap().build())); + } + + @Override + public Page findByFilter(Queryable filter, Pageable pageable) { + Set fields = filter.getFilterConditions() + .stream() + .map(ConvertibleCondition::getAllConditions) + .flatMap(Collection::stream) + .map(FilterCondition::getSearchCriteria) + .collect(Collectors.toSet()); + fields.addAll( + pageable.getSort().get().map(Sort.Order::getProperty).collect(Collectors.toSet())); + + return PageableExecutionUtils.getPage( + WIDGET_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter, fields) + .with(pageable) + .wrap() + .withWrapperSort(pageable.getSort()) + .build())), pageable, + () -> dsl.fetchCount(QueryBuilder.newBuilder(filter, fields).build())); + } } diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java index 8cfded51a..fcc9470b5 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java @@ -89,7 +89,6 @@ import com.epam.ta.reportportal.jooq.Tables; import com.epam.ta.reportportal.jooq.tables.JLog; import com.epam.ta.reportportal.ws.model.ErrorType; -import com.epam.ta.reportportal.ws.model.SharedEntity; import com.epam.ta.reportportal.ws.model.analyzer.IndexLaunch; import com.epam.ta.reportportal.ws.model.analyzer.IndexLog; import com.epam.ta.reportportal.ws.model.analyzer.IndexTestItem; @@ -424,9 +423,6 @@ public class RecordMappers { return activity; }; - public static final RecordMapper SHARED_ENTITY_MAPPER = r -> r.into( - SharedEntity.class); - private static final BiConsumer WIDGET_USER_FILTER_MAPPER = (widget, res) -> ofNullable( res.get(FILTER.ID)).ifPresent( id -> { @@ -548,7 +544,6 @@ public class RecordMappers { dashboardWidget.setWidgetOwner(r.get(DASHBOARD_WIDGET.WIDGET_OWNER)); dashboardWidget.setWidgetName(r.get(DASHBOARD_WIDGET.WIDGET_NAME)); dashboardWidget.setWidgetType(r.get(DASHBOARD_WIDGET.WIDGET_TYPE)); - dashboardWidget.setShare(r.get(DASHBOARD_WIDGET.SHARE)); final Widget widget = new Widget(); WIDGET_OPTIONS_MAPPER.accept(widget, r); dashboardWidget.setWidget(widget); diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/ResultFetchers.java b/src/main/java/com/epam/ta/reportportal/dao/util/ResultFetchers.java index 8d24c7d17..2e98bf560 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/ResultFetchers.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/ResultFetchers.java @@ -36,7 +36,6 @@ import static com.epam.ta.reportportal.jooq.Tables.LOG; import static com.epam.ta.reportportal.jooq.Tables.PARAMETER; import static com.epam.ta.reportportal.jooq.Tables.PROJECT_ATTRIBUTE; -import static com.epam.ta.reportportal.jooq.Tables.SHAREABLE_ENTITY; import static com.epam.ta.reportportal.jooq.tables.JProject.PROJECT; import static com.epam.ta.reportportal.jooq.tables.JProjectUser.PROJECT_USER; import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; @@ -68,18 +67,26 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.function.Function; import org.jooq.Record; import org.jooq.Result; import org.springframework.data.domain.Sort; import org.springframework.util.CollectionUtils; +import java.util.*; +import java.util.function.Function; + +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.PAGE_NUMBER; +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.TYPE; +import static com.epam.ta.reportportal.dao.constant.LogRepositoryConstants.LOG_LEVEL; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.ID; +import static com.epam.ta.reportportal.dao.util.RecordMappers.*; +import static com.epam.ta.reportportal.jooq.Tables.*; +import static com.epam.ta.reportportal.jooq.tables.JProject.PROJECT; +import static com.epam.ta.reportportal.jooq.tables.JProjectUser.PROJECT_USER; +import static com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; +import static com.epam.ta.reportportal.jooq.tables.JUsers.USERS; +import static java.util.Optional.ofNullable; + /** * Fetches results from db by JOOQ queries into Java objects. * @@ -87,6 +94,10 @@ */ public class ResultFetchers { + private ResultFetchers() { + //static only + } + /** * Fetches records from db results into list of {@link Project} objects. */ @@ -116,6 +127,7 @@ public class ResultFetchers { }); return new ArrayList<>(projects.values()); }; + /** * Fetches records from db results into list of {@link Launch} objects. */ @@ -135,6 +147,7 @@ public class ResultFetchers { }); return new ArrayList<>(launches.values()); }; + /** * Fetches records from db results into list of {@link TestItem} objects. */ @@ -164,6 +177,7 @@ public class ResultFetchers { }); return new ArrayList<>(testItems.values()); }; + /** * Fetches records from db results into list of {@link TestItem} objects. */ @@ -179,6 +193,7 @@ public class ResultFetchers { }); return new ArrayList<>(testItems.values()); }; + /** * Fetches records from db results into list of {@link com.epam.ta.reportportal.entity.log.Log} * objects. @@ -193,6 +208,7 @@ public class ResultFetchers { }); return new ArrayList<>(logs.values()); }; + /** * Fetches records from db results into list of {@link Activity} objects. */ @@ -210,6 +226,7 @@ public class ResultFetchers { }); return new ArrayList<>(activities.values()); }; + /** * Fetches records from db results into list of * {@link com.epam.ta.reportportal.entity.integration.Integration} objects. @@ -228,6 +245,7 @@ public class ResultFetchers { }); return new ArrayList<>(integrations.values()); }; + public static final Function, List> USER_FETCHER = records -> { Map users = Maps.newLinkedHashMap(); records.forEach(record -> { @@ -246,12 +264,14 @@ public class ResultFetchers { }); return new ArrayList<>(users.values()); }; + public static final Function, List> USER_WITHOUT_PROJECT_FETCHER = records -> { Map users = Maps.newLinkedHashMap(); records.forEach( record -> users.computeIfAbsent(record.get(USERS.ID), key -> record.map(USER_MAPPER))); return new ArrayList<>(users.values()); }; + public static final Function, List> USER_FILTER_FETCHER = result -> { Map userFilterMap = Maps.newLinkedHashMap(); result.forEach(r -> { @@ -261,10 +281,9 @@ record -> users.computeIfAbsent(record.get(USERS.ID), key -> record.map(USER_MAP userFilter = userFilterMap.get(userFilterID); } else { userFilter = r.into(UserFilter.class); - userFilter.setOwner(r.get(SHAREABLE_ENTITY.OWNER)); - userFilter.setShared(r.get(SHAREABLE_ENTITY.SHARED)); + userFilter.setOwner(r.get(OWNED_ENTITY.OWNER)); Project project = new Project(); - project.setId(r.get(SHAREABLE_ENTITY.PROJECT_ID, Long.class)); + project.setId(r.get(OWNED_ENTITY.PROJECT_ID, Long.class)); userFilter.setProject(project); } userFilter.getFilterCondition().add(r.into(FilterCondition.class)); @@ -277,6 +296,7 @@ record -> users.computeIfAbsent(record.get(USERS.ID), key -> record.map(USER_MAP }); return Lists.newArrayList(userFilterMap.values()); }; + public static final Function, List> DASHBOARD_FETCHER = result -> { Map dashboardMap = Maps.newLinkedHashMap(); result.forEach(r -> { @@ -286,10 +306,9 @@ record -> users.computeIfAbsent(record.get(USERS.ID), key -> record.map(USER_MAP dashboard = dashboardMap.get(dashboardId); } else { dashboard = r.into(Dashboard.class); - dashboard.setOwner(r.get(SHAREABLE_ENTITY.OWNER)); - dashboard.setShared(r.get(SHAREABLE_ENTITY.SHARED)); + dashboard.setOwner(r.get(OWNED_ENTITY.OWNER)); Project project = new Project(); - project.setId(r.get(SHAREABLE_ENTITY.PROJECT_ID, Long.class)); + project.setId(r.get(OWNED_ENTITY.PROJECT_ID, Long.class)); dashboard.setProject(project); } DASHBOARD_WIDGET_MAPPER.apply(r).ifPresent(it -> dashboard.getDashboardWidgets().add(it)); @@ -297,6 +316,7 @@ record -> users.computeIfAbsent(record.get(USERS.ID), key -> record.map(USER_MAP }); return Lists.newArrayList(dashboardMap.values()); }; + public static final Function, List> WIDGET_FETCHER = result -> { Map widgetMap = Maps.newLinkedHashMap(); result.forEach(r -> { @@ -306,16 +326,16 @@ record -> users.computeIfAbsent(record.get(USERS.ID), key -> record.map(USER_MAP widget = widgetMap.get(widgetId); } else { widget = r.into(Widget.class); - widget.setOwner(r.get(SHAREABLE_ENTITY.OWNER)); - widget.setShared(r.get(SHAREABLE_ENTITY.SHARED)); + widget.setOwner(r.get(OWNED_ENTITY.OWNER)); Project project = new Project(); - project.setId(r.get(SHAREABLE_ENTITY.PROJECT_ID, Long.class)); + project.setId(r.get(OWNED_ENTITY.PROJECT_ID, Long.class)); widget.setProject(project); } widgetMap.put(widgetId, widget); }); return Lists.newArrayList(widgetMap.values()); }; + public static final Function, List> NESTED_ITEM_FETCHER = result -> { List nestedItems = Lists.newArrayListWithExpectedSize(result.size()); result.forEach(record -> nestedItems.add(new NestedItem( @@ -325,6 +345,7 @@ record -> users.computeIfAbsent(record.get(USERS.ID), key -> record.map(USER_MAP ))); return nestedItems; }; + public static final Function, List> NESTED_ITEM_LOCATED_FETCHER = result -> { List itemWithLocation = Lists.newArrayListWithExpectedSize(result.size()); result.forEach(record -> itemWithLocation.add(new NestedItemPage(record.get(ID, Long.class), @@ -334,6 +355,7 @@ record -> users.computeIfAbsent(record.get(USERS.ID), key -> record.map(USER_MAP ))); return itemWithLocation; }; + public static final Function, ReportPortalUser> REPORTPORTAL_USER_FETCHER = records -> { if (!CollectionUtils.isEmpty(records)) { ReportPortalUser user = ReportPortalUser.userBuilder() @@ -363,8 +385,4 @@ record -> ofNullable(record.get(PROJECT_USER.PROJECT_ID, Long.class)).ifPresent( return null; }; - private ResultFetchers() { - //static only - } - } diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/ShareableUtils.java b/src/main/java/com/epam/ta/reportportal/dao/util/ShareableUtils.java deleted file mode 100644 index 9986f3191..000000000 --- a/src/main/java/com/epam/ta/reportportal/dao/util/ShareableUtils.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.dao.util; - -import com.epam.ta.reportportal.commons.querygen.FilterTarget; -import com.epam.ta.reportportal.jooq.tables.JAclEntry; -import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; -import com.epam.ta.reportportal.jooq.tables.JAclSid; -import com.epam.ta.reportportal.jooq.tables.JShareableEntity; -import org.jooq.Condition; -import org.jooq.impl.DSL; - -/** - * @author Pavel Bortnik - */ -public class ShareableUtils { - - private ShareableUtils() { - //static only - } - - /** - * Condition that retrieves entities only shared entities. - * - * @param userName Username - * @return Condition for shared entities - */ - public static Condition sharedCondition(String userName) { - return permittedCondition(userName).and(JShareableEntity.SHAREABLE_ENTITY.SHARED); - } - - /** - * Condition that retrieves entities permitted (shared + own) entities. - * - * @param userName Username - * @return Condition for permitted entities - */ - public static Condition permittedCondition(String userName) { - return JAclEntry.ACL_ENTRY.SID.in(DSL.select(JAclSid.ACL_SID.ID).from(JAclSid.ACL_SID) - .where(JAclSid.ACL_SID.SID.eq(userName))); - } - - /** - * Condition that retrieves entities of {@link FilterTarget} class only own entities. - * - * @param userName Username - * @return Condition for own entities - */ - public static Condition ownCondition(String userName) { - return JAclObjectIdentity.ACL_OBJECT_IDENTITY.OWNER_SID.in(DSL.select(JAclSid.ACL_SID.ID) - .from(JAclSid.ACL_SID) - .where(JAclSid.ACL_SID.SID.eq(userName))); - } - -} diff --git a/src/main/java/com/epam/ta/reportportal/entity/ShareableEntity.java b/src/main/java/com/epam/ta/reportportal/entity/OwnedEntity.java similarity index 82% rename from src/main/java/com/epam/ta/reportportal/entity/ShareableEntity.java rename to src/main/java/com/epam/ta/reportportal/entity/OwnedEntity.java index 9c5466103..f0f9c9596 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/ShareableEntity.java +++ b/src/main/java/com/epam/ta/reportportal/entity/OwnedEntity.java @@ -32,9 +32,9 @@ * @author Pavel Bortnik */ @Entity -@Table(name = "shareable_entity") +@Table(name = "owned_entity") @Inheritance(strategy = InheritanceType.JOINED) -public abstract class ShareableEntity { +public abstract class OwnedEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -42,11 +42,9 @@ public abstract class ShareableEntity { private String owner; - private boolean shared; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "project_id") - private Project project; + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "project_id") + private Project project; public Long getId() { return id; @@ -56,17 +54,9 @@ public void setId(Long id) { this.id = id; } - public boolean isShared() { - return shared; - } - - public void setShared(boolean shared) { - this.shared = shared; - } - public String getOwner() { - return owner; - } + return owner; + } public void setOwner(String owner) { this.owner = owner; @@ -79,4 +69,4 @@ public Project getProject() { public void setProject(Project project) { this.project = project; } -} +} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/entity/dashboard/Dashboard.java b/src/main/java/com/epam/ta/reportportal/entity/dashboard/Dashboard.java index 10a440d6d..e62ea3835 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/dashboard/Dashboard.java +++ b/src/main/java/com/epam/ta/reportportal/entity/dashboard/Dashboard.java @@ -16,7 +16,7 @@ package com.epam.ta.reportportal.entity.dashboard; -import com.epam.ta.reportportal.entity.ShareableEntity; +import com.epam.ta.reportportal.entity.OwnedEntity; import com.google.common.collect.Sets; import java.io.Serializable; import java.time.LocalDateTime; @@ -36,7 +36,7 @@ */ @Entity @EntityListeners(AuditingEntityListener.class) -public class Dashboard extends ShareableEntity implements Serializable { +public class Dashboard extends OwnedEntity implements Serializable { @Column(name = "name") private String name; diff --git a/src/main/java/com/epam/ta/reportportal/entity/dashboard/DashboardWidget.java b/src/main/java/com/epam/ta/reportportal/entity/dashboard/DashboardWidget.java index 7bbd8d7b1..01aa8d53c 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/dashboard/DashboardWidget.java +++ b/src/main/java/com/epam/ta/reportportal/entity/dashboard/DashboardWidget.java @@ -68,12 +68,9 @@ public class DashboardWidget implements Serializable { @Column(name = "widget_position_y") private int positionY; - @Column(name = "share") - private boolean share; - public DashboardWidgetId getId() { - return id; - } + return id; + } public void setId(DashboardWidgetId id) { this.id = id; @@ -159,22 +156,14 @@ public void setPositionY(int positionY) { this.positionY = positionY; } - public boolean isShare() { - return share; - } - - public void setShare(boolean share) { - this.share = share; - } - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } DashboardWidget that = (DashboardWidget) o; diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/FeatureFlag.java b/src/main/java/com/epam/ta/reportportal/entity/enums/FeatureFlag.java new file mode 100644 index 000000000..8feebfc48 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/FeatureFlag.java @@ -0,0 +1,35 @@ +package com.epam.ta.reportportal.entity.enums; + +import java.util.Arrays; +import java.util.Optional; + +/** + * Enumeration of current feature flags. + * + * @author Ivan Kustau + */ +public enum FeatureFlag { + SINGLE_BUCKET("singleBucket"); + + private final String name; + + FeatureFlag(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + /** + * Returns {@link Optional} of {@link FeatureFlag} by string. + * + * @param name Name of feature flag + * @return {@link Optional} of {@link FeatureFlag} by string + */ + public static Optional fromString(String name) { + return Optional.ofNullable(name).flatMap( + str -> Arrays.stream(values()).filter(it -> it.name.equalsIgnoreCase(str)).findAny()); + + } +} diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/LogicalOperator.java b/src/main/java/com/epam/ta/reportportal/entity/enums/LogicalOperator.java new file mode 100644 index 000000000..2b27dafc0 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/LogicalOperator.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 EPAM Systems + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.epam.ta.reportportal.entity.enums; + +import java.util.Arrays; +import java.util.Optional; + +/** + * @author Andrei Piankouski + */ +public enum LogicalOperator { + + AND("AND"), + OR("OR"); + + private final String value; + + LogicalOperator(String value) { + this.value = value; + } + + public static Optional findByName(String name) { + return Arrays.stream(LogicalOperator.values()).filter(val -> val.getOperator().equalsIgnoreCase(name)).findAny(); + } + + public static boolean isPresent(String name) { + return findByName(name).isPresent(); + } + + public String getOperator() { + return value; + } +} diff --git a/src/main/java/com/epam/ta/reportportal/entity/filter/UserFilter.java b/src/main/java/com/epam/ta/reportportal/entity/filter/UserFilter.java index 4db212506..d1490a6bc 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/filter/UserFilter.java +++ b/src/main/java/com/epam/ta/reportportal/entity/filter/UserFilter.java @@ -17,7 +17,7 @@ package com.epam.ta.reportportal.entity.filter; import com.epam.ta.reportportal.commons.querygen.FilterCondition; -import com.epam.ta.reportportal.entity.ShareableEntity; +import com.epam.ta.reportportal.entity.OwnedEntity; import com.epam.ta.reportportal.entity.enums.PostgreSQLEnumType; import com.google.common.collect.Sets; import java.io.Serializable; @@ -41,7 +41,7 @@ @Entity @Table(name = "filter") @TypeDef(name = "pgsql_enum", typeClass = PostgreSQLEnumType.class) -public class UserFilter extends ShareableEntity implements Serializable { +public class UserFilter extends OwnedEntity implements Serializable { @Column(name = "name") private String name; diff --git a/src/main/java/com/epam/ta/reportportal/entity/user/ApiKey.java b/src/main/java/com/epam/ta/reportportal/entity/user/ApiKey.java new file mode 100644 index 000000000..f47a6e5b6 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/entity/user/ApiKey.java @@ -0,0 +1,95 @@ +/* + * Copyright 2022 EPAM Systems + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.epam.ta.reportportal.entity.user; + +import java.time.LocalDateTime; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +/** + * Representation of ApiKeys table. + * + * @author Andrei Piankouski + */ +@Entity +@Table(name = "api_keys", schema = "public") +public class ApiKey { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private Long id; + + @Column(name = "name") + private String name; + + @Column(name = "hash") + private String hash; + + @Column(name = "created_at") + private LocalDateTime createdAt; + + @Column(name = "user_id") + private Long userId; + + public ApiKey() { + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getHash() { + return hash; + } + + public void setHash(String hash) { + this.hash = hash; + } + + public LocalDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(LocalDateTime createdAt) { + this.createdAt = createdAt; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } +} diff --git a/src/main/java/com/epam/ta/reportportal/entity/widget/Widget.java b/src/main/java/com/epam/ta/reportportal/entity/widget/Widget.java index ab0f49886..88b08038b 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/widget/Widget.java +++ b/src/main/java/com/epam/ta/reportportal/entity/widget/Widget.java @@ -16,7 +16,7 @@ package com.epam.ta.reportportal.entity.widget; -import com.epam.ta.reportportal.entity.ShareableEntity; +import com.epam.ta.reportportal.entity.OwnedEntity; import com.epam.ta.reportportal.entity.dashboard.DashboardWidget; import com.epam.ta.reportportal.entity.filter.UserFilter; import com.google.common.collect.Sets; @@ -44,7 +44,7 @@ @Entity @Table(name = "widget") @TypeDef(name = "widgetOptions", typeClass = WidgetOptions.class) -public class Widget extends ShareableEntity implements Serializable { +public class Widget extends OwnedEntity implements Serializable { @Column(name = "name") private String name; diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java index 84d417618..e2601b95b 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java @@ -16,8 +16,10 @@ package com.epam.ta.reportportal.filesystem.distributed.s3; +import com.epam.ta.reportportal.entity.enums.FeatureFlag; import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.filesystem.DataStore; +import com.epam.ta.reportportal.util.FeatureFlagHandler; import com.epam.ta.reportportal.ws.model.ErrorType; import java.io.IOException; import java.io.InputStream; @@ -46,12 +48,24 @@ public class S3DataStore implements DataStore { private final String defaultBucketName; private final Location location; + private final FeatureFlagHandler featureFlagHandler; + + /** + * Initialises {@link S3DataStore}. + * + * @param blobStore {@link BlobStore} + * @param bucketPrefix Prefix for bucket name + * @param defaultBucketName Name of default bucket to use + * @param region Region to use + * @param featureFlagHandler {@link FeatureFlagHandler} + */ public S3DataStore(BlobStore blobStore, String bucketPrefix, String defaultBucketName, - String region) { + String region, FeatureFlagHandler featureFlagHandler) { this.blobStore = blobStore; this.bucketPrefix = bucketPrefix; this.defaultBucketName = defaultBucketName; this.location = getLocationFromString(region); + this.featureFlagHandler = featureFlagHandler; } @Override @@ -69,11 +83,8 @@ public String save(String filePath, InputStream inputStream) { } } - Blob objectBlob = blobStore.blobBuilder(s3File.getFilePath()) - .payload(inputStream) - .contentDisposition(s3File.getFilePath()) - .contentLength(inputStream.available()) - .build(); + Blob objectBlob = blobStore.blobBuilder(s3File.getFilePath()).payload(inputStream) + .contentDisposition(s3File.getFilePath()).contentLength(inputStream.available()).build(); blobStore.putBlob(s3File.getBucket(), objectBlob); return Paths.get(filePath).toString(); } catch (IOException e) { @@ -86,7 +97,12 @@ public String save(String filePath, InputStream inputStream) { public InputStream load(String filePath) { S3File s3File = getS3File(filePath); try { - return blobStore.getBlob(s3File.getBucket(), s3File.getFilePath()).getPayload().openStream(); + Blob fileBlob = blobStore.getBlob(s3File.getBucket(), s3File.getFilePath()); + if (fileBlob != null) { + return fileBlob.getPayload().openStream(); + } else { + throw new Exception(); + } } catch (Exception e) { LOGGER.error("Unable to find file '{}'", filePath, e); throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); @@ -105,11 +121,15 @@ public void delete(String filePath) { } private S3File getS3File(String filePath) { + if (featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { + return new S3File(defaultBucketName, filePath); + } Path targetPath = Paths.get(filePath); int nameCount = targetPath.getNameCount(); if (nameCount > 1) { return new S3File(bucketPrefix + retrievePath(targetPath, 0, 1), - retrievePath(targetPath, 1, nameCount)); + retrievePath(targetPath, 1, nameCount) + ); } else { return new S3File(defaultBucketName, retrievePath(targetPath, 0, 1)); } @@ -119,11 +139,9 @@ private S3File getS3File(String filePath) { private Location getLocationFromString(String locationString) { Location location = null; if (locationString != null) { - location = new LocationBuilder() - .scope(LocationScope.REGION) - .id(locationString) - .description("region") - .build(); + location = + new LocationBuilder().scope(LocationScope.REGION).id(locationString).description("region") + .build(); } return location; } @@ -131,4 +149,4 @@ private Location getLocationFromString(String locationString) { private String retrievePath(Path path, int beginIndex, int endIndex) { return String.valueOf(path.subpath(beginIndex, endIndex)); } -} +} \ No newline at end of file diff --git a/src/main/java/com/epam/ta/reportportal/jooq/DefaultCatalog.java b/src/main/java/com/epam/ta/reportportal/jooq/DefaultCatalog.java old mode 100755 new mode 100644 index 7750178ac..4aa1da4ff --- a/src/main/java/com/epam/ta/reportportal/jooq/DefaultCatalog.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/DefaultCatalog.java @@ -7,7 +7,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Schema; import org.jooq.impl.CatalogImpl; @@ -22,35 +24,37 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class DefaultCatalog extends CatalogImpl { - /** - * The reference instance of - */ - public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog(); - private static final long serialVersionUID = 312084026; - /** - * The schema public. - */ - public final JPublic PUBLIC = com.epam.ta.reportportal.jooq.JPublic.PUBLIC; - - /** - * No further instances allowed - */ - private DefaultCatalog() { - super(""); - } - - @Override - public final List getSchemas() { - List result = new ArrayList(); - result.addAll(getSchemas0()); - return result; - } - - private final List getSchemas0() { - return Arrays.asList( - JPublic.PUBLIC); - } + private static final long serialVersionUID = 312084026; + + /** + * The reference instance of + */ + public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog(); + + /** + * The schema public. + */ + public final JPublic PUBLIC = com.epam.ta.reportportal.jooq.JPublic.PUBLIC; + + /** + * No further instances allowed + */ + private DefaultCatalog() { + super(""); + } + + @Override + public final List getSchemas() { + List result = new ArrayList(); + result.addAll(getSchemas0()); + return result; + } + + private final List getSchemas0() { + return Arrays.asList( + JPublic.PUBLIC); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java b/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java old mode 100755 new mode 100644 index 8c16731f6..1516b2579 --- a/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java @@ -4,11 +4,8 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.JAclClass; -import com.epam.ta.reportportal.jooq.tables.JAclEntry; -import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; -import com.epam.ta.reportportal.jooq.tables.JAclSid; import com.epam.ta.reportportal.jooq.tables.JActivity; +import com.epam.ta.reportportal.jooq.tables.JApiKeys; import com.epam.ta.reportportal.jooq.tables.JAttachment; import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; import com.epam.ta.reportportal.jooq.tables.JAttribute; @@ -38,6 +35,9 @@ import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; import com.epam.ta.reportportal.jooq.tables.JOnboarding; +import com.epam.ta.reportportal.jooq.tables.JOrganization; +import com.epam.ta.reportportal.jooq.tables.JOrganizationAttribute; +import com.epam.ta.reportportal.jooq.tables.JOwnedEntity; import com.epam.ta.reportportal.jooq.tables.JParameter; import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; @@ -48,7 +48,7 @@ import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; import com.epam.ta.reportportal.jooq.tables.JSenderCase; import com.epam.ta.reportportal.jooq.tables.JServerSettings; -import com.epam.ta.reportportal.jooq.tables.JShareableEntity; +import com.epam.ta.reportportal.jooq.tables.JShedlock; import com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView; import com.epam.ta.reportportal.jooq.tables.JStatistics; import com.epam.ta.reportportal.jooq.tables.JStatisticsField; @@ -60,7 +60,9 @@ import com.epam.ta.reportportal.jooq.tables.JUsers; import com.epam.ta.reportportal.jooq.tables.JWidget; import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; + import javax.annotation.processing.Generated; + import org.jooq.Index; import org.jooq.OrderField; import org.jooq.impl.Internal; @@ -76,512 +78,284 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Indexes { - // ------------------------------------------------------------------------- - // INDEX definitions - // ------------------------------------------------------------------------- - - public static final Index ACL_CLASS_PKEY = Indexes0.ACL_CLASS_PKEY; - public static final Index UNIQUE_UK_2 = Indexes0.UNIQUE_UK_2; - public static final Index ACL_ENTRY_PKEY = Indexes0.ACL_ENTRY_PKEY; - public static final Index UNIQUE_UK_4 = Indexes0.UNIQUE_UK_4; - public static final Index ACL_OBJECT_IDENTITY_PKEY = Indexes0.ACL_OBJECT_IDENTITY_PKEY; - public static final Index UNIQUE_UK_3 = Indexes0.UNIQUE_UK_3; - public static final Index ACL_SID_IDX = Indexes0.ACL_SID_IDX; - public static final Index ACL_SID_PKEY = Indexes0.ACL_SID_PKEY; - public static final Index UNIQUE_UK_1 = Indexes0.UNIQUE_UK_1; - public static final Index ACTIVITY_CREATION_DATE_IDX = Indexes0.ACTIVITY_CREATION_DATE_IDX; - public static final Index ACTIVITY_OBJECT_IDX = Indexes0.ACTIVITY_OBJECT_IDX; - public static final Index ACTIVITY_PK = Indexes0.ACTIVITY_PK; - public static final Index ACTIVITY_PROJECT_IDX = Indexes0.ACTIVITY_PROJECT_IDX; - public static final Index ATT_ITEM_IDX = Indexes0.ATT_ITEM_IDX; - public static final Index ATT_LAUNCH_IDX = Indexes0.ATT_LAUNCH_IDX; - public static final Index ATT_PROJECT_IDX = Indexes0.ATT_PROJECT_IDX; - public static final Index ATTACHMENT_PK = Indexes0.ATTACHMENT_PK; - public static final Index ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX = Indexes0.ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX; - public static final Index ATTACHMENT_DELETION_PKEY = Indexes0.ATTACHMENT_DELETION_PKEY; - public static final Index ATTRIBUTE_PK = Indexes0.ATTRIBUTE_PK; - public static final Index CLUSTER_INDEX_ID_IDX = Indexes0.CLUSTER_INDEX_ID_IDX; - public static final Index CLUSTER_LAUNCH_IDX = Indexes0.CLUSTER_LAUNCH_IDX; - public static final Index CLUSTER_PROJECT_IDX = Indexes0.CLUSTER_PROJECT_IDX; - public static final Index CLUSTERS_PK = Indexes0.CLUSTERS_PK; - public static final Index INDEX_ID_LAUNCH_ID_UNQ = Indexes0.INDEX_ID_LAUNCH_ID_UNQ; - public static final Index CLUSTER_ITEM_CLUSTER_IDX = Indexes0.CLUSTER_ITEM_CLUSTER_IDX; - public static final Index CLUSTER_ITEM_ITEM_IDX = Indexes0.CLUSTER_ITEM_ITEM_IDX; - public static final Index CLUSTER_ITEM_UNQ = Indexes0.CLUSTER_ITEM_UNQ; - public static final Index CONTENT_FIELD_IDX = Indexes0.CONTENT_FIELD_IDX; - public static final Index CONTENT_FIELD_WIDGET_IDX = Indexes0.CONTENT_FIELD_WIDGET_IDX; - public static final Index DASHBOARD_PKEY = Indexes0.DASHBOARD_PKEY; - public static final Index DASHBOARD_WIDGET_PK = Indexes0.DASHBOARD_WIDGET_PK; - public static final Index WIDGET_ON_DASHBOARD_UNQ = Indexes0.WIDGET_ON_DASHBOARD_UNQ; - public static final Index FILTER_PKEY = Indexes0.FILTER_PKEY; - public static final Index FILTER_COND_FILTER_IDX = Indexes0.FILTER_COND_FILTER_IDX; - public static final Index FILTER_CONDITION_PK = Indexes0.FILTER_CONDITION_PK; - public static final Index FILTER_SORT_FILTER_IDX = Indexes0.FILTER_SORT_FILTER_IDX; - public static final Index FILTER_SORT_PK = Indexes0.FILTER_SORT_PK; - public static final Index INTEGR_PROJECT_IDX = Indexes0.INTEGR_PROJECT_IDX; - public static final Index INTEGRATION_PK = Indexes0.INTEGRATION_PK; - public static final Index UNIQUE_GLOBAL_INTEGRATION_NAME = Indexes0.UNIQUE_GLOBAL_INTEGRATION_NAME; - public static final Index UNIQUE_PROJECT_INTEGRATION_NAME = Indexes0.UNIQUE_PROJECT_INTEGRATION_NAME; - public static final Index INTEGRATION_TYPE_NAME_KEY = Indexes0.INTEGRATION_TYPE_NAME_KEY; - public static final Index INTEGRATION_TYPE_PK = Indexes0.INTEGRATION_TYPE_PK; - public static final Index ISSUE_IT_IDX = Indexes0.ISSUE_IT_IDX; - public static final Index ISSUE_PK = Indexes0.ISSUE_PK; - public static final Index ISSUE_GROUP_PK = Indexes0.ISSUE_GROUP_PK; - public static final Index ISSUE_TICKET_PK = Indexes0.ISSUE_TICKET_PK; - public static final Index ISSUE_TYPE_GROUP_IDX = Indexes0.ISSUE_TYPE_GROUP_IDX; - public static final Index ISSUE_TYPE_LOCATOR_KEY = Indexes0.ISSUE_TYPE_LOCATOR_KEY; - public static final Index ISSUE_TYPE_PK = Indexes0.ISSUE_TYPE_PK; - public static final Index ISSUE_TYPE_PROJECT_PK = Indexes0.ISSUE_TYPE_PROJECT_PK; - public static final Index ITEM_ATTR_LAUNCH_IDX = Indexes0.ITEM_ATTR_LAUNCH_IDX; - public static final Index ITEM_ATTR_TI_IDX = Indexes0.ITEM_ATTR_TI_IDX; - public static final Index ITEM_ATTRIBUTE_PK = Indexes0.ITEM_ATTRIBUTE_PK; - public static final Index LAUNCH_PK = Indexes0.LAUNCH_PK; - public static final Index LAUNCH_PROJECT_START_TIME_IDX = Indexes0.LAUNCH_PROJECT_START_TIME_IDX; - public static final Index LAUNCH_USER_IDX = Indexes0.LAUNCH_USER_IDX; - public static final Index LAUNCH_UUID_KEY = Indexes0.LAUNCH_UUID_KEY; - public static final Index UNQ_NAME_NUMBER = Indexes0.UNQ_NAME_NUMBER; - public static final Index L_ATTR_RL_SEND_CASE_IDX = Indexes0.L_ATTR_RL_SEND_CASE_IDX; - public static final Index LAUNCH_ATTRIBUTE_RULES_PK = Indexes0.LAUNCH_ATTRIBUTE_RULES_PK; - public static final Index LN_SEND_CASE_IDX = Indexes0.LN_SEND_CASE_IDX; - public static final Index LAUNCH_NUMBER_PK = Indexes0.LAUNCH_NUMBER_PK; - public static final Index UNQ_PROJECT_NAME = Indexes0.UNQ_PROJECT_NAME; - public static final Index LOG_ATTACH_ID_IDX = Indexes0.LOG_ATTACH_ID_IDX; - public static final Index LOG_CLUSTER_IDX = Indexes0.LOG_CLUSTER_IDX; - public static final Index LOG_LAUNCH_ID_IDX = Indexes0.LOG_LAUNCH_ID_IDX; - public static final Index LOG_MESSAGE_TRGM_IDX = Indexes0.LOG_MESSAGE_TRGM_IDX; - public static final Index LOG_PK = Indexes0.LOG_PK; - public static final Index LOG_PROJECT_ID_LOG_TIME_IDX = Indexes0.LOG_PROJECT_ID_LOG_TIME_IDX; - public static final Index LOG_PROJECT_IDX = Indexes0.LOG_PROJECT_IDX; - public static final Index LOG_TI_IDX = Indexes0.LOG_TI_IDX; - public static final Index OAUTH_ACCESS_TOKEN_PKEY = Indexes0.OAUTH_ACCESS_TOKEN_PKEY; - public static final Index OAUTH_AT_USER_IDX = Indexes0.OAUTH_AT_USER_IDX; - public static final Index USERS_ACCESS_TOKEN_UNIQUE = Indexes0.USERS_ACCESS_TOKEN_UNIQUE; - public static final Index OAUTH_REGISTRATION_CLIENT_ID_KEY = Indexes0.OAUTH_REGISTRATION_CLIENT_ID_KEY; - public static final Index OAUTH_REGISTRATION_PKEY = Indexes0.OAUTH_REGISTRATION_PKEY; - public static final Index OAUTH_REGISTRATION_RESTRICTION_PK = Indexes0.OAUTH_REGISTRATION_RESTRICTION_PK; - public static final Index OAUTH_REGISTRATION_RESTRICTION_UNIQUE = Indexes0.OAUTH_REGISTRATION_RESTRICTION_UNIQUE; - public static final Index OAUTH_REGISTRATION_SCOPE_PK = Indexes0.OAUTH_REGISTRATION_SCOPE_PK; - public static final Index OAUTH_REGISTRATION_SCOPE_UNIQUE = Indexes0.OAUTH_REGISTRATION_SCOPE_UNIQUE; - public static final Index ONBOARDING_PK = Indexes0.ONBOARDING_PK; - public static final Index PARAMETER_TI_IDX = Indexes0.PARAMETER_TI_IDX; - public static final Index PATTERN_TEMPLATE_PK = Indexes0.PATTERN_TEMPLATE_PK; - public static final Index UNQ_NAME_PROJECTID = Indexes0.UNQ_NAME_PROJECTID; - public static final Index PATTERN_ITEM_ITEM_ID_IDX = Indexes0.PATTERN_ITEM_ITEM_ID_IDX; - public static final Index PATTERN_ITEM_UNQ = Indexes0.PATTERN_ITEM_UNQ; - public static final Index PROJECT_NAME_KEY = Indexes0.PROJECT_NAME_KEY; - public static final Index PROJECT_PK = Indexes0.PROJECT_PK; - public static final Index UNIQUE_ATTRIBUTE_PER_PROJECT = Indexes0.UNIQUE_ATTRIBUTE_PER_PROJECT; - public static final Index USERS_PROJECT_PK = Indexes0.USERS_PROJECT_PK; - public static final Index RCPNT_SEND_CASE_IDX = Indexes0.RCPNT_SEND_CASE_IDX; - public static final Index RESTORE_PASSWORD_BID_EMAIL_KEY = Indexes0.RESTORE_PASSWORD_BID_EMAIL_KEY; - public static final Index RESTORE_PASSWORD_BID_PK = Indexes0.RESTORE_PASSWORD_BID_PK; - public static final Index SENDER_CASE_PK = Indexes0.SENDER_CASE_PK; - public static final Index SENDER_CASE_PROJECT_IDX = Indexes0.SENDER_CASE_PROJECT_IDX; - public static final Index SERVER_SETTINGS_ID = Indexes0.SERVER_SETTINGS_ID; - public static final Index SERVER_SETTINGS_KEY_KEY = Indexes0.SERVER_SETTINGS_KEY_KEY; - public static final Index SHAREABLE_PK = Indexes0.SHAREABLE_PK; - public static final Index SHARED_ENTITY_OWNERX = Indexes0.SHARED_ENTITY_OWNERX; - public static final Index SHARED_ENTITY_PROJECT_IDX = Indexes0.SHARED_ENTITY_PROJECT_IDX; - public static final Index STALE_MATERIALIZED_VIEW_NAME_KEY = Indexes0.STALE_MATERIALIZED_VIEW_NAME_KEY; - public static final Index STALE_MATERIALIZED_VIEW_PKEY = Indexes0.STALE_MATERIALIZED_VIEW_PKEY; - public static final Index STALE_MV_CREATION_DATE_IDX = Indexes0.STALE_MV_CREATION_DATE_IDX; - public static final Index STATISTICS_LAUNCH_IDX = Indexes0.STATISTICS_LAUNCH_IDX; - public static final Index STATISTICS_PK = Indexes0.STATISTICS_PK; - public static final Index STATISTICS_TI_IDX = Indexes0.STATISTICS_TI_IDX; - public static final Index UNIQUE_STATS_ITEM = Indexes0.UNIQUE_STATS_ITEM; - public static final Index UNIQUE_STATS_LAUNCH = Indexes0.UNIQUE_STATS_LAUNCH; - public static final Index STATISTICS_FIELD_NAME_KEY = Indexes0.STATISTICS_FIELD_NAME_KEY; - public static final Index STATISTICS_FIELD_PK = Indexes0.STATISTICS_FIELD_PK; - public static final Index ITEM_TEST_CASE_ID_LAUNCH_ID_IDX = Indexes0.ITEM_TEST_CASE_ID_LAUNCH_ID_IDX; - public static final Index PATH_GIST_IDX = Indexes0.PATH_GIST_IDX; - public static final Index PATH_IDX = Indexes0.PATH_IDX; - public static final Index TEST_CASE_HASH_LAUNCH_ID_IDX = Indexes0.TEST_CASE_HASH_LAUNCH_ID_IDX; - public static final Index TEST_ITEM_PK = Indexes0.TEST_ITEM_PK; - public static final Index TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX = Indexes0.TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX; - public static final Index TEST_ITEM_UUID_KEY = Indexes0.TEST_ITEM_UUID_KEY; - public static final Index TI_LAUNCH_IDX = Indexes0.TI_LAUNCH_IDX; - public static final Index TI_PARENT_IDX = Indexes0.TI_PARENT_IDX; - public static final Index TI_RETRY_OF_IDX = Indexes0.TI_RETRY_OF_IDX; - public static final Index TEST_ITEM_RESULTS_PK = Indexes0.TEST_ITEM_RESULTS_PK; - public static final Index TICKET_ID_IDX = Indexes0.TICKET_ID_IDX; - public static final Index TICKET_PK = Indexes0.TICKET_PK; - public static final Index TICKET_SUBMITTER_IDX = Indexes0.TICKET_SUBMITTER_IDX; - public static final Index USER_BID_PROJECT_IDX = Indexes0.USER_BID_PROJECT_IDX; - public static final Index USER_CREATION_BID_PK = Indexes0.USER_CREATION_BID_PK; - public static final Index USER_PREFERENCE_PK = Indexes0.USER_PREFERENCE_PK; - public static final Index USER_PREFERENCE_UQ = Indexes0.USER_PREFERENCE_UQ; - public static final Index USERS_EMAIL_KEY = Indexes0.USERS_EMAIL_KEY; - public static final Index USERS_LOGIN_KEY = Indexes0.USERS_LOGIN_KEY; - public static final Index USERS_PK = Indexes0.USERS_PK; - public static final Index WIDGET_PKEY = Indexes0.WIDGET_PKEY; - public static final Index WIDGET_FILTER_PK = Indexes0.WIDGET_FILTER_PK; + // ------------------------------------------------------------------------- + // INDEX definitions + // ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- - // [#1459] distribute members to avoid static initialisers > 64kb - // ------------------------------------------------------------------------- + public static final Index ACTIVITY_CREATION_DATE_IDX = Indexes0.ACTIVITY_CREATION_DATE_IDX; + public static final Index ACTIVITY_OBJECT_IDX = Indexes0.ACTIVITY_OBJECT_IDX; + public static final Index ACTIVITY_PK = Indexes0.ACTIVITY_PK; + public static final Index ACTIVITY_PROJECT_IDX = Indexes0.ACTIVITY_PROJECT_IDX; + public static final Index API_KEYS_PKEY = Indexes0.API_KEYS_PKEY; + public static final Index HASH_API_KEYS_IDX = Indexes0.HASH_API_KEYS_IDX; + public static final Index USERS_API_KEYS_UNIQUE = Indexes0.USERS_API_KEYS_UNIQUE; + public static final Index ATT_ITEM_IDX = Indexes0.ATT_ITEM_IDX; + public static final Index ATT_LAUNCH_IDX = Indexes0.ATT_LAUNCH_IDX; + public static final Index ATT_PROJECT_IDX = Indexes0.ATT_PROJECT_IDX; + public static final Index ATTACHMENT_PK = Indexes0.ATTACHMENT_PK; + public static final Index ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX = Indexes0.ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX; + public static final Index ATTACHMENT_DELETION_PKEY = Indexes0.ATTACHMENT_DELETION_PKEY; + public static final Index ATTRIBUTE_PK = Indexes0.ATTRIBUTE_PK; + public static final Index CLUSTER_INDEX_ID_IDX = Indexes0.CLUSTER_INDEX_ID_IDX; + public static final Index CLUSTER_LAUNCH_IDX = Indexes0.CLUSTER_LAUNCH_IDX; + public static final Index CLUSTER_PROJECT_IDX = Indexes0.CLUSTER_PROJECT_IDX; + public static final Index CLUSTERS_PK = Indexes0.CLUSTERS_PK; + public static final Index INDEX_ID_LAUNCH_ID_UNQ = Indexes0.INDEX_ID_LAUNCH_ID_UNQ; + public static final Index CLUSTER_ITEM_CLUSTER_IDX = Indexes0.CLUSTER_ITEM_CLUSTER_IDX; + public static final Index CLUSTER_ITEM_ITEM_IDX = Indexes0.CLUSTER_ITEM_ITEM_IDX; + public static final Index CLUSTER_ITEM_UNQ = Indexes0.CLUSTER_ITEM_UNQ; + public static final Index CONTENT_FIELD_IDX = Indexes0.CONTENT_FIELD_IDX; + public static final Index CONTENT_FIELD_WIDGET_IDX = Indexes0.CONTENT_FIELD_WIDGET_IDX; + public static final Index DASHBOARD_PKEY = Indexes0.DASHBOARD_PKEY; + public static final Index DASHBOARD_WIDGET_PK = Indexes0.DASHBOARD_WIDGET_PK; + public static final Index WIDGET_ON_DASHBOARD_UNQ = Indexes0.WIDGET_ON_DASHBOARD_UNQ; + public static final Index FILTER_PKEY = Indexes0.FILTER_PKEY; + public static final Index FILTER_COND_FILTER_IDX = Indexes0.FILTER_COND_FILTER_IDX; + public static final Index FILTER_CONDITION_PK = Indexes0.FILTER_CONDITION_PK; + public static final Index FILTER_SORT_FILTER_IDX = Indexes0.FILTER_SORT_FILTER_IDX; + public static final Index FILTER_SORT_PK = Indexes0.FILTER_SORT_PK; + public static final Index INTEGR_PROJECT_IDX = Indexes0.INTEGR_PROJECT_IDX; + public static final Index INTEGRATION_PK = Indexes0.INTEGRATION_PK; + public static final Index UNIQUE_GLOBAL_INTEGRATION_NAME = Indexes0.UNIQUE_GLOBAL_INTEGRATION_NAME; + public static final Index UNIQUE_PROJECT_INTEGRATION_NAME = Indexes0.UNIQUE_PROJECT_INTEGRATION_NAME; + public static final Index INTEGRATION_TYPE_NAME_KEY = Indexes0.INTEGRATION_TYPE_NAME_KEY; + public static final Index INTEGRATION_TYPE_PK = Indexes0.INTEGRATION_TYPE_PK; + public static final Index ISSUE_IT_IDX = Indexes0.ISSUE_IT_IDX; + public static final Index ISSUE_PK = Indexes0.ISSUE_PK; + public static final Index ISSUE_GROUP_PK = Indexes0.ISSUE_GROUP_PK; + public static final Index ISSUE_TICKET_PK = Indexes0.ISSUE_TICKET_PK; + public static final Index ISSUE_TYPE_GROUP_IDX = Indexes0.ISSUE_TYPE_GROUP_IDX; + public static final Index ISSUE_TYPE_LOCATOR_KEY = Indexes0.ISSUE_TYPE_LOCATOR_KEY; + public static final Index ISSUE_TYPE_PK = Indexes0.ISSUE_TYPE_PK; + public static final Index ISSUE_TYPE_PROJECT_PK = Indexes0.ISSUE_TYPE_PROJECT_PK; + public static final Index ITEM_ATTR_LAUNCH_IDX = Indexes0.ITEM_ATTR_LAUNCH_IDX; + public static final Index ITEM_ATTR_TI_IDX = Indexes0.ITEM_ATTR_TI_IDX; + public static final Index ITEM_ATTRIBUTE_PK = Indexes0.ITEM_ATTRIBUTE_PK; + public static final Index LAUNCH_PK = Indexes0.LAUNCH_PK; + public static final Index LAUNCH_PROJECT_START_TIME_IDX = Indexes0.LAUNCH_PROJECT_START_TIME_IDX; + public static final Index LAUNCH_USER_IDX = Indexes0.LAUNCH_USER_IDX; + public static final Index LAUNCH_UUID_KEY = Indexes0.LAUNCH_UUID_KEY; + public static final Index UNQ_NAME_NUMBER = Indexes0.UNQ_NAME_NUMBER; + public static final Index L_ATTR_RL_SEND_CASE_IDX = Indexes0.L_ATTR_RL_SEND_CASE_IDX; + public static final Index LAUNCH_ATTRIBUTE_RULES_PK = Indexes0.LAUNCH_ATTRIBUTE_RULES_PK; + public static final Index LN_SEND_CASE_IDX = Indexes0.LN_SEND_CASE_IDX; + public static final Index LAUNCH_NUMBER_PK = Indexes0.LAUNCH_NUMBER_PK; + public static final Index UNQ_PROJECT_NAME = Indexes0.UNQ_PROJECT_NAME; + public static final Index LOG_ATTACH_ID_IDX = Indexes0.LOG_ATTACH_ID_IDX; + public static final Index LOG_CLUSTER_IDX = Indexes0.LOG_CLUSTER_IDX; + public static final Index LOG_LAUNCH_ID_IDX = Indexes0.LOG_LAUNCH_ID_IDX; + public static final Index LOG_MESSAGE_TRGM_IDX = Indexes0.LOG_MESSAGE_TRGM_IDX; + public static final Index LOG_PK = Indexes0.LOG_PK; + public static final Index LOG_PROJECT_ID_LOG_TIME_IDX = Indexes0.LOG_PROJECT_ID_LOG_TIME_IDX; + public static final Index LOG_PROJECT_IDX = Indexes0.LOG_PROJECT_IDX; + public static final Index LOG_TI_IDX = Indexes0.LOG_TI_IDX; + public static final Index OAUTH_ACCESS_TOKEN_PKEY = Indexes0.OAUTH_ACCESS_TOKEN_PKEY; + public static final Index OAUTH_AT_USER_IDX = Indexes0.OAUTH_AT_USER_IDX; + public static final Index USERS_ACCESS_TOKEN_UNIQUE = Indexes0.USERS_ACCESS_TOKEN_UNIQUE; + public static final Index OAUTH_REGISTRATION_CLIENT_ID_KEY = Indexes0.OAUTH_REGISTRATION_CLIENT_ID_KEY; + public static final Index OAUTH_REGISTRATION_PKEY = Indexes0.OAUTH_REGISTRATION_PKEY; + public static final Index OAUTH_REGISTRATION_RESTRICTION_PK = Indexes0.OAUTH_REGISTRATION_RESTRICTION_PK; + public static final Index OAUTH_REGISTRATION_RESTRICTION_UNIQUE = Indexes0.OAUTH_REGISTRATION_RESTRICTION_UNIQUE; + public static final Index OAUTH_REGISTRATION_SCOPE_PK = Indexes0.OAUTH_REGISTRATION_SCOPE_PK; + public static final Index OAUTH_REGISTRATION_SCOPE_UNIQUE = Indexes0.OAUTH_REGISTRATION_SCOPE_UNIQUE; + public static final Index ONBOARDING_PK = Indexes0.ONBOARDING_PK; + public static final Index ORGANIZATION_PKEY = Indexes0.ORGANIZATION_PKEY; + public static final Index ORGANIZATION_ATTRIBUTE_PKEY = Indexes0.ORGANIZATION_ATTRIBUTE_PKEY; + public static final Index SHAREABLE_PK = Indexes0.SHAREABLE_PK; + public static final Index SHARED_ENTITY_OWNERX = Indexes0.SHARED_ENTITY_OWNERX; + public static final Index SHARED_ENTITY_PROJECT_IDX = Indexes0.SHARED_ENTITY_PROJECT_IDX; + public static final Index PARAMETER_TI_IDX = Indexes0.PARAMETER_TI_IDX; + public static final Index PATTERN_TEMPLATE_PK = Indexes0.PATTERN_TEMPLATE_PK; + public static final Index UNQ_NAME_PROJECTID = Indexes0.UNQ_NAME_PROJECTID; + public static final Index PATTERN_ITEM_ITEM_ID_IDX = Indexes0.PATTERN_ITEM_ITEM_ID_IDX; + public static final Index PATTERN_ITEM_UNQ = Indexes0.PATTERN_ITEM_UNQ; + public static final Index PROJECT_NAME_KEY = Indexes0.PROJECT_NAME_KEY; + public static final Index PROJECT_PK = Indexes0.PROJECT_PK; + public static final Index UNIQUE_ATTRIBUTE_PER_PROJECT = Indexes0.UNIQUE_ATTRIBUTE_PER_PROJECT; + public static final Index USERS_PROJECT_PK = Indexes0.USERS_PROJECT_PK; + public static final Index RCPNT_SEND_CASE_IDX = Indexes0.RCPNT_SEND_CASE_IDX; + public static final Index RESTORE_PASSWORD_BID_EMAIL_KEY = Indexes0.RESTORE_PASSWORD_BID_EMAIL_KEY; + public static final Index RESTORE_PASSWORD_BID_PK = Indexes0.RESTORE_PASSWORD_BID_PK; + public static final Index SENDER_CASE_PK = Indexes0.SENDER_CASE_PK; + public static final Index SENDER_CASE_PROJECT_IDX = Indexes0.SENDER_CASE_PROJECT_IDX; + public static final Index UNIQUE_RULE_NAME_PER_PROJECT = Indexes0.UNIQUE_RULE_NAME_PER_PROJECT; + public static final Index SERVER_SETTINGS_ID = Indexes0.SERVER_SETTINGS_ID; + public static final Index SERVER_SETTINGS_KEY_KEY = Indexes0.SERVER_SETTINGS_KEY_KEY; + public static final Index SHEDLOCK_PKEY = Indexes0.SHEDLOCK_PKEY; + public static final Index STALE_MATERIALIZED_VIEW_NAME_KEY = Indexes0.STALE_MATERIALIZED_VIEW_NAME_KEY; + public static final Index STALE_MATERIALIZED_VIEW_PKEY = Indexes0.STALE_MATERIALIZED_VIEW_PKEY; + public static final Index STALE_MV_CREATION_DATE_IDX = Indexes0.STALE_MV_CREATION_DATE_IDX; + public static final Index STATISTICS_LAUNCH_IDX = Indexes0.STATISTICS_LAUNCH_IDX; + public static final Index STATISTICS_PK = Indexes0.STATISTICS_PK; + public static final Index STATISTICS_TI_IDX = Indexes0.STATISTICS_TI_IDX; + public static final Index UNIQUE_STATS_ITEM = Indexes0.UNIQUE_STATS_ITEM; + public static final Index UNIQUE_STATS_LAUNCH = Indexes0.UNIQUE_STATS_LAUNCH; + public static final Index STATISTICS_FIELD_NAME_KEY = Indexes0.STATISTICS_FIELD_NAME_KEY; + public static final Index STATISTICS_FIELD_PK = Indexes0.STATISTICS_FIELD_PK; + public static final Index ITEM_TEST_CASE_ID_LAUNCH_ID_IDX = Indexes0.ITEM_TEST_CASE_ID_LAUNCH_ID_IDX; + public static final Index PATH_GIST_IDX = Indexes0.PATH_GIST_IDX; + public static final Index PATH_IDX = Indexes0.PATH_IDX; + public static final Index TEST_CASE_HASH_LAUNCH_ID_IDX = Indexes0.TEST_CASE_HASH_LAUNCH_ID_IDX; + public static final Index TEST_ITEM_PK = Indexes0.TEST_ITEM_PK; + public static final Index TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX = Indexes0.TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX; + public static final Index TEST_ITEM_UUID_KEY = Indexes0.TEST_ITEM_UUID_KEY; + public static final Index TI_LAUNCH_IDX = Indexes0.TI_LAUNCH_IDX; + public static final Index TI_PARENT_IDX = Indexes0.TI_PARENT_IDX; + public static final Index TI_RETRY_OF_IDX = Indexes0.TI_RETRY_OF_IDX; + public static final Index TEST_ITEM_RESULTS_PK = Indexes0.TEST_ITEM_RESULTS_PK; + public static final Index TICKET_ID_IDX = Indexes0.TICKET_ID_IDX; + public static final Index TICKET_PK = Indexes0.TICKET_PK; + public static final Index TICKET_SUBMITTER_IDX = Indexes0.TICKET_SUBMITTER_IDX; + public static final Index USER_BID_PROJECT_IDX = Indexes0.USER_BID_PROJECT_IDX; + public static final Index USER_CREATION_BID_PK = Indexes0.USER_CREATION_BID_PK; + public static final Index USER_PREFERENCE_PK = Indexes0.USER_PREFERENCE_PK; + public static final Index USER_PREFERENCE_UQ = Indexes0.USER_PREFERENCE_UQ; + public static final Index USERS_EMAIL_KEY = Indexes0.USERS_EMAIL_KEY; + public static final Index USERS_LOGIN_KEY = Indexes0.USERS_LOGIN_KEY; + public static final Index USERS_PK = Indexes0.USERS_PK; + public static final Index WIDGET_PKEY = Indexes0.WIDGET_PKEY; + public static final Index WIDGET_FILTER_PK = Indexes0.WIDGET_FILTER_PK; - private static class Indexes0 { + // ------------------------------------------------------------------------- + // [#1459] distribute members to avoid static initialisers > 64kb + // ------------------------------------------------------------------------- - public static Index ACL_CLASS_PKEY = Internal.createIndex("acl_class_pkey", JAclClass.ACL_CLASS, - new OrderField[]{JAclClass.ACL_CLASS.ID}, true); - public static Index UNIQUE_UK_2 = Internal.createIndex("unique_uk_2", JAclClass.ACL_CLASS, - new OrderField[]{JAclClass.ACL_CLASS.CLASS}, true); - public static Index ACL_ENTRY_PKEY = Internal.createIndex("acl_entry_pkey", JAclEntry.ACL_ENTRY, - new OrderField[]{JAclEntry.ACL_ENTRY.ID}, true); - public static Index UNIQUE_UK_4 = Internal.createIndex("unique_uk_4", JAclEntry.ACL_ENTRY, - new OrderField[]{JAclEntry.ACL_ENTRY.ACL_OBJECT_IDENTITY, JAclEntry.ACL_ENTRY.ACE_ORDER}, - true); - public static Index ACL_OBJECT_IDENTITY_PKEY = Internal.createIndex("acl_object_identity_pkey", - JAclObjectIdentity.ACL_OBJECT_IDENTITY, - new OrderField[]{JAclObjectIdentity.ACL_OBJECT_IDENTITY.ID}, true); - public static Index UNIQUE_UK_3 = Internal.createIndex("unique_uk_3", - JAclObjectIdentity.ACL_OBJECT_IDENTITY, - new OrderField[]{JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS, - JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY}, true); - public static Index ACL_SID_IDX = Internal.createIndex("acl_sid_idx", JAclSid.ACL_SID, - new OrderField[]{JAclSid.ACL_SID.SID}, false); - public static Index ACL_SID_PKEY = Internal.createIndex("acl_sid_pkey", JAclSid.ACL_SID, - new OrderField[]{JAclSid.ACL_SID.ID}, true); - public static Index UNIQUE_UK_1 = Internal.createIndex("unique_uk_1", JAclSid.ACL_SID, - new OrderField[]{JAclSid.ACL_SID.SID, JAclSid.ACL_SID.PRINCIPAL}, true); - public static Index ACTIVITY_CREATION_DATE_IDX = Internal.createIndex( - "activity_creation_date_idx", JActivity.ACTIVITY, - new OrderField[]{JActivity.ACTIVITY.CREATION_DATE}, false); - public static Index ACTIVITY_OBJECT_IDX = Internal.createIndex("activity_object_idx", - JActivity.ACTIVITY, new OrderField[]{JActivity.ACTIVITY.OBJECT_ID}, false); - public static Index ACTIVITY_PK = Internal.createIndex("activity_pk", JActivity.ACTIVITY, - new OrderField[]{JActivity.ACTIVITY.ID}, true); - public static Index ACTIVITY_PROJECT_IDX = Internal.createIndex("activity_project_idx", - JActivity.ACTIVITY, new OrderField[]{JActivity.ACTIVITY.PROJECT_ID}, false); - public static Index ATT_ITEM_IDX = Internal.createIndex("att_item_idx", JAttachment.ATTACHMENT, - new OrderField[]{JAttachment.ATTACHMENT.ITEM_ID}, false); - public static Index ATT_LAUNCH_IDX = Internal.createIndex("att_launch_idx", - JAttachment.ATTACHMENT, new OrderField[]{JAttachment.ATTACHMENT.LAUNCH_ID}, false); - public static Index ATT_PROJECT_IDX = Internal.createIndex("att_project_idx", - JAttachment.ATTACHMENT, new OrderField[]{JAttachment.ATTACHMENT.PROJECT_ID}, false); - public static Index ATTACHMENT_PK = Internal.createIndex("attachment_pk", - JAttachment.ATTACHMENT, new OrderField[]{JAttachment.ATTACHMENT.ID}, true); - public static Index ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX = Internal.createIndex( - "attachment_project_id_creation_time_idx", JAttachment.ATTACHMENT, - new OrderField[]{JAttachment.ATTACHMENT.PROJECT_ID, JAttachment.ATTACHMENT.CREATION_DATE}, - false); - public static Index ATTACHMENT_DELETION_PKEY = Internal.createIndex("attachment_deletion_pkey", - JAttachmentDeletion.ATTACHMENT_DELETION, - new OrderField[]{JAttachmentDeletion.ATTACHMENT_DELETION.ID}, true); - public static Index ATTRIBUTE_PK = Internal.createIndex("attribute_pk", JAttribute.ATTRIBUTE, - new OrderField[]{JAttribute.ATTRIBUTE.ID}, true); - public static Index CLUSTER_INDEX_ID_IDX = Internal.createIndex("cluster_index_id_idx", - JClusters.CLUSTERS, new OrderField[]{JClusters.CLUSTERS.INDEX_ID}, false); - public static Index CLUSTER_LAUNCH_IDX = Internal.createIndex("cluster_launch_idx", - JClusters.CLUSTERS, new OrderField[]{JClusters.CLUSTERS.LAUNCH_ID}, false); - public static Index CLUSTER_PROJECT_IDX = Internal.createIndex("cluster_project_idx", - JClusters.CLUSTERS, new OrderField[]{JClusters.CLUSTERS.PROJECT_ID}, false); - public static Index CLUSTERS_PK = Internal.createIndex("clusters_pk", JClusters.CLUSTERS, - new OrderField[]{JClusters.CLUSTERS.ID}, true); - public static Index INDEX_ID_LAUNCH_ID_UNQ = Internal.createIndex("index_id_launch_id_unq", - JClusters.CLUSTERS, - new OrderField[]{JClusters.CLUSTERS.INDEX_ID, JClusters.CLUSTERS.LAUNCH_ID}, true); - public static Index CLUSTER_ITEM_CLUSTER_IDX = Internal.createIndex("cluster_item_cluster_idx", - JClustersTestItem.CLUSTERS_TEST_ITEM, - new OrderField[]{JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID}, false); - public static Index CLUSTER_ITEM_ITEM_IDX = Internal.createIndex("cluster_item_item_idx", - JClustersTestItem.CLUSTERS_TEST_ITEM, - new OrderField[]{JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID}, false); - public static Index CLUSTER_ITEM_UNQ = Internal.createIndex("cluster_item_unq", - JClustersTestItem.CLUSTERS_TEST_ITEM, - new OrderField[]{JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID, - JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID}, true); - public static Index CONTENT_FIELD_IDX = Internal.createIndex("content_field_idx", - JContentField.CONTENT_FIELD, new OrderField[]{JContentField.CONTENT_FIELD.FIELD}, false); - public static Index CONTENT_FIELD_WIDGET_IDX = Internal.createIndex("content_field_widget_idx", - JContentField.CONTENT_FIELD, new OrderField[]{JContentField.CONTENT_FIELD.ID}, false); - public static Index DASHBOARD_PKEY = Internal.createIndex("dashboard_pkey", - JDashboard.DASHBOARD, new OrderField[]{JDashboard.DASHBOARD.ID}, true); - public static Index DASHBOARD_WIDGET_PK = Internal.createIndex("dashboard_widget_pk", - JDashboardWidget.DASHBOARD_WIDGET, - new OrderField[]{JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, - JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID}, true); - public static Index WIDGET_ON_DASHBOARD_UNQ = Internal.createIndex("widget_on_dashboard_unq", - JDashboardWidget.DASHBOARD_WIDGET, - new OrderField[]{JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, - JDashboardWidget.DASHBOARD_WIDGET.WIDGET_NAME, - JDashboardWidget.DASHBOARD_WIDGET.WIDGET_OWNER}, true); - public static Index FILTER_PKEY = Internal.createIndex("filter_pkey", JFilter.FILTER, - new OrderField[]{JFilter.FILTER.ID}, true); - public static Index FILTER_COND_FILTER_IDX = Internal.createIndex("filter_cond_filter_idx", - JFilterCondition.FILTER_CONDITION, - new OrderField[]{JFilterCondition.FILTER_CONDITION.FILTER_ID}, false); - public static Index FILTER_CONDITION_PK = Internal.createIndex("filter_condition_pk", - JFilterCondition.FILTER_CONDITION, new OrderField[]{JFilterCondition.FILTER_CONDITION.ID}, - true); - public static Index FILTER_SORT_FILTER_IDX = Internal.createIndex("filter_sort_filter_idx", - JFilterSort.FILTER_SORT, new OrderField[]{JFilterSort.FILTER_SORT.FILTER_ID}, false); - public static Index FILTER_SORT_PK = Internal.createIndex("filter_sort_pk", - JFilterSort.FILTER_SORT, new OrderField[]{JFilterSort.FILTER_SORT.ID}, true); - public static Index INTEGR_PROJECT_IDX = Internal.createIndex("integr_project_idx", - JIntegration.INTEGRATION, new OrderField[]{JIntegration.INTEGRATION.PROJECT_ID}, false); - public static Index INTEGRATION_PK = Internal.createIndex("integration_pk", - JIntegration.INTEGRATION, new OrderField[]{JIntegration.INTEGRATION.ID}, true); - public static Index UNIQUE_GLOBAL_INTEGRATION_NAME = Internal.createIndex( - "unique_global_integration_name", JIntegration.INTEGRATION, - new OrderField[]{JIntegration.INTEGRATION.NAME, JIntegration.INTEGRATION.TYPE}, true); - public static Index UNIQUE_PROJECT_INTEGRATION_NAME = Internal.createIndex( - "unique_project_integration_name", JIntegration.INTEGRATION, - new OrderField[]{JIntegration.INTEGRATION.NAME, JIntegration.INTEGRATION.TYPE, - JIntegration.INTEGRATION.PROJECT_ID}, true); - public static Index INTEGRATION_TYPE_NAME_KEY = Internal.createIndex( - "integration_type_name_key", JIntegrationType.INTEGRATION_TYPE, - new OrderField[]{JIntegrationType.INTEGRATION_TYPE.NAME}, true); - public static Index INTEGRATION_TYPE_PK = Internal.createIndex("integration_type_pk", - JIntegrationType.INTEGRATION_TYPE, new OrderField[]{JIntegrationType.INTEGRATION_TYPE.ID}, - true); - public static Index ISSUE_IT_IDX = Internal.createIndex("issue_it_idx", JIssue.ISSUE, - new OrderField[]{JIssue.ISSUE.ISSUE_TYPE}, false); - public static Index ISSUE_PK = Internal.createIndex("issue_pk", JIssue.ISSUE, - new OrderField[]{JIssue.ISSUE.ISSUE_ID}, true); - public static Index ISSUE_GROUP_PK = Internal.createIndex("issue_group_pk", - JIssueGroup.ISSUE_GROUP, new OrderField[]{JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID}, true); - public static Index ISSUE_TICKET_PK = Internal.createIndex("issue_ticket_pk", - JIssueTicket.ISSUE_TICKET, - new OrderField[]{JIssueTicket.ISSUE_TICKET.ISSUE_ID, JIssueTicket.ISSUE_TICKET.TICKET_ID}, - true); - public static Index ISSUE_TYPE_GROUP_IDX = Internal.createIndex("issue_type_group_idx", - JIssueType.ISSUE_TYPE, new OrderField[]{JIssueType.ISSUE_TYPE.ISSUE_GROUP_ID}, false); - public static Index ISSUE_TYPE_LOCATOR_KEY = Internal.createIndex("issue_type_locator_key", - JIssueType.ISSUE_TYPE, new OrderField[]{JIssueType.ISSUE_TYPE.LOCATOR}, true); - public static Index ISSUE_TYPE_PK = Internal.createIndex("issue_type_pk", JIssueType.ISSUE_TYPE, - new OrderField[]{JIssueType.ISSUE_TYPE.ID}, true); - public static Index ISSUE_TYPE_PROJECT_PK = Internal.createIndex("issue_type_project_pk", - JIssueTypeProject.ISSUE_TYPE_PROJECT, - new OrderField[]{JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID, - JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID}, true); - public static Index ITEM_ATTR_LAUNCH_IDX = Internal.createIndex("item_attr_launch_idx", - JItemAttribute.ITEM_ATTRIBUTE, new OrderField[]{JItemAttribute.ITEM_ATTRIBUTE.LAUNCH_ID}, - false); - public static Index ITEM_ATTR_TI_IDX = Internal.createIndex("item_attr_ti_idx", - JItemAttribute.ITEM_ATTRIBUTE, new OrderField[]{JItemAttribute.ITEM_ATTRIBUTE.ITEM_ID}, - false); - public static Index ITEM_ATTRIBUTE_PK = Internal.createIndex("item_attribute_pk", - JItemAttribute.ITEM_ATTRIBUTE, new OrderField[]{JItemAttribute.ITEM_ATTRIBUTE.ID}, true); - public static Index LAUNCH_PK = Internal.createIndex("launch_pk", JLaunch.LAUNCH, - new OrderField[]{JLaunch.LAUNCH.ID}, true); - public static Index LAUNCH_PROJECT_START_TIME_IDX = Internal.createIndex( - "launch_project_start_time_idx", JLaunch.LAUNCH, - new OrderField[]{JLaunch.LAUNCH.PROJECT_ID, JLaunch.LAUNCH.START_TIME}, false); - public static Index LAUNCH_USER_IDX = Internal.createIndex("launch_user_idx", JLaunch.LAUNCH, - new OrderField[]{JLaunch.LAUNCH.USER_ID}, false); - public static Index LAUNCH_UUID_KEY = Internal.createIndex("launch_uuid_key", JLaunch.LAUNCH, - new OrderField[]{JLaunch.LAUNCH.UUID}, true); - public static Index UNQ_NAME_NUMBER = Internal.createIndex("unq_name_number", JLaunch.LAUNCH, - new OrderField[]{JLaunch.LAUNCH.NAME, JLaunch.LAUNCH.NUMBER, JLaunch.LAUNCH.PROJECT_ID}, - true); - public static Index L_ATTR_RL_SEND_CASE_IDX = Internal.createIndex("l_attr_rl_send_case_idx", - JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, - new OrderField[]{JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.SENDER_CASE_ID}, false); - public static Index LAUNCH_ATTRIBUTE_RULES_PK = Internal.createIndex( - "launch_attribute_rules_pk", JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, - new OrderField[]{JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID}, true); - public static Index LN_SEND_CASE_IDX = Internal.createIndex("ln_send_case_idx", - JLaunchNames.LAUNCH_NAMES, new OrderField[]{JLaunchNames.LAUNCH_NAMES.SENDER_CASE_ID}, - false); - public static Index LAUNCH_NUMBER_PK = Internal.createIndex("launch_number_pk", - JLaunchNumber.LAUNCH_NUMBER, new OrderField[]{JLaunchNumber.LAUNCH_NUMBER.ID}, true); - public static Index UNQ_PROJECT_NAME = Internal.createIndex("unq_project_name", - JLaunchNumber.LAUNCH_NUMBER, new OrderField[]{JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID, - JLaunchNumber.LAUNCH_NUMBER.LAUNCH_NAME}, true); - public static Index LOG_ATTACH_ID_IDX = Internal.createIndex("log_attach_id_idx", JLog.LOG, - new OrderField[]{JLog.LOG.ATTACHMENT_ID}, false); - public static Index LOG_CLUSTER_IDX = Internal.createIndex("log_cluster_idx", JLog.LOG, - new OrderField[]{JLog.LOG.CLUSTER_ID}, false); - public static Index LOG_LAUNCH_ID_IDX = Internal.createIndex("log_launch_id_idx", JLog.LOG, - new OrderField[]{JLog.LOG.LAUNCH_ID}, false); - public static Index LOG_MESSAGE_TRGM_IDX = Internal.createIndex("log_message_trgm_idx", - JLog.LOG, new OrderField[]{JLog.LOG.LOG_MESSAGE}, false); - public static Index LOG_PK = Internal.createIndex("log_pk", JLog.LOG, - new OrderField[]{JLog.LOG.ID}, true); - public static Index LOG_PROJECT_ID_LOG_TIME_IDX = Internal.createIndex( - "log_project_id_log_time_idx", JLog.LOG, - new OrderField[]{JLog.LOG.PROJECT_ID, JLog.LOG.LOG_TIME}, false); - public static Index LOG_PROJECT_IDX = Internal.createIndex("log_project_idx", JLog.LOG, - new OrderField[]{JLog.LOG.PROJECT_ID}, false); - public static Index LOG_TI_IDX = Internal.createIndex("log_ti_idx", JLog.LOG, - new OrderField[]{JLog.LOG.ITEM_ID}, false); - public static Index OAUTH_ACCESS_TOKEN_PKEY = Internal.createIndex("oauth_access_token_pkey", - JOauthAccessToken.OAUTH_ACCESS_TOKEN, - new OrderField[]{JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID}, true); - public static Index OAUTH_AT_USER_IDX = Internal.createIndex("oauth_at_user_idx", - JOauthAccessToken.OAUTH_ACCESS_TOKEN, - new OrderField[]{JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID}, false); - public static Index USERS_ACCESS_TOKEN_UNIQUE = Internal.createIndex( - "users_access_token_unique", JOauthAccessToken.OAUTH_ACCESS_TOKEN, - new OrderField[]{JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN_ID, - JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID}, true); - public static Index OAUTH_REGISTRATION_CLIENT_ID_KEY = Internal.createIndex( - "oauth_registration_client_id_key", JOauthRegistration.OAUTH_REGISTRATION, - new OrderField[]{JOauthRegistration.OAUTH_REGISTRATION.CLIENT_ID}, true); - public static Index OAUTH_REGISTRATION_PKEY = Internal.createIndex("oauth_registration_pkey", - JOauthRegistration.OAUTH_REGISTRATION, - new OrderField[]{JOauthRegistration.OAUTH_REGISTRATION.ID}, true); - public static Index OAUTH_REGISTRATION_RESTRICTION_PK = Internal.createIndex( - "oauth_registration_restriction_pk", - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, - new OrderField[]{JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID}, true); - public static Index OAUTH_REGISTRATION_RESTRICTION_UNIQUE = Internal.createIndex( - "oauth_registration_restriction_unique", - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, - new OrderField[]{JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.TYPE, - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.VALUE, - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK}, - true); - public static Index OAUTH_REGISTRATION_SCOPE_PK = Internal.createIndex( - "oauth_registration_scope_pk", JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, - new OrderField[]{JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID}, true); - public static Index OAUTH_REGISTRATION_SCOPE_UNIQUE = Internal.createIndex( - "oauth_registration_scope_unique", JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, - new OrderField[]{JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.SCOPE, - JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK}, true); - public static Index ONBOARDING_PK = Internal.createIndex("onboarding_pk", - JOnboarding.ONBOARDING, new OrderField[]{JOnboarding.ONBOARDING.ID}, true); - public static Index PARAMETER_TI_IDX = Internal.createIndex("parameter_ti_idx", - JParameter.PARAMETER, new OrderField[]{JParameter.PARAMETER.ITEM_ID}, false); - public static Index PATTERN_TEMPLATE_PK = Internal.createIndex("pattern_template_pk", - JPatternTemplate.PATTERN_TEMPLATE, new OrderField[]{JPatternTemplate.PATTERN_TEMPLATE.ID}, - true); - public static Index UNQ_NAME_PROJECTID = Internal.createIndex("unq_name_projectid", - JPatternTemplate.PATTERN_TEMPLATE, new OrderField[]{JPatternTemplate.PATTERN_TEMPLATE.NAME, - JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID}, true); - public static Index PATTERN_ITEM_ITEM_ID_IDX = Internal.createIndex("pattern_item_item_id_idx", - JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, - new OrderField[]{JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID}, false); - public static Index PATTERN_ITEM_UNQ = Internal.createIndex("pattern_item_unq", - JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, - new OrderField[]{JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID, - JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID}, true); - public static Index PROJECT_NAME_KEY = Internal.createIndex("project_name_key", - JProject.PROJECT, new OrderField[]{JProject.PROJECT.NAME}, true); - public static Index PROJECT_PK = Internal.createIndex("project_pk", JProject.PROJECT, - new OrderField[]{JProject.PROJECT.ID}, true); - public static Index UNIQUE_ATTRIBUTE_PER_PROJECT = Internal.createIndex( - "unique_attribute_per_project", JProjectAttribute.PROJECT_ATTRIBUTE, - new OrderField[]{JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID, - JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID}, true); - public static Index USERS_PROJECT_PK = Internal.createIndex("users_project_pk", - JProjectUser.PROJECT_USER, - new OrderField[]{JProjectUser.PROJECT_USER.USER_ID, JProjectUser.PROJECT_USER.PROJECT_ID}, - true); - public static Index RCPNT_SEND_CASE_IDX = Internal.createIndex("rcpnt_send_case_idx", - JRecipients.RECIPIENTS, new OrderField[]{JRecipients.RECIPIENTS.SENDER_CASE_ID}, false); - public static Index RESTORE_PASSWORD_BID_EMAIL_KEY = Internal.createIndex( - "restore_password_bid_email_key", JRestorePasswordBid.RESTORE_PASSWORD_BID, - new OrderField[]{JRestorePasswordBid.RESTORE_PASSWORD_BID.EMAIL}, true); - public static Index RESTORE_PASSWORD_BID_PK = Internal.createIndex("restore_password_bid_pk", - JRestorePasswordBid.RESTORE_PASSWORD_BID, - new OrderField[]{JRestorePasswordBid.RESTORE_PASSWORD_BID.UUID}, true); - public static Index SENDER_CASE_PK = Internal.createIndex("sender_case_pk", - JSenderCase.SENDER_CASE, new OrderField[]{JSenderCase.SENDER_CASE.ID}, true); - public static Index SENDER_CASE_PROJECT_IDX = Internal.createIndex("sender_case_project_idx", - JSenderCase.SENDER_CASE, new OrderField[]{JSenderCase.SENDER_CASE.PROJECT_ID}, false); - public static Index SERVER_SETTINGS_ID = Internal.createIndex("server_settings_id", - JServerSettings.SERVER_SETTINGS, new OrderField[]{JServerSettings.SERVER_SETTINGS.ID}, - true); - public static Index SERVER_SETTINGS_KEY_KEY = Internal.createIndex("server_settings_key_key", - JServerSettings.SERVER_SETTINGS, new OrderField[]{JServerSettings.SERVER_SETTINGS.KEY}, - true); - public static Index SHAREABLE_PK = Internal.createIndex("shareable_pk", - JShareableEntity.SHAREABLE_ENTITY, new OrderField[]{JShareableEntity.SHAREABLE_ENTITY.ID}, - true); - public static Index SHARED_ENTITY_OWNERX = Internal.createIndex("shared_entity_ownerx", - JShareableEntity.SHAREABLE_ENTITY, - new OrderField[]{JShareableEntity.SHAREABLE_ENTITY.OWNER}, false); - public static Index SHARED_ENTITY_PROJECT_IDX = Internal.createIndex( - "shared_entity_project_idx", JShareableEntity.SHAREABLE_ENTITY, - new OrderField[]{JShareableEntity.SHAREABLE_ENTITY.PROJECT_ID}, false); - public static Index STALE_MATERIALIZED_VIEW_NAME_KEY = Internal.createIndex( - "stale_materialized_view_name_key", JStaleMaterializedView.STALE_MATERIALIZED_VIEW, - new OrderField[]{JStaleMaterializedView.STALE_MATERIALIZED_VIEW.NAME}, true); - public static Index STALE_MATERIALIZED_VIEW_PKEY = Internal.createIndex( - "stale_materialized_view_pkey", JStaleMaterializedView.STALE_MATERIALIZED_VIEW, - new OrderField[]{JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID}, true); - public static Index STALE_MV_CREATION_DATE_IDX = Internal.createIndex( - "stale_mv_creation_date_idx", JStaleMaterializedView.STALE_MATERIALIZED_VIEW, - new OrderField[]{JStaleMaterializedView.STALE_MATERIALIZED_VIEW.CREATION_DATE}, false); - public static Index STATISTICS_LAUNCH_IDX = Internal.createIndex("statistics_launch_idx", - JStatistics.STATISTICS, new OrderField[]{JStatistics.STATISTICS.LAUNCH_ID}, false); - public static Index STATISTICS_PK = Internal.createIndex("statistics_pk", - JStatistics.STATISTICS, new OrderField[]{JStatistics.STATISTICS.S_ID}, true); - public static Index STATISTICS_TI_IDX = Internal.createIndex("statistics_ti_idx", - JStatistics.STATISTICS, new OrderField[]{JStatistics.STATISTICS.ITEM_ID}, false); - public static Index UNIQUE_STATS_ITEM = Internal.createIndex("unique_stats_item", - JStatistics.STATISTICS, new OrderField[]{JStatistics.STATISTICS.STATISTICS_FIELD_ID, - JStatistics.STATISTICS.ITEM_ID}, true); - public static Index UNIQUE_STATS_LAUNCH = Internal.createIndex("unique_stats_launch", - JStatistics.STATISTICS, new OrderField[]{JStatistics.STATISTICS.STATISTICS_FIELD_ID, - JStatistics.STATISTICS.LAUNCH_ID}, true); - public static Index STATISTICS_FIELD_NAME_KEY = Internal.createIndex( - "statistics_field_name_key", JStatisticsField.STATISTICS_FIELD, - new OrderField[]{JStatisticsField.STATISTICS_FIELD.NAME}, true); - public static Index STATISTICS_FIELD_PK = Internal.createIndex("statistics_field_pk", - JStatisticsField.STATISTICS_FIELD, - new OrderField[]{JStatisticsField.STATISTICS_FIELD.SF_ID}, true); - public static Index ITEM_TEST_CASE_ID_LAUNCH_ID_IDX = Internal.createIndex( - "item_test_case_id_launch_id_idx", JTestItem.TEST_ITEM, - new OrderField[]{JTestItem.TEST_ITEM.TEST_CASE_ID, JTestItem.TEST_ITEM.LAUNCH_ID}, false); - public static Index PATH_GIST_IDX = Internal.createIndex("path_gist_idx", JTestItem.TEST_ITEM, - new OrderField[]{JTestItem.TEST_ITEM.PATH}, false); - public static Index PATH_IDX = Internal.createIndex("path_idx", JTestItem.TEST_ITEM, - new OrderField[]{JTestItem.TEST_ITEM.PATH}, false); - public static Index TEST_CASE_HASH_LAUNCH_ID_IDX = Internal.createIndex( - "test_case_hash_launch_id_idx", JTestItem.TEST_ITEM, - new OrderField[]{JTestItem.TEST_ITEM.TEST_CASE_HASH, JTestItem.TEST_ITEM.LAUNCH_ID}, false); - public static Index TEST_ITEM_PK = Internal.createIndex("test_item_pk", JTestItem.TEST_ITEM, - new OrderField[]{JTestItem.TEST_ITEM.ITEM_ID}, true); - public static Index TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX = Internal.createIndex( - "test_item_unique_id_launch_id_idx", JTestItem.TEST_ITEM, - new OrderField[]{JTestItem.TEST_ITEM.UNIQUE_ID, JTestItem.TEST_ITEM.LAUNCH_ID}, false); - public static Index TEST_ITEM_UUID_KEY = Internal.createIndex("test_item_uuid_key", - JTestItem.TEST_ITEM, new OrderField[]{JTestItem.TEST_ITEM.UUID}, true); - public static Index TI_LAUNCH_IDX = Internal.createIndex("ti_launch_idx", JTestItem.TEST_ITEM, - new OrderField[]{JTestItem.TEST_ITEM.LAUNCH_ID}, false); - public static Index TI_PARENT_IDX = Internal.createIndex("ti_parent_idx", JTestItem.TEST_ITEM, - new OrderField[]{JTestItem.TEST_ITEM.PARENT_ID}, false); - public static Index TI_RETRY_OF_IDX = Internal.createIndex("ti_retry_of_idx", - JTestItem.TEST_ITEM, new OrderField[]{JTestItem.TEST_ITEM.RETRY_OF}, false); - public static Index TEST_ITEM_RESULTS_PK = Internal.createIndex("test_item_results_pk", - JTestItemResults.TEST_ITEM_RESULTS, - new OrderField[]{JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID}, true); - public static Index TICKET_ID_IDX = Internal.createIndex("ticket_id_idx", JTicket.TICKET, - new OrderField[]{JTicket.TICKET.TICKET_ID}, false); - public static Index TICKET_PK = Internal.createIndex("ticket_pk", JTicket.TICKET, - new OrderField[]{JTicket.TICKET.ID}, true); - public static Index TICKET_SUBMITTER_IDX = Internal.createIndex("ticket_submitter_idx", - JTicket.TICKET, new OrderField[]{JTicket.TICKET.SUBMITTER}, false); - public static Index USER_BID_PROJECT_IDX = Internal.createIndex("user_bid_project_idx", - JUserCreationBid.USER_CREATION_BID, - new OrderField[]{JUserCreationBid.USER_CREATION_BID.DEFAULT_PROJECT_ID}, false); - public static Index USER_CREATION_BID_PK = Internal.createIndex("user_creation_bid_pk", - JUserCreationBid.USER_CREATION_BID, - new OrderField[]{JUserCreationBid.USER_CREATION_BID.UUID}, true); - public static Index USER_PREFERENCE_PK = Internal.createIndex("user_preference_pk", - JUserPreference.USER_PREFERENCE, new OrderField[]{JUserPreference.USER_PREFERENCE.ID}, - true); - public static Index USER_PREFERENCE_UQ = Internal.createIndex("user_preference_uq", - JUserPreference.USER_PREFERENCE, - new OrderField[]{JUserPreference.USER_PREFERENCE.PROJECT_ID, - JUserPreference.USER_PREFERENCE.USER_ID, JUserPreference.USER_PREFERENCE.FILTER_ID}, - true); - public static Index USERS_EMAIL_KEY = Internal.createIndex("users_email_key", JUsers.USERS, - new OrderField[]{JUsers.USERS.EMAIL}, true); - public static Index USERS_LOGIN_KEY = Internal.createIndex("users_login_key", JUsers.USERS, - new OrderField[]{JUsers.USERS.LOGIN}, true); - public static Index USERS_PK = Internal.createIndex("users_pk", JUsers.USERS, - new OrderField[]{JUsers.USERS.ID}, true); - public static Index WIDGET_PKEY = Internal.createIndex("widget_pkey", JWidget.WIDGET, - new OrderField[]{JWidget.WIDGET.ID}, true); - public static Index WIDGET_FILTER_PK = Internal.createIndex("widget_filter_pk", - JWidgetFilter.WIDGET_FILTER, new OrderField[]{JWidgetFilter.WIDGET_FILTER.WIDGET_ID, - JWidgetFilter.WIDGET_FILTER.FILTER_ID}, true); - } + private static class Indexes0 { + public static Index ACTIVITY_CREATION_DATE_IDX = Internal.createIndex("activity_creation_date_idx", JActivity.ACTIVITY, new OrderField[] { JActivity.ACTIVITY.CREATION_DATE }, false); + public static Index ACTIVITY_OBJECT_IDX = Internal.createIndex("activity_object_idx", JActivity.ACTIVITY, new OrderField[] { JActivity.ACTIVITY.OBJECT_ID }, false); + public static Index ACTIVITY_PK = Internal.createIndex("activity_pk", JActivity.ACTIVITY, new OrderField[] { JActivity.ACTIVITY.ID }, true); + public static Index ACTIVITY_PROJECT_IDX = Internal.createIndex("activity_project_idx", JActivity.ACTIVITY, new OrderField[] { JActivity.ACTIVITY.PROJECT_ID }, false); + public static Index API_KEYS_PKEY = Internal.createIndex("api_keys_pkey", JApiKeys.API_KEYS, new OrderField[] { JApiKeys.API_KEYS.ID }, true); + public static Index HASH_API_KEYS_IDX = Internal.createIndex("hash_api_keys_idx", JApiKeys.API_KEYS, new OrderField[] { JApiKeys.API_KEYS.HASH }, false); + public static Index USERS_API_KEYS_UNIQUE = Internal.createIndex("users_api_keys_unique", JApiKeys.API_KEYS, new OrderField[] { JApiKeys.API_KEYS.NAME, JApiKeys.API_KEYS.USER_ID }, true); + public static Index ATT_ITEM_IDX = Internal.createIndex("att_item_idx", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.ITEM_ID }, false); + public static Index ATT_LAUNCH_IDX = Internal.createIndex("att_launch_idx", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.LAUNCH_ID }, false); + public static Index ATT_PROJECT_IDX = Internal.createIndex("att_project_idx", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.PROJECT_ID }, false); + public static Index ATTACHMENT_PK = Internal.createIndex("attachment_pk", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.ID }, true); + public static Index ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX = Internal.createIndex("attachment_project_id_creation_time_idx", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.PROJECT_ID, JAttachment.ATTACHMENT.CREATION_DATE }, false); + public static Index ATTACHMENT_DELETION_PKEY = Internal.createIndex("attachment_deletion_pkey", JAttachmentDeletion.ATTACHMENT_DELETION, new OrderField[] { JAttachmentDeletion.ATTACHMENT_DELETION.ID }, true); + public static Index ATTRIBUTE_PK = Internal.createIndex("attribute_pk", JAttribute.ATTRIBUTE, new OrderField[] { JAttribute.ATTRIBUTE.ID }, true); + public static Index CLUSTER_INDEX_ID_IDX = Internal.createIndex("cluster_index_id_idx", JClusters.CLUSTERS, new OrderField[] { JClusters.CLUSTERS.INDEX_ID }, false); + public static Index CLUSTER_LAUNCH_IDX = Internal.createIndex("cluster_launch_idx", JClusters.CLUSTERS, new OrderField[] { JClusters.CLUSTERS.LAUNCH_ID }, false); + public static Index CLUSTER_PROJECT_IDX = Internal.createIndex("cluster_project_idx", JClusters.CLUSTERS, new OrderField[] { JClusters.CLUSTERS.PROJECT_ID }, false); + public static Index CLUSTERS_PK = Internal.createIndex("clusters_pk", JClusters.CLUSTERS, new OrderField[] { JClusters.CLUSTERS.ID }, true); + public static Index INDEX_ID_LAUNCH_ID_UNQ = Internal.createIndex("index_id_launch_id_unq", JClusters.CLUSTERS, new OrderField[] { JClusters.CLUSTERS.INDEX_ID, JClusters.CLUSTERS.LAUNCH_ID }, true); + public static Index CLUSTER_ITEM_CLUSTER_IDX = Internal.createIndex("cluster_item_cluster_idx", JClustersTestItem.CLUSTERS_TEST_ITEM, new OrderField[] { JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID }, false); + public static Index CLUSTER_ITEM_ITEM_IDX = Internal.createIndex("cluster_item_item_idx", JClustersTestItem.CLUSTERS_TEST_ITEM, new OrderField[] { JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID }, false); + public static Index CLUSTER_ITEM_UNQ = Internal.createIndex("cluster_item_unq", JClustersTestItem.CLUSTERS_TEST_ITEM, new OrderField[] { JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID, JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID }, true); + public static Index CONTENT_FIELD_IDX = Internal.createIndex("content_field_idx", JContentField.CONTENT_FIELD, new OrderField[] { JContentField.CONTENT_FIELD.FIELD }, false); + public static Index CONTENT_FIELD_WIDGET_IDX = Internal.createIndex("content_field_widget_idx", JContentField.CONTENT_FIELD, new OrderField[] { JContentField.CONTENT_FIELD.ID }, false); + public static Index DASHBOARD_PKEY = Internal.createIndex("dashboard_pkey", JDashboard.DASHBOARD, new OrderField[] { JDashboard.DASHBOARD.ID }, true); + public static Index DASHBOARD_WIDGET_PK = Internal.createIndex("dashboard_widget_pk", JDashboardWidget.DASHBOARD_WIDGET, new OrderField[] { JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID }, true); + public static Index WIDGET_ON_DASHBOARD_UNQ = Internal.createIndex("widget_on_dashboard_unq", JDashboardWidget.DASHBOARD_WIDGET, new OrderField[] { JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, JDashboardWidget.DASHBOARD_WIDGET.WIDGET_NAME, JDashboardWidget.DASHBOARD_WIDGET.WIDGET_OWNER }, true); + public static Index FILTER_PKEY = Internal.createIndex("filter_pkey", JFilter.FILTER, new OrderField[] { JFilter.FILTER.ID }, true); + public static Index FILTER_COND_FILTER_IDX = Internal.createIndex("filter_cond_filter_idx", JFilterCondition.FILTER_CONDITION, new OrderField[] { JFilterCondition.FILTER_CONDITION.FILTER_ID }, false); + public static Index FILTER_CONDITION_PK = Internal.createIndex("filter_condition_pk", JFilterCondition.FILTER_CONDITION, new OrderField[] { JFilterCondition.FILTER_CONDITION.ID }, true); + public static Index FILTER_SORT_FILTER_IDX = Internal.createIndex("filter_sort_filter_idx", JFilterSort.FILTER_SORT, new OrderField[] { JFilterSort.FILTER_SORT.FILTER_ID }, false); + public static Index FILTER_SORT_PK = Internal.createIndex("filter_sort_pk", JFilterSort.FILTER_SORT, new OrderField[] { JFilterSort.FILTER_SORT.ID }, true); + public static Index INTEGR_PROJECT_IDX = Internal.createIndex("integr_project_idx", JIntegration.INTEGRATION, new OrderField[] { JIntegration.INTEGRATION.PROJECT_ID }, false); + public static Index INTEGRATION_PK = Internal.createIndex("integration_pk", JIntegration.INTEGRATION, new OrderField[] { JIntegration.INTEGRATION.ID }, true); + public static Index UNIQUE_GLOBAL_INTEGRATION_NAME = Internal.createIndex("unique_global_integration_name", JIntegration.INTEGRATION, new OrderField[] { JIntegration.INTEGRATION.NAME, JIntegration.INTEGRATION.TYPE }, true); + public static Index UNIQUE_PROJECT_INTEGRATION_NAME = Internal.createIndex("unique_project_integration_name", JIntegration.INTEGRATION, new OrderField[] { JIntegration.INTEGRATION.NAME, JIntegration.INTEGRATION.TYPE, JIntegration.INTEGRATION.PROJECT_ID }, true); + public static Index INTEGRATION_TYPE_NAME_KEY = Internal.createIndex("integration_type_name_key", JIntegrationType.INTEGRATION_TYPE, new OrderField[] { JIntegrationType.INTEGRATION_TYPE.NAME }, true); + public static Index INTEGRATION_TYPE_PK = Internal.createIndex("integration_type_pk", JIntegrationType.INTEGRATION_TYPE, new OrderField[] { JIntegrationType.INTEGRATION_TYPE.ID }, true); + public static Index ISSUE_IT_IDX = Internal.createIndex("issue_it_idx", JIssue.ISSUE, new OrderField[] { JIssue.ISSUE.ISSUE_TYPE }, false); + public static Index ISSUE_PK = Internal.createIndex("issue_pk", JIssue.ISSUE, new OrderField[] { JIssue.ISSUE.ISSUE_ID }, true); + public static Index ISSUE_GROUP_PK = Internal.createIndex("issue_group_pk", JIssueGroup.ISSUE_GROUP, new OrderField[] { JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID }, true); + public static Index ISSUE_TICKET_PK = Internal.createIndex("issue_ticket_pk", JIssueTicket.ISSUE_TICKET, new OrderField[] { JIssueTicket.ISSUE_TICKET.ISSUE_ID, JIssueTicket.ISSUE_TICKET.TICKET_ID }, true); + public static Index ISSUE_TYPE_GROUP_IDX = Internal.createIndex("issue_type_group_idx", JIssueType.ISSUE_TYPE, new OrderField[] { JIssueType.ISSUE_TYPE.ISSUE_GROUP_ID }, false); + public static Index ISSUE_TYPE_LOCATOR_KEY = Internal.createIndex("issue_type_locator_key", JIssueType.ISSUE_TYPE, new OrderField[] { JIssueType.ISSUE_TYPE.LOCATOR }, true); + public static Index ISSUE_TYPE_PK = Internal.createIndex("issue_type_pk", JIssueType.ISSUE_TYPE, new OrderField[] { JIssueType.ISSUE_TYPE.ID }, true); + public static Index ISSUE_TYPE_PROJECT_PK = Internal.createIndex("issue_type_project_pk", JIssueTypeProject.ISSUE_TYPE_PROJECT, new OrderField[] { JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID, JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID }, true); + public static Index ITEM_ATTR_LAUNCH_IDX = Internal.createIndex("item_attr_launch_idx", JItemAttribute.ITEM_ATTRIBUTE, new OrderField[] { JItemAttribute.ITEM_ATTRIBUTE.LAUNCH_ID }, false); + public static Index ITEM_ATTR_TI_IDX = Internal.createIndex("item_attr_ti_idx", JItemAttribute.ITEM_ATTRIBUTE, new OrderField[] { JItemAttribute.ITEM_ATTRIBUTE.ITEM_ID }, false); + public static Index ITEM_ATTRIBUTE_PK = Internal.createIndex("item_attribute_pk", JItemAttribute.ITEM_ATTRIBUTE, new OrderField[] { JItemAttribute.ITEM_ATTRIBUTE.ID }, true); + public static Index LAUNCH_PK = Internal.createIndex("launch_pk", JLaunch.LAUNCH, new OrderField[] { JLaunch.LAUNCH.ID }, true); + public static Index LAUNCH_PROJECT_START_TIME_IDX = Internal.createIndex("launch_project_start_time_idx", JLaunch.LAUNCH, new OrderField[] { JLaunch.LAUNCH.PROJECT_ID, JLaunch.LAUNCH.START_TIME }, false); + public static Index LAUNCH_USER_IDX = Internal.createIndex("launch_user_idx", JLaunch.LAUNCH, new OrderField[] { JLaunch.LAUNCH.USER_ID }, false); + public static Index LAUNCH_UUID_KEY = Internal.createIndex("launch_uuid_key", JLaunch.LAUNCH, new OrderField[] { JLaunch.LAUNCH.UUID }, true); + public static Index UNQ_NAME_NUMBER = Internal.createIndex("unq_name_number", JLaunch.LAUNCH, new OrderField[] { JLaunch.LAUNCH.NAME, JLaunch.LAUNCH.NUMBER, JLaunch.LAUNCH.PROJECT_ID }, true); + public static Index L_ATTR_RL_SEND_CASE_IDX = Internal.createIndex("l_attr_rl_send_case_idx", JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, new OrderField[] { JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.SENDER_CASE_ID }, false); + public static Index LAUNCH_ATTRIBUTE_RULES_PK = Internal.createIndex("launch_attribute_rules_pk", JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, new OrderField[] { JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID }, true); + public static Index LN_SEND_CASE_IDX = Internal.createIndex("ln_send_case_idx", JLaunchNames.LAUNCH_NAMES, new OrderField[] { JLaunchNames.LAUNCH_NAMES.SENDER_CASE_ID }, false); + public static Index LAUNCH_NUMBER_PK = Internal.createIndex("launch_number_pk", JLaunchNumber.LAUNCH_NUMBER, new OrderField[] { JLaunchNumber.LAUNCH_NUMBER.ID }, true); + public static Index UNQ_PROJECT_NAME = Internal.createIndex("unq_project_name", JLaunchNumber.LAUNCH_NUMBER, new OrderField[] { JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID, JLaunchNumber.LAUNCH_NUMBER.LAUNCH_NAME }, true); + public static Index LOG_ATTACH_ID_IDX = Internal.createIndex("log_attach_id_idx", JLog.LOG, new OrderField[] { JLog.LOG.ATTACHMENT_ID }, false); + public static Index LOG_CLUSTER_IDX = Internal.createIndex("log_cluster_idx", JLog.LOG, new OrderField[] { JLog.LOG.CLUSTER_ID }, false); + public static Index LOG_LAUNCH_ID_IDX = Internal.createIndex("log_launch_id_idx", JLog.LOG, new OrderField[] { JLog.LOG.LAUNCH_ID }, false); + public static Index LOG_MESSAGE_TRGM_IDX = Internal.createIndex("log_message_trgm_idx", JLog.LOG, new OrderField[] { JLog.LOG.LOG_MESSAGE }, false); + public static Index LOG_PK = Internal.createIndex("log_pk", JLog.LOG, new OrderField[] { JLog.LOG.ID }, true); + public static Index LOG_PROJECT_ID_LOG_TIME_IDX = Internal.createIndex("log_project_id_log_time_idx", JLog.LOG, new OrderField[] { JLog.LOG.PROJECT_ID, JLog.LOG.LOG_TIME }, false); + public static Index LOG_PROJECT_IDX = Internal.createIndex("log_project_idx", JLog.LOG, new OrderField[] { JLog.LOG.PROJECT_ID }, false); + public static Index LOG_TI_IDX = Internal.createIndex("log_ti_idx", JLog.LOG, new OrderField[] { JLog.LOG.ITEM_ID }, false); + public static Index OAUTH_ACCESS_TOKEN_PKEY = Internal.createIndex("oauth_access_token_pkey", JOauthAccessToken.OAUTH_ACCESS_TOKEN, new OrderField[] { JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID }, true); + public static Index OAUTH_AT_USER_IDX = Internal.createIndex("oauth_at_user_idx", JOauthAccessToken.OAUTH_ACCESS_TOKEN, new OrderField[] { JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID }, false); + public static Index USERS_ACCESS_TOKEN_UNIQUE = Internal.createIndex("users_access_token_unique", JOauthAccessToken.OAUTH_ACCESS_TOKEN, new OrderField[] { JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN_ID, JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID }, true); + public static Index OAUTH_REGISTRATION_CLIENT_ID_KEY = Internal.createIndex("oauth_registration_client_id_key", JOauthRegistration.OAUTH_REGISTRATION, new OrderField[] { JOauthRegistration.OAUTH_REGISTRATION.CLIENT_ID }, true); + public static Index OAUTH_REGISTRATION_PKEY = Internal.createIndex("oauth_registration_pkey", JOauthRegistration.OAUTH_REGISTRATION, new OrderField[] { JOauthRegistration.OAUTH_REGISTRATION.ID }, true); + public static Index OAUTH_REGISTRATION_RESTRICTION_PK = Internal.createIndex("oauth_registration_restriction_pk", JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, new OrderField[] { JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID }, true); + public static Index OAUTH_REGISTRATION_RESTRICTION_UNIQUE = Internal.createIndex("oauth_registration_restriction_unique", JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, new OrderField[] { JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.TYPE, JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.VALUE, JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK }, true); + public static Index OAUTH_REGISTRATION_SCOPE_PK = Internal.createIndex("oauth_registration_scope_pk", JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, new OrderField[] { JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID }, true); + public static Index OAUTH_REGISTRATION_SCOPE_UNIQUE = Internal.createIndex("oauth_registration_scope_unique", JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, new OrderField[] { JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.SCOPE, JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK }, true); + public static Index ONBOARDING_PK = Internal.createIndex("onboarding_pk", JOnboarding.ONBOARDING, new OrderField[] { JOnboarding.ONBOARDING.ID }, true); + public static Index ORGANIZATION_PKEY = Internal.createIndex("organization_pkey", JOrganization.ORGANIZATION, new OrderField[] { JOrganization.ORGANIZATION.ID }, true); + public static Index ORGANIZATION_ATTRIBUTE_PKEY = Internal.createIndex("organization_attribute_pkey", JOrganizationAttribute.ORGANIZATION_ATTRIBUTE, new OrderField[] { JOrganizationAttribute.ORGANIZATION_ATTRIBUTE.ID }, true); + public static Index SHAREABLE_PK = Internal.createIndex("shareable_pk", JOwnedEntity.OWNED_ENTITY, new OrderField[] { JOwnedEntity.OWNED_ENTITY.ID }, true); + public static Index SHARED_ENTITY_OWNERX = Internal.createIndex("shared_entity_ownerx", JOwnedEntity.OWNED_ENTITY, new OrderField[] { JOwnedEntity.OWNED_ENTITY.OWNER }, false); + public static Index SHARED_ENTITY_PROJECT_IDX = Internal.createIndex("shared_entity_project_idx", JOwnedEntity.OWNED_ENTITY, new OrderField[] { JOwnedEntity.OWNED_ENTITY.PROJECT_ID }, false); + public static Index PARAMETER_TI_IDX = Internal.createIndex("parameter_ti_idx", JParameter.PARAMETER, new OrderField[] { JParameter.PARAMETER.ITEM_ID }, false); + public static Index PATTERN_TEMPLATE_PK = Internal.createIndex("pattern_template_pk", JPatternTemplate.PATTERN_TEMPLATE, new OrderField[] { JPatternTemplate.PATTERN_TEMPLATE.ID }, true); + public static Index UNQ_NAME_PROJECTID = Internal.createIndex("unq_name_projectid", JPatternTemplate.PATTERN_TEMPLATE, new OrderField[] { JPatternTemplate.PATTERN_TEMPLATE.NAME, JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID }, true); + public static Index PATTERN_ITEM_ITEM_ID_IDX = Internal.createIndex("pattern_item_item_id_idx", JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, new OrderField[] { JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID }, false); + public static Index PATTERN_ITEM_UNQ = Internal.createIndex("pattern_item_unq", JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, new OrderField[] { JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID, JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID }, true); + public static Index PROJECT_NAME_KEY = Internal.createIndex("project_name_key", JProject.PROJECT, new OrderField[] { JProject.PROJECT.NAME }, true); + public static Index PROJECT_PK = Internal.createIndex("project_pk", JProject.PROJECT, new OrderField[] { JProject.PROJECT.ID }, true); + public static Index UNIQUE_ATTRIBUTE_PER_PROJECT = Internal.createIndex("unique_attribute_per_project", JProjectAttribute.PROJECT_ATTRIBUTE, new OrderField[] { JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID, JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID }, true); + public static Index USERS_PROJECT_PK = Internal.createIndex("users_project_pk", JProjectUser.PROJECT_USER, new OrderField[] { JProjectUser.PROJECT_USER.USER_ID, JProjectUser.PROJECT_USER.PROJECT_ID }, true); + public static Index RCPNT_SEND_CASE_IDX = Internal.createIndex("rcpnt_send_case_idx", JRecipients.RECIPIENTS, new OrderField[] { JRecipients.RECIPIENTS.SENDER_CASE_ID }, false); + public static Index RESTORE_PASSWORD_BID_EMAIL_KEY = Internal.createIndex("restore_password_bid_email_key", JRestorePasswordBid.RESTORE_PASSWORD_BID, new OrderField[] { JRestorePasswordBid.RESTORE_PASSWORD_BID.EMAIL }, true); + public static Index RESTORE_PASSWORD_BID_PK = Internal.createIndex("restore_password_bid_pk", JRestorePasswordBid.RESTORE_PASSWORD_BID, new OrderField[] { JRestorePasswordBid.RESTORE_PASSWORD_BID.UUID }, true); + public static Index SENDER_CASE_PK = Internal.createIndex("sender_case_pk", JSenderCase.SENDER_CASE, new OrderField[] { JSenderCase.SENDER_CASE.ID }, true); + public static Index SENDER_CASE_PROJECT_IDX = Internal.createIndex("sender_case_project_idx", JSenderCase.SENDER_CASE, new OrderField[] { JSenderCase.SENDER_CASE.PROJECT_ID }, false); + public static Index UNIQUE_RULE_NAME_PER_PROJECT = Internal.createIndex("unique_rule_name_per_project", JSenderCase.SENDER_CASE, new OrderField[] { JSenderCase.SENDER_CASE.RULE_NAME, JSenderCase.SENDER_CASE.PROJECT_ID }, true); + public static Index SERVER_SETTINGS_ID = Internal.createIndex("server_settings_id", JServerSettings.SERVER_SETTINGS, new OrderField[] { JServerSettings.SERVER_SETTINGS.ID }, true); + public static Index SERVER_SETTINGS_KEY_KEY = Internal.createIndex("server_settings_key_key", JServerSettings.SERVER_SETTINGS, new OrderField[] { JServerSettings.SERVER_SETTINGS.KEY }, true); + public static Index SHEDLOCK_PKEY = Internal.createIndex("shedlock_pkey", JShedlock.SHEDLOCK, new OrderField[] { JShedlock.SHEDLOCK.NAME }, true); + public static Index STALE_MATERIALIZED_VIEW_NAME_KEY = Internal.createIndex("stale_materialized_view_name_key", JStaleMaterializedView.STALE_MATERIALIZED_VIEW, new OrderField[] { JStaleMaterializedView.STALE_MATERIALIZED_VIEW.NAME }, true); + public static Index STALE_MATERIALIZED_VIEW_PKEY = Internal.createIndex("stale_materialized_view_pkey", JStaleMaterializedView.STALE_MATERIALIZED_VIEW, new OrderField[] { JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID }, true); + public static Index STALE_MV_CREATION_DATE_IDX = Internal.createIndex("stale_mv_creation_date_idx", JStaleMaterializedView.STALE_MATERIALIZED_VIEW, new OrderField[] { JStaleMaterializedView.STALE_MATERIALIZED_VIEW.CREATION_DATE }, false); + public static Index STATISTICS_LAUNCH_IDX = Internal.createIndex("statistics_launch_idx", JStatistics.STATISTICS, new OrderField[] { JStatistics.STATISTICS.LAUNCH_ID }, false); + public static Index STATISTICS_PK = Internal.createIndex("statistics_pk", JStatistics.STATISTICS, new OrderField[] { JStatistics.STATISTICS.S_ID }, true); + public static Index STATISTICS_TI_IDX = Internal.createIndex("statistics_ti_idx", JStatistics.STATISTICS, new OrderField[] { JStatistics.STATISTICS.ITEM_ID }, false); + public static Index UNIQUE_STATS_ITEM = Internal.createIndex("unique_stats_item", JStatistics.STATISTICS, new OrderField[] { JStatistics.STATISTICS.STATISTICS_FIELD_ID, JStatistics.STATISTICS.ITEM_ID }, true); + public static Index UNIQUE_STATS_LAUNCH = Internal.createIndex("unique_stats_launch", JStatistics.STATISTICS, new OrderField[] { JStatistics.STATISTICS.STATISTICS_FIELD_ID, JStatistics.STATISTICS.LAUNCH_ID }, true); + public static Index STATISTICS_FIELD_NAME_KEY = Internal.createIndex("statistics_field_name_key", JStatisticsField.STATISTICS_FIELD, new OrderField[] { JStatisticsField.STATISTICS_FIELD.NAME }, true); + public static Index STATISTICS_FIELD_PK = Internal.createIndex("statistics_field_pk", JStatisticsField.STATISTICS_FIELD, new OrderField[] { JStatisticsField.STATISTICS_FIELD.SF_ID }, true); + public static Index ITEM_TEST_CASE_ID_LAUNCH_ID_IDX = Internal.createIndex("item_test_case_id_launch_id_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.TEST_CASE_ID, JTestItem.TEST_ITEM.LAUNCH_ID }, false); + public static Index PATH_GIST_IDX = Internal.createIndex("path_gist_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.PATH }, false); + public static Index PATH_IDX = Internal.createIndex("path_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.PATH }, false); + public static Index TEST_CASE_HASH_LAUNCH_ID_IDX = Internal.createIndex("test_case_hash_launch_id_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.TEST_CASE_HASH, JTestItem.TEST_ITEM.LAUNCH_ID }, false); + public static Index TEST_ITEM_PK = Internal.createIndex("test_item_pk", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.ITEM_ID }, true); + public static Index TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX = Internal.createIndex("test_item_unique_id_launch_id_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.UNIQUE_ID, JTestItem.TEST_ITEM.LAUNCH_ID }, false); + public static Index TEST_ITEM_UUID_KEY = Internal.createIndex("test_item_uuid_key", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.UUID }, true); + public static Index TI_LAUNCH_IDX = Internal.createIndex("ti_launch_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.LAUNCH_ID }, false); + public static Index TI_PARENT_IDX = Internal.createIndex("ti_parent_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.PARENT_ID }, false); + public static Index TI_RETRY_OF_IDX = Internal.createIndex("ti_retry_of_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.RETRY_OF }, false); + public static Index TEST_ITEM_RESULTS_PK = Internal.createIndex("test_item_results_pk", JTestItemResults.TEST_ITEM_RESULTS, new OrderField[] { JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID }, true); + public static Index TICKET_ID_IDX = Internal.createIndex("ticket_id_idx", JTicket.TICKET, new OrderField[] { JTicket.TICKET.TICKET_ID }, false); + public static Index TICKET_PK = Internal.createIndex("ticket_pk", JTicket.TICKET, new OrderField[] { JTicket.TICKET.ID }, true); + public static Index TICKET_SUBMITTER_IDX = Internal.createIndex("ticket_submitter_idx", JTicket.TICKET, new OrderField[] { JTicket.TICKET.SUBMITTER }, false); + public static Index USER_BID_PROJECT_IDX = Internal.createIndex("user_bid_project_idx", JUserCreationBid.USER_CREATION_BID, new OrderField[] { JUserCreationBid.USER_CREATION_BID.DEFAULT_PROJECT_ID }, false); + public static Index USER_CREATION_BID_PK = Internal.createIndex("user_creation_bid_pk", JUserCreationBid.USER_CREATION_BID, new OrderField[] { JUserCreationBid.USER_CREATION_BID.UUID }, true); + public static Index USER_PREFERENCE_PK = Internal.createIndex("user_preference_pk", JUserPreference.USER_PREFERENCE, new OrderField[] { JUserPreference.USER_PREFERENCE.ID }, true); + public static Index USER_PREFERENCE_UQ = Internal.createIndex("user_preference_uq", JUserPreference.USER_PREFERENCE, new OrderField[] { JUserPreference.USER_PREFERENCE.PROJECT_ID, JUserPreference.USER_PREFERENCE.USER_ID, JUserPreference.USER_PREFERENCE.FILTER_ID }, true); + public static Index USERS_EMAIL_KEY = Internal.createIndex("users_email_key", JUsers.USERS, new OrderField[] { JUsers.USERS.EMAIL }, true); + public static Index USERS_LOGIN_KEY = Internal.createIndex("users_login_key", JUsers.USERS, new OrderField[] { JUsers.USERS.LOGIN }, true); + public static Index USERS_PK = Internal.createIndex("users_pk", JUsers.USERS, new OrderField[] { JUsers.USERS.ID }, true); + public static Index WIDGET_PKEY = Internal.createIndex("widget_pkey", JWidget.WIDGET, new OrderField[] { JWidget.WIDGET.ID }, true); + public static Index WIDGET_FILTER_PK = Internal.createIndex("widget_filter_pk", JWidgetFilter.WIDGET_FILTER, new OrderField[] { JWidgetFilter.WIDGET_FILTER.WIDGET_ID, JWidgetFilter.WIDGET_FILTER.FILTER_ID }, true); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java b/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java index 2fee64e48..896d9e0c7 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java @@ -4,11 +4,8 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.JAclClass; -import com.epam.ta.reportportal.jooq.tables.JAclEntry; -import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; -import com.epam.ta.reportportal.jooq.tables.JAclSid; import com.epam.ta.reportportal.jooq.tables.JActivity; +import com.epam.ta.reportportal.jooq.tables.JApiKeys; import com.epam.ta.reportportal.jooq.tables.JAttachment; import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; import com.epam.ta.reportportal.jooq.tables.JAttribute; @@ -38,6 +35,9 @@ import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; import com.epam.ta.reportportal.jooq.tables.JOnboarding; +import com.epam.ta.reportportal.jooq.tables.JOrganization; +import com.epam.ta.reportportal.jooq.tables.JOrganizationAttribute; +import com.epam.ta.reportportal.jooq.tables.JOwnedEntity; import com.epam.ta.reportportal.jooq.tables.JParameter; import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; @@ -49,7 +49,7 @@ import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; import com.epam.ta.reportportal.jooq.tables.JSenderCase; import com.epam.ta.reportportal.jooq.tables.JServerSettings; -import com.epam.ta.reportportal.jooq.tables.JShareableEntity; +import com.epam.ta.reportportal.jooq.tables.JShedlock; import com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView; import com.epam.ta.reportportal.jooq.tables.JStatistics; import com.epam.ta.reportportal.jooq.tables.JStatisticsField; @@ -62,10 +62,13 @@ import com.epam.ta.reportportal.jooq.tables.JWidget; import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; import com.epam.ta.reportportal.jooq.tables.records.JPgpArmorHeadersRecord; + import java.util.ArrayList; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Catalog; import org.jooq.Configuration; import org.jooq.Field; @@ -85,429 +88,448 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JPublic extends SchemaImpl { - /** - * The reference instance of public - */ - public static final JPublic PUBLIC = new JPublic(); - private static final long serialVersionUID = 784587878; - /** - * The table public.acl_class. - */ - public final JAclClass ACL_CLASS = com.epam.ta.reportportal.jooq.tables.JAclClass.ACL_CLASS; - - /** - * The table public.acl_entry. - */ - public final JAclEntry ACL_ENTRY = com.epam.ta.reportportal.jooq.tables.JAclEntry.ACL_ENTRY; - - /** - * The table public.acl_object_identity. - */ - public final JAclObjectIdentity ACL_OBJECT_IDENTITY = com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity.ACL_OBJECT_IDENTITY; - - /** - * The table public.acl_sid. - */ - public final JAclSid ACL_SID = com.epam.ta.reportportal.jooq.tables.JAclSid.ACL_SID; - - /** - * The table public.activity. - */ - public final JActivity ACTIVITY = com.epam.ta.reportportal.jooq.tables.JActivity.ACTIVITY; - - /** - * The table public.attachment. - */ - public final JAttachment ATTACHMENT = com.epam.ta.reportportal.jooq.tables.JAttachment.ATTACHMENT; - - /** - * The table public.attachment_deletion. - */ - public final JAttachmentDeletion ATTACHMENT_DELETION = com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion.ATTACHMENT_DELETION; - - /** - * The table public.attribute. - */ - public final JAttribute ATTRIBUTE = com.epam.ta.reportportal.jooq.tables.JAttribute.ATTRIBUTE; - - /** - * The table public.clusters. - */ - public final JClusters CLUSTERS = com.epam.ta.reportportal.jooq.tables.JClusters.CLUSTERS; - - /** - * The table public.clusters_test_item. - */ - public final JClustersTestItem CLUSTERS_TEST_ITEM = com.epam.ta.reportportal.jooq.tables.JClustersTestItem.CLUSTERS_TEST_ITEM; - - /** - * The table public.content_field. - */ - public final JContentField CONTENT_FIELD = com.epam.ta.reportportal.jooq.tables.JContentField.CONTENT_FIELD; - - /** - * The table public.dashboard. - */ - public final JDashboard DASHBOARD = com.epam.ta.reportportal.jooq.tables.JDashboard.DASHBOARD; - - /** - * The table public.dashboard_widget. - */ - public final JDashboardWidget DASHBOARD_WIDGET = com.epam.ta.reportportal.jooq.tables.JDashboardWidget.DASHBOARD_WIDGET; - - /** - * The table public.filter. - */ - public final JFilter FILTER = com.epam.ta.reportportal.jooq.tables.JFilter.FILTER; - - /** - * The table public.filter_condition. - */ - public final JFilterCondition FILTER_CONDITION = com.epam.ta.reportportal.jooq.tables.JFilterCondition.FILTER_CONDITION; - - /** - * The table public.filter_sort. - */ - public final JFilterSort FILTER_SORT = com.epam.ta.reportportal.jooq.tables.JFilterSort.FILTER_SORT; - - /** - * The table public.integration. - */ - public final JIntegration INTEGRATION = com.epam.ta.reportportal.jooq.tables.JIntegration.INTEGRATION; - - /** - * The table public.integration_type. - */ - public final JIntegrationType INTEGRATION_TYPE = com.epam.ta.reportportal.jooq.tables.JIntegrationType.INTEGRATION_TYPE; - - /** - * The table public.issue. - */ - public final JIssue ISSUE = com.epam.ta.reportportal.jooq.tables.JIssue.ISSUE; - - /** - * The table public.issue_group. - */ - public final JIssueGroup ISSUE_GROUP = com.epam.ta.reportportal.jooq.tables.JIssueGroup.ISSUE_GROUP; - - /** - * The table public.issue_ticket. - */ - public final JIssueTicket ISSUE_TICKET = com.epam.ta.reportportal.jooq.tables.JIssueTicket.ISSUE_TICKET; - - /** - * The table public.issue_type. - */ - public final JIssueType ISSUE_TYPE = com.epam.ta.reportportal.jooq.tables.JIssueType.ISSUE_TYPE; - - /** - * The table public.issue_type_project. - */ - public final JIssueTypeProject ISSUE_TYPE_PROJECT = com.epam.ta.reportportal.jooq.tables.JIssueTypeProject.ISSUE_TYPE_PROJECT; - - /** - * The table public.item_attribute. - */ - public final JItemAttribute ITEM_ATTRIBUTE = com.epam.ta.reportportal.jooq.tables.JItemAttribute.ITEM_ATTRIBUTE; - - /** - * The table public.launch. - */ - public final JLaunch LAUNCH = com.epam.ta.reportportal.jooq.tables.JLaunch.LAUNCH; - - /** - * The table public.launch_attribute_rules. - */ - public final JLaunchAttributeRules LAUNCH_ATTRIBUTE_RULES = com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES; - - /** - * The table public.launch_names. - */ - public final JLaunchNames LAUNCH_NAMES = com.epam.ta.reportportal.jooq.tables.JLaunchNames.LAUNCH_NAMES; - - /** - * The table public.launch_number. - */ - public final JLaunchNumber LAUNCH_NUMBER = com.epam.ta.reportportal.jooq.tables.JLaunchNumber.LAUNCH_NUMBER; - - /** - * The table public.log. - */ - public final JLog LOG = com.epam.ta.reportportal.jooq.tables.JLog.LOG; - - /** - * The table public.oauth_access_token. - */ - public final JOauthAccessToken OAUTH_ACCESS_TOKEN = com.epam.ta.reportportal.jooq.tables.JOauthAccessToken.OAUTH_ACCESS_TOKEN; - - /** - * The table public.oauth_registration. - */ - public final JOauthRegistration OAUTH_REGISTRATION = com.epam.ta.reportportal.jooq.tables.JOauthRegistration.OAUTH_REGISTRATION; - - /** - * The table public.oauth_registration_restriction. - */ - public final JOauthRegistrationRestriction OAUTH_REGISTRATION_RESTRICTION = com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION; - - /** - * The table public.oauth_registration_scope. - */ - public final JOauthRegistrationScope OAUTH_REGISTRATION_SCOPE = com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE; - - /** - * The table public.onboarding. - */ - public final JOnboarding ONBOARDING = com.epam.ta.reportportal.jooq.tables.JOnboarding.ONBOARDING; - - /** - * The table public.parameter. - */ - public final JParameter PARAMETER = com.epam.ta.reportportal.jooq.tables.JParameter.PARAMETER; - - /** - * The table public.pattern_template. - */ - public final JPatternTemplate PATTERN_TEMPLATE = com.epam.ta.reportportal.jooq.tables.JPatternTemplate.PATTERN_TEMPLATE; - - /** - * The table public.pattern_template_test_item. - */ - public final JPatternTemplateTestItem PATTERN_TEMPLATE_TEST_ITEM = com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM; - - /** - * The table public.pgp_armor_headers. - */ - public final JPgpArmorHeaders PGP_ARMOR_HEADERS = com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS; - /** - * The table public.project. - */ - public final JProject PROJECT = com.epam.ta.reportportal.jooq.tables.JProject.PROJECT; - /** - * The table public.project_attribute. - */ - public final JProjectAttribute PROJECT_ATTRIBUTE = com.epam.ta.reportportal.jooq.tables.JProjectAttribute.PROJECT_ATTRIBUTE; - /** - * The table public.project_user. - */ - public final JProjectUser PROJECT_USER = com.epam.ta.reportportal.jooq.tables.JProjectUser.PROJECT_USER; - /** - * The table public.recipients. - */ - public final JRecipients RECIPIENTS = com.epam.ta.reportportal.jooq.tables.JRecipients.RECIPIENTS; - /** - * The table public.restore_password_bid. - */ - public final JRestorePasswordBid RESTORE_PASSWORD_BID = com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid.RESTORE_PASSWORD_BID; - /** - * The table public.sender_case. - */ - public final JSenderCase SENDER_CASE = com.epam.ta.reportportal.jooq.tables.JSenderCase.SENDER_CASE; - /** - * The table public.server_settings. - */ - public final JServerSettings SERVER_SETTINGS = com.epam.ta.reportportal.jooq.tables.JServerSettings.SERVER_SETTINGS; - /** - * The table public.shareable_entity. - */ - public final JShareableEntity SHAREABLE_ENTITY = com.epam.ta.reportportal.jooq.tables.JShareableEntity.SHAREABLE_ENTITY; - /** - * The table public.stale_materialized_view. - */ - public final JStaleMaterializedView STALE_MATERIALIZED_VIEW = com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView.STALE_MATERIALIZED_VIEW; - /** - * The table public.statistics. - */ - public final JStatistics STATISTICS = com.epam.ta.reportportal.jooq.tables.JStatistics.STATISTICS; - /** - * The table public.statistics_field. - */ - public final JStatisticsField STATISTICS_FIELD = com.epam.ta.reportportal.jooq.tables.JStatisticsField.STATISTICS_FIELD; - /** - * The table public.test_item. - */ - public final JTestItem TEST_ITEM = com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; - /** - * The table public.test_item_results. - */ - public final JTestItemResults TEST_ITEM_RESULTS = com.epam.ta.reportportal.jooq.tables.JTestItemResults.TEST_ITEM_RESULTS; - /** - * The table public.ticket. - */ - public final JTicket TICKET = com.epam.ta.reportportal.jooq.tables.JTicket.TICKET; - /** - * The table public.user_creation_bid. - */ - public final JUserCreationBid USER_CREATION_BID = com.epam.ta.reportportal.jooq.tables.JUserCreationBid.USER_CREATION_BID; - /** - * The table public.user_preference. - */ - public final JUserPreference USER_PREFERENCE = com.epam.ta.reportportal.jooq.tables.JUserPreference.USER_PREFERENCE; - /** - * The table public.users. - */ - public final JUsers USERS = com.epam.ta.reportportal.jooq.tables.JUsers.USERS; - /** - * The table public.widget. - */ - public final JWidget WIDGET = com.epam.ta.reportportal.jooq.tables.JWidget.WIDGET; - /** - * The table public.widget_filter. - */ - public final JWidgetFilter WIDGET_FILTER = com.epam.ta.reportportal.jooq.tables.JWidgetFilter.WIDGET_FILTER; - - /** - * No further instances allowed - */ - private JPublic() { - super("public", null); - } - - /** - * Call public.pgp_armor_headers. - */ - public static Result PGP_ARMOR_HEADERS(Configuration configuration, - String __1) { - return configuration.dsl().selectFrom( - com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1)).fetch(); - } - - /** - * Get public.pgp_armor_headers as a table. - */ - public static JPgpArmorHeaders PGP_ARMOR_HEADERS(String __1) { - return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); - } - - /** - * Get public.pgp_armor_headers as a table. - */ - public static JPgpArmorHeaders PGP_ARMOR_HEADERS(Field __1) { - return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); - } - - @Override - public Catalog getCatalog() { - return DefaultCatalog.DEFAULT_CATALOG; - } - - @Override - public final List> getSequences() { - List result = new ArrayList(); - result.addAll(getSequences0()); - return result; - } - - private final List> getSequences0() { - return Arrays.>asList( - Sequences.ACL_CLASS_ID_SEQ, - Sequences.ACL_ENTRY_ID_SEQ, - Sequences.ACL_OBJECT_IDENTITY_ID_SEQ, - Sequences.ACL_SID_ID_SEQ, - Sequences.ACTIVITY_ID_SEQ, - Sequences.ATTACHMENT_ID_SEQ, - Sequences.ATTRIBUTE_ID_SEQ, - Sequences.CLUSTERS_ID_SEQ, - Sequences.FILTER_CONDITION_ID_SEQ, - Sequences.FILTER_SORT_ID_SEQ, - Sequences.INTEGRATION_ID_SEQ, - Sequences.INTEGRATION_TYPE_ID_SEQ, - Sequences.ISSUE_GROUP_ISSUE_GROUP_ID_SEQ, - Sequences.ISSUE_TYPE_ID_SEQ, - Sequences.ITEM_ATTRIBUTE_ID_SEQ, - Sequences.LAUNCH_ATTRIBUTE_RULES_ID_SEQ, - Sequences.LAUNCH_ID_SEQ, - Sequences.LAUNCH_NUMBER_ID_SEQ, - Sequences.LOG_ID_SEQ, - Sequences.OAUTH_ACCESS_TOKEN_ID_SEQ, - Sequences.OAUTH_REGISTRATION_RESTRICTION_ID_SEQ, - Sequences.OAUTH_REGISTRATION_SCOPE_ID_SEQ, - Sequences.ONBOARDING_ID_SEQ, - Sequences.PATTERN_TEMPLATE_ID_SEQ, - Sequences.PROJECT_ATTRIBUTE_ATTRIBUTE_ID_SEQ, - Sequences.PROJECT_ATTRIBUTE_PROJECT_ID_SEQ, - Sequences.PROJECT_ID_SEQ, - Sequences.SENDER_CASE_ID_SEQ, - Sequences.SENDER_CASE_PROJECT_ID_SEQ, - Sequences.SERVER_SETTINGS_ID_SEQ, - Sequences.SHAREABLE_ENTITY_ID_SEQ, - Sequences.STALE_MATERIALIZED_VIEW_ID_SEQ, - Sequences.STATISTICS_FIELD_SF_ID_SEQ, - Sequences.STATISTICS_S_ID_SEQ, - Sequences.TEST_ITEM_ITEM_ID_SEQ, - Sequences.TICKET_ID_SEQ, - Sequences.USER_PREFERENCE_ID_SEQ, - Sequences.USERS_ID_SEQ); - } - - @Override - public final List> getTables() { - List result = new ArrayList(); - result.addAll(getTables0()); - return result; - } - - private final List> getTables0() { - return Arrays.>asList( - JAclClass.ACL_CLASS, - JAclEntry.ACL_ENTRY, - JAclObjectIdentity.ACL_OBJECT_IDENTITY, - JAclSid.ACL_SID, - JActivity.ACTIVITY, - JAttachment.ATTACHMENT, - JAttachmentDeletion.ATTACHMENT_DELETION, - JAttribute.ATTRIBUTE, - JClusters.CLUSTERS, - JClustersTestItem.CLUSTERS_TEST_ITEM, - JContentField.CONTENT_FIELD, - JDashboard.DASHBOARD, - JDashboardWidget.DASHBOARD_WIDGET, - JFilter.FILTER, - JFilterCondition.FILTER_CONDITION, - JFilterSort.FILTER_SORT, - JIntegration.INTEGRATION, - JIntegrationType.INTEGRATION_TYPE, - JIssue.ISSUE, - JIssueGroup.ISSUE_GROUP, - JIssueTicket.ISSUE_TICKET, - JIssueType.ISSUE_TYPE, - JIssueTypeProject.ISSUE_TYPE_PROJECT, - JItemAttribute.ITEM_ATTRIBUTE, - JLaunch.LAUNCH, - JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, - JLaunchNames.LAUNCH_NAMES, - JLaunchNumber.LAUNCH_NUMBER, - JLog.LOG, - JOauthAccessToken.OAUTH_ACCESS_TOKEN, - JOauthRegistration.OAUTH_REGISTRATION, - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, - JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, - JOnboarding.ONBOARDING, - JParameter.PARAMETER, - JPatternTemplate.PATTERN_TEMPLATE, - JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, - JPgpArmorHeaders.PGP_ARMOR_HEADERS, - JProject.PROJECT, - JProjectAttribute.PROJECT_ATTRIBUTE, - JProjectUser.PROJECT_USER, - JRecipients.RECIPIENTS, - JRestorePasswordBid.RESTORE_PASSWORD_BID, - JSenderCase.SENDER_CASE, - JServerSettings.SERVER_SETTINGS, - JShareableEntity.SHAREABLE_ENTITY, - JStaleMaterializedView.STALE_MATERIALIZED_VIEW, - JStatistics.STATISTICS, - JStatisticsField.STATISTICS_FIELD, - JTestItem.TEST_ITEM, - JTestItemResults.TEST_ITEM_RESULTS, - JTicket.TICKET, - JUserCreationBid.USER_CREATION_BID, - JUserPreference.USER_PREFERENCE, - JUsers.USERS, - JWidget.WIDGET, - JWidgetFilter.WIDGET_FILTER); - } + private static final long serialVersionUID = 1553647718; + + /** + * The reference instance of public + */ + public static final JPublic PUBLIC = new JPublic(); + + /** + * The table public.activity. + */ + public final JActivity ACTIVITY = com.epam.ta.reportportal.jooq.tables.JActivity.ACTIVITY; + + /** + * The table public.api_keys. + */ + public final JApiKeys API_KEYS = com.epam.ta.reportportal.jooq.tables.JApiKeys.API_KEYS; + + /** + * The table public.attachment. + */ + public final JAttachment ATTACHMENT = com.epam.ta.reportportal.jooq.tables.JAttachment.ATTACHMENT; + + /** + * The table public.attachment_deletion. + */ + public final JAttachmentDeletion ATTACHMENT_DELETION = com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion.ATTACHMENT_DELETION; + + /** + * The table public.attribute. + */ + public final JAttribute ATTRIBUTE = com.epam.ta.reportportal.jooq.tables.JAttribute.ATTRIBUTE; + + /** + * The table public.clusters. + */ + public final JClusters CLUSTERS = com.epam.ta.reportportal.jooq.tables.JClusters.CLUSTERS; + + /** + * The table public.clusters_test_item. + */ + public final JClustersTestItem CLUSTERS_TEST_ITEM = com.epam.ta.reportportal.jooq.tables.JClustersTestItem.CLUSTERS_TEST_ITEM; + + /** + * The table public.content_field. + */ + public final JContentField CONTENT_FIELD = com.epam.ta.reportportal.jooq.tables.JContentField.CONTENT_FIELD; + + /** + * The table public.dashboard. + */ + public final JDashboard DASHBOARD = com.epam.ta.reportportal.jooq.tables.JDashboard.DASHBOARD; + + /** + * The table public.dashboard_widget. + */ + public final JDashboardWidget DASHBOARD_WIDGET = com.epam.ta.reportportal.jooq.tables.JDashboardWidget.DASHBOARD_WIDGET; + + /** + * The table public.filter. + */ + public final JFilter FILTER = com.epam.ta.reportportal.jooq.tables.JFilter.FILTER; + + /** + * The table public.filter_condition. + */ + public final JFilterCondition FILTER_CONDITION = com.epam.ta.reportportal.jooq.tables.JFilterCondition.FILTER_CONDITION; + + /** + * The table public.filter_sort. + */ + public final JFilterSort FILTER_SORT = com.epam.ta.reportportal.jooq.tables.JFilterSort.FILTER_SORT; + + /** + * The table public.integration. + */ + public final JIntegration INTEGRATION = com.epam.ta.reportportal.jooq.tables.JIntegration.INTEGRATION; + + /** + * The table public.integration_type. + */ + public final JIntegrationType INTEGRATION_TYPE = com.epam.ta.reportportal.jooq.tables.JIntegrationType.INTEGRATION_TYPE; + + /** + * The table public.issue. + */ + public final JIssue ISSUE = com.epam.ta.reportportal.jooq.tables.JIssue.ISSUE; + + /** + * The table public.issue_group. + */ + public final JIssueGroup ISSUE_GROUP = com.epam.ta.reportportal.jooq.tables.JIssueGroup.ISSUE_GROUP; + + /** + * The table public.issue_ticket. + */ + public final JIssueTicket ISSUE_TICKET = com.epam.ta.reportportal.jooq.tables.JIssueTicket.ISSUE_TICKET; + + /** + * The table public.issue_type. + */ + public final JIssueType ISSUE_TYPE = com.epam.ta.reportportal.jooq.tables.JIssueType.ISSUE_TYPE; + + /** + * The table public.issue_type_project. + */ + public final JIssueTypeProject ISSUE_TYPE_PROJECT = com.epam.ta.reportportal.jooq.tables.JIssueTypeProject.ISSUE_TYPE_PROJECT; + + /** + * The table public.item_attribute. + */ + public final JItemAttribute ITEM_ATTRIBUTE = com.epam.ta.reportportal.jooq.tables.JItemAttribute.ITEM_ATTRIBUTE; + + /** + * The table public.launch. + */ + public final JLaunch LAUNCH = com.epam.ta.reportportal.jooq.tables.JLaunch.LAUNCH; + + /** + * The table public.launch_attribute_rules. + */ + public final JLaunchAttributeRules LAUNCH_ATTRIBUTE_RULES = com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES; + + /** + * The table public.launch_names. + */ + public final JLaunchNames LAUNCH_NAMES = com.epam.ta.reportportal.jooq.tables.JLaunchNames.LAUNCH_NAMES; + + /** + * The table public.launch_number. + */ + public final JLaunchNumber LAUNCH_NUMBER = com.epam.ta.reportportal.jooq.tables.JLaunchNumber.LAUNCH_NUMBER; + + /** + * The table public.log. + */ + public final JLog LOG = com.epam.ta.reportportal.jooq.tables.JLog.LOG; + + /** + * The table public.oauth_access_token. + */ + public final JOauthAccessToken OAUTH_ACCESS_TOKEN = com.epam.ta.reportportal.jooq.tables.JOauthAccessToken.OAUTH_ACCESS_TOKEN; + + /** + * The table public.oauth_registration. + */ + public final JOauthRegistration OAUTH_REGISTRATION = com.epam.ta.reportportal.jooq.tables.JOauthRegistration.OAUTH_REGISTRATION; + + /** + * The table public.oauth_registration_restriction. + */ + public final JOauthRegistrationRestriction OAUTH_REGISTRATION_RESTRICTION = com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION; + + /** + * The table public.oauth_registration_scope. + */ + public final JOauthRegistrationScope OAUTH_REGISTRATION_SCOPE = com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE; + + /** + * The table public.onboarding. + */ + public final JOnboarding ONBOARDING = com.epam.ta.reportportal.jooq.tables.JOnboarding.ONBOARDING; + + /** + * The table public.organization. + */ + public final JOrganization ORGANIZATION = com.epam.ta.reportportal.jooq.tables.JOrganization.ORGANIZATION; + + /** + * The table public.organization_attribute. + */ + public final JOrganizationAttribute ORGANIZATION_ATTRIBUTE = com.epam.ta.reportportal.jooq.tables.JOrganizationAttribute.ORGANIZATION_ATTRIBUTE; + + /** + * The table public.owned_entity. + */ + public final JOwnedEntity OWNED_ENTITY = com.epam.ta.reportportal.jooq.tables.JOwnedEntity.OWNED_ENTITY; + + /** + * The table public.parameter. + */ + public final JParameter PARAMETER = com.epam.ta.reportportal.jooq.tables.JParameter.PARAMETER; + + /** + * The table public.pattern_template. + */ + public final JPatternTemplate PATTERN_TEMPLATE = com.epam.ta.reportportal.jooq.tables.JPatternTemplate.PATTERN_TEMPLATE; + + /** + * The table public.pattern_template_test_item. + */ + public final JPatternTemplateTestItem PATTERN_TEMPLATE_TEST_ITEM = com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM; + + /** + * The table public.pgp_armor_headers. + */ + public final JPgpArmorHeaders PGP_ARMOR_HEADERS = com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS; + + /** + * Call public.pgp_armor_headers. + */ + public static Result PGP_ARMOR_HEADERS(Configuration configuration, String __1) { + return configuration.dsl().selectFrom(com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1)).fetch(); + } + + /** + * Get public.pgp_armor_headers as a table. + */ + public static JPgpArmorHeaders PGP_ARMOR_HEADERS(String __1) { + return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); + } + + /** + * Get public.pgp_armor_headers as a table. + */ + public static JPgpArmorHeaders PGP_ARMOR_HEADERS(Field __1) { + return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); + } + + /** + * The table public.project. + */ + public final JProject PROJECT = com.epam.ta.reportportal.jooq.tables.JProject.PROJECT; + + /** + * The table public.project_attribute. + */ + public final JProjectAttribute PROJECT_ATTRIBUTE = com.epam.ta.reportportal.jooq.tables.JProjectAttribute.PROJECT_ATTRIBUTE; + + /** + * The table public.project_user. + */ + public final JProjectUser PROJECT_USER = com.epam.ta.reportportal.jooq.tables.JProjectUser.PROJECT_USER; + + /** + * The table public.recipients. + */ + public final JRecipients RECIPIENTS = com.epam.ta.reportportal.jooq.tables.JRecipients.RECIPIENTS; + + /** + * The table public.restore_password_bid. + */ + public final JRestorePasswordBid RESTORE_PASSWORD_BID = com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid.RESTORE_PASSWORD_BID; + + /** + * The table public.sender_case. + */ + public final JSenderCase SENDER_CASE = com.epam.ta.reportportal.jooq.tables.JSenderCase.SENDER_CASE; + + /** + * The table public.server_settings. + */ + public final JServerSettings SERVER_SETTINGS = com.epam.ta.reportportal.jooq.tables.JServerSettings.SERVER_SETTINGS; + + /** + * The table public.shedlock. + */ + public final JShedlock SHEDLOCK = com.epam.ta.reportportal.jooq.tables.JShedlock.SHEDLOCK; + + /** + * The table public.stale_materialized_view. + */ + public final JStaleMaterializedView STALE_MATERIALIZED_VIEW = com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView.STALE_MATERIALIZED_VIEW; + + /** + * The table public.statistics. + */ + public final JStatistics STATISTICS = com.epam.ta.reportportal.jooq.tables.JStatistics.STATISTICS; + + /** + * The table public.statistics_field. + */ + public final JStatisticsField STATISTICS_FIELD = com.epam.ta.reportportal.jooq.tables.JStatisticsField.STATISTICS_FIELD; + + /** + * The table public.test_item. + */ + public final JTestItem TEST_ITEM = com.epam.ta.reportportal.jooq.tables.JTestItem.TEST_ITEM; + + /** + * The table public.test_item_results. + */ + public final JTestItemResults TEST_ITEM_RESULTS = com.epam.ta.reportportal.jooq.tables.JTestItemResults.TEST_ITEM_RESULTS; + + /** + * The table public.ticket. + */ + public final JTicket TICKET = com.epam.ta.reportportal.jooq.tables.JTicket.TICKET; + + /** + * The table public.user_creation_bid. + */ + public final JUserCreationBid USER_CREATION_BID = com.epam.ta.reportportal.jooq.tables.JUserCreationBid.USER_CREATION_BID; + + /** + * The table public.user_preference. + */ + public final JUserPreference USER_PREFERENCE = com.epam.ta.reportportal.jooq.tables.JUserPreference.USER_PREFERENCE; + + /** + * The table public.users. + */ + public final JUsers USERS = com.epam.ta.reportportal.jooq.tables.JUsers.USERS; + + /** + * The table public.widget. + */ + public final JWidget WIDGET = com.epam.ta.reportportal.jooq.tables.JWidget.WIDGET; + + /** + * The table public.widget_filter. + */ + public final JWidgetFilter WIDGET_FILTER = com.epam.ta.reportportal.jooq.tables.JWidgetFilter.WIDGET_FILTER; + + /** + * No further instances allowed + */ + private JPublic() { + super("public", null); + } + + + @Override + public Catalog getCatalog() { + return DefaultCatalog.DEFAULT_CATALOG; + } + + @Override + public final List> getSequences() { + List result = new ArrayList(); + result.addAll(getSequences0()); + return result; + } + + private final List> getSequences0() { + return Arrays.>asList( + Sequences.ACTIVITY_ID_SEQ, + Sequences.API_KEYS_ID_SEQ, + Sequences.ATTACHMENT_ID_SEQ, + Sequences.ATTRIBUTE_ID_SEQ, + Sequences.CLUSTERS_ID_SEQ, + Sequences.FILTER_CONDITION_ID_SEQ, + Sequences.FILTER_SORT_ID_SEQ, + Sequences.INTEGRATION_ID_SEQ, + Sequences.INTEGRATION_TYPE_ID_SEQ, + Sequences.ISSUE_GROUP_ISSUE_GROUP_ID_SEQ, + Sequences.ISSUE_TYPE_ID_SEQ, + Sequences.ITEM_ATTRIBUTE_ID_SEQ, + Sequences.LAUNCH_ATTRIBUTE_RULES_ID_SEQ, + Sequences.LAUNCH_ID_SEQ, + Sequences.LAUNCH_NUMBER_ID_SEQ, + Sequences.LOG_ID_SEQ, + Sequences.OAUTH_ACCESS_TOKEN_ID_SEQ, + Sequences.OAUTH_REGISTRATION_RESTRICTION_ID_SEQ, + Sequences.OAUTH_REGISTRATION_SCOPE_ID_SEQ, + Sequences.ONBOARDING_ID_SEQ, + Sequences.ORGANIZATION_ATTRIBUTE_ID_SEQ, + Sequences.ORGANIZATION_ID_SEQ, + Sequences.PATTERN_TEMPLATE_ID_SEQ, + Sequences.PROJECT_ATTRIBUTE_ATTRIBUTE_ID_SEQ, + Sequences.PROJECT_ATTRIBUTE_PROJECT_ID_SEQ, + Sequences.PROJECT_ID_SEQ, + Sequences.SENDER_CASE_ID_SEQ, + Sequences.SENDER_CASE_PROJECT_ID_SEQ, + Sequences.SERVER_SETTINGS_ID_SEQ, + Sequences.SHAREABLE_ENTITY_ID_SEQ, + Sequences.STALE_MATERIALIZED_VIEW_ID_SEQ, + Sequences.STATISTICS_FIELD_SF_ID_SEQ, + Sequences.STATISTICS_S_ID_SEQ, + Sequences.TEST_ITEM_ITEM_ID_SEQ, + Sequences.TICKET_ID_SEQ, + Sequences.USER_PREFERENCE_ID_SEQ, + Sequences.USERS_ID_SEQ); + } + + @Override + public final List> getTables() { + List result = new ArrayList(); + result.addAll(getTables0()); + return result; + } + + private final List> getTables0() { + return Arrays.>asList( + JActivity.ACTIVITY, + JApiKeys.API_KEYS, + JAttachment.ATTACHMENT, + JAttachmentDeletion.ATTACHMENT_DELETION, + JAttribute.ATTRIBUTE, + JClusters.CLUSTERS, + JClustersTestItem.CLUSTERS_TEST_ITEM, + JContentField.CONTENT_FIELD, + JDashboard.DASHBOARD, + JDashboardWidget.DASHBOARD_WIDGET, + JFilter.FILTER, + JFilterCondition.FILTER_CONDITION, + JFilterSort.FILTER_SORT, + JIntegration.INTEGRATION, + JIntegrationType.INTEGRATION_TYPE, + JIssue.ISSUE, + JIssueGroup.ISSUE_GROUP, + JIssueTicket.ISSUE_TICKET, + JIssueType.ISSUE_TYPE, + JIssueTypeProject.ISSUE_TYPE_PROJECT, + JItemAttribute.ITEM_ATTRIBUTE, + JLaunch.LAUNCH, + JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, + JLaunchNames.LAUNCH_NAMES, + JLaunchNumber.LAUNCH_NUMBER, + JLog.LOG, + JOauthAccessToken.OAUTH_ACCESS_TOKEN, + JOauthRegistration.OAUTH_REGISTRATION, + JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, + JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, + JOnboarding.ONBOARDING, + JOrganization.ORGANIZATION, + JOrganizationAttribute.ORGANIZATION_ATTRIBUTE, + JOwnedEntity.OWNED_ENTITY, + JParameter.PARAMETER, + JPatternTemplate.PATTERN_TEMPLATE, + JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, + JPgpArmorHeaders.PGP_ARMOR_HEADERS, + JProject.PROJECT, + JProjectAttribute.PROJECT_ATTRIBUTE, + JProjectUser.PROJECT_USER, + JRecipients.RECIPIENTS, + JRestorePasswordBid.RESTORE_PASSWORD_BID, + JSenderCase.SENDER_CASE, + JServerSettings.SERVER_SETTINGS, + JShedlock.SHEDLOCK, + JStaleMaterializedView.STALE_MATERIALIZED_VIEW, + JStatistics.STATISTICS, + JStatisticsField.STATISTICS_FIELD, + JTestItem.TEST_ITEM, + JTestItemResults.TEST_ITEM_RESULTS, + JTicket.TICKET, + JUserCreationBid.USER_CREATION_BID, + JUserPreference.USER_PREFERENCE, + JUsers.USERS, + JWidget.WIDGET, + JWidgetFilter.WIDGET_FILTER); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Keys.java b/src/main/java/com/epam/ta/reportportal/jooq/Keys.java old mode 100755 new mode 100644 index db174c4fb..f505ae0a5 --- a/src/main/java/com/epam/ta/reportportal/jooq/Keys.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Keys.java @@ -4,11 +4,8 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.JAclClass; -import com.epam.ta.reportportal.jooq.tables.JAclEntry; -import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; -import com.epam.ta.reportportal.jooq.tables.JAclSid; import com.epam.ta.reportportal.jooq.tables.JActivity; +import com.epam.ta.reportportal.jooq.tables.JApiKeys; import com.epam.ta.reportportal.jooq.tables.JAttachment; import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; import com.epam.ta.reportportal.jooq.tables.JAttribute; @@ -38,6 +35,9 @@ import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; import com.epam.ta.reportportal.jooq.tables.JOnboarding; +import com.epam.ta.reportportal.jooq.tables.JOrganization; +import com.epam.ta.reportportal.jooq.tables.JOrganizationAttribute; +import com.epam.ta.reportportal.jooq.tables.JOwnedEntity; import com.epam.ta.reportportal.jooq.tables.JParameter; import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; @@ -48,7 +48,7 @@ import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; import com.epam.ta.reportportal.jooq.tables.JSenderCase; import com.epam.ta.reportportal.jooq.tables.JServerSettings; -import com.epam.ta.reportportal.jooq.tables.JShareableEntity; +import com.epam.ta.reportportal.jooq.tables.JShedlock; import com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView; import com.epam.ta.reportportal.jooq.tables.JStatistics; import com.epam.ta.reportportal.jooq.tables.JStatisticsField; @@ -60,11 +60,8 @@ import com.epam.ta.reportportal.jooq.tables.JUsers; import com.epam.ta.reportportal.jooq.tables.JWidget; import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; -import com.epam.ta.reportportal.jooq.tables.records.JAclClassRecord; -import com.epam.ta.reportportal.jooq.tables.records.JAclEntryRecord; -import com.epam.ta.reportportal.jooq.tables.records.JAclObjectIdentityRecord; -import com.epam.ta.reportportal.jooq.tables.records.JAclSidRecord; import com.epam.ta.reportportal.jooq.tables.records.JActivityRecord; +import com.epam.ta.reportportal.jooq.tables.records.JApiKeysRecord; import com.epam.ta.reportportal.jooq.tables.records.JAttachmentDeletionRecord; import com.epam.ta.reportportal.jooq.tables.records.JAttachmentRecord; import com.epam.ta.reportportal.jooq.tables.records.JAttributeRecord; @@ -94,6 +91,9 @@ import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationRestrictionRecord; import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationScopeRecord; import com.epam.ta.reportportal.jooq.tables.records.JOnboardingRecord; +import com.epam.ta.reportportal.jooq.tables.records.JOrganizationAttributeRecord; +import com.epam.ta.reportportal.jooq.tables.records.JOrganizationRecord; +import com.epam.ta.reportportal.jooq.tables.records.JOwnedEntityRecord; import com.epam.ta.reportportal.jooq.tables.records.JParameterRecord; import com.epam.ta.reportportal.jooq.tables.records.JPatternTemplateRecord; import com.epam.ta.reportportal.jooq.tables.records.JPatternTemplateTestItemRecord; @@ -104,7 +104,7 @@ import com.epam.ta.reportportal.jooq.tables.records.JRestorePasswordBidRecord; import com.epam.ta.reportportal.jooq.tables.records.JSenderCaseRecord; import com.epam.ta.reportportal.jooq.tables.records.JServerSettingsRecord; -import com.epam.ta.reportportal.jooq.tables.records.JShareableEntityRecord; +import com.epam.ta.reportportal.jooq.tables.records.JShedlockRecord; import com.epam.ta.reportportal.jooq.tables.records.JStaleMaterializedViewRecord; import com.epam.ta.reportportal.jooq.tables.records.JStatisticsFieldRecord; import com.epam.ta.reportportal.jooq.tables.records.JStatisticsRecord; @@ -116,7 +116,9 @@ import com.epam.ta.reportportal.jooq.tables.records.JUsersRecord; import com.epam.ta.reportportal.jooq.tables.records.JWidgetFilterRecord; import com.epam.ta.reportportal.jooq.tables.records.JWidgetRecord; + import javax.annotation.processing.Generated; + import org.jooq.ForeignKey; import org.jooq.Identity; import org.jooq.UniqueKey; @@ -124,8 +126,8 @@ /** - * A class modelling foreign key relationships and constraints of tables of the public - * schema. + * A class modelling foreign key relationships and constraints of tables of + * the public schema. */ @Generated( value = { @@ -134,722 +136,372 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Keys { - // ------------------------------------------------------------------------- - // IDENTITY definitions - // ------------------------------------------------------------------------- - - public static final Identity IDENTITY_ACL_CLASS = Identities0.IDENTITY_ACL_CLASS; - public static final Identity IDENTITY_ACL_ENTRY = Identities0.IDENTITY_ACL_ENTRY; - public static final Identity IDENTITY_ACL_OBJECT_IDENTITY = Identities0.IDENTITY_ACL_OBJECT_IDENTITY; - public static final Identity IDENTITY_ACL_SID = Identities0.IDENTITY_ACL_SID; - public static final Identity IDENTITY_ACTIVITY = Identities0.IDENTITY_ACTIVITY; - public static final Identity IDENTITY_ATTACHMENT = Identities0.IDENTITY_ATTACHMENT; - public static final Identity IDENTITY_ATTRIBUTE = Identities0.IDENTITY_ATTRIBUTE; - public static final Identity IDENTITY_CLUSTERS = Identities0.IDENTITY_CLUSTERS; - public static final Identity IDENTITY_FILTER_CONDITION = Identities0.IDENTITY_FILTER_CONDITION; - public static final Identity IDENTITY_FILTER_SORT = Identities0.IDENTITY_FILTER_SORT; - public static final Identity IDENTITY_INTEGRATION = Identities0.IDENTITY_INTEGRATION; - public static final Identity IDENTITY_INTEGRATION_TYPE = Identities0.IDENTITY_INTEGRATION_TYPE; - public static final Identity IDENTITY_ISSUE_GROUP = Identities0.IDENTITY_ISSUE_GROUP; - public static final Identity IDENTITY_ISSUE_TYPE = Identities0.IDENTITY_ISSUE_TYPE; - public static final Identity IDENTITY_ITEM_ATTRIBUTE = Identities0.IDENTITY_ITEM_ATTRIBUTE; - public static final Identity IDENTITY_LAUNCH = Identities0.IDENTITY_LAUNCH; - public static final Identity IDENTITY_LAUNCH_ATTRIBUTE_RULES = Identities0.IDENTITY_LAUNCH_ATTRIBUTE_RULES; - public static final Identity IDENTITY_LAUNCH_NUMBER = Identities0.IDENTITY_LAUNCH_NUMBER; - public static final Identity IDENTITY_LOG = Identities0.IDENTITY_LOG; - public static final Identity IDENTITY_OAUTH_ACCESS_TOKEN = Identities0.IDENTITY_OAUTH_ACCESS_TOKEN; - public static final Identity IDENTITY_OAUTH_REGISTRATION_RESTRICTION = Identities0.IDENTITY_OAUTH_REGISTRATION_RESTRICTION; - public static final Identity IDENTITY_OAUTH_REGISTRATION_SCOPE = Identities0.IDENTITY_OAUTH_REGISTRATION_SCOPE; - public static final Identity IDENTITY_ONBOARDING = Identities0.IDENTITY_ONBOARDING; - public static final Identity IDENTITY_PATTERN_TEMPLATE = Identities0.IDENTITY_PATTERN_TEMPLATE; - public static final Identity IDENTITY_PROJECT = Identities0.IDENTITY_PROJECT; - public static final Identity IDENTITY_PROJECT_ATTRIBUTE = Identities0.IDENTITY_PROJECT_ATTRIBUTE; - public static final Identity IDENTITY_SENDER_CASE = Identities0.IDENTITY_SENDER_CASE; - public static final Identity IDENTITY_SERVER_SETTINGS = Identities0.IDENTITY_SERVER_SETTINGS; - public static final Identity IDENTITY_SHAREABLE_ENTITY = Identities0.IDENTITY_SHAREABLE_ENTITY; - public static final Identity IDENTITY_STALE_MATERIALIZED_VIEW = Identities0.IDENTITY_STALE_MATERIALIZED_VIEW; - public static final Identity IDENTITY_STATISTICS = Identities0.IDENTITY_STATISTICS; - public static final Identity IDENTITY_STATISTICS_FIELD = Identities0.IDENTITY_STATISTICS_FIELD; - public static final Identity IDENTITY_TEST_ITEM = Identities0.IDENTITY_TEST_ITEM; - public static final Identity IDENTITY_TICKET = Identities0.IDENTITY_TICKET; - public static final Identity IDENTITY_USER_PREFERENCE = Identities0.IDENTITY_USER_PREFERENCE; - public static final Identity IDENTITY_USERS = Identities0.IDENTITY_USERS; - - // ------------------------------------------------------------------------- - // UNIQUE and PRIMARY KEY definitions - // ------------------------------------------------------------------------- - - public static final UniqueKey ACL_CLASS_PKEY = UniqueKeys0.ACL_CLASS_PKEY; - public static final UniqueKey UNIQUE_UK_2 = UniqueKeys0.UNIQUE_UK_2; - public static final UniqueKey ACL_ENTRY_PKEY = UniqueKeys0.ACL_ENTRY_PKEY; - public static final UniqueKey UNIQUE_UK_4 = UniqueKeys0.UNIQUE_UK_4; - public static final UniqueKey ACL_OBJECT_IDENTITY_PKEY = UniqueKeys0.ACL_OBJECT_IDENTITY_PKEY; - public static final UniqueKey UNIQUE_UK_3 = UniqueKeys0.UNIQUE_UK_3; - public static final UniqueKey ACL_SID_PKEY = UniqueKeys0.ACL_SID_PKEY; - public static final UniqueKey UNIQUE_UK_1 = UniqueKeys0.UNIQUE_UK_1; - public static final UniqueKey ACTIVITY_PK = UniqueKeys0.ACTIVITY_PK; - public static final UniqueKey ATTACHMENT_PK = UniqueKeys0.ATTACHMENT_PK; - public static final UniqueKey ATTACHMENT_DELETION_PKEY = UniqueKeys0.ATTACHMENT_DELETION_PKEY; - public static final UniqueKey ATTRIBUTE_PK = UniqueKeys0.ATTRIBUTE_PK; - public static final UniqueKey CLUSTERS_PK = UniqueKeys0.CLUSTERS_PK; - public static final UniqueKey INDEX_ID_LAUNCH_ID_UNQ = UniqueKeys0.INDEX_ID_LAUNCH_ID_UNQ; - public static final UniqueKey CLUSTER_ITEM_UNQ = UniqueKeys0.CLUSTER_ITEM_UNQ; - public static final UniqueKey DASHBOARD_PKEY = UniqueKeys0.DASHBOARD_PKEY; - public static final UniqueKey DASHBOARD_WIDGET_PK = UniqueKeys0.DASHBOARD_WIDGET_PK; - public static final UniqueKey WIDGET_ON_DASHBOARD_UNQ = UniqueKeys0.WIDGET_ON_DASHBOARD_UNQ; - public static final UniqueKey FILTER_PKEY = UniqueKeys0.FILTER_PKEY; - public static final UniqueKey FILTER_CONDITION_PK = UniqueKeys0.FILTER_CONDITION_PK; - public static final UniqueKey FILTER_SORT_PK = UniqueKeys0.FILTER_SORT_PK; - public static final UniqueKey INTEGRATION_PK = UniqueKeys0.INTEGRATION_PK; - public static final UniqueKey INTEGRATION_TYPE_PK = UniqueKeys0.INTEGRATION_TYPE_PK; - public static final UniqueKey INTEGRATION_TYPE_NAME_KEY = UniqueKeys0.INTEGRATION_TYPE_NAME_KEY; - public static final UniqueKey ISSUE_PK = UniqueKeys0.ISSUE_PK; - public static final UniqueKey ISSUE_GROUP_PK = UniqueKeys0.ISSUE_GROUP_PK; - public static final UniqueKey ISSUE_TICKET_PK = UniqueKeys0.ISSUE_TICKET_PK; - public static final UniqueKey ISSUE_TYPE_PK = UniqueKeys0.ISSUE_TYPE_PK; - public static final UniqueKey ISSUE_TYPE_LOCATOR_KEY = UniqueKeys0.ISSUE_TYPE_LOCATOR_KEY; - public static final UniqueKey ISSUE_TYPE_PROJECT_PK = UniqueKeys0.ISSUE_TYPE_PROJECT_PK; - public static final UniqueKey ITEM_ATTRIBUTE_PK = UniqueKeys0.ITEM_ATTRIBUTE_PK; - public static final UniqueKey LAUNCH_PK = UniqueKeys0.LAUNCH_PK; - public static final UniqueKey LAUNCH_UUID_KEY = UniqueKeys0.LAUNCH_UUID_KEY; - public static final UniqueKey UNQ_NAME_NUMBER = UniqueKeys0.UNQ_NAME_NUMBER; - public static final UniqueKey LAUNCH_ATTRIBUTE_RULES_PK = UniqueKeys0.LAUNCH_ATTRIBUTE_RULES_PK; - public static final UniqueKey LAUNCH_NUMBER_PK = UniqueKeys0.LAUNCH_NUMBER_PK; - public static final UniqueKey UNQ_PROJECT_NAME = UniqueKeys0.UNQ_PROJECT_NAME; - public static final UniqueKey LOG_PK = UniqueKeys0.LOG_PK; - public static final UniqueKey OAUTH_ACCESS_TOKEN_PKEY = UniqueKeys0.OAUTH_ACCESS_TOKEN_PKEY; - public static final UniqueKey USERS_ACCESS_TOKEN_UNIQUE = UniqueKeys0.USERS_ACCESS_TOKEN_UNIQUE; - public static final UniqueKey OAUTH_REGISTRATION_PKEY = UniqueKeys0.OAUTH_REGISTRATION_PKEY; - public static final UniqueKey OAUTH_REGISTRATION_CLIENT_ID_KEY = UniqueKeys0.OAUTH_REGISTRATION_CLIENT_ID_KEY; - public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_PK = UniqueKeys0.OAUTH_REGISTRATION_RESTRICTION_PK; - public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_UNIQUE = UniqueKeys0.OAUTH_REGISTRATION_RESTRICTION_UNIQUE; - public static final UniqueKey OAUTH_REGISTRATION_SCOPE_PK = UniqueKeys0.OAUTH_REGISTRATION_SCOPE_PK; - public static final UniqueKey OAUTH_REGISTRATION_SCOPE_UNIQUE = UniqueKeys0.OAUTH_REGISTRATION_SCOPE_UNIQUE; - public static final UniqueKey ONBOARDING_PK = UniqueKeys0.ONBOARDING_PK; - public static final UniqueKey PATTERN_TEMPLATE_PK = UniqueKeys0.PATTERN_TEMPLATE_PK; - public static final UniqueKey UNQ_NAME_PROJECTID = UniqueKeys0.UNQ_NAME_PROJECTID; - public static final UniqueKey PATTERN_ITEM_UNQ = UniqueKeys0.PATTERN_ITEM_UNQ; - public static final UniqueKey PROJECT_PK = UniqueKeys0.PROJECT_PK; - public static final UniqueKey PROJECT_NAME_KEY = UniqueKeys0.PROJECT_NAME_KEY; - public static final UniqueKey UNIQUE_ATTRIBUTE_PER_PROJECT = UniqueKeys0.UNIQUE_ATTRIBUTE_PER_PROJECT; - public static final UniqueKey USERS_PROJECT_PK = UniqueKeys0.USERS_PROJECT_PK; - public static final UniqueKey RESTORE_PASSWORD_BID_PK = UniqueKeys0.RESTORE_PASSWORD_BID_PK; - public static final UniqueKey RESTORE_PASSWORD_BID_EMAIL_KEY = UniqueKeys0.RESTORE_PASSWORD_BID_EMAIL_KEY; - public static final UniqueKey SENDER_CASE_PK = UniqueKeys0.SENDER_CASE_PK; - public static final UniqueKey SERVER_SETTINGS_ID = UniqueKeys0.SERVER_SETTINGS_ID; - public static final UniqueKey SERVER_SETTINGS_KEY_KEY = UniqueKeys0.SERVER_SETTINGS_KEY_KEY; - public static final UniqueKey SHAREABLE_PK = UniqueKeys0.SHAREABLE_PK; - public static final UniqueKey STALE_MATERIALIZED_VIEW_PKEY = UniqueKeys0.STALE_MATERIALIZED_VIEW_PKEY; - public static final UniqueKey STALE_MATERIALIZED_VIEW_NAME_KEY = UniqueKeys0.STALE_MATERIALIZED_VIEW_NAME_KEY; - public static final UniqueKey STATISTICS_PK = UniqueKeys0.STATISTICS_PK; - public static final UniqueKey UNIQUE_STATS_LAUNCH = UniqueKeys0.UNIQUE_STATS_LAUNCH; - public static final UniqueKey UNIQUE_STATS_ITEM = UniqueKeys0.UNIQUE_STATS_ITEM; - public static final UniqueKey STATISTICS_FIELD_PK = UniqueKeys0.STATISTICS_FIELD_PK; - public static final UniqueKey STATISTICS_FIELD_NAME_KEY = UniqueKeys0.STATISTICS_FIELD_NAME_KEY; - public static final UniqueKey TEST_ITEM_PK = UniqueKeys0.TEST_ITEM_PK; - public static final UniqueKey TEST_ITEM_UUID_KEY = UniqueKeys0.TEST_ITEM_UUID_KEY; - public static final UniqueKey TEST_ITEM_RESULTS_PK = UniqueKeys0.TEST_ITEM_RESULTS_PK; - public static final UniqueKey TICKET_PK = UniqueKeys0.TICKET_PK; - public static final UniqueKey USER_CREATION_BID_PK = UniqueKeys0.USER_CREATION_BID_PK; - public static final UniqueKey USER_PREFERENCE_PK = UniqueKeys0.USER_PREFERENCE_PK; - public static final UniqueKey USER_PREFERENCE_UQ = UniqueKeys0.USER_PREFERENCE_UQ; - public static final UniqueKey USERS_PK = UniqueKeys0.USERS_PK; - public static final UniqueKey USERS_LOGIN_KEY = UniqueKeys0.USERS_LOGIN_KEY; - public static final UniqueKey USERS_EMAIL_KEY = UniqueKeys0.USERS_EMAIL_KEY; - public static final UniqueKey WIDGET_PKEY = UniqueKeys0.WIDGET_PKEY; - public static final UniqueKey WIDGET_FILTER_PK = UniqueKeys0.WIDGET_FILTER_PK; + // ------------------------------------------------------------------------- + // IDENTITY definitions + // ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- - // FOREIGN KEY definitions - // ------------------------------------------------------------------------- + public static final Identity IDENTITY_ACTIVITY = Identities0.IDENTITY_ACTIVITY; + public static final Identity IDENTITY_API_KEYS = Identities0.IDENTITY_API_KEYS; + public static final Identity IDENTITY_ATTACHMENT = Identities0.IDENTITY_ATTACHMENT; + public static final Identity IDENTITY_ATTRIBUTE = Identities0.IDENTITY_ATTRIBUTE; + public static final Identity IDENTITY_CLUSTERS = Identities0.IDENTITY_CLUSTERS; + public static final Identity IDENTITY_FILTER_CONDITION = Identities0.IDENTITY_FILTER_CONDITION; + public static final Identity IDENTITY_FILTER_SORT = Identities0.IDENTITY_FILTER_SORT; + public static final Identity IDENTITY_INTEGRATION = Identities0.IDENTITY_INTEGRATION; + public static final Identity IDENTITY_INTEGRATION_TYPE = Identities0.IDENTITY_INTEGRATION_TYPE; + public static final Identity IDENTITY_ISSUE_GROUP = Identities0.IDENTITY_ISSUE_GROUP; + public static final Identity IDENTITY_ISSUE_TYPE = Identities0.IDENTITY_ISSUE_TYPE; + public static final Identity IDENTITY_ITEM_ATTRIBUTE = Identities0.IDENTITY_ITEM_ATTRIBUTE; + public static final Identity IDENTITY_LAUNCH = Identities0.IDENTITY_LAUNCH; + public static final Identity IDENTITY_LAUNCH_ATTRIBUTE_RULES = Identities0.IDENTITY_LAUNCH_ATTRIBUTE_RULES; + public static final Identity IDENTITY_LAUNCH_NUMBER = Identities0.IDENTITY_LAUNCH_NUMBER; + public static final Identity IDENTITY_LOG = Identities0.IDENTITY_LOG; + public static final Identity IDENTITY_OAUTH_ACCESS_TOKEN = Identities0.IDENTITY_OAUTH_ACCESS_TOKEN; + public static final Identity IDENTITY_OAUTH_REGISTRATION_RESTRICTION = Identities0.IDENTITY_OAUTH_REGISTRATION_RESTRICTION; + public static final Identity IDENTITY_OAUTH_REGISTRATION_SCOPE = Identities0.IDENTITY_OAUTH_REGISTRATION_SCOPE; + public static final Identity IDENTITY_ONBOARDING = Identities0.IDENTITY_ONBOARDING; + public static final Identity IDENTITY_ORGANIZATION = Identities0.IDENTITY_ORGANIZATION; + public static final Identity IDENTITY_ORGANIZATION_ATTRIBUTE = Identities0.IDENTITY_ORGANIZATION_ATTRIBUTE; + public static final Identity IDENTITY_OWNED_ENTITY = Identities0.IDENTITY_OWNED_ENTITY; + public static final Identity IDENTITY_PATTERN_TEMPLATE = Identities0.IDENTITY_PATTERN_TEMPLATE; + public static final Identity IDENTITY_PROJECT = Identities0.IDENTITY_PROJECT; + public static final Identity IDENTITY_PROJECT_ATTRIBUTE = Identities0.IDENTITY_PROJECT_ATTRIBUTE; + public static final Identity IDENTITY_SENDER_CASE = Identities0.IDENTITY_SENDER_CASE; + public static final Identity IDENTITY_SERVER_SETTINGS = Identities0.IDENTITY_SERVER_SETTINGS; + public static final Identity IDENTITY_STALE_MATERIALIZED_VIEW = Identities0.IDENTITY_STALE_MATERIALIZED_VIEW; + public static final Identity IDENTITY_STATISTICS = Identities0.IDENTITY_STATISTICS; + public static final Identity IDENTITY_STATISTICS_FIELD = Identities0.IDENTITY_STATISTICS_FIELD; + public static final Identity IDENTITY_TEST_ITEM = Identities0.IDENTITY_TEST_ITEM; + public static final Identity IDENTITY_TICKET = Identities0.IDENTITY_TICKET; + public static final Identity IDENTITY_USER_PREFERENCE = Identities0.IDENTITY_USER_PREFERENCE; + public static final Identity IDENTITY_USERS = Identities0.IDENTITY_USERS; - public static final ForeignKey ACL_ENTRY__FOREIGN_FK_4 = ForeignKeys0.ACL_ENTRY__FOREIGN_FK_4; - public static final ForeignKey ACL_ENTRY__FOREIGN_FK_5 = ForeignKeys0.ACL_ENTRY__FOREIGN_FK_5; - public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_2 = ForeignKeys0.ACL_OBJECT_IDENTITY__FOREIGN_FK_2; - public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_1 = ForeignKeys0.ACL_OBJECT_IDENTITY__FOREIGN_FK_1; - public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_3 = ForeignKeys0.ACL_OBJECT_IDENTITY__FOREIGN_FK_3; - public static final ForeignKey ACL_SID__ACL_SID_SID_FKEY = ForeignKeys0.ACL_SID__ACL_SID_SID_FKEY; - public static final ForeignKey ACTIVITY__ACTIVITY_USER_ID_FKEY = ForeignKeys0.ACTIVITY__ACTIVITY_USER_ID_FKEY; - public static final ForeignKey ACTIVITY__ACTIVITY_PROJECT_ID_FKEY = ForeignKeys0.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY; - public static final ForeignKey CONTENT_FIELD__CONTENT_FIELD_ID_FKEY = ForeignKeys0.CONTENT_FIELD__CONTENT_FIELD_ID_FKEY; - public static final ForeignKey DASHBOARD__DASHBOARD_ID_FK = ForeignKeys0.DASHBOARD__DASHBOARD_ID_FK; - public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY = ForeignKeys0.DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY; - public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY = ForeignKeys0.DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY; - public static final ForeignKey FILTER__FILTER_ID_FK = ForeignKeys0.FILTER__FILTER_ID_FK; - public static final ForeignKey FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY = ForeignKeys0.FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY; - public static final ForeignKey FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY = ForeignKeys0.FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY; - public static final ForeignKey INTEGRATION__INTEGRATION_PROJECT_ID_FKEY = ForeignKeys0.INTEGRATION__INTEGRATION_PROJECT_ID_FKEY; - public static final ForeignKey INTEGRATION__INTEGRATION_TYPE_FKEY = ForeignKeys0.INTEGRATION__INTEGRATION_TYPE_FKEY; - public static final ForeignKey ISSUE__ISSUE_ISSUE_ID_FKEY = ForeignKeys0.ISSUE__ISSUE_ISSUE_ID_FKEY; - public static final ForeignKey ISSUE__ISSUE_ISSUE_TYPE_FKEY = ForeignKeys0.ISSUE__ISSUE_ISSUE_TYPE_FKEY; - public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY = ForeignKeys0.ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY; - public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY = ForeignKeys0.ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY; - public static final ForeignKey ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY = ForeignKeys0.ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY; - public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY = ForeignKeys0.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY; - public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY = ForeignKeys0.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY; - public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY = ForeignKeys0.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY; - public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY = ForeignKeys0.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY; - public static final ForeignKey LAUNCH__LAUNCH_PROJECT_ID_FKEY = ForeignKeys0.LAUNCH__LAUNCH_PROJECT_ID_FKEY; - public static final ForeignKey LAUNCH__LAUNCH_USER_ID_FKEY = ForeignKeys0.LAUNCH__LAUNCH_USER_ID_FKEY; - public static final ForeignKey LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY = ForeignKeys0.LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY; - public static final ForeignKey LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY = ForeignKeys0.LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY; - public static final ForeignKey LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY = ForeignKeys0.LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY; - public static final ForeignKey LOG__LOG_ITEM_ID_FKEY = ForeignKeys0.LOG__LOG_ITEM_ID_FKEY; - public static final ForeignKey LOG__LOG_LAUNCH_ID_FKEY = ForeignKeys0.LOG__LOG_LAUNCH_ID_FKEY; - public static final ForeignKey LOG__LOG_ATTACHMENT_ID_FKEY = ForeignKeys0.LOG__LOG_ATTACHMENT_ID_FKEY; - public static final ForeignKey OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY = ForeignKeys0.OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY; - public static final ForeignKey OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY = ForeignKeys0.OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY; - public static final ForeignKey OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY = ForeignKeys0.OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY; - public static final ForeignKey PARAMETER__PARAMETER_ITEM_ID_FKEY = ForeignKeys0.PARAMETER__PARAMETER_ITEM_ID_FKEY; - public static final ForeignKey PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY = ForeignKeys0.PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY; - public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY = ForeignKeys0.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY; - public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY = ForeignKeys0.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY; - public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY = ForeignKeys0.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY; - public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY = ForeignKeys0.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY; - public static final ForeignKey PROJECT_USER__PROJECT_USER_USER_ID_FKEY = ForeignKeys0.PROJECT_USER__PROJECT_USER_USER_ID_FKEY; - public static final ForeignKey PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY = ForeignKeys0.PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY; - public static final ForeignKey RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY = ForeignKeys0.RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY; - public static final ForeignKey SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY = ForeignKeys0.SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY; - public static final ForeignKey SHAREABLE_ENTITY__SHAREABLE_ENTITY_OWNER_FKEY = ForeignKeys0.SHAREABLE_ENTITY__SHAREABLE_ENTITY_OWNER_FKEY; - public static final ForeignKey SHAREABLE_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY = ForeignKeys0.SHAREABLE_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY; - public static final ForeignKey STATISTICS__STATISTICS_LAUNCH_ID_FKEY = ForeignKeys0.STATISTICS__STATISTICS_LAUNCH_ID_FKEY; - public static final ForeignKey STATISTICS__STATISTICS_ITEM_ID_FKEY = ForeignKeys0.STATISTICS__STATISTICS_ITEM_ID_FKEY; - public static final ForeignKey STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY = ForeignKeys0.STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY; - public static final ForeignKey TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY = ForeignKeys0.TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY; - public static final ForeignKey TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY = ForeignKeys0.TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY; - public static final ForeignKey TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY = ForeignKeys0.TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY; - public static final ForeignKey TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY = ForeignKeys0.TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY; - public static final ForeignKey USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY = ForeignKeys0.USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY; - public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY = ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY; - public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY = ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY; - public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY = ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY; - public static final ForeignKey WIDGET__WIDGET_ID_FK = ForeignKeys0.WIDGET__WIDGET_ID_FK; - public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY = ForeignKeys0.WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY; - public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY = ForeignKeys0.WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY; + // ------------------------------------------------------------------------- + // UNIQUE and PRIMARY KEY definitions + // ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- - // [#1459] distribute members to avoid static initialisers > 64kb - // ------------------------------------------------------------------------- + public static final UniqueKey ACTIVITY_PK = UniqueKeys0.ACTIVITY_PK; + public static final UniqueKey API_KEYS_PKEY = UniqueKeys0.API_KEYS_PKEY; + public static final UniqueKey USERS_API_KEYS_UNIQUE = UniqueKeys0.USERS_API_KEYS_UNIQUE; + public static final UniqueKey ATTACHMENT_PK = UniqueKeys0.ATTACHMENT_PK; + public static final UniqueKey ATTACHMENT_DELETION_PKEY = UniqueKeys0.ATTACHMENT_DELETION_PKEY; + public static final UniqueKey ATTRIBUTE_PK = UniqueKeys0.ATTRIBUTE_PK; + public static final UniqueKey CLUSTERS_PK = UniqueKeys0.CLUSTERS_PK; + public static final UniqueKey INDEX_ID_LAUNCH_ID_UNQ = UniqueKeys0.INDEX_ID_LAUNCH_ID_UNQ; + public static final UniqueKey CLUSTER_ITEM_UNQ = UniqueKeys0.CLUSTER_ITEM_UNQ; + public static final UniqueKey DASHBOARD_PKEY = UniqueKeys0.DASHBOARD_PKEY; + public static final UniqueKey DASHBOARD_WIDGET_PK = UniqueKeys0.DASHBOARD_WIDGET_PK; + public static final UniqueKey WIDGET_ON_DASHBOARD_UNQ = UniqueKeys0.WIDGET_ON_DASHBOARD_UNQ; + public static final UniqueKey FILTER_PKEY = UniqueKeys0.FILTER_PKEY; + public static final UniqueKey FILTER_CONDITION_PK = UniqueKeys0.FILTER_CONDITION_PK; + public static final UniqueKey FILTER_SORT_PK = UniqueKeys0.FILTER_SORT_PK; + public static final UniqueKey INTEGRATION_PK = UniqueKeys0.INTEGRATION_PK; + public static final UniqueKey INTEGRATION_TYPE_PK = UniqueKeys0.INTEGRATION_TYPE_PK; + public static final UniqueKey INTEGRATION_TYPE_NAME_KEY = UniqueKeys0.INTEGRATION_TYPE_NAME_KEY; + public static final UniqueKey ISSUE_PK = UniqueKeys0.ISSUE_PK; + public static final UniqueKey ISSUE_GROUP_PK = UniqueKeys0.ISSUE_GROUP_PK; + public static final UniqueKey ISSUE_TICKET_PK = UniqueKeys0.ISSUE_TICKET_PK; + public static final UniqueKey ISSUE_TYPE_PK = UniqueKeys0.ISSUE_TYPE_PK; + public static final UniqueKey ISSUE_TYPE_LOCATOR_KEY = UniqueKeys0.ISSUE_TYPE_LOCATOR_KEY; + public static final UniqueKey ISSUE_TYPE_PROJECT_PK = UniqueKeys0.ISSUE_TYPE_PROJECT_PK; + public static final UniqueKey ITEM_ATTRIBUTE_PK = UniqueKeys0.ITEM_ATTRIBUTE_PK; + public static final UniqueKey LAUNCH_PK = UniqueKeys0.LAUNCH_PK; + public static final UniqueKey LAUNCH_UUID_KEY = UniqueKeys0.LAUNCH_UUID_KEY; + public static final UniqueKey UNQ_NAME_NUMBER = UniqueKeys0.UNQ_NAME_NUMBER; + public static final UniqueKey LAUNCH_ATTRIBUTE_RULES_PK = UniqueKeys0.LAUNCH_ATTRIBUTE_RULES_PK; + public static final UniqueKey LAUNCH_NUMBER_PK = UniqueKeys0.LAUNCH_NUMBER_PK; + public static final UniqueKey UNQ_PROJECT_NAME = UniqueKeys0.UNQ_PROJECT_NAME; + public static final UniqueKey LOG_PK = UniqueKeys0.LOG_PK; + public static final UniqueKey OAUTH_ACCESS_TOKEN_PKEY = UniqueKeys0.OAUTH_ACCESS_TOKEN_PKEY; + public static final UniqueKey USERS_ACCESS_TOKEN_UNIQUE = UniqueKeys0.USERS_ACCESS_TOKEN_UNIQUE; + public static final UniqueKey OAUTH_REGISTRATION_PKEY = UniqueKeys0.OAUTH_REGISTRATION_PKEY; + public static final UniqueKey OAUTH_REGISTRATION_CLIENT_ID_KEY = UniqueKeys0.OAUTH_REGISTRATION_CLIENT_ID_KEY; + public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_PK = UniqueKeys0.OAUTH_REGISTRATION_RESTRICTION_PK; + public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_UNIQUE = UniqueKeys0.OAUTH_REGISTRATION_RESTRICTION_UNIQUE; + public static final UniqueKey OAUTH_REGISTRATION_SCOPE_PK = UniqueKeys0.OAUTH_REGISTRATION_SCOPE_PK; + public static final UniqueKey OAUTH_REGISTRATION_SCOPE_UNIQUE = UniqueKeys0.OAUTH_REGISTRATION_SCOPE_UNIQUE; + public static final UniqueKey ONBOARDING_PK = UniqueKeys0.ONBOARDING_PK; + public static final UniqueKey ORGANIZATION_PKEY = UniqueKeys0.ORGANIZATION_PKEY; + public static final UniqueKey ORGANIZATION_ATTRIBUTE_PKEY = UniqueKeys0.ORGANIZATION_ATTRIBUTE_PKEY; + public static final UniqueKey SHAREABLE_PK = UniqueKeys0.SHAREABLE_PK; + public static final UniqueKey PATTERN_TEMPLATE_PK = UniqueKeys0.PATTERN_TEMPLATE_PK; + public static final UniqueKey UNQ_NAME_PROJECTID = UniqueKeys0.UNQ_NAME_PROJECTID; + public static final UniqueKey PATTERN_ITEM_UNQ = UniqueKeys0.PATTERN_ITEM_UNQ; + public static final UniqueKey PROJECT_PK = UniqueKeys0.PROJECT_PK; + public static final UniqueKey PROJECT_NAME_KEY = UniqueKeys0.PROJECT_NAME_KEY; + public static final UniqueKey UNIQUE_ATTRIBUTE_PER_PROJECT = UniqueKeys0.UNIQUE_ATTRIBUTE_PER_PROJECT; + public static final UniqueKey USERS_PROJECT_PK = UniqueKeys0.USERS_PROJECT_PK; + public static final UniqueKey RESTORE_PASSWORD_BID_PK = UniqueKeys0.RESTORE_PASSWORD_BID_PK; + public static final UniqueKey RESTORE_PASSWORD_BID_EMAIL_KEY = UniqueKeys0.RESTORE_PASSWORD_BID_EMAIL_KEY; + public static final UniqueKey SENDER_CASE_PK = UniqueKeys0.SENDER_CASE_PK; + public static final UniqueKey SERVER_SETTINGS_ID = UniqueKeys0.SERVER_SETTINGS_ID; + public static final UniqueKey SERVER_SETTINGS_KEY_KEY = UniqueKeys0.SERVER_SETTINGS_KEY_KEY; + public static final UniqueKey SHEDLOCK_PKEY = UniqueKeys0.SHEDLOCK_PKEY; + public static final UniqueKey STALE_MATERIALIZED_VIEW_PKEY = UniqueKeys0.STALE_MATERIALIZED_VIEW_PKEY; + public static final UniqueKey STALE_MATERIALIZED_VIEW_NAME_KEY = UniqueKeys0.STALE_MATERIALIZED_VIEW_NAME_KEY; + public static final UniqueKey STATISTICS_PK = UniqueKeys0.STATISTICS_PK; + public static final UniqueKey UNIQUE_STATS_LAUNCH = UniqueKeys0.UNIQUE_STATS_LAUNCH; + public static final UniqueKey UNIQUE_STATS_ITEM = UniqueKeys0.UNIQUE_STATS_ITEM; + public static final UniqueKey STATISTICS_FIELD_PK = UniqueKeys0.STATISTICS_FIELD_PK; + public static final UniqueKey STATISTICS_FIELD_NAME_KEY = UniqueKeys0.STATISTICS_FIELD_NAME_KEY; + public static final UniqueKey TEST_ITEM_PK = UniqueKeys0.TEST_ITEM_PK; + public static final UniqueKey TEST_ITEM_UUID_KEY = UniqueKeys0.TEST_ITEM_UUID_KEY; + public static final UniqueKey TEST_ITEM_RESULTS_PK = UniqueKeys0.TEST_ITEM_RESULTS_PK; + public static final UniqueKey TICKET_PK = UniqueKeys0.TICKET_PK; + public static final UniqueKey USER_CREATION_BID_PK = UniqueKeys0.USER_CREATION_BID_PK; + public static final UniqueKey USER_PREFERENCE_PK = UniqueKeys0.USER_PREFERENCE_PK; + public static final UniqueKey USER_PREFERENCE_UQ = UniqueKeys0.USER_PREFERENCE_UQ; + public static final UniqueKey USERS_PK = UniqueKeys0.USERS_PK; + public static final UniqueKey USERS_LOGIN_KEY = UniqueKeys0.USERS_LOGIN_KEY; + public static final UniqueKey USERS_EMAIL_KEY = UniqueKeys0.USERS_EMAIL_KEY; + public static final UniqueKey WIDGET_PKEY = UniqueKeys0.WIDGET_PKEY; + public static final UniqueKey WIDGET_FILTER_PK = UniqueKeys0.WIDGET_FILTER_PK; - private static class Identities0 { + // ------------------------------------------------------------------------- + // FOREIGN KEY definitions + // ------------------------------------------------------------------------- - public static Identity IDENTITY_ACL_CLASS = Internal.createIdentity( - JAclClass.ACL_CLASS, JAclClass.ACL_CLASS.ID); - public static Identity IDENTITY_ACL_ENTRY = Internal.createIdentity( - JAclEntry.ACL_ENTRY, JAclEntry.ACL_ENTRY.ID); - public static Identity IDENTITY_ACL_OBJECT_IDENTITY = Internal.createIdentity( - JAclObjectIdentity.ACL_OBJECT_IDENTITY, JAclObjectIdentity.ACL_OBJECT_IDENTITY.ID); - public static Identity IDENTITY_ACL_SID = Internal.createIdentity( - JAclSid.ACL_SID, JAclSid.ACL_SID.ID); - public static Identity IDENTITY_ACTIVITY = Internal.createIdentity( - JActivity.ACTIVITY, JActivity.ACTIVITY.ID); - public static Identity IDENTITY_ATTACHMENT = Internal.createIdentity( - JAttachment.ATTACHMENT, JAttachment.ATTACHMENT.ID); - public static Identity IDENTITY_ATTRIBUTE = Internal.createIdentity( - JAttribute.ATTRIBUTE, JAttribute.ATTRIBUTE.ID); - public static Identity IDENTITY_CLUSTERS = Internal.createIdentity( - JClusters.CLUSTERS, JClusters.CLUSTERS.ID); - public static Identity IDENTITY_FILTER_CONDITION = Internal.createIdentity( - JFilterCondition.FILTER_CONDITION, JFilterCondition.FILTER_CONDITION.ID); - public static Identity IDENTITY_FILTER_SORT = Internal.createIdentity( - JFilterSort.FILTER_SORT, JFilterSort.FILTER_SORT.ID); - public static Identity IDENTITY_INTEGRATION = Internal.createIdentity( - JIntegration.INTEGRATION, JIntegration.INTEGRATION.ID); - public static Identity IDENTITY_INTEGRATION_TYPE = Internal.createIdentity( - JIntegrationType.INTEGRATION_TYPE, JIntegrationType.INTEGRATION_TYPE.ID); - public static Identity IDENTITY_ISSUE_GROUP = Internal.createIdentity( - JIssueGroup.ISSUE_GROUP, JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID); - public static Identity IDENTITY_ISSUE_TYPE = Internal.createIdentity( - JIssueType.ISSUE_TYPE, JIssueType.ISSUE_TYPE.ID); - public static Identity IDENTITY_ITEM_ATTRIBUTE = Internal.createIdentity( - JItemAttribute.ITEM_ATTRIBUTE, JItemAttribute.ITEM_ATTRIBUTE.ID); - public static Identity IDENTITY_LAUNCH = Internal.createIdentity( - JLaunch.LAUNCH, JLaunch.LAUNCH.ID); - public static Identity IDENTITY_LAUNCH_ATTRIBUTE_RULES = Internal.createIdentity( - JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, - JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID); - public static Identity IDENTITY_LAUNCH_NUMBER = Internal.createIdentity( - JLaunchNumber.LAUNCH_NUMBER, JLaunchNumber.LAUNCH_NUMBER.ID); - public static Identity IDENTITY_LOG = Internal.createIdentity(JLog.LOG, - JLog.LOG.ID); - public static Identity IDENTITY_OAUTH_ACCESS_TOKEN = Internal.createIdentity( - JOauthAccessToken.OAUTH_ACCESS_TOKEN, JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID); - public static Identity IDENTITY_OAUTH_REGISTRATION_RESTRICTION = Internal.createIdentity( - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID); - public static Identity IDENTITY_OAUTH_REGISTRATION_SCOPE = Internal.createIdentity( - JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, - JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID); - public static Identity IDENTITY_ONBOARDING = Internal.createIdentity( - JOnboarding.ONBOARDING, JOnboarding.ONBOARDING.ID); - public static Identity IDENTITY_PATTERN_TEMPLATE = Internal.createIdentity( - JPatternTemplate.PATTERN_TEMPLATE, JPatternTemplate.PATTERN_TEMPLATE.ID); - public static Identity IDENTITY_PROJECT = Internal.createIdentity( - JProject.PROJECT, JProject.PROJECT.ID); - public static Identity IDENTITY_PROJECT_ATTRIBUTE = Internal.createIdentity( - JProjectAttribute.PROJECT_ATTRIBUTE, JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID); - public static Identity IDENTITY_SENDER_CASE = Internal.createIdentity( - JSenderCase.SENDER_CASE, JSenderCase.SENDER_CASE.ID); - public static Identity IDENTITY_SERVER_SETTINGS = Internal.createIdentity( - JServerSettings.SERVER_SETTINGS, JServerSettings.SERVER_SETTINGS.ID); - public static Identity IDENTITY_SHAREABLE_ENTITY = Internal.createIdentity( - JShareableEntity.SHAREABLE_ENTITY, JShareableEntity.SHAREABLE_ENTITY.ID); - public static Identity IDENTITY_STALE_MATERIALIZED_VIEW = Internal.createIdentity( - JStaleMaterializedView.STALE_MATERIALIZED_VIEW, - JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID); - public static Identity IDENTITY_STATISTICS = Internal.createIdentity( - JStatistics.STATISTICS, JStatistics.STATISTICS.S_ID); - public static Identity IDENTITY_STATISTICS_FIELD = Internal.createIdentity( - JStatisticsField.STATISTICS_FIELD, JStatisticsField.STATISTICS_FIELD.SF_ID); - public static Identity IDENTITY_TEST_ITEM = Internal.createIdentity( - JTestItem.TEST_ITEM, JTestItem.TEST_ITEM.ITEM_ID); - public static Identity IDENTITY_TICKET = Internal.createIdentity( - JTicket.TICKET, JTicket.TICKET.ID); - public static Identity IDENTITY_USER_PREFERENCE = Internal.createIdentity( - JUserPreference.USER_PREFERENCE, JUserPreference.USER_PREFERENCE.ID); - public static Identity IDENTITY_USERS = Internal.createIdentity( - JUsers.USERS, JUsers.USERS.ID); - } + public static final ForeignKey ACTIVITY__ACTIVITY_USER_ID_FKEY = ForeignKeys0.ACTIVITY__ACTIVITY_USER_ID_FKEY; + public static final ForeignKey ACTIVITY__ACTIVITY_PROJECT_ID_FKEY = ForeignKeys0.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY; + public static final ForeignKey API_KEYS__API_KEYS_USER_ID_FKEY = ForeignKeys0.API_KEYS__API_KEYS_USER_ID_FKEY; + public static final ForeignKey CONTENT_FIELD__CONTENT_FIELD_ID_FKEY = ForeignKeys0.CONTENT_FIELD__CONTENT_FIELD_ID_FKEY; + public static final ForeignKey DASHBOARD__DASHBOARD_ID_FK = ForeignKeys0.DASHBOARD__DASHBOARD_ID_FK; + public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY = ForeignKeys0.DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY; + public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY = ForeignKeys0.DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY; + public static final ForeignKey FILTER__FILTER_ID_FK = ForeignKeys0.FILTER__FILTER_ID_FK; + public static final ForeignKey FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY = ForeignKeys0.FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY; + public static final ForeignKey FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY = ForeignKeys0.FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY; + public static final ForeignKey INTEGRATION__INTEGRATION_PROJECT_ID_FKEY = ForeignKeys0.INTEGRATION__INTEGRATION_PROJECT_ID_FKEY; + public static final ForeignKey INTEGRATION__INTEGRATION_TYPE_FKEY = ForeignKeys0.INTEGRATION__INTEGRATION_TYPE_FKEY; + public static final ForeignKey ISSUE__ISSUE_ISSUE_ID_FKEY = ForeignKeys0.ISSUE__ISSUE_ISSUE_ID_FKEY; + public static final ForeignKey ISSUE__ISSUE_ISSUE_TYPE_FKEY = ForeignKeys0.ISSUE__ISSUE_ISSUE_TYPE_FKEY; + public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY = ForeignKeys0.ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY; + public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY = ForeignKeys0.ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY; + public static final ForeignKey ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY = ForeignKeys0.ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY; + public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY = ForeignKeys0.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY; + public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY = ForeignKeys0.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY; + public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY = ForeignKeys0.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY; + public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY = ForeignKeys0.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY; + public static final ForeignKey LAUNCH__LAUNCH_PROJECT_ID_FKEY = ForeignKeys0.LAUNCH__LAUNCH_PROJECT_ID_FKEY; + public static final ForeignKey LAUNCH__LAUNCH_USER_ID_FKEY = ForeignKeys0.LAUNCH__LAUNCH_USER_ID_FKEY; + public static final ForeignKey LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY = ForeignKeys0.LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY; + public static final ForeignKey LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY = ForeignKeys0.LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY; + public static final ForeignKey LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY = ForeignKeys0.LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY; + public static final ForeignKey LOG__LOG_ITEM_ID_FKEY = ForeignKeys0.LOG__LOG_ITEM_ID_FKEY; + public static final ForeignKey LOG__LOG_LAUNCH_ID_FKEY = ForeignKeys0.LOG__LOG_LAUNCH_ID_FKEY; + public static final ForeignKey LOG__LOG_ATTACHMENT_ID_FKEY = ForeignKeys0.LOG__LOG_ATTACHMENT_ID_FKEY; + public static final ForeignKey OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY = ForeignKeys0.OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY; + public static final ForeignKey OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY = ForeignKeys0.OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY; + public static final ForeignKey OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY = ForeignKeys0.OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY; + public static final ForeignKey ORGANIZATION_ATTRIBUTE__ORGANIZATION_ATTRIBUTE_ORGANIZATION_ID_FKEY = ForeignKeys0.ORGANIZATION_ATTRIBUTE__ORGANIZATION_ATTRIBUTE_ORGANIZATION_ID_FKEY; + public static final ForeignKey OWNED_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY = ForeignKeys0.OWNED_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY; + public static final ForeignKey PARAMETER__PARAMETER_ITEM_ID_FKEY = ForeignKeys0.PARAMETER__PARAMETER_ITEM_ID_FKEY; + public static final ForeignKey PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY = ForeignKeys0.PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY; + public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY = ForeignKeys0.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY; + public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY = ForeignKeys0.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY; + public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY = ForeignKeys0.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY; + public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY = ForeignKeys0.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY; + public static final ForeignKey PROJECT_USER__PROJECT_USER_USER_ID_FKEY = ForeignKeys0.PROJECT_USER__PROJECT_USER_USER_ID_FKEY; + public static final ForeignKey PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY = ForeignKeys0.PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY; + public static final ForeignKey RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY = ForeignKeys0.RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY; + public static final ForeignKey SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY = ForeignKeys0.SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY; + public static final ForeignKey STATISTICS__STATISTICS_LAUNCH_ID_FKEY = ForeignKeys0.STATISTICS__STATISTICS_LAUNCH_ID_FKEY; + public static final ForeignKey STATISTICS__STATISTICS_ITEM_ID_FKEY = ForeignKeys0.STATISTICS__STATISTICS_ITEM_ID_FKEY; + public static final ForeignKey STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY = ForeignKeys0.STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY; + public static final ForeignKey TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY = ForeignKeys0.TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY; + public static final ForeignKey TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY = ForeignKeys0.TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY; + public static final ForeignKey TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY = ForeignKeys0.TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY; + public static final ForeignKey TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY = ForeignKeys0.TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY; + public static final ForeignKey USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY = ForeignKeys0.USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY; + public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY = ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY; + public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY = ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY; + public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY = ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY; + public static final ForeignKey WIDGET__WIDGET_ID_FK = ForeignKeys0.WIDGET__WIDGET_ID_FK; + public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY = ForeignKeys0.WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY; + public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY = ForeignKeys0.WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY; - private static class UniqueKeys0 { + // ------------------------------------------------------------------------- + // [#1459] distribute members to avoid static initialisers > 64kb + // ------------------------------------------------------------------------- - public static final UniqueKey ACL_CLASS_PKEY = Internal.createUniqueKey( - JAclClass.ACL_CLASS, "acl_class_pkey", JAclClass.ACL_CLASS.ID); - public static final UniqueKey UNIQUE_UK_2 = Internal.createUniqueKey( - JAclClass.ACL_CLASS, "unique_uk_2", JAclClass.ACL_CLASS.CLASS); - public static final UniqueKey ACL_ENTRY_PKEY = Internal.createUniqueKey( - JAclEntry.ACL_ENTRY, "acl_entry_pkey", JAclEntry.ACL_ENTRY.ID); - public static final UniqueKey UNIQUE_UK_4 = Internal.createUniqueKey( - JAclEntry.ACL_ENTRY, "unique_uk_4", JAclEntry.ACL_ENTRY.ACL_OBJECT_IDENTITY, - JAclEntry.ACL_ENTRY.ACE_ORDER); - public static final UniqueKey ACL_OBJECT_IDENTITY_PKEY = Internal.createUniqueKey( - JAclObjectIdentity.ACL_OBJECT_IDENTITY, "acl_object_identity_pkey", - JAclObjectIdentity.ACL_OBJECT_IDENTITY.ID); - public static final UniqueKey UNIQUE_UK_3 = Internal.createUniqueKey( - JAclObjectIdentity.ACL_OBJECT_IDENTITY, "unique_uk_3", - JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS, - JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY); - public static final UniqueKey ACL_SID_PKEY = Internal.createUniqueKey( - JAclSid.ACL_SID, "acl_sid_pkey", JAclSid.ACL_SID.ID); - public static final UniqueKey UNIQUE_UK_1 = Internal.createUniqueKey( - JAclSid.ACL_SID, "unique_uk_1", JAclSid.ACL_SID.SID, JAclSid.ACL_SID.PRINCIPAL); - public static final UniqueKey ACTIVITY_PK = Internal.createUniqueKey( - JActivity.ACTIVITY, "activity_pk", JActivity.ACTIVITY.ID); - public static final UniqueKey ATTACHMENT_PK = Internal.createUniqueKey( - JAttachment.ATTACHMENT, "attachment_pk", JAttachment.ATTACHMENT.ID); - public static final UniqueKey ATTACHMENT_DELETION_PKEY = Internal.createUniqueKey( - JAttachmentDeletion.ATTACHMENT_DELETION, "attachment_deletion_pkey", - JAttachmentDeletion.ATTACHMENT_DELETION.ID); - public static final UniqueKey ATTRIBUTE_PK = Internal.createUniqueKey( - JAttribute.ATTRIBUTE, "attribute_pk", JAttribute.ATTRIBUTE.ID); - public static final UniqueKey CLUSTERS_PK = Internal.createUniqueKey( - JClusters.CLUSTERS, "clusters_pk", JClusters.CLUSTERS.ID); - public static final UniqueKey INDEX_ID_LAUNCH_ID_UNQ = Internal.createUniqueKey( - JClusters.CLUSTERS, "index_id_launch_id_unq", JClusters.CLUSTERS.INDEX_ID, - JClusters.CLUSTERS.LAUNCH_ID); - public static final UniqueKey CLUSTER_ITEM_UNQ = Internal.createUniqueKey( - JClustersTestItem.CLUSTERS_TEST_ITEM, "cluster_item_unq", - JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID, - JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID); - public static final UniqueKey DASHBOARD_PKEY = Internal.createUniqueKey( - JDashboard.DASHBOARD, "dashboard_pkey", JDashboard.DASHBOARD.ID); - public static final UniqueKey DASHBOARD_WIDGET_PK = Internal.createUniqueKey( - JDashboardWidget.DASHBOARD_WIDGET, "dashboard_widget_pk", - JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, - JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID); - public static final UniqueKey WIDGET_ON_DASHBOARD_UNQ = Internal.createUniqueKey( - JDashboardWidget.DASHBOARD_WIDGET, "widget_on_dashboard_unq", - JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, - JDashboardWidget.DASHBOARD_WIDGET.WIDGET_NAME, - JDashboardWidget.DASHBOARD_WIDGET.WIDGET_OWNER); - public static final UniqueKey FILTER_PKEY = Internal.createUniqueKey( - JFilter.FILTER, "filter_pkey", JFilter.FILTER.ID); - public static final UniqueKey FILTER_CONDITION_PK = Internal.createUniqueKey( - JFilterCondition.FILTER_CONDITION, "filter_condition_pk", - JFilterCondition.FILTER_CONDITION.ID); - public static final UniqueKey FILTER_SORT_PK = Internal.createUniqueKey( - JFilterSort.FILTER_SORT, "filter_sort_pk", JFilterSort.FILTER_SORT.ID); - public static final UniqueKey INTEGRATION_PK = Internal.createUniqueKey( - JIntegration.INTEGRATION, "integration_pk", JIntegration.INTEGRATION.ID); - public static final UniqueKey INTEGRATION_TYPE_PK = Internal.createUniqueKey( - JIntegrationType.INTEGRATION_TYPE, "integration_type_pk", - JIntegrationType.INTEGRATION_TYPE.ID); - public static final UniqueKey INTEGRATION_TYPE_NAME_KEY = Internal.createUniqueKey( - JIntegrationType.INTEGRATION_TYPE, "integration_type_name_key", - JIntegrationType.INTEGRATION_TYPE.NAME); - public static final UniqueKey ISSUE_PK = Internal.createUniqueKey(JIssue.ISSUE, - "issue_pk", JIssue.ISSUE.ISSUE_ID); - public static final UniqueKey ISSUE_GROUP_PK = Internal.createUniqueKey( - JIssueGroup.ISSUE_GROUP, "issue_group_pk", JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID); - public static final UniqueKey ISSUE_TICKET_PK = Internal.createUniqueKey( - JIssueTicket.ISSUE_TICKET, "issue_ticket_pk", JIssueTicket.ISSUE_TICKET.ISSUE_ID, - JIssueTicket.ISSUE_TICKET.TICKET_ID); - public static final UniqueKey ISSUE_TYPE_PK = Internal.createUniqueKey( - JIssueType.ISSUE_TYPE, "issue_type_pk", JIssueType.ISSUE_TYPE.ID); - public static final UniqueKey ISSUE_TYPE_LOCATOR_KEY = Internal.createUniqueKey( - JIssueType.ISSUE_TYPE, "issue_type_locator_key", JIssueType.ISSUE_TYPE.LOCATOR); - public static final UniqueKey ISSUE_TYPE_PROJECT_PK = Internal.createUniqueKey( - JIssueTypeProject.ISSUE_TYPE_PROJECT, "issue_type_project_pk", - JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID, - JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID); - public static final UniqueKey ITEM_ATTRIBUTE_PK = Internal.createUniqueKey( - JItemAttribute.ITEM_ATTRIBUTE, "item_attribute_pk", JItemAttribute.ITEM_ATTRIBUTE.ID); - public static final UniqueKey LAUNCH_PK = Internal.createUniqueKey( - JLaunch.LAUNCH, "launch_pk", JLaunch.LAUNCH.ID); - public static final UniqueKey LAUNCH_UUID_KEY = Internal.createUniqueKey( - JLaunch.LAUNCH, "launch_uuid_key", JLaunch.LAUNCH.UUID); - public static final UniqueKey UNQ_NAME_NUMBER = Internal.createUniqueKey( - JLaunch.LAUNCH, "unq_name_number", JLaunch.LAUNCH.NAME, JLaunch.LAUNCH.NUMBER, - JLaunch.LAUNCH.PROJECT_ID); - public static final UniqueKey LAUNCH_ATTRIBUTE_RULES_PK = Internal.createUniqueKey( - JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, "launch_attribute_rules_pk", - JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID); - public static final UniqueKey LAUNCH_NUMBER_PK = Internal.createUniqueKey( - JLaunchNumber.LAUNCH_NUMBER, "launch_number_pk", JLaunchNumber.LAUNCH_NUMBER.ID); - public static final UniqueKey UNQ_PROJECT_NAME = Internal.createUniqueKey( - JLaunchNumber.LAUNCH_NUMBER, "unq_project_name", JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID, - JLaunchNumber.LAUNCH_NUMBER.LAUNCH_NAME); - public static final UniqueKey LOG_PK = Internal.createUniqueKey(JLog.LOG, "log_pk", - JLog.LOG.ID); - public static final UniqueKey OAUTH_ACCESS_TOKEN_PKEY = Internal.createUniqueKey( - JOauthAccessToken.OAUTH_ACCESS_TOKEN, "oauth_access_token_pkey", - JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID); - public static final UniqueKey USERS_ACCESS_TOKEN_UNIQUE = Internal.createUniqueKey( - JOauthAccessToken.OAUTH_ACCESS_TOKEN, "users_access_token_unique", - JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN_ID, - JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID); - public static final UniqueKey OAUTH_REGISTRATION_PKEY = Internal.createUniqueKey( - JOauthRegistration.OAUTH_REGISTRATION, "oauth_registration_pkey", - JOauthRegistration.OAUTH_REGISTRATION.ID); - public static final UniqueKey OAUTH_REGISTRATION_CLIENT_ID_KEY = Internal.createUniqueKey( - JOauthRegistration.OAUTH_REGISTRATION, "oauth_registration_client_id_key", - JOauthRegistration.OAUTH_REGISTRATION.CLIENT_ID); - public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_PK = Internal.createUniqueKey( - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, - "oauth_registration_restriction_pk", - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID); - public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_UNIQUE = Internal.createUniqueKey( - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, - "oauth_registration_restriction_unique", - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.TYPE, - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.VALUE, - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK); - public static final UniqueKey OAUTH_REGISTRATION_SCOPE_PK = Internal.createUniqueKey( - JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, "oauth_registration_scope_pk", - JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID); - public static final UniqueKey OAUTH_REGISTRATION_SCOPE_UNIQUE = Internal.createUniqueKey( - JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, "oauth_registration_scope_unique", - JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.SCOPE, - JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK); - public static final UniqueKey ONBOARDING_PK = Internal.createUniqueKey( - JOnboarding.ONBOARDING, "onboarding_pk", JOnboarding.ONBOARDING.ID); - public static final UniqueKey PATTERN_TEMPLATE_PK = Internal.createUniqueKey( - JPatternTemplate.PATTERN_TEMPLATE, "pattern_template_pk", - JPatternTemplate.PATTERN_TEMPLATE.ID); - public static final UniqueKey UNQ_NAME_PROJECTID = Internal.createUniqueKey( - JPatternTemplate.PATTERN_TEMPLATE, "unq_name_projectid", - JPatternTemplate.PATTERN_TEMPLATE.NAME, JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID); - public static final UniqueKey PATTERN_ITEM_UNQ = Internal.createUniqueKey( - JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, "pattern_item_unq", - JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID, - JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID); - public static final UniqueKey PROJECT_PK = Internal.createUniqueKey( - JProject.PROJECT, "project_pk", JProject.PROJECT.ID); - public static final UniqueKey PROJECT_NAME_KEY = Internal.createUniqueKey( - JProject.PROJECT, "project_name_key", JProject.PROJECT.NAME); - public static final UniqueKey UNIQUE_ATTRIBUTE_PER_PROJECT = Internal.createUniqueKey( - JProjectAttribute.PROJECT_ATTRIBUTE, "unique_attribute_per_project", - JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID, - JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID); - public static final UniqueKey USERS_PROJECT_PK = Internal.createUniqueKey( - JProjectUser.PROJECT_USER, "users_project_pk", JProjectUser.PROJECT_USER.USER_ID, - JProjectUser.PROJECT_USER.PROJECT_ID); - public static final UniqueKey RESTORE_PASSWORD_BID_PK = Internal.createUniqueKey( - JRestorePasswordBid.RESTORE_PASSWORD_BID, "restore_password_bid_pk", - JRestorePasswordBid.RESTORE_PASSWORD_BID.UUID); - public static final UniqueKey RESTORE_PASSWORD_BID_EMAIL_KEY = Internal.createUniqueKey( - JRestorePasswordBid.RESTORE_PASSWORD_BID, "restore_password_bid_email_key", - JRestorePasswordBid.RESTORE_PASSWORD_BID.EMAIL); - public static final UniqueKey SENDER_CASE_PK = Internal.createUniqueKey( - JSenderCase.SENDER_CASE, "sender_case_pk", JSenderCase.SENDER_CASE.ID); - public static final UniqueKey SERVER_SETTINGS_ID = Internal.createUniqueKey( - JServerSettings.SERVER_SETTINGS, "server_settings_id", JServerSettings.SERVER_SETTINGS.ID); - public static final UniqueKey SERVER_SETTINGS_KEY_KEY = Internal.createUniqueKey( - JServerSettings.SERVER_SETTINGS, "server_settings_key_key", - JServerSettings.SERVER_SETTINGS.KEY); - public static final UniqueKey SHAREABLE_PK = Internal.createUniqueKey( - JShareableEntity.SHAREABLE_ENTITY, "shareable_pk", JShareableEntity.SHAREABLE_ENTITY.ID); - public static final UniqueKey STALE_MATERIALIZED_VIEW_PKEY = Internal.createUniqueKey( - JStaleMaterializedView.STALE_MATERIALIZED_VIEW, "stale_materialized_view_pkey", - JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID); - public static final UniqueKey STALE_MATERIALIZED_VIEW_NAME_KEY = Internal.createUniqueKey( - JStaleMaterializedView.STALE_MATERIALIZED_VIEW, "stale_materialized_view_name_key", - JStaleMaterializedView.STALE_MATERIALIZED_VIEW.NAME); - public static final UniqueKey STATISTICS_PK = Internal.createUniqueKey( - JStatistics.STATISTICS, "statistics_pk", JStatistics.STATISTICS.S_ID); - public static final UniqueKey UNIQUE_STATS_LAUNCH = Internal.createUniqueKey( - JStatistics.STATISTICS, "unique_stats_launch", JStatistics.STATISTICS.STATISTICS_FIELD_ID, - JStatistics.STATISTICS.LAUNCH_ID); - public static final UniqueKey UNIQUE_STATS_ITEM = Internal.createUniqueKey( - JStatistics.STATISTICS, "unique_stats_item", JStatistics.STATISTICS.STATISTICS_FIELD_ID, - JStatistics.STATISTICS.ITEM_ID); - public static final UniqueKey STATISTICS_FIELD_PK = Internal.createUniqueKey( - JStatisticsField.STATISTICS_FIELD, "statistics_field_pk", - JStatisticsField.STATISTICS_FIELD.SF_ID); - public static final UniqueKey STATISTICS_FIELD_NAME_KEY = Internal.createUniqueKey( - JStatisticsField.STATISTICS_FIELD, "statistics_field_name_key", - JStatisticsField.STATISTICS_FIELD.NAME); - public static final UniqueKey TEST_ITEM_PK = Internal.createUniqueKey( - JTestItem.TEST_ITEM, "test_item_pk", JTestItem.TEST_ITEM.ITEM_ID); - public static final UniqueKey TEST_ITEM_UUID_KEY = Internal.createUniqueKey( - JTestItem.TEST_ITEM, "test_item_uuid_key", JTestItem.TEST_ITEM.UUID); - public static final UniqueKey TEST_ITEM_RESULTS_PK = Internal.createUniqueKey( - JTestItemResults.TEST_ITEM_RESULTS, "test_item_results_pk", - JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID); - public static final UniqueKey TICKET_PK = Internal.createUniqueKey( - JTicket.TICKET, "ticket_pk", JTicket.TICKET.ID); - public static final UniqueKey USER_CREATION_BID_PK = Internal.createUniqueKey( - JUserCreationBid.USER_CREATION_BID, "user_creation_bid_pk", - JUserCreationBid.USER_CREATION_BID.UUID); - public static final UniqueKey USER_PREFERENCE_PK = Internal.createUniqueKey( - JUserPreference.USER_PREFERENCE, "user_preference_pk", JUserPreference.USER_PREFERENCE.ID); - public static final UniqueKey USER_PREFERENCE_UQ = Internal.createUniqueKey( - JUserPreference.USER_PREFERENCE, "user_preference_uq", - JUserPreference.USER_PREFERENCE.PROJECT_ID, JUserPreference.USER_PREFERENCE.USER_ID, - JUserPreference.USER_PREFERENCE.FILTER_ID); - public static final UniqueKey USERS_PK = Internal.createUniqueKey(JUsers.USERS, - "users_pk", JUsers.USERS.ID); - public static final UniqueKey USERS_LOGIN_KEY = Internal.createUniqueKey( - JUsers.USERS, "users_login_key", JUsers.USERS.LOGIN); - public static final UniqueKey USERS_EMAIL_KEY = Internal.createUniqueKey( - JUsers.USERS, "users_email_key", JUsers.USERS.EMAIL); - public static final UniqueKey WIDGET_PKEY = Internal.createUniqueKey( - JWidget.WIDGET, "widget_pkey", JWidget.WIDGET.ID); - public static final UniqueKey WIDGET_FILTER_PK = Internal.createUniqueKey( - JWidgetFilter.WIDGET_FILTER, "widget_filter_pk", JWidgetFilter.WIDGET_FILTER.WIDGET_ID, - JWidgetFilter.WIDGET_FILTER.FILTER_ID); - } + private static class Identities0 { + public static Identity IDENTITY_ACTIVITY = Internal.createIdentity(JActivity.ACTIVITY, JActivity.ACTIVITY.ID); + public static Identity IDENTITY_API_KEYS = Internal.createIdentity(JApiKeys.API_KEYS, JApiKeys.API_KEYS.ID); + public static Identity IDENTITY_ATTACHMENT = Internal.createIdentity(JAttachment.ATTACHMENT, JAttachment.ATTACHMENT.ID); + public static Identity IDENTITY_ATTRIBUTE = Internal.createIdentity(JAttribute.ATTRIBUTE, JAttribute.ATTRIBUTE.ID); + public static Identity IDENTITY_CLUSTERS = Internal.createIdentity(JClusters.CLUSTERS, JClusters.CLUSTERS.ID); + public static Identity IDENTITY_FILTER_CONDITION = Internal.createIdentity(JFilterCondition.FILTER_CONDITION, JFilterCondition.FILTER_CONDITION.ID); + public static Identity IDENTITY_FILTER_SORT = Internal.createIdentity(JFilterSort.FILTER_SORT, JFilterSort.FILTER_SORT.ID); + public static Identity IDENTITY_INTEGRATION = Internal.createIdentity(JIntegration.INTEGRATION, JIntegration.INTEGRATION.ID); + public static Identity IDENTITY_INTEGRATION_TYPE = Internal.createIdentity(JIntegrationType.INTEGRATION_TYPE, JIntegrationType.INTEGRATION_TYPE.ID); + public static Identity IDENTITY_ISSUE_GROUP = Internal.createIdentity(JIssueGroup.ISSUE_GROUP, JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID); + public static Identity IDENTITY_ISSUE_TYPE = Internal.createIdentity(JIssueType.ISSUE_TYPE, JIssueType.ISSUE_TYPE.ID); + public static Identity IDENTITY_ITEM_ATTRIBUTE = Internal.createIdentity(JItemAttribute.ITEM_ATTRIBUTE, JItemAttribute.ITEM_ATTRIBUTE.ID); + public static Identity IDENTITY_LAUNCH = Internal.createIdentity(JLaunch.LAUNCH, JLaunch.LAUNCH.ID); + public static Identity IDENTITY_LAUNCH_ATTRIBUTE_RULES = Internal.createIdentity(JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID); + public static Identity IDENTITY_LAUNCH_NUMBER = Internal.createIdentity(JLaunchNumber.LAUNCH_NUMBER, JLaunchNumber.LAUNCH_NUMBER.ID); + public static Identity IDENTITY_LOG = Internal.createIdentity(JLog.LOG, JLog.LOG.ID); + public static Identity IDENTITY_OAUTH_ACCESS_TOKEN = Internal.createIdentity(JOauthAccessToken.OAUTH_ACCESS_TOKEN, JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID); + public static Identity IDENTITY_OAUTH_REGISTRATION_RESTRICTION = Internal.createIdentity(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID); + public static Identity IDENTITY_OAUTH_REGISTRATION_SCOPE = Internal.createIdentity(JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID); + public static Identity IDENTITY_ONBOARDING = Internal.createIdentity(JOnboarding.ONBOARDING, JOnboarding.ONBOARDING.ID); + public static Identity IDENTITY_ORGANIZATION = Internal.createIdentity(JOrganization.ORGANIZATION, JOrganization.ORGANIZATION.ID); + public static Identity IDENTITY_ORGANIZATION_ATTRIBUTE = Internal.createIdentity(JOrganizationAttribute.ORGANIZATION_ATTRIBUTE, JOrganizationAttribute.ORGANIZATION_ATTRIBUTE.ID); + public static Identity IDENTITY_OWNED_ENTITY = Internal.createIdentity(JOwnedEntity.OWNED_ENTITY, JOwnedEntity.OWNED_ENTITY.ID); + public static Identity IDENTITY_PATTERN_TEMPLATE = Internal.createIdentity(JPatternTemplate.PATTERN_TEMPLATE, JPatternTemplate.PATTERN_TEMPLATE.ID); + public static Identity IDENTITY_PROJECT = Internal.createIdentity(JProject.PROJECT, JProject.PROJECT.ID); + public static Identity IDENTITY_PROJECT_ATTRIBUTE = Internal.createIdentity(JProjectAttribute.PROJECT_ATTRIBUTE, JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID); + public static Identity IDENTITY_SENDER_CASE = Internal.createIdentity(JSenderCase.SENDER_CASE, JSenderCase.SENDER_CASE.ID); + public static Identity IDENTITY_SERVER_SETTINGS = Internal.createIdentity(JServerSettings.SERVER_SETTINGS, JServerSettings.SERVER_SETTINGS.ID); + public static Identity IDENTITY_STALE_MATERIALIZED_VIEW = Internal.createIdentity(JStaleMaterializedView.STALE_MATERIALIZED_VIEW, JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID); + public static Identity IDENTITY_STATISTICS = Internal.createIdentity(JStatistics.STATISTICS, JStatistics.STATISTICS.S_ID); + public static Identity IDENTITY_STATISTICS_FIELD = Internal.createIdentity(JStatisticsField.STATISTICS_FIELD, JStatisticsField.STATISTICS_FIELD.SF_ID); + public static Identity IDENTITY_TEST_ITEM = Internal.createIdentity(JTestItem.TEST_ITEM, JTestItem.TEST_ITEM.ITEM_ID); + public static Identity IDENTITY_TICKET = Internal.createIdentity(JTicket.TICKET, JTicket.TICKET.ID); + public static Identity IDENTITY_USER_PREFERENCE = Internal.createIdentity(JUserPreference.USER_PREFERENCE, JUserPreference.USER_PREFERENCE.ID); + public static Identity IDENTITY_USERS = Internal.createIdentity(JUsers.USERS, JUsers.USERS.ID); + } - private static class ForeignKeys0 { + private static class UniqueKeys0 { + public static final UniqueKey ACTIVITY_PK = Internal.createUniqueKey(JActivity.ACTIVITY, "activity_pk", JActivity.ACTIVITY.ID); + public static final UniqueKey API_KEYS_PKEY = Internal.createUniqueKey(JApiKeys.API_KEYS, "api_keys_pkey", JApiKeys.API_KEYS.ID); + public static final UniqueKey USERS_API_KEYS_UNIQUE = Internal.createUniqueKey(JApiKeys.API_KEYS, "users_api_keys_unique", JApiKeys.API_KEYS.NAME, JApiKeys.API_KEYS.USER_ID); + public static final UniqueKey ATTACHMENT_PK = Internal.createUniqueKey(JAttachment.ATTACHMENT, "attachment_pk", JAttachment.ATTACHMENT.ID); + public static final UniqueKey ATTACHMENT_DELETION_PKEY = Internal.createUniqueKey(JAttachmentDeletion.ATTACHMENT_DELETION, "attachment_deletion_pkey", JAttachmentDeletion.ATTACHMENT_DELETION.ID); + public static final UniqueKey ATTRIBUTE_PK = Internal.createUniqueKey(JAttribute.ATTRIBUTE, "attribute_pk", JAttribute.ATTRIBUTE.ID); + public static final UniqueKey CLUSTERS_PK = Internal.createUniqueKey(JClusters.CLUSTERS, "clusters_pk", JClusters.CLUSTERS.ID); + public static final UniqueKey INDEX_ID_LAUNCH_ID_UNQ = Internal.createUniqueKey(JClusters.CLUSTERS, "index_id_launch_id_unq", JClusters.CLUSTERS.INDEX_ID, JClusters.CLUSTERS.LAUNCH_ID); + public static final UniqueKey CLUSTER_ITEM_UNQ = Internal.createUniqueKey(JClustersTestItem.CLUSTERS_TEST_ITEM, "cluster_item_unq", JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID, JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID); + public static final UniqueKey DASHBOARD_PKEY = Internal.createUniqueKey(JDashboard.DASHBOARD, "dashboard_pkey", JDashboard.DASHBOARD.ID); + public static final UniqueKey DASHBOARD_WIDGET_PK = Internal.createUniqueKey(JDashboardWidget.DASHBOARD_WIDGET, "dashboard_widget_pk", JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID); + public static final UniqueKey WIDGET_ON_DASHBOARD_UNQ = Internal.createUniqueKey(JDashboardWidget.DASHBOARD_WIDGET, "widget_on_dashboard_unq", JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID, JDashboardWidget.DASHBOARD_WIDGET.WIDGET_NAME, JDashboardWidget.DASHBOARD_WIDGET.WIDGET_OWNER); + public static final UniqueKey FILTER_PKEY = Internal.createUniqueKey(JFilter.FILTER, "filter_pkey", JFilter.FILTER.ID); + public static final UniqueKey FILTER_CONDITION_PK = Internal.createUniqueKey(JFilterCondition.FILTER_CONDITION, "filter_condition_pk", JFilterCondition.FILTER_CONDITION.ID); + public static final UniqueKey FILTER_SORT_PK = Internal.createUniqueKey(JFilterSort.FILTER_SORT, "filter_sort_pk", JFilterSort.FILTER_SORT.ID); + public static final UniqueKey INTEGRATION_PK = Internal.createUniqueKey(JIntegration.INTEGRATION, "integration_pk", JIntegration.INTEGRATION.ID); + public static final UniqueKey INTEGRATION_TYPE_PK = Internal.createUniqueKey(JIntegrationType.INTEGRATION_TYPE, "integration_type_pk", JIntegrationType.INTEGRATION_TYPE.ID); + public static final UniqueKey INTEGRATION_TYPE_NAME_KEY = Internal.createUniqueKey(JIntegrationType.INTEGRATION_TYPE, "integration_type_name_key", JIntegrationType.INTEGRATION_TYPE.NAME); + public static final UniqueKey ISSUE_PK = Internal.createUniqueKey(JIssue.ISSUE, "issue_pk", JIssue.ISSUE.ISSUE_ID); + public static final UniqueKey ISSUE_GROUP_PK = Internal.createUniqueKey(JIssueGroup.ISSUE_GROUP, "issue_group_pk", JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID); + public static final UniqueKey ISSUE_TICKET_PK = Internal.createUniqueKey(JIssueTicket.ISSUE_TICKET, "issue_ticket_pk", JIssueTicket.ISSUE_TICKET.ISSUE_ID, JIssueTicket.ISSUE_TICKET.TICKET_ID); + public static final UniqueKey ISSUE_TYPE_PK = Internal.createUniqueKey(JIssueType.ISSUE_TYPE, "issue_type_pk", JIssueType.ISSUE_TYPE.ID); + public static final UniqueKey ISSUE_TYPE_LOCATOR_KEY = Internal.createUniqueKey(JIssueType.ISSUE_TYPE, "issue_type_locator_key", JIssueType.ISSUE_TYPE.LOCATOR); + public static final UniqueKey ISSUE_TYPE_PROJECT_PK = Internal.createUniqueKey(JIssueTypeProject.ISSUE_TYPE_PROJECT, "issue_type_project_pk", JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID, JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID); + public static final UniqueKey ITEM_ATTRIBUTE_PK = Internal.createUniqueKey(JItemAttribute.ITEM_ATTRIBUTE, "item_attribute_pk", JItemAttribute.ITEM_ATTRIBUTE.ID); + public static final UniqueKey LAUNCH_PK = Internal.createUniqueKey(JLaunch.LAUNCH, "launch_pk", JLaunch.LAUNCH.ID); + public static final UniqueKey LAUNCH_UUID_KEY = Internal.createUniqueKey(JLaunch.LAUNCH, "launch_uuid_key", JLaunch.LAUNCH.UUID); + public static final UniqueKey UNQ_NAME_NUMBER = Internal.createUniqueKey(JLaunch.LAUNCH, "unq_name_number", JLaunch.LAUNCH.NAME, JLaunch.LAUNCH.NUMBER, JLaunch.LAUNCH.PROJECT_ID); + public static final UniqueKey LAUNCH_ATTRIBUTE_RULES_PK = Internal.createUniqueKey(JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, "launch_attribute_rules_pk", JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID); + public static final UniqueKey LAUNCH_NUMBER_PK = Internal.createUniqueKey(JLaunchNumber.LAUNCH_NUMBER, "launch_number_pk", JLaunchNumber.LAUNCH_NUMBER.ID); + public static final UniqueKey UNQ_PROJECT_NAME = Internal.createUniqueKey(JLaunchNumber.LAUNCH_NUMBER, "unq_project_name", JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID, JLaunchNumber.LAUNCH_NUMBER.LAUNCH_NAME); + public static final UniqueKey LOG_PK = Internal.createUniqueKey(JLog.LOG, "log_pk", JLog.LOG.ID); + public static final UniqueKey OAUTH_ACCESS_TOKEN_PKEY = Internal.createUniqueKey(JOauthAccessToken.OAUTH_ACCESS_TOKEN, "oauth_access_token_pkey", JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID); + public static final UniqueKey USERS_ACCESS_TOKEN_UNIQUE = Internal.createUniqueKey(JOauthAccessToken.OAUTH_ACCESS_TOKEN, "users_access_token_unique", JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN_ID, JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID); + public static final UniqueKey OAUTH_REGISTRATION_PKEY = Internal.createUniqueKey(JOauthRegistration.OAUTH_REGISTRATION, "oauth_registration_pkey", JOauthRegistration.OAUTH_REGISTRATION.ID); + public static final UniqueKey OAUTH_REGISTRATION_CLIENT_ID_KEY = Internal.createUniqueKey(JOauthRegistration.OAUTH_REGISTRATION, "oauth_registration_client_id_key", JOauthRegistration.OAUTH_REGISTRATION.CLIENT_ID); + public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_PK = Internal.createUniqueKey(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, "oauth_registration_restriction_pk", JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID); + public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_UNIQUE = Internal.createUniqueKey(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, "oauth_registration_restriction_unique", JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.TYPE, JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.VALUE, JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK); + public static final UniqueKey OAUTH_REGISTRATION_SCOPE_PK = Internal.createUniqueKey(JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, "oauth_registration_scope_pk", JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID); + public static final UniqueKey OAUTH_REGISTRATION_SCOPE_UNIQUE = Internal.createUniqueKey(JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, "oauth_registration_scope_unique", JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.SCOPE, JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK); + public static final UniqueKey ONBOARDING_PK = Internal.createUniqueKey(JOnboarding.ONBOARDING, "onboarding_pk", JOnboarding.ONBOARDING.ID); + public static final UniqueKey ORGANIZATION_PKEY = Internal.createUniqueKey(JOrganization.ORGANIZATION, "organization_pkey", JOrganization.ORGANIZATION.ID); + public static final UniqueKey ORGANIZATION_ATTRIBUTE_PKEY = Internal.createUniqueKey(JOrganizationAttribute.ORGANIZATION_ATTRIBUTE, "organization_attribute_pkey", JOrganizationAttribute.ORGANIZATION_ATTRIBUTE.ID); + public static final UniqueKey SHAREABLE_PK = Internal.createUniqueKey(JOwnedEntity.OWNED_ENTITY, "shareable_pk", JOwnedEntity.OWNED_ENTITY.ID); + public static final UniqueKey PATTERN_TEMPLATE_PK = Internal.createUniqueKey(JPatternTemplate.PATTERN_TEMPLATE, "pattern_template_pk", JPatternTemplate.PATTERN_TEMPLATE.ID); + public static final UniqueKey UNQ_NAME_PROJECTID = Internal.createUniqueKey(JPatternTemplate.PATTERN_TEMPLATE, "unq_name_projectid", JPatternTemplate.PATTERN_TEMPLATE.NAME, JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID); + public static final UniqueKey PATTERN_ITEM_UNQ = Internal.createUniqueKey(JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, "pattern_item_unq", JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID, JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID); + public static final UniqueKey PROJECT_PK = Internal.createUniqueKey(JProject.PROJECT, "project_pk", JProject.PROJECT.ID); + public static final UniqueKey PROJECT_NAME_KEY = Internal.createUniqueKey(JProject.PROJECT, "project_name_key", JProject.PROJECT.NAME); + public static final UniqueKey UNIQUE_ATTRIBUTE_PER_PROJECT = Internal.createUniqueKey(JProjectAttribute.PROJECT_ATTRIBUTE, "unique_attribute_per_project", JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID, JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID); + public static final UniqueKey USERS_PROJECT_PK = Internal.createUniqueKey(JProjectUser.PROJECT_USER, "users_project_pk", JProjectUser.PROJECT_USER.USER_ID, JProjectUser.PROJECT_USER.PROJECT_ID); + public static final UniqueKey RESTORE_PASSWORD_BID_PK = Internal.createUniqueKey(JRestorePasswordBid.RESTORE_PASSWORD_BID, "restore_password_bid_pk", JRestorePasswordBid.RESTORE_PASSWORD_BID.UUID); + public static final UniqueKey RESTORE_PASSWORD_BID_EMAIL_KEY = Internal.createUniqueKey(JRestorePasswordBid.RESTORE_PASSWORD_BID, "restore_password_bid_email_key", JRestorePasswordBid.RESTORE_PASSWORD_BID.EMAIL); + public static final UniqueKey SENDER_CASE_PK = Internal.createUniqueKey(JSenderCase.SENDER_CASE, "sender_case_pk", JSenderCase.SENDER_CASE.ID); + public static final UniqueKey SERVER_SETTINGS_ID = Internal.createUniqueKey(JServerSettings.SERVER_SETTINGS, "server_settings_id", JServerSettings.SERVER_SETTINGS.ID); + public static final UniqueKey SERVER_SETTINGS_KEY_KEY = Internal.createUniqueKey(JServerSettings.SERVER_SETTINGS, "server_settings_key_key", JServerSettings.SERVER_SETTINGS.KEY); + public static final UniqueKey SHEDLOCK_PKEY = Internal.createUniqueKey(JShedlock.SHEDLOCK, "shedlock_pkey", JShedlock.SHEDLOCK.NAME); + public static final UniqueKey STALE_MATERIALIZED_VIEW_PKEY = Internal.createUniqueKey(JStaleMaterializedView.STALE_MATERIALIZED_VIEW, "stale_materialized_view_pkey", JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID); + public static final UniqueKey STALE_MATERIALIZED_VIEW_NAME_KEY = Internal.createUniqueKey(JStaleMaterializedView.STALE_MATERIALIZED_VIEW, "stale_materialized_view_name_key", JStaleMaterializedView.STALE_MATERIALIZED_VIEW.NAME); + public static final UniqueKey STATISTICS_PK = Internal.createUniqueKey(JStatistics.STATISTICS, "statistics_pk", JStatistics.STATISTICS.S_ID); + public static final UniqueKey UNIQUE_STATS_LAUNCH = Internal.createUniqueKey(JStatistics.STATISTICS, "unique_stats_launch", JStatistics.STATISTICS.STATISTICS_FIELD_ID, JStatistics.STATISTICS.LAUNCH_ID); + public static final UniqueKey UNIQUE_STATS_ITEM = Internal.createUniqueKey(JStatistics.STATISTICS, "unique_stats_item", JStatistics.STATISTICS.STATISTICS_FIELD_ID, JStatistics.STATISTICS.ITEM_ID); + public static final UniqueKey STATISTICS_FIELD_PK = Internal.createUniqueKey(JStatisticsField.STATISTICS_FIELD, "statistics_field_pk", JStatisticsField.STATISTICS_FIELD.SF_ID); + public static final UniqueKey STATISTICS_FIELD_NAME_KEY = Internal.createUniqueKey(JStatisticsField.STATISTICS_FIELD, "statistics_field_name_key", JStatisticsField.STATISTICS_FIELD.NAME); + public static final UniqueKey TEST_ITEM_PK = Internal.createUniqueKey(JTestItem.TEST_ITEM, "test_item_pk", JTestItem.TEST_ITEM.ITEM_ID); + public static final UniqueKey TEST_ITEM_UUID_KEY = Internal.createUniqueKey(JTestItem.TEST_ITEM, "test_item_uuid_key", JTestItem.TEST_ITEM.UUID); + public static final UniqueKey TEST_ITEM_RESULTS_PK = Internal.createUniqueKey(JTestItemResults.TEST_ITEM_RESULTS, "test_item_results_pk", JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID); + public static final UniqueKey TICKET_PK = Internal.createUniqueKey(JTicket.TICKET, "ticket_pk", JTicket.TICKET.ID); + public static final UniqueKey USER_CREATION_BID_PK = Internal.createUniqueKey(JUserCreationBid.USER_CREATION_BID, "user_creation_bid_pk", JUserCreationBid.USER_CREATION_BID.UUID); + public static final UniqueKey USER_PREFERENCE_PK = Internal.createUniqueKey(JUserPreference.USER_PREFERENCE, "user_preference_pk", JUserPreference.USER_PREFERENCE.ID); + public static final UniqueKey USER_PREFERENCE_UQ = Internal.createUniqueKey(JUserPreference.USER_PREFERENCE, "user_preference_uq", JUserPreference.USER_PREFERENCE.PROJECT_ID, JUserPreference.USER_PREFERENCE.USER_ID, JUserPreference.USER_PREFERENCE.FILTER_ID); + public static final UniqueKey USERS_PK = Internal.createUniqueKey(JUsers.USERS, "users_pk", JUsers.USERS.ID); + public static final UniqueKey USERS_LOGIN_KEY = Internal.createUniqueKey(JUsers.USERS, "users_login_key", JUsers.USERS.LOGIN); + public static final UniqueKey USERS_EMAIL_KEY = Internal.createUniqueKey(JUsers.USERS, "users_email_key", JUsers.USERS.EMAIL); + public static final UniqueKey WIDGET_PKEY = Internal.createUniqueKey(JWidget.WIDGET, "widget_pkey", JWidget.WIDGET.ID); + public static final UniqueKey WIDGET_FILTER_PK = Internal.createUniqueKey(JWidgetFilter.WIDGET_FILTER, "widget_filter_pk", JWidgetFilter.WIDGET_FILTER.WIDGET_ID, JWidgetFilter.WIDGET_FILTER.FILTER_ID); + } - public static final ForeignKey ACL_ENTRY__FOREIGN_FK_4 = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.ACL_OBJECT_IDENTITY_PKEY, JAclEntry.ACL_ENTRY, - "acl_entry__foreign_fk_4", JAclEntry.ACL_ENTRY.ACL_OBJECT_IDENTITY); - public static final ForeignKey ACL_ENTRY__FOREIGN_FK_5 = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.ACL_SID_PKEY, JAclEntry.ACL_ENTRY, - "acl_entry__foreign_fk_5", JAclEntry.ACL_ENTRY.SID); - public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_2 = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.ACL_CLASS_PKEY, JAclObjectIdentity.ACL_OBJECT_IDENTITY, - "acl_object_identity__foreign_fk_2", - JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS); - public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_1 = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.ACL_OBJECT_IDENTITY_PKEY, - JAclObjectIdentity.ACL_OBJECT_IDENTITY, "acl_object_identity__foreign_fk_1", - JAclObjectIdentity.ACL_OBJECT_IDENTITY.PARENT_OBJECT); - public static final ForeignKey ACL_OBJECT_IDENTITY__FOREIGN_FK_3 = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.ACL_SID_PKEY, JAclObjectIdentity.ACL_OBJECT_IDENTITY, - "acl_object_identity__foreign_fk_3", JAclObjectIdentity.ACL_OBJECT_IDENTITY.OWNER_SID); - public static final ForeignKey ACL_SID__ACL_SID_SID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.USERS_LOGIN_KEY, JAclSid.ACL_SID, - "acl_sid__acl_sid_sid_fkey", JAclSid.ACL_SID.SID); - public static final ForeignKey ACTIVITY__ACTIVITY_USER_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.USERS_PK, JActivity.ACTIVITY, - "activity__activity_user_id_fkey", JActivity.ACTIVITY.USER_ID); - public static final ForeignKey ACTIVITY__ACTIVITY_PROJECT_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JActivity.ACTIVITY, - "activity__activity_project_id_fkey", JActivity.ACTIVITY.PROJECT_ID); - public static final ForeignKey CONTENT_FIELD__CONTENT_FIELD_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.WIDGET_PKEY, JContentField.CONTENT_FIELD, - "content_field__content_field_id_fkey", JContentField.CONTENT_FIELD.ID); - public static final ForeignKey DASHBOARD__DASHBOARD_ID_FK = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.SHAREABLE_PK, JDashboard.DASHBOARD, - "dashboard__dashboard_id_fk", JDashboard.DASHBOARD.ID); - public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.DASHBOARD_PKEY, JDashboardWidget.DASHBOARD_WIDGET, - "dashboard_widget__dashboard_widget_dashboard_id_fkey", - JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID); - public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.WIDGET_PKEY, JDashboardWidget.DASHBOARD_WIDGET, - "dashboard_widget__dashboard_widget_widget_id_fkey", - JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID); - public static final ForeignKey FILTER__FILTER_ID_FK = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.SHAREABLE_PK, JFilter.FILTER, "filter__filter_id_fk", - JFilter.FILTER.ID); - public static final ForeignKey FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JFilterCondition.FILTER_CONDITION, - "filter_condition__filter_condition_filter_id_fkey", - JFilterCondition.FILTER_CONDITION.FILTER_ID); - public static final ForeignKey FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JFilterSort.FILTER_SORT, - "filter_sort__filter_sort_filter_id_fkey", JFilterSort.FILTER_SORT.FILTER_ID); - public static final ForeignKey INTEGRATION__INTEGRATION_PROJECT_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JIntegration.INTEGRATION, - "integration__integration_project_id_fkey", JIntegration.INTEGRATION.PROJECT_ID); - public static final ForeignKey INTEGRATION__INTEGRATION_TYPE_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.INTEGRATION_TYPE_PK, JIntegration.INTEGRATION, - "integration__integration_type_fkey", JIntegration.INTEGRATION.TYPE); - public static final ForeignKey ISSUE__ISSUE_ISSUE_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_RESULTS_PK, JIssue.ISSUE, - "issue__issue_issue_id_fkey", JIssue.ISSUE.ISSUE_ID); - public static final ForeignKey ISSUE__ISSUE_ISSUE_TYPE_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.ISSUE_TYPE_PK, JIssue.ISSUE, - "issue__issue_issue_type_fkey", JIssue.ISSUE.ISSUE_TYPE); - public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.ISSUE_PK, JIssueTicket.ISSUE_TICKET, - "issue_ticket__issue_ticket_issue_id_fkey", JIssueTicket.ISSUE_TICKET.ISSUE_ID); - public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.TICKET_PK, JIssueTicket.ISSUE_TICKET, - "issue_ticket__issue_ticket_ticket_id_fkey", JIssueTicket.ISSUE_TICKET.TICKET_ID); - public static final ForeignKey ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.ISSUE_GROUP_PK, JIssueType.ISSUE_TYPE, - "issue_type__issue_type_issue_group_id_fkey", JIssueType.ISSUE_TYPE.ISSUE_GROUP_ID); - public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JIssueTypeProject.ISSUE_TYPE_PROJECT, - "issue_type_project__issue_type_project_project_id_fkey", - JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID); - public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.ISSUE_TYPE_PK, JIssueTypeProject.ISSUE_TYPE_PROJECT, - "issue_type_project__issue_type_project_issue_type_id_fkey", - JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID); - public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JItemAttribute.ITEM_ATTRIBUTE, - "item_attribute__item_attribute_item_id_fkey", JItemAttribute.ITEM_ATTRIBUTE.ITEM_ID); - public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JItemAttribute.ITEM_ATTRIBUTE, - "item_attribute__item_attribute_launch_id_fkey", JItemAttribute.ITEM_ATTRIBUTE.LAUNCH_ID); - public static final ForeignKey LAUNCH__LAUNCH_PROJECT_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JLaunch.LAUNCH, - "launch__launch_project_id_fkey", JLaunch.LAUNCH.PROJECT_ID); - public static final ForeignKey LAUNCH__LAUNCH_USER_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.USERS_PK, JLaunch.LAUNCH, "launch__launch_user_id_fkey", - JLaunch.LAUNCH.USER_ID); - public static final ForeignKey LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.SENDER_CASE_PK, - JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, - "launch_attribute_rules__launch_attribute_rules_sender_case_id_fkey", - JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.SENDER_CASE_ID); - public static final ForeignKey LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.SENDER_CASE_PK, JLaunchNames.LAUNCH_NAMES, - "launch_names__launch_names_sender_case_id_fkey", JLaunchNames.LAUNCH_NAMES.SENDER_CASE_ID); - public static final ForeignKey LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JLaunchNumber.LAUNCH_NUMBER, - "launch_number__launch_number_project_id_fkey", JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID); - public static final ForeignKey LOG__LOG_ITEM_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JLog.LOG, "log__log_item_id_fkey", - JLog.LOG.ITEM_ID); - public static final ForeignKey LOG__LOG_LAUNCH_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JLog.LOG, "log__log_launch_id_fkey", - JLog.LOG.LAUNCH_ID); - public static final ForeignKey LOG__LOG_ATTACHMENT_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.ATTACHMENT_PK, JLog.LOG, "log__log_attachment_id_fkey", - JLog.LOG.ATTACHMENT_ID); - public static final ForeignKey OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.USERS_PK, JOauthAccessToken.OAUTH_ACCESS_TOKEN, - "oauth_access_token__oauth_access_token_user_id_fkey", - JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID); - public static final ForeignKey OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.OAUTH_REGISTRATION_PKEY, - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, - "oauth_registration_restriction__oauth_registration_restriction_oauth_registration_fk_fkey", - JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK); - public static final ForeignKey OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.OAUTH_REGISTRATION_PKEY, - JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, - "oauth_registration_scope__oauth_registration_scope_oauth_registration_fk_fkey", - JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK); - public static final ForeignKey PARAMETER__PARAMETER_ITEM_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JParameter.PARAMETER, - "parameter__parameter_item_id_fkey", JParameter.PARAMETER.ITEM_ID); - public static final ForeignKey PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JPatternTemplate.PATTERN_TEMPLATE, - "pattern_template__pattern_template_project_id_fkey", - JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID); - public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.PATTERN_TEMPLATE_PK, - JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, - "pattern_template_test_item__pattern_template_test_item_pattern_id_fkey", - JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID); - public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, - JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, - "pattern_template_test_item__pattern_template_test_item_item_id_fkey", - JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID); - public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.ATTRIBUTE_PK, JProjectAttribute.PROJECT_ATTRIBUTE, - "project_attribute__project_attribute_attribute_id_fkey", - JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID); - public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JProjectAttribute.PROJECT_ATTRIBUTE, - "project_attribute__project_attribute_project_id_fkey", - JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID); - public static final ForeignKey PROJECT_USER__PROJECT_USER_USER_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.USERS_PK, JProjectUser.PROJECT_USER, - "project_user__project_user_user_id_fkey", JProjectUser.PROJECT_USER.USER_ID); - public static final ForeignKey PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JProjectUser.PROJECT_USER, - "project_user__project_user_project_id_fkey", JProjectUser.PROJECT_USER.PROJECT_ID); - public static final ForeignKey RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.SENDER_CASE_PK, JRecipients.RECIPIENTS, - "recipients__recipients_sender_case_id_fkey", JRecipients.RECIPIENTS.SENDER_CASE_ID); - public static final ForeignKey SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JSenderCase.SENDER_CASE, - "sender_case__sender_case_project_id_fkey", JSenderCase.SENDER_CASE.PROJECT_ID); - public static final ForeignKey SHAREABLE_ENTITY__SHAREABLE_ENTITY_OWNER_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.USERS_LOGIN_KEY, JShareableEntity.SHAREABLE_ENTITY, - "shareable_entity__shareable_entity_owner_fkey", JShareableEntity.SHAREABLE_ENTITY.OWNER); - public static final ForeignKey SHAREABLE_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JShareableEntity.SHAREABLE_ENTITY, - "shareable_entity__shareable_entity_project_id_fkey", - JShareableEntity.SHAREABLE_ENTITY.PROJECT_ID); - public static final ForeignKey STATISTICS__STATISTICS_LAUNCH_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JStatistics.STATISTICS, - "statistics__statistics_launch_id_fkey", JStatistics.STATISTICS.LAUNCH_ID); - public static final ForeignKey STATISTICS__STATISTICS_ITEM_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JStatistics.STATISTICS, - "statistics__statistics_item_id_fkey", JStatistics.STATISTICS.ITEM_ID); - public static final ForeignKey STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.STATISTICS_FIELD_PK, JStatistics.STATISTICS, - "statistics__statistics_statistics_field_id_fkey", - JStatistics.STATISTICS.STATISTICS_FIELD_ID); - public static final ForeignKey TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JTestItem.TEST_ITEM, - "test_item__test_item_parent_id_fkey", JTestItem.TEST_ITEM.PARENT_ID); - public static final ForeignKey TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JTestItem.TEST_ITEM, - "test_item__test_item_retry_of_fkey", JTestItem.TEST_ITEM.RETRY_OF); - public static final ForeignKey TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JTestItem.TEST_ITEM, - "test_item__test_item_launch_id_fkey", JTestItem.TEST_ITEM.LAUNCH_ID); - public static final ForeignKey TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JTestItemResults.TEST_ITEM_RESULTS, - "test_item_results__test_item_results_result_id_fkey", - JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID); - public static final ForeignKey USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JUserCreationBid.USER_CREATION_BID, - "user_creation_bid__user_creation_bid_default_project_id_fkey", - JUserCreationBid.USER_CREATION_BID.DEFAULT_PROJECT_ID); - public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JUserPreference.USER_PREFERENCE, - "user_preference__user_preference_project_id_fkey", - JUserPreference.USER_PREFERENCE.PROJECT_ID); - public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.USERS_PK, JUserPreference.USER_PREFERENCE, - "user_preference__user_preference_user_id_fkey", JUserPreference.USER_PREFERENCE.USER_ID); - public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JUserPreference.USER_PREFERENCE, - "user_preference__user_preference_filter_id_fkey", - JUserPreference.USER_PREFERENCE.FILTER_ID); - public static final ForeignKey WIDGET__WIDGET_ID_FK = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.SHAREABLE_PK, JWidget.WIDGET, "widget__widget_id_fk", - JWidget.WIDGET.ID); - public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.WIDGET_PKEY, JWidgetFilter.WIDGET_FILTER, - "widget_filter__widget_filter_widget_id_fkey", JWidgetFilter.WIDGET_FILTER.WIDGET_ID); - public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY = Internal.createForeignKey( - com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JWidgetFilter.WIDGET_FILTER, - "widget_filter__widget_filter_filter_id_fkey", JWidgetFilter.WIDGET_FILTER.FILTER_ID); - } + private static class ForeignKeys0 { + public static final ForeignKey ACTIVITY__ACTIVITY_USER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_PK, JActivity.ACTIVITY, "activity__activity_user_id_fkey", JActivity.ACTIVITY.USER_ID); + public static final ForeignKey ACTIVITY__ACTIVITY_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JActivity.ACTIVITY, "activity__activity_project_id_fkey", JActivity.ACTIVITY.PROJECT_ID); + public static final ForeignKey API_KEYS__API_KEYS_USER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_PK, JApiKeys.API_KEYS, "api_keys__api_keys_user_id_fkey", JApiKeys.API_KEYS.USER_ID); + public static final ForeignKey CONTENT_FIELD__CONTENT_FIELD_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.WIDGET_PKEY, JContentField.CONTENT_FIELD, "content_field__content_field_id_fkey", JContentField.CONTENT_FIELD.ID); + public static final ForeignKey DASHBOARD__DASHBOARD_ID_FK = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.SHAREABLE_PK, JDashboard.DASHBOARD, "dashboard__dashboard_id_fk", JDashboard.DASHBOARD.ID); + public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.DASHBOARD_PKEY, JDashboardWidget.DASHBOARD_WIDGET, "dashboard_widget__dashboard_widget_dashboard_id_fkey", JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID); + public static final ForeignKey DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.WIDGET_PKEY, JDashboardWidget.DASHBOARD_WIDGET, "dashboard_widget__dashboard_widget_widget_id_fkey", JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID); + public static final ForeignKey FILTER__FILTER_ID_FK = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.SHAREABLE_PK, JFilter.FILTER, "filter__filter_id_fk", JFilter.FILTER.ID); + public static final ForeignKey FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JFilterCondition.FILTER_CONDITION, "filter_condition__filter_condition_filter_id_fkey", JFilterCondition.FILTER_CONDITION.FILTER_ID); + public static final ForeignKey FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JFilterSort.FILTER_SORT, "filter_sort__filter_sort_filter_id_fkey", JFilterSort.FILTER_SORT.FILTER_ID); + public static final ForeignKey INTEGRATION__INTEGRATION_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JIntegration.INTEGRATION, "integration__integration_project_id_fkey", JIntegration.INTEGRATION.PROJECT_ID); + public static final ForeignKey INTEGRATION__INTEGRATION_TYPE_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.INTEGRATION_TYPE_PK, JIntegration.INTEGRATION, "integration__integration_type_fkey", JIntegration.INTEGRATION.TYPE); + public static final ForeignKey ISSUE__ISSUE_ISSUE_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_RESULTS_PK, JIssue.ISSUE, "issue__issue_issue_id_fkey", JIssue.ISSUE.ISSUE_ID); + public static final ForeignKey ISSUE__ISSUE_ISSUE_TYPE_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ISSUE_TYPE_PK, JIssue.ISSUE, "issue__issue_issue_type_fkey", JIssue.ISSUE.ISSUE_TYPE); + public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ISSUE_PK, JIssueTicket.ISSUE_TICKET, "issue_ticket__issue_ticket_issue_id_fkey", JIssueTicket.ISSUE_TICKET.ISSUE_ID); + public static final ForeignKey ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TICKET_PK, JIssueTicket.ISSUE_TICKET, "issue_ticket__issue_ticket_ticket_id_fkey", JIssueTicket.ISSUE_TICKET.TICKET_ID); + public static final ForeignKey ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ISSUE_GROUP_PK, JIssueType.ISSUE_TYPE, "issue_type__issue_type_issue_group_id_fkey", JIssueType.ISSUE_TYPE.ISSUE_GROUP_ID); + public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JIssueTypeProject.ISSUE_TYPE_PROJECT, "issue_type_project__issue_type_project_project_id_fkey", JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID); + public static final ForeignKey ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ISSUE_TYPE_PK, JIssueTypeProject.ISSUE_TYPE_PROJECT, "issue_type_project__issue_type_project_issue_type_id_fkey", JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID); + public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JItemAttribute.ITEM_ATTRIBUTE, "item_attribute__item_attribute_item_id_fkey", JItemAttribute.ITEM_ATTRIBUTE.ITEM_ID); + public static final ForeignKey ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JItemAttribute.ITEM_ATTRIBUTE, "item_attribute__item_attribute_launch_id_fkey", JItemAttribute.ITEM_ATTRIBUTE.LAUNCH_ID); + public static final ForeignKey LAUNCH__LAUNCH_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JLaunch.LAUNCH, "launch__launch_project_id_fkey", JLaunch.LAUNCH.PROJECT_ID); + public static final ForeignKey LAUNCH__LAUNCH_USER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_PK, JLaunch.LAUNCH, "launch__launch_user_id_fkey", JLaunch.LAUNCH.USER_ID); + public static final ForeignKey LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.SENDER_CASE_PK, JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, "launch_attribute_rules__launch_attribute_rules_sender_case_id_fkey", JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.SENDER_CASE_ID); + public static final ForeignKey LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.SENDER_CASE_PK, JLaunchNames.LAUNCH_NAMES, "launch_names__launch_names_sender_case_id_fkey", JLaunchNames.LAUNCH_NAMES.SENDER_CASE_ID); + public static final ForeignKey LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JLaunchNumber.LAUNCH_NUMBER, "launch_number__launch_number_project_id_fkey", JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID); + public static final ForeignKey LOG__LOG_ITEM_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JLog.LOG, "log__log_item_id_fkey", JLog.LOG.ITEM_ID); + public static final ForeignKey LOG__LOG_LAUNCH_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JLog.LOG, "log__log_launch_id_fkey", JLog.LOG.LAUNCH_ID); + public static final ForeignKey LOG__LOG_ATTACHMENT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ATTACHMENT_PK, JLog.LOG, "log__log_attachment_id_fkey", JLog.LOG.ATTACHMENT_ID); + public static final ForeignKey OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_PK, JOauthAccessToken.OAUTH_ACCESS_TOKEN, "oauth_access_token__oauth_access_token_user_id_fkey", JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID); + public static final ForeignKey OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.OAUTH_REGISTRATION_PKEY, JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, "oauth_registration_restriction__oauth_registration_restriction_oauth_registration_fk_fkey", JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK); + public static final ForeignKey OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.OAUTH_REGISTRATION_PKEY, JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, "oauth_registration_scope__oauth_registration_scope_oauth_registration_fk_fkey", JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK); + public static final ForeignKey ORGANIZATION_ATTRIBUTE__ORGANIZATION_ATTRIBUTE_ORGANIZATION_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ORGANIZATION_PKEY, JOrganizationAttribute.ORGANIZATION_ATTRIBUTE, "organization_attribute__organization_attribute_organization_id_fkey", JOrganizationAttribute.ORGANIZATION_ATTRIBUTE.ORGANIZATION_ID); + public static final ForeignKey OWNED_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JOwnedEntity.OWNED_ENTITY, "owned_entity__shareable_entity_project_id_fkey", JOwnedEntity.OWNED_ENTITY.PROJECT_ID); + public static final ForeignKey PARAMETER__PARAMETER_ITEM_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JParameter.PARAMETER, "parameter__parameter_item_id_fkey", JParameter.PARAMETER.ITEM_ID); + public static final ForeignKey PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JPatternTemplate.PATTERN_TEMPLATE, "pattern_template__pattern_template_project_id_fkey", JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID); + public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PATTERN_TEMPLATE_PK, JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, "pattern_template_test_item__pattern_template_test_item_pattern_id_fkey", JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID); + public static final ForeignKey PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM, "pattern_template_test_item__pattern_template_test_item_item_id_fkey", JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID); + public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ATTRIBUTE_PK, JProjectAttribute.PROJECT_ATTRIBUTE, "project_attribute__project_attribute_attribute_id_fkey", JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID); + public static final ForeignKey PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JProjectAttribute.PROJECT_ATTRIBUTE, "project_attribute__project_attribute_project_id_fkey", JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID); + public static final ForeignKey PROJECT_USER__PROJECT_USER_USER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_PK, JProjectUser.PROJECT_USER, "project_user__project_user_user_id_fkey", JProjectUser.PROJECT_USER.USER_ID); + public static final ForeignKey PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JProjectUser.PROJECT_USER, "project_user__project_user_project_id_fkey", JProjectUser.PROJECT_USER.PROJECT_ID); + public static final ForeignKey RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.SENDER_CASE_PK, JRecipients.RECIPIENTS, "recipients__recipients_sender_case_id_fkey", JRecipients.RECIPIENTS.SENDER_CASE_ID); + public static final ForeignKey SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JSenderCase.SENDER_CASE, "sender_case__sender_case_project_id_fkey", JSenderCase.SENDER_CASE.PROJECT_ID); + public static final ForeignKey STATISTICS__STATISTICS_LAUNCH_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JStatistics.STATISTICS, "statistics__statistics_launch_id_fkey", JStatistics.STATISTICS.LAUNCH_ID); + public static final ForeignKey STATISTICS__STATISTICS_ITEM_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JStatistics.STATISTICS, "statistics__statistics_item_id_fkey", JStatistics.STATISTICS.ITEM_ID); + public static final ForeignKey STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.STATISTICS_FIELD_PK, JStatistics.STATISTICS, "statistics__statistics_statistics_field_id_fkey", JStatistics.STATISTICS.STATISTICS_FIELD_ID); + public static final ForeignKey TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JTestItem.TEST_ITEM, "test_item__test_item_parent_id_fkey", JTestItem.TEST_ITEM.PARENT_ID); + public static final ForeignKey TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JTestItem.TEST_ITEM, "test_item__test_item_retry_of_fkey", JTestItem.TEST_ITEM.RETRY_OF); + public static final ForeignKey TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JTestItem.TEST_ITEM, "test_item__test_item_launch_id_fkey", JTestItem.TEST_ITEM.LAUNCH_ID); + public static final ForeignKey TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JTestItemResults.TEST_ITEM_RESULTS, "test_item_results__test_item_results_result_id_fkey", JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID); + public static final ForeignKey USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JUserCreationBid.USER_CREATION_BID, "user_creation_bid__user_creation_bid_default_project_id_fkey", JUserCreationBid.USER_CREATION_BID.DEFAULT_PROJECT_ID); + public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JUserPreference.USER_PREFERENCE, "user_preference__user_preference_project_id_fkey", JUserPreference.USER_PREFERENCE.PROJECT_ID); + public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_PK, JUserPreference.USER_PREFERENCE, "user_preference__user_preference_user_id_fkey", JUserPreference.USER_PREFERENCE.USER_ID); + public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JUserPreference.USER_PREFERENCE, "user_preference__user_preference_filter_id_fkey", JUserPreference.USER_PREFERENCE.FILTER_ID); + public static final ForeignKey WIDGET__WIDGET_ID_FK = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.SHAREABLE_PK, JWidget.WIDGET, "widget__widget_id_fk", JWidget.WIDGET.ID); + public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.WIDGET_PKEY, JWidgetFilter.WIDGET_FILTER, "widget_filter__widget_filter_widget_id_fkey", JWidgetFilter.WIDGET_FILTER.WIDGET_ID); + public static final ForeignKey WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JWidgetFilter.WIDGET_FILTER, "widget_filter__widget_filter_filter_id_fkey", JWidgetFilter.WIDGET_FILTER.FILTER_ID); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java b/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java index e9c01edf1..eccb5f790 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java @@ -5,6 +5,7 @@ import javax.annotation.processing.Generated; + import org.jooq.Sequence; import org.jooq.impl.SequenceImpl; @@ -19,245 +20,191 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Sequences { - /** - * The sequence public.acl_class_id_seq - */ - public static final Sequence ACL_CLASS_ID_SEQ = new SequenceImpl("acl_class_id_seq", - JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.acl_entry_id_seq - */ - public static final Sequence ACL_ENTRY_ID_SEQ = new SequenceImpl("acl_entry_id_seq", - JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.acl_object_identity_id_seq - */ - public static final Sequence ACL_OBJECT_IDENTITY_ID_SEQ = new SequenceImpl( - "acl_object_identity_id_seq", JPublic.PUBLIC, - org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.acl_sid_id_seq - */ - public static final Sequence ACL_SID_ID_SEQ = new SequenceImpl("acl_sid_id_seq", - JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.activity_id_seq - */ - public static final Sequence ACTIVITY_ID_SEQ = new SequenceImpl("activity_id_seq", - JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.attachment_id_seq - */ - public static final Sequence ATTACHMENT_ID_SEQ = new SequenceImpl("attachment_id_seq", - JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.attribute_id_seq - */ - public static final Sequence ATTRIBUTE_ID_SEQ = new SequenceImpl("attribute_id_seq", - JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.clusters_id_seq - */ - public static final Sequence CLUSTERS_ID_SEQ = new SequenceImpl("clusters_id_seq", - JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.filter_condition_id_seq - */ - public static final Sequence FILTER_CONDITION_ID_SEQ = new SequenceImpl( - "filter_condition_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.filter_sort_id_seq - */ - public static final Sequence FILTER_SORT_ID_SEQ = new SequenceImpl( - "filter_sort_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.integration_id_seq - */ - public static final Sequence INTEGRATION_ID_SEQ = new SequenceImpl( - "integration_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.INTEGER.nullable(false)); - - /** - * The sequence public.integration_type_id_seq - */ - public static final Sequence INTEGRATION_TYPE_ID_SEQ = new SequenceImpl( - "integration_type_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.INTEGER.nullable(false)); - - /** - * The sequence public.issue_group_issue_group_id_seq - */ - public static final Sequence ISSUE_GROUP_ISSUE_GROUP_ID_SEQ = new SequenceImpl( - "issue_group_issue_group_id_seq", JPublic.PUBLIC, - org.jooq.impl.SQLDataType.SMALLINT.nullable(false)); - - /** - * The sequence public.issue_type_id_seq - */ - public static final Sequence ISSUE_TYPE_ID_SEQ = new SequenceImpl("issue_type_id_seq", - JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.item_attribute_id_seq - */ - public static final Sequence ITEM_ATTRIBUTE_ID_SEQ = new SequenceImpl( - "item_attribute_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.launch_attribute_rules_id_seq - */ - public static final Sequence LAUNCH_ATTRIBUTE_RULES_ID_SEQ = new SequenceImpl( - "launch_attribute_rules_id_seq", JPublic.PUBLIC, - org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.launch_id_seq - */ - public static final Sequence LAUNCH_ID_SEQ = new SequenceImpl("launch_id_seq", - JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.launch_number_id_seq - */ - public static final Sequence LAUNCH_NUMBER_ID_SEQ = new SequenceImpl( - "launch_number_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.log_id_seq - */ - public static final Sequence LOG_ID_SEQ = new SequenceImpl("log_id_seq", - JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.oauth_access_token_id_seq - */ - public static final Sequence OAUTH_ACCESS_TOKEN_ID_SEQ = new SequenceImpl( - "oauth_access_token_id_seq", JPublic.PUBLIC, - org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.oauth_registration_restriction_id_seq - */ - public static final Sequence OAUTH_REGISTRATION_RESTRICTION_ID_SEQ = new SequenceImpl( - "oauth_registration_restriction_id_seq", JPublic.PUBLIC, - org.jooq.impl.SQLDataType.INTEGER.nullable(false)); - - /** - * The sequence public.oauth_registration_scope_id_seq - */ - public static final Sequence OAUTH_REGISTRATION_SCOPE_ID_SEQ = new SequenceImpl( - "oauth_registration_scope_id_seq", JPublic.PUBLIC, - org.jooq.impl.SQLDataType.INTEGER.nullable(false)); - - /** - * The sequence public.onboarding_id_seq - */ - public static final Sequence ONBOARDING_ID_SEQ = new SequenceImpl( - "onboarding_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.SMALLINT.nullable(false)); - - /** - * The sequence public.pattern_template_id_seq - */ - public static final Sequence PATTERN_TEMPLATE_ID_SEQ = new SequenceImpl( - "pattern_template_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.project_attribute_attribute_id_seq - */ - public static final Sequence PROJECT_ATTRIBUTE_ATTRIBUTE_ID_SEQ = new SequenceImpl( - "project_attribute_attribute_id_seq", JPublic.PUBLIC, - org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.project_attribute_project_id_seq - */ - public static final Sequence PROJECT_ATTRIBUTE_PROJECT_ID_SEQ = new SequenceImpl( - "project_attribute_project_id_seq", JPublic.PUBLIC, - org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.project_id_seq - */ - public static final Sequence PROJECT_ID_SEQ = new SequenceImpl("project_id_seq", - JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.sender_case_id_seq - */ - public static final Sequence SENDER_CASE_ID_SEQ = new SequenceImpl( - "sender_case_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.sender_case_project_id_seq - */ - public static final Sequence SENDER_CASE_PROJECT_ID_SEQ = new SequenceImpl( - "sender_case_project_id_seq", JPublic.PUBLIC, - org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.server_settings_id_seq - */ - public static final Sequence SERVER_SETTINGS_ID_SEQ = new SequenceImpl( - "server_settings_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.SMALLINT.nullable(false)); - - /** - * The sequence public.shareable_entity_id_seq - */ - public static final Sequence SHAREABLE_ENTITY_ID_SEQ = new SequenceImpl( - "shareable_entity_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.stale_materialized_view_id_seq - */ - public static final Sequence STALE_MATERIALIZED_VIEW_ID_SEQ = new SequenceImpl( - "stale_materialized_view_id_seq", JPublic.PUBLIC, - org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.statistics_field_sf_id_seq - */ - public static final Sequence STATISTICS_FIELD_SF_ID_SEQ = new SequenceImpl( - "statistics_field_sf_id_seq", JPublic.PUBLIC, - org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.statistics_s_id_seq - */ - public static final Sequence STATISTICS_S_ID_SEQ = new SequenceImpl( - "statistics_s_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.test_item_item_id_seq - */ - public static final Sequence TEST_ITEM_ITEM_ID_SEQ = new SequenceImpl( - "test_item_item_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.ticket_id_seq - */ - public static final Sequence TICKET_ID_SEQ = new SequenceImpl("ticket_id_seq", - JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.user_preference_id_seq - */ - public static final Sequence USER_PREFERENCE_ID_SEQ = new SequenceImpl( - "user_preference_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.users_id_seq - */ - public static final Sequence USERS_ID_SEQ = new SequenceImpl("users_id_seq", - JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + /** + * The sequence public.activity_id_seq + */ + public static final Sequence ACTIVITY_ID_SEQ = new SequenceImpl("activity_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.api_keys_id_seq + */ + public static final Sequence API_KEYS_ID_SEQ = new SequenceImpl("api_keys_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.attachment_id_seq + */ + public static final Sequence ATTACHMENT_ID_SEQ = new SequenceImpl("attachment_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.attribute_id_seq + */ + public static final Sequence ATTRIBUTE_ID_SEQ = new SequenceImpl("attribute_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.clusters_id_seq + */ + public static final Sequence CLUSTERS_ID_SEQ = new SequenceImpl("clusters_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.filter_condition_id_seq + */ + public static final Sequence FILTER_CONDITION_ID_SEQ = new SequenceImpl("filter_condition_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.filter_sort_id_seq + */ + public static final Sequence FILTER_SORT_ID_SEQ = new SequenceImpl("filter_sort_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.integration_id_seq + */ + public static final Sequence INTEGRATION_ID_SEQ = new SequenceImpl("integration_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.INTEGER.nullable(false)); + + /** + * The sequence public.integration_type_id_seq + */ + public static final Sequence INTEGRATION_TYPE_ID_SEQ = new SequenceImpl("integration_type_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.INTEGER.nullable(false)); + + /** + * The sequence public.issue_group_issue_group_id_seq + */ + public static final Sequence ISSUE_GROUP_ISSUE_GROUP_ID_SEQ = new SequenceImpl("issue_group_issue_group_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.SMALLINT.nullable(false)); + + /** + * The sequence public.issue_type_id_seq + */ + public static final Sequence ISSUE_TYPE_ID_SEQ = new SequenceImpl("issue_type_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.item_attribute_id_seq + */ + public static final Sequence ITEM_ATTRIBUTE_ID_SEQ = new SequenceImpl("item_attribute_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.launch_attribute_rules_id_seq + */ + public static final Sequence LAUNCH_ATTRIBUTE_RULES_ID_SEQ = new SequenceImpl("launch_attribute_rules_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.launch_id_seq + */ + public static final Sequence LAUNCH_ID_SEQ = new SequenceImpl("launch_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.launch_number_id_seq + */ + public static final Sequence LAUNCH_NUMBER_ID_SEQ = new SequenceImpl("launch_number_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.log_id_seq + */ + public static final Sequence LOG_ID_SEQ = new SequenceImpl("log_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.oauth_access_token_id_seq + */ + public static final Sequence OAUTH_ACCESS_TOKEN_ID_SEQ = new SequenceImpl("oauth_access_token_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.oauth_registration_restriction_id_seq + */ + public static final Sequence OAUTH_REGISTRATION_RESTRICTION_ID_SEQ = new SequenceImpl("oauth_registration_restriction_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.INTEGER.nullable(false)); + + /** + * The sequence public.oauth_registration_scope_id_seq + */ + public static final Sequence OAUTH_REGISTRATION_SCOPE_ID_SEQ = new SequenceImpl("oauth_registration_scope_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.INTEGER.nullable(false)); + + /** + * The sequence public.onboarding_id_seq + */ + public static final Sequence ONBOARDING_ID_SEQ = new SequenceImpl("onboarding_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.SMALLINT.nullable(false)); + + /** + * The sequence public.organization_attribute_id_seq + */ + public static final Sequence ORGANIZATION_ATTRIBUTE_ID_SEQ = new SequenceImpl("organization_attribute_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.organization_id_seq + */ + public static final Sequence ORGANIZATION_ID_SEQ = new SequenceImpl("organization_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.pattern_template_id_seq + */ + public static final Sequence PATTERN_TEMPLATE_ID_SEQ = new SequenceImpl("pattern_template_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.project_attribute_attribute_id_seq + */ + public static final Sequence PROJECT_ATTRIBUTE_ATTRIBUTE_ID_SEQ = new SequenceImpl("project_attribute_attribute_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.project_attribute_project_id_seq + */ + public static final Sequence PROJECT_ATTRIBUTE_PROJECT_ID_SEQ = new SequenceImpl("project_attribute_project_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.project_id_seq + */ + public static final Sequence PROJECT_ID_SEQ = new SequenceImpl("project_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.sender_case_id_seq + */ + public static final Sequence SENDER_CASE_ID_SEQ = new SequenceImpl("sender_case_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.sender_case_project_id_seq + */ + public static final Sequence SENDER_CASE_PROJECT_ID_SEQ = new SequenceImpl("sender_case_project_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.server_settings_id_seq + */ + public static final Sequence SERVER_SETTINGS_ID_SEQ = new SequenceImpl("server_settings_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.SMALLINT.nullable(false)); + + /** + * The sequence public.shareable_entity_id_seq + */ + public static final Sequence SHAREABLE_ENTITY_ID_SEQ = new SequenceImpl("shareable_entity_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.stale_materialized_view_id_seq + */ + public static final Sequence STALE_MATERIALIZED_VIEW_ID_SEQ = new SequenceImpl("stale_materialized_view_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.statistics_field_sf_id_seq + */ + public static final Sequence STATISTICS_FIELD_SF_ID_SEQ = new SequenceImpl("statistics_field_sf_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.statistics_s_id_seq + */ + public static final Sequence STATISTICS_S_ID_SEQ = new SequenceImpl("statistics_s_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.test_item_item_id_seq + */ + public static final Sequence TEST_ITEM_ITEM_ID_SEQ = new SequenceImpl("test_item_item_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.ticket_id_seq + */ + public static final Sequence TICKET_ID_SEQ = new SequenceImpl("ticket_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.user_preference_id_seq + */ + public static final Sequence USER_PREFERENCE_ID_SEQ = new SequenceImpl("user_preference_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); + + /** + * The sequence public.users_id_seq + */ + public static final Sequence USERS_ID_SEQ = new SequenceImpl("users_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Tables.java b/src/main/java/com/epam/ta/reportportal/jooq/Tables.java index 249dae9cb..d9ec8bdda 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/Tables.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Tables.java @@ -4,11 +4,8 @@ package com.epam.ta.reportportal.jooq; -import com.epam.ta.reportportal.jooq.tables.JAclClass; -import com.epam.ta.reportportal.jooq.tables.JAclEntry; -import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; -import com.epam.ta.reportportal.jooq.tables.JAclSid; import com.epam.ta.reportportal.jooq.tables.JActivity; +import com.epam.ta.reportportal.jooq.tables.JApiKeys; import com.epam.ta.reportportal.jooq.tables.JAttachment; import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; import com.epam.ta.reportportal.jooq.tables.JAttribute; @@ -38,6 +35,9 @@ import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; import com.epam.ta.reportportal.jooq.tables.JOnboarding; +import com.epam.ta.reportportal.jooq.tables.JOrganization; +import com.epam.ta.reportportal.jooq.tables.JOrganizationAttribute; +import com.epam.ta.reportportal.jooq.tables.JOwnedEntity; import com.epam.ta.reportportal.jooq.tables.JParameter; import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; @@ -49,7 +49,7 @@ import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; import com.epam.ta.reportportal.jooq.tables.JSenderCase; import com.epam.ta.reportportal.jooq.tables.JServerSettings; -import com.epam.ta.reportportal.jooq.tables.JShareableEntity; +import com.epam.ta.reportportal.jooq.tables.JShedlock; import com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView; import com.epam.ta.reportportal.jooq.tables.JStatistics; import com.epam.ta.reportportal.jooq.tables.JStatisticsField; @@ -62,7 +62,9 @@ import com.epam.ta.reportportal.jooq.tables.JWidget; import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; import com.epam.ta.reportportal.jooq.tables.records.JPgpArmorHeadersRecord; + import javax.annotation.processing.Generated; + import org.jooq.Configuration; import org.jooq.Field; import org.jooq.Result; @@ -78,295 +80,312 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Tables { - /** - * The table public.acl_class. - */ - public static final JAclClass ACL_CLASS = JAclClass.ACL_CLASS; - - /** - * The table public.acl_entry. - */ - public static final JAclEntry ACL_ENTRY = JAclEntry.ACL_ENTRY; - - /** - * The table public.acl_object_identity. - */ - public static final JAclObjectIdentity ACL_OBJECT_IDENTITY = JAclObjectIdentity.ACL_OBJECT_IDENTITY; - - /** - * The table public.acl_sid. - */ - public static final JAclSid ACL_SID = JAclSid.ACL_SID; - - /** - * The table public.activity. - */ - public static final JActivity ACTIVITY = JActivity.ACTIVITY; - - /** - * The table public.attachment. - */ - public static final JAttachment ATTACHMENT = JAttachment.ATTACHMENT; - - /** - * The table public.attachment_deletion. - */ - public static final JAttachmentDeletion ATTACHMENT_DELETION = JAttachmentDeletion.ATTACHMENT_DELETION; - - /** - * The table public.attribute. - */ - public static final JAttribute ATTRIBUTE = JAttribute.ATTRIBUTE; - - /** - * The table public.clusters. - */ - public static final JClusters CLUSTERS = JClusters.CLUSTERS; - - /** - * The table public.clusters_test_item. - */ - public static final JClustersTestItem CLUSTERS_TEST_ITEM = JClustersTestItem.CLUSTERS_TEST_ITEM; - - /** - * The table public.content_field. - */ - public static final JContentField CONTENT_FIELD = JContentField.CONTENT_FIELD; - - /** - * The table public.dashboard. - */ - public static final JDashboard DASHBOARD = JDashboard.DASHBOARD; - - /** - * The table public.dashboard_widget. - */ - public static final JDashboardWidget DASHBOARD_WIDGET = JDashboardWidget.DASHBOARD_WIDGET; - - /** - * The table public.filter. - */ - public static final JFilter FILTER = JFilter.FILTER; - - /** - * The table public.filter_condition. - */ - public static final JFilterCondition FILTER_CONDITION = JFilterCondition.FILTER_CONDITION; - - /** - * The table public.filter_sort. - */ - public static final JFilterSort FILTER_SORT = JFilterSort.FILTER_SORT; - - /** - * The table public.integration. - */ - public static final JIntegration INTEGRATION = JIntegration.INTEGRATION; - - /** - * The table public.integration_type. - */ - public static final JIntegrationType INTEGRATION_TYPE = JIntegrationType.INTEGRATION_TYPE; - - /** - * The table public.issue. - */ - public static final JIssue ISSUE = JIssue.ISSUE; - - /** - * The table public.issue_group. - */ - public static final JIssueGroup ISSUE_GROUP = JIssueGroup.ISSUE_GROUP; - - /** - * The table public.issue_ticket. - */ - public static final JIssueTicket ISSUE_TICKET = JIssueTicket.ISSUE_TICKET; - - /** - * The table public.issue_type. - */ - public static final JIssueType ISSUE_TYPE = JIssueType.ISSUE_TYPE; - - /** - * The table public.issue_type_project. - */ - public static final JIssueTypeProject ISSUE_TYPE_PROJECT = JIssueTypeProject.ISSUE_TYPE_PROJECT; - - /** - * The table public.item_attribute. - */ - public static final JItemAttribute ITEM_ATTRIBUTE = JItemAttribute.ITEM_ATTRIBUTE; - - /** - * The table public.launch. - */ - public static final JLaunch LAUNCH = JLaunch.LAUNCH; - - /** - * The table public.launch_attribute_rules. - */ - public static final JLaunchAttributeRules LAUNCH_ATTRIBUTE_RULES = JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES; - - /** - * The table public.launch_names. - */ - public static final JLaunchNames LAUNCH_NAMES = JLaunchNames.LAUNCH_NAMES; - - /** - * The table public.launch_number. - */ - public static final JLaunchNumber LAUNCH_NUMBER = JLaunchNumber.LAUNCH_NUMBER; - - /** - * The table public.log. - */ - public static final JLog LOG = JLog.LOG; - - /** - * The table public.oauth_access_token. - */ - public static final JOauthAccessToken OAUTH_ACCESS_TOKEN = JOauthAccessToken.OAUTH_ACCESS_TOKEN; - - /** - * The table public.oauth_registration. - */ - public static final JOauthRegistration OAUTH_REGISTRATION = JOauthRegistration.OAUTH_REGISTRATION; - - /** - * The table public.oauth_registration_restriction. - */ - public static final JOauthRegistrationRestriction OAUTH_REGISTRATION_RESTRICTION = JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION; - - /** - * The table public.oauth_registration_scope. - */ - public static final JOauthRegistrationScope OAUTH_REGISTRATION_SCOPE = JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE; - - /** - * The table public.onboarding. - */ - public static final JOnboarding ONBOARDING = JOnboarding.ONBOARDING; - - /** - * The table public.parameter. - */ - public static final JParameter PARAMETER = JParameter.PARAMETER; - - /** - * The table public.pattern_template. - */ - public static final JPatternTemplate PATTERN_TEMPLATE = JPatternTemplate.PATTERN_TEMPLATE; - - /** - * The table public.pattern_template_test_item. - */ - public static final JPatternTemplateTestItem PATTERN_TEMPLATE_TEST_ITEM = JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM; - - /** - * The table public.pgp_armor_headers. - */ - public static final JPgpArmorHeaders PGP_ARMOR_HEADERS = JPgpArmorHeaders.PGP_ARMOR_HEADERS; - /** - * The table public.project. - */ - public static final JProject PROJECT = JProject.PROJECT; - /** - * The table public.project_attribute. - */ - public static final JProjectAttribute PROJECT_ATTRIBUTE = JProjectAttribute.PROJECT_ATTRIBUTE; - /** - * The table public.project_user. - */ - public static final JProjectUser PROJECT_USER = JProjectUser.PROJECT_USER; - /** - * The table public.recipients. - */ - public static final JRecipients RECIPIENTS = JRecipients.RECIPIENTS; - /** - * The table public.restore_password_bid. - */ - public static final JRestorePasswordBid RESTORE_PASSWORD_BID = JRestorePasswordBid.RESTORE_PASSWORD_BID; - /** - * The table public.sender_case. - */ - public static final JSenderCase SENDER_CASE = JSenderCase.SENDER_CASE; - /** - * The table public.server_settings. - */ - public static final JServerSettings SERVER_SETTINGS = JServerSettings.SERVER_SETTINGS; - /** - * The table public.shareable_entity. - */ - public static final JShareableEntity SHAREABLE_ENTITY = JShareableEntity.SHAREABLE_ENTITY; - /** - * The table public.stale_materialized_view. - */ - public static final JStaleMaterializedView STALE_MATERIALIZED_VIEW = JStaleMaterializedView.STALE_MATERIALIZED_VIEW; - /** - * The table public.statistics. - */ - public static final JStatistics STATISTICS = JStatistics.STATISTICS; - /** - * The table public.statistics_field. - */ - public static final JStatisticsField STATISTICS_FIELD = JStatisticsField.STATISTICS_FIELD; - /** - * The table public.test_item. - */ - public static final JTestItem TEST_ITEM = JTestItem.TEST_ITEM; - /** - * The table public.test_item_results. - */ - public static final JTestItemResults TEST_ITEM_RESULTS = JTestItemResults.TEST_ITEM_RESULTS; - /** - * The table public.ticket. - */ - public static final JTicket TICKET = JTicket.TICKET; - /** - * The table public.user_creation_bid. - */ - public static final JUserCreationBid USER_CREATION_BID = JUserCreationBid.USER_CREATION_BID; - /** - * The table public.user_preference. - */ - public static final JUserPreference USER_PREFERENCE = JUserPreference.USER_PREFERENCE; - /** - * The table public.users. - */ - public static final JUsers USERS = JUsers.USERS; - /** - * The table public.widget. - */ - public static final JWidget WIDGET = JWidget.WIDGET; - /** - * The table public.widget_filter. - */ - public static final JWidgetFilter WIDGET_FILTER = JWidgetFilter.WIDGET_FILTER; - - /** - * Call public.pgp_armor_headers. - */ - public static Result PGP_ARMOR_HEADERS(Configuration configuration, - String __1) { - return configuration.dsl().selectFrom( - com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1)).fetch(); - } - - /** - * Get public.pgp_armor_headers as a table. - */ - public static JPgpArmorHeaders PGP_ARMOR_HEADERS(String __1) { - return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); - } - - /** - * Get public.pgp_armor_headers as a table. - */ - public static JPgpArmorHeaders PGP_ARMOR_HEADERS(Field __1) { - return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); - } + /** + * The table public.activity. + */ + public static final JActivity ACTIVITY = JActivity.ACTIVITY; + + /** + * The table public.api_keys. + */ + public static final JApiKeys API_KEYS = JApiKeys.API_KEYS; + + /** + * The table public.attachment. + */ + public static final JAttachment ATTACHMENT = JAttachment.ATTACHMENT; + + /** + * The table public.attachment_deletion. + */ + public static final JAttachmentDeletion ATTACHMENT_DELETION = JAttachmentDeletion.ATTACHMENT_DELETION; + + /** + * The table public.attribute. + */ + public static final JAttribute ATTRIBUTE = JAttribute.ATTRIBUTE; + + /** + * The table public.clusters. + */ + public static final JClusters CLUSTERS = JClusters.CLUSTERS; + + /** + * The table public.clusters_test_item. + */ + public static final JClustersTestItem CLUSTERS_TEST_ITEM = JClustersTestItem.CLUSTERS_TEST_ITEM; + + /** + * The table public.content_field. + */ + public static final JContentField CONTENT_FIELD = JContentField.CONTENT_FIELD; + + /** + * The table public.dashboard. + */ + public static final JDashboard DASHBOARD = JDashboard.DASHBOARD; + + /** + * The table public.dashboard_widget. + */ + public static final JDashboardWidget DASHBOARD_WIDGET = JDashboardWidget.DASHBOARD_WIDGET; + + /** + * The table public.filter. + */ + public static final JFilter FILTER = JFilter.FILTER; + + /** + * The table public.filter_condition. + */ + public static final JFilterCondition FILTER_CONDITION = JFilterCondition.FILTER_CONDITION; + + /** + * The table public.filter_sort. + */ + public static final JFilterSort FILTER_SORT = JFilterSort.FILTER_SORT; + + /** + * The table public.integration. + */ + public static final JIntegration INTEGRATION = JIntegration.INTEGRATION; + + /** + * The table public.integration_type. + */ + public static final JIntegrationType INTEGRATION_TYPE = JIntegrationType.INTEGRATION_TYPE; + + /** + * The table public.issue. + */ + public static final JIssue ISSUE = JIssue.ISSUE; + + /** + * The table public.issue_group. + */ + public static final JIssueGroup ISSUE_GROUP = JIssueGroup.ISSUE_GROUP; + + /** + * The table public.issue_ticket. + */ + public static final JIssueTicket ISSUE_TICKET = JIssueTicket.ISSUE_TICKET; + + /** + * The table public.issue_type. + */ + public static final JIssueType ISSUE_TYPE = JIssueType.ISSUE_TYPE; + + /** + * The table public.issue_type_project. + */ + public static final JIssueTypeProject ISSUE_TYPE_PROJECT = JIssueTypeProject.ISSUE_TYPE_PROJECT; + + /** + * The table public.item_attribute. + */ + public static final JItemAttribute ITEM_ATTRIBUTE = JItemAttribute.ITEM_ATTRIBUTE; + + /** + * The table public.launch. + */ + public static final JLaunch LAUNCH = JLaunch.LAUNCH; + + /** + * The table public.launch_attribute_rules. + */ + public static final JLaunchAttributeRules LAUNCH_ATTRIBUTE_RULES = JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES; + + /** + * The table public.launch_names. + */ + public static final JLaunchNames LAUNCH_NAMES = JLaunchNames.LAUNCH_NAMES; + + /** + * The table public.launch_number. + */ + public static final JLaunchNumber LAUNCH_NUMBER = JLaunchNumber.LAUNCH_NUMBER; + + /** + * The table public.log. + */ + public static final JLog LOG = JLog.LOG; + + /** + * The table public.oauth_access_token. + */ + public static final JOauthAccessToken OAUTH_ACCESS_TOKEN = JOauthAccessToken.OAUTH_ACCESS_TOKEN; + + /** + * The table public.oauth_registration. + */ + public static final JOauthRegistration OAUTH_REGISTRATION = JOauthRegistration.OAUTH_REGISTRATION; + + /** + * The table public.oauth_registration_restriction. + */ + public static final JOauthRegistrationRestriction OAUTH_REGISTRATION_RESTRICTION = JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION; + + /** + * The table public.oauth_registration_scope. + */ + public static final JOauthRegistrationScope OAUTH_REGISTRATION_SCOPE = JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE; + + /** + * The table public.onboarding. + */ + public static final JOnboarding ONBOARDING = JOnboarding.ONBOARDING; + + /** + * The table public.organization. + */ + public static final JOrganization ORGANIZATION = JOrganization.ORGANIZATION; + + /** + * The table public.organization_attribute. + */ + public static final JOrganizationAttribute ORGANIZATION_ATTRIBUTE = JOrganizationAttribute.ORGANIZATION_ATTRIBUTE; + + /** + * The table public.owned_entity. + */ + public static final JOwnedEntity OWNED_ENTITY = JOwnedEntity.OWNED_ENTITY; + + /** + * The table public.parameter. + */ + public static final JParameter PARAMETER = JParameter.PARAMETER; + + /** + * The table public.pattern_template. + */ + public static final JPatternTemplate PATTERN_TEMPLATE = JPatternTemplate.PATTERN_TEMPLATE; + + /** + * The table public.pattern_template_test_item. + */ + public static final JPatternTemplateTestItem PATTERN_TEMPLATE_TEST_ITEM = JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM; + + /** + * The table public.pgp_armor_headers. + */ + public static final JPgpArmorHeaders PGP_ARMOR_HEADERS = JPgpArmorHeaders.PGP_ARMOR_HEADERS; + + /** + * Call public.pgp_armor_headers. + */ + public static Result PGP_ARMOR_HEADERS(Configuration configuration, String __1) { + return configuration.dsl().selectFrom(com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1)).fetch(); + } + + /** + * Get public.pgp_armor_headers as a table. + */ + public static JPgpArmorHeaders PGP_ARMOR_HEADERS(String __1) { + return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); + } + + /** + * Get public.pgp_armor_headers as a table. + */ + public static JPgpArmorHeaders PGP_ARMOR_HEADERS(Field __1) { + return com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders.PGP_ARMOR_HEADERS.call(__1); + } + + /** + * The table public.project. + */ + public static final JProject PROJECT = JProject.PROJECT; + + /** + * The table public.project_attribute. + */ + public static final JProjectAttribute PROJECT_ATTRIBUTE = JProjectAttribute.PROJECT_ATTRIBUTE; + + /** + * The table public.project_user. + */ + public static final JProjectUser PROJECT_USER = JProjectUser.PROJECT_USER; + + /** + * The table public.recipients. + */ + public static final JRecipients RECIPIENTS = JRecipients.RECIPIENTS; + + /** + * The table public.restore_password_bid. + */ + public static final JRestorePasswordBid RESTORE_PASSWORD_BID = JRestorePasswordBid.RESTORE_PASSWORD_BID; + + /** + * The table public.sender_case. + */ + public static final JSenderCase SENDER_CASE = JSenderCase.SENDER_CASE; + + /** + * The table public.server_settings. + */ + public static final JServerSettings SERVER_SETTINGS = JServerSettings.SERVER_SETTINGS; + + /** + * The table public.shedlock. + */ + public static final JShedlock SHEDLOCK = JShedlock.SHEDLOCK; + + /** + * The table public.stale_materialized_view. + */ + public static final JStaleMaterializedView STALE_MATERIALIZED_VIEW = JStaleMaterializedView.STALE_MATERIALIZED_VIEW; + + /** + * The table public.statistics. + */ + public static final JStatistics STATISTICS = JStatistics.STATISTICS; + + /** + * The table public.statistics_field. + */ + public static final JStatisticsField STATISTICS_FIELD = JStatisticsField.STATISTICS_FIELD; + + /** + * The table public.test_item. + */ + public static final JTestItem TEST_ITEM = JTestItem.TEST_ITEM; + + /** + * The table public.test_item_results. + */ + public static final JTestItemResults TEST_ITEM_RESULTS = JTestItemResults.TEST_ITEM_RESULTS; + + /** + * The table public.ticket. + */ + public static final JTicket TICKET = JTicket.TICKET; + + /** + * The table public.user_creation_bid. + */ + public static final JUserCreationBid USER_CREATION_BID = JUserCreationBid.USER_CREATION_BID; + + /** + * The table public.user_preference. + */ + public static final JUserPreference USER_PREFERENCE = JUserPreference.USER_PREFERENCE; + + /** + * The table public.users. + */ + public static final JUsers USERS = JUsers.USERS; + + /** + * The table public.widget. + */ + public static final JWidget WIDGET = JWidget.WIDGET; + + /** + * The table public.widget_filter. + */ + public static final JWidgetFilter WIDGET_FILTER = JWidgetFilter.WIDGET_FILTER; } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JAccessTokenTypeEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JAccessTokenTypeEnum.java index fa8d20227..aa9293ca3 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JAccessTokenTypeEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JAccessTokenTypeEnum.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.JPublic; + import javax.annotation.processing.Generated; + import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -21,40 +23,40 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public enum JAccessTokenTypeEnum implements EnumType { - OAUTH("OAUTH"), + OAUTH("OAUTH"), - NTLM("NTLM"), + NTLM("NTLM"), - APIKEY("APIKEY"), + APIKEY("APIKEY"), - BASIC("BASIC"); + BASIC("BASIC"); - private final String literal; + private final String literal; - private JAccessTokenTypeEnum(String literal) { - this.literal = literal; - } + private JAccessTokenTypeEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "access_token_type_enum"; - } + @Override + public String getName() { + return "access_token_type_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JAuthTypeEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JAuthTypeEnum.java index fe9b5ae34..b1d17d910 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JAuthTypeEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JAuthTypeEnum.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.JPublic; + import javax.annotation.processing.Generated; + import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -21,40 +23,40 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public enum JAuthTypeEnum implements EnumType { - OAUTH("OAUTH"), + OAUTH("OAUTH"), - NTLM("NTLM"), + NTLM("NTLM"), - APIKEY("APIKEY"), + APIKEY("APIKEY"), - BASIC("BASIC"); + BASIC("BASIC"); - private final String literal; + private final String literal; - private JAuthTypeEnum(String literal) { - this.literal = literal; - } + private JAuthTypeEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "auth_type_enum"; - } + @Override + public String getName() { + return "auth_type_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JFilterConditionEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JFilterConditionEnum.java index 0d16a047a..8d2af3a71 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JFilterConditionEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JFilterConditionEnum.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.JPublic; + import javax.annotation.processing.Generated; + import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -21,56 +23,56 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public enum JFilterConditionEnum implements EnumType { - EQUALS("EQUALS"), + EQUALS("EQUALS"), - NOT_EQUALS("NOT_EQUALS"), + NOT_EQUALS("NOT_EQUALS"), - CONTAINS("CONTAINS"), + CONTAINS("CONTAINS"), - EXISTS("EXISTS"), + EXISTS("EXISTS"), - IN("IN"), + IN("IN"), - HAS("HAS"), + HAS("HAS"), - GREATER_THAN("GREATER_THAN"), + GREATER_THAN("GREATER_THAN"), - GREATER_THAN_OR_EQUALS("GREATER_THAN_OR_EQUALS"), + GREATER_THAN_OR_EQUALS("GREATER_THAN_OR_EQUALS"), - LOWER_THAN("LOWER_THAN"), + LOWER_THAN("LOWER_THAN"), - LOWER_THAN_OR_EQUALS("LOWER_THAN_OR_EQUALS"), + LOWER_THAN_OR_EQUALS("LOWER_THAN_OR_EQUALS"), - BETWEEN("BETWEEN"), + BETWEEN("BETWEEN"), - ANY("ANY"); + ANY("ANY"); - private final String literal; + private final String literal; - private JFilterConditionEnum(String literal) { - this.literal = literal; - } + private JFilterConditionEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "filter_condition_enum"; - } + @Override + public String getName() { + return "filter_condition_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationAuthFlowEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationAuthFlowEnum.java index 35de465f3..e03b48f97 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationAuthFlowEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationAuthFlowEnum.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.JPublic; + import javax.annotation.processing.Generated; + import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -21,42 +23,42 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public enum JIntegrationAuthFlowEnum implements EnumType { - OAUTH("OAUTH"), + OAUTH("OAUTH"), - BASIC("BASIC"), + BASIC("BASIC"), - TOKEN("TOKEN"), + TOKEN("TOKEN"), - FORM("FORM"), + FORM("FORM"), - LDAP("LDAP"); + LDAP("LDAP"); - private final String literal; + private final String literal; - private JIntegrationAuthFlowEnum(String literal) { - this.literal = literal; - } + private JIntegrationAuthFlowEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "integration_auth_flow_enum"; - } + @Override + public String getName() { + return "integration_auth_flow_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationGroupEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationGroupEnum.java index 8446426a9..cfc69d36b 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationGroupEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JIntegrationGroupEnum.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.JPublic; + import javax.annotation.processing.Generated; + import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -21,40 +23,40 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public enum JIntegrationGroupEnum implements EnumType { - BTS("BTS"), + BTS("BTS"), - NOTIFICATION("NOTIFICATION"), + NOTIFICATION("NOTIFICATION"), - AUTH("AUTH"), + AUTH("AUTH"), - OTHER("OTHER"); + OTHER("OTHER"); - private final String literal; + private final String literal; - private JIntegrationGroupEnum(String literal) { - this.literal = literal; - } + private JIntegrationGroupEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "integration_group_enum"; - } + @Override + public String getName() { + return "integration_group_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JIssueGroupEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JIssueGroupEnum.java index 86661b5ed..c0ed38f2d 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JIssueGroupEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JIssueGroupEnum.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.JPublic; + import javax.annotation.processing.Generated; + import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -21,42 +23,42 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public enum JIssueGroupEnum implements EnumType { - PRODUCT_BUG("PRODUCT_BUG"), + PRODUCT_BUG("PRODUCT_BUG"), - AUTOMATION_BUG("AUTOMATION_BUG"), + AUTOMATION_BUG("AUTOMATION_BUG"), - SYSTEM_ISSUE("SYSTEM_ISSUE"), + SYSTEM_ISSUE("SYSTEM_ISSUE"), - TO_INVESTIGATE("TO_INVESTIGATE"), + TO_INVESTIGATE("TO_INVESTIGATE"), - NO_DEFECT("NO_DEFECT"); + NO_DEFECT("NO_DEFECT"); - private final String literal; + private final String literal; - private JIssueGroupEnum(String literal) { - this.literal = literal; - } + private JIssueGroupEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "issue_group_enum"; - } + @Override + public String getName() { + return "issue_group_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JLaunchModeEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JLaunchModeEnum.java index 3e14ed76a..3a8a1e391 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JLaunchModeEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JLaunchModeEnum.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.JPublic; + import javax.annotation.processing.Generated; + import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -21,36 +23,36 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public enum JLaunchModeEnum implements EnumType { - DEFAULT("DEFAULT"), + DEFAULT("DEFAULT"), - DEBUG("DEBUG"); + DEBUG("DEBUG"); - private final String literal; + private final String literal; - private JLaunchModeEnum(String literal) { - this.literal = literal; - } + private JLaunchModeEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "launch_mode_enum"; - } + @Override + public String getName() { + return "launch_mode_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JLogicalOperatorEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JLogicalOperatorEnum.java new file mode 100644 index 000000000..b118ff474 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JLogicalOperatorEnum.java @@ -0,0 +1,58 @@ +/* + * This file is generated by jOOQ. + */ +package com.epam.ta.reportportal.jooq.enums; + + +import com.epam.ta.reportportal.jooq.JPublic; + +import javax.annotation.processing.Generated; + +import org.jooq.Catalog; +import org.jooq.EnumType; +import org.jooq.Schema; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.4" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public enum JLogicalOperatorEnum implements EnumType { + + AND("AND"), + + OR("OR"); + + private final String literal; + + private JLogicalOperatorEnum(String literal) { + this.literal = literal; + } + + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public String getName() { + return "logical_operator_enum"; + } + + @Override + public String getLiteral() { + return literal; + } +} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JPasswordEncoderType.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JPasswordEncoderType.java index e7ed7cbd7..6c9b84ef2 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JPasswordEncoderType.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JPasswordEncoderType.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.JPublic; + import javax.annotation.processing.Generated; + import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -21,42 +23,42 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public enum JPasswordEncoderType implements EnumType { - PLAIN("PLAIN"), + PLAIN("PLAIN"), - SHA("SHA"), + SHA("SHA"), - LDAP_SHA("LDAP_SHA"), + LDAP_SHA("LDAP_SHA"), - MD4("MD4"), + MD4("MD4"), - MD5("MD5"); + MD5("MD5"); - private final String literal; + private final String literal; - private JPasswordEncoderType(String literal) { - this.literal = literal; - } + private JPasswordEncoderType(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "password_encoder_type"; - } + @Override + public String getName() { + return "password_encoder_type"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JProjectRoleEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JProjectRoleEnum.java index 6ae4cbc41..0be0d7121 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JProjectRoleEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JProjectRoleEnum.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.JPublic; + import javax.annotation.processing.Generated; + import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -21,40 +23,40 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public enum JProjectRoleEnum implements EnumType { - OPERATOR("OPERATOR"), + OPERATOR("OPERATOR"), - CUSTOMER("CUSTOMER"), + CUSTOMER("CUSTOMER"), - MEMBER("MEMBER"), + MEMBER("MEMBER"), - PROJECT_MANAGER("PROJECT_MANAGER"); + PROJECT_MANAGER("PROJECT_MANAGER"); - private final String literal; + private final String literal; - private JProjectRoleEnum(String literal) { - this.literal = literal; - } + private JProjectRoleEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "project_role_enum"; - } + @Override + public String getName() { + return "project_role_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JSortDirectionEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JSortDirectionEnum.java index 2fca2e39d..983fbf9c8 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JSortDirectionEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JSortDirectionEnum.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.JPublic; + import javax.annotation.processing.Generated; + import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -21,36 +23,36 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public enum JSortDirectionEnum implements EnumType { - ASC("ASC"), + ASC("ASC"), - DESC("DESC"); + DESC("DESC"); - private final String literal; + private final String literal; - private JSortDirectionEnum(String literal) { - this.literal = literal; - } + private JSortDirectionEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "sort_direction_enum"; - } + @Override + public String getName() { + return "sort_direction_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JStatusEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JStatusEnum.java old mode 100755 new mode 100644 index 7d7bf50ff..de5198b17 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JStatusEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JStatusEnum.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.JPublic; + import javax.annotation.processing.Generated; + import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -21,52 +23,52 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public enum JStatusEnum implements EnumType { - CANCELLED("CANCELLED"), + CANCELLED("CANCELLED"), - FAILED("FAILED"), + FAILED("FAILED"), - INTERRUPTED("INTERRUPTED"), + INTERRUPTED("INTERRUPTED"), - IN_PROGRESS("IN_PROGRESS"), + IN_PROGRESS("IN_PROGRESS"), - PASSED("PASSED"), + PASSED("PASSED"), - RESETED("RESETED"), + RESETED("RESETED"), - SKIPPED("SKIPPED"), + SKIPPED("SKIPPED"), - STOPPED("STOPPED"), + STOPPED("STOPPED"), - INFO("INFO"), + INFO("INFO"), - WARN("WARN"); + WARN("WARN"); - private final String literal; + private final String literal; - private JStatusEnum(String literal) { - this.literal = literal; - } + private JStatusEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "status_enum"; - } + @Override + public String getName() { + return "status_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/enums/JTestItemTypeEnum.java b/src/main/java/com/epam/ta/reportportal/jooq/enums/JTestItemTypeEnum.java index 43a874cfd..a0ae5219a 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/enums/JTestItemTypeEnum.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/enums/JTestItemTypeEnum.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.JPublic; + import javax.annotation.processing.Generated; + import org.jooq.Catalog; import org.jooq.EnumType; import org.jooq.Schema; @@ -21,62 +23,62 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public enum JTestItemTypeEnum implements EnumType { - AFTER_CLASS("AFTER_CLASS"), + AFTER_CLASS("AFTER_CLASS"), - AFTER_GROUPS("AFTER_GROUPS"), + AFTER_GROUPS("AFTER_GROUPS"), - AFTER_METHOD("AFTER_METHOD"), + AFTER_METHOD("AFTER_METHOD"), - AFTER_SUITE("AFTER_SUITE"), + AFTER_SUITE("AFTER_SUITE"), - AFTER_TEST("AFTER_TEST"), + AFTER_TEST("AFTER_TEST"), - BEFORE_CLASS("BEFORE_CLASS"), + BEFORE_CLASS("BEFORE_CLASS"), - BEFORE_GROUPS("BEFORE_GROUPS"), + BEFORE_GROUPS("BEFORE_GROUPS"), - BEFORE_METHOD("BEFORE_METHOD"), + BEFORE_METHOD("BEFORE_METHOD"), - BEFORE_SUITE("BEFORE_SUITE"), + BEFORE_SUITE("BEFORE_SUITE"), - BEFORE_TEST("BEFORE_TEST"), + BEFORE_TEST("BEFORE_TEST"), - SCENARIO("SCENARIO"), + SCENARIO("SCENARIO"), - STEP("STEP"), + STEP("STEP"), - STORY("STORY"), + STORY("STORY"), - SUITE("SUITE"), + SUITE("SUITE"), - TEST("TEST"); + TEST("TEST"); - private final String literal; + private final String literal; - private JTestItemTypeEnum(String literal) { - this.literal = literal; - } + private JTestItemTypeEnum(String literal) { + this.literal = literal; + } - @Override - public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); - } + @Override + public Catalog getCatalog() { + return getSchema() == null ? null : getSchema().getCatalog(); + } - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } - @Override - public String getName() { - return "test_item_type_enum"; - } + @Override + public String getName() { + return "test_item_type_enum"; + } - @Override - public String getLiteral() { - return literal; - } + @Override + public String getLiteral() { + return literal; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclClass.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclClass.java deleted file mode 100755 index 96992fa6a..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclClass.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables; - - -import com.epam.ta.reportportal.jooq.Indexes; -import com.epam.ta.reportportal.jooq.JPublic; -import com.epam.ta.reportportal.jooq.Keys; -import com.epam.ta.reportportal.jooq.tables.records.JAclClassRecord; -import java.util.Arrays; -import java.util.List; -import javax.annotation.processing.Generated; -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Index; -import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Row3; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.DSL; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JAclClass extends TableImpl { - - /** - * The reference instance of public.acl_class - */ - public static final JAclClass ACL_CLASS = new JAclClass(); - private static final long serialVersionUID = -211706799; - /** - * The column public.acl_class.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('acl_class_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.acl_class.class. - */ - public final TableField CLASS = createField(DSL.name("class"), - org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - /** - * The column public.acl_class.class_id_type. - */ - public final TableField CLASS_ID_TYPE = createField( - DSL.name("class_id_type"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); - - /** - * Create a public.acl_class table reference - */ - public JAclClass() { - this(DSL.name("acl_class"), null); - } - - /** - * Create an aliased public.acl_class table reference - */ - public JAclClass(String alias) { - this(DSL.name(alias), ACL_CLASS); - } - - /** - * Create an aliased public.acl_class table reference - */ - public JAclClass(Name alias) { - this(alias, ACL_CLASS); - } - - private JAclClass(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JAclClass(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JAclClass(Table child, ForeignKey key) { - super(child, key, ACL_CLASS); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JAclClassRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ACL_CLASS_PKEY, Indexes.UNIQUE_UK_2); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ACL_CLASS; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ACL_CLASS_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ACL_CLASS_PKEY, Keys.UNIQUE_UK_2); - } - - @Override - public JAclClass as(String alias) { - return new JAclClass(DSL.name(alias), this); - } - - @Override - public JAclClass as(Name alias) { - return new JAclClass(alias, this); - } - - /** - * Rename this table - */ - @Override - public JAclClass rename(String name) { - return new JAclClass(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JAclClass rename(Name name) { - return new JAclClass(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclEntry.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclEntry.java deleted file mode 100644 index 78c4cd6c9..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclEntry.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables; - - -import com.epam.ta.reportportal.jooq.Indexes; -import com.epam.ta.reportportal.jooq.JPublic; -import com.epam.ta.reportportal.jooq.Keys; -import com.epam.ta.reportportal.jooq.tables.records.JAclEntryRecord; -import java.util.Arrays; -import java.util.List; -import javax.annotation.processing.Generated; -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Index; -import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Row8; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.DSL; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JAclEntry extends TableImpl { - - /** - * The reference instance of public.acl_entry - */ - public static final JAclEntry ACL_ENTRY = new JAclEntry(); - private static final long serialVersionUID = 300624344; - /** - * The column public.acl_entry.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('acl_entry_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.acl_entry.acl_object_identity. - */ - public final TableField ACL_OBJECT_IDENTITY = createField( - DSL.name("acl_object_identity"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.acl_entry.ace_order. - */ - public final TableField ACE_ORDER = createField(DSL.name("ace_order"), - org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - /** - * The column public.acl_entry.sid. - */ - public final TableField SID = createField(DSL.name("sid"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.acl_entry.mask. - */ - public final TableField MASK = createField(DSL.name("mask"), - org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - /** - * The column public.acl_entry.granting. - */ - public final TableField GRANTING = createField(DSL.name("granting"), - org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - /** - * The column public.acl_entry.audit_success. - */ - public final TableField AUDIT_SUCCESS = createField( - DSL.name("audit_success"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - /** - * The column public.acl_entry.audit_failure. - */ - public final TableField AUDIT_FAILURE = createField( - DSL.name("audit_failure"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - - /** - * Create a public.acl_entry table reference - */ - public JAclEntry() { - this(DSL.name("acl_entry"), null); - } - - /** - * Create an aliased public.acl_entry table reference - */ - public JAclEntry(String alias) { - this(DSL.name(alias), ACL_ENTRY); - } - - /** - * Create an aliased public.acl_entry table reference - */ - public JAclEntry(Name alias) { - this(alias, ACL_ENTRY); - } - - private JAclEntry(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JAclEntry(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JAclEntry(Table child, ForeignKey key) { - super(child, key, ACL_ENTRY); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JAclEntryRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ACL_ENTRY_PKEY, Indexes.UNIQUE_UK_4); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ACL_ENTRY; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ACL_ENTRY_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ACL_ENTRY_PKEY, Keys.UNIQUE_UK_4); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ACL_ENTRY__FOREIGN_FK_4, - Keys.ACL_ENTRY__FOREIGN_FK_5); - } - - public JAclObjectIdentity aclObjectIdentity() { - return new JAclObjectIdentity(this, Keys.ACL_ENTRY__FOREIGN_FK_4); - } - - public JAclSid aclSid() { - return new JAclSid(this, Keys.ACL_ENTRY__FOREIGN_FK_5); - } - - @Override - public JAclEntry as(String alias) { - return new JAclEntry(DSL.name(alias), this); - } - - @Override - public JAclEntry as(Name alias) { - return new JAclEntry(alias, this); - } - - /** - * Rename this table - */ - @Override - public JAclEntry rename(String name) { - return new JAclEntry(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JAclEntry rename(Name name) { - return new JAclEntry(name, null); - } - - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclObjectIdentity.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclObjectIdentity.java deleted file mode 100755 index e31fd8c41..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclObjectIdentity.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables; - - -import com.epam.ta.reportportal.jooq.Indexes; -import com.epam.ta.reportportal.jooq.JPublic; -import com.epam.ta.reportportal.jooq.Keys; -import com.epam.ta.reportportal.jooq.tables.records.JAclObjectIdentityRecord; -import java.util.Arrays; -import java.util.List; -import javax.annotation.processing.Generated; -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Index; -import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Row6; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.DSL; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JAclObjectIdentity extends TableImpl { - - /** - * The reference instance of public.acl_object_identity - */ - public static final JAclObjectIdentity ACL_OBJECT_IDENTITY = new JAclObjectIdentity(); - private static final long serialVersionUID = -275800054; - /** - * The column public.acl_object_identity.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('acl_object_identity_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.acl_object_identity.object_id_class. - */ - public final TableField OBJECT_ID_CLASS = createField( - DSL.name("object_id_class"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.acl_object_identity.object_id_identity. - */ - public final TableField OBJECT_ID_IDENTITY = createField( - DSL.name("object_id_identity"), org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, - ""); - /** - * The column public.acl_object_identity.parent_object. - */ - public final TableField PARENT_OBJECT = createField( - DSL.name("parent_object"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.acl_object_identity.owner_sid. - */ - public final TableField OWNER_SID = createField( - DSL.name("owner_sid"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.acl_object_identity.entries_inheriting. - */ - public final TableField ENTRIES_INHERITING = createField( - DSL.name("entries_inheriting"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - - /** - * Create a public.acl_object_identity table reference - */ - public JAclObjectIdentity() { - this(DSL.name("acl_object_identity"), null); - } - - /** - * Create an aliased public.acl_object_identity table reference - */ - public JAclObjectIdentity(String alias) { - this(DSL.name(alias), ACL_OBJECT_IDENTITY); - } - - /** - * Create an aliased public.acl_object_identity table reference - */ - public JAclObjectIdentity(Name alias) { - this(alias, ACL_OBJECT_IDENTITY); - } - - private JAclObjectIdentity(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JAclObjectIdentity(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JAclObjectIdentity(Table child, - ForeignKey key) { - super(child, key, ACL_OBJECT_IDENTITY); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JAclObjectIdentityRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ACL_OBJECT_IDENTITY_PKEY, Indexes.UNIQUE_UK_3); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ACL_OBJECT_IDENTITY; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ACL_OBJECT_IDENTITY_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ACL_OBJECT_IDENTITY_PKEY, - Keys.UNIQUE_UK_3); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_2, Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_1, - Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_3); - } - - public JAclClass aclClass() { - return new JAclClass(this, Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_2); - } - - public com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity aclObjectIdentity() { - return new com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity(this, - Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_1); - } - - public JAclSid aclSid() { - return new JAclSid(this, Keys.ACL_OBJECT_IDENTITY__FOREIGN_FK_3); - } - - @Override - public JAclObjectIdentity as(String alias) { - return new JAclObjectIdentity(DSL.name(alias), this); - } - - @Override - public JAclObjectIdentity as(Name alias) { - return new JAclObjectIdentity(alias, this); - } - - /** - * Rename this table - */ - @Override - public JAclObjectIdentity rename(String name) { - return new JAclObjectIdentity(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JAclObjectIdentity rename(Name name) { - return new JAclObjectIdentity(name, null); - } - - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclSid.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclSid.java deleted file mode 100644 index 6d0aa4d75..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAclSid.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables; - - -import com.epam.ta.reportportal.jooq.Indexes; -import com.epam.ta.reportportal.jooq.JPublic; -import com.epam.ta.reportportal.jooq.Keys; -import com.epam.ta.reportportal.jooq.tables.records.JAclSidRecord; -import java.util.Arrays; -import java.util.List; -import javax.annotation.processing.Generated; -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Index; -import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Row3; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.DSL; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JAclSid extends TableImpl { - - /** - * The reference instance of public.acl_sid - */ - public static final JAclSid ACL_SID = new JAclSid(); - private static final long serialVersionUID = 1699356761; - /** - * The column public.acl_sid.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('acl_sid_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.acl_sid.principal. - */ - public final TableField PRINCIPAL = createField(DSL.name("principal"), - org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - /** - * The column public.acl_sid.sid. - */ - public final TableField SID = createField(DSL.name("sid"), - org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - - /** - * Create a public.acl_sid table reference - */ - public JAclSid() { - this(DSL.name("acl_sid"), null); - } - - /** - * Create an aliased public.acl_sid table reference - */ - public JAclSid(String alias) { - this(DSL.name(alias), ACL_SID); - } - - /** - * Create an aliased public.acl_sid table reference - */ - public JAclSid(Name alias) { - this(alias, ACL_SID); - } - - private JAclSid(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JAclSid(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JAclSid(Table child, ForeignKey key) { - super(child, key, ACL_SID); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JAclSidRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ACL_SID_IDX, Indexes.ACL_SID_PKEY, Indexes.UNIQUE_UK_1); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ACL_SID; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ACL_SID_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ACL_SID_PKEY, Keys.UNIQUE_UK_1); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ACL_SID__ACL_SID_SID_FKEY); - } - - public JUsers users() { - return new JUsers(this, Keys.ACL_SID__ACL_SID_SID_FKEY); - } - - @Override - public JAclSid as(String alias) { - return new JAclSid(DSL.name(alias), this); - } - - @Override - public JAclSid as(Name alias) { - return new JAclSid(alias, this); - } - - /** - * Rename this table - */ - @Override - public JAclSid rename(String name) { - return new JAclSid(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JAclSid rename(Name name) { - return new JAclSid(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JActivity.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JActivity.java old mode 100755 new mode 100644 index a825ce21f..f837a1059 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JActivity.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JActivity.java @@ -8,10 +8,13 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JActivityRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -38,175 +41,172 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JActivity extends TableImpl { - /** - * The reference instance of public.activity - */ - public static final JActivity ACTIVITY = new JActivity(); - private static final long serialVersionUID = 152202898; - /** - * The column public.activity.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('activity_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.activity.user_id. - */ - public final TableField USER_ID = createField(DSL.name("user_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.activity.username. - */ - public final TableField USERNAME = createField(DSL.name("username"), - org.jooq.impl.SQLDataType.VARCHAR, this, ""); - /** - * The column public.activity.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.activity.entity. - */ - public final TableField ENTITY = createField(DSL.name("entity"), - org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - /** - * The column public.activity.action. - */ - public final TableField ACTION = createField(DSL.name("action"), - org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - /** - * The column public.activity.details. - */ - public final TableField DETAILS = createField(DSL.name("details"), - org.jooq.impl.SQLDataType.JSONB, this, ""); - /** - * The column public.activity.creation_date. - */ - public final TableField CREATION_DATE = createField( - DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - /** - * The column public.activity.object_id. - */ - public final TableField OBJECT_ID = createField(DSL.name("object_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * Create a public.activity table reference - */ - public JActivity() { - this(DSL.name("activity"), null); - } - - /** - * Create an aliased public.activity table reference - */ - public JActivity(String alias) { - this(DSL.name(alias), ACTIVITY); - } - - /** - * Create an aliased public.activity table reference - */ - public JActivity(Name alias) { - this(alias, ACTIVITY); - } - - private JActivity(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JActivity(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JActivity(Table child, ForeignKey key) { - super(child, key, ACTIVITY); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JActivityRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ACTIVITY_CREATION_DATE_IDX, Indexes.ACTIVITY_OBJECT_IDX, - Indexes.ACTIVITY_PK, Indexes.ACTIVITY_PROJECT_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ACTIVITY; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ACTIVITY_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ACTIVITY_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ACTIVITY__ACTIVITY_USER_ID_FKEY, - Keys.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY); - } - - public JUsers users() { - return new JUsers(this, Keys.ACTIVITY__ACTIVITY_USER_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY); - } - - @Override - public JActivity as(String alias) { - return new JActivity(DSL.name(alias), this); - } - - @Override - public JActivity as(Name alias) { - return new JActivity(alias, this); - } - - /** - * Rename this table - */ - @Override - public JActivity rename(String name) { - return new JActivity(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JActivity rename(Name name) { - return new JActivity(name, null); - } - - // ------------------------------------------------------------------------- - // Row9 type methods - // ------------------------------------------------------------------------- - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } + private static final long serialVersionUID = 152202898; + + /** + * The reference instance of public.activity + */ + public static final JActivity ACTIVITY = new JActivity(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JActivityRecord.class; + } + + /** + * The column public.activity.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('activity_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.activity.user_id. + */ + public final TableField USER_ID = createField(DSL.name("user_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.activity.username. + */ + public final TableField USERNAME = createField(DSL.name("username"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * The column public.activity.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.activity.entity. + */ + public final TableField ENTITY = createField(DSL.name("entity"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); + + /** + * The column public.activity.action. + */ + public final TableField ACTION = createField(DSL.name("action"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); + + /** + * The column public.activity.details. + */ + public final TableField DETAILS = createField(DSL.name("details"), org.jooq.impl.SQLDataType.JSONB, this, ""); + + /** + * The column public.activity.creation_date. + */ + public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * The column public.activity.object_id. + */ + public final TableField OBJECT_ID = createField(DSL.name("object_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * Create a public.activity table reference + */ + public JActivity() { + this(DSL.name("activity"), null); + } + + /** + * Create an aliased public.activity table reference + */ + public JActivity(String alias) { + this(DSL.name(alias), ACTIVITY); + } + + /** + * Create an aliased public.activity table reference + */ + public JActivity(Name alias) { + this(alias, ACTIVITY); + } + + private JActivity(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JActivity(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JActivity(Table child, ForeignKey key) { + super(child, key, ACTIVITY); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ACTIVITY_CREATION_DATE_IDX, Indexes.ACTIVITY_OBJECT_IDX, Indexes.ACTIVITY_PK, Indexes.ACTIVITY_PROJECT_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ACTIVITY; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ACTIVITY_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ACTIVITY_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ACTIVITY__ACTIVITY_USER_ID_FKEY, Keys.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY); + } + + public JUsers users() { + return new JUsers(this, Keys.ACTIVITY__ACTIVITY_USER_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY); + } + + @Override + public JActivity as(String alias) { + return new JActivity(DSL.name(alias), this); + } + + @Override + public JActivity as(Name alias) { + return new JActivity(alias, this); + } + + /** + * Rename this table + */ + @Override + public JActivity rename(String name) { + return new JActivity(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JActivity rename(Name name) { + return new JActivity(name, null); + } + + // ------------------------------------------------------------------------- + // Row9 type methods + // ------------------------------------------------------------------------- + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JApiKeys.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JApiKeys.java new file mode 100644 index 000000000..adbca4ae9 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JApiKeys.java @@ -0,0 +1,187 @@ +/* + * This file is generated by jOOQ. + */ +package com.epam.ta.reportportal.jooq.tables; + + +import com.epam.ta.reportportal.jooq.Indexes; +import com.epam.ta.reportportal.jooq.JPublic; +import com.epam.ta.reportportal.jooq.Keys; +import com.epam.ta.reportportal.jooq.tables.records.JApiKeysRecord; + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row5; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.4" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JApiKeys extends TableImpl { + + private static final long serialVersionUID = 1459363165; + + /** + * The reference instance of public.api_keys + */ + public static final JApiKeys API_KEYS = new JApiKeys(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JApiKeysRecord.class; + } + + /** + * The column public.api_keys.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('api_keys_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.api_keys.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); + + /** + * The column public.api_keys.hash. + */ + public final TableField HASH = createField(DSL.name("hash"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); + + /** + * The column public.api_keys.created_at. + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * The column public.api_keys.user_id. + */ + public final TableField USER_ID = createField(DSL.name("user_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * Create a public.api_keys table reference + */ + public JApiKeys() { + this(DSL.name("api_keys"), null); + } + + /** + * Create an aliased public.api_keys table reference + */ + public JApiKeys(String alias) { + this(DSL.name(alias), API_KEYS); + } + + /** + * Create an aliased public.api_keys table reference + */ + public JApiKeys(Name alias) { + this(alias, API_KEYS); + } + + private JApiKeys(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JApiKeys(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JApiKeys(Table child, ForeignKey key) { + super(child, key, API_KEYS); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.API_KEYS_PKEY, Indexes.HASH_API_KEYS_IDX, Indexes.USERS_API_KEYS_UNIQUE); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_API_KEYS; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.API_KEYS_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.API_KEYS_PKEY, Keys.USERS_API_KEYS_UNIQUE); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.API_KEYS__API_KEYS_USER_ID_FKEY); + } + + public JUsers users() { + return new JUsers(this, Keys.API_KEYS__API_KEYS_USER_ID_FKEY); + } + + @Override + public JApiKeys as(String alias) { + return new JApiKeys(DSL.name(alias), this); + } + + @Override + public JApiKeys as(Name alias) { + return new JApiKeys(alias, this); + } + + /** + * Rename this table + */ + @Override + public JApiKeys rename(String name) { + return new JApiKeys(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JApiKeys rename(Name name) { + return new JApiKeys(name, null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } +} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java index e3b277c5f..17b911178 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java @@ -8,10 +8,13 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JAttachmentRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -37,163 +40,159 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JAttachment extends TableImpl { - /** - * The reference instance of public.attachment - */ - public static final JAttachment ATTACHMENT = new JAttachment(); - private static final long serialVersionUID = -1988681978; - /** - * The column public.attachment.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('attachment_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.attachment.file_id. - */ - public final TableField FILE_ID = createField(DSL.name("file_id"), - org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); - /** - * The column public.attachment.thumbnail_id. - */ - public final TableField THUMBNAIL_ID = createField( - DSL.name("thumbnail_id"), org.jooq.impl.SQLDataType.CLOB, this, ""); - /** - * The column public.attachment.content_type. - */ - public final TableField CONTENT_TYPE = createField( - DSL.name("content_type"), org.jooq.impl.SQLDataType.CLOB, this, ""); - /** - * The column public.attachment.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.attachment.launch_id. - */ - public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.attachment.item_id. - */ - public final TableField ITEM_ID = createField(DSL.name("item_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.attachment.file_size. - */ - public final TableField FILE_SIZE = createField(DSL.name("file_size"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false) - .defaultValue(org.jooq.impl.DSL.field("0", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.attachment.creation_date. - */ - public final TableField CREATION_DATE = createField( - DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - - /** - * Create a public.attachment table reference - */ - public JAttachment() { - this(DSL.name("attachment"), null); - } - - /** - * Create an aliased public.attachment table reference - */ - public JAttachment(String alias) { - this(DSL.name(alias), ATTACHMENT); - } - - /** - * Create an aliased public.attachment table reference - */ - public JAttachment(Name alias) { - this(alias, ATTACHMENT); - } - - private JAttachment(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JAttachment(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JAttachment(Table child, ForeignKey key) { - super(child, key, ATTACHMENT); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JAttachmentRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ATT_ITEM_IDX, Indexes.ATT_LAUNCH_IDX, - Indexes.ATT_PROJECT_IDX, Indexes.ATTACHMENT_PK, - Indexes.ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ATTACHMENT; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ATTACHMENT_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ATTACHMENT_PK); - } - - @Override - public JAttachment as(String alias) { - return new JAttachment(DSL.name(alias), this); - } - - @Override - public JAttachment as(Name alias) { - return new JAttachment(alias, this); - } - - /** - * Rename this table - */ - @Override - public JAttachment rename(String name) { - return new JAttachment(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JAttachment rename(Name name) { - return new JAttachment(name, null); - } - - // ------------------------------------------------------------------------- - // Row9 type methods - // ------------------------------------------------------------------------- - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } + private static final long serialVersionUID = -1988681978; + + /** + * The reference instance of public.attachment + */ + public static final JAttachment ATTACHMENT = new JAttachment(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JAttachmentRecord.class; + } + + /** + * The column public.attachment.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('attachment_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.attachment.file_id. + */ + public final TableField FILE_ID = createField(DSL.name("file_id"), org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column public.attachment.thumbnail_id. + */ + public final TableField THUMBNAIL_ID = createField(DSL.name("thumbnail_id"), org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column public.attachment.content_type. + */ + public final TableField CONTENT_TYPE = createField(DSL.name("content_type"), org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column public.attachment.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.attachment.launch_id. + */ + public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.attachment.item_id. + */ + public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.attachment.file_size. + */ + public final TableField FILE_SIZE = createField(DSL.name("file_size"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("0", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.attachment.creation_date. + */ + public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * Create a public.attachment table reference + */ + public JAttachment() { + this(DSL.name("attachment"), null); + } + + /** + * Create an aliased public.attachment table reference + */ + public JAttachment(String alias) { + this(DSL.name(alias), ATTACHMENT); + } + + /** + * Create an aliased public.attachment table reference + */ + public JAttachment(Name alias) { + this(alias, ATTACHMENT); + } + + private JAttachment(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JAttachment(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JAttachment(Table child, ForeignKey key) { + super(child, key, ATTACHMENT); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ATT_ITEM_IDX, Indexes.ATT_LAUNCH_IDX, Indexes.ATT_PROJECT_IDX, Indexes.ATTACHMENT_PK, Indexes.ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ATTACHMENT; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ATTACHMENT_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ATTACHMENT_PK); + } + + @Override + public JAttachment as(String alias) { + return new JAttachment(DSL.name(alias), this); + } + + @Override + public JAttachment as(Name alias) { + return new JAttachment(alias, this); + } + + /** + * Rename this table + */ + @Override + public JAttachment rename(String name) { + return new JAttachment(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JAttachment rename(Name name) { + return new JAttachment(name, null); + } + + // ------------------------------------------------------------------------- + // Row9 type methods + // ------------------------------------------------------------------------- + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachmentDeletion.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachmentDeletion.java index 669301225..6d09bc3a2 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachmentDeletion.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachmentDeletion.java @@ -8,10 +8,13 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JAttachmentDeletionRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -36,135 +39,134 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JAttachmentDeletion extends TableImpl { - /** - * The reference instance of public.attachment_deletion - */ - public static final JAttachmentDeletion ATTACHMENT_DELETION = new JAttachmentDeletion(); - private static final long serialVersionUID = -2120808493; - /** - * The column public.attachment_deletion.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.attachment_deletion.file_id. - */ - public final TableField FILE_ID = createField( - DSL.name("file_id"), org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); - /** - * The column public.attachment_deletion.thumbnail_id. - */ - public final TableField THUMBNAIL_ID = createField( - DSL.name("thumbnail_id"), org.jooq.impl.SQLDataType.CLOB, this, ""); - /** - * The column public.attachment_deletion.creation_attachment_date. - */ - public final TableField CREATION_ATTACHMENT_DATE = createField( - DSL.name("creation_attachment_date"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - /** - * The column public.attachment_deletion.deletion_date. - */ - public final TableField DELETION_DATE = createField( - DSL.name("deletion_date"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * Create a public.attachment_deletion table reference - */ - public JAttachmentDeletion() { - this(DSL.name("attachment_deletion"), null); - } - - /** - * Create an aliased public.attachment_deletion table reference - */ - public JAttachmentDeletion(String alias) { - this(DSL.name(alias), ATTACHMENT_DELETION); - } - - /** - * Create an aliased public.attachment_deletion table reference - */ - public JAttachmentDeletion(Name alias) { - this(alias, ATTACHMENT_DELETION); - } - - private JAttachmentDeletion(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JAttachmentDeletion(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JAttachmentDeletion(Table child, - ForeignKey key) { - super(child, key, ATTACHMENT_DELETION); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JAttachmentDeletionRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ATTACHMENT_DELETION_PKEY); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ATTACHMENT_DELETION_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ATTACHMENT_DELETION_PKEY); - } - - @Override - public JAttachmentDeletion as(String alias) { - return new JAttachmentDeletion(DSL.name(alias), this); - } - - @Override - public JAttachmentDeletion as(Name alias) { - return new JAttachmentDeletion(alias, this); - } - - /** - * Rename this table - */ - @Override - public JAttachmentDeletion rename(String name) { - return new JAttachmentDeletion(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JAttachmentDeletion rename(Name name) { - return new JAttachmentDeletion(name, null); - } - - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } + private static final long serialVersionUID = -2120808493; + + /** + * The reference instance of public.attachment_deletion + */ + public static final JAttachmentDeletion ATTACHMENT_DELETION = new JAttachmentDeletion(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JAttachmentDeletionRecord.class; + } + + /** + * The column public.attachment_deletion.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.attachment_deletion.file_id. + */ + public final TableField FILE_ID = createField(DSL.name("file_id"), org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column public.attachment_deletion.thumbnail_id. + */ + public final TableField THUMBNAIL_ID = createField(DSL.name("thumbnail_id"), org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column public.attachment_deletion.creation_attachment_date. + */ + public final TableField CREATION_ATTACHMENT_DATE = createField(DSL.name("creation_attachment_date"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + + /** + * The column public.attachment_deletion.deletion_date. + */ + public final TableField DELETION_DATE = createField(DSL.name("deletion_date"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + + /** + * Create a public.attachment_deletion table reference + */ + public JAttachmentDeletion() { + this(DSL.name("attachment_deletion"), null); + } + + /** + * Create an aliased public.attachment_deletion table reference + */ + public JAttachmentDeletion(String alias) { + this(DSL.name(alias), ATTACHMENT_DELETION); + } + + /** + * Create an aliased public.attachment_deletion table reference + */ + public JAttachmentDeletion(Name alias) { + this(alias, ATTACHMENT_DELETION); + } + + private JAttachmentDeletion(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JAttachmentDeletion(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JAttachmentDeletion(Table child, ForeignKey key) { + super(child, key, ATTACHMENT_DELETION); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ATTACHMENT_DELETION_PKEY); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ATTACHMENT_DELETION_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ATTACHMENT_DELETION_PKEY); + } + + @Override + public JAttachmentDeletion as(String alias) { + return new JAttachmentDeletion(DSL.name(alias), this); + } + + @Override + public JAttachmentDeletion as(Name alias) { + return new JAttachmentDeletion(alias, this); + } + + /** + * Rename this table + */ + @Override + public JAttachmentDeletion rename(String name) { + return new JAttachmentDeletion(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JAttachmentDeletion rename(Name name) { + return new JAttachmentDeletion(name, null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttribute.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttribute.java old mode 100755 new mode 100644 index 8cb82c402..547091d40 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttribute.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttribute.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JAttributeRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -36,125 +39,124 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JAttribute extends TableImpl { - /** - * The reference instance of public.attribute - */ - public static final JAttribute ATTRIBUTE = new JAttribute(); - private static final long serialVersionUID = -720380676; - /** - * The column public.attribute.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('attribute_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.attribute.name. - */ - public final TableField NAME = createField(DSL.name("name"), - org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * Create a public.attribute table reference - */ - public JAttribute() { - this(DSL.name("attribute"), null); - } - - /** - * Create an aliased public.attribute table reference - */ - public JAttribute(String alias) { - this(DSL.name(alias), ATTRIBUTE); - } - - /** - * Create an aliased public.attribute table reference - */ - public JAttribute(Name alias) { - this(alias, ATTRIBUTE); - } - - private JAttribute(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JAttribute(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JAttribute(Table child, ForeignKey key) { - super(child, key, ATTRIBUTE); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JAttributeRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ATTRIBUTE_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ATTRIBUTE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ATTRIBUTE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ATTRIBUTE_PK); - } - - @Override - public JAttribute as(String alias) { - return new JAttribute(DSL.name(alias), this); - } - - @Override - public JAttribute as(Name alias) { - return new JAttribute(alias, this); - } - - /** - * Rename this table - */ - @Override - public JAttribute rename(String name) { - return new JAttribute(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JAttribute rename(Name name) { - return new JAttribute(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + private static final long serialVersionUID = -720380676; + + /** + * The reference instance of public.attribute + */ + public static final JAttribute ATTRIBUTE = new JAttribute(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JAttributeRecord.class; + } + + /** + * The column public.attribute.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('attribute_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.attribute.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + + /** + * Create a public.attribute table reference + */ + public JAttribute() { + this(DSL.name("attribute"), null); + } + + /** + * Create an aliased public.attribute table reference + */ + public JAttribute(String alias) { + this(DSL.name(alias), ATTRIBUTE); + } + + /** + * Create an aliased public.attribute table reference + */ + public JAttribute(Name alias) { + this(alias, ATTRIBUTE); + } + + private JAttribute(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JAttribute(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JAttribute(Table child, ForeignKey key) { + super(child, key, ATTRIBUTE); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ATTRIBUTE_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ATTRIBUTE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ATTRIBUTE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ATTRIBUTE_PK); + } + + @Override + public JAttribute as(String alias) { + return new JAttribute(DSL.name(alias), this); + } + + @Override + public JAttribute as(Name alias) { + return new JAttribute(alias, this); + } + + /** + * Rename this table + */ + @Override + public JAttribute rename(String name) { + return new JAttribute(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JAttribute rename(Name name) { + return new JAttribute(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JClusters.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JClusters.java index 9697adcb3..5d8ab0c83 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JClusters.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JClusters.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JClustersRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -36,141 +39,139 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JClusters extends TableImpl { - /** - * The reference instance of public.clusters - */ - public static final JClusters CLUSTERS = new JClusters(); - private static final long serialVersionUID = -1432286641; - /** - * The column public.clusters.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('clusters_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.clusters.index_id. - */ - public final TableField INDEX_ID = createField(DSL.name("index_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.clusters.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.clusters.launch_id. - */ - public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.clusters.message. - */ - public final TableField MESSAGE = createField(DSL.name("message"), - org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); - - /** - * Create a public.clusters table reference - */ - public JClusters() { - this(DSL.name("clusters"), null); - } - - /** - * Create an aliased public.clusters table reference - */ - public JClusters(String alias) { - this(DSL.name(alias), CLUSTERS); - } - - /** - * Create an aliased public.clusters table reference - */ - public JClusters(Name alias) { - this(alias, CLUSTERS); - } - - private JClusters(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JClusters(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JClusters(Table child, ForeignKey key) { - super(child, key, CLUSTERS); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JClustersRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.CLUSTER_INDEX_ID_IDX, Indexes.CLUSTER_LAUNCH_IDX, - Indexes.CLUSTER_PROJECT_IDX, Indexes.CLUSTERS_PK, Indexes.INDEX_ID_LAUNCH_ID_UNQ); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_CLUSTERS; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.CLUSTERS_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.CLUSTERS_PK, Keys.INDEX_ID_LAUNCH_ID_UNQ); - } - - @Override - public JClusters as(String alias) { - return new JClusters(DSL.name(alias), this); - } - - @Override - public JClusters as(Name alias) { - return new JClusters(alias, this); - } - - /** - * Rename this table - */ - @Override - public JClusters rename(String name) { - return new JClusters(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JClusters rename(Name name) { - return new JClusters(name, null); - } - - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } + private static final long serialVersionUID = -1432286641; + + /** + * The reference instance of public.clusters + */ + public static final JClusters CLUSTERS = new JClusters(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JClustersRecord.class; + } + + /** + * The column public.clusters.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('clusters_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.clusters.index_id. + */ + public final TableField INDEX_ID = createField(DSL.name("index_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.clusters.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.clusters.launch_id. + */ + public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.clusters.message. + */ + public final TableField MESSAGE = createField(DSL.name("message"), org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * Create a public.clusters table reference + */ + public JClusters() { + this(DSL.name("clusters"), null); + } + + /** + * Create an aliased public.clusters table reference + */ + public JClusters(String alias) { + this(DSL.name(alias), CLUSTERS); + } + + /** + * Create an aliased public.clusters table reference + */ + public JClusters(Name alias) { + this(alias, CLUSTERS); + } + + private JClusters(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JClusters(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JClusters(Table child, ForeignKey key) { + super(child, key, CLUSTERS); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.CLUSTER_INDEX_ID_IDX, Indexes.CLUSTER_LAUNCH_IDX, Indexes.CLUSTER_PROJECT_IDX, Indexes.CLUSTERS_PK, Indexes.INDEX_ID_LAUNCH_ID_UNQ); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_CLUSTERS; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.CLUSTERS_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.CLUSTERS_PK, Keys.INDEX_ID_LAUNCH_ID_UNQ); + } + + @Override + public JClusters as(String alias) { + return new JClusters(DSL.name(alias), this); + } + + @Override + public JClusters as(Name alias) { + return new JClusters(alias, this); + } + + /** + * Rename this table + */ + @Override + public JClusters rename(String name) { + return new JClusters(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JClusters rename(Name name) { + return new JClusters(name, null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JClustersTestItem.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JClustersTestItem.java index add77055e..98498d548 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JClustersTestItem.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JClustersTestItem.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JClustersTestItemRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -35,116 +38,114 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JClustersTestItem extends TableImpl { - /** - * The reference instance of public.clusters_test_item - */ - public static final JClustersTestItem CLUSTERS_TEST_ITEM = new JClustersTestItem(); - private static final long serialVersionUID = -1374737681; - /** - * The column public.clusters_test_item.cluster_id. - */ - public final TableField CLUSTER_ID = createField( - DSL.name("cluster_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.clusters_test_item.item_id. - */ - public final TableField ITEM_ID = createField(DSL.name("item_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.clusters_test_item table reference - */ - public JClustersTestItem() { - this(DSL.name("clusters_test_item"), null); - } - - /** - * Create an aliased public.clusters_test_item table reference - */ - public JClustersTestItem(String alias) { - this(DSL.name(alias), CLUSTERS_TEST_ITEM); - } - - /** - * Create an aliased public.clusters_test_item table reference - */ - public JClustersTestItem(Name alias) { - this(alias, CLUSTERS_TEST_ITEM); - } - - private JClustersTestItem(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JClustersTestItem(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JClustersTestItem(Table child, - ForeignKey key) { - super(child, key, CLUSTERS_TEST_ITEM); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JClustersTestItemRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.CLUSTER_ITEM_CLUSTER_IDX, Indexes.CLUSTER_ITEM_ITEM_IDX, - Indexes.CLUSTER_ITEM_UNQ); - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.CLUSTER_ITEM_UNQ); - } - - @Override - public JClustersTestItem as(String alias) { - return new JClustersTestItem(DSL.name(alias), this); - } - - @Override - public JClustersTestItem as(Name alias) { - return new JClustersTestItem(alias, this); - } - - /** - * Rename this table - */ - @Override - public JClustersTestItem rename(String name) { - return new JClustersTestItem(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JClustersTestItem rename(Name name) { - return new JClustersTestItem(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + private static final long serialVersionUID = -1374737681; + + /** + * The reference instance of public.clusters_test_item + */ + public static final JClustersTestItem CLUSTERS_TEST_ITEM = new JClustersTestItem(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JClustersTestItemRecord.class; + } + + /** + * The column public.clusters_test_item.cluster_id. + */ + public final TableField CLUSTER_ID = createField(DSL.name("cluster_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.clusters_test_item.item_id. + */ + public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.clusters_test_item table reference + */ + public JClustersTestItem() { + this(DSL.name("clusters_test_item"), null); + } + + /** + * Create an aliased public.clusters_test_item table reference + */ + public JClustersTestItem(String alias) { + this(DSL.name(alias), CLUSTERS_TEST_ITEM); + } + + /** + * Create an aliased public.clusters_test_item table reference + */ + public JClustersTestItem(Name alias) { + this(alias, CLUSTERS_TEST_ITEM); + } + + private JClustersTestItem(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JClustersTestItem(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JClustersTestItem(Table child, ForeignKey key) { + super(child, key, CLUSTERS_TEST_ITEM); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.CLUSTER_ITEM_CLUSTER_IDX, Indexes.CLUSTER_ITEM_ITEM_IDX, Indexes.CLUSTER_ITEM_UNQ); + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.CLUSTER_ITEM_UNQ); + } + + @Override + public JClustersTestItem as(String alias) { + return new JClustersTestItem(DSL.name(alias), this); + } + + @Override + public JClustersTestItem as(Name alias) { + return new JClustersTestItem(alias, this); + } + + /** + * Rename this table + */ + @Override + public JClustersTestItem rename(String name) { + return new JClustersTestItem(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JClustersTestItem rename(Name name) { + return new JClustersTestItem(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JContentField.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JContentField.java old mode 100755 new mode 100644 index 2753751b0..f180cdba0 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JContentField.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JContentField.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JContentFieldRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -34,118 +37,118 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JContentField extends TableImpl { - /** - * The reference instance of public.content_field - */ - public static final JContentField CONTENT_FIELD = new JContentField(); - private static final long serialVersionUID = 840904857; - /** - * The column public.content_field.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.content_field.field. - */ - public final TableField FIELD = createField(DSL.name("field"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * Create a public.content_field table reference - */ - public JContentField() { - this(DSL.name("content_field"), null); - } - - /** - * Create an aliased public.content_field table reference - */ - public JContentField(String alias) { - this(DSL.name(alias), CONTENT_FIELD); - } - - /** - * Create an aliased public.content_field table reference - */ - public JContentField(Name alias) { - this(alias, CONTENT_FIELD); - } - - private JContentField(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JContentField(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JContentField(Table child, ForeignKey key) { - super(child, key, CONTENT_FIELD); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JContentFieldRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.CONTENT_FIELD_IDX, Indexes.CONTENT_FIELD_WIDGET_IDX); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.CONTENT_FIELD__CONTENT_FIELD_ID_FKEY); - } - - public JWidget widget() { - return new JWidget(this, Keys.CONTENT_FIELD__CONTENT_FIELD_ID_FKEY); - } - - @Override - public JContentField as(String alias) { - return new JContentField(DSL.name(alias), this); - } - - @Override - public JContentField as(Name alias) { - return new JContentField(alias, this); - } - - /** - * Rename this table - */ - @Override - public JContentField rename(String name) { - return new JContentField(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JContentField rename(Name name) { - return new JContentField(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + private static final long serialVersionUID = 840904857; + + /** + * The reference instance of public.content_field + */ + public static final JContentField CONTENT_FIELD = new JContentField(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JContentFieldRecord.class; + } + + /** + * The column public.content_field.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.content_field.field. + */ + public final TableField FIELD = createField(DSL.name("field"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * Create a public.content_field table reference + */ + public JContentField() { + this(DSL.name("content_field"), null); + } + + /** + * Create an aliased public.content_field table reference + */ + public JContentField(String alias) { + this(DSL.name(alias), CONTENT_FIELD); + } + + /** + * Create an aliased public.content_field table reference + */ + public JContentField(Name alias) { + this(alias, CONTENT_FIELD); + } + + private JContentField(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JContentField(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JContentField(Table child, ForeignKey key) { + super(child, key, CONTENT_FIELD); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.CONTENT_FIELD_IDX, Indexes.CONTENT_FIELD_WIDGET_IDX); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.CONTENT_FIELD__CONTENT_FIELD_ID_FKEY); + } + + public JWidget widget() { + return new JWidget(this, Keys.CONTENT_FIELD__CONTENT_FIELD_ID_FKEY); + } + + @Override + public JContentField as(String alias) { + return new JContentField(DSL.name(alias), this); + } + + @Override + public JContentField as(Name alias) { + return new JContentField(alias, this); + } + + /** + * Rename this table + */ + @Override + public JContentField rename(String name) { + return new JContentField(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JContentField rename(Name name) { + return new JContentField(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboard.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboard.java old mode 100755 new mode 100644 index 882c133aa..e0ac7ac8c --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboard.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboard.java @@ -8,10 +8,13 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JDashboardRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -36,139 +39,138 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JDashboard extends TableImpl { - /** - * The reference instance of public.dashboard - */ - public static final JDashboard DASHBOARD = new JDashboard(); - private static final long serialVersionUID = 282960554; - /** - * The column public.dashboard.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.dashboard.name. - */ - public final TableField NAME = createField(DSL.name("name"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.dashboard.description. - */ - public final TableField DESCRIPTION = createField( - DSL.name("description"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - /** - * The column public.dashboard.creation_date. - */ - public final TableField CREATION_DATE = createField( - DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false) - .defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), - this, ""); - - /** - * Create a public.dashboard table reference - */ - public JDashboard() { - this(DSL.name("dashboard"), null); - } - - /** - * Create an aliased public.dashboard table reference - */ - public JDashboard(String alias) { - this(DSL.name(alias), DASHBOARD); - } - - /** - * Create an aliased public.dashboard table reference - */ - public JDashboard(Name alias) { - this(alias, DASHBOARD); - } - - private JDashboard(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JDashboard(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JDashboard(Table child, ForeignKey key) { - super(child, key, DASHBOARD); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JDashboardRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.DASHBOARD_PKEY); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.DASHBOARD_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.DASHBOARD_PKEY); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.DASHBOARD__DASHBOARD_ID_FK); - } - - public JShareableEntity shareableEntity() { - return new JShareableEntity(this, Keys.DASHBOARD__DASHBOARD_ID_FK); - } - - @Override - public JDashboard as(String alias) { - return new JDashboard(DSL.name(alias), this); - } - - @Override - public JDashboard as(Name alias) { - return new JDashboard(alias, this); - } - - /** - * Rename this table - */ - @Override - public JDashboard rename(String name) { - return new JDashboard(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JDashboard rename(Name name) { - return new JDashboard(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + private static final long serialVersionUID = 205291374; + + /** + * The reference instance of public.dashboard + */ + public static final JDashboard DASHBOARD = new JDashboard(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JDashboardRecord.class; + } + + /** + * The column public.dashboard.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.dashboard.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.dashboard.description. + */ + public final TableField DESCRIPTION = createField(DSL.name("description"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * The column public.dashboard.creation_date. + */ + public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * Create a public.dashboard table reference + */ + public JDashboard() { + this(DSL.name("dashboard"), null); + } + + /** + * Create an aliased public.dashboard table reference + */ + public JDashboard(String alias) { + this(DSL.name(alias), DASHBOARD); + } + + /** + * Create an aliased public.dashboard table reference + */ + public JDashboard(Name alias) { + this(alias, DASHBOARD); + } + + private JDashboard(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JDashboard(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JDashboard(Table child, ForeignKey key) { + super(child, key, DASHBOARD); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.DASHBOARD_PKEY); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.DASHBOARD_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.DASHBOARD_PKEY); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.DASHBOARD__DASHBOARD_ID_FK); + } + + public JOwnedEntity ownedEntity() { + return new JOwnedEntity(this, Keys.DASHBOARD__DASHBOARD_ID_FK); + } + + @Override + public JDashboard as(String alias) { + return new JDashboard(DSL.name(alias), this); + } + + @Override + public JDashboard as(Name alias) { + return new JDashboard(alias, this); + } + + /** + * Rename this table + */ + @Override + public JDashboard rename(String name) { + return new JDashboard(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JDashboard rename(Name name) { + return new JDashboard(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboardWidget.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboardWidget.java old mode 100755 new mode 100644 index f2aa7df8e..819422a2e --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboardWidget.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JDashboardWidget.java @@ -8,15 +8,18 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JDashboardWidgetRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row11; +import org.jooq.Row10; import org.jooq.Schema; import org.jooq.Table; import org.jooq.TableField; @@ -35,185 +38,172 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JDashboardWidget extends TableImpl { - /** - * The reference instance of public.dashboard_widget - */ - public static final JDashboardWidget DASHBOARD_WIDGET = new JDashboardWidget(); - private static final long serialVersionUID = -1430378404; - /** - * The column public.dashboard_widget.dashboard_id. - */ - public final TableField DASHBOARD_ID = createField( - DSL.name("dashboard_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.dashboard_widget.widget_id. - */ - public final TableField WIDGET_ID = createField( - DSL.name("widget_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.dashboard_widget.widget_name. - */ - public final TableField WIDGET_NAME = createField( - DSL.name("widget_name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.dashboard_widget.widget_owner. - */ - public final TableField WIDGET_OWNER = createField( - DSL.name("widget_owner"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.dashboard_widget.widget_type. - */ - public final TableField WIDGET_TYPE = createField( - DSL.name("widget_type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.dashboard_widget.widget_width. - */ - public final TableField WIDGET_WIDTH = createField( - DSL.name("widget_width"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - /** - * The column public.dashboard_widget.widget_height. - */ - public final TableField WIDGET_HEIGHT = createField( - DSL.name("widget_height"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - /** - * The column public.dashboard_widget.widget_position_x. - */ - public final TableField WIDGET_POSITION_X = createField( - DSL.name("widget_position_x"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - /** - * The column public.dashboard_widget.widget_position_y. - */ - public final TableField WIDGET_POSITION_Y = createField( - DSL.name("widget_position_y"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - /** - * The column public.dashboard_widget.is_created_on. - */ - public final TableField IS_CREATED_ON = createField( - DSL.name("is_created_on"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false) - .defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, - ""); - /** - * The column public.dashboard_widget.share. - */ - public final TableField SHARE = createField(DSL.name("share"), - org.jooq.impl.SQLDataType.BOOLEAN.nullable(false) - .defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, - ""); - - /** - * Create a public.dashboard_widget table reference - */ - public JDashboardWidget() { - this(DSL.name("dashboard_widget"), null); - } - - /** - * Create an aliased public.dashboard_widget table reference - */ - public JDashboardWidget(String alias) { - this(DSL.name(alias), DASHBOARD_WIDGET); - } - - /** - * Create an aliased public.dashboard_widget table reference - */ - public JDashboardWidget(Name alias) { - this(alias, DASHBOARD_WIDGET); - } - - private JDashboardWidget(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JDashboardWidget(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JDashboardWidget(Table child, - ForeignKey key) { - super(child, key, DASHBOARD_WIDGET); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JDashboardWidgetRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.DASHBOARD_WIDGET_PK, Indexes.WIDGET_ON_DASHBOARD_UNQ); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.DASHBOARD_WIDGET_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.DASHBOARD_WIDGET_PK, - Keys.WIDGET_ON_DASHBOARD_UNQ); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY, - Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY); - } - - public JDashboard dashboard() { - return new JDashboard(this, Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY); - } - - public JWidget widget() { - return new JWidget(this, Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY); - } - - @Override - public JDashboardWidget as(String alias) { - return new JDashboardWidget(DSL.name(alias), this); - } - - @Override - public JDashboardWidget as(Name alias) { - return new JDashboardWidget(alias, this); - } - - /** - * Rename this table - */ - @Override - public JDashboardWidget rename(String name) { - return new JDashboardWidget(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JDashboardWidget rename(Name name) { - return new JDashboardWidget(name, null); - } - - // ------------------------------------------------------------------------- - // Row11 type methods - // ------------------------------------------------------------------------- - - @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); - } + private static final long serialVersionUID = 2110169553; + + /** + * The reference instance of public.dashboard_widget + */ + public static final JDashboardWidget DASHBOARD_WIDGET = new JDashboardWidget(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JDashboardWidgetRecord.class; + } + + /** + * The column public.dashboard_widget.dashboard_id. + */ + public final TableField DASHBOARD_ID = createField(DSL.name("dashboard_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.dashboard_widget.widget_id. + */ + public final TableField WIDGET_ID = createField(DSL.name("widget_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.dashboard_widget.widget_name. + */ + public final TableField WIDGET_NAME = createField(DSL.name("widget_name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.dashboard_widget.widget_owner. + */ + public final TableField WIDGET_OWNER = createField(DSL.name("widget_owner"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.dashboard_widget.widget_type. + */ + public final TableField WIDGET_TYPE = createField(DSL.name("widget_type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.dashboard_widget.widget_width. + */ + public final TableField WIDGET_WIDTH = createField(DSL.name("widget_width"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column public.dashboard_widget.widget_height. + */ + public final TableField WIDGET_HEIGHT = createField(DSL.name("widget_height"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column public.dashboard_widget.widget_position_x. + */ + public final TableField WIDGET_POSITION_X = createField(DSL.name("widget_position_x"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column public.dashboard_widget.widget_position_y. + */ + public final TableField WIDGET_POSITION_Y = createField(DSL.name("widget_position_y"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column public.dashboard_widget.is_created_on. + */ + public final TableField IS_CREATED_ON = createField(DSL.name("is_created_on"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false).defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + + /** + * Create a public.dashboard_widget table reference + */ + public JDashboardWidget() { + this(DSL.name("dashboard_widget"), null); + } + + /** + * Create an aliased public.dashboard_widget table reference + */ + public JDashboardWidget(String alias) { + this(DSL.name(alias), DASHBOARD_WIDGET); + } + + /** + * Create an aliased public.dashboard_widget table reference + */ + public JDashboardWidget(Name alias) { + this(alias, DASHBOARD_WIDGET); + } + + private JDashboardWidget(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JDashboardWidget(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JDashboardWidget(Table child, ForeignKey key) { + super(child, key, DASHBOARD_WIDGET); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.DASHBOARD_WIDGET_PK, Indexes.WIDGET_ON_DASHBOARD_UNQ); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.DASHBOARD_WIDGET_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.DASHBOARD_WIDGET_PK, Keys.WIDGET_ON_DASHBOARD_UNQ); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY, Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY); + } + + public JDashboard dashboard() { + return new JDashboard(this, Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_DASHBOARD_ID_FKEY); + } + + public JWidget widget() { + return new JWidget(this, Keys.DASHBOARD_WIDGET__DASHBOARD_WIDGET_WIDGET_ID_FKEY); + } + + @Override + public JDashboardWidget as(String alias) { + return new JDashboardWidget(DSL.name(alias), this); + } + + @Override + public JDashboardWidget as(Name alias) { + return new JDashboardWidget(alias, this); + } + + /** + * Rename this table + */ + @Override + public JDashboardWidget rename(String name) { + return new JDashboardWidget(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JDashboardWidget rename(Name name) { + return new JDashboardWidget(name, null); + } + + // ------------------------------------------------------------------------- + // Row10 type methods + // ------------------------------------------------------------------------- + + @Override + public Row10 fieldsRow() { + return (Row10) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilter.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilter.java old mode 100755 new mode 100644 index f13b84ebf..fb81da179 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilter.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilter.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JFilterRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -35,137 +38,138 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JFilter extends TableImpl { - /** - * The reference instance of public.filter - */ - public static final JFilter FILTER = new JFilter(); - private static final long serialVersionUID = 991147208; - /** - * The column public.filter.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.filter.name. - */ - public final TableField NAME = createField(DSL.name("name"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.filter.target. - */ - public final TableField TARGET = createField(DSL.name("target"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.filter.description. - */ - public final TableField DESCRIPTION = createField(DSL.name("description"), - org.jooq.impl.SQLDataType.VARCHAR, this, ""); - - /** - * Create a public.filter table reference - */ - public JFilter() { - this(DSL.name("filter"), null); - } - - /** - * Create an aliased public.filter table reference - */ - public JFilter(String alias) { - this(DSL.name(alias), FILTER); - } - - /** - * Create an aliased public.filter table reference - */ - public JFilter(Name alias) { - this(alias, FILTER); - } - - private JFilter(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JFilter(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JFilter(Table child, ForeignKey key) { - super(child, key, FILTER); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JFilterRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.FILTER_PKEY); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.FILTER_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.FILTER_PKEY); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.FILTER__FILTER_ID_FK); - } - - public JShareableEntity shareableEntity() { - return new JShareableEntity(this, Keys.FILTER__FILTER_ID_FK); - } - - @Override - public JFilter as(String alias) { - return new JFilter(DSL.name(alias), this); - } - - @Override - public JFilter as(Name alias) { - return new JFilter(alias, this); - } - - /** - * Rename this table - */ - @Override - public JFilter rename(String name) { - return new JFilter(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JFilter rename(Name name) { - return new JFilter(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + private static final long serialVersionUID = -1242846460; + + /** + * The reference instance of public.filter + */ + public static final JFilter FILTER = new JFilter(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JFilterRecord.class; + } + + /** + * The column public.filter.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.filter.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.filter.target. + */ + public final TableField TARGET = createField(DSL.name("target"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.filter.description. + */ + public final TableField DESCRIPTION = createField(DSL.name("description"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * Create a public.filter table reference + */ + public JFilter() { + this(DSL.name("filter"), null); + } + + /** + * Create an aliased public.filter table reference + */ + public JFilter(String alias) { + this(DSL.name(alias), FILTER); + } + + /** + * Create an aliased public.filter table reference + */ + public JFilter(Name alias) { + this(alias, FILTER); + } + + private JFilter(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JFilter(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JFilter(Table child, ForeignKey key) { + super(child, key, FILTER); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.FILTER_PKEY); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.FILTER_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.FILTER_PKEY); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.FILTER__FILTER_ID_FK); + } + + public JOwnedEntity ownedEntity() { + return new JOwnedEntity(this, Keys.FILTER__FILTER_ID_FK); + } + + @Override + public JFilter as(String alias) { + return new JFilter(DSL.name(alias), this); + } + + @Override + public JFilter as(Name alias) { + return new JFilter(alias, this); + } + + /** + * Rename this table + */ + @Override + public JFilter rename(String name) { + return new JFilter(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JFilter rename(Name name) { + return new JFilter(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterCondition.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterCondition.java index 5008c50af..a37b4c452 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterCondition.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterCondition.java @@ -9,9 +9,12 @@ import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.enums.JFilterConditionEnum; import com.epam.ta.reportportal.jooq.tables.records.JFilterConditionRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -37,159 +40,153 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JFilterCondition extends TableImpl { - /** - * The reference instance of public.filter_condition - */ - public static final JFilterCondition FILTER_CONDITION = new JFilterCondition(); - private static final long serialVersionUID = 1735686331; - /** - * The column public.filter_condition.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('filter_condition_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.filter_condition.filter_id. - */ - public final TableField FILTER_ID = createField( - DSL.name("filter_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.filter_condition.condition. - */ - public final TableField CONDITION = createField( - DSL.name("condition"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false) - .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JFilterConditionEnum.class), this, - ""); - /** - * The column public.filter_condition.value. - */ - public final TableField VALUE = createField(DSL.name("value"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.filter_condition.search_criteria. - */ - public final TableField SEARCH_CRITERIA = createField( - DSL.name("search_criteria"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.filter_condition.negative. - */ - public final TableField NEGATIVE = createField( - DSL.name("negative"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - - /** - * Create a public.filter_condition table reference - */ - public JFilterCondition() { - this(DSL.name("filter_condition"), null); - } - - /** - * Create an aliased public.filter_condition table reference - */ - public JFilterCondition(String alias) { - this(DSL.name(alias), FILTER_CONDITION); - } - - /** - * Create an aliased public.filter_condition table reference - */ - public JFilterCondition(Name alias) { - this(alias, FILTER_CONDITION); - } - - private JFilterCondition(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JFilterCondition(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JFilterCondition(Table child, - ForeignKey key) { - super(child, key, FILTER_CONDITION); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JFilterConditionRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.FILTER_COND_FILTER_IDX, Indexes.FILTER_CONDITION_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_FILTER_CONDITION; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.FILTER_CONDITION_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.FILTER_CONDITION_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY); - } - - public JFilter filter() { - return new JFilter(this, Keys.FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY); - } - - @Override - public JFilterCondition as(String alias) { - return new JFilterCondition(DSL.name(alias), this); - } - - @Override - public JFilterCondition as(Name alias) { - return new JFilterCondition(alias, this); - } - - /** - * Rename this table - */ - @Override - public JFilterCondition rename(String name) { - return new JFilterCondition(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JFilterCondition rename(Name name) { - return new JFilterCondition(name, null); - } - - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } + private static final long serialVersionUID = 1735686331; + + /** + * The reference instance of public.filter_condition + */ + public static final JFilterCondition FILTER_CONDITION = new JFilterCondition(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JFilterConditionRecord.class; + } + + /** + * The column public.filter_condition.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('filter_condition_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.filter_condition.filter_id. + */ + public final TableField FILTER_ID = createField(DSL.name("filter_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.filter_condition.condition. + */ + public final TableField CONDITION = createField(DSL.name("condition"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JFilterConditionEnum.class), this, ""); + + /** + * The column public.filter_condition.value. + */ + public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.filter_condition.search_criteria. + */ + public final TableField SEARCH_CRITERIA = createField(DSL.name("search_criteria"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.filter_condition.negative. + */ + public final TableField NEGATIVE = createField(DSL.name("negative"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); + + /** + * Create a public.filter_condition table reference + */ + public JFilterCondition() { + this(DSL.name("filter_condition"), null); + } + + /** + * Create an aliased public.filter_condition table reference + */ + public JFilterCondition(String alias) { + this(DSL.name(alias), FILTER_CONDITION); + } + + /** + * Create an aliased public.filter_condition table reference + */ + public JFilterCondition(Name alias) { + this(alias, FILTER_CONDITION); + } + + private JFilterCondition(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JFilterCondition(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JFilterCondition(Table child, ForeignKey key) { + super(child, key, FILTER_CONDITION); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.FILTER_COND_FILTER_IDX, Indexes.FILTER_CONDITION_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_FILTER_CONDITION; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.FILTER_CONDITION_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.FILTER_CONDITION_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY); + } + + public JFilter filter() { + return new JFilter(this, Keys.FILTER_CONDITION__FILTER_CONDITION_FILTER_ID_FKEY); + } + + @Override + public JFilterCondition as(String alias) { + return new JFilterCondition(DSL.name(alias), this); + } + + @Override + public JFilterCondition as(Name alias) { + return new JFilterCondition(alias, this); + } + + /** + * Rename this table + */ + @Override + public JFilterCondition rename(String name) { + return new JFilterCondition(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JFilterCondition rename(Name name) { + return new JFilterCondition(name, null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterSort.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterSort.java old mode 100755 new mode 100644 index f42176568..9ceedb7f7 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterSort.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JFilterSort.java @@ -9,9 +9,12 @@ import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.enums.JSortDirectionEnum; import com.epam.ta.reportportal.jooq.tables.records.JFilterSortRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -37,147 +40,143 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JFilterSort extends TableImpl { - /** - * The reference instance of public.filter_sort - */ - public static final JFilterSort FILTER_SORT = new JFilterSort(); - private static final long serialVersionUID = -796123697; - /** - * The column public.filter_sort.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('filter_sort_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.filter_sort.filter_id. - */ - public final TableField FILTER_ID = createField(DSL.name("filter_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.filter_sort.field. - */ - public final TableField FIELD = createField(DSL.name("field"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.filter_sort.direction. - */ - public final TableField DIRECTION = createField( - DSL.name("direction"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).defaultValue( - org.jooq.impl.DSL.field("'ASC'::sort_direction_enum", org.jooq.impl.SQLDataType.VARCHAR)) - .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JSortDirectionEnum.class), this, ""); - - /** - * Create a public.filter_sort table reference - */ - public JFilterSort() { - this(DSL.name("filter_sort"), null); - } - - /** - * Create an aliased public.filter_sort table reference - */ - public JFilterSort(String alias) { - this(DSL.name(alias), FILTER_SORT); - } - - /** - * Create an aliased public.filter_sort table reference - */ - public JFilterSort(Name alias) { - this(alias, FILTER_SORT); - } - - private JFilterSort(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JFilterSort(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JFilterSort(Table child, ForeignKey key) { - super(child, key, FILTER_SORT); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JFilterSortRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.FILTER_SORT_FILTER_IDX, Indexes.FILTER_SORT_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_FILTER_SORT; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.FILTER_SORT_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.FILTER_SORT_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY); - } - - public JFilter filter() { - return new JFilter(this, Keys.FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY); - } - - @Override - public JFilterSort as(String alias) { - return new JFilterSort(DSL.name(alias), this); - } - - @Override - public JFilterSort as(Name alias) { - return new JFilterSort(alias, this); - } - - /** - * Rename this table - */ - @Override - public JFilterSort rename(String name) { - return new JFilterSort(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JFilterSort rename(Name name) { - return new JFilterSort(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + private static final long serialVersionUID = -796123697; + + /** + * The reference instance of public.filter_sort + */ + public static final JFilterSort FILTER_SORT = new JFilterSort(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JFilterSortRecord.class; + } + + /** + * The column public.filter_sort.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('filter_sort_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.filter_sort.filter_id. + */ + public final TableField FILTER_ID = createField(DSL.name("filter_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.filter_sort.field. + */ + public final TableField FIELD = createField(DSL.name("field"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.filter_sort.direction. + */ + public final TableField DIRECTION = createField(DSL.name("direction"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).defaultValue(org.jooq.impl.DSL.field("'ASC'::sort_direction_enum", org.jooq.impl.SQLDataType.VARCHAR)).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JSortDirectionEnum.class), this, ""); + + /** + * Create a public.filter_sort table reference + */ + public JFilterSort() { + this(DSL.name("filter_sort"), null); + } + + /** + * Create an aliased public.filter_sort table reference + */ + public JFilterSort(String alias) { + this(DSL.name(alias), FILTER_SORT); + } + + /** + * Create an aliased public.filter_sort table reference + */ + public JFilterSort(Name alias) { + this(alias, FILTER_SORT); + } + + private JFilterSort(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JFilterSort(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JFilterSort(Table child, ForeignKey key) { + super(child, key, FILTER_SORT); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.FILTER_SORT_FILTER_IDX, Indexes.FILTER_SORT_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_FILTER_SORT; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.FILTER_SORT_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.FILTER_SORT_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY); + } + + public JFilter filter() { + return new JFilter(this, Keys.FILTER_SORT__FILTER_SORT_FILTER_ID_FKEY); + } + + @Override + public JFilterSort as(String alias) { + return new JFilterSort(DSL.name(alias), this); + } + + @Override + public JFilterSort as(Name alias) { + return new JFilterSort(alias, this); + } + + /** + * Rename this table + */ + @Override + public JFilterSort rename(String name) { + return new JFilterSort(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JFilterSort rename(Name name) { + return new JFilterSort(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegration.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegration.java old mode 100755 new mode 100644 index 906be0511..106417a11 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegration.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegration.java @@ -8,10 +8,13 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JIntegrationRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -38,172 +41,167 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JIntegration extends TableImpl { - /** - * The reference instance of public.integration - */ - public static final JIntegration INTEGRATION = new JIntegration(); - private static final long serialVersionUID = 429690557; - /** - * The column public.integration.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('integration_id_seq'::regclass)", - org.jooq.impl.SQLDataType.INTEGER)), this, ""); - /** - * The column public.integration.name. - */ - public final TableField NAME = createField(DSL.name("name"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.integration.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.integration.type. - */ - public final TableField TYPE = createField(DSL.name("type"), - org.jooq.impl.SQLDataType.INTEGER, this, ""); - /** - * The column public.integration.enabled. - */ - public final TableField ENABLED = createField(DSL.name("enabled"), - org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - /** - * The column public.integration.params. - */ - public final TableField PARAMS = createField(DSL.name("params"), - org.jooq.impl.SQLDataType.JSONB, this, ""); - /** - * The column public.integration.creator. - */ - public final TableField CREATOR = createField(DSL.name("creator"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.integration.creation_date. - */ - public final TableField CREATION_DATE = createField( - DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false) - .defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), - this, ""); - - /** - * Create a public.integration table reference - */ - public JIntegration() { - this(DSL.name("integration"), null); - } - - /** - * Create an aliased public.integration table reference - */ - public JIntegration(String alias) { - this(DSL.name(alias), INTEGRATION); - } - - /** - * Create an aliased public.integration table reference - */ - public JIntegration(Name alias) { - this(alias, INTEGRATION); - } - - private JIntegration(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JIntegration(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JIntegration(Table child, ForeignKey key) { - super(child, key, INTEGRATION); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JIntegrationRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.INTEGR_PROJECT_IDX, Indexes.INTEGRATION_PK, - Indexes.UNIQUE_GLOBAL_INTEGRATION_NAME, Indexes.UNIQUE_PROJECT_INTEGRATION_NAME); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_INTEGRATION; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.INTEGRATION_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.INTEGRATION_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.INTEGRATION__INTEGRATION_PROJECT_ID_FKEY, Keys.INTEGRATION__INTEGRATION_TYPE_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.INTEGRATION__INTEGRATION_PROJECT_ID_FKEY); - } - - public JIntegrationType integrationType() { - return new JIntegrationType(this, Keys.INTEGRATION__INTEGRATION_TYPE_FKEY); - } - - @Override - public JIntegration as(String alias) { - return new JIntegration(DSL.name(alias), this); - } - - @Override - public JIntegration as(Name alias) { - return new JIntegration(alias, this); - } - - /** - * Rename this table - */ - @Override - public JIntegration rename(String name) { - return new JIntegration(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JIntegration rename(Name name) { - return new JIntegration(name, null); - } - - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } + private static final long serialVersionUID = 429690557; + + /** + * The reference instance of public.integration + */ + public static final JIntegration INTEGRATION = new JIntegration(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JIntegrationRecord.class; + } + + /** + * The column public.integration.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('integration_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); + + /** + * The column public.integration.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.integration.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.integration.type. + */ + public final TableField TYPE = createField(DSL.name("type"), org.jooq.impl.SQLDataType.INTEGER, this, ""); + + /** + * The column public.integration.enabled. + */ + public final TableField ENABLED = createField(DSL.name("enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); + + /** + * The column public.integration.params. + */ + public final TableField PARAMS = createField(DSL.name("params"), org.jooq.impl.SQLDataType.JSONB, this, ""); + + /** + * The column public.integration.creator. + */ + public final TableField CREATOR = createField(DSL.name("creator"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.integration.creation_date. + */ + public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * Create a public.integration table reference + */ + public JIntegration() { + this(DSL.name("integration"), null); + } + + /** + * Create an aliased public.integration table reference + */ + public JIntegration(String alias) { + this(DSL.name(alias), INTEGRATION); + } + + /** + * Create an aliased public.integration table reference + */ + public JIntegration(Name alias) { + this(alias, INTEGRATION); + } + + private JIntegration(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JIntegration(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JIntegration(Table child, ForeignKey key) { + super(child, key, INTEGRATION); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.INTEGR_PROJECT_IDX, Indexes.INTEGRATION_PK, Indexes.UNIQUE_GLOBAL_INTEGRATION_NAME, Indexes.UNIQUE_PROJECT_INTEGRATION_NAME); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_INTEGRATION; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.INTEGRATION_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.INTEGRATION_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.INTEGRATION__INTEGRATION_PROJECT_ID_FKEY, Keys.INTEGRATION__INTEGRATION_TYPE_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.INTEGRATION__INTEGRATION_PROJECT_ID_FKEY); + } + + public JIntegrationType integrationType() { + return new JIntegrationType(this, Keys.INTEGRATION__INTEGRATION_TYPE_FKEY); + } + + @Override + public JIntegration as(String alias) { + return new JIntegration(DSL.name(alias), this); + } + + @Override + public JIntegration as(Name alias) { + return new JIntegration(alias, this); + } + + /** + * Rename this table + */ + @Override + public JIntegration rename(String name) { + return new JIntegration(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JIntegration rename(Name name) { + return new JIntegration(name, null); + } + + // ------------------------------------------------------------------------- + // Row8 type methods + // ------------------------------------------------------------------------- + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegrationType.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegrationType.java index d6ac6bf74..50ce2d789 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegrationType.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIntegrationType.java @@ -10,10 +10,13 @@ import com.epam.ta.reportportal.jooq.enums.JIntegrationAuthFlowEnum; import com.epam.ta.reportportal.jooq.enums.JIntegrationGroupEnum; import com.epam.ta.reportportal.jooq.tables.records.JIntegrationTypeRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -40,158 +43,149 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JIntegrationType extends TableImpl { - /** - * The reference instance of public.integration_type - */ - public static final JIntegrationType INTEGRATION_TYPE = new JIntegrationType(); - private static final long serialVersionUID = -1051931010; - /** - * The column public.integration_type.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('integration_type_id_seq'::regclass)", - org.jooq.impl.SQLDataType.INTEGER)), this, ""); - /** - * The column public.integration_type.name. - */ - public final TableField NAME = createField(DSL.name("name"), - org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - /** - * The column public.integration_type.auth_flow. - */ - public final TableField AUTH_FLOW = createField( - DSL.name("auth_flow"), org.jooq.impl.SQLDataType.VARCHAR.asEnumDataType( - com.epam.ta.reportportal.jooq.enums.JIntegrationAuthFlowEnum.class), this, ""); - /** - * The column public.integration_type.creation_date. - */ - public final TableField CREATION_DATE = createField( - DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false) - .defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), - this, ""); - /** - * The column public.integration_type.group_type. - */ - public final TableField GROUP_TYPE = createField( - DSL.name("group_type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false) - .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JIntegrationGroupEnum.class), this, - ""); - /** - * The column public.integration_type.enabled. - */ - public final TableField ENABLED = createField( - DSL.name("enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - /** - * The column public.integration_type.details. - */ - public final TableField DETAILS = createField(DSL.name("details"), - org.jooq.impl.SQLDataType.JSONB, this, ""); - - /** - * Create a public.integration_type table reference - */ - public JIntegrationType() { - this(DSL.name("integration_type"), null); - } - - /** - * Create an aliased public.integration_type table reference - */ - public JIntegrationType(String alias) { - this(DSL.name(alias), INTEGRATION_TYPE); - } - - /** - * Create an aliased public.integration_type table reference - */ - public JIntegrationType(Name alias) { - this(alias, INTEGRATION_TYPE); - } - - private JIntegrationType(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JIntegrationType(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JIntegrationType(Table child, - ForeignKey key) { - super(child, key, INTEGRATION_TYPE); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JIntegrationTypeRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.INTEGRATION_TYPE_NAME_KEY, Indexes.INTEGRATION_TYPE_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_INTEGRATION_TYPE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.INTEGRATION_TYPE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.INTEGRATION_TYPE_PK, - Keys.INTEGRATION_TYPE_NAME_KEY); - } - - @Override - public JIntegrationType as(String alias) { - return new JIntegrationType(DSL.name(alias), this); - } - - @Override - public JIntegrationType as(Name alias) { - return new JIntegrationType(alias, this); - } - - /** - * Rename this table - */ - @Override - public JIntegrationType rename(String name) { - return new JIntegrationType(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JIntegrationType rename(Name name) { - return new JIntegrationType(name, null); - } - - // ------------------------------------------------------------------------- - // Row7 type methods - // ------------------------------------------------------------------------- - - @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); - } + private static final long serialVersionUID = -1051931010; + + /** + * The reference instance of public.integration_type + */ + public static final JIntegrationType INTEGRATION_TYPE = new JIntegrationType(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JIntegrationTypeRecord.class; + } + + /** + * The column public.integration_type.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('integration_type_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); + + /** + * The column public.integration_type.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); + + /** + * The column public.integration_type.auth_flow. + */ + public final TableField AUTH_FLOW = createField(DSL.name("auth_flow"), org.jooq.impl.SQLDataType.VARCHAR.asEnumDataType(com.epam.ta.reportportal.jooq.enums.JIntegrationAuthFlowEnum.class), this, ""); + + /** + * The column public.integration_type.creation_date. + */ + public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column public.integration_type.group_type. + */ + public final TableField GROUP_TYPE = createField(DSL.name("group_type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JIntegrationGroupEnum.class), this, ""); + + /** + * The column public.integration_type.enabled. + */ + public final TableField ENABLED = createField(DSL.name("enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); + + /** + * The column public.integration_type.details. + */ + public final TableField DETAILS = createField(DSL.name("details"), org.jooq.impl.SQLDataType.JSONB, this, ""); + + /** + * Create a public.integration_type table reference + */ + public JIntegrationType() { + this(DSL.name("integration_type"), null); + } + + /** + * Create an aliased public.integration_type table reference + */ + public JIntegrationType(String alias) { + this(DSL.name(alias), INTEGRATION_TYPE); + } + + /** + * Create an aliased public.integration_type table reference + */ + public JIntegrationType(Name alias) { + this(alias, INTEGRATION_TYPE); + } + + private JIntegrationType(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JIntegrationType(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JIntegrationType(Table child, ForeignKey key) { + super(child, key, INTEGRATION_TYPE); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.INTEGRATION_TYPE_NAME_KEY, Indexes.INTEGRATION_TYPE_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_INTEGRATION_TYPE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.INTEGRATION_TYPE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.INTEGRATION_TYPE_PK, Keys.INTEGRATION_TYPE_NAME_KEY); + } + + @Override + public JIntegrationType as(String alias) { + return new JIntegrationType(DSL.name(alias), this); + } + + @Override + public JIntegrationType as(Name alias) { + return new JIntegrationType(alias, this); + } + + /** + * Rename this table + */ + @Override + public JIntegrationType rename(String name) { + return new JIntegrationType(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JIntegrationType rename(Name name) { + return new JIntegrationType(name, null); + } + + // ------------------------------------------------------------------------- + // Row7 type methods + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssue.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssue.java index 55c7f0b72..a555c4326 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssue.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssue.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JIssueRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -35,149 +38,147 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JIssue extends TableImpl { - /** - * The reference instance of public.issue - */ - public static final JIssue ISSUE = new JIssue(); - private static final long serialVersionUID = -877705555; - /** - * The column public.issue.issue_id. - */ - public final TableField ISSUE_ID = createField(DSL.name("issue_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.issue.issue_type. - */ - public final TableField ISSUE_TYPE = createField(DSL.name("issue_type"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.issue.issue_description. - */ - public final TableField ISSUE_DESCRIPTION = createField( - DSL.name("issue_description"), org.jooq.impl.SQLDataType.CLOB, this, ""); - /** - * The column public.issue.auto_analyzed. - */ - public final TableField AUTO_ANALYZED = createField( - DSL.name("auto_analyzed"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue( - org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - /** - * The column public.issue.ignore_analyzer. - */ - public final TableField IGNORE_ANALYZER = createField( - DSL.name("ignore_analyzer"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue( - org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - - /** - * Create a public.issue table reference - */ - public JIssue() { - this(DSL.name("issue"), null); - } - - /** - * Create an aliased public.issue table reference - */ - public JIssue(String alias) { - this(DSL.name(alias), ISSUE); - } - - /** - * Create an aliased public.issue table reference - */ - public JIssue(Name alias) { - this(alias, ISSUE); - } - - private JIssue(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JIssue(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JIssue(Table child, ForeignKey key) { - super(child, key, ISSUE); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JIssueRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ISSUE_IT_IDX, Indexes.ISSUE_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ISSUE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ISSUE_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ISSUE__ISSUE_ISSUE_ID_FKEY, - Keys.ISSUE__ISSUE_ISSUE_TYPE_FKEY); - } - - public JTestItemResults testItemResults() { - return new JTestItemResults(this, Keys.ISSUE__ISSUE_ISSUE_ID_FKEY); - } - - public JIssueType issueType() { - return new JIssueType(this, Keys.ISSUE__ISSUE_ISSUE_TYPE_FKEY); - } - - @Override - public JIssue as(String alias) { - return new JIssue(DSL.name(alias), this); - } - - @Override - public JIssue as(Name alias) { - return new JIssue(alias, this); - } - - /** - * Rename this table - */ - @Override - public JIssue rename(String name) { - return new JIssue(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JIssue rename(Name name) { - return new JIssue(name, null); - } - - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } + private static final long serialVersionUID = -877705555; + + /** + * The reference instance of public.issue + */ + public static final JIssue ISSUE = new JIssue(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JIssueRecord.class; + } + + /** + * The column public.issue.issue_id. + */ + public final TableField ISSUE_ID = createField(DSL.name("issue_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.issue.issue_type. + */ + public final TableField ISSUE_TYPE = createField(DSL.name("issue_type"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.issue.issue_description. + */ + public final TableField ISSUE_DESCRIPTION = createField(DSL.name("issue_description"), org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column public.issue.auto_analyzed. + */ + public final TableField AUTO_ANALYZED = createField(DSL.name("auto_analyzed"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + + /** + * The column public.issue.ignore_analyzer. + */ + public final TableField IGNORE_ANALYZER = createField(DSL.name("ignore_analyzer"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + + /** + * Create a public.issue table reference + */ + public JIssue() { + this(DSL.name("issue"), null); + } + + /** + * Create an aliased public.issue table reference + */ + public JIssue(String alias) { + this(DSL.name(alias), ISSUE); + } + + /** + * Create an aliased public.issue table reference + */ + public JIssue(Name alias) { + this(alias, ISSUE); + } + + private JIssue(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JIssue(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JIssue(Table child, ForeignKey key) { + super(child, key, ISSUE); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ISSUE_IT_IDX, Indexes.ISSUE_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ISSUE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ISSUE_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ISSUE__ISSUE_ISSUE_ID_FKEY, Keys.ISSUE__ISSUE_ISSUE_TYPE_FKEY); + } + + public JTestItemResults testItemResults() { + return new JTestItemResults(this, Keys.ISSUE__ISSUE_ISSUE_ID_FKEY); + } + + public JIssueType issueType() { + return new JIssueType(this, Keys.ISSUE__ISSUE_ISSUE_TYPE_FKEY); + } + + @Override + public JIssue as(String alias) { + return new JIssue(DSL.name(alias), this); + } + + @Override + public JIssue as(Name alias) { + return new JIssue(alias, this); + } + + /** + * Rename this table + */ + @Override + public JIssue rename(String name) { + return new JIssue(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JIssue rename(Name name) { + return new JIssue(name, null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueGroup.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueGroup.java old mode 100755 new mode 100644 index 18b8891bf..832c0dd4d --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueGroup.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueGroup.java @@ -9,9 +9,12 @@ import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.enums.JIssueGroupEnum; import com.epam.ta.reportportal.jooq.tables.records.JIssueGroupRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -37,126 +40,124 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JIssueGroup extends TableImpl { - /** - * The reference instance of public.issue_group - */ - public static final JIssueGroup ISSUE_GROUP = new JIssueGroup(); - private static final long serialVersionUID = -124161300; - /** - * The column public.issue_group.issue_group_id. - */ - public final TableField ISSUE_GROUP_ID = createField( - DSL.name("issue_group_id"), org.jooq.impl.SQLDataType.SMALLINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('issue_group_issue_group_id_seq'::regclass)", - org.jooq.impl.SQLDataType.SMALLINT)), this, ""); - /** - * The column public.issue_group.issue_group. - */ - public final TableField ISSUE_GROUP_ = createField( - DSL.name("issue_group"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false) - .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JIssueGroupEnum.class), this, ""); - - /** - * Create a public.issue_group table reference - */ - public JIssueGroup() { - this(DSL.name("issue_group"), null); - } - - /** - * Create an aliased public.issue_group table reference - */ - public JIssueGroup(String alias) { - this(DSL.name(alias), ISSUE_GROUP); - } - - /** - * Create an aliased public.issue_group table reference - */ - public JIssueGroup(Name alias) { - this(alias, ISSUE_GROUP); - } - - private JIssueGroup(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JIssueGroup(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JIssueGroup(Table child, ForeignKey key) { - super(child, key, ISSUE_GROUP); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JIssueGroupRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ISSUE_GROUP_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ISSUE_GROUP; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ISSUE_GROUP_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ISSUE_GROUP_PK); - } - - @Override - public JIssueGroup as(String alias) { - return new JIssueGroup(DSL.name(alias), this); - } - - @Override - public JIssueGroup as(Name alias) { - return new JIssueGroup(alias, this); - } - - /** - * Rename this table - */ - @Override - public JIssueGroup rename(String name) { - return new JIssueGroup(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JIssueGroup rename(Name name) { - return new JIssueGroup(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + private static final long serialVersionUID = -124161300; + + /** + * The reference instance of public.issue_group + */ + public static final JIssueGroup ISSUE_GROUP = new JIssueGroup(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JIssueGroupRecord.class; + } + + /** + * The column public.issue_group.issue_group_id. + */ + public final TableField ISSUE_GROUP_ID = createField(DSL.name("issue_group_id"), org.jooq.impl.SQLDataType.SMALLINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('issue_group_issue_group_id_seq'::regclass)", org.jooq.impl.SQLDataType.SMALLINT)), this, ""); + + /** + * The column public.issue_group.issue_group. + */ + public final TableField ISSUE_GROUP_ = createField(DSL.name("issue_group"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JIssueGroupEnum.class), this, ""); + + /** + * Create a public.issue_group table reference + */ + public JIssueGroup() { + this(DSL.name("issue_group"), null); + } + + /** + * Create an aliased public.issue_group table reference + */ + public JIssueGroup(String alias) { + this(DSL.name(alias), ISSUE_GROUP); + } + + /** + * Create an aliased public.issue_group table reference + */ + public JIssueGroup(Name alias) { + this(alias, ISSUE_GROUP); + } + + private JIssueGroup(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JIssueGroup(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JIssueGroup(Table child, ForeignKey key) { + super(child, key, ISSUE_GROUP); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ISSUE_GROUP_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ISSUE_GROUP; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ISSUE_GROUP_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ISSUE_GROUP_PK); + } + + @Override + public JIssueGroup as(String alias) { + return new JIssueGroup(DSL.name(alias), this); + } + + @Override + public JIssueGroup as(Name alias) { + return new JIssueGroup(alias, this); + } + + /** + * Rename this table + */ + @Override + public JIssueGroup rename(String name) { + return new JIssueGroup(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JIssueGroup rename(Name name) { + return new JIssueGroup(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTicket.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTicket.java index 119ed94cf..8c46bcd46 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTicket.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTicket.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JIssueTicketRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -35,133 +38,132 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JIssueTicket extends TableImpl { - /** - * The reference instance of public.issue_ticket - */ - public static final JIssueTicket ISSUE_TICKET = new JIssueTicket(); - private static final long serialVersionUID = -1026586967; - /** - * The column public.issue_ticket.issue_id. - */ - public final TableField ISSUE_ID = createField(DSL.name("issue_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.issue_ticket.ticket_id. - */ - public final TableField TICKET_ID = createField(DSL.name("ticket_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.issue_ticket table reference - */ - public JIssueTicket() { - this(DSL.name("issue_ticket"), null); - } - - /** - * Create an aliased public.issue_ticket table reference - */ - public JIssueTicket(String alias) { - this(DSL.name(alias), ISSUE_TICKET); - } - - /** - * Create an aliased public.issue_ticket table reference - */ - public JIssueTicket(Name alias) { - this(alias, ISSUE_TICKET); - } - - private JIssueTicket(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JIssueTicket(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JIssueTicket(Table child, ForeignKey key) { - super(child, key, ISSUE_TICKET); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JIssueTicketRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ISSUE_TICKET_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ISSUE_TICKET_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ISSUE_TICKET_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY, - Keys.ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY); - } - - public JIssue issue() { - return new JIssue(this, Keys.ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY); - } - - public JTicket ticket() { - return new JTicket(this, Keys.ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY); - } - - @Override - public JIssueTicket as(String alias) { - return new JIssueTicket(DSL.name(alias), this); - } - - @Override - public JIssueTicket as(Name alias) { - return new JIssueTicket(alias, this); - } - - /** - * Rename this table - */ - @Override - public JIssueTicket rename(String name) { - return new JIssueTicket(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JIssueTicket rename(Name name) { - return new JIssueTicket(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + private static final long serialVersionUID = -1026586967; + + /** + * The reference instance of public.issue_ticket + */ + public static final JIssueTicket ISSUE_TICKET = new JIssueTicket(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JIssueTicketRecord.class; + } + + /** + * The column public.issue_ticket.issue_id. + */ + public final TableField ISSUE_ID = createField(DSL.name("issue_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.issue_ticket.ticket_id. + */ + public final TableField TICKET_ID = createField(DSL.name("ticket_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.issue_ticket table reference + */ + public JIssueTicket() { + this(DSL.name("issue_ticket"), null); + } + + /** + * Create an aliased public.issue_ticket table reference + */ + public JIssueTicket(String alias) { + this(DSL.name(alias), ISSUE_TICKET); + } + + /** + * Create an aliased public.issue_ticket table reference + */ + public JIssueTicket(Name alias) { + this(alias, ISSUE_TICKET); + } + + private JIssueTicket(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JIssueTicket(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JIssueTicket(Table child, ForeignKey key) { + super(child, key, ISSUE_TICKET); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ISSUE_TICKET_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ISSUE_TICKET_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ISSUE_TICKET_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY, Keys.ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY); + } + + public JIssue issue() { + return new JIssue(this, Keys.ISSUE_TICKET__ISSUE_TICKET_ISSUE_ID_FKEY); + } + + public JTicket ticket() { + return new JTicket(this, Keys.ISSUE_TICKET__ISSUE_TICKET_TICKET_ID_FKEY); + } + + @Override + public JIssueTicket as(String alias) { + return new JIssueTicket(DSL.name(alias), this); + } + + @Override + public JIssueTicket as(Name alias) { + return new JIssueTicket(alias, this); + } + + /** + * Rename this table + */ + @Override + public JIssueTicket rename(String name) { + return new JIssueTicket(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JIssueTicket rename(Name name) { + return new JIssueTicket(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueType.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueType.java old mode 100755 new mode 100644 index c6c991979..b8b906523 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueType.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueType.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JIssueTypeRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -36,157 +39,153 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JIssueType extends TableImpl { - /** - * The reference instance of public.issue_type - */ - public static final JIssueType ISSUE_TYPE = new JIssueType(); - private static final long serialVersionUID = -1978728165; - /** - * The column public.issue_type.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('issue_type_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.issue_type.issue_group_id. - */ - public final TableField ISSUE_GROUP_ID = createField( - DSL.name("issue_group_id"), org.jooq.impl.SQLDataType.SMALLINT, this, ""); - /** - * The column public.issue_type.locator. - */ - public final TableField LOCATOR = createField(DSL.name("locator"), - org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, ""); - /** - * The column public.issue_type.issue_name. - */ - public final TableField ISSUE_NAME = createField(DSL.name("issue_name"), - org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - /** - * The column public.issue_type.abbreviation. - */ - public final TableField ABBREVIATION = createField( - DSL.name("abbreviation"), org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, ""); - /** - * The column public.issue_type.hex_color. - */ - public final TableField HEX_COLOR = createField(DSL.name("hex_color"), - org.jooq.impl.SQLDataType.VARCHAR(7).nullable(false), this, ""); - - /** - * Create a public.issue_type table reference - */ - public JIssueType() { - this(DSL.name("issue_type"), null); - } - - /** - * Create an aliased public.issue_type table reference - */ - public JIssueType(String alias) { - this(DSL.name(alias), ISSUE_TYPE); - } - - /** - * Create an aliased public.issue_type table reference - */ - public JIssueType(Name alias) { - this(alias, ISSUE_TYPE); - } - - private JIssueType(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JIssueType(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JIssueType(Table child, ForeignKey key) { - super(child, key, ISSUE_TYPE); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JIssueTypeRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ISSUE_TYPE_GROUP_IDX, Indexes.ISSUE_TYPE_LOCATOR_KEY, - Indexes.ISSUE_TYPE_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ISSUE_TYPE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ISSUE_TYPE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ISSUE_TYPE_PK, - Keys.ISSUE_TYPE_LOCATOR_KEY); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY); - } - - public JIssueGroup issueGroup() { - return new JIssueGroup(this, Keys.ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY); - } - - @Override - public JIssueType as(String alias) { - return new JIssueType(DSL.name(alias), this); - } - - @Override - public JIssueType as(Name alias) { - return new JIssueType(alias, this); - } - - /** - * Rename this table - */ - @Override - public JIssueType rename(String name) { - return new JIssueType(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JIssueType rename(Name name) { - return new JIssueType(name, null); - } - - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } + private static final long serialVersionUID = -1978728165; + + /** + * The reference instance of public.issue_type + */ + public static final JIssueType ISSUE_TYPE = new JIssueType(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JIssueTypeRecord.class; + } + + /** + * The column public.issue_type.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('issue_type_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.issue_type.issue_group_id. + */ + public final TableField ISSUE_GROUP_ID = createField(DSL.name("issue_group_id"), org.jooq.impl.SQLDataType.SMALLINT, this, ""); + + /** + * The column public.issue_type.locator. + */ + public final TableField LOCATOR = createField(DSL.name("locator"), org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, ""); + + /** + * The column public.issue_type.issue_name. + */ + public final TableField ISSUE_NAME = createField(DSL.name("issue_name"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + + /** + * The column public.issue_type.abbreviation. + */ + public final TableField ABBREVIATION = createField(DSL.name("abbreviation"), org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, ""); + + /** + * The column public.issue_type.hex_color. + */ + public final TableField HEX_COLOR = createField(DSL.name("hex_color"), org.jooq.impl.SQLDataType.VARCHAR(7).nullable(false), this, ""); + + /** + * Create a public.issue_type table reference + */ + public JIssueType() { + this(DSL.name("issue_type"), null); + } + + /** + * Create an aliased public.issue_type table reference + */ + public JIssueType(String alias) { + this(DSL.name(alias), ISSUE_TYPE); + } + + /** + * Create an aliased public.issue_type table reference + */ + public JIssueType(Name alias) { + this(alias, ISSUE_TYPE); + } + + private JIssueType(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JIssueType(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JIssueType(Table child, ForeignKey key) { + super(child, key, ISSUE_TYPE); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ISSUE_TYPE_GROUP_IDX, Indexes.ISSUE_TYPE_LOCATOR_KEY, Indexes.ISSUE_TYPE_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ISSUE_TYPE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ISSUE_TYPE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ISSUE_TYPE_PK, Keys.ISSUE_TYPE_LOCATOR_KEY); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY); + } + + public JIssueGroup issueGroup() { + return new JIssueGroup(this, Keys.ISSUE_TYPE__ISSUE_TYPE_ISSUE_GROUP_ID_FKEY); + } + + @Override + public JIssueType as(String alias) { + return new JIssueType(DSL.name(alias), this); + } + + @Override + public JIssueType as(Name alias) { + return new JIssueType(alias, this); + } + + /** + * Rename this table + */ + @Override + public JIssueType rename(String name) { + return new JIssueType(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JIssueType rename(Name name) { + return new JIssueType(name, null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTypeProject.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTypeProject.java old mode 100755 new mode 100644 index a96f5ab4f..4ecdc5792 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTypeProject.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JIssueTypeProject.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JIssueTypeProjectRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -35,135 +38,132 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JIssueTypeProject extends TableImpl { - /** - * The reference instance of public.issue_type_project - */ - public static final JIssueTypeProject ISSUE_TYPE_PROJECT = new JIssueTypeProject(); - private static final long serialVersionUID = -184496297; - /** - * The column public.issue_type_project.project_id. - */ - public final TableField PROJECT_ID = createField( - DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.issue_type_project.issue_type_id. - */ - public final TableField ISSUE_TYPE_ID = createField( - DSL.name("issue_type_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.issue_type_project table reference - */ - public JIssueTypeProject() { - this(DSL.name("issue_type_project"), null); - } - - /** - * Create an aliased public.issue_type_project table reference - */ - public JIssueTypeProject(String alias) { - this(DSL.name(alias), ISSUE_TYPE_PROJECT); - } - - /** - * Create an aliased public.issue_type_project table reference - */ - public JIssueTypeProject(Name alias) { - this(alias, ISSUE_TYPE_PROJECT); - } - - private JIssueTypeProject(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JIssueTypeProject(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JIssueTypeProject(Table child, - ForeignKey key) { - super(child, key, ISSUE_TYPE_PROJECT); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JIssueTypeProjectRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ISSUE_TYPE_PROJECT_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ISSUE_TYPE_PROJECT_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ISSUE_TYPE_PROJECT_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY, - Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY); - } - - public JIssueType issueType() { - return new JIssueType(this, Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY); - } - - @Override - public JIssueTypeProject as(String alias) { - return new JIssueTypeProject(DSL.name(alias), this); - } - - @Override - public JIssueTypeProject as(Name alias) { - return new JIssueTypeProject(alias, this); - } - - /** - * Rename this table - */ - @Override - public JIssueTypeProject rename(String name) { - return new JIssueTypeProject(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JIssueTypeProject rename(Name name) { - return new JIssueTypeProject(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + private static final long serialVersionUID = -184496297; + + /** + * The reference instance of public.issue_type_project + */ + public static final JIssueTypeProject ISSUE_TYPE_PROJECT = new JIssueTypeProject(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JIssueTypeProjectRecord.class; + } + + /** + * The column public.issue_type_project.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.issue_type_project.issue_type_id. + */ + public final TableField ISSUE_TYPE_ID = createField(DSL.name("issue_type_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.issue_type_project table reference + */ + public JIssueTypeProject() { + this(DSL.name("issue_type_project"), null); + } + + /** + * Create an aliased public.issue_type_project table reference + */ + public JIssueTypeProject(String alias) { + this(DSL.name(alias), ISSUE_TYPE_PROJECT); + } + + /** + * Create an aliased public.issue_type_project table reference + */ + public JIssueTypeProject(Name alias) { + this(alias, ISSUE_TYPE_PROJECT); + } + + private JIssueTypeProject(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JIssueTypeProject(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JIssueTypeProject(Table child, ForeignKey key) { + super(child, key, ISSUE_TYPE_PROJECT); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ISSUE_TYPE_PROJECT_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ISSUE_TYPE_PROJECT_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ISSUE_TYPE_PROJECT_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY, Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_PROJECT_ID_FKEY); + } + + public JIssueType issueType() { + return new JIssueType(this, Keys.ISSUE_TYPE_PROJECT__ISSUE_TYPE_PROJECT_ISSUE_TYPE_ID_FKEY); + } + + @Override + public JIssueTypeProject as(String alias) { + return new JIssueTypeProject(DSL.name(alias), this); + } + + @Override + public JIssueTypeProject as(Name alias) { + return new JIssueTypeProject(alias, this); + } + + /** + * Rename this table + */ + @Override + public JIssueTypeProject rename(String name) { + return new JIssueTypeProject(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JIssueTypeProject rename(Name name) { + return new JIssueTypeProject(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JItemAttribute.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JItemAttribute.java old mode 100755 new mode 100644 index 708fee273..28fb6cedb --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JItemAttribute.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JItemAttribute.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JItemAttributeRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -36,163 +39,157 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JItemAttribute extends TableImpl { - /** - * The reference instance of public.item_attribute - */ - public static final JItemAttribute ITEM_ATTRIBUTE = new JItemAttribute(); - private static final long serialVersionUID = -425535120; - /** - * The column public.item_attribute.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('item_attribute_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.item_attribute.key. - */ - public final TableField KEY = createField(DSL.name("key"), - org.jooq.impl.SQLDataType.VARCHAR, this, ""); - /** - * The column public.item_attribute.value. - */ - public final TableField VALUE = createField(DSL.name("value"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.item_attribute.item_id. - */ - public final TableField ITEM_ID = createField(DSL.name("item_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.item_attribute.launch_id. - */ - public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.item_attribute.system. - */ - public final TableField SYSTEM = createField(DSL.name("system"), - org.jooq.impl.SQLDataType.BOOLEAN.defaultValue( - org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - - /** - * Create a public.item_attribute table reference - */ - public JItemAttribute() { - this(DSL.name("item_attribute"), null); - } - - /** - * Create an aliased public.item_attribute table reference - */ - public JItemAttribute(String alias) { - this(DSL.name(alias), ITEM_ATTRIBUTE); - } - - /** - * Create an aliased public.item_attribute table reference - */ - public JItemAttribute(Name alias) { - this(alias, ITEM_ATTRIBUTE); - } - - private JItemAttribute(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JItemAttribute(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JItemAttribute(Table child, - ForeignKey key) { - super(child, key, ITEM_ATTRIBUTE); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JItemAttributeRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ITEM_ATTR_LAUNCH_IDX, Indexes.ITEM_ATTR_TI_IDX, - Indexes.ITEM_ATTRIBUTE_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ITEM_ATTRIBUTE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ITEM_ATTRIBUTE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ITEM_ATTRIBUTE_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY, - Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY); - } - - public JTestItem testItem() { - return new JTestItem(this, Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY); - } - - public JLaunch launch() { - return new JLaunch(this, Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY); - } - - @Override - public JItemAttribute as(String alias) { - return new JItemAttribute(DSL.name(alias), this); - } - - @Override - public JItemAttribute as(Name alias) { - return new JItemAttribute(alias, this); - } - - /** - * Rename this table - */ - @Override - public JItemAttribute rename(String name) { - return new JItemAttribute(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JItemAttribute rename(Name name) { - return new JItemAttribute(name, null); - } - - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } + private static final long serialVersionUID = -425535120; + + /** + * The reference instance of public.item_attribute + */ + public static final JItemAttribute ITEM_ATTRIBUTE = new JItemAttribute(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JItemAttributeRecord.class; + } + + /** + * The column public.item_attribute.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('item_attribute_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.item_attribute.key. + */ + public final TableField KEY = createField(DSL.name("key"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * The column public.item_attribute.value. + */ + public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.item_attribute.item_id. + */ + public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.item_attribute.launch_id. + */ + public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.item_attribute.system. + */ + public final TableField SYSTEM = createField(DSL.name("system"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + + /** + * Create a public.item_attribute table reference + */ + public JItemAttribute() { + this(DSL.name("item_attribute"), null); + } + + /** + * Create an aliased public.item_attribute table reference + */ + public JItemAttribute(String alias) { + this(DSL.name(alias), ITEM_ATTRIBUTE); + } + + /** + * Create an aliased public.item_attribute table reference + */ + public JItemAttribute(Name alias) { + this(alias, ITEM_ATTRIBUTE); + } + + private JItemAttribute(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JItemAttribute(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JItemAttribute(Table child, ForeignKey key) { + super(child, key, ITEM_ATTRIBUTE); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ITEM_ATTR_LAUNCH_IDX, Indexes.ITEM_ATTR_TI_IDX, Indexes.ITEM_ATTRIBUTE_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ITEM_ATTRIBUTE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ITEM_ATTRIBUTE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ITEM_ATTRIBUTE_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY, Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY); + } + + public JTestItem testItem() { + return new JTestItem(this, Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_ITEM_ID_FKEY); + } + + public JLaunch launch() { + return new JLaunch(this, Keys.ITEM_ATTRIBUTE__ITEM_ATTRIBUTE_LAUNCH_ID_FKEY); + } + + @Override + public JItemAttribute as(String alias) { + return new JItemAttribute(DSL.name(alias), this); + } + + @Override + public JItemAttribute as(Name alias) { + return new JItemAttribute(alias, this); + } + + /** + * Rename this table + */ + @Override + public JItemAttribute rename(String name) { + return new JItemAttribute(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JItemAttribute rename(Name name) { + return new JItemAttribute(name, null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunch.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunch.java old mode 100755 new mode 100644 index c687439b4..38a03ae90 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunch.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunch.java @@ -10,10 +10,13 @@ import com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum; import com.epam.ta.reportportal.jooq.enums.JStatusEnum; import com.epam.ta.reportportal.jooq.tables.records.JLaunchRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -39,215 +42,202 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JLaunch extends TableImpl { - /** - * The reference instance of public.launch - */ - public static final JLaunch LAUNCH = new JLaunch(); - private static final long serialVersionUID = 1513226778; - /** - * The column public.launch.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('launch_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.launch.uuid. - */ - public final TableField UUID = createField(DSL.name("uuid"), - org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, ""); - /** - * The column public.launch.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.launch.user_id. - */ - public final TableField USER_ID = createField(DSL.name("user_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.launch.name. - */ - public final TableField NAME = createField(DSL.name("name"), - org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - /** - * The column public.launch.description. - */ - public final TableField DESCRIPTION = createField(DSL.name("description"), - org.jooq.impl.SQLDataType.CLOB, this, ""); - /** - * The column public.launch.start_time. - */ - public final TableField START_TIME = createField(DSL.name("start_time"), - org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - /** - * The column public.launch.end_time. - */ - public final TableField END_TIME = createField(DSL.name("end_time"), - org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - /** - * The column public.launch.number. - */ - public final TableField NUMBER = createField(DSL.name("number"), - org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - /** - * The column public.launch.last_modified. - */ - public final TableField LAST_MODIFIED = createField( - DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false) - .defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), - this, ""); - /** - * The column public.launch.mode. - */ - public final TableField MODE = createField(DSL.name("mode"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false) - .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum.class), this, ""); - /** - * The column public.launch.status. - */ - public final TableField STATUS = createField(DSL.name("status"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false) - .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JStatusEnum.class), this, ""); - /** - * The column public.launch.has_retries. - */ - public final TableField HAS_RETRIES = createField(DSL.name("has_retries"), - org.jooq.impl.SQLDataType.BOOLEAN.nullable(false) - .defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, - ""); - /** - * The column public.launch.rerun. - */ - public final TableField RERUN = createField(DSL.name("rerun"), - org.jooq.impl.SQLDataType.BOOLEAN.nullable(false) - .defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, - ""); - /** - * The column public.launch.approximate_duration. - */ - public final TableField APPROXIMATE_DURATION = createField( - DSL.name("approximate_duration"), org.jooq.impl.SQLDataType.DOUBLE.defaultValue( - org.jooq.impl.DSL.field("0.0", org.jooq.impl.SQLDataType.DOUBLE)), this, ""); - - /** - * Create a public.launch table reference - */ - public JLaunch() { - this(DSL.name("launch"), null); - } - - /** - * Create an aliased public.launch table reference - */ - public JLaunch(String alias) { - this(DSL.name(alias), LAUNCH); - } - - /** - * Create an aliased public.launch table reference - */ - public JLaunch(Name alias) { - this(alias, LAUNCH); - } - - private JLaunch(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JLaunch(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JLaunch(Table child, ForeignKey key) { - super(child, key, LAUNCH); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JLaunchRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.LAUNCH_PK, Indexes.LAUNCH_PROJECT_START_TIME_IDX, - Indexes.LAUNCH_USER_IDX, Indexes.LAUNCH_UUID_KEY, Indexes.UNQ_NAME_NUMBER); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_LAUNCH; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.LAUNCH_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.LAUNCH_PK, Keys.LAUNCH_UUID_KEY, - Keys.UNQ_NAME_NUMBER); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.LAUNCH__LAUNCH_PROJECT_ID_FKEY, - Keys.LAUNCH__LAUNCH_USER_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.LAUNCH__LAUNCH_PROJECT_ID_FKEY); - } - - public JUsers users() { - return new JUsers(this, Keys.LAUNCH__LAUNCH_USER_ID_FKEY); - } - - @Override - public JLaunch as(String alias) { - return new JLaunch(DSL.name(alias), this); - } - - @Override - public JLaunch as(Name alias) { - return new JLaunch(alias, this); - } - - /** - * Rename this table - */ - @Override - public JLaunch rename(String name) { - return new JLaunch(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JLaunch rename(Name name) { - return new JLaunch(name, null); - } - - // ------------------------------------------------------------------------- - // Row15 type methods - // ------------------------------------------------------------------------- - - @Override - public Row15 fieldsRow() { - return (Row15) super.fieldsRow(); - } + private static final long serialVersionUID = 1513226778; + + /** + * The reference instance of public.launch + */ + public static final JLaunch LAUNCH = new JLaunch(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JLaunchRecord.class; + } + + /** + * The column public.launch.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('launch_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.launch.uuid. + */ + public final TableField UUID = createField(DSL.name("uuid"), org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, ""); + + /** + * The column public.launch.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.launch.user_id. + */ + public final TableField USER_ID = createField(DSL.name("user_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.launch.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + + /** + * The column public.launch.description. + */ + public final TableField DESCRIPTION = createField(DSL.name("description"), org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column public.launch.start_time. + */ + public final TableField START_TIME = createField(DSL.name("start_time"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * The column public.launch.end_time. + */ + public final TableField END_TIME = createField(DSL.name("end_time"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + + /** + * The column public.launch.number. + */ + public final TableField NUMBER = createField(DSL.name("number"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column public.launch.last_modified. + */ + public final TableField LAST_MODIFIED = createField(DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column public.launch.mode. + */ + public final TableField MODE = createField(DSL.name("mode"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum.class), this, ""); + + /** + * The column public.launch.status. + */ + public final TableField STATUS = createField(DSL.name("status"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JStatusEnum.class), this, ""); + + /** + * The column public.launch.has_retries. + */ + public final TableField HAS_RETRIES = createField(DSL.name("has_retries"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false).defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + + /** + * The column public.launch.rerun. + */ + public final TableField RERUN = createField(DSL.name("rerun"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false).defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + + /** + * The column public.launch.approximate_duration. + */ + public final TableField APPROXIMATE_DURATION = createField(DSL.name("approximate_duration"), org.jooq.impl.SQLDataType.DOUBLE.defaultValue(org.jooq.impl.DSL.field("0.0", org.jooq.impl.SQLDataType.DOUBLE)), this, ""); + + /** + * Create a public.launch table reference + */ + public JLaunch() { + this(DSL.name("launch"), null); + } + + /** + * Create an aliased public.launch table reference + */ + public JLaunch(String alias) { + this(DSL.name(alias), LAUNCH); + } + + /** + * Create an aliased public.launch table reference + */ + public JLaunch(Name alias) { + this(alias, LAUNCH); + } + + private JLaunch(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JLaunch(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JLaunch(Table child, ForeignKey key) { + super(child, key, LAUNCH); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.LAUNCH_PK, Indexes.LAUNCH_PROJECT_START_TIME_IDX, Indexes.LAUNCH_USER_IDX, Indexes.LAUNCH_UUID_KEY, Indexes.UNQ_NAME_NUMBER); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_LAUNCH; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.LAUNCH_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.LAUNCH_PK, Keys.LAUNCH_UUID_KEY, Keys.UNQ_NAME_NUMBER); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.LAUNCH__LAUNCH_PROJECT_ID_FKEY, Keys.LAUNCH__LAUNCH_USER_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.LAUNCH__LAUNCH_PROJECT_ID_FKEY); + } + + public JUsers users() { + return new JUsers(this, Keys.LAUNCH__LAUNCH_USER_ID_FKEY); + } + + @Override + public JLaunch as(String alias) { + return new JLaunch(DSL.name(alias), this); + } + + @Override + public JLaunch as(Name alias) { + return new JLaunch(alias, this); + } + + /** + * Rename this table + */ + @Override + public JLaunch rename(String name) { + return new JLaunch(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JLaunch rename(Name name) { + return new JLaunch(name, null); + } + + // ------------------------------------------------------------------------- + // Row15 type methods + // ------------------------------------------------------------------------- + + @Override + public Row15 fieldsRow() { + return (Row15) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchAttributeRules.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchAttributeRules.java old mode 100755 new mode 100644 index 833b28127..cdf3dcb12 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchAttributeRules.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchAttributeRules.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JLaunchAttributeRulesRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -36,148 +39,143 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JLaunchAttributeRules extends TableImpl { - /** - * The reference instance of public.launch_attribute_rules - */ - public static final JLaunchAttributeRules LAUNCH_ATTRIBUTE_RULES = new JLaunchAttributeRules(); - private static final long serialVersionUID = 1128795973; - /** - * The column public.launch_attribute_rules.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('launch_attribute_rules_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.launch_attribute_rules.sender_case_id. - */ - public final TableField SENDER_CASE_ID = createField( - DSL.name("sender_case_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.launch_attribute_rules.key. - */ - public final TableField KEY = createField(DSL.name("key"), - org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - /** - * The column public.launch_attribute_rules.value. - */ - public final TableField VALUE = createField( - DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - - /** - * Create a public.launch_attribute_rules table reference - */ - public JLaunchAttributeRules() { - this(DSL.name("launch_attribute_rules"), null); - } - - /** - * Create an aliased public.launch_attribute_rules table reference - */ - public JLaunchAttributeRules(String alias) { - this(DSL.name(alias), LAUNCH_ATTRIBUTE_RULES); - } - - /** - * Create an aliased public.launch_attribute_rules table reference - */ - public JLaunchAttributeRules(Name alias) { - this(alias, LAUNCH_ATTRIBUTE_RULES); - } - - private JLaunchAttributeRules(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JLaunchAttributeRules(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JLaunchAttributeRules(Table child, - ForeignKey key) { - super(child, key, LAUNCH_ATTRIBUTE_RULES); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JLaunchAttributeRulesRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.L_ATTR_RL_SEND_CASE_IDX, Indexes.LAUNCH_ATTRIBUTE_RULES_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_LAUNCH_ATTRIBUTE_RULES; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.LAUNCH_ATTRIBUTE_RULES_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.LAUNCH_ATTRIBUTE_RULES_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY); - } - - public JSenderCase senderCase() { - return new JSenderCase(this, - Keys.LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY); - } - - @Override - public JLaunchAttributeRules as(String alias) { - return new JLaunchAttributeRules(DSL.name(alias), this); - } - - @Override - public JLaunchAttributeRules as(Name alias) { - return new JLaunchAttributeRules(alias, this); - } - - /** - * Rename this table - */ - @Override - public JLaunchAttributeRules rename(String name) { - return new JLaunchAttributeRules(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JLaunchAttributeRules rename(Name name) { - return new JLaunchAttributeRules(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + private static final long serialVersionUID = 1014824139; + + /** + * The reference instance of public.launch_attribute_rules + */ + public static final JLaunchAttributeRules LAUNCH_ATTRIBUTE_RULES = new JLaunchAttributeRules(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JLaunchAttributeRulesRecord.class; + } + + /** + * The column public.launch_attribute_rules.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('launch_attribute_rules_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.launch_attribute_rules.sender_case_id. + */ + public final TableField SENDER_CASE_ID = createField(DSL.name("sender_case_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.launch_attribute_rules.key. + */ + public final TableField KEY = createField(DSL.name("key"), org.jooq.impl.SQLDataType.VARCHAR(512), this, ""); + + /** + * The column public.launch_attribute_rules.value. + */ + public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR(512).nullable(false), this, ""); + + /** + * Create a public.launch_attribute_rules table reference + */ + public JLaunchAttributeRules() { + this(DSL.name("launch_attribute_rules"), null); + } + + /** + * Create an aliased public.launch_attribute_rules table reference + */ + public JLaunchAttributeRules(String alias) { + this(DSL.name(alias), LAUNCH_ATTRIBUTE_RULES); + } + + /** + * Create an aliased public.launch_attribute_rules table reference + */ + public JLaunchAttributeRules(Name alias) { + this(alias, LAUNCH_ATTRIBUTE_RULES); + } + + private JLaunchAttributeRules(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JLaunchAttributeRules(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JLaunchAttributeRules(Table child, ForeignKey key) { + super(child, key, LAUNCH_ATTRIBUTE_RULES); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.L_ATTR_RL_SEND_CASE_IDX, Indexes.LAUNCH_ATTRIBUTE_RULES_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_LAUNCH_ATTRIBUTE_RULES; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.LAUNCH_ATTRIBUTE_RULES_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.LAUNCH_ATTRIBUTE_RULES_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY); + } + + public JSenderCase senderCase() { + return new JSenderCase(this, Keys.LAUNCH_ATTRIBUTE_RULES__LAUNCH_ATTRIBUTE_RULES_SENDER_CASE_ID_FKEY); + } + + @Override + public JLaunchAttributeRules as(String alias) { + return new JLaunchAttributeRules(DSL.name(alias), this); + } + + @Override + public JLaunchAttributeRules as(Name alias) { + return new JLaunchAttributeRules(alias, this); + } + + /** + * Rename this table + */ + @Override + public JLaunchAttributeRules rename(String name) { + return new JLaunchAttributeRules(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JLaunchAttributeRules rename(Name name) { + return new JLaunchAttributeRules(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNames.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNames.java old mode 100755 new mode 100644 index d680d6a80..0488fb931 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNames.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNames.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JLaunchNamesRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -34,118 +37,118 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JLaunchNames extends TableImpl { - /** - * The reference instance of public.launch_names - */ - public static final JLaunchNames LAUNCH_NAMES = new JLaunchNames(); - private static final long serialVersionUID = 2113925870; - /** - * The column public.launch_names.sender_case_id. - */ - public final TableField SENDER_CASE_ID = createField( - DSL.name("sender_case_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.launch_names.launch_name. - */ - public final TableField LAUNCH_NAME = createField( - DSL.name("launch_name"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * Create a public.launch_names table reference - */ - public JLaunchNames() { - this(DSL.name("launch_names"), null); - } - - /** - * Create an aliased public.launch_names table reference - */ - public JLaunchNames(String alias) { - this(DSL.name(alias), LAUNCH_NAMES); - } - - /** - * Create an aliased public.launch_names table reference - */ - public JLaunchNames(Name alias) { - this(alias, LAUNCH_NAMES); - } - - private JLaunchNames(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JLaunchNames(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JLaunchNames(Table child, ForeignKey key) { - super(child, key, LAUNCH_NAMES); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JLaunchNamesRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.LN_SEND_CASE_IDX); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY); - } - - public JSenderCase senderCase() { - return new JSenderCase(this, Keys.LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY); - } - - @Override - public JLaunchNames as(String alias) { - return new JLaunchNames(DSL.name(alias), this); - } - - @Override - public JLaunchNames as(Name alias) { - return new JLaunchNames(alias, this); - } - - /** - * Rename this table - */ - @Override - public JLaunchNames rename(String name) { - return new JLaunchNames(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JLaunchNames rename(Name name) { - return new JLaunchNames(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + private static final long serialVersionUID = 2113925870; + + /** + * The reference instance of public.launch_names + */ + public static final JLaunchNames LAUNCH_NAMES = new JLaunchNames(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JLaunchNamesRecord.class; + } + + /** + * The column public.launch_names.sender_case_id. + */ + public final TableField SENDER_CASE_ID = createField(DSL.name("sender_case_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.launch_names.launch_name. + */ + public final TableField LAUNCH_NAME = createField(DSL.name("launch_name"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + + /** + * Create a public.launch_names table reference + */ + public JLaunchNames() { + this(DSL.name("launch_names"), null); + } + + /** + * Create an aliased public.launch_names table reference + */ + public JLaunchNames(String alias) { + this(DSL.name(alias), LAUNCH_NAMES); + } + + /** + * Create an aliased public.launch_names table reference + */ + public JLaunchNames(Name alias) { + this(alias, LAUNCH_NAMES); + } + + private JLaunchNames(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JLaunchNames(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JLaunchNames(Table child, ForeignKey key) { + super(child, key, LAUNCH_NAMES); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.LN_SEND_CASE_IDX); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY); + } + + public JSenderCase senderCase() { + return new JSenderCase(this, Keys.LAUNCH_NAMES__LAUNCH_NAMES_SENDER_CASE_ID_FKEY); + } + + @Override + public JLaunchNames as(String alias) { + return new JLaunchNames(DSL.name(alias), this); + } + + @Override + public JLaunchNames as(Name alias) { + return new JLaunchNames(alias, this); + } + + /** + * Rename this table + */ + @Override + public JLaunchNames rename(String name) { + return new JLaunchNames(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JLaunchNames rename(Name name) { + return new JLaunchNames(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNumber.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNumber.java index d007ac2b3..55e1583b5 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNumber.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchNumber.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JLaunchNumberRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -36,146 +39,143 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JLaunchNumber extends TableImpl { - /** - * The reference instance of public.launch_number - */ - public static final JLaunchNumber LAUNCH_NUMBER = new JLaunchNumber(); - private static final long serialVersionUID = 1327480379; - /** - * The column public.launch_number.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('launch_number_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.launch_number.project_id. - */ - public final TableField PROJECT_ID = createField( - DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.launch_number.launch_name. - */ - public final TableField LAUNCH_NAME = createField( - DSL.name("launch_name"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - /** - * The column public.launch_number.number. - */ - public final TableField NUMBER = createField(DSL.name("number"), - org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * Create a public.launch_number table reference - */ - public JLaunchNumber() { - this(DSL.name("launch_number"), null); - } - - /** - * Create an aliased public.launch_number table reference - */ - public JLaunchNumber(String alias) { - this(DSL.name(alias), LAUNCH_NUMBER); - } - - /** - * Create an aliased public.launch_number table reference - */ - public JLaunchNumber(Name alias) { - this(alias, LAUNCH_NUMBER); - } - - private JLaunchNumber(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JLaunchNumber(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JLaunchNumber(Table child, ForeignKey key) { - super(child, key, LAUNCH_NUMBER); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JLaunchNumberRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.LAUNCH_NUMBER_PK, Indexes.UNQ_PROJECT_NAME); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_LAUNCH_NUMBER; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.LAUNCH_NUMBER_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.LAUNCH_NUMBER_PK, - Keys.UNQ_PROJECT_NAME); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY); - } - - @Override - public JLaunchNumber as(String alias) { - return new JLaunchNumber(DSL.name(alias), this); - } - - @Override - public JLaunchNumber as(Name alias) { - return new JLaunchNumber(alias, this); - } - - /** - * Rename this table - */ - @Override - public JLaunchNumber rename(String name) { - return new JLaunchNumber(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JLaunchNumber rename(Name name) { - return new JLaunchNumber(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + private static final long serialVersionUID = 1327480379; + + /** + * The reference instance of public.launch_number + */ + public static final JLaunchNumber LAUNCH_NUMBER = new JLaunchNumber(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JLaunchNumberRecord.class; + } + + /** + * The column public.launch_number.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('launch_number_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.launch_number.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.launch_number.launch_name. + */ + public final TableField LAUNCH_NAME = createField(DSL.name("launch_name"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + + /** + * The column public.launch_number.number. + */ + public final TableField NUMBER = createField(DSL.name("number"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * Create a public.launch_number table reference + */ + public JLaunchNumber() { + this(DSL.name("launch_number"), null); + } + + /** + * Create an aliased public.launch_number table reference + */ + public JLaunchNumber(String alias) { + this(DSL.name(alias), LAUNCH_NUMBER); + } + + /** + * Create an aliased public.launch_number table reference + */ + public JLaunchNumber(Name alias) { + this(alias, LAUNCH_NUMBER); + } + + private JLaunchNumber(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JLaunchNumber(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JLaunchNumber(Table child, ForeignKey key) { + super(child, key, LAUNCH_NUMBER); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.LAUNCH_NUMBER_PK, Indexes.UNQ_PROJECT_NAME); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_LAUNCH_NUMBER; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.LAUNCH_NUMBER_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.LAUNCH_NUMBER_PK, Keys.UNQ_PROJECT_NAME); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.LAUNCH_NUMBER__LAUNCH_NUMBER_PROJECT_ID_FKEY); + } + + @Override + public JLaunchNumber as(String alias) { + return new JLaunchNumber(DSL.name(alias), this); + } + + @Override + public JLaunchNumber as(Name alias) { + return new JLaunchNumber(alias, this); + } + + /** + * Rename this table + */ + @Override + public JLaunchNumber rename(String name) { + return new JLaunchNumber(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JLaunchNumber rename(Name name) { + return new JLaunchNumber(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLog.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLog.java old mode 100755 new mode 100644 index ff8235a97..023f79df7 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLog.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLog.java @@ -8,10 +8,13 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JLogRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -37,190 +40,186 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JLog extends TableImpl { - /** - * The reference instance of public.log - */ - public static final JLog LOG = new JLog(); - private static final long serialVersionUID = -198837446; - /** - * The column public.log.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('log_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.log.uuid. - */ - public final TableField UUID = createField(DSL.name("uuid"), - org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, ""); - /** - * The column public.log.log_time. - */ - public final TableField LOG_TIME = createField(DSL.name("log_time"), - org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - /** - * The column public.log.log_message. - */ - public final TableField LOG_MESSAGE = createField(DSL.name("log_message"), - org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); - /** - * The column public.log.item_id. - */ - public final TableField ITEM_ID = createField(DSL.name("item_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.log.launch_id. - */ - public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.log.last_modified. - */ - public final TableField LAST_MODIFIED = createField( - DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - /** - * The column public.log.log_level. - */ - public final TableField LOG_LEVEL = createField(DSL.name("log_level"), - org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - /** - * The column public.log.attachment_id. - */ - public final TableField ATTACHMENT_ID = createField(DSL.name("attachment_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.log.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.log.cluster_id. - */ - public final TableField CLUSTER_ID = createField(DSL.name("cluster_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * Create a public.log table reference - */ - public JLog() { - this(DSL.name("log"), null); - } - - /** - * Create an aliased public.log table reference - */ - public JLog(String alias) { - this(DSL.name(alias), LOG); - } - - /** - * Create an aliased public.log table reference - */ - public JLog(Name alias) { - this(alias, LOG); - } - - private JLog(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JLog(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JLog(Table child, ForeignKey key) { - super(child, key, LOG); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JLogRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.LOG_ATTACH_ID_IDX, Indexes.LOG_CLUSTER_IDX, - Indexes.LOG_LAUNCH_ID_IDX, Indexes.LOG_MESSAGE_TRGM_IDX, Indexes.LOG_PK, - Indexes.LOG_PROJECT_ID_LOG_TIME_IDX, Indexes.LOG_PROJECT_IDX, Indexes.LOG_TI_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_LOG; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.LOG_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.LOG_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.LOG__LOG_ITEM_ID_FKEY, - Keys.LOG__LOG_LAUNCH_ID_FKEY, Keys.LOG__LOG_ATTACHMENT_ID_FKEY); - } - - public JTestItem testItem() { - return new JTestItem(this, Keys.LOG__LOG_ITEM_ID_FKEY); - } - - public JLaunch launch() { - return new JLaunch(this, Keys.LOG__LOG_LAUNCH_ID_FKEY); - } - - public JAttachment attachment() { - return new JAttachment(this, Keys.LOG__LOG_ATTACHMENT_ID_FKEY); - } - - @Override - public JLog as(String alias) { - return new JLog(DSL.name(alias), this); - } - - @Override - public JLog as(Name alias) { - return new JLog(alias, this); - } - - /** - * Rename this table - */ - @Override - public JLog rename(String name) { - return new JLog(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JLog rename(Name name) { - return new JLog(name, null); - } - - // ------------------------------------------------------------------------- - // Row11 type methods - // ------------------------------------------------------------------------- - - @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); - } + private static final long serialVersionUID = -198837446; + + /** + * The reference instance of public.log + */ + public static final JLog LOG = new JLog(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JLogRecord.class; + } + + /** + * The column public.log.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('log_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.log.uuid. + */ + public final TableField UUID = createField(DSL.name("uuid"), org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, ""); + + /** + * The column public.log.log_time. + */ + public final TableField LOG_TIME = createField(DSL.name("log_time"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * The column public.log.log_message. + */ + public final TableField LOG_MESSAGE = createField(DSL.name("log_message"), org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column public.log.item_id. + */ + public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.log.launch_id. + */ + public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.log.last_modified. + */ + public final TableField LAST_MODIFIED = createField(DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * The column public.log.log_level. + */ + public final TableField LOG_LEVEL = createField(DSL.name("log_level"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column public.log.attachment_id. + */ + public final TableField ATTACHMENT_ID = createField(DSL.name("attachment_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.log.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.log.cluster_id. + */ + public final TableField CLUSTER_ID = createField(DSL.name("cluster_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * Create a public.log table reference + */ + public JLog() { + this(DSL.name("log"), null); + } + + /** + * Create an aliased public.log table reference + */ + public JLog(String alias) { + this(DSL.name(alias), LOG); + } + + /** + * Create an aliased public.log table reference + */ + public JLog(Name alias) { + this(alias, LOG); + } + + private JLog(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JLog(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JLog(Table child, ForeignKey key) { + super(child, key, LOG); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.LOG_ATTACH_ID_IDX, Indexes.LOG_CLUSTER_IDX, Indexes.LOG_LAUNCH_ID_IDX, Indexes.LOG_MESSAGE_TRGM_IDX, Indexes.LOG_PK, Indexes.LOG_PROJECT_ID_LOG_TIME_IDX, Indexes.LOG_PROJECT_IDX, Indexes.LOG_TI_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_LOG; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.LOG_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.LOG_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.LOG__LOG_ITEM_ID_FKEY, Keys.LOG__LOG_LAUNCH_ID_FKEY, Keys.LOG__LOG_ATTACHMENT_ID_FKEY); + } + + public JTestItem testItem() { + return new JTestItem(this, Keys.LOG__LOG_ITEM_ID_FKEY); + } + + public JLaunch launch() { + return new JLaunch(this, Keys.LOG__LOG_LAUNCH_ID_FKEY); + } + + public JAttachment attachment() { + return new JAttachment(this, Keys.LOG__LOG_ATTACHMENT_ID_FKEY); + } + + @Override + public JLog as(String alias) { + return new JLog(DSL.name(alias), this); + } + + @Override + public JLog as(Name alias) { + return new JLog(alias, this); + } + + /** + * Rename this table + */ + @Override + public JLog rename(String name) { + return new JLog(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JLog rename(Name name) { + return new JLog(name, null); + } + + // ------------------------------------------------------------------------- + // Row11 type methods + // ------------------------------------------------------------------------- + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthAccessToken.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthAccessToken.java old mode 100755 new mode 100644 index 8d278e1c3..3153ca63c --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthAccessToken.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthAccessToken.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JOauthAccessTokenRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -36,174 +39,168 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JOauthAccessToken extends TableImpl { - /** - * The reference instance of public.oauth_access_token - */ - public static final JOauthAccessToken OAUTH_ACCESS_TOKEN = new JOauthAccessToken(); - private static final long serialVersionUID = -1465585063; - /** - * The column public.oauth_access_token.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('oauth_access_token_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.oauth_access_token.token_id. - */ - public final TableField TOKEN_ID = createField( - DSL.name("token_id"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - /** - * The column public.oauth_access_token.token. - */ - public final TableField TOKEN = createField(DSL.name("token"), - org.jooq.impl.SQLDataType.BLOB, this, ""); - /** - * The column public.oauth_access_token.authentication_id. - */ - public final TableField AUTHENTICATION_ID = createField( - DSL.name("authentication_id"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - /** - * The column public.oauth_access_token.username. - */ - public final TableField USERNAME = createField( - DSL.name("username"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - /** - * The column public.oauth_access_token.user_id. - */ - public final TableField USER_ID = createField(DSL.name("user_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.oauth_access_token.client_id. - */ - public final TableField CLIENT_ID = createField( - DSL.name("client_id"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - /** - * The column public.oauth_access_token.authentication. - */ - public final TableField AUTHENTICATION = createField( - DSL.name("authentication"), org.jooq.impl.SQLDataType.BLOB, this, ""); - /** - * The column public.oauth_access_token.refresh_token. - */ - public final TableField REFRESH_TOKEN = createField( - DSL.name("refresh_token"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - - /** - * Create a public.oauth_access_token table reference - */ - public JOauthAccessToken() { - this(DSL.name("oauth_access_token"), null); - } - - /** - * Create an aliased public.oauth_access_token table reference - */ - public JOauthAccessToken(String alias) { - this(DSL.name(alias), OAUTH_ACCESS_TOKEN); - } - - /** - * Create an aliased public.oauth_access_token table reference - */ - public JOauthAccessToken(Name alias) { - this(alias, OAUTH_ACCESS_TOKEN); - } - - private JOauthAccessToken(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JOauthAccessToken(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JOauthAccessToken(Table child, - ForeignKey key) { - super(child, key, OAUTH_ACCESS_TOKEN); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JOauthAccessTokenRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.OAUTH_ACCESS_TOKEN_PKEY, Indexes.OAUTH_AT_USER_IDX, - Indexes.USERS_ACCESS_TOKEN_UNIQUE); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_OAUTH_ACCESS_TOKEN; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.OAUTH_ACCESS_TOKEN_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.OAUTH_ACCESS_TOKEN_PKEY, - Keys.USERS_ACCESS_TOKEN_UNIQUE); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY); - } - - public JUsers users() { - return new JUsers(this, Keys.OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY); - } - - @Override - public JOauthAccessToken as(String alias) { - return new JOauthAccessToken(DSL.name(alias), this); - } - - @Override - public JOauthAccessToken as(Name alias) { - return new JOauthAccessToken(alias, this); - } - - /** - * Rename this table - */ - @Override - public JOauthAccessToken rename(String name) { - return new JOauthAccessToken(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JOauthAccessToken rename(Name name) { - return new JOauthAccessToken(name, null); - } - - // ------------------------------------------------------------------------- - // Row9 type methods - // ------------------------------------------------------------------------- - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } + private static final long serialVersionUID = -1465585063; + + /** + * The reference instance of public.oauth_access_token + */ + public static final JOauthAccessToken OAUTH_ACCESS_TOKEN = new JOauthAccessToken(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JOauthAccessTokenRecord.class; + } + + /** + * The column public.oauth_access_token.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('oauth_access_token_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.oauth_access_token.token_id. + */ + public final TableField TOKEN_ID = createField(DSL.name("token_id"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); + + /** + * The column public.oauth_access_token.token. + */ + public final TableField TOKEN = createField(DSL.name("token"), org.jooq.impl.SQLDataType.BLOB, this, ""); + + /** + * The column public.oauth_access_token.authentication_id. + */ + public final TableField AUTHENTICATION_ID = createField(DSL.name("authentication_id"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); + + /** + * The column public.oauth_access_token.username. + */ + public final TableField USERNAME = createField(DSL.name("username"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); + + /** + * The column public.oauth_access_token.user_id. + */ + public final TableField USER_ID = createField(DSL.name("user_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.oauth_access_token.client_id. + */ + public final TableField CLIENT_ID = createField(DSL.name("client_id"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); + + /** + * The column public.oauth_access_token.authentication. + */ + public final TableField AUTHENTICATION = createField(DSL.name("authentication"), org.jooq.impl.SQLDataType.BLOB, this, ""); + + /** + * The column public.oauth_access_token.refresh_token. + */ + public final TableField REFRESH_TOKEN = createField(DSL.name("refresh_token"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); + + /** + * Create a public.oauth_access_token table reference + */ + public JOauthAccessToken() { + this(DSL.name("oauth_access_token"), null); + } + + /** + * Create an aliased public.oauth_access_token table reference + */ + public JOauthAccessToken(String alias) { + this(DSL.name(alias), OAUTH_ACCESS_TOKEN); + } + + /** + * Create an aliased public.oauth_access_token table reference + */ + public JOauthAccessToken(Name alias) { + this(alias, OAUTH_ACCESS_TOKEN); + } + + private JOauthAccessToken(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JOauthAccessToken(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JOauthAccessToken(Table child, ForeignKey key) { + super(child, key, OAUTH_ACCESS_TOKEN); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.OAUTH_ACCESS_TOKEN_PKEY, Indexes.OAUTH_AT_USER_IDX, Indexes.USERS_ACCESS_TOKEN_UNIQUE); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_OAUTH_ACCESS_TOKEN; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.OAUTH_ACCESS_TOKEN_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.OAUTH_ACCESS_TOKEN_PKEY, Keys.USERS_ACCESS_TOKEN_UNIQUE); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY); + } + + public JUsers users() { + return new JUsers(this, Keys.OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY); + } + + @Override + public JOauthAccessToken as(String alias) { + return new JOauthAccessToken(DSL.name(alias), this); + } + + @Override + public JOauthAccessToken as(Name alias) { + return new JOauthAccessToken(alias, this); + } + + /** + * Rename this table + */ + @Override + public JOauthAccessToken rename(String name) { + return new JOauthAccessToken(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JOauthAccessToken rename(Name name) { + return new JOauthAccessToken(name, null); + } + + // ------------------------------------------------------------------------- + // Row9 type methods + // ------------------------------------------------------------------------- + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistration.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistration.java index 172c17220..8aa550cad 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistration.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistration.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -35,173 +38,169 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JOauthRegistration extends TableImpl { - /** - * The reference instance of public.oauth_registration - */ - public static final JOauthRegistration OAUTH_REGISTRATION = new JOauthRegistration(); - private static final long serialVersionUID = -982956746; - /** - * The column public.oauth_registration.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, ""); - /** - * The column public.oauth_registration.client_id. - */ - public final TableField CLIENT_ID = createField( - DSL.name("client_id"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - /** - * The column public.oauth_registration.client_secret. - */ - public final TableField CLIENT_SECRET = createField( - DSL.name("client_secret"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - /** - * The column public.oauth_registration.client_auth_method. - */ - public final TableField CLIENT_AUTH_METHOD = createField( - DSL.name("client_auth_method"), org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, - ""); - /** - * The column public.oauth_registration.auth_grant_type. - */ - public final TableField AUTH_GRANT_TYPE = createField( - DSL.name("auth_grant_type"), org.jooq.impl.SQLDataType.VARCHAR(64), this, ""); - /** - * The column public.oauth_registration.redirect_uri_template. - */ - public final TableField REDIRECT_URI_TEMPLATE = createField( - DSL.name("redirect_uri_template"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - /** - * The column public.oauth_registration.authorization_uri. - */ - public final TableField AUTHORIZATION_URI = createField( - DSL.name("authorization_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - /** - * The column public.oauth_registration.token_uri. - */ - public final TableField TOKEN_URI = createField( - DSL.name("token_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - /** - * The column public.oauth_registration.user_info_endpoint_uri. - */ - public final TableField USER_INFO_ENDPOINT_URI = createField( - DSL.name("user_info_endpoint_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - /** - * The column public.oauth_registration.user_info_endpoint_name_attr. - */ - public final TableField USER_INFO_ENDPOINT_NAME_ATTR = createField( - DSL.name("user_info_endpoint_name_attr"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - /** - * The column public.oauth_registration.jwk_set_uri. - */ - public final TableField JWK_SET_URI = createField( - DSL.name("jwk_set_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - /** - * The column public.oauth_registration.client_name. - */ - public final TableField CLIENT_NAME = createField( - DSL.name("client_name"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); - - /** - * Create a public.oauth_registration table reference - */ - public JOauthRegistration() { - this(DSL.name("oauth_registration"), null); - } - - /** - * Create an aliased public.oauth_registration table reference - */ - public JOauthRegistration(String alias) { - this(DSL.name(alias), OAUTH_REGISTRATION); - } - - /** - * Create an aliased public.oauth_registration table reference - */ - public JOauthRegistration(Name alias) { - this(alias, OAUTH_REGISTRATION); - } - - private JOauthRegistration(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JOauthRegistration(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JOauthRegistration(Table child, - ForeignKey key) { - super(child, key, OAUTH_REGISTRATION); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JOauthRegistrationRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.OAUTH_REGISTRATION_CLIENT_ID_KEY, - Indexes.OAUTH_REGISTRATION_PKEY); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.OAUTH_REGISTRATION_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.OAUTH_REGISTRATION_PKEY, - Keys.OAUTH_REGISTRATION_CLIENT_ID_KEY); - } - - @Override - public JOauthRegistration as(String alias) { - return new JOauthRegistration(DSL.name(alias), this); - } - - @Override - public JOauthRegistration as(Name alias) { - return new JOauthRegistration(alias, this); - } - - /** - * Rename this table - */ - @Override - public JOauthRegistration rename(String name) { - return new JOauthRegistration(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JOauthRegistration rename(Name name) { - return new JOauthRegistration(name, null); - } - - // ------------------------------------------------------------------------- - // Row12 type methods - // ------------------------------------------------------------------------- - - @Override - public Row12 fieldsRow() { - return (Row12) super.fieldsRow(); - } + private static final long serialVersionUID = -982956746; + + /** + * The reference instance of public.oauth_registration + */ + public static final JOauthRegistration OAUTH_REGISTRATION = new JOauthRegistration(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JOauthRegistrationRecord.class; + } + + /** + * The column public.oauth_registration.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, ""); + + /** + * The column public.oauth_registration.client_id. + */ + public final TableField CLIENT_ID = createField(DSL.name("client_id"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); + + /** + * The column public.oauth_registration.client_secret. + */ + public final TableField CLIENT_SECRET = createField(DSL.name("client_secret"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + + /** + * The column public.oauth_registration.client_auth_method. + */ + public final TableField CLIENT_AUTH_METHOD = createField(DSL.name("client_auth_method"), org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, ""); + + /** + * The column public.oauth_registration.auth_grant_type. + */ + public final TableField AUTH_GRANT_TYPE = createField(DSL.name("auth_grant_type"), org.jooq.impl.SQLDataType.VARCHAR(64), this, ""); + + /** + * The column public.oauth_registration.redirect_uri_template. + */ + public final TableField REDIRECT_URI_TEMPLATE = createField(DSL.name("redirect_uri_template"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + + /** + * The column public.oauth_registration.authorization_uri. + */ + public final TableField AUTHORIZATION_URI = createField(DSL.name("authorization_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + + /** + * The column public.oauth_registration.token_uri. + */ + public final TableField TOKEN_URI = createField(DSL.name("token_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + + /** + * The column public.oauth_registration.user_info_endpoint_uri. + */ + public final TableField USER_INFO_ENDPOINT_URI = createField(DSL.name("user_info_endpoint_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + + /** + * The column public.oauth_registration.user_info_endpoint_name_attr. + */ + public final TableField USER_INFO_ENDPOINT_NAME_ATTR = createField(DSL.name("user_info_endpoint_name_attr"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + + /** + * The column public.oauth_registration.jwk_set_uri. + */ + public final TableField JWK_SET_URI = createField(DSL.name("jwk_set_uri"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + + /** + * The column public.oauth_registration.client_name. + */ + public final TableField CLIENT_NAME = createField(DSL.name("client_name"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); + + /** + * Create a public.oauth_registration table reference + */ + public JOauthRegistration() { + this(DSL.name("oauth_registration"), null); + } + + /** + * Create an aliased public.oauth_registration table reference + */ + public JOauthRegistration(String alias) { + this(DSL.name(alias), OAUTH_REGISTRATION); + } + + /** + * Create an aliased public.oauth_registration table reference + */ + public JOauthRegistration(Name alias) { + this(alias, OAUTH_REGISTRATION); + } + + private JOauthRegistration(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JOauthRegistration(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JOauthRegistration(Table child, ForeignKey key) { + super(child, key, OAUTH_REGISTRATION); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.OAUTH_REGISTRATION_CLIENT_ID_KEY, Indexes.OAUTH_REGISTRATION_PKEY); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.OAUTH_REGISTRATION_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.OAUTH_REGISTRATION_PKEY, Keys.OAUTH_REGISTRATION_CLIENT_ID_KEY); + } + + @Override + public JOauthRegistration as(String alias) { + return new JOauthRegistration(DSL.name(alias), this); + } + + @Override + public JOauthRegistration as(Name alias) { + return new JOauthRegistration(alias, this); + } + + /** + * Rename this table + */ + @Override + public JOauthRegistration rename(String name) { + return new JOauthRegistration(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JOauthRegistration rename(Name name) { + return new JOauthRegistration(name, null); + } + + // ------------------------------------------------------------------------- + // Row12 type methods + // ------------------------------------------------------------------------- + + @Override + public Row12 fieldsRow() { + return (Row12) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationRestriction.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationRestriction.java index 8da01d6ac..63d523eb2 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationRestriction.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationRestriction.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationRestrictionRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -36,151 +39,143 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JOauthRegistrationRestriction extends TableImpl { - /** - * The reference instance of public.oauth_registration_restriction - */ - public static final JOauthRegistrationRestriction OAUTH_REGISTRATION_RESTRICTION = new JOauthRegistrationRestriction(); - private static final long serialVersionUID = -973937527; - /** - * The column public.oauth_registration_restriction.id. - */ - public final TableField ID = createField( - DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('oauth_registration_restriction_id_seq'::regclass)", - org.jooq.impl.SQLDataType.INTEGER)), this, ""); - /** - * The column public.oauth_registration_restriction.oauth_registration_fk. - */ - public final TableField OAUTH_REGISTRATION_FK = createField( - DSL.name("oauth_registration_fk"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); - /** - * The column public.oauth_registration_restriction.type. - */ - public final TableField TYPE = createField( - DSL.name("type"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - /** - * The column public.oauth_registration_restriction.value. - */ - public final TableField VALUE = createField( - DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - - /** - * Create a public.oauth_registration_restriction table reference - */ - public JOauthRegistrationRestriction() { - this(DSL.name("oauth_registration_restriction"), null); - } - - /** - * Create an aliased public.oauth_registration_restriction table reference - */ - public JOauthRegistrationRestriction(String alias) { - this(DSL.name(alias), OAUTH_REGISTRATION_RESTRICTION); - } - - /** - * Create an aliased public.oauth_registration_restriction table reference - */ - public JOauthRegistrationRestriction(Name alias) { - this(alias, OAUTH_REGISTRATION_RESTRICTION); - } - - private JOauthRegistrationRestriction(Name alias, - Table aliased) { - this(alias, aliased, null); - } - - private JOauthRegistrationRestriction(Name alias, - Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JOauthRegistrationRestriction(Table child, - ForeignKey key) { - super(child, key, OAUTH_REGISTRATION_RESTRICTION); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JOauthRegistrationRestrictionRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.OAUTH_REGISTRATION_RESTRICTION_PK, - Indexes.OAUTH_REGISTRATION_RESTRICTION_UNIQUE); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_OAUTH_REGISTRATION_RESTRICTION; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.OAUTH_REGISTRATION_RESTRICTION_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList( - Keys.OAUTH_REGISTRATION_RESTRICTION_PK, Keys.OAUTH_REGISTRATION_RESTRICTION_UNIQUE); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY); - } - - public JOauthRegistration oauthRegistration() { - return new JOauthRegistration(this, - Keys.OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY); - } - - @Override - public JOauthRegistrationRestriction as(String alias) { - return new JOauthRegistrationRestriction(DSL.name(alias), this); - } - - @Override - public JOauthRegistrationRestriction as(Name alias) { - return new JOauthRegistrationRestriction(alias, this); - } - - /** - * Rename this table - */ - @Override - public JOauthRegistrationRestriction rename(String name) { - return new JOauthRegistrationRestriction(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JOauthRegistrationRestriction rename(Name name) { - return new JOauthRegistrationRestriction(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + private static final long serialVersionUID = -973937527; + + /** + * The reference instance of public.oauth_registration_restriction + */ + public static final JOauthRegistrationRestriction OAUTH_REGISTRATION_RESTRICTION = new JOauthRegistrationRestriction(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JOauthRegistrationRestrictionRecord.class; + } + + /** + * The column public.oauth_registration_restriction.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('oauth_registration_restriction_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); + + /** + * The column public.oauth_registration_restriction.oauth_registration_fk. + */ + public final TableField OAUTH_REGISTRATION_FK = createField(DSL.name("oauth_registration_fk"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); + + /** + * The column public.oauth_registration_restriction.type. + */ + public final TableField TYPE = createField(DSL.name("type"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + + /** + * The column public.oauth_registration_restriction.value. + */ + public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + + /** + * Create a public.oauth_registration_restriction table reference + */ + public JOauthRegistrationRestriction() { + this(DSL.name("oauth_registration_restriction"), null); + } + + /** + * Create an aliased public.oauth_registration_restriction table reference + */ + public JOauthRegistrationRestriction(String alias) { + this(DSL.name(alias), OAUTH_REGISTRATION_RESTRICTION); + } + + /** + * Create an aliased public.oauth_registration_restriction table reference + */ + public JOauthRegistrationRestriction(Name alias) { + this(alias, OAUTH_REGISTRATION_RESTRICTION); + } + + private JOauthRegistrationRestriction(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JOauthRegistrationRestriction(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JOauthRegistrationRestriction(Table child, ForeignKey key) { + super(child, key, OAUTH_REGISTRATION_RESTRICTION); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.OAUTH_REGISTRATION_RESTRICTION_PK, Indexes.OAUTH_REGISTRATION_RESTRICTION_UNIQUE); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_OAUTH_REGISTRATION_RESTRICTION; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.OAUTH_REGISTRATION_RESTRICTION_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.OAUTH_REGISTRATION_RESTRICTION_PK, Keys.OAUTH_REGISTRATION_RESTRICTION_UNIQUE); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY); + } + + public JOauthRegistration oauthRegistration() { + return new JOauthRegistration(this, Keys.OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY); + } + + @Override + public JOauthRegistrationRestriction as(String alias) { + return new JOauthRegistrationRestriction(DSL.name(alias), this); + } + + @Override + public JOauthRegistrationRestriction as(Name alias) { + return new JOauthRegistrationRestriction(alias, this); + } + + /** + * Rename this table + */ + @Override + public JOauthRegistrationRestriction rename(String name) { + return new JOauthRegistrationRestriction(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JOauthRegistrationRestriction rename(Name name) { + return new JOauthRegistrationRestriction(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationScope.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationScope.java old mode 100755 new mode 100644 index dec7c213c..f5ea776bd --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationScope.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthRegistrationScope.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationScopeRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -36,145 +39,138 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JOauthRegistrationScope extends TableImpl { - /** - * The reference instance of public.oauth_registration_scope - */ - public static final JOauthRegistrationScope OAUTH_REGISTRATION_SCOPE = new JOauthRegistrationScope(); - private static final long serialVersionUID = -729490491; - /** - * The column public.oauth_registration_scope.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('oauth_registration_scope_id_seq'::regclass)", - org.jooq.impl.SQLDataType.INTEGER)), this, ""); - /** - * The column public.oauth_registration_scope.oauth_registration_fk. - */ - public final TableField OAUTH_REGISTRATION_FK = createField( - DSL.name("oauth_registration_fk"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); - /** - * The column public.oauth_registration_scope.scope. - */ - public final TableField SCOPE = createField( - DSL.name("scope"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * Create a public.oauth_registration_scope table reference - */ - public JOauthRegistrationScope() { - this(DSL.name("oauth_registration_scope"), null); - } - - /** - * Create an aliased public.oauth_registration_scope table reference - */ - public JOauthRegistrationScope(String alias) { - this(DSL.name(alias), OAUTH_REGISTRATION_SCOPE); - } - - /** - * Create an aliased public.oauth_registration_scope table reference - */ - public JOauthRegistrationScope(Name alias) { - this(alias, OAUTH_REGISTRATION_SCOPE); - } - - private JOauthRegistrationScope(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JOauthRegistrationScope(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JOauthRegistrationScope(Table child, - ForeignKey key) { - super(child, key, OAUTH_REGISTRATION_SCOPE); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JOauthRegistrationScopeRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.OAUTH_REGISTRATION_SCOPE_PK, - Indexes.OAUTH_REGISTRATION_SCOPE_UNIQUE); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_OAUTH_REGISTRATION_SCOPE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.OAUTH_REGISTRATION_SCOPE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.OAUTH_REGISTRATION_SCOPE_PK, - Keys.OAUTH_REGISTRATION_SCOPE_UNIQUE); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY); - } - - public JOauthRegistration oauthRegistration() { - return new JOauthRegistration(this, - Keys.OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY); - } - - @Override - public JOauthRegistrationScope as(String alias) { - return new JOauthRegistrationScope(DSL.name(alias), this); - } - - @Override - public JOauthRegistrationScope as(Name alias) { - return new JOauthRegistrationScope(alias, this); - } - - /** - * Rename this table - */ - @Override - public JOauthRegistrationScope rename(String name) { - return new JOauthRegistrationScope(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JOauthRegistrationScope rename(Name name) { - return new JOauthRegistrationScope(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + private static final long serialVersionUID = -729490491; + + /** + * The reference instance of public.oauth_registration_scope + */ + public static final JOauthRegistrationScope OAUTH_REGISTRATION_SCOPE = new JOauthRegistrationScope(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JOauthRegistrationScopeRecord.class; + } + + /** + * The column public.oauth_registration_scope.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('oauth_registration_scope_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); + + /** + * The column public.oauth_registration_scope.oauth_registration_fk. + */ + public final TableField OAUTH_REGISTRATION_FK = createField(DSL.name("oauth_registration_fk"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); + + /** + * The column public.oauth_registration_scope.scope. + */ + public final TableField SCOPE = createField(DSL.name("scope"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + + /** + * Create a public.oauth_registration_scope table reference + */ + public JOauthRegistrationScope() { + this(DSL.name("oauth_registration_scope"), null); + } + + /** + * Create an aliased public.oauth_registration_scope table reference + */ + public JOauthRegistrationScope(String alias) { + this(DSL.name(alias), OAUTH_REGISTRATION_SCOPE); + } + + /** + * Create an aliased public.oauth_registration_scope table reference + */ + public JOauthRegistrationScope(Name alias) { + this(alias, OAUTH_REGISTRATION_SCOPE); + } + + private JOauthRegistrationScope(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JOauthRegistrationScope(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JOauthRegistrationScope(Table child, ForeignKey key) { + super(child, key, OAUTH_REGISTRATION_SCOPE); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.OAUTH_REGISTRATION_SCOPE_PK, Indexes.OAUTH_REGISTRATION_SCOPE_UNIQUE); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_OAUTH_REGISTRATION_SCOPE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.OAUTH_REGISTRATION_SCOPE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.OAUTH_REGISTRATION_SCOPE_PK, Keys.OAUTH_REGISTRATION_SCOPE_UNIQUE); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY); + } + + public JOauthRegistration oauthRegistration() { + return new JOauthRegistration(this, Keys.OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY); + } + + @Override + public JOauthRegistrationScope as(String alias) { + return new JOauthRegistrationScope(DSL.name(alias), this); + } + + @Override + public JOauthRegistrationScope as(Name alias) { + return new JOauthRegistrationScope(alias, this); + } + + /** + * Rename this table + */ + @Override + public JOauthRegistrationScope rename(String name) { + return new JOauthRegistrationScope(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JOauthRegistrationScope rename(Name name) { + return new JOauthRegistrationScope(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOnboarding.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOnboarding.java index debed3b2f..da8518405 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOnboarding.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOnboarding.java @@ -8,10 +8,13 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JOnboardingRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -37,140 +40,139 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JOnboarding extends TableImpl { - /** - * The reference instance of public.onboarding - */ - public static final JOnboarding ONBOARDING = new JOnboarding(); - private static final long serialVersionUID = -1798770038; - /** - * The column public.onboarding.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.SMALLINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('onboarding_id_seq'::regclass)", - org.jooq.impl.SQLDataType.SMALLINT)), this, ""); - /** - * The column public.onboarding.data. - */ - public final TableField DATA = createField(DSL.name("data"), - org.jooq.impl.SQLDataType.CLOB, this, ""); - /** - * The column public.onboarding.page. - */ - public final TableField PAGE = createField(DSL.name("page"), - org.jooq.impl.SQLDataType.VARCHAR(50).nullable(false), this, ""); - /** - * The column public.onboarding.available_from. - */ - public final TableField AVAILABLE_FROM = createField( - DSL.name("available_from"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - /** - * The column public.onboarding.available_to. - */ - public final TableField AVAILABLE_TO = createField( - DSL.name("available_to"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - - /** - * Create a public.onboarding table reference - */ - public JOnboarding() { - this(DSL.name("onboarding"), null); - } - - /** - * Create an aliased public.onboarding table reference - */ - public JOnboarding(String alias) { - this(DSL.name(alias), ONBOARDING); - } - - /** - * Create an aliased public.onboarding table reference - */ - public JOnboarding(Name alias) { - this(alias, ONBOARDING); - } - - private JOnboarding(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JOnboarding(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JOnboarding(Table child, ForeignKey key) { - super(child, key, ONBOARDING); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JOnboardingRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ONBOARDING_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ONBOARDING; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ONBOARDING_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ONBOARDING_PK); - } - - @Override - public JOnboarding as(String alias) { - return new JOnboarding(DSL.name(alias), this); - } - - @Override - public JOnboarding as(Name alias) { - return new JOnboarding(alias, this); - } - - /** - * Rename this table - */ - @Override - public JOnboarding rename(String name) { - return new JOnboarding(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JOnboarding rename(Name name) { - return new JOnboarding(name, null); - } - - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } + private static final long serialVersionUID = -1798770038; + + /** + * The reference instance of public.onboarding + */ + public static final JOnboarding ONBOARDING = new JOnboarding(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JOnboardingRecord.class; + } + + /** + * The column public.onboarding.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.SMALLINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('onboarding_id_seq'::regclass)", org.jooq.impl.SQLDataType.SMALLINT)), this, ""); + + /** + * The column public.onboarding.data. + */ + public final TableField DATA = createField(DSL.name("data"), org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column public.onboarding.page. + */ + public final TableField PAGE = createField(DSL.name("page"), org.jooq.impl.SQLDataType.VARCHAR(50).nullable(false), this, ""); + + /** + * The column public.onboarding.available_from. + */ + public final TableField AVAILABLE_FROM = createField(DSL.name("available_from"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + + /** + * The column public.onboarding.available_to. + */ + public final TableField AVAILABLE_TO = createField(DSL.name("available_to"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + + /** + * Create a public.onboarding table reference + */ + public JOnboarding() { + this(DSL.name("onboarding"), null); + } + + /** + * Create an aliased public.onboarding table reference + */ + public JOnboarding(String alias) { + this(DSL.name(alias), ONBOARDING); + } + + /** + * Create an aliased public.onboarding table reference + */ + public JOnboarding(Name alias) { + this(alias, ONBOARDING); + } + + private JOnboarding(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JOnboarding(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JOnboarding(Table child, ForeignKey key) { + super(child, key, ONBOARDING); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ONBOARDING_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ONBOARDING; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ONBOARDING_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ONBOARDING_PK); + } + + @Override + public JOnboarding as(String alias) { + return new JOnboarding(DSL.name(alias), this); + } + + @Override + public JOnboarding as(Name alias) { + return new JOnboarding(alias, this); + } + + /** + * Rename this table + */ + @Override + public JOnboarding rename(String name) { + return new JOnboarding(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JOnboarding rename(Name name) { + return new JOnboarding(name, null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganization.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganization.java new file mode 100644 index 000000000..d81926b91 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganization.java @@ -0,0 +1,162 @@ +/* + * This file is generated by jOOQ. + */ +package com.epam.ta.reportportal.jooq.tables; + + +import com.epam.ta.reportportal.jooq.Indexes; +import com.epam.ta.reportportal.jooq.JPublic; +import com.epam.ta.reportportal.jooq.Keys; +import com.epam.ta.reportportal.jooq.tables.records.JOrganizationRecord; + +import java.util.Arrays; +import java.util.List; + +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row2; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.4" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JOrganization extends TableImpl { + + private static final long serialVersionUID = -239155074; + + /** + * The reference instance of public.organization + */ + public static final JOrganization ORGANIZATION = new JOrganization(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JOrganizationRecord.class; + } + + /** + * The column public.organization.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('organization_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.organization.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); + + /** + * Create a public.organization table reference + */ + public JOrganization() { + this(DSL.name("organization"), null); + } + + /** + * Create an aliased public.organization table reference + */ + public JOrganization(String alias) { + this(DSL.name(alias), ORGANIZATION); + } + + /** + * Create an aliased public.organization table reference + */ + public JOrganization(Name alias) { + this(alias, ORGANIZATION); + } + + private JOrganization(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JOrganization(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JOrganization(Table child, ForeignKey key) { + super(child, key, ORGANIZATION); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ORGANIZATION_PKEY); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ORGANIZATION; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ORGANIZATION_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ORGANIZATION_PKEY); + } + + @Override + public JOrganization as(String alias) { + return new JOrganization(DSL.name(alias), this); + } + + @Override + public JOrganization as(Name alias) { + return new JOrganization(alias, this); + } + + /** + * Rename this table + */ + @Override + public JOrganization rename(String name) { + return new JOrganization(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JOrganization rename(Name name) { + return new JOrganization(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } +} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganizationAttribute.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganizationAttribute.java new file mode 100644 index 000000000..fecb54a8a --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganizationAttribute.java @@ -0,0 +1,182 @@ +/* + * This file is generated by jOOQ. + */ +package com.epam.ta.reportportal.jooq.tables; + +import com.epam.ta.reportportal.jooq.Indexes; +import com.epam.ta.reportportal.jooq.JPublic; +import com.epam.ta.reportportal.jooq.Keys; +import com.epam.ta.reportportal.jooq.tables.records.JOrganizationAttributeRecord; +import java.util.Arrays; +import java.util.List; +import javax.annotation.processing.Generated; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row5; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.4" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JOrganizationAttribute extends TableImpl { + + private static final long serialVersionUID = 1240174929; + + /** + * The reference instance of public.organization_attribute + */ + public static final JOrganizationAttribute ORGANIZATION_ATTRIBUTE = new JOrganizationAttribute(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JOrganizationAttributeRecord.class; + } + + /** + * The column public.organization_attribute.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('organization_attribute_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.organization_attribute.key. + */ + public final TableField KEY = createField(DSL.name("key"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + + /** + * The column public.organization_attribute.value. + */ + public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + + /** + * The column public.organization_attribute.system. + */ + public final TableField SYSTEM = createField(DSL.name("system"), org.jooq.impl.SQLDataType.BOOLEAN, this, ""); + + /** + * The column public.organization_attribute.organization_id. + */ + public final TableField ORGANIZATION_ID = createField(DSL.name("organization_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * Create a public.organization_attribute table reference + */ + public JOrganizationAttribute() { + this(DSL.name("organization_attribute"), null); + } + + /** + * Create an aliased public.organization_attribute table reference + */ + public JOrganizationAttribute(String alias) { + this(DSL.name(alias), ORGANIZATION_ATTRIBUTE); + } + + /** + * Create an aliased public.organization_attribute table reference + */ + public JOrganizationAttribute(Name alias) { + this(alias, ORGANIZATION_ATTRIBUTE); + } + + private JOrganizationAttribute(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JOrganizationAttribute(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JOrganizationAttribute(Table child, ForeignKey key) { + super(child, key, ORGANIZATION_ATTRIBUTE); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ORGANIZATION_ATTRIBUTE_PKEY); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ORGANIZATION_ATTRIBUTE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ORGANIZATION_ATTRIBUTE_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ORGANIZATION_ATTRIBUTE_PKEY); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ORGANIZATION_ATTRIBUTE__ORGANIZATION_ATTRIBUTE_ORGANIZATION_ID_FKEY); + } + + public JOrganization organization() { + return new JOrganization(this, Keys.ORGANIZATION_ATTRIBUTE__ORGANIZATION_ATTRIBUTE_ORGANIZATION_ID_FKEY); + } + + @Override + public JOrganizationAttribute as(String alias) { + return new JOrganizationAttribute(DSL.name(alias), this); + } + + @Override + public JOrganizationAttribute as(Name alias) { + return new JOrganizationAttribute(alias, this); + } + + /** + * Rename this table + */ + @Override + public JOrganizationAttribute rename(String name) { + return new JOrganizationAttribute(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JOrganizationAttribute rename(Name name) { + return new JOrganizationAttribute(name, null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } +} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOwnedEntity.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOwnedEntity.java new file mode 100644 index 000000000..46ddbcbbd --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOwnedEntity.java @@ -0,0 +1,176 @@ +/* + * This file is generated by jOOQ. + */ +package com.epam.ta.reportportal.jooq.tables; + + +import com.epam.ta.reportportal.jooq.Indexes; +import com.epam.ta.reportportal.jooq.JPublic; +import com.epam.ta.reportportal.jooq.Keys; +import com.epam.ta.reportportal.jooq.tables.records.JOwnedEntityRecord; + +import java.util.Arrays; +import java.util.List; + +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row3; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.4" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JOwnedEntity extends TableImpl { + + private static final long serialVersionUID = 1859921375; + + /** + * The reference instance of public.owned_entity + */ + public static final JOwnedEntity OWNED_ENTITY = new JOwnedEntity(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JOwnedEntityRecord.class; + } + + /** + * The column public.owned_entity.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('shareable_entity_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.owned_entity.owner. + */ + public final TableField OWNER = createField(DSL.name("owner"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * The column public.owned_entity.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.owned_entity table reference + */ + public JOwnedEntity() { + this(DSL.name("owned_entity"), null); + } + + /** + * Create an aliased public.owned_entity table reference + */ + public JOwnedEntity(String alias) { + this(DSL.name(alias), OWNED_ENTITY); + } + + /** + * Create an aliased public.owned_entity table reference + */ + public JOwnedEntity(Name alias) { + this(alias, OWNED_ENTITY); + } + + private JOwnedEntity(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JOwnedEntity(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JOwnedEntity(Table child, ForeignKey key) { + super(child, key, OWNED_ENTITY); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.SHAREABLE_PK, Indexes.SHARED_ENTITY_OWNERX, Indexes.SHARED_ENTITY_PROJECT_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_OWNED_ENTITY; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.SHAREABLE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.SHAREABLE_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.OWNED_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.OWNED_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY); + } + + @Override + public JOwnedEntity as(String alias) { + return new JOwnedEntity(DSL.name(alias), this); + } + + @Override + public JOwnedEntity as(Name alias) { + return new JOwnedEntity(alias, this); + } + + /** + * Rename this table + */ + @Override + public JOwnedEntity rename(String name) { + return new JOwnedEntity(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JOwnedEntity rename(Name name) { + return new JOwnedEntity(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } +} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JParameter.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JParameter.java old mode 100755 new mode 100644 index f52b1b9c3..83a277958 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JParameter.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JParameter.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JParameterRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -34,122 +37,123 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JParameter extends TableImpl { - /** - * The reference instance of public.parameter - */ - public static final JParameter PARAMETER = new JParameter(); - private static final long serialVersionUID = 870603839; - /** - * The column public.parameter.item_id. - */ - public final TableField ITEM_ID = createField(DSL.name("item_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.parameter.key. - */ - public final TableField KEY = createField(DSL.name("key"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.parameter.value. - */ - public final TableField VALUE = createField(DSL.name("value"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * Create a public.parameter table reference - */ - public JParameter() { - this(DSL.name("parameter"), null); - } - - /** - * Create an aliased public.parameter table reference - */ - public JParameter(String alias) { - this(DSL.name(alias), PARAMETER); - } - - /** - * Create an aliased public.parameter table reference - */ - public JParameter(Name alias) { - this(alias, PARAMETER); - } - - private JParameter(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JParameter(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JParameter(Table child, ForeignKey key) { - super(child, key, PARAMETER); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JParameterRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.PARAMETER_TI_IDX); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.PARAMETER__PARAMETER_ITEM_ID_FKEY); - } - - public JTestItem testItem() { - return new JTestItem(this, Keys.PARAMETER__PARAMETER_ITEM_ID_FKEY); - } - - @Override - public JParameter as(String alias) { - return new JParameter(DSL.name(alias), this); - } - - @Override - public JParameter as(Name alias) { - return new JParameter(alias, this); - } - - /** - * Rename this table - */ - @Override - public JParameter rename(String name) { - return new JParameter(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JParameter rename(Name name) { - return new JParameter(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + private static final long serialVersionUID = 870603839; + + /** + * The reference instance of public.parameter + */ + public static final JParameter PARAMETER = new JParameter(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JParameterRecord.class; + } + + /** + * The column public.parameter.item_id. + */ + public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.parameter.key. + */ + public final TableField KEY = createField(DSL.name("key"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.parameter.value. + */ + public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * Create a public.parameter table reference + */ + public JParameter() { + this(DSL.name("parameter"), null); + } + + /** + * Create an aliased public.parameter table reference + */ + public JParameter(String alias) { + this(DSL.name(alias), PARAMETER); + } + + /** + * Create an aliased public.parameter table reference + */ + public JParameter(Name alias) { + this(alias, PARAMETER); + } + + private JParameter(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JParameter(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JParameter(Table child, ForeignKey key) { + super(child, key, PARAMETER); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.PARAMETER_TI_IDX); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.PARAMETER__PARAMETER_ITEM_ID_FKEY); + } + + public JTestItem testItem() { + return new JTestItem(this, Keys.PARAMETER__PARAMETER_ITEM_ID_FKEY); + } + + @Override + public JParameter as(String alias) { + return new JParameter(DSL.name(alias), this); + } + + @Override + public JParameter as(Name alias) { + return new JParameter(alias, this); + } + + /** + * Rename this table + */ + @Override + public JParameter rename(String name) { + return new JParameter(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JParameter rename(Name name) { + return new JParameter(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplate.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplate.java old mode 100755 new mode 100644 index 2ca6d9203..899ff846a --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplate.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplate.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JPatternTemplateRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -36,158 +39,153 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JPatternTemplate extends TableImpl { - /** - * The reference instance of public.pattern_template - */ - public static final JPatternTemplate PATTERN_TEMPLATE = new JPatternTemplate(); - private static final long serialVersionUID = 505397920; - /** - * The column public.pattern_template.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('pattern_template_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.pattern_template.name. - */ - public final TableField NAME = createField(DSL.name("name"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.pattern_template.value. - */ - public final TableField VALUE = createField(DSL.name("value"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.pattern_template.type. - */ - public final TableField TYPE = createField(DSL.name("type"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.pattern_template.enabled. - */ - public final TableField ENABLED = createField( - DSL.name("enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - /** - * The column public.pattern_template.project_id. - */ - public final TableField PROJECT_ID = createField( - DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.pattern_template table reference - */ - public JPatternTemplate() { - this(DSL.name("pattern_template"), null); - } - - /** - * Create an aliased public.pattern_template table reference - */ - public JPatternTemplate(String alias) { - this(DSL.name(alias), PATTERN_TEMPLATE); - } - - /** - * Create an aliased public.pattern_template table reference - */ - public JPatternTemplate(Name alias) { - this(alias, PATTERN_TEMPLATE); - } - - private JPatternTemplate(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JPatternTemplate(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JPatternTemplate(Table child, - ForeignKey key) { - super(child, key, PATTERN_TEMPLATE); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JPatternTemplateRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.PATTERN_TEMPLATE_PK, Indexes.UNQ_NAME_PROJECTID); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_PATTERN_TEMPLATE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.PATTERN_TEMPLATE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.PATTERN_TEMPLATE_PK, - Keys.UNQ_NAME_PROJECTID); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY); - } - - @Override - public JPatternTemplate as(String alias) { - return new JPatternTemplate(DSL.name(alias), this); - } - - @Override - public JPatternTemplate as(Name alias) { - return new JPatternTemplate(alias, this); - } - - /** - * Rename this table - */ - @Override - public JPatternTemplate rename(String name) { - return new JPatternTemplate(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JPatternTemplate rename(Name name) { - return new JPatternTemplate(name, null); - } - - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } + private static final long serialVersionUID = 505397920; + + /** + * The reference instance of public.pattern_template + */ + public static final JPatternTemplate PATTERN_TEMPLATE = new JPatternTemplate(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JPatternTemplateRecord.class; + } + + /** + * The column public.pattern_template.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('pattern_template_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.pattern_template.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.pattern_template.value. + */ + public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.pattern_template.type. + */ + public final TableField TYPE = createField(DSL.name("type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.pattern_template.enabled. + */ + public final TableField ENABLED = createField(DSL.name("enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); + + /** + * The column public.pattern_template.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.pattern_template table reference + */ + public JPatternTemplate() { + this(DSL.name("pattern_template"), null); + } + + /** + * Create an aliased public.pattern_template table reference + */ + public JPatternTemplate(String alias) { + this(DSL.name(alias), PATTERN_TEMPLATE); + } + + /** + * Create an aliased public.pattern_template table reference + */ + public JPatternTemplate(Name alias) { + this(alias, PATTERN_TEMPLATE); + } + + private JPatternTemplate(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JPatternTemplate(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JPatternTemplate(Table child, ForeignKey key) { + super(child, key, PATTERN_TEMPLATE); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.PATTERN_TEMPLATE_PK, Indexes.UNQ_NAME_PROJECTID); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_PATTERN_TEMPLATE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PATTERN_TEMPLATE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.PATTERN_TEMPLATE_PK, Keys.UNQ_NAME_PROJECTID); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.PATTERN_TEMPLATE__PATTERN_TEMPLATE_PROJECT_ID_FKEY); + } + + @Override + public JPatternTemplate as(String alias) { + return new JPatternTemplate(DSL.name(alias), this); + } + + @Override + public JPatternTemplate as(Name alias) { + return new JPatternTemplate(alias, this); + } + + /** + * Rename this table + */ + @Override + public JPatternTemplate rename(String name) { + return new JPatternTemplate(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JPatternTemplate rename(Name name) { + return new JPatternTemplate(name, null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplateTestItem.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplateTestItem.java old mode 100755 new mode 100644 index 211e69c14..588acea06 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplateTestItem.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JPatternTemplateTestItem.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JPatternTemplateTestItemRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -35,137 +38,132 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JPatternTemplateTestItem extends TableImpl { - /** - * The reference instance of public.pattern_template_test_item - */ - public static final JPatternTemplateTestItem PATTERN_TEMPLATE_TEST_ITEM = new JPatternTemplateTestItem(); - private static final long serialVersionUID = 1502918772; - /** - * The column public.pattern_template_test_item.pattern_id. - */ - public final TableField PATTERN_ID = createField( - DSL.name("pattern_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.pattern_template_test_item.item_id. - */ - public final TableField ITEM_ID = createField( - DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.pattern_template_test_item table reference - */ - public JPatternTemplateTestItem() { - this(DSL.name("pattern_template_test_item"), null); - } - - /** - * Create an aliased public.pattern_template_test_item table reference - */ - public JPatternTemplateTestItem(String alias) { - this(DSL.name(alias), PATTERN_TEMPLATE_TEST_ITEM); - } - - /** - * Create an aliased public.pattern_template_test_item table reference - */ - public JPatternTemplateTestItem(Name alias) { - this(alias, PATTERN_TEMPLATE_TEST_ITEM); - } - - private JPatternTemplateTestItem(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JPatternTemplateTestItem(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JPatternTemplateTestItem(Table child, - ForeignKey key) { - super(child, key, PATTERN_TEMPLATE_TEST_ITEM); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JPatternTemplateTestItemRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.PATTERN_ITEM_ITEM_ID_IDX, Indexes.PATTERN_ITEM_UNQ); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.PATTERN_ITEM_UNQ; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.PATTERN_ITEM_UNQ); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY, - Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY); - } - - public JPatternTemplate patternTemplate() { - return new JPatternTemplate(this, - Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY); - } - - public JTestItem testItem() { - return new JTestItem(this, - Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY); - } - - @Override - public JPatternTemplateTestItem as(String alias) { - return new JPatternTemplateTestItem(DSL.name(alias), this); - } - - @Override - public JPatternTemplateTestItem as(Name alias) { - return new JPatternTemplateTestItem(alias, this); - } - - /** - * Rename this table - */ - @Override - public JPatternTemplateTestItem rename(String name) { - return new JPatternTemplateTestItem(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JPatternTemplateTestItem rename(Name name) { - return new JPatternTemplateTestItem(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + private static final long serialVersionUID = 1502918772; + + /** + * The reference instance of public.pattern_template_test_item + */ + public static final JPatternTemplateTestItem PATTERN_TEMPLATE_TEST_ITEM = new JPatternTemplateTestItem(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JPatternTemplateTestItemRecord.class; + } + + /** + * The column public.pattern_template_test_item.pattern_id. + */ + public final TableField PATTERN_ID = createField(DSL.name("pattern_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.pattern_template_test_item.item_id. + */ + public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.pattern_template_test_item table reference + */ + public JPatternTemplateTestItem() { + this(DSL.name("pattern_template_test_item"), null); + } + + /** + * Create an aliased public.pattern_template_test_item table reference + */ + public JPatternTemplateTestItem(String alias) { + this(DSL.name(alias), PATTERN_TEMPLATE_TEST_ITEM); + } + + /** + * Create an aliased public.pattern_template_test_item table reference + */ + public JPatternTemplateTestItem(Name alias) { + this(alias, PATTERN_TEMPLATE_TEST_ITEM); + } + + private JPatternTemplateTestItem(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JPatternTemplateTestItem(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JPatternTemplateTestItem(Table child, ForeignKey key) { + super(child, key, PATTERN_TEMPLATE_TEST_ITEM); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.PATTERN_ITEM_ITEM_ID_IDX, Indexes.PATTERN_ITEM_UNQ); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PATTERN_ITEM_UNQ; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.PATTERN_ITEM_UNQ); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY, Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY); + } + + public JPatternTemplate patternTemplate() { + return new JPatternTemplate(this, Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_PATTERN_ID_FKEY); + } + + public JTestItem testItem() { + return new JTestItem(this, Keys.PATTERN_TEMPLATE_TEST_ITEM__PATTERN_TEMPLATE_TEST_ITEM_ITEM_ID_FKEY); + } + + @Override + public JPatternTemplateTestItem as(String alias) { + return new JPatternTemplateTestItem(DSL.name(alias), this); + } + + @Override + public JPatternTemplateTestItem as(Name alias) { + return new JPatternTemplateTestItem(alias, this); + } + + /** + * Rename this table + */ + @Override + public JPatternTemplateTestItem rename(String name) { + return new JPatternTemplateTestItem(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JPatternTemplateTestItem rename(Name name) { + return new JPatternTemplateTestItem(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JPgpArmorHeaders.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JPgpArmorHeaders.java old mode 100755 new mode 100644 index 7973bfc30..c8a9b346f --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JPgpArmorHeaders.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JPgpArmorHeaders.java @@ -6,7 +6,9 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.tables.records.JPgpArmorHeadersRecord; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Name; @@ -29,123 +31,122 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JPgpArmorHeaders extends TableImpl { - /** - * The reference instance of public.pgp_armor_headers - */ - public static final JPgpArmorHeaders PGP_ARMOR_HEADERS = new JPgpArmorHeaders(); - private static final long serialVersionUID = -689424105; - /** - * The column public.pgp_armor_headers.key. - */ - public final TableField KEY = createField(DSL.name("key"), - org.jooq.impl.SQLDataType.CLOB, this, ""); - /** - * The column public.pgp_armor_headers.value. - */ - public final TableField VALUE = createField(DSL.name("value"), - org.jooq.impl.SQLDataType.CLOB, this, ""); - - /** - * Create a public.pgp_armor_headers table reference - */ - public JPgpArmorHeaders() { - this(DSL.name("pgp_armor_headers"), null); - } - - /** - * Create an aliased public.pgp_armor_headers table reference - */ - public JPgpArmorHeaders(String alias) { - this(DSL.name(alias), PGP_ARMOR_HEADERS); - } - - /** - * Create an aliased public.pgp_armor_headers table reference - */ - public JPgpArmorHeaders(Name alias) { - this(alias, PGP_ARMOR_HEADERS); - } - - private JPgpArmorHeaders(Name alias, Table aliased) { - this(alias, aliased, new Field[1]); - } - - private JPgpArmorHeaders(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JPgpArmorHeaders(Table child, - ForeignKey key) { - super(child, key, PGP_ARMOR_HEADERS); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JPgpArmorHeadersRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public JPgpArmorHeaders as(String alias) { - return new JPgpArmorHeaders(DSL.name(alias), this, parameters); - } - - @Override - public JPgpArmorHeaders as(Name alias) { - return new JPgpArmorHeaders(alias, this, parameters); - } - - /** - * Rename this table - */ - @Override - public JPgpArmorHeaders rename(String name) { - return new JPgpArmorHeaders(DSL.name(name), null, parameters); - } - - /** - * Rename this table - */ - @Override - public JPgpArmorHeaders rename(Name name) { - return new JPgpArmorHeaders(name, null, parameters); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - /** - * Call this table-valued function - */ - public JPgpArmorHeaders call(String __1) { - return new JPgpArmorHeaders(DSL.name(getName()), null, new Field[]{ - DSL.val(__1, org.jooq.impl.SQLDataType.CLOB) - }); - } - - /** - * Call this table-valued function - */ - public JPgpArmorHeaders call(Field __1) { - return new JPgpArmorHeaders(DSL.name(getName()), null, new Field[]{ - __1 - }); - } + private static final long serialVersionUID = -689424105; + + /** + * The reference instance of public.pgp_armor_headers + */ + public static final JPgpArmorHeaders PGP_ARMOR_HEADERS = new JPgpArmorHeaders(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JPgpArmorHeadersRecord.class; + } + + /** + * The column public.pgp_armor_headers.key. + */ + public final TableField KEY = createField(DSL.name("key"), org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column public.pgp_armor_headers.value. + */ + public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * Create a public.pgp_armor_headers table reference + */ + public JPgpArmorHeaders() { + this(DSL.name("pgp_armor_headers"), null); + } + + /** + * Create an aliased public.pgp_armor_headers table reference + */ + public JPgpArmorHeaders(String alias) { + this(DSL.name(alias), PGP_ARMOR_HEADERS); + } + + /** + * Create an aliased public.pgp_armor_headers table reference + */ + public JPgpArmorHeaders(Name alias) { + this(alias, PGP_ARMOR_HEADERS); + } + + private JPgpArmorHeaders(Name alias, Table aliased) { + this(alias, aliased, new Field[1]); + } + + private JPgpArmorHeaders(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JPgpArmorHeaders(Table child, ForeignKey key) { + super(child, key, PGP_ARMOR_HEADERS); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public JPgpArmorHeaders as(String alias) { + return new JPgpArmorHeaders(DSL.name(alias), this, parameters); + } + + @Override + public JPgpArmorHeaders as(Name alias) { + return new JPgpArmorHeaders(alias, this, parameters); + } + + /** + * Rename this table + */ + @Override + public JPgpArmorHeaders rename(String name) { + return new JPgpArmorHeaders(DSL.name(name), null, parameters); + } + + /** + * Rename this table + */ + @Override + public JPgpArmorHeaders rename(Name name) { + return new JPgpArmorHeaders(name, null, parameters); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + /** + * Call this table-valued function + */ + public JPgpArmorHeaders call(String __1) { + return new JPgpArmorHeaders(DSL.name(getName()), null, new Field[] { + DSL.val(__1, org.jooq.impl.SQLDataType.CLOB) + }); + } + + /** + * Call this table-valued function + */ + public JPgpArmorHeaders call(Field __1) { + return new JPgpArmorHeaders(DSL.name(getName()), null, new Field[] { + __1 + }); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JProject.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JProject.java index 7d1b4e8c1..4f07f222f 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JProject.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JProject.java @@ -8,10 +8,13 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JProjectRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -38,153 +41,149 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JProject extends TableImpl { - /** - * The reference instance of public.project - */ - public static final JProject PROJECT = new JProject(); - private static final long serialVersionUID = 1584335243; - /** - * The column public.project.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('project_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.project.name. - */ - public final TableField NAME = createField(DSL.name("name"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.project.project_type. - */ - public final TableField PROJECT_TYPE = createField( - DSL.name("project_type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.project.organization. - */ - public final TableField ORGANIZATION = createField( - DSL.name("organization"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - /** - * The column public.project.creation_date. - */ - public final TableField CREATION_DATE = createField( - DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false) - .defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), - this, ""); - /** - * The column public.project.metadata. - */ - public final TableField METADATA = createField(DSL.name("metadata"), - org.jooq.impl.SQLDataType.JSONB, this, ""); - /** - * The column public.project.allocated_storage. - */ - public final TableField ALLOCATED_STORAGE = createField( - DSL.name("allocated_storage"), org.jooq.impl.SQLDataType.BIGINT.nullable(false) - .defaultValue(org.jooq.impl.DSL.field("0", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * Create a public.project table reference - */ - public JProject() { - this(DSL.name("project"), null); - } - - /** - * Create an aliased public.project table reference - */ - public JProject(String alias) { - this(DSL.name(alias), PROJECT); - } - - /** - * Create an aliased public.project table reference - */ - public JProject(Name alias) { - this(alias, PROJECT); - } - - private JProject(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JProject(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JProject(Table child, ForeignKey key) { - super(child, key, PROJECT); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JProjectRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.PROJECT_NAME_KEY, Indexes.PROJECT_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_PROJECT; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.PROJECT_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.PROJECT_PK, Keys.PROJECT_NAME_KEY); - } - - @Override - public JProject as(String alias) { - return new JProject(DSL.name(alias), this); - } - - @Override - public JProject as(Name alias) { - return new JProject(alias, this); - } - - /** - * Rename this table - */ - @Override - public JProject rename(String name) { - return new JProject(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JProject rename(Name name) { - return new JProject(name, null); - } - - // ------------------------------------------------------------------------- - // Row7 type methods - // ------------------------------------------------------------------------- - - @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); - } + private static final long serialVersionUID = 1584335243; + + /** + * The reference instance of public.project + */ + public static final JProject PROJECT = new JProject(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JProjectRecord.class; + } + + /** + * The column public.project.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('project_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.project.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.project.project_type. + */ + public final TableField PROJECT_TYPE = createField(DSL.name("project_type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.project.organization. + */ + public final TableField ORGANIZATION = createField(DSL.name("organization"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * The column public.project.creation_date. + */ + public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column public.project.metadata. + */ + public final TableField METADATA = createField(DSL.name("metadata"), org.jooq.impl.SQLDataType.JSONB, this, ""); + + /** + * The column public.project.allocated_storage. + */ + public final TableField ALLOCATED_STORAGE = createField(DSL.name("allocated_storage"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("0", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * Create a public.project table reference + */ + public JProject() { + this(DSL.name("project"), null); + } + + /** + * Create an aliased public.project table reference + */ + public JProject(String alias) { + this(DSL.name(alias), PROJECT); + } + + /** + * Create an aliased public.project table reference + */ + public JProject(Name alias) { + this(alias, PROJECT); + } + + private JProject(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JProject(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JProject(Table child, ForeignKey key) { + super(child, key, PROJECT); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.PROJECT_NAME_KEY, Indexes.PROJECT_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_PROJECT; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.PROJECT_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.PROJECT_PK, Keys.PROJECT_NAME_KEY); + } + + @Override + public JProject as(String alias) { + return new JProject(DSL.name(alias), this); + } + + @Override + public JProject as(Name alias) { + return new JProject(alias, this); + } + + /** + * Rename this table + */ + @Override + public JProject rename(String name) { + return new JProject(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JProject rename(Name name) { + return new JProject(name, null); + } + + // ------------------------------------------------------------------------- + // Row7 type methods + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectAttribute.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectAttribute.java old mode 100755 new mode 100644 index 2559d44d3..db1892c07 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectAttribute.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectAttribute.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JProjectAttributeRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -36,149 +39,142 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JProjectAttribute extends TableImpl { - /** - * The reference instance of public.project_attribute - */ - public static final JProjectAttribute PROJECT_ATTRIBUTE = new JProjectAttribute(); - private static final long serialVersionUID = -860086297; - /** - * The column public.project_attribute.attribute_id. - */ - public final TableField ATTRIBUTE_ID = createField( - DSL.name("attribute_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('project_attribute_attribute_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.project_attribute.value. - */ - public final TableField VALUE = createField(DSL.name("value"), - org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - /** - * The column public.project_attribute.project_id. - */ - public final TableField PROJECT_ID = createField( - DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('project_attribute_project_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * Create a public.project_attribute table reference - */ - public JProjectAttribute() { - this(DSL.name("project_attribute"), null); - } - - /** - * Create an aliased public.project_attribute table reference - */ - public JProjectAttribute(String alias) { - this(DSL.name(alias), PROJECT_ATTRIBUTE); - } - - /** - * Create an aliased public.project_attribute table reference - */ - public JProjectAttribute(Name alias) { - this(alias, PROJECT_ATTRIBUTE); - } - - private JProjectAttribute(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JProjectAttribute(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JProjectAttribute(Table child, - ForeignKey key) { - super(child, key, PROJECT_ATTRIBUTE); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JProjectAttributeRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.UNIQUE_ATTRIBUTE_PER_PROJECT); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_PROJECT_ATTRIBUTE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.UNIQUE_ATTRIBUTE_PER_PROJECT; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.UNIQUE_ATTRIBUTE_PER_PROJECT); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY, - Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY); - } - - public JAttribute attribute() { - return new JAttribute(this, Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY); - } - - @Override - public JProjectAttribute as(String alias) { - return new JProjectAttribute(DSL.name(alias), this); - } - - @Override - public JProjectAttribute as(Name alias) { - return new JProjectAttribute(alias, this); - } - - /** - * Rename this table - */ - @Override - public JProjectAttribute rename(String name) { - return new JProjectAttribute(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JProjectAttribute rename(Name name) { - return new JProjectAttribute(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + private static final long serialVersionUID = -860086297; + + /** + * The reference instance of public.project_attribute + */ + public static final JProjectAttribute PROJECT_ATTRIBUTE = new JProjectAttribute(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JProjectAttributeRecord.class; + } + + /** + * The column public.project_attribute.attribute_id. + */ + public final TableField ATTRIBUTE_ID = createField(DSL.name("attribute_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('project_attribute_attribute_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.project_attribute.value. + */ + public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + + /** + * The column public.project_attribute.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('project_attribute_project_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * Create a public.project_attribute table reference + */ + public JProjectAttribute() { + this(DSL.name("project_attribute"), null); + } + + /** + * Create an aliased public.project_attribute table reference + */ + public JProjectAttribute(String alias) { + this(DSL.name(alias), PROJECT_ATTRIBUTE); + } + + /** + * Create an aliased public.project_attribute table reference + */ + public JProjectAttribute(Name alias) { + this(alias, PROJECT_ATTRIBUTE); + } + + private JProjectAttribute(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JProjectAttribute(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JProjectAttribute(Table child, ForeignKey key) { + super(child, key, PROJECT_ATTRIBUTE); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.UNIQUE_ATTRIBUTE_PER_PROJECT); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_PROJECT_ATTRIBUTE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.UNIQUE_ATTRIBUTE_PER_PROJECT; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.UNIQUE_ATTRIBUTE_PER_PROJECT); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY, Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY); + } + + public JAttribute attribute() { + return new JAttribute(this, Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_ATTRIBUTE_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.PROJECT_ATTRIBUTE__PROJECT_ATTRIBUTE_PROJECT_ID_FKEY); + } + + @Override + public JProjectAttribute as(String alias) { + return new JProjectAttribute(DSL.name(alias), this); + } + + @Override + public JProjectAttribute as(Name alias) { + return new JProjectAttribute(alias, this); + } + + /** + * Rename this table + */ + @Override + public JProjectAttribute rename(String name) { + return new JProjectAttribute(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JProjectAttribute rename(Name name) { + return new JProjectAttribute(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectUser.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectUser.java index c91af2dc1..c6142c102 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectUser.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JProjectUser.java @@ -9,9 +9,12 @@ import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.enums.JProjectRoleEnum; import com.epam.ta.reportportal.jooq.tables.records.JProjectUserRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -36,139 +39,137 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JProjectUser extends TableImpl { - /** - * The reference instance of public.project_user - */ - public static final JProjectUser PROJECT_USER = new JProjectUser(); - private static final long serialVersionUID = -877127631; - /** - * The column public.project_user.user_id. - */ - public final TableField USER_ID = createField(DSL.name("user_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.project_user.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.project_user.project_role. - */ - public final TableField PROJECT_ROLE = createField( - DSL.name("project_role"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false) - .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JProjectRoleEnum.class), this, ""); - - /** - * Create a public.project_user table reference - */ - public JProjectUser() { - this(DSL.name("project_user"), null); - } - - /** - * Create an aliased public.project_user table reference - */ - public JProjectUser(String alias) { - this(DSL.name(alias), PROJECT_USER); - } - - /** - * Create an aliased public.project_user table reference - */ - public JProjectUser(Name alias) { - this(alias, PROJECT_USER); - } - - private JProjectUser(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JProjectUser(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JProjectUser(Table child, ForeignKey key) { - super(child, key, PROJECT_USER); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JProjectUserRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.USERS_PROJECT_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.USERS_PROJECT_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.USERS_PROJECT_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.PROJECT_USER__PROJECT_USER_USER_ID_FKEY, - Keys.PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY); - } - - public JUsers users() { - return new JUsers(this, Keys.PROJECT_USER__PROJECT_USER_USER_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY); - } - - @Override - public JProjectUser as(String alias) { - return new JProjectUser(DSL.name(alias), this); - } - - @Override - public JProjectUser as(Name alias) { - return new JProjectUser(alias, this); - } - - /** - * Rename this table - */ - @Override - public JProjectUser rename(String name) { - return new JProjectUser(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JProjectUser rename(Name name) { - return new JProjectUser(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + private static final long serialVersionUID = -877127631; + + /** + * The reference instance of public.project_user + */ + public static final JProjectUser PROJECT_USER = new JProjectUser(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JProjectUserRecord.class; + } + + /** + * The column public.project_user.user_id. + */ + public final TableField USER_ID = createField(DSL.name("user_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.project_user.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.project_user.project_role. + */ + public final TableField PROJECT_ROLE = createField(DSL.name("project_role"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JProjectRoleEnum.class), this, ""); + + /** + * Create a public.project_user table reference + */ + public JProjectUser() { + this(DSL.name("project_user"), null); + } + + /** + * Create an aliased public.project_user table reference + */ + public JProjectUser(String alias) { + this(DSL.name(alias), PROJECT_USER); + } + + /** + * Create an aliased public.project_user table reference + */ + public JProjectUser(Name alias) { + this(alias, PROJECT_USER); + } + + private JProjectUser(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JProjectUser(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JProjectUser(Table child, ForeignKey key) { + super(child, key, PROJECT_USER); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.USERS_PROJECT_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.USERS_PROJECT_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.USERS_PROJECT_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.PROJECT_USER__PROJECT_USER_USER_ID_FKEY, Keys.PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY); + } + + public JUsers users() { + return new JUsers(this, Keys.PROJECT_USER__PROJECT_USER_USER_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.PROJECT_USER__PROJECT_USER_PROJECT_ID_FKEY); + } + + @Override + public JProjectUser as(String alias) { + return new JProjectUser(DSL.name(alias), this); + } + + @Override + public JProjectUser as(Name alias) { + return new JProjectUser(alias, this); + } + + /** + * Rename this table + */ + @Override + public JProjectUser rename(String name) { + return new JProjectUser(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JProjectUser rename(Name name) { + return new JProjectUser(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JRecipients.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JRecipients.java old mode 100755 new mode 100644 index 77353bc64..6ae881db0 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JRecipients.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JRecipients.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JRecipientsRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -34,118 +37,118 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JRecipients extends TableImpl { - /** - * The reference instance of public.recipients - */ - public static final JRecipients RECIPIENTS = new JRecipients(); - private static final long serialVersionUID = -1755691325; - /** - * The column public.recipients.sender_case_id. - */ - public final TableField SENDER_CASE_ID = createField( - DSL.name("sender_case_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.recipients.recipient. - */ - public final TableField RECIPIENT = createField(DSL.name("recipient"), - org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); - - /** - * Create a public.recipients table reference - */ - public JRecipients() { - this(DSL.name("recipients"), null); - } - - /** - * Create an aliased public.recipients table reference - */ - public JRecipients(String alias) { - this(DSL.name(alias), RECIPIENTS); - } - - /** - * Create an aliased public.recipients table reference - */ - public JRecipients(Name alias) { - this(alias, RECIPIENTS); - } - - private JRecipients(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JRecipients(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JRecipients(Table child, ForeignKey key) { - super(child, key, RECIPIENTS); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JRecipientsRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.RCPNT_SEND_CASE_IDX); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY); - } - - public JSenderCase senderCase() { - return new JSenderCase(this, Keys.RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY); - } - - @Override - public JRecipients as(String alias) { - return new JRecipients(DSL.name(alias), this); - } - - @Override - public JRecipients as(Name alias) { - return new JRecipients(alias, this); - } - - /** - * Rename this table - */ - @Override - public JRecipients rename(String name) { - return new JRecipients(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JRecipients rename(Name name) { - return new JRecipients(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + private static final long serialVersionUID = -1755691325; + + /** + * The reference instance of public.recipients + */ + public static final JRecipients RECIPIENTS = new JRecipients(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JRecipientsRecord.class; + } + + /** + * The column public.recipients.sender_case_id. + */ + public final TableField SENDER_CASE_ID = createField(DSL.name("sender_case_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.recipients.recipient. + */ + public final TableField RECIPIENT = createField(DSL.name("recipient"), org.jooq.impl.SQLDataType.VARCHAR(256), this, ""); + + /** + * Create a public.recipients table reference + */ + public JRecipients() { + this(DSL.name("recipients"), null); + } + + /** + * Create an aliased public.recipients table reference + */ + public JRecipients(String alias) { + this(DSL.name(alias), RECIPIENTS); + } + + /** + * Create an aliased public.recipients table reference + */ + public JRecipients(Name alias) { + this(alias, RECIPIENTS); + } + + private JRecipients(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JRecipients(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JRecipients(Table child, ForeignKey key) { + super(child, key, RECIPIENTS); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.RCPNT_SEND_CASE_IDX); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY); + } + + public JSenderCase senderCase() { + return new JSenderCase(this, Keys.RECIPIENTS__RECIPIENTS_SENDER_CASE_ID_FKEY); + } + + @Override + public JRecipients as(String alias) { + return new JRecipients(DSL.name(alias), this); + } + + @Override + public JRecipients as(Name alias) { + return new JRecipients(alias, this); + } + + /** + * Rename this table + */ + @Override + public JRecipients rename(String name) { + return new JRecipients(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JRecipients rename(Name name) { + return new JRecipients(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JRestorePasswordBid.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JRestorePasswordBid.java index 1e73d09d8..31e1065d6 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JRestorePasswordBid.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JRestorePasswordBid.java @@ -8,10 +8,13 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JRestorePasswordBidRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -36,128 +39,124 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JRestorePasswordBid extends TableImpl { - /** - * The reference instance of public.restore_password_bid - */ - public static final JRestorePasswordBid RESTORE_PASSWORD_BID = new JRestorePasswordBid(); - private static final long serialVersionUID = -130391773; - /** - * The column public.restore_password_bid.uuid. - */ - public final TableField UUID = createField(DSL.name("uuid"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.restore_password_bid.last_modified. - */ - public final TableField LAST_MODIFIED = createField( - DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue( - org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - /** - * The column public.restore_password_bid.email. - */ - public final TableField EMAIL = createField(DSL.name("email"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * Create a public.restore_password_bid table reference - */ - public JRestorePasswordBid() { - this(DSL.name("restore_password_bid"), null); - } - - /** - * Create an aliased public.restore_password_bid table reference - */ - public JRestorePasswordBid(String alias) { - this(DSL.name(alias), RESTORE_PASSWORD_BID); - } - - /** - * Create an aliased public.restore_password_bid table reference - */ - public JRestorePasswordBid(Name alias) { - this(alias, RESTORE_PASSWORD_BID); - } - - private JRestorePasswordBid(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JRestorePasswordBid(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JRestorePasswordBid(Table child, - ForeignKey key) { - super(child, key, RESTORE_PASSWORD_BID); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JRestorePasswordBidRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.RESTORE_PASSWORD_BID_EMAIL_KEY, - Indexes.RESTORE_PASSWORD_BID_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.RESTORE_PASSWORD_BID_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.RESTORE_PASSWORD_BID_PK, - Keys.RESTORE_PASSWORD_BID_EMAIL_KEY); - } - - @Override - public JRestorePasswordBid as(String alias) { - return new JRestorePasswordBid(DSL.name(alias), this); - } - - @Override - public JRestorePasswordBid as(Name alias) { - return new JRestorePasswordBid(alias, this); - } - - /** - * Rename this table - */ - @Override - public JRestorePasswordBid rename(String name) { - return new JRestorePasswordBid(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JRestorePasswordBid rename(Name name) { - return new JRestorePasswordBid(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + private static final long serialVersionUID = -130391773; + + /** + * The reference instance of public.restore_password_bid + */ + public static final JRestorePasswordBid RESTORE_PASSWORD_BID = new JRestorePasswordBid(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JRestorePasswordBidRecord.class; + } + + /** + * The column public.restore_password_bid.uuid. + */ + public final TableField UUID = createField(DSL.name("uuid"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.restore_password_bid.last_modified. + */ + public final TableField LAST_MODIFIED = createField(DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column public.restore_password_bid.email. + */ + public final TableField EMAIL = createField(DSL.name("email"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * Create a public.restore_password_bid table reference + */ + public JRestorePasswordBid() { + this(DSL.name("restore_password_bid"), null); + } + + /** + * Create an aliased public.restore_password_bid table reference + */ + public JRestorePasswordBid(String alias) { + this(DSL.name(alias), RESTORE_PASSWORD_BID); + } + + /** + * Create an aliased public.restore_password_bid table reference + */ + public JRestorePasswordBid(Name alias) { + this(alias, RESTORE_PASSWORD_BID); + } + + private JRestorePasswordBid(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JRestorePasswordBid(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JRestorePasswordBid(Table child, ForeignKey key) { + super(child, key, RESTORE_PASSWORD_BID); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.RESTORE_PASSWORD_BID_EMAIL_KEY, Indexes.RESTORE_PASSWORD_BID_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.RESTORE_PASSWORD_BID_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.RESTORE_PASSWORD_BID_PK, Keys.RESTORE_PASSWORD_BID_EMAIL_KEY); + } + + @Override + public JRestorePasswordBid as(String alias) { + return new JRestorePasswordBid(DSL.name(alias), this); + } + + @Override + public JRestorePasswordBid as(Name alias) { + return new JRestorePasswordBid(alias, this); + } + + /** + * Rename this table + */ + @Override + public JRestorePasswordBid rename(String name) { + return new JRestorePasswordBid(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JRestorePasswordBid rename(Name name) { + return new JRestorePasswordBid(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JSenderCase.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JSenderCase.java index 3bbdaae1c..9348532cd 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JSenderCase.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JSenderCase.java @@ -7,17 +7,21 @@ import com.epam.ta.reportportal.jooq.Indexes; import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; +import com.epam.ta.reportportal.jooq.enums.JLogicalOperatorEnum; import com.epam.ta.reportportal.jooq.tables.records.JSenderCaseRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row4; +import org.jooq.Row6; import org.jooq.Schema; import org.jooq.Table; import org.jooq.TableField; @@ -36,149 +40,153 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JSenderCase extends TableImpl { - /** - * The reference instance of public.sender_case - */ - public static final JSenderCase SENDER_CASE = new JSenderCase(); - private static final long serialVersionUID = -964535423; - /** - * The column public.sender_case.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('sender_case_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.sender_case.send_case. - */ - public final TableField SEND_CASE = createField(DSL.name("send_case"), - org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - /** - * The column public.sender_case.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('sender_case_project_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.sender_case.enabled. - */ - public final TableField ENABLED = createField(DSL.name("enabled"), - org.jooq.impl.SQLDataType.BOOLEAN.nullable(false) - .defaultValue(org.jooq.impl.DSL.field("true", org.jooq.impl.SQLDataType.BOOLEAN)), this, - ""); - - /** - * Create a public.sender_case table reference - */ - public JSenderCase() { - this(DSL.name("sender_case"), null); - } - - /** - * Create an aliased public.sender_case table reference - */ - public JSenderCase(String alias) { - this(DSL.name(alias), SENDER_CASE); - } - - /** - * Create an aliased public.sender_case table reference - */ - public JSenderCase(Name alias) { - this(alias, SENDER_CASE); - } - - private JSenderCase(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JSenderCase(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JSenderCase(Table child, ForeignKey key) { - super(child, key, SENDER_CASE); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JSenderCaseRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.SENDER_CASE_PK, Indexes.SENDER_CASE_PROJECT_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_SENDER_CASE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.SENDER_CASE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.SENDER_CASE_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY); - } - - @Override - public JSenderCase as(String alias) { - return new JSenderCase(DSL.name(alias), this); - } - - @Override - public JSenderCase as(Name alias) { - return new JSenderCase(alias, this); - } - - /** - * Rename this table - */ - @Override - public JSenderCase rename(String name) { - return new JSenderCase(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JSenderCase rename(Name name) { - return new JSenderCase(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + private static final long serialVersionUID = -592069423; + + /** + * The reference instance of public.sender_case + */ + public static final JSenderCase SENDER_CASE = new JSenderCase(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JSenderCaseRecord.class; + } + + /** + * The column public.sender_case.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('sender_case_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.sender_case.send_case. + */ + public final TableField SEND_CASE = createField(DSL.name("send_case"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + + /** + * The column public.sender_case.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('sender_case_project_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.sender_case.enabled. + */ + public final TableField ENABLED = createField(DSL.name("enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false).defaultValue(org.jooq.impl.DSL.field("true", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + + /** + * The column public.sender_case.attributes_operator. + */ + public final TableField ATTRIBUTES_OPERATOR = createField(DSL.name("attributes_operator"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).defaultValue(org.jooq.impl.DSL.field("'AND'::logical_operator_enum", org.jooq.impl.SQLDataType.VARCHAR)).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JLogicalOperatorEnum.class), this, ""); + + /** + * The column public.sender_case.rule_name. + */ + public final TableField RULE_NAME = createField(DSL.name("rule_name"), org.jooq.impl.SQLDataType.VARCHAR(55).nullable(false), this, ""); + + /** + * Create a public.sender_case table reference + */ + public JSenderCase() { + this(DSL.name("sender_case"), null); + } + + /** + * Create an aliased public.sender_case table reference + */ + public JSenderCase(String alias) { + this(DSL.name(alias), SENDER_CASE); + } + + /** + * Create an aliased public.sender_case table reference + */ + public JSenderCase(Name alias) { + this(alias, SENDER_CASE); + } + + private JSenderCase(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JSenderCase(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JSenderCase(Table child, ForeignKey key) { + super(child, key, SENDER_CASE); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.SENDER_CASE_PK, Indexes.SENDER_CASE_PROJECT_IDX, Indexes.UNIQUE_RULE_NAME_PER_PROJECT); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_SENDER_CASE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.SENDER_CASE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.SENDER_CASE_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.SENDER_CASE__SENDER_CASE_PROJECT_ID_FKEY); + } + + @Override + public JSenderCase as(String alias) { + return new JSenderCase(DSL.name(alias), this); + } + + @Override + public JSenderCase as(Name alias) { + return new JSenderCase(alias, this); + } + + /** + * Rename this table + */ + @Override + public JSenderCase rename(String name) { + return new JSenderCase(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JSenderCase rename(Name name) { + return new JSenderCase(name, null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JServerSettings.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JServerSettings.java old mode 100755 new mode 100644 index 063c0e1ee..a25ae3e37 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JServerSettings.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JServerSettings.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JServerSettingsRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -36,132 +39,129 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JServerSettings extends TableImpl { - /** - * The reference instance of public.server_settings - */ - public static final JServerSettings SERVER_SETTINGS = new JServerSettings(); - private static final long serialVersionUID = -628087328; - /** - * The column public.server_settings.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.SMALLINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('server_settings_id_seq'::regclass)", - org.jooq.impl.SQLDataType.SMALLINT)), this, ""); - /** - * The column public.server_settings.key. - */ - public final TableField KEY = createField(DSL.name("key"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.server_settings.value. - */ - public final TableField VALUE = createField(DSL.name("value"), - org.jooq.impl.SQLDataType.VARCHAR, this, ""); - - /** - * Create a public.server_settings table reference - */ - public JServerSettings() { - this(DSL.name("server_settings"), null); - } - - /** - * Create an aliased public.server_settings table reference - */ - public JServerSettings(String alias) { - this(DSL.name(alias), SERVER_SETTINGS); - } - - /** - * Create an aliased public.server_settings table reference - */ - public JServerSettings(Name alias) { - this(alias, SERVER_SETTINGS); - } - - private JServerSettings(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JServerSettings(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JServerSettings(Table child, - ForeignKey key) { - super(child, key, SERVER_SETTINGS); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JServerSettingsRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.SERVER_SETTINGS_ID, Indexes.SERVER_SETTINGS_KEY_KEY); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_SERVER_SETTINGS; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.SERVER_SETTINGS_ID; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.SERVER_SETTINGS_ID, - Keys.SERVER_SETTINGS_KEY_KEY); - } - - @Override - public JServerSettings as(String alias) { - return new JServerSettings(DSL.name(alias), this); - } - - @Override - public JServerSettings as(Name alias) { - return new JServerSettings(alias, this); - } - - /** - * Rename this table - */ - @Override - public JServerSettings rename(String name) { - return new JServerSettings(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JServerSettings rename(Name name) { - return new JServerSettings(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + private static final long serialVersionUID = -628087328; + + /** + * The reference instance of public.server_settings + */ + public static final JServerSettings SERVER_SETTINGS = new JServerSettings(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JServerSettingsRecord.class; + } + + /** + * The column public.server_settings.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.SMALLINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('server_settings_id_seq'::regclass)", org.jooq.impl.SQLDataType.SMALLINT)), this, ""); + + /** + * The column public.server_settings.key. + */ + public final TableField KEY = createField(DSL.name("key"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.server_settings.value. + */ + public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * Create a public.server_settings table reference + */ + public JServerSettings() { + this(DSL.name("server_settings"), null); + } + + /** + * Create an aliased public.server_settings table reference + */ + public JServerSettings(String alias) { + this(DSL.name(alias), SERVER_SETTINGS); + } + + /** + * Create an aliased public.server_settings table reference + */ + public JServerSettings(Name alias) { + this(alias, SERVER_SETTINGS); + } + + private JServerSettings(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JServerSettings(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JServerSettings(Table child, ForeignKey key) { + super(child, key, SERVER_SETTINGS); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.SERVER_SETTINGS_ID, Indexes.SERVER_SETTINGS_KEY_KEY); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_SERVER_SETTINGS; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.SERVER_SETTINGS_ID; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.SERVER_SETTINGS_ID, Keys.SERVER_SETTINGS_KEY_KEY); + } + + @Override + public JServerSettings as(String alias) { + return new JServerSettings(DSL.name(alias), this); + } + + @Override + public JServerSettings as(Name alias) { + return new JServerSettings(alias, this); + } + + /** + * Rename this table + */ + @Override + public JServerSettings rename(String name) { + return new JServerSettings(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JServerSettings rename(Name name) { + return new JServerSettings(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JShareableEntity.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JShareableEntity.java deleted file mode 100644 index a15632d97..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JShareableEntity.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables; - - -import com.epam.ta.reportportal.jooq.Indexes; -import com.epam.ta.reportportal.jooq.JPublic; -import com.epam.ta.reportportal.jooq.Keys; -import com.epam.ta.reportportal.jooq.tables.records.JShareableEntityRecord; -import java.util.Arrays; -import java.util.List; -import javax.annotation.processing.Generated; -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Index; -import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Row4; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.DSL; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JShareableEntity extends TableImpl { - - /** - * The reference instance of public.shareable_entity - */ - public static final JShareableEntity SHAREABLE_ENTITY = new JShareableEntity(); - private static final long serialVersionUID = 1299591789; - /** - * The column public.shareable_entity.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('shareable_entity_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.shareable_entity.shared. - */ - public final TableField SHARED = createField(DSL.name("shared"), - org.jooq.impl.SQLDataType.BOOLEAN.nullable(false) - .defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, - ""); - /** - * The column public.shareable_entity.owner. - */ - public final TableField OWNER = createField(DSL.name("owner"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.shareable_entity.project_id. - */ - public final TableField PROJECT_ID = createField( - DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.shareable_entity table reference - */ - public JShareableEntity() { - this(DSL.name("shareable_entity"), null); - } - - /** - * Create an aliased public.shareable_entity table reference - */ - public JShareableEntity(String alias) { - this(DSL.name(alias), SHAREABLE_ENTITY); - } - - /** - * Create an aliased public.shareable_entity table reference - */ - public JShareableEntity(Name alias) { - this(alias, SHAREABLE_ENTITY); - } - - private JShareableEntity(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JShareableEntity(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JShareableEntity(Table child, - ForeignKey key) { - super(child, key, SHAREABLE_ENTITY); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JShareableEntityRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.SHAREABLE_PK, Indexes.SHARED_ENTITY_OWNERX, - Indexes.SHARED_ENTITY_PROJECT_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_SHAREABLE_ENTITY; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.SHAREABLE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.SHAREABLE_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.SHAREABLE_ENTITY__SHAREABLE_ENTITY_OWNER_FKEY, - Keys.SHAREABLE_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY); - } - - public JUsers users() { - return new JUsers(this, Keys.SHAREABLE_ENTITY__SHAREABLE_ENTITY_OWNER_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.SHAREABLE_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY); - } - - @Override - public JShareableEntity as(String alias) { - return new JShareableEntity(DSL.name(alias), this); - } - - @Override - public JShareableEntity as(Name alias) { - return new JShareableEntity(alias, this); - } - - /** - * Rename this table - */ - @Override - public JShareableEntity rename(String name) { - return new JShareableEntity(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JShareableEntity rename(Name name) { - return new JShareableEntity(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JShedlock.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JShedlock.java new file mode 100644 index 000000000..bf4152103 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JShedlock.java @@ -0,0 +1,167 @@ +/* + * This file is generated by jOOQ. + */ +package com.epam.ta.reportportal.jooq.tables; + + +import com.epam.ta.reportportal.jooq.Indexes; +import com.epam.ta.reportportal.jooq.JPublic; +import com.epam.ta.reportportal.jooq.Keys; +import com.epam.ta.reportportal.jooq.tables.records.JShedlockRecord; + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.List; + +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row4; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.4" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JShedlock extends TableImpl { + + private static final long serialVersionUID = 1429877320; + + /** + * The reference instance of public.shedlock + */ + public static final JShedlock SHEDLOCK = new JShedlock(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JShedlockRecord.class; + } + + /** + * The column public.shedlock.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(64).nullable(false), this, ""); + + /** + * The column public.shedlock.lock_until. + */ + public final TableField LOCK_UNTIL = createField(DSL.name("lock_until"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * The column public.shedlock.locked_at. + */ + public final TableField LOCKED_AT = createField(DSL.name("locked_at"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * The column public.shedlock.locked_by. + */ + public final TableField LOCKED_BY = createField(DSL.name("locked_by"), org.jooq.impl.SQLDataType.VARCHAR(255).nullable(false), this, ""); + + /** + * Create a public.shedlock table reference + */ + public JShedlock() { + this(DSL.name("shedlock"), null); + } + + /** + * Create an aliased public.shedlock table reference + */ + public JShedlock(String alias) { + this(DSL.name(alias), SHEDLOCK); + } + + /** + * Create an aliased public.shedlock table reference + */ + public JShedlock(Name alias) { + this(alias, SHEDLOCK); + } + + private JShedlock(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JShedlock(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JShedlock(Table child, ForeignKey key) { + super(child, key, SHEDLOCK); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.SHEDLOCK_PKEY); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.SHEDLOCK_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.SHEDLOCK_PKEY); + } + + @Override + public JShedlock as(String alias) { + return new JShedlock(DSL.name(alias), this); + } + + @Override + public JShedlock as(Name alias) { + return new JShedlock(alias, this); + } + + /** + * Rename this table + */ + @Override + public JShedlock rename(String name) { + return new JShedlock(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JShedlock rename(Name name) { + return new JShedlock(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } +} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JStaleMaterializedView.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JStaleMaterializedView.java index 5e5a8629e..7a2bd6a7e 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JStaleMaterializedView.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JStaleMaterializedView.java @@ -8,10 +8,13 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JStaleMaterializedViewRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -37,134 +40,129 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JStaleMaterializedView extends TableImpl { - /** - * The reference instance of public.stale_materialized_view - */ - public static final JStaleMaterializedView STALE_MATERIALIZED_VIEW = new JStaleMaterializedView(); - private static final long serialVersionUID = 964883742; - /** - * The column public.stale_materialized_view.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('stale_materialized_view_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.stale_materialized_view.name. - */ - public final TableField NAME = createField(DSL.name("name"), - org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - /** - * The column public.stale_materialized_view.creation_date. - */ - public final TableField CREATION_DATE = createField( - DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - - /** - * Create a public.stale_materialized_view table reference - */ - public JStaleMaterializedView() { - this(DSL.name("stale_materialized_view"), null); - } - - /** - * Create an aliased public.stale_materialized_view table reference - */ - public JStaleMaterializedView(String alias) { - this(DSL.name(alias), STALE_MATERIALIZED_VIEW); - } - - /** - * Create an aliased public.stale_materialized_view table reference - */ - public JStaleMaterializedView(Name alias) { - this(alias, STALE_MATERIALIZED_VIEW); - } - - private JStaleMaterializedView(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JStaleMaterializedView(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JStaleMaterializedView(Table child, - ForeignKey key) { - super(child, key, STALE_MATERIALIZED_VIEW); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JStaleMaterializedViewRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.STALE_MATERIALIZED_VIEW_NAME_KEY, - Indexes.STALE_MATERIALIZED_VIEW_PKEY, Indexes.STALE_MV_CREATION_DATE_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_STALE_MATERIALIZED_VIEW; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.STALE_MATERIALIZED_VIEW_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.STALE_MATERIALIZED_VIEW_PKEY, - Keys.STALE_MATERIALIZED_VIEW_NAME_KEY); - } - - @Override - public JStaleMaterializedView as(String alias) { - return new JStaleMaterializedView(DSL.name(alias), this); - } - - @Override - public JStaleMaterializedView as(Name alias) { - return new JStaleMaterializedView(alias, this); - } - - /** - * Rename this table - */ - @Override - public JStaleMaterializedView rename(String name) { - return new JStaleMaterializedView(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JStaleMaterializedView rename(Name name) { - return new JStaleMaterializedView(name, null); - } - - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } + private static final long serialVersionUID = 964883742; + + /** + * The reference instance of public.stale_materialized_view + */ + public static final JStaleMaterializedView STALE_MATERIALIZED_VIEW = new JStaleMaterializedView(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JStaleMaterializedViewRecord.class; + } + + /** + * The column public.stale_materialized_view.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('stale_materialized_view_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.stale_materialized_view.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); + + /** + * The column public.stale_materialized_view.creation_date. + */ + public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * Create a public.stale_materialized_view table reference + */ + public JStaleMaterializedView() { + this(DSL.name("stale_materialized_view"), null); + } + + /** + * Create an aliased public.stale_materialized_view table reference + */ + public JStaleMaterializedView(String alias) { + this(DSL.name(alias), STALE_MATERIALIZED_VIEW); + } + + /** + * Create an aliased public.stale_materialized_view table reference + */ + public JStaleMaterializedView(Name alias) { + this(alias, STALE_MATERIALIZED_VIEW); + } + + private JStaleMaterializedView(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JStaleMaterializedView(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JStaleMaterializedView(Table child, ForeignKey key) { + super(child, key, STALE_MATERIALIZED_VIEW); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.STALE_MATERIALIZED_VIEW_NAME_KEY, Indexes.STALE_MATERIALIZED_VIEW_PKEY, Indexes.STALE_MV_CREATION_DATE_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_STALE_MATERIALIZED_VIEW; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.STALE_MATERIALIZED_VIEW_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.STALE_MATERIALIZED_VIEW_PKEY, Keys.STALE_MATERIALIZED_VIEW_NAME_KEY); + } + + @Override + public JStaleMaterializedView as(String alias) { + return new JStaleMaterializedView(DSL.name(alias), this); + } + + @Override + public JStaleMaterializedView as(Name alias) { + return new JStaleMaterializedView(alias, this); + } + + /** + * Rename this table + */ + @Override + public JStaleMaterializedView rename(String name) { + return new JStaleMaterializedView(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JStaleMaterializedView rename(Name name) { + return new JStaleMaterializedView(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatistics.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatistics.java old mode 100755 new mode 100644 index 31ba30fe3..c2fbd62de --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatistics.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatistics.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JStatisticsRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -36,162 +39,156 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JStatistics extends TableImpl { - /** - * The reference instance of public.statistics - */ - public static final JStatistics STATISTICS = new JStatistics(); - private static final long serialVersionUID = -879938205; - /** - * The column public.statistics.s_id. - */ - public final TableField S_ID = createField(DSL.name("s_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('statistics_s_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.statistics.s_counter. - */ - public final TableField S_COUNTER = createField(DSL.name("s_counter"), - org.jooq.impl.SQLDataType.INTEGER.defaultValue( - org.jooq.impl.DSL.field("0", org.jooq.impl.SQLDataType.INTEGER)), this, ""); - /** - * The column public.statistics.launch_id. - */ - public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.statistics.item_id. - */ - public final TableField ITEM_ID = createField(DSL.name("item_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.statistics.statistics_field_id. - */ - public final TableField STATISTICS_FIELD_ID = createField( - DSL.name("statistics_field_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * Create a public.statistics table reference - */ - public JStatistics() { - this(DSL.name("statistics"), null); - } - - /** - * Create an aliased public.statistics table reference - */ - public JStatistics(String alias) { - this(DSL.name(alias), STATISTICS); - } - - /** - * Create an aliased public.statistics table reference - */ - public JStatistics(Name alias) { - this(alias, STATISTICS); - } - - private JStatistics(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JStatistics(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JStatistics(Table child, ForeignKey key) { - super(child, key, STATISTICS); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JStatisticsRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.STATISTICS_LAUNCH_IDX, Indexes.STATISTICS_PK, - Indexes.STATISTICS_TI_IDX, Indexes.UNIQUE_STATS_ITEM, Indexes.UNIQUE_STATS_LAUNCH); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_STATISTICS; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.STATISTICS_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.STATISTICS_PK, Keys.UNIQUE_STATS_LAUNCH, - Keys.UNIQUE_STATS_ITEM); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.STATISTICS__STATISTICS_LAUNCH_ID_FKEY, Keys.STATISTICS__STATISTICS_ITEM_ID_FKEY, - Keys.STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY); - } - - public JLaunch launch() { - return new JLaunch(this, Keys.STATISTICS__STATISTICS_LAUNCH_ID_FKEY); - } - - public JTestItem testItem() { - return new JTestItem(this, Keys.STATISTICS__STATISTICS_ITEM_ID_FKEY); - } - - public JStatisticsField statisticsField() { - return new JStatisticsField(this, Keys.STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY); - } - - @Override - public JStatistics as(String alias) { - return new JStatistics(DSL.name(alias), this); - } - - @Override - public JStatistics as(Name alias) { - return new JStatistics(alias, this); - } - - /** - * Rename this table - */ - @Override - public JStatistics rename(String name) { - return new JStatistics(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JStatistics rename(Name name) { - return new JStatistics(name, null); - } - - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } + private static final long serialVersionUID = -879938205; + + /** + * The reference instance of public.statistics + */ + public static final JStatistics STATISTICS = new JStatistics(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JStatisticsRecord.class; + } + + /** + * The column public.statistics.s_id. + */ + public final TableField S_ID = createField(DSL.name("s_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('statistics_s_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.statistics.s_counter. + */ + public final TableField S_COUNTER = createField(DSL.name("s_counter"), org.jooq.impl.SQLDataType.INTEGER.defaultValue(org.jooq.impl.DSL.field("0", org.jooq.impl.SQLDataType.INTEGER)), this, ""); + + /** + * The column public.statistics.launch_id. + */ + public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.statistics.item_id. + */ + public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.statistics.statistics_field_id. + */ + public final TableField STATISTICS_FIELD_ID = createField(DSL.name("statistics_field_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * Create a public.statistics table reference + */ + public JStatistics() { + this(DSL.name("statistics"), null); + } + + /** + * Create an aliased public.statistics table reference + */ + public JStatistics(String alias) { + this(DSL.name(alias), STATISTICS); + } + + /** + * Create an aliased public.statistics table reference + */ + public JStatistics(Name alias) { + this(alias, STATISTICS); + } + + private JStatistics(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JStatistics(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JStatistics(Table child, ForeignKey key) { + super(child, key, STATISTICS); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.STATISTICS_LAUNCH_IDX, Indexes.STATISTICS_PK, Indexes.STATISTICS_TI_IDX, Indexes.UNIQUE_STATS_ITEM, Indexes.UNIQUE_STATS_LAUNCH); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_STATISTICS; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.STATISTICS_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.STATISTICS_PK, Keys.UNIQUE_STATS_LAUNCH, Keys.UNIQUE_STATS_ITEM); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.STATISTICS__STATISTICS_LAUNCH_ID_FKEY, Keys.STATISTICS__STATISTICS_ITEM_ID_FKEY, Keys.STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY); + } + + public JLaunch launch() { + return new JLaunch(this, Keys.STATISTICS__STATISTICS_LAUNCH_ID_FKEY); + } + + public JTestItem testItem() { + return new JTestItem(this, Keys.STATISTICS__STATISTICS_ITEM_ID_FKEY); + } + + public JStatisticsField statisticsField() { + return new JStatisticsField(this, Keys.STATISTICS__STATISTICS_STATISTICS_FIELD_ID_FKEY); + } + + @Override + public JStatistics as(String alias) { + return new JStatistics(DSL.name(alias), this); + } + + @Override + public JStatistics as(Name alias) { + return new JStatistics(alias, this); + } + + /** + * Rename this table + */ + @Override + public JStatistics rename(String name) { + return new JStatistics(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JStatistics rename(Name name) { + return new JStatistics(name, null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatisticsField.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatisticsField.java index a5a96bf8c..ba03c618b 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatisticsField.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JStatisticsField.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JStatisticsFieldRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -36,128 +39,124 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JStatisticsField extends TableImpl { - /** - * The reference instance of public.statistics_field - */ - public static final JStatisticsField STATISTICS_FIELD = new JStatisticsField(); - private static final long serialVersionUID = 1631655273; - /** - * The column public.statistics_field.sf_id. - */ - public final TableField SF_ID = createField(DSL.name("sf_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('statistics_field_sf_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.statistics_field.name. - */ - public final TableField NAME = createField(DSL.name("name"), - org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - - /** - * Create a public.statistics_field table reference - */ - public JStatisticsField() { - this(DSL.name("statistics_field"), null); - } - - /** - * Create an aliased public.statistics_field table reference - */ - public JStatisticsField(String alias) { - this(DSL.name(alias), STATISTICS_FIELD); - } - - /** - * Create an aliased public.statistics_field table reference - */ - public JStatisticsField(Name alias) { - this(alias, STATISTICS_FIELD); - } - - private JStatisticsField(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JStatisticsField(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JStatisticsField(Table child, - ForeignKey key) { - super(child, key, STATISTICS_FIELD); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JStatisticsFieldRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.STATISTICS_FIELD_NAME_KEY, Indexes.STATISTICS_FIELD_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_STATISTICS_FIELD; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.STATISTICS_FIELD_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.STATISTICS_FIELD_PK, - Keys.STATISTICS_FIELD_NAME_KEY); - } - - @Override - public JStatisticsField as(String alias) { - return new JStatisticsField(DSL.name(alias), this); - } - - @Override - public JStatisticsField as(Name alias) { - return new JStatisticsField(alias, this); - } - - /** - * Rename this table - */ - @Override - public JStatisticsField rename(String name) { - return new JStatisticsField(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JStatisticsField rename(Name name) { - return new JStatisticsField(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + private static final long serialVersionUID = 1631655273; + + /** + * The reference instance of public.statistics_field + */ + public static final JStatisticsField STATISTICS_FIELD = new JStatisticsField(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JStatisticsFieldRecord.class; + } + + /** + * The column public.statistics_field.sf_id. + */ + public final TableField SF_ID = createField(DSL.name("sf_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('statistics_field_sf_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.statistics_field.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + + /** + * Create a public.statistics_field table reference + */ + public JStatisticsField() { + this(DSL.name("statistics_field"), null); + } + + /** + * Create an aliased public.statistics_field table reference + */ + public JStatisticsField(String alias) { + this(DSL.name(alias), STATISTICS_FIELD); + } + + /** + * Create an aliased public.statistics_field table reference + */ + public JStatisticsField(Name alias) { + this(alias, STATISTICS_FIELD); + } + + private JStatisticsField(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JStatisticsField(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JStatisticsField(Table child, ForeignKey key) { + super(child, key, STATISTICS_FIELD); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.STATISTICS_FIELD_NAME_KEY, Indexes.STATISTICS_FIELD_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_STATISTICS_FIELD; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.STATISTICS_FIELD_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.STATISTICS_FIELD_PK, Keys.STATISTICS_FIELD_NAME_KEY); + } + + @Override + public JStatisticsField as(String alias) { + return new JStatisticsField(DSL.name(alias), this); + } + + @Override + public JStatisticsField as(Name alias) { + return new JStatisticsField(alias, this); + } + + /** + * Rename this table + */ + @Override + public JStatisticsField rename(String name) { + return new JStatisticsField(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JStatisticsField rename(Name name) { + return new JStatisticsField(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItem.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItem.java old mode 100755 new mode 100644 index f70d13c44..54aee9985 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItem.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItem.java @@ -9,10 +9,13 @@ import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum; import com.epam.ta.reportportal.jooq.tables.records.JTestItemRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -38,232 +41,221 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JTestItem extends TableImpl { - /** - * The reference instance of public.test_item - */ - public static final JTestItem TEST_ITEM = new JTestItem(); - private static final long serialVersionUID = 1848873064; - /** - * The column public.test_item.item_id. - */ - public final TableField ITEM_ID = createField(DSL.name("item_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('test_item_item_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.test_item.uuid. - */ - public final TableField UUID = createField(DSL.name("uuid"), - org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, ""); - /** - * The column public.test_item.name. - */ - public final TableField NAME = createField(DSL.name("name"), - org.jooq.impl.SQLDataType.VARCHAR(1024), this, ""); - /** - * The column public.test_item.code_ref. - */ - public final TableField CODE_REF = createField(DSL.name("code_ref"), - org.jooq.impl.SQLDataType.VARCHAR, this, ""); - /** - * The column public.test_item.type. - */ - public final TableField TYPE = createField(DSL.name("type"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false) - .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum.class), this, ""); - /** - * The column public.test_item.start_time. - */ - public final TableField START_TIME = createField( - DSL.name("start_time"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - /** - * The column public.test_item.description. - */ - public final TableField DESCRIPTION = createField( - DSL.name("description"), org.jooq.impl.SQLDataType.CLOB, this, ""); - /** - * The column public.test_item.last_modified. - */ - public final TableField LAST_MODIFIED = createField( - DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - /** - * The column public.test_item.path. - */ - public final TableField PATH = createField(DSL.name("path"), - org.jooq.impl.DefaultDataType.getDefaultDataType("\"public\".\"ltree\""), this, ""); - /** - * The column public.test_item.unique_id. - */ - public final TableField UNIQUE_ID = createField(DSL.name("unique_id"), - org.jooq.impl.SQLDataType.VARCHAR(1024), this, ""); - /** - * The column public.test_item.test_case_id. - */ - public final TableField TEST_CASE_ID = createField( - DSL.name("test_case_id"), org.jooq.impl.SQLDataType.VARCHAR(1024), this, ""); - /** - * The column public.test_item.has_children. - */ - public final TableField HAS_CHILDREN = createField( - DSL.name("has_children"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue( - org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - /** - * The column public.test_item.has_retries. - */ - public final TableField HAS_RETRIES = createField( - DSL.name("has_retries"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue( - org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - /** - * The column public.test_item.has_stats. - */ - public final TableField HAS_STATS = createField(DSL.name("has_stats"), - org.jooq.impl.SQLDataType.BOOLEAN.defaultValue( - org.jooq.impl.DSL.field("true", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); - /** - * The column public.test_item.parent_id. - */ - public final TableField PARENT_ID = createField(DSL.name("parent_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.test_item.retry_of. - */ - public final TableField RETRY_OF = createField(DSL.name("retry_of"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.test_item.launch_id. - */ - public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.test_item.test_case_hash. - */ - public final TableField TEST_CASE_HASH = createField( - DSL.name("test_case_hash"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); - - /** - * Create a public.test_item table reference - */ - public JTestItem() { - this(DSL.name("test_item"), null); - } - - /** - * Create an aliased public.test_item table reference - */ - public JTestItem(String alias) { - this(DSL.name(alias), TEST_ITEM); - } - - /** - * Create an aliased public.test_item table reference - */ - public JTestItem(Name alias) { - this(alias, TEST_ITEM); - } - - private JTestItem(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JTestItem(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JTestItem(Table child, ForeignKey key) { - super(child, key, TEST_ITEM); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JTestItemRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ITEM_TEST_CASE_ID_LAUNCH_ID_IDX, Indexes.PATH_GIST_IDX, - Indexes.PATH_IDX, Indexes.TEST_CASE_HASH_LAUNCH_ID_IDX, Indexes.TEST_ITEM_PK, - Indexes.TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX, Indexes.TEST_ITEM_UUID_KEY, - Indexes.TI_LAUNCH_IDX, Indexes.TI_PARENT_IDX, Indexes.TI_RETRY_OF_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_TEST_ITEM; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.TEST_ITEM_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.TEST_ITEM_PK, Keys.TEST_ITEM_UUID_KEY); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY, - Keys.TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY, Keys.TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY); - } - - public com.epam.ta.reportportal.jooq.tables.JTestItem testItem_TestItemParentIdFkey() { - return new com.epam.ta.reportportal.jooq.tables.JTestItem(this, - Keys.TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY); - } - - public com.epam.ta.reportportal.jooq.tables.JTestItem testItem_TestItemRetryOfFkey() { - return new com.epam.ta.reportportal.jooq.tables.JTestItem(this, - Keys.TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY); - } - - public JLaunch launch() { - return new JLaunch(this, Keys.TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY); - } - - @Override - public JTestItem as(String alias) { - return new JTestItem(DSL.name(alias), this); - } - - @Override - public JTestItem as(Name alias) { - return new JTestItem(alias, this); - } - - /** - * Rename this table - */ - @Override - public JTestItem rename(String name) { - return new JTestItem(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JTestItem rename(Name name) { - return new JTestItem(name, null); - } - - // ------------------------------------------------------------------------- - // Row18 type methods - // ------------------------------------------------------------------------- - - @Override - public Row18 fieldsRow() { - return (Row18) super.fieldsRow(); - } + private static final long serialVersionUID = 1848873064; + + /** + * The reference instance of public.test_item + */ + public static final JTestItem TEST_ITEM = new JTestItem(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JTestItemRecord.class; + } + + /** + * The column public.test_item.item_id. + */ + public final TableField ITEM_ID = createField(DSL.name("item_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('test_item_item_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.test_item.uuid. + */ + public final TableField UUID = createField(DSL.name("uuid"), org.jooq.impl.SQLDataType.VARCHAR(36).nullable(false), this, ""); + + /** + * The column public.test_item.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(1024), this, ""); + + /** + * The column public.test_item.code_ref. + */ + public final TableField CODE_REF = createField(DSL.name("code_ref"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * The column public.test_item.type. + */ + public final TableField TYPE = createField(DSL.name("type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum.class), this, ""); + + /** + * The column public.test_item.start_time. + */ + public final TableField START_TIME = createField(DSL.name("start_time"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * The column public.test_item.description. + */ + public final TableField DESCRIPTION = createField(DSL.name("description"), org.jooq.impl.SQLDataType.CLOB, this, ""); + + /** + * The column public.test_item.last_modified. + */ + public final TableField LAST_MODIFIED = createField(DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * The column public.test_item.path. + */ + public final TableField PATH = createField(DSL.name("path"), org.jooq.impl.DefaultDataType.getDefaultDataType("\"public\".\"ltree\""), this, ""); + + /** + * The column public.test_item.unique_id. + */ + public final TableField UNIQUE_ID = createField(DSL.name("unique_id"), org.jooq.impl.SQLDataType.VARCHAR(1024), this, ""); + + /** + * The column public.test_item.test_case_id. + */ + public final TableField TEST_CASE_ID = createField(DSL.name("test_case_id"), org.jooq.impl.SQLDataType.VARCHAR(1024), this, ""); + + /** + * The column public.test_item.has_children. + */ + public final TableField HAS_CHILDREN = createField(DSL.name("has_children"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + + /** + * The column public.test_item.has_retries. + */ + public final TableField HAS_RETRIES = createField(DSL.name("has_retries"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + + /** + * The column public.test_item.has_stats. + */ + public final TableField HAS_STATS = createField(DSL.name("has_stats"), org.jooq.impl.SQLDataType.BOOLEAN.defaultValue(org.jooq.impl.DSL.field("true", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + + /** + * The column public.test_item.parent_id. + */ + public final TableField PARENT_ID = createField(DSL.name("parent_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.test_item.retry_of. + */ + public final TableField RETRY_OF = createField(DSL.name("retry_of"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.test_item.launch_id. + */ + public final TableField LAUNCH_ID = createField(DSL.name("launch_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.test_item.test_case_hash. + */ + public final TableField TEST_CASE_HASH = createField(DSL.name("test_case_hash"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * Create a public.test_item table reference + */ + public JTestItem() { + this(DSL.name("test_item"), null); + } + + /** + * Create an aliased public.test_item table reference + */ + public JTestItem(String alias) { + this(DSL.name(alias), TEST_ITEM); + } + + /** + * Create an aliased public.test_item table reference + */ + public JTestItem(Name alias) { + this(alias, TEST_ITEM); + } + + private JTestItem(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JTestItem(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JTestItem(Table child, ForeignKey key) { + super(child, key, TEST_ITEM); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ITEM_TEST_CASE_ID_LAUNCH_ID_IDX, Indexes.PATH_GIST_IDX, Indexes.PATH_IDX, Indexes.TEST_CASE_HASH_LAUNCH_ID_IDX, Indexes.TEST_ITEM_PK, Indexes.TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX, Indexes.TEST_ITEM_UUID_KEY, Indexes.TI_LAUNCH_IDX, Indexes.TI_PARENT_IDX, Indexes.TI_RETRY_OF_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_TEST_ITEM; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.TEST_ITEM_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.TEST_ITEM_PK, Keys.TEST_ITEM_UUID_KEY); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY, Keys.TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY, Keys.TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY); + } + + public com.epam.ta.reportportal.jooq.tables.JTestItem testItem_TestItemParentIdFkey() { + return new com.epam.ta.reportportal.jooq.tables.JTestItem(this, Keys.TEST_ITEM__TEST_ITEM_PARENT_ID_FKEY); + } + + public com.epam.ta.reportportal.jooq.tables.JTestItem testItem_TestItemRetryOfFkey() { + return new com.epam.ta.reportportal.jooq.tables.JTestItem(this, Keys.TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY); + } + + public JLaunch launch() { + return new JLaunch(this, Keys.TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY); + } + + @Override + public JTestItem as(String alias) { + return new JTestItem(DSL.name(alias), this); + } + + @Override + public JTestItem as(Name alias) { + return new JTestItem(alias, this); + } + + /** + * Rename this table + */ + @Override + public JTestItem rename(String name) { + return new JTestItem(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JTestItem rename(Name name) { + return new JTestItem(name, null); + } + + // ------------------------------------------------------------------------- + // Row18 type methods + // ------------------------------------------------------------------------- + + @Override + public Row18 fieldsRow() { + return (Row18) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItemResults.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItemResults.java old mode 100755 new mode 100644 index 78793f3ca..81ec18eb1 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItemResults.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItemResults.java @@ -9,10 +9,13 @@ import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.enums.JStatusEnum; import com.epam.ta.reportportal.jooq.tables.records.JTestItemResultsRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -37,141 +40,138 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JTestItemResults extends TableImpl { - /** - * The reference instance of public.test_item_results - */ - public static final JTestItemResults TEST_ITEM_RESULTS = new JTestItemResults(); - private static final long serialVersionUID = 1284570207; - /** - * The column public.test_item_results.result_id. - */ - public final TableField RESULT_ID = createField( - DSL.name("result_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.test_item_results.status. - */ - public final TableField STATUS = createField( - DSL.name("status"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false) - .asEnumDataType(com.epam.ta.reportportal.jooq.enums.JStatusEnum.class), this, ""); - /** - * The column public.test_item_results.end_time. - */ - public final TableField END_TIME = createField( - DSL.name("end_time"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); - /** - * The column public.test_item_results.duration. - */ - public final TableField DURATION = createField( - DSL.name("duration"), org.jooq.impl.SQLDataType.DOUBLE, this, ""); - - /** - * Create a public.test_item_results table reference - */ - public JTestItemResults() { - this(DSL.name("test_item_results"), null); - } - - /** - * Create an aliased public.test_item_results table reference - */ - public JTestItemResults(String alias) { - this(DSL.name(alias), TEST_ITEM_RESULTS); - } - - /** - * Create an aliased public.test_item_results table reference - */ - public JTestItemResults(Name alias) { - this(alias, TEST_ITEM_RESULTS); - } - - private JTestItemResults(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JTestItemResults(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JTestItemResults(Table child, - ForeignKey key) { - super(child, key, TEST_ITEM_RESULTS); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JTestItemResultsRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.TEST_ITEM_RESULTS_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.TEST_ITEM_RESULTS_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.TEST_ITEM_RESULTS_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY); - } - - public JTestItem testItem() { - return new JTestItem(this, Keys.TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY); - } - - @Override - public JTestItemResults as(String alias) { - return new JTestItemResults(DSL.name(alias), this); - } - - @Override - public JTestItemResults as(Name alias) { - return new JTestItemResults(alias, this); - } - - /** - * Rename this table - */ - @Override - public JTestItemResults rename(String name) { - return new JTestItemResults(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JTestItemResults rename(Name name) { - return new JTestItemResults(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + private static final long serialVersionUID = 1284570207; + + /** + * The reference instance of public.test_item_results + */ + public static final JTestItemResults TEST_ITEM_RESULTS = new JTestItemResults(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JTestItemResultsRecord.class; + } + + /** + * The column public.test_item_results.result_id. + */ + public final TableField RESULT_ID = createField(DSL.name("result_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.test_item_results.status. + */ + public final TableField STATUS = createField(DSL.name("status"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JStatusEnum.class), this, ""); + + /** + * The column public.test_item_results.end_time. + */ + public final TableField END_TIME = createField(DSL.name("end_time"), org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); + + /** + * The column public.test_item_results.duration. + */ + public final TableField DURATION = createField(DSL.name("duration"), org.jooq.impl.SQLDataType.DOUBLE, this, ""); + + /** + * Create a public.test_item_results table reference + */ + public JTestItemResults() { + this(DSL.name("test_item_results"), null); + } + + /** + * Create an aliased public.test_item_results table reference + */ + public JTestItemResults(String alias) { + this(DSL.name(alias), TEST_ITEM_RESULTS); + } + + /** + * Create an aliased public.test_item_results table reference + */ + public JTestItemResults(Name alias) { + this(alias, TEST_ITEM_RESULTS); + } + + private JTestItemResults(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JTestItemResults(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JTestItemResults(Table child, ForeignKey key) { + super(child, key, TEST_ITEM_RESULTS); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.TEST_ITEM_RESULTS_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.TEST_ITEM_RESULTS_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.TEST_ITEM_RESULTS_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY); + } + + public JTestItem testItem() { + return new JTestItem(this, Keys.TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY); + } + + @Override + public JTestItemResults as(String alias) { + return new JTestItemResults(DSL.name(alias), this); + } + + @Override + public JTestItemResults as(Name alias) { + return new JTestItemResults(alias, this); + } + + /** + * Rename this table + */ + @Override + public JTestItemResults rename(String name) { + return new JTestItemResults(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JTestItemResults rename(Name name) { + return new JTestItemResults(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTicket.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTicket.java index 4ac4c6f6f..0520aa80f 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTicket.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTicket.java @@ -8,10 +8,13 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JTicketRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -37,158 +40,154 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JTicket extends TableImpl { - /** - * The reference instance of public.ticket - */ - public static final JTicket TICKET = new JTicket(); - private static final long serialVersionUID = -119397332; - /** - * The column public.ticket.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('ticket_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.ticket.ticket_id. - */ - public final TableField TICKET_ID = createField(DSL.name("ticket_id"), - org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - /** - * The column public.ticket.submitter. - */ - public final TableField SUBMITTER = createField(DSL.name("submitter"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.ticket.submit_date. - */ - public final TableField SUBMIT_DATE = createField( - DSL.name("submit_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false) - .defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), - this, ""); - /** - * The column public.ticket.bts_url. - */ - public final TableField BTS_URL = createField(DSL.name("bts_url"), - org.jooq.impl.SQLDataType.VARCHAR(1024).nullable(false), this, ""); - /** - * The column public.ticket.bts_project. - */ - public final TableField BTS_PROJECT = createField(DSL.name("bts_project"), - org.jooq.impl.SQLDataType.VARCHAR(1024).nullable(false), this, ""); - /** - * The column public.ticket.url. - */ - public final TableField URL = createField(DSL.name("url"), - org.jooq.impl.SQLDataType.VARCHAR(1024).nullable(false), this, ""); - /** - * The column public.ticket.plugin_name. - */ - public final TableField PLUGIN_NAME = createField(DSL.name("plugin_name"), - org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); - - /** - * Create a public.ticket table reference - */ - public JTicket() { - this(DSL.name("ticket"), null); - } - - /** - * Create an aliased public.ticket table reference - */ - public JTicket(String alias) { - this(DSL.name(alias), TICKET); - } - - /** - * Create an aliased public.ticket table reference - */ - public JTicket(Name alias) { - this(alias, TICKET); - } - - private JTicket(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JTicket(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JTicket(Table child, ForeignKey key) { - super(child, key, TICKET); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JTicketRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.TICKET_ID_IDX, Indexes.TICKET_PK, - Indexes.TICKET_SUBMITTER_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_TICKET; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.TICKET_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.TICKET_PK); - } - - @Override - public JTicket as(String alias) { - return new JTicket(DSL.name(alias), this); - } - - @Override - public JTicket as(Name alias) { - return new JTicket(alias, this); - } - - /** - * Rename this table - */ - @Override - public JTicket rename(String name) { - return new JTicket(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JTicket rename(Name name) { - return new JTicket(name, null); - } - - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } + private static final long serialVersionUID = -119397332; + + /** + * The reference instance of public.ticket + */ + public static final JTicket TICKET = new JTicket(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JTicketRecord.class; + } + + /** + * The column public.ticket.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('ticket_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.ticket.ticket_id. + */ + public final TableField TICKET_ID = createField(DSL.name("ticket_id"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); + + /** + * The column public.ticket.submitter. + */ + public final TableField SUBMITTER = createField(DSL.name("submitter"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.ticket.submit_date. + */ + public final TableField SUBMIT_DATE = createField(DSL.name("submit_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column public.ticket.bts_url. + */ + public final TableField BTS_URL = createField(DSL.name("bts_url"), org.jooq.impl.SQLDataType.VARCHAR(1024).nullable(false), this, ""); + + /** + * The column public.ticket.bts_project. + */ + public final TableField BTS_PROJECT = createField(DSL.name("bts_project"), org.jooq.impl.SQLDataType.VARCHAR(1024).nullable(false), this, ""); + + /** + * The column public.ticket.url. + */ + public final TableField URL = createField(DSL.name("url"), org.jooq.impl.SQLDataType.VARCHAR(1024).nullable(false), this, ""); + + /** + * The column public.ticket.plugin_name. + */ + public final TableField PLUGIN_NAME = createField(DSL.name("plugin_name"), org.jooq.impl.SQLDataType.VARCHAR(128), this, ""); + + /** + * Create a public.ticket table reference + */ + public JTicket() { + this(DSL.name("ticket"), null); + } + + /** + * Create an aliased public.ticket table reference + */ + public JTicket(String alias) { + this(DSL.name(alias), TICKET); + } + + /** + * Create an aliased public.ticket table reference + */ + public JTicket(Name alias) { + this(alias, TICKET); + } + + private JTicket(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JTicket(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JTicket(Table child, ForeignKey key) { + super(child, key, TICKET); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.TICKET_ID_IDX, Indexes.TICKET_PK, Indexes.TICKET_SUBMITTER_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_TICKET; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.TICKET_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.TICKET_PK); + } + + @Override + public JTicket as(String alias) { + return new JTicket(DSL.name(alias), this); + } + + @Override + public JTicket as(Name alias) { + return new JTicket(alias, this); + } + + /** + * Rename this table + */ + @Override + public JTicket rename(String name) { + return new JTicket(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JTicket rename(Name name) { + return new JTicket(name, null); + } + + // ------------------------------------------------------------------------- + // Row8 type methods + // ------------------------------------------------------------------------- + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserCreationBid.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserCreationBid.java index 5754e0beb..c17df5c06 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserCreationBid.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserCreationBid.java @@ -8,16 +8,20 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JUserCreationBidRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; +import org.jooq.JSONB; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row5; +import org.jooq.Row6; import org.jooq.Schema; import org.jooq.Table; import org.jooq.TableField; @@ -36,146 +40,153 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JUserCreationBid extends TableImpl { - /** - * The reference instance of public.user_creation_bid - */ - public static final JUserCreationBid USER_CREATION_BID = new JUserCreationBid(); - private static final long serialVersionUID = 1036111992; - /** - * The column public.user_creation_bid.uuid. - */ - public final TableField UUID = createField(DSL.name("uuid"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.user_creation_bid.last_modified. - */ - public final TableField LAST_MODIFIED = createField( - DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue( - org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); - /** - * The column public.user_creation_bid.email. - */ - public final TableField EMAIL = createField(DSL.name("email"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.user_creation_bid.default_project_id. - */ - public final TableField DEFAULT_PROJECT_ID = createField( - DSL.name("default_project_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.user_creation_bid.role. - */ - public final TableField ROLE = createField(DSL.name("role"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - - /** - * Create a public.user_creation_bid table reference - */ - public JUserCreationBid() { - this(DSL.name("user_creation_bid"), null); - } - - /** - * Create an aliased public.user_creation_bid table reference - */ - public JUserCreationBid(String alias) { - this(DSL.name(alias), USER_CREATION_BID); - } - - /** - * Create an aliased public.user_creation_bid table reference - */ - public JUserCreationBid(Name alias) { - this(alias, USER_CREATION_BID); - } - - private JUserCreationBid(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JUserCreationBid(Name alias, Table aliased, - Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JUserCreationBid(Table child, - ForeignKey key) { - super(child, key, USER_CREATION_BID); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JUserCreationBidRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.USER_BID_PROJECT_IDX, Indexes.USER_CREATION_BID_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.USER_CREATION_BID_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.USER_CREATION_BID_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY); - } - - @Override - public JUserCreationBid as(String alias) { - return new JUserCreationBid(DSL.name(alias), this); - } - - @Override - public JUserCreationBid as(Name alias) { - return new JUserCreationBid(alias, this); - } - - /** - * Rename this table - */ - @Override - public JUserCreationBid rename(String name) { - return new JUserCreationBid(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JUserCreationBid rename(Name name) { - return new JUserCreationBid(name, null); - } - - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } + private static final long serialVersionUID = -1960236175; + + /** + * The reference instance of public.user_creation_bid + */ + public static final JUserCreationBid USER_CREATION_BID = new JUserCreationBid(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JUserCreationBidRecord.class; + } + + /** + * The column public.user_creation_bid.uuid. + */ + public final TableField UUID = createField(DSL.name("uuid"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.user_creation_bid.last_modified. + */ + public final TableField LAST_MODIFIED = createField(DSL.name("last_modified"), org.jooq.impl.SQLDataType.TIMESTAMP.defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMP)), this, ""); + + /** + * The column public.user_creation_bid.email. + */ + public final TableField EMAIL = createField(DSL.name("email"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.user_creation_bid.default_project_id. + */ + public final TableField DEFAULT_PROJECT_ID = createField(DSL.name("default_project_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.user_creation_bid.role. + */ + public final TableField ROLE = createField(DSL.name("role"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.user_creation_bid.project_name. + */ + public final TableField PROJECT_NAME = createField(DSL.name("project_name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.user_creation_bid.metadata. + */ + public final TableField METADATA = createField(DSL.name("metadata"), org.jooq.impl.SQLDataType.JSONB, this, ""); + + /** + * Create a public.user_creation_bid table reference + */ + public JUserCreationBid() { + this(DSL.name("user_creation_bid"), null); + } + + /** + * Create an aliased public.user_creation_bid table reference + */ + public JUserCreationBid(String alias) { + this(DSL.name(alias), USER_CREATION_BID); + } + + /** + * Create an aliased public.user_creation_bid table reference + */ + public JUserCreationBid(Name alias) { + this(alias, USER_CREATION_BID); + } + + private JUserCreationBid(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JUserCreationBid(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JUserCreationBid(Table child, ForeignKey key) { + super(child, key, USER_CREATION_BID); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.USER_BID_PROJECT_IDX, Indexes.USER_CREATION_BID_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.USER_CREATION_BID_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.USER_CREATION_BID_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY); + } + + @Override + public JUserCreationBid as(String alias) { + return new JUserCreationBid(DSL.name(alias), this); + } + + @Override + public JUserCreationBid as(Name alias) { + return new JUserCreationBid(alias, this); + } + + /** + * Rename this table + */ + @Override + public JUserCreationBid rename(String name) { + return new JUserCreationBid(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JUserCreationBid rename(Name name) { + return new JUserCreationBid(name, null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserPreference.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserPreference.java old mode 100755 new mode 100644 index 391f703d5..9640cdd36 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserPreference.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserPreference.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JUserPreferenceRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -36,157 +39,151 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JUserPreference extends TableImpl { - /** - * The reference instance of public.user_preference - */ - public static final JUserPreference USER_PREFERENCE = new JUserPreference(); - private static final long serialVersionUID = 732684537; - /** - * The column public.user_preference.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('user_preference_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.user_preference.project_id. - */ - public final TableField PROJECT_ID = createField( - DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.user_preference.user_id. - */ - public final TableField USER_ID = createField(DSL.name("user_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.user_preference.filter_id. - */ - public final TableField FILTER_ID = createField( - DSL.name("filter_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.user_preference table reference - */ - public JUserPreference() { - this(DSL.name("user_preference"), null); - } - - /** - * Create an aliased public.user_preference table reference - */ - public JUserPreference(String alias) { - this(DSL.name(alias), USER_PREFERENCE); - } - - /** - * Create an aliased public.user_preference table reference - */ - public JUserPreference(Name alias) { - this(alias, USER_PREFERENCE); - } - - private JUserPreference(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JUserPreference(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JUserPreference(Table child, - ForeignKey key) { - super(child, key, USER_PREFERENCE); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JUserPreferenceRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.USER_PREFERENCE_PK, Indexes.USER_PREFERENCE_UQ); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_USER_PREFERENCE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.USER_PREFERENCE_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.USER_PREFERENCE_PK, - Keys.USER_PREFERENCE_UQ); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY, - Keys.USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY, - Keys.USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY); - } - - public JUsers users() { - return new JUsers(this, Keys.USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY); - } - - public JFilter filter() { - return new JFilter(this, Keys.USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY); - } - - @Override - public JUserPreference as(String alias) { - return new JUserPreference(DSL.name(alias), this); - } - - @Override - public JUserPreference as(Name alias) { - return new JUserPreference(alias, this); - } - - /** - * Rename this table - */ - @Override - public JUserPreference rename(String name) { - return new JUserPreference(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JUserPreference rename(Name name) { - return new JUserPreference(name, null); - } - - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } + private static final long serialVersionUID = 732684537; + + /** + * The reference instance of public.user_preference + */ + public static final JUserPreference USER_PREFERENCE = new JUserPreference(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JUserPreferenceRecord.class; + } + + /** + * The column public.user_preference.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('user_preference_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.user_preference.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.user_preference.user_id. + */ + public final TableField USER_ID = createField(DSL.name("user_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.user_preference.filter_id. + */ + public final TableField FILTER_ID = createField(DSL.name("filter_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.user_preference table reference + */ + public JUserPreference() { + this(DSL.name("user_preference"), null); + } + + /** + * Create an aliased public.user_preference table reference + */ + public JUserPreference(String alias) { + this(DSL.name(alias), USER_PREFERENCE); + } + + /** + * Create an aliased public.user_preference table reference + */ + public JUserPreference(Name alias) { + this(alias, USER_PREFERENCE); + } + + private JUserPreference(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JUserPreference(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JUserPreference(Table child, ForeignKey key) { + super(child, key, USER_PREFERENCE); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.USER_PREFERENCE_PK, Indexes.USER_PREFERENCE_UQ); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_USER_PREFERENCE; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.USER_PREFERENCE_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.USER_PREFERENCE_PK, Keys.USER_PREFERENCE_UQ); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY, Keys.USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY, Keys.USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY); + } + + public JUsers users() { + return new JUsers(this, Keys.USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY); + } + + public JFilter filter() { + return new JFilter(this, Keys.USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY); + } + + @Override + public JUserPreference as(String alias) { + return new JUserPreference(DSL.name(alias), this); + } + + @Override + public JUserPreference as(Name alias) { + return new JUserPreference(alias, this); + } + + /** + * Rename this table + */ + @Override + public JUserPreference rename(String name) { + return new JUserPreference(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JUserPreference rename(Name name) { + return new JUserPreference(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JUsers.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JUsers.java index 46dda6173..64bfc9264 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JUsers.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JUsers.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JUsersRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -37,171 +40,169 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JUsers extends TableImpl { - /** - * The reference instance of public.users - */ - public static final JUsers USERS = new JUsers(); - private static final long serialVersionUID = 2058736098; - /** - * The column public.users.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('users_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.users.login. - */ - public final TableField LOGIN = createField(DSL.name("login"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.users.password. - */ - public final TableField PASSWORD = createField(DSL.name("password"), - org.jooq.impl.SQLDataType.VARCHAR, this, ""); - /** - * The column public.users.email. - */ - public final TableField EMAIL = createField(DSL.name("email"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.users.attachment. - */ - public final TableField ATTACHMENT = createField(DSL.name("attachment"), - org.jooq.impl.SQLDataType.VARCHAR, this, ""); - /** - * The column public.users.attachment_thumbnail. - */ - public final TableField ATTACHMENT_THUMBNAIL = createField( - DSL.name("attachment_thumbnail"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - /** - * The column public.users.role. - */ - public final TableField ROLE = createField(DSL.name("role"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.users.type. - */ - public final TableField TYPE = createField(DSL.name("type"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.users.expired. - */ - public final TableField EXPIRED = createField(DSL.name("expired"), - org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); - /** - * The column public.users.full_name. - */ - public final TableField FULL_NAME = createField(DSL.name("full_name"), - org.jooq.impl.SQLDataType.VARCHAR, this, ""); - /** - * The column public.users.metadata. - */ - public final TableField METADATA = createField(DSL.name("metadata"), - org.jooq.impl.SQLDataType.JSONB, this, ""); - - /** - * Create a public.users table reference - */ - public JUsers() { - this(DSL.name("users"), null); - } - - /** - * Create an aliased public.users table reference - */ - public JUsers(String alias) { - this(DSL.name(alias), USERS); - } - - /** - * Create an aliased public.users table reference - */ - public JUsers(Name alias) { - this(alias, USERS); - } - - private JUsers(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JUsers(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JUsers(Table child, ForeignKey key) { - super(child, key, USERS); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JUsersRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.USERS_EMAIL_KEY, Indexes.USERS_LOGIN_KEY, Indexes.USERS_PK); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_USERS; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.USERS_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.USERS_PK, Keys.USERS_LOGIN_KEY, - Keys.USERS_EMAIL_KEY); - } - - @Override - public JUsers as(String alias) { - return new JUsers(DSL.name(alias), this); - } - - @Override - public JUsers as(Name alias) { - return new JUsers(alias, this); - } - - /** - * Rename this table - */ - @Override - public JUsers rename(String name) { - return new JUsers(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JUsers rename(Name name) { - return new JUsers(name, null); - } - - // ------------------------------------------------------------------------- - // Row11 type methods - // ------------------------------------------------------------------------- - - @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); - } + private static final long serialVersionUID = 2058736098; + + /** + * The reference instance of public.users + */ + public static final JUsers USERS = new JUsers(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JUsersRecord.class; + } + + /** + * The column public.users.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('users_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.users.login. + */ + public final TableField LOGIN = createField(DSL.name("login"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.users.password. + */ + public final TableField PASSWORD = createField(DSL.name("password"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * The column public.users.email. + */ + public final TableField EMAIL = createField(DSL.name("email"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.users.attachment. + */ + public final TableField ATTACHMENT = createField(DSL.name("attachment"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * The column public.users.attachment_thumbnail. + */ + public final TableField ATTACHMENT_THUMBNAIL = createField(DSL.name("attachment_thumbnail"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * The column public.users.role. + */ + public final TableField ROLE = createField(DSL.name("role"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.users.type. + */ + public final TableField TYPE = createField(DSL.name("type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.users.expired. + */ + public final TableField EXPIRED = createField(DSL.name("expired"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false), this, ""); + + /** + * The column public.users.full_name. + */ + public final TableField FULL_NAME = createField(DSL.name("full_name"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * The column public.users.metadata. + */ + public final TableField METADATA = createField(DSL.name("metadata"), org.jooq.impl.SQLDataType.JSONB, this, ""); + + /** + * Create a public.users table reference + */ + public JUsers() { + this(DSL.name("users"), null); + } + + /** + * Create an aliased public.users table reference + */ + public JUsers(String alias) { + this(DSL.name(alias), USERS); + } + + /** + * Create an aliased public.users table reference + */ + public JUsers(Name alias) { + this(alias, USERS); + } + + private JUsers(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JUsers(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JUsers(Table child, ForeignKey key) { + super(child, key, USERS); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.USERS_EMAIL_KEY, Indexes.USERS_LOGIN_KEY, Indexes.USERS_PK); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_USERS; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.USERS_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.USERS_PK, Keys.USERS_LOGIN_KEY, Keys.USERS_EMAIL_KEY); + } + + @Override + public JUsers as(String alias) { + return new JUsers(DSL.name(alias), this); + } + + @Override + public JUsers as(Name alias) { + return new JUsers(alias, this); + } + + /** + * Rename this table + */ + @Override + public JUsers rename(String name) { + return new JUsers(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JUsers rename(Name name) { + return new JUsers(name, null); + } + + // ------------------------------------------------------------------------- + // Row11 type methods + // ------------------------------------------------------------------------- + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidget.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidget.java index 3819bb92d..611428f13 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidget.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidget.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JWidgetRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -36,147 +39,148 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JWidget extends TableImpl { - /** - * The reference instance of public.widget - */ - public static final JWidget WIDGET = new JWidget(); - private static final long serialVersionUID = -796307886; - /** - * The column public.widget.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.widget.name. - */ - public final TableField NAME = createField(DSL.name("name"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.widget.description. - */ - public final TableField DESCRIPTION = createField(DSL.name("description"), - org.jooq.impl.SQLDataType.VARCHAR, this, ""); - /** - * The column public.widget.widget_type. - */ - public final TableField WIDGET_TYPE = createField(DSL.name("widget_type"), - org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); - /** - * The column public.widget.items_count. - */ - public final TableField ITEMS_COUNT = createField(DSL.name("items_count"), - org.jooq.impl.SQLDataType.SMALLINT, this, ""); - /** - * The column public.widget.widget_options. - */ - public final TableField WIDGET_OPTIONS = createField( - DSL.name("widget_options"), org.jooq.impl.SQLDataType.JSONB, this, ""); - - /** - * Create a public.widget table reference - */ - public JWidget() { - this(DSL.name("widget"), null); - } - - /** - * Create an aliased public.widget table reference - */ - public JWidget(String alias) { - this(DSL.name(alias), WIDGET); - } - - /** - * Create an aliased public.widget table reference - */ - public JWidget(Name alias) { - this(alias, WIDGET); - } - - private JWidget(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JWidget(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JWidget(Table child, ForeignKey key) { - super(child, key, WIDGET); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JWidgetRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.WIDGET_PKEY); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.WIDGET_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.WIDGET_PKEY); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.WIDGET__WIDGET_ID_FK); - } - - public JShareableEntity shareableEntity() { - return new JShareableEntity(this, Keys.WIDGET__WIDGET_ID_FK); - } - - @Override - public JWidget as(String alias) { - return new JWidget(DSL.name(alias), this); - } - - @Override - public JWidget as(Name alias) { - return new JWidget(alias, this); - } - - /** - * Rename this table - */ - @Override - public JWidget rename(String name) { - return new JWidget(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JWidget rename(Name name) { - return new JWidget(name, null); - } - - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } + private static final long serialVersionUID = 1350743694; + + /** + * The reference instance of public.widget + */ + public static final JWidget WIDGET = new JWidget(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JWidgetRecord.class; + } + + /** + * The column public.widget.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.widget.name. + */ + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.widget.description. + */ + public final TableField DESCRIPTION = createField(DSL.name("description"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * The column public.widget.widget_type. + */ + public final TableField WIDGET_TYPE = createField(DSL.name("widget_type"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.widget.items_count. + */ + public final TableField ITEMS_COUNT = createField(DSL.name("items_count"), org.jooq.impl.SQLDataType.SMALLINT, this, ""); + + /** + * The column public.widget.widget_options. + */ + public final TableField WIDGET_OPTIONS = createField(DSL.name("widget_options"), org.jooq.impl.SQLDataType.JSONB, this, ""); + + /** + * Create a public.widget table reference + */ + public JWidget() { + this(DSL.name("widget"), null); + } + + /** + * Create an aliased public.widget table reference + */ + public JWidget(String alias) { + this(DSL.name(alias), WIDGET); + } + + /** + * Create an aliased public.widget table reference + */ + public JWidget(Name alias) { + this(alias, WIDGET); + } + + private JWidget(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JWidget(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JWidget(Table child, ForeignKey key) { + super(child, key, WIDGET); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.WIDGET_PKEY); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.WIDGET_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.WIDGET_PKEY); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.WIDGET__WIDGET_ID_FK); + } + + public JOwnedEntity ownedEntity() { + return new JOwnedEntity(this, Keys.WIDGET__WIDGET_ID_FK); + } + + @Override + public JWidget as(String alias) { + return new JWidget(DSL.name(alias), this); + } + + @Override + public JWidget as(Name alias) { + return new JWidget(alias, this); + } + + /** + * Rename this table + */ + @Override + public JWidget rename(String name) { + return new JWidget(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JWidget rename(Name name) { + return new JWidget(name, null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidgetFilter.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidgetFilter.java old mode 100755 new mode 100644 index 182586658..4efca3481 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidgetFilter.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JWidgetFilter.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JWidgetFilterRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; @@ -35,133 +38,132 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JWidgetFilter extends TableImpl { - /** - * The reference instance of public.widget_filter - */ - public static final JWidgetFilter WIDGET_FILTER = new JWidgetFilter(); - private static final long serialVersionUID = 456969536; - /** - * The column public.widget_filter.widget_id. - */ - public final TableField WIDGET_ID = createField(DSL.name("widget_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - /** - * The column public.widget_filter.filter_id. - */ - public final TableField FILTER_ID = createField(DSL.name("filter_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.widget_filter table reference - */ - public JWidgetFilter() { - this(DSL.name("widget_filter"), null); - } - - /** - * Create an aliased public.widget_filter table reference - */ - public JWidgetFilter(String alias) { - this(DSL.name(alias), WIDGET_FILTER); - } - - /** - * Create an aliased public.widget_filter table reference - */ - public JWidgetFilter(Name alias) { - this(alias, WIDGET_FILTER); - } - - private JWidgetFilter(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JWidgetFilter(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JWidgetFilter(Table child, ForeignKey key) { - super(child, key, WIDGET_FILTER); - } - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JWidgetFilterRecord.class; - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.WIDGET_FILTER_PK); - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.WIDGET_FILTER_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.WIDGET_FILTER_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY, - Keys.WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY); - } - - public JWidget widget() { - return new JWidget(this, Keys.WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY); - } - - public JFilter filter() { - return new JFilter(this, Keys.WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY); - } - - @Override - public JWidgetFilter as(String alias) { - return new JWidgetFilter(DSL.name(alias), this); - } - - @Override - public JWidgetFilter as(Name alias) { - return new JWidgetFilter(alias, this); - } - - /** - * Rename this table - */ - @Override - public JWidgetFilter rename(String name) { - return new JWidgetFilter(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JWidgetFilter rename(Name name) { - return new JWidgetFilter(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } + private static final long serialVersionUID = 456969536; + + /** + * The reference instance of public.widget_filter + */ + public static final JWidgetFilter WIDGET_FILTER = new JWidgetFilter(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JWidgetFilterRecord.class; + } + + /** + * The column public.widget_filter.widget_id. + */ + public final TableField WIDGET_ID = createField(DSL.name("widget_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.widget_filter.filter_id. + */ + public final TableField FILTER_ID = createField(DSL.name("filter_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.widget_filter table reference + */ + public JWidgetFilter() { + this(DSL.name("widget_filter"), null); + } + + /** + * Create an aliased public.widget_filter table reference + */ + public JWidgetFilter(String alias) { + this(DSL.name(alias), WIDGET_FILTER); + } + + /** + * Create an aliased public.widget_filter table reference + */ + public JWidgetFilter(Name alias) { + this(alias, WIDGET_FILTER); + } + + private JWidgetFilter(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JWidgetFilter(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment("")); + } + + public JWidgetFilter(Table child, ForeignKey key) { + super(child, key, WIDGET_FILTER); + } + + @Override + public Schema getSchema() { + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.WIDGET_FILTER_PK); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.WIDGET_FILTER_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.WIDGET_FILTER_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY, Keys.WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY); + } + + public JWidget widget() { + return new JWidget(this, Keys.WIDGET_FILTER__WIDGET_FILTER_WIDGET_ID_FKEY); + } + + public JFilter filter() { + return new JFilter(this, Keys.WIDGET_FILTER__WIDGET_FILTER_FILTER_ID_FKEY); + } + + @Override + public JWidgetFilter as(String alias) { + return new JWidgetFilter(DSL.name(alias), this); + } + + @Override + public JWidgetFilter as(Name alias) { + return new JWidgetFilter(alias, this); + } + + /** + * Rename this table + */ + @Override + public JWidgetFilter rename(String name) { + return new JWidgetFilter(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JWidgetFilter rename(Name name) { + return new JWidgetFilter(name, null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclClassRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclClassRecord.java deleted file mode 100755 index 6a8669962..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclClassRecord.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables.records; - - -import com.epam.ta.reportportal.jooq.tables.JAclClass; -import javax.annotation.processing.Generated; -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record3; -import org.jooq.Row3; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JAclClassRecord extends UpdatableRecordImpl implements - Record3 { - - private static final long serialVersionUID = 832162643; - - /** - * Create a detached JAclClassRecord - */ - public JAclClassRecord() { - super(JAclClass.ACL_CLASS); - } - - /** - * Create a detached, initialised JAclClassRecord - */ - public JAclClassRecord(Long id, String class_, String classIdType) { - super(JAclClass.ACL_CLASS); - - set(0, id); - set(1, class_); - set(2, classIdType); - } - - /** - * Getter for public.acl_class.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.acl_class.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.acl_class.class. - */ - public String getClass_() { - return (String) get(1); - } - - /** - * Setter for public.acl_class.class. - */ - public void setClass_(String value) { - set(1, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.acl_class.class_id_type. - */ - public String getClassIdType() { - return (String) get(2); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.acl_class.class_id_type. - */ - public void setClassIdType(String value) { - set(2, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JAclClass.ACL_CLASS.ID; - } - - @Override - public Field field2() { - return JAclClass.ACL_CLASS.CLASS; - } - - @Override - public Field field3() { - return JAclClass.ACL_CLASS.CLASS_ID_TYPE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getClass_(); - } - - @Override - public String component3() { - return getClassIdType(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getClass_(); - } - - @Override - public String value3() { - return getClassIdType(); - } - - @Override - public JAclClassRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JAclClassRecord value2(String value) { - setClass_(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JAclClassRecord value3(String value) { - setClassIdType(value); - return this; - } - - @Override - public JAclClassRecord values(Long value1, String value2, String value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclEntryRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclEntryRecord.java deleted file mode 100755 index 664ce11b1..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclEntryRecord.java +++ /dev/null @@ -1,376 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables.records; - - -import com.epam.ta.reportportal.jooq.tables.JAclEntry; -import javax.annotation.processing.Generated; -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record8; -import org.jooq.Row8; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JAclEntryRecord extends UpdatableRecordImpl implements - Record8 { - - private static final long serialVersionUID = -1130110111; - - /** - * Create a detached JAclEntryRecord - */ - public JAclEntryRecord() { - super(JAclEntry.ACL_ENTRY); - } - - /** - * Create a detached, initialised JAclEntryRecord - */ - public JAclEntryRecord(Long id, Long aclObjectIdentity, Integer aceOrder, Long sid, Integer mask, - Boolean granting, Boolean auditSuccess, Boolean auditFailure) { - super(JAclEntry.ACL_ENTRY); - - set(0, id); - set(1, aclObjectIdentity); - set(2, aceOrder); - set(3, sid); - set(4, mask); - set(5, granting); - set(6, auditSuccess); - set(7, auditFailure); - } - - /** - * Getter for public.acl_entry.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.acl_entry.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.acl_entry.acl_object_identity. - */ - public Long getAclObjectIdentity() { - return (Long) get(1); - } - - /** - * Setter for public.acl_entry.acl_object_identity. - */ - public void setAclObjectIdentity(Long value) { - set(1, value); - } - - /** - * Getter for public.acl_entry.ace_order. - */ - public Integer getAceOrder() { - return (Integer) get(2); - } - - /** - * Setter for public.acl_entry.ace_order. - */ - public void setAceOrder(Integer value) { - set(2, value); - } - - /** - * Getter for public.acl_entry.sid. - */ - public Long getSid() { - return (Long) get(3); - } - - /** - * Setter for public.acl_entry.sid. - */ - public void setSid(Long value) { - set(3, value); - } - - /** - * Getter for public.acl_entry.mask. - */ - public Integer getMask() { - return (Integer) get(4); - } - - /** - * Setter for public.acl_entry.mask. - */ - public void setMask(Integer value) { - set(4, value); - } - - /** - * Getter for public.acl_entry.granting. - */ - public Boolean getGranting() { - return (Boolean) get(5); - } - - /** - * Setter for public.acl_entry.granting. - */ - public void setGranting(Boolean value) { - set(5, value); - } - - /** - * Getter for public.acl_entry.audit_success. - */ - public Boolean getAuditSuccess() { - return (Boolean) get(6); - } - - /** - * Setter for public.acl_entry.audit_success. - */ - public void setAuditSuccess(Boolean value) { - set(6, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.acl_entry.audit_failure. - */ - public Boolean getAuditFailure() { - return (Boolean) get(7); - } - - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.acl_entry.audit_failure. - */ - public void setAuditFailure(Boolean value) { - set(7, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - @Override - public Field field1() { - return JAclEntry.ACL_ENTRY.ID; - } - - @Override - public Field field2() { - return JAclEntry.ACL_ENTRY.ACL_OBJECT_IDENTITY; - } - - @Override - public Field field3() { - return JAclEntry.ACL_ENTRY.ACE_ORDER; - } - - @Override - public Field field4() { - return JAclEntry.ACL_ENTRY.SID; - } - - @Override - public Field field5() { - return JAclEntry.ACL_ENTRY.MASK; - } - - @Override - public Field field6() { - return JAclEntry.ACL_ENTRY.GRANTING; - } - - @Override - public Field field7() { - return JAclEntry.ACL_ENTRY.AUDIT_SUCCESS; - } - - @Override - public Field field8() { - return JAclEntry.ACL_ENTRY.AUDIT_FAILURE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getAclObjectIdentity(); - } - - @Override - public Integer component3() { - return getAceOrder(); - } - - @Override - public Long component4() { - return getSid(); - } - - @Override - public Integer component5() { - return getMask(); - } - - @Override - public Boolean component6() { - return getGranting(); - } - - @Override - public Boolean component7() { - return getAuditSuccess(); - } - - @Override - public Boolean component8() { - return getAuditFailure(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getAclObjectIdentity(); - } - - @Override - public Integer value3() { - return getAceOrder(); - } - - @Override - public Long value4() { - return getSid(); - } - - @Override - public Integer value5() { - return getMask(); - } - - @Override - public Boolean value6() { - return getGranting(); - } - - @Override - public Boolean value7() { - return getAuditSuccess(); - } - - @Override - public Boolean value8() { - return getAuditFailure(); - } - - @Override - public JAclEntryRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JAclEntryRecord value2(Long value) { - setAclObjectIdentity(value); - return this; - } - - @Override - public JAclEntryRecord value3(Integer value) { - setAceOrder(value); - return this; - } - - @Override - public JAclEntryRecord value4(Long value) { - setSid(value); - return this; - } - - @Override - public JAclEntryRecord value5(Integer value) { - setMask(value); - return this; - } - - @Override - public JAclEntryRecord value6(Boolean value) { - setGranting(value); - return this; - } - - @Override - public JAclEntryRecord value7(Boolean value) { - setAuditSuccess(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JAclEntryRecord value8(Boolean value) { - setAuditFailure(value); - return this; - } - - @Override - public JAclEntryRecord values(Long value1, Long value2, Integer value3, Long value4, - Integer value5, Boolean value6, Boolean value7, Boolean value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclObjectIdentityRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclObjectIdentityRecord.java deleted file mode 100755 index 39fb80faa..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclObjectIdentityRecord.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables.records; - - -import com.epam.ta.reportportal.jooq.tables.JAclObjectIdentity; -import javax.annotation.processing.Generated; -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record6; -import org.jooq.Row6; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JAclObjectIdentityRecord extends - UpdatableRecordImpl implements - Record6 { - - private static final long serialVersionUID = 1370439583; - - /** - * Create a detached JAclObjectIdentityRecord - */ - public JAclObjectIdentityRecord() { - super(JAclObjectIdentity.ACL_OBJECT_IDENTITY); - } - - /** - * Create a detached, initialised JAclObjectIdentityRecord - */ - public JAclObjectIdentityRecord(Long id, Long objectIdClass, String objectIdIdentity, - Long parentObject, Long ownerSid, Boolean entriesInheriting) { - super(JAclObjectIdentity.ACL_OBJECT_IDENTITY); - - set(0, id); - set(1, objectIdClass); - set(2, objectIdIdentity); - set(3, parentObject); - set(4, ownerSid); - set(5, entriesInheriting); - } - - /** - * Getter for public.acl_object_identity.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.acl_object_identity.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.acl_object_identity.object_id_class. - */ - public Long getObjectIdClass() { - return (Long) get(1); - } - - /** - * Setter for public.acl_object_identity.object_id_class. - */ - public void setObjectIdClass(Long value) { - set(1, value); - } - - /** - * Getter for public.acl_object_identity.object_id_identity. - */ - public String getObjectIdIdentity() { - return (String) get(2); - } - - /** - * Setter for public.acl_object_identity.object_id_identity. - */ - public void setObjectIdIdentity(String value) { - set(2, value); - } - - /** - * Getter for public.acl_object_identity.parent_object. - */ - public Long getParentObject() { - return (Long) get(3); - } - - /** - * Setter for public.acl_object_identity.parent_object. - */ - public void setParentObject(Long value) { - set(3, value); - } - - /** - * Getter for public.acl_object_identity.owner_sid. - */ - public Long getOwnerSid() { - return (Long) get(4); - } - - /** - * Setter for public.acl_object_identity.owner_sid. - */ - public void setOwnerSid(Long value) { - set(4, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.acl_object_identity.entries_inheriting. - */ - public Boolean getEntriesInheriting() { - return (Boolean) get(5); - } - - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.acl_object_identity.entries_inheriting. - */ - public void setEntriesInheriting(Boolean value) { - set(5, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return JAclObjectIdentity.ACL_OBJECT_IDENTITY.ID; - } - - @Override - public Field field2() { - return JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_CLASS; - } - - @Override - public Field field3() { - return JAclObjectIdentity.ACL_OBJECT_IDENTITY.OBJECT_ID_IDENTITY; - } - - @Override - public Field field4() { - return JAclObjectIdentity.ACL_OBJECT_IDENTITY.PARENT_OBJECT; - } - - @Override - public Field field5() { - return JAclObjectIdentity.ACL_OBJECT_IDENTITY.OWNER_SID; - } - - @Override - public Field field6() { - return JAclObjectIdentity.ACL_OBJECT_IDENTITY.ENTRIES_INHERITING; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getObjectIdClass(); - } - - @Override - public String component3() { - return getObjectIdIdentity(); - } - - @Override - public Long component4() { - return getParentObject(); - } - - @Override - public Long component5() { - return getOwnerSid(); - } - - @Override - public Boolean component6() { - return getEntriesInheriting(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getObjectIdClass(); - } - - @Override - public String value3() { - return getObjectIdIdentity(); - } - - @Override - public Long value4() { - return getParentObject(); - } - - @Override - public Long value5() { - return getOwnerSid(); - } - - @Override - public Boolean value6() { - return getEntriesInheriting(); - } - - @Override - public JAclObjectIdentityRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JAclObjectIdentityRecord value2(Long value) { - setObjectIdClass(value); - return this; - } - - @Override - public JAclObjectIdentityRecord value3(String value) { - setObjectIdIdentity(value); - return this; - } - - @Override - public JAclObjectIdentityRecord value4(Long value) { - setParentObject(value); - return this; - } - - @Override - public JAclObjectIdentityRecord value5(Long value) { - setOwnerSid(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JAclObjectIdentityRecord value6(Boolean value) { - setEntriesInheriting(value); - return this; - } - - @Override - public JAclObjectIdentityRecord values(Long value1, Long value2, String value3, Long value4, - Long value5, Boolean value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclSidRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclSidRecord.java deleted file mode 100644 index 6e5e6a9c8..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAclSidRecord.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables.records; - - -import com.epam.ta.reportportal.jooq.tables.JAclSid; -import javax.annotation.processing.Generated; -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record3; -import org.jooq.Row3; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JAclSidRecord extends UpdatableRecordImpl implements - Record3 { - - private static final long serialVersionUID = -2019104834; - - /** - * Create a detached JAclSidRecord - */ - public JAclSidRecord() { - super(JAclSid.ACL_SID); - } - - /** - * Create a detached, initialised JAclSidRecord - */ - public JAclSidRecord(Long id, Boolean principal, String sid) { - super(JAclSid.ACL_SID); - - set(0, id); - set(1, principal); - set(2, sid); - } - - /** - * Getter for public.acl_sid.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.acl_sid.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.acl_sid.principal. - */ - public Boolean getPrincipal() { - return (Boolean) get(1); - } - - /** - * Setter for public.acl_sid.principal. - */ - public void setPrincipal(Boolean value) { - set(1, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.acl_sid.sid. - */ - public String getSid() { - return (String) get(2); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.acl_sid.sid. - */ - public void setSid(String value) { - set(2, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JAclSid.ACL_SID.ID; - } - - @Override - public Field field2() { - return JAclSid.ACL_SID.PRINCIPAL; - } - - @Override - public Field field3() { - return JAclSid.ACL_SID.SID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Boolean component2() { - return getPrincipal(); - } - - @Override - public String component3() { - return getSid(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Boolean value2() { - return getPrincipal(); - } - - @Override - public String value3() { - return getSid(); - } - - @Override - public JAclSidRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JAclSidRecord value2(Boolean value) { - setPrincipal(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JAclSidRecord value3(String value) { - setSid(value); - return this; - } - - @Override - public JAclSidRecord values(Long value1, Boolean value2, String value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JActivityRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JActivityRecord.java index f5cb05141..6f34fd512 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JActivityRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JActivityRecord.java @@ -5,8 +5,11 @@ import com.epam.ta.reportportal.jooq.tables.JActivity; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.JSONB; import org.jooq.Record1; @@ -25,391 +28,388 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JActivityRecord extends UpdatableRecordImpl implements - Record9 { - - private static final long serialVersionUID = 1741928455; - - /** - * Create a detached JActivityRecord - */ - public JActivityRecord() { - super(JActivity.ACTIVITY); - } - - /** - * Create a detached, initialised JActivityRecord - */ - public JActivityRecord(Long id, Long userId, String username, Long projectId, String entity, - String action, JSONB details, Timestamp creationDate, Long objectId) { - super(JActivity.ACTIVITY); - - set(0, id); - set(1, userId); - set(2, username); - set(3, projectId); - set(4, entity); - set(5, action); - set(6, details); - set(7, creationDate); - set(8, objectId); - } - - /** - * Getter for public.activity.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.activity.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.activity.user_id. - */ - public Long getUserId() { - return (Long) get(1); - } - - /** - * Setter for public.activity.user_id. - */ - public void setUserId(Long value) { - set(1, value); - } - - /** - * Getter for public.activity.username. - */ - public String getUsername() { - return (String) get(2); - } - - /** - * Setter for public.activity.username. - */ - public void setUsername(String value) { - set(2, value); - } - - /** - * Getter for public.activity.project_id. - */ - public Long getProjectId() { - return (Long) get(3); - } - - /** - * Setter for public.activity.project_id. - */ - public void setProjectId(Long value) { - set(3, value); - } - - /** - * Getter for public.activity.entity. - */ - public String getEntity() { - return (String) get(4); - } - - /** - * Setter for public.activity.entity. - */ - public void setEntity(String value) { - set(4, value); - } - - /** - * Getter for public.activity.action. - */ - public String getAction() { - return (String) get(5); - } - - /** - * Setter for public.activity.action. - */ - public void setAction(String value) { - set(5, value); - } - - /** - * Getter for public.activity.details. - */ - public JSONB getDetails() { - return (JSONB) get(6); - } - - /** - * Setter for public.activity.details. - */ - public void setDetails(JSONB value) { - set(6, value); - } - - /** - * Getter for public.activity.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(7); - } - - /** - * Setter for public.activity.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(7, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.activity.object_id. - */ - public Long getObjectId() { - return (Long) get(8); - } - - // ------------------------------------------------------------------------- - // Record9 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.activity.object_id. - */ - public void setObjectId(Long value) { - set(8, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } - - @Override - public Row9 valuesRow() { - return (Row9) super.valuesRow(); - } - - @Override - public Field field1() { - return JActivity.ACTIVITY.ID; - } - - @Override - public Field field2() { - return JActivity.ACTIVITY.USER_ID; - } - - @Override - public Field field3() { - return JActivity.ACTIVITY.USERNAME; - } - - @Override - public Field field4() { - return JActivity.ACTIVITY.PROJECT_ID; - } - - @Override - public Field field5() { - return JActivity.ACTIVITY.ENTITY; - } - - @Override - public Field field6() { - return JActivity.ACTIVITY.ACTION; - } - - @Override - public Field field7() { - return JActivity.ACTIVITY.DETAILS; - } - - @Override - public Field field8() { - return JActivity.ACTIVITY.CREATION_DATE; - } - - @Override - public Field field9() { - return JActivity.ACTIVITY.OBJECT_ID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getUserId(); - } - - @Override - public String component3() { - return getUsername(); - } - - @Override - public Long component4() { - return getProjectId(); - } - - @Override - public String component5() { - return getEntity(); - } - - @Override - public String component6() { - return getAction(); - } - - @Override - public JSONB component7() { - return getDetails(); - } - - @Override - public Timestamp component8() { - return getCreationDate(); - } - - @Override - public Long component9() { - return getObjectId(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getUserId(); - } - - @Override - public String value3() { - return getUsername(); - } - - @Override - public Long value4() { - return getProjectId(); - } - - @Override - public String value5() { - return getEntity(); - } - - @Override - public String value6() { - return getAction(); - } - - @Override - public JSONB value7() { - return getDetails(); - } - - @Override - public Timestamp value8() { - return getCreationDate(); - } - - @Override - public Long value9() { - return getObjectId(); - } - - @Override - public JActivityRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JActivityRecord value2(Long value) { - setUserId(value); - return this; - } - - @Override - public JActivityRecord value3(String value) { - setUsername(value); - return this; - } - - @Override - public JActivityRecord value4(Long value) { - setProjectId(value); - return this; - } - - @Override - public JActivityRecord value5(String value) { - setEntity(value); - return this; - } - - @Override - public JActivityRecord value6(String value) { - setAction(value); - return this; - } - - @Override - public JActivityRecord value7(JSONB value) { - setDetails(value); - return this; - } - - @Override - public JActivityRecord value8(Timestamp value) { - setCreationDate(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JActivityRecord value9(Long value) { - setObjectId(value); - return this; - } - - @Override - public JActivityRecord values(Long value1, Long value2, String value3, Long value4, String value5, - String value6, JSONB value7, Timestamp value8, Long value9) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JActivityRecord extends UpdatableRecordImpl implements Record9 { + + private static final long serialVersionUID = 1741928455; + + /** + * Setter for public.activity.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.activity.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.activity.user_id. + */ + public void setUserId(Long value) { + set(1, value); + } + + /** + * Getter for public.activity.user_id. + */ + public Long getUserId() { + return (Long) get(1); + } + + /** + * Setter for public.activity.username. + */ + public void setUsername(String value) { + set(2, value); + } + + /** + * Getter for public.activity.username. + */ + public String getUsername() { + return (String) get(2); + } + + /** + * Setter for public.activity.project_id. + */ + public void setProjectId(Long value) { + set(3, value); + } + + /** + * Getter for public.activity.project_id. + */ + public Long getProjectId() { + return (Long) get(3); + } + + /** + * Setter for public.activity.entity. + */ + public void setEntity(String value) { + set(4, value); + } + + /** + * Getter for public.activity.entity. + */ + public String getEntity() { + return (String) get(4); + } + + /** + * Setter for public.activity.action. + */ + public void setAction(String value) { + set(5, value); + } + + /** + * Getter for public.activity.action. + */ + public String getAction() { + return (String) get(5); + } + + /** + * Setter for public.activity.details. + */ + public void setDetails(JSONB value) { + set(6, value); + } + + /** + * Getter for public.activity.details. + */ + public JSONB getDetails() { + return (JSONB) get(6); + } + + /** + * Setter for public.activity.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(7, value); + } + + /** + * Getter for public.activity.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(7); + } + + /** + * Setter for public.activity.object_id. + */ + public void setObjectId(Long value) { + set(8, value); + } + + /** + * Getter for public.activity.object_id. + */ + public Long getObjectId() { + return (Long) get(8); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record9 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } + + @Override + public Row9 valuesRow() { + return (Row9) super.valuesRow(); + } + + @Override + public Field field1() { + return JActivity.ACTIVITY.ID; + } + + @Override + public Field field2() { + return JActivity.ACTIVITY.USER_ID; + } + + @Override + public Field field3() { + return JActivity.ACTIVITY.USERNAME; + } + + @Override + public Field field4() { + return JActivity.ACTIVITY.PROJECT_ID; + } + + @Override + public Field field5() { + return JActivity.ACTIVITY.ENTITY; + } + + @Override + public Field field6() { + return JActivity.ACTIVITY.ACTION; + } + + @Override + public Field field7() { + return JActivity.ACTIVITY.DETAILS; + } + + @Override + public Field field8() { + return JActivity.ACTIVITY.CREATION_DATE; + } + + @Override + public Field field9() { + return JActivity.ACTIVITY.OBJECT_ID; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getUserId(); + } + + @Override + public String component3() { + return getUsername(); + } + + @Override + public Long component4() { + return getProjectId(); + } + + @Override + public String component5() { + return getEntity(); + } + + @Override + public String component6() { + return getAction(); + } + + @Override + public JSONB component7() { + return getDetails(); + } + + @Override + public Timestamp component8() { + return getCreationDate(); + } + + @Override + public Long component9() { + return getObjectId(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getUserId(); + } + + @Override + public String value3() { + return getUsername(); + } + + @Override + public Long value4() { + return getProjectId(); + } + + @Override + public String value5() { + return getEntity(); + } + + @Override + public String value6() { + return getAction(); + } + + @Override + public JSONB value7() { + return getDetails(); + } + + @Override + public Timestamp value8() { + return getCreationDate(); + } + + @Override + public Long value9() { + return getObjectId(); + } + + @Override + public JActivityRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JActivityRecord value2(Long value) { + setUserId(value); + return this; + } + + @Override + public JActivityRecord value3(String value) { + setUsername(value); + return this; + } + + @Override + public JActivityRecord value4(Long value) { + setProjectId(value); + return this; + } + + @Override + public JActivityRecord value5(String value) { + setEntity(value); + return this; + } + + @Override + public JActivityRecord value6(String value) { + setAction(value); + return this; + } + + @Override + public JActivityRecord value7(JSONB value) { + setDetails(value); + return this; + } + + @Override + public JActivityRecord value8(Timestamp value) { + setCreationDate(value); + return this; + } + + @Override + public JActivityRecord value9(Long value) { + setObjectId(value); + return this; + } + + @Override + public JActivityRecord values(Long value1, Long value2, String value3, Long value4, String value5, String value6, JSONB value7, Timestamp value8, Long value9) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JActivityRecord + */ + public JActivityRecord() { + super(JActivity.ACTIVITY); + } + + /** + * Create a detached, initialised JActivityRecord + */ + public JActivityRecord(Long id, Long userId, String username, Long projectId, String entity, String action, JSONB details, Timestamp creationDate, Long objectId) { + super(JActivity.ACTIVITY); + + set(0, id); + set(1, userId); + set(2, username); + set(3, projectId); + set(4, entity); + set(5, action); + set(6, details); + set(7, creationDate); + set(8, objectId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JApiKeysRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JApiKeysRecord.java new file mode 100644 index 000000000..78a6fb40e --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JApiKeysRecord.java @@ -0,0 +1,266 @@ +/* + * This file is generated by jOOQ. + */ +package com.epam.ta.reportportal.jooq.tables.records; + + +import com.epam.ta.reportportal.jooq.tables.JApiKeys; + +import java.sql.Timestamp; + +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record5; +import org.jooq.Row5; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.4" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JApiKeysRecord extends UpdatableRecordImpl implements Record5 { + + private static final long serialVersionUID = 186305862; + + /** + * Setter for public.api_keys.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.api_keys.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.api_keys.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.api_keys.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.api_keys.hash. + */ + public void setHash(String value) { + set(2, value); + } + + /** + * Getter for public.api_keys.hash. + */ + public String getHash() { + return (String) get(2); + } + + /** + * Setter for public.api_keys.created_at. + */ + public void setCreatedAt(Timestamp value) { + set(3, value); + } + + /** + * Getter for public.api_keys.created_at. + */ + public Timestamp getCreatedAt() { + return (Timestamp) get(3); + } + + /** + * Setter for public.api_keys.user_id. + */ + public void setUserId(Long value) { + set(4, value); + } + + /** + * Getter for public.api_keys.user_id. + */ + public Long getUserId() { + return (Long) get(4); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return JApiKeys.API_KEYS.ID; + } + + @Override + public Field field2() { + return JApiKeys.API_KEYS.NAME; + } + + @Override + public Field field3() { + return JApiKeys.API_KEYS.HASH; + } + + @Override + public Field field4() { + return JApiKeys.API_KEYS.CREATED_AT; + } + + @Override + public Field field5() { + return JApiKeys.API_KEYS.USER_ID; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public String component3() { + return getHash(); + } + + @Override + public Timestamp component4() { + return getCreatedAt(); + } + + @Override + public Long component5() { + return getUserId(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public String value3() { + return getHash(); + } + + @Override + public Timestamp value4() { + return getCreatedAt(); + } + + @Override + public Long value5() { + return getUserId(); + } + + @Override + public JApiKeysRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JApiKeysRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JApiKeysRecord value3(String value) { + setHash(value); + return this; + } + + @Override + public JApiKeysRecord value4(Timestamp value) { + setCreatedAt(value); + return this; + } + + @Override + public JApiKeysRecord value5(Long value) { + setUserId(value); + return this; + } + + @Override + public JApiKeysRecord values(Long value1, String value2, String value3, Timestamp value4, Long value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JApiKeysRecord + */ + public JApiKeysRecord() { + super(JApiKeys.API_KEYS); + } + + /** + * Create a detached, initialised JApiKeysRecord + */ + public JApiKeysRecord(Long id, String name, String hash, Timestamp createdAt, Long userId) { + super(JApiKeys.API_KEYS); + + set(0, id); + set(1, name); + set(2, hash); + set(3, createdAt); + set(4, userId); + } +} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentDeletionRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentDeletionRecord.java index fca373375..dc92a59ab 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentDeletionRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentDeletionRecord.java @@ -5,8 +5,11 @@ import com.epam.ta.reportportal.jooq.tables.JAttachmentDeletion; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record5; @@ -24,244 +27,240 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JAttachmentDeletionRecord extends - UpdatableRecordImpl implements - Record5 { - - private static final long serialVersionUID = 1506388720; - - /** - * Create a detached JAttachmentDeletionRecord - */ - public JAttachmentDeletionRecord() { - super(JAttachmentDeletion.ATTACHMENT_DELETION); - } - - /** - * Create a detached, initialised JAttachmentDeletionRecord - */ - public JAttachmentDeletionRecord(Long id, String fileId, String thumbnailId, - Timestamp creationAttachmentDate, Timestamp deletionDate) { - super(JAttachmentDeletion.ATTACHMENT_DELETION); - - set(0, id); - set(1, fileId); - set(2, thumbnailId); - set(3, creationAttachmentDate); - set(4, deletionDate); - } - - /** - * Getter for public.attachment_deletion.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.attachment_deletion.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.attachment_deletion.file_id. - */ - public String getFileId() { - return (String) get(1); - } - - /** - * Setter for public.attachment_deletion.file_id. - */ - public void setFileId(String value) { - set(1, value); - } - - /** - * Getter for public.attachment_deletion.thumbnail_id. - */ - public String getThumbnailId() { - return (String) get(2); - } - - /** - * Setter for public.attachment_deletion.thumbnail_id. - */ - public void setThumbnailId(String value) { - set(2, value); - } - - /** - * Getter for public.attachment_deletion.creation_attachment_date. - */ - public Timestamp getCreationAttachmentDate() { - return (Timestamp) get(3); - } - - /** - * Setter for public.attachment_deletion.creation_attachment_date. - */ - public void setCreationAttachmentDate(Timestamp value) { - set(3, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.attachment_deletion.deletion_date. - */ - public Timestamp getDeletionDate() { - return (Timestamp) get(4); - } - - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.attachment_deletion.deletion_date. - */ - public void setDeletionDate(Timestamp value) { - set(4, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } - - @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); - } - - @Override - public Field field1() { - return JAttachmentDeletion.ATTACHMENT_DELETION.ID; - } - - @Override - public Field field2() { - return JAttachmentDeletion.ATTACHMENT_DELETION.FILE_ID; - } - - @Override - public Field field3() { - return JAttachmentDeletion.ATTACHMENT_DELETION.THUMBNAIL_ID; - } - - @Override - public Field field4() { - return JAttachmentDeletion.ATTACHMENT_DELETION.CREATION_ATTACHMENT_DATE; - } - - @Override - public Field field5() { - return JAttachmentDeletion.ATTACHMENT_DELETION.DELETION_DATE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getFileId(); - } - - @Override - public String component3() { - return getThumbnailId(); - } - - @Override - public Timestamp component4() { - return getCreationAttachmentDate(); - } - - @Override - public Timestamp component5() { - return getDeletionDate(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getFileId(); - } - - @Override - public String value3() { - return getThumbnailId(); - } - - @Override - public Timestamp value4() { - return getCreationAttachmentDate(); - } - - @Override - public Timestamp value5() { - return getDeletionDate(); - } - - @Override - public JAttachmentDeletionRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JAttachmentDeletionRecord value2(String value) { - setFileId(value); - return this; - } - - @Override - public JAttachmentDeletionRecord value3(String value) { - setThumbnailId(value); - return this; - } - - @Override - public JAttachmentDeletionRecord value4(Timestamp value) { - setCreationAttachmentDate(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JAttachmentDeletionRecord value5(Timestamp value) { - setDeletionDate(value); - return this; - } - - @Override - public JAttachmentDeletionRecord values(Long value1, String value2, String value3, - Timestamp value4, Timestamp value5) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JAttachmentDeletionRecord extends UpdatableRecordImpl implements Record5 { + + private static final long serialVersionUID = 1506388720; + + /** + * Setter for public.attachment_deletion.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.attachment_deletion.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.attachment_deletion.file_id. + */ + public void setFileId(String value) { + set(1, value); + } + + /** + * Getter for public.attachment_deletion.file_id. + */ + public String getFileId() { + return (String) get(1); + } + + /** + * Setter for public.attachment_deletion.thumbnail_id. + */ + public void setThumbnailId(String value) { + set(2, value); + } + + /** + * Getter for public.attachment_deletion.thumbnail_id. + */ + public String getThumbnailId() { + return (String) get(2); + } + + /** + * Setter for public.attachment_deletion.creation_attachment_date. + */ + public void setCreationAttachmentDate(Timestamp value) { + set(3, value); + } + + /** + * Getter for public.attachment_deletion.creation_attachment_date. + */ + public Timestamp getCreationAttachmentDate() { + return (Timestamp) get(3); + } + + /** + * Setter for public.attachment_deletion.deletion_date. + */ + public void setDeletionDate(Timestamp value) { + set(4, value); + } + + /** + * Getter for public.attachment_deletion.deletion_date. + */ + public Timestamp getDeletionDate() { + return (Timestamp) get(4); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return JAttachmentDeletion.ATTACHMENT_DELETION.ID; + } + + @Override + public Field field2() { + return JAttachmentDeletion.ATTACHMENT_DELETION.FILE_ID; + } + + @Override + public Field field3() { + return JAttachmentDeletion.ATTACHMENT_DELETION.THUMBNAIL_ID; + } + + @Override + public Field field4() { + return JAttachmentDeletion.ATTACHMENT_DELETION.CREATION_ATTACHMENT_DATE; + } + + @Override + public Field field5() { + return JAttachmentDeletion.ATTACHMENT_DELETION.DELETION_DATE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getFileId(); + } + + @Override + public String component3() { + return getThumbnailId(); + } + + @Override + public Timestamp component4() { + return getCreationAttachmentDate(); + } + + @Override + public Timestamp component5() { + return getDeletionDate(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getFileId(); + } + + @Override + public String value3() { + return getThumbnailId(); + } + + @Override + public Timestamp value4() { + return getCreationAttachmentDate(); + } + + @Override + public Timestamp value5() { + return getDeletionDate(); + } + + @Override + public JAttachmentDeletionRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JAttachmentDeletionRecord value2(String value) { + setFileId(value); + return this; + } + + @Override + public JAttachmentDeletionRecord value3(String value) { + setThumbnailId(value); + return this; + } + + @Override + public JAttachmentDeletionRecord value4(Timestamp value) { + setCreationAttachmentDate(value); + return this; + } + + @Override + public JAttachmentDeletionRecord value5(Timestamp value) { + setDeletionDate(value); + return this; + } + + @Override + public JAttachmentDeletionRecord values(Long value1, String value2, String value3, Timestamp value4, Timestamp value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JAttachmentDeletionRecord + */ + public JAttachmentDeletionRecord() { + super(JAttachmentDeletion.ATTACHMENT_DELETION); + } + + /** + * Create a detached, initialised JAttachmentDeletionRecord + */ + public JAttachmentDeletionRecord(Long id, String fileId, String thumbnailId, Timestamp creationAttachmentDate, Timestamp deletionDate) { + super(JAttachmentDeletion.ATTACHMENT_DELETION); + + set(0, id); + set(1, fileId); + set(2, thumbnailId); + set(3, creationAttachmentDate); + set(4, deletionDate); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentRecord.java old mode 100755 new mode 100644 index 199aa2c54..1b6ad3d29 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentRecord.java @@ -5,8 +5,11 @@ import com.epam.ta.reportportal.jooq.tables.JAttachment; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record9; @@ -24,391 +27,388 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JAttachmentRecord extends UpdatableRecordImpl implements - Record9 { - - private static final long serialVersionUID = 171693268; - - /** - * Create a detached JAttachmentRecord - */ - public JAttachmentRecord() { - super(JAttachment.ATTACHMENT); - } - - /** - * Create a detached, initialised JAttachmentRecord - */ - public JAttachmentRecord(Long id, String fileId, String thumbnailId, String contentType, - Long projectId, Long launchId, Long itemId, Long fileSize, Timestamp creationDate) { - super(JAttachment.ATTACHMENT); - - set(0, id); - set(1, fileId); - set(2, thumbnailId); - set(3, contentType); - set(4, projectId); - set(5, launchId); - set(6, itemId); - set(7, fileSize); - set(8, creationDate); - } - - /** - * Getter for public.attachment.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.attachment.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.attachment.file_id. - */ - public String getFileId() { - return (String) get(1); - } - - /** - * Setter for public.attachment.file_id. - */ - public void setFileId(String value) { - set(1, value); - } - - /** - * Getter for public.attachment.thumbnail_id. - */ - public String getThumbnailId() { - return (String) get(2); - } - - /** - * Setter for public.attachment.thumbnail_id. - */ - public void setThumbnailId(String value) { - set(2, value); - } - - /** - * Getter for public.attachment.content_type. - */ - public String getContentType() { - return (String) get(3); - } - - /** - * Setter for public.attachment.content_type. - */ - public void setContentType(String value) { - set(3, value); - } - - /** - * Getter for public.attachment.project_id. - */ - public Long getProjectId() { - return (Long) get(4); - } - - /** - * Setter for public.attachment.project_id. - */ - public void setProjectId(Long value) { - set(4, value); - } - - /** - * Getter for public.attachment.launch_id. - */ - public Long getLaunchId() { - return (Long) get(5); - } - - /** - * Setter for public.attachment.launch_id. - */ - public void setLaunchId(Long value) { - set(5, value); - } - - /** - * Getter for public.attachment.item_id. - */ - public Long getItemId() { - return (Long) get(6); - } - - /** - * Setter for public.attachment.item_id. - */ - public void setItemId(Long value) { - set(6, value); - } - - /** - * Getter for public.attachment.file_size. - */ - public Long getFileSize() { - return (Long) get(7); - } - - /** - * Setter for public.attachment.file_size. - */ - public void setFileSize(Long value) { - set(7, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.attachment.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(8); - } - - // ------------------------------------------------------------------------- - // Record9 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.attachment.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(8, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } - - @Override - public Row9 valuesRow() { - return (Row9) super.valuesRow(); - } - - @Override - public Field field1() { - return JAttachment.ATTACHMENT.ID; - } - - @Override - public Field field2() { - return JAttachment.ATTACHMENT.FILE_ID; - } - - @Override - public Field field3() { - return JAttachment.ATTACHMENT.THUMBNAIL_ID; - } - - @Override - public Field field4() { - return JAttachment.ATTACHMENT.CONTENT_TYPE; - } - - @Override - public Field field5() { - return JAttachment.ATTACHMENT.PROJECT_ID; - } - - @Override - public Field field6() { - return JAttachment.ATTACHMENT.LAUNCH_ID; - } - - @Override - public Field field7() { - return JAttachment.ATTACHMENT.ITEM_ID; - } - - @Override - public Field field8() { - return JAttachment.ATTACHMENT.FILE_SIZE; - } - - @Override - public Field field9() { - return JAttachment.ATTACHMENT.CREATION_DATE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getFileId(); - } - - @Override - public String component3() { - return getThumbnailId(); - } - - @Override - public String component4() { - return getContentType(); - } - - @Override - public Long component5() { - return getProjectId(); - } - - @Override - public Long component6() { - return getLaunchId(); - } - - @Override - public Long component7() { - return getItemId(); - } - - @Override - public Long component8() { - return getFileSize(); - } - - @Override - public Timestamp component9() { - return getCreationDate(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getFileId(); - } - - @Override - public String value3() { - return getThumbnailId(); - } - - @Override - public String value4() { - return getContentType(); - } - - @Override - public Long value5() { - return getProjectId(); - } - - @Override - public Long value6() { - return getLaunchId(); - } - - @Override - public Long value7() { - return getItemId(); - } - - @Override - public Long value8() { - return getFileSize(); - } - - @Override - public Timestamp value9() { - return getCreationDate(); - } - - @Override - public JAttachmentRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JAttachmentRecord value2(String value) { - setFileId(value); - return this; - } - - @Override - public JAttachmentRecord value3(String value) { - setThumbnailId(value); - return this; - } - - @Override - public JAttachmentRecord value4(String value) { - setContentType(value); - return this; - } - - @Override - public JAttachmentRecord value5(Long value) { - setProjectId(value); - return this; - } - - @Override - public JAttachmentRecord value6(Long value) { - setLaunchId(value); - return this; - } - - @Override - public JAttachmentRecord value7(Long value) { - setItemId(value); - return this; - } - - @Override - public JAttachmentRecord value8(Long value) { - setFileSize(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JAttachmentRecord value9(Timestamp value) { - setCreationDate(value); - return this; - } - - @Override - public JAttachmentRecord values(Long value1, String value2, String value3, String value4, - Long value5, Long value6, Long value7, Long value8, Timestamp value9) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JAttachmentRecord extends UpdatableRecordImpl implements Record9 { + + private static final long serialVersionUID = 171693268; + + /** + * Setter for public.attachment.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.attachment.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.attachment.file_id. + */ + public void setFileId(String value) { + set(1, value); + } + + /** + * Getter for public.attachment.file_id. + */ + public String getFileId() { + return (String) get(1); + } + + /** + * Setter for public.attachment.thumbnail_id. + */ + public void setThumbnailId(String value) { + set(2, value); + } + + /** + * Getter for public.attachment.thumbnail_id. + */ + public String getThumbnailId() { + return (String) get(2); + } + + /** + * Setter for public.attachment.content_type. + */ + public void setContentType(String value) { + set(3, value); + } + + /** + * Getter for public.attachment.content_type. + */ + public String getContentType() { + return (String) get(3); + } + + /** + * Setter for public.attachment.project_id. + */ + public void setProjectId(Long value) { + set(4, value); + } + + /** + * Getter for public.attachment.project_id. + */ + public Long getProjectId() { + return (Long) get(4); + } + + /** + * Setter for public.attachment.launch_id. + */ + public void setLaunchId(Long value) { + set(5, value); + } + + /** + * Getter for public.attachment.launch_id. + */ + public Long getLaunchId() { + return (Long) get(5); + } + + /** + * Setter for public.attachment.item_id. + */ + public void setItemId(Long value) { + set(6, value); + } + + /** + * Getter for public.attachment.item_id. + */ + public Long getItemId() { + return (Long) get(6); + } + + /** + * Setter for public.attachment.file_size. + */ + public void setFileSize(Long value) { + set(7, value); + } + + /** + * Getter for public.attachment.file_size. + */ + public Long getFileSize() { + return (Long) get(7); + } + + /** + * Setter for public.attachment.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(8, value); + } + + /** + * Getter for public.attachment.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(8); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record9 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } + + @Override + public Row9 valuesRow() { + return (Row9) super.valuesRow(); + } + + @Override + public Field field1() { + return JAttachment.ATTACHMENT.ID; + } + + @Override + public Field field2() { + return JAttachment.ATTACHMENT.FILE_ID; + } + + @Override + public Field field3() { + return JAttachment.ATTACHMENT.THUMBNAIL_ID; + } + + @Override + public Field field4() { + return JAttachment.ATTACHMENT.CONTENT_TYPE; + } + + @Override + public Field field5() { + return JAttachment.ATTACHMENT.PROJECT_ID; + } + + @Override + public Field field6() { + return JAttachment.ATTACHMENT.LAUNCH_ID; + } + + @Override + public Field field7() { + return JAttachment.ATTACHMENT.ITEM_ID; + } + + @Override + public Field field8() { + return JAttachment.ATTACHMENT.FILE_SIZE; + } + + @Override + public Field field9() { + return JAttachment.ATTACHMENT.CREATION_DATE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getFileId(); + } + + @Override + public String component3() { + return getThumbnailId(); + } + + @Override + public String component4() { + return getContentType(); + } + + @Override + public Long component5() { + return getProjectId(); + } + + @Override + public Long component6() { + return getLaunchId(); + } + + @Override + public Long component7() { + return getItemId(); + } + + @Override + public Long component8() { + return getFileSize(); + } + + @Override + public Timestamp component9() { + return getCreationDate(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getFileId(); + } + + @Override + public String value3() { + return getThumbnailId(); + } + + @Override + public String value4() { + return getContentType(); + } + + @Override + public Long value5() { + return getProjectId(); + } + + @Override + public Long value6() { + return getLaunchId(); + } + + @Override + public Long value7() { + return getItemId(); + } + + @Override + public Long value8() { + return getFileSize(); + } + + @Override + public Timestamp value9() { + return getCreationDate(); + } + + @Override + public JAttachmentRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JAttachmentRecord value2(String value) { + setFileId(value); + return this; + } + + @Override + public JAttachmentRecord value3(String value) { + setThumbnailId(value); + return this; + } + + @Override + public JAttachmentRecord value4(String value) { + setContentType(value); + return this; + } + + @Override + public JAttachmentRecord value5(Long value) { + setProjectId(value); + return this; + } + + @Override + public JAttachmentRecord value6(Long value) { + setLaunchId(value); + return this; + } + + @Override + public JAttachmentRecord value7(Long value) { + setItemId(value); + return this; + } + + @Override + public JAttachmentRecord value8(Long value) { + setFileSize(value); + return this; + } + + @Override + public JAttachmentRecord value9(Timestamp value) { + setCreationDate(value); + return this; + } + + @Override + public JAttachmentRecord values(Long value1, String value2, String value3, String value4, Long value5, Long value6, Long value7, Long value8, Timestamp value9) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JAttachmentRecord + */ + public JAttachmentRecord() { + super(JAttachment.ATTACHMENT); + } + + /** + * Create a detached, initialised JAttachmentRecord + */ + public JAttachmentRecord(Long id, String fileId, String thumbnailId, String contentType, Long projectId, Long launchId, Long itemId, Long fileSize, Timestamp creationDate) { + super(JAttachment.ATTACHMENT); + + set(0, id); + set(1, fileId); + set(2, thumbnailId); + set(3, contentType); + set(4, projectId); + set(5, launchId); + set(6, itemId); + set(7, fileSize); + set(8, creationDate); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttributeRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttributeRecord.java index ff92f4640..e89015d8b 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttributeRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttributeRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JAttribute; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record2; @@ -23,130 +25,129 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JAttributeRecord extends UpdatableRecordImpl implements - Record2 { - - private static final long serialVersionUID = -421000452; - - /** - * Create a detached JAttributeRecord - */ - public JAttributeRecord() { - super(JAttribute.ATTRIBUTE); - } - - /** - * Create a detached, initialised JAttributeRecord - */ - public JAttributeRecord(Long id, String name) { - super(JAttribute.ATTRIBUTE); - - set(0, id); - set(1, name); - } - - /** - * Getter for public.attribute.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.attribute.id. - */ - public void setId(Long value) { - set(0, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.attribute.name. - */ - public String getName() { - return (String) get(1); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.attribute.name. - */ - public void setName(String value) { - set(1, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JAttribute.ATTRIBUTE.ID; - } - - @Override - public Field field2() { - return JAttribute.ATTRIBUTE.NAME; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public JAttributeRecord value1(Long value) { - setId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JAttributeRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JAttributeRecord values(Long value1, String value2) { - value1(value1); - value2(value2); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JAttributeRecord extends UpdatableRecordImpl implements Record2 { + + private static final long serialVersionUID = -421000452; + + /** + * Setter for public.attribute.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.attribute.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.attribute.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.attribute.name. + */ + public String getName() { + return (String) get(1); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JAttribute.ATTRIBUTE.ID; + } + + @Override + public Field field2() { + return JAttribute.ATTRIBUTE.NAME; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public JAttributeRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JAttributeRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JAttributeRecord values(Long value1, String value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JAttributeRecord + */ + public JAttributeRecord() { + super(JAttribute.ATTRIBUTE); + } + + /** + * Create a detached, initialised JAttributeRecord + */ + public JAttributeRecord(Long id, String name) { + super(JAttribute.ATTRIBUTE); + + set(0, id); + set(1, name); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersRecord.java index 592630198..e165b6b84 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JClusters; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record5; @@ -23,241 +25,240 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JClustersRecord extends UpdatableRecordImpl implements - Record5 { - - private static final long serialVersionUID = -1880325859; - - /** - * Create a detached JClustersRecord - */ - public JClustersRecord() { - super(JClusters.CLUSTERS); - } - - /** - * Create a detached, initialised JClustersRecord - */ - public JClustersRecord(Long id, Long indexId, Long projectId, Long launchId, String message) { - super(JClusters.CLUSTERS); - - set(0, id); - set(1, indexId); - set(2, projectId); - set(3, launchId); - set(4, message); - } - - /** - * Getter for public.clusters.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.clusters.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.clusters.index_id. - */ - public Long getIndexId() { - return (Long) get(1); - } - - /** - * Setter for public.clusters.index_id. - */ - public void setIndexId(Long value) { - set(1, value); - } - - /** - * Getter for public.clusters.project_id. - */ - public Long getProjectId() { - return (Long) get(2); - } - - /** - * Setter for public.clusters.project_id. - */ - public void setProjectId(Long value) { - set(2, value); - } - - /** - * Getter for public.clusters.launch_id. - */ - public Long getLaunchId() { - return (Long) get(3); - } - - /** - * Setter for public.clusters.launch_id. - */ - public void setLaunchId(Long value) { - set(3, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.clusters.message. - */ - public String getMessage() { - return (String) get(4); - } - - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.clusters.message. - */ - public void setMessage(String value) { - set(4, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } - - @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); - } - - @Override - public Field field1() { - return JClusters.CLUSTERS.ID; - } - - @Override - public Field field2() { - return JClusters.CLUSTERS.INDEX_ID; - } - - @Override - public Field field3() { - return JClusters.CLUSTERS.PROJECT_ID; - } - - @Override - public Field field4() { - return JClusters.CLUSTERS.LAUNCH_ID; - } - - @Override - public Field field5() { - return JClusters.CLUSTERS.MESSAGE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getIndexId(); - } - - @Override - public Long component3() { - return getProjectId(); - } - - @Override - public Long component4() { - return getLaunchId(); - } - - @Override - public String component5() { - return getMessage(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getIndexId(); - } - - @Override - public Long value3() { - return getProjectId(); - } - - @Override - public Long value4() { - return getLaunchId(); - } - - @Override - public String value5() { - return getMessage(); - } - - @Override - public JClustersRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JClustersRecord value2(Long value) { - setIndexId(value); - return this; - } - - @Override - public JClustersRecord value3(Long value) { - setProjectId(value); - return this; - } - - @Override - public JClustersRecord value4(Long value) { - setLaunchId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JClustersRecord value5(String value) { - setMessage(value); - return this; - } - - @Override - public JClustersRecord values(Long value1, Long value2, Long value3, Long value4, String value5) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JClustersRecord extends UpdatableRecordImpl implements Record5 { + + private static final long serialVersionUID = -1880325859; + + /** + * Setter for public.clusters.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.clusters.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.clusters.index_id. + */ + public void setIndexId(Long value) { + set(1, value); + } + + /** + * Getter for public.clusters.index_id. + */ + public Long getIndexId() { + return (Long) get(1); + } + + /** + * Setter for public.clusters.project_id. + */ + public void setProjectId(Long value) { + set(2, value); + } + + /** + * Getter for public.clusters.project_id. + */ + public Long getProjectId() { + return (Long) get(2); + } + + /** + * Setter for public.clusters.launch_id. + */ + public void setLaunchId(Long value) { + set(3, value); + } + + /** + * Getter for public.clusters.launch_id. + */ + public Long getLaunchId() { + return (Long) get(3); + } + + /** + * Setter for public.clusters.message. + */ + public void setMessage(String value) { + set(4, value); + } + + /** + * Getter for public.clusters.message. + */ + public String getMessage() { + return (String) get(4); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return JClusters.CLUSTERS.ID; + } + + @Override + public Field field2() { + return JClusters.CLUSTERS.INDEX_ID; + } + + @Override + public Field field3() { + return JClusters.CLUSTERS.PROJECT_ID; + } + + @Override + public Field field4() { + return JClusters.CLUSTERS.LAUNCH_ID; + } + + @Override + public Field field5() { + return JClusters.CLUSTERS.MESSAGE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getIndexId(); + } + + @Override + public Long component3() { + return getProjectId(); + } + + @Override + public Long component4() { + return getLaunchId(); + } + + @Override + public String component5() { + return getMessage(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getIndexId(); + } + + @Override + public Long value3() { + return getProjectId(); + } + + @Override + public Long value4() { + return getLaunchId(); + } + + @Override + public String value5() { + return getMessage(); + } + + @Override + public JClustersRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JClustersRecord value2(Long value) { + setIndexId(value); + return this; + } + + @Override + public JClustersRecord value3(Long value) { + setProjectId(value); + return this; + } + + @Override + public JClustersRecord value4(Long value) { + setLaunchId(value); + return this; + } + + @Override + public JClustersRecord value5(String value) { + setMessage(value); + return this; + } + + @Override + public JClustersRecord values(Long value1, Long value2, Long value3, Long value4, String value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JClustersRecord + */ + public JClustersRecord() { + super(JClusters.CLUSTERS); + } + + /** + * Create a detached, initialised JClustersRecord + */ + public JClustersRecord(Long id, Long indexId, Long projectId, Long launchId, String message) { + super(JClusters.CLUSTERS); + + set(0, id); + set(1, indexId); + set(2, projectId); + set(3, launchId); + set(4, message); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersTestItemRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersTestItemRecord.java index 3c3b7abf8..c020b3db7 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersTestItemRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JClustersTestItemRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JClustersTestItem; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -22,121 +24,120 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JClustersTestItemRecord extends TableRecordImpl implements - Record2 { - - private static final long serialVersionUID = -1142553978; - - /** - * Create a detached JClustersTestItemRecord - */ - public JClustersTestItemRecord() { - super(JClustersTestItem.CLUSTERS_TEST_ITEM); - } - - /** - * Create a detached, initialised JClustersTestItemRecord - */ - public JClustersTestItemRecord(Long clusterId, Long itemId) { - super(JClustersTestItem.CLUSTERS_TEST_ITEM); - - set(0, clusterId); - set(1, itemId); - } - - /** - * Getter for public.clusters_test_item.cluster_id. - */ - public Long getClusterId() { - return (Long) get(0); - } - - /** - * Setter for public.clusters_test_item.cluster_id. - */ - public void setClusterId(Long value) { - set(0, value); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - /** - * Getter for public.clusters_test_item.item_id. - */ - public Long getItemId() { - return (Long) get(1); - } - - /** - * Setter for public.clusters_test_item.item_id. - */ - public void setItemId(Long value) { - set(1, value); - } - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID; - } - - @Override - public Field field2() { - return JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID; - } - - @Override - public Long component1() { - return getClusterId(); - } - - @Override - public Long component2() { - return getItemId(); - } - - @Override - public Long value1() { - return getClusterId(); - } - - @Override - public Long value2() { - return getItemId(); - } - - @Override - public JClustersTestItemRecord value1(Long value) { - setClusterId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JClustersTestItemRecord value2(Long value) { - setItemId(value); - return this; - } - - @Override - public JClustersTestItemRecord values(Long value1, Long value2) { - value1(value1); - value2(value2); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JClustersTestItemRecord extends TableRecordImpl implements Record2 { + + private static final long serialVersionUID = -1142553978; + + /** + * Setter for public.clusters_test_item.cluster_id. + */ + public void setClusterId(Long value) { + set(0, value); + } + + /** + * Getter for public.clusters_test_item.cluster_id. + */ + public Long getClusterId() { + return (Long) get(0); + } + + /** + * Setter for public.clusters_test_item.item_id. + */ + public void setItemId(Long value) { + set(1, value); + } + + /** + * Getter for public.clusters_test_item.item_id. + */ + public Long getItemId() { + return (Long) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JClustersTestItem.CLUSTERS_TEST_ITEM.CLUSTER_ID; + } + + @Override + public Field field2() { + return JClustersTestItem.CLUSTERS_TEST_ITEM.ITEM_ID; + } + + @Override + public Long component1() { + return getClusterId(); + } + + @Override + public Long component2() { + return getItemId(); + } + + @Override + public Long value1() { + return getClusterId(); + } + + @Override + public Long value2() { + return getItemId(); + } + + @Override + public JClustersTestItemRecord value1(Long value) { + setClusterId(value); + return this; + } + + @Override + public JClustersTestItemRecord value2(Long value) { + setItemId(value); + return this; + } + + @Override + public JClustersTestItemRecord values(Long value1, Long value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JClustersTestItemRecord + */ + public JClustersTestItemRecord() { + super(JClustersTestItem.CLUSTERS_TEST_ITEM); + } + + /** + * Create a detached, initialised JClustersTestItemRecord + */ + public JClustersTestItemRecord(Long clusterId, Long itemId) { + super(JClustersTestItem.CLUSTERS_TEST_ITEM); + + set(0, clusterId); + set(1, itemId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JContentFieldRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JContentFieldRecord.java index 6da181dc8..c9e701c30 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JContentFieldRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JContentFieldRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JContentField; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -22,121 +24,120 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JContentFieldRecord extends TableRecordImpl implements - Record2 { - - private static final long serialVersionUID = -1854921726; - - /** - * Create a detached JContentFieldRecord - */ - public JContentFieldRecord() { - super(JContentField.CONTENT_FIELD); - } - - /** - * Create a detached, initialised JContentFieldRecord - */ - public JContentFieldRecord(Long id, String field) { - super(JContentField.CONTENT_FIELD); - - set(0, id); - set(1, field); - } - - /** - * Getter for public.content_field.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.content_field.id. - */ - public void setId(Long value) { - set(0, value); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - /** - * Getter for public.content_field.field. - */ - public String getField() { - return (String) get(1); - } - - /** - * Setter for public.content_field.field. - */ - public void setField(String value) { - set(1, value); - } - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JContentField.CONTENT_FIELD.ID; - } - - @Override - public Field field2() { - return JContentField.CONTENT_FIELD.FIELD; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getField(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getField(); - } - - @Override - public JContentFieldRecord value1(Long value) { - setId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JContentFieldRecord value2(String value) { - setField(value); - return this; - } - - @Override - public JContentFieldRecord values(Long value1, String value2) { - value1(value1); - value2(value2); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JContentFieldRecord extends TableRecordImpl implements Record2 { + + private static final long serialVersionUID = -1854921726; + + /** + * Setter for public.content_field.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.content_field.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.content_field.field. + */ + public void setField(String value) { + set(1, value); + } + + /** + * Getter for public.content_field.field. + */ + public String getField() { + return (String) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JContentField.CONTENT_FIELD.ID; + } + + @Override + public Field field2() { + return JContentField.CONTENT_FIELD.FIELD; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getField(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getField(); + } + + @Override + public JContentFieldRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JContentFieldRecord value2(String value) { + setField(value); + return this; + } + + @Override + public JContentFieldRecord values(Long value1, String value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JContentFieldRecord + */ + public JContentFieldRecord() { + super(JContentField.CONTENT_FIELD); + } + + /** + * Create a detached, initialised JContentFieldRecord + */ + public JContentFieldRecord(Long id, String field) { + super(JContentField.CONTENT_FIELD); + + set(0, id); + set(1, field); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardRecord.java index 8351bbfd0..5311875e9 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardRecord.java @@ -5,8 +5,11 @@ import com.epam.ta.reportportal.jooq.tables.JDashboard; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -24,204 +27,203 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JDashboardRecord extends UpdatableRecordImpl implements - Record4 { - - private static final long serialVersionUID = -2017006257; - - /** - * Create a detached JDashboardRecord - */ - public JDashboardRecord() { - super(JDashboard.DASHBOARD); - } - - /** - * Create a detached, initialised JDashboardRecord - */ - public JDashboardRecord(Long id, String name, String description, Timestamp creationDate) { - super(JDashboard.DASHBOARD); - - set(0, id); - set(1, name); - set(2, description); - set(3, creationDate); - } - - /** - * Getter for public.dashboard.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.dashboard.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.dashboard.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.dashboard.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.dashboard.description. - */ - public String getDescription() { - return (String) get(2); - } - - /** - * Setter for public.dashboard.description. - */ - public void setDescription(String value) { - set(2, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.dashboard.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(3); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.dashboard.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(3, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JDashboard.DASHBOARD.ID; - } - - @Override - public Field field2() { - return JDashboard.DASHBOARD.NAME; - } - - @Override - public Field field3() { - return JDashboard.DASHBOARD.DESCRIPTION; - } - - @Override - public Field field4() { - return JDashboard.DASHBOARD.CREATION_DATE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public String component3() { - return getDescription(); - } - - @Override - public Timestamp component4() { - return getCreationDate(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public String value3() { - return getDescription(); - } - - @Override - public Timestamp value4() { - return getCreationDate(); - } - - @Override - public JDashboardRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JDashboardRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JDashboardRecord value3(String value) { - setDescription(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JDashboardRecord value4(Timestamp value) { - setCreationDate(value); - return this; - } - - @Override - public JDashboardRecord values(Long value1, String value2, String value3, Timestamp value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JDashboardRecord extends UpdatableRecordImpl implements Record4 { + + private static final long serialVersionUID = -2017006257; + + /** + * Setter for public.dashboard.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.dashboard.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.dashboard.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.dashboard.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.dashboard.description. + */ + public void setDescription(String value) { + set(2, value); + } + + /** + * Getter for public.dashboard.description. + */ + public String getDescription() { + return (String) get(2); + } + + /** + * Setter for public.dashboard.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(3, value); + } + + /** + * Getter for public.dashboard.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JDashboard.DASHBOARD.ID; + } + + @Override + public Field field2() { + return JDashboard.DASHBOARD.NAME; + } + + @Override + public Field field3() { + return JDashboard.DASHBOARD.DESCRIPTION; + } + + @Override + public Field field4() { + return JDashboard.DASHBOARD.CREATION_DATE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public String component3() { + return getDescription(); + } + + @Override + public Timestamp component4() { + return getCreationDate(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public String value3() { + return getDescription(); + } + + @Override + public Timestamp value4() { + return getCreationDate(); + } + + @Override + public JDashboardRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JDashboardRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JDashboardRecord value3(String value) { + setDescription(value); + return this; + } + + @Override + public JDashboardRecord value4(Timestamp value) { + setCreationDate(value); + return this; + } + + @Override + public JDashboardRecord values(Long value1, String value2, String value3, Timestamp value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JDashboardRecord + */ + public JDashboardRecord() { + super(JDashboard.DASHBOARD); + } + + /** + * Create a detached, initialised JDashboardRecord + */ + public JDashboardRecord(Long id, String name, String description, Timestamp creationDate) { + super(JDashboard.DASHBOARD); + + set(0, id); + set(1, name); + set(2, description); + set(3, creationDate); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardWidgetRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardWidgetRecord.java index 9bc41e2a8..68ed59d27 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardWidgetRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JDashboardWidgetRecord.java @@ -5,11 +5,13 @@ import com.epam.ta.reportportal.jooq.tables.JDashboardWidget; + import javax.annotation.processing.Generated; + import org.jooq.Field; -import org.jooq.Record11; +import org.jooq.Record10; import org.jooq.Record2; -import org.jooq.Row11; +import org.jooq.Row10; import org.jooq.impl.UpdatableRecordImpl; @@ -23,467 +25,425 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JDashboardWidgetRecord extends UpdatableRecordImpl implements - Record11 { - - private static final long serialVersionUID = -1630807143; - - /** - * Create a detached JDashboardWidgetRecord - */ - public JDashboardWidgetRecord() { - super(JDashboardWidget.DASHBOARD_WIDGET); - } - - /** - * Create a detached, initialised JDashboardWidgetRecord - */ - public JDashboardWidgetRecord(Long dashboardId, Long widgetId, String widgetName, - String widgetOwner, String widgetType, Integer widgetWidth, Integer widgetHeight, - Integer widgetPositionX, Integer widgetPositionY, Boolean isCreatedOn, Boolean share) { - super(JDashboardWidget.DASHBOARD_WIDGET); - - set(0, dashboardId); - set(1, widgetId); - set(2, widgetName); - set(3, widgetOwner); - set(4, widgetType); - set(5, widgetWidth); - set(6, widgetHeight); - set(7, widgetPositionX); - set(8, widgetPositionY); - set(9, isCreatedOn); - set(10, share); - } - - /** - * Getter for public.dashboard_widget.dashboard_id. - */ - public Long getDashboardId() { - return (Long) get(0); - } - - /** - * Setter for public.dashboard_widget.dashboard_id. - */ - public void setDashboardId(Long value) { - set(0, value); - } - - /** - * Getter for public.dashboard_widget.widget_id. - */ - public Long getWidgetId() { - return (Long) get(1); - } - - /** - * Setter for public.dashboard_widget.widget_id. - */ - public void setWidgetId(Long value) { - set(1, value); - } - - /** - * Getter for public.dashboard_widget.widget_name. - */ - public String getWidgetName() { - return (String) get(2); - } - - /** - * Setter for public.dashboard_widget.widget_name. - */ - public void setWidgetName(String value) { - set(2, value); - } - - /** - * Getter for public.dashboard_widget.widget_owner. - */ - public String getWidgetOwner() { - return (String) get(3); - } - - /** - * Setter for public.dashboard_widget.widget_owner. - */ - public void setWidgetOwner(String value) { - set(3, value); - } - - /** - * Getter for public.dashboard_widget.widget_type. - */ - public String getWidgetType() { - return (String) get(4); - } - - /** - * Setter for public.dashboard_widget.widget_type. - */ - public void setWidgetType(String value) { - set(4, value); - } - - /** - * Getter for public.dashboard_widget.widget_width. - */ - public Integer getWidgetWidth() { - return (Integer) get(5); - } - - /** - * Setter for public.dashboard_widget.widget_width. - */ - public void setWidgetWidth(Integer value) { - set(5, value); - } - - /** - * Getter for public.dashboard_widget.widget_height. - */ - public Integer getWidgetHeight() { - return (Integer) get(6); - } - - /** - * Setter for public.dashboard_widget.widget_height. - */ - public void setWidgetHeight(Integer value) { - set(6, value); - } - - /** - * Getter for public.dashboard_widget.widget_position_x. - */ - public Integer getWidgetPositionX() { - return (Integer) get(7); - } - - /** - * Setter for public.dashboard_widget.widget_position_x. - */ - public void setWidgetPositionX(Integer value) { - set(7, value); - } - - /** - * Getter for public.dashboard_widget.widget_position_y. - */ - public Integer getWidgetPositionY() { - return (Integer) get(8); - } - - /** - * Setter for public.dashboard_widget.widget_position_y. - */ - public void setWidgetPositionY(Integer value) { - set(8, value); - } - - /** - * Getter for public.dashboard_widget.is_created_on. - */ - public Boolean getIsCreatedOn() { - return (Boolean) get(9); - } - - /** - * Setter for public.dashboard_widget.is_created_on. - */ - public void setIsCreatedOn(Boolean value) { - set(9, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.dashboard_widget.share. - */ - public Boolean getShare() { - return (Boolean) get(10); - } - - // ------------------------------------------------------------------------- - // Record11 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.dashboard_widget.share. - */ - public void setShare(Boolean value) { - set(10, value); - } - - @Override - public Record2 key() { - return (Record2) super.key(); - } - - @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); - } - - @Override - public Row11 valuesRow() { - return (Row11) super.valuesRow(); - } - - @Override - public Field field1() { - return JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID; - } - - @Override - public Field field2() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID; - } - - @Override - public Field field3() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_NAME; - } - - @Override - public Field field4() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_OWNER; - } - - @Override - public Field field5() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_TYPE; - } - - @Override - public Field field6() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_WIDTH; - } - - @Override - public Field field7() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_HEIGHT; - } - - @Override - public Field field8() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_POSITION_X; - } - - @Override - public Field field9() { - return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_POSITION_Y; - } - - @Override - public Field field10() { - return JDashboardWidget.DASHBOARD_WIDGET.IS_CREATED_ON; - } - - @Override - public Field field11() { - return JDashboardWidget.DASHBOARD_WIDGET.SHARE; - } - - @Override - public Long component1() { - return getDashboardId(); - } - - @Override - public Long component2() { - return getWidgetId(); - } - - @Override - public String component3() { - return getWidgetName(); - } - - @Override - public String component4() { - return getWidgetOwner(); - } - - @Override - public String component5() { - return getWidgetType(); - } - - @Override - public Integer component6() { - return getWidgetWidth(); - } - - @Override - public Integer component7() { - return getWidgetHeight(); - } - - @Override - public Integer component8() { - return getWidgetPositionX(); - } - - @Override - public Integer component9() { - return getWidgetPositionY(); - } - - @Override - public Boolean component10() { - return getIsCreatedOn(); - } - - @Override - public Boolean component11() { - return getShare(); - } - - @Override - public Long value1() { - return getDashboardId(); - } - - @Override - public Long value2() { - return getWidgetId(); - } - - @Override - public String value3() { - return getWidgetName(); - } - - @Override - public String value4() { - return getWidgetOwner(); - } - - @Override - public String value5() { - return getWidgetType(); - } - - @Override - public Integer value6() { - return getWidgetWidth(); - } - - @Override - public Integer value7() { - return getWidgetHeight(); - } - - @Override - public Integer value8() { - return getWidgetPositionX(); - } - - @Override - public Integer value9() { - return getWidgetPositionY(); - } - - @Override - public Boolean value10() { - return getIsCreatedOn(); - } - - @Override - public Boolean value11() { - return getShare(); - } - - @Override - public JDashboardWidgetRecord value1(Long value) { - setDashboardId(value); - return this; - } - - @Override - public JDashboardWidgetRecord value2(Long value) { - setWidgetId(value); - return this; - } - - @Override - public JDashboardWidgetRecord value3(String value) { - setWidgetName(value); - return this; - } - - @Override - public JDashboardWidgetRecord value4(String value) { - setWidgetOwner(value); - return this; - } - - @Override - public JDashboardWidgetRecord value5(String value) { - setWidgetType(value); - return this; - } - - @Override - public JDashboardWidgetRecord value6(Integer value) { - setWidgetWidth(value); - return this; - } - - @Override - public JDashboardWidgetRecord value7(Integer value) { - setWidgetHeight(value); - return this; - } - - @Override - public JDashboardWidgetRecord value8(Integer value) { - setWidgetPositionX(value); - return this; - } - - @Override - public JDashboardWidgetRecord value9(Integer value) { - setWidgetPositionY(value); - return this; - } - - @Override - public JDashboardWidgetRecord value10(Boolean value) { - setIsCreatedOn(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JDashboardWidgetRecord value11(Boolean value) { - setShare(value); - return this; - } - - @Override - public JDashboardWidgetRecord values(Long value1, Long value2, String value3, String value4, - String value5, Integer value6, Integer value7, Integer value8, Integer value9, - Boolean value10, Boolean value11) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JDashboardWidgetRecord extends UpdatableRecordImpl implements Record10 { + + private static final long serialVersionUID = -1831425663; + + /** + * Setter for public.dashboard_widget.dashboard_id. + */ + public void setDashboardId(Long value) { + set(0, value); + } + + /** + * Getter for public.dashboard_widget.dashboard_id. + */ + public Long getDashboardId() { + return (Long) get(0); + } + + /** + * Setter for public.dashboard_widget.widget_id. + */ + public void setWidgetId(Long value) { + set(1, value); + } + + /** + * Getter for public.dashboard_widget.widget_id. + */ + public Long getWidgetId() { + return (Long) get(1); + } + + /** + * Setter for public.dashboard_widget.widget_name. + */ + public void setWidgetName(String value) { + set(2, value); + } + + /** + * Getter for public.dashboard_widget.widget_name. + */ + public String getWidgetName() { + return (String) get(2); + } + + /** + * Setter for public.dashboard_widget.widget_owner. + */ + public void setWidgetOwner(String value) { + set(3, value); + } + + /** + * Getter for public.dashboard_widget.widget_owner. + */ + public String getWidgetOwner() { + return (String) get(3); + } + + /** + * Setter for public.dashboard_widget.widget_type. + */ + public void setWidgetType(String value) { + set(4, value); + } + + /** + * Getter for public.dashboard_widget.widget_type. + */ + public String getWidgetType() { + return (String) get(4); + } + + /** + * Setter for public.dashboard_widget.widget_width. + */ + public void setWidgetWidth(Integer value) { + set(5, value); + } + + /** + * Getter for public.dashboard_widget.widget_width. + */ + public Integer getWidgetWidth() { + return (Integer) get(5); + } + + /** + * Setter for public.dashboard_widget.widget_height. + */ + public void setWidgetHeight(Integer value) { + set(6, value); + } + + /** + * Getter for public.dashboard_widget.widget_height. + */ + public Integer getWidgetHeight() { + return (Integer) get(6); + } + + /** + * Setter for public.dashboard_widget.widget_position_x. + */ + public void setWidgetPositionX(Integer value) { + set(7, value); + } + + /** + * Getter for public.dashboard_widget.widget_position_x. + */ + public Integer getWidgetPositionX() { + return (Integer) get(7); + } + + /** + * Setter for public.dashboard_widget.widget_position_y. + */ + public void setWidgetPositionY(Integer value) { + set(8, value); + } + + /** + * Getter for public.dashboard_widget.widget_position_y. + */ + public Integer getWidgetPositionY() { + return (Integer) get(8); + } + + /** + * Setter for public.dashboard_widget.is_created_on. + */ + public void setIsCreatedOn(Boolean value) { + set(9, value); + } + + /** + * Getter for public.dashboard_widget.is_created_on. + */ + public Boolean getIsCreatedOn() { + return (Boolean) get(9); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record10 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row10 fieldsRow() { + return (Row10) super.fieldsRow(); + } + + @Override + public Row10 valuesRow() { + return (Row10) super.valuesRow(); + } + + @Override + public Field field1() { + return JDashboardWidget.DASHBOARD_WIDGET.DASHBOARD_ID; + } + + @Override + public Field field2() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_ID; + } + + @Override + public Field field3() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_NAME; + } + + @Override + public Field field4() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_OWNER; + } + + @Override + public Field field5() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_TYPE; + } + + @Override + public Field field6() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_WIDTH; + } + + @Override + public Field field7() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_HEIGHT; + } + + @Override + public Field field8() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_POSITION_X; + } + + @Override + public Field field9() { + return JDashboardWidget.DASHBOARD_WIDGET.WIDGET_POSITION_Y; + } + + @Override + public Field field10() { + return JDashboardWidget.DASHBOARD_WIDGET.IS_CREATED_ON; + } + + @Override + public Long component1() { + return getDashboardId(); + } + + @Override + public Long component2() { + return getWidgetId(); + } + + @Override + public String component3() { + return getWidgetName(); + } + + @Override + public String component4() { + return getWidgetOwner(); + } + + @Override + public String component5() { + return getWidgetType(); + } + + @Override + public Integer component6() { + return getWidgetWidth(); + } + + @Override + public Integer component7() { + return getWidgetHeight(); + } + + @Override + public Integer component8() { + return getWidgetPositionX(); + } + + @Override + public Integer component9() { + return getWidgetPositionY(); + } + + @Override + public Boolean component10() { + return getIsCreatedOn(); + } + + @Override + public Long value1() { + return getDashboardId(); + } + + @Override + public Long value2() { + return getWidgetId(); + } + + @Override + public String value3() { + return getWidgetName(); + } + + @Override + public String value4() { + return getWidgetOwner(); + } + + @Override + public String value5() { + return getWidgetType(); + } + + @Override + public Integer value6() { + return getWidgetWidth(); + } + + @Override + public Integer value7() { + return getWidgetHeight(); + } + + @Override + public Integer value8() { + return getWidgetPositionX(); + } + + @Override + public Integer value9() { + return getWidgetPositionY(); + } + + @Override + public Boolean value10() { + return getIsCreatedOn(); + } + + @Override + public JDashboardWidgetRecord value1(Long value) { + setDashboardId(value); + return this; + } + + @Override + public JDashboardWidgetRecord value2(Long value) { + setWidgetId(value); + return this; + } + + @Override + public JDashboardWidgetRecord value3(String value) { + setWidgetName(value); + return this; + } + + @Override + public JDashboardWidgetRecord value4(String value) { + setWidgetOwner(value); + return this; + } + + @Override + public JDashboardWidgetRecord value5(String value) { + setWidgetType(value); + return this; + } + + @Override + public JDashboardWidgetRecord value6(Integer value) { + setWidgetWidth(value); + return this; + } + + @Override + public JDashboardWidgetRecord value7(Integer value) { + setWidgetHeight(value); + return this; + } + + @Override + public JDashboardWidgetRecord value8(Integer value) { + setWidgetPositionX(value); + return this; + } + + @Override + public JDashboardWidgetRecord value9(Integer value) { + setWidgetPositionY(value); + return this; + } + + @Override + public JDashboardWidgetRecord value10(Boolean value) { + setIsCreatedOn(value); + return this; + } + + @Override + public JDashboardWidgetRecord values(Long value1, Long value2, String value3, String value4, String value5, Integer value6, Integer value7, Integer value8, Integer value9, Boolean value10) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JDashboardWidgetRecord + */ + public JDashboardWidgetRecord() { + super(JDashboardWidget.DASHBOARD_WIDGET); + } + + /** + * Create a detached, initialised JDashboardWidgetRecord + */ + public JDashboardWidgetRecord(Long dashboardId, Long widgetId, String widgetName, String widgetOwner, String widgetType, Integer widgetWidth, Integer widgetHeight, Integer widgetPositionX, Integer widgetPositionY, Boolean isCreatedOn) { + super(JDashboardWidget.DASHBOARD_WIDGET); + + set(0, dashboardId); + set(1, widgetId); + set(2, widgetName); + set(3, widgetOwner); + set(4, widgetType); + set(5, widgetWidth); + set(6, widgetHeight); + set(7, widgetPositionX); + set(8, widgetPositionY); + set(9, isCreatedOn); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterConditionRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterConditionRecord.java old mode 100755 new mode 100644 index a59178517..30d7abac7 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterConditionRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterConditionRecord.java @@ -6,7 +6,9 @@ import com.epam.ta.reportportal.jooq.enums.JFilterConditionEnum; import com.epam.ta.reportportal.jooq.tables.JFilterCondition; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record6; @@ -24,280 +26,277 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JFilterConditionRecord extends UpdatableRecordImpl implements - Record6 { - - private static final long serialVersionUID = 1436060418; - - /** - * Create a detached JFilterConditionRecord - */ - public JFilterConditionRecord() { - super(JFilterCondition.FILTER_CONDITION); - } - - /** - * Create a detached, initialised JFilterConditionRecord - */ - public JFilterConditionRecord(Long id, Long filterId, JFilterConditionEnum condition, - String value, String searchCriteria, Boolean negative) { - super(JFilterCondition.FILTER_CONDITION); - - set(0, id); - set(1, filterId); - set(2, condition); - set(3, value); - set(4, searchCriteria); - set(5, negative); - } - - /** - * Getter for public.filter_condition.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.filter_condition.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.filter_condition.filter_id. - */ - public Long getFilterId() { - return (Long) get(1); - } - - /** - * Setter for public.filter_condition.filter_id. - */ - public void setFilterId(Long value) { - set(1, value); - } - - /** - * Getter for public.filter_condition.condition. - */ - public JFilterConditionEnum getCondition() { - return (JFilterConditionEnum) get(2); - } - - /** - * Setter for public.filter_condition.condition. - */ - public void setCondition(JFilterConditionEnum value) { - set(2, value); - } - - /** - * Getter for public.filter_condition.value. - */ - public String getValue() { - return (String) get(3); - } - - /** - * Setter for public.filter_condition.value. - */ - public void setValue(String value) { - set(3, value); - } - - /** - * Getter for public.filter_condition.search_criteria. - */ - public String getSearchCriteria() { - return (String) get(4); - } - - /** - * Setter for public.filter_condition.search_criteria. - */ - public void setSearchCriteria(String value) { - set(4, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.filter_condition.negative. - */ - public Boolean getNegative() { - return (Boolean) get(5); - } - - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.filter_condition.negative. - */ - public void setNegative(Boolean value) { - set(5, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return JFilterCondition.FILTER_CONDITION.ID; - } - - @Override - public Field field2() { - return JFilterCondition.FILTER_CONDITION.FILTER_ID; - } - - @Override - public Field field3() { - return JFilterCondition.FILTER_CONDITION.CONDITION; - } - - @Override - public Field field4() { - return JFilterCondition.FILTER_CONDITION.VALUE; - } - - @Override - public Field field5() { - return JFilterCondition.FILTER_CONDITION.SEARCH_CRITERIA; - } - - @Override - public Field field6() { - return JFilterCondition.FILTER_CONDITION.NEGATIVE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getFilterId(); - } - - @Override - public JFilterConditionEnum component3() { - return getCondition(); - } - - @Override - public String component4() { - return getValue(); - } - - @Override - public String component5() { - return getSearchCriteria(); - } - - @Override - public Boolean component6() { - return getNegative(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getFilterId(); - } - - @Override - public JFilterConditionEnum value3() { - return getCondition(); - } - - @Override - public String value4() { - return getValue(); - } - - @Override - public String value5() { - return getSearchCriteria(); - } - - @Override - public Boolean value6() { - return getNegative(); - } - - @Override - public JFilterConditionRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JFilterConditionRecord value2(Long value) { - setFilterId(value); - return this; - } - - @Override - public JFilterConditionRecord value3(JFilterConditionEnum value) { - setCondition(value); - return this; - } - - @Override - public JFilterConditionRecord value4(String value) { - setValue(value); - return this; - } - - @Override - public JFilterConditionRecord value5(String value) { - setSearchCriteria(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JFilterConditionRecord value6(Boolean value) { - setNegative(value); - return this; - } - - @Override - public JFilterConditionRecord values(Long value1, Long value2, JFilterConditionEnum value3, - String value4, String value5, Boolean value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JFilterConditionRecord extends UpdatableRecordImpl implements Record6 { + + private static final long serialVersionUID = 1436060418; + + /** + * Setter for public.filter_condition.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.filter_condition.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.filter_condition.filter_id. + */ + public void setFilterId(Long value) { + set(1, value); + } + + /** + * Getter for public.filter_condition.filter_id. + */ + public Long getFilterId() { + return (Long) get(1); + } + + /** + * Setter for public.filter_condition.condition. + */ + public void setCondition(JFilterConditionEnum value) { + set(2, value); + } + + /** + * Getter for public.filter_condition.condition. + */ + public JFilterConditionEnum getCondition() { + return (JFilterConditionEnum) get(2); + } + + /** + * Setter for public.filter_condition.value. + */ + public void setValue(String value) { + set(3, value); + } + + /** + * Getter for public.filter_condition.value. + */ + public String getValue() { + return (String) get(3); + } + + /** + * Setter for public.filter_condition.search_criteria. + */ + public void setSearchCriteria(String value) { + set(4, value); + } + + /** + * Getter for public.filter_condition.search_criteria. + */ + public String getSearchCriteria() { + return (String) get(4); + } + + /** + * Setter for public.filter_condition.negative. + */ + public void setNegative(Boolean value) { + set(5, value); + } + + /** + * Getter for public.filter_condition.negative. + */ + public Boolean getNegative() { + return (Boolean) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return JFilterCondition.FILTER_CONDITION.ID; + } + + @Override + public Field field2() { + return JFilterCondition.FILTER_CONDITION.FILTER_ID; + } + + @Override + public Field field3() { + return JFilterCondition.FILTER_CONDITION.CONDITION; + } + + @Override + public Field field4() { + return JFilterCondition.FILTER_CONDITION.VALUE; + } + + @Override + public Field field5() { + return JFilterCondition.FILTER_CONDITION.SEARCH_CRITERIA; + } + + @Override + public Field field6() { + return JFilterCondition.FILTER_CONDITION.NEGATIVE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getFilterId(); + } + + @Override + public JFilterConditionEnum component3() { + return getCondition(); + } + + @Override + public String component4() { + return getValue(); + } + + @Override + public String component5() { + return getSearchCriteria(); + } + + @Override + public Boolean component6() { + return getNegative(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getFilterId(); + } + + @Override + public JFilterConditionEnum value3() { + return getCondition(); + } + + @Override + public String value4() { + return getValue(); + } + + @Override + public String value5() { + return getSearchCriteria(); + } + + @Override + public Boolean value6() { + return getNegative(); + } + + @Override + public JFilterConditionRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JFilterConditionRecord value2(Long value) { + setFilterId(value); + return this; + } + + @Override + public JFilterConditionRecord value3(JFilterConditionEnum value) { + setCondition(value); + return this; + } + + @Override + public JFilterConditionRecord value4(String value) { + setValue(value); + return this; + } + + @Override + public JFilterConditionRecord value5(String value) { + setSearchCriteria(value); + return this; + } + + @Override + public JFilterConditionRecord value6(Boolean value) { + setNegative(value); + return this; + } + + @Override + public JFilterConditionRecord values(Long value1, Long value2, JFilterConditionEnum value3, String value4, String value5, Boolean value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JFilterConditionRecord + */ + public JFilterConditionRecord() { + super(JFilterCondition.FILTER_CONDITION); + } + + /** + * Create a detached, initialised JFilterConditionRecord + */ + public JFilterConditionRecord(Long id, Long filterId, JFilterConditionEnum condition, String value, String searchCriteria, Boolean negative) { + super(JFilterCondition.FILTER_CONDITION); + + set(0, id); + set(1, filterId); + set(2, condition); + set(3, value); + set(4, searchCriteria); + set(5, negative); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterRecord.java old mode 100755 new mode 100644 index 561d292c4..d3d5052f7 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JFilter; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -23,204 +25,203 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JFilterRecord extends UpdatableRecordImpl implements - Record4 { - - private static final long serialVersionUID = -1042860928; - - /** - * Create a detached JFilterRecord - */ - public JFilterRecord() { - super(JFilter.FILTER); - } - - /** - * Create a detached, initialised JFilterRecord - */ - public JFilterRecord(Long id, String name, String target, String description) { - super(JFilter.FILTER); - - set(0, id); - set(1, name); - set(2, target); - set(3, description); - } - - /** - * Getter for public.filter.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.filter.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.filter.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.filter.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.filter.target. - */ - public String getTarget() { - return (String) get(2); - } - - /** - * Setter for public.filter.target. - */ - public void setTarget(String value) { - set(2, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.filter.description. - */ - public String getDescription() { - return (String) get(3); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.filter.description. - */ - public void setDescription(String value) { - set(3, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JFilter.FILTER.ID; - } - - @Override - public Field field2() { - return JFilter.FILTER.NAME; - } - - @Override - public Field field3() { - return JFilter.FILTER.TARGET; - } - - @Override - public Field field4() { - return JFilter.FILTER.DESCRIPTION; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public String component3() { - return getTarget(); - } - - @Override - public String component4() { - return getDescription(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public String value3() { - return getTarget(); - } - - @Override - public String value4() { - return getDescription(); - } - - @Override - public JFilterRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JFilterRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JFilterRecord value3(String value) { - setTarget(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JFilterRecord value4(String value) { - setDescription(value); - return this; - } - - @Override - public JFilterRecord values(Long value1, String value2, String value3, String value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JFilterRecord extends UpdatableRecordImpl implements Record4 { + + private static final long serialVersionUID = -1042860928; + + /** + * Setter for public.filter.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.filter.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.filter.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.filter.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.filter.target. + */ + public void setTarget(String value) { + set(2, value); + } + + /** + * Getter for public.filter.target. + */ + public String getTarget() { + return (String) get(2); + } + + /** + * Setter for public.filter.description. + */ + public void setDescription(String value) { + set(3, value); + } + + /** + * Getter for public.filter.description. + */ + public String getDescription() { + return (String) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JFilter.FILTER.ID; + } + + @Override + public Field field2() { + return JFilter.FILTER.NAME; + } + + @Override + public Field field3() { + return JFilter.FILTER.TARGET; + } + + @Override + public Field field4() { + return JFilter.FILTER.DESCRIPTION; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public String component3() { + return getTarget(); + } + + @Override + public String component4() { + return getDescription(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public String value3() { + return getTarget(); + } + + @Override + public String value4() { + return getDescription(); + } + + @Override + public JFilterRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JFilterRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JFilterRecord value3(String value) { + setTarget(value); + return this; + } + + @Override + public JFilterRecord value4(String value) { + setDescription(value); + return this; + } + + @Override + public JFilterRecord values(Long value1, String value2, String value3, String value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JFilterRecord + */ + public JFilterRecord() { + super(JFilter.FILTER); + } + + /** + * Create a detached, initialised JFilterRecord + */ + public JFilterRecord(Long id, String name, String target, String description) { + super(JFilter.FILTER); + + set(0, id); + set(1, name); + set(2, target); + set(3, description); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterSortRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterSortRecord.java old mode 100755 new mode 100644 index 942b8b914..362d482a7 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterSortRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JFilterSortRecord.java @@ -6,7 +6,9 @@ import com.epam.ta.reportportal.jooq.enums.JSortDirectionEnum; import com.epam.ta.reportportal.jooq.tables.JFilterSort; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -24,205 +26,203 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JFilterSortRecord extends UpdatableRecordImpl implements - Record4 { - - private static final long serialVersionUID = -758871639; - - /** - * Create a detached JFilterSortRecord - */ - public JFilterSortRecord() { - super(JFilterSort.FILTER_SORT); - } - - /** - * Create a detached, initialised JFilterSortRecord - */ - public JFilterSortRecord(Long id, Long filterId, String field, JSortDirectionEnum direction) { - super(JFilterSort.FILTER_SORT); - - set(0, id); - set(1, filterId); - set(2, field); - set(3, direction); - } - - /** - * Getter for public.filter_sort.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.filter_sort.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.filter_sort.filter_id. - */ - public Long getFilterId() { - return (Long) get(1); - } - - /** - * Setter for public.filter_sort.filter_id. - */ - public void setFilterId(Long value) { - set(1, value); - } - - /** - * Getter for public.filter_sort.field. - */ - public String getField() { - return (String) get(2); - } - - /** - * Setter for public.filter_sort.field. - */ - public void setField(String value) { - set(2, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.filter_sort.direction. - */ - public JSortDirectionEnum getDirection() { - return (JSortDirectionEnum) get(3); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.filter_sort.direction. - */ - public void setDirection(JSortDirectionEnum value) { - set(3, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JFilterSort.FILTER_SORT.ID; - } - - @Override - public Field field2() { - return JFilterSort.FILTER_SORT.FILTER_ID; - } - - @Override - public Field field3() { - return JFilterSort.FILTER_SORT.FIELD; - } - - @Override - public Field field4() { - return JFilterSort.FILTER_SORT.DIRECTION; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getFilterId(); - } - - @Override - public String component3() { - return getField(); - } - - @Override - public JSortDirectionEnum component4() { - return getDirection(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getFilterId(); - } - - @Override - public String value3() { - return getField(); - } - - @Override - public JSortDirectionEnum value4() { - return getDirection(); - } - - @Override - public JFilterSortRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JFilterSortRecord value2(Long value) { - setFilterId(value); - return this; - } - - @Override - public JFilterSortRecord value3(String value) { - setField(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JFilterSortRecord value4(JSortDirectionEnum value) { - setDirection(value); - return this; - } - - @Override - public JFilterSortRecord values(Long value1, Long value2, String value3, - JSortDirectionEnum value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JFilterSortRecord extends UpdatableRecordImpl implements Record4 { + + private static final long serialVersionUID = -758871639; + + /** + * Setter for public.filter_sort.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.filter_sort.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.filter_sort.filter_id. + */ + public void setFilterId(Long value) { + set(1, value); + } + + /** + * Getter for public.filter_sort.filter_id. + */ + public Long getFilterId() { + return (Long) get(1); + } + + /** + * Setter for public.filter_sort.field. + */ + public void setField(String value) { + set(2, value); + } + + /** + * Getter for public.filter_sort.field. + */ + public String getField() { + return (String) get(2); + } + + /** + * Setter for public.filter_sort.direction. + */ + public void setDirection(JSortDirectionEnum value) { + set(3, value); + } + + /** + * Getter for public.filter_sort.direction. + */ + public JSortDirectionEnum getDirection() { + return (JSortDirectionEnum) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JFilterSort.FILTER_SORT.ID; + } + + @Override + public Field field2() { + return JFilterSort.FILTER_SORT.FILTER_ID; + } + + @Override + public Field field3() { + return JFilterSort.FILTER_SORT.FIELD; + } + + @Override + public Field field4() { + return JFilterSort.FILTER_SORT.DIRECTION; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getFilterId(); + } + + @Override + public String component3() { + return getField(); + } + + @Override + public JSortDirectionEnum component4() { + return getDirection(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getFilterId(); + } + + @Override + public String value3() { + return getField(); + } + + @Override + public JSortDirectionEnum value4() { + return getDirection(); + } + + @Override + public JFilterSortRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JFilterSortRecord value2(Long value) { + setFilterId(value); + return this; + } + + @Override + public JFilterSortRecord value3(String value) { + setField(value); + return this; + } + + @Override + public JFilterSortRecord value4(JSortDirectionEnum value) { + setDirection(value); + return this; + } + + @Override + public JFilterSortRecord values(Long value1, Long value2, String value3, JSortDirectionEnum value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JFilterSortRecord + */ + public JFilterSortRecord() { + super(JFilterSort.FILTER_SORT); + } + + /** + * Create a detached, initialised JFilterSortRecord + */ + public JFilterSortRecord(Long id, Long filterId, String field, JSortDirectionEnum direction) { + super(JFilterSort.FILTER_SORT); + + set(0, id); + set(1, filterId); + set(2, field); + set(3, direction); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationRecord.java old mode 100755 new mode 100644 index 92486873d..636128fa1 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationRecord.java @@ -5,8 +5,11 @@ import com.epam.ta.reportportal.jooq.tables.JIntegration; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.JSONB; import org.jooq.Record1; @@ -25,354 +28,351 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JIntegrationRecord extends UpdatableRecordImpl implements - Record8 { - - private static final long serialVersionUID = 760916157; - - /** - * Create a detached JIntegrationRecord - */ - public JIntegrationRecord() { - super(JIntegration.INTEGRATION); - } - - /** - * Create a detached, initialised JIntegrationRecord - */ - public JIntegrationRecord(Integer id, String name, Long projectId, Integer type, Boolean enabled, - JSONB params, String creator, Timestamp creationDate) { - super(JIntegration.INTEGRATION); - - set(0, id); - set(1, name); - set(2, projectId); - set(3, type); - set(4, enabled); - set(5, params); - set(6, creator); - set(7, creationDate); - } - - /** - * Getter for public.integration.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for public.integration.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for public.integration.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.integration.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.integration.project_id. - */ - public Long getProjectId() { - return (Long) get(2); - } - - /** - * Setter for public.integration.project_id. - */ - public void setProjectId(Long value) { - set(2, value); - } - - /** - * Getter for public.integration.type. - */ - public Integer getType() { - return (Integer) get(3); - } - - /** - * Setter for public.integration.type. - */ - public void setType(Integer value) { - set(3, value); - } - - /** - * Getter for public.integration.enabled. - */ - public Boolean getEnabled() { - return (Boolean) get(4); - } - - /** - * Setter for public.integration.enabled. - */ - public void setEnabled(Boolean value) { - set(4, value); - } - - /** - * Getter for public.integration.params. - */ - public JSONB getParams() { - return (JSONB) get(5); - } - - /** - * Setter for public.integration.params. - */ - public void setParams(JSONB value) { - set(5, value); - } - - /** - * Getter for public.integration.creator. - */ - public String getCreator() { - return (String) get(6); - } - - /** - * Setter for public.integration.creator. - */ - public void setCreator(String value) { - set(6, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.integration.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(7); - } - - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.integration.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(7, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - @Override - public Field field1() { - return JIntegration.INTEGRATION.ID; - } - - @Override - public Field field2() { - return JIntegration.INTEGRATION.NAME; - } - - @Override - public Field field3() { - return JIntegration.INTEGRATION.PROJECT_ID; - } - - @Override - public Field field4() { - return JIntegration.INTEGRATION.TYPE; - } - - @Override - public Field field5() { - return JIntegration.INTEGRATION.ENABLED; - } - - @Override - public Field field6() { - return JIntegration.INTEGRATION.PARAMS; - } - - @Override - public Field field7() { - return JIntegration.INTEGRATION.CREATOR; - } - - @Override - public Field field8() { - return JIntegration.INTEGRATION.CREATION_DATE; - } - - @Override - public Integer component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public Long component3() { - return getProjectId(); - } - - @Override - public Integer component4() { - return getType(); - } - - @Override - public Boolean component5() { - return getEnabled(); - } - - @Override - public JSONB component6() { - return getParams(); - } - - @Override - public String component7() { - return getCreator(); - } - - @Override - public Timestamp component8() { - return getCreationDate(); - } - - @Override - public Integer value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public Long value3() { - return getProjectId(); - } - - @Override - public Integer value4() { - return getType(); - } - - @Override - public Boolean value5() { - return getEnabled(); - } - - @Override - public JSONB value6() { - return getParams(); - } - - @Override - public String value7() { - return getCreator(); - } - - @Override - public Timestamp value8() { - return getCreationDate(); - } - - @Override - public JIntegrationRecord value1(Integer value) { - setId(value); - return this; - } - - @Override - public JIntegrationRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JIntegrationRecord value3(Long value) { - setProjectId(value); - return this; - } - - @Override - public JIntegrationRecord value4(Integer value) { - setType(value); - return this; - } - - @Override - public JIntegrationRecord value5(Boolean value) { - setEnabled(value); - return this; - } - - @Override - public JIntegrationRecord value6(JSONB value) { - setParams(value); - return this; - } - - @Override - public JIntegrationRecord value7(String value) { - setCreator(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JIntegrationRecord value8(Timestamp value) { - setCreationDate(value); - return this; - } - - @Override - public JIntegrationRecord values(Integer value1, String value2, Long value3, Integer value4, - Boolean value5, JSONB value6, String value7, Timestamp value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JIntegrationRecord extends UpdatableRecordImpl implements Record8 { + + private static final long serialVersionUID = 760916157; + + /** + * Setter for public.integration.id. + */ + public void setId(Integer value) { + set(0, value); + } + + /** + * Getter for public.integration.id. + */ + public Integer getId() { + return (Integer) get(0); + } + + /** + * Setter for public.integration.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.integration.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.integration.project_id. + */ + public void setProjectId(Long value) { + set(2, value); + } + + /** + * Getter for public.integration.project_id. + */ + public Long getProjectId() { + return (Long) get(2); + } + + /** + * Setter for public.integration.type. + */ + public void setType(Integer value) { + set(3, value); + } + + /** + * Getter for public.integration.type. + */ + public Integer getType() { + return (Integer) get(3); + } + + /** + * Setter for public.integration.enabled. + */ + public void setEnabled(Boolean value) { + set(4, value); + } + + /** + * Getter for public.integration.enabled. + */ + public Boolean getEnabled() { + return (Boolean) get(4); + } + + /** + * Setter for public.integration.params. + */ + public void setParams(JSONB value) { + set(5, value); + } + + /** + * Getter for public.integration.params. + */ + public JSONB getParams() { + return (JSONB) get(5); + } + + /** + * Setter for public.integration.creator. + */ + public void setCreator(String value) { + set(6, value); + } + + /** + * Getter for public.integration.creator. + */ + public String getCreator() { + return (String) get(6); + } + + /** + * Setter for public.integration.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(7, value); + } + + /** + * Getter for public.integration.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(7); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record8 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } + + @Override + public Row8 valuesRow() { + return (Row8) super.valuesRow(); + } + + @Override + public Field field1() { + return JIntegration.INTEGRATION.ID; + } + + @Override + public Field field2() { + return JIntegration.INTEGRATION.NAME; + } + + @Override + public Field field3() { + return JIntegration.INTEGRATION.PROJECT_ID; + } + + @Override + public Field field4() { + return JIntegration.INTEGRATION.TYPE; + } + + @Override + public Field field5() { + return JIntegration.INTEGRATION.ENABLED; + } + + @Override + public Field field6() { + return JIntegration.INTEGRATION.PARAMS; + } + + @Override + public Field field7() { + return JIntegration.INTEGRATION.CREATOR; + } + + @Override + public Field field8() { + return JIntegration.INTEGRATION.CREATION_DATE; + } + + @Override + public Integer component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public Long component3() { + return getProjectId(); + } + + @Override + public Integer component4() { + return getType(); + } + + @Override + public Boolean component5() { + return getEnabled(); + } + + @Override + public JSONB component6() { + return getParams(); + } + + @Override + public String component7() { + return getCreator(); + } + + @Override + public Timestamp component8() { + return getCreationDate(); + } + + @Override + public Integer value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public Long value3() { + return getProjectId(); + } + + @Override + public Integer value4() { + return getType(); + } + + @Override + public Boolean value5() { + return getEnabled(); + } + + @Override + public JSONB value6() { + return getParams(); + } + + @Override + public String value7() { + return getCreator(); + } + + @Override + public Timestamp value8() { + return getCreationDate(); + } + + @Override + public JIntegrationRecord value1(Integer value) { + setId(value); + return this; + } + + @Override + public JIntegrationRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JIntegrationRecord value3(Long value) { + setProjectId(value); + return this; + } + + @Override + public JIntegrationRecord value4(Integer value) { + setType(value); + return this; + } + + @Override + public JIntegrationRecord value5(Boolean value) { + setEnabled(value); + return this; + } + + @Override + public JIntegrationRecord value6(JSONB value) { + setParams(value); + return this; + } + + @Override + public JIntegrationRecord value7(String value) { + setCreator(value); + return this; + } + + @Override + public JIntegrationRecord value8(Timestamp value) { + setCreationDate(value); + return this; + } + + @Override + public JIntegrationRecord values(Integer value1, String value2, Long value3, Integer value4, Boolean value5, JSONB value6, String value7, Timestamp value8) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JIntegrationRecord + */ + public JIntegrationRecord() { + super(JIntegration.INTEGRATION); + } + + /** + * Create a detached, initialised JIntegrationRecord + */ + public JIntegrationRecord(Integer id, String name, Long projectId, Integer type, Boolean enabled, JSONB params, String creator, Timestamp creationDate) { + super(JIntegration.INTEGRATION); + + set(0, id); + set(1, name); + set(2, projectId); + set(3, type); + set(4, enabled); + set(5, params); + set(6, creator); + set(7, creationDate); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationTypeRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationTypeRecord.java old mode 100755 new mode 100644 index 542775350..c4d03c99e --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationTypeRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIntegrationTypeRecord.java @@ -7,8 +7,11 @@ import com.epam.ta.reportportal.jooq.enums.JIntegrationAuthFlowEnum; import com.epam.ta.reportportal.jooq.enums.JIntegrationGroupEnum; import com.epam.ta.reportportal.jooq.tables.JIntegrationType; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.JSONB; import org.jooq.Record1; @@ -27,318 +30,314 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JIntegrationTypeRecord extends UpdatableRecordImpl implements - Record7 { - - private static final long serialVersionUID = -1999785253; - - /** - * Create a detached JIntegrationTypeRecord - */ - public JIntegrationTypeRecord() { - super(JIntegrationType.INTEGRATION_TYPE); - } - - /** - * Create a detached, initialised JIntegrationTypeRecord - */ - public JIntegrationTypeRecord(Integer id, String name, JIntegrationAuthFlowEnum authFlow, - Timestamp creationDate, JIntegrationGroupEnum groupType, Boolean enabled, JSONB details) { - super(JIntegrationType.INTEGRATION_TYPE); - - set(0, id); - set(1, name); - set(2, authFlow); - set(3, creationDate); - set(4, groupType); - set(5, enabled); - set(6, details); - } - - /** - * Getter for public.integration_type.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for public.integration_type.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for public.integration_type.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.integration_type.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.integration_type.auth_flow. - */ - public JIntegrationAuthFlowEnum getAuthFlow() { - return (JIntegrationAuthFlowEnum) get(2); - } - - /** - * Setter for public.integration_type.auth_flow. - */ - public void setAuthFlow(JIntegrationAuthFlowEnum value) { - set(2, value); - } - - /** - * Getter for public.integration_type.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(3); - } - - /** - * Setter for public.integration_type.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(3, value); - } - - /** - * Getter for public.integration_type.group_type. - */ - public JIntegrationGroupEnum getGroupType() { - return (JIntegrationGroupEnum) get(4); - } - - /** - * Setter for public.integration_type.group_type. - */ - public void setGroupType(JIntegrationGroupEnum value) { - set(4, value); - } - - /** - * Getter for public.integration_type.enabled. - */ - public Boolean getEnabled() { - return (Boolean) get(5); - } - - /** - * Setter for public.integration_type.enabled. - */ - public void setEnabled(Boolean value) { - set(5, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.integration_type.details. - */ - public JSONB getDetails() { - return (JSONB) get(6); - } - - // ------------------------------------------------------------------------- - // Record7 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.integration_type.details. - */ - public void setDetails(JSONB value) { - set(6, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); - } - - @Override - public Row7 valuesRow() { - return (Row7) super.valuesRow(); - } - - @Override - public Field field1() { - return JIntegrationType.INTEGRATION_TYPE.ID; - } - - @Override - public Field field2() { - return JIntegrationType.INTEGRATION_TYPE.NAME; - } - - @Override - public Field field3() { - return JIntegrationType.INTEGRATION_TYPE.AUTH_FLOW; - } - - @Override - public Field field4() { - return JIntegrationType.INTEGRATION_TYPE.CREATION_DATE; - } - - @Override - public Field field5() { - return JIntegrationType.INTEGRATION_TYPE.GROUP_TYPE; - } - - @Override - public Field field6() { - return JIntegrationType.INTEGRATION_TYPE.ENABLED; - } - - @Override - public Field field7() { - return JIntegrationType.INTEGRATION_TYPE.DETAILS; - } - - @Override - public Integer component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public JIntegrationAuthFlowEnum component3() { - return getAuthFlow(); - } - - @Override - public Timestamp component4() { - return getCreationDate(); - } - - @Override - public JIntegrationGroupEnum component5() { - return getGroupType(); - } - - @Override - public Boolean component6() { - return getEnabled(); - } - - @Override - public JSONB component7() { - return getDetails(); - } - - @Override - public Integer value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public JIntegrationAuthFlowEnum value3() { - return getAuthFlow(); - } - - @Override - public Timestamp value4() { - return getCreationDate(); - } - - @Override - public JIntegrationGroupEnum value5() { - return getGroupType(); - } - - @Override - public Boolean value6() { - return getEnabled(); - } - - @Override - public JSONB value7() { - return getDetails(); - } - - @Override - public JIntegrationTypeRecord value1(Integer value) { - setId(value); - return this; - } - - @Override - public JIntegrationTypeRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JIntegrationTypeRecord value3(JIntegrationAuthFlowEnum value) { - setAuthFlow(value); - return this; - } - - @Override - public JIntegrationTypeRecord value4(Timestamp value) { - setCreationDate(value); - return this; - } - - @Override - public JIntegrationTypeRecord value5(JIntegrationGroupEnum value) { - setGroupType(value); - return this; - } - - @Override - public JIntegrationTypeRecord value6(Boolean value) { - setEnabled(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JIntegrationTypeRecord value7(JSONB value) { - setDetails(value); - return this; - } - - @Override - public JIntegrationTypeRecord values(Integer value1, String value2, - JIntegrationAuthFlowEnum value3, Timestamp value4, JIntegrationGroupEnum value5, - Boolean value6, JSONB value7) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JIntegrationTypeRecord extends UpdatableRecordImpl implements Record7 { + + private static final long serialVersionUID = -1999785253; + + /** + * Setter for public.integration_type.id. + */ + public void setId(Integer value) { + set(0, value); + } + + /** + * Getter for public.integration_type.id. + */ + public Integer getId() { + return (Integer) get(0); + } + + /** + * Setter for public.integration_type.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.integration_type.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.integration_type.auth_flow. + */ + public void setAuthFlow(JIntegrationAuthFlowEnum value) { + set(2, value); + } + + /** + * Getter for public.integration_type.auth_flow. + */ + public JIntegrationAuthFlowEnum getAuthFlow() { + return (JIntegrationAuthFlowEnum) get(2); + } + + /** + * Setter for public.integration_type.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(3, value); + } + + /** + * Getter for public.integration_type.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(3); + } + + /** + * Setter for public.integration_type.group_type. + */ + public void setGroupType(JIntegrationGroupEnum value) { + set(4, value); + } + + /** + * Getter for public.integration_type.group_type. + */ + public JIntegrationGroupEnum getGroupType() { + return (JIntegrationGroupEnum) get(4); + } + + /** + * Setter for public.integration_type.enabled. + */ + public void setEnabled(Boolean value) { + set(5, value); + } + + /** + * Getter for public.integration_type.enabled. + */ + public Boolean getEnabled() { + return (Boolean) get(5); + } + + /** + * Setter for public.integration_type.details. + */ + public void setDetails(JSONB value) { + set(6, value); + } + + /** + * Getter for public.integration_type.details. + */ + public JSONB getDetails() { + return (JSONB) get(6); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record7 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + @Override + public Row7 valuesRow() { + return (Row7) super.valuesRow(); + } + + @Override + public Field field1() { + return JIntegrationType.INTEGRATION_TYPE.ID; + } + + @Override + public Field field2() { + return JIntegrationType.INTEGRATION_TYPE.NAME; + } + + @Override + public Field field3() { + return JIntegrationType.INTEGRATION_TYPE.AUTH_FLOW; + } + + @Override + public Field field4() { + return JIntegrationType.INTEGRATION_TYPE.CREATION_DATE; + } + + @Override + public Field field5() { + return JIntegrationType.INTEGRATION_TYPE.GROUP_TYPE; + } + + @Override + public Field field6() { + return JIntegrationType.INTEGRATION_TYPE.ENABLED; + } + + @Override + public Field field7() { + return JIntegrationType.INTEGRATION_TYPE.DETAILS; + } + + @Override + public Integer component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public JIntegrationAuthFlowEnum component3() { + return getAuthFlow(); + } + + @Override + public Timestamp component4() { + return getCreationDate(); + } + + @Override + public JIntegrationGroupEnum component5() { + return getGroupType(); + } + + @Override + public Boolean component6() { + return getEnabled(); + } + + @Override + public JSONB component7() { + return getDetails(); + } + + @Override + public Integer value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public JIntegrationAuthFlowEnum value3() { + return getAuthFlow(); + } + + @Override + public Timestamp value4() { + return getCreationDate(); + } + + @Override + public JIntegrationGroupEnum value5() { + return getGroupType(); + } + + @Override + public Boolean value6() { + return getEnabled(); + } + + @Override + public JSONB value7() { + return getDetails(); + } + + @Override + public JIntegrationTypeRecord value1(Integer value) { + setId(value); + return this; + } + + @Override + public JIntegrationTypeRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JIntegrationTypeRecord value3(JIntegrationAuthFlowEnum value) { + setAuthFlow(value); + return this; + } + + @Override + public JIntegrationTypeRecord value4(Timestamp value) { + setCreationDate(value); + return this; + } + + @Override + public JIntegrationTypeRecord value5(JIntegrationGroupEnum value) { + setGroupType(value); + return this; + } + + @Override + public JIntegrationTypeRecord value6(Boolean value) { + setEnabled(value); + return this; + } + + @Override + public JIntegrationTypeRecord value7(JSONB value) { + setDetails(value); + return this; + } + + @Override + public JIntegrationTypeRecord values(Integer value1, String value2, JIntegrationAuthFlowEnum value3, Timestamp value4, JIntegrationGroupEnum value5, Boolean value6, JSONB value7) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JIntegrationTypeRecord + */ + public JIntegrationTypeRecord() { + super(JIntegrationType.INTEGRATION_TYPE); + } + + /** + * Create a detached, initialised JIntegrationTypeRecord + */ + public JIntegrationTypeRecord(Integer id, String name, JIntegrationAuthFlowEnum authFlow, Timestamp creationDate, JIntegrationGroupEnum groupType, Boolean enabled, JSONB details) { + super(JIntegrationType.INTEGRATION_TYPE); + + set(0, id); + set(1, name); + set(2, authFlow); + set(3, creationDate); + set(4, groupType); + set(5, enabled); + set(6, details); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueGroupRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueGroupRecord.java old mode 100755 new mode 100644 index 281d97f44..23af40700 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueGroupRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueGroupRecord.java @@ -6,7 +6,9 @@ import com.epam.ta.reportportal.jooq.enums.JIssueGroupEnum; import com.epam.ta.reportportal.jooq.tables.JIssueGroup; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record2; @@ -24,130 +26,129 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JIssueGroupRecord extends UpdatableRecordImpl implements - Record2 { - - private static final long serialVersionUID = 706892897; - - /** - * Create a detached JIssueGroupRecord - */ - public JIssueGroupRecord() { - super(JIssueGroup.ISSUE_GROUP); - } - - /** - * Create a detached, initialised JIssueGroupRecord - */ - public JIssueGroupRecord(Short issueGroupId, JIssueGroupEnum issueGroup) { - super(JIssueGroup.ISSUE_GROUP); - - set(0, issueGroupId); - set(1, issueGroup); - } - - /** - * Getter for public.issue_group.issue_group_id. - */ - public Short getIssueGroupId() { - return (Short) get(0); - } - - /** - * Setter for public.issue_group.issue_group_id. - */ - public void setIssueGroupId(Short value) { - set(0, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.issue_group.issue_group. - */ - public JIssueGroupEnum getIssueGroup() { - return (JIssueGroupEnum) get(1); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.issue_group.issue_group. - */ - public void setIssueGroup(JIssueGroupEnum value) { - set(1, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID; - } - - @Override - public Field field2() { - return JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_; - } - - @Override - public Short component1() { - return getIssueGroupId(); - } - - @Override - public JIssueGroupEnum component2() { - return getIssueGroup(); - } - - @Override - public Short value1() { - return getIssueGroupId(); - } - - @Override - public JIssueGroupEnum value2() { - return getIssueGroup(); - } - - @Override - public JIssueGroupRecord value1(Short value) { - setIssueGroupId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JIssueGroupRecord value2(JIssueGroupEnum value) { - setIssueGroup(value); - return this; - } - - @Override - public JIssueGroupRecord values(Short value1, JIssueGroupEnum value2) { - value1(value1); - value2(value2); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JIssueGroupRecord extends UpdatableRecordImpl implements Record2 { + + private static final long serialVersionUID = 706892897; + + /** + * Setter for public.issue_group.issue_group_id. + */ + public void setIssueGroupId(Short value) { + set(0, value); + } + + /** + * Getter for public.issue_group.issue_group_id. + */ + public Short getIssueGroupId() { + return (Short) get(0); + } + + /** + * Setter for public.issue_group.issue_group. + */ + public void setIssueGroup(JIssueGroupEnum value) { + set(1, value); + } + + /** + * Getter for public.issue_group.issue_group. + */ + public JIssueGroupEnum getIssueGroup() { + return (JIssueGroupEnum) get(1); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_ID; + } + + @Override + public Field field2() { + return JIssueGroup.ISSUE_GROUP.ISSUE_GROUP_; + } + + @Override + public Short component1() { + return getIssueGroupId(); + } + + @Override + public JIssueGroupEnum component2() { + return getIssueGroup(); + } + + @Override + public Short value1() { + return getIssueGroupId(); + } + + @Override + public JIssueGroupEnum value2() { + return getIssueGroup(); + } + + @Override + public JIssueGroupRecord value1(Short value) { + setIssueGroupId(value); + return this; + } + + @Override + public JIssueGroupRecord value2(JIssueGroupEnum value) { + setIssueGroup(value); + return this; + } + + @Override + public JIssueGroupRecord values(Short value1, JIssueGroupEnum value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JIssueGroupRecord + */ + public JIssueGroupRecord() { + super(JIssueGroup.ISSUE_GROUP); + } + + /** + * Create a detached, initialised JIssueGroupRecord + */ + public JIssueGroupRecord(Short issueGroupId, JIssueGroupEnum issueGroup) { + super(JIssueGroup.ISSUE_GROUP); + + set(0, issueGroupId); + set(1, issueGroup); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueRecord.java old mode 100755 new mode 100644 index 223cbe2de..eaab83c61 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JIssue; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record5; @@ -23,243 +25,240 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JIssueRecord extends UpdatableRecordImpl implements - Record5 { - - private static final long serialVersionUID = -1357499849; - - /** - * Create a detached JIssueRecord - */ - public JIssueRecord() { - super(JIssue.ISSUE); - } - - /** - * Create a detached, initialised JIssueRecord - */ - public JIssueRecord(Long issueId, Long issueType, String issueDescription, Boolean autoAnalyzed, - Boolean ignoreAnalyzer) { - super(JIssue.ISSUE); - - set(0, issueId); - set(1, issueType); - set(2, issueDescription); - set(3, autoAnalyzed); - set(4, ignoreAnalyzer); - } - - /** - * Getter for public.issue.issue_id. - */ - public Long getIssueId() { - return (Long) get(0); - } - - /** - * Setter for public.issue.issue_id. - */ - public void setIssueId(Long value) { - set(0, value); - } - - /** - * Getter for public.issue.issue_type. - */ - public Long getIssueType() { - return (Long) get(1); - } - - /** - * Setter for public.issue.issue_type. - */ - public void setIssueType(Long value) { - set(1, value); - } - - /** - * Getter for public.issue.issue_description. - */ - public String getIssueDescription() { - return (String) get(2); - } - - /** - * Setter for public.issue.issue_description. - */ - public void setIssueDescription(String value) { - set(2, value); - } - - /** - * Getter for public.issue.auto_analyzed. - */ - public Boolean getAutoAnalyzed() { - return (Boolean) get(3); - } - - /** - * Setter for public.issue.auto_analyzed. - */ - public void setAutoAnalyzed(Boolean value) { - set(3, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.issue.ignore_analyzer. - */ - public Boolean getIgnoreAnalyzer() { - return (Boolean) get(4); - } - - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.issue.ignore_analyzer. - */ - public void setIgnoreAnalyzer(Boolean value) { - set(4, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } - - @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); - } - - @Override - public Field field1() { - return JIssue.ISSUE.ISSUE_ID; - } - - @Override - public Field field2() { - return JIssue.ISSUE.ISSUE_TYPE; - } - - @Override - public Field field3() { - return JIssue.ISSUE.ISSUE_DESCRIPTION; - } - - @Override - public Field field4() { - return JIssue.ISSUE.AUTO_ANALYZED; - } - - @Override - public Field field5() { - return JIssue.ISSUE.IGNORE_ANALYZER; - } - - @Override - public Long component1() { - return getIssueId(); - } - - @Override - public Long component2() { - return getIssueType(); - } - - @Override - public String component3() { - return getIssueDescription(); - } - - @Override - public Boolean component4() { - return getAutoAnalyzed(); - } - - @Override - public Boolean component5() { - return getIgnoreAnalyzer(); - } - - @Override - public Long value1() { - return getIssueId(); - } - - @Override - public Long value2() { - return getIssueType(); - } - - @Override - public String value3() { - return getIssueDescription(); - } - - @Override - public Boolean value4() { - return getAutoAnalyzed(); - } - - @Override - public Boolean value5() { - return getIgnoreAnalyzer(); - } - - @Override - public JIssueRecord value1(Long value) { - setIssueId(value); - return this; - } - - @Override - public JIssueRecord value2(Long value) { - setIssueType(value); - return this; - } - - @Override - public JIssueRecord value3(String value) { - setIssueDescription(value); - return this; - } - - @Override - public JIssueRecord value4(Boolean value) { - setAutoAnalyzed(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JIssueRecord value5(Boolean value) { - setIgnoreAnalyzer(value); - return this; - } - - @Override - public JIssueRecord values(Long value1, Long value2, String value3, Boolean value4, - Boolean value5) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JIssueRecord extends UpdatableRecordImpl implements Record5 { + + private static final long serialVersionUID = -1357499849; + + /** + * Setter for public.issue.issue_id. + */ + public void setIssueId(Long value) { + set(0, value); + } + + /** + * Getter for public.issue.issue_id. + */ + public Long getIssueId() { + return (Long) get(0); + } + + /** + * Setter for public.issue.issue_type. + */ + public void setIssueType(Long value) { + set(1, value); + } + + /** + * Getter for public.issue.issue_type. + */ + public Long getIssueType() { + return (Long) get(1); + } + + /** + * Setter for public.issue.issue_description. + */ + public void setIssueDescription(String value) { + set(2, value); + } + + /** + * Getter for public.issue.issue_description. + */ + public String getIssueDescription() { + return (String) get(2); + } + + /** + * Setter for public.issue.auto_analyzed. + */ + public void setAutoAnalyzed(Boolean value) { + set(3, value); + } + + /** + * Getter for public.issue.auto_analyzed. + */ + public Boolean getAutoAnalyzed() { + return (Boolean) get(3); + } + + /** + * Setter for public.issue.ignore_analyzer. + */ + public void setIgnoreAnalyzer(Boolean value) { + set(4, value); + } + + /** + * Getter for public.issue.ignore_analyzer. + */ + public Boolean getIgnoreAnalyzer() { + return (Boolean) get(4); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return JIssue.ISSUE.ISSUE_ID; + } + + @Override + public Field field2() { + return JIssue.ISSUE.ISSUE_TYPE; + } + + @Override + public Field field3() { + return JIssue.ISSUE.ISSUE_DESCRIPTION; + } + + @Override + public Field field4() { + return JIssue.ISSUE.AUTO_ANALYZED; + } + + @Override + public Field field5() { + return JIssue.ISSUE.IGNORE_ANALYZER; + } + + @Override + public Long component1() { + return getIssueId(); + } + + @Override + public Long component2() { + return getIssueType(); + } + + @Override + public String component3() { + return getIssueDescription(); + } + + @Override + public Boolean component4() { + return getAutoAnalyzed(); + } + + @Override + public Boolean component5() { + return getIgnoreAnalyzer(); + } + + @Override + public Long value1() { + return getIssueId(); + } + + @Override + public Long value2() { + return getIssueType(); + } + + @Override + public String value3() { + return getIssueDescription(); + } + + @Override + public Boolean value4() { + return getAutoAnalyzed(); + } + + @Override + public Boolean value5() { + return getIgnoreAnalyzer(); + } + + @Override + public JIssueRecord value1(Long value) { + setIssueId(value); + return this; + } + + @Override + public JIssueRecord value2(Long value) { + setIssueType(value); + return this; + } + + @Override + public JIssueRecord value3(String value) { + setIssueDescription(value); + return this; + } + + @Override + public JIssueRecord value4(Boolean value) { + setAutoAnalyzed(value); + return this; + } + + @Override + public JIssueRecord value5(Boolean value) { + setIgnoreAnalyzer(value); + return this; + } + + @Override + public JIssueRecord values(Long value1, Long value2, String value3, Boolean value4, Boolean value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JIssueRecord + */ + public JIssueRecord() { + super(JIssue.ISSUE); + } + + /** + * Create a detached, initialised JIssueRecord + */ + public JIssueRecord(Long issueId, Long issueType, String issueDescription, Boolean autoAnalyzed, Boolean ignoreAnalyzer) { + super(JIssue.ISSUE); + + set(0, issueId); + set(1, issueType); + set(2, issueDescription); + set(3, autoAnalyzed); + set(4, ignoreAnalyzer); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTicketRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTicketRecord.java old mode 100755 new mode 100644 index 3828dd97f..7f7b3719e --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTicketRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTicketRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JIssueTicket; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -22,130 +24,129 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JIssueTicketRecord extends UpdatableRecordImpl implements - Record2 { - - private static final long serialVersionUID = -755638091; - - /** - * Create a detached JIssueTicketRecord - */ - public JIssueTicketRecord() { - super(JIssueTicket.ISSUE_TICKET); - } - - /** - * Create a detached, initialised JIssueTicketRecord - */ - public JIssueTicketRecord(Long issueId, Long ticketId) { - super(JIssueTicket.ISSUE_TICKET); - - set(0, issueId); - set(1, ticketId); - } - - /** - * Getter for public.issue_ticket.issue_id. - */ - public Long getIssueId() { - return (Long) get(0); - } - - /** - * Setter for public.issue_ticket.issue_id. - */ - public void setIssueId(Long value) { - set(0, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.issue_ticket.ticket_id. - */ - public Long getTicketId() { - return (Long) get(1); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.issue_ticket.ticket_id. - */ - public void setTicketId(Long value) { - set(1, value); - } - - @Override - public Record2 key() { - return (Record2) super.key(); - } - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JIssueTicket.ISSUE_TICKET.ISSUE_ID; - } - - @Override - public Field field2() { - return JIssueTicket.ISSUE_TICKET.TICKET_ID; - } - - @Override - public Long component1() { - return getIssueId(); - } - - @Override - public Long component2() { - return getTicketId(); - } - - @Override - public Long value1() { - return getIssueId(); - } - - @Override - public Long value2() { - return getTicketId(); - } - - @Override - public JIssueTicketRecord value1(Long value) { - setIssueId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JIssueTicketRecord value2(Long value) { - setTicketId(value); - return this; - } - - @Override - public JIssueTicketRecord values(Long value1, Long value2) { - value1(value1); - value2(value2); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JIssueTicketRecord extends UpdatableRecordImpl implements Record2 { + + private static final long serialVersionUID = -755638091; + + /** + * Setter for public.issue_ticket.issue_id. + */ + public void setIssueId(Long value) { + set(0, value); + } + + /** + * Getter for public.issue_ticket.issue_id. + */ + public Long getIssueId() { + return (Long) get(0); + } + + /** + * Setter for public.issue_ticket.ticket_id. + */ + public void setTicketId(Long value) { + set(1, value); + } + + /** + * Getter for public.issue_ticket.ticket_id. + */ + public Long getTicketId() { + return (Long) get(1); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JIssueTicket.ISSUE_TICKET.ISSUE_ID; + } + + @Override + public Field field2() { + return JIssueTicket.ISSUE_TICKET.TICKET_ID; + } + + @Override + public Long component1() { + return getIssueId(); + } + + @Override + public Long component2() { + return getTicketId(); + } + + @Override + public Long value1() { + return getIssueId(); + } + + @Override + public Long value2() { + return getTicketId(); + } + + @Override + public JIssueTicketRecord value1(Long value) { + setIssueId(value); + return this; + } + + @Override + public JIssueTicketRecord value2(Long value) { + setTicketId(value); + return this; + } + + @Override + public JIssueTicketRecord values(Long value1, Long value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JIssueTicketRecord + */ + public JIssueTicketRecord() { + super(JIssueTicket.ISSUE_TICKET); + } + + /** + * Create a detached, initialised JIssueTicketRecord + */ + public JIssueTicketRecord(Long issueId, Long ticketId) { + super(JIssueTicket.ISSUE_TICKET); + + set(0, issueId); + set(1, ticketId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeProjectRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeProjectRecord.java index a8ff40847..f9d621758 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeProjectRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeProjectRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JIssueTypeProject; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -22,130 +24,129 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JIssueTypeProjectRecord extends UpdatableRecordImpl implements - Record2 { - - private static final long serialVersionUID = -272281122; - - /** - * Create a detached JIssueTypeProjectRecord - */ - public JIssueTypeProjectRecord() { - super(JIssueTypeProject.ISSUE_TYPE_PROJECT); - } - - /** - * Create a detached, initialised JIssueTypeProjectRecord - */ - public JIssueTypeProjectRecord(Long projectId, Long issueTypeId) { - super(JIssueTypeProject.ISSUE_TYPE_PROJECT); - - set(0, projectId); - set(1, issueTypeId); - } - - /** - * Getter for public.issue_type_project.project_id. - */ - public Long getProjectId() { - return (Long) get(0); - } - - /** - * Setter for public.issue_type_project.project_id. - */ - public void setProjectId(Long value) { - set(0, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.issue_type_project.issue_type_id. - */ - public Long getIssueTypeId() { - return (Long) get(1); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.issue_type_project.issue_type_id. - */ - public void setIssueTypeId(Long value) { - set(1, value); - } - - @Override - public Record2 key() { - return (Record2) super.key(); - } - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID; - } - - @Override - public Field field2() { - return JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID; - } - - @Override - public Long component1() { - return getProjectId(); - } - - @Override - public Long component2() { - return getIssueTypeId(); - } - - @Override - public Long value1() { - return getProjectId(); - } - - @Override - public Long value2() { - return getIssueTypeId(); - } - - @Override - public JIssueTypeProjectRecord value1(Long value) { - setProjectId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JIssueTypeProjectRecord value2(Long value) { - setIssueTypeId(value); - return this; - } - - @Override - public JIssueTypeProjectRecord values(Long value1, Long value2) { - value1(value1); - value2(value2); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JIssueTypeProjectRecord extends UpdatableRecordImpl implements Record2 { + + private static final long serialVersionUID = -272281122; + + /** + * Setter for public.issue_type_project.project_id. + */ + public void setProjectId(Long value) { + set(0, value); + } + + /** + * Getter for public.issue_type_project.project_id. + */ + public Long getProjectId() { + return (Long) get(0); + } + + /** + * Setter for public.issue_type_project.issue_type_id. + */ + public void setIssueTypeId(Long value) { + set(1, value); + } + + /** + * Getter for public.issue_type_project.issue_type_id. + */ + public Long getIssueTypeId() { + return (Long) get(1); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JIssueTypeProject.ISSUE_TYPE_PROJECT.PROJECT_ID; + } + + @Override + public Field field2() { + return JIssueTypeProject.ISSUE_TYPE_PROJECT.ISSUE_TYPE_ID; + } + + @Override + public Long component1() { + return getProjectId(); + } + + @Override + public Long component2() { + return getIssueTypeId(); + } + + @Override + public Long value1() { + return getProjectId(); + } + + @Override + public Long value2() { + return getIssueTypeId(); + } + + @Override + public JIssueTypeProjectRecord value1(Long value) { + setProjectId(value); + return this; + } + + @Override + public JIssueTypeProjectRecord value2(Long value) { + setIssueTypeId(value); + return this; + } + + @Override + public JIssueTypeProjectRecord values(Long value1, Long value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JIssueTypeProjectRecord + */ + public JIssueTypeProjectRecord() { + super(JIssueTypeProject.ISSUE_TYPE_PROJECT); + } + + /** + * Create a detached, initialised JIssueTypeProjectRecord + */ + public JIssueTypeProjectRecord(Long projectId, Long issueTypeId) { + super(JIssueTypeProject.ISSUE_TYPE_PROJECT); + + set(0, projectId); + set(1, issueTypeId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeRecord.java index eea23b87b..6cb851de7 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JIssueTypeRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JIssueType; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record6; @@ -23,280 +25,277 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JIssueTypeRecord extends UpdatableRecordImpl implements - Record6 { - - private static final long serialVersionUID = -1954908516; - - /** - * Create a detached JIssueTypeRecord - */ - public JIssueTypeRecord() { - super(JIssueType.ISSUE_TYPE); - } - - /** - * Create a detached, initialised JIssueTypeRecord - */ - public JIssueTypeRecord(Long id, Short issueGroupId, String locator, String issueName, - String abbreviation, String hexColor) { - super(JIssueType.ISSUE_TYPE); - - set(0, id); - set(1, issueGroupId); - set(2, locator); - set(3, issueName); - set(4, abbreviation); - set(5, hexColor); - } - - /** - * Getter for public.issue_type.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.issue_type.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.issue_type.issue_group_id. - */ - public Short getIssueGroupId() { - return (Short) get(1); - } - - /** - * Setter for public.issue_type.issue_group_id. - */ - public void setIssueGroupId(Short value) { - set(1, value); - } - - /** - * Getter for public.issue_type.locator. - */ - public String getLocator() { - return (String) get(2); - } - - /** - * Setter for public.issue_type.locator. - */ - public void setLocator(String value) { - set(2, value); - } - - /** - * Getter for public.issue_type.issue_name. - */ - public String getIssueName() { - return (String) get(3); - } - - /** - * Setter for public.issue_type.issue_name. - */ - public void setIssueName(String value) { - set(3, value); - } - - /** - * Getter for public.issue_type.abbreviation. - */ - public String getAbbreviation() { - return (String) get(4); - } - - /** - * Setter for public.issue_type.abbreviation. - */ - public void setAbbreviation(String value) { - set(4, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.issue_type.hex_color. - */ - public String getHexColor() { - return (String) get(5); - } - - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.issue_type.hex_color. - */ - public void setHexColor(String value) { - set(5, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return JIssueType.ISSUE_TYPE.ID; - } - - @Override - public Field field2() { - return JIssueType.ISSUE_TYPE.ISSUE_GROUP_ID; - } - - @Override - public Field field3() { - return JIssueType.ISSUE_TYPE.LOCATOR; - } - - @Override - public Field field4() { - return JIssueType.ISSUE_TYPE.ISSUE_NAME; - } - - @Override - public Field field5() { - return JIssueType.ISSUE_TYPE.ABBREVIATION; - } - - @Override - public Field field6() { - return JIssueType.ISSUE_TYPE.HEX_COLOR; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Short component2() { - return getIssueGroupId(); - } - - @Override - public String component3() { - return getLocator(); - } - - @Override - public String component4() { - return getIssueName(); - } - - @Override - public String component5() { - return getAbbreviation(); - } - - @Override - public String component6() { - return getHexColor(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Short value2() { - return getIssueGroupId(); - } - - @Override - public String value3() { - return getLocator(); - } - - @Override - public String value4() { - return getIssueName(); - } - - @Override - public String value5() { - return getAbbreviation(); - } - - @Override - public String value6() { - return getHexColor(); - } - - @Override - public JIssueTypeRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JIssueTypeRecord value2(Short value) { - setIssueGroupId(value); - return this; - } - - @Override - public JIssueTypeRecord value3(String value) { - setLocator(value); - return this; - } - - @Override - public JIssueTypeRecord value4(String value) { - setIssueName(value); - return this; - } - - @Override - public JIssueTypeRecord value5(String value) { - setAbbreviation(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JIssueTypeRecord value6(String value) { - setHexColor(value); - return this; - } - - @Override - public JIssueTypeRecord values(Long value1, Short value2, String value3, String value4, - String value5, String value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JIssueTypeRecord extends UpdatableRecordImpl implements Record6 { + + private static final long serialVersionUID = -1954908516; + + /** + * Setter for public.issue_type.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.issue_type.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.issue_type.issue_group_id. + */ + public void setIssueGroupId(Short value) { + set(1, value); + } + + /** + * Getter for public.issue_type.issue_group_id. + */ + public Short getIssueGroupId() { + return (Short) get(1); + } + + /** + * Setter for public.issue_type.locator. + */ + public void setLocator(String value) { + set(2, value); + } + + /** + * Getter for public.issue_type.locator. + */ + public String getLocator() { + return (String) get(2); + } + + /** + * Setter for public.issue_type.issue_name. + */ + public void setIssueName(String value) { + set(3, value); + } + + /** + * Getter for public.issue_type.issue_name. + */ + public String getIssueName() { + return (String) get(3); + } + + /** + * Setter for public.issue_type.abbreviation. + */ + public void setAbbreviation(String value) { + set(4, value); + } + + /** + * Getter for public.issue_type.abbreviation. + */ + public String getAbbreviation() { + return (String) get(4); + } + + /** + * Setter for public.issue_type.hex_color. + */ + public void setHexColor(String value) { + set(5, value); + } + + /** + * Getter for public.issue_type.hex_color. + */ + public String getHexColor() { + return (String) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return JIssueType.ISSUE_TYPE.ID; + } + + @Override + public Field field2() { + return JIssueType.ISSUE_TYPE.ISSUE_GROUP_ID; + } + + @Override + public Field field3() { + return JIssueType.ISSUE_TYPE.LOCATOR; + } + + @Override + public Field field4() { + return JIssueType.ISSUE_TYPE.ISSUE_NAME; + } + + @Override + public Field field5() { + return JIssueType.ISSUE_TYPE.ABBREVIATION; + } + + @Override + public Field field6() { + return JIssueType.ISSUE_TYPE.HEX_COLOR; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Short component2() { + return getIssueGroupId(); + } + + @Override + public String component3() { + return getLocator(); + } + + @Override + public String component4() { + return getIssueName(); + } + + @Override + public String component5() { + return getAbbreviation(); + } + + @Override + public String component6() { + return getHexColor(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Short value2() { + return getIssueGroupId(); + } + + @Override + public String value3() { + return getLocator(); + } + + @Override + public String value4() { + return getIssueName(); + } + + @Override + public String value5() { + return getAbbreviation(); + } + + @Override + public String value6() { + return getHexColor(); + } + + @Override + public JIssueTypeRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JIssueTypeRecord value2(Short value) { + setIssueGroupId(value); + return this; + } + + @Override + public JIssueTypeRecord value3(String value) { + setLocator(value); + return this; + } + + @Override + public JIssueTypeRecord value4(String value) { + setIssueName(value); + return this; + } + + @Override + public JIssueTypeRecord value5(String value) { + setAbbreviation(value); + return this; + } + + @Override + public JIssueTypeRecord value6(String value) { + setHexColor(value); + return this; + } + + @Override + public JIssueTypeRecord values(Long value1, Short value2, String value3, String value4, String value5, String value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JIssueTypeRecord + */ + public JIssueTypeRecord() { + super(JIssueType.ISSUE_TYPE); + } + + /** + * Create a detached, initialised JIssueTypeRecord + */ + public JIssueTypeRecord(Long id, Short issueGroupId, String locator, String issueName, String abbreviation, String hexColor) { + super(JIssueType.ISSUE_TYPE); + + set(0, id); + set(1, issueGroupId); + set(2, locator); + set(3, issueName); + set(4, abbreviation); + set(5, hexColor); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JItemAttributeRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JItemAttributeRecord.java index 29055fe44..1c979a008 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JItemAttributeRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JItemAttributeRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JItemAttribute; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record6; @@ -23,280 +25,277 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JItemAttributeRecord extends UpdatableRecordImpl implements - Record6 { - - private static final long serialVersionUID = 1975199970; - - /** - * Create a detached JItemAttributeRecord - */ - public JItemAttributeRecord() { - super(JItemAttribute.ITEM_ATTRIBUTE); - } - - /** - * Create a detached, initialised JItemAttributeRecord - */ - public JItemAttributeRecord(Long id, String key, String value, Long itemId, Long launchId, - Boolean system) { - super(JItemAttribute.ITEM_ATTRIBUTE); - - set(0, id); - set(1, key); - set(2, value); - set(3, itemId); - set(4, launchId); - set(5, system); - } - - /** - * Getter for public.item_attribute.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.item_attribute.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.item_attribute.key. - */ - public String getKey() { - return (String) get(1); - } - - /** - * Setter for public.item_attribute.key. - */ - public void setKey(String value) { - set(1, value); - } - - /** - * Getter for public.item_attribute.value. - */ - public String getValue() { - return (String) get(2); - } - - /** - * Setter for public.item_attribute.value. - */ - public void setValue(String value) { - set(2, value); - } - - /** - * Getter for public.item_attribute.item_id. - */ - public Long getItemId() { - return (Long) get(3); - } - - /** - * Setter for public.item_attribute.item_id. - */ - public void setItemId(Long value) { - set(3, value); - } - - /** - * Getter for public.item_attribute.launch_id. - */ - public Long getLaunchId() { - return (Long) get(4); - } - - /** - * Setter for public.item_attribute.launch_id. - */ - public void setLaunchId(Long value) { - set(4, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.item_attribute.system. - */ - public Boolean getSystem() { - return (Boolean) get(5); - } - - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.item_attribute.system. - */ - public void setSystem(Boolean value) { - set(5, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return JItemAttribute.ITEM_ATTRIBUTE.ID; - } - - @Override - public Field field2() { - return JItemAttribute.ITEM_ATTRIBUTE.KEY; - } - - @Override - public Field field3() { - return JItemAttribute.ITEM_ATTRIBUTE.VALUE; - } - - @Override - public Field field4() { - return JItemAttribute.ITEM_ATTRIBUTE.ITEM_ID; - } - - @Override - public Field field5() { - return JItemAttribute.ITEM_ATTRIBUTE.LAUNCH_ID; - } - - @Override - public Field field6() { - return JItemAttribute.ITEM_ATTRIBUTE.SYSTEM; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getKey(); - } - - @Override - public String component3() { - return getValue(); - } - - @Override - public Long component4() { - return getItemId(); - } - - @Override - public Long component5() { - return getLaunchId(); - } - - @Override - public Boolean component6() { - return getSystem(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getKey(); - } - - @Override - public String value3() { - return getValue(); - } - - @Override - public Long value4() { - return getItemId(); - } - - @Override - public Long value5() { - return getLaunchId(); - } - - @Override - public Boolean value6() { - return getSystem(); - } - - @Override - public JItemAttributeRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JItemAttributeRecord value2(String value) { - setKey(value); - return this; - } - - @Override - public JItemAttributeRecord value3(String value) { - setValue(value); - return this; - } - - @Override - public JItemAttributeRecord value4(Long value) { - setItemId(value); - return this; - } - - @Override - public JItemAttributeRecord value5(Long value) { - setLaunchId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JItemAttributeRecord value6(Boolean value) { - setSystem(value); - return this; - } - - @Override - public JItemAttributeRecord values(Long value1, String value2, String value3, Long value4, - Long value5, Boolean value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JItemAttributeRecord extends UpdatableRecordImpl implements Record6 { + + private static final long serialVersionUID = 1975199970; + + /** + * Setter for public.item_attribute.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.item_attribute.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.item_attribute.key. + */ + public void setKey(String value) { + set(1, value); + } + + /** + * Getter for public.item_attribute.key. + */ + public String getKey() { + return (String) get(1); + } + + /** + * Setter for public.item_attribute.value. + */ + public void setValue(String value) { + set(2, value); + } + + /** + * Getter for public.item_attribute.value. + */ + public String getValue() { + return (String) get(2); + } + + /** + * Setter for public.item_attribute.item_id. + */ + public void setItemId(Long value) { + set(3, value); + } + + /** + * Getter for public.item_attribute.item_id. + */ + public Long getItemId() { + return (Long) get(3); + } + + /** + * Setter for public.item_attribute.launch_id. + */ + public void setLaunchId(Long value) { + set(4, value); + } + + /** + * Getter for public.item_attribute.launch_id. + */ + public Long getLaunchId() { + return (Long) get(4); + } + + /** + * Setter for public.item_attribute.system. + */ + public void setSystem(Boolean value) { + set(5, value); + } + + /** + * Getter for public.item_attribute.system. + */ + public Boolean getSystem() { + return (Boolean) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return JItemAttribute.ITEM_ATTRIBUTE.ID; + } + + @Override + public Field field2() { + return JItemAttribute.ITEM_ATTRIBUTE.KEY; + } + + @Override + public Field field3() { + return JItemAttribute.ITEM_ATTRIBUTE.VALUE; + } + + @Override + public Field field4() { + return JItemAttribute.ITEM_ATTRIBUTE.ITEM_ID; + } + + @Override + public Field field5() { + return JItemAttribute.ITEM_ATTRIBUTE.LAUNCH_ID; + } + + @Override + public Field field6() { + return JItemAttribute.ITEM_ATTRIBUTE.SYSTEM; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getKey(); + } + + @Override + public String component3() { + return getValue(); + } + + @Override + public Long component4() { + return getItemId(); + } + + @Override + public Long component5() { + return getLaunchId(); + } + + @Override + public Boolean component6() { + return getSystem(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getKey(); + } + + @Override + public String value3() { + return getValue(); + } + + @Override + public Long value4() { + return getItemId(); + } + + @Override + public Long value5() { + return getLaunchId(); + } + + @Override + public Boolean value6() { + return getSystem(); + } + + @Override + public JItemAttributeRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JItemAttributeRecord value2(String value) { + setKey(value); + return this; + } + + @Override + public JItemAttributeRecord value3(String value) { + setValue(value); + return this; + } + + @Override + public JItemAttributeRecord value4(Long value) { + setItemId(value); + return this; + } + + @Override + public JItemAttributeRecord value5(Long value) { + setLaunchId(value); + return this; + } + + @Override + public JItemAttributeRecord value6(Boolean value) { + setSystem(value); + return this; + } + + @Override + public JItemAttributeRecord values(Long value1, String value2, String value3, Long value4, Long value5, Boolean value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JItemAttributeRecord + */ + public JItemAttributeRecord() { + super(JItemAttribute.ITEM_ATTRIBUTE); + } + + /** + * Create a detached, initialised JItemAttributeRecord + */ + public JItemAttributeRecord(Long id, String key, String value, Long itemId, Long launchId, Boolean system) { + super(JItemAttribute.ITEM_ATTRIBUTE); + + set(0, id); + set(1, key); + set(2, value); + set(3, itemId); + set(4, launchId); + set(5, system); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchAttributeRulesRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchAttributeRulesRecord.java old mode 100755 new mode 100644 index 204bf45a5..5b7d4ae19 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchAttributeRulesRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchAttributeRulesRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JLaunchAttributeRules; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -23,206 +25,203 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JLaunchAttributeRulesRecord extends - UpdatableRecordImpl implements - Record4 { - - private static final long serialVersionUID = -95178244; - - /** - * Create a detached JLaunchAttributeRulesRecord - */ - public JLaunchAttributeRulesRecord() { - super(JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES); - } - - /** - * Create a detached, initialised JLaunchAttributeRulesRecord - */ - public JLaunchAttributeRulesRecord(Long id, Long senderCaseId, String key, String value) { - super(JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES); - - set(0, id); - set(1, senderCaseId); - set(2, key); - set(3, value); - } - - /** - * Getter for public.launch_attribute_rules.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.launch_attribute_rules.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.launch_attribute_rules.sender_case_id. - */ - public Long getSenderCaseId() { - return (Long) get(1); - } - - /** - * Setter for public.launch_attribute_rules.sender_case_id. - */ - public void setSenderCaseId(Long value) { - set(1, value); - } - - /** - * Getter for public.launch_attribute_rules.key. - */ - public String getKey() { - return (String) get(2); - } - - /** - * Setter for public.launch_attribute_rules.key. - */ - public void setKey(String value) { - set(2, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.launch_attribute_rules.value. - */ - public String getValue() { - return (String) get(3); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.launch_attribute_rules.value. - */ - public void setValue(String value) { - set(3, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID; - } - - @Override - public Field field2() { - return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.SENDER_CASE_ID; - } - - @Override - public Field field3() { - return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.KEY; - } - - @Override - public Field field4() { - return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.VALUE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getSenderCaseId(); - } - - @Override - public String component3() { - return getKey(); - } - - @Override - public String component4() { - return getValue(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getSenderCaseId(); - } - - @Override - public String value3() { - return getKey(); - } - - @Override - public String value4() { - return getValue(); - } - - @Override - public JLaunchAttributeRulesRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JLaunchAttributeRulesRecord value2(Long value) { - setSenderCaseId(value); - return this; - } - - @Override - public JLaunchAttributeRulesRecord value3(String value) { - setKey(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JLaunchAttributeRulesRecord value4(String value) { - setValue(value); - return this; - } - - @Override - public JLaunchAttributeRulesRecord values(Long value1, Long value2, String value3, - String value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JLaunchAttributeRulesRecord extends UpdatableRecordImpl implements Record4 { + + private static final long serialVersionUID = -95178244; + + /** + * Setter for public.launch_attribute_rules.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.launch_attribute_rules.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.launch_attribute_rules.sender_case_id. + */ + public void setSenderCaseId(Long value) { + set(1, value); + } + + /** + * Getter for public.launch_attribute_rules.sender_case_id. + */ + public Long getSenderCaseId() { + return (Long) get(1); + } + + /** + * Setter for public.launch_attribute_rules.key. + */ + public void setKey(String value) { + set(2, value); + } + + /** + * Getter for public.launch_attribute_rules.key. + */ + public String getKey() { + return (String) get(2); + } + + /** + * Setter for public.launch_attribute_rules.value. + */ + public void setValue(String value) { + set(3, value); + } + + /** + * Getter for public.launch_attribute_rules.value. + */ + public String getValue() { + return (String) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID; + } + + @Override + public Field field2() { + return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.SENDER_CASE_ID; + } + + @Override + public Field field3() { + return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.KEY; + } + + @Override + public Field field4() { + return JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.VALUE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getSenderCaseId(); + } + + @Override + public String component3() { + return getKey(); + } + + @Override + public String component4() { + return getValue(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getSenderCaseId(); + } + + @Override + public String value3() { + return getKey(); + } + + @Override + public String value4() { + return getValue(); + } + + @Override + public JLaunchAttributeRulesRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JLaunchAttributeRulesRecord value2(Long value) { + setSenderCaseId(value); + return this; + } + + @Override + public JLaunchAttributeRulesRecord value3(String value) { + setKey(value); + return this; + } + + @Override + public JLaunchAttributeRulesRecord value4(String value) { + setValue(value); + return this; + } + + @Override + public JLaunchAttributeRulesRecord values(Long value1, Long value2, String value3, String value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JLaunchAttributeRulesRecord + */ + public JLaunchAttributeRulesRecord() { + super(JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES); + } + + /** + * Create a detached, initialised JLaunchAttributeRulesRecord + */ + public JLaunchAttributeRulesRecord(Long id, Long senderCaseId, String key, String value) { + super(JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES); + + set(0, id); + set(1, senderCaseId); + set(2, key); + set(3, value); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNamesRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNamesRecord.java index c045d55b3..7e2283a23 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNamesRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNamesRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JLaunchNames; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -22,121 +24,120 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JLaunchNamesRecord extends TableRecordImpl implements - Record2 { - - private static final long serialVersionUID = -1168746037; - - /** - * Create a detached JLaunchNamesRecord - */ - public JLaunchNamesRecord() { - super(JLaunchNames.LAUNCH_NAMES); - } - - /** - * Create a detached, initialised JLaunchNamesRecord - */ - public JLaunchNamesRecord(Long senderCaseId, String launchName) { - super(JLaunchNames.LAUNCH_NAMES); - - set(0, senderCaseId); - set(1, launchName); - } - - /** - * Getter for public.launch_names.sender_case_id. - */ - public Long getSenderCaseId() { - return (Long) get(0); - } - - /** - * Setter for public.launch_names.sender_case_id. - */ - public void setSenderCaseId(Long value) { - set(0, value); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - /** - * Getter for public.launch_names.launch_name. - */ - public String getLaunchName() { - return (String) get(1); - } - - /** - * Setter for public.launch_names.launch_name. - */ - public void setLaunchName(String value) { - set(1, value); - } - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JLaunchNames.LAUNCH_NAMES.SENDER_CASE_ID; - } - - @Override - public Field field2() { - return JLaunchNames.LAUNCH_NAMES.LAUNCH_NAME; - } - - @Override - public Long component1() { - return getSenderCaseId(); - } - - @Override - public String component2() { - return getLaunchName(); - } - - @Override - public Long value1() { - return getSenderCaseId(); - } - - @Override - public String value2() { - return getLaunchName(); - } - - @Override - public JLaunchNamesRecord value1(Long value) { - setSenderCaseId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JLaunchNamesRecord value2(String value) { - setLaunchName(value); - return this; - } - - @Override - public JLaunchNamesRecord values(Long value1, String value2) { - value1(value1); - value2(value2); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JLaunchNamesRecord extends TableRecordImpl implements Record2 { + + private static final long serialVersionUID = -1168746037; + + /** + * Setter for public.launch_names.sender_case_id. + */ + public void setSenderCaseId(Long value) { + set(0, value); + } + + /** + * Getter for public.launch_names.sender_case_id. + */ + public Long getSenderCaseId() { + return (Long) get(0); + } + + /** + * Setter for public.launch_names.launch_name. + */ + public void setLaunchName(String value) { + set(1, value); + } + + /** + * Getter for public.launch_names.launch_name. + */ + public String getLaunchName() { + return (String) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JLaunchNames.LAUNCH_NAMES.SENDER_CASE_ID; + } + + @Override + public Field field2() { + return JLaunchNames.LAUNCH_NAMES.LAUNCH_NAME; + } + + @Override + public Long component1() { + return getSenderCaseId(); + } + + @Override + public String component2() { + return getLaunchName(); + } + + @Override + public Long value1() { + return getSenderCaseId(); + } + + @Override + public String value2() { + return getLaunchName(); + } + + @Override + public JLaunchNamesRecord value1(Long value) { + setSenderCaseId(value); + return this; + } + + @Override + public JLaunchNamesRecord value2(String value) { + setLaunchName(value); + return this; + } + + @Override + public JLaunchNamesRecord values(Long value1, String value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JLaunchNamesRecord + */ + public JLaunchNamesRecord() { + super(JLaunchNames.LAUNCH_NAMES); + } + + /** + * Create a detached, initialised JLaunchNamesRecord + */ + public JLaunchNamesRecord(Long senderCaseId, String launchName) { + super(JLaunchNames.LAUNCH_NAMES); + + set(0, senderCaseId); + set(1, launchName); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNumberRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNumberRecord.java index 86c37d81b..fba7c8831 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNumberRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchNumberRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -23,204 +25,203 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JLaunchNumberRecord extends UpdatableRecordImpl implements - Record4 { - - private static final long serialVersionUID = -1978268674; - - /** - * Create a detached JLaunchNumberRecord - */ - public JLaunchNumberRecord() { - super(JLaunchNumber.LAUNCH_NUMBER); - } - - /** - * Create a detached, initialised JLaunchNumberRecord - */ - public JLaunchNumberRecord(Long id, Long projectId, String launchName, Integer number) { - super(JLaunchNumber.LAUNCH_NUMBER); - - set(0, id); - set(1, projectId); - set(2, launchName); - set(3, number); - } - - /** - * Getter for public.launch_number.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.launch_number.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.launch_number.project_id. - */ - public Long getProjectId() { - return (Long) get(1); - } - - /** - * Setter for public.launch_number.project_id. - */ - public void setProjectId(Long value) { - set(1, value); - } - - /** - * Getter for public.launch_number.launch_name. - */ - public String getLaunchName() { - return (String) get(2); - } - - /** - * Setter for public.launch_number.launch_name. - */ - public void setLaunchName(String value) { - set(2, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.launch_number.number. - */ - public Integer getNumber() { - return (Integer) get(3); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.launch_number.number. - */ - public void setNumber(Integer value) { - set(3, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JLaunchNumber.LAUNCH_NUMBER.ID; - } - - @Override - public Field field2() { - return JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID; - } - - @Override - public Field field3() { - return JLaunchNumber.LAUNCH_NUMBER.LAUNCH_NAME; - } - - @Override - public Field field4() { - return JLaunchNumber.LAUNCH_NUMBER.NUMBER; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getProjectId(); - } - - @Override - public String component3() { - return getLaunchName(); - } - - @Override - public Integer component4() { - return getNumber(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getProjectId(); - } - - @Override - public String value3() { - return getLaunchName(); - } - - @Override - public Integer value4() { - return getNumber(); - } - - @Override - public JLaunchNumberRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JLaunchNumberRecord value2(Long value) { - setProjectId(value); - return this; - } - - @Override - public JLaunchNumberRecord value3(String value) { - setLaunchName(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JLaunchNumberRecord value4(Integer value) { - setNumber(value); - return this; - } - - @Override - public JLaunchNumberRecord values(Long value1, Long value2, String value3, Integer value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JLaunchNumberRecord extends UpdatableRecordImpl implements Record4 { + + private static final long serialVersionUID = -1978268674; + + /** + * Setter for public.launch_number.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.launch_number.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.launch_number.project_id. + */ + public void setProjectId(Long value) { + set(1, value); + } + + /** + * Getter for public.launch_number.project_id. + */ + public Long getProjectId() { + return (Long) get(1); + } + + /** + * Setter for public.launch_number.launch_name. + */ + public void setLaunchName(String value) { + set(2, value); + } + + /** + * Getter for public.launch_number.launch_name. + */ + public String getLaunchName() { + return (String) get(2); + } + + /** + * Setter for public.launch_number.number. + */ + public void setNumber(Integer value) { + set(3, value); + } + + /** + * Getter for public.launch_number.number. + */ + public Integer getNumber() { + return (Integer) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JLaunchNumber.LAUNCH_NUMBER.ID; + } + + @Override + public Field field2() { + return JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID; + } + + @Override + public Field field3() { + return JLaunchNumber.LAUNCH_NUMBER.LAUNCH_NAME; + } + + @Override + public Field field4() { + return JLaunchNumber.LAUNCH_NUMBER.NUMBER; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getProjectId(); + } + + @Override + public String component3() { + return getLaunchName(); + } + + @Override + public Integer component4() { + return getNumber(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getProjectId(); + } + + @Override + public String value3() { + return getLaunchName(); + } + + @Override + public Integer value4() { + return getNumber(); + } + + @Override + public JLaunchNumberRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JLaunchNumberRecord value2(Long value) { + setProjectId(value); + return this; + } + + @Override + public JLaunchNumberRecord value3(String value) { + setLaunchName(value); + return this; + } + + @Override + public JLaunchNumberRecord value4(Integer value) { + setNumber(value); + return this; + } + + @Override + public JLaunchNumberRecord values(Long value1, Long value2, String value3, Integer value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JLaunchNumberRecord + */ + public JLaunchNumberRecord() { + super(JLaunchNumber.LAUNCH_NUMBER); + } + + /** + * Create a detached, initialised JLaunchNumberRecord + */ + public JLaunchNumberRecord(Long id, Long projectId, String launchName, Integer number) { + super(JLaunchNumber.LAUNCH_NUMBER); + + set(0, id); + set(1, projectId); + set(2, launchName); + set(3, number); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchRecord.java index c7ac0a183..836b343c3 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLaunchRecord.java @@ -7,8 +7,11 @@ import com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum; import com.epam.ta.reportportal.jooq.enums.JStatusEnum; import com.epam.ta.reportportal.jooq.tables.JLaunch; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record15; @@ -26,617 +29,610 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JLaunchRecord extends UpdatableRecordImpl implements - Record15 { - - private static final long serialVersionUID = 2143234608; - - /** - * Create a detached JLaunchRecord - */ - public JLaunchRecord() { - super(JLaunch.LAUNCH); - } - - /** - * Create a detached, initialised JLaunchRecord - */ - public JLaunchRecord(Long id, String uuid, Long projectId, Long userId, String name, - String description, Timestamp startTime, Timestamp endTime, Integer number, - Timestamp lastModified, JLaunchModeEnum mode, JStatusEnum status, Boolean hasRetries, - Boolean rerun, Double approximateDuration) { - super(JLaunch.LAUNCH); - - set(0, id); - set(1, uuid); - set(2, projectId); - set(3, userId); - set(4, name); - set(5, description); - set(6, startTime); - set(7, endTime); - set(8, number); - set(9, lastModified); - set(10, mode); - set(11, status); - set(12, hasRetries); - set(13, rerun); - set(14, approximateDuration); - } - - /** - * Getter for public.launch.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.launch.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.launch.uuid. - */ - public String getUuid() { - return (String) get(1); - } - - /** - * Setter for public.launch.uuid. - */ - public void setUuid(String value) { - set(1, value); - } - - /** - * Getter for public.launch.project_id. - */ - public Long getProjectId() { - return (Long) get(2); - } - - /** - * Setter for public.launch.project_id. - */ - public void setProjectId(Long value) { - set(2, value); - } - - /** - * Getter for public.launch.user_id. - */ - public Long getUserId() { - return (Long) get(3); - } - - /** - * Setter for public.launch.user_id. - */ - public void setUserId(Long value) { - set(3, value); - } - - /** - * Getter for public.launch.name. - */ - public String getName() { - return (String) get(4); - } - - /** - * Setter for public.launch.name. - */ - public void setName(String value) { - set(4, value); - } - - /** - * Getter for public.launch.description. - */ - public String getDescription() { - return (String) get(5); - } - - /** - * Setter for public.launch.description. - */ - public void setDescription(String value) { - set(5, value); - } - - /** - * Getter for public.launch.start_time. - */ - public Timestamp getStartTime() { - return (Timestamp) get(6); - } - - /** - * Setter for public.launch.start_time. - */ - public void setStartTime(Timestamp value) { - set(6, value); - } - - /** - * Getter for public.launch.end_time. - */ - public Timestamp getEndTime() { - return (Timestamp) get(7); - } - - /** - * Setter for public.launch.end_time. - */ - public void setEndTime(Timestamp value) { - set(7, value); - } - - /** - * Getter for public.launch.number. - */ - public Integer getNumber() { - return (Integer) get(8); - } - - /** - * Setter for public.launch.number. - */ - public void setNumber(Integer value) { - set(8, value); - } - - /** - * Getter for public.launch.last_modified. - */ - public Timestamp getLastModified() { - return (Timestamp) get(9); - } - - /** - * Setter for public.launch.last_modified. - */ - public void setLastModified(Timestamp value) { - set(9, value); - } - - /** - * Getter for public.launch.mode. - */ - public JLaunchModeEnum getMode() { - return (JLaunchModeEnum) get(10); - } - - /** - * Setter for public.launch.mode. - */ - public void setMode(JLaunchModeEnum value) { - set(10, value); - } - - /** - * Getter for public.launch.status. - */ - public JStatusEnum getStatus() { - return (JStatusEnum) get(11); - } - - /** - * Setter for public.launch.status. - */ - public void setStatus(JStatusEnum value) { - set(11, value); - } - - /** - * Getter for public.launch.has_retries. - */ - public Boolean getHasRetries() { - return (Boolean) get(12); - } - - /** - * Setter for public.launch.has_retries. - */ - public void setHasRetries(Boolean value) { - set(12, value); - } - - /** - * Getter for public.launch.rerun. - */ - public Boolean getRerun() { - return (Boolean) get(13); - } - - /** - * Setter for public.launch.rerun. - */ - public void setRerun(Boolean value) { - set(13, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.launch.approximate_duration. - */ - public Double getApproximateDuration() { - return (Double) get(14); - } - - // ------------------------------------------------------------------------- - // Record15 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.launch.approximate_duration. - */ - public void setApproximateDuration(Double value) { - set(14, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row15 fieldsRow() { - return (Row15) super.fieldsRow(); - } - - @Override - public Row15 valuesRow() { - return (Row15) super.valuesRow(); - } - - @Override - public Field field1() { - return JLaunch.LAUNCH.ID; - } - - @Override - public Field field2() { - return JLaunch.LAUNCH.UUID; - } - - @Override - public Field field3() { - return JLaunch.LAUNCH.PROJECT_ID; - } - - @Override - public Field field4() { - return JLaunch.LAUNCH.USER_ID; - } - - @Override - public Field field5() { - return JLaunch.LAUNCH.NAME; - } - - @Override - public Field field6() { - return JLaunch.LAUNCH.DESCRIPTION; - } - - @Override - public Field field7() { - return JLaunch.LAUNCH.START_TIME; - } - - @Override - public Field field8() { - return JLaunch.LAUNCH.END_TIME; - } - - @Override - public Field field9() { - return JLaunch.LAUNCH.NUMBER; - } - - @Override - public Field field10() { - return JLaunch.LAUNCH.LAST_MODIFIED; - } - - @Override - public Field field11() { - return JLaunch.LAUNCH.MODE; - } - - @Override - public Field field12() { - return JLaunch.LAUNCH.STATUS; - } - - @Override - public Field field13() { - return JLaunch.LAUNCH.HAS_RETRIES; - } - - @Override - public Field field14() { - return JLaunch.LAUNCH.RERUN; - } - - @Override - public Field field15() { - return JLaunch.LAUNCH.APPROXIMATE_DURATION; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getUuid(); - } - - @Override - public Long component3() { - return getProjectId(); - } - - @Override - public Long component4() { - return getUserId(); - } - - @Override - public String component5() { - return getName(); - } - - @Override - public String component6() { - return getDescription(); - } - - @Override - public Timestamp component7() { - return getStartTime(); - } - - @Override - public Timestamp component8() { - return getEndTime(); - } - - @Override - public Integer component9() { - return getNumber(); - } - - @Override - public Timestamp component10() { - return getLastModified(); - } - - @Override - public JLaunchModeEnum component11() { - return getMode(); - } - - @Override - public JStatusEnum component12() { - return getStatus(); - } - - @Override - public Boolean component13() { - return getHasRetries(); - } - - @Override - public Boolean component14() { - return getRerun(); - } - - @Override - public Double component15() { - return getApproximateDuration(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getUuid(); - } - - @Override - public Long value3() { - return getProjectId(); - } - - @Override - public Long value4() { - return getUserId(); - } - - @Override - public String value5() { - return getName(); - } - - @Override - public String value6() { - return getDescription(); - } - - @Override - public Timestamp value7() { - return getStartTime(); - } - - @Override - public Timestamp value8() { - return getEndTime(); - } - - @Override - public Integer value9() { - return getNumber(); - } - - @Override - public Timestamp value10() { - return getLastModified(); - } - - @Override - public JLaunchModeEnum value11() { - return getMode(); - } - - @Override - public JStatusEnum value12() { - return getStatus(); - } - - @Override - public Boolean value13() { - return getHasRetries(); - } - - @Override - public Boolean value14() { - return getRerun(); - } - - @Override - public Double value15() { - return getApproximateDuration(); - } - - @Override - public JLaunchRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JLaunchRecord value2(String value) { - setUuid(value); - return this; - } - - @Override - public JLaunchRecord value3(Long value) { - setProjectId(value); - return this; - } - - @Override - public JLaunchRecord value4(Long value) { - setUserId(value); - return this; - } - - @Override - public JLaunchRecord value5(String value) { - setName(value); - return this; - } - - @Override - public JLaunchRecord value6(String value) { - setDescription(value); - return this; - } - - @Override - public JLaunchRecord value7(Timestamp value) { - setStartTime(value); - return this; - } - - @Override - public JLaunchRecord value8(Timestamp value) { - setEndTime(value); - return this; - } - - @Override - public JLaunchRecord value9(Integer value) { - setNumber(value); - return this; - } - - @Override - public JLaunchRecord value10(Timestamp value) { - setLastModified(value); - return this; - } - - @Override - public JLaunchRecord value11(JLaunchModeEnum value) { - setMode(value); - return this; - } - - @Override - public JLaunchRecord value12(JStatusEnum value) { - setStatus(value); - return this; - } - - @Override - public JLaunchRecord value13(Boolean value) { - setHasRetries(value); - return this; - } - - @Override - public JLaunchRecord value14(Boolean value) { - setRerun(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JLaunchRecord value15(Double value) { - setApproximateDuration(value); - return this; - } - - @Override - public JLaunchRecord values(Long value1, String value2, Long value3, Long value4, String value5, - String value6, Timestamp value7, Timestamp value8, Integer value9, Timestamp value10, - JLaunchModeEnum value11, JStatusEnum value12, Boolean value13, Boolean value14, - Double value15) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - value12(value12); - value13(value13); - value14(value14); - value15(value15); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JLaunchRecord extends UpdatableRecordImpl implements Record15 { + + private static final long serialVersionUID = 2143234608; + + /** + * Setter for public.launch.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.launch.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.launch.uuid. + */ + public void setUuid(String value) { + set(1, value); + } + + /** + * Getter for public.launch.uuid. + */ + public String getUuid() { + return (String) get(1); + } + + /** + * Setter for public.launch.project_id. + */ + public void setProjectId(Long value) { + set(2, value); + } + + /** + * Getter for public.launch.project_id. + */ + public Long getProjectId() { + return (Long) get(2); + } + + /** + * Setter for public.launch.user_id. + */ + public void setUserId(Long value) { + set(3, value); + } + + /** + * Getter for public.launch.user_id. + */ + public Long getUserId() { + return (Long) get(3); + } + + /** + * Setter for public.launch.name. + */ + public void setName(String value) { + set(4, value); + } + + /** + * Getter for public.launch.name. + */ + public String getName() { + return (String) get(4); + } + + /** + * Setter for public.launch.description. + */ + public void setDescription(String value) { + set(5, value); + } + + /** + * Getter for public.launch.description. + */ + public String getDescription() { + return (String) get(5); + } + + /** + * Setter for public.launch.start_time. + */ + public void setStartTime(Timestamp value) { + set(6, value); + } + + /** + * Getter for public.launch.start_time. + */ + public Timestamp getStartTime() { + return (Timestamp) get(6); + } + + /** + * Setter for public.launch.end_time. + */ + public void setEndTime(Timestamp value) { + set(7, value); + } + + /** + * Getter for public.launch.end_time. + */ + public Timestamp getEndTime() { + return (Timestamp) get(7); + } + + /** + * Setter for public.launch.number. + */ + public void setNumber(Integer value) { + set(8, value); + } + + /** + * Getter for public.launch.number. + */ + public Integer getNumber() { + return (Integer) get(8); + } + + /** + * Setter for public.launch.last_modified. + */ + public void setLastModified(Timestamp value) { + set(9, value); + } + + /** + * Getter for public.launch.last_modified. + */ + public Timestamp getLastModified() { + return (Timestamp) get(9); + } + + /** + * Setter for public.launch.mode. + */ + public void setMode(JLaunchModeEnum value) { + set(10, value); + } + + /** + * Getter for public.launch.mode. + */ + public JLaunchModeEnum getMode() { + return (JLaunchModeEnum) get(10); + } + + /** + * Setter for public.launch.status. + */ + public void setStatus(JStatusEnum value) { + set(11, value); + } + + /** + * Getter for public.launch.status. + */ + public JStatusEnum getStatus() { + return (JStatusEnum) get(11); + } + + /** + * Setter for public.launch.has_retries. + */ + public void setHasRetries(Boolean value) { + set(12, value); + } + + /** + * Getter for public.launch.has_retries. + */ + public Boolean getHasRetries() { + return (Boolean) get(12); + } + + /** + * Setter for public.launch.rerun. + */ + public void setRerun(Boolean value) { + set(13, value); + } + + /** + * Getter for public.launch.rerun. + */ + public Boolean getRerun() { + return (Boolean) get(13); + } + + /** + * Setter for public.launch.approximate_duration. + */ + public void setApproximateDuration(Double value) { + set(14, value); + } + + /** + * Getter for public.launch.approximate_duration. + */ + public Double getApproximateDuration() { + return (Double) get(14); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record15 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row15 fieldsRow() { + return (Row15) super.fieldsRow(); + } + + @Override + public Row15 valuesRow() { + return (Row15) super.valuesRow(); + } + + @Override + public Field field1() { + return JLaunch.LAUNCH.ID; + } + + @Override + public Field field2() { + return JLaunch.LAUNCH.UUID; + } + + @Override + public Field field3() { + return JLaunch.LAUNCH.PROJECT_ID; + } + + @Override + public Field field4() { + return JLaunch.LAUNCH.USER_ID; + } + + @Override + public Field field5() { + return JLaunch.LAUNCH.NAME; + } + + @Override + public Field field6() { + return JLaunch.LAUNCH.DESCRIPTION; + } + + @Override + public Field field7() { + return JLaunch.LAUNCH.START_TIME; + } + + @Override + public Field field8() { + return JLaunch.LAUNCH.END_TIME; + } + + @Override + public Field field9() { + return JLaunch.LAUNCH.NUMBER; + } + + @Override + public Field field10() { + return JLaunch.LAUNCH.LAST_MODIFIED; + } + + @Override + public Field field11() { + return JLaunch.LAUNCH.MODE; + } + + @Override + public Field field12() { + return JLaunch.LAUNCH.STATUS; + } + + @Override + public Field field13() { + return JLaunch.LAUNCH.HAS_RETRIES; + } + + @Override + public Field field14() { + return JLaunch.LAUNCH.RERUN; + } + + @Override + public Field field15() { + return JLaunch.LAUNCH.APPROXIMATE_DURATION; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getUuid(); + } + + @Override + public Long component3() { + return getProjectId(); + } + + @Override + public Long component4() { + return getUserId(); + } + + @Override + public String component5() { + return getName(); + } + + @Override + public String component6() { + return getDescription(); + } + + @Override + public Timestamp component7() { + return getStartTime(); + } + + @Override + public Timestamp component8() { + return getEndTime(); + } + + @Override + public Integer component9() { + return getNumber(); + } + + @Override + public Timestamp component10() { + return getLastModified(); + } + + @Override + public JLaunchModeEnum component11() { + return getMode(); + } + + @Override + public JStatusEnum component12() { + return getStatus(); + } + + @Override + public Boolean component13() { + return getHasRetries(); + } + + @Override + public Boolean component14() { + return getRerun(); + } + + @Override + public Double component15() { + return getApproximateDuration(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getUuid(); + } + + @Override + public Long value3() { + return getProjectId(); + } + + @Override + public Long value4() { + return getUserId(); + } + + @Override + public String value5() { + return getName(); + } + + @Override + public String value6() { + return getDescription(); + } + + @Override + public Timestamp value7() { + return getStartTime(); + } + + @Override + public Timestamp value8() { + return getEndTime(); + } + + @Override + public Integer value9() { + return getNumber(); + } + + @Override + public Timestamp value10() { + return getLastModified(); + } + + @Override + public JLaunchModeEnum value11() { + return getMode(); + } + + @Override + public JStatusEnum value12() { + return getStatus(); + } + + @Override + public Boolean value13() { + return getHasRetries(); + } + + @Override + public Boolean value14() { + return getRerun(); + } + + @Override + public Double value15() { + return getApproximateDuration(); + } + + @Override + public JLaunchRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JLaunchRecord value2(String value) { + setUuid(value); + return this; + } + + @Override + public JLaunchRecord value3(Long value) { + setProjectId(value); + return this; + } + + @Override + public JLaunchRecord value4(Long value) { + setUserId(value); + return this; + } + + @Override + public JLaunchRecord value5(String value) { + setName(value); + return this; + } + + @Override + public JLaunchRecord value6(String value) { + setDescription(value); + return this; + } + + @Override + public JLaunchRecord value7(Timestamp value) { + setStartTime(value); + return this; + } + + @Override + public JLaunchRecord value8(Timestamp value) { + setEndTime(value); + return this; + } + + @Override + public JLaunchRecord value9(Integer value) { + setNumber(value); + return this; + } + + @Override + public JLaunchRecord value10(Timestamp value) { + setLastModified(value); + return this; + } + + @Override + public JLaunchRecord value11(JLaunchModeEnum value) { + setMode(value); + return this; + } + + @Override + public JLaunchRecord value12(JStatusEnum value) { + setStatus(value); + return this; + } + + @Override + public JLaunchRecord value13(Boolean value) { + setHasRetries(value); + return this; + } + + @Override + public JLaunchRecord value14(Boolean value) { + setRerun(value); + return this; + } + + @Override + public JLaunchRecord value15(Double value) { + setApproximateDuration(value); + return this; + } + + @Override + public JLaunchRecord values(Long value1, String value2, Long value3, Long value4, String value5, String value6, Timestamp value7, Timestamp value8, Integer value9, Timestamp value10, JLaunchModeEnum value11, JStatusEnum value12, Boolean value13, Boolean value14, Double value15) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + value15(value15); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JLaunchRecord + */ + public JLaunchRecord() { + super(JLaunch.LAUNCH); + } + + /** + * Create a detached, initialised JLaunchRecord + */ + public JLaunchRecord(Long id, String uuid, Long projectId, Long userId, String name, String description, Timestamp startTime, Timestamp endTime, Integer number, Timestamp lastModified, JLaunchModeEnum mode, JStatusEnum status, Boolean hasRetries, Boolean rerun, Double approximateDuration) { + super(JLaunch.LAUNCH); + + set(0, id); + set(1, uuid); + set(2, projectId); + set(3, userId); + set(4, name); + set(5, description); + set(6, startTime); + set(7, endTime); + set(8, number); + set(9, lastModified); + set(10, mode); + set(11, status); + set(12, hasRetries); + set(13, rerun); + set(14, approximateDuration); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLogRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLogRecord.java old mode 100755 new mode 100644 index 2b1c88c41..7b0c6c5f3 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLogRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JLogRecord.java @@ -5,8 +5,11 @@ import com.epam.ta.reportportal.jooq.tables.JLog; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record11; @@ -24,466 +27,462 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JLogRecord extends UpdatableRecordImpl implements - Record11 { - - private static final long serialVersionUID = 560244651; - - /** - * Create a detached JLogRecord - */ - public JLogRecord() { - super(JLog.LOG); - } - - /** - * Create a detached, initialised JLogRecord - */ - public JLogRecord(Long id, String uuid, Timestamp logTime, String logMessage, Long itemId, - Long launchId, Timestamp lastModified, Integer logLevel, Long attachmentId, Long projectId, - Long clusterId) { - super(JLog.LOG); - - set(0, id); - set(1, uuid); - set(2, logTime); - set(3, logMessage); - set(4, itemId); - set(5, launchId); - set(6, lastModified); - set(7, logLevel); - set(8, attachmentId); - set(9, projectId); - set(10, clusterId); - } - - /** - * Getter for public.log.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.log.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.log.uuid. - */ - public String getUuid() { - return (String) get(1); - } - - /** - * Setter for public.log.uuid. - */ - public void setUuid(String value) { - set(1, value); - } - - /** - * Getter for public.log.log_time. - */ - public Timestamp getLogTime() { - return (Timestamp) get(2); - } - - /** - * Setter for public.log.log_time. - */ - public void setLogTime(Timestamp value) { - set(2, value); - } - - /** - * Getter for public.log.log_message. - */ - public String getLogMessage() { - return (String) get(3); - } - - /** - * Setter for public.log.log_message. - */ - public void setLogMessage(String value) { - set(3, value); - } - - /** - * Getter for public.log.item_id. - */ - public Long getItemId() { - return (Long) get(4); - } - - /** - * Setter for public.log.item_id. - */ - public void setItemId(Long value) { - set(4, value); - } - - /** - * Getter for public.log.launch_id. - */ - public Long getLaunchId() { - return (Long) get(5); - } - - /** - * Setter for public.log.launch_id. - */ - public void setLaunchId(Long value) { - set(5, value); - } - - /** - * Getter for public.log.last_modified. - */ - public Timestamp getLastModified() { - return (Timestamp) get(6); - } - - /** - * Setter for public.log.last_modified. - */ - public void setLastModified(Timestamp value) { - set(6, value); - } - - /** - * Getter for public.log.log_level. - */ - public Integer getLogLevel() { - return (Integer) get(7); - } - - /** - * Setter for public.log.log_level. - */ - public void setLogLevel(Integer value) { - set(7, value); - } - - /** - * Getter for public.log.attachment_id. - */ - public Long getAttachmentId() { - return (Long) get(8); - } - - /** - * Setter for public.log.attachment_id. - */ - public void setAttachmentId(Long value) { - set(8, value); - } - - /** - * Getter for public.log.project_id. - */ - public Long getProjectId() { - return (Long) get(9); - } - - /** - * Setter for public.log.project_id. - */ - public void setProjectId(Long value) { - set(9, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.log.cluster_id. - */ - public Long getClusterId() { - return (Long) get(10); - } - - // ------------------------------------------------------------------------- - // Record11 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.log.cluster_id. - */ - public void setClusterId(Long value) { - set(10, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); - } - - @Override - public Row11 valuesRow() { - return (Row11) super.valuesRow(); - } - - @Override - public Field field1() { - return JLog.LOG.ID; - } - - @Override - public Field field2() { - return JLog.LOG.UUID; - } - - @Override - public Field field3() { - return JLog.LOG.LOG_TIME; - } - - @Override - public Field field4() { - return JLog.LOG.LOG_MESSAGE; - } - - @Override - public Field field5() { - return JLog.LOG.ITEM_ID; - } - - @Override - public Field field6() { - return JLog.LOG.LAUNCH_ID; - } - - @Override - public Field field7() { - return JLog.LOG.LAST_MODIFIED; - } - - @Override - public Field field8() { - return JLog.LOG.LOG_LEVEL; - } - - @Override - public Field field9() { - return JLog.LOG.ATTACHMENT_ID; - } - - @Override - public Field field10() { - return JLog.LOG.PROJECT_ID; - } - - @Override - public Field field11() { - return JLog.LOG.CLUSTER_ID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getUuid(); - } - - @Override - public Timestamp component3() { - return getLogTime(); - } - - @Override - public String component4() { - return getLogMessage(); - } - - @Override - public Long component5() { - return getItemId(); - } - - @Override - public Long component6() { - return getLaunchId(); - } - - @Override - public Timestamp component7() { - return getLastModified(); - } - - @Override - public Integer component8() { - return getLogLevel(); - } - - @Override - public Long component9() { - return getAttachmentId(); - } - - @Override - public Long component10() { - return getProjectId(); - } - - @Override - public Long component11() { - return getClusterId(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getUuid(); - } - - @Override - public Timestamp value3() { - return getLogTime(); - } - - @Override - public String value4() { - return getLogMessage(); - } - - @Override - public Long value5() { - return getItemId(); - } - - @Override - public Long value6() { - return getLaunchId(); - } - - @Override - public Timestamp value7() { - return getLastModified(); - } - - @Override - public Integer value8() { - return getLogLevel(); - } - - @Override - public Long value9() { - return getAttachmentId(); - } - - @Override - public Long value10() { - return getProjectId(); - } - - @Override - public Long value11() { - return getClusterId(); - } - - @Override - public JLogRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JLogRecord value2(String value) { - setUuid(value); - return this; - } - - @Override - public JLogRecord value3(Timestamp value) { - setLogTime(value); - return this; - } - - @Override - public JLogRecord value4(String value) { - setLogMessage(value); - return this; - } - - @Override - public JLogRecord value5(Long value) { - setItemId(value); - return this; - } - - @Override - public JLogRecord value6(Long value) { - setLaunchId(value); - return this; - } - - @Override - public JLogRecord value7(Timestamp value) { - setLastModified(value); - return this; - } - - @Override - public JLogRecord value8(Integer value) { - setLogLevel(value); - return this; - } - - @Override - public JLogRecord value9(Long value) { - setAttachmentId(value); - return this; - } - - @Override - public JLogRecord value10(Long value) { - setProjectId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JLogRecord value11(Long value) { - setClusterId(value); - return this; - } - - @Override - public JLogRecord values(Long value1, String value2, Timestamp value3, String value4, Long value5, - Long value6, Timestamp value7, Integer value8, Long value9, Long value10, Long value11) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JLogRecord extends UpdatableRecordImpl implements Record11 { + + private static final long serialVersionUID = 560244651; + + /** + * Setter for public.log.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.log.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.log.uuid. + */ + public void setUuid(String value) { + set(1, value); + } + + /** + * Getter for public.log.uuid. + */ + public String getUuid() { + return (String) get(1); + } + + /** + * Setter for public.log.log_time. + */ + public void setLogTime(Timestamp value) { + set(2, value); + } + + /** + * Getter for public.log.log_time. + */ + public Timestamp getLogTime() { + return (Timestamp) get(2); + } + + /** + * Setter for public.log.log_message. + */ + public void setLogMessage(String value) { + set(3, value); + } + + /** + * Getter for public.log.log_message. + */ + public String getLogMessage() { + return (String) get(3); + } + + /** + * Setter for public.log.item_id. + */ + public void setItemId(Long value) { + set(4, value); + } + + /** + * Getter for public.log.item_id. + */ + public Long getItemId() { + return (Long) get(4); + } + + /** + * Setter for public.log.launch_id. + */ + public void setLaunchId(Long value) { + set(5, value); + } + + /** + * Getter for public.log.launch_id. + */ + public Long getLaunchId() { + return (Long) get(5); + } + + /** + * Setter for public.log.last_modified. + */ + public void setLastModified(Timestamp value) { + set(6, value); + } + + /** + * Getter for public.log.last_modified. + */ + public Timestamp getLastModified() { + return (Timestamp) get(6); + } + + /** + * Setter for public.log.log_level. + */ + public void setLogLevel(Integer value) { + set(7, value); + } + + /** + * Getter for public.log.log_level. + */ + public Integer getLogLevel() { + return (Integer) get(7); + } + + /** + * Setter for public.log.attachment_id. + */ + public void setAttachmentId(Long value) { + set(8, value); + } + + /** + * Getter for public.log.attachment_id. + */ + public Long getAttachmentId() { + return (Long) get(8); + } + + /** + * Setter for public.log.project_id. + */ + public void setProjectId(Long value) { + set(9, value); + } + + /** + * Getter for public.log.project_id. + */ + public Long getProjectId() { + return (Long) get(9); + } + + /** + * Setter for public.log.cluster_id. + */ + public void setClusterId(Long value) { + set(10, value); + } + + /** + * Getter for public.log.cluster_id. + */ + public Long getClusterId() { + return (Long) get(10); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record11 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } + + @Override + public Row11 valuesRow() { + return (Row11) super.valuesRow(); + } + + @Override + public Field field1() { + return JLog.LOG.ID; + } + + @Override + public Field field2() { + return JLog.LOG.UUID; + } + + @Override + public Field field3() { + return JLog.LOG.LOG_TIME; + } + + @Override + public Field field4() { + return JLog.LOG.LOG_MESSAGE; + } + + @Override + public Field field5() { + return JLog.LOG.ITEM_ID; + } + + @Override + public Field field6() { + return JLog.LOG.LAUNCH_ID; + } + + @Override + public Field field7() { + return JLog.LOG.LAST_MODIFIED; + } + + @Override + public Field field8() { + return JLog.LOG.LOG_LEVEL; + } + + @Override + public Field field9() { + return JLog.LOG.ATTACHMENT_ID; + } + + @Override + public Field field10() { + return JLog.LOG.PROJECT_ID; + } + + @Override + public Field field11() { + return JLog.LOG.CLUSTER_ID; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getUuid(); + } + + @Override + public Timestamp component3() { + return getLogTime(); + } + + @Override + public String component4() { + return getLogMessage(); + } + + @Override + public Long component5() { + return getItemId(); + } + + @Override + public Long component6() { + return getLaunchId(); + } + + @Override + public Timestamp component7() { + return getLastModified(); + } + + @Override + public Integer component8() { + return getLogLevel(); + } + + @Override + public Long component9() { + return getAttachmentId(); + } + + @Override + public Long component10() { + return getProjectId(); + } + + @Override + public Long component11() { + return getClusterId(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getUuid(); + } + + @Override + public Timestamp value3() { + return getLogTime(); + } + + @Override + public String value4() { + return getLogMessage(); + } + + @Override + public Long value5() { + return getItemId(); + } + + @Override + public Long value6() { + return getLaunchId(); + } + + @Override + public Timestamp value7() { + return getLastModified(); + } + + @Override + public Integer value8() { + return getLogLevel(); + } + + @Override + public Long value9() { + return getAttachmentId(); + } + + @Override + public Long value10() { + return getProjectId(); + } + + @Override + public Long value11() { + return getClusterId(); + } + + @Override + public JLogRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JLogRecord value2(String value) { + setUuid(value); + return this; + } + + @Override + public JLogRecord value3(Timestamp value) { + setLogTime(value); + return this; + } + + @Override + public JLogRecord value4(String value) { + setLogMessage(value); + return this; + } + + @Override + public JLogRecord value5(Long value) { + setItemId(value); + return this; + } + + @Override + public JLogRecord value6(Long value) { + setLaunchId(value); + return this; + } + + @Override + public JLogRecord value7(Timestamp value) { + setLastModified(value); + return this; + } + + @Override + public JLogRecord value8(Integer value) { + setLogLevel(value); + return this; + } + + @Override + public JLogRecord value9(Long value) { + setAttachmentId(value); + return this; + } + + @Override + public JLogRecord value10(Long value) { + setProjectId(value); + return this; + } + + @Override + public JLogRecord value11(Long value) { + setClusterId(value); + return this; + } + + @Override + public JLogRecord values(Long value1, String value2, Timestamp value3, String value4, Long value5, Long value6, Timestamp value7, Integer value8, Long value9, Long value10, Long value11) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JLogRecord + */ + public JLogRecord() { + super(JLog.LOG); + } + + /** + * Create a detached, initialised JLogRecord + */ + public JLogRecord(Long id, String uuid, Timestamp logTime, String logMessage, Long itemId, Long launchId, Timestamp lastModified, Integer logLevel, Long attachmentId, Long projectId, Long clusterId) { + super(JLog.LOG); + + set(0, id); + set(1, uuid); + set(2, logTime); + set(3, logMessage); + set(4, itemId); + set(5, launchId); + set(6, lastModified); + set(7, logLevel); + set(8, attachmentId); + set(9, projectId); + set(10, clusterId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthAccessTokenRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthAccessTokenRecord.java old mode 100755 new mode 100644 index ec91d18b5..6ed08ed2d --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthAccessTokenRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthAccessTokenRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record9; @@ -23,391 +25,388 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JOauthAccessTokenRecord extends UpdatableRecordImpl implements - Record9 { - - private static final long serialVersionUID = 1312835184; - - /** - * Create a detached JOauthAccessTokenRecord - */ - public JOauthAccessTokenRecord() { - super(JOauthAccessToken.OAUTH_ACCESS_TOKEN); - } - - /** - * Create a detached, initialised JOauthAccessTokenRecord - */ - public JOauthAccessTokenRecord(Long id, String tokenId, byte[] token, String authenticationId, - String username, Long userId, String clientId, byte[] authentication, String refreshToken) { - super(JOauthAccessToken.OAUTH_ACCESS_TOKEN); - - set(0, id); - set(1, tokenId); - set(2, token); - set(3, authenticationId); - set(4, username); - set(5, userId); - set(6, clientId); - set(7, authentication); - set(8, refreshToken); - } - - /** - * Getter for public.oauth_access_token.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.oauth_access_token.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.oauth_access_token.token_id. - */ - public String getTokenId() { - return (String) get(1); - } - - /** - * Setter for public.oauth_access_token.token_id. - */ - public void setTokenId(String value) { - set(1, value); - } - - /** - * Getter for public.oauth_access_token.token. - */ - public byte[] getToken() { - return (byte[]) get(2); - } - - /** - * Setter for public.oauth_access_token.token. - */ - public void setToken(byte... value) { - set(2, value); - } - - /** - * Getter for public.oauth_access_token.authentication_id. - */ - public String getAuthenticationId() { - return (String) get(3); - } - - /** - * Setter for public.oauth_access_token.authentication_id. - */ - public void setAuthenticationId(String value) { - set(3, value); - } - - /** - * Getter for public.oauth_access_token.username. - */ - public String getUsername() { - return (String) get(4); - } - - /** - * Setter for public.oauth_access_token.username. - */ - public void setUsername(String value) { - set(4, value); - } - - /** - * Getter for public.oauth_access_token.user_id. - */ - public Long getUserId() { - return (Long) get(5); - } - - /** - * Setter for public.oauth_access_token.user_id. - */ - public void setUserId(Long value) { - set(5, value); - } - - /** - * Getter for public.oauth_access_token.client_id. - */ - public String getClientId() { - return (String) get(6); - } - - /** - * Setter for public.oauth_access_token.client_id. - */ - public void setClientId(String value) { - set(6, value); - } - - /** - * Getter for public.oauth_access_token.authentication. - */ - public byte[] getAuthentication() { - return (byte[]) get(7); - } - - /** - * Setter for public.oauth_access_token.authentication. - */ - public void setAuthentication(byte... value) { - set(7, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.oauth_access_token.refresh_token. - */ - public String getRefreshToken() { - return (String) get(8); - } - - // ------------------------------------------------------------------------- - // Record9 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.oauth_access_token.refresh_token. - */ - public void setRefreshToken(String value) { - set(8, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } - - @Override - public Row9 valuesRow() { - return (Row9) super.valuesRow(); - } - - @Override - public Field field1() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID; - } - - @Override - public Field field2() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN_ID; - } - - @Override - public Field field3() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN; - } - - @Override - public Field field4() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.AUTHENTICATION_ID; - } - - @Override - public Field field5() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.USERNAME; - } - - @Override - public Field field6() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID; - } - - @Override - public Field field7() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.CLIENT_ID; - } - - @Override - public Field field8() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.AUTHENTICATION; - } - - @Override - public Field field9() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.REFRESH_TOKEN; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getTokenId(); - } - - @Override - public byte[] component3() { - return getToken(); - } - - @Override - public String component4() { - return getAuthenticationId(); - } - - @Override - public String component5() { - return getUsername(); - } - - @Override - public Long component6() { - return getUserId(); - } - - @Override - public String component7() { - return getClientId(); - } - - @Override - public byte[] component8() { - return getAuthentication(); - } - - @Override - public String component9() { - return getRefreshToken(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getTokenId(); - } - - @Override - public byte[] value3() { - return getToken(); - } - - @Override - public String value4() { - return getAuthenticationId(); - } - - @Override - public String value5() { - return getUsername(); - } - - @Override - public Long value6() { - return getUserId(); - } - - @Override - public String value7() { - return getClientId(); - } - - @Override - public byte[] value8() { - return getAuthentication(); - } - - @Override - public String value9() { - return getRefreshToken(); - } - - @Override - public JOauthAccessTokenRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value2(String value) { - setTokenId(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value3(byte... value) { - setToken(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value4(String value) { - setAuthenticationId(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value5(String value) { - setUsername(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value6(Long value) { - setUserId(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value7(String value) { - setClientId(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value8(byte... value) { - setAuthentication(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JOauthAccessTokenRecord value9(String value) { - setRefreshToken(value); - return this; - } - - @Override - public JOauthAccessTokenRecord values(Long value1, String value2, byte[] value3, String value4, - String value5, Long value6, String value7, byte[] value8, String value9) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JOauthAccessTokenRecord extends UpdatableRecordImpl implements Record9 { + + private static final long serialVersionUID = 1312835184; + + /** + * Setter for public.oauth_access_token.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.oauth_access_token.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.oauth_access_token.token_id. + */ + public void setTokenId(String value) { + set(1, value); + } + + /** + * Getter for public.oauth_access_token.token_id. + */ + public String getTokenId() { + return (String) get(1); + } + + /** + * Setter for public.oauth_access_token.token. + */ + public void setToken(byte... value) { + set(2, value); + } + + /** + * Getter for public.oauth_access_token.token. + */ + public byte[] getToken() { + return (byte[]) get(2); + } + + /** + * Setter for public.oauth_access_token.authentication_id. + */ + public void setAuthenticationId(String value) { + set(3, value); + } + + /** + * Getter for public.oauth_access_token.authentication_id. + */ + public String getAuthenticationId() { + return (String) get(3); + } + + /** + * Setter for public.oauth_access_token.username. + */ + public void setUsername(String value) { + set(4, value); + } + + /** + * Getter for public.oauth_access_token.username. + */ + public String getUsername() { + return (String) get(4); + } + + /** + * Setter for public.oauth_access_token.user_id. + */ + public void setUserId(Long value) { + set(5, value); + } + + /** + * Getter for public.oauth_access_token.user_id. + */ + public Long getUserId() { + return (Long) get(5); + } + + /** + * Setter for public.oauth_access_token.client_id. + */ + public void setClientId(String value) { + set(6, value); + } + + /** + * Getter for public.oauth_access_token.client_id. + */ + public String getClientId() { + return (String) get(6); + } + + /** + * Setter for public.oauth_access_token.authentication. + */ + public void setAuthentication(byte... value) { + set(7, value); + } + + /** + * Getter for public.oauth_access_token.authentication. + */ + public byte[] getAuthentication() { + return (byte[]) get(7); + } + + /** + * Setter for public.oauth_access_token.refresh_token. + */ + public void setRefreshToken(String value) { + set(8, value); + } + + /** + * Getter for public.oauth_access_token.refresh_token. + */ + public String getRefreshToken() { + return (String) get(8); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record9 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } + + @Override + public Row9 valuesRow() { + return (Row9) super.valuesRow(); + } + + @Override + public Field field1() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID; + } + + @Override + public Field field2() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN_ID; + } + + @Override + public Field field3() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN; + } + + @Override + public Field field4() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.AUTHENTICATION_ID; + } + + @Override + public Field field5() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.USERNAME; + } + + @Override + public Field field6() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID; + } + + @Override + public Field field7() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.CLIENT_ID; + } + + @Override + public Field field8() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.AUTHENTICATION; + } + + @Override + public Field field9() { + return JOauthAccessToken.OAUTH_ACCESS_TOKEN.REFRESH_TOKEN; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getTokenId(); + } + + @Override + public byte[] component3() { + return getToken(); + } + + @Override + public String component4() { + return getAuthenticationId(); + } + + @Override + public String component5() { + return getUsername(); + } + + @Override + public Long component6() { + return getUserId(); + } + + @Override + public String component7() { + return getClientId(); + } + + @Override + public byte[] component8() { + return getAuthentication(); + } + + @Override + public String component9() { + return getRefreshToken(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getTokenId(); + } + + @Override + public byte[] value3() { + return getToken(); + } + + @Override + public String value4() { + return getAuthenticationId(); + } + + @Override + public String value5() { + return getUsername(); + } + + @Override + public Long value6() { + return getUserId(); + } + + @Override + public String value7() { + return getClientId(); + } + + @Override + public byte[] value8() { + return getAuthentication(); + } + + @Override + public String value9() { + return getRefreshToken(); + } + + @Override + public JOauthAccessTokenRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JOauthAccessTokenRecord value2(String value) { + setTokenId(value); + return this; + } + + @Override + public JOauthAccessTokenRecord value3(byte... value) { + setToken(value); + return this; + } + + @Override + public JOauthAccessTokenRecord value4(String value) { + setAuthenticationId(value); + return this; + } + + @Override + public JOauthAccessTokenRecord value5(String value) { + setUsername(value); + return this; + } + + @Override + public JOauthAccessTokenRecord value6(Long value) { + setUserId(value); + return this; + } + + @Override + public JOauthAccessTokenRecord value7(String value) { + setClientId(value); + return this; + } + + @Override + public JOauthAccessTokenRecord value8(byte... value) { + setAuthentication(value); + return this; + } + + @Override + public JOauthAccessTokenRecord value9(String value) { + setRefreshToken(value); + return this; + } + + @Override + public JOauthAccessTokenRecord values(Long value1, String value2, byte[] value3, String value4, String value5, Long value6, String value7, byte[] value8, String value9) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JOauthAccessTokenRecord + */ + public JOauthAccessTokenRecord() { + super(JOauthAccessToken.OAUTH_ACCESS_TOKEN); + } + + /** + * Create a detached, initialised JOauthAccessTokenRecord + */ + public JOauthAccessTokenRecord(Long id, String tokenId, byte[] token, String authenticationId, String username, Long userId, String clientId, byte[] authentication, String refreshToken) { + super(JOauthAccessToken.OAUTH_ACCESS_TOKEN); + + set(0, id); + set(1, tokenId); + set(2, token); + set(3, authenticationId); + set(4, username); + set(5, userId); + set(6, clientId); + set(7, authentication); + set(8, refreshToken); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRecord.java index 8575e8bc7..83e6c4926 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record12; @@ -23,506 +25,499 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JOauthRegistrationRecord extends - UpdatableRecordImpl implements - Record12 { - - private static final long serialVersionUID = -1760457440; - - /** - * Create a detached JOauthRegistrationRecord - */ - public JOauthRegistrationRecord() { - super(JOauthRegistration.OAUTH_REGISTRATION); - } - - /** - * Create a detached, initialised JOauthRegistrationRecord - */ - public JOauthRegistrationRecord(String id, String clientId, String clientSecret, - String clientAuthMethod, String authGrantType, String redirectUriTemplate, - String authorizationUri, String tokenUri, String userInfoEndpointUri, - String userInfoEndpointNameAttr, String jwkSetUri, String clientName) { - super(JOauthRegistration.OAUTH_REGISTRATION); - - set(0, id); - set(1, clientId); - set(2, clientSecret); - set(3, clientAuthMethod); - set(4, authGrantType); - set(5, redirectUriTemplate); - set(6, authorizationUri); - set(7, tokenUri); - set(8, userInfoEndpointUri); - set(9, userInfoEndpointNameAttr); - set(10, jwkSetUri); - set(11, clientName); - } - - /** - * Getter for public.oauth_registration.id. - */ - public String getId() { - return (String) get(0); - } - - /** - * Setter for public.oauth_registration.id. - */ - public void setId(String value) { - set(0, value); - } - - /** - * Getter for public.oauth_registration.client_id. - */ - public String getClientId() { - return (String) get(1); - } - - /** - * Setter for public.oauth_registration.client_id. - */ - public void setClientId(String value) { - set(1, value); - } - - /** - * Getter for public.oauth_registration.client_secret. - */ - public String getClientSecret() { - return (String) get(2); - } - - /** - * Setter for public.oauth_registration.client_secret. - */ - public void setClientSecret(String value) { - set(2, value); - } - - /** - * Getter for public.oauth_registration.client_auth_method. - */ - public String getClientAuthMethod() { - return (String) get(3); - } - - /** - * Setter for public.oauth_registration.client_auth_method. - */ - public void setClientAuthMethod(String value) { - set(3, value); - } - - /** - * Getter for public.oauth_registration.auth_grant_type. - */ - public String getAuthGrantType() { - return (String) get(4); - } - - /** - * Setter for public.oauth_registration.auth_grant_type. - */ - public void setAuthGrantType(String value) { - set(4, value); - } - - /** - * Getter for public.oauth_registration.redirect_uri_template. - */ - public String getRedirectUriTemplate() { - return (String) get(5); - } - - /** - * Setter for public.oauth_registration.redirect_uri_template. - */ - public void setRedirectUriTemplate(String value) { - set(5, value); - } - - /** - * Getter for public.oauth_registration.authorization_uri. - */ - public String getAuthorizationUri() { - return (String) get(6); - } - - /** - * Setter for public.oauth_registration.authorization_uri. - */ - public void setAuthorizationUri(String value) { - set(6, value); - } - - /** - * Getter for public.oauth_registration.token_uri. - */ - public String getTokenUri() { - return (String) get(7); - } - - /** - * Setter for public.oauth_registration.token_uri. - */ - public void setTokenUri(String value) { - set(7, value); - } - - /** - * Getter for public.oauth_registration.user_info_endpoint_uri. - */ - public String getUserInfoEndpointUri() { - return (String) get(8); - } - - /** - * Setter for public.oauth_registration.user_info_endpoint_uri. - */ - public void setUserInfoEndpointUri(String value) { - set(8, value); - } - - /** - * Getter for public.oauth_registration.user_info_endpoint_name_attr. - */ - public String getUserInfoEndpointNameAttr() { - return (String) get(9); - } - - /** - * Setter for public.oauth_registration.user_info_endpoint_name_attr. - */ - public void setUserInfoEndpointNameAttr(String value) { - set(9, value); - } - - /** - * Getter for public.oauth_registration.jwk_set_uri. - */ - public String getJwkSetUri() { - return (String) get(10); - } - - /** - * Setter for public.oauth_registration.jwk_set_uri. - */ - public void setJwkSetUri(String value) { - set(10, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.oauth_registration.client_name. - */ - public String getClientName() { - return (String) get(11); - } - - // ------------------------------------------------------------------------- - // Record12 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.oauth_registration.client_name. - */ - public void setClientName(String value) { - set(11, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row12 fieldsRow() { - return (Row12) super.fieldsRow(); - } - - @Override - public Row12 valuesRow() { - return (Row12) super.valuesRow(); - } - - @Override - public Field field1() { - return JOauthRegistration.OAUTH_REGISTRATION.ID; - } - - @Override - public Field field2() { - return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_ID; - } - - @Override - public Field field3() { - return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_SECRET; - } - - @Override - public Field field4() { - return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_AUTH_METHOD; - } - - @Override - public Field field5() { - return JOauthRegistration.OAUTH_REGISTRATION.AUTH_GRANT_TYPE; - } - - @Override - public Field field6() { - return JOauthRegistration.OAUTH_REGISTRATION.REDIRECT_URI_TEMPLATE; - } - - @Override - public Field field7() { - return JOauthRegistration.OAUTH_REGISTRATION.AUTHORIZATION_URI; - } - - @Override - public Field field8() { - return JOauthRegistration.OAUTH_REGISTRATION.TOKEN_URI; - } - - @Override - public Field field9() { - return JOauthRegistration.OAUTH_REGISTRATION.USER_INFO_ENDPOINT_URI; - } - - @Override - public Field field10() { - return JOauthRegistration.OAUTH_REGISTRATION.USER_INFO_ENDPOINT_NAME_ATTR; - } - - @Override - public Field field11() { - return JOauthRegistration.OAUTH_REGISTRATION.JWK_SET_URI; - } - - @Override - public Field field12() { - return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_NAME; - } - - @Override - public String component1() { - return getId(); - } - - @Override - public String component2() { - return getClientId(); - } - - @Override - public String component3() { - return getClientSecret(); - } - - @Override - public String component4() { - return getClientAuthMethod(); - } - - @Override - public String component5() { - return getAuthGrantType(); - } - - @Override - public String component6() { - return getRedirectUriTemplate(); - } - - @Override - public String component7() { - return getAuthorizationUri(); - } - - @Override - public String component8() { - return getTokenUri(); - } - - @Override - public String component9() { - return getUserInfoEndpointUri(); - } - - @Override - public String component10() { - return getUserInfoEndpointNameAttr(); - } - - @Override - public String component11() { - return getJwkSetUri(); - } - - @Override - public String component12() { - return getClientName(); - } - - @Override - public String value1() { - return getId(); - } - - @Override - public String value2() { - return getClientId(); - } - - @Override - public String value3() { - return getClientSecret(); - } - - @Override - public String value4() { - return getClientAuthMethod(); - } - - @Override - public String value5() { - return getAuthGrantType(); - } - - @Override - public String value6() { - return getRedirectUriTemplate(); - } - - @Override - public String value7() { - return getAuthorizationUri(); - } - - @Override - public String value8() { - return getTokenUri(); - } - - @Override - public String value9() { - return getUserInfoEndpointUri(); - } - - @Override - public String value10() { - return getUserInfoEndpointNameAttr(); - } - - @Override - public String value11() { - return getJwkSetUri(); - } - - @Override - public String value12() { - return getClientName(); - } - - @Override - public JOauthRegistrationRecord value1(String value) { - setId(value); - return this; - } - - @Override - public JOauthRegistrationRecord value2(String value) { - setClientId(value); - return this; - } - - @Override - public JOauthRegistrationRecord value3(String value) { - setClientSecret(value); - return this; - } - - @Override - public JOauthRegistrationRecord value4(String value) { - setClientAuthMethod(value); - return this; - } - - @Override - public JOauthRegistrationRecord value5(String value) { - setAuthGrantType(value); - return this; - } - - @Override - public JOauthRegistrationRecord value6(String value) { - setRedirectUriTemplate(value); - return this; - } - - @Override - public JOauthRegistrationRecord value7(String value) { - setAuthorizationUri(value); - return this; - } - - @Override - public JOauthRegistrationRecord value8(String value) { - setTokenUri(value); - return this; - } - - @Override - public JOauthRegistrationRecord value9(String value) { - setUserInfoEndpointUri(value); - return this; - } - - @Override - public JOauthRegistrationRecord value10(String value) { - setUserInfoEndpointNameAttr(value); - return this; - } - - @Override - public JOauthRegistrationRecord value11(String value) { - setJwkSetUri(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JOauthRegistrationRecord value12(String value) { - setClientName(value); - return this; - } - - @Override - public JOauthRegistrationRecord values(String value1, String value2, String value3, String value4, - String value5, String value6, String value7, String value8, String value9, String value10, - String value11, String value12) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - value12(value12); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JOauthRegistrationRecord extends UpdatableRecordImpl implements Record12 { + + private static final long serialVersionUID = -1760457440; + + /** + * Setter for public.oauth_registration.id. + */ + public void setId(String value) { + set(0, value); + } + + /** + * Getter for public.oauth_registration.id. + */ + public String getId() { + return (String) get(0); + } + + /** + * Setter for public.oauth_registration.client_id. + */ + public void setClientId(String value) { + set(1, value); + } + + /** + * Getter for public.oauth_registration.client_id. + */ + public String getClientId() { + return (String) get(1); + } + + /** + * Setter for public.oauth_registration.client_secret. + */ + public void setClientSecret(String value) { + set(2, value); + } + + /** + * Getter for public.oauth_registration.client_secret. + */ + public String getClientSecret() { + return (String) get(2); + } + + /** + * Setter for public.oauth_registration.client_auth_method. + */ + public void setClientAuthMethod(String value) { + set(3, value); + } + + /** + * Getter for public.oauth_registration.client_auth_method. + */ + public String getClientAuthMethod() { + return (String) get(3); + } + + /** + * Setter for public.oauth_registration.auth_grant_type. + */ + public void setAuthGrantType(String value) { + set(4, value); + } + + /** + * Getter for public.oauth_registration.auth_grant_type. + */ + public String getAuthGrantType() { + return (String) get(4); + } + + /** + * Setter for public.oauth_registration.redirect_uri_template. + */ + public void setRedirectUriTemplate(String value) { + set(5, value); + } + + /** + * Getter for public.oauth_registration.redirect_uri_template. + */ + public String getRedirectUriTemplate() { + return (String) get(5); + } + + /** + * Setter for public.oauth_registration.authorization_uri. + */ + public void setAuthorizationUri(String value) { + set(6, value); + } + + /** + * Getter for public.oauth_registration.authorization_uri. + */ + public String getAuthorizationUri() { + return (String) get(6); + } + + /** + * Setter for public.oauth_registration.token_uri. + */ + public void setTokenUri(String value) { + set(7, value); + } + + /** + * Getter for public.oauth_registration.token_uri. + */ + public String getTokenUri() { + return (String) get(7); + } + + /** + * Setter for public.oauth_registration.user_info_endpoint_uri. + */ + public void setUserInfoEndpointUri(String value) { + set(8, value); + } + + /** + * Getter for public.oauth_registration.user_info_endpoint_uri. + */ + public String getUserInfoEndpointUri() { + return (String) get(8); + } + + /** + * Setter for public.oauth_registration.user_info_endpoint_name_attr. + */ + public void setUserInfoEndpointNameAttr(String value) { + set(9, value); + } + + /** + * Getter for public.oauth_registration.user_info_endpoint_name_attr. + */ + public String getUserInfoEndpointNameAttr() { + return (String) get(9); + } + + /** + * Setter for public.oauth_registration.jwk_set_uri. + */ + public void setJwkSetUri(String value) { + set(10, value); + } + + /** + * Getter for public.oauth_registration.jwk_set_uri. + */ + public String getJwkSetUri() { + return (String) get(10); + } + + /** + * Setter for public.oauth_registration.client_name. + */ + public void setClientName(String value) { + set(11, value); + } + + /** + * Getter for public.oauth_registration.client_name. + */ + public String getClientName() { + return (String) get(11); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record12 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row12 fieldsRow() { + return (Row12) super.fieldsRow(); + } + + @Override + public Row12 valuesRow() { + return (Row12) super.valuesRow(); + } + + @Override + public Field field1() { + return JOauthRegistration.OAUTH_REGISTRATION.ID; + } + + @Override + public Field field2() { + return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_ID; + } + + @Override + public Field field3() { + return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_SECRET; + } + + @Override + public Field field4() { + return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_AUTH_METHOD; + } + + @Override + public Field field5() { + return JOauthRegistration.OAUTH_REGISTRATION.AUTH_GRANT_TYPE; + } + + @Override + public Field field6() { + return JOauthRegistration.OAUTH_REGISTRATION.REDIRECT_URI_TEMPLATE; + } + + @Override + public Field field7() { + return JOauthRegistration.OAUTH_REGISTRATION.AUTHORIZATION_URI; + } + + @Override + public Field field8() { + return JOauthRegistration.OAUTH_REGISTRATION.TOKEN_URI; + } + + @Override + public Field field9() { + return JOauthRegistration.OAUTH_REGISTRATION.USER_INFO_ENDPOINT_URI; + } + + @Override + public Field field10() { + return JOauthRegistration.OAUTH_REGISTRATION.USER_INFO_ENDPOINT_NAME_ATTR; + } + + @Override + public Field field11() { + return JOauthRegistration.OAUTH_REGISTRATION.JWK_SET_URI; + } + + @Override + public Field field12() { + return JOauthRegistration.OAUTH_REGISTRATION.CLIENT_NAME; + } + + @Override + public String component1() { + return getId(); + } + + @Override + public String component2() { + return getClientId(); + } + + @Override + public String component3() { + return getClientSecret(); + } + + @Override + public String component4() { + return getClientAuthMethod(); + } + + @Override + public String component5() { + return getAuthGrantType(); + } + + @Override + public String component6() { + return getRedirectUriTemplate(); + } + + @Override + public String component7() { + return getAuthorizationUri(); + } + + @Override + public String component8() { + return getTokenUri(); + } + + @Override + public String component9() { + return getUserInfoEndpointUri(); + } + + @Override + public String component10() { + return getUserInfoEndpointNameAttr(); + } + + @Override + public String component11() { + return getJwkSetUri(); + } + + @Override + public String component12() { + return getClientName(); + } + + @Override + public String value1() { + return getId(); + } + + @Override + public String value2() { + return getClientId(); + } + + @Override + public String value3() { + return getClientSecret(); + } + + @Override + public String value4() { + return getClientAuthMethod(); + } + + @Override + public String value5() { + return getAuthGrantType(); + } + + @Override + public String value6() { + return getRedirectUriTemplate(); + } + + @Override + public String value7() { + return getAuthorizationUri(); + } + + @Override + public String value8() { + return getTokenUri(); + } + + @Override + public String value9() { + return getUserInfoEndpointUri(); + } + + @Override + public String value10() { + return getUserInfoEndpointNameAttr(); + } + + @Override + public String value11() { + return getJwkSetUri(); + } + + @Override + public String value12() { + return getClientName(); + } + + @Override + public JOauthRegistrationRecord value1(String value) { + setId(value); + return this; + } + + @Override + public JOauthRegistrationRecord value2(String value) { + setClientId(value); + return this; + } + + @Override + public JOauthRegistrationRecord value3(String value) { + setClientSecret(value); + return this; + } + + @Override + public JOauthRegistrationRecord value4(String value) { + setClientAuthMethod(value); + return this; + } + + @Override + public JOauthRegistrationRecord value5(String value) { + setAuthGrantType(value); + return this; + } + + @Override + public JOauthRegistrationRecord value6(String value) { + setRedirectUriTemplate(value); + return this; + } + + @Override + public JOauthRegistrationRecord value7(String value) { + setAuthorizationUri(value); + return this; + } + + @Override + public JOauthRegistrationRecord value8(String value) { + setTokenUri(value); + return this; + } + + @Override + public JOauthRegistrationRecord value9(String value) { + setUserInfoEndpointUri(value); + return this; + } + + @Override + public JOauthRegistrationRecord value10(String value) { + setUserInfoEndpointNameAttr(value); + return this; + } + + @Override + public JOauthRegistrationRecord value11(String value) { + setJwkSetUri(value); + return this; + } + + @Override + public JOauthRegistrationRecord value12(String value) { + setClientName(value); + return this; + } + + @Override + public JOauthRegistrationRecord values(String value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, String value9, String value10, String value11, String value12) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JOauthRegistrationRecord + */ + public JOauthRegistrationRecord() { + super(JOauthRegistration.OAUTH_REGISTRATION); + } + + /** + * Create a detached, initialised JOauthRegistrationRecord + */ + public JOauthRegistrationRecord(String id, String clientId, String clientSecret, String clientAuthMethod, String authGrantType, String redirectUriTemplate, String authorizationUri, String tokenUri, String userInfoEndpointUri, String userInfoEndpointNameAttr, String jwkSetUri, String clientName) { + super(JOauthRegistration.OAUTH_REGISTRATION); + + set(0, id); + set(1, clientId); + set(2, clientSecret); + set(3, clientAuthMethod); + set(4, authGrantType); + set(5, redirectUriTemplate); + set(6, authorizationUri); + set(7, tokenUri); + set(8, userInfoEndpointUri); + set(9, userInfoEndpointNameAttr); + set(10, jwkSetUri); + set(11, clientName); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRestrictionRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRestrictionRecord.java index 9b78187f6..9882acf6c 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRestrictionRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationRestrictionRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -23,207 +25,203 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JOauthRegistrationRestrictionRecord extends - UpdatableRecordImpl implements - Record4 { - - private static final long serialVersionUID = 335765148; - - /** - * Create a detached JOauthRegistrationRestrictionRecord - */ - public JOauthRegistrationRestrictionRecord() { - super(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION); - } - - /** - * Create a detached, initialised JOauthRegistrationRestrictionRecord - */ - public JOauthRegistrationRestrictionRecord(Integer id, String oauthRegistrationFk, String type, - String value) { - super(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION); - - set(0, id); - set(1, oauthRegistrationFk); - set(2, type); - set(3, value); - } - - /** - * Getter for public.oauth_registration_restriction.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for public.oauth_registration_restriction.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for public.oauth_registration_restriction.oauth_registration_fk. - */ - public String getOauthRegistrationFk() { - return (String) get(1); - } - - /** - * Setter for public.oauth_registration_restriction.oauth_registration_fk. - */ - public void setOauthRegistrationFk(String value) { - set(1, value); - } - - /** - * Getter for public.oauth_registration_restriction.type. - */ - public String getType() { - return (String) get(2); - } - - /** - * Setter for public.oauth_registration_restriction.type. - */ - public void setType(String value) { - set(2, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.oauth_registration_restriction.value. - */ - public String getValue() { - return (String) get(3); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.oauth_registration_restriction.value. - */ - public void setValue(String value) { - set(3, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID; - } - - @Override - public Field field2() { - return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK; - } - - @Override - public Field field3() { - return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.TYPE; - } - - @Override - public Field field4() { - return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.VALUE; - } - - @Override - public Integer component1() { - return getId(); - } - - @Override - public String component2() { - return getOauthRegistrationFk(); - } - - @Override - public String component3() { - return getType(); - } - - @Override - public String component4() { - return getValue(); - } - - @Override - public Integer value1() { - return getId(); - } - - @Override - public String value2() { - return getOauthRegistrationFk(); - } - - @Override - public String value3() { - return getType(); - } - - @Override - public String value4() { - return getValue(); - } - - @Override - public JOauthRegistrationRestrictionRecord value1(Integer value) { - setId(value); - return this; - } - - @Override - public JOauthRegistrationRestrictionRecord value2(String value) { - setOauthRegistrationFk(value); - return this; - } - - @Override - public JOauthRegistrationRestrictionRecord value3(String value) { - setType(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JOauthRegistrationRestrictionRecord value4(String value) { - setValue(value); - return this; - } - - @Override - public JOauthRegistrationRestrictionRecord values(Integer value1, String value2, String value3, - String value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JOauthRegistrationRestrictionRecord extends UpdatableRecordImpl implements Record4 { + + private static final long serialVersionUID = 335765148; + + /** + * Setter for public.oauth_registration_restriction.id. + */ + public void setId(Integer value) { + set(0, value); + } + + /** + * Getter for public.oauth_registration_restriction.id. + */ + public Integer getId() { + return (Integer) get(0); + } + + /** + * Setter for public.oauth_registration_restriction.oauth_registration_fk. + */ + public void setOauthRegistrationFk(String value) { + set(1, value); + } + + /** + * Getter for public.oauth_registration_restriction.oauth_registration_fk. + */ + public String getOauthRegistrationFk() { + return (String) get(1); + } + + /** + * Setter for public.oauth_registration_restriction.type. + */ + public void setType(String value) { + set(2, value); + } + + /** + * Getter for public.oauth_registration_restriction.type. + */ + public String getType() { + return (String) get(2); + } + + /** + * Setter for public.oauth_registration_restriction.value. + */ + public void setValue(String value) { + set(3, value); + } + + /** + * Getter for public.oauth_registration_restriction.value. + */ + public String getValue() { + return (String) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID; + } + + @Override + public Field field2() { + return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK; + } + + @Override + public Field field3() { + return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.TYPE; + } + + @Override + public Field field4() { + return JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.VALUE; + } + + @Override + public Integer component1() { + return getId(); + } + + @Override + public String component2() { + return getOauthRegistrationFk(); + } + + @Override + public String component3() { + return getType(); + } + + @Override + public String component4() { + return getValue(); + } + + @Override + public Integer value1() { + return getId(); + } + + @Override + public String value2() { + return getOauthRegistrationFk(); + } + + @Override + public String value3() { + return getType(); + } + + @Override + public String value4() { + return getValue(); + } + + @Override + public JOauthRegistrationRestrictionRecord value1(Integer value) { + setId(value); + return this; + } + + @Override + public JOauthRegistrationRestrictionRecord value2(String value) { + setOauthRegistrationFk(value); + return this; + } + + @Override + public JOauthRegistrationRestrictionRecord value3(String value) { + setType(value); + return this; + } + + @Override + public JOauthRegistrationRestrictionRecord value4(String value) { + setValue(value); + return this; + } + + @Override + public JOauthRegistrationRestrictionRecord values(Integer value1, String value2, String value3, String value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JOauthRegistrationRestrictionRecord + */ + public JOauthRegistrationRestrictionRecord() { + super(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION); + } + + /** + * Create a detached, initialised JOauthRegistrationRestrictionRecord + */ + public JOauthRegistrationRestrictionRecord(Integer id, String oauthRegistrationFk, String type, String value) { + super(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION); + + set(0, id); + set(1, oauthRegistrationFk); + set(2, type); + set(3, value); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationScopeRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationScopeRecord.java old mode 100755 new mode 100644 index 7516c99f0..f514ad369 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationScopeRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthRegistrationScopeRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record3; @@ -23,167 +25,166 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JOauthRegistrationScopeRecord extends - UpdatableRecordImpl implements Record3 { - - private static final long serialVersionUID = 688903255; - - /** - * Create a detached JOauthRegistrationScopeRecord - */ - public JOauthRegistrationScopeRecord() { - super(JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE); - } - - /** - * Create a detached, initialised JOauthRegistrationScopeRecord - */ - public JOauthRegistrationScopeRecord(Integer id, String oauthRegistrationFk, String scope) { - super(JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE); - - set(0, id); - set(1, oauthRegistrationFk); - set(2, scope); - } - - /** - * Getter for public.oauth_registration_scope.id. - */ - public Integer getId() { - return (Integer) get(0); - } - - /** - * Setter for public.oauth_registration_scope.id. - */ - public void setId(Integer value) { - set(0, value); - } - - /** - * Getter for public.oauth_registration_scope.oauth_registration_fk. - */ - public String getOauthRegistrationFk() { - return (String) get(1); - } - - /** - * Setter for public.oauth_registration_scope.oauth_registration_fk. - */ - public void setOauthRegistrationFk(String value) { - set(1, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.oauth_registration_scope.scope. - */ - public String getScope() { - return (String) get(2); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.oauth_registration_scope.scope. - */ - public void setScope(String value) { - set(2, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID; - } - - @Override - public Field field2() { - return JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK; - } - - @Override - public Field field3() { - return JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.SCOPE; - } - - @Override - public Integer component1() { - return getId(); - } - - @Override - public String component2() { - return getOauthRegistrationFk(); - } - - @Override - public String component3() { - return getScope(); - } - - @Override - public Integer value1() { - return getId(); - } - - @Override - public String value2() { - return getOauthRegistrationFk(); - } - - @Override - public String value3() { - return getScope(); - } - - @Override - public JOauthRegistrationScopeRecord value1(Integer value) { - setId(value); - return this; - } - - @Override - public JOauthRegistrationScopeRecord value2(String value) { - setOauthRegistrationFk(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JOauthRegistrationScopeRecord value3(String value) { - setScope(value); - return this; - } - - @Override - public JOauthRegistrationScopeRecord values(Integer value1, String value2, String value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JOauthRegistrationScopeRecord extends UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = 688903255; + + /** + * Setter for public.oauth_registration_scope.id. + */ + public void setId(Integer value) { + set(0, value); + } + + /** + * Getter for public.oauth_registration_scope.id. + */ + public Integer getId() { + return (Integer) get(0); + } + + /** + * Setter for public.oauth_registration_scope.oauth_registration_fk. + */ + public void setOauthRegistrationFk(String value) { + set(1, value); + } + + /** + * Getter for public.oauth_registration_scope.oauth_registration_fk. + */ + public String getOauthRegistrationFk() { + return (String) get(1); + } + + /** + * Setter for public.oauth_registration_scope.scope. + */ + public void setScope(String value) { + set(2, value); + } + + /** + * Getter for public.oauth_registration_scope.scope. + */ + public String getScope() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID; + } + + @Override + public Field field2() { + return JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK; + } + + @Override + public Field field3() { + return JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.SCOPE; + } + + @Override + public Integer component1() { + return getId(); + } + + @Override + public String component2() { + return getOauthRegistrationFk(); + } + + @Override + public String component3() { + return getScope(); + } + + @Override + public Integer value1() { + return getId(); + } + + @Override + public String value2() { + return getOauthRegistrationFk(); + } + + @Override + public String value3() { + return getScope(); + } + + @Override + public JOauthRegistrationScopeRecord value1(Integer value) { + setId(value); + return this; + } + + @Override + public JOauthRegistrationScopeRecord value2(String value) { + setOauthRegistrationFk(value); + return this; + } + + @Override + public JOauthRegistrationScopeRecord value3(String value) { + setScope(value); + return this; + } + + @Override + public JOauthRegistrationScopeRecord values(Integer value1, String value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JOauthRegistrationScopeRecord + */ + public JOauthRegistrationScopeRecord() { + super(JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE); + } + + /** + * Create a detached, initialised JOauthRegistrationScopeRecord + */ + public JOauthRegistrationScopeRecord(Integer id, String oauthRegistrationFk, String scope) { + super(JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE); + + set(0, id); + set(1, oauthRegistrationFk); + set(2, scope); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOnboardingRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOnboardingRecord.java index 5c16f6986..db749c19d 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOnboardingRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOnboardingRecord.java @@ -5,8 +5,11 @@ import com.epam.ta.reportportal.jooq.tables.JOnboarding; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record5; @@ -24,243 +27,240 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JOnboardingRecord extends UpdatableRecordImpl implements - Record5 { - - private static final long serialVersionUID = -1405142552; - - /** - * Create a detached JOnboardingRecord - */ - public JOnboardingRecord() { - super(JOnboarding.ONBOARDING); - } - - /** - * Create a detached, initialised JOnboardingRecord - */ - public JOnboardingRecord(Short id, String data, String page, Timestamp availableFrom, - Timestamp availableTo) { - super(JOnboarding.ONBOARDING); - - set(0, id); - set(1, data); - set(2, page); - set(3, availableFrom); - set(4, availableTo); - } - - /** - * Getter for public.onboarding.id. - */ - public Short getId() { - return (Short) get(0); - } - - /** - * Setter for public.onboarding.id. - */ - public void setId(Short value) { - set(0, value); - } - - /** - * Getter for public.onboarding.data. - */ - public String getData() { - return (String) get(1); - } - - /** - * Setter for public.onboarding.data. - */ - public void setData(String value) { - set(1, value); - } - - /** - * Getter for public.onboarding.page. - */ - public String getPage() { - return (String) get(2); - } - - /** - * Setter for public.onboarding.page. - */ - public void setPage(String value) { - set(2, value); - } - - /** - * Getter for public.onboarding.available_from. - */ - public Timestamp getAvailableFrom() { - return (Timestamp) get(3); - } - - /** - * Setter for public.onboarding.available_from. - */ - public void setAvailableFrom(Timestamp value) { - set(3, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.onboarding.available_to. - */ - public Timestamp getAvailableTo() { - return (Timestamp) get(4); - } - - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.onboarding.available_to. - */ - public void setAvailableTo(Timestamp value) { - set(4, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } - - @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); - } - - @Override - public Field field1() { - return JOnboarding.ONBOARDING.ID; - } - - @Override - public Field field2() { - return JOnboarding.ONBOARDING.DATA; - } - - @Override - public Field field3() { - return JOnboarding.ONBOARDING.PAGE; - } - - @Override - public Field field4() { - return JOnboarding.ONBOARDING.AVAILABLE_FROM; - } - - @Override - public Field field5() { - return JOnboarding.ONBOARDING.AVAILABLE_TO; - } - - @Override - public Short component1() { - return getId(); - } - - @Override - public String component2() { - return getData(); - } - - @Override - public String component3() { - return getPage(); - } - - @Override - public Timestamp component4() { - return getAvailableFrom(); - } - - @Override - public Timestamp component5() { - return getAvailableTo(); - } - - @Override - public Short value1() { - return getId(); - } - - @Override - public String value2() { - return getData(); - } - - @Override - public String value3() { - return getPage(); - } - - @Override - public Timestamp value4() { - return getAvailableFrom(); - } - - @Override - public Timestamp value5() { - return getAvailableTo(); - } - - @Override - public JOnboardingRecord value1(Short value) { - setId(value); - return this; - } - - @Override - public JOnboardingRecord value2(String value) { - setData(value); - return this; - } - - @Override - public JOnboardingRecord value3(String value) { - setPage(value); - return this; - } - - @Override - public JOnboardingRecord value4(Timestamp value) { - setAvailableFrom(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JOnboardingRecord value5(Timestamp value) { - setAvailableTo(value); - return this; - } - - @Override - public JOnboardingRecord values(Short value1, String value2, String value3, Timestamp value4, - Timestamp value5) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JOnboardingRecord extends UpdatableRecordImpl implements Record5 { + + private static final long serialVersionUID = -1405142552; + + /** + * Setter for public.onboarding.id. + */ + public void setId(Short value) { + set(0, value); + } + + /** + * Getter for public.onboarding.id. + */ + public Short getId() { + return (Short) get(0); + } + + /** + * Setter for public.onboarding.data. + */ + public void setData(String value) { + set(1, value); + } + + /** + * Getter for public.onboarding.data. + */ + public String getData() { + return (String) get(1); + } + + /** + * Setter for public.onboarding.page. + */ + public void setPage(String value) { + set(2, value); + } + + /** + * Getter for public.onboarding.page. + */ + public String getPage() { + return (String) get(2); + } + + /** + * Setter for public.onboarding.available_from. + */ + public void setAvailableFrom(Timestamp value) { + set(3, value); + } + + /** + * Getter for public.onboarding.available_from. + */ + public Timestamp getAvailableFrom() { + return (Timestamp) get(3); + } + + /** + * Setter for public.onboarding.available_to. + */ + public void setAvailableTo(Timestamp value) { + set(4, value); + } + + /** + * Getter for public.onboarding.available_to. + */ + public Timestamp getAvailableTo() { + return (Timestamp) get(4); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return JOnboarding.ONBOARDING.ID; + } + + @Override + public Field field2() { + return JOnboarding.ONBOARDING.DATA; + } + + @Override + public Field field3() { + return JOnboarding.ONBOARDING.PAGE; + } + + @Override + public Field field4() { + return JOnboarding.ONBOARDING.AVAILABLE_FROM; + } + + @Override + public Field field5() { + return JOnboarding.ONBOARDING.AVAILABLE_TO; + } + + @Override + public Short component1() { + return getId(); + } + + @Override + public String component2() { + return getData(); + } + + @Override + public String component3() { + return getPage(); + } + + @Override + public Timestamp component4() { + return getAvailableFrom(); + } + + @Override + public Timestamp component5() { + return getAvailableTo(); + } + + @Override + public Short value1() { + return getId(); + } + + @Override + public String value2() { + return getData(); + } + + @Override + public String value3() { + return getPage(); + } + + @Override + public Timestamp value4() { + return getAvailableFrom(); + } + + @Override + public Timestamp value5() { + return getAvailableTo(); + } + + @Override + public JOnboardingRecord value1(Short value) { + setId(value); + return this; + } + + @Override + public JOnboardingRecord value2(String value) { + setData(value); + return this; + } + + @Override + public JOnboardingRecord value3(String value) { + setPage(value); + return this; + } + + @Override + public JOnboardingRecord value4(Timestamp value) { + setAvailableFrom(value); + return this; + } + + @Override + public JOnboardingRecord value5(Timestamp value) { + setAvailableTo(value); + return this; + } + + @Override + public JOnboardingRecord values(Short value1, String value2, String value3, Timestamp value4, Timestamp value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JOnboardingRecord + */ + public JOnboardingRecord() { + super(JOnboarding.ONBOARDING); + } + + /** + * Create a detached, initialised JOnboardingRecord + */ + public JOnboardingRecord(Short id, String data, String page, Timestamp availableFrom, Timestamp availableTo) { + super(JOnboarding.ONBOARDING); + + set(0, id); + set(1, data); + set(2, page); + set(3, availableFrom); + set(4, availableTo); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationAttributeRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationAttributeRecord.java new file mode 100644 index 000000000..6ea2d5c0c --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationAttributeRecord.java @@ -0,0 +1,264 @@ +/* + * This file is generated by jOOQ. + */ +package com.epam.ta.reportportal.jooq.tables.records; + + +import com.epam.ta.reportportal.jooq.tables.JOrganizationAttribute; + +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record5; +import org.jooq.Row5; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.4" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JOrganizationAttributeRecord extends UpdatableRecordImpl implements Record5 { + + private static final long serialVersionUID = 2074289218; + + /** + * Setter for public.organization_attribute.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.organization_attribute.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.organization_attribute.key. + */ + public void setKey(String value) { + set(1, value); + } + + /** + * Getter for public.organization_attribute.key. + */ + public String getKey() { + return (String) get(1); + } + + /** + * Setter for public.organization_attribute.value. + */ + public void setValue(String value) { + set(2, value); + } + + /** + * Getter for public.organization_attribute.value. + */ + public String getValue() { + return (String) get(2); + } + + /** + * Setter for public.organization_attribute.system. + */ + public void setSystem(Boolean value) { + set(3, value); + } + + /** + * Getter for public.organization_attribute.system. + */ + public Boolean getSystem() { + return (Boolean) get(3); + } + + /** + * Setter for public.organization_attribute.organization_id. + */ + public void setOrganizationId(Long value) { + set(4, value); + } + + /** + * Getter for public.organization_attribute.organization_id. + */ + public Long getOrganizationId() { + return (Long) get(4); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return JOrganizationAttribute.ORGANIZATION_ATTRIBUTE.ID; + } + + @Override + public Field field2() { + return JOrganizationAttribute.ORGANIZATION_ATTRIBUTE.KEY; + } + + @Override + public Field field3() { + return JOrganizationAttribute.ORGANIZATION_ATTRIBUTE.VALUE; + } + + @Override + public Field field4() { + return JOrganizationAttribute.ORGANIZATION_ATTRIBUTE.SYSTEM; + } + + @Override + public Field field5() { + return JOrganizationAttribute.ORGANIZATION_ATTRIBUTE.ORGANIZATION_ID; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getKey(); + } + + @Override + public String component3() { + return getValue(); + } + + @Override + public Boolean component4() { + return getSystem(); + } + + @Override + public Long component5() { + return getOrganizationId(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getKey(); + } + + @Override + public String value3() { + return getValue(); + } + + @Override + public Boolean value4() { + return getSystem(); + } + + @Override + public Long value5() { + return getOrganizationId(); + } + + @Override + public JOrganizationAttributeRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JOrganizationAttributeRecord value2(String value) { + setKey(value); + return this; + } + + @Override + public JOrganizationAttributeRecord value3(String value) { + setValue(value); + return this; + } + + @Override + public JOrganizationAttributeRecord value4(Boolean value) { + setSystem(value); + return this; + } + + @Override + public JOrganizationAttributeRecord value5(Long value) { + setOrganizationId(value); + return this; + } + + @Override + public JOrganizationAttributeRecord values(Long value1, String value2, String value3, Boolean value4, Long value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JOrganizationAttributeRecord + */ + public JOrganizationAttributeRecord() { + super(JOrganizationAttribute.ORGANIZATION_ATTRIBUTE); + } + + /** + * Create a detached, initialised JOrganizationAttributeRecord + */ + public JOrganizationAttributeRecord(Long id, String key, String value, Boolean system, Long organizationId) { + super(JOrganizationAttribute.ORGANIZATION_ATTRIBUTE); + + set(0, id); + set(1, key); + set(2, value); + set(3, system); + set(4, organizationId); + } +} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationRecord.java new file mode 100644 index 000000000..b69e5cc2a --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationRecord.java @@ -0,0 +1,153 @@ +/* + * This file is generated by jOOQ. + */ +package com.epam.ta.reportportal.jooq.tables.records; + + +import com.epam.ta.reportportal.jooq.tables.JOrganization; + +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record2; +import org.jooq.Row2; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.4" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JOrganizationRecord extends UpdatableRecordImpl implements Record2 { + + private static final long serialVersionUID = 1068958172; + + /** + * Setter for public.organization.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.organization.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.organization.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.organization.name. + */ + public String getName() { + return (String) get(1); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JOrganization.ORGANIZATION.ID; + } + + @Override + public Field field2() { + return JOrganization.ORGANIZATION.NAME; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public JOrganizationRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JOrganizationRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JOrganizationRecord values(Long value1, String value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JOrganizationRecord + */ + public JOrganizationRecord() { + super(JOrganization.ORGANIZATION); + } + + /** + * Create a detached, initialised JOrganizationRecord + */ + public JOrganizationRecord(Long id, String name) { + super(JOrganization.ORGANIZATION); + + set(0, id); + set(1, name); + } +} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOwnedEntityRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOwnedEntityRecord.java new file mode 100644 index 000000000..047b04ec5 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOwnedEntityRecord.java @@ -0,0 +1,190 @@ +/* + * This file is generated by jOOQ. + */ +package com.epam.ta.reportportal.jooq.tables.records; + + +import com.epam.ta.reportportal.jooq.tables.JOwnedEntity; + +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.4" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JOwnedEntityRecord extends UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = -1583001151; + + /** + * Setter for public.owned_entity.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.owned_entity.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.owned_entity.owner. + */ + public void setOwner(String value) { + set(1, value); + } + + /** + * Getter for public.owned_entity.owner. + */ + public String getOwner() { + return (String) get(1); + } + + /** + * Setter for public.owned_entity.project_id. + */ + public void setProjectId(Long value) { + set(2, value); + } + + /** + * Getter for public.owned_entity.project_id. + */ + public Long getProjectId() { + return (Long) get(2); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JOwnedEntity.OWNED_ENTITY.ID; + } + + @Override + public Field field2() { + return JOwnedEntity.OWNED_ENTITY.OWNER; + } + + @Override + public Field field3() { + return JOwnedEntity.OWNED_ENTITY.PROJECT_ID; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getOwner(); + } + + @Override + public Long component3() { + return getProjectId(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getOwner(); + } + + @Override + public Long value3() { + return getProjectId(); + } + + @Override + public JOwnedEntityRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JOwnedEntityRecord value2(String value) { + setOwner(value); + return this; + } + + @Override + public JOwnedEntityRecord value3(Long value) { + setProjectId(value); + return this; + } + + @Override + public JOwnedEntityRecord values(Long value1, String value2, Long value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JOwnedEntityRecord + */ + public JOwnedEntityRecord() { + super(JOwnedEntity.OWNED_ENTITY); + } + + /** + * Create a detached, initialised JOwnedEntityRecord + */ + public JOwnedEntityRecord(Long id, String owner, Long projectId) { + super(JOwnedEntity.OWNED_ENTITY); + + set(0, id); + set(1, owner); + set(2, projectId); + } +} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JParameterRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JParameterRecord.java old mode 100755 new mode 100644 index fff4862c3..2778ef7b7 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JParameterRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JParameterRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JParameter; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record3; import org.jooq.Row3; @@ -22,158 +24,157 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JParameterRecord extends TableRecordImpl implements - Record3 { - - private static final long serialVersionUID = 607314343; - - /** - * Create a detached JParameterRecord - */ - public JParameterRecord() { - super(JParameter.PARAMETER); - } - - /** - * Create a detached, initialised JParameterRecord - */ - public JParameterRecord(Long itemId, String key, String value) { - super(JParameter.PARAMETER); - - set(0, itemId); - set(1, key); - set(2, value); - } - - /** - * Getter for public.parameter.item_id. - */ - public Long getItemId() { - return (Long) get(0); - } - - /** - * Setter for public.parameter.item_id. - */ - public void setItemId(Long value) { - set(0, value); - } - - /** - * Getter for public.parameter.key. - */ - public String getKey() { - return (String) get(1); - } - - /** - * Setter for public.parameter.key. - */ - public void setKey(String value) { - set(1, value); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - /** - * Getter for public.parameter.value. - */ - public String getValue() { - return (String) get(2); - } - - /** - * Setter for public.parameter.value. - */ - public void setValue(String value) { - set(2, value); - } - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JParameter.PARAMETER.ITEM_ID; - } - - @Override - public Field field2() { - return JParameter.PARAMETER.KEY; - } - - @Override - public Field field3() { - return JParameter.PARAMETER.VALUE; - } - - @Override - public Long component1() { - return getItemId(); - } - - @Override - public String component2() { - return getKey(); - } - - @Override - public String component3() { - return getValue(); - } - - @Override - public Long value1() { - return getItemId(); - } - - @Override - public String value2() { - return getKey(); - } - - @Override - public String value3() { - return getValue(); - } - - @Override - public JParameterRecord value1(Long value) { - setItemId(value); - return this; - } - - @Override - public JParameterRecord value2(String value) { - setKey(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JParameterRecord value3(String value) { - setValue(value); - return this; - } - - @Override - public JParameterRecord values(Long value1, String value2, String value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JParameterRecord extends TableRecordImpl implements Record3 { + + private static final long serialVersionUID = 607314343; + + /** + * Setter for public.parameter.item_id. + */ + public void setItemId(Long value) { + set(0, value); + } + + /** + * Getter for public.parameter.item_id. + */ + public Long getItemId() { + return (Long) get(0); + } + + /** + * Setter for public.parameter.key. + */ + public void setKey(String value) { + set(1, value); + } + + /** + * Getter for public.parameter.key. + */ + public String getKey() { + return (String) get(1); + } + + /** + * Setter for public.parameter.value. + */ + public void setValue(String value) { + set(2, value); + } + + /** + * Getter for public.parameter.value. + */ + public String getValue() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JParameter.PARAMETER.ITEM_ID; + } + + @Override + public Field field2() { + return JParameter.PARAMETER.KEY; + } + + @Override + public Field field3() { + return JParameter.PARAMETER.VALUE; + } + + @Override + public Long component1() { + return getItemId(); + } + + @Override + public String component2() { + return getKey(); + } + + @Override + public String component3() { + return getValue(); + } + + @Override + public Long value1() { + return getItemId(); + } + + @Override + public String value2() { + return getKey(); + } + + @Override + public String value3() { + return getValue(); + } + + @Override + public JParameterRecord value1(Long value) { + setItemId(value); + return this; + } + + @Override + public JParameterRecord value2(String value) { + setKey(value); + return this; + } + + @Override + public JParameterRecord value3(String value) { + setValue(value); + return this; + } + + @Override + public JParameterRecord values(Long value1, String value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JParameterRecord + */ + public JParameterRecord() { + super(JParameter.PARAMETER); + } + + /** + * Create a detached, initialised JParameterRecord + */ + public JParameterRecord(Long itemId, String key, String value) { + super(JParameter.PARAMETER); + + set(0, itemId); + set(1, key); + set(2, value); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateRecord.java old mode 100755 new mode 100644 index 4b489177c..acff7d0b0 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JPatternTemplate; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record6; @@ -23,280 +25,277 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JPatternTemplateRecord extends UpdatableRecordImpl implements - Record6 { - - private static final long serialVersionUID = -264502879; - - /** - * Create a detached JPatternTemplateRecord - */ - public JPatternTemplateRecord() { - super(JPatternTemplate.PATTERN_TEMPLATE); - } - - /** - * Create a detached, initialised JPatternTemplateRecord - */ - public JPatternTemplateRecord(Long id, String name, String value, String type, Boolean enabled, - Long projectId) { - super(JPatternTemplate.PATTERN_TEMPLATE); - - set(0, id); - set(1, name); - set(2, value); - set(3, type); - set(4, enabled); - set(5, projectId); - } - - /** - * Getter for public.pattern_template.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.pattern_template.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.pattern_template.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.pattern_template.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.pattern_template.value. - */ - public String getValue() { - return (String) get(2); - } - - /** - * Setter for public.pattern_template.value. - */ - public void setValue(String value) { - set(2, value); - } - - /** - * Getter for public.pattern_template.type. - */ - public String getType() { - return (String) get(3); - } - - /** - * Setter for public.pattern_template.type. - */ - public void setType(String value) { - set(3, value); - } - - /** - * Getter for public.pattern_template.enabled. - */ - public Boolean getEnabled() { - return (Boolean) get(4); - } - - /** - * Setter for public.pattern_template.enabled. - */ - public void setEnabled(Boolean value) { - set(4, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.pattern_template.project_id. - */ - public Long getProjectId() { - return (Long) get(5); - } - - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.pattern_template.project_id. - */ - public void setProjectId(Long value) { - set(5, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return JPatternTemplate.PATTERN_TEMPLATE.ID; - } - - @Override - public Field field2() { - return JPatternTemplate.PATTERN_TEMPLATE.NAME; - } - - @Override - public Field field3() { - return JPatternTemplate.PATTERN_TEMPLATE.VALUE; - } - - @Override - public Field field4() { - return JPatternTemplate.PATTERN_TEMPLATE.TYPE; - } - - @Override - public Field field5() { - return JPatternTemplate.PATTERN_TEMPLATE.ENABLED; - } - - @Override - public Field field6() { - return JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public String component3() { - return getValue(); - } - - @Override - public String component4() { - return getType(); - } - - @Override - public Boolean component5() { - return getEnabled(); - } - - @Override - public Long component6() { - return getProjectId(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public String value3() { - return getValue(); - } - - @Override - public String value4() { - return getType(); - } - - @Override - public Boolean value5() { - return getEnabled(); - } - - @Override - public Long value6() { - return getProjectId(); - } - - @Override - public JPatternTemplateRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JPatternTemplateRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JPatternTemplateRecord value3(String value) { - setValue(value); - return this; - } - - @Override - public JPatternTemplateRecord value4(String value) { - setType(value); - return this; - } - - @Override - public JPatternTemplateRecord value5(Boolean value) { - setEnabled(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JPatternTemplateRecord value6(Long value) { - setProjectId(value); - return this; - } - - @Override - public JPatternTemplateRecord values(Long value1, String value2, String value3, String value4, - Boolean value5, Long value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JPatternTemplateRecord extends UpdatableRecordImpl implements Record6 { + + private static final long serialVersionUID = -264502879; + + /** + * Setter for public.pattern_template.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.pattern_template.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.pattern_template.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.pattern_template.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.pattern_template.value. + */ + public void setValue(String value) { + set(2, value); + } + + /** + * Getter for public.pattern_template.value. + */ + public String getValue() { + return (String) get(2); + } + + /** + * Setter for public.pattern_template.type. + */ + public void setType(String value) { + set(3, value); + } + + /** + * Getter for public.pattern_template.type. + */ + public String getType() { + return (String) get(3); + } + + /** + * Setter for public.pattern_template.enabled. + */ + public void setEnabled(Boolean value) { + set(4, value); + } + + /** + * Getter for public.pattern_template.enabled. + */ + public Boolean getEnabled() { + return (Boolean) get(4); + } + + /** + * Setter for public.pattern_template.project_id. + */ + public void setProjectId(Long value) { + set(5, value); + } + + /** + * Getter for public.pattern_template.project_id. + */ + public Long getProjectId() { + return (Long) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return JPatternTemplate.PATTERN_TEMPLATE.ID; + } + + @Override + public Field field2() { + return JPatternTemplate.PATTERN_TEMPLATE.NAME; + } + + @Override + public Field field3() { + return JPatternTemplate.PATTERN_TEMPLATE.VALUE; + } + + @Override + public Field field4() { + return JPatternTemplate.PATTERN_TEMPLATE.TYPE; + } + + @Override + public Field field5() { + return JPatternTemplate.PATTERN_TEMPLATE.ENABLED; + } + + @Override + public Field field6() { + return JPatternTemplate.PATTERN_TEMPLATE.PROJECT_ID; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public String component3() { + return getValue(); + } + + @Override + public String component4() { + return getType(); + } + + @Override + public Boolean component5() { + return getEnabled(); + } + + @Override + public Long component6() { + return getProjectId(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public String value3() { + return getValue(); + } + + @Override + public String value4() { + return getType(); + } + + @Override + public Boolean value5() { + return getEnabled(); + } + + @Override + public Long value6() { + return getProjectId(); + } + + @Override + public JPatternTemplateRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JPatternTemplateRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JPatternTemplateRecord value3(String value) { + setValue(value); + return this; + } + + @Override + public JPatternTemplateRecord value4(String value) { + setType(value); + return this; + } + + @Override + public JPatternTemplateRecord value5(Boolean value) { + setEnabled(value); + return this; + } + + @Override + public JPatternTemplateRecord value6(Long value) { + setProjectId(value); + return this; + } + + @Override + public JPatternTemplateRecord values(Long value1, String value2, String value3, String value4, Boolean value5, Long value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JPatternTemplateRecord + */ + public JPatternTemplateRecord() { + super(JPatternTemplate.PATTERN_TEMPLATE); + } + + /** + * Create a detached, initialised JPatternTemplateRecord + */ + public JPatternTemplateRecord(Long id, String name, String value, String type, Boolean enabled, Long projectId) { + super(JPatternTemplate.PATTERN_TEMPLATE); + + set(0, id); + set(1, name); + set(2, value); + set(3, type); + set(4, enabled); + set(5, projectId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateTestItemRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateTestItemRecord.java old mode 100755 new mode 100644 index d79a4236e..67dabcd8a --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateTestItemRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPatternTemplateTestItemRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JPatternTemplateTestItem; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -22,130 +24,129 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JPatternTemplateTestItemRecord extends - UpdatableRecordImpl implements Record2 { - - private static final long serialVersionUID = 884087599; - - /** - * Create a detached JPatternTemplateTestItemRecord - */ - public JPatternTemplateTestItemRecord() { - super(JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM); - } - - /** - * Create a detached, initialised JPatternTemplateTestItemRecord - */ - public JPatternTemplateTestItemRecord(Long patternId, Long itemId) { - super(JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM); - - set(0, patternId); - set(1, itemId); - } - - /** - * Getter for public.pattern_template_test_item.pattern_id. - */ - public Long getPatternId() { - return (Long) get(0); - } - - /** - * Setter for public.pattern_template_test_item.pattern_id. - */ - public void setPatternId(Long value) { - set(0, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.pattern_template_test_item.item_id. - */ - public Long getItemId() { - return (Long) get(1); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.pattern_template_test_item.item_id. - */ - public void setItemId(Long value) { - set(1, value); - } - - @Override - public Record2 key() { - return (Record2) super.key(); - } - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID; - } - - @Override - public Field field2() { - return JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID; - } - - @Override - public Long component1() { - return getPatternId(); - } - - @Override - public Long component2() { - return getItemId(); - } - - @Override - public Long value1() { - return getPatternId(); - } - - @Override - public Long value2() { - return getItemId(); - } - - @Override - public JPatternTemplateTestItemRecord value1(Long value) { - setPatternId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JPatternTemplateTestItemRecord value2(Long value) { - setItemId(value); - return this; - } - - @Override - public JPatternTemplateTestItemRecord values(Long value1, Long value2) { - value1(value1); - value2(value2); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JPatternTemplateTestItemRecord extends UpdatableRecordImpl implements Record2 { + + private static final long serialVersionUID = 884087599; + + /** + * Setter for public.pattern_template_test_item.pattern_id. + */ + public void setPatternId(Long value) { + set(0, value); + } + + /** + * Getter for public.pattern_template_test_item.pattern_id. + */ + public Long getPatternId() { + return (Long) get(0); + } + + /** + * Setter for public.pattern_template_test_item.item_id. + */ + public void setItemId(Long value) { + set(1, value); + } + + /** + * Getter for public.pattern_template_test_item.item_id. + */ + public Long getItemId() { + return (Long) get(1); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID; + } + + @Override + public Field field2() { + return JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID; + } + + @Override + public Long component1() { + return getPatternId(); + } + + @Override + public Long component2() { + return getItemId(); + } + + @Override + public Long value1() { + return getPatternId(); + } + + @Override + public Long value2() { + return getItemId(); + } + + @Override + public JPatternTemplateTestItemRecord value1(Long value) { + setPatternId(value); + return this; + } + + @Override + public JPatternTemplateTestItemRecord value2(Long value) { + setItemId(value); + return this; + } + + @Override + public JPatternTemplateTestItemRecord values(Long value1, Long value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JPatternTemplateTestItemRecord + */ + public JPatternTemplateTestItemRecord() { + super(JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM); + } + + /** + * Create a detached, initialised JPatternTemplateTestItemRecord + */ + public JPatternTemplateTestItemRecord(Long patternId, Long itemId) { + super(JPatternTemplateTestItem.PATTERN_TEMPLATE_TEST_ITEM); + + set(0, patternId); + set(1, itemId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPgpArmorHeadersRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPgpArmorHeadersRecord.java index fd160b6d3..aebb70718 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPgpArmorHeadersRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JPgpArmorHeadersRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JPgpArmorHeaders; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -22,121 +24,120 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JPgpArmorHeadersRecord extends TableRecordImpl implements - Record2 { - - private static final long serialVersionUID = 483081900; - - /** - * Create a detached JPgpArmorHeadersRecord - */ - public JPgpArmorHeadersRecord() { - super(JPgpArmorHeaders.PGP_ARMOR_HEADERS); - } - - /** - * Create a detached, initialised JPgpArmorHeadersRecord - */ - public JPgpArmorHeadersRecord(String key, String value) { - super(JPgpArmorHeaders.PGP_ARMOR_HEADERS); - - set(0, key); - set(1, value); - } - - /** - * Getter for public.pgp_armor_headers.key. - */ - public String getKey() { - return (String) get(0); - } - - /** - * Setter for public.pgp_armor_headers.key. - */ - public void setKey(String value) { - set(0, value); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - /** - * Getter for public.pgp_armor_headers.value. - */ - public String getValue() { - return (String) get(1); - } - - /** - * Setter for public.pgp_armor_headers.value. - */ - public void setValue(String value) { - set(1, value); - } - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JPgpArmorHeaders.PGP_ARMOR_HEADERS.KEY; - } - - @Override - public Field field2() { - return JPgpArmorHeaders.PGP_ARMOR_HEADERS.VALUE; - } - - @Override - public String component1() { - return getKey(); - } - - @Override - public String component2() { - return getValue(); - } - - @Override - public String value1() { - return getKey(); - } - - @Override - public String value2() { - return getValue(); - } - - @Override - public JPgpArmorHeadersRecord value1(String value) { - setKey(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JPgpArmorHeadersRecord value2(String value) { - setValue(value); - return this; - } - - @Override - public JPgpArmorHeadersRecord values(String value1, String value2) { - value1(value1); - value2(value2); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JPgpArmorHeadersRecord extends TableRecordImpl implements Record2 { + + private static final long serialVersionUID = 483081900; + + /** + * Setter for public.pgp_armor_headers.key. + */ + public void setKey(String value) { + set(0, value); + } + + /** + * Getter for public.pgp_armor_headers.key. + */ + public String getKey() { + return (String) get(0); + } + + /** + * Setter for public.pgp_armor_headers.value. + */ + public void setValue(String value) { + set(1, value); + } + + /** + * Getter for public.pgp_armor_headers.value. + */ + public String getValue() { + return (String) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JPgpArmorHeaders.PGP_ARMOR_HEADERS.KEY; + } + + @Override + public Field field2() { + return JPgpArmorHeaders.PGP_ARMOR_HEADERS.VALUE; + } + + @Override + public String component1() { + return getKey(); + } + + @Override + public String component2() { + return getValue(); + } + + @Override + public String value1() { + return getKey(); + } + + @Override + public String value2() { + return getValue(); + } + + @Override + public JPgpArmorHeadersRecord value1(String value) { + setKey(value); + return this; + } + + @Override + public JPgpArmorHeadersRecord value2(String value) { + setValue(value); + return this; + } + + @Override + public JPgpArmorHeadersRecord values(String value1, String value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JPgpArmorHeadersRecord + */ + public JPgpArmorHeadersRecord() { + super(JPgpArmorHeaders.PGP_ARMOR_HEADERS); + } + + /** + * Create a detached, initialised JPgpArmorHeadersRecord + */ + public JPgpArmorHeadersRecord(String key, String value) { + super(JPgpArmorHeaders.PGP_ARMOR_HEADERS); + + set(0, key); + set(1, value); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectAttributeRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectAttributeRecord.java old mode 100755 new mode 100644 index dbf6ddc68..d3de3e2cb --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectAttributeRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectAttributeRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JProjectAttribute; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record2; import org.jooq.Record3; @@ -23,167 +25,166 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JProjectAttributeRecord extends UpdatableRecordImpl implements - Record3 { - - private static final long serialVersionUID = -1540669256; - - /** - * Create a detached JProjectAttributeRecord - */ - public JProjectAttributeRecord() { - super(JProjectAttribute.PROJECT_ATTRIBUTE); - } - - /** - * Create a detached, initialised JProjectAttributeRecord - */ - public JProjectAttributeRecord(Long attributeId, String value, Long projectId) { - super(JProjectAttribute.PROJECT_ATTRIBUTE); - - set(0, attributeId); - set(1, value); - set(2, projectId); - } - - /** - * Getter for public.project_attribute.attribute_id. - */ - public Long getAttributeId() { - return (Long) get(0); - } - - /** - * Setter for public.project_attribute.attribute_id. - */ - public void setAttributeId(Long value) { - set(0, value); - } - - /** - * Getter for public.project_attribute.value. - */ - public String getValue() { - return (String) get(1); - } - - /** - * Setter for public.project_attribute.value. - */ - public void setValue(String value) { - set(1, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.project_attribute.project_id. - */ - public Long getProjectId() { - return (Long) get(2); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.project_attribute.project_id. - */ - public void setProjectId(Long value) { - set(2, value); - } - - @Override - public Record2 key() { - return (Record2) super.key(); - } - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID; - } - - @Override - public Field field2() { - return JProjectAttribute.PROJECT_ATTRIBUTE.VALUE; - } - - @Override - public Field field3() { - return JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID; - } - - @Override - public Long component1() { - return getAttributeId(); - } - - @Override - public String component2() { - return getValue(); - } - - @Override - public Long component3() { - return getProjectId(); - } - - @Override - public Long value1() { - return getAttributeId(); - } - - @Override - public String value2() { - return getValue(); - } - - @Override - public Long value3() { - return getProjectId(); - } - - @Override - public JProjectAttributeRecord value1(Long value) { - setAttributeId(value); - return this; - } - - @Override - public JProjectAttributeRecord value2(String value) { - setValue(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JProjectAttributeRecord value3(Long value) { - setProjectId(value); - return this; - } - - @Override - public JProjectAttributeRecord values(Long value1, String value2, Long value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JProjectAttributeRecord extends UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = -1540669256; + + /** + * Setter for public.project_attribute.attribute_id. + */ + public void setAttributeId(Long value) { + set(0, value); + } + + /** + * Getter for public.project_attribute.attribute_id. + */ + public Long getAttributeId() { + return (Long) get(0); + } + + /** + * Setter for public.project_attribute.value. + */ + public void setValue(String value) { + set(1, value); + } + + /** + * Getter for public.project_attribute.value. + */ + public String getValue() { + return (String) get(1); + } + + /** + * Setter for public.project_attribute.project_id. + */ + public void setProjectId(Long value) { + set(2, value); + } + + /** + * Getter for public.project_attribute.project_id. + */ + public Long getProjectId() { + return (Long) get(2); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JProjectAttribute.PROJECT_ATTRIBUTE.ATTRIBUTE_ID; + } + + @Override + public Field field2() { + return JProjectAttribute.PROJECT_ATTRIBUTE.VALUE; + } + + @Override + public Field field3() { + return JProjectAttribute.PROJECT_ATTRIBUTE.PROJECT_ID; + } + + @Override + public Long component1() { + return getAttributeId(); + } + + @Override + public String component2() { + return getValue(); + } + + @Override + public Long component3() { + return getProjectId(); + } + + @Override + public Long value1() { + return getAttributeId(); + } + + @Override + public String value2() { + return getValue(); + } + + @Override + public Long value3() { + return getProjectId(); + } + + @Override + public JProjectAttributeRecord value1(Long value) { + setAttributeId(value); + return this; + } + + @Override + public JProjectAttributeRecord value2(String value) { + setValue(value); + return this; + } + + @Override + public JProjectAttributeRecord value3(Long value) { + setProjectId(value); + return this; + } + + @Override + public JProjectAttributeRecord values(Long value1, String value2, Long value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JProjectAttributeRecord + */ + public JProjectAttributeRecord() { + super(JProjectAttribute.PROJECT_ATTRIBUTE); + } + + /** + * Create a detached, initialised JProjectAttributeRecord + */ + public JProjectAttributeRecord(Long attributeId, String value, Long projectId) { + super(JProjectAttribute.PROJECT_ATTRIBUTE); + + set(0, attributeId); + set(1, value); + set(2, projectId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectRecord.java old mode 100755 new mode 100644 index 5185dfb46..164b64e73 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectRecord.java @@ -5,8 +5,11 @@ import com.epam.ta.reportportal.jooq.tables.JProject; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.JSONB; import org.jooq.Record1; @@ -25,317 +28,314 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JProjectRecord extends UpdatableRecordImpl implements - Record7 { - - private static final long serialVersionUID = 832057346; - - /** - * Create a detached JProjectRecord - */ - public JProjectRecord() { - super(JProject.PROJECT); - } - - /** - * Create a detached, initialised JProjectRecord - */ - public JProjectRecord(Long id, String name, String projectType, String organization, - Timestamp creationDate, JSONB metadata, Long allocatedStorage) { - super(JProject.PROJECT); - - set(0, id); - set(1, name); - set(2, projectType); - set(3, organization); - set(4, creationDate); - set(5, metadata); - set(6, allocatedStorage); - } - - /** - * Getter for public.project.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.project.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.project.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.project.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.project.project_type. - */ - public String getProjectType() { - return (String) get(2); - } - - /** - * Setter for public.project.project_type. - */ - public void setProjectType(String value) { - set(2, value); - } - - /** - * Getter for public.project.organization. - */ - public String getOrganization() { - return (String) get(3); - } - - /** - * Setter for public.project.organization. - */ - public void setOrganization(String value) { - set(3, value); - } - - /** - * Getter for public.project.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(4); - } - - /** - * Setter for public.project.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(4, value); - } - - /** - * Getter for public.project.metadata. - */ - public JSONB getMetadata() { - return (JSONB) get(5); - } - - /** - * Setter for public.project.metadata. - */ - public void setMetadata(JSONB value) { - set(5, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.project.allocated_storage. - */ - public Long getAllocatedStorage() { - return (Long) get(6); - } - - // ------------------------------------------------------------------------- - // Record7 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.project.allocated_storage. - */ - public void setAllocatedStorage(Long value) { - set(6, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); - } - - @Override - public Row7 valuesRow() { - return (Row7) super.valuesRow(); - } - - @Override - public Field field1() { - return JProject.PROJECT.ID; - } - - @Override - public Field field2() { - return JProject.PROJECT.NAME; - } - - @Override - public Field field3() { - return JProject.PROJECT.PROJECT_TYPE; - } - - @Override - public Field field4() { - return JProject.PROJECT.ORGANIZATION; - } - - @Override - public Field field5() { - return JProject.PROJECT.CREATION_DATE; - } - - @Override - public Field field6() { - return JProject.PROJECT.METADATA; - } - - @Override - public Field field7() { - return JProject.PROJECT.ALLOCATED_STORAGE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public String component3() { - return getProjectType(); - } - - @Override - public String component4() { - return getOrganization(); - } - - @Override - public Timestamp component5() { - return getCreationDate(); - } - - @Override - public JSONB component6() { - return getMetadata(); - } - - @Override - public Long component7() { - return getAllocatedStorage(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public String value3() { - return getProjectType(); - } - - @Override - public String value4() { - return getOrganization(); - } - - @Override - public Timestamp value5() { - return getCreationDate(); - } - - @Override - public JSONB value6() { - return getMetadata(); - } - - @Override - public Long value7() { - return getAllocatedStorage(); - } - - @Override - public JProjectRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JProjectRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JProjectRecord value3(String value) { - setProjectType(value); - return this; - } - - @Override - public JProjectRecord value4(String value) { - setOrganization(value); - return this; - } - - @Override - public JProjectRecord value5(Timestamp value) { - setCreationDate(value); - return this; - } - - @Override - public JProjectRecord value6(JSONB value) { - setMetadata(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JProjectRecord value7(Long value) { - setAllocatedStorage(value); - return this; - } - - @Override - public JProjectRecord values(Long value1, String value2, String value3, String value4, - Timestamp value5, JSONB value6, Long value7) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JProjectRecord extends UpdatableRecordImpl implements Record7 { + + private static final long serialVersionUID = 832057346; + + /** + * Setter for public.project.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.project.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.project.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.project.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.project.project_type. + */ + public void setProjectType(String value) { + set(2, value); + } + + /** + * Getter for public.project.project_type. + */ + public String getProjectType() { + return (String) get(2); + } + + /** + * Setter for public.project.organization. + */ + public void setOrganization(String value) { + set(3, value); + } + + /** + * Getter for public.project.organization. + */ + public String getOrganization() { + return (String) get(3); + } + + /** + * Setter for public.project.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(4, value); + } + + /** + * Getter for public.project.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(4); + } + + /** + * Setter for public.project.metadata. + */ + public void setMetadata(JSONB value) { + set(5, value); + } + + /** + * Getter for public.project.metadata. + */ + public JSONB getMetadata() { + return (JSONB) get(5); + } + + /** + * Setter for public.project.allocated_storage. + */ + public void setAllocatedStorage(Long value) { + set(6, value); + } + + /** + * Getter for public.project.allocated_storage. + */ + public Long getAllocatedStorage() { + return (Long) get(6); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record7 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + @Override + public Row7 valuesRow() { + return (Row7) super.valuesRow(); + } + + @Override + public Field field1() { + return JProject.PROJECT.ID; + } + + @Override + public Field field2() { + return JProject.PROJECT.NAME; + } + + @Override + public Field field3() { + return JProject.PROJECT.PROJECT_TYPE; + } + + @Override + public Field field4() { + return JProject.PROJECT.ORGANIZATION; + } + + @Override + public Field field5() { + return JProject.PROJECT.CREATION_DATE; + } + + @Override + public Field field6() { + return JProject.PROJECT.METADATA; + } + + @Override + public Field field7() { + return JProject.PROJECT.ALLOCATED_STORAGE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public String component3() { + return getProjectType(); + } + + @Override + public String component4() { + return getOrganization(); + } + + @Override + public Timestamp component5() { + return getCreationDate(); + } + + @Override + public JSONB component6() { + return getMetadata(); + } + + @Override + public Long component7() { + return getAllocatedStorage(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public String value3() { + return getProjectType(); + } + + @Override + public String value4() { + return getOrganization(); + } + + @Override + public Timestamp value5() { + return getCreationDate(); + } + + @Override + public JSONB value6() { + return getMetadata(); + } + + @Override + public Long value7() { + return getAllocatedStorage(); + } + + @Override + public JProjectRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JProjectRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JProjectRecord value3(String value) { + setProjectType(value); + return this; + } + + @Override + public JProjectRecord value4(String value) { + setOrganization(value); + return this; + } + + @Override + public JProjectRecord value5(Timestamp value) { + setCreationDate(value); + return this; + } + + @Override + public JProjectRecord value6(JSONB value) { + setMetadata(value); + return this; + } + + @Override + public JProjectRecord value7(Long value) { + setAllocatedStorage(value); + return this; + } + + @Override + public JProjectRecord values(Long value1, String value2, String value3, String value4, Timestamp value5, JSONB value6, Long value7) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JProjectRecord + */ + public JProjectRecord() { + super(JProject.PROJECT); + } + + /** + * Create a detached, initialised JProjectRecord + */ + public JProjectRecord(Long id, String name, String projectType, String organization, Timestamp creationDate, JSONB metadata, Long allocatedStorage) { + super(JProject.PROJECT); + + set(0, id); + set(1, name); + set(2, projectType); + set(3, organization); + set(4, creationDate); + set(5, metadata); + set(6, allocatedStorage); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectUserRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectUserRecord.java old mode 100755 new mode 100644 index c87a5598d..6604b6c18 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectUserRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JProjectUserRecord.java @@ -6,7 +6,9 @@ import com.epam.ta.reportportal.jooq.enums.JProjectRoleEnum; import com.epam.ta.reportportal.jooq.tables.JProjectUser; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record2; import org.jooq.Record3; @@ -24,167 +26,166 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JProjectUserRecord extends UpdatableRecordImpl implements - Record3 { - - private static final long serialVersionUID = -388211168; - - /** - * Create a detached JProjectUserRecord - */ - public JProjectUserRecord() { - super(JProjectUser.PROJECT_USER); - } - - /** - * Create a detached, initialised JProjectUserRecord - */ - public JProjectUserRecord(Long userId, Long projectId, JProjectRoleEnum projectRole) { - super(JProjectUser.PROJECT_USER); - - set(0, userId); - set(1, projectId); - set(2, projectRole); - } - - /** - * Getter for public.project_user.user_id. - */ - public Long getUserId() { - return (Long) get(0); - } - - /** - * Setter for public.project_user.user_id. - */ - public void setUserId(Long value) { - set(0, value); - } - - /** - * Getter for public.project_user.project_id. - */ - public Long getProjectId() { - return (Long) get(1); - } - - /** - * Setter for public.project_user.project_id. - */ - public void setProjectId(Long value) { - set(1, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.project_user.project_role. - */ - public JProjectRoleEnum getProjectRole() { - return (JProjectRoleEnum) get(2); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.project_user.project_role. - */ - public void setProjectRole(JProjectRoleEnum value) { - set(2, value); - } - - @Override - public Record2 key() { - return (Record2) super.key(); - } - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JProjectUser.PROJECT_USER.USER_ID; - } - - @Override - public Field field2() { - return JProjectUser.PROJECT_USER.PROJECT_ID; - } - - @Override - public Field field3() { - return JProjectUser.PROJECT_USER.PROJECT_ROLE; - } - - @Override - public Long component1() { - return getUserId(); - } - - @Override - public Long component2() { - return getProjectId(); - } - - @Override - public JProjectRoleEnum component3() { - return getProjectRole(); - } - - @Override - public Long value1() { - return getUserId(); - } - - @Override - public Long value2() { - return getProjectId(); - } - - @Override - public JProjectRoleEnum value3() { - return getProjectRole(); - } - - @Override - public JProjectUserRecord value1(Long value) { - setUserId(value); - return this; - } - - @Override - public JProjectUserRecord value2(Long value) { - setProjectId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JProjectUserRecord value3(JProjectRoleEnum value) { - setProjectRole(value); - return this; - } - - @Override - public JProjectUserRecord values(Long value1, Long value2, JProjectRoleEnum value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JProjectUserRecord extends UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = -388211168; + + /** + * Setter for public.project_user.user_id. + */ + public void setUserId(Long value) { + set(0, value); + } + + /** + * Getter for public.project_user.user_id. + */ + public Long getUserId() { + return (Long) get(0); + } + + /** + * Setter for public.project_user.project_id. + */ + public void setProjectId(Long value) { + set(1, value); + } + + /** + * Getter for public.project_user.project_id. + */ + public Long getProjectId() { + return (Long) get(1); + } + + /** + * Setter for public.project_user.project_role. + */ + public void setProjectRole(JProjectRoleEnum value) { + set(2, value); + } + + /** + * Getter for public.project_user.project_role. + */ + public JProjectRoleEnum getProjectRole() { + return (JProjectRoleEnum) get(2); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JProjectUser.PROJECT_USER.USER_ID; + } + + @Override + public Field field2() { + return JProjectUser.PROJECT_USER.PROJECT_ID; + } + + @Override + public Field field3() { + return JProjectUser.PROJECT_USER.PROJECT_ROLE; + } + + @Override + public Long component1() { + return getUserId(); + } + + @Override + public Long component2() { + return getProjectId(); + } + + @Override + public JProjectRoleEnum component3() { + return getProjectRole(); + } + + @Override + public Long value1() { + return getUserId(); + } + + @Override + public Long value2() { + return getProjectId(); + } + + @Override + public JProjectRoleEnum value3() { + return getProjectRole(); + } + + @Override + public JProjectUserRecord value1(Long value) { + setUserId(value); + return this; + } + + @Override + public JProjectUserRecord value2(Long value) { + setProjectId(value); + return this; + } + + @Override + public JProjectUserRecord value3(JProjectRoleEnum value) { + setProjectRole(value); + return this; + } + + @Override + public JProjectUserRecord values(Long value1, Long value2, JProjectRoleEnum value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JProjectUserRecord + */ + public JProjectUserRecord() { + super(JProjectUser.PROJECT_USER); + } + + /** + * Create a detached, initialised JProjectUserRecord + */ + public JProjectUserRecord(Long userId, Long projectId, JProjectRoleEnum projectRole) { + super(JProjectUser.PROJECT_USER); + + set(0, userId); + set(1, projectId); + set(2, projectRole); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRecipientsRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRecipientsRecord.java old mode 100755 new mode 100644 index b824e5f0d..aee2b16d9 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRecipientsRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRecipientsRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JRecipients; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -22,121 +24,120 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JRecipientsRecord extends TableRecordImpl implements - Record2 { - - private static final long serialVersionUID = 662647080; - - /** - * Create a detached JRecipientsRecord - */ - public JRecipientsRecord() { - super(JRecipients.RECIPIENTS); - } - - /** - * Create a detached, initialised JRecipientsRecord - */ - public JRecipientsRecord(Long senderCaseId, String recipient) { - super(JRecipients.RECIPIENTS); - - set(0, senderCaseId); - set(1, recipient); - } - - /** - * Getter for public.recipients.sender_case_id. - */ - public Long getSenderCaseId() { - return (Long) get(0); - } - - /** - * Setter for public.recipients.sender_case_id. - */ - public void setSenderCaseId(Long value) { - set(0, value); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - /** - * Getter for public.recipients.recipient. - */ - public String getRecipient() { - return (String) get(1); - } - - /** - * Setter for public.recipients.recipient. - */ - public void setRecipient(String value) { - set(1, value); - } - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JRecipients.RECIPIENTS.SENDER_CASE_ID; - } - - @Override - public Field field2() { - return JRecipients.RECIPIENTS.RECIPIENT; - } - - @Override - public Long component1() { - return getSenderCaseId(); - } - - @Override - public String component2() { - return getRecipient(); - } - - @Override - public Long value1() { - return getSenderCaseId(); - } - - @Override - public String value2() { - return getRecipient(); - } - - @Override - public JRecipientsRecord value1(Long value) { - setSenderCaseId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JRecipientsRecord value2(String value) { - setRecipient(value); - return this; - } - - @Override - public JRecipientsRecord values(Long value1, String value2) { - value1(value1); - value2(value2); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JRecipientsRecord extends TableRecordImpl implements Record2 { + + private static final long serialVersionUID = 662647080; + + /** + * Setter for public.recipients.sender_case_id. + */ + public void setSenderCaseId(Long value) { + set(0, value); + } + + /** + * Getter for public.recipients.sender_case_id. + */ + public Long getSenderCaseId() { + return (Long) get(0); + } + + /** + * Setter for public.recipients.recipient. + */ + public void setRecipient(String value) { + set(1, value); + } + + /** + * Getter for public.recipients.recipient. + */ + public String getRecipient() { + return (String) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JRecipients.RECIPIENTS.SENDER_CASE_ID; + } + + @Override + public Field field2() { + return JRecipients.RECIPIENTS.RECIPIENT; + } + + @Override + public Long component1() { + return getSenderCaseId(); + } + + @Override + public String component2() { + return getRecipient(); + } + + @Override + public Long value1() { + return getSenderCaseId(); + } + + @Override + public String value2() { + return getRecipient(); + } + + @Override + public JRecipientsRecord value1(Long value) { + setSenderCaseId(value); + return this; + } + + @Override + public JRecipientsRecord value2(String value) { + setRecipient(value); + return this; + } + + @Override + public JRecipientsRecord values(Long value1, String value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JRecipientsRecord + */ + public JRecipientsRecord() { + super(JRecipients.RECIPIENTS); + } + + /** + * Create a detached, initialised JRecipientsRecord + */ + public JRecipientsRecord(Long senderCaseId, String recipient) { + super(JRecipients.RECIPIENTS); + + set(0, senderCaseId); + set(1, recipient); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRestorePasswordBidRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRestorePasswordBidRecord.java index 4620c9ece..c62d12ce4 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRestorePasswordBidRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JRestorePasswordBidRecord.java @@ -5,8 +5,11 @@ import com.epam.ta.reportportal.jooq.tables.JRestorePasswordBid; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record3; @@ -24,167 +27,166 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JRestorePasswordBidRecord extends - UpdatableRecordImpl implements Record3 { - - private static final long serialVersionUID = -2003482281; - - /** - * Create a detached JRestorePasswordBidRecord - */ - public JRestorePasswordBidRecord() { - super(JRestorePasswordBid.RESTORE_PASSWORD_BID); - } - - /** - * Create a detached, initialised JRestorePasswordBidRecord - */ - public JRestorePasswordBidRecord(String uuid, Timestamp lastModified, String email) { - super(JRestorePasswordBid.RESTORE_PASSWORD_BID); - - set(0, uuid); - set(1, lastModified); - set(2, email); - } - - /** - * Getter for public.restore_password_bid.uuid. - */ - public String getUuid() { - return (String) get(0); - } - - /** - * Setter for public.restore_password_bid.uuid. - */ - public void setUuid(String value) { - set(0, value); - } - - /** - * Getter for public.restore_password_bid.last_modified. - */ - public Timestamp getLastModified() { - return (Timestamp) get(1); - } - - /** - * Setter for public.restore_password_bid.last_modified. - */ - public void setLastModified(Timestamp value) { - set(1, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.restore_password_bid.email. - */ - public String getEmail() { - return (String) get(2); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.restore_password_bid.email. - */ - public void setEmail(String value) { - set(2, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JRestorePasswordBid.RESTORE_PASSWORD_BID.UUID; - } - - @Override - public Field field2() { - return JRestorePasswordBid.RESTORE_PASSWORD_BID.LAST_MODIFIED; - } - - @Override - public Field field3() { - return JRestorePasswordBid.RESTORE_PASSWORD_BID.EMAIL; - } - - @Override - public String component1() { - return getUuid(); - } - - @Override - public Timestamp component2() { - return getLastModified(); - } - - @Override - public String component3() { - return getEmail(); - } - - @Override - public String value1() { - return getUuid(); - } - - @Override - public Timestamp value2() { - return getLastModified(); - } - - @Override - public String value3() { - return getEmail(); - } - - @Override - public JRestorePasswordBidRecord value1(String value) { - setUuid(value); - return this; - } - - @Override - public JRestorePasswordBidRecord value2(Timestamp value) { - setLastModified(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JRestorePasswordBidRecord value3(String value) { - setEmail(value); - return this; - } - - @Override - public JRestorePasswordBidRecord values(String value1, Timestamp value2, String value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JRestorePasswordBidRecord extends UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = -2003482281; + + /** + * Setter for public.restore_password_bid.uuid. + */ + public void setUuid(String value) { + set(0, value); + } + + /** + * Getter for public.restore_password_bid.uuid. + */ + public String getUuid() { + return (String) get(0); + } + + /** + * Setter for public.restore_password_bid.last_modified. + */ + public void setLastModified(Timestamp value) { + set(1, value); + } + + /** + * Getter for public.restore_password_bid.last_modified. + */ + public Timestamp getLastModified() { + return (Timestamp) get(1); + } + + /** + * Setter for public.restore_password_bid.email. + */ + public void setEmail(String value) { + set(2, value); + } + + /** + * Getter for public.restore_password_bid.email. + */ + public String getEmail() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JRestorePasswordBid.RESTORE_PASSWORD_BID.UUID; + } + + @Override + public Field field2() { + return JRestorePasswordBid.RESTORE_PASSWORD_BID.LAST_MODIFIED; + } + + @Override + public Field field3() { + return JRestorePasswordBid.RESTORE_PASSWORD_BID.EMAIL; + } + + @Override + public String component1() { + return getUuid(); + } + + @Override + public Timestamp component2() { + return getLastModified(); + } + + @Override + public String component3() { + return getEmail(); + } + + @Override + public String value1() { + return getUuid(); + } + + @Override + public Timestamp value2() { + return getLastModified(); + } + + @Override + public String value3() { + return getEmail(); + } + + @Override + public JRestorePasswordBidRecord value1(String value) { + setUuid(value); + return this; + } + + @Override + public JRestorePasswordBidRecord value2(Timestamp value) { + setLastModified(value); + return this; + } + + @Override + public JRestorePasswordBidRecord value3(String value) { + setEmail(value); + return this; + } + + @Override + public JRestorePasswordBidRecord values(String value1, Timestamp value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JRestorePasswordBidRecord + */ + public JRestorePasswordBidRecord() { + super(JRestorePasswordBid.RESTORE_PASSWORD_BID); + } + + /** + * Create a detached, initialised JRestorePasswordBidRecord + */ + public JRestorePasswordBidRecord(String uuid, Timestamp lastModified, String email) { + super(JRestorePasswordBid.RESTORE_PASSWORD_BID); + + set(0, uuid); + set(1, lastModified); + set(2, email); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JSenderCaseRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JSenderCaseRecord.java index 352e48633..c77a6b663 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JSenderCaseRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JSenderCaseRecord.java @@ -4,12 +4,15 @@ package com.epam.ta.reportportal.jooq.tables.records; +import com.epam.ta.reportportal.jooq.enums.JLogicalOperatorEnum; import com.epam.ta.reportportal.jooq.tables.JSenderCase; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record4; -import org.jooq.Row4; +import org.jooq.Record6; +import org.jooq.Row6; import org.jooq.impl.UpdatableRecordImpl; @@ -23,204 +26,277 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JSenderCaseRecord extends UpdatableRecordImpl implements - Record4 { - - private static final long serialVersionUID = 794748140; - - /** - * Create a detached JSenderCaseRecord - */ - public JSenderCaseRecord() { - super(JSenderCase.SENDER_CASE); - } - - /** - * Create a detached, initialised JSenderCaseRecord - */ - public JSenderCaseRecord(Long id, String sendCase, Long projectId, Boolean enabled) { - super(JSenderCase.SENDER_CASE); - - set(0, id); - set(1, sendCase); - set(2, projectId); - set(3, enabled); - } - - /** - * Getter for public.sender_case.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.sender_case.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.sender_case.send_case. - */ - public String getSendCase() { - return (String) get(1); - } - - /** - * Setter for public.sender_case.send_case. - */ - public void setSendCase(String value) { - set(1, value); - } - - /** - * Getter for public.sender_case.project_id. - */ - public Long getProjectId() { - return (Long) get(2); - } - - /** - * Setter for public.sender_case.project_id. - */ - public void setProjectId(Long value) { - set(2, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.sender_case.enabled. - */ - public Boolean getEnabled() { - return (Boolean) get(3); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.sender_case.enabled. - */ - public void setEnabled(Boolean value) { - set(3, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JSenderCase.SENDER_CASE.ID; - } - - @Override - public Field field2() { - return JSenderCase.SENDER_CASE.SEND_CASE; - } - - @Override - public Field field3() { - return JSenderCase.SENDER_CASE.PROJECT_ID; - } - - @Override - public Field field4() { - return JSenderCase.SENDER_CASE.ENABLED; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getSendCase(); - } - - @Override - public Long component3() { - return getProjectId(); - } - - @Override - public Boolean component4() { - return getEnabled(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getSendCase(); - } - - @Override - public Long value3() { - return getProjectId(); - } - - @Override - public Boolean value4() { - return getEnabled(); - } - - @Override - public JSenderCaseRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JSenderCaseRecord value2(String value) { - setSendCase(value); - return this; - } - - @Override - public JSenderCaseRecord value3(Long value) { - setProjectId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JSenderCaseRecord value4(Boolean value) { - setEnabled(value); - return this; - } - - @Override - public JSenderCaseRecord values(Long value1, String value2, Long value3, Boolean value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JSenderCaseRecord extends UpdatableRecordImpl implements Record6 { + + private static final long serialVersionUID = 1738483780; + + /** + * Setter for public.sender_case.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.sender_case.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.sender_case.send_case. + */ + public void setSendCase(String value) { + set(1, value); + } + + /** + * Getter for public.sender_case.send_case. + */ + public String getSendCase() { + return (String) get(1); + } + + /** + * Setter for public.sender_case.project_id. + */ + public void setProjectId(Long value) { + set(2, value); + } + + /** + * Getter for public.sender_case.project_id. + */ + public Long getProjectId() { + return (Long) get(2); + } + + /** + * Setter for public.sender_case.enabled. + */ + public void setEnabled(Boolean value) { + set(3, value); + } + + /** + * Getter for public.sender_case.enabled. + */ + public Boolean getEnabled() { + return (Boolean) get(3); + } + + /** + * Setter for public.sender_case.attributes_operator. + */ + public void setAttributesOperator(JLogicalOperatorEnum value) { + set(4, value); + } + + /** + * Getter for public.sender_case.attributes_operator. + */ + public JLogicalOperatorEnum getAttributesOperator() { + return (JLogicalOperatorEnum) get(4); + } + + /** + * Setter for public.sender_case.rule_name. + */ + public void setRuleName(String value) { + set(5, value); + } + + /** + * Getter for public.sender_case.rule_name. + */ + public String getRuleName() { + return (String) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return JSenderCase.SENDER_CASE.ID; + } + + @Override + public Field field2() { + return JSenderCase.SENDER_CASE.SEND_CASE; + } + + @Override + public Field field3() { + return JSenderCase.SENDER_CASE.PROJECT_ID; + } + + @Override + public Field field4() { + return JSenderCase.SENDER_CASE.ENABLED; + } + + @Override + public Field field5() { + return JSenderCase.SENDER_CASE.ATTRIBUTES_OPERATOR; + } + + @Override + public Field field6() { + return JSenderCase.SENDER_CASE.RULE_NAME; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getSendCase(); + } + + @Override + public Long component3() { + return getProjectId(); + } + + @Override + public Boolean component4() { + return getEnabled(); + } + + @Override + public JLogicalOperatorEnum component5() { + return getAttributesOperator(); + } + + @Override + public String component6() { + return getRuleName(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getSendCase(); + } + + @Override + public Long value3() { + return getProjectId(); + } + + @Override + public Boolean value4() { + return getEnabled(); + } + + @Override + public JLogicalOperatorEnum value5() { + return getAttributesOperator(); + } + + @Override + public String value6() { + return getRuleName(); + } + + @Override + public JSenderCaseRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JSenderCaseRecord value2(String value) { + setSendCase(value); + return this; + } + + @Override + public JSenderCaseRecord value3(Long value) { + setProjectId(value); + return this; + } + + @Override + public JSenderCaseRecord value4(Boolean value) { + setEnabled(value); + return this; + } + + @Override + public JSenderCaseRecord value5(JLogicalOperatorEnum value) { + setAttributesOperator(value); + return this; + } + + @Override + public JSenderCaseRecord value6(String value) { + setRuleName(value); + return this; + } + + @Override + public JSenderCaseRecord values(Long value1, String value2, Long value3, Boolean value4, JLogicalOperatorEnum value5, String value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JSenderCaseRecord + */ + public JSenderCaseRecord() { + super(JSenderCase.SENDER_CASE); + } + + /** + * Create a detached, initialised JSenderCaseRecord + */ + public JSenderCaseRecord(Long id, String sendCase, Long projectId, Boolean enabled, JLogicalOperatorEnum attributesOperator, String ruleName) { + super(JSenderCase.SENDER_CASE); + + set(0, id); + set(1, sendCase); + set(2, projectId); + set(3, enabled); + set(4, attributesOperator); + set(5, ruleName); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JServerSettingsRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JServerSettingsRecord.java index 66b6658c3..7a7258660 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JServerSettingsRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JServerSettingsRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JServerSettings; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record3; @@ -23,167 +25,166 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JServerSettingsRecord extends UpdatableRecordImpl implements - Record3 { - - private static final long serialVersionUID = 1082773050; - - /** - * Create a detached JServerSettingsRecord - */ - public JServerSettingsRecord() { - super(JServerSettings.SERVER_SETTINGS); - } - - /** - * Create a detached, initialised JServerSettingsRecord - */ - public JServerSettingsRecord(Short id, String key, String value) { - super(JServerSettings.SERVER_SETTINGS); - - set(0, id); - set(1, key); - set(2, value); - } - - /** - * Getter for public.server_settings.id. - */ - public Short getId() { - return (Short) get(0); - } - - /** - * Setter for public.server_settings.id. - */ - public void setId(Short value) { - set(0, value); - } - - /** - * Getter for public.server_settings.key. - */ - public String getKey() { - return (String) get(1); - } - - /** - * Setter for public.server_settings.key. - */ - public void setKey(String value) { - set(1, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.server_settings.value. - */ - public String getValue() { - return (String) get(2); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.server_settings.value. - */ - public void setValue(String value) { - set(2, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JServerSettings.SERVER_SETTINGS.ID; - } - - @Override - public Field field2() { - return JServerSettings.SERVER_SETTINGS.KEY; - } - - @Override - public Field field3() { - return JServerSettings.SERVER_SETTINGS.VALUE; - } - - @Override - public Short component1() { - return getId(); - } - - @Override - public String component2() { - return getKey(); - } - - @Override - public String component3() { - return getValue(); - } - - @Override - public Short value1() { - return getId(); - } - - @Override - public String value2() { - return getKey(); - } - - @Override - public String value3() { - return getValue(); - } - - @Override - public JServerSettingsRecord value1(Short value) { - setId(value); - return this; - } - - @Override - public JServerSettingsRecord value2(String value) { - setKey(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JServerSettingsRecord value3(String value) { - setValue(value); - return this; - } - - @Override - public JServerSettingsRecord values(Short value1, String value2, String value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JServerSettingsRecord extends UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = 1082773050; + + /** + * Setter for public.server_settings.id. + */ + public void setId(Short value) { + set(0, value); + } + + /** + * Getter for public.server_settings.id. + */ + public Short getId() { + return (Short) get(0); + } + + /** + * Setter for public.server_settings.key. + */ + public void setKey(String value) { + set(1, value); + } + + /** + * Getter for public.server_settings.key. + */ + public String getKey() { + return (String) get(1); + } + + /** + * Setter for public.server_settings.value. + */ + public void setValue(String value) { + set(2, value); + } + + /** + * Getter for public.server_settings.value. + */ + public String getValue() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JServerSettings.SERVER_SETTINGS.ID; + } + + @Override + public Field field2() { + return JServerSettings.SERVER_SETTINGS.KEY; + } + + @Override + public Field field3() { + return JServerSettings.SERVER_SETTINGS.VALUE; + } + + @Override + public Short component1() { + return getId(); + } + + @Override + public String component2() { + return getKey(); + } + + @Override + public String component3() { + return getValue(); + } + + @Override + public Short value1() { + return getId(); + } + + @Override + public String value2() { + return getKey(); + } + + @Override + public String value3() { + return getValue(); + } + + @Override + public JServerSettingsRecord value1(Short value) { + setId(value); + return this; + } + + @Override + public JServerSettingsRecord value2(String value) { + setKey(value); + return this; + } + + @Override + public JServerSettingsRecord value3(String value) { + setValue(value); + return this; + } + + @Override + public JServerSettingsRecord values(Short value1, String value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JServerSettingsRecord + */ + public JServerSettingsRecord() { + super(JServerSettings.SERVER_SETTINGS); + } + + /** + * Create a detached, initialised JServerSettingsRecord + */ + public JServerSettingsRecord(Short id, String key, String value) { + super(JServerSettings.SERVER_SETTINGS); + + set(0, id); + set(1, key); + set(2, value); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JShareableEntityRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JShareableEntityRecord.java deleted file mode 100755 index d40dda66f..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JShareableEntityRecord.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables.records; - - -import com.epam.ta.reportportal.jooq.tables.JShareableEntity; -import javax.annotation.processing.Generated; -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record4; -import org.jooq.Row4; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JShareableEntityRecord extends UpdatableRecordImpl implements - Record4 { - - private static final long serialVersionUID = -423678501; - - /** - * Create a detached JShareableEntityRecord - */ - public JShareableEntityRecord() { - super(JShareableEntity.SHAREABLE_ENTITY); - } - - /** - * Create a detached, initialised JShareableEntityRecord - */ - public JShareableEntityRecord(Long id, Boolean shared, String owner, Long projectId) { - super(JShareableEntity.SHAREABLE_ENTITY); - - set(0, id); - set(1, shared); - set(2, owner); - set(3, projectId); - } - - /** - * Getter for public.shareable_entity.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.shareable_entity.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.shareable_entity.shared. - */ - public Boolean getShared() { - return (Boolean) get(1); - } - - /** - * Setter for public.shareable_entity.shared. - */ - public void setShared(Boolean value) { - set(1, value); - } - - /** - * Getter for public.shareable_entity.owner. - */ - public String getOwner() { - return (String) get(2); - } - - /** - * Setter for public.shareable_entity.owner. - */ - public void setOwner(String value) { - set(2, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.shareable_entity.project_id. - */ - public Long getProjectId() { - return (Long) get(3); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.shareable_entity.project_id. - */ - public void setProjectId(Long value) { - set(3, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JShareableEntity.SHAREABLE_ENTITY.ID; - } - - @Override - public Field field2() { - return JShareableEntity.SHAREABLE_ENTITY.SHARED; - } - - @Override - public Field field3() { - return JShareableEntity.SHAREABLE_ENTITY.OWNER; - } - - @Override - public Field field4() { - return JShareableEntity.SHAREABLE_ENTITY.PROJECT_ID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Boolean component2() { - return getShared(); - } - - @Override - public String component3() { - return getOwner(); - } - - @Override - public Long component4() { - return getProjectId(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Boolean value2() { - return getShared(); - } - - @Override - public String value3() { - return getOwner(); - } - - @Override - public Long value4() { - return getProjectId(); - } - - @Override - public JShareableEntityRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JShareableEntityRecord value2(Boolean value) { - setShared(value); - return this; - } - - @Override - public JShareableEntityRecord value3(String value) { - setOwner(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JShareableEntityRecord value4(Long value) { - setProjectId(value); - return this; - } - - @Override - public JShareableEntityRecord values(Long value1, Boolean value2, String value3, Long value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JShedlockRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JShedlockRecord.java new file mode 100644 index 000000000..e0f82124e --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JShedlockRecord.java @@ -0,0 +1,229 @@ +/* + * This file is generated by jOOQ. + */ +package com.epam.ta.reportportal.jooq.tables.records; + + +import com.epam.ta.reportportal.jooq.tables.JShedlock; + +import java.sql.Timestamp; + +import javax.annotation.processing.Generated; + +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record4; +import org.jooq.Row4; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@Generated( + value = { + "http://www.jooq.org", + "jOOQ version:3.12.4" + }, + comments = "This class is generated by jOOQ" +) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JShedlockRecord extends UpdatableRecordImpl implements Record4 { + + private static final long serialVersionUID = -2130296882; + + /** + * Setter for public.shedlock.name. + */ + public void setName(String value) { + set(0, value); + } + + /** + * Getter for public.shedlock.name. + */ + public String getName() { + return (String) get(0); + } + + /** + * Setter for public.shedlock.lock_until. + */ + public void setLockUntil(Timestamp value) { + set(1, value); + } + + /** + * Getter for public.shedlock.lock_until. + */ + public Timestamp getLockUntil() { + return (Timestamp) get(1); + } + + /** + * Setter for public.shedlock.locked_at. + */ + public void setLockedAt(Timestamp value) { + set(2, value); + } + + /** + * Getter for public.shedlock.locked_at. + */ + public Timestamp getLockedAt() { + return (Timestamp) get(2); + } + + /** + * Setter for public.shedlock.locked_by. + */ + public void setLockedBy(String value) { + set(3, value); + } + + /** + * Getter for public.shedlock.locked_by. + */ + public String getLockedBy() { + return (String) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JShedlock.SHEDLOCK.NAME; + } + + @Override + public Field field2() { + return JShedlock.SHEDLOCK.LOCK_UNTIL; + } + + @Override + public Field field3() { + return JShedlock.SHEDLOCK.LOCKED_AT; + } + + @Override + public Field field4() { + return JShedlock.SHEDLOCK.LOCKED_BY; + } + + @Override + public String component1() { + return getName(); + } + + @Override + public Timestamp component2() { + return getLockUntil(); + } + + @Override + public Timestamp component3() { + return getLockedAt(); + } + + @Override + public String component4() { + return getLockedBy(); + } + + @Override + public String value1() { + return getName(); + } + + @Override + public Timestamp value2() { + return getLockUntil(); + } + + @Override + public Timestamp value3() { + return getLockedAt(); + } + + @Override + public String value4() { + return getLockedBy(); + } + + @Override + public JShedlockRecord value1(String value) { + setName(value); + return this; + } + + @Override + public JShedlockRecord value2(Timestamp value) { + setLockUntil(value); + return this; + } + + @Override + public JShedlockRecord value3(Timestamp value) { + setLockedAt(value); + return this; + } + + @Override + public JShedlockRecord value4(String value) { + setLockedBy(value); + return this; + } + + @Override + public JShedlockRecord values(String value1, Timestamp value2, Timestamp value3, String value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JShedlockRecord + */ + public JShedlockRecord() { + super(JShedlock.SHEDLOCK); + } + + /** + * Create a detached, initialised JShedlockRecord + */ + public JShedlockRecord(String name, Timestamp lockUntil, Timestamp lockedAt, String lockedBy) { + super(JShedlock.SHEDLOCK); + + set(0, name); + set(1, lockUntil); + set(2, lockedAt); + set(3, lockedBy); + } +} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStaleMaterializedViewRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStaleMaterializedViewRecord.java index 42e84abef..c149f2931 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStaleMaterializedViewRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStaleMaterializedViewRecord.java @@ -5,8 +5,11 @@ import com.epam.ta.reportportal.jooq.tables.JStaleMaterializedView; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record3; @@ -24,167 +27,166 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JStaleMaterializedViewRecord extends - UpdatableRecordImpl implements Record3 { - - private static final long serialVersionUID = -1478372239; - - /** - * Create a detached JStaleMaterializedViewRecord - */ - public JStaleMaterializedViewRecord() { - super(JStaleMaterializedView.STALE_MATERIALIZED_VIEW); - } - - /** - * Create a detached, initialised JStaleMaterializedViewRecord - */ - public JStaleMaterializedViewRecord(Long id, String name, Timestamp creationDate) { - super(JStaleMaterializedView.STALE_MATERIALIZED_VIEW); - - set(0, id); - set(1, name); - set(2, creationDate); - } - - /** - * Getter for public.stale_materialized_view.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.stale_materialized_view.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.stale_materialized_view.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.stale_materialized_view.name. - */ - public void setName(String value) { - set(1, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.stale_materialized_view.creation_date. - */ - public Timestamp getCreationDate() { - return (Timestamp) get(2); - } - - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.stale_materialized_view.creation_date. - */ - public void setCreationDate(Timestamp value) { - set(2, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID; - } - - @Override - public Field field2() { - return JStaleMaterializedView.STALE_MATERIALIZED_VIEW.NAME; - } - - @Override - public Field field3() { - return JStaleMaterializedView.STALE_MATERIALIZED_VIEW.CREATION_DATE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public Timestamp component3() { - return getCreationDate(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public Timestamp value3() { - return getCreationDate(); - } - - @Override - public JStaleMaterializedViewRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JStaleMaterializedViewRecord value2(String value) { - setName(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JStaleMaterializedViewRecord value3(Timestamp value) { - setCreationDate(value); - return this; - } - - @Override - public JStaleMaterializedViewRecord values(Long value1, String value2, Timestamp value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JStaleMaterializedViewRecord extends UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = -1478372239; + + /** + * Setter for public.stale_materialized_view.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.stale_materialized_view.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.stale_materialized_view.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.stale_materialized_view.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.stale_materialized_view.creation_date. + */ + public void setCreationDate(Timestamp value) { + set(2, value); + } + + /** + * Getter for public.stale_materialized_view.creation_date. + */ + public Timestamp getCreationDate() { + return (Timestamp) get(2); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JStaleMaterializedView.STALE_MATERIALIZED_VIEW.ID; + } + + @Override + public Field field2() { + return JStaleMaterializedView.STALE_MATERIALIZED_VIEW.NAME; + } + + @Override + public Field field3() { + return JStaleMaterializedView.STALE_MATERIALIZED_VIEW.CREATION_DATE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public Timestamp component3() { + return getCreationDate(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public Timestamp value3() { + return getCreationDate(); + } + + @Override + public JStaleMaterializedViewRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JStaleMaterializedViewRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JStaleMaterializedViewRecord value3(Timestamp value) { + setCreationDate(value); + return this; + } + + @Override + public JStaleMaterializedViewRecord values(Long value1, String value2, Timestamp value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JStaleMaterializedViewRecord + */ + public JStaleMaterializedViewRecord() { + super(JStaleMaterializedView.STALE_MATERIALIZED_VIEW); + } + + /** + * Create a detached, initialised JStaleMaterializedViewRecord + */ + public JStaleMaterializedViewRecord(Long id, String name, Timestamp creationDate) { + super(JStaleMaterializedView.STALE_MATERIALIZED_VIEW); + + set(0, id); + set(1, name); + set(2, creationDate); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsFieldRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsFieldRecord.java old mode 100755 new mode 100644 index bf93afea4..55ac7fb6e --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsFieldRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsFieldRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JStatisticsField; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record2; @@ -23,130 +25,129 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JStatisticsFieldRecord extends UpdatableRecordImpl implements - Record2 { - - private static final long serialVersionUID = 1879883941; - - /** - * Create a detached JStatisticsFieldRecord - */ - public JStatisticsFieldRecord() { - super(JStatisticsField.STATISTICS_FIELD); - } - - /** - * Create a detached, initialised JStatisticsFieldRecord - */ - public JStatisticsFieldRecord(Long sfId, String name) { - super(JStatisticsField.STATISTICS_FIELD); - - set(0, sfId); - set(1, name); - } - - /** - * Getter for public.statistics_field.sf_id. - */ - public Long getSfId() { - return (Long) get(0); - } - - /** - * Setter for public.statistics_field.sf_id. - */ - public void setSfId(Long value) { - set(0, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.statistics_field.name. - */ - public String getName() { - return (String) get(1); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.statistics_field.name. - */ - public void setName(String value) { - set(1, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JStatisticsField.STATISTICS_FIELD.SF_ID; - } - - @Override - public Field field2() { - return JStatisticsField.STATISTICS_FIELD.NAME; - } - - @Override - public Long component1() { - return getSfId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public Long value1() { - return getSfId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public JStatisticsFieldRecord value1(Long value) { - setSfId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JStatisticsFieldRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JStatisticsFieldRecord values(Long value1, String value2) { - value1(value1); - value2(value2); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JStatisticsFieldRecord extends UpdatableRecordImpl implements Record2 { + + private static final long serialVersionUID = 1879883941; + + /** + * Setter for public.statistics_field.sf_id. + */ + public void setSfId(Long value) { + set(0, value); + } + + /** + * Getter for public.statistics_field.sf_id. + */ + public Long getSfId() { + return (Long) get(0); + } + + /** + * Setter for public.statistics_field.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.statistics_field.name. + */ + public String getName() { + return (String) get(1); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JStatisticsField.STATISTICS_FIELD.SF_ID; + } + + @Override + public Field field2() { + return JStatisticsField.STATISTICS_FIELD.NAME; + } + + @Override + public Long component1() { + return getSfId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public Long value1() { + return getSfId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public JStatisticsFieldRecord value1(Long value) { + setSfId(value); + return this; + } + + @Override + public JStatisticsFieldRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JStatisticsFieldRecord values(Long value1, String value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JStatisticsFieldRecord + */ + public JStatisticsFieldRecord() { + super(JStatisticsField.STATISTICS_FIELD); + } + + /** + * Create a detached, initialised JStatisticsFieldRecord + */ + public JStatisticsFieldRecord(Long sfId, String name) { + super(JStatisticsField.STATISTICS_FIELD); + + set(0, sfId); + set(1, name); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsRecord.java old mode 100755 new mode 100644 index 2ddf99fee..4c78a3450 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JStatisticsRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JStatistics; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record5; @@ -23,243 +25,240 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JStatisticsRecord extends UpdatableRecordImpl implements - Record5 { - - private static final long serialVersionUID = 1301927224; - - /** - * Create a detached JStatisticsRecord - */ - public JStatisticsRecord() { - super(JStatistics.STATISTICS); - } - - /** - * Create a detached, initialised JStatisticsRecord - */ - public JStatisticsRecord(Long sId, Integer sCounter, Long launchId, Long itemId, - Long statisticsFieldId) { - super(JStatistics.STATISTICS); - - set(0, sId); - set(1, sCounter); - set(2, launchId); - set(3, itemId); - set(4, statisticsFieldId); - } - - /** - * Getter for public.statistics.s_id. - */ - public Long getSId() { - return (Long) get(0); - } - - /** - * Setter for public.statistics.s_id. - */ - public void setSId(Long value) { - set(0, value); - } - - /** - * Getter for public.statistics.s_counter. - */ - public Integer getSCounter() { - return (Integer) get(1); - } - - /** - * Setter for public.statistics.s_counter. - */ - public void setSCounter(Integer value) { - set(1, value); - } - - /** - * Getter for public.statistics.launch_id. - */ - public Long getLaunchId() { - return (Long) get(2); - } - - /** - * Setter for public.statistics.launch_id. - */ - public void setLaunchId(Long value) { - set(2, value); - } - - /** - * Getter for public.statistics.item_id. - */ - public Long getItemId() { - return (Long) get(3); - } - - /** - * Setter for public.statistics.item_id. - */ - public void setItemId(Long value) { - set(3, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.statistics.statistics_field_id. - */ - public Long getStatisticsFieldId() { - return (Long) get(4); - } - - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.statistics.statistics_field_id. - */ - public void setStatisticsFieldId(Long value) { - set(4, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } - - @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); - } - - @Override - public Field field1() { - return JStatistics.STATISTICS.S_ID; - } - - @Override - public Field field2() { - return JStatistics.STATISTICS.S_COUNTER; - } - - @Override - public Field field3() { - return JStatistics.STATISTICS.LAUNCH_ID; - } - - @Override - public Field field4() { - return JStatistics.STATISTICS.ITEM_ID; - } - - @Override - public Field field5() { - return JStatistics.STATISTICS.STATISTICS_FIELD_ID; - } - - @Override - public Long component1() { - return getSId(); - } - - @Override - public Integer component2() { - return getSCounter(); - } - - @Override - public Long component3() { - return getLaunchId(); - } - - @Override - public Long component4() { - return getItemId(); - } - - @Override - public Long component5() { - return getStatisticsFieldId(); - } - - @Override - public Long value1() { - return getSId(); - } - - @Override - public Integer value2() { - return getSCounter(); - } - - @Override - public Long value3() { - return getLaunchId(); - } - - @Override - public Long value4() { - return getItemId(); - } - - @Override - public Long value5() { - return getStatisticsFieldId(); - } - - @Override - public JStatisticsRecord value1(Long value) { - setSId(value); - return this; - } - - @Override - public JStatisticsRecord value2(Integer value) { - setSCounter(value); - return this; - } - - @Override - public JStatisticsRecord value3(Long value) { - setLaunchId(value); - return this; - } - - @Override - public JStatisticsRecord value4(Long value) { - setItemId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JStatisticsRecord value5(Long value) { - setStatisticsFieldId(value); - return this; - } - - @Override - public JStatisticsRecord values(Long value1, Integer value2, Long value3, Long value4, - Long value5) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JStatisticsRecord extends UpdatableRecordImpl implements Record5 { + + private static final long serialVersionUID = 1301927224; + + /** + * Setter for public.statistics.s_id. + */ + public void setSId(Long value) { + set(0, value); + } + + /** + * Getter for public.statistics.s_id. + */ + public Long getSId() { + return (Long) get(0); + } + + /** + * Setter for public.statistics.s_counter. + */ + public void setSCounter(Integer value) { + set(1, value); + } + + /** + * Getter for public.statistics.s_counter. + */ + public Integer getSCounter() { + return (Integer) get(1); + } + + /** + * Setter for public.statistics.launch_id. + */ + public void setLaunchId(Long value) { + set(2, value); + } + + /** + * Getter for public.statistics.launch_id. + */ + public Long getLaunchId() { + return (Long) get(2); + } + + /** + * Setter for public.statistics.item_id. + */ + public void setItemId(Long value) { + set(3, value); + } + + /** + * Getter for public.statistics.item_id. + */ + public Long getItemId() { + return (Long) get(3); + } + + /** + * Setter for public.statistics.statistics_field_id. + */ + public void setStatisticsFieldId(Long value) { + set(4, value); + } + + /** + * Getter for public.statistics.statistics_field_id. + */ + public Long getStatisticsFieldId() { + return (Long) get(4); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return JStatistics.STATISTICS.S_ID; + } + + @Override + public Field field2() { + return JStatistics.STATISTICS.S_COUNTER; + } + + @Override + public Field field3() { + return JStatistics.STATISTICS.LAUNCH_ID; + } + + @Override + public Field field4() { + return JStatistics.STATISTICS.ITEM_ID; + } + + @Override + public Field field5() { + return JStatistics.STATISTICS.STATISTICS_FIELD_ID; + } + + @Override + public Long component1() { + return getSId(); + } + + @Override + public Integer component2() { + return getSCounter(); + } + + @Override + public Long component3() { + return getLaunchId(); + } + + @Override + public Long component4() { + return getItemId(); + } + + @Override + public Long component5() { + return getStatisticsFieldId(); + } + + @Override + public Long value1() { + return getSId(); + } + + @Override + public Integer value2() { + return getSCounter(); + } + + @Override + public Long value3() { + return getLaunchId(); + } + + @Override + public Long value4() { + return getItemId(); + } + + @Override + public Long value5() { + return getStatisticsFieldId(); + } + + @Override + public JStatisticsRecord value1(Long value) { + setSId(value); + return this; + } + + @Override + public JStatisticsRecord value2(Integer value) { + setSCounter(value); + return this; + } + + @Override + public JStatisticsRecord value3(Long value) { + setLaunchId(value); + return this; + } + + @Override + public JStatisticsRecord value4(Long value) { + setItemId(value); + return this; + } + + @Override + public JStatisticsRecord value5(Long value) { + setStatisticsFieldId(value); + return this; + } + + @Override + public JStatisticsRecord values(Long value1, Integer value2, Long value3, Long value4, Long value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JStatisticsRecord + */ + public JStatisticsRecord() { + super(JStatistics.STATISTICS); + } + + /** + * Create a detached, initialised JStatisticsRecord + */ + public JStatisticsRecord(Long sId, Integer sCounter, Long launchId, Long itemId, Long statisticsFieldId) { + super(JStatistics.STATISTICS); + + set(0, sId); + set(1, sCounter); + set(2, launchId); + set(3, itemId); + set(4, statisticsFieldId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemRecord.java old mode 100755 new mode 100644 index 729695368..f4f8dce36 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemRecord.java @@ -6,8 +6,11 @@ import com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum; import com.epam.ta.reportportal.jooq.tables.JTestItem; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record18; @@ -25,728 +28,721 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JTestItemRecord extends UpdatableRecordImpl implements - Record18 { - - private static final long serialVersionUID = -759970468; - - /** - * Create a detached JTestItemRecord - */ - public JTestItemRecord() { - super(JTestItem.TEST_ITEM); - } - - /** - * Create a detached, initialised JTestItemRecord - */ - public JTestItemRecord(Long itemId, String uuid, String name, String codeRef, - JTestItemTypeEnum type, Timestamp startTime, String description, Timestamp lastModified, - Object path, String uniqueId, String testCaseId, Boolean hasChildren, Boolean hasRetries, - Boolean hasStats, Long parentId, Long retryOf, Long launchId, Integer testCaseHash) { - super(JTestItem.TEST_ITEM); - - set(0, itemId); - set(1, uuid); - set(2, name); - set(3, codeRef); - set(4, type); - set(5, startTime); - set(6, description); - set(7, lastModified); - set(8, path); - set(9, uniqueId); - set(10, testCaseId); - set(11, hasChildren); - set(12, hasRetries); - set(13, hasStats); - set(14, parentId); - set(15, retryOf); - set(16, launchId); - set(17, testCaseHash); - } - - /** - * Getter for public.test_item.item_id. - */ - public Long getItemId() { - return (Long) get(0); - } - - /** - * Setter for public.test_item.item_id. - */ - public void setItemId(Long value) { - set(0, value); - } - - /** - * Getter for public.test_item.uuid. - */ - public String getUuid() { - return (String) get(1); - } - - /** - * Setter for public.test_item.uuid. - */ - public void setUuid(String value) { - set(1, value); - } - - /** - * Getter for public.test_item.name. - */ - public String getName() { - return (String) get(2); - } - - /** - * Setter for public.test_item.name. - */ - public void setName(String value) { - set(2, value); - } - - /** - * Getter for public.test_item.code_ref. - */ - public String getCodeRef() { - return (String) get(3); - } - - /** - * Setter for public.test_item.code_ref. - */ - public void setCodeRef(String value) { - set(3, value); - } - - /** - * Getter for public.test_item.type. - */ - public JTestItemTypeEnum getType() { - return (JTestItemTypeEnum) get(4); - } - - /** - * Setter for public.test_item.type. - */ - public void setType(JTestItemTypeEnum value) { - set(4, value); - } - - /** - * Getter for public.test_item.start_time. - */ - public Timestamp getStartTime() { - return (Timestamp) get(5); - } - - /** - * Setter for public.test_item.start_time. - */ - public void setStartTime(Timestamp value) { - set(5, value); - } - - /** - * Getter for public.test_item.description. - */ - public String getDescription() { - return (String) get(6); - } - - /** - * Setter for public.test_item.description. - */ - public void setDescription(String value) { - set(6, value); - } - - /** - * Getter for public.test_item.last_modified. - */ - public Timestamp getLastModified() { - return (Timestamp) get(7); - } - - /** - * Setter for public.test_item.last_modified. - */ - public void setLastModified(Timestamp value) { - set(7, value); - } - - /** - * Getter for public.test_item.path. - */ - public Object getPath() { - return get(8); - } - - /** - * Setter for public.test_item.path. - */ - public void setPath(Object value) { - set(8, value); - } - - /** - * Getter for public.test_item.unique_id. - */ - public String getUniqueId() { - return (String) get(9); - } - - /** - * Setter for public.test_item.unique_id. - */ - public void setUniqueId(String value) { - set(9, value); - } - - /** - * Getter for public.test_item.test_case_id. - */ - public String getTestCaseId() { - return (String) get(10); - } - - /** - * Setter for public.test_item.test_case_id. - */ - public void setTestCaseId(String value) { - set(10, value); - } - - /** - * Getter for public.test_item.has_children. - */ - public Boolean getHasChildren() { - return (Boolean) get(11); - } - - /** - * Setter for public.test_item.has_children. - */ - public void setHasChildren(Boolean value) { - set(11, value); - } - - /** - * Getter for public.test_item.has_retries. - */ - public Boolean getHasRetries() { - return (Boolean) get(12); - } - - /** - * Setter for public.test_item.has_retries. - */ - public void setHasRetries(Boolean value) { - set(12, value); - } - - /** - * Getter for public.test_item.has_stats. - */ - public Boolean getHasStats() { - return (Boolean) get(13); - } - - /** - * Setter for public.test_item.has_stats. - */ - public void setHasStats(Boolean value) { - set(13, value); - } - - /** - * Getter for public.test_item.parent_id. - */ - public Long getParentId() { - return (Long) get(14); - } - - /** - * Setter for public.test_item.parent_id. - */ - public void setParentId(Long value) { - set(14, value); - } - - /** - * Getter for public.test_item.retry_of. - */ - public Long getRetryOf() { - return (Long) get(15); - } - - /** - * Setter for public.test_item.retry_of. - */ - public void setRetryOf(Long value) { - set(15, value); - } - - /** - * Getter for public.test_item.launch_id. - */ - public Long getLaunchId() { - return (Long) get(16); - } - - /** - * Setter for public.test_item.launch_id. - */ - public void setLaunchId(Long value) { - set(16, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.test_item.test_case_hash. - */ - public Integer getTestCaseHash() { - return (Integer) get(17); - } - - // ------------------------------------------------------------------------- - // Record18 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.test_item.test_case_hash. - */ - public void setTestCaseHash(Integer value) { - set(17, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row18 fieldsRow() { - return (Row18) super.fieldsRow(); - } - - @Override - public Row18 valuesRow() { - return (Row18) super.valuesRow(); - } - - @Override - public Field field1() { - return JTestItem.TEST_ITEM.ITEM_ID; - } - - @Override - public Field field2() { - return JTestItem.TEST_ITEM.UUID; - } - - @Override - public Field field3() { - return JTestItem.TEST_ITEM.NAME; - } - - @Override - public Field field4() { - return JTestItem.TEST_ITEM.CODE_REF; - } - - @Override - public Field field5() { - return JTestItem.TEST_ITEM.TYPE; - } - - @Override - public Field field6() { - return JTestItem.TEST_ITEM.START_TIME; - } - - @Override - public Field field7() { - return JTestItem.TEST_ITEM.DESCRIPTION; - } - - @Override - public Field field8() { - return JTestItem.TEST_ITEM.LAST_MODIFIED; - } - - @Override - public Field field9() { - return JTestItem.TEST_ITEM.PATH; - } - - @Override - public Field field10() { - return JTestItem.TEST_ITEM.UNIQUE_ID; - } - - @Override - public Field field11() { - return JTestItem.TEST_ITEM.TEST_CASE_ID; - } - - @Override - public Field field12() { - return JTestItem.TEST_ITEM.HAS_CHILDREN; - } - - @Override - public Field field13() { - return JTestItem.TEST_ITEM.HAS_RETRIES; - } - - @Override - public Field field14() { - return JTestItem.TEST_ITEM.HAS_STATS; - } - - @Override - public Field field15() { - return JTestItem.TEST_ITEM.PARENT_ID; - } - - @Override - public Field field16() { - return JTestItem.TEST_ITEM.RETRY_OF; - } - - @Override - public Field field17() { - return JTestItem.TEST_ITEM.LAUNCH_ID; - } - - @Override - public Field field18() { - return JTestItem.TEST_ITEM.TEST_CASE_HASH; - } - - @Override - public Long component1() { - return getItemId(); - } - - @Override - public String component2() { - return getUuid(); - } - - @Override - public String component3() { - return getName(); - } - - @Override - public String component4() { - return getCodeRef(); - } - - @Override - public JTestItemTypeEnum component5() { - return getType(); - } - - @Override - public Timestamp component6() { - return getStartTime(); - } - - @Override - public String component7() { - return getDescription(); - } - - @Override - public Timestamp component8() { - return getLastModified(); - } - - @Override - public Object component9() { - return getPath(); - } - - @Override - public String component10() { - return getUniqueId(); - } - - @Override - public String component11() { - return getTestCaseId(); - } - - @Override - public Boolean component12() { - return getHasChildren(); - } - - @Override - public Boolean component13() { - return getHasRetries(); - } - - @Override - public Boolean component14() { - return getHasStats(); - } - - @Override - public Long component15() { - return getParentId(); - } - - @Override - public Long component16() { - return getRetryOf(); - } - - @Override - public Long component17() { - return getLaunchId(); - } - - @Override - public Integer component18() { - return getTestCaseHash(); - } - - @Override - public Long value1() { - return getItemId(); - } - - @Override - public String value2() { - return getUuid(); - } - - @Override - public String value3() { - return getName(); - } - - @Override - public String value4() { - return getCodeRef(); - } - - @Override - public JTestItemTypeEnum value5() { - return getType(); - } - - @Override - public Timestamp value6() { - return getStartTime(); - } - - @Override - public String value7() { - return getDescription(); - } - - @Override - public Timestamp value8() { - return getLastModified(); - } - - @Override - public Object value9() { - return getPath(); - } - - @Override - public String value10() { - return getUniqueId(); - } - - @Override - public String value11() { - return getTestCaseId(); - } - - @Override - public Boolean value12() { - return getHasChildren(); - } - - @Override - public Boolean value13() { - return getHasRetries(); - } - - @Override - public Boolean value14() { - return getHasStats(); - } - - @Override - public Long value15() { - return getParentId(); - } - - @Override - public Long value16() { - return getRetryOf(); - } - - @Override - public Long value17() { - return getLaunchId(); - } - - @Override - public Integer value18() { - return getTestCaseHash(); - } - - @Override - public JTestItemRecord value1(Long value) { - setItemId(value); - return this; - } - - @Override - public JTestItemRecord value2(String value) { - setUuid(value); - return this; - } - - @Override - public JTestItemRecord value3(String value) { - setName(value); - return this; - } - - @Override - public JTestItemRecord value4(String value) { - setCodeRef(value); - return this; - } - - @Override - public JTestItemRecord value5(JTestItemTypeEnum value) { - setType(value); - return this; - } - - @Override - public JTestItemRecord value6(Timestamp value) { - setStartTime(value); - return this; - } - - @Override - public JTestItemRecord value7(String value) { - setDescription(value); - return this; - } - - @Override - public JTestItemRecord value8(Timestamp value) { - setLastModified(value); - return this; - } - - @Override - public JTestItemRecord value9(Object value) { - setPath(value); - return this; - } - - @Override - public JTestItemRecord value10(String value) { - setUniqueId(value); - return this; - } - - @Override - public JTestItemRecord value11(String value) { - setTestCaseId(value); - return this; - } - - @Override - public JTestItemRecord value12(Boolean value) { - setHasChildren(value); - return this; - } - - @Override - public JTestItemRecord value13(Boolean value) { - setHasRetries(value); - return this; - } - - @Override - public JTestItemRecord value14(Boolean value) { - setHasStats(value); - return this; - } - - @Override - public JTestItemRecord value15(Long value) { - setParentId(value); - return this; - } - - @Override - public JTestItemRecord value16(Long value) { - setRetryOf(value); - return this; - } - - @Override - public JTestItemRecord value17(Long value) { - setLaunchId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JTestItemRecord value18(Integer value) { - setTestCaseHash(value); - return this; - } - - @Override - public JTestItemRecord values(Long value1, String value2, String value3, String value4, - JTestItemTypeEnum value5, Timestamp value6, String value7, Timestamp value8, Object value9, - String value10, String value11, Boolean value12, Boolean value13, Boolean value14, - Long value15, Long value16, Long value17, Integer value18) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - value12(value12); - value13(value13); - value14(value14); - value15(value15); - value16(value16); - value17(value17); - value18(value18); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JTestItemRecord extends UpdatableRecordImpl implements Record18 { + + private static final long serialVersionUID = -759970468; + + /** + * Setter for public.test_item.item_id. + */ + public void setItemId(Long value) { + set(0, value); + } + + /** + * Getter for public.test_item.item_id. + */ + public Long getItemId() { + return (Long) get(0); + } + + /** + * Setter for public.test_item.uuid. + */ + public void setUuid(String value) { + set(1, value); + } + + /** + * Getter for public.test_item.uuid. + */ + public String getUuid() { + return (String) get(1); + } + + /** + * Setter for public.test_item.name. + */ + public void setName(String value) { + set(2, value); + } + + /** + * Getter for public.test_item.name. + */ + public String getName() { + return (String) get(2); + } + + /** + * Setter for public.test_item.code_ref. + */ + public void setCodeRef(String value) { + set(3, value); + } + + /** + * Getter for public.test_item.code_ref. + */ + public String getCodeRef() { + return (String) get(3); + } + + /** + * Setter for public.test_item.type. + */ + public void setType(JTestItemTypeEnum value) { + set(4, value); + } + + /** + * Getter for public.test_item.type. + */ + public JTestItemTypeEnum getType() { + return (JTestItemTypeEnum) get(4); + } + + /** + * Setter for public.test_item.start_time. + */ + public void setStartTime(Timestamp value) { + set(5, value); + } + + /** + * Getter for public.test_item.start_time. + */ + public Timestamp getStartTime() { + return (Timestamp) get(5); + } + + /** + * Setter for public.test_item.description. + */ + public void setDescription(String value) { + set(6, value); + } + + /** + * Getter for public.test_item.description. + */ + public String getDescription() { + return (String) get(6); + } + + /** + * Setter for public.test_item.last_modified. + */ + public void setLastModified(Timestamp value) { + set(7, value); + } + + /** + * Getter for public.test_item.last_modified. + */ + public Timestamp getLastModified() { + return (Timestamp) get(7); + } + + /** + * Setter for public.test_item.path. + */ + public void setPath(Object value) { + set(8, value); + } + + /** + * Getter for public.test_item.path. + */ + public Object getPath() { + return get(8); + } + + /** + * Setter for public.test_item.unique_id. + */ + public void setUniqueId(String value) { + set(9, value); + } + + /** + * Getter for public.test_item.unique_id. + */ + public String getUniqueId() { + return (String) get(9); + } + + /** + * Setter for public.test_item.test_case_id. + */ + public void setTestCaseId(String value) { + set(10, value); + } + + /** + * Getter for public.test_item.test_case_id. + */ + public String getTestCaseId() { + return (String) get(10); + } + + /** + * Setter for public.test_item.has_children. + */ + public void setHasChildren(Boolean value) { + set(11, value); + } + + /** + * Getter for public.test_item.has_children. + */ + public Boolean getHasChildren() { + return (Boolean) get(11); + } + + /** + * Setter for public.test_item.has_retries. + */ + public void setHasRetries(Boolean value) { + set(12, value); + } + + /** + * Getter for public.test_item.has_retries. + */ + public Boolean getHasRetries() { + return (Boolean) get(12); + } + + /** + * Setter for public.test_item.has_stats. + */ + public void setHasStats(Boolean value) { + set(13, value); + } + + /** + * Getter for public.test_item.has_stats. + */ + public Boolean getHasStats() { + return (Boolean) get(13); + } + + /** + * Setter for public.test_item.parent_id. + */ + public void setParentId(Long value) { + set(14, value); + } + + /** + * Getter for public.test_item.parent_id. + */ + public Long getParentId() { + return (Long) get(14); + } + + /** + * Setter for public.test_item.retry_of. + */ + public void setRetryOf(Long value) { + set(15, value); + } + + /** + * Getter for public.test_item.retry_of. + */ + public Long getRetryOf() { + return (Long) get(15); + } + + /** + * Setter for public.test_item.launch_id. + */ + public void setLaunchId(Long value) { + set(16, value); + } + + /** + * Getter for public.test_item.launch_id. + */ + public Long getLaunchId() { + return (Long) get(16); + } + + /** + * Setter for public.test_item.test_case_hash. + */ + public void setTestCaseHash(Integer value) { + set(17, value); + } + + /** + * Getter for public.test_item.test_case_hash. + */ + public Integer getTestCaseHash() { + return (Integer) get(17); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record18 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row18 fieldsRow() { + return (Row18) super.fieldsRow(); + } + + @Override + public Row18 valuesRow() { + return (Row18) super.valuesRow(); + } + + @Override + public Field field1() { + return JTestItem.TEST_ITEM.ITEM_ID; + } + + @Override + public Field field2() { + return JTestItem.TEST_ITEM.UUID; + } + + @Override + public Field field3() { + return JTestItem.TEST_ITEM.NAME; + } + + @Override + public Field field4() { + return JTestItem.TEST_ITEM.CODE_REF; + } + + @Override + public Field field5() { + return JTestItem.TEST_ITEM.TYPE; + } + + @Override + public Field field6() { + return JTestItem.TEST_ITEM.START_TIME; + } + + @Override + public Field field7() { + return JTestItem.TEST_ITEM.DESCRIPTION; + } + + @Override + public Field field8() { + return JTestItem.TEST_ITEM.LAST_MODIFIED; + } + + @Override + public Field field9() { + return JTestItem.TEST_ITEM.PATH; + } + + @Override + public Field field10() { + return JTestItem.TEST_ITEM.UNIQUE_ID; + } + + @Override + public Field field11() { + return JTestItem.TEST_ITEM.TEST_CASE_ID; + } + + @Override + public Field field12() { + return JTestItem.TEST_ITEM.HAS_CHILDREN; + } + + @Override + public Field field13() { + return JTestItem.TEST_ITEM.HAS_RETRIES; + } + + @Override + public Field field14() { + return JTestItem.TEST_ITEM.HAS_STATS; + } + + @Override + public Field field15() { + return JTestItem.TEST_ITEM.PARENT_ID; + } + + @Override + public Field field16() { + return JTestItem.TEST_ITEM.RETRY_OF; + } + + @Override + public Field field17() { + return JTestItem.TEST_ITEM.LAUNCH_ID; + } + + @Override + public Field field18() { + return JTestItem.TEST_ITEM.TEST_CASE_HASH; + } + + @Override + public Long component1() { + return getItemId(); + } + + @Override + public String component2() { + return getUuid(); + } + + @Override + public String component3() { + return getName(); + } + + @Override + public String component4() { + return getCodeRef(); + } + + @Override + public JTestItemTypeEnum component5() { + return getType(); + } + + @Override + public Timestamp component6() { + return getStartTime(); + } + + @Override + public String component7() { + return getDescription(); + } + + @Override + public Timestamp component8() { + return getLastModified(); + } + + @Override + public Object component9() { + return getPath(); + } + + @Override + public String component10() { + return getUniqueId(); + } + + @Override + public String component11() { + return getTestCaseId(); + } + + @Override + public Boolean component12() { + return getHasChildren(); + } + + @Override + public Boolean component13() { + return getHasRetries(); + } + + @Override + public Boolean component14() { + return getHasStats(); + } + + @Override + public Long component15() { + return getParentId(); + } + + @Override + public Long component16() { + return getRetryOf(); + } + + @Override + public Long component17() { + return getLaunchId(); + } + + @Override + public Integer component18() { + return getTestCaseHash(); + } + + @Override + public Long value1() { + return getItemId(); + } + + @Override + public String value2() { + return getUuid(); + } + + @Override + public String value3() { + return getName(); + } + + @Override + public String value4() { + return getCodeRef(); + } + + @Override + public JTestItemTypeEnum value5() { + return getType(); + } + + @Override + public Timestamp value6() { + return getStartTime(); + } + + @Override + public String value7() { + return getDescription(); + } + + @Override + public Timestamp value8() { + return getLastModified(); + } + + @Override + public Object value9() { + return getPath(); + } + + @Override + public String value10() { + return getUniqueId(); + } + + @Override + public String value11() { + return getTestCaseId(); + } + + @Override + public Boolean value12() { + return getHasChildren(); + } + + @Override + public Boolean value13() { + return getHasRetries(); + } + + @Override + public Boolean value14() { + return getHasStats(); + } + + @Override + public Long value15() { + return getParentId(); + } + + @Override + public Long value16() { + return getRetryOf(); + } + + @Override + public Long value17() { + return getLaunchId(); + } + + @Override + public Integer value18() { + return getTestCaseHash(); + } + + @Override + public JTestItemRecord value1(Long value) { + setItemId(value); + return this; + } + + @Override + public JTestItemRecord value2(String value) { + setUuid(value); + return this; + } + + @Override + public JTestItemRecord value3(String value) { + setName(value); + return this; + } + + @Override + public JTestItemRecord value4(String value) { + setCodeRef(value); + return this; + } + + @Override + public JTestItemRecord value5(JTestItemTypeEnum value) { + setType(value); + return this; + } + + @Override + public JTestItemRecord value6(Timestamp value) { + setStartTime(value); + return this; + } + + @Override + public JTestItemRecord value7(String value) { + setDescription(value); + return this; + } + + @Override + public JTestItemRecord value8(Timestamp value) { + setLastModified(value); + return this; + } + + @Override + public JTestItemRecord value9(Object value) { + setPath(value); + return this; + } + + @Override + public JTestItemRecord value10(String value) { + setUniqueId(value); + return this; + } + + @Override + public JTestItemRecord value11(String value) { + setTestCaseId(value); + return this; + } + + @Override + public JTestItemRecord value12(Boolean value) { + setHasChildren(value); + return this; + } + + @Override + public JTestItemRecord value13(Boolean value) { + setHasRetries(value); + return this; + } + + @Override + public JTestItemRecord value14(Boolean value) { + setHasStats(value); + return this; + } + + @Override + public JTestItemRecord value15(Long value) { + setParentId(value); + return this; + } + + @Override + public JTestItemRecord value16(Long value) { + setRetryOf(value); + return this; + } + + @Override + public JTestItemRecord value17(Long value) { + setLaunchId(value); + return this; + } + + @Override + public JTestItemRecord value18(Integer value) { + setTestCaseHash(value); + return this; + } + + @Override + public JTestItemRecord values(Long value1, String value2, String value3, String value4, JTestItemTypeEnum value5, Timestamp value6, String value7, Timestamp value8, Object value9, String value10, String value11, Boolean value12, Boolean value13, Boolean value14, Long value15, Long value16, Long value17, Integer value18) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + value15(value15); + value16(value16); + value17(value17); + value18(value18); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JTestItemRecord + */ + public JTestItemRecord() { + super(JTestItem.TEST_ITEM); + } + + /** + * Create a detached, initialised JTestItemRecord + */ + public JTestItemRecord(Long itemId, String uuid, String name, String codeRef, JTestItemTypeEnum type, Timestamp startTime, String description, Timestamp lastModified, Object path, String uniqueId, String testCaseId, Boolean hasChildren, Boolean hasRetries, Boolean hasStats, Long parentId, Long retryOf, Long launchId, Integer testCaseHash) { + super(JTestItem.TEST_ITEM); + + set(0, itemId); + set(1, uuid); + set(2, name); + set(3, codeRef); + set(4, type); + set(5, startTime); + set(6, description); + set(7, lastModified); + set(8, path); + set(9, uniqueId); + set(10, testCaseId); + set(11, hasChildren); + set(12, hasRetries); + set(13, hasStats); + set(14, parentId); + set(15, retryOf); + set(16, launchId); + set(17, testCaseHash); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemResultsRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemResultsRecord.java old mode 100755 new mode 100644 index 407842718..3b8dc81f7 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemResultsRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTestItemResultsRecord.java @@ -6,8 +6,11 @@ import com.epam.ta.reportportal.jooq.enums.JStatusEnum; import com.epam.ta.reportportal.jooq.tables.JTestItemResults; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -25,206 +28,203 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JTestItemResultsRecord extends UpdatableRecordImpl implements - Record4 { - - private static final long serialVersionUID = 188670853; - - /** - * Create a detached JTestItemResultsRecord - */ - public JTestItemResultsRecord() { - super(JTestItemResults.TEST_ITEM_RESULTS); - } - - /** - * Create a detached, initialised JTestItemResultsRecord - */ - public JTestItemResultsRecord(Long resultId, JStatusEnum status, Timestamp endTime, - Double duration) { - super(JTestItemResults.TEST_ITEM_RESULTS); - - set(0, resultId); - set(1, status); - set(2, endTime); - set(3, duration); - } - - /** - * Getter for public.test_item_results.result_id. - */ - public Long getResultId() { - return (Long) get(0); - } - - /** - * Setter for public.test_item_results.result_id. - */ - public void setResultId(Long value) { - set(0, value); - } - - /** - * Getter for public.test_item_results.status. - */ - public JStatusEnum getStatus() { - return (JStatusEnum) get(1); - } - - /** - * Setter for public.test_item_results.status. - */ - public void setStatus(JStatusEnum value) { - set(1, value); - } - - /** - * Getter for public.test_item_results.end_time. - */ - public Timestamp getEndTime() { - return (Timestamp) get(2); - } - - /** - * Setter for public.test_item_results.end_time. - */ - public void setEndTime(Timestamp value) { - set(2, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.test_item_results.duration. - */ - public Double getDuration() { - return (Double) get(3); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.test_item_results.duration. - */ - public void setDuration(Double value) { - set(3, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID; - } - - @Override - public Field field2() { - return JTestItemResults.TEST_ITEM_RESULTS.STATUS; - } - - @Override - public Field field3() { - return JTestItemResults.TEST_ITEM_RESULTS.END_TIME; - } - - @Override - public Field field4() { - return JTestItemResults.TEST_ITEM_RESULTS.DURATION; - } - - @Override - public Long component1() { - return getResultId(); - } - - @Override - public JStatusEnum component2() { - return getStatus(); - } - - @Override - public Timestamp component3() { - return getEndTime(); - } - - @Override - public Double component4() { - return getDuration(); - } - - @Override - public Long value1() { - return getResultId(); - } - - @Override - public JStatusEnum value2() { - return getStatus(); - } - - @Override - public Timestamp value3() { - return getEndTime(); - } - - @Override - public Double value4() { - return getDuration(); - } - - @Override - public JTestItemResultsRecord value1(Long value) { - setResultId(value); - return this; - } - - @Override - public JTestItemResultsRecord value2(JStatusEnum value) { - setStatus(value); - return this; - } - - @Override - public JTestItemResultsRecord value3(Timestamp value) { - setEndTime(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JTestItemResultsRecord value4(Double value) { - setDuration(value); - return this; - } - - @Override - public JTestItemResultsRecord values(Long value1, JStatusEnum value2, Timestamp value3, - Double value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JTestItemResultsRecord extends UpdatableRecordImpl implements Record4 { + + private static final long serialVersionUID = 188670853; + + /** + * Setter for public.test_item_results.result_id. + */ + public void setResultId(Long value) { + set(0, value); + } + + /** + * Getter for public.test_item_results.result_id. + */ + public Long getResultId() { + return (Long) get(0); + } + + /** + * Setter for public.test_item_results.status. + */ + public void setStatus(JStatusEnum value) { + set(1, value); + } + + /** + * Getter for public.test_item_results.status. + */ + public JStatusEnum getStatus() { + return (JStatusEnum) get(1); + } + + /** + * Setter for public.test_item_results.end_time. + */ + public void setEndTime(Timestamp value) { + set(2, value); + } + + /** + * Getter for public.test_item_results.end_time. + */ + public Timestamp getEndTime() { + return (Timestamp) get(2); + } + + /** + * Setter for public.test_item_results.duration. + */ + public void setDuration(Double value) { + set(3, value); + } + + /** + * Getter for public.test_item_results.duration. + */ + public Double getDuration() { + return (Double) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID; + } + + @Override + public Field field2() { + return JTestItemResults.TEST_ITEM_RESULTS.STATUS; + } + + @Override + public Field field3() { + return JTestItemResults.TEST_ITEM_RESULTS.END_TIME; + } + + @Override + public Field field4() { + return JTestItemResults.TEST_ITEM_RESULTS.DURATION; + } + + @Override + public Long component1() { + return getResultId(); + } + + @Override + public JStatusEnum component2() { + return getStatus(); + } + + @Override + public Timestamp component3() { + return getEndTime(); + } + + @Override + public Double component4() { + return getDuration(); + } + + @Override + public Long value1() { + return getResultId(); + } + + @Override + public JStatusEnum value2() { + return getStatus(); + } + + @Override + public Timestamp value3() { + return getEndTime(); + } + + @Override + public Double value4() { + return getDuration(); + } + + @Override + public JTestItemResultsRecord value1(Long value) { + setResultId(value); + return this; + } + + @Override + public JTestItemResultsRecord value2(JStatusEnum value) { + setStatus(value); + return this; + } + + @Override + public JTestItemResultsRecord value3(Timestamp value) { + setEndTime(value); + return this; + } + + @Override + public JTestItemResultsRecord value4(Double value) { + setDuration(value); + return this; + } + + @Override + public JTestItemResultsRecord values(Long value1, JStatusEnum value2, Timestamp value3, Double value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JTestItemResultsRecord + */ + public JTestItemResultsRecord() { + super(JTestItemResults.TEST_ITEM_RESULTS); + } + + /** + * Create a detached, initialised JTestItemResultsRecord + */ + public JTestItemResultsRecord(Long resultId, JStatusEnum status, Timestamp endTime, Double duration) { + super(JTestItemResults.TEST_ITEM_RESULTS); + + set(0, resultId); + set(1, status); + set(2, endTime); + set(3, duration); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTicketRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTicketRecord.java index 04bd43d9a..8891add6c 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTicketRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JTicketRecord.java @@ -5,8 +5,11 @@ import com.epam.ta.reportportal.jooq.tables.JTicket; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record8; @@ -24,354 +27,351 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JTicketRecord extends UpdatableRecordImpl implements - Record8 { - - private static final long serialVersionUID = 2136482225; - - /** - * Create a detached JTicketRecord - */ - public JTicketRecord() { - super(JTicket.TICKET); - } - - /** - * Create a detached, initialised JTicketRecord - */ - public JTicketRecord(Long id, String ticketId, String submitter, Timestamp submitDate, - String btsUrl, String btsProject, String url, String pluginName) { - super(JTicket.TICKET); - - set(0, id); - set(1, ticketId); - set(2, submitter); - set(3, submitDate); - set(4, btsUrl); - set(5, btsProject); - set(6, url); - set(7, pluginName); - } - - /** - * Getter for public.ticket.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.ticket.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.ticket.ticket_id. - */ - public String getTicketId() { - return (String) get(1); - } - - /** - * Setter for public.ticket.ticket_id. - */ - public void setTicketId(String value) { - set(1, value); - } - - /** - * Getter for public.ticket.submitter. - */ - public String getSubmitter() { - return (String) get(2); - } - - /** - * Setter for public.ticket.submitter. - */ - public void setSubmitter(String value) { - set(2, value); - } - - /** - * Getter for public.ticket.submit_date. - */ - public Timestamp getSubmitDate() { - return (Timestamp) get(3); - } - - /** - * Setter for public.ticket.submit_date. - */ - public void setSubmitDate(Timestamp value) { - set(3, value); - } - - /** - * Getter for public.ticket.bts_url. - */ - public String getBtsUrl() { - return (String) get(4); - } - - /** - * Setter for public.ticket.bts_url. - */ - public void setBtsUrl(String value) { - set(4, value); - } - - /** - * Getter for public.ticket.bts_project. - */ - public String getBtsProject() { - return (String) get(5); - } - - /** - * Setter for public.ticket.bts_project. - */ - public void setBtsProject(String value) { - set(5, value); - } - - /** - * Getter for public.ticket.url. - */ - public String getUrl() { - return (String) get(6); - } - - /** - * Setter for public.ticket.url. - */ - public void setUrl(String value) { - set(6, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.ticket.plugin_name. - */ - public String getPluginName() { - return (String) get(7); - } - - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.ticket.plugin_name. - */ - public void setPluginName(String value) { - set(7, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - @Override - public Field field1() { - return JTicket.TICKET.ID; - } - - @Override - public Field field2() { - return JTicket.TICKET.TICKET_ID; - } - - @Override - public Field field3() { - return JTicket.TICKET.SUBMITTER; - } - - @Override - public Field field4() { - return JTicket.TICKET.SUBMIT_DATE; - } - - @Override - public Field field5() { - return JTicket.TICKET.BTS_URL; - } - - @Override - public Field field6() { - return JTicket.TICKET.BTS_PROJECT; - } - - @Override - public Field field7() { - return JTicket.TICKET.URL; - } - - @Override - public Field field8() { - return JTicket.TICKET.PLUGIN_NAME; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getTicketId(); - } - - @Override - public String component3() { - return getSubmitter(); - } - - @Override - public Timestamp component4() { - return getSubmitDate(); - } - - @Override - public String component5() { - return getBtsUrl(); - } - - @Override - public String component6() { - return getBtsProject(); - } - - @Override - public String component7() { - return getUrl(); - } - - @Override - public String component8() { - return getPluginName(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getTicketId(); - } - - @Override - public String value3() { - return getSubmitter(); - } - - @Override - public Timestamp value4() { - return getSubmitDate(); - } - - @Override - public String value5() { - return getBtsUrl(); - } - - @Override - public String value6() { - return getBtsProject(); - } - - @Override - public String value7() { - return getUrl(); - } - - @Override - public String value8() { - return getPluginName(); - } - - @Override - public JTicketRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JTicketRecord value2(String value) { - setTicketId(value); - return this; - } - - @Override - public JTicketRecord value3(String value) { - setSubmitter(value); - return this; - } - - @Override - public JTicketRecord value4(Timestamp value) { - setSubmitDate(value); - return this; - } - - @Override - public JTicketRecord value5(String value) { - setBtsUrl(value); - return this; - } - - @Override - public JTicketRecord value6(String value) { - setBtsProject(value); - return this; - } - - @Override - public JTicketRecord value7(String value) { - setUrl(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JTicketRecord value8(String value) { - setPluginName(value); - return this; - } - - @Override - public JTicketRecord values(Long value1, String value2, String value3, Timestamp value4, - String value5, String value6, String value7, String value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JTicketRecord extends UpdatableRecordImpl implements Record8 { + + private static final long serialVersionUID = 2136482225; + + /** + * Setter for public.ticket.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.ticket.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.ticket.ticket_id. + */ + public void setTicketId(String value) { + set(1, value); + } + + /** + * Getter for public.ticket.ticket_id. + */ + public String getTicketId() { + return (String) get(1); + } + + /** + * Setter for public.ticket.submitter. + */ + public void setSubmitter(String value) { + set(2, value); + } + + /** + * Getter for public.ticket.submitter. + */ + public String getSubmitter() { + return (String) get(2); + } + + /** + * Setter for public.ticket.submit_date. + */ + public void setSubmitDate(Timestamp value) { + set(3, value); + } + + /** + * Getter for public.ticket.submit_date. + */ + public Timestamp getSubmitDate() { + return (Timestamp) get(3); + } + + /** + * Setter for public.ticket.bts_url. + */ + public void setBtsUrl(String value) { + set(4, value); + } + + /** + * Getter for public.ticket.bts_url. + */ + public String getBtsUrl() { + return (String) get(4); + } + + /** + * Setter for public.ticket.bts_project. + */ + public void setBtsProject(String value) { + set(5, value); + } + + /** + * Getter for public.ticket.bts_project. + */ + public String getBtsProject() { + return (String) get(5); + } + + /** + * Setter for public.ticket.url. + */ + public void setUrl(String value) { + set(6, value); + } + + /** + * Getter for public.ticket.url. + */ + public String getUrl() { + return (String) get(6); + } + + /** + * Setter for public.ticket.plugin_name. + */ + public void setPluginName(String value) { + set(7, value); + } + + /** + * Getter for public.ticket.plugin_name. + */ + public String getPluginName() { + return (String) get(7); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record8 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row8 fieldsRow() { + return (Row8) super.fieldsRow(); + } + + @Override + public Row8 valuesRow() { + return (Row8) super.valuesRow(); + } + + @Override + public Field field1() { + return JTicket.TICKET.ID; + } + + @Override + public Field field2() { + return JTicket.TICKET.TICKET_ID; + } + + @Override + public Field field3() { + return JTicket.TICKET.SUBMITTER; + } + + @Override + public Field field4() { + return JTicket.TICKET.SUBMIT_DATE; + } + + @Override + public Field field5() { + return JTicket.TICKET.BTS_URL; + } + + @Override + public Field field6() { + return JTicket.TICKET.BTS_PROJECT; + } + + @Override + public Field field7() { + return JTicket.TICKET.URL; + } + + @Override + public Field field8() { + return JTicket.TICKET.PLUGIN_NAME; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getTicketId(); + } + + @Override + public String component3() { + return getSubmitter(); + } + + @Override + public Timestamp component4() { + return getSubmitDate(); + } + + @Override + public String component5() { + return getBtsUrl(); + } + + @Override + public String component6() { + return getBtsProject(); + } + + @Override + public String component7() { + return getUrl(); + } + + @Override + public String component8() { + return getPluginName(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getTicketId(); + } + + @Override + public String value3() { + return getSubmitter(); + } + + @Override + public Timestamp value4() { + return getSubmitDate(); + } + + @Override + public String value5() { + return getBtsUrl(); + } + + @Override + public String value6() { + return getBtsProject(); + } + + @Override + public String value7() { + return getUrl(); + } + + @Override + public String value8() { + return getPluginName(); + } + + @Override + public JTicketRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JTicketRecord value2(String value) { + setTicketId(value); + return this; + } + + @Override + public JTicketRecord value3(String value) { + setSubmitter(value); + return this; + } + + @Override + public JTicketRecord value4(Timestamp value) { + setSubmitDate(value); + return this; + } + + @Override + public JTicketRecord value5(String value) { + setBtsUrl(value); + return this; + } + + @Override + public JTicketRecord value6(String value) { + setBtsProject(value); + return this; + } + + @Override + public JTicketRecord value7(String value) { + setUrl(value); + return this; + } + + @Override + public JTicketRecord value8(String value) { + setPluginName(value); + return this; + } + + @Override + public JTicketRecord values(Long value1, String value2, String value3, Timestamp value4, String value5, String value6, String value7, String value8) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JTicketRecord + */ + public JTicketRecord() { + super(JTicket.TICKET); + } + + /** + * Create a detached, initialised JTicketRecord + */ + public JTicketRecord(Long id, String ticketId, String submitter, Timestamp submitDate, String btsUrl, String btsProject, String url, String pluginName) { + super(JTicket.TICKET); + + set(0, id); + set(1, ticketId); + set(2, submitter); + set(3, submitDate); + set(4, btsUrl); + set(5, btsProject); + set(6, url); + set(7, pluginName); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserCreationBidRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserCreationBidRecord.java old mode 100755 new mode 100644 index 2bc6f6eaf..b647655b1 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserCreationBidRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserCreationBidRecord.java @@ -5,12 +5,16 @@ import com.epam.ta.reportportal.jooq.tables.JUserCreationBid; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; +import org.jooq.JSONB; import org.jooq.Record1; -import org.jooq.Record5; -import org.jooq.Row5; +import org.jooq.Record6; +import org.jooq.Row6; import org.jooq.impl.UpdatableRecordImpl; @@ -24,243 +28,277 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JUserCreationBidRecord extends UpdatableRecordImpl implements - Record5 { - - private static final long serialVersionUID = 503171682; - - /** - * Create a detached JUserCreationBidRecord - */ - public JUserCreationBidRecord() { - super(JUserCreationBid.USER_CREATION_BID); - } - - /** - * Create a detached, initialised JUserCreationBidRecord - */ - public JUserCreationBidRecord(String uuid, Timestamp lastModified, String email, - Long defaultProjectId, String role) { - super(JUserCreationBid.USER_CREATION_BID); - - set(0, uuid); - set(1, lastModified); - set(2, email); - set(3, defaultProjectId); - set(4, role); - } - - /** - * Getter for public.user_creation_bid.uuid. - */ - public String getUuid() { - return (String) get(0); - } - - /** - * Setter for public.user_creation_bid.uuid. - */ - public void setUuid(String value) { - set(0, value); - } - - /** - * Getter for public.user_creation_bid.last_modified. - */ - public Timestamp getLastModified() { - return (Timestamp) get(1); - } - - /** - * Setter for public.user_creation_bid.last_modified. - */ - public void setLastModified(Timestamp value) { - set(1, value); - } - - /** - * Getter for public.user_creation_bid.email. - */ - public String getEmail() { - return (String) get(2); - } - - /** - * Setter for public.user_creation_bid.email. - */ - public void setEmail(String value) { - set(2, value); - } - - /** - * Getter for public.user_creation_bid.default_project_id. - */ - public Long getDefaultProjectId() { - return (Long) get(3); - } - - /** - * Setter for public.user_creation_bid.default_project_id. - */ - public void setDefaultProjectId(Long value) { - set(3, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.user_creation_bid.role. - */ - public String getRole() { - return (String) get(4); - } - - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.user_creation_bid.role. - */ - public void setRole(String value) { - set(4, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } - - @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); - } - - @Override - public Field field1() { - return JUserCreationBid.USER_CREATION_BID.UUID; - } - - @Override - public Field field2() { - return JUserCreationBid.USER_CREATION_BID.LAST_MODIFIED; - } - - @Override - public Field field3() { - return JUserCreationBid.USER_CREATION_BID.EMAIL; - } - - @Override - public Field field4() { - return JUserCreationBid.USER_CREATION_BID.DEFAULT_PROJECT_ID; - } - - @Override - public Field field5() { - return JUserCreationBid.USER_CREATION_BID.ROLE; - } - - @Override - public String component1() { - return getUuid(); - } - - @Override - public Timestamp component2() { - return getLastModified(); - } - - @Override - public String component3() { - return getEmail(); - } - - @Override - public Long component4() { - return getDefaultProjectId(); - } - - @Override - public String component5() { - return getRole(); - } - - @Override - public String value1() { - return getUuid(); - } - - @Override - public Timestamp value2() { - return getLastModified(); - } - - @Override - public String value3() { - return getEmail(); - } - - @Override - public Long value4() { - return getDefaultProjectId(); - } - - @Override - public String value5() { - return getRole(); - } - - @Override - public JUserCreationBidRecord value1(String value) { - setUuid(value); - return this; - } - - @Override - public JUserCreationBidRecord value2(Timestamp value) { - setLastModified(value); - return this; - } - - @Override - public JUserCreationBidRecord value3(String value) { - setEmail(value); - return this; - } - - @Override - public JUserCreationBidRecord value4(Long value) { - setDefaultProjectId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JUserCreationBidRecord value5(String value) { - setRole(value); - return this; - } - - @Override - public JUserCreationBidRecord values(String value1, Timestamp value2, String value3, Long value4, - String value5) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JUserCreationBidRecord extends UpdatableRecordImpl implements Record6 { + + private static final long serialVersionUID = 1323859516; + + /** + * Setter for public.user_creation_bid.uuid. + */ + public void setUuid(String value) { + set(0, value); + } + + /** + * Getter for public.user_creation_bid.uuid. + */ + public String getUuid() { + return (String) get(0); + } + + /** + * Setter for public.user_creation_bid.last_modified. + */ + public void setLastModified(Timestamp value) { + set(1, value); + } + + /** + * Getter for public.user_creation_bid.last_modified. + */ + public Timestamp getLastModified() { + return (Timestamp) get(1); + } + + /** + * Setter for public.user_creation_bid.email. + */ + public void setEmail(String value) { + set(2, value); + } + + /** + * Getter for public.user_creation_bid.email. + */ + public String getEmail() { + return (String) get(2); + } + + /** + * Setter for public.user_creation_bid.role. + */ + public void setRole(String value) { + set(3, value); + } + + /** + * Getter for public.user_creation_bid.role. + */ + public String getRole() { + return (String) get(3); + } + + /** + * Setter for public.user_creation_bid.project_name. + */ + public void setProjectName(String value) { + set(4, value); + } + + /** + * Getter for public.user_creation_bid.project_name. + */ + public String getProjectName() { + return (String) get(4); + } + + /** + * Setter for public.user_creation_bid.metadata. + */ + public void setMetadata(JSONB value) { + set(5, value); + } + + /** + * Getter for public.user_creation_bid.metadata. + */ + public JSONB getMetadata() { + return (JSONB) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return JUserCreationBid.USER_CREATION_BID.UUID; + } + + @Override + public Field field2() { + return JUserCreationBid.USER_CREATION_BID.LAST_MODIFIED; + } + + @Override + public Field field3() { + return JUserCreationBid.USER_CREATION_BID.EMAIL; + } + + @Override + public Field field4() { + return JUserCreationBid.USER_CREATION_BID.ROLE; + } + + @Override + public Field field5() { + return JUserCreationBid.USER_CREATION_BID.PROJECT_NAME; + } + + @Override + public Field field6() { + return JUserCreationBid.USER_CREATION_BID.METADATA; + } + + @Override + public String component1() { + return getUuid(); + } + + @Override + public Timestamp component2() { + return getLastModified(); + } + + @Override + public String component3() { + return getEmail(); + } + + @Override + public String component4() { + return getRole(); + } + + @Override + public String component5() { + return getProjectName(); + } + + @Override + public JSONB component6() { + return getMetadata(); + } + + @Override + public String value1() { + return getUuid(); + } + + @Override + public Timestamp value2() { + return getLastModified(); + } + + @Override + public String value3() { + return getEmail(); + } + + @Override + public String value4() { + return getRole(); + } + + @Override + public String value5() { + return getProjectName(); + } + + @Override + public JSONB value6() { + return getMetadata(); + } + + @Override + public JUserCreationBidRecord value1(String value) { + setUuid(value); + return this; + } + + @Override + public JUserCreationBidRecord value2(Timestamp value) { + setLastModified(value); + return this; + } + + @Override + public JUserCreationBidRecord value3(String value) { + setEmail(value); + return this; + } + + @Override + public JUserCreationBidRecord value4(String value) { + setRole(value); + return this; + } + + @Override + public JUserCreationBidRecord value5(String value) { + setProjectName(value); + return this; + } + + @Override + public JUserCreationBidRecord value6(JSONB value) { + setMetadata(value); + return this; + } + + @Override + public JUserCreationBidRecord values(String value1, Timestamp value2, String value3, String value4, String value5, JSONB value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JUserCreationBidRecord + */ + public JUserCreationBidRecord() { + super(JUserCreationBid.USER_CREATION_BID); + } + + /** + * Create a detached, initialised JUserCreationBidRecord + */ + public JUserCreationBidRecord(String uuid, Timestamp lastModified, String email, String role, String projectName, JSONB metadata) { + super(JUserCreationBid.USER_CREATION_BID); + + set(0, uuid); + set(1, lastModified); + set(2, email); + set(3, role); + set(4, projectName); + set(5, metadata); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserPreferenceRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserPreferenceRecord.java old mode 100755 new mode 100644 index cf7565694..ea8b61038 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserPreferenceRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserPreferenceRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JUserPreference; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record4; @@ -23,204 +25,203 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JUserPreferenceRecord extends UpdatableRecordImpl implements - Record4 { - - private static final long serialVersionUID = 1708369277; - - /** - * Create a detached JUserPreferenceRecord - */ - public JUserPreferenceRecord() { - super(JUserPreference.USER_PREFERENCE); - } - - /** - * Create a detached, initialised JUserPreferenceRecord - */ - public JUserPreferenceRecord(Long id, Long projectId, Long userId, Long filterId) { - super(JUserPreference.USER_PREFERENCE); - - set(0, id); - set(1, projectId); - set(2, userId); - set(3, filterId); - } - - /** - * Getter for public.user_preference.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.user_preference.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.user_preference.project_id. - */ - public Long getProjectId() { - return (Long) get(1); - } - - /** - * Setter for public.user_preference.project_id. - */ - public void setProjectId(Long value) { - set(1, value); - } - - /** - * Getter for public.user_preference.user_id. - */ - public Long getUserId() { - return (Long) get(2); - } - - /** - * Setter for public.user_preference.user_id. - */ - public void setUserId(Long value) { - set(2, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.user_preference.filter_id. - */ - public Long getFilterId() { - return (Long) get(3); - } - - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.user_preference.filter_id. - */ - public void setFilterId(Long value) { - set(3, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return JUserPreference.USER_PREFERENCE.ID; - } - - @Override - public Field field2() { - return JUserPreference.USER_PREFERENCE.PROJECT_ID; - } - - @Override - public Field field3() { - return JUserPreference.USER_PREFERENCE.USER_ID; - } - - @Override - public Field field4() { - return JUserPreference.USER_PREFERENCE.FILTER_ID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Long component2() { - return getProjectId(); - } - - @Override - public Long component3() { - return getUserId(); - } - - @Override - public Long component4() { - return getFilterId(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Long value2() { - return getProjectId(); - } - - @Override - public Long value3() { - return getUserId(); - } - - @Override - public Long value4() { - return getFilterId(); - } - - @Override - public JUserPreferenceRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JUserPreferenceRecord value2(Long value) { - setProjectId(value); - return this; - } - - @Override - public JUserPreferenceRecord value3(Long value) { - setUserId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JUserPreferenceRecord value4(Long value) { - setFilterId(value); - return this; - } - - @Override - public JUserPreferenceRecord values(Long value1, Long value2, Long value3, Long value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JUserPreferenceRecord extends UpdatableRecordImpl implements Record4 { + + private static final long serialVersionUID = 1708369277; + + /** + * Setter for public.user_preference.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.user_preference.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.user_preference.project_id. + */ + public void setProjectId(Long value) { + set(1, value); + } + + /** + * Getter for public.user_preference.project_id. + */ + public Long getProjectId() { + return (Long) get(1); + } + + /** + * Setter for public.user_preference.user_id. + */ + public void setUserId(Long value) { + set(2, value); + } + + /** + * Getter for public.user_preference.user_id. + */ + public Long getUserId() { + return (Long) get(2); + } + + /** + * Setter for public.user_preference.filter_id. + */ + public void setFilterId(Long value) { + set(3, value); + } + + /** + * Getter for public.user_preference.filter_id. + */ + public Long getFilterId() { + return (Long) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return JUserPreference.USER_PREFERENCE.ID; + } + + @Override + public Field field2() { + return JUserPreference.USER_PREFERENCE.PROJECT_ID; + } + + @Override + public Field field3() { + return JUserPreference.USER_PREFERENCE.USER_ID; + } + + @Override + public Field field4() { + return JUserPreference.USER_PREFERENCE.FILTER_ID; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Long component2() { + return getProjectId(); + } + + @Override + public Long component3() { + return getUserId(); + } + + @Override + public Long component4() { + return getFilterId(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Long value2() { + return getProjectId(); + } + + @Override + public Long value3() { + return getUserId(); + } + + @Override + public Long value4() { + return getFilterId(); + } + + @Override + public JUserPreferenceRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JUserPreferenceRecord value2(Long value) { + setProjectId(value); + return this; + } + + @Override + public JUserPreferenceRecord value3(Long value) { + setUserId(value); + return this; + } + + @Override + public JUserPreferenceRecord value4(Long value) { + setFilterId(value); + return this; + } + + @Override + public JUserPreferenceRecord values(Long value1, Long value2, Long value3, Long value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JUserPreferenceRecord + */ + public JUserPreferenceRecord() { + super(JUserPreference.USER_PREFERENCE); + } + + /** + * Create a detached, initialised JUserPreferenceRecord + */ + public JUserPreferenceRecord(Long id, Long projectId, Long userId, Long filterId) { + super(JUserPreference.USER_PREFERENCE); + + set(0, id); + set(1, projectId); + set(2, userId); + set(3, filterId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUsersRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUsersRecord.java index 0dbe9ed12..4dffd9558 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUsersRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUsersRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JUsers; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.JSONB; import org.jooq.Record1; @@ -24,467 +26,462 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JUsersRecord extends UpdatableRecordImpl implements - Record11 { - - private static final long serialVersionUID = -329787849; - - /** - * Create a detached JUsersRecord - */ - public JUsersRecord() { - super(JUsers.USERS); - } - - /** - * Create a detached, initialised JUsersRecord - */ - public JUsersRecord(Long id, String login, String password, String email, String attachment, - String attachmentThumbnail, String role, String type, Boolean expired, String fullName, - JSONB metadata) { - super(JUsers.USERS); - - set(0, id); - set(1, login); - set(2, password); - set(3, email); - set(4, attachment); - set(5, attachmentThumbnail); - set(6, role); - set(7, type); - set(8, expired); - set(9, fullName); - set(10, metadata); - } - - /** - * Getter for public.users.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.users.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.users.login. - */ - public String getLogin() { - return (String) get(1); - } - - /** - * Setter for public.users.login. - */ - public void setLogin(String value) { - set(1, value); - } - - /** - * Getter for public.users.password. - */ - public String getPassword() { - return (String) get(2); - } - - /** - * Setter for public.users.password. - */ - public void setPassword(String value) { - set(2, value); - } - - /** - * Getter for public.users.email. - */ - public String getEmail() { - return (String) get(3); - } - - /** - * Setter for public.users.email. - */ - public void setEmail(String value) { - set(3, value); - } - - /** - * Getter for public.users.attachment. - */ - public String getAttachment() { - return (String) get(4); - } - - /** - * Setter for public.users.attachment. - */ - public void setAttachment(String value) { - set(4, value); - } - - /** - * Getter for public.users.attachment_thumbnail. - */ - public String getAttachmentThumbnail() { - return (String) get(5); - } - - /** - * Setter for public.users.attachment_thumbnail. - */ - public void setAttachmentThumbnail(String value) { - set(5, value); - } - - /** - * Getter for public.users.role. - */ - public String getRole() { - return (String) get(6); - } - - /** - * Setter for public.users.role. - */ - public void setRole(String value) { - set(6, value); - } - - /** - * Getter for public.users.type. - */ - public String getType() { - return (String) get(7); - } - - /** - * Setter for public.users.type. - */ - public void setType(String value) { - set(7, value); - } - - /** - * Getter for public.users.expired. - */ - public Boolean getExpired() { - return (Boolean) get(8); - } - - /** - * Setter for public.users.expired. - */ - public void setExpired(Boolean value) { - set(8, value); - } - - /** - * Getter for public.users.full_name. - */ - public String getFullName() { - return (String) get(9); - } - - /** - * Setter for public.users.full_name. - */ - public void setFullName(String value) { - set(9, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.users.metadata. - */ - public JSONB getMetadata() { - return (JSONB) get(10); - } - - // ------------------------------------------------------------------------- - // Record11 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.users.metadata. - */ - public void setMetadata(JSONB value) { - set(10, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); - } - - @Override - public Row11 valuesRow() { - return (Row11) super.valuesRow(); - } - - @Override - public Field field1() { - return JUsers.USERS.ID; - } - - @Override - public Field field2() { - return JUsers.USERS.LOGIN; - } - - @Override - public Field field3() { - return JUsers.USERS.PASSWORD; - } - - @Override - public Field field4() { - return JUsers.USERS.EMAIL; - } - - @Override - public Field field5() { - return JUsers.USERS.ATTACHMENT; - } - - @Override - public Field field6() { - return JUsers.USERS.ATTACHMENT_THUMBNAIL; - } - - @Override - public Field field7() { - return JUsers.USERS.ROLE; - } - - @Override - public Field field8() { - return JUsers.USERS.TYPE; - } - - @Override - public Field field9() { - return JUsers.USERS.EXPIRED; - } - - @Override - public Field field10() { - return JUsers.USERS.FULL_NAME; - } - - @Override - public Field field11() { - return JUsers.USERS.METADATA; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getLogin(); - } - - @Override - public String component3() { - return getPassword(); - } - - @Override - public String component4() { - return getEmail(); - } - - @Override - public String component5() { - return getAttachment(); - } - - @Override - public String component6() { - return getAttachmentThumbnail(); - } - - @Override - public String component7() { - return getRole(); - } - - @Override - public String component8() { - return getType(); - } - - @Override - public Boolean component9() { - return getExpired(); - } - - @Override - public String component10() { - return getFullName(); - } - - @Override - public JSONB component11() { - return getMetadata(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getLogin(); - } - - @Override - public String value3() { - return getPassword(); - } - - @Override - public String value4() { - return getEmail(); - } - - @Override - public String value5() { - return getAttachment(); - } - - @Override - public String value6() { - return getAttachmentThumbnail(); - } - - @Override - public String value7() { - return getRole(); - } - - @Override - public String value8() { - return getType(); - } - - @Override - public Boolean value9() { - return getExpired(); - } - - @Override - public String value10() { - return getFullName(); - } - - @Override - public JSONB value11() { - return getMetadata(); - } - - @Override - public JUsersRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JUsersRecord value2(String value) { - setLogin(value); - return this; - } - - @Override - public JUsersRecord value3(String value) { - setPassword(value); - return this; - } - - @Override - public JUsersRecord value4(String value) { - setEmail(value); - return this; - } - - @Override - public JUsersRecord value5(String value) { - setAttachment(value); - return this; - } - - @Override - public JUsersRecord value6(String value) { - setAttachmentThumbnail(value); - return this; - } - - @Override - public JUsersRecord value7(String value) { - setRole(value); - return this; - } - - @Override - public JUsersRecord value8(String value) { - setType(value); - return this; - } - - @Override - public JUsersRecord value9(Boolean value) { - setExpired(value); - return this; - } - - @Override - public JUsersRecord value10(String value) { - setFullName(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JUsersRecord value11(JSONB value) { - setMetadata(value); - return this; - } - - @Override - public JUsersRecord values(Long value1, String value2, String value3, String value4, - String value5, String value6, String value7, String value8, Boolean value9, String value10, - JSONB value11) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JUsersRecord extends UpdatableRecordImpl implements Record11 { + + private static final long serialVersionUID = -329787849; + + /** + * Setter for public.users.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.users.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.users.login. + */ + public void setLogin(String value) { + set(1, value); + } + + /** + * Getter for public.users.login. + */ + public String getLogin() { + return (String) get(1); + } + + /** + * Setter for public.users.password. + */ + public void setPassword(String value) { + set(2, value); + } + + /** + * Getter for public.users.password. + */ + public String getPassword() { + return (String) get(2); + } + + /** + * Setter for public.users.email. + */ + public void setEmail(String value) { + set(3, value); + } + + /** + * Getter for public.users.email. + */ + public String getEmail() { + return (String) get(3); + } + + /** + * Setter for public.users.attachment. + */ + public void setAttachment(String value) { + set(4, value); + } + + /** + * Getter for public.users.attachment. + */ + public String getAttachment() { + return (String) get(4); + } + + /** + * Setter for public.users.attachment_thumbnail. + */ + public void setAttachmentThumbnail(String value) { + set(5, value); + } + + /** + * Getter for public.users.attachment_thumbnail. + */ + public String getAttachmentThumbnail() { + return (String) get(5); + } + + /** + * Setter for public.users.role. + */ + public void setRole(String value) { + set(6, value); + } + + /** + * Getter for public.users.role. + */ + public String getRole() { + return (String) get(6); + } + + /** + * Setter for public.users.type. + */ + public void setType(String value) { + set(7, value); + } + + /** + * Getter for public.users.type. + */ + public String getType() { + return (String) get(7); + } + + /** + * Setter for public.users.expired. + */ + public void setExpired(Boolean value) { + set(8, value); + } + + /** + * Getter for public.users.expired. + */ + public Boolean getExpired() { + return (Boolean) get(8); + } + + /** + * Setter for public.users.full_name. + */ + public void setFullName(String value) { + set(9, value); + } + + /** + * Getter for public.users.full_name. + */ + public String getFullName() { + return (String) get(9); + } + + /** + * Setter for public.users.metadata. + */ + public void setMetadata(JSONB value) { + set(10, value); + } + + /** + * Getter for public.users.metadata. + */ + public JSONB getMetadata() { + return (JSONB) get(10); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record11 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } + + @Override + public Row11 valuesRow() { + return (Row11) super.valuesRow(); + } + + @Override + public Field field1() { + return JUsers.USERS.ID; + } + + @Override + public Field field2() { + return JUsers.USERS.LOGIN; + } + + @Override + public Field field3() { + return JUsers.USERS.PASSWORD; + } + + @Override + public Field field4() { + return JUsers.USERS.EMAIL; + } + + @Override + public Field field5() { + return JUsers.USERS.ATTACHMENT; + } + + @Override + public Field field6() { + return JUsers.USERS.ATTACHMENT_THUMBNAIL; + } + + @Override + public Field field7() { + return JUsers.USERS.ROLE; + } + + @Override + public Field field8() { + return JUsers.USERS.TYPE; + } + + @Override + public Field field9() { + return JUsers.USERS.EXPIRED; + } + + @Override + public Field field10() { + return JUsers.USERS.FULL_NAME; + } + + @Override + public Field field11() { + return JUsers.USERS.METADATA; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getLogin(); + } + + @Override + public String component3() { + return getPassword(); + } + + @Override + public String component4() { + return getEmail(); + } + + @Override + public String component5() { + return getAttachment(); + } + + @Override + public String component6() { + return getAttachmentThumbnail(); + } + + @Override + public String component7() { + return getRole(); + } + + @Override + public String component8() { + return getType(); + } + + @Override + public Boolean component9() { + return getExpired(); + } + + @Override + public String component10() { + return getFullName(); + } + + @Override + public JSONB component11() { + return getMetadata(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getLogin(); + } + + @Override + public String value3() { + return getPassword(); + } + + @Override + public String value4() { + return getEmail(); + } + + @Override + public String value5() { + return getAttachment(); + } + + @Override + public String value6() { + return getAttachmentThumbnail(); + } + + @Override + public String value7() { + return getRole(); + } + + @Override + public String value8() { + return getType(); + } + + @Override + public Boolean value9() { + return getExpired(); + } + + @Override + public String value10() { + return getFullName(); + } + + @Override + public JSONB value11() { + return getMetadata(); + } + + @Override + public JUsersRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JUsersRecord value2(String value) { + setLogin(value); + return this; + } + + @Override + public JUsersRecord value3(String value) { + setPassword(value); + return this; + } + + @Override + public JUsersRecord value4(String value) { + setEmail(value); + return this; + } + + @Override + public JUsersRecord value5(String value) { + setAttachment(value); + return this; + } + + @Override + public JUsersRecord value6(String value) { + setAttachmentThumbnail(value); + return this; + } + + @Override + public JUsersRecord value7(String value) { + setRole(value); + return this; + } + + @Override + public JUsersRecord value8(String value) { + setType(value); + return this; + } + + @Override + public JUsersRecord value9(Boolean value) { + setExpired(value); + return this; + } + + @Override + public JUsersRecord value10(String value) { + setFullName(value); + return this; + } + + @Override + public JUsersRecord value11(JSONB value) { + setMetadata(value); + return this; + } + + @Override + public JUsersRecord values(Long value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, Boolean value9, String value10, JSONB value11) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JUsersRecord + */ + public JUsersRecord() { + super(JUsers.USERS); + } + + /** + * Create a detached, initialised JUsersRecord + */ + public JUsersRecord(Long id, String login, String password, String email, String attachment, String attachmentThumbnail, String role, String type, Boolean expired, String fullName, JSONB metadata) { + super(JUsers.USERS); + + set(0, id); + set(1, login); + set(2, password); + set(3, email); + set(4, attachment); + set(5, attachmentThumbnail); + set(6, role); + set(7, type); + set(8, expired); + set(9, fullName); + set(10, metadata); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetFilterRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetFilterRecord.java old mode 100755 new mode 100644 index 7f8a0fa40..e4f6db2ab --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetFilterRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetFilterRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record2; import org.jooq.Row2; @@ -22,130 +24,129 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JWidgetFilterRecord extends UpdatableRecordImpl implements - Record2 { - - private static final long serialVersionUID = 618192211; - - /** - * Create a detached JWidgetFilterRecord - */ - public JWidgetFilterRecord() { - super(JWidgetFilter.WIDGET_FILTER); - } - - /** - * Create a detached, initialised JWidgetFilterRecord - */ - public JWidgetFilterRecord(Long widgetId, Long filterId) { - super(JWidgetFilter.WIDGET_FILTER); - - set(0, widgetId); - set(1, filterId); - } - - /** - * Getter for public.widget_filter.widget_id. - */ - public Long getWidgetId() { - return (Long) get(0); - } - - /** - * Setter for public.widget_filter.widget_id. - */ - public void setWidgetId(Long value) { - set(0, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.widget_filter.filter_id. - */ - public Long getFilterId() { - return (Long) get(1); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.widget_filter.filter_id. - */ - public void setFilterId(Long value) { - set(1, value); - } - - @Override - public Record2 key() { - return (Record2) super.key(); - } - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JWidgetFilter.WIDGET_FILTER.WIDGET_ID; - } - - @Override - public Field field2() { - return JWidgetFilter.WIDGET_FILTER.FILTER_ID; - } - - @Override - public Long component1() { - return getWidgetId(); - } - - @Override - public Long component2() { - return getFilterId(); - } - - @Override - public Long value1() { - return getWidgetId(); - } - - @Override - public Long value2() { - return getFilterId(); - } - - @Override - public JWidgetFilterRecord value1(Long value) { - setWidgetId(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JWidgetFilterRecord value2(Long value) { - setFilterId(value); - return this; - } - - @Override - public JWidgetFilterRecord values(Long value1, Long value2) { - value1(value1); - value2(value2); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JWidgetFilterRecord extends UpdatableRecordImpl implements Record2 { + + private static final long serialVersionUID = 618192211; + + /** + * Setter for public.widget_filter.widget_id. + */ + public void setWidgetId(Long value) { + set(0, value); + } + + /** + * Getter for public.widget_filter.widget_id. + */ + public Long getWidgetId() { + return (Long) get(0); + } + + /** + * Setter for public.widget_filter.filter_id. + */ + public void setFilterId(Long value) { + set(1, value); + } + + /** + * Getter for public.widget_filter.filter_id. + */ + public Long getFilterId() { + return (Long) get(1); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record2 key() { + return (Record2) super.key(); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return JWidgetFilter.WIDGET_FILTER.WIDGET_ID; + } + + @Override + public Field field2() { + return JWidgetFilter.WIDGET_FILTER.FILTER_ID; + } + + @Override + public Long component1() { + return getWidgetId(); + } + + @Override + public Long component2() { + return getFilterId(); + } + + @Override + public Long value1() { + return getWidgetId(); + } + + @Override + public Long value2() { + return getFilterId(); + } + + @Override + public JWidgetFilterRecord value1(Long value) { + setWidgetId(value); + return this; + } + + @Override + public JWidgetFilterRecord value2(Long value) { + setFilterId(value); + return this; + } + + @Override + public JWidgetFilterRecord values(Long value1, Long value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JWidgetFilterRecord + */ + public JWidgetFilterRecord() { + super(JWidgetFilter.WIDGET_FILTER); + } + + /** + * Create a detached, initialised JWidgetFilterRecord + */ + public JWidgetFilterRecord(Long widgetId, Long filterId) { + super(JWidgetFilter.WIDGET_FILTER); + + set(0, widgetId); + set(1, filterId); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetRecord.java old mode 100755 new mode 100644 index fd8e2648c..c582c2f56 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JWidgetRecord.java @@ -5,7 +5,9 @@ import com.epam.ta.reportportal.jooq.tables.JWidget; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.JSONB; import org.jooq.Record1; @@ -24,280 +26,277 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JWidgetRecord extends UpdatableRecordImpl implements - Record6 { - - private static final long serialVersionUID = 716998638; - - /** - * Create a detached JWidgetRecord - */ - public JWidgetRecord() { - super(JWidget.WIDGET); - } - - /** - * Create a detached, initialised JWidgetRecord - */ - public JWidgetRecord(Long id, String name, String description, String widgetType, - Short itemsCount, JSONB widgetOptions) { - super(JWidget.WIDGET); - - set(0, id); - set(1, name); - set(2, description); - set(3, widgetType); - set(4, itemsCount); - set(5, widgetOptions); - } - - /** - * Getter for public.widget.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.widget.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.widget.name. - */ - public String getName() { - return (String) get(1); - } - - /** - * Setter for public.widget.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.widget.description. - */ - public String getDescription() { - return (String) get(2); - } - - /** - * Setter for public.widget.description. - */ - public void setDescription(String value) { - set(2, value); - } - - /** - * Getter for public.widget.widget_type. - */ - public String getWidgetType() { - return (String) get(3); - } - - /** - * Setter for public.widget.widget_type. - */ - public void setWidgetType(String value) { - set(3, value); - } - - /** - * Getter for public.widget.items_count. - */ - public Short getItemsCount() { - return (Short) get(4); - } - - /** - * Setter for public.widget.items_count. - */ - public void setItemsCount(Short value) { - set(4, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.widget.widget_options. - */ - public JSONB getWidgetOptions() { - return (JSONB) get(5); - } - - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.widget.widget_options. - */ - public void setWidgetOptions(JSONB value) { - set(5, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return JWidget.WIDGET.ID; - } - - @Override - public Field field2() { - return JWidget.WIDGET.NAME; - } - - @Override - public Field field3() { - return JWidget.WIDGET.DESCRIPTION; - } - - @Override - public Field field4() { - return JWidget.WIDGET.WIDGET_TYPE; - } - - @Override - public Field field5() { - return JWidget.WIDGET.ITEMS_COUNT; - } - - @Override - public Field field6() { - return JWidget.WIDGET.WIDGET_OPTIONS; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public String component3() { - return getDescription(); - } - - @Override - public String component4() { - return getWidgetType(); - } - - @Override - public Short component5() { - return getItemsCount(); - } - - @Override - public JSONB component6() { - return getWidgetOptions(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public String value3() { - return getDescription(); - } - - @Override - public String value4() { - return getWidgetType(); - } - - @Override - public Short value5() { - return getItemsCount(); - } - - @Override - public JSONB value6() { - return getWidgetOptions(); - } - - @Override - public JWidgetRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JWidgetRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JWidgetRecord value3(String value) { - setDescription(value); - return this; - } - - @Override - public JWidgetRecord value4(String value) { - setWidgetType(value); - return this; - } - - @Override - public JWidgetRecord value5(Short value) { - setItemsCount(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JWidgetRecord value6(JSONB value) { - setWidgetOptions(value); - return this; - } - - @Override - public JWidgetRecord values(Long value1, String value2, String value3, String value4, - Short value5, JSONB value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JWidgetRecord extends UpdatableRecordImpl implements Record6 { + + private static final long serialVersionUID = 716998638; + + /** + * Setter for public.widget.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.widget.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.widget.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.widget.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.widget.description. + */ + public void setDescription(String value) { + set(2, value); + } + + /** + * Getter for public.widget.description. + */ + public String getDescription() { + return (String) get(2); + } + + /** + * Setter for public.widget.widget_type. + */ + public void setWidgetType(String value) { + set(3, value); + } + + /** + * Getter for public.widget.widget_type. + */ + public String getWidgetType() { + return (String) get(3); + } + + /** + * Setter for public.widget.items_count. + */ + public void setItemsCount(Short value) { + set(4, value); + } + + /** + * Getter for public.widget.items_count. + */ + public Short getItemsCount() { + return (Short) get(4); + } + + /** + * Setter for public.widget.widget_options. + */ + public void setWidgetOptions(JSONB value) { + set(5, value); + } + + /** + * Getter for public.widget.widget_options. + */ + public JSONB getWidgetOptions() { + return (JSONB) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return JWidget.WIDGET.ID; + } + + @Override + public Field field2() { + return JWidget.WIDGET.NAME; + } + + @Override + public Field field3() { + return JWidget.WIDGET.DESCRIPTION; + } + + @Override + public Field field4() { + return JWidget.WIDGET.WIDGET_TYPE; + } + + @Override + public Field field5() { + return JWidget.WIDGET.ITEMS_COUNT; + } + + @Override + public Field field6() { + return JWidget.WIDGET.WIDGET_OPTIONS; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public String component3() { + return getDescription(); + } + + @Override + public String component4() { + return getWidgetType(); + } + + @Override + public Short component5() { + return getItemsCount(); + } + + @Override + public JSONB component6() { + return getWidgetOptions(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public String value3() { + return getDescription(); + } + + @Override + public String value4() { + return getWidgetType(); + } + + @Override + public Short value5() { + return getItemsCount(); + } + + @Override + public JSONB value6() { + return getWidgetOptions(); + } + + @Override + public JWidgetRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JWidgetRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JWidgetRecord value3(String value) { + setDescription(value); + return this; + } + + @Override + public JWidgetRecord value4(String value) { + setWidgetType(value); + return this; + } + + @Override + public JWidgetRecord value5(Short value) { + setItemsCount(value); + return this; + } + + @Override + public JWidgetRecord value6(JSONB value) { + setWidgetOptions(value); + return this; + } + + @Override + public JWidgetRecord values(Long value1, String value2, String value3, String value4, Short value5, JSONB value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JWidgetRecord + */ + public JWidgetRecord() { + super(JWidget.WIDGET); + } + + /** + * Create a detached, initialised JWidgetRecord + */ + public JWidgetRecord(Long id, String name, String description, String widgetType, Short itemsCount, JSONB widgetOptions) { + super(JWidget.WIDGET); + + set(0, id); + set(1, name); + set(2, description); + set(3, widgetType); + set(4, itemsCount); + set(5, widgetOptions); + } } diff --git a/src/main/java/com/epam/ta/reportportal/util/FeatureFlagHandler.java b/src/main/java/com/epam/ta/reportportal/util/FeatureFlagHandler.java new file mode 100644 index 000000000..111c55382 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/util/FeatureFlagHandler.java @@ -0,0 +1,38 @@ +package com.epam.ta.reportportal.util; + +import com.epam.ta.reportportal.entity.enums.FeatureFlag; +import java.util.HashSet; +import java.util.Optional; +import java.util.Set; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +/** + * Component for checking enabled feature flags. + * + * @author Ivan Kustau + */ +@Component +public class FeatureFlagHandler { + + private final Set enabledFeatureFlagsSet = new HashSet<>(); + + /** + * Initialises {@link FeatureFlagHandler} by environment variable with enabled feature flags. + * + * @param featureFlags Set of enabled feature flags + */ + public FeatureFlagHandler( + @Value("#{'${rp.feature.flags}'.split(',')}") Set featureFlags) { + + if (!CollectionUtils.isEmpty(featureFlags)) { + featureFlags.stream().map(FeatureFlag::fromString).filter(Optional::isPresent) + .map(Optional::get).forEach(enabledFeatureFlagsSet::add); + } + } + + public boolean isEnabled(FeatureFlag featureFlag) { + return enabledFeatureFlagsSet.contains(featureFlag); + } +} diff --git a/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java b/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java index 42984efc6..57e9808b0 100644 --- a/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java +++ b/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java @@ -40,9 +40,10 @@ class AttachmentDataStoreServiceTest extends BaseTest { private static Random random = new Random(); - @Autowired + @Autowired private AttachmentDataStoreService attachmentDataStoreService; - @Value("${datastore.default.path:/data/store}") + + @Value("${datastore.path:/data/store}") private String storageRootPath; @Test @@ -59,7 +60,8 @@ void saveLoadAndDeleteTest() throws IOException { attachmentDataStoreService.delete(fileId); - ReportPortalException exception = assertThrows(ReportPortalException.class, + ReportPortalException exception = + assertThrows(ReportPortalException.class, () -> attachmentDataStoreService.load(fileId)); assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); assertFalse(Files.exists( @@ -70,7 +72,8 @@ void saveLoadAndDeleteTest() throws IOException { void saveLoadAndDeleteThumbnailTest() throws IOException { InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); - String thumbnailId = attachmentDataStoreService.saveThumbnail( + String thumbnailId = + attachmentDataStoreService.saveThumbnail( random.nextLong() + "thumbnail.jpg", inputStream); Optional loadedData = attachmentDataStoreService.load(thumbnailId); @@ -82,7 +85,8 @@ void saveLoadAndDeleteThumbnailTest() throws IOException { attachmentDataStoreService.delete(thumbnailId); ReportPortalException exception = assertThrows(ReportPortalException.class, - () -> attachmentDataStoreService.load(thumbnailId)); + () -> attachmentDataStoreService.load(thumbnailId) + ); assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); assertFalse(Files.exists( Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(thumbnailId)))); diff --git a/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java b/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java index 347a91422..6d5e669b8 100644 --- a/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java +++ b/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java @@ -53,7 +53,7 @@ class CommonDataStoreServiceTest extends BaseTest { @Autowired private DataEncoder dataEncoder; - @Value("${datastore.default.path:/data/store}") + @Value("${datastore.path:/data/store}") private String storageRootPath; public static CommonsMultipartFile getMultipartFile(String path) throws IOException { @@ -67,13 +67,11 @@ public static CommonsMultipartFile getMultipartFile(String path) throws IOExcept ); IOUtils.copy(new FileInputStream(file), fileItem.getOutputStream()); return new CommonsMultipartFile(fileItem); - } - - @Test + }@Test void saveTest() throws IOException { CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); - String fileId = dataStoreService.save(multipartFile.getOriginalFilename(), - multipartFile.getInputStream()); + String fileId = + dataStoreService.save(multipartFile.getOriginalFilename(), multipartFile.getInputStream()); assertNotNull(fileId); assertTrue(Files.exists(Paths.get(storageRootPath, dataEncoder.decode(fileId)))); dataStoreService.delete(fileId); @@ -83,7 +81,8 @@ void saveTest() throws IOException { void saveThumbnailTest() throws IOException { CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); String fileId = dataStoreService.saveThumbnail(multipartFile.getOriginalFilename(), - multipartFile.getInputStream()); + multipartFile.getInputStream() + ); assertNotNull(fileId); assertTrue(Files.exists(Paths.get(storageRootPath, dataEncoder.decode(fileId)))); dataStoreService.delete(fileId); @@ -93,7 +92,8 @@ void saveThumbnailTest() throws IOException { void saveAndLoadTest() throws IOException { CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); String fileId = dataStoreService.saveThumbnail(multipartFile.getOriginalFilename(), - multipartFile.getInputStream()); + multipartFile.getInputStream() + ); Optional content = dataStoreService.load(fileId); @@ -105,10 +105,10 @@ void saveAndLoadTest() throws IOException { void saveAndDeleteTest() throws IOException { CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); Random random = new Random(); - String fileId = dataStoreService.save( - random.nextLong() + "/" + multipartFile.getOriginalFilename(), - multipartFile.getInputStream() - ); + String fileId = + dataStoreService.save(random.nextLong() + "/" + multipartFile.getOriginalFilename(), + multipartFile.getInputStream() + ); dataStoreService.delete(fileId); diff --git a/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java b/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java index b1713d597..2fd5a6345 100644 --- a/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java +++ b/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java @@ -39,12 +39,14 @@ */ class UserDataStoreServiceTest extends BaseTest { - private static Random random = new Random(); - @Autowired + private static Random random = new Random();@Autowired private UserDataStoreService userDataStoreService; - @Value("${datastore.default.path:/data/store}") + + @Value("${datastore.path:/data/store}") private String storageRootPath; + + @Test void saveLoadAndDeleteTest() throws IOException { InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); @@ -59,7 +61,8 @@ void saveLoadAndDeleteTest() throws IOException { userDataStoreService.delete(fileId); - ReportPortalException exception = assertThrows(ReportPortalException.class, + ReportPortalException exception = + assertThrows(ReportPortalException.class, () -> userDataStoreService.load(fileId)); assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); assertFalse( @@ -70,7 +73,8 @@ void saveLoadAndDeleteTest() throws IOException { void saveLoadAndDeleteThumbnailTest() throws IOException { InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); - String thumbnailId = userDataStoreService.saveThumbnail(random.nextLong() + "thmbnail.jpg", + String thumbnailId = + userDataStoreService.saveThumbnail(random.nextLong() + "thmbnail.jpg", inputStream); Optional loadedData = userDataStoreService.load(thumbnailId); @@ -81,7 +85,8 @@ void saveLoadAndDeleteThumbnailTest() throws IOException { userDataStoreService.delete(thumbnailId); - ReportPortalException exception = assertThrows(ReportPortalException.class, + ReportPortalException exception = + assertThrows(ReportPortalException.class, () -> userDataStoreService.load(thumbnailId)); assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); assertFalse(Files.exists( diff --git a/src/test/java/com/epam/ta/reportportal/config/TestConfiguration.java b/src/test/java/com/epam/ta/reportportal/config/TestConfiguration.java index d01fbf3a8..28b57c9f5 100644 --- a/src/test/java/com/epam/ta/reportportal/config/TestConfiguration.java +++ b/src/test/java/com/epam/ta/reportportal/config/TestConfiguration.java @@ -21,6 +21,8 @@ import com.epam.reportportal.commons.ThumbnailatorImpl; import com.epam.reportportal.commons.TikaContentTypeResolver; import com.epam.ta.reportportal.filesystem.DataEncoder; +import com.epam.ta.reportportal.util.FeatureFlagHandler; +import java.util.Set; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration; @@ -51,6 +53,12 @@ public Thumbnailator userPhotoThumbnailator( return new ThumbnailatorImpl(width, height); } + @Bean + public FeatureFlagHandler featureFlagHandler( + @Value("#{'${rp.feature.flags}'.split(',')}") Set featureFlagsSet) { + return new FeatureFlagHandler(featureFlagsSet); + } + @Bean public ContentTypeResolver contentTypeResolver() { return new TikaContentTypeResolver(); diff --git a/src/test/java/com/epam/ta/reportportal/dao/ApiKeyRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/ApiKeyRepositoryTest.java new file mode 100644 index 000000000..f28d302c3 --- /dev/null +++ b/src/test/java/com/epam/ta/reportportal/dao/ApiKeyRepositoryTest.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 EPAM Systems + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.epam.ta.reportportal.dao; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import com.epam.ta.reportportal.BaseTest; +import com.epam.ta.reportportal.entity.user.ApiKey; +import java.time.LocalDateTime; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @author Andrei Piankouski + */ +public class ApiKeyRepositoryTest extends BaseTest { + + @Autowired + private ApiKeyRepository apiKeyRepository; + + @Test + void shouldInsertAndSetId() { + final ApiKey apiKey = new ApiKey(); + apiKey.setName("ApiKey"); + apiKey.setHash("8743b52063cd84097a65d1633f5c74f5"); + apiKey.setCreatedAt(LocalDateTime.now()); + apiKey.setUserId(1L); + + ApiKey saved = apiKeyRepository.save(apiKey); + + assertNotNull(saved.getId()); + } + +} diff --git a/src/test/java/com/epam/ta/reportportal/dao/DashboardRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/DashboardRepositoryTest.java index 76b389f69..8b156da34 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/DashboardRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/DashboardRepositoryTest.java @@ -27,17 +27,19 @@ import com.epam.ta.reportportal.commons.querygen.Condition; import com.epam.ta.reportportal.commons.querygen.Filter; import com.epam.ta.reportportal.commons.querygen.FilterCondition; -import com.epam.ta.reportportal.commons.querygen.ProjectFilter; import com.epam.ta.reportportal.entity.dashboard.Dashboard; import java.util.List; import java.util.Optional; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; import org.springframework.test.context.jdbc.Sql; +import java.util.List; +import java.util.Optional; + +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; +import static org.junit.jupiter.api.Assertions.*; + /** * @author Ihar Kahadouski */ @@ -94,90 +96,6 @@ void existsByNameAndOwnerAndProjectId() { assertFalse(repository.existsByNameAndOwnerAndProjectId("not exist name", "default", 2L)); } - @Test - void getPermitted() { - final String adminLogin = "superadmin"; - final Page superadminPermitted = repository.getPermitted( - ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), - adminLogin - ); - assertEquals(3, superadminPermitted.getTotalElements(), - "Unexpected permitted dashboards count"); - - final String defaultLogin = "default"; - final Page defaultPermitted = repository.getPermitted( - ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - defaultLogin - ); - assertEquals(2, defaultPermitted.getTotalElements(), "Unexpected permitted dashboards count"); - - final String jajaLogin = "jaja_user"; - final Page jajaPermitted = repository.getPermitted( - ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), - jajaLogin - ); - assertEquals(3, jajaPermitted.getTotalElements(), "Unexpected permitted dashboards count"); - } - - @Test - void getOwn() { - final String adminLogin = "superadmin"; - final Page superadminOwn = repository.getOwn( - ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), - adminLogin - ); - assertEquals(2, superadminOwn.getTotalElements(), "Unexpected own dashboards count"); - superadminOwn.getContent().forEach(it -> assertEquals(adminLogin, it.getOwner())); - - final String defaultLogin = "default"; - final Page defaultOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - defaultLogin - ); - assertEquals(2, defaultOwn.getTotalElements(), "Unexpected own dashboards count"); - defaultOwn.getContent().forEach(it -> assertEquals(defaultLogin, it.getOwner())); - - final String jajaLogin = "jaja_user"; - final Page jajaOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), jajaLogin); - assertEquals(2, jajaOwn.getTotalElements(), "Unexpected own dashboards count"); - jajaOwn.getContent().forEach(it -> assertEquals(jajaLogin, it.getOwner())); - } - - @Test - void getShared() { - final String adminLogin = "superadmin"; - final Page superadminShared = repository.getShared( - ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), - adminLogin - ); - assertEquals(2, superadminShared.getTotalElements(), "Unexpected shared dashboards count"); - superadminShared.getContent().forEach(it -> assertTrue(it.isShared())); - - final String defaultLogin = "default"; - final Page defaultShared = repository.getShared( - ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - defaultLogin - ); - assertEquals(1, defaultShared.getTotalElements(), "Unexpected shared dashboards count"); - defaultShared.getContent().forEach(it -> assertTrue(it.isShared())); - - final String jajaLogin = "jaja_user"; - final Page jajaShared = repository.getShared( - ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), - jajaLogin - ); - assertEquals(2, jajaShared.getTotalElements(), "Unexpected shared dashboards count"); - jajaShared.getContent().forEach(it -> assertTrue(it.isShared())); - } - @Test void shouldFindBySpecifiedNameAndProjectId() { assertTrue(repository.existsByNameAndProjectId("test admin dashboard", 1L)); diff --git a/src/test/java/com/epam/ta/reportportal/dao/UserFilterRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/UserFilterRepositoryTest.java index ad931a9d8..3e44f256a 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/UserFilterRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/UserFilterRepositoryTest.java @@ -16,28 +16,20 @@ package com.epam.ta.reportportal.dao; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_NAME; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.commons.querygen.Condition; import com.epam.ta.reportportal.commons.querygen.Filter; import com.epam.ta.reportportal.commons.querygen.FilterCondition; -import com.epam.ta.reportportal.commons.querygen.ProjectFilter; import com.epam.ta.reportportal.entity.filter.UserFilter; import com.google.common.collect.Lists; -import java.util.List; -import java.util.Optional; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; import org.springframework.test.context.jdbc.Sql; +import java.util.List; +import java.util.Optional; + +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; +import static org.junit.jupiter.api.Assertions.*; /** * @author Ivan Nikitsenka @@ -48,13 +40,6 @@ class UserFilterRepositoryTest extends BaseTest { @Autowired private UserFilterRepository userFilterRepository; - @Test - public void updateSharing() { - userFilterRepository.updateSharingFlag(Lists.newArrayList(1L), true); - final Optional filter = userFilterRepository.findById(1L); - assertTrue(filter.get().isShared()); - } - @Test public void shouldFindByIdAndProjectIdWhenExists() { Optional userFilter = userFilterRepository.findByIdAndProjectId(1L, 1L); @@ -101,86 +86,6 @@ public void shouldNotFindByIdsAndProjectIdWhenProjectIdNotExists() { assertTrue(userFilters.isEmpty()); } - @Test - void getSharedFilters() { - Page superadminSharedFilters = userFilterRepository.getShared( - ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - "superadmin" - ); - assertEquals(0, superadminSharedFilters.getTotalElements(), "Unexpected shared filters count"); - - Page result2 = userFilterRepository.getShared( - ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - "default" - ); - assertEquals(1, result2.getTotalElements(), "Unexpected shared filters count"); - - final Page jajaSharedFilters = userFilterRepository.getShared( - ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), - "jaja_user" - ); - assertEquals(1, jajaSharedFilters.getTotalElements(), "Unexpected shared filters count"); - } - - @Test - void getPermittedFilters() { - Page adminPermittedFilters = userFilterRepository.getPermitted( - ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), - "superadmin" - ); - assertEquals(2, adminPermittedFilters.getTotalElements(), "Unexpected shared filters count"); - - Page defaultPermittedFilters = userFilterRepository.getPermitted( - ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - "default" - ); - assertEquals(2, defaultPermittedFilters.getTotalElements(), "Unexpected shared filters count"); - - final Page jajaPermittedFilters = userFilterRepository.getPermitted( - ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), - "jaja_user" - ); - assertEquals(1, jajaPermittedFilters.getTotalElements(), "Unexpected shared filters count"); - } - - @Test - void getOwnFilters() { - Page superadminOwnFilters = userFilterRepository.getOwn( - ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), - "superadmin" - ); - assertEquals(2, superadminOwnFilters.getTotalElements()); - - Page defaultOwnFilters = userFilterRepository.getOwn( - ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - "default" - ); - assertEquals(2, defaultOwnFilters.getTotalElements(), "Unexpected shared filters count"); - - final Page jajaOwnFilters = userFilterRepository.getOwn( - ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), - "jaja_user" - ); - assertEquals(0, jajaOwnFilters.getTotalElements(), "Unexpected shared filters count"); - - final Page jajaOwnFiltersOnForeingProject = userFilterRepository.getOwn( - ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - "jaja_user" - ); - assertEquals(0, jajaOwnFiltersOnForeingProject.getTotalElements(), - "Unexpected shared filters count"); - } - @Test void existsByNameAndOwnerAndProjectIdTest() { assertTrue( diff --git a/src/test/java/com/epam/ta/reportportal/dao/WidgetRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/WidgetRepositoryTest.java index 0a26a68c0..9d6ef502c 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/WidgetRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/WidgetRepositoryTest.java @@ -16,33 +16,26 @@ package com.epam.ta.reportportal.dao; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_NAME; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.commons.querygen.Condition; import com.epam.ta.reportportal.commons.querygen.Filter; import com.epam.ta.reportportal.commons.querygen.FilterCondition; -import com.epam.ta.reportportal.commons.querygen.ProjectFilter; import com.epam.ta.reportportal.entity.widget.Widget; import com.epam.ta.reportportal.entity.widget.WidgetType; import com.google.common.collect.Lists; -import java.util.Collections; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; import org.springframework.test.context.jdbc.Sql; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; +import static org.junit.jupiter.api.Assertions.*; + /** * Uses script from * @@ -101,83 +94,6 @@ void existsByNameAndOwnerAndProjectId() { assertFalse(repository.existsByNameAndOwnerAndProjectId("not exist name", "default", 2L)); } - @Test - void getPermitted() { - final String adminLogin = "superadmin"; - final Page superadminPermitted = repository.getPermitted( - ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), - adminLogin - ); - assertEquals(4, superadminPermitted.getTotalElements(), "Unexpected permitted widgets count"); - - final String defaultLogin = "default"; - final Page defaultPermitted = repository.getPermitted( - ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - defaultLogin - ); - assertEquals(3, defaultPermitted.getTotalElements(), "Unexpected permitted widgets count"); - - final String jajaLogin = "jaja_user"; - final Page jajaPermitted = repository.getPermitted( - ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), - jajaLogin - ); - assertEquals(4, jajaPermitted.getTotalElements(), "Unexpected permitted widgets count"); - } - - @Test - void getOwn() { - final String adminLogin = "superadmin"; - final Page superadminOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), - adminLogin - ); - assertEquals(3, superadminOwn.getTotalElements(), "Unexpected own widgets count"); - superadminOwn.getContent().forEach(it -> assertEquals(adminLogin, it.getOwner())); - - final String defaultLogin = "default"; - final Page defaultOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), defaultLogin); - assertEquals(3, defaultOwn.getTotalElements(), "Unexpected own widgets count"); - defaultOwn.getContent().forEach(it -> assertEquals(defaultLogin, it.getOwner())); - - final String jajaLogin = "jaja_user"; - final Page jajaOwn = repository.getOwn(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), jajaLogin); - assertEquals(2, jajaOwn.getTotalElements(), "Unexpected own widgets count"); - jajaOwn.getContent().forEach(it -> assertEquals(jajaLogin, it.getOwner())); - } - - @Test - void getShared() { - final String adminLogin = "superadmin"; - final Page superadminShared = repository.getShared( - ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3, Sort.by(Sort.Direction.DESC, CRITERIA_NAME)), - adminLogin - ); - assertEquals(3, superadminShared.getTotalElements(), "Unexpected shared widgets count"); - superadminShared.getContent().forEach(it -> assertTrue(it.isShared())); - - final String defaultLogin = "default"; - final Page defaultShared = repository.getShared( - ProjectFilter.of(buildDefaultFilter(), 2L), - PageRequest.of(0, 3), - defaultLogin - ); - assertEquals(1, defaultShared.getTotalElements(), "Unexpected shared widgets count"); - defaultShared.getContent().forEach(it -> assertTrue(it.isShared())); - - final String jajaLogin = "jaja_user"; - final Page jajaShared = repository.getShared(ProjectFilter.of(buildDefaultFilter(), 1L), - PageRequest.of(0, 3), jajaLogin); - assertEquals(3, jajaShared.getTotalElements(), "Unexpected shared widgets count"); - jajaShared.getContent().forEach(it -> assertTrue(it.isShared())); - } - @Test void deleteRelationByFilterIdAndNotOwnerTest() { diff --git a/src/test/java/com/epam/ta/reportportal/filesystem/FilePathGeneratorTest.java b/src/test/java/com/epam/ta/reportportal/filesystem/FilePathGeneratorTest.java index c8975a49c..d5590e2bb 100644 --- a/src/test/java/com/epam/ta/reportportal/filesystem/FilePathGeneratorTest.java +++ b/src/test/java/com/epam/ta/reportportal/filesystem/FilePathGeneratorTest.java @@ -39,17 +39,15 @@ void setUp() { @Test void generate_different_even_for_same_date() { - // given: - AttachmentMetaInfo metaInfo = AttachmentMetaInfo.builder() - .withProjectId(1L) - .withLaunchUuid("271b5881-9a62-4df4-b477-335a96acbe14") - .build(); + //given: + AttachmentMetaInfo metaInfo = AttachmentMetaInfo.builder().withProjectId(1L) + .withLaunchUuid("271b5881-9a62-4df4-b477-335a96acbe14").build(); LocalDateTime date = LocalDateTime.of(2018, 5, 28, 3, 3); when(dateTimeProvider.localDateTimeNow()).thenReturn(date); // - // when: + //when: String pathOne = new FilePathGenerator(dateTimeProvider).generate(metaInfo); Assertions.assertThat(pathOne).isEqualTo( diff --git a/src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java b/src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java index 8fb173d51..4d8d62d0b 100644 --- a/src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java +++ b/src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 EPAM Systems + * Copyright 2023 EPAM Systems * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,8 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import com.epam.ta.reportportal.entity.enums.FeatureFlag; +import com.epam.ta.reportportal.util.FeatureFlagHandler; import java.io.InputStream; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.domain.Blob; @@ -44,15 +46,17 @@ class S3DataStoreTest { private final BlobStore blobStore = mock(BlobStore.class); private final InputStream inputStream = mock(InputStream.class); - private final S3DataStore s3DataStore = new S3DataStore(blobStore, BUCKET_PREFIX, - DEFAULT_BUCKET_NAME, REGION); + private final FeatureFlagHandler featureFlagHandler = mock(FeatureFlagHandler.class); + + private final S3DataStore s3DataStore = + new S3DataStore(blobStore, BUCKET_PREFIX, DEFAULT_BUCKET_NAME, REGION, featureFlagHandler); @Test void save() throws Exception { BlobBuilder blobBuilderMock = mock(BlobBuilder.class); - BlobBuilder.PayloadBlobBuilder payloadBlobBuilderMock = mock( - BlobBuilder.PayloadBlobBuilder.class); + BlobBuilder.PayloadBlobBuilder payloadBlobBuilderMock = + mock(BlobBuilder.PayloadBlobBuilder.class); Blob blobMock = mock(Blob.class); when(inputStream.available()).thenReturn(ZERO); @@ -64,6 +68,8 @@ void save() throws Exception { when(blobStore.containerExists(any(String.class))).thenReturn(true); when(blobStore.blobBuilder(FILE_PATH)).thenReturn(blobBuilderMock); + when(featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)).thenReturn(false); + s3DataStore.save(FILE_PATH, inputStream); verify(blobStore, times(1)).putBlob(DEFAULT_BUCKET_NAME, blobMock); diff --git a/src/test/resources/db/fill/dashboard-widget/dashboard-widget-fill.sql b/src/test/resources/db/fill/dashboard-widget/dashboard-widget-fill.sql index a7b0d8ed3..ec1de601c 100644 --- a/src/test/resources/db/fill/dashboard-widget/dashboard-widget-fill.sql +++ b/src/test/resources/db/fill/dashboard-widget/dashboard-widget-fill.sql @@ -10,15 +10,15 @@ VALUES (3, 'jaja_user', '7c381f9d81b0e438af4e7094c6cae203', 'jaja@mail.com', nul INSERT INTO public.project_user (user_id, project_id, project_role) VALUES (3, 1, 'MEMBER'); -INSERT INTO public.shareable_entity (id, shared, owner, project_id) -VALUES (5, true, 'superadmin', 1), - (6, false, 'superadmin', 1), - (13, true, 'superadmin', 1), - (14, false, 'superadmin', 1), - (15, true, 'jaja_user', 1), - (16, false, 'jaja_user', 1), - (17, true, 'default', 2), - (18, false, 'default', 2); +INSERT INTO public.owned_entity (id, owner, project_id) +VALUES (5, 'superadmin', 1), + (6, 'superadmin', 1), + (13, 'superadmin', 1), + (14, 'superadmin', 1), + (15, 'jaja_user', 1), + (16, 'jaja_user', 1), + (17, 'default', 2), + (18, 'default', 2); INSERT INTO public.widget (id, name, description, widget_type, items_count, widget_options) VALUES (5, 'activity stream12', null, 'activityStream', 50, @@ -35,8 +35,7 @@ INSERT INTO public.dashboard_widget (dashboard_id, widget_id, widget_name, widge widget_position_x, widget_position_y) VALUES (13, 5, 'activity stream12', 'superadmin', 'activityStream', 5, 5, 0, 0), - (13, 6, 'INVESTIGATED PERCENTAGE OF LAUNCHES', 'superadmin', 'investigatedTrend', 6, 3, 0, - 0), + (13, 6, 'INVESTIGATED PERCENTAGE OF LAUNCHES', 'superadmin', 'investigatedTrend', 6, 3, 0,0), (14, 5, 'activity stream12', 'superadmin', 'activityStream', 5, 5, 0, 0), (14, 6, 'LAUNCH STATISTICS', 'superadmin', 'launchStatistics', 4, 6, 0, 0), (15, 5, 'TEST CASES GROWTH TREND CHART', 'jaja_user', 'topTestCases', 7, 3, 0, 0); \ No newline at end of file diff --git a/src/test/resources/db/fill/shareable/shareable-fill.sql b/src/test/resources/db/fill/shareable/shareable-fill.sql index b202fcfa8..9861a761f 100644 --- a/src/test/resources/db/fill/shareable/shareable-fill.sql +++ b/src/test/resources/db/fill/shareable/shareable-fill.sql @@ -1,91 +1,80 @@ -DELETE -FROM public.users -WHERE id = 3; - -INSERT INTO public.users (id, login, password, email, attachment, attachment_thumbnail, role, type, - expired, full_name, metadata) -VALUES (3, 'jaja_user', '7c381f9d81b0e438af4e7094c6cae203', 'jaja@mail.com', null, null, 'USER', - 'INTERNAL', false, 'Jaja Juja', '{"metadata": {"last_login": 1546605767372}}'); - -INSERT INTO public.project_user (user_id, project_id, project_role) -VALUES (3, 1, 'MEMBER'); - -INSERT INTO public.shareable_entity (id, shared, owner, project_id) -VALUES (1, false, 'superadmin', 1), - (2, true, 'superadmin', 1), - (3, false, 'default', 2), - (4, true, 'default', 2), - (5, true, 'superadmin', 1), - (6, false, 'superadmin', 1), - (7, true, 'superadmin', 1), - (8, true, 'jaja_user', 1), - (9, false, 'jaja_user', 1), - (10, false, 'default', 2), - (11, false, 'default', 2), - (12, true, 'default', 2), - (13, true, 'superadmin', 1), - (14, false, 'superadmin', 1), - (15, true, 'jaja_user', 1), - (16, false, 'jaja_user', 1), - (17, true, 'default', 2), - (18, false, 'default', 2); - -INSERT INTO public.filter (id, name, target, description) -VALUES (1, 'Admin Filter', 'Launch', null), - (2, 'Admin Shared Filter', 'Launch', null), - (3, 'Default Filter', 'Launch', null), - (4, 'Default Shared Filter', 'Launch', null); - -INSERT INTO public.filter_sort (id, filter_id, field, direction) -VALUES (1, 1, 'name', 'ASC'), - (2, 2, 'name', 'DESC'), - (3, 3, 'name', 'ASC'), - (4, 4, 'name', 'DESC'); - -INSERT INTO public.filter_condition (id, filter_id, condition, value, search_criteria, negative) -VALUES (1, 1, 'CONTAINS', 'asdf', 'name', false), - (2, 2, 'EQUALS', 'test', 'description', false), - (3, 3, 'EQUALS', 'juja', 'name', false), - (4, 4, 'EQUALS', 'qwerty', 'name', false); - -INSERT INTO public.widget (id, name, description, widget_type, items_count, widget_options) -VALUES (5, 'activity stream12', null, 'activityStream', 50, - '{"options": {"user": "superadmin", "actionType": ["startLaunch", "finishLaunch"]}}'), - (7, 'INVESTIGATED PERCENTAGE OF LAUNCHES', null, 'investigatedTrend', 10, - '{"options": {"timeline": "DAY"}}'), - (6, 'LAUNCH STATISTICS', null, 'launchStatistics', 10, '{"options": {"timeline": "WEEK"}}'), - (8, 'TEST CASES GROWTH TREND CHART', null, 'casesTrend', 10, '{"options": {}}'), - (9, 'LAUNCHES DURATION CHART', null, 'launchesDurationChart', 10, '{"options": {}}'), - (12, 'ACTIVITY STREAM', null, 'activityStream', 10, - '{"options": {"user": "default", "actionType": ["startLaunch", "finishLaunch", "deleteLaunch"]}}'), - (10, 'FAILED CASES TREND CHART', null, 'bugTrend', 10, '{"options": {}}'), - (11, 'LAUNCH STATISTICS', null, 'launchStatistics', 10, '{"options": {"timeline": "WEEK"}}'); - -INSERT INTO public.content_field(id, field) -VALUES (6, 'statistics$product_bug$pb001'); - -INSERT INTO public.widget_filter (widget_id, filter_id) -VALUES (6, 1), - (7, 2), - (8, 2), - (10, 3), - (11, 3); - -INSERT INTO public.dashboard (id, name, description, creation_date) -VALUES (13, 'test admin dashboard', 'admin shared dashboard', '2019-01-10 13:01:06.083000'), - (14, 'test admin private dashboard', 'admin dashboard', '2019-01-10 13:01:19.259000'), - (15, 'test jaja shared dashboard', 'jaja dashboard', '2019-01-10 13:01:51.417000'), - (16, 'test jaja private dashboard', 'jaja dashboard', '2019-01-10 13:01:59.015000'), - (17, 'test default shared dashboard', 'default dashboard', '2019-01-10 13:02:20.397000'), - (18, 'test default private dashboard', 'default dashboard', '2019-01-10 13:02:27.659000'); - -INSERT INTO public.dashboard_widget (dashboard_id, widget_id, widget_name, widget_owner, - widget_type, widget_width, widget_height, +DELETE FROM public.users WHERE id = 3; + +INSERT INTO public.users (id, login, password, email, attachment, attachment_thumbnail, role, type, expired, full_name, metadata) +VALUES (3, 'jaja_user', '7c381f9d81b0e438af4e7094c6cae203', 'jaja@mail.com', null, null, 'USER', 'INTERNAL', false, 'Jaja Juja', '{"metadata": {"last_login": 1546605767372}}'); + +INSERT INTO public.project_user (user_id, project_id, project_role) VALUES (3, 1, 'MEMBER'); + +INSERT INTO public.owned_entity (id, owner, project_id) VALUES +(1,'superadmin', 1), +(2, 'superadmin', 1), +(3, 'default', 2), +(4, 'default', 2), +(5, 'superadmin', 1), +(6, 'superadmin', 1), +(7, 'superadmin', 1), +(8, 'jaja_user', 1), +(9, 'jaja_user', 1), +(10, 'default', 2), +(11, 'default', 2), +(12, 'default', 2), +(13, 'superadmin', 1), +(14, 'superadmin', 1), +(15, 'jaja_user', 1), +(16, 'jaja_user', 1), +(17, 'default', 2), +(18, 'default', 2); + +INSERT INTO public.filter (id, name, target, description) VALUES +(1, 'Admin Filter', 'Launch', null), +(2, 'Admin Shared Filter', 'Launch', null), +(3, 'Default Filter', 'Launch', null), +(4, 'Default Shared Filter', 'Launch', null); + +INSERT INTO public.filter_sort (id, filter_id, field, direction) VALUES +(1, 1, 'name', 'ASC'), +(2, 2, 'name', 'DESC'), +(3, 3, 'name', 'ASC'), +(4, 4, 'name', 'DESC'); + +INSERT INTO public.filter_condition (id, filter_id, condition, value, search_criteria, negative) VALUES +(1, 1, 'CONTAINS', 'asdf', 'name', false), +(2, 2, 'EQUALS', 'test', 'description', false), +(3, 3, 'EQUALS', 'juja', 'name', false), +(4, 4, 'EQUALS', 'qwerty', 'name', false); + +INSERT INTO public.widget (id, name, description, widget_type, items_count, widget_options) VALUES +(5, 'activity stream12', null, 'activityStream', 50, '{"options": {"user": "superadmin", "actionType": ["startLaunch", "finishLaunch"]}}'), +(7, 'INVESTIGATED PERCENTAGE OF LAUNCHES', null, 'investigatedTrend', 10, '{"options": {"timeline": "DAY"}}'), +(6, 'LAUNCH STATISTICS', null, 'launchStatistics', 10, '{"options": {"timeline": "WEEK"}}'), +(8, 'TEST CASES GROWTH TREND CHART', null, 'casesTrend', 10, '{"options": {}}'), +(9, 'LAUNCHES DURATION CHART', null, 'launchesDurationChart', 10, '{"options": {}}'), +(12, 'ACTIVITY STREAM', null, 'activityStream', 10, '{"options": {"user": "default", "actionType": ["startLaunch", "finishLaunch", "deleteLaunch"]}}'), +(10, 'FAILED CASES TREND CHART', null, 'bugTrend', 10, '{"options": {}}'), +(11, 'LAUNCH STATISTICS', null, 'launchStatistics', 10, '{"options": {"timeline": "WEEK"}}'); + +INSERT INTO public.content_field(id, field) VALUES (6, 'statistics$product_bug$pb001'); + +INSERT INTO public.widget_filter (widget_id, filter_id) VALUES +(6, 1), +(7, 2), +(8, 2), +(10, 3), +(11, 3); + +INSERT INTO public.dashboard (id, name, description, creation_date) VALUES +(13, 'test admin dashboard', 'admin shared dashboard', '2019-01-10 13:01:06.083000'), +(14, 'test admin private dashboard', 'admin dashboard', '2019-01-10 13:01:19.259000'), +(15, 'test jaja shared dashboard', 'jaja dashboard', '2019-01-10 13:01:51.417000'), +(16, 'test jaja private dashboard', 'jaja dashboard', '2019-01-10 13:01:59.015000'), +(17, 'test default shared dashboard', 'default dashboard', '2019-01-10 13:02:20.397000'), +(18, 'test default private dashboard', 'default dashboard', '2019-01-10 13:02:27.659000'); + +INSERT INTO public.dashboard_widget (dashboard_id, widget_id, widget_name, widget_owner, widget_type, widget_width, widget_height, widget_position_x, widget_position_y) VALUES (13, 5, 'activity stream12', 'superadmin', 'activityStream', 5, 5, 0, 0), - (13, 7, 'INVESTIGATED PERCENTAGE OF LAUNCHES', 'superadmin', 'investigatedTrend', 6, 3, 0, - 0), + (13, 7, 'INVESTIGATED PERCENTAGE OF LAUNCHES', 'superadmin', 'investigatedTrend', 6, 3, 0, 0), (14, 5, 'activity stream12', 'superadmin', 'activityStream', 5, 5, 0, 0), (14, 6, 'LAUNCH STATISTICS', 'superadmin', 'launchStatistics', 4, 6, 0, 0), (15, 8, 'TEST CASES GROWTH TREND CHART', 'jaja_user', 'topTestCases', 7, 3, 0, 0), @@ -94,66 +83,4 @@ VALUES (13, 5, 'activity stream12', 'superadmin', 'activityStream', 5, 5, 0, 0), (18, 10, 'FAILED CASES TREND CHART', 'default', 'topTestCases', 6, 5, 0, 0), (18, 11, 'LAUNCH STATISTICS', 'default', 'launchStatistics', 5, 5, 0, 0); -INSERT INTO public.acl_sid (id, principal, sid) -VALUES (1, true, 'superadmin'), - (2, true, 'jaja_user'), - (3, true, 'default'); - -INSERT INTO public.acl_class (id, class, class_id_type) -VALUES (1, 'com.epam.ta.reportportal.entity.filter.UserFilter', 'java.lang.Long'), - (2, 'com.epam.ta.reportportal.entity.widget.Widget', 'java.lang.Long'), - (3, 'com.epam.ta.reportportal.entity.dashboard.Dashboard', 'java.lang.Long'); - -INSERT INTO public.acl_object_identity (id, object_id_class, object_id_identity, parent_object, - owner_sid, entries_inheriting) -VALUES (1, 1, '1', null, 1, true), - (2, 1, '2', null, 1, true), - (3, 1, '3', null, 3, true), - (4, 1, '4', null, 3, true), - (5, 2, '5', null, 1, true), - (6, 2, '6', null, 1, true), - (7, 2, '7', null, 1, true), - (8, 2, '8', null, 2, true), - (9, 2, '9', null, 2, true), - (10, 2, '10', null, 3, true), - (11, 2, '11', null, 3, true), - (12, 2, '12', null, 3, true), - (13, 3, '13', null, 1, true), - (14, 3, '14', null, 1, true), - (15, 3, '15', null, 2, true), - (16, 3, '16', null, 2, true), - (17, 3, '17', null, 3, true), - (18, 3, '18', null, 3, true); - -INSERT INTO public.acl_entry (id, acl_object_identity, ace_order, sid, mask, granting, - audit_success, audit_failure) -VALUES (1, 1, 0, 1, 16, true, false, false), - (3, 2, 0, 2, 1, true, false, false), - (4, 2, 1, 1, 16, true, false, false), - (5, 3, 0, 3, 16, true, false, false), - (6, 4, 0, 3, 16, true, false, false), - (8, 5, 0, 2, 1, true, false, false), - (9, 5, 1, 1, 16, true, false, false), - (10, 6, 0, 1, 16, true, false, false), - (12, 7, 0, 2, 1, true, false, false), - (13, 7, 1, 1, 16, true, false, false), - (15, 8, 0, 1, 1, true, false, false), - (16, 8, 1, 2, 16, true, false, false), - (17, 9, 0, 2, 16, true, false, false), - (18, 10, 0, 3, 16, true, false, false), - (19, 11, 0, 3, 16, true, false, false), - (20, 12, 0, 3, 16, true, false, false), - (22, 13, 0, 2, 1, true, false, false), - (23, 13, 1, 1, 16, true, false, false), - (24, 14, 0, 1, 16, true, false, false), - (26, 15, 0, 1, 1, true, false, false), - (27, 15, 1, 2, 16, true, false, false), - (28, 16, 0, 2, 16, true, false, false), - (29, 17, 0, 3, 16, true, false, false), - (30, 18, 0, 3, 16, true, false, false); - -INSERT INTO public.user_preference(project_id, user_id, filter_id) -VALUES (1, 1, 1), - (1, 1, 2), - (1, 3, 2), - (2, 2, 3); \ No newline at end of file +INSERT INTO public.user_preference(project_id, user_id, filter_id) VALUES (1, 1, 1), (1, 1, 2), (1, 3, 2), (2, 2, 3); \ No newline at end of file diff --git a/src/test/resources/db/migration/V001005__widget_content_init.sql b/src/test/resources/db/migration/V001005__widget_content_init.sql index a56c4b518..a9990f448 100644 --- a/src/test/resources/db/migration/V001005__widget_content_init.sql +++ b/src/test/resources/db/migration/V001005__widget_content_init.sql @@ -16,8 +16,8 @@ BEGIN alter sequence ticket_id_seq restart with 1; alter sequence activity_id_seq restart with 1; - INSERT INTO public.shareable_entity (id, shared, owner, project_id) - VALUES (1, false, 'superadmin', 1); + INSERT INTO public.owned_entity (id, owner, project_id) + VALUES (1, 'superadmin', 1); INSERT INTO public.filter (id, name, target, description) VALUES (1, 'filter name', 'Launch', 'filter for product status widget'); diff --git a/src/test/resources/test-application.properties b/src/test/resources/test-application.properties index 93c4d9f5a..730f4eb11 100644 --- a/src/test/resources/test-application.properties +++ b/src/test/resources/test-application.properties @@ -17,14 +17,16 @@ embedded.datasource.dir=${java.io.tmpdir}/reportportal/embedded-postgres embedded.datasource.clean=true embedded.datasource.port=0 rp.binarystore.path=${java.io.tmpdir}/reportportal/datastore -datastore.default.path=${rp.binarystore.path:/data/storage} +rp.feature.flags= + +datastore.path=${rp.binarystore.path:/data/storage} datastore.seaweed.master.host=${rp.binarystore.master.host:localhost} datastore.seaweed.master.port=${rp.binarystore.master.port:9333} datastore.s3.endpoint=${rp.binarystore.s3.endpoint:https://play.min.io} datastore.s3.accessKey=${rp.binarystore.s3.accessKey:Q3AM3UQ867SPQQA43P2F} datastore.s3.secretKey=${rp.binarystore.s3.secretKey:zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG} # could be one of [seaweed, filesystem, s3] -datastore.type=${rp.binarystore.type:filesystem} +datastore.type=filesystem datastore.thumbnail.attachment.width=${rp.binarystore.thumbnail.attachment.width:100} datastore.thumbnail.attachment.height=${rp.binarystore.thumbnail.attachment.height:55} datastore.thumbnail.avatar.width=${rp.binarystore.thumbnail.avatar.width:40} From 38cc5c75c8073f83725437b665e022fbe39e42dc Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Tue, 6 Jun 2023 15:35:16 +0300 Subject: [PATCH 064/110] EPMRPP-84251 || Fix SenderCase --- .../entity/project/email/SenderCase.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java b/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java index 35fdbb50c..617fabc8d 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java @@ -16,6 +16,7 @@ package com.epam.ta.reportportal.entity.project.email; +import com.epam.ta.reportportal.entity.enums.LogicalOperator; import com.epam.ta.reportportal.entity.enums.PostgreSQLEnumType; import com.epam.ta.reportportal.entity.enums.SendCase; import com.epam.ta.reportportal.entity.project.Project; @@ -82,6 +83,11 @@ public class SenderCase implements Serializable { @Column(name = "enabled") private boolean enabled; + @Enumerated(EnumType.STRING) + @Column(name = "attributes_operator") + @Type(type = "pqsql_enum") + private LogicalOperator attributesOperator; + public SenderCase() { } @@ -158,4 +164,12 @@ public boolean isEnabled() { public void setEnabled(boolean enabled) { this.enabled = enabled; } + + public LogicalOperator getAttributesOperator() { + return attributesOperator; + } + + public void setAttributesOperator(LogicalOperator attributesOperator) { + this.attributesOperator = attributesOperator; + } } From 513abc7d7e82d67901ffab888f6fadfb4e81a8ba Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Tue, 6 Jun 2023 15:54:42 +0300 Subject: [PATCH 065/110] EPMRPP-84251 || Fix SenderCase --- .../ta/reportportal/entity/project/email/SenderCase.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java b/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java index 617fabc8d..17bbfe5ec 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/email/SenderCase.java @@ -91,14 +91,14 @@ public class SenderCase implements Serializable { public SenderCase() { } - public SenderCase(Set recipients, Set launchNames, - Set launchAttributeRules, SendCase sendCase, - boolean enabled) { + public SenderCase(Set recipients, Set launchNames, Set launchAttributeRules, SendCase sendCase, + boolean enabled, LogicalOperator attributesOperator) { this.recipients = recipients; this.launchNames = launchNames; this.launchAttributeRules = launchAttributeRules; this.sendCase = sendCase; this.enabled = enabled; + this.attributesOperator = attributesOperator; } public Long getId() { From 7befa656ed03a19dd3527a32e011aa4da6a9455e Mon Sep 17 00:00:00 2001 From: Ivan Kustau <86599591+IvanKustau@users.noreply.github.com> Date: Fri, 16 Jun 2023 15:14:53 +0300 Subject: [PATCH 066/110] EPRMPP-84114 || Api key last used at (#890) * EPMRPP-84114 || Add last used field for ApiKey * EPMRPP-84174 || Performance degradation during reporting with API key * EPMRPP-84114 || Refactor checkstyle * EPMRPP-84114 || Add lastUsedAt update method * EPMRPP-84114 || Add doc for updateLastUsedAt * EPMRPP-84114 || Add cache for findByHash method * EPMRPP-84114 || Update version of migration scripts * EPMRPP-84114 || Add @EnableCaching annotation --------- Co-authored-by: Andrei Piankouski --- project-properties.gradle | 1 + .../config/DatabaseConfiguration.java | 2 + .../ta/reportportal/dao/ApiKeyRepository.java | 21 +++++- .../dao/UserRepositoryCustom.java | 2 + .../dao/UserRepositoryCustomImpl.java | 73 +++++++------------ .../ta/reportportal/entity/user/ApiKey.java | 12 +++ .../ta/reportportal/jooq/tables/JApiKeys.java | 16 ++-- .../jooq/tables/records/JApiKeysRecord.java | 60 ++++++++++++--- .../dao/ApiKeyRepositoryTest.java | 2 + 9 files changed, 122 insertions(+), 67 deletions(-) diff --git a/project-properties.gradle b/project-properties.gradle index a8df1836e..f8820f047 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -73,6 +73,7 @@ project.ext { (migrationsUrl + '/migrations/68_sender_case_rule_name.up.sql') : 'V068__sender_case_rule_name.sql', (migrationsUrl + '/migrations/71_user_bid_extension.up.sql') : 'V071__user_bid_extension.up.sql', (migrationsUrl + '/migrations/72_organization_tables.up.sql') : 'V072__organization_tables.up.sql', + (migrationsUrl + '/migrations/73_api_key_last_used_at.up.sql') : 'V073__api_key_last_used_at.up.sql', ] excludeTests = [ diff --git a/src/main/java/com/epam/ta/reportportal/config/DatabaseConfiguration.java b/src/main/java/com/epam/ta/reportportal/config/DatabaseConfiguration.java index 92f13329c..9672210c0 100644 --- a/src/main/java/com/epam/ta/reportportal/config/DatabaseConfiguration.java +++ b/src/main/java/com/epam/ta/reportportal/config/DatabaseConfiguration.java @@ -30,6 +30,7 @@ import org.jooq.impl.DefaultDSLContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.AutowireCapableBeanFactory; +import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; @@ -59,6 +60,7 @@ @EnableJpaRepositories(basePackages = { "com.epam.ta.reportportal.dao"}, repositoryBaseClass = ReportPortalRepositoryImpl.class, repositoryFactoryBeanClass = DatabaseConfiguration.RpRepoFactoryBean.class) @EnableTransactionManagement +@EnableCaching public class DatabaseConfiguration { @Autowired diff --git a/src/main/java/com/epam/ta/reportportal/dao/ApiKeyRepository.java b/src/main/java/com/epam/ta/reportportal/dao/ApiKeyRepository.java index a9e5961cd..f42f03a2f 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/ApiKeyRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/ApiKeyRepository.java @@ -17,7 +17,12 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.user.ApiKey; +import java.time.LocalDate; import java.util.List; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; /** * ApiKey Repository @@ -27,24 +32,32 @@ public interface ApiKeyRepository extends ReportPortalRepository { /** - * * @param hash hash of api key * @return {@link ApiKey} */ + @Cacheable(value = "apiKeyCache", key = "#hash") ApiKey findByHash(String hash); /** - * - * @param name name of user Api key + * @param name name of user Api key * @param userId {@link com.epam.ta.reportportal.entity.user.User#id} * @return if exists 'true' else 'false' */ boolean existsByNameAndUserId(String name, Long userId); /** - * * @param userId {@link com.epam.ta.reportportal.entity.user.User#id} * @return list of user api keys */ List findByUserId(Long userId); + + /** + * Update lastUsedAt for apiKey + * + * @param id id of the ApiKey to update + * @param lastUsedAt {@link LocalDate} + */ + @Modifying + @Query("UPDATE ApiKey ak SET ak.lastUsedAt = :lastUsedAt WHERE ak.id = :id") + void updateLastUsedAt(@Param("id") Long id, @Param("lastUsedAt") LocalDate lastUsedAt); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustom.java index 6927f04c6..08b1d5924 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustom.java @@ -55,4 +55,6 @@ public interface UserRepositoryCustom extends FilterableRepository { Optional findUserDetails(String login); Optional findReportPortalUser(String login); + + Optional findReportPortalUser(Long userId); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustomImpl.java index 513fec003..b209e9190 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserRepositoryCustomImpl.java @@ -63,21 +63,15 @@ public List findByFilter(Queryable filter) { @Override public Page findByFilter(Queryable filter, Pageable pageable) { - return PageableExecutionUtils.getPage( - USER_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter) - .with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) + return PageableExecutionUtils.getPage(USER_FETCHER.apply(dsl.fetch( + QueryBuilder.newBuilder(filter).with(pageable).wrap().withWrapperSort(pageable.getSort()) .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build())); } @Override public Page findByFilterExcludingProjects(Queryable filter, Pageable pageable) { - return PageableExecutionUtils.getPage( - USER_WITHOUT_PROJECT_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter) - .with(pageable) - .wrap() - .withWrapperSort(pageable.getSort()) + return PageableExecutionUtils.getPage(USER_WITHOUT_PROJECT_FETCHER.apply(dsl.fetch( + QueryBuilder.newBuilder(filter).with(pageable).wrap().withWrapperSort(pageable.getSort()) .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build())); } @@ -89,57 +83,42 @@ public Optional findRawById(Long id) { @Override public Page findByFilterExcluding(Queryable filter, Pageable pageable, String... exclude) { return PageableExecutionUtils.getPage( - USER_FETCHER.apply(dsl.fetch(QueryBuilder.newBuilder(filter) - .with(pageable) - .wrapExcludingFields(exclude) - .withWrapperSort(pageable.getSort()) - .build())), pageable, () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build())); + USER_FETCHER.apply(dsl.fetch( + QueryBuilder.newBuilder(filter).with(pageable).wrapExcludingFields(exclude) + .withWrapperSort(pageable.getSort()).build())), pageable, + () -> dsl.fetchCount(QueryBuilder.newBuilder(filter).build()) + ); } @Override public Map findUsernamesWithProjectRolesByProjectId(Long projectId) { - return dsl.select(USERS.LOGIN, PROJECT_USER.PROJECT_ROLE) - .from(USERS) - .join(PROJECT_USER) - .on(USERS.ID.eq(PROJECT_USER.USER_ID)) - .where(PROJECT_USER.PROJECT_ID.eq(projectId)) - .fetch() - .stream() - .collect(Collectors.toMap(r -> r.get(USERS.LOGIN), r -> { + return dsl.select(USERS.LOGIN, PROJECT_USER.PROJECT_ROLE).from(USERS).join(PROJECT_USER) + .on(USERS.ID.eq(PROJECT_USER.USER_ID)).where(PROJECT_USER.PROJECT_ID.eq(projectId)).fetch() + .stream().collect(Collectors.toMap(r -> r.get(USERS.LOGIN), r -> { String projectRoleName = r.get(PROJECT_USER.PROJECT_ROLE).getLiteral(); - return ProjectRole.forName(projectRoleName) - .orElseThrow( - () -> new ReportPortalException(ErrorType.ROLE_NOT_FOUND, projectRoleName)); + return ProjectRole.forName(projectRoleName).orElseThrow( + () -> new ReportPortalException(ErrorType.ROLE_NOT_FOUND, projectRoleName)); })); } @Override public Optional findUserDetails(String login) { - return Optional.ofNullable(REPORTPORTAL_USER_FETCHER.apply(dsl.select( - USERS.ID, - USERS.LOGIN, - USERS.PASSWORD, - USERS.ROLE, - USERS.EMAIL, - PROJECT_USER.PROJECT_ID, - PROJECT_USER.PROJECT_ROLE, - PROJECT.NAME - ) - .from(USERS) - .leftJoin(PROJECT_USER) - .on(USERS.ID.eq(PROJECT_USER.USER_ID)) - .leftJoin(PROJECT) - .on(PROJECT_USER.PROJECT_ID.eq(PROJECT.ID)) - .where(USERS.LOGIN.eq(login)) - .fetch())); + return Optional.ofNullable(REPORTPORTAL_USER_FETCHER.apply( + dsl.select(USERS.ID, USERS.LOGIN, USERS.PASSWORD, USERS.ROLE, USERS.EMAIL, + PROJECT_USER.PROJECT_ID, PROJECT_USER.PROJECT_ROLE, PROJECT.NAME + ).from(USERS).leftJoin(PROJECT_USER).on(USERS.ID.eq(PROJECT_USER.USER_ID)).leftJoin(PROJECT) + .on(PROJECT_USER.PROJECT_ID.eq(PROJECT.ID)).where(USERS.LOGIN.eq(login)).fetch())); } @Override public Optional findReportPortalUser(String login) { - return dsl.select(USERS.ID, USERS.LOGIN, USERS.PASSWORD, USERS.ROLE, USERS.EMAIL) - .from(USERS) - .where(USERS.LOGIN.eq(login)) - .fetchOptional(REPORT_PORTAL_USER_MAPPER); + return dsl.select(USERS.ID, USERS.LOGIN, USERS.PASSWORD, USERS.ROLE, USERS.EMAIL).from(USERS) + .where(USERS.LOGIN.eq(login)).fetchOptional(REPORT_PORTAL_USER_MAPPER); } + @Override + public Optional findReportPortalUser(Long userId) { + return dsl.select(USERS.ID, USERS.LOGIN, USERS.PASSWORD, USERS.ROLE, USERS.EMAIL).from(USERS) + .where(USERS.ID.eq(userId)).fetchOptional(REPORT_PORTAL_USER_MAPPER); + } } diff --git a/src/main/java/com/epam/ta/reportportal/entity/user/ApiKey.java b/src/main/java/com/epam/ta/reportportal/entity/user/ApiKey.java index f47a6e5b6..0899d7c98 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/user/ApiKey.java +++ b/src/main/java/com/epam/ta/reportportal/entity/user/ApiKey.java @@ -16,6 +16,7 @@ package com.epam.ta.reportportal.entity.user; +import java.time.LocalDate; import java.time.LocalDateTime; import javax.persistence.Column; import javax.persistence.Entity; @@ -50,6 +51,9 @@ public class ApiKey { @Column(name = "user_id") private Long userId; + @Column(name = "last_used_at") + private LocalDate lastUsedAt; + public ApiKey() { } @@ -92,4 +96,12 @@ public Long getUserId() { public void setUserId(Long userId) { this.userId = userId; } + + public LocalDate getLastUsedAt() { + return lastUsedAt; + } + + public void setLastUsedAt(LocalDate lastUsedAt) { + this.lastUsedAt = lastUsedAt; + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JApiKeys.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JApiKeys.java index adbca4ae9..f15f4627c 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JApiKeys.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JApiKeys.java @@ -9,6 +9,7 @@ import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JApiKeysRecord; +import java.sql.Date; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; @@ -21,7 +22,7 @@ import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row5; +import org.jooq.Row6; import org.jooq.Schema; import org.jooq.Table; import org.jooq.TableField; @@ -43,7 +44,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JApiKeys extends TableImpl { - private static final long serialVersionUID = 1459363165; + private static final long serialVersionUID = -1062577780; /** * The reference instance of public.api_keys @@ -83,6 +84,11 @@ public Class getRecordType() { */ public final TableField USER_ID = createField(DSL.name("user_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + /** + * The column public.api_keys.last_used_at. + */ + public final TableField LAST_USED_AT = createField(DSL.name("last_used_at"), org.jooq.impl.SQLDataType.DATE, this, ""); + /** * Create a public.api_keys table reference */ @@ -177,11 +183,11 @@ public JApiKeys rename(Name name) { } // ------------------------------------------------------------------------- - // Row5 type methods + // Row6 type methods // ------------------------------------------------------------------------- @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JApiKeysRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JApiKeysRecord.java index 78a6fb40e..1d1780f8a 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JApiKeysRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JApiKeysRecord.java @@ -6,14 +6,15 @@ import com.epam.ta.reportportal.jooq.tables.JApiKeys; +import java.sql.Date; import java.sql.Timestamp; import javax.annotation.processing.Generated; import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record5; -import org.jooq.Row5; +import org.jooq.Record6; +import org.jooq.Row6; import org.jooq.impl.UpdatableRecordImpl; @@ -28,9 +29,9 @@ comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JApiKeysRecord extends UpdatableRecordImpl implements Record5 { +public class JApiKeysRecord extends UpdatableRecordImpl implements Record6 { - private static final long serialVersionUID = 186305862; + private static final long serialVersionUID = -24722664; /** * Setter for public.api_keys.id. @@ -102,6 +103,20 @@ public Long getUserId() { return (Long) get(4); } + /** + * Setter for public.api_keys.last_used_at. + */ + public void setLastUsedAt(Date value) { + set(5, value); + } + + /** + * Getter for public.api_keys.last_used_at. + */ + public Date getLastUsedAt() { + return (Date) get(5); + } + // ------------------------------------------------------------------------- // Primary key information // ------------------------------------------------------------------------- @@ -112,17 +127,17 @@ public Record1 key() { } // ------------------------------------------------------------------------- - // Record5 type implementation + // Record6 type implementation // ------------------------------------------------------------------------- @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); } @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); + public Row6 valuesRow() { + return (Row6) super.valuesRow(); } @Override @@ -150,6 +165,11 @@ public Field field5() { return JApiKeys.API_KEYS.USER_ID; } + @Override + public Field field6() { + return JApiKeys.API_KEYS.LAST_USED_AT; + } + @Override public Long component1() { return getId(); @@ -175,6 +195,11 @@ public Long component5() { return getUserId(); } + @Override + public Date component6() { + return getLastUsedAt(); + } + @Override public Long value1() { return getId(); @@ -200,6 +225,11 @@ public Long value5() { return getUserId(); } + @Override + public Date value6() { + return getLastUsedAt(); + } + @Override public JApiKeysRecord value1(Long value) { setId(value); @@ -231,12 +261,19 @@ public JApiKeysRecord value5(Long value) { } @Override - public JApiKeysRecord values(Long value1, String value2, String value3, Timestamp value4, Long value5) { + public JApiKeysRecord value6(Date value) { + setLastUsedAt(value); + return this; + } + + @Override + public JApiKeysRecord values(Long value1, String value2, String value3, Timestamp value4, Long value5, Date value6) { value1(value1); value2(value2); value3(value3); value4(value4); value5(value5); + value6(value6); return this; } @@ -254,7 +291,7 @@ public JApiKeysRecord() { /** * Create a detached, initialised JApiKeysRecord */ - public JApiKeysRecord(Long id, String name, String hash, Timestamp createdAt, Long userId) { + public JApiKeysRecord(Long id, String name, String hash, Timestamp createdAt, Long userId, Date lastUsedAt) { super(JApiKeys.API_KEYS); set(0, id); @@ -262,5 +299,6 @@ public JApiKeysRecord(Long id, String name, String hash, Timestamp createdAt, Lo set(2, hash); set(3, createdAt); set(4, userId); + set(5, lastUsedAt); } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/ApiKeyRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/ApiKeyRepositoryTest.java index f28d302c3..8f062f05e 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/ApiKeyRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/ApiKeyRepositoryTest.java @@ -20,6 +20,7 @@ import com.epam.ta.reportportal.BaseTest; import com.epam.ta.reportportal.entity.user.ApiKey; +import java.time.LocalDate; import java.time.LocalDateTime; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -39,6 +40,7 @@ void shouldInsertAndSetId() { apiKey.setHash("8743b52063cd84097a65d1633f5c74f5"); apiKey.setCreatedAt(LocalDateTime.now()); apiKey.setUserId(1L); + apiKey.setLastUsedAt(LocalDate.now()); ApiKey saved = apiKeyRepository.save(apiKey); From 0d5d936f875775d4901e8e0c84cbc5924efbeefb Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Fri, 8 Sep 2023 12:14:44 +0300 Subject: [PATCH 067/110] EPMRPP-84794 || Add event object type --- .../com/epam/ta/reportportal/entity/activity/EventObject.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/entity/activity/EventObject.java b/src/main/java/com/epam/ta/reportportal/entity/activity/EventObject.java index be28f5118..288859225 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/activity/EventObject.java +++ b/src/main/java/com/epam/ta/reportportal/entity/activity/EventObject.java @@ -32,7 +32,8 @@ public enum EventObject { WIDGET("widget"), PATTERN("pattern"), INDEX("index"), - PLUGIN("plugin"); + PLUGIN("plugin"), + INVITATION_LINK("invitationLink"); private final String value; EventObject(String value) { From 08e2ee4226ab2489442954094a7ac4bbcb633afb Mon Sep 17 00:00:00 2001 From: Ivan_Kustau Date: Mon, 11 Sep 2023 18:16:58 +0300 Subject: [PATCH 068/110] EPMRPP-80519 || Add methods for removing buckets and files --- .../dao/AttachmentRepository.java | 24 ++-- .../ta/reportportal/filesystem/DataStore.java | 11 +- .../filesystem/LocalDataStore.java | 105 +++++++++++------- .../distributed/s3/S3DataStore.java | 19 ++++ 4 files changed, 103 insertions(+), 56 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java index fd210eb16..614d97a22 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java @@ -17,25 +17,27 @@ package com.epam.ta.reportportal.dao; import com.epam.ta.reportportal.entity.attachment.Attachment; -import org.springframework.data.jpa.repository.Modifying; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; - import java.util.Collection; import java.util.List; import java.util.Optional; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; /** * @author Ivan Budayeu */ -public interface AttachmentRepository extends ReportPortalRepository, AttachmentRepositoryCustom { +public interface AttachmentRepository + extends ReportPortalRepository, AttachmentRepositoryCustom { + + Optional findByFileId(String fileId); - Optional findByFileId(String fileId); + List findAllByLaunchIdIn(Collection launchIds); - List findAllByLaunchIdIn(Collection launchIds); + void deleteAllByProjectId(Long projectId); - @Modifying - @Query(value = "UPDATE attachment SET launch_id = :newLaunchId WHERE project_id = :projectId AND launch_id = :currentLaunchId", nativeQuery = true) - void updateLaunchIdByProjectIdAndLaunchId(@Param("projectId") Long projectId, @Param("currentLaunchId") Long currentLaunchId, - @Param("newLaunchId") Long newLaunchId); + @Modifying + @Query(value = "UPDATE attachment SET launch_id = :newLaunchId WHERE project_id = :projectId AND launch_id = :currentLaunchId", nativeQuery = true) + void updateLaunchIdByProjectIdAndLaunchId(@Param("projectId") Long projectId, + @Param("currentLaunchId") Long currentLaunchId, @Param("newLaunchId") Long newLaunchId); } diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java index 58203495a..3d4b88ee0 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java @@ -17,15 +17,20 @@ package com.epam.ta.reportportal.filesystem; import java.io.InputStream; +import java.util.List; /** * @author Dzianis_Shybeka */ public interface DataStore { - String save(String fileName, InputStream inputStream); + String save(String fileName, InputStream inputStream); - InputStream load(String filePath); + InputStream load(String filePath); - void delete(String filePath); + void delete(String filePath); + + void deleteAll(List filePaths, String bucketName); + + void deleteContainer(String bucketName); } diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java index ad74302c8..1276907e4 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java @@ -18,80 +18,101 @@ import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.ws.model.ErrorType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; +import java.util.List; import java.util.Objects; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @author Dzianis_Shybeka */ public class LocalDataStore implements DataStore { - private static final Logger logger = LoggerFactory.getLogger(LocalDataStore.class); + private static final Logger logger = LoggerFactory.getLogger(LocalDataStore.class); + + private final String storageRootPath; + + public LocalDataStore(String storageRootPath) { + this.storageRootPath = storageRootPath; + } + + @Override + public String save(String filePath, InputStream inputStream) { + + try { + + Path targetPath = Paths.get(storageRootPath, filePath); + Path targetDirectory = targetPath.getParent(); + + if (Objects.nonNull(targetDirectory) && !Files.isDirectory(targetDirectory)) { + Files.createDirectories(targetDirectory); + } - private final String storageRootPath; + logger.debug("Saving to: {} ", targetPath.toAbsolutePath()); - public LocalDataStore(String storageRootPath) { - this.storageRootPath = storageRootPath; - } + Files.copy(inputStream, targetPath, StandardCopyOption.REPLACE_EXISTING); - @Override - public String save(String filePath, InputStream inputStream) { + return filePath; + } catch (IOException e) { - try { + logger.error("Unable to save log file '{}'", filePath, e); - Path targetPath = Paths.get(storageRootPath, filePath); - Path targetDirectory = targetPath.getParent(); + throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to save log file"); + } + } - if (Objects.nonNull(targetDirectory) && !Files.isDirectory(targetDirectory)) { - Files.createDirectories(targetDirectory); - } + @Override + public InputStream load(String filePath) { - logger.debug("Saving to: {} ", targetPath.toAbsolutePath()); + try { - Files.copy(inputStream, targetPath, StandardCopyOption.REPLACE_EXISTING); + return Files.newInputStream(Paths.get(storageRootPath, filePath)); + } catch (IOException e) { - return filePath; - } catch (IOException e) { + logger.error("Unable to find file '{}'", filePath, e); - logger.error("Unable to save log file '{}'", filePath, e); + throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); + } + } - throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to save log file"); - } - } + @Override + public void delete(String filePath) { - @Override - public InputStream load(String filePath) { + try { - try { + Files.deleteIfExists(Paths.get(storageRootPath, filePath)); + } catch (IOException e) { - return Files.newInputStream(Paths.get(storageRootPath, filePath)); - } catch (IOException e) { + logger.error("Unable to delete file '{}'", filePath, e); - logger.error("Unable to find file '{}'", filePath, e); + throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to delete file"); + } + } - throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); - } - } + @Override + public void deleteAll(List filePaths, String bucketName) { - @Override - public void delete(String filePath) { + for (String filePath : filePaths) { + delete(filePath); + } + } - try { + @Override + public void deleteContainer(String bucketName) { + try { - Files.deleteIfExists(Paths.get(storageRootPath, filePath)); - } catch (IOException e) { + Files.deleteIfExists(Paths.get(bucketName)); + } catch (IOException e) { - logger.error("Unable to delete file '{}'", filePath, e); + logger.error("Unable to delete bucket '{}'", bucketName, e); - throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to delete file"); - } - } + throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to delete file"); + } + } } diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java index e9f7e2e49..1ac0d896f 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java @@ -25,6 +25,7 @@ import java.io.InputStream; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.List; import java.util.Objects; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; @@ -126,6 +127,24 @@ public void delete(String filePath) { } } + @Override + public void deleteAll(List filePaths, String bucketName) { + if (!featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { + blobStore.removeBlobs(bucketPrefix + bucketName + bucketPostfix, filePaths); + } else { + blobStore.removeBlobs(bucketName, filePaths); + } + } + + @Override + public void deleteContainer(String bucketName) { + if (!featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { + blobStore.deleteContainer(bucketPrefix + bucketName + bucketPostfix); + } else { + blobStore.deleteContainer(bucketName); + } + } + private S3File getS3File(String filePath) { if (featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { return new S3File(defaultBucketName, filePath); From c418e876a903e84b2cbaf7f8c38ab4183f3771e0 Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Tue, 12 Sep 2023 11:12:32 +0300 Subject: [PATCH 069/110] EPMRPP-84794 || Change Object Name --- .../com/epam/ta/reportportal/entity/activity/EventObject.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/entity/activity/EventObject.java b/src/main/java/com/epam/ta/reportportal/entity/activity/EventObject.java index 288859225..d03168dc0 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/activity/EventObject.java +++ b/src/main/java/com/epam/ta/reportportal/entity/activity/EventObject.java @@ -33,7 +33,7 @@ public enum EventObject { PATTERN("pattern"), INDEX("index"), PLUGIN("plugin"), - INVITATION_LINK("invitationLink"); + INVITATION_LINK("Invitation link"); private final String value; EventObject(String value) { From a65d0b96addc6abf1cf14e69ea2951f64f17397d Mon Sep 17 00:00:00 2001 From: Ivan_Kustau Date: Tue, 12 Sep 2023 18:10:16 +0300 Subject: [PATCH 070/110] EPMRPP-80519 || Remove attachments by project id --- .../binary/AttachmentBinaryDataService.java | 16 ++++---- .../reportportal/binary/DataStoreService.java | 13 +++++-- .../impl/AttachmentBinaryDataServiceImpl.java | 38 ++++++++++++++----- .../binary/impl/CommonDataStoreService.java | 13 +++++++ .../dao/AttachmentRepository.java | 2 + .../distributed/s3/S3DataStore.java | 2 +- 6 files changed, 62 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/binary/AttachmentBinaryDataService.java b/src/main/java/com/epam/ta/reportportal/binary/AttachmentBinaryDataService.java index cec525d02..b4721620c 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/AttachmentBinaryDataService.java +++ b/src/main/java/com/epam/ta/reportportal/binary/AttachmentBinaryDataService.java @@ -20,22 +20,24 @@ import com.epam.ta.reportportal.commons.ReportPortalUser; import com.epam.ta.reportportal.entity.attachment.AttachmentMetaInfo; import com.epam.ta.reportportal.entity.attachment.BinaryData; -import org.springframework.web.multipart.MultipartFile; - import java.util.Optional; +import org.springframework.web.multipart.MultipartFile; /** * @author Ihar Kahadouski */ public interface AttachmentBinaryDataService { - Optional saveAttachment(AttachmentMetaInfo attachmentMetaInfo, MultipartFile file); + Optional saveAttachment(AttachmentMetaInfo attachmentMetaInfo, + MultipartFile file); + + void saveFileAndAttachToLog(MultipartFile file, AttachmentMetaInfo attachmentMetaInfo); - void saveFileAndAttachToLog(MultipartFile file, AttachmentMetaInfo attachmentMetaInfo); + void attachToLog(BinaryDataMetaInfo binaryDataMetaInfo, AttachmentMetaInfo attachmentMetaInfo); - void attachToLog(BinaryDataMetaInfo binaryDataMetaInfo, AttachmentMetaInfo attachmentMetaInfo); + BinaryData load(Long fileId, ReportPortalUser.ProjectDetails projectDetails); - BinaryData load(Long fileId, ReportPortalUser.ProjectDetails projectDetails); + void delete(String fileId); - void delete(String fileId); + void deleteAllByProjectId(Long projectId); } diff --git a/src/main/java/com/epam/ta/reportportal/binary/DataStoreService.java b/src/main/java/com/epam/ta/reportportal/binary/DataStoreService.java index c98a2029f..0f80ba167 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/DataStoreService.java +++ b/src/main/java/com/epam/ta/reportportal/binary/DataStoreService.java @@ -17,6 +17,7 @@ package com.epam.ta.reportportal.binary; import java.io.InputStream; +import java.util.List; import java.util.Optional; /** @@ -24,11 +25,15 @@ */ public interface DataStoreService { - String save(String fileName, InputStream data); + String save(String fileName, InputStream data); - String saveThumbnail(String fileName, InputStream data); + String saveThumbnail(String fileName, InputStream data); - void delete(String fileId); + void delete(String fileId); - Optional load(String fileId); + void deleteAll(List fileIds, String bucketName); + + void deleteContainer(String containerName); + + Optional load(String fileId); } diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java b/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java index 2b8ffbfd4..b49b1a407 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java @@ -16,6 +16,12 @@ package com.epam.ta.reportportal.binary.impl; +import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.PROJECT_PATH; +import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.isContentTypePresent; +import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.resolveExtension; +import static com.epam.ta.reportportal.commons.validation.BusinessRule.expect; +import static com.epam.ta.reportportal.commons.validation.Suppliers.formattedSupplier; + import com.epam.reportportal.commons.ContentTypeResolver; import com.epam.ta.reportportal.binary.AttachmentBinaryDataService; import com.epam.ta.reportportal.binary.CreateLogAttachmentService; @@ -31,6 +37,14 @@ import com.epam.ta.reportportal.filesystem.FilePathGenerator; import com.epam.ta.reportportal.util.FeatureFlagHandler; import com.epam.ta.reportportal.ws.model.ErrorType; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Paths; +import java.util.Optional; +import java.util.function.Predicate; +import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,15 +54,6 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.commons.CommonsMultipartFile; -import java.io.*; -import java.nio.file.Paths; -import java.util.Optional; -import java.util.function.Predicate; - -import static com.epam.ta.reportportal.binary.impl.DataStoreUtils.*; -import static com.epam.ta.reportportal.commons.validation.BusinessRule.expect; -import static com.epam.ta.reportportal.commons.validation.Suppliers.formattedSupplier; - /** * @author Ihar Kahadouski */ @@ -179,7 +184,8 @@ public BinaryData load(Long fileId, ReportPortalUser.ProjectDetails projectDetai ErrorType.ACCESS_DENIED, formattedSupplier("You are not assigned to project '{}'", projectDetails.getProjectName()) ); - return new BinaryData(attachment.getFileName(), attachment.getContentType(), (long) data.available(), data); + return new BinaryData( + attachment.getFileName(), attachment.getContentType(), (long) data.available(), data); } catch (IOException e) { LOGGER.error("Unable to load binary data", e); throw new ReportPortalException( @@ -195,6 +201,18 @@ public void delete(String fileId) { } } + @Override + public void deleteAllByProjectId(Long projectId) { + if (featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { + dataStoreService.deleteAll( + attachmentRepository.findAllByProjectId(projectId).stream().map(Attachment::getFileId) + .collect(Collectors.toList()), projectId.toString()); + } else { + dataStoreService.deleteContainer(projectId.toString()); + } + attachmentRepository.deleteAllByProjectId(projectId); + } + private String resolveContentType(String contentType, ByteArrayOutputStream outputStream) throws IOException { if (isContentTypePresent(contentType)) { diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreService.java b/src/main/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreService.java index 03c5ef21e..8bb4058ef 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreService.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreService.java @@ -22,7 +22,9 @@ import com.epam.ta.reportportal.filesystem.DataEncoder; import com.epam.ta.reportportal.filesystem.DataStore; import java.io.InputStream; +import java.util.List; import java.util.Optional; +import java.util.stream.Collectors; /** * @author Ihar Kahadouski @@ -51,6 +53,17 @@ public void delete(String fileId) { dataStore.delete(dataEncoder.decode(fileId)); } + @Override + public void deleteAll(List fileIds, String bucketName) { + dataStore.deleteAll( + fileIds.stream().map(dataEncoder::decode).collect(Collectors.toList()), bucketName); + } + + @Override + public void deleteContainer(String containerName) { + dataStore.deleteContainer(containerName); + } + @Override public Optional load(String fileId) { return ofNullable(dataStore.load(dataEncoder.decode(fileId))); diff --git a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java index 614d97a22..b203c98c5 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java @@ -32,6 +32,8 @@ public interface AttachmentRepository Optional findByFileId(String fileId); + List findAllByProjectId(Long projectId); + List findAllByLaunchIdIn(Collection launchIds); void deleteAllByProjectId(Long projectId); diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java index 1ac0d896f..abcad405b 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java @@ -132,7 +132,7 @@ public void deleteAll(List filePaths, String bucketName) { if (!featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { blobStore.removeBlobs(bucketPrefix + bucketName + bucketPostfix, filePaths); } else { - blobStore.removeBlobs(bucketName, filePaths); + blobStore.removeBlobs(defaultBucketName, filePaths); } } From f746541ed4178f52bb7f088d48c11ba7b8bdaf0a Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Mon, 18 Sep 2023 10:54:44 +0300 Subject: [PATCH 071/110] EPMRPP-86221 || Generate jooq schema --- build.gradle | 2 +- project-properties.gradle | 11 +- .../impl/UserBinaryDataServiceImpl.java | 7 +- .../ta/reportportal/dao/LaunchRepository.java | 4 +- .../dao/UserFilterRepositoryCustomImpl.java | 15 +- .../dao/WidgetContentRepositoryImpl.java | 1 + .../reportportal/dao/util/RecordMappers.java | 3 +- .../epam/ta/reportportal/jooq/Indexes.java | 82 +- .../com/epam/ta/reportportal/jooq/Keys.java | 32 +- .../epam/ta/reportportal/jooq/Sequences.java | 10 - .../reportportal/jooq/tables/JActivity.java | 297 +++-- .../ta/reportportal/jooq/tables/JApiKeys.java | 68 +- .../reportportal/jooq/tables/JAttachment.java | 15 +- .../jooq/tables/JLaunchAttributeRules.java | 55 +- .../jooq/tables/JOrganization.java | 162 --- .../jooq/tables/JOrganizationAttribute.java | 182 --- .../jooq/tables/JOwnedEntity.java | 56 +- .../reportportal/jooq/tables/JSenderCase.java | 17 +- .../reportportal/jooq/tables/JTestItem.java | 4 +- .../jooq/tables/JUserCreationBid.java | 45 +- .../jooq/tables/records/JActivityRecord.java | 1072 ++++++++--------- .../jooq/tables/records/JApiKeysRecord.java | 314 ++--- .../tables/records/JAttachmentRecord.java | 59 +- .../records/JOrganizationAttributeRecord.java | 264 ---- .../tables/records/JOrganizationRecord.java | 153 --- .../tables/records/JSenderCaseRecord.java | 59 +- .../records/JUserCreationBidRecord.java | 152 ++- .../dao/DashboardRepositoryTest.java | 18 +- 28 files changed, 1226 insertions(+), 1933 deletions(-) delete mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganization.java delete mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganizationAttribute.java delete mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationAttributeRecord.java delete mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationRecord.java diff --git a/build.gradle b/build.gradle index 9e4245019..1ba3e1864 100644 --- a/build.gradle +++ b/build.gradle @@ -63,7 +63,7 @@ dependencies { } else { compile 'com.github.reportportal:commons:ce2166b5' compile 'com.github.reportportal:commons-rules:5.10.0' - compile 'com.github.reportportal:commons-model:232e69a5' + compile 'com.github.reportportal:commons-model:cd4791d' } //https://nvd.nist.gov/vuln/detail/CVE-2020-10683 (dom4j 2.1.3 version dependency) AND https://nvd.nist.gov/vuln/detail/CVE-2019-14900 diff --git a/project-properties.gradle b/project-properties.gradle index 272711623..c398e93ec 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -9,7 +9,7 @@ project.ext { dependencyRepos = ["commons", "commons-rules", "commons-model", "commons-bom"] releaseMode = project.hasProperty("releaseMode") scriptsUrl = commonScriptsUrl + (releaseMode ? getProperty('scripts.version') : 'master') - migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'develop') + migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'feature/settings') //TODO refactor with archive download testScriptsSrc = [ (migrationsUrl + '/migrations/0_extensions.up.sql') : 'V001__extensions.sql', @@ -68,12 +68,17 @@ project.ext { (migrationsUrl + '/migrations/60_sender_case_operator.up.sql') : 'V060__sender_case_operator.sql', (migrationsUrl + '/migrations/61_remove_acl.up.sql') : 'V061__remove_acl.sql', (migrationsUrl + '/migrations/62_remove_dashboard_cascade_drop.up.sql') : 'V062__remove_dashboard_cascade_drop.sql', - (migrationsUrl + '/migrations/65_launch_attribute_rules_length.up.sql') : 'V065__launch_attribute_rules_length.up.sql', + (migrationsUrl + '/migrations/65_launch_attribute_rules_length.up.sql') : 'V065__launch_attribute_rules_length.sql', (migrationsUrl + '/migrations/67_api_keys.up.sql') : 'V067__api_keys.sql', - (migrationsUrl + '/migrations/68_api_key_last_used_at.up.sql') : 'V068__api_key_last_used_at.up.sql', + (migrationsUrl + '/migrations/68_api_key_last_used_at.up.sql') : 'V068__api_key_last_used_at.sql', (migrationsUrl + '/migrations/69_replace_activity_table.up.sql') : 'V069__replace_activity_table.sql', (migrationsUrl + '/migrations/71_user_bid_inviting_user_id.up.sql') : 'V071__user_bid_inviting_user_id.sql', (migrationsUrl + '/migrations/72_add_attachment_name.up.sql') : 'V072__add_attachment_name.sql', + (migrationsUrl + '/migrations/73_api_key_last_used_at.up.sql') : 'V073__api_key_last_used_at.sql', + (migrationsUrl + '/migrations/74_sender_case_rule_name.up.sql') : 'V074__sender_case_rule_name.sql', + (migrationsUrl + '/migrations/77_user_bid_extension.up.sql') : 'V077__user_bid_extension.sql', + (migrationsUrl + '/migrations/78_email_server_documentation _link.up.sql') : 'V078__email_server_documentation _link.sql', + (migrationsUrl + '/migrations/79_drop_redundant_index.up.sql') : 'V079__drop_redundant_index.sql', ] excludeTests = [ diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/UserBinaryDataServiceImpl.java b/src/main/java/com/epam/ta/reportportal/binary/impl/UserBinaryDataServiceImpl.java index d10a0e01e..c822eda7c 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/UserBinaryDataServiceImpl.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/UserBinaryDataServiceImpl.java @@ -55,12 +55,11 @@ public class UserBinaryDataServiceImpl implements UserBinaryDataService { private static final Logger LOGGER = LoggerFactory.getLogger(UserBinaryDataServiceImpl.class); - private FeatureFlagHandler featureFlagHandler; + private static final String DEFAULT_USER_PHOTO = "image/defaultAvatar.png"; - privatestatic final String DEFAULT_USER_PHOTO = "image/defaultAvatar.png"; - private DataStoreService dataStoreService; + private final DataStoreService dataStoreService; - private FeatureFlagHandler featureFlagHandler; + private final FeatureFlagHandler featureFlagHandler; @Autowired public UserBinaryDataServiceImpl( diff --git a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepository.java b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepository.java index 55c2bfcb6..2581b23bc 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepository.java @@ -119,9 +119,9 @@ List findLaunchesHistory(@Param("historyDepth") int historyDepth, /** * @param launchId {@link Launch#getId()} - * @param status {@link TestItemResults#getStatus()} + * @param statuses {@link TestItemResults#getStatus()} * @return `true` if {@link TestItem#getLaunchId()} equal to provided `launchId`, - * {@link TestItem#getParent()} equal to `NULL` and {@link TestItemResults#getStatus()} is not + * {@link TestItem#getParentId()} equal to `NULL` and {@link TestItemResults#getStatus()} is not * equal to provided `status`, otherwise return `false` */ @Query(value = diff --git a/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustomImpl.java index 2567873a3..8fe138b3f 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/UserFilterRepositoryCustomImpl.java @@ -16,10 +16,6 @@ package com.epam.ta.reportportal.dao; -import com.epam.ta.reportportal.commons.querygen.ConvertibleCondition; -import com.epam.ta.reportportal.commons.querygen.FilterCondition; -import com.epam.ta.reportportal.commons.querygen.QueryBuilder; -import com.epam.ta.reportportal.commons.querygen.Queryable; import static com.epam.ta.reportportal.dao.util.ResultFetchers.USER_FILTER_FETCHER; import com.epam.ta.reportportal.commons.querygen.ConvertibleCondition; @@ -27,6 +23,10 @@ import com.epam.ta.reportportal.commons.querygen.QueryBuilder; import com.epam.ta.reportportal.commons.querygen.Queryable; import com.epam.ta.reportportal.entity.filter.UserFilter; +import java.util.Collection; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; import org.jooq.DSLContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -35,13 +35,6 @@ import org.springframework.data.repository.support.PageableExecutionUtils; import org.springframework.stereotype.Repository; -import java.util.Collection; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -import static com.epam.ta.reportportal.dao.util.ResultFetchers.USER_FILTER_FETCHER; - /** * @author Pavel Bortnik */ diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java index 1be858f04..54d7b0306 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java @@ -67,6 +67,7 @@ import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.PERCENTAGE; import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.PERCENTAGE_MULTIPLIER; import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.SF_NAME; +import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.SKIPPED; import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.START_TIME; import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.START_TIME_HISTORY; import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.STATISTICS_COUNTER; diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java index 046ab6b54..0822a6a12 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java @@ -16,6 +16,7 @@ package com.epam.ta.reportportal.dao.util; +import static com.epam.ta.reportportal.commons.querygen.FilterTarget.ATTRIBUTE_ALIAS; import static com.epam.ta.reportportal.dao.LogRepositoryCustomImpl.ROOT_ITEM_ID; import static com.epam.ta.reportportal.dao.constant.TestItemRepositoryConstants.ATTACHMENTS_COUNT; import static com.epam.ta.reportportal.dao.constant.TestItemRepositoryConstants.HAS_CONTENT; @@ -30,7 +31,6 @@ import static com.epam.ta.reportportal.jooq.Tables.INTEGRATION_TYPE; import static com.epam.ta.reportportal.jooq.Tables.ISSUE; import static com.epam.ta.reportportal.jooq.Tables.ISSUE_TYPE; -import static com.epam.ta.reportportal.jooq.Tables.ITEM_ATTRIBUTE; import static com.epam.ta.reportportal.jooq.Tables.LAUNCH; import static com.epam.ta.reportportal.jooq.Tables.LOG; import static com.epam.ta.reportportal.jooq.Tables.PATTERN_TEMPLATE; @@ -115,6 +115,7 @@ import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Function; +import org.apache.logging.log4j.util.Strings; import org.jooq.Field; import org.jooq.Record; import org.jooq.RecordMapper; diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java b/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java index da4c46ca3..fdafa0494 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java @@ -58,7 +58,9 @@ import com.epam.ta.reportportal.jooq.tables.JUsers; import com.epam.ta.reportportal.jooq.tables.JWidget; import com.epam.ta.reportportal.jooq.tables.JWidgetFilter; + import javax.annotation.processing.Generated; + import org.jooq.Index; import org.jooq.OrderField; import org.jooq.impl.Internal; @@ -74,25 +76,25 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Indexes { - // ------------------------------------------------------------------------- - // INDEX definitions - // ------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // INDEX definitions + // ------------------------------------------------------------------------- - public static final Index ACTIVITY_CREATED_AT_IDX = Indexes0.ACTIVITY_CREATED_AT_IDX; - public static final Index ACTIVITY_OBJECT_IDX = Indexes0.ACTIVITY_OBJECT_IDX; - public static final Index ACTIVITY_PK = Indexes0.ACTIVITY_PK; - public static final Index ACTIVITY_PROJECT_IDX = Indexes0.ACTIVITY_PROJECT_IDX; - public static final Index API_KEYS_PKEY = Indexes0.API_KEYS_PKEY; - public static final Index HASH_API_KEYS_IDX = Indexes0.HASH_API_KEYS_IDX; - public static final Index USERS_API_KEYS_UNIQUE = Indexes0.USERS_API_KEYS_UNIQUE; - public static final Index ATT_ITEM_IDX = Indexes0.ATT_ITEM_IDX; - public static final Index ATT_LAUNCH_IDX = Indexes0.ATT_LAUNCH_IDX; - public static final Index ATT_PROJECT_IDX = Indexes0.ATT_PROJECT_IDX; - public static final Index ATTACHMENT_PK = Indexes0.ATTACHMENT_PK; - public static final Index ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX = Indexes0.ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX; + public static final Index ACTIVITY_CREATED_AT_IDX = Indexes0.ACTIVITY_CREATED_AT_IDX; + public static final Index ACTIVITY_OBJECT_IDX = Indexes0.ACTIVITY_OBJECT_IDX; + public static final Index ACTIVITY_PK = Indexes0.ACTIVITY_PK; + public static final Index ACTIVITY_PROJECT_IDX = Indexes0.ACTIVITY_PROJECT_IDX; + public static final Index API_KEYS_PKEY = Indexes0.API_KEYS_PKEY; + public static final Index HASH_API_KEYS_IDX = Indexes0.HASH_API_KEYS_IDX; + public static final Index USERS_API_KEYS_UNIQUE = Indexes0.USERS_API_KEYS_UNIQUE; + public static final Index ATT_ITEM_IDX = Indexes0.ATT_ITEM_IDX; + public static final Index ATT_LAUNCH_IDX = Indexes0.ATT_LAUNCH_IDX; + public static final Index ATT_PROJECT_IDX = Indexes0.ATT_PROJECT_IDX; + public static final Index ATTACHMENT_PK = Indexes0.ATTACHMENT_PK; + public static final Index ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX = Indexes0.ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX; public static final Index ATTACHMENT_DELETION_PKEY = Indexes0.ATTACHMENT_DELETION_PKEY; public static final Index ATTRIBUTE_PK = Indexes0.ATTRIBUTE_PK; public static final Index CLUSTER_INDEX_ID_IDX = Indexes0.CLUSTER_INDEX_ID_IDX; @@ -175,6 +177,7 @@ public class Indexes { public static final Index RESTORE_PASSWORD_BID_PK = Indexes0.RESTORE_PASSWORD_BID_PK; public static final Index SENDER_CASE_PK = Indexes0.SENDER_CASE_PK; public static final Index SENDER_CASE_PROJECT_IDX = Indexes0.SENDER_CASE_PROJECT_IDX; + public static final Index UNIQUE_RULE_NAME_PER_PROJECT = Indexes0.UNIQUE_RULE_NAME_PER_PROJECT; public static final Index SERVER_SETTINGS_ID = Indexes0.SERVER_SETTINGS_ID; public static final Index SERVER_SETTINGS_KEY_KEY = Indexes0.SERVER_SETTINGS_KEY_KEY; public static final Index SHEDLOCK_PKEY = Indexes0.SHEDLOCK_PKEY; @@ -190,7 +193,6 @@ public class Indexes { public static final Index STATISTICS_FIELD_PK = Indexes0.STATISTICS_FIELD_PK; public static final Index ITEM_TEST_CASE_ID_LAUNCH_ID_IDX = Indexes0.ITEM_TEST_CASE_ID_LAUNCH_ID_IDX; public static final Index PATH_GIST_IDX = Indexes0.PATH_GIST_IDX; - public static final Index PATH_IDX = Indexes0.PATH_IDX; public static final Index TEST_CASE_HASH_LAUNCH_ID_IDX = Indexes0.TEST_CASE_HASH_LAUNCH_ID_IDX; public static final Index TEST_ITEM_PK = Indexes0.TEST_ITEM_PK; public static final Index TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX = Indexes0.TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX; @@ -202,7 +204,6 @@ public class Indexes { public static final Index TICKET_ID_IDX = Indexes0.TICKET_ID_IDX; public static final Index TICKET_PK = Indexes0.TICKET_PK; public static final Index TICKET_SUBMITTER_IDX = Indexes0.TICKET_SUBMITTER_IDX; - public static final Index USER_BID_PROJECT_IDX = Indexes0.USER_BID_PROJECT_IDX; public static final Index USER_CREATION_BID_PK = Indexes0.USER_CREATION_BID_PK; public static final Index USER_PREFERENCE_PK = Indexes0.USER_PREFERENCE_PK; public static final Index USER_PREFERENCE_UQ = Indexes0.USER_PREFERENCE_UQ; @@ -216,35 +217,19 @@ public class Indexes { // [#1459] distribute members to avoid static initialisers > 64kb // ------------------------------------------------------------------------- - private static class Indexes0 { - - public static Index ACTIVITY_CREATED_AT_IDX = Internal.createIndex("activity_created_at_idx", - JActivity.ACTIVITY, new OrderField[]{JActivity.ACTIVITY.CREATED_AT}, false); - public static Index ACTIVITY_OBJECT_IDX = Internal.createIndex("activity_object_idx", - JActivity.ACTIVITY, new OrderField[]{JActivity.ACTIVITY.OBJECT_ID}, false); - public static Index ACTIVITY_PK = Internal.createIndex("activity_pk", JActivity.ACTIVITY, - new OrderField[]{JActivity.ACTIVITY.ID}, true); - public static Index ACTIVITY_PROJECT_IDX = Internal.createIndex("activity_project_idx", - JActivity.ACTIVITY, new OrderField[]{JActivity.ACTIVITY.PROJECT_ID}, false); - public static Index API_KEYS_PKEY = Internal.createIndex("api_keys_pkey", JApiKeys.API_KEYS, - new OrderField[]{JApiKeys.API_KEYS.ID}, true); - public static Index HASH_API_KEYS_IDX = Internal.createIndex("hash_api_keys_idx", - JApiKeys.API_KEYS, new OrderField[]{JApiKeys.API_KEYS.HASH}, false); - public static Index USERS_API_KEYS_UNIQUE = Internal.createIndex("users_api_keys_unique", - JApiKeys.API_KEYS, new OrderField[]{JApiKeys.API_KEYS.NAME, JApiKeys.API_KEYS.USER_ID}, - true); - public static Index ATT_ITEM_IDX = Internal.createIndex("att_item_idx", JAttachment.ATTACHMENT, - new OrderField[]{JAttachment.ATTACHMENT.ITEM_ID}, false); - public static Index ATT_LAUNCH_IDX = Internal.createIndex("att_launch_idx", - JAttachment.ATTACHMENT, new OrderField[]{JAttachment.ATTACHMENT.LAUNCH_ID}, false); - public static Index ATT_PROJECT_IDX = Internal.createIndex("att_project_idx", - JAttachment.ATTACHMENT, new OrderField[]{JAttachment.ATTACHMENT.PROJECT_ID}, false); - public static Index ATTACHMENT_PK = Internal.createIndex("attachment_pk", - JAttachment.ATTACHMENT, new OrderField[]{JAttachment.ATTACHMENT.ID}, true); - public static Index ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX = Internal.createIndex( - "attachment_project_id_creation_time_idx", JAttachment.ATTACHMENT, - new OrderField[]{JAttachment.ATTACHMENT.PROJECT_ID, JAttachment.ATTACHMENT.CREATION_DATE}, - false); + private static class Indexes0 { + public static Index ACTIVITY_CREATED_AT_IDX = Internal.createIndex("activity_created_at_idx", JActivity.ACTIVITY, new OrderField[] { JActivity.ACTIVITY.CREATED_AT }, false); + public static Index ACTIVITY_OBJECT_IDX = Internal.createIndex("activity_object_idx", JActivity.ACTIVITY, new OrderField[] { JActivity.ACTIVITY.OBJECT_ID }, false); + public static Index ACTIVITY_PK = Internal.createIndex("activity_pk", JActivity.ACTIVITY, new OrderField[] { JActivity.ACTIVITY.ID }, true); + public static Index ACTIVITY_PROJECT_IDX = Internal.createIndex("activity_project_idx", JActivity.ACTIVITY, new OrderField[] { JActivity.ACTIVITY.PROJECT_ID }, false); + public static Index API_KEYS_PKEY = Internal.createIndex("api_keys_pkey", JApiKeys.API_KEYS, new OrderField[] { JApiKeys.API_KEYS.ID }, true); + public static Index HASH_API_KEYS_IDX = Internal.createIndex("hash_api_keys_idx", JApiKeys.API_KEYS, new OrderField[] { JApiKeys.API_KEYS.HASH }, false); + public static Index USERS_API_KEYS_UNIQUE = Internal.createIndex("users_api_keys_unique", JApiKeys.API_KEYS, new OrderField[] { JApiKeys.API_KEYS.NAME, JApiKeys.API_KEYS.USER_ID }, true); + public static Index ATT_ITEM_IDX = Internal.createIndex("att_item_idx", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.ITEM_ID }, false); + public static Index ATT_LAUNCH_IDX = Internal.createIndex("att_launch_idx", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.LAUNCH_ID }, false); + public static Index ATT_PROJECT_IDX = Internal.createIndex("att_project_idx", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.PROJECT_ID }, false); + public static Index ATTACHMENT_PK = Internal.createIndex("attachment_pk", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.ID }, true); + public static Index ATTACHMENT_PROJECT_ID_CREATION_TIME_IDX = Internal.createIndex("attachment_project_id_creation_time_idx", JAttachment.ATTACHMENT, new OrderField[] { JAttachment.ATTACHMENT.PROJECT_ID, JAttachment.ATTACHMENT.CREATION_DATE }, false); public static Index ATTACHMENT_DELETION_PKEY = Internal.createIndex("attachment_deletion_pkey", JAttachmentDeletion.ATTACHMENT_DELETION, new OrderField[] { JAttachmentDeletion.ATTACHMENT_DELETION.ID }, true); public static Index ATTRIBUTE_PK = Internal.createIndex("attribute_pk", JAttribute.ATTRIBUTE, new OrderField[] { JAttribute.ATTRIBUTE.ID }, true); public static Index CLUSTER_INDEX_ID_IDX = Internal.createIndex("cluster_index_id_idx", JClusters.CLUSTERS, new OrderField[] { JClusters.CLUSTERS.INDEX_ID }, false); @@ -327,6 +312,7 @@ private static class Indexes0 { public static Index RESTORE_PASSWORD_BID_PK = Internal.createIndex("restore_password_bid_pk", JRestorePasswordBid.RESTORE_PASSWORD_BID, new OrderField[] { JRestorePasswordBid.RESTORE_PASSWORD_BID.UUID }, true); public static Index SENDER_CASE_PK = Internal.createIndex("sender_case_pk", JSenderCase.SENDER_CASE, new OrderField[] { JSenderCase.SENDER_CASE.ID }, true); public static Index SENDER_CASE_PROJECT_IDX = Internal.createIndex("sender_case_project_idx", JSenderCase.SENDER_CASE, new OrderField[] { JSenderCase.SENDER_CASE.PROJECT_ID }, false); + public static Index UNIQUE_RULE_NAME_PER_PROJECT = Internal.createIndex("unique_rule_name_per_project", JSenderCase.SENDER_CASE, new OrderField[] { JSenderCase.SENDER_CASE.RULE_NAME, JSenderCase.SENDER_CASE.PROJECT_ID }, true); public static Index SERVER_SETTINGS_ID = Internal.createIndex("server_settings_id", JServerSettings.SERVER_SETTINGS, new OrderField[] { JServerSettings.SERVER_SETTINGS.ID }, true); public static Index SERVER_SETTINGS_KEY_KEY = Internal.createIndex("server_settings_key_key", JServerSettings.SERVER_SETTINGS, new OrderField[] { JServerSettings.SERVER_SETTINGS.KEY }, true); public static Index SHEDLOCK_PKEY = Internal.createIndex("shedlock_pkey", JShedlock.SHEDLOCK, new OrderField[] { JShedlock.SHEDLOCK.NAME }, true); @@ -342,7 +328,6 @@ private static class Indexes0 { public static Index STATISTICS_FIELD_PK = Internal.createIndex("statistics_field_pk", JStatisticsField.STATISTICS_FIELD, new OrderField[] { JStatisticsField.STATISTICS_FIELD.SF_ID }, true); public static Index ITEM_TEST_CASE_ID_LAUNCH_ID_IDX = Internal.createIndex("item_test_case_id_launch_id_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.TEST_CASE_ID, JTestItem.TEST_ITEM.LAUNCH_ID }, false); public static Index PATH_GIST_IDX = Internal.createIndex("path_gist_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.PATH }, false); - public static Index PATH_IDX = Internal.createIndex("path_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.PATH }, false); public static Index TEST_CASE_HASH_LAUNCH_ID_IDX = Internal.createIndex("test_case_hash_launch_id_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.TEST_CASE_HASH, JTestItem.TEST_ITEM.LAUNCH_ID }, false); public static Index TEST_ITEM_PK = Internal.createIndex("test_item_pk", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.ITEM_ID }, true); public static Index TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX = Internal.createIndex("test_item_unique_id_launch_id_idx", JTestItem.TEST_ITEM, new OrderField[] { JTestItem.TEST_ITEM.UNIQUE_ID, JTestItem.TEST_ITEM.LAUNCH_ID }, false); @@ -354,7 +339,6 @@ private static class Indexes0 { public static Index TICKET_ID_IDX = Internal.createIndex("ticket_id_idx", JTicket.TICKET, new OrderField[] { JTicket.TICKET.TICKET_ID }, false); public static Index TICKET_PK = Internal.createIndex("ticket_pk", JTicket.TICKET, new OrderField[] { JTicket.TICKET.ID }, true); public static Index TICKET_SUBMITTER_IDX = Internal.createIndex("ticket_submitter_idx", JTicket.TICKET, new OrderField[] { JTicket.TICKET.SUBMITTER }, false); - public static Index USER_BID_PROJECT_IDX = Internal.createIndex("user_bid_project_idx", JUserCreationBid.USER_CREATION_BID, new OrderField[] { JUserCreationBid.USER_CREATION_BID.DEFAULT_PROJECT_ID }, false); public static Index USER_CREATION_BID_PK = Internal.createIndex("user_creation_bid_pk", JUserCreationBid.USER_CREATION_BID, new OrderField[] { JUserCreationBid.USER_CREATION_BID.UUID }, true); public static Index USER_PREFERENCE_PK = Internal.createIndex("user_preference_pk", JUserPreference.USER_PREFERENCE, new OrderField[] { JUserPreference.USER_PREFERENCE.ID }, true); public static Index USER_PREFERENCE_UQ = Internal.createIndex("user_preference_uq", JUserPreference.USER_PREFERENCE, new OrderField[] { JUserPreference.USER_PREFERENCE.PROJECT_ID, JUserPreference.USER_PREFERENCE.USER_ID, JUserPreference.USER_PREFERENCE.FILTER_ID }, true); diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Keys.java b/src/main/java/com/epam/ta/reportportal/jooq/Keys.java index 515e30d94..957e0b257 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/Keys.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Keys.java @@ -112,7 +112,9 @@ import com.epam.ta.reportportal.jooq.tables.records.JUsersRecord; import com.epam.ta.reportportal.jooq.tables.records.JWidgetFilterRecord; import com.epam.ta.reportportal.jooq.tables.records.JWidgetRecord; + import javax.annotation.processing.Generated; + import org.jooq.ForeignKey; import org.jooq.Identity; import org.jooq.UniqueKey; @@ -303,15 +305,8 @@ public class Keys { public static final ForeignKey TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY = ForeignKeys0.TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY; public static final ForeignKey TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY = ForeignKeys0.TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY; public static final ForeignKey TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY = ForeignKeys0.TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY; - public static final ForeignKey - USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY = - ForeignKeys0.USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY; - public static final ForeignKey - USER_CREATION_BID__USER_CREATION_BID_INVITING_USER_ID_FKEY = - ForeignKeys0.USER_CREATION_BID__USER_CREATION_BID_INVITING_USER_ID_FKEY; - public static final ForeignKey - USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY = - ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY; + public static final ForeignKey USER_CREATION_BID__USER_CREATION_BID_INVITING_USER_ID_FKEY = ForeignKeys0.USER_CREATION_BID__USER_CREATION_BID_INVITING_USER_ID_FKEY; + public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY = ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY; public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY = ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY; public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY = ForeignKeys0.USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY; public static final ForeignKey WIDGET__WIDGET_ID_FK = ForeignKeys0.WIDGET__WIDGET_ID_FK; @@ -485,23 +480,8 @@ private static class ForeignKeys0 { public static final ForeignKey TEST_ITEM__TEST_ITEM_RETRY_OF_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JTestItem.TEST_ITEM, "test_item__test_item_retry_of_fkey", JTestItem.TEST_ITEM.RETRY_OF); public static final ForeignKey TEST_ITEM__TEST_ITEM_LAUNCH_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JTestItem.TEST_ITEM, "test_item__test_item_launch_id_fkey", JTestItem.TEST_ITEM.LAUNCH_ID); public static final ForeignKey TEST_ITEM_RESULTS__TEST_ITEM_RESULTS_RESULT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JTestItemResults.TEST_ITEM_RESULTS, "test_item_results__test_item_results_result_id_fkey", JTestItemResults.TEST_ITEM_RESULTS.RESULT_ID); - public static final ForeignKey - USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY = - Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, - JUserCreationBid.USER_CREATION_BID, - "user_creation_bid__user_creation_bid_default_project_id_fkey", - JUserCreationBid.USER_CREATION_BID.DEFAULT_PROJECT_ID); - public static final ForeignKey - USER_CREATION_BID__USER_CREATION_BID_INVITING_USER_ID_FKEY = - Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_PK, - JUserCreationBid.USER_CREATION_BID, - "user_creation_bid__user_creation_bid_inviting_user_id_fkey", - JUserCreationBid.USER_CREATION_BID.INVITING_USER_ID); - public static final ForeignKey - USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY = - Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, - JUserPreference.USER_PREFERENCE, "user_preference__user_preference_project_id_fkey", - JUserPreference.USER_PREFERENCE.PROJECT_ID); + public static final ForeignKey USER_CREATION_BID__USER_CREATION_BID_INVITING_USER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_PK, JUserCreationBid.USER_CREATION_BID, "user_creation_bid__user_creation_bid_inviting_user_id_fkey", JUserCreationBid.USER_CREATION_BID.INVITING_USER_ID); + public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JUserPreference.USER_PREFERENCE, "user_preference__user_preference_project_id_fkey", JUserPreference.USER_PREFERENCE.PROJECT_ID); public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_USER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_PK, JUserPreference.USER_PREFERENCE, "user_preference__user_preference_user_id_fkey", JUserPreference.USER_PREFERENCE.USER_ID); public static final ForeignKey USER_PREFERENCE__USER_PREFERENCE_FILTER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.FILTER_PKEY, JUserPreference.USER_PREFERENCE, "user_preference__user_preference_filter_id_fkey", JUserPreference.USER_PREFERENCE.FILTER_ID); public static final ForeignKey WIDGET__WIDGET_ID_FK = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.SHAREABLE_PK, JWidget.WIDGET, "widget__widget_id_fk", JWidget.WIDGET.ID); diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java b/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java index eccb5f790..9633442ab 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java @@ -123,16 +123,6 @@ public class Sequences { */ public static final Sequence ONBOARDING_ID_SEQ = new SequenceImpl("onboarding_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.SMALLINT.nullable(false)); - /** - * The sequence public.organization_attribute_id_seq - */ - public static final Sequence ORGANIZATION_ATTRIBUTE_ID_SEQ = new SequenceImpl("organization_attribute_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - - /** - * The sequence public.organization_id_seq - */ - public static final Sequence ORGANIZATION_ID_SEQ = new SequenceImpl("organization_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - /** * The sequence public.pattern_template_id_seq */ diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JActivity.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JActivity.java index e7a3be687..b83c9209e 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JActivity.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JActivity.java @@ -8,10 +8,13 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JActivityRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -41,107 +44,105 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JActivity extends TableImpl { - private static final long serialVersionUID = 551259526; + private static final long serialVersionUID = 551259526; /** * The reference instance of public.activity */ public static final JActivity ACTIVITY = new JActivity(); - /** - * The column public.activity.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('activity_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.activity.created_at. - */ - public final TableField CREATED_AT = createField( - DSL.name("created_at"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - /** - * The column public.activity.action. - */ - public final TableField ACTION = createField(DSL.name("action"), - org.jooq.impl.SQLDataType.VARCHAR(24).nullable(false), this, ""); - /** - * The column public.activity.event_name. - */ - public final TableField EVENT_NAME = createField(DSL.name("event_name"), - org.jooq.impl.SQLDataType.VARCHAR(32).nullable(false), this, ""); - /** - * The column public.activity.priority. - */ - public final TableField PRIORITY = createField(DSL.name("priority"), - org.jooq.impl.SQLDataType.VARCHAR(12).nullable(false), this, ""); - /** - * The column public.activity.object_id. - */ - public final TableField OBJECT_ID = createField(DSL.name("object_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.activity.object_name. - */ - public final TableField OBJECT_NAME = createField( - DSL.name("object_name"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - /** - * The column public.activity.object_type. - */ - public final TableField OBJECT_TYPE = createField( - DSL.name("object_type"), org.jooq.impl.SQLDataType.VARCHAR(24).nullable(false), this, ""); - /** - * The column public.activity.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.activity.details. - */ - public final TableField DETAILS = createField(DSL.name("details"), - org.jooq.impl.SQLDataType.JSONB, this, ""); - /** - * The column public.activity.subject_id. - */ - public final TableField SUBJECT_ID = createField(DSL.name("subject_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - /** - * The column public.activity.subject_name. - */ - public final TableField SUBJECT_NAME = createField( - DSL.name("subject_name"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); - /** - * The column public.activity.subject_type. - */ - public final TableField SUBJECT_TYPE = createField( - DSL.name("subject_type"), org.jooq.impl.SQLDataType.VARCHAR(32).nullable(false), this, ""); - - /** - * Create a public.activity table reference - */ - public JActivity() { - this(DSL.name("activity"), null); - } - - /** - * Create an aliased public.activity table reference - */ - public JActivity(String alias) { - this(DSL.name(alias), ACTIVITY); - } - - /** - * Create an aliased public.activity table reference - */ - public JActivity(Name alias) { - this(alias, ACTIVITY); - } /** * The class holding records for this type */ @Override public Class getRecordType() { - return JActivityRecord.class; + return JActivityRecord.class; + } + + /** + * The column public.activity.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('activity_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.activity.created_at. + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * The column public.activity.action. + */ + public final TableField ACTION = createField(DSL.name("action"), org.jooq.impl.SQLDataType.VARCHAR(24).nullable(false), this, ""); + + /** + * The column public.activity.event_name. + */ + public final TableField EVENT_NAME = createField(DSL.name("event_name"), org.jooq.impl.SQLDataType.VARCHAR(32).nullable(false), this, ""); + + /** + * The column public.activity.priority. + */ + public final TableField PRIORITY = createField(DSL.name("priority"), org.jooq.impl.SQLDataType.VARCHAR(12).nullable(false), this, ""); + + /** + * The column public.activity.object_id. + */ + public final TableField OBJECT_ID = createField(DSL.name("object_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.activity.object_name. + */ + public final TableField OBJECT_NAME = createField(DSL.name("object_name"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); + + /** + * The column public.activity.object_type. + */ + public final TableField OBJECT_TYPE = createField(DSL.name("object_type"), org.jooq.impl.SQLDataType.VARCHAR(24).nullable(false), this, ""); + + /** + * The column public.activity.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.activity.details. + */ + public final TableField DETAILS = createField(DSL.name("details"), org.jooq.impl.SQLDataType.JSONB, this, ""); + + /** + * The column public.activity.subject_id. + */ + public final TableField SUBJECT_ID = createField(DSL.name("subject_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.activity.subject_name. + */ + public final TableField SUBJECT_NAME = createField(DSL.name("subject_name"), org.jooq.impl.SQLDataType.VARCHAR(128).nullable(false), this, ""); + + /** + * The column public.activity.subject_type. + */ + public final TableField SUBJECT_TYPE = createField(DSL.name("subject_type"), org.jooq.impl.SQLDataType.VARCHAR(32).nullable(false), this, ""); + + /** + * Create a public.activity table reference + */ + public JActivity() { + this(DSL.name("activity"), null); + } + + /** + * Create an aliased public.activity table reference + */ + public JActivity(String alias) { + this(DSL.name(alias), ACTIVITY); + } + + /** + * Create an aliased public.activity table reference + */ + public JActivity(Name alias) { + this(alias, ACTIVITY); } private JActivity(Name alias, Table aliased) { @@ -158,51 +159,49 @@ public JActivity(Table child, ForeignKey getIndexes() { - return Arrays.asList(Indexes.ACTIVITY_CREATED_AT_IDX, Indexes.ACTIVITY_OBJECT_IDX, - Indexes.ACTIVITY_PK, Indexes.ACTIVITY_PROJECT_IDX); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ACTIVITY; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ACTIVITY_PK; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ACTIVITY_PK); - } - - @Override - public List> getReferences() { - return Arrays.>asList( - Keys.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY); - } - - public JProject project() { - return new JProject(this, Keys.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY); - } - - @Override - public JActivity as(String alias) { - return new JActivity(DSL.name(alias), this); - } - - @Override - public JActivity as(Name alias) { - return new JActivity(alias, this); - } - - /** + return JPublic.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.ACTIVITY_CREATED_AT_IDX, Indexes.ACTIVITY_OBJECT_IDX, Indexes.ACTIVITY_PK, Indexes.ACTIVITY_PROJECT_IDX); + } + + @Override + public Identity getIdentity() { + return Keys.IDENTITY_ACTIVITY; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.ACTIVITY_PK; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.ACTIVITY_PK); + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY); + } + + public JProject project() { + return new JProject(this, Keys.ACTIVITY__ACTIVITY_PROJECT_ID_FKEY); + } + + @Override + public JActivity as(String alias) { + return new JActivity(DSL.name(alias), this); + } + + @Override + public JActivity as(Name alias) { + return new JActivity(alias, this); + } + + /** * Rename this table */ @Override @@ -210,20 +209,20 @@ public JActivity rename(String name) { return new JActivity(DSL.name(name), null); } - /** - * Rename this table - */ - @Override - public JActivity rename(Name name) { - return new JActivity(name, null); - } + /** + * Rename this table + */ + @Override + public JActivity rename(Name name) { + return new JActivity(name, null); + } - // ------------------------------------------------------------------------- - // Row13 type methods - // ------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // Row13 type methods + // ------------------------------------------------------------------------- - @Override - public Row13 fieldsRow() { - return (Row13) super.fieldsRow(); - } + @Override + public Row13 fieldsRow() { + return (Row13) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JApiKeys.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JApiKeys.java index 3676eaf52..f15f4627c 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JApiKeys.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JApiKeys.java @@ -8,11 +8,14 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JApiKeysRecord; + import java.sql.Date; import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -41,7 +44,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JApiKeys extends TableImpl { - private static final long serialVersionUID = -1062577780; + private static final long serialVersionUID = -1062577780; /** * The reference instance of public.api_keys @@ -71,33 +74,30 @@ public Class getRecordType() { */ public final TableField HASH = createField(DSL.name("hash"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - /** - * The column public.api_keys.created_at. - */ - public final TableField CREATED_AT = createField( - DSL.name("created_at"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); - - /** - * The column public.api_keys.user_id. - */ - public final TableField USER_ID = createField(DSL.name("user_id"), - org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.api_keys.last_used_at. - */ - public final TableField LAST_USED_AT = createField(DSL.name("last_used_at"), - org.jooq.impl.SQLDataType.DATE, this, ""); - - /** - * Create a public.api_keys table reference - */ - public JApiKeys() { - this(DSL.name("api_keys"), null); - } - - /** - * Create an aliased public.api_keys table reference + /** + * The column public.api_keys.created_at. + */ + public final TableField CREATED_AT = createField(DSL.name("created_at"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + + /** + * The column public.api_keys.user_id. + */ + public final TableField USER_ID = createField(DSL.name("user_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + + /** + * The column public.api_keys.last_used_at. + */ + public final TableField LAST_USED_AT = createField(DSL.name("last_used_at"), org.jooq.impl.SQLDataType.DATE, this, ""); + + /** + * Create a public.api_keys table reference + */ + public JApiKeys() { + this(DSL.name("api_keys"), null); + } + + /** + * Create an aliased public.api_keys table reference */ public JApiKeys(String alias) { this(DSL.name(alias), API_KEYS); @@ -183,11 +183,11 @@ public JApiKeys rename(Name name) { } // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java index 17b911178..4ad91b62d 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JAttachment.java @@ -21,7 +21,7 @@ import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row9; +import org.jooq.Row10; import org.jooq.Schema; import org.jooq.Table; import org.jooq.TableField; @@ -43,7 +43,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JAttachment extends TableImpl { - private static final long serialVersionUID = -1988681978; + private static final long serialVersionUID = -453732948; /** * The reference instance of public.attachment @@ -103,6 +103,11 @@ public Class getRecordType() { */ public final TableField CREATION_DATE = createField(DSL.name("creation_date"), org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false), this, ""); + /** + * The column public.attachment.file_name. + */ + public final TableField FILE_NAME = createField(DSL.name("file_name"), org.jooq.impl.SQLDataType.VARCHAR(512), this, ""); + /** * Create a public.attachment table reference */ @@ -188,11 +193,11 @@ public JAttachment rename(Name name) { } // ------------------------------------------------------------------------- - // Row9 type methods + // Row10 type methods // ------------------------------------------------------------------------- @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); + public Row10 fieldsRow() { + return (Row10) super.fieldsRow(); } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchAttributeRules.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchAttributeRules.java index 2e4da1b30..cdf3dcb12 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchAttributeRules.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JLaunchAttributeRules.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JLaunchAttributeRulesRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -54,35 +57,29 @@ public Class getRecordType() { return JLaunchAttributeRulesRecord.class; } - /** - * The column public.launch_attribute_rules.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('launch_attribute_rules_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.launch_attribute_rules.sender_case_id. - */ - public final TableField SENDER_CASE_ID = createField( - DSL.name("sender_case_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * The column public.launch_attribute_rules.key. - */ - public final TableField KEY = createField(DSL.name("key"), - org.jooq.impl.SQLDataType.VARCHAR(512), this, ""); - - /** - * The column public.launch_attribute_rules.value. - */ - public final TableField VALUE = createField( - DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR(512).nullable(false), this, ""); - - /** - * Create a public.launch_attribute_rules table reference - */ + /** + * The column public.launch_attribute_rules.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('launch_attribute_rules_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.launch_attribute_rules.sender_case_id. + */ + public final TableField SENDER_CASE_ID = createField(DSL.name("sender_case_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.launch_attribute_rules.key. + */ + public final TableField KEY = createField(DSL.name("key"), org.jooq.impl.SQLDataType.VARCHAR(512), this, ""); + + /** + * The column public.launch_attribute_rules.value. + */ + public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR(512).nullable(false), this, ""); + + /** + * Create a public.launch_attribute_rules table reference + */ public JLaunchAttributeRules() { this(DSL.name("launch_attribute_rules"), null); } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganization.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganization.java deleted file mode 100644 index d81926b91..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganization.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables; - - -import com.epam.ta.reportportal.jooq.Indexes; -import com.epam.ta.reportportal.jooq.JPublic; -import com.epam.ta.reportportal.jooq.Keys; -import com.epam.ta.reportportal.jooq.tables.records.JOrganizationRecord; - -import java.util.Arrays; -import java.util.List; - -import javax.annotation.processing.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Index; -import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Row2; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.DSL; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JOrganization extends TableImpl { - - private static final long serialVersionUID = -239155074; - - /** - * The reference instance of public.organization - */ - public static final JOrganization ORGANIZATION = new JOrganization(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JOrganizationRecord.class; - } - - /** - * The column public.organization.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('organization_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.organization.name. - */ - public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.CLOB.nullable(false), this, ""); - - /** - * Create a public.organization table reference - */ - public JOrganization() { - this(DSL.name("organization"), null); - } - - /** - * Create an aliased public.organization table reference - */ - public JOrganization(String alias) { - this(DSL.name(alias), ORGANIZATION); - } - - /** - * Create an aliased public.organization table reference - */ - public JOrganization(Name alias) { - this(alias, ORGANIZATION); - } - - private JOrganization(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JOrganization(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JOrganization(Table child, ForeignKey key) { - super(child, key, ORGANIZATION); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ORGANIZATION_PKEY); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ORGANIZATION; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ORGANIZATION_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ORGANIZATION_PKEY); - } - - @Override - public JOrganization as(String alias) { - return new JOrganization(DSL.name(alias), this); - } - - @Override - public JOrganization as(Name alias) { - return new JOrganization(alias, this); - } - - /** - * Rename this table - */ - @Override - public JOrganization rename(String name) { - return new JOrganization(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JOrganization rename(Name name) { - return new JOrganization(name, null); - } - - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganizationAttribute.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganizationAttribute.java deleted file mode 100644 index fecb54a8a..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOrganizationAttribute.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables; - -import com.epam.ta.reportportal.jooq.Indexes; -import com.epam.ta.reportportal.jooq.JPublic; -import com.epam.ta.reportportal.jooq.Keys; -import com.epam.ta.reportportal.jooq.tables.records.JOrganizationAttributeRecord; -import java.util.Arrays; -import java.util.List; -import javax.annotation.processing.Generated; -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Index; -import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Row5; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.DSL; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JOrganizationAttribute extends TableImpl { - - private static final long serialVersionUID = 1240174929; - - /** - * The reference instance of public.organization_attribute - */ - public static final JOrganizationAttribute ORGANIZATION_ATTRIBUTE = new JOrganizationAttribute(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JOrganizationAttributeRecord.class; - } - - /** - * The column public.organization_attribute.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('organization_attribute_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.organization_attribute.key. - */ - public final TableField KEY = createField(DSL.name("key"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - - /** - * The column public.organization_attribute.value. - */ - public final TableField VALUE = createField(DSL.name("value"), org.jooq.impl.SQLDataType.VARCHAR(256).nullable(false), this, ""); - - /** - * The column public.organization_attribute.system. - */ - public final TableField SYSTEM = createField(DSL.name("system"), org.jooq.impl.SQLDataType.BOOLEAN, this, ""); - - /** - * The column public.organization_attribute.organization_id. - */ - public final TableField ORGANIZATION_ID = createField(DSL.name("organization_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * Create a public.organization_attribute table reference - */ - public JOrganizationAttribute() { - this(DSL.name("organization_attribute"), null); - } - - /** - * Create an aliased public.organization_attribute table reference - */ - public JOrganizationAttribute(String alias) { - this(DSL.name(alias), ORGANIZATION_ATTRIBUTE); - } - - /** - * Create an aliased public.organization_attribute table reference - */ - public JOrganizationAttribute(Name alias) { - this(alias, ORGANIZATION_ATTRIBUTE); - } - - private JOrganizationAttribute(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JOrganizationAttribute(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JOrganizationAttribute(Table child, ForeignKey key) { - super(child, key, ORGANIZATION_ATTRIBUTE); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.ORGANIZATION_ATTRIBUTE_PKEY); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_ORGANIZATION_ATTRIBUTE; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.ORGANIZATION_ATTRIBUTE_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ORGANIZATION_ATTRIBUTE_PKEY); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.ORGANIZATION_ATTRIBUTE__ORGANIZATION_ATTRIBUTE_ORGANIZATION_ID_FKEY); - } - - public JOrganization organization() { - return new JOrganization(this, Keys.ORGANIZATION_ATTRIBUTE__ORGANIZATION_ATTRIBUTE_ORGANIZATION_ID_FKEY); - } - - @Override - public JOrganizationAttribute as(String alias) { - return new JOrganizationAttribute(DSL.name(alias), this); - } - - @Override - public JOrganizationAttribute as(Name alias) { - return new JOrganizationAttribute(alias, this); - } - - /** - * Rename this table - */ - @Override - public JOrganizationAttribute rename(String name) { - return new JOrganizationAttribute(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JOrganizationAttribute rename(Name name) { - return new JOrganizationAttribute(name, null); - } - - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOwnedEntity.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOwnedEntity.java index 73ce85058..46ddbcbbd 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOwnedEntity.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOwnedEntity.java @@ -8,9 +8,12 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JOwnedEntityRecord; + import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Identity; @@ -45,37 +48,35 @@ public class JOwnedEntity extends TableImpl { * The reference instance of public.owned_entity */ public static final JOwnedEntity OWNED_ENTITY = new JOwnedEntity(); - /** - * The column public.owned_entity.id. - */ - public final TableField ID = createField(DSL.name("id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue( - org.jooq.impl.DSL.field("nextval('shareable_entity_id_seq'::regclass)", - org.jooq.impl.SQLDataType.BIGINT)), this, ""); - /** - * The column public.owned_entity.owner. - */ - public final TableField OWNER = createField(DSL.name("owner"), - org.jooq.impl.SQLDataType.VARCHAR, this, ""); - /** - * The column public.owned_entity.project_id. - */ - public final TableField PROJECT_ID = createField(DSL.name("project_id"), - org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); - - /** - * Create a public.owned_entity table reference - */ - public JOwnedEntity() { - this(DSL.name("owned_entity"), null); - } /** * The class holding records for this type */ @Override public Class getRecordType() { - return JOwnedEntityRecord.class; + return JOwnedEntityRecord.class; + } + + /** + * The column public.owned_entity.id. + */ + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('shareable_entity_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); + + /** + * The column public.owned_entity.owner. + */ + public final TableField OWNER = createField(DSL.name("owner"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + + /** + * The column public.owned_entity.project_id. + */ + public final TableField PROJECT_ID = createField(DSL.name("project_id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * Create a public.owned_entity table reference + */ + public JOwnedEntity() { + this(DSL.name("owned_entity"), null); } /** @@ -131,11 +132,10 @@ public List> getKeys() { @Override public List> getReferences() { - return Arrays.>asList( - Keys.OWNED_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY); + return Arrays.>asList(Keys.OWNED_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY); } - public JProject project() { + public JProject project() { return new JProject(this, Keys.OWNED_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY); } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JSenderCase.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JSenderCase.java index d53ea6fc1..9348532cd 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JSenderCase.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JSenderCase.java @@ -21,7 +21,7 @@ import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row5; +import org.jooq.Row6; import org.jooq.Schema; import org.jooq.Table; import org.jooq.TableField; @@ -43,7 +43,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JSenderCase extends TableImpl { - private static final long serialVersionUID = -15193371; + private static final long serialVersionUID = -592069423; /** * The reference instance of public.sender_case @@ -83,6 +83,11 @@ public Class getRecordType() { */ public final TableField ATTRIBUTES_OPERATOR = createField(DSL.name("attributes_operator"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).defaultValue(org.jooq.impl.DSL.field("'AND'::logical_operator_enum", org.jooq.impl.SQLDataType.VARCHAR)).asEnumDataType(com.epam.ta.reportportal.jooq.enums.JLogicalOperatorEnum.class), this, ""); + /** + * The column public.sender_case.rule_name. + */ + public final TableField RULE_NAME = createField(DSL.name("rule_name"), org.jooq.impl.SQLDataType.VARCHAR(55).nullable(false), this, ""); + /** * Create a public.sender_case table reference */ @@ -123,7 +128,7 @@ public Schema getSchema() { @Override public List getIndexes() { - return Arrays.asList(Indexes.SENDER_CASE_PK, Indexes.SENDER_CASE_PROJECT_IDX); + return Arrays.asList(Indexes.SENDER_CASE_PK, Indexes.SENDER_CASE_PROJECT_IDX, Indexes.UNIQUE_RULE_NAME_PER_PROJECT); } @Override @@ -177,11 +182,11 @@ public JSenderCase rename(Name name) { } // ------------------------------------------------------------------------- - // Row5 type methods + // Row6 type methods // ------------------------------------------------------------------------- @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItem.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItem.java index 54aee9985..99adc04f5 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItem.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JTestItem.java @@ -44,7 +44,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JTestItem extends TableImpl { - private static final long serialVersionUID = 1848873064; + private static final long serialVersionUID = 476122531; /** * The reference instance of public.test_item @@ -189,7 +189,7 @@ public Schema getSchema() { @Override public List getIndexes() { - return Arrays.asList(Indexes.ITEM_TEST_CASE_ID_LAUNCH_ID_IDX, Indexes.PATH_GIST_IDX, Indexes.PATH_IDX, Indexes.TEST_CASE_HASH_LAUNCH_ID_IDX, Indexes.TEST_ITEM_PK, Indexes.TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX, Indexes.TEST_ITEM_UUID_KEY, Indexes.TI_LAUNCH_IDX, Indexes.TI_PARENT_IDX, Indexes.TI_RETRY_OF_IDX); + return Arrays.asList(Indexes.ITEM_TEST_CASE_ID_LAUNCH_ID_IDX, Indexes.PATH_GIST_IDX, Indexes.TEST_CASE_HASH_LAUNCH_ID_IDX, Indexes.TEST_ITEM_PK, Indexes.TEST_ITEM_UNIQUE_ID_LAUNCH_ID_IDX, Indexes.TEST_ITEM_UUID_KEY, Indexes.TI_LAUNCH_IDX, Indexes.TI_PARENT_IDX, Indexes.TI_RETRY_OF_IDX); } @Override diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserCreationBid.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserCreationBid.java index 8ded9d356..9bf7a40d1 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserCreationBid.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/JUserCreationBid.java @@ -8,16 +8,20 @@ import com.epam.ta.reportportal.jooq.JPublic; import com.epam.ta.reportportal.jooq.Keys; import com.epam.ta.reportportal.jooq.tables.records.JUserCreationBidRecord; + import java.sql.Timestamp; import java.util.Arrays; import java.util.List; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Index; +import org.jooq.JSONB; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row6; +import org.jooq.Row7; import org.jooq.Schema; import org.jooq.Table; import org.jooq.TableField; @@ -39,7 +43,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JUserCreationBid extends TableImpl { - private static final long serialVersionUID = -1620298373; + private static final long serialVersionUID = 1009841154; /** * The reference instance of public.user_creation_bid @@ -70,22 +74,24 @@ public Class getRecordType() { public final TableField EMAIL = createField(DSL.name("email"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); /** - * The column public.user_creation_bid.default_project_id. + * The column public.user_creation_bid.role. */ - public final TableField DEFAULT_PROJECT_ID = - createField(DSL.name("default_project_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + public final TableField ROLE = createField(DSL.name("role"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); /** - * The column public.user_creation_bid.role. + * The column public.user_creation_bid.inviting_user_id. */ - public final TableField ROLE = - createField(DSL.name("role"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + public final TableField INVITING_USER_ID = createField(DSL.name("inviting_user_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); /** - * The column public.user_creation_bid.inviting_user_id. + * The column public.user_creation_bid.project_name. + */ + public final TableField PROJECT_NAME = createField(DSL.name("project_name"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false), this, ""); + + /** + * The column public.user_creation_bid.metadata. */ - public final TableField INVITING_USER_ID = - createField(DSL.name("inviting_user_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); + public final TableField METADATA = createField(DSL.name("metadata"), org.jooq.impl.SQLDataType.JSONB, this, ""); /** * Create a public.user_creation_bid table reference @@ -127,7 +133,7 @@ public Schema getSchema() { @Override public List getIndexes() { - return Arrays.asList(Indexes.USER_BID_PROJECT_IDX, Indexes.USER_CREATION_BID_PK); + return Arrays.asList(Indexes.USER_CREATION_BID_PK); } @Override @@ -142,14 +148,7 @@ public List> getKeys() { @Override public List> getReferences() { - return Arrays.>asList( - Keys.USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY, - Keys.USER_CREATION_BID__USER_CREATION_BID_INVITING_USER_ID_FKEY); - } - - public JProject project() { - return new JProject(this, - Keys.USER_CREATION_BID__USER_CREATION_BID_DEFAULT_PROJECT_ID_FKEY); + return Arrays.>asList(Keys.USER_CREATION_BID__USER_CREATION_BID_INVITING_USER_ID_FKEY); } public JUsers users() { @@ -183,11 +182,11 @@ public JUserCreationBid rename(Name name) { } // ------------------------------------------------------------------------- - // Row6 type methods + // Row7 type methods // ------------------------------------------------------------------------- @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JActivityRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JActivityRecord.java index 0898c7a66..55bd2f04f 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JActivityRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JActivityRecord.java @@ -5,8 +5,11 @@ import com.epam.ta.reportportal.jooq.tables.JActivity; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.JSONB; import org.jooq.Record1; @@ -25,541 +28,536 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JActivityRecord extends UpdatableRecordImpl implements - Record13 { - - private static final long serialVersionUID = 1950403337; - - /** - * Create a detached JActivityRecord - */ - public JActivityRecord() { - super(JActivity.ACTIVITY); - } - - /** - * Create a detached, initialised JActivityRecord - */ - public JActivityRecord(Long id, Timestamp createdAt, String action, String eventName, - String priority, Long objectId, String objectName, String objectType, Long projectId, - JSONB details, Long subjectId, String subjectName, String subjectType) { - super(JActivity.ACTIVITY); - - set(0, id); - set(1, createdAt); - set(2, action); - set(3, eventName); - set(4, priority); - set(5, objectId); - set(6, objectName); - set(7, objectType); - set(8, projectId); - set(9, details); - set(10, subjectId); - set(11, subjectName); - set(12, subjectType); - } - - /** - * Getter for public.activity.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.activity.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.activity.created_at. - */ - public Timestamp getCreatedAt() { - return (Timestamp) get(1); - } - - /** - * Setter for public.activity.created_at. - */ - public void setCreatedAt(Timestamp value) { - set(1, value); - } - - /** - * Getter for public.activity.action. - */ - public String getAction() { - return (String) get(2); - } - - /** - * Setter for public.activity.action. - */ - public void setAction(String value) { - set(2, value); - } - - /** - * Getter for public.activity.event_name. - */ - public String getEventName() { - return (String) get(3); - } - - /** - * Setter for public.activity.event_name. - */ - public void setEventName(String value) { - set(3, value); - } - - /** - * Getter for public.activity.priority. - */ - public String getPriority() { - return (String) get(4); - } - - /** - * Setter for public.activity.priority. - */ - public void setPriority(String value) { - set(4, value); - } - - /** - * Getter for public.activity.object_id. - */ - public Long getObjectId() { - return (Long) get(5); - } - - /** - * Setter for public.activity.object_id. - */ - public void setObjectId(Long value) { - set(5, value); - } - - /** - * Getter for public.activity.object_name. - */ - public String getObjectName() { - return (String) get(6); - } - - /** - * Setter for public.activity.object_name. - */ - public void setObjectName(String value) { - set(6, value); - } - - /** - * Getter for public.activity.object_type. - */ - public String getObjectType() { - return (String) get(7); - } - - /** - * Setter for public.activity.object_type. - */ - public void setObjectType(String value) { - set(7, value); - } - - /** - * Getter for public.activity.project_id. - */ - public Long getProjectId() { - return (Long) get(8); - } - - /** - * Setter for public.activity.project_id. - */ - public void setProjectId(Long value) { - set(8, value); - } - - /** - * Getter for public.activity.details. - */ - public JSONB getDetails() { - return (JSONB) get(9); - } - - /** - * Setter for public.activity.details. - */ - public void setDetails(JSONB value) { - set(9, value); - } - - /** - * Getter for public.activity.subject_id. - */ - public Long getSubjectId() { - return (Long) get(10); - } - - /** - * Setter for public.activity.subject_id. - */ - public void setSubjectId(Long value) { - set(10, value); - } - - /** - * Getter for public.activity.subject_name. - */ - public String getSubjectName() { - return (String) get(11); - } - - /** - * Setter for public.activity.subject_name. - */ - public void setSubjectName(String value) { - set(11, value); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Getter for public.activity.subject_type. - */ - public String getSubjectType() { - return (String) get(12); - } - - // ------------------------------------------------------------------------- - // Record13 type implementation - // ------------------------------------------------------------------------- - - /** - * Setter for public.activity.subject_type. - */ - public void setSubjectType(String value) { - set(12, value); - } - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row13 fieldsRow() { - return (Row13) super.fieldsRow(); - } - - @Override - public Row13 valuesRow() { - return (Row13) super.valuesRow(); - } - - @Override - public Field field1() { - return JActivity.ACTIVITY.ID; - } - - @Override - public Field field2() { - return JActivity.ACTIVITY.CREATED_AT; - } - - @Override - public Field field3() { - return JActivity.ACTIVITY.ACTION; - } - - @Override - public Field field4() { - return JActivity.ACTIVITY.EVENT_NAME; - } - - @Override - public Field field5() { - return JActivity.ACTIVITY.PRIORITY; - } - - @Override - public Field field6() { - return JActivity.ACTIVITY.OBJECT_ID; - } - - @Override - public Field field7() { - return JActivity.ACTIVITY.OBJECT_NAME; - } - - @Override - public Field field8() { - return JActivity.ACTIVITY.OBJECT_TYPE; - } - - @Override - public Field field9() { - return JActivity.ACTIVITY.PROJECT_ID; - } - - @Override - public Field field10() { - return JActivity.ACTIVITY.DETAILS; - } - - @Override - public Field field11() { - return JActivity.ACTIVITY.SUBJECT_ID; - } - - @Override - public Field field12() { - return JActivity.ACTIVITY.SUBJECT_NAME; - } - - @Override - public Field field13() { - return JActivity.ACTIVITY.SUBJECT_TYPE; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public Timestamp component2() { - return getCreatedAt(); - } - - @Override - public String component3() { - return getAction(); - } - - @Override - public String component4() { - return getEventName(); - } - - @Override - public String component5() { - return getPriority(); - } - - @Override - public Long component6() { - return getObjectId(); - } - - @Override - public String component7() { - return getObjectName(); - } - - @Override - public String component8() { - return getObjectType(); - } - - @Override - public Long component9() { - return getProjectId(); - } - - @Override - public JSONB component10() { - return getDetails(); - } - - @Override - public Long component11() { - return getSubjectId(); - } - - @Override - public String component12() { - return getSubjectName(); - } - - @Override - public String component13() { - return getSubjectType(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public Timestamp value2() { - return getCreatedAt(); - } - - @Override - public String value3() { - return getAction(); - } - - @Override - public String value4() { - return getEventName(); - } - - @Override - public String value5() { - return getPriority(); - } - - @Override - public Long value6() { - return getObjectId(); - } - - @Override - public String value7() { - return getObjectName(); - } - - @Override - public String value8() { - return getObjectType(); - } - - @Override - public Long value9() { - return getProjectId(); - } - - @Override - public JSONB value10() { - return getDetails(); - } - - @Override - public Long value11() { - return getSubjectId(); - } - - @Override - public String value12() { - return getSubjectName(); - } - - @Override - public String value13() { - return getSubjectType(); - } - - @Override - public JActivityRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JActivityRecord value2(Timestamp value) { - setCreatedAt(value); - return this; - } - - @Override - public JActivityRecord value3(String value) { - setAction(value); - return this; - } - - @Override - public JActivityRecord value4(String value) { - setEventName(value); - return this; - } - - @Override - public JActivityRecord value5(String value) { - setPriority(value); - return this; - } - - @Override - public JActivityRecord value6(Long value) { - setObjectId(value); - return this; - } - - @Override - public JActivityRecord value7(String value) { - setObjectName(value); - return this; - } - - @Override - public JActivityRecord value8(String value) { - setObjectType(value); - return this; - } - - @Override - public JActivityRecord value9(Long value) { - setProjectId(value); - return this; - } - - @Override - public JActivityRecord value10(JSONB value) { - setDetails(value); - return this; - } - - @Override - public JActivityRecord value11(Long value) { - setSubjectId(value); - return this; - } - - @Override - public JActivityRecord value12(String value) { - setSubjectName(value); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - @Override - public JActivityRecord value13(String value) { - setSubjectType(value); - return this; - } - - @Override - public JActivityRecord values(Long value1, Timestamp value2, String value3, String value4, - String value5, Long value6, String value7, String value8, Long value9, JSONB value10, - Long value11, String value12, String value13) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - value12(value12); - value13(value13); - return this; - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JActivityRecord extends UpdatableRecordImpl implements Record13 { + + private static final long serialVersionUID = 1950403337; + + /** + * Setter for public.activity.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.activity.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.activity.created_at. + */ + public void setCreatedAt(Timestamp value) { + set(1, value); + } + + /** + * Getter for public.activity.created_at. + */ + public Timestamp getCreatedAt() { + return (Timestamp) get(1); + } + + /** + * Setter for public.activity.action. + */ + public void setAction(String value) { + set(2, value); + } + + /** + * Getter for public.activity.action. + */ + public String getAction() { + return (String) get(2); + } + + /** + * Setter for public.activity.event_name. + */ + public void setEventName(String value) { + set(3, value); + } + + /** + * Getter for public.activity.event_name. + */ + public String getEventName() { + return (String) get(3); + } + + /** + * Setter for public.activity.priority. + */ + public void setPriority(String value) { + set(4, value); + } + + /** + * Getter for public.activity.priority. + */ + public String getPriority() { + return (String) get(4); + } + + /** + * Setter for public.activity.object_id. + */ + public void setObjectId(Long value) { + set(5, value); + } + + /** + * Getter for public.activity.object_id. + */ + public Long getObjectId() { + return (Long) get(5); + } + + /** + * Setter for public.activity.object_name. + */ + public void setObjectName(String value) { + set(6, value); + } + + /** + * Getter for public.activity.object_name. + */ + public String getObjectName() { + return (String) get(6); + } + + /** + * Setter for public.activity.object_type. + */ + public void setObjectType(String value) { + set(7, value); + } + + /** + * Getter for public.activity.object_type. + */ + public String getObjectType() { + return (String) get(7); + } + + /** + * Setter for public.activity.project_id. + */ + public void setProjectId(Long value) { + set(8, value); + } + + /** + * Getter for public.activity.project_id. + */ + public Long getProjectId() { + return (Long) get(8); + } + + /** + * Setter for public.activity.details. + */ + public void setDetails(JSONB value) { + set(9, value); + } + + /** + * Getter for public.activity.details. + */ + public JSONB getDetails() { + return (JSONB) get(9); + } + + /** + * Setter for public.activity.subject_id. + */ + public void setSubjectId(Long value) { + set(10, value); + } + + /** + * Getter for public.activity.subject_id. + */ + public Long getSubjectId() { + return (Long) get(10); + } + + /** + * Setter for public.activity.subject_name. + */ + public void setSubjectName(String value) { + set(11, value); + } + + /** + * Getter for public.activity.subject_name. + */ + public String getSubjectName() { + return (String) get(11); + } + + /** + * Setter for public.activity.subject_type. + */ + public void setSubjectType(String value) { + set(12, value); + } + + /** + * Getter for public.activity.subject_type. + */ + public String getSubjectType() { + return (String) get(12); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record13 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row13 fieldsRow() { + return (Row13) super.fieldsRow(); + } + + @Override + public Row13 valuesRow() { + return (Row13) super.valuesRow(); + } + + @Override + public Field field1() { + return JActivity.ACTIVITY.ID; + } + + @Override + public Field field2() { + return JActivity.ACTIVITY.CREATED_AT; + } + + @Override + public Field field3() { + return JActivity.ACTIVITY.ACTION; + } + + @Override + public Field field4() { + return JActivity.ACTIVITY.EVENT_NAME; + } + + @Override + public Field field5() { + return JActivity.ACTIVITY.PRIORITY; + } + + @Override + public Field field6() { + return JActivity.ACTIVITY.OBJECT_ID; + } + + @Override + public Field field7() { + return JActivity.ACTIVITY.OBJECT_NAME; + } + + @Override + public Field field8() { + return JActivity.ACTIVITY.OBJECT_TYPE; + } + + @Override + public Field field9() { + return JActivity.ACTIVITY.PROJECT_ID; + } + + @Override + public Field field10() { + return JActivity.ACTIVITY.DETAILS; + } + + @Override + public Field field11() { + return JActivity.ACTIVITY.SUBJECT_ID; + } + + @Override + public Field field12() { + return JActivity.ACTIVITY.SUBJECT_NAME; + } + + @Override + public Field field13() { + return JActivity.ACTIVITY.SUBJECT_TYPE; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Timestamp component2() { + return getCreatedAt(); + } + + @Override + public String component3() { + return getAction(); + } + + @Override + public String component4() { + return getEventName(); + } + + @Override + public String component5() { + return getPriority(); + } + + @Override + public Long component6() { + return getObjectId(); + } + + @Override + public String component7() { + return getObjectName(); + } + + @Override + public String component8() { + return getObjectType(); + } + + @Override + public Long component9() { + return getProjectId(); + } + + @Override + public JSONB component10() { + return getDetails(); + } + + @Override + public Long component11() { + return getSubjectId(); + } + + @Override + public String component12() { + return getSubjectName(); + } + + @Override + public String component13() { + return getSubjectType(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Timestamp value2() { + return getCreatedAt(); + } + + @Override + public String value3() { + return getAction(); + } + + @Override + public String value4() { + return getEventName(); + } + + @Override + public String value5() { + return getPriority(); + } + + @Override + public Long value6() { + return getObjectId(); + } + + @Override + public String value7() { + return getObjectName(); + } + + @Override + public String value8() { + return getObjectType(); + } + + @Override + public Long value9() { + return getProjectId(); + } + + @Override + public JSONB value10() { + return getDetails(); + } + + @Override + public Long value11() { + return getSubjectId(); + } + + @Override + public String value12() { + return getSubjectName(); + } + + @Override + public String value13() { + return getSubjectType(); + } + + @Override + public JActivityRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public JActivityRecord value2(Timestamp value) { + setCreatedAt(value); + return this; + } + + @Override + public JActivityRecord value3(String value) { + setAction(value); + return this; + } + + @Override + public JActivityRecord value4(String value) { + setEventName(value); + return this; + } + + @Override + public JActivityRecord value5(String value) { + setPriority(value); + return this; + } + + @Override + public JActivityRecord value6(Long value) { + setObjectId(value); + return this; + } + + @Override + public JActivityRecord value7(String value) { + setObjectName(value); + return this; + } + + @Override + public JActivityRecord value8(String value) { + setObjectType(value); + return this; + } + + @Override + public JActivityRecord value9(Long value) { + setProjectId(value); + return this; + } + + @Override + public JActivityRecord value10(JSONB value) { + setDetails(value); + return this; + } + + @Override + public JActivityRecord value11(Long value) { + setSubjectId(value); + return this; + } + + @Override + public JActivityRecord value12(String value) { + setSubjectName(value); + return this; + } + + @Override + public JActivityRecord value13(String value) { + setSubjectType(value); + return this; + } + + @Override + public JActivityRecord values(Long value1, Timestamp value2, String value3, String value4, String value5, Long value6, String value7, String value8, Long value9, JSONB value10, Long value11, String value12, String value13) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JActivityRecord + */ + public JActivityRecord() { + super(JActivity.ACTIVITY); + } + + /** + * Create a detached, initialised JActivityRecord + */ + public JActivityRecord(Long id, Timestamp createdAt, String action, String eventName, String priority, Long objectId, String objectName, String objectType, Long projectId, JSONB details, Long subjectId, String subjectName, String subjectType) { + super(JActivity.ACTIVITY); + + set(0, id); + set(1, createdAt); + set(2, action); + set(3, eventName); + set(4, priority); + set(5, objectId); + set(6, objectName); + set(7, objectType); + set(8, projectId); + set(9, details); + set(10, subjectId); + set(11, subjectName); + set(12, subjectType); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JApiKeysRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JApiKeysRecord.java index e29c4925c..1d1780f8a 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JApiKeysRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JApiKeysRecord.java @@ -5,9 +5,12 @@ import com.epam.ta.reportportal.jooq.tables.JApiKeys; + import java.sql.Date; import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; import org.jooq.Record1; import org.jooq.Record6; @@ -25,26 +28,17 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JApiKeysRecord extends UpdatableRecordImpl implements - Record6 { - - private static final long serialVersionUID = -24722664; - - /** - * Create a detached, initialised JApiKeysRecord - */ - public JApiKeysRecord(Long id, String name, String hash, Timestamp createdAt, Long userId, - Date lastUsedAt) { - super(JApiKeys.API_KEYS); - - set(0, id); - set(1, name); - set(2, hash); - set(3, createdAt); - set(4, userId); - set(5, lastUsedAt); - } +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JApiKeysRecord extends UpdatableRecordImpl implements Record6 { + + private static final long serialVersionUID = -24722664; + + /** + * Setter for public.api_keys.id. + */ + public void setId(Long value) { + set(0, value); + } /** * Getter for public.api_keys.id. @@ -95,63 +89,61 @@ public Timestamp getCreatedAt() { return (Timestamp) get(3); } - /** - * Setter for public.api_keys.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.api_keys.user_id. - */ - public Long getUserId() { - return (Long) get(4); - } - /** * Setter for public.api_keys.user_id. */ public void setUserId(Long value) { - set(4, value); - } - - /** - * Getter for public.api_keys.last_used_at. - */ - public Date getLastUsedAt() { - return (Date) get(5); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - /** - * Setter for public.api_keys.last_used_at. - */ - public void setLastUsedAt(Date value) { - set(5, value); - } - - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } + set(4, value); + } + + /** + * Getter for public.api_keys.user_id. + */ + public Long getUserId() { + return (Long) get(4); + } + + /** + * Setter for public.api_keys.last_used_at. + */ + public void setLastUsedAt(Date value) { + set(5, value); + } + + /** + * Getter for public.api_keys.last_used_at. + */ + public Date getLastUsedAt() { + return (Date) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return JApiKeys.API_KEYS.ID; + } @Override public Field field2() { @@ -163,91 +155,92 @@ public Field field3() { return JApiKeys.API_KEYS.HASH; } - @Override - public Field field1() { - return JApiKeys.API_KEYS.ID; - } - @Override public Field field4() { - return JApiKeys.API_KEYS.CREATED_AT; + return JApiKeys.API_KEYS.CREATED_AT; } - @Override - public Field field5() { - return JApiKeys.API_KEYS.USER_ID; - } + @Override + public Field field5() { + return JApiKeys.API_KEYS.USER_ID; + } - @Override - public Field field6() { - return JApiKeys.API_KEYS.LAST_USED_AT; - } + @Override + public Field field6() { + return JApiKeys.API_KEYS.LAST_USED_AT; + } - @Override - public Long component1() { - return getId(); - } + @Override + public Long component1() { + return getId(); + } - @Override - public String component2() { - return getName(); - } + @Override + public String component2() { + return getName(); + } - @Override - public String component3() { + @Override + public String component3() { return getHash(); } @Override public Timestamp component4() { - return getCreatedAt(); + return getCreatedAt(); } - @Override - public Long component5() { - return getUserId(); - } + @Override + public Long component5() { + return getUserId(); + } - @Override - public Date component6() { - return getLastUsedAt(); - } + @Override + public Date component6() { + return getLastUsedAt(); + } - @Override - public Long value1() { - return getId(); - } + @Override + public Long value1() { + return getId(); + } - @Override - public String value2() { - return getName(); - } + @Override + public String value2() { + return getName(); + } - @Override - public String value3() { + @Override + public String value3() { return getHash(); } @Override public Timestamp value4() { - return getCreatedAt(); + return getCreatedAt(); + } + + @Override + public Long value5() { + return getUserId(); } - @Override - public Long value5() { - return getUserId(); - } + @Override + public Date value6() { + return getLastUsedAt(); + } - @Override - public Date value6() { - return getLastUsedAt(); - } + @Override + public JApiKeysRecord value1(Long value) { + setId(value); + return this; + } - @Override - public JApiKeysRecord value1(Long value) { - setId(value); - return this; - } + @Override + public JApiKeysRecord value2(String value) { + setName(value); + return this; + } @Override public JApiKeysRecord value3(String value) { @@ -261,26 +254,31 @@ public JApiKeysRecord value4(Timestamp value) { return this; } - @Override - public JApiKeysRecord value2(String value) { - setName(value); - return this; + @Override + public JApiKeysRecord value5(Long value) { + setUserId(value); + return this; } - @Override - public JApiKeysRecord value5(Long value) { - setUserId(value); - return this; - } + @Override + public JApiKeysRecord value6(Date value) { + setLastUsedAt(value); + return this; + } - @Override - public JApiKeysRecord value6(Date value) { - setLastUsedAt(value); - return this; - } + @Override + public JApiKeysRecord values(Long value1, String value2, String value3, Timestamp value4, Long value5, Date value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } - // ------------------------------------------------------------------------- - // Constructors + // ------------------------------------------------------------------------- + // Constructors // ------------------------------------------------------------------------- /** @@ -290,15 +288,17 @@ public JApiKeysRecord() { super(JApiKeys.API_KEYS); } - @Override - public JApiKeysRecord values(Long value1, String value2, String value3, Timestamp value4, - Long value5, Date value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } + /** + * Create a detached, initialised JApiKeysRecord + */ + public JApiKeysRecord(Long id, String name, String hash, Timestamp createdAt, Long userId, Date lastUsedAt) { + super(JApiKeys.API_KEYS); + + set(0, id); + set(1, name); + set(2, hash); + set(3, createdAt); + set(4, userId); + set(5, lastUsedAt); + } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentRecord.java index 1b6ad3d29..3d47cac9f 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JAttachmentRecord.java @@ -12,8 +12,8 @@ import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record9; -import org.jooq.Row9; +import org.jooq.Record10; +import org.jooq.Row10; import org.jooq.impl.UpdatableRecordImpl; @@ -28,9 +28,9 @@ comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JAttachmentRecord extends UpdatableRecordImpl implements Record9 { +public class JAttachmentRecord extends UpdatableRecordImpl implements Record10 { - private static final long serialVersionUID = 171693268; + private static final long serialVersionUID = 583025152; /** * Setter for public.attachment.id. @@ -158,6 +158,20 @@ public Timestamp getCreationDate() { return (Timestamp) get(8); } + /** + * Setter for public.attachment.file_name. + */ + public void setFileName(String value) { + set(9, value); + } + + /** + * Getter for public.attachment.file_name. + */ + public String getFileName() { + return (String) get(9); + } + // ------------------------------------------------------------------------- // Primary key information // ------------------------------------------------------------------------- @@ -168,17 +182,17 @@ public Record1 key() { } // ------------------------------------------------------------------------- - // Record9 type implementation + // Record10 type implementation // ------------------------------------------------------------------------- @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); + public Row10 fieldsRow() { + return (Row10) super.fieldsRow(); } @Override - public Row9 valuesRow() { - return (Row9) super.valuesRow(); + public Row10 valuesRow() { + return (Row10) super.valuesRow(); } @Override @@ -226,6 +240,11 @@ public Field field9() { return JAttachment.ATTACHMENT.CREATION_DATE; } + @Override + public Field field10() { + return JAttachment.ATTACHMENT.FILE_NAME; + } + @Override public Long component1() { return getId(); @@ -271,6 +290,11 @@ public Timestamp component9() { return getCreationDate(); } + @Override + public String component10() { + return getFileName(); + } + @Override public Long value1() { return getId(); @@ -316,6 +340,11 @@ public Timestamp value9() { return getCreationDate(); } + @Override + public String value10() { + return getFileName(); + } + @Override public JAttachmentRecord value1(Long value) { setId(value); @@ -371,7 +400,13 @@ public JAttachmentRecord value9(Timestamp value) { } @Override - public JAttachmentRecord values(Long value1, String value2, String value3, String value4, Long value5, Long value6, Long value7, Long value8, Timestamp value9) { + public JAttachmentRecord value10(String value) { + setFileName(value); + return this; + } + + @Override + public JAttachmentRecord values(Long value1, String value2, String value3, String value4, Long value5, Long value6, Long value7, Long value8, Timestamp value9, String value10) { value1(value1); value2(value2); value3(value3); @@ -381,6 +416,7 @@ public JAttachmentRecord values(Long value1, String value2, String value3, Strin value7(value7); value8(value8); value9(value9); + value10(value10); return this; } @@ -398,7 +434,7 @@ public JAttachmentRecord() { /** * Create a detached, initialised JAttachmentRecord */ - public JAttachmentRecord(Long id, String fileId, String thumbnailId, String contentType, Long projectId, Long launchId, Long itemId, Long fileSize, Timestamp creationDate) { + public JAttachmentRecord(Long id, String fileId, String thumbnailId, String contentType, Long projectId, Long launchId, Long itemId, Long fileSize, Timestamp creationDate, String fileName) { super(JAttachment.ATTACHMENT); set(0, id); @@ -410,5 +446,6 @@ public JAttachmentRecord(Long id, String fileId, String thumbnailId, String cont set(6, itemId); set(7, fileSize); set(8, creationDate); + set(9, fileName); } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationAttributeRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationAttributeRecord.java deleted file mode 100644 index 6ea2d5c0c..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationAttributeRecord.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables.records; - - -import com.epam.ta.reportportal.jooq.tables.JOrganizationAttribute; - -import javax.annotation.processing.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record5; -import org.jooq.Row5; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JOrganizationAttributeRecord extends UpdatableRecordImpl implements Record5 { - - private static final long serialVersionUID = 2074289218; - - /** - * Setter for public.organization_attribute.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.organization_attribute.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.organization_attribute.key. - */ - public void setKey(String value) { - set(1, value); - } - - /** - * Getter for public.organization_attribute.key. - */ - public String getKey() { - return (String) get(1); - } - - /** - * Setter for public.organization_attribute.value. - */ - public void setValue(String value) { - set(2, value); - } - - /** - * Getter for public.organization_attribute.value. - */ - public String getValue() { - return (String) get(2); - } - - /** - * Setter for public.organization_attribute.system. - */ - public void setSystem(Boolean value) { - set(3, value); - } - - /** - * Getter for public.organization_attribute.system. - */ - public Boolean getSystem() { - return (Boolean) get(3); - } - - /** - * Setter for public.organization_attribute.organization_id. - */ - public void setOrganizationId(Long value) { - set(4, value); - } - - /** - * Getter for public.organization_attribute.organization_id. - */ - public Long getOrganizationId() { - return (Long) get(4); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } - - @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); - } - - @Override - public Field field1() { - return JOrganizationAttribute.ORGANIZATION_ATTRIBUTE.ID; - } - - @Override - public Field field2() { - return JOrganizationAttribute.ORGANIZATION_ATTRIBUTE.KEY; - } - - @Override - public Field field3() { - return JOrganizationAttribute.ORGANIZATION_ATTRIBUTE.VALUE; - } - - @Override - public Field field4() { - return JOrganizationAttribute.ORGANIZATION_ATTRIBUTE.SYSTEM; - } - - @Override - public Field field5() { - return JOrganizationAttribute.ORGANIZATION_ATTRIBUTE.ORGANIZATION_ID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getKey(); - } - - @Override - public String component3() { - return getValue(); - } - - @Override - public Boolean component4() { - return getSystem(); - } - - @Override - public Long component5() { - return getOrganizationId(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getKey(); - } - - @Override - public String value3() { - return getValue(); - } - - @Override - public Boolean value4() { - return getSystem(); - } - - @Override - public Long value5() { - return getOrganizationId(); - } - - @Override - public JOrganizationAttributeRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JOrganizationAttributeRecord value2(String value) { - setKey(value); - return this; - } - - @Override - public JOrganizationAttributeRecord value3(String value) { - setValue(value); - return this; - } - - @Override - public JOrganizationAttributeRecord value4(Boolean value) { - setSystem(value); - return this; - } - - @Override - public JOrganizationAttributeRecord value5(Long value) { - setOrganizationId(value); - return this; - } - - @Override - public JOrganizationAttributeRecord values(Long value1, String value2, String value3, Boolean value4, Long value5) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JOrganizationAttributeRecord - */ - public JOrganizationAttributeRecord() { - super(JOrganizationAttribute.ORGANIZATION_ATTRIBUTE); - } - - /** - * Create a detached, initialised JOrganizationAttributeRecord - */ - public JOrganizationAttributeRecord(Long id, String key, String value, Boolean system, Long organizationId) { - super(JOrganizationAttribute.ORGANIZATION_ATTRIBUTE); - - set(0, id); - set(1, key); - set(2, value); - set(3, system); - set(4, organizationId); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationRecord.java deleted file mode 100644 index b69e5cc2a..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOrganizationRecord.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables.records; - - -import com.epam.ta.reportportal.jooq.tables.JOrganization; - -import javax.annotation.processing.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record2; -import org.jooq.Row2; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JOrganizationRecord extends UpdatableRecordImpl implements Record2 { - - private static final long serialVersionUID = 1068958172; - - /** - * Setter for public.organization.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.organization.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.organization.name. - */ - public void setName(String value) { - set(1, value); - } - - /** - * Getter for public.organization.name. - */ - public String getName() { - return (String) get(1); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return JOrganization.ORGANIZATION.ID; - } - - @Override - public Field field2() { - return JOrganization.ORGANIZATION.NAME; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public JOrganizationRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JOrganizationRecord value2(String value) { - setName(value); - return this; - } - - @Override - public JOrganizationRecord values(Long value1, String value2) { - value1(value1); - value2(value2); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JOrganizationRecord - */ - public JOrganizationRecord() { - super(JOrganization.ORGANIZATION); - } - - /** - * Create a detached, initialised JOrganizationRecord - */ - public JOrganizationRecord(Long id, String name) { - super(JOrganization.ORGANIZATION); - - set(0, id); - set(1, name); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JSenderCaseRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JSenderCaseRecord.java index e1d873276..c77a6b663 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JSenderCaseRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JSenderCaseRecord.java @@ -11,8 +11,8 @@ import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record5; -import org.jooq.Row5; +import org.jooq.Record6; +import org.jooq.Row6; import org.jooq.impl.UpdatableRecordImpl; @@ -27,9 +27,9 @@ comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JSenderCaseRecord extends UpdatableRecordImpl implements Record5 { +public class JSenderCaseRecord extends UpdatableRecordImpl implements Record6 { - private static final long serialVersionUID = -492653770; + private static final long serialVersionUID = 1738483780; /** * Setter for public.sender_case.id. @@ -101,6 +101,20 @@ public JLogicalOperatorEnum getAttributesOperator() { return (JLogicalOperatorEnum) get(4); } + /** + * Setter for public.sender_case.rule_name. + */ + public void setRuleName(String value) { + set(5, value); + } + + /** + * Getter for public.sender_case.rule_name. + */ + public String getRuleName() { + return (String) get(5); + } + // ------------------------------------------------------------------------- // Primary key information // ------------------------------------------------------------------------- @@ -111,17 +125,17 @@ public Record1 key() { } // ------------------------------------------------------------------------- - // Record5 type implementation + // Record6 type implementation // ------------------------------------------------------------------------- @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); } @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); + public Row6 valuesRow() { + return (Row6) super.valuesRow(); } @Override @@ -149,6 +163,11 @@ public Field field5() { return JSenderCase.SENDER_CASE.ATTRIBUTES_OPERATOR; } + @Override + public Field field6() { + return JSenderCase.SENDER_CASE.RULE_NAME; + } + @Override public Long component1() { return getId(); @@ -174,6 +193,11 @@ public JLogicalOperatorEnum component5() { return getAttributesOperator(); } + @Override + public String component6() { + return getRuleName(); + } + @Override public Long value1() { return getId(); @@ -199,6 +223,11 @@ public JLogicalOperatorEnum value5() { return getAttributesOperator(); } + @Override + public String value6() { + return getRuleName(); + } + @Override public JSenderCaseRecord value1(Long value) { setId(value); @@ -230,12 +259,19 @@ public JSenderCaseRecord value5(JLogicalOperatorEnum value) { } @Override - public JSenderCaseRecord values(Long value1, String value2, Long value3, Boolean value4, JLogicalOperatorEnum value5) { + public JSenderCaseRecord value6(String value) { + setRuleName(value); + return this; + } + + @Override + public JSenderCaseRecord values(Long value1, String value2, Long value3, Boolean value4, JLogicalOperatorEnum value5, String value6) { value1(value1); value2(value2); value3(value3); value4(value4); value5(value5); + value6(value6); return this; } @@ -253,7 +289,7 @@ public JSenderCaseRecord() { /** * Create a detached, initialised JSenderCaseRecord */ - public JSenderCaseRecord(Long id, String sendCase, Long projectId, Boolean enabled, JLogicalOperatorEnum attributesOperator) { + public JSenderCaseRecord(Long id, String sendCase, Long projectId, Boolean enabled, JLogicalOperatorEnum attributesOperator, String ruleName) { super(JSenderCase.SENDER_CASE); set(0, id); @@ -261,5 +297,6 @@ public JSenderCaseRecord(Long id, String sendCase, Long projectId, Boolean enabl set(2, projectId); set(3, enabled); set(4, attributesOperator); + set(5, ruleName); } } diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserCreationBidRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserCreationBidRecord.java index 81ab9a98f..4e588ac7e 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserCreationBidRecord.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JUserCreationBidRecord.java @@ -5,12 +5,16 @@ import com.epam.ta.reportportal.jooq.tables.JUserCreationBid; + import java.sql.Timestamp; + import javax.annotation.processing.Generated; + import org.jooq.Field; +import org.jooq.JSONB; import org.jooq.Record1; -import org.jooq.Record6; -import org.jooq.Row6; +import org.jooq.Record7; +import org.jooq.Row7; import org.jooq.impl.UpdatableRecordImpl; @@ -24,11 +28,10 @@ }, comments = "This class is generated by jOOQ" ) -@SuppressWarnings({"all", "unchecked", "rawtypes"}) -public class JUserCreationBidRecord extends UpdatableRecordImpl - implements Record6 { +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JUserCreationBidRecord extends UpdatableRecordImpl implements Record7 { - private static final long serialVersionUID = 2025644286; + private static final long serialVersionUID = -997614482; /** * Setter for public.user_creation_bid.uuid. @@ -73,45 +76,59 @@ public String getEmail() { } /** - * Setter for public.user_creation_bid.default_project_id. + * Setter for public.user_creation_bid.role. */ - public void setDefaultProjectId(Long value) { + public void setRole(String value) { set(3, value); } /** - * Getter for public.user_creation_bid.default_project_id. + * Getter for public.user_creation_bid.role. */ - public Long getDefaultProjectId() { - return (Long) get(3); + public String getRole() { + return (String) get(3); } /** - * Setter for public.user_creation_bid.role. + * Setter for public.user_creation_bid.inviting_user_id. */ - public void setRole(String value) { + public void setInvitingUserId(Long value) { set(4, value); } /** - * Getter for public.user_creation_bid.role. + * Getter for public.user_creation_bid.inviting_user_id. */ - public String getRole() { - return (String) get(4); + public Long getInvitingUserId() { + return (Long) get(4); } /** - * Setter for public.user_creation_bid.inviting_user_id. + * Setter for public.user_creation_bid.project_name. */ - public void setInvitingUserId(Long value) { + public void setProjectName(String value) { set(5, value); } /** - * Getter for public.user_creation_bid.inviting_user_id. + * Getter for public.user_creation_bid.project_name. */ - public Long getInvitingUserId() { - return (Long) get(5); + public String getProjectName() { + return (String) get(5); + } + + /** + * Setter for public.user_creation_bid.metadata. + */ + public void setMetadata(JSONB value) { + set(6, value); + } + + /** + * Getter for public.user_creation_bid.metadata. + */ + public JSONB getMetadata() { + return (JSONB) get(6); } // ------------------------------------------------------------------------- @@ -124,17 +141,17 @@ public Record1 key() { } // ------------------------------------------------------------------------- - // Record6 type implementation + // Record7 type implementation // ------------------------------------------------------------------------- @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); } @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); + public Row7 valuesRow() { + return (Row7) super.valuesRow(); } @Override @@ -153,18 +170,23 @@ public Field field3() { } @Override - public Field field4() { - return JUserCreationBid.USER_CREATION_BID.DEFAULT_PROJECT_ID; + public Field field4() { + return JUserCreationBid.USER_CREATION_BID.ROLE; + } + + @Override + public Field field5() { + return JUserCreationBid.USER_CREATION_BID.INVITING_USER_ID; } @Override - public Field field5() { - return JUserCreationBid.USER_CREATION_BID.ROLE; + public Field field6() { + return JUserCreationBid.USER_CREATION_BID.PROJECT_NAME; } @Override - public Field field6() { - return JUserCreationBid.USER_CREATION_BID.INVITING_USER_ID; + public Field field7() { + return JUserCreationBid.USER_CREATION_BID.METADATA; } @Override @@ -183,18 +205,23 @@ public String component3() { } @Override - public Long component4() { - return getDefaultProjectId(); + public String component4() { + return getRole(); + } + + @Override + public Long component5() { + return getInvitingUserId(); } @Override - public String component5() { - return getRole(); + public String component6() { + return getProjectName(); } @Override - public Long component6() { - return getInvitingUserId(); + public JSONB component7() { + return getMetadata(); } @Override @@ -213,18 +240,23 @@ public String value3() { } @Override - public Long value4() { - return getDefaultProjectId(); + public String value4() { + return getRole(); + } + + @Override + public Long value5() { + return getInvitingUserId(); } @Override - public String value5() { - return getRole(); + public String value6() { + return getProjectName(); } @Override - public Long value6() { - return getInvitingUserId(); + public JSONB value7() { + return getMetadata(); } @Override @@ -246,32 +278,38 @@ public JUserCreationBidRecord value3(String value) { } @Override - public JUserCreationBidRecord value4(Long value) { - setDefaultProjectId(value); + public JUserCreationBidRecord value4(String value) { + setRole(value); + return this; + } + + @Override + public JUserCreationBidRecord value5(Long value) { + setInvitingUserId(value); return this; } @Override - public JUserCreationBidRecord value5(String value) { - setRole(value); + public JUserCreationBidRecord value6(String value) { + setProjectName(value); return this; } @Override - public JUserCreationBidRecord value6(Long value) { - setInvitingUserId(value); + public JUserCreationBidRecord value7(JSONB value) { + setMetadata(value); return this; } @Override - public JUserCreationBidRecord values(String value1, Timestamp value2, String value3, - Long value4, String value5, Long value6) { + public JUserCreationBidRecord values(String value1, Timestamp value2, String value3, String value4, Long value5, String value6, JSONB value7) { value1(value1); value2(value2); value3(value3); value4(value4); value5(value5); value6(value6); + value7(value7); return this; } @@ -289,15 +327,15 @@ public JUserCreationBidRecord() { /** * Create a detached, initialised JUserCreationBidRecord */ - public JUserCreationBidRecord(String uuid, Timestamp lastModified, String email, - Long defaultProjectId, String role, Long invitingUserId) { + public JUserCreationBidRecord(String uuid, Timestamp lastModified, String email, String role, Long invitingUserId, String projectName, JSONB metadata) { super(JUserCreationBid.USER_CREATION_BID); set(0, uuid); set(1, lastModified); set(2, email); - set(3, defaultProjectId); - set(4, role); - set(5, invitingUserId); + set(3, role); + set(4, invitingUserId); + set(5, projectName); + set(6, metadata); } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/DashboardRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/DashboardRepositoryTest.java index 1a12dcf70..83908afa2 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/DashboardRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/DashboardRepositoryTest.java @@ -17,7 +17,6 @@ package com.epam.ta.reportportal.dao; import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_NAME; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -34,12 +33,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.jdbc.Sql; -import java.util.List; -import java.util.Optional; - -import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID; -import static org.junit.jupiter.api.Assertions.*; - /** * @author Ihar Kahadouski */ @@ -90,17 +83,10 @@ void findAllByProjectId() { } @Test - void existsByNameAndOwnerAndProjectId() { - assertTrue( - repository.existsByNameAndOwnerAndProjectId("test admin dashboard", "superadmin", 1L)); - assertFalse(repository.existsByNameAndOwnerAndProjectId("not exist name", "default", 2L)); + void shouldFindBySpecifiedNameAndProjectId() { + assertTrue(repository.existsByNameAndProjectId("test admin dashboard", 1L)); } - @Test - void shouldFindBySpecifiedNameAndProjectId() { - assertTrue(repository.existsByNameAndProjectId("test admin dashboard", 1L)); - } - private Filter buildDefaultFilter() { return Filter.builder() .withTarget(Dashboard.class) From cc041fe2fef21ea13154bce18f6e2283864e626d Mon Sep 17 00:00:00 2001 From: Ivan_Kustau Date: Mon, 11 Sep 2023 18:16:58 +0300 Subject: [PATCH 072/110] EPMRPP-86221 || Resolve conflicts --- .../dao/AttachmentRepository.java | 2 ++ .../entity/user/UserCreationBid.java | 36 +++++++++++++------ .../ta/reportportal/filesystem/DataStore.java | 5 +++ .../filesystem/LocalDataStore.java | 20 +++++++++++ .../distributed/s3/S3DataStore.java | 19 ++++++++++ .../dao/UserCreationBidRepositoryTest.java | 12 +++---- .../db/fill/user-bid/user-bid-fill.sql | 21 ++++++++--- 7 files changed, 94 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java index dc5418a53..2fd297db8 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java @@ -34,6 +34,8 @@ public interface AttachmentRepository extends ReportPortalRepository findAllByLaunchIdIn(Collection launchIds); + void deleteAllByProjectId(Long projectId); + @Modifying @Query(value = "UPDATE attachment SET launch_id = :newLaunchId WHERE project_id = :projectId AND launch_id = :currentLaunchId", nativeQuery = true) void updateLaunchIdByProjectIdAndLaunchId(@Param("projectId") Long projectId, diff --git a/src/main/java/com/epam/ta/reportportal/entity/user/UserCreationBid.java b/src/main/java/com/epam/ta/reportportal/entity/user/UserCreationBid.java index dbf274e29..20ea9c292 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/user/UserCreationBid.java +++ b/src/main/java/com/epam/ta/reportportal/entity/user/UserCreationBid.java @@ -16,8 +16,10 @@ package com.epam.ta.reportportal.entity.user; +import com.epam.ta.reportportal.entity.Metadata; import com.epam.ta.reportportal.entity.Modifiable; -import com.epam.ta.reportportal.entity.project.Project; +import org.hibernate.annotations.Type; +import org.hibernate.annotations.TypeDef; import java.io.Serializable; import java.util.Date; import javax.persistence.CascadeType; @@ -36,6 +38,7 @@ */ @Entity @Table(name = "user_creation_bid") +@TypeDef(name = "json", typeClass = Metadata.class) @EntityListeners(AuditingEntityListener.class) public class UserCreationBid implements Serializable, Modifiable { @@ -50,9 +53,8 @@ public class UserCreationBid implements Serializable, Modifiable { @Column(name = "email") private String email; - @OneToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "default_project_id") - private Project defaultProject; + @Column(name = "project_name") + private String projectName; @Column(name = "role") private String role; @@ -61,6 +63,10 @@ public class UserCreationBid implements Serializable, Modifiable { @JoinColumn(name = "inviting_user_id") private User invitingUser; + @Type(type = "json") + @Column(name = "metadata") + private Metadata metadata; + public String getUuid() { return uuid; } @@ -77,12 +83,12 @@ public void setEmail(String email) { this.email = email; } - public Project getDefaultProject() { - return defaultProject; + public String getProjectName() { + return projectName; } - public void setDefaultProject(Project defaultProject) { - this.defaultProject = defaultProject; + public void setProjectName(String projectName) { + this.projectName = projectName; } public String getRole() { @@ -98,9 +104,17 @@ public Date getLastModified() { return lastModified; } - public void setLastModified(Date lastModified) { - this.lastModified = lastModified; - } + public void setLastModified(Date lastModified) { + this.lastModified = lastModified; + } + + public Metadata getMetadata() { + return metadata; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } public User getInvitingUser() { return invitingUser; diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java index 9e6c7e2d8..3d4b88ee0 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java @@ -17,6 +17,7 @@ package com.epam.ta.reportportal.filesystem; import java.io.InputStream; +import java.util.List; /** * @author Dzianis_Shybeka @@ -28,4 +29,8 @@ public interface DataStore { InputStream load(String filePath); void delete(String filePath); + + void deleteAll(List filePaths, String bucketName); + + void deleteContainer(String bucketName); } diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java index 96d935a0f..88e2b70a0 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java @@ -24,6 +24,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; +import java.util.List; import java.util.Objects; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -93,4 +94,23 @@ public void delete(String filePath) { throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to delete file"); } } + + @Override + public void deleteAll(List filePaths, String bucketName) { + for (String filePath : filePaths) { + delete(filePath); + } + } + + @Override + public void deleteContainer(String bucketName) { + try { + Files.deleteIfExists(Paths.get(bucketName)); + } catch (IOException e) { + + logger.error("Unable to delete bucket '{}'", bucketName, e); + + throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to delete file"); + } + } } diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java index e9f7e2e49..1ac0d896f 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java @@ -25,6 +25,7 @@ import java.io.InputStream; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.List; import java.util.Objects; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; @@ -126,6 +127,24 @@ public void delete(String filePath) { } } + @Override + public void deleteAll(List filePaths, String bucketName) { + if (!featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { + blobStore.removeBlobs(bucketPrefix + bucketName + bucketPostfix, filePaths); + } else { + blobStore.removeBlobs(bucketName, filePaths); + } + } + + @Override + public void deleteContainer(String bucketName) { + if (!featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { + blobStore.deleteContainer(bucketPrefix + bucketName + bucketPostfix); + } else { + blobStore.deleteContainer(bucketName); + } + } + private S3File getS3File(String filePath) { if (featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { return new S3File(defaultBucketName, filePath); diff --git a/src/test/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryTest.java index f6013f388..9abc4686d 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/UserCreationBidRepositoryTest.java @@ -54,14 +54,14 @@ void findByUuidAndType() { assertEquals("superadminemail@domain.com", userBid.get().getEmail(), "Incorrect email"); } - @Test - void shouldNotFindByUuidAndTypeWhenTypeNotMatched() { - final String adminUuid = "0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb"; + @Test + void shouldNotFindByUuidAndTypeWhenTypeNotMatched() { + final String adminUuid = "0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb"; - final Optional userBid = repository.findByUuidAndType(adminUuid, UNKNOWN_TYPE); + final Optional userBid = repository.findByUuidAndType(adminUuid, UNKNOWN_TYPE); - assertTrue(userBid.isEmpty(), "User bid should not exists"); - } + assertTrue(userBid.isEmpty(), "User bid should not exists"); + } @Test void expireBidsOlderThan() { diff --git a/src/test/resources/db/fill/user-bid/user-bid-fill.sql b/src/test/resources/db/fill/user-bid/user-bid-fill.sql index 35d86a1b2..1dca22b1c 100644 --- a/src/test/resources/db/fill/user-bid/user-bid-fill.sql +++ b/src/test/resources/db/fill/user-bid/user-bid-fill.sql @@ -1,4 +1,17 @@ -insert into user_creation_bid(uuid, last_modified, email, default_project_id, role, inviting_user_id) -values ('0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb', now(), 'superadminemail@domain.com', 1, 'PROJECT_MANAGER', 1), - ('6cb0ce2a-e974-44d8-ae78-d86baa38c356', now() - interval '30 day', 'defaultemail@domain.com', 2, 'PROJECT_MANAGER', 1), - ('04ff29db-88ef-44c9-9273-5701f6969127', now() - interval '1 day', 'defaultemail@domain.com', 1, 'MEMBER', 1); \ No newline at end of file +INSERT INTO user_creation_bid(uuid, last_modified, email, project_name, role, metadata, inviting_user_id) +VALUES ('0647cf8f-02e3-4acd-ba3e-f74ec9d2c5cb', now(), 'superadminemail@domain.com', 1, 'PROJECT_MANAGER', '{ + "metadata": { + "type": "internal" + } +}', 1), + + ('6cb0ce2a-e974-44d8-ae78-d86baa38c356', now() - interval '30 day', 'defaultemail@domain.com', 2, 'PROJECT_MANAGER', '{ + "metadata": { + "type": "internal" + } + }', 1), + ('04ff29db-88ef-44c9-9273-5701f6969127', now() - interval '1 day', 'defaultemail@domain.com', 1, 'MEMBER', '{ + "metadata": { + "type": "internal" + } + }', 1); \ No newline at end of file From b5093310eee1dc08c2ca465a5fec456242bf480b Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Mon, 18 Sep 2023 12:22:42 +0300 Subject: [PATCH 073/110] EPMRPP-86221 || Resolve conflicts --- .../binary/AttachmentBinaryDataService.java | 2 ++ .../ta/reportportal/binary/DataStoreService.java | 5 +++++ .../impl/AttachmentBinaryDataServiceImpl.java | 13 +++++++++++++ .../binary/impl/CommonDataStoreService.java | 13 +++++++++++++ .../ta/reportportal/dao/AttachmentRepository.java | 2 ++ 5 files changed, 35 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/binary/AttachmentBinaryDataService.java b/src/main/java/com/epam/ta/reportportal/binary/AttachmentBinaryDataService.java index 70fe65624..b4721620c 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/AttachmentBinaryDataService.java +++ b/src/main/java/com/epam/ta/reportportal/binary/AttachmentBinaryDataService.java @@ -38,4 +38,6 @@ Optional saveAttachment(AttachmentMetaInfo attachmentMetaInf BinaryData load(Long fileId, ReportPortalUser.ProjectDetails projectDetails); void delete(String fileId); + + void deleteAllByProjectId(Long projectId); } diff --git a/src/main/java/com/epam/ta/reportportal/binary/DataStoreService.java b/src/main/java/com/epam/ta/reportportal/binary/DataStoreService.java index 62512258e..0f80ba167 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/DataStoreService.java +++ b/src/main/java/com/epam/ta/reportportal/binary/DataStoreService.java @@ -17,6 +17,7 @@ package com.epam.ta.reportportal.binary; import java.io.InputStream; +import java.util.List; import java.util.Optional; /** @@ -30,5 +31,9 @@ public interface DataStoreService { void delete(String fileId); + void deleteAll(List fileIds, String bucketName); + + void deleteContainer(String containerName); + Optional load(String fileId); } diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java b/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java index 56bd17cab..fce4c7b96 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java @@ -44,6 +44,7 @@ import java.nio.file.Paths; import java.util.Optional; import java.util.function.Predicate; +import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -199,6 +200,18 @@ public void delete(String fileId) { } } + @Override + public void deleteAllByProjectId(Long projectId) { + if (featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { + dataStoreService.deleteAll( + attachmentRepository.findAllByProjectId(projectId).stream().map(Attachment::getFileId) + .collect(Collectors.toList()), projectId.toString()); + } else { + dataStoreService.deleteContainer(projectId.toString()); + } + attachmentRepository.deleteAllByProjectId(projectId); + } + private String resolveContentType(String contentType, ByteArrayOutputStream outputStream) throws IOException { if (isContentTypePresent(contentType)) { diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreService.java b/src/main/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreService.java index 03c5ef21e..8bb4058ef 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreService.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreService.java @@ -22,7 +22,9 @@ import com.epam.ta.reportportal.filesystem.DataEncoder; import com.epam.ta.reportportal.filesystem.DataStore; import java.io.InputStream; +import java.util.List; import java.util.Optional; +import java.util.stream.Collectors; /** * @author Ihar Kahadouski @@ -51,6 +53,17 @@ public void delete(String fileId) { dataStore.delete(dataEncoder.decode(fileId)); } + @Override + public void deleteAll(List fileIds, String bucketName) { + dataStore.deleteAll( + fileIds.stream().map(dataEncoder::decode).collect(Collectors.toList()), bucketName); + } + + @Override + public void deleteContainer(String containerName) { + dataStore.deleteContainer(containerName); + } + @Override public Optional load(String fileId) { return ofNullable(dataStore.load(dataEncoder.decode(fileId))); diff --git a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java index 2fd297db8..9b02a4f1f 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java +++ b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepository.java @@ -32,6 +32,8 @@ public interface AttachmentRepository extends ReportPortalRepository findByFileId(String fileId); + List findAllByProjectId(Long projectId); + List findAllByLaunchIdIn(Collection launchIds); void deleteAllByProjectId(Long projectId); From 2a352a86bf7f01145b786100c45de6fb8efdd139 Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Mon, 18 Sep 2023 16:59:45 +0300 Subject: [PATCH 074/110] EPMRPP-86221 || Fix test --- project-properties.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project-properties.gradle b/project-properties.gradle index c398e93ec..7b330b6b9 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -77,7 +77,7 @@ project.ext { (migrationsUrl + '/migrations/73_api_key_last_used_at.up.sql') : 'V073__api_key_last_used_at.sql', (migrationsUrl + '/migrations/74_sender_case_rule_name.up.sql') : 'V074__sender_case_rule_name.sql', (migrationsUrl + '/migrations/77_user_bid_extension.up.sql') : 'V077__user_bid_extension.sql', - (migrationsUrl + '/migrations/78_email_server_documentation _link.up.sql') : 'V078__email_server_documentation _link.sql', + (migrationsUrl + '/migrations/78_email_server_documentation_link.up.sql') : 'V078__email_server_documentation _link.sql', (migrationsUrl + '/migrations/79_drop_redundant_index.up.sql') : 'V079__drop_redundant_index.sql', ] From 567e79c2549aca217c0e3989500c417a1a840874 Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Mon, 18 Sep 2023 17:00:05 +0300 Subject: [PATCH 075/110] EPMRPP-86221 || Fix test --- project-properties.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project-properties.gradle b/project-properties.gradle index 7b330b6b9..45edef439 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -77,7 +77,7 @@ project.ext { (migrationsUrl + '/migrations/73_api_key_last_used_at.up.sql') : 'V073__api_key_last_used_at.sql', (migrationsUrl + '/migrations/74_sender_case_rule_name.up.sql') : 'V074__sender_case_rule_name.sql', (migrationsUrl + '/migrations/77_user_bid_extension.up.sql') : 'V077__user_bid_extension.sql', - (migrationsUrl + '/migrations/78_email_server_documentation_link.up.sql') : 'V078__email_server_documentation _link.sql', + (migrationsUrl + '/migrations/78_email_server_documentation_link.up.sql') : 'V078__email_server_documentation_link.sql', (migrationsUrl + '/migrations/79_drop_redundant_index.up.sql') : 'V079__drop_redundant_index.sql', ] From 98aa9f1ad1b35c7625119cec224d6cdf9e7cf7aa Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Tue, 19 Sep 2023 09:48:02 +0300 Subject: [PATCH 076/110] EPMRPP-86221 || Delete duplicate script --- project-properties.gradle | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/project-properties.gradle b/project-properties.gradle index 45edef439..f67d3868e 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -74,11 +74,10 @@ project.ext { (migrationsUrl + '/migrations/69_replace_activity_table.up.sql') : 'V069__replace_activity_table.sql', (migrationsUrl + '/migrations/71_user_bid_inviting_user_id.up.sql') : 'V071__user_bid_inviting_user_id.sql', (migrationsUrl + '/migrations/72_add_attachment_name.up.sql') : 'V072__add_attachment_name.sql', - (migrationsUrl + '/migrations/73_api_key_last_used_at.up.sql') : 'V073__api_key_last_used_at.sql', - (migrationsUrl + '/migrations/74_sender_case_rule_name.up.sql') : 'V074__sender_case_rule_name.sql', - (migrationsUrl + '/migrations/77_user_bid_extension.up.sql') : 'V077__user_bid_extension.sql', - (migrationsUrl + '/migrations/78_email_server_documentation_link.up.sql') : 'V078__email_server_documentation_link.sql', - (migrationsUrl + '/migrations/79_drop_redundant_index.up.sql') : 'V079__drop_redundant_index.sql', + (migrationsUrl + '/migrations/73_sender_case_rule_name.up.sql') : 'V073__sender_case_rule_name.sql', + (migrationsUrl + '/migrations/76_user_bid_extension.up.sql') : 'V076__user_bid_extension.sql', + (migrationsUrl + '/migrations/77_email_server_documentation_link.up.sql') : 'V077__email_server_documentation_link.sql', + (migrationsUrl + '/migrations/78_drop_redundant_index.up.sql') : 'V078__drop_redundant_index.sql', ] excludeTests = [ From 8e4b91cc929905442e27eec74bddadb70a3e58de Mon Sep 17 00:00:00 2001 From: Siarhei Hrabko <45555481+grabsefx@users.noreply.github.com> Date: Fri, 22 Sep 2023 13:15:14 +0300 Subject: [PATCH 077/110] EPMRPP-86363 exclude system attributes in launches table widget (#932) * EPMRPP-86363 exclude system attributes in launches table widget * EPMRPP-86363 fixed check-style comments --- .../dao/WidgetContentRepositoryImpl.java | 3 ++- .../dao/WidgetContentRepositoryTest.java | 25 +++++++++++++++++++ .../V001005__widget_content_init.sql | 4 +-- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java index 7290d5e73..3481ddabf 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java @@ -1227,7 +1227,8 @@ private SelectSeekStepN buildLaunchesTableQuery(Collection contentFields = buildLaunchesTableContentFields(); + + List launchStatisticsContents = widgetContentRepository.launchesTableStatistics( + filter, + contentFields, + sort, + 3 + ); + assertNotNull(launchStatisticsContents); + assertEquals(3, launchStatisticsContents.size()); + + launchStatisticsContents.forEach(content -> { + assertTrue(CollectionUtils.isNotEmpty(content.getAttributes())); + boolean isSystemAttributePresent = content.getAttributes() + .stream() + .anyMatch(attribute -> attribute.getValue().equals("true_system_attr")); + assertFalse(isSystemAttributePresent); + }); + } + @Test void activityStatistics() { Filter filter = buildDefaultActivityFilter(1L); diff --git a/src/test/resources/db/migration/V001005__widget_content_init.sql b/src/test/resources/db/migration/V001005__widget_content_init.sql index d840d13ba..e36ee9da1 100644 --- a/src/test/resources/db/migration/V001005__widget_content_init.sql +++ b/src/test/resources/db/migration/V001005__widget_content_init.sql @@ -1,8 +1,7 @@ create or replace function widget_content_init() RETURNS VOID as $$ -DECLARE - launch1 BIGINT; + DECLARE launch1 BIGINT; DECLARE launch2 BIGINT; DECLARE launch3 BIGINT; DECLARE launch4 BIGINT; @@ -98,6 +97,7 @@ BEGIN INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '1.3.2', null, launch2, false); INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '1.9.1', null, launch3, false); INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '3', null, launch4, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', 'true_system_attr', null, launch1, true); INSERT INTO public.ticket (id, ticket_id, submitter, submit_date, bts_url, bts_project, url) From 236cb31818c4916d2ca8d77f34e62a93af116fcf Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Mon, 25 Sep 2023 15:45:10 +0300 Subject: [PATCH 078/110] Fix test --- .../ta/reportportal/entity/integration/IntegrationType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationType.java b/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationType.java index f737d0859..34cf624c6 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationType.java +++ b/src/main/java/com/epam/ta/reportportal/entity/integration/IntegrationType.java @@ -56,7 +56,7 @@ public class IntegrationType implements Serializable { @Enumerated(EnumType.STRING) @Type(type = "pqsql_enum") - @Column(name = "auth_flow", nullable = false) + @Column(name = "auth_flow") private IntegrationAuthFlowEnum authFlow; @CreatedDate From c5ce21984dfae0ccd935f731fa49e5a77cf2413f Mon Sep 17 00:00:00 2001 From: siarhei_hrabko Date: Fri, 22 Sep 2023 13:15:14 +0300 Subject: [PATCH 079/110] EPMRPP-86363 exclude system attributes in launches table widget --- .../dao/WidgetContentRepositoryImpl.java | 3 ++- .../dao/WidgetContentRepositoryTest.java | 25 +++++++++++++++++++ .../V001005__widget_content_init.sql | 4 +-- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java index 54d7b0306..092217e85 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java @@ -1345,7 +1345,8 @@ private SelectSeekStepN buildLaunchesTableQuery( .join(USERS) .on(LAUNCH.USER_ID.eq(USERS.ID)); if (isAttributePresent) { - select = select.leftJoin(ITEM_ATTRIBUTE).on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)); + select = select.leftJoin(ITEM_ATTRIBUTE).on(LAUNCH.ID.eq(ITEM_ATTRIBUTE.LAUNCH_ID)) + .and(ITEM_ATTRIBUTE.SYSTEM.isFalse()); } return select.orderBy( diff --git a/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java index b89489c92..53aa25035 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java @@ -86,6 +86,7 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import org.apache.commons.collections4.CollectionUtils; import org.assertj.core.util.Lists; import org.jooq.DSLContext; import org.jooq.Record; @@ -491,6 +492,30 @@ void launchesTableStatistics() { } + @Test + void launchesTableStatisticsIgnoreSystemAttributes() { + Filter filter = buildDefaultFilter(1L); + Sort sort = Sort.by(List.of(new Sort.Order(Sort.Direction.ASC, CRITERIA_START_TIME))); + List contentFields = buildLaunchesTableContentFields(); + + List launchStatisticsContents = widgetContentRepository.launchesTableStatistics( + filter, + contentFields, + sort, + 3 + ); + assertNotNull(launchStatisticsContents); + assertEquals(3, launchStatisticsContents.size()); + + launchStatisticsContents.forEach(content -> { + assertTrue(CollectionUtils.isNotEmpty(content.getAttributes())); + boolean isSystemAttributePresent = content.getAttributes() + .stream() + .anyMatch(attribute -> attribute.getValue().equals("true_system_attr")); + assertFalse(isSystemAttributePresent); + }); + } + @Test void activityStatistics() { Filter filter = buildDefaultActivityFilter(1L); diff --git a/src/test/resources/db/migration/V001005__widget_content_init.sql b/src/test/resources/db/migration/V001005__widget_content_init.sql index bc1c2d3f8..69c5c685c 100644 --- a/src/test/resources/db/migration/V001005__widget_content_init.sql +++ b/src/test/resources/db/migration/V001005__widget_content_init.sql @@ -1,8 +1,7 @@ CREATE OR REPLACE FUNCTION widget_content_init() RETURNS VOID AS $$ -DECLARE - launch1 BIGINT; + DECLARE launch1 BIGINT; DECLARE launch2 BIGINT; DECLARE launch3 BIGINT; DECLARE launch4 BIGINT; @@ -98,6 +97,7 @@ BEGIN INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '1.3.2', null, launch2, false); INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '1.9.1', null, launch3, false); INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', '3', null, launch4, false); + INSERT INTO item_attribute ("key", "value", item_id, launch_id, system) VALUES ('build', 'true_system_attr', null, launch1, true); INSERT INTO public.ticket (id, ticket_id, submitter, submit_date, bts_url, bts_project, url) From dc4130d42424682037e376bd5406f98a537abb26 Mon Sep 17 00:00:00 2001 From: PeeAyBee Date: Wed, 27 Sep 2023 11:10:37 +0300 Subject: [PATCH 080/110] EPMRPP-86348 || Add new query for check already matched items (#933) * EPMRPP-86348 || Add new query for check already matched items * EPMRPP-86348 || Fix unit tests --- .../dao/PatternTemplateRepositoryCustom.java | 1 + .../dao/PatternTemplateRepositoryCustomImpl.java | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustom.java index a0d0fe798..f5b488fcd 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustom.java @@ -25,4 +25,5 @@ public interface PatternTemplateRepositoryCustom { int saveInBatch(List patternTemplateTestItemPojos); + List findMatchedItemIdsIn(Long patternId, List itemId); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustomImpl.java index d50151092..d18f90ede 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/PatternTemplateRepositoryCustomImpl.java @@ -45,6 +45,14 @@ public int saveInBatch(List patternTemplateTestItem patternTemplateTestItems.forEach( pojo -> columns.values(pojo.getPatternTemplateId(), pojo.getTestItemId())); - return columns.execute(); + return columns.onConflictDoNothing().execute(); + } + + @Override + public List findMatchedItemIdsIn(Long patternId, List itemId) { + return dslContext.select(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID) + .from(PATTERN_TEMPLATE_TEST_ITEM).where(PATTERN_TEMPLATE_TEST_ITEM.PATTERN_ID.eq(patternId)) + .and(PATTERN_TEMPLATE_TEST_ITEM.ITEM_ID.in(itemId)) + .fetchInto(Long.class); } } From 25b288089dbe862462db3f00eb2af9fc254d98a0 Mon Sep 17 00:00:00 2001 From: APiankouski <109206864+APiankouski@users.noreply.github.com> Date: Thu, 28 Sep 2023 13:00:15 +0300 Subject: [PATCH 081/110] EPMRPP-84226 || Remove access token logic from the code (#934) --- .../dao/OAuth2AccessTokenRepository.java | 63 --- .../entity/user/StoredAccessToken.java | 135 ------ .../epam/ta/reportportal/jooq/Indexes.java | 7 - .../epam/ta/reportportal/jooq/JPublic.java | 10 +- .../com/epam/ta/reportportal/jooq/Keys.java | 10 - .../epam/ta/reportportal/jooq/Sequences.java | 5 - .../com/epam/ta/reportportal/jooq/Tables.java | 6 - .../jooq/tables/JOauthAccessToken.java | 206 --------- .../records/JOauthAccessTokenRecord.java | 412 ------------------ 9 files changed, 1 insertion(+), 853 deletions(-) delete mode 100644 src/main/java/com/epam/ta/reportportal/dao/OAuth2AccessTokenRepository.java delete mode 100644 src/main/java/com/epam/ta/reportportal/entity/user/StoredAccessToken.java delete mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthAccessToken.java delete mode 100644 src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthAccessTokenRecord.java diff --git a/src/main/java/com/epam/ta/reportportal/dao/OAuth2AccessTokenRepository.java b/src/main/java/com/epam/ta/reportportal/dao/OAuth2AccessTokenRepository.java deleted file mode 100644 index 0b8cea35c..000000000 --- a/src/main/java/com/epam/ta/reportportal/dao/OAuth2AccessTokenRepository.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.dao; - -import com.epam.ta.reportportal.entity.user.StoredAccessToken; -import java.util.stream.Stream; -import org.springframework.stereotype.Repository; - -/** - * @author Pavel Bortnik - */ -@Repository -public interface OAuth2AccessTokenRepository extends - ReportPortalRepository { - - /** - * Find entity by token id - * - * @param tokenId token id - * @return {@link StoredAccessToken} - */ - StoredAccessToken findByTokenId(String tokenId); - - /** - * Find entity by authentication id - * - * @param authenticationId authentication id - * @return {@link StoredAccessToken} - */ - StoredAccessToken findByAuthenticationId(String authenticationId); - - /** - * Find entity by client id and username - * - * @param clientId Client id - * @param userName Username - * @return Stream of {@link StoredAccessToken} - */ - Stream findByClientIdAndUserName(String clientId, String userName); - - /** - * Find entity by client id - * - * @param clientId client id - * @return Stream of {@link StoredAccessToken} - */ - Stream findByClientId(String clientId); - -} diff --git a/src/main/java/com/epam/ta/reportportal/entity/user/StoredAccessToken.java b/src/main/java/com/epam/ta/reportportal/entity/user/StoredAccessToken.java deleted file mode 100644 index 5dbb2101b..000000000 --- a/src/main/java/com/epam/ta/reportportal/entity/user/StoredAccessToken.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 2019 EPAM Systems - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.epam.ta.reportportal.entity.user; - -import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; - -/** - * @author Pavel Bortnik - */ -@Entity -@Table(name = "oauth_access_token", schema = "public") -public class StoredAccessToken implements Serializable { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id") - private Long id; - - @Column(name = "token_id") - private String tokenId; - - @Column(name = "token") - private byte[] token; - - @Column(name = "authentication_id") - private String authenticationId; - - @Column(name = "username") - private String userName; - - @Column(name = "user_id") - private Long userId; - - @Column(name = "client_id") - private String clientId; - - @Column(name = "authentication") - private byte[] authentication; - - @Column(name = "refresh_token") - private String refreshToken; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getTokenId() { - return tokenId; - } - - public void setTokenId(String tokenId) { - this.tokenId = tokenId; - } - - public byte[] getToken() { - return token; - } - - public void setToken(byte[] token) { - this.token = token; - } - - public String getAuthenticationId() { - return authenticationId; - } - - public void setAuthenticationId(String authenticationId) { - this.authenticationId = authenticationId; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public Long getUserId() { - return userId; - } - - public void setUserId(Long userId) { - this.userId = userId; - } - - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public byte[] getAuthentication() { - return authentication; - } - - public void setAuthentication(byte[] authentication) { - this.authentication = authentication; - } - - public String getRefreshToken() { - return refreshToken; - } - - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java b/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java index fdafa0494..d40580b1c 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Indexes.java @@ -30,7 +30,6 @@ import com.epam.ta.reportportal.jooq.tables.JLaunchNames; import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; import com.epam.ta.reportportal.jooq.tables.JLog; -import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; @@ -150,9 +149,6 @@ public class Indexes { public static final Index LOG_PROJECT_ID_LOG_TIME_IDX = Indexes0.LOG_PROJECT_ID_LOG_TIME_IDX; public static final Index LOG_PROJECT_IDX = Indexes0.LOG_PROJECT_IDX; public static final Index LOG_TI_IDX = Indexes0.LOG_TI_IDX; - public static final Index OAUTH_ACCESS_TOKEN_PKEY = Indexes0.OAUTH_ACCESS_TOKEN_PKEY; - public static final Index OAUTH_AT_USER_IDX = Indexes0.OAUTH_AT_USER_IDX; - public static final Index USERS_ACCESS_TOKEN_UNIQUE = Indexes0.USERS_ACCESS_TOKEN_UNIQUE; public static final Index OAUTH_REGISTRATION_CLIENT_ID_KEY = Indexes0.OAUTH_REGISTRATION_CLIENT_ID_KEY; public static final Index OAUTH_REGISTRATION_PKEY = Indexes0.OAUTH_REGISTRATION_PKEY; public static final Index OAUTH_REGISTRATION_RESTRICTION_PK = Indexes0.OAUTH_REGISTRATION_RESTRICTION_PK; @@ -285,9 +281,6 @@ private static class Indexes0 { public static Index LOG_PROJECT_ID_LOG_TIME_IDX = Internal.createIndex("log_project_id_log_time_idx", JLog.LOG, new OrderField[] { JLog.LOG.PROJECT_ID, JLog.LOG.LOG_TIME }, false); public static Index LOG_PROJECT_IDX = Internal.createIndex("log_project_idx", JLog.LOG, new OrderField[] { JLog.LOG.PROJECT_ID }, false); public static Index LOG_TI_IDX = Internal.createIndex("log_ti_idx", JLog.LOG, new OrderField[] { JLog.LOG.ITEM_ID }, false); - public static Index OAUTH_ACCESS_TOKEN_PKEY = Internal.createIndex("oauth_access_token_pkey", JOauthAccessToken.OAUTH_ACCESS_TOKEN, new OrderField[] { JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID }, true); - public static Index OAUTH_AT_USER_IDX = Internal.createIndex("oauth_at_user_idx", JOauthAccessToken.OAUTH_ACCESS_TOKEN, new OrderField[] { JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID }, false); - public static Index USERS_ACCESS_TOKEN_UNIQUE = Internal.createIndex("users_access_token_unique", JOauthAccessToken.OAUTH_ACCESS_TOKEN, new OrderField[] { JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN_ID, JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID }, true); public static Index OAUTH_REGISTRATION_CLIENT_ID_KEY = Internal.createIndex("oauth_registration_client_id_key", JOauthRegistration.OAUTH_REGISTRATION, new OrderField[] { JOauthRegistration.OAUTH_REGISTRATION.CLIENT_ID }, true); public static Index OAUTH_REGISTRATION_PKEY = Internal.createIndex("oauth_registration_pkey", JOauthRegistration.OAUTH_REGISTRATION, new OrderField[] { JOauthRegistration.OAUTH_REGISTRATION.ID }, true); public static Index OAUTH_REGISTRATION_RESTRICTION_PK = Internal.createIndex("oauth_registration_restriction_pk", JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, new OrderField[] { JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID }, true); diff --git a/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java b/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java index 077841828..8ec2de1f5 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/JPublic.java @@ -30,7 +30,6 @@ import com.epam.ta.reportportal.jooq.tables.JLaunchNames; import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; import com.epam.ta.reportportal.jooq.tables.JLog; -import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; @@ -89,7 +88,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class JPublic extends SchemaImpl { - private static final long serialVersionUID = -962528853; + private static final long serialVersionUID = -1176761935; /** * The reference instance of public @@ -226,11 +225,6 @@ public class JPublic extends SchemaImpl { */ public final JLog LOG = com.epam.ta.reportportal.jooq.tables.JLog.LOG; - /** - * The table public.oauth_access_token. - */ - public final JOauthAccessToken OAUTH_ACCESS_TOKEN = com.epam.ta.reportportal.jooq.tables.JOauthAccessToken.OAUTH_ACCESS_TOKEN; - /** * The table public.oauth_registration. */ @@ -430,7 +424,6 @@ private final List> getSequences0() { Sequences.LAUNCH_ID_SEQ, Sequences.LAUNCH_NUMBER_ID_SEQ, Sequences.LOG_ID_SEQ, - Sequences.OAUTH_ACCESS_TOKEN_ID_SEQ, Sequences.OAUTH_REGISTRATION_RESTRICTION_ID_SEQ, Sequences.OAUTH_REGISTRATION_SCOPE_ID_SEQ, Sequences.ONBOARDING_ID_SEQ, @@ -486,7 +479,6 @@ private final List> getTables0() { JLaunchNames.LAUNCH_NAMES, JLaunchNumber.LAUNCH_NUMBER, JLog.LOG, - JOauthAccessToken.OAUTH_ACCESS_TOKEN, JOauthRegistration.OAUTH_REGISTRATION, JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Keys.java b/src/main/java/com/epam/ta/reportportal/jooq/Keys.java index 957e0b257..266024928 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/Keys.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Keys.java @@ -30,7 +30,6 @@ import com.epam.ta.reportportal.jooq.tables.JLaunchNames; import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; import com.epam.ta.reportportal.jooq.tables.JLog; -import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; @@ -84,7 +83,6 @@ import com.epam.ta.reportportal.jooq.tables.records.JLaunchNumberRecord; import com.epam.ta.reportportal.jooq.tables.records.JLaunchRecord; import com.epam.ta.reportportal.jooq.tables.records.JLogRecord; -import com.epam.ta.reportportal.jooq.tables.records.JOauthAccessTokenRecord; import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationRecord; import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationRestrictionRecord; import com.epam.ta.reportportal.jooq.tables.records.JOauthRegistrationScopeRecord; @@ -155,7 +153,6 @@ public class Keys { public static final Identity IDENTITY_LAUNCH_ATTRIBUTE_RULES = Identities0.IDENTITY_LAUNCH_ATTRIBUTE_RULES; public static final Identity IDENTITY_LAUNCH_NUMBER = Identities0.IDENTITY_LAUNCH_NUMBER; public static final Identity IDENTITY_LOG = Identities0.IDENTITY_LOG; - public static final Identity IDENTITY_OAUTH_ACCESS_TOKEN = Identities0.IDENTITY_OAUTH_ACCESS_TOKEN; public static final Identity IDENTITY_OAUTH_REGISTRATION_RESTRICTION = Identities0.IDENTITY_OAUTH_REGISTRATION_RESTRICTION; public static final Identity IDENTITY_OAUTH_REGISTRATION_SCOPE = Identities0.IDENTITY_OAUTH_REGISTRATION_SCOPE; public static final Identity IDENTITY_ONBOARDING = Identities0.IDENTITY_ONBOARDING; @@ -209,8 +206,6 @@ public class Keys { public static final UniqueKey LAUNCH_NUMBER_PK = UniqueKeys0.LAUNCH_NUMBER_PK; public static final UniqueKey UNQ_PROJECT_NAME = UniqueKeys0.UNQ_PROJECT_NAME; public static final UniqueKey LOG_PK = UniqueKeys0.LOG_PK; - public static final UniqueKey OAUTH_ACCESS_TOKEN_PKEY = UniqueKeys0.OAUTH_ACCESS_TOKEN_PKEY; - public static final UniqueKey USERS_ACCESS_TOKEN_UNIQUE = UniqueKeys0.USERS_ACCESS_TOKEN_UNIQUE; public static final UniqueKey OAUTH_REGISTRATION_PKEY = UniqueKeys0.OAUTH_REGISTRATION_PKEY; public static final UniqueKey OAUTH_REGISTRATION_CLIENT_ID_KEY = UniqueKeys0.OAUTH_REGISTRATION_CLIENT_ID_KEY; public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_PK = UniqueKeys0.OAUTH_REGISTRATION_RESTRICTION_PK; @@ -284,7 +279,6 @@ public class Keys { public static final ForeignKey LOG__LOG_ITEM_ID_FKEY = ForeignKeys0.LOG__LOG_ITEM_ID_FKEY; public static final ForeignKey LOG__LOG_LAUNCH_ID_FKEY = ForeignKeys0.LOG__LOG_LAUNCH_ID_FKEY; public static final ForeignKey LOG__LOG_ATTACHMENT_ID_FKEY = ForeignKeys0.LOG__LOG_ATTACHMENT_ID_FKEY; - public static final ForeignKey OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY = ForeignKeys0.OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY; public static final ForeignKey OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY = ForeignKeys0.OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY; public static final ForeignKey OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY = ForeignKeys0.OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY; public static final ForeignKey OWNED_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY = ForeignKeys0.OWNED_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY; @@ -334,7 +328,6 @@ private static class Identities0 { public static Identity IDENTITY_LAUNCH_ATTRIBUTE_RULES = Internal.createIdentity(JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES, JLaunchAttributeRules.LAUNCH_ATTRIBUTE_RULES.ID); public static Identity IDENTITY_LAUNCH_NUMBER = Internal.createIdentity(JLaunchNumber.LAUNCH_NUMBER, JLaunchNumber.LAUNCH_NUMBER.ID); public static Identity IDENTITY_LOG = Internal.createIdentity(JLog.LOG, JLog.LOG.ID); - public static Identity IDENTITY_OAUTH_ACCESS_TOKEN = Internal.createIdentity(JOauthAccessToken.OAUTH_ACCESS_TOKEN, JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID); public static Identity IDENTITY_OAUTH_REGISTRATION_RESTRICTION = Internal.createIdentity(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID); public static Identity IDENTITY_OAUTH_REGISTRATION_SCOPE = Internal.createIdentity(JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.ID); public static Identity IDENTITY_ONBOARDING = Internal.createIdentity(JOnboarding.ONBOARDING, JOnboarding.ONBOARDING.ID); @@ -386,8 +379,6 @@ private static class UniqueKeys0 { public static final UniqueKey LAUNCH_NUMBER_PK = Internal.createUniqueKey(JLaunchNumber.LAUNCH_NUMBER, "launch_number_pk", JLaunchNumber.LAUNCH_NUMBER.ID); public static final UniqueKey UNQ_PROJECT_NAME = Internal.createUniqueKey(JLaunchNumber.LAUNCH_NUMBER, "unq_project_name", JLaunchNumber.LAUNCH_NUMBER.PROJECT_ID, JLaunchNumber.LAUNCH_NUMBER.LAUNCH_NAME); public static final UniqueKey LOG_PK = Internal.createUniqueKey(JLog.LOG, "log_pk", JLog.LOG.ID); - public static final UniqueKey OAUTH_ACCESS_TOKEN_PKEY = Internal.createUniqueKey(JOauthAccessToken.OAUTH_ACCESS_TOKEN, "oauth_access_token_pkey", JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID); - public static final UniqueKey USERS_ACCESS_TOKEN_UNIQUE = Internal.createUniqueKey(JOauthAccessToken.OAUTH_ACCESS_TOKEN, "users_access_token_unique", JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN_ID, JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID); public static final UniqueKey OAUTH_REGISTRATION_PKEY = Internal.createUniqueKey(JOauthRegistration.OAUTH_REGISTRATION, "oauth_registration_pkey", JOauthRegistration.OAUTH_REGISTRATION.ID); public static final UniqueKey OAUTH_REGISTRATION_CLIENT_ID_KEY = Internal.createUniqueKey(JOauthRegistration.OAUTH_REGISTRATION, "oauth_registration_client_id_key", JOauthRegistration.OAUTH_REGISTRATION.CLIENT_ID); public static final UniqueKey OAUTH_REGISTRATION_RESTRICTION_PK = Internal.createUniqueKey(JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, "oauth_registration_restriction_pk", JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.ID); @@ -459,7 +450,6 @@ private static class ForeignKeys0 { public static final ForeignKey LOG__LOG_ITEM_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.TEST_ITEM_PK, JLog.LOG, "log__log_item_id_fkey", JLog.LOG.ITEM_ID); public static final ForeignKey LOG__LOG_LAUNCH_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.LAUNCH_PK, JLog.LOG, "log__log_launch_id_fkey", JLog.LOG.LAUNCH_ID); public static final ForeignKey LOG__LOG_ATTACHMENT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.ATTACHMENT_PK, JLog.LOG, "log__log_attachment_id_fkey", JLog.LOG.ATTACHMENT_ID); - public static final ForeignKey OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.USERS_PK, JOauthAccessToken.OAUTH_ACCESS_TOKEN, "oauth_access_token__oauth_access_token_user_id_fkey", JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID); public static final ForeignKey OAUTH_REGISTRATION_RESTRICTION__OAUTH_REGISTRATION_RESTRICTION_OAUTH_REGISTRATION_FK_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.OAUTH_REGISTRATION_PKEY, JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION, "oauth_registration_restriction__oauth_registration_restriction_oauth_registration_fk_fkey", JOauthRegistrationRestriction.OAUTH_REGISTRATION_RESTRICTION.OAUTH_REGISTRATION_FK); public static final ForeignKey OAUTH_REGISTRATION_SCOPE__OAUTH_REGISTRATION_SCOPE_OAUTH_REGISTRATION_FK_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.OAUTH_REGISTRATION_PKEY, JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE, "oauth_registration_scope__oauth_registration_scope_oauth_registration_fk_fkey", JOauthRegistrationScope.OAUTH_REGISTRATION_SCOPE.OAUTH_REGISTRATION_FK); public static final ForeignKey OWNED_ENTITY__SHAREABLE_ENTITY_PROJECT_ID_FKEY = Internal.createForeignKey(com.epam.ta.reportportal.jooq.Keys.PROJECT_PK, JOwnedEntity.OWNED_ENTITY, "owned_entity__shareable_entity_project_id_fkey", JOwnedEntity.OWNED_ENTITY.PROJECT_ID); diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java b/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java index 9633442ab..b1c0fc0aa 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Sequences.java @@ -103,11 +103,6 @@ public class Sequences { */ public static final Sequence LOG_ID_SEQ = new SequenceImpl("log_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - /** - * The sequence public.oauth_access_token_id_seq - */ - public static final Sequence OAUTH_ACCESS_TOKEN_ID_SEQ = new SequenceImpl("oauth_access_token_id_seq", JPublic.PUBLIC, org.jooq.impl.SQLDataType.BIGINT.nullable(false)); - /** * The sequence public.oauth_registration_restriction_id_seq */ diff --git a/src/main/java/com/epam/ta/reportportal/jooq/Tables.java b/src/main/java/com/epam/ta/reportportal/jooq/Tables.java index c334ebfbd..ab133d143 100644 --- a/src/main/java/com/epam/ta/reportportal/jooq/Tables.java +++ b/src/main/java/com/epam/ta/reportportal/jooq/Tables.java @@ -30,7 +30,6 @@ import com.epam.ta.reportportal.jooq.tables.JLaunchNames; import com.epam.ta.reportportal.jooq.tables.JLaunchNumber; import com.epam.ta.reportportal.jooq.tables.JLog; -import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; import com.epam.ta.reportportal.jooq.tables.JOauthRegistration; import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationRestriction; import com.epam.ta.reportportal.jooq.tables.JOauthRegistrationScope; @@ -211,11 +210,6 @@ public class Tables { */ public static final JLog LOG = JLog.LOG; - /** - * The table public.oauth_access_token. - */ - public static final JOauthAccessToken OAUTH_ACCESS_TOKEN = JOauthAccessToken.OAUTH_ACCESS_TOKEN; - /** * The table public.oauth_registration. */ diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthAccessToken.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthAccessToken.java deleted file mode 100644 index 3153ca63c..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/JOauthAccessToken.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables; - - -import com.epam.ta.reportportal.jooq.Indexes; -import com.epam.ta.reportportal.jooq.JPublic; -import com.epam.ta.reportportal.jooq.Keys; -import com.epam.ta.reportportal.jooq.tables.records.JOauthAccessTokenRecord; - -import java.util.Arrays; -import java.util.List; - -import javax.annotation.processing.Generated; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Identity; -import org.jooq.Index; -import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Row9; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.UniqueKey; -import org.jooq.impl.DSL; -import org.jooq.impl.TableImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JOauthAccessToken extends TableImpl { - - private static final long serialVersionUID = -1465585063; - - /** - * The reference instance of public.oauth_access_token - */ - public static final JOauthAccessToken OAUTH_ACCESS_TOKEN = new JOauthAccessToken(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return JOauthAccessTokenRecord.class; - } - - /** - * The column public.oauth_access_token.id. - */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('oauth_access_token_id_seq'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, ""); - - /** - * The column public.oauth_access_token.token_id. - */ - public final TableField TOKEN_ID = createField(DSL.name("token_id"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - - /** - * The column public.oauth_access_token.token. - */ - public final TableField TOKEN = createField(DSL.name("token"), org.jooq.impl.SQLDataType.BLOB, this, ""); - - /** - * The column public.oauth_access_token.authentication_id. - */ - public final TableField AUTHENTICATION_ID = createField(DSL.name("authentication_id"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - - /** - * The column public.oauth_access_token.username. - */ - public final TableField USERNAME = createField(DSL.name("username"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - - /** - * The column public.oauth_access_token.user_id. - */ - public final TableField USER_ID = createField(DSL.name("user_id"), org.jooq.impl.SQLDataType.BIGINT, this, ""); - - /** - * The column public.oauth_access_token.client_id. - */ - public final TableField CLIENT_ID = createField(DSL.name("client_id"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - - /** - * The column public.oauth_access_token.authentication. - */ - public final TableField AUTHENTICATION = createField(DSL.name("authentication"), org.jooq.impl.SQLDataType.BLOB, this, ""); - - /** - * The column public.oauth_access_token.refresh_token. - */ - public final TableField REFRESH_TOKEN = createField(DSL.name("refresh_token"), org.jooq.impl.SQLDataType.VARCHAR(255), this, ""); - - /** - * Create a public.oauth_access_token table reference - */ - public JOauthAccessToken() { - this(DSL.name("oauth_access_token"), null); - } - - /** - * Create an aliased public.oauth_access_token table reference - */ - public JOauthAccessToken(String alias) { - this(DSL.name(alias), OAUTH_ACCESS_TOKEN); - } - - /** - * Create an aliased public.oauth_access_token table reference - */ - public JOauthAccessToken(Name alias) { - this(alias, OAUTH_ACCESS_TOKEN); - } - - private JOauthAccessToken(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private JOauthAccessToken(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment("")); - } - - public JOauthAccessToken(Table child, ForeignKey key) { - super(child, key, OAUTH_ACCESS_TOKEN); - } - - @Override - public Schema getSchema() { - return JPublic.PUBLIC; - } - - @Override - public List getIndexes() { - return Arrays.asList(Indexes.OAUTH_ACCESS_TOKEN_PKEY, Indexes.OAUTH_AT_USER_IDX, Indexes.USERS_ACCESS_TOKEN_UNIQUE); - } - - @Override - public Identity getIdentity() { - return Keys.IDENTITY_OAUTH_ACCESS_TOKEN; - } - - @Override - public UniqueKey getPrimaryKey() { - return Keys.OAUTH_ACCESS_TOKEN_PKEY; - } - - @Override - public List> getKeys() { - return Arrays.>asList(Keys.OAUTH_ACCESS_TOKEN_PKEY, Keys.USERS_ACCESS_TOKEN_UNIQUE); - } - - @Override - public List> getReferences() { - return Arrays.>asList(Keys.OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY); - } - - public JUsers users() { - return new JUsers(this, Keys.OAUTH_ACCESS_TOKEN__OAUTH_ACCESS_TOKEN_USER_ID_FKEY); - } - - @Override - public JOauthAccessToken as(String alias) { - return new JOauthAccessToken(DSL.name(alias), this); - } - - @Override - public JOauthAccessToken as(Name alias) { - return new JOauthAccessToken(alias, this); - } - - /** - * Rename this table - */ - @Override - public JOauthAccessToken rename(String name) { - return new JOauthAccessToken(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public JOauthAccessToken rename(Name name) { - return new JOauthAccessToken(name, null); - } - - // ------------------------------------------------------------------------- - // Row9 type methods - // ------------------------------------------------------------------------- - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } -} diff --git a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthAccessTokenRecord.java b/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthAccessTokenRecord.java deleted file mode 100644 index 6ed08ed2d..000000000 --- a/src/main/java/com/epam/ta/reportportal/jooq/tables/records/JOauthAccessTokenRecord.java +++ /dev/null @@ -1,412 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package com.epam.ta.reportportal.jooq.tables.records; - - -import com.epam.ta.reportportal.jooq.tables.JOauthAccessToken; - -import javax.annotation.processing.Generated; - -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Record9; -import org.jooq.Row9; -import org.jooq.impl.UpdatableRecordImpl; - - -/** - * This class is generated by jOOQ. - */ -@Generated( - value = { - "http://www.jooq.org", - "jOOQ version:3.12.4" - }, - comments = "This class is generated by jOOQ" -) -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JOauthAccessTokenRecord extends UpdatableRecordImpl implements Record9 { - - private static final long serialVersionUID = 1312835184; - - /** - * Setter for public.oauth_access_token.id. - */ - public void setId(Long value) { - set(0, value); - } - - /** - * Getter for public.oauth_access_token.id. - */ - public Long getId() { - return (Long) get(0); - } - - /** - * Setter for public.oauth_access_token.token_id. - */ - public void setTokenId(String value) { - set(1, value); - } - - /** - * Getter for public.oauth_access_token.token_id. - */ - public String getTokenId() { - return (String) get(1); - } - - /** - * Setter for public.oauth_access_token.token. - */ - public void setToken(byte... value) { - set(2, value); - } - - /** - * Getter for public.oauth_access_token.token. - */ - public byte[] getToken() { - return (byte[]) get(2); - } - - /** - * Setter for public.oauth_access_token.authentication_id. - */ - public void setAuthenticationId(String value) { - set(3, value); - } - - /** - * Getter for public.oauth_access_token.authentication_id. - */ - public String getAuthenticationId() { - return (String) get(3); - } - - /** - * Setter for public.oauth_access_token.username. - */ - public void setUsername(String value) { - set(4, value); - } - - /** - * Getter for public.oauth_access_token.username. - */ - public String getUsername() { - return (String) get(4); - } - - /** - * Setter for public.oauth_access_token.user_id. - */ - public void setUserId(Long value) { - set(5, value); - } - - /** - * Getter for public.oauth_access_token.user_id. - */ - public Long getUserId() { - return (Long) get(5); - } - - /** - * Setter for public.oauth_access_token.client_id. - */ - public void setClientId(String value) { - set(6, value); - } - - /** - * Getter for public.oauth_access_token.client_id. - */ - public String getClientId() { - return (String) get(6); - } - - /** - * Setter for public.oauth_access_token.authentication. - */ - public void setAuthentication(byte... value) { - set(7, value); - } - - /** - * Getter for public.oauth_access_token.authentication. - */ - public byte[] getAuthentication() { - return (byte[]) get(7); - } - - /** - * Setter for public.oauth_access_token.refresh_token. - */ - public void setRefreshToken(String value) { - set(8, value); - } - - /** - * Getter for public.oauth_access_token.refresh_token. - */ - public String getRefreshToken() { - return (String) get(8); - } - - // ------------------------------------------------------------------------- - // Primary key information - // ------------------------------------------------------------------------- - - @Override - public Record1 key() { - return (Record1) super.key(); - } - - // ------------------------------------------------------------------------- - // Record9 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } - - @Override - public Row9 valuesRow() { - return (Row9) super.valuesRow(); - } - - @Override - public Field field1() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.ID; - } - - @Override - public Field field2() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN_ID; - } - - @Override - public Field field3() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.TOKEN; - } - - @Override - public Field field4() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.AUTHENTICATION_ID; - } - - @Override - public Field field5() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.USERNAME; - } - - @Override - public Field field6() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.USER_ID; - } - - @Override - public Field field7() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.CLIENT_ID; - } - - @Override - public Field field8() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.AUTHENTICATION; - } - - @Override - public Field field9() { - return JOauthAccessToken.OAUTH_ACCESS_TOKEN.REFRESH_TOKEN; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getTokenId(); - } - - @Override - public byte[] component3() { - return getToken(); - } - - @Override - public String component4() { - return getAuthenticationId(); - } - - @Override - public String component5() { - return getUsername(); - } - - @Override - public Long component6() { - return getUserId(); - } - - @Override - public String component7() { - return getClientId(); - } - - @Override - public byte[] component8() { - return getAuthentication(); - } - - @Override - public String component9() { - return getRefreshToken(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getTokenId(); - } - - @Override - public byte[] value3() { - return getToken(); - } - - @Override - public String value4() { - return getAuthenticationId(); - } - - @Override - public String value5() { - return getUsername(); - } - - @Override - public Long value6() { - return getUserId(); - } - - @Override - public String value7() { - return getClientId(); - } - - @Override - public byte[] value8() { - return getAuthentication(); - } - - @Override - public String value9() { - return getRefreshToken(); - } - - @Override - public JOauthAccessTokenRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value2(String value) { - setTokenId(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value3(byte... value) { - setToken(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value4(String value) { - setAuthenticationId(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value5(String value) { - setUsername(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value6(Long value) { - setUserId(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value7(String value) { - setClientId(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value8(byte... value) { - setAuthentication(value); - return this; - } - - @Override - public JOauthAccessTokenRecord value9(String value) { - setRefreshToken(value); - return this; - } - - @Override - public JOauthAccessTokenRecord values(Long value1, String value2, byte[] value3, String value4, String value5, Long value6, String value7, byte[] value8, String value9) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached JOauthAccessTokenRecord - */ - public JOauthAccessTokenRecord() { - super(JOauthAccessToken.OAUTH_ACCESS_TOKEN); - } - - /** - * Create a detached, initialised JOauthAccessTokenRecord - */ - public JOauthAccessTokenRecord(Long id, String tokenId, byte[] token, String authenticationId, String username, Long userId, String clientId, byte[] authentication, String refreshToken) { - super(JOauthAccessToken.OAUTH_ACCESS_TOKEN); - - set(0, id); - set(1, tokenId); - set(2, token); - set(3, authenticationId); - set(4, username); - set(5, userId); - set(6, clientId); - set(7, authentication); - set(8, refreshToken); - } -} From 3a33882812f1d3d382b17ab0f745b2efd5ab594e Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Fri, 29 Sep 2023 09:12:19 +0300 Subject: [PATCH 082/110] EPMRPP-86250 || Update Analyzer settings. Provide the base for analysis: Current launch and Current launch+previous --- .../java/com/epam/ta/reportportal/entity/AnalyzeMode.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/entity/AnalyzeMode.java b/src/main/java/com/epam/ta/reportportal/entity/AnalyzeMode.java index f97069148..722392f76 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/AnalyzeMode.java +++ b/src/main/java/com/epam/ta/reportportal/entity/AnalyzeMode.java @@ -26,7 +26,10 @@ public enum AnalyzeMode { ALL_LAUNCHES("ALL"), BY_LAUNCH_NAME("LAUNCH_NAME"), - CURRENT_LAUNCH("CURRENT_LAUNCH"); + CURRENT_LAUNCH("CURRENT_LAUNCH"), + PREVIOUS_LAUNCH("PREVIOUS_LAUNCH"), + + CURRENT_AND_THE_SAME_NAME("CURRENT_AND_THE_SAME_NAME"); private String value; From 5ca97ad68e7b95e0b9309750afbb5dadafc68872 Mon Sep 17 00:00:00 2001 From: PeeAyBee Date: Fri, 29 Sep 2023 14:07:27 +0300 Subject: [PATCH 083/110] EPMRPP-86361 || Add possibility to filter items by composite system attributes (#936) --- .../commons/querygen/FilterTarget.java | 347 ++++++++++-------- .../constant/ItemAttributeConstant.java | 1 + .../dao/TestItemRepositoryTest.java | 15 + .../db/migration/V001004__items_init.sql | 3 + 4 files changed, 211 insertions(+), 155 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java index dfaa25825..d9f820c62 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java @@ -46,6 +46,7 @@ import static com.epam.ta.reportportal.commons.querygen.constant.IssueCriteriaConstant.CRITERIA_ISSUE_IGNORE_ANALYZER; import static com.epam.ta.reportportal.commons.querygen.constant.IssueCriteriaConstant.CRITERIA_ISSUE_LOCATOR; import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_COMPOSITE_ATTRIBUTE; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_COMPOSITE_SYSTEM_ATTRIBUTE; import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_ITEM_ATTRIBUTE_KEY; import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_ITEM_ATTRIBUTE_VALUE; import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_LEVEL_ATTRIBUTE; @@ -798,6 +799,35 @@ private List> getSelectAggregatedFields() { .filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(false)) ).toString()).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_COMPOSITE_SYSTEM_ATTRIBUTE, + ITEM_ATTRIBUTE.KEY, + String[].class, Lists.newArrayList( + JoinEntity.of(ITEM_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, + TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID)), + JoinEntity.of(LAUNCH_ATTRIBUTE, JoinType.LEFT_OUTER_JOIN, + LAUNCH.ID.eq(LAUNCH_ATTRIBUTE.LAUNCH_ID)) + )).withAggregateCriteria(DSL.field( + "{0}::varchar[] || {1}::varchar[] || {2}::varchar[] || {3}::varchar[] || {4}::varchar[] || {5}::varchar[]", + DSL.arrayAggDistinct(DSL.concat(LAUNCH_ATTRIBUTE.KEY, ":")) + .filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(true)), + DSL.arrayAggDistinct(DSL.concat(LAUNCH_ATTRIBUTE.VALUE)) + .filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(true)), + DSL.arrayAgg(DSL.concat(DSL.coalesce(LAUNCH_ATTRIBUTE.KEY, ""), + DSL.val(KEY_VALUE_SEPARATOR), + LAUNCH_ATTRIBUTE.VALUE + )) + .filterWhere(LAUNCH_ATTRIBUTE.SYSTEM.eq(true)), + DSL.arrayAggDistinct(DSL.concat(ITEM_ATTRIBUTE.KEY, ":")) + .filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(true)), + DSL.arrayAggDistinct(DSL.concat(ITEM_ATTRIBUTE.VALUE)) + .filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(true)), + DSL.arrayAgg(DSL.concat(DSL.coalesce(ITEM_ATTRIBUTE.KEY, ""), + DSL.val(KEY_VALUE_SEPARATOR), + ITEM_ATTRIBUTE.VALUE + )) + .filterWhere(ITEM_ATTRIBUTE.SYSTEM.eq(true)) + ).toString()).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PATTERN_TEMPLATE_NAME, PATTERN_TEMPLATE.NAME, List.class, @@ -1082,69 +1112,69 @@ protected Field idField() { ACTIVITY_TARGET(Activity.class, Arrays.asList( - new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, ACTIVITY.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_ACTION, ACTIVITY.ACTION, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_CREATED_AT, ACTIVITY.CREATED_AT, - Timestamp.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_OBJECT_ID, ACTIVITY.OBJECT_ID, Long.class) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_OBJECT_NAME, ACTIVITY.OBJECT_NAME, - String.class) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_OBJECT_TYPE, ACTIVITY.OBJECT_TYPE, - String.class) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PRIORITY, ACTIVITY.PRIORITY, String.class) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, ACTIVITY.PROJECT_ID, Long.class) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_SUBJECT_ID, ACTIVITY.SUBJECT_ID, Long.class) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_SUBJECT_NAME, ACTIVITY.SUBJECT_NAME, - String.class) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_SUBJECT_TYPE, ACTIVITY.SUBJECT_TYPE, - String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_ACTIVITY_PROJECT_NAME, PROJECT.NAME, - String.class) - .withAggregateCriteria(DSL.max(PROJECT.NAME).toString()) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_USER, USERS.LOGIN, String.class) - .withAggregateCriteria(DSL.max(USERS.LOGIN).toString()) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_EVENT_NAME, ACTIVITY.EVENT_NAME, String.class) - .get() - )) { - @Override - protected Collection selectFields() { - return Lists.newArrayList(ACTIVITY.ID, - ACTIVITY.ACTION, - ACTIVITY.EVENT_NAME, - ACTIVITY.CREATED_AT, - ACTIVITY.DETAILS, - ACTIVITY.OBJECT_ID, - ACTIVITY.OBJECT_NAME, - ACTIVITY.OBJECT_TYPE, - ACTIVITY.PRIORITY, - ACTIVITY.PROJECT_ID, - ACTIVITY.SUBJECT_ID, - ACTIVITY.SUBJECT_NAME, - ACTIVITY.SUBJECT_TYPE, - USERS.LOGIN, - PROJECT.NAME - ); - } + new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, ACTIVITY.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_ACTION, ACTIVITY.ACTION, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_CREATED_AT, ACTIVITY.CREATED_AT, + Timestamp.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_OBJECT_ID, ACTIVITY.OBJECT_ID, Long.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_OBJECT_NAME, ACTIVITY.OBJECT_NAME, + String.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_OBJECT_TYPE, ACTIVITY.OBJECT_TYPE, + String.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PRIORITY, ACTIVITY.PRIORITY, String.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, ACTIVITY.PROJECT_ID, Long.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_SUBJECT_ID, ACTIVITY.SUBJECT_ID, Long.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_SUBJECT_NAME, ACTIVITY.SUBJECT_NAME, + String.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_SUBJECT_TYPE, ACTIVITY.SUBJECT_TYPE, + String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_ACTIVITY_PROJECT_NAME, PROJECT.NAME, + String.class) + .withAggregateCriteria(DSL.max(PROJECT.NAME).toString()) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_USER, USERS.LOGIN, String.class) + .withAggregateCriteria(DSL.max(USERS.LOGIN).toString()) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_EVENT_NAME, ACTIVITY.EVENT_NAME, String.class) + .get() + )) { + @Override + protected Collection selectFields() { + return Lists.newArrayList(ACTIVITY.ID, + ACTIVITY.ACTION, + ACTIVITY.EVENT_NAME, + ACTIVITY.CREATED_AT, + ACTIVITY.DETAILS, + ACTIVITY.OBJECT_ID, + ACTIVITY.OBJECT_NAME, + ACTIVITY.OBJECT_TYPE, + ACTIVITY.PRIORITY, + ACTIVITY.PROJECT_ID, + ACTIVITY.SUBJECT_ID, + ACTIVITY.SUBJECT_NAME, + ACTIVITY.SUBJECT_TYPE, + USERS.LOGIN, + PROJECT.NAME + ); + } @Override protected void addFrom(SelectQuery query) { query.addFrom(ACTIVITY); } - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(USERS, JoinType.LEFT_OUTER_JOIN, ACTIVITY.SUBJECT_ID.eq(USERS.ID)); - query.addJoin(PROJECT, JoinType.JOIN, ACTIVITY.PROJECT_ID.eq(PROJECT.ID)); - } + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(USERS, JoinType.LEFT_OUTER_JOIN, ACTIVITY.SUBJECT_ID.eq(USERS.ID)); + query.addJoin(PROJECT, JoinType.JOIN, ACTIVITY.PROJECT_ID.eq(PROJECT.ID)); + } @Override protected Field idField() { @@ -1199,47 +1229,49 @@ protected Field idField() { DASHBOARD_TARGET(Dashboard.class, Arrays.asList( - new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, DASHBOARD.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, DASHBOARD.NAME, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, OWNED_ENTITY.PROJECT_ID, Long.class) - .withAggregateCriteria(DSL.max(OWNED_ENTITY.PROJECT_ID).toString()) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, OWNED_ENTITY.OWNER, String.class) - .withAggregateCriteria(DSL.max(OWNED_ENTITY.OWNER).toString()) - .get() - )) { - @Override - protected Collection selectFields() { - return Lists.newArrayList(DASHBOARD.ID, - DASHBOARD.NAME, - DASHBOARD.DESCRIPTION, - DASHBOARD.CREATION_DATE, - DASHBOARD_WIDGET.WIDGET_OWNER, - DASHBOARD_WIDGET.IS_CREATED_ON, - DASHBOARD_WIDGET.WIDGET_ID, - DASHBOARD_WIDGET.WIDGET_NAME, - DASHBOARD_WIDGET.WIDGET_TYPE, - DASHBOARD_WIDGET.WIDGET_HEIGHT, - DASHBOARD_WIDGET.WIDGET_WIDTH, - DASHBOARD_WIDGET.WIDGET_POSITION_X, - DASHBOARD_WIDGET.WIDGET_POSITION_Y, - WIDGET.WIDGET_OPTIONS, - OWNED_ENTITY.PROJECT_ID, - OWNED_ENTITY.OWNER - ); - } + new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, DASHBOARD.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, DASHBOARD.NAME, String.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, OWNED_ENTITY.PROJECT_ID, + Long.class) + .withAggregateCriteria(DSL.max(OWNED_ENTITY.PROJECT_ID).toString()) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, OWNED_ENTITY.OWNER, String.class) + .withAggregateCriteria(DSL.max(OWNED_ENTITY.OWNER).toString()) + .get() + )) { + @Override + protected Collection selectFields() { + return Lists.newArrayList(DASHBOARD.ID, + DASHBOARD.NAME, + DASHBOARD.DESCRIPTION, + DASHBOARD.CREATION_DATE, + DASHBOARD_WIDGET.WIDGET_OWNER, + DASHBOARD_WIDGET.IS_CREATED_ON, + DASHBOARD_WIDGET.WIDGET_ID, + DASHBOARD_WIDGET.WIDGET_NAME, + DASHBOARD_WIDGET.WIDGET_TYPE, + DASHBOARD_WIDGET.WIDGET_HEIGHT, + DASHBOARD_WIDGET.WIDGET_WIDTH, + DASHBOARD_WIDGET.WIDGET_POSITION_X, + DASHBOARD_WIDGET.WIDGET_POSITION_Y, + WIDGET.WIDGET_OPTIONS, + OWNED_ENTITY.PROJECT_ID, + OWNED_ENTITY.OWNER + ); + } @Override protected void addFrom(SelectQuery query) { query.addFrom(DASHBOARD); } - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(DASHBOARD_WIDGET, JoinType.LEFT_OUTER_JOIN, DASHBOARD.ID.eq(DASHBOARD_WIDGET.DASHBOARD_ID)); - query.addJoin(WIDGET, JoinType.LEFT_OUTER_JOIN, DASHBOARD_WIDGET.WIDGET_ID.eq(WIDGET.ID)); - query.addJoin(OWNED_ENTITY, JoinType.JOIN, DASHBOARD.ID.eq(OWNED_ENTITY.ID)); - } + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(DASHBOARD_WIDGET, JoinType.LEFT_OUTER_JOIN, + DASHBOARD.ID.eq(DASHBOARD_WIDGET.DASHBOARD_ID)); + query.addJoin(WIDGET, JoinType.LEFT_OUTER_JOIN, DASHBOARD_WIDGET.WIDGET_ID.eq(WIDGET.ID)); + query.addJoin(OWNED_ENTITY, JoinType.JOIN, DASHBOARD.ID.eq(OWNED_ENTITY.ID)); + } @Override protected Field idField() { @@ -1249,38 +1281,40 @@ protected Field idField() { WIDGET_TARGET(Widget.class, Arrays.asList( - new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, WIDGET.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, WIDGET.NAME, String.class) - .withAggregateCriteria(DSL.max(WIDGET.NAME).toString()) - .get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_DESCRIPTION, WIDGET.DESCRIPTION, String.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, OWNED_ENTITY.PROJECT_ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, OWNED_ENTITY.OWNER, String.class) - .withAggregateCriteria(DSL.max(OWNED_ENTITY.OWNER).toString()) - .get() - - )) { - @Override - protected Collection selectFields() { - return Lists.newArrayList(WIDGET.ID, - WIDGET.NAME, - WIDGET.WIDGET_TYPE, - WIDGET.DESCRIPTION, - WIDGET.ITEMS_COUNT, - OWNED_ENTITY.PROJECT_ID, - OWNED_ENTITY.OWNER - ); - } + new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, WIDGET.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, WIDGET.NAME, String.class) + .withAggregateCriteria(DSL.max(WIDGET.NAME).toString()) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_DESCRIPTION, WIDGET.DESCRIPTION, String.class) + .get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, OWNED_ENTITY.PROJECT_ID, + Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, OWNED_ENTITY.OWNER, String.class) + .withAggregateCriteria(DSL.max(OWNED_ENTITY.OWNER).toString()) + .get() + + )) { + @Override + protected Collection selectFields() { + return Lists.newArrayList(WIDGET.ID, + WIDGET.NAME, + WIDGET.WIDGET_TYPE, + WIDGET.DESCRIPTION, + WIDGET.ITEMS_COUNT, + OWNED_ENTITY.PROJECT_ID, + OWNED_ENTITY.OWNER + ); + } @Override protected void addFrom(SelectQuery query) { query.addFrom(WIDGET); } - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(OWNED_ENTITY, JoinType.JOIN, WIDGET.ID.eq(OWNED_ENTITY.ID)); - } + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(OWNED_ENTITY, JoinType.JOIN, WIDGET.ID.eq(OWNED_ENTITY.ID)); + } @Override protected Field idField() { @@ -1288,47 +1322,50 @@ protected Field idField() { } }, - USER_FILTER_TARGET(UserFilter.class, - Arrays.asList(new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, FILTER.ID, Long.class).get(), - new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, FILTER.NAME, String.class).get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, OWNED_ENTITY.PROJECT_ID, Long.class) - .withAggregateCriteria(DSL.max(OWNED_ENTITY.PROJECT_ID).toString()) - .get(), - - new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, OWNED_ENTITY.OWNER, String.class) - .withAggregateCriteria(DSL.max(OWNED_ENTITY.OWNER).toString()) - .get() - ) - ) { - @Override - protected Collection selectFields() { - return Lists.newArrayList(FILTER.ID, - FILTER.NAME, - FILTER.TARGET, - FILTER.DESCRIPTION, - FILTER_CONDITION.SEARCH_CRITERIA, - FILTER_CONDITION.CONDITION, - FILTER_CONDITION.VALUE, - FILTER_CONDITION.NEGATIVE, - FILTER_SORT.FIELD, - FILTER_SORT.DIRECTION, - OWNED_ENTITY.PROJECT_ID, - OWNED_ENTITY.OWNER - ); - } + USER_FILTER_TARGET(UserFilter.class, + Arrays.asList( + new CriteriaHolderBuilder().newBuilder(CRITERIA_ID, FILTER.ID, Long.class).get(), + new CriteriaHolderBuilder().newBuilder(CRITERIA_NAME, FILTER.NAME, String.class).get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_PROJECT_ID, OWNED_ENTITY.PROJECT_ID, + Long.class) + .withAggregateCriteria(DSL.max(OWNED_ENTITY.PROJECT_ID).toString()) + .get(), + + new CriteriaHolderBuilder().newBuilder(CRITERIA_OWNER, OWNED_ENTITY.OWNER, String.class) + .withAggregateCriteria(DSL.max(OWNED_ENTITY.OWNER).toString()) + .get() + ) + ) { + @Override + protected Collection selectFields() { + return Lists.newArrayList(FILTER.ID, + FILTER.NAME, + FILTER.TARGET, + FILTER.DESCRIPTION, + FILTER_CONDITION.SEARCH_CRITERIA, + FILTER_CONDITION.CONDITION, + FILTER_CONDITION.VALUE, + FILTER_CONDITION.NEGATIVE, + FILTER_SORT.FIELD, + FILTER_SORT.DIRECTION, + OWNED_ENTITY.PROJECT_ID, + OWNED_ENTITY.OWNER + ); + } @Override protected void addFrom(SelectQuery query) { query.addFrom(FILTER); } - @Override - protected void joinTables(QuerySupplier query) { - query.addJoin(OWNED_ENTITY, JoinType.JOIN, FILTER.ID.eq(OWNED_ENTITY.ID)); - query.addJoin(FILTER_CONDITION, JoinType.LEFT_OUTER_JOIN, FILTER.ID.eq(FILTER_CONDITION.FILTER_ID)); - query.addJoin(FILTER_SORT, JoinType.LEFT_OUTER_JOIN, FILTER.ID.eq(FILTER_SORT.FILTER_ID)); - } + @Override + protected void joinTables(QuerySupplier query) { + query.addJoin(OWNED_ENTITY, JoinType.JOIN, FILTER.ID.eq(OWNED_ENTITY.ID)); + query.addJoin(FILTER_CONDITION, JoinType.LEFT_OUTER_JOIN, + FILTER.ID.eq(FILTER_CONDITION.FILTER_ID)); + query.addJoin(FILTER_SORT, JoinType.LEFT_OUTER_JOIN, FILTER.ID.eq(FILTER_SORT.FILTER_ID)); + } @Override protected Field idField() { @@ -1340,8 +1377,8 @@ protected Field idField() { public static final String ATTRIBUTE_ALIAS = "attribute"; public static final String FILTERED_ID = "id"; - private final Class clazz; - private final List criteriaHolders; + private final Class clazz; + private final List criteriaHolders; FilterTarget(Class clazz, List criteriaHolders) { this.clazz = clazz; diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ItemAttributeConstant.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ItemAttributeConstant.java index 6548788a9..1482c2378 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ItemAttributeConstant.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/constant/ItemAttributeConstant.java @@ -27,6 +27,7 @@ public final class ItemAttributeConstant { public static final String CRITERIA_ITEM_ATTRIBUTE_VALUE = "attributeValue"; public static final String CRITERIA_ITEM_ATTRIBUTE_SYSTEM = "attributeSystem"; public static final String CRITERIA_COMPOSITE_ATTRIBUTE = "compositeAttribute"; + public static final String CRITERIA_COMPOSITE_SYSTEM_ATTRIBUTE = "compositeSystemAttribute"; public static final String CRITERIA_LEVEL_ATTRIBUTE = "levelAttribute"; public static final String KEY_VALUE_SEPARATOR = ":"; public static final JItemAttribute LAUNCH_ATTRIBUTE = JItemAttribute.ITEM_ATTRIBUTE.as( diff --git a/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java index 76c5a2b34..8a7ca7368 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/TestItemRepositoryTest.java @@ -22,6 +22,7 @@ import static com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_START_TIME; import static com.epam.ta.reportportal.commons.querygen.constant.IssueCriteriaConstant.CRITERIA_ISSUE_ID; import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_COMPOSITE_ATTRIBUTE; +import static com.epam.ta.reportportal.commons.querygen.constant.ItemAttributeConstant.CRITERIA_COMPOSITE_SYSTEM_ATTRIBUTE; import static com.epam.ta.reportportal.commons.querygen.constant.LaunchCriteriaConstant.CRITERIA_LAUNCH_MODE; import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_LOG_MESSAGE; import static com.epam.ta.reportportal.commons.querygen.constant.LogCriteriaConstant.CRITERIA_TEST_ITEM_ID; @@ -1313,6 +1314,20 @@ void compositeAttributeHas() { assertFalse(items.isEmpty()); } + @Test + void compositeSystemAttributeHas() { + List items = testItemRepository.findByFilter(Filter.builder() + .withTarget(TestItem.class) + .withCondition(FilterCondition.builder() + .withCondition(Condition.HAS) + .withSearchCriteria(CRITERIA_COMPOSITE_SYSTEM_ATTRIBUTE) + .withValue("systemTestKey:systemTestValue") + .build()) + .build()); + + assertFalse(items.isEmpty()); + } + @Test void compositeAttributeHasNegative() { List items = testItemRepository.findByFilter(Filter.builder() diff --git a/src/test/resources/db/migration/V001004__items_init.sql b/src/test/resources/db/migration/V001004__items_init.sql index cdd716b15..b256ad5b1 100644 --- a/src/test/resources/db/migration/V001004__items_init.sql +++ b/src/test/resources/db/migration/V001004__items_init.sql @@ -121,6 +121,9 @@ BEGIN INSERT INTO item_attribute (key, value, item_id, launch_id, system) VALUES ('step', 'value' || cur_step_id, cur_step_id, NULL, TRUE); + INSERT INTO item_attribute (key, value, item_id, launch_id, system) + VALUES ('systemTestKey', 'systemTestValue', cur_step_id, NULL, TRUE); + ELSE INSERT INTO item_attribute (key, value, item_id, launch_id, system) VALUES ('step', 'value' || cur_step_id, cur_step_id, NULL, FALSE); From 7a14043a435a2185dca67ac15df5edd780af57d0 Mon Sep 17 00:00:00 2001 From: Ivan_Kustau Date: Mon, 4 Sep 2023 15:53:30 +0300 Subject: [PATCH 084/110] EPMRPP-86208 || Update api key cache resolver (cherry picked from commit b2928d39df7f994ecae34d3471395056d0f1a46c) --- .../com/epam/ta/reportportal/config/ApiKeyCacheResolver.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/epam/ta/reportportal/config/ApiKeyCacheResolver.java b/src/main/java/com/epam/ta/reportportal/config/ApiKeyCacheResolver.java index f7e2ef052..69c07b369 100644 --- a/src/main/java/com/epam/ta/reportportal/config/ApiKeyCacheResolver.java +++ b/src/main/java/com/epam/ta/reportportal/config/ApiKeyCacheResolver.java @@ -38,6 +38,7 @@ public Collection resolveCaches(CacheOperationInvocationContext if (apiKey != null && context.getOperation().getCacheNames().contains("apiKeyCache")) { Cache cache = cacheManager.getCache("apiKeyCache"); if (cache != null) { + cache.evict(apiKey.getHash()); caches.add(cache); } } From 638ca154b4c6bcb61290e92998f1cdd1712d5aa0 Mon Sep 17 00:00:00 2001 From: Ivan_Kustau Date: Mon, 9 Oct 2023 17:10:13 +0300 Subject: [PATCH 085/110] EPMRPP-86775 || Add possibility to have no auth in ES --- .../dao/custom/ElasticSearchClient.java | 67 ++++++++++--------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java b/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java index 72986e0cc..3334ecfc2 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java +++ b/src/main/java/com/epam/ta/reportportal/dao/custom/ElasticSearchClient.java @@ -45,10 +45,13 @@ public class ElasticSearchClient { private final RestTemplate restTemplate; public ElasticSearchClient(@Value("${rp.elasticsearch.host}") String host, - @Value("${rp.elasticsearch.username}") String username, - @Value("${rp.elasticsearch.password}") String password) { + @Value("${rp.elasticsearch.username:}") String username, + @Value("${rp.elasticsearch.password:}") String password) { restTemplate = new RestTemplate(); - restTemplate.getInterceptors().add(new BasicAuthenticationInterceptor(username, password)); + + if (!username.isEmpty() && !password.isEmpty()) { + restTemplate.getInterceptors().add(new BasicAuthenticationInterceptor(username, password)); + } this.host = host; } @@ -109,8 +112,8 @@ public void deleteLogsByProjectId(Long projectId) { restTemplate.delete(host + "/_data_stream/" + indexName); } catch (Exception exception) { // to avoid checking of exists stream or not - LOGGER.error("DELETE stream from ES " + indexName + " Project: " + projectId - + " Message: " + exception.getMessage()); + LOGGER.error("DELETE stream from ES " + indexName + " Project: " + projectId + " Message: " + + exception.getMessage()); } } @@ -172,11 +175,14 @@ private List searchTestItemIdsByConditions(Long projectId, JSONObject sear try { HttpEntity searchRequest = getStringHttpEntity(searchJson.toString()); - LinkedHashMap result = restTemplate.postForObject( - host + "/" + indexName + "/_search", searchRequest, LinkedHashMap.class); + LinkedHashMap result = + restTemplate.postForObject(host + "/" + indexName + "/_search", searchRequest, + LinkedHashMap.class + ); - List> hits = (List>) ((LinkedHashMap) result.get( - "hits")).get("hits"); + List> hits = + (List>) ((LinkedHashMap) result.get( + "hits")).get("hits"); if (org.apache.commons.collections.CollectionUtils.isNotEmpty(hits)) { for (LinkedHashMap hit : hits) { @@ -188,9 +194,8 @@ private List searchTestItemIdsByConditions(Long projectId, JSONObject sear } } catch (Exception exception) { - LOGGER.error("Search error " + indexName - + " SearchJson: " + searchJson - + " Message: " + exception.getMessage()); + LOGGER.error("Search error " + indexName + " SearchJson: " + searchJson + " Message: " + + exception.getMessage()); } return new ArrayList<>(testItemIds); @@ -208,11 +213,14 @@ private Map getLogMessageMapBatch(Long projectId, List l JSONObject searchJson = getSearchJson(terms, size); HttpEntity searchRequest = getStringHttpEntity(searchJson.toString()); - LinkedHashMap result = restTemplate.postForObject( - host + "/" + indexName + "/_search", searchRequest, LinkedHashMap.class); + LinkedHashMap result = + restTemplate.postForObject(host + "/" + indexName + "/_search", searchRequest, + LinkedHashMap.class + ); - List> hits = (List>) ((LinkedHashMap) result.get( - "hits")).get("hits"); + List> hits = + (List>) ((LinkedHashMap) result.get( + "hits")).get("hits"); if (org.apache.commons.collections.CollectionUtils.isNotEmpty(hits)) { for (LinkedHashMap hit : hits) { @@ -224,8 +232,8 @@ private Map getLogMessageMapBatch(Long projectId, List l } } catch (Exception exception) { - LOGGER.error("Search error " + indexName + " Terms: " + terms - + " Message: " + exception.getMessage()); + LOGGER.error( + "Search error " + indexName + " Terms: " + terms + " Message: " + exception.getMessage()); } return logMessageMap; @@ -242,16 +250,10 @@ private LogMessage convertElasticDataToLogMessage(Long projectId, Map deleteRequest = getStringHttpEntity(deleteByLaunch.toString()); restTemplate.postForObject(host + "/" + indexName + "/_delete_by_query", deleteRequest, - JSONObject.class); + JSONObject.class + ); } catch (Exception exception) { // to avoid checking of exists stream or not - LOGGER.error("DELETE logs from stream ES error " + indexName + " Terms: " + terms - + " Message: " + exception.getMessage()); + LOGGER.error( + "DELETE logs from stream ES error " + indexName + " Terms: " + terms + " Message: " + + exception.getMessage()); } } @@ -295,7 +299,6 @@ private JSONObject getSearchJson(JSONObject terms, Integer size) { return searchJson; } - private JSONObject getSearchStringJson(String string, JSONObject filterTerms, List sourceFields, Integer size) { JSONObject postFilter = new JSONObject(); From 8501b4a06729660ab7349b4bfb34d6b7ee1eb52a Mon Sep 17 00:00:00 2001 From: PeeAyBee Date: Mon, 16 Oct 2023 16:31:06 +0300 Subject: [PATCH 086/110] EPMRPP-80574 (#939) * EPMRPP-80519 || Add methods for removing buckets and files * EPMRPP-80519 || Remove attachments by project id * EPMRPP-86363 exclude system attributes in launches table widget (#932) * EPMRPP-86363 exclude system attributes in launches table widget * EPMRPP-86363 fixed check-style comments * EPMRPP-80574 || Add possibility to provide encryption password by env * EPMRPP-80574 || Add file existence check to the DataStore interface * EPMRPP-80574 || Add default password value * EPMRPP-80574 || Add default null password value * EPMRPP-80574 || Update exception handling in s3 data store * EPMRPP-80574 || Fix spelling mistake --------- Co-authored-by: Ivan_Kustau Co-authored-by: Ivan Kustau <86599591+IvanKustau@users.noreply.github.com> Co-authored-by: Siarhei Hrabko <45555481+grabsefx@users.noreply.github.com> --- .../impl/AttachmentBinaryDataServiceImpl.java | 3 +- .../config/EncryptConfiguration.java | 44 +++++++++++++------ .../ta/reportportal/filesystem/DataStore.java | 2 + .../filesystem/LocalDataStore.java | 5 +++ .../distributed/s3/S3DataStore.java | 24 ++++++---- 5 files changed, 55 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java b/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java index fce4c7b96..b49b1a407 100644 --- a/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java +++ b/src/main/java/com/epam/ta/reportportal/binary/impl/AttachmentBinaryDataServiceImpl.java @@ -184,7 +184,8 @@ public BinaryData load(Long fileId, ReportPortalUser.ProjectDetails projectDetai ErrorType.ACCESS_DENIED, formattedSupplier("You are not assigned to project '{}'", projectDetails.getProjectName()) ); - return new BinaryData(attachment.getFileName(), attachment.getContentType(), (long) data.available(), data); + return new BinaryData( + attachment.getFileName(), attachment.getContentType(), (long) data.available(), data); } catch (IOException e) { LOGGER.error("Unable to load binary data", e); throw new ReportPortalException( diff --git a/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java b/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java index 36ff5207c..b865b6add 100644 --- a/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java +++ b/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java @@ -22,6 +22,7 @@ import com.epam.ta.reportportal.exception.ReportPortalException; import com.epam.ta.reportportal.filesystem.DataStore; import com.epam.ta.reportportal.util.FeatureFlagHandler; +import com.epam.ta.reportportal.ws.model.ErrorType; import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; @@ -30,6 +31,7 @@ import java.nio.file.Paths; import java.security.SecureRandom; import java.util.Base64; +import java.util.Optional; import org.apache.commons.io.IOUtils; import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; import org.jasypt.util.text.BasicTextEncryptor; @@ -51,13 +53,17 @@ public class EncryptConfiguration implements InitializingBean { private static final Logger LOGGER = LoggerFactory.getLogger(EncryptConfiguration.class); + @Value("${rp.encryptor.password:#{null}}") + private String password; + @Value("${rp.integration.salt.path:keystore}") - private String integrationSaltPath; + private String passwordFilePath; @Value("${rp.integration.salt.file:secret-integration-salt}") - private String integrationSaltFile; + private String passwordFile; private String secretFilePath; + private final DataStore dataStore; private final FeatureFlagHandler featureFlagHandler; @@ -74,9 +80,9 @@ public EncryptConfiguration(DataStore dataStore, FeatureFlagHandler featureFlagH * @return {@link BasicTextEncryptor} instance */ @Bean(name = "basicEncryptor") - public BasicTextEncryptor getBasicEncrypt() throws IOException { + public BasicTextEncryptor getBasicEncrypt() { BasicTextEncryptor basic = new BasicTextEncryptor(); - basic.setPassword(IOUtils.toString(dataStore.load(secretFilePath), StandardCharsets.UTF_8)); + basic.setPassword(getPassword()); return basic; } @@ -86,27 +92,39 @@ public BasicTextEncryptor getBasicEncrypt() throws IOException { * @return {@link StandardPBEStringEncryptor} instance */ @Bean(name = "strongEncryptor") - public StandardPBEStringEncryptor getStrongEncryptor() throws IOException { + public StandardPBEStringEncryptor getStrongEncryptor() { StandardPBEStringEncryptor strong = new StandardPBEStringEncryptor(); - strong.setPassword(IOUtils.toString(dataStore.load(secretFilePath), StandardCharsets.UTF_8)); + strong.setPassword(getPassword()); strong.setAlgorithm("PBEWithMD5AndTripleDES"); return strong; } @Override - public void afterPropertiesSet() throws Exception { + public void afterPropertiesSet() { if (featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { - secretFilePath = Paths.get(INTEGRATION_SECRETS_PATH, integrationSaltFile).toString(); + secretFilePath = Paths.get(INTEGRATION_SECRETS_PATH, passwordFile).toString(); } else { - secretFilePath = integrationSaltPath + File.separator + integrationSaltFile; + secretFilePath = passwordFilePath + File.separator + passwordFile; } - loadOrGenerateIntegrationSalt(dataStore); + if (password == null) { + loadOrGenerateEncryptorPassword(); + } + } + + private String getPassword() { + return Optional.ofNullable(password).orElseGet(this::loadFromDataStore); } - private void loadOrGenerateIntegrationSalt(DataStore dataStore) { + private String loadFromDataStore() { try { - dataStore.load(secretFilePath); - } catch (ReportPortalException ex) { + return IOUtils.toString(dataStore.load(secretFilePath), StandardCharsets.UTF_8); + } catch (IOException e) { + throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, e.getMessage()); + } + } + + private void loadOrGenerateEncryptorPassword() { + if (!dataStore.exists(secretFilePath)) { byte[] bytes = new byte[20]; new SecureRandom().nextBytes(bytes); try (InputStream secret = new ByteArrayInputStream( diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java index 3d4b88ee0..2dbb43ef4 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/DataStore.java @@ -28,6 +28,8 @@ public interface DataStore { InputStream load(String filePath); + boolean exists(String filePath); + void delete(String filePath); void deleteAll(List filePaths, String bucketName); diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java index 88e2b70a0..34bb83299 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java @@ -81,6 +81,11 @@ public InputStream load(String filePath) { } } + @Override + public boolean exists(String filePath) { + return Files.exists(Paths.get(storageRootPath, filePath)); + } + @Override public void delete(String filePath) { diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java index 1ac0d896f..313e1102b 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java @@ -27,6 +27,7 @@ import java.nio.file.Paths; import java.util.List; import java.util.Objects; +import java.util.Optional; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import org.jclouds.blobstore.BlobStore; @@ -103,17 +104,22 @@ public String save(String filePath, InputStream inputStream) { @Override public InputStream load(String filePath) { S3File s3File = getS3File(filePath); - try { - Blob fileBlob = blobStore.getBlob(s3File.getBucket(), s3File.getFilePath()); - if (fileBlob != null) { - return fileBlob.getPayload().openStream(); - } else { - throw new Exception(); + Blob fileBlob = blobStore.getBlob(s3File.getBucket(), s3File.getFilePath()); + if (fileBlob != null) { + try (InputStream inputStream = fileBlob.getPayload().openStream()) { + return inputStream; + } catch (IOException e) { + throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, e.getMessage()); } - } catch (Exception e) { - LOGGER.error("Unable to find file '{}'", filePath, e); - throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); } + LOGGER.error("Unable to find file '{}'", filePath); + throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); + } + + @Override + public boolean exists(String filePath) { + S3File s3File = getS3File(filePath); + return blobStore.blobExists(s3File.getBucket(), s3File.getFilePath()); } @Override From f267140a3ddf512d449ef91c663a1acac4701d3f Mon Sep 17 00:00:00 2001 From: PeeAyBee Date: Fri, 20 Oct 2023 17:05:20 +0300 Subject: [PATCH 087/110] EPMRPP-80574 || Fix early stream closing (#940) * EPMRPP-80519 || Add methods for removing buckets and files * EPMRPP-80519 || Remove attachments by project id * EPMRPP-86363 exclude system attributes in launches table widget (#932) * EPMRPP-86363 exclude system attributes in launches table widget * EPMRPP-86363 fixed check-style comments * EPMRPP-80574 || Fix early stream closing --------- Co-authored-by: Ivan_Kustau Co-authored-by: Ivan Kustau <86599591+IvanKustau@users.noreply.github.com> Co-authored-by: Siarhei Hrabko <45555481+grabsefx@users.noreply.github.com> --- .../com/epam/ta/reportportal/config/EncryptConfiguration.java | 4 ++-- .../reportportal/filesystem/distributed/s3/S3DataStore.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java b/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java index b865b6add..4a0069e16 100644 --- a/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java +++ b/src/main/java/com/epam/ta/reportportal/config/EncryptConfiguration.java @@ -116,8 +116,8 @@ private String getPassword() { } private String loadFromDataStore() { - try { - return IOUtils.toString(dataStore.load(secretFilePath), StandardCharsets.UTF_8); + try (InputStream source = dataStore.load(secretFilePath)) { + return IOUtils.toString(source, StandardCharsets.UTF_8); } catch (IOException e) { throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, e.getMessage()); } diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java index 313e1102b..22b09474b 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java @@ -106,8 +106,8 @@ public InputStream load(String filePath) { S3File s3File = getS3File(filePath); Blob fileBlob = blobStore.getBlob(s3File.getBucket(), s3File.getFilePath()); if (fileBlob != null) { - try (InputStream inputStream = fileBlob.getPayload().openStream()) { - return inputStream; + try { + return fileBlob.getPayload().openStream(); } catch (IOException e) { throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, e.getMessage()); } From c02ebd5b662a9ece43153f57a10d5f72f8398aaf Mon Sep 17 00:00:00 2001 From: APiankouski <109206864+APiankouski@users.noreply.github.com> Date: Tue, 24 Oct 2023 13:02:48 +0300 Subject: [PATCH 088/110] Epmrpp 86248 || Auto-Analysis should skip already analyzed items on launch finish (#941) --- .../dao/TestItemRepositoryCustom.java | 2 ++ .../dao/TestItemRepositoryCustomImpl.java | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java index ef5883f47..1555838b0 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustom.java @@ -256,6 +256,8 @@ Page loadItemsHistoryPage(boolean isLatest, Queryable launchFil List findAllInIssueGroupByLaunch(Long launchId, TestItemIssueGroup issueGroup); + List findItemsForAnalyze(Long launchId); + /** * Select all {@link TestItem#getItemId()} of {@link TestItem} with attached {@link Issue} and * {@link TestItem#getLaunchId()} equal to provided `launchId` diff --git a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java index 688042e18..ac586a083 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/TestItemRepositoryCustomImpl.java @@ -45,6 +45,7 @@ import static com.epam.ta.reportportal.jooq.Tables.ISSUE; import static com.epam.ta.reportportal.jooq.Tables.ISSUE_GROUP; import static com.epam.ta.reportportal.jooq.Tables.ISSUE_TYPE_PROJECT; +import static com.epam.ta.reportportal.jooq.Tables.ITEM_ATTRIBUTE; import static com.epam.ta.reportportal.jooq.Tables.LAUNCH; import static com.epam.ta.reportportal.jooq.Tables.LOG; import static com.epam.ta.reportportal.jooq.Tables.PARAMETER; @@ -729,8 +730,38 @@ public List findAllInIssueGroupByLaunch(Long launchId, TestItemIssueGr .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) .join(ISSUE_GROUP) .on(ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)) + .leftOuterJoin(ITEM_ATTRIBUTE) + .on(TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID) + .and(ITEM_ATTRIBUTE.KEY.eq("immediateAA")) + .and(ITEM_ATTRIBUTE.VALUE.eq("true")) + .and(ITEM_ATTRIBUTE.SYSTEM.eq(true))) .where(TEST_ITEM.LAUNCH_ID.eq(launchId) .and(ISSUE_GROUP.ISSUE_GROUP_.eq(JIssueGroupEnum.valueOf(issueGroup.getValue())))) + .and(ITEM_ATTRIBUTE.ID.isNull()) + .fetch(TEST_ITEM_RECORD_MAPPER); + } + + @Override + public List findItemsForAnalyze(Long launchId) { + return dsl.select() + .from(TEST_ITEM) + .join(TEST_ITEM_RESULTS) + .on(TEST_ITEM.ITEM_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(ISSUE) + .on(ISSUE.ISSUE_ID.eq(TEST_ITEM_RESULTS.RESULT_ID)) + .join(ISSUE_TYPE) + .on(ISSUE.ISSUE_TYPE.eq(ISSUE_TYPE.ID)) + .join(ISSUE_GROUP) + .on(ISSUE_TYPE.ISSUE_GROUP_ID.eq(ISSUE_GROUP.ISSUE_GROUP_ID)) + .leftOuterJoin(ITEM_ATTRIBUTE) + .on(TEST_ITEM.ITEM_ID.eq(ITEM_ATTRIBUTE.ITEM_ID) + .and(ITEM_ATTRIBUTE.KEY.eq("immediateAA")) + .and(ITEM_ATTRIBUTE.VALUE.eq("true")) + .and(ITEM_ATTRIBUTE.SYSTEM.eq(true))) + .where(TEST_ITEM.LAUNCH_ID.eq(launchId) + .and(ISSUE_GROUP.ISSUE_GROUP_.eq( + JIssueGroupEnum.valueOf(TestItemIssueGroup.TO_INVESTIGATE.getValue())))) + .and(ITEM_ATTRIBUTE.ID.isNull()) .fetch(TEST_ITEM_RECORD_MAPPER); } From f042158b099e089c2bcd6504fd3021767f869280 Mon Sep 17 00:00:00 2001 From: Ivan Kustau <86599591+IvanKustau@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:50:22 +0300 Subject: [PATCH 089/110] EPMRPP-79482 || JCloud filesystem (#942) * EPMRPP-79482 || Create JCloud filesystem storage implementation * EPMRPP-79482 || Refactor JCloud filesystem implementation --- build.gradle | 1 + .../config/DataStoreConfiguration.java | 31 ++- .../filesystem/LocalDataStore.java | 112 ++++++----- .../distributed/s3/S3DataStore.java | 35 ++-- .../s3/{S3File.java => StoredFile.java} | 4 +- .../impl/AttachmentDataStoreServiceTest.java | 55 +++--- .../impl/CommonDataStoreServiceTest.java | 29 +-- .../binary/impl/UserDataStoreServiceTest.java | 21 +- .../config/TestConfiguration.java | 2 +- .../filesystem/LocalDataStoreTest.java | 180 ++++++++++++------ 10 files changed, 298 insertions(+), 172 deletions(-) rename src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/{S3File.java => StoredFile.java} (92%) diff --git a/build.gradle b/build.gradle index 1ba3e1864..9743e2d1b 100644 --- a/build.gradle +++ b/build.gradle @@ -97,6 +97,7 @@ dependencies { compile 'org.apache.jclouds.api:s3:2.5.0' compile 'org.apache.jclouds.provider:aws-s3:2.5.0' + implementation 'org.apache.jclouds.api:filesystem:2.5.0' testCompile 'org.springframework.boot:spring-boot-starter-test' testCompile 'org.flywaydb.flyway-test-extensions:flyway-spring-test:6.1.0' diff --git a/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java b/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java index 279253bde..fe0ad3293 100644 --- a/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java +++ b/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java @@ -30,12 +30,14 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.inject.Module; +import java.util.Properties; import java.util.Set; import org.jclouds.ContextBuilder; import org.jclouds.aws.s3.config.AWSS3HttpApiModule; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.BlobStoreContext; import org.jclouds.blobstore.ContainerNotFoundException; +import org.jclouds.filesystem.reference.FilesystemConstants; import org.jclouds.rest.ConfiguresHttpApi; import org.jclouds.s3.S3Client; import org.springframework.beans.factory.annotation.Autowired; @@ -78,7 +80,7 @@ protected CacheLoader> bucketToRegion( return new CacheLoader<>() { @Override - @SuppressWarnings({"Guava", "NullableProblems"}) + @SuppressWarnings({ "Guava", "NullableProblems" }) public Optional load(String bucket) { if (CustomBucketToRegionModule.this.region != null) { return Optional.of(CustomBucketToRegionModule.this.region); @@ -137,9 +139,24 @@ public String toString() { @Bean @ConditionalOnProperty(name = "datastore.type", havingValue = "filesystem") - public DataStore localDataStore( - @Value("${datastore.path:/data/store}") String storagePath) { - return new LocalDataStore(storagePath); + public BlobStore filesystemBlobStore( + @Value("${datastore.path:/data/store}") String baseDirectory) { + + Properties properties = new Properties(); + properties.setProperty(FilesystemConstants.PROPERTY_BASEDIR, baseDirectory); + + BlobStoreContext blobStoreContext = + ContextBuilder.newBuilder("filesystem").overrides(properties) + .buildView(BlobStoreContext.class); + + return blobStoreContext.getBlobStore(); + } + + @Bean + @ConditionalOnProperty(name = "datastore.type", havingValue = "filesystem") + public DataStore localDataStore(@Autowired BlobStore blobStore, + FeatureFlagHandler featureFlagHandler) { + return new LocalDataStore(blobStore, featureFlagHandler); } /** @@ -180,7 +197,8 @@ public DataStore minioDataStore(@Autowired BlobStore blobStore, @Value("${datastore.bucketPostfix}") String bucketPostfix, @Value("${datastore.defaultBucketName}") String defaultBucketName, @Value("${datastore.region}") String region, FeatureFlagHandler featureFlagHandler) { - return new S3DataStore(blobStore, bucketPrefix, bucketPostfix, defaultBucketName, region, featureFlagHandler); + return new S3DataStore( + blobStore, bucketPrefix, bucketPostfix, defaultBucketName, region, featureFlagHandler); } /** @@ -213,7 +231,8 @@ public DataStore s3DataStore(@Autowired BlobStore blobStore, @Value("${datastore.defaultBucketName}") String defaultBucketName, @Value("${datastore.region}") String region, FeatureFlagHandler featureFlagHandler) { return new S3DataStore(blobStore, bucketPrefix, bucketPostfix, defaultBucketName, region, - featureFlagHandler); + featureFlagHandler + ); } @Bean("attachmentThumbnailator") diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java index 34bb83299..f1274c3ac 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java @@ -16,16 +16,18 @@ package com.epam.ta.reportportal.filesystem; +import com.epam.ta.reportportal.entity.enums.FeatureFlag; import com.epam.ta.reportportal.exception.ReportPortalException; +import com.epam.ta.reportportal.filesystem.distributed.s3.StoredFile; +import com.epam.ta.reportportal.util.FeatureFlagHandler; import com.epam.ta.reportportal.ws.model.ErrorType; import java.io.IOException; import java.io.InputStream; -import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; import java.util.List; -import java.util.Objects; +import org.jclouds.blobstore.BlobStore; +import org.jclouds.blobstore.domain.Blob; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -34,88 +36,100 @@ */ public class LocalDataStore implements DataStore { - private static final Logger logger = LoggerFactory.getLogger(LocalDataStore.class); + private static final Logger LOGGER = LoggerFactory.getLogger(LocalDataStore.class); + private final BlobStore blobStore; - private final String storageRootPath; + private final FeatureFlagHandler featureFlagHandler; - public LocalDataStore(String storageRootPath) { - this.storageRootPath = storageRootPath; + private static final String SINGLE_BUCKET_NAME = "store"; + + private static final String PLUGINS = "plugins"; + + public LocalDataStore(BlobStore blobStore, FeatureFlagHandler featureFlagHandler) { + this.blobStore = blobStore; + this.featureFlagHandler = featureFlagHandler; } @Override public String save(String filePath, InputStream inputStream) { - + StoredFile storedFile = getStoredFile(filePath); try { - - Path targetPath = Paths.get(storageRootPath, filePath); - Path targetDirectory = targetPath.getParent(); - - if (Objects.nonNull(targetDirectory) && !Files.isDirectory(targetDirectory)) { - Files.createDirectories(targetDirectory); + if (!blobStore.containerExists(storedFile.getBucket())) { + blobStore.createContainerInLocation(null, storedFile.getBucket()); } - - logger.debug("Saving to: {} ", targetPath.toAbsolutePath()); - - Files.copy(inputStream, targetPath, StandardCopyOption.REPLACE_EXISTING); - + Blob objectBlob = blobStore.blobBuilder(storedFile.getFilePath()).payload(inputStream) + .contentDisposition(storedFile.getFilePath()).contentLength(inputStream.available()) + .build(); + blobStore.putBlob(storedFile.getBucket(), objectBlob); return filePath; } catch (IOException e) { - - logger.error("Unable to save log file '{}'", filePath, e); - - throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to save log file"); + throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to save file", e); } } @Override public InputStream load(String filePath) { - - try { - - return Files.newInputStream(Paths.get(storageRootPath, filePath)); - } catch (IOException e) { - - logger.error("Unable to find file '{}'", filePath, e); - - throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); + StoredFile storedFile = getStoredFile(filePath); + Blob fileBlob = blobStore.getBlob(storedFile.getBucket(), storedFile.getFilePath()); + if (fileBlob != null) { + try { + return fileBlob.getPayload().openStream(); + } catch (IOException e) { + throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, e.getMessage(), e); + } } + throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); } @Override public boolean exists(String filePath) { - return Files.exists(Paths.get(storageRootPath, filePath)); + StoredFile storedFile = getStoredFile(filePath); + if (blobStore.containerExists(storedFile.getBucket())) { + return blobStore.blobExists(storedFile.getBucket(), storedFile.getFilePath()); + } else { + LOGGER.warn("Container '{}' does not exist", storedFile.getBucket()); + return false; + } } @Override public void delete(String filePath) { - + StoredFile storedFile = getStoredFile(filePath); try { - - Files.deleteIfExists(Paths.get(storageRootPath, filePath)); - } catch (IOException e) { - - logger.error("Unable to delete file '{}'", filePath, e); - - throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to delete file"); + blobStore.removeBlob(storedFile.getBucket(), storedFile.getFilePath()); + } catch (Exception e) { + throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to delete file", e); } } @Override public void deleteAll(List filePaths, String bucketName) { - for (String filePath : filePaths) { - delete(filePath); + if (!featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { + blobStore.removeBlobs(bucketName, filePaths); + } else { + blobStore.removeBlobs(SINGLE_BUCKET_NAME, filePaths); } } @Override public void deleteContainer(String bucketName) { - try { - Files.deleteIfExists(Paths.get(bucketName)); - } catch (IOException e) { - - logger.error("Unable to delete bucket '{}'", bucketName, e); + blobStore.deleteContainer(bucketName); + } - throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to delete file"); + private StoredFile getStoredFile(String filePath) { + Path targetPath = Paths.get(filePath); + if (featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { + return new StoredFile(SINGLE_BUCKET_NAME, filePath); + } else { + int nameCount = targetPath.getNameCount(); + if (nameCount > 1) { + String bucketName = targetPath.getName(0).toString(); + String newFilePath = targetPath.subpath(1, nameCount).toString(); + return new StoredFile(bucketName, newFilePath); + } else { + return new StoredFile(PLUGINS, filePath); + } } } } + diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java index 22b09474b..e809fdda8 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java @@ -27,7 +27,6 @@ import java.nio.file.Paths; import java.util.List; import java.util.Objects; -import java.util.Optional; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import org.jclouds.blobstore.BlobStore; @@ -78,22 +77,22 @@ public S3DataStore(BlobStore blobStore, String bucketPrefix, String bucketPostfi @Override public String save(String filePath, InputStream inputStream) { - S3File s3File = getS3File(filePath); + StoredFile storedFile = getStoredFile(filePath); try { - if (!blobStore.containerExists(s3File.getBucket())) { + if (!blobStore.containerExists(storedFile.getBucket())) { CREATE_BUCKET_LOCK.lock(); try { - if (!blobStore.containerExists(s3File.getBucket())) { - blobStore.createContainerInLocation(location, s3File.getBucket()); + if (!blobStore.containerExists(storedFile.getBucket())) { + blobStore.createContainerInLocation(location, storedFile.getBucket()); } } finally { CREATE_BUCKET_LOCK.unlock(); } } - Blob objectBlob = blobStore.blobBuilder(s3File.getFilePath()).payload(inputStream) - .contentDisposition(s3File.getFilePath()).contentLength(inputStream.available()).build(); - blobStore.putBlob(s3File.getBucket(), objectBlob); + Blob objectBlob = blobStore.blobBuilder(storedFile.getFilePath()).payload(inputStream) + .contentDisposition(storedFile.getFilePath()).contentLength(inputStream.available()).build(); + blobStore.putBlob(storedFile.getBucket(), objectBlob); return Paths.get(filePath).toString(); } catch (IOException e) { LOGGER.error("Unable to save file '{}'", filePath, e); @@ -103,8 +102,8 @@ public String save(String filePath, InputStream inputStream) { @Override public InputStream load(String filePath) { - S3File s3File = getS3File(filePath); - Blob fileBlob = blobStore.getBlob(s3File.getBucket(), s3File.getFilePath()); + StoredFile storedFile = getStoredFile(filePath); + Blob fileBlob = blobStore.getBlob(storedFile.getBucket(), storedFile.getFilePath()); if (fileBlob != null) { try { return fileBlob.getPayload().openStream(); @@ -118,15 +117,15 @@ public InputStream load(String filePath) { @Override public boolean exists(String filePath) { - S3File s3File = getS3File(filePath); - return blobStore.blobExists(s3File.getBucket(), s3File.getFilePath()); + StoredFile storedFile = getStoredFile(filePath); + return blobStore.blobExists(storedFile.getBucket(), storedFile.getFilePath()); } @Override public void delete(String filePath) { - S3File s3File = getS3File(filePath); + StoredFile storedFile = getStoredFile(filePath); try { - blobStore.removeBlob(s3File.getBucket(), s3File.getFilePath()); + blobStore.removeBlob(storedFile.getBucket(), storedFile.getFilePath()); } catch (Exception e) { LOGGER.error("Unable to delete file '{}'", filePath, e); throw new ReportPortalException(ErrorType.INCORRECT_REQUEST, "Unable to delete file"); @@ -151,19 +150,19 @@ public void deleteContainer(String bucketName) { } } - private S3File getS3File(String filePath) { + private StoredFile getStoredFile(String filePath) { if (featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { - return new S3File(defaultBucketName, filePath); + return new StoredFile(defaultBucketName, filePath); } Path targetPath = Paths.get(filePath); int nameCount = targetPath.getNameCount(); String bucketName; if (nameCount > 1) { bucketName = bucketPrefix + retrievePath(targetPath, 0, 1) + bucketPostfix; - return new S3File(bucketName, retrievePath(targetPath, 1, nameCount)); + return new StoredFile(bucketName, retrievePath(targetPath, 1, nameCount)); } else { bucketName = bucketPrefix + defaultBucketName + bucketPostfix; - return new S3File(bucketName, retrievePath(targetPath, 0, 1)); + return new StoredFile(bucketName, retrievePath(targetPath, 0, 1)); } } diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3File.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/StoredFile.java similarity index 92% rename from src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3File.java rename to src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/StoredFile.java index aac56b4f3..6e661fece 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3File.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/StoredFile.java @@ -19,12 +19,12 @@ /** * @author Ivan Budayeu */ -public class S3File { +public class StoredFile { private final String bucket; private final String filePath; - public S3File(String bucket, String filePath) { + public StoredFile(String bucket, String filePath) { this.bucket = bucket; this.filePath = filePath; } diff --git a/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java b/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java index 5f8c7922f..ae1ef69b6 100644 --- a/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java +++ b/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java @@ -45,19 +45,26 @@ class AttachmentDataStoreServiceTest extends BaseTest { @Value("${datastore.path:/data/store}") private String storageRootPath; + private static final String BUCKET_NAME = "bucket"; + private static Random random = new Random(); @Test void saveLoadAndDeleteTest() throws IOException { InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); - String fileId = attachmentDataStoreService.save(random.nextLong() + "meh.jpg", inputStream); + String fileId = + attachmentDataStoreService.save(BUCKET_NAME + "/" + random.nextLong() + "meh.jpg", + inputStream + ); Optional loadedData = attachmentDataStoreService.load(fileId); assertTrue(loadedData.isPresent()); - assertTrue(Files.exists( - Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(fileId)))); + try (InputStream ignored = loadedData.get()) { + assertTrue(Files.exists( + Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(fileId)))); + } attachmentDataStoreService.delete(fileId); @@ -70,24 +77,28 @@ void saveLoadAndDeleteTest() throws IOException { @Test void saveLoadAndDeleteThumbnailTest() throws IOException { - InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); - - String thumbnailId = - attachmentDataStoreService.saveThumbnail(random.nextLong() + "thumbnail.jpg", inputStream); - - Optional loadedData = attachmentDataStoreService.load(thumbnailId); - - assertTrue(loadedData.isPresent()); - assertTrue(Files.exists( - Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(thumbnailId)))); - - attachmentDataStoreService.delete(thumbnailId); - - ReportPortalException exception = assertThrows(ReportPortalException.class, - () -> attachmentDataStoreService.load(thumbnailId) - ); - assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); - assertFalse(Files.exists( - Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(thumbnailId)))); + try (InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream()) { + String thumbnailId = attachmentDataStoreService.saveThumbnail( + BUCKET_NAME + "/" + random.nextLong() + "thumbnail.jpg", inputStream); + + Optional loadedData = attachmentDataStoreService.load(thumbnailId); + + assertTrue(loadedData.isPresent()); + try (InputStream is = loadedData.get()) { + assertTrue(Files.exists(Paths.get(storageRootPath, + attachmentDataStoreService.dataEncoder.decode(thumbnailId) + ))); + } + + attachmentDataStoreService.delete(thumbnailId); + + ReportPortalException exception = assertThrows(ReportPortalException.class, + () -> attachmentDataStoreService.load(thumbnailId) + ); + assertEquals( + "Unable to load binary data by id 'Unable to find file'", exception.getMessage()); + assertFalse(Files.exists( + Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(thumbnailId)))); + } } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java b/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java index cf840c7fd..050db9a70 100644 --- a/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java +++ b/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java @@ -56,11 +56,14 @@ class CommonDataStoreServiceTest extends BaseTest { @Value("${datastore.path:/data/store}") private String storageRootPath; + private static final String BUCKET_NAME = "bucket"; + @Test void saveTest() throws IOException { CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); - String fileId = - dataStoreService.save(multipartFile.getOriginalFilename(), multipartFile.getInputStream()); + String fileId = dataStoreService.save(BUCKET_NAME + "/" + multipartFile.getOriginalFilename(), + multipartFile.getInputStream() + ); assertNotNull(fileId); assertTrue(Files.exists(Paths.get(storageRootPath, dataEncoder.decode(fileId)))); dataStoreService.delete(fileId); @@ -69,9 +72,10 @@ void saveTest() throws IOException { @Test void saveThumbnailTest() throws IOException { CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); - String fileId = dataStoreService.saveThumbnail(multipartFile.getOriginalFilename(), - multipartFile.getInputStream() - ); + String fileId = + dataStoreService.saveThumbnail(BUCKET_NAME + "/" + multipartFile.getOriginalFilename(), + multipartFile.getInputStream() + ); assertNotNull(fileId); assertTrue(Files.exists(Paths.get(storageRootPath, dataEncoder.decode(fileId)))); dataStoreService.delete(fileId); @@ -80,9 +84,10 @@ void saveThumbnailTest() throws IOException { @Test void saveAndLoadTest() throws IOException { CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); - String fileId = dataStoreService.saveThumbnail(multipartFile.getOriginalFilename(), - multipartFile.getInputStream() - ); + String fileId = + dataStoreService.saveThumbnail(BUCKET_NAME + "/" + multipartFile.getOriginalFilename(), + multipartFile.getInputStream() + ); Optional content = dataStoreService.load(fileId); @@ -94,10 +99,10 @@ void saveAndLoadTest() throws IOException { void saveAndDeleteTest() throws IOException { CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); Random random = new Random(); - String fileId = - dataStoreService.save(random.nextLong() + "/" + multipartFile.getOriginalFilename(), - multipartFile.getInputStream() - ); + String fileId = dataStoreService.save( + BUCKET_NAME + "/" + random.nextLong() + "/" + multipartFile.getOriginalFilename(), + multipartFile.getInputStream() + ); dataStoreService.delete(fileId); diff --git a/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java b/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java index a35198301..fd634c346 100644 --- a/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java +++ b/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java @@ -45,19 +45,24 @@ class UserDataStoreServiceTest extends BaseTest { @Value("${datastore.path:/data/store}") private String storageRootPath; + private static final String BUCKET_NAME = "bucket"; + private static Random random = new Random(); @Test void saveLoadAndDeleteTest() throws IOException { InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); - String fileId = userDataStoreService.save(random.nextLong() + "meh.jpg", inputStream); + String fileId = + userDataStoreService.save(BUCKET_NAME + "/" + random.nextLong() + "meh.jpg", inputStream); Optional loadedData = userDataStoreService.load(fileId); assertTrue(loadedData.isPresent()); - assertTrue( - Files.exists(Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(fileId)))); + try (InputStream ignored = loadedData.get()) { + assertTrue(Files.exists( + Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(fileId)))); + } userDataStoreService.delete(fileId); @@ -73,13 +78,17 @@ void saveLoadAndDeleteThumbnailTest() throws IOException { InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); String thumbnailId = - userDataStoreService.saveThumbnail(random.nextLong() + "thmbnail.jpg", inputStream); + userDataStoreService.saveThumbnail(BUCKET_NAME + "/" + random.nextLong() + "thmbnail.jpg", + inputStream + ); Optional loadedData = userDataStoreService.load(thumbnailId); assertTrue(loadedData.isPresent()); - assertTrue(Files.exists( - Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(thumbnailId)))); + try (InputStream ignored = loadedData.get()) { + assertTrue(Files.exists( + Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(thumbnailId)))); + } userDataStoreService.delete(thumbnailId); diff --git a/src/test/java/com/epam/ta/reportportal/config/TestConfiguration.java b/src/test/java/com/epam/ta/reportportal/config/TestConfiguration.java index 28b57c9f5..a3cc2652e 100644 --- a/src/test/java/com/epam/ta/reportportal/config/TestConfiguration.java +++ b/src/test/java/com/epam/ta/reportportal/config/TestConfiguration.java @@ -36,7 +36,7 @@ @EnableConfigurationProperties @EnableAutoConfiguration(exclude = QuartzAutoConfiguration.class) @ComponentScan(basePackages = "com.epam.ta.reportportal") -@PropertySource({"classpath:test-application.properties"}) +@PropertySource({ "classpath:test-application.properties" }) public class TestConfiguration { @Bean("attachmentThumbnailator") diff --git a/src/test/java/com/epam/ta/reportportal/filesystem/LocalDataStoreTest.java b/src/test/java/com/epam/ta/reportportal/filesystem/LocalDataStoreTest.java index 363c35316..b38ea634a 100644 --- a/src/test/java/com/epam/ta/reportportal/filesystem/LocalDataStoreTest.java +++ b/src/test/java/com/epam/ta/reportportal/filesystem/LocalDataStoreTest.java @@ -16,80 +16,148 @@ package com.epam.ta.reportportal.filesystem; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.springframework.test.util.AssertionErrors.assertTrue; -import com.epam.ta.reportportal.entity.attachment.AttachmentMetaInfo; -import com.epam.ta.reportportal.exception.ReportPortalException; -import com.google.common.base.Charsets; -import java.io.ByteArrayInputStream; -import java.io.File; +import com.epam.ta.reportportal.entity.enums.FeatureFlag; +import com.epam.ta.reportportal.util.FeatureFlagHandler; import java.io.InputStream; -import java.nio.file.Paths; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; +import org.jclouds.blobstore.BlobStore; +import org.jclouds.blobstore.domain.Blob; +import org.jclouds.blobstore.domain.BlobBuilder; +import org.jclouds.io.Payload; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mockito; class LocalDataStoreTest { - private static final String ROOT_PATH = System.getProperty("java.io.tmpdir"); - private static final String TEST_FILE = "test-file.txt"; - private LocalDataStore localDataStore; - private FilePathGenerator fileNameGenerator; + private BlobStore blobStore; + + private FeatureFlagHandler featureFlagHandler; + + private final InputStream inputStream = mock(InputStream.class); + + private static final int ZERO = 0; + + private static final String SINGLE_BUCKET_NAME = "store"; + + private static final String FILE_PATH = "someFile.txt"; + + private static final String MULTI_BUCKET_NAME = "multiBucket"; + + private static final String MULTI_FILE_PATH = MULTI_BUCKET_NAME + "/" + FILE_PATH; @BeforeEach void setUp() { - fileNameGenerator = Mockito.mock(FilePathGenerator.class); + blobStore = Mockito.mock(BlobStore.class); + + featureFlagHandler = Mockito.mock(FeatureFlagHandler.class); + + localDataStore = new LocalDataStore(blobStore, featureFlagHandler); + } + + @Test + void whenSave_andSingleBucketIsEnabled_thenSaveToSingleBucket() throws Exception { + + BlobBuilder blobBuilderMock = mock(BlobBuilder.class); + BlobBuilder.PayloadBlobBuilder payloadBlobBuilderMock = + mock(BlobBuilder.PayloadBlobBuilder.class); + Blob blobMock = mock(Blob.class); + + when(inputStream.available()).thenReturn(ZERO); + when(payloadBlobBuilderMock.contentLength(ZERO)).thenReturn(payloadBlobBuilderMock); + when(payloadBlobBuilderMock.contentDisposition(FILE_PATH)).thenReturn(payloadBlobBuilderMock); + when(payloadBlobBuilderMock.build()).thenReturn(blobMock); + when(blobBuilderMock.payload(inputStream)).thenReturn(payloadBlobBuilderMock); + + when(featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)).thenReturn(true); + when(blobStore.blobBuilder(FILE_PATH)).thenReturn(blobBuilderMock); + + localDataStore.save(FILE_PATH, inputStream); + + verify(blobStore, times(1)).putBlob(SINGLE_BUCKET_NAME, blobMock); + } + + @Test + void whenLoad_andSingleBucketIsEnabled_thenReturnFromSingleBucket() throws Exception { + + Blob mockBlob = mock(Blob.class); + Payload mockPayload = mock(Payload.class); + + when(mockPayload.openStream()).thenReturn(inputStream); + when(mockBlob.getPayload()).thenReturn(mockPayload); + + when(featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)).thenReturn(true); + when(blobStore.getBlob(SINGLE_BUCKET_NAME, FILE_PATH)).thenReturn(mockBlob); + InputStream loaded = localDataStore.load(FILE_PATH); - localDataStore = new LocalDataStore(ROOT_PATH); + Assertions.assertEquals(inputStream, loaded); } @Test - void save_load_delete() throws Exception { - - // given: - AttachmentMetaInfo attachmentMetaInfo = AttachmentMetaInfo.builder() - .withProjectId(1L) - .withLaunchId(2L) - .withItemId(3L) - .withLogId(4L) - .build(); - String generatedDirectory = "/test"; - when(fileNameGenerator.generate(attachmentMetaInfo)).thenReturn(generatedDirectory); - FileUtils.deleteDirectory(new File(Paths.get(ROOT_PATH, generatedDirectory).toUri())); - - // when: save new file - String savedFilePath = localDataStore.save(TEST_FILE, - new ByteArrayInputStream("test text".getBytes(Charsets.UTF_8))); - - // and: load it back - InputStream loaded = localDataStore.load(savedFilePath); - - // then: saved and loaded files should be the same - byte[] bytes = IOUtils.toByteArray(loaded); - String result = new String(bytes, Charsets.UTF_8); - assertEquals("test text", result, "saved and loaded files should be the same"); - - // when: delete saved file - localDataStore.delete(savedFilePath); - - // and: load file again - boolean isNotFound = false; - try { - - localDataStore.load(savedFilePath); - } catch (ReportPortalException e) { - - isNotFound = true; - } - - // then: deleted file should not be found - assertTrue("deleted file should not be found", isNotFound); + void whenDelete_andSingleBucketIsEnabled_thenDeleteFromSingleBucket() throws Exception { + + when(featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)).thenReturn(true); + + localDataStore.delete(FILE_PATH); + + verify(blobStore, times(1)).removeBlob(SINGLE_BUCKET_NAME, FILE_PATH); + } + + @Test + void whenSave_andSingleBucketIsDisabled_andBucketInName_thenSaveToThisBucket() throws Exception { + + BlobBuilder blobBuilderMock = mock(BlobBuilder.class); + BlobBuilder.PayloadBlobBuilder payloadBlobBuilderMock = + mock(BlobBuilder.PayloadBlobBuilder.class); + Blob blobMock = mock(Blob.class); + + when(inputStream.available()).thenReturn(ZERO); + when(payloadBlobBuilderMock.contentLength(ZERO)).thenReturn(payloadBlobBuilderMock); + when(payloadBlobBuilderMock.contentDisposition(FILE_PATH)).thenReturn(payloadBlobBuilderMock); + when(payloadBlobBuilderMock.build()).thenReturn(blobMock); + when(blobBuilderMock.payload(inputStream)).thenReturn(payloadBlobBuilderMock); + + when(featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)).thenReturn(false); + when(blobStore.blobBuilder(FILE_PATH)).thenReturn(blobBuilderMock); + + localDataStore.save(MULTI_FILE_PATH, inputStream); + + verify(blobStore, times(1)).putBlob(MULTI_BUCKET_NAME, blobMock); + } + + @Test + void whenLoad_andSingleBucketIsDisabled_andBucketInName_thenReturnFromThisBucket() + throws Exception { + + Blob mockBlob = mock(Blob.class); + Payload mockPayload = mock(Payload.class); + + when(mockPayload.openStream()).thenReturn(inputStream); + when(mockBlob.getPayload()).thenReturn(mockPayload); + + when(featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)).thenReturn(false); + when(blobStore.getBlob(MULTI_BUCKET_NAME, FILE_PATH)).thenReturn(mockBlob); + InputStream loaded = localDataStore.load(MULTI_FILE_PATH); + + Assertions.assertEquals(inputStream, loaded); + } + + @Test + void whenDelete_andSingleBucketIsDisabled_andBucketInName_thenReturnFromThisBucket() + throws Exception { + + when(featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)).thenReturn(false); + + localDataStore.delete(MULTI_FILE_PATH); + + verify(blobStore, times(1)).removeBlob(MULTI_BUCKET_NAME, FILE_PATH); } } From 14766149b18c17abd8ca9d2e57e9f8f1c09b77ae Mon Sep 17 00:00:00 2001 From: Siarhei Hrabko <45555481+grabsefx@users.noreply.github.com> Date: Tue, 31 Oct 2023 11:29:21 +0300 Subject: [PATCH 090/110] EPMRPP-87044 exclude empty statistics records from processing (#943) --- .../content/HealthCheckTableChain.java | 16 ++++++++-------- .../dao/WidgetContentRepositoryTest.java | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableChain.java b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableChain.java index 13bc4f6ff..fad08c033 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableChain.java +++ b/src/main/java/com/epam/ta/reportportal/dao/widget/healthcheck/content/HealthCheckTableChain.java @@ -70,14 +70,14 @@ private List concat(boolean contentFirst, result.add(resultEntry); }); } else { - columnMapping.forEach((key, attributes) -> { - HealthCheckTableContent resultEntry = ofNullable(content.remove(key)).map( - statisticsContent -> entryFromStatistics(key, - statisticsContent - )).orElseGet(HealthCheckTableContent::new); - resultEntry.setCustomValues(attributes); - result.add(resultEntry); - }); + columnMapping.forEach((key, attributes) -> + ofNullable(content.remove(key)) + .map(statisticsContent -> entryFromStatistics(key, statisticsContent)) + .ifPresent(resultEntry -> { + resultEntry.setCustomValues(attributes); + result.add(resultEntry); + })); + content.forEach((key, statistics) -> result.add(entryFromStatistics(key, statistics))); } return result; diff --git a/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java index 53aa25035..682536a10 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryTest.java @@ -1337,7 +1337,7 @@ void componentHealthCheckTable() { .of("first", "build", Sort.by(Sort.Direction.DESC, "customColumn"), true, new ArrayList<>())); - assertFalse(healthCheckTableContents.isEmpty()); + assertTrue(healthCheckTableContents.isEmpty()); initParams = HealthCheckTableInitParams.of("hello", com.google.common.collect.Lists.newArrayList("build")); @@ -1440,9 +1440,9 @@ void componentHealthCheckTableCompositeAttributeWithoutAny() { new ArrayList<>() )); - assertFalse(healthCheckTableContents.isEmpty()); + assertTrue(healthCheckTableContents.isEmpty()); widgetContentRepository.removeWidgetView(initParams.getViewName()); } -} \ No newline at end of file +} From ac5a7479c50a2298ae0508d4a39b03001755a922 Mon Sep 17 00:00:00 2001 From: Ivan_Kustau Date: Wed, 8 Nov 2023 10:37:49 +0300 Subject: [PATCH 091/110] EPMRPP-79482 || Refactor JCloud filesystem implementation --- .../ta/reportportal/filesystem/LocalDataStore.java | 12 ++++++++++++ .../filesystem/distributed/s3/S3DataStore.java | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java index f1274c3ac..62305e00c 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java @@ -52,6 +52,9 @@ public LocalDataStore(BlobStore blobStore, FeatureFlagHandler featureFlagHandler @Override public String save(String filePath, InputStream inputStream) { + if (filePath == null){ + return ""; + } StoredFile storedFile = getStoredFile(filePath); try { if (!blobStore.containerExists(storedFile.getBucket())) { @@ -69,6 +72,9 @@ public String save(String filePath, InputStream inputStream) { @Override public InputStream load(String filePath) { + if (filePath == null){ + throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); + } StoredFile storedFile = getStoredFile(filePath); Blob fileBlob = blobStore.getBlob(storedFile.getBucket(), storedFile.getFilePath()); if (fileBlob != null) { @@ -83,6 +89,9 @@ public InputStream load(String filePath) { @Override public boolean exists(String filePath) { + if (filePath == null){ + return false; + } StoredFile storedFile = getStoredFile(filePath); if (blobStore.containerExists(storedFile.getBucket())) { return blobStore.blobExists(storedFile.getBucket(), storedFile.getFilePath()); @@ -94,6 +103,9 @@ public boolean exists(String filePath) { @Override public void delete(String filePath) { + if (filePath == null){ + return; + } StoredFile storedFile = getStoredFile(filePath); try { blobStore.removeBlob(storedFile.getBucket(), storedFile.getFilePath()); diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java index e809fdda8..62787dcbf 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java @@ -77,6 +77,9 @@ public S3DataStore(BlobStore blobStore, String bucketPrefix, String bucketPostfi @Override public String save(String filePath, InputStream inputStream) { + if (filePath == null){ + return ""; + } StoredFile storedFile = getStoredFile(filePath); try { if (!blobStore.containerExists(storedFile.getBucket())) { @@ -102,6 +105,10 @@ public String save(String filePath, InputStream inputStream) { @Override public InputStream load(String filePath) { + if (filePath == null){ + LOGGER.error("Unable to find file"); + throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); + } StoredFile storedFile = getStoredFile(filePath); Blob fileBlob = blobStore.getBlob(storedFile.getBucket(), storedFile.getFilePath()); if (fileBlob != null) { @@ -117,12 +124,18 @@ public InputStream load(String filePath) { @Override public boolean exists(String filePath) { + if (filePath == null){ + return false; + } StoredFile storedFile = getStoredFile(filePath); return blobStore.blobExists(storedFile.getBucket(), storedFile.getFilePath()); } @Override public void delete(String filePath) { + if (filePath == null){ + return; + } StoredFile storedFile = getStoredFile(filePath); try { blobStore.removeBlob(storedFile.getBucket(), storedFile.getFilePath()); From c37885018cece5ac0524391a1be4717068188764 Mon Sep 17 00:00:00 2001 From: Ivan_Kustau Date: Wed, 8 Nov 2023 10:37:49 +0300 Subject: [PATCH 092/110] EPMRPP-82591 || Add check for null file path --- .../ta/reportportal/filesystem/LocalDataStore.java | 12 ++++++++++++ .../filesystem/distributed/s3/S3DataStore.java | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java index f1274c3ac..62305e00c 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java @@ -52,6 +52,9 @@ public LocalDataStore(BlobStore blobStore, FeatureFlagHandler featureFlagHandler @Override public String save(String filePath, InputStream inputStream) { + if (filePath == null){ + return ""; + } StoredFile storedFile = getStoredFile(filePath); try { if (!blobStore.containerExists(storedFile.getBucket())) { @@ -69,6 +72,9 @@ public String save(String filePath, InputStream inputStream) { @Override public InputStream load(String filePath) { + if (filePath == null){ + throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); + } StoredFile storedFile = getStoredFile(filePath); Blob fileBlob = blobStore.getBlob(storedFile.getBucket(), storedFile.getFilePath()); if (fileBlob != null) { @@ -83,6 +89,9 @@ public InputStream load(String filePath) { @Override public boolean exists(String filePath) { + if (filePath == null){ + return false; + } StoredFile storedFile = getStoredFile(filePath); if (blobStore.containerExists(storedFile.getBucket())) { return blobStore.blobExists(storedFile.getBucket(), storedFile.getFilePath()); @@ -94,6 +103,9 @@ public boolean exists(String filePath) { @Override public void delete(String filePath) { + if (filePath == null){ + return; + } StoredFile storedFile = getStoredFile(filePath); try { blobStore.removeBlob(storedFile.getBucket(), storedFile.getFilePath()); diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java index e809fdda8..62787dcbf 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java @@ -77,6 +77,9 @@ public S3DataStore(BlobStore blobStore, String bucketPrefix, String bucketPostfi @Override public String save(String filePath, InputStream inputStream) { + if (filePath == null){ + return ""; + } StoredFile storedFile = getStoredFile(filePath); try { if (!blobStore.containerExists(storedFile.getBucket())) { @@ -102,6 +105,10 @@ public String save(String filePath, InputStream inputStream) { @Override public InputStream load(String filePath) { + if (filePath == null){ + LOGGER.error("Unable to find file"); + throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); + } StoredFile storedFile = getStoredFile(filePath); Blob fileBlob = blobStore.getBlob(storedFile.getBucket(), storedFile.getFilePath()); if (fileBlob != null) { @@ -117,12 +124,18 @@ public InputStream load(String filePath) { @Override public boolean exists(String filePath) { + if (filePath == null){ + return false; + } StoredFile storedFile = getStoredFile(filePath); return blobStore.blobExists(storedFile.getBucket(), storedFile.getFilePath()); } @Override public void delete(String filePath) { + if (filePath == null){ + return; + } StoredFile storedFile = getStoredFile(filePath); try { blobStore.removeBlob(storedFile.getBucket(), storedFile.getFilePath()); From 3be9b8a436fc5d7d96f58ed1acfbeb1ee14c9860 Mon Sep 17 00:00:00 2001 From: Siarhei Hrabko <45555481+grabsefx@users.noreply.github.com> Date: Thu, 9 Nov 2023 12:20:01 +0300 Subject: [PATCH 093/110] EPMRPP-87173 exclude SKIPPED items from flaky tests widget (#944) --- gradle.properties | 2 +- .../epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 1e9baf98f..24cce7a9a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=5.10.0 \ No newline at end of file +version=5.10.0 diff --git a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java index 092217e85..282da42ec 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/WidgetContentRepositoryImpl.java @@ -409,6 +409,7 @@ public List flakyCasesStatistics(Filter filter, boolean .and(TEST_ITEM.HAS_STATS.eq(Boolean.TRUE)) .and(TEST_ITEM.HAS_CHILDREN.eq(false)) .and(TEST_ITEM.RETRY_OF.isNull()) + .and(TEST_ITEM_RESULTS.STATUS.notEqual(JStatusEnum.SKIPPED)) .groupBy(TEST_ITEM.ITEM_ID, TEST_ITEM_RESULTS.STATUS, TEST_ITEM.UNIQUE_ID, TEST_ITEM.NAME, TEST_ITEM.START_TIME) .orderBy(TEST_ITEM.UNIQUE_ID, TEST_ITEM.START_TIME.desc()) From 86177cf9101cd51ce5c8979752e99c5e62157aa7 Mon Sep 17 00:00:00 2001 From: APiankouski <109206864+APiankouski@users.noreply.github.com> Date: Thu, 9 Nov 2023 13:06:50 +0300 Subject: [PATCH 094/110] EPMRPP-87537 || Launch number not indexing (#945) * EPMRPP-87537 || Launch number not indexing --- build.gradle | 2 +- .../epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java | 2 +- .../java/com/epam/ta/reportportal/dao/util/RecordMappers.java | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 9743e2d1b..c6a08b52c 100644 --- a/build.gradle +++ b/build.gradle @@ -63,7 +63,7 @@ dependencies { } else { compile 'com.github.reportportal:commons:ce2166b5' compile 'com.github.reportportal:commons-rules:5.10.0' - compile 'com.github.reportportal:commons-model:cd4791d' + compile 'com.github.reportportal:commons-model:67c5f50' } //https://nvd.nist.gov/vuln/detail/CVE-2020-10683 (dom4j 2.1.3 version dependency) AND https://nvd.nist.gov/vuln/detail/CVE-2019-14900 diff --git a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java index e94d9496a..962467be0 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java @@ -366,7 +366,7 @@ public boolean hasItemsWithLogsWithLogLevel(Long launchId, @Override public List findIndexLaunchByIds(List ids) { - return dsl.select(LAUNCH.ID, LAUNCH.NAME, LAUNCH.PROJECT_ID, LAUNCH.START_TIME) + return dsl.select(LAUNCH.ID, LAUNCH.NAME, LAUNCH.PROJECT_ID, LAUNCH.START_TIME, LAUNCH.NUMBER) .from(LAUNCH) .where(LAUNCH.ID.in(ids)) .orderBy(LAUNCH.ID) diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java index 0822a6a12..67106e201 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java @@ -115,6 +115,7 @@ import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Function; +import org.apache.commons.lang3.ObjectUtils; import org.apache.logging.log4j.util.Strings; import org.jooq.Field; import org.jooq.Record; @@ -351,6 +352,8 @@ public class RecordMappers { indexLaunch.setLaunchName(record.get(LAUNCH.NAME)); indexLaunch.setLaunchStartTime(record.get(LAUNCH.START_TIME).toLocalDateTime()); indexLaunch.setProjectId(record.get(LAUNCH.PROJECT_ID)); + indexLaunch.setLaunchNumber( + (record.get(LAUNCH.NUMBER) != null) ? record.get(LAUNCH.NUMBER).longValue() : null); return indexLaunch; }; From 897397efe8502f5a2339476240b7b63465e44687 Mon Sep 17 00:00:00 2001 From: PeeAyBee Date: Fri, 10 Nov 2023 10:25:57 +0300 Subject: [PATCH 095/110] EPMRPP-80574 || Update dependencies (#947) --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index c6a08b52c..3ff9cfc25 100644 --- a/build.gradle +++ b/build.gradle @@ -62,8 +62,8 @@ dependencies { compile 'com.epam.reportportal:commons-model' } else { compile 'com.github.reportportal:commons:ce2166b5' - compile 'com.github.reportportal:commons-rules:5.10.0' - compile 'com.github.reportportal:commons-model:67c5f50' + compile 'com.github.reportportal:commons-rules:e859db2' + compile 'com.github.reportportal:commons-model:9ec180b' } //https://nvd.nist.gov/vuln/detail/CVE-2020-10683 (dom4j 2.1.3 version dependency) AND https://nvd.nist.gov/vuln/detail/CVE-2019-14900 From 79904245003e9c3a6907304d901a5841494b36fd Mon Sep 17 00:00:00 2001 From: PeeAyBee Date: Fri, 10 Nov 2023 19:46:31 +0300 Subject: [PATCH 096/110] Update build.gradle (#948) --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 3ff9cfc25..198c0d586 100644 --- a/build.gradle +++ b/build.gradle @@ -63,7 +63,7 @@ dependencies { } else { compile 'com.github.reportportal:commons:ce2166b5' compile 'com.github.reportportal:commons-rules:e859db2' - compile 'com.github.reportportal:commons-model:9ec180b' + compile 'com.github.reportportal:commons-model:bf40974' } //https://nvd.nist.gov/vuln/detail/CVE-2020-10683 (dom4j 2.1.3 version dependency) AND https://nvd.nist.gov/vuln/detail/CVE-2019-14900 From bbd11376407c40b506212926f439ef636ec0c390 Mon Sep 17 00:00:00 2001 From: Ivan_Kustau Date: Sat, 11 Nov 2023 11:58:34 +0300 Subject: [PATCH 097/110] EPMRPP-82591 || Refactor according to checkstyle --- .../ta/reportportal/filesystem/LocalDataStore.java | 8 ++++---- .../filesystem/distributed/s3/S3DataStore.java | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java index 62305e00c..0a3617022 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java @@ -52,7 +52,7 @@ public LocalDataStore(BlobStore blobStore, FeatureFlagHandler featureFlagHandler @Override public String save(String filePath, InputStream inputStream) { - if (filePath == null){ + if (filePath == null) { return ""; } StoredFile storedFile = getStoredFile(filePath); @@ -72,7 +72,7 @@ public String save(String filePath, InputStream inputStream) { @Override public InputStream load(String filePath) { - if (filePath == null){ + if (filePath == null) { throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); } StoredFile storedFile = getStoredFile(filePath); @@ -89,7 +89,7 @@ public InputStream load(String filePath) { @Override public boolean exists(String filePath) { - if (filePath == null){ + if (filePath == null) { return false; } StoredFile storedFile = getStoredFile(filePath); @@ -103,7 +103,7 @@ public boolean exists(String filePath) { @Override public void delete(String filePath) { - if (filePath == null){ + if (filePath == null) { return; } StoredFile storedFile = getStoredFile(filePath); diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java index 62787dcbf..17ab82a47 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java @@ -77,7 +77,7 @@ public S3DataStore(BlobStore blobStore, String bucketPrefix, String bucketPostfi @Override public String save(String filePath, InputStream inputStream) { - if (filePath == null){ + if (filePath == null) { return ""; } StoredFile storedFile = getStoredFile(filePath); @@ -94,7 +94,8 @@ public String save(String filePath, InputStream inputStream) { } Blob objectBlob = blobStore.blobBuilder(storedFile.getFilePath()).payload(inputStream) - .contentDisposition(storedFile.getFilePath()).contentLength(inputStream.available()).build(); + .contentDisposition(storedFile.getFilePath()).contentLength(inputStream.available()) + .build(); blobStore.putBlob(storedFile.getBucket(), objectBlob); return Paths.get(filePath).toString(); } catch (IOException e) { @@ -105,7 +106,7 @@ public String save(String filePath, InputStream inputStream) { @Override public InputStream load(String filePath) { - if (filePath == null){ + if (filePath == null) { LOGGER.error("Unable to find file"); throw new ReportPortalException(ErrorType.UNABLE_TO_LOAD_BINARY_DATA, "Unable to find file"); } @@ -124,7 +125,7 @@ public InputStream load(String filePath) { @Override public boolean exists(String filePath) { - if (filePath == null){ + if (filePath == null) { return false; } StoredFile storedFile = getStoredFile(filePath); @@ -133,7 +134,7 @@ public boolean exists(String filePath) { @Override public void delete(String filePath) { - if (filePath == null){ + if (filePath == null) { return; } StoredFile storedFile = getStoredFile(filePath); From 6627cb054e2dec7e176db6d031e747315e77c740 Mon Sep 17 00:00:00 2001 From: Siarhei Hrabko <45555481+grabsefx@users.noreply.github.com> Date: Mon, 13 Nov 2023 15:25:18 +0300 Subject: [PATCH 098/110] EPMRPP-87271 fixed datetime parser (#950) * EPMRPP-87271 fixed datetime parser --- build.gradle | 8 +- gradle.properties | 1 + .../commons/querygen/CriteriaHolder.java | 6 +- .../entity/activity/Activity.java | 143 +----------------- .../ta/reportportal/util/DateTimeUtils.java | 66 ++++++++ 5 files changed, 83 insertions(+), 141 deletions(-) create mode 100644 src/main/java/com/epam/ta/reportportal/util/DateTimeUtils.java diff --git a/build.gradle b/build.gradle index 198c0d586..bfb22a8ff 100644 --- a/build.gradle +++ b/build.gradle @@ -63,7 +63,7 @@ dependencies { } else { compile 'com.github.reportportal:commons:ce2166b5' compile 'com.github.reportportal:commons-rules:e859db2' - compile 'com.github.reportportal:commons-model:bf40974' + compile 'com.github.reportportal:commons-model:508b9ef' } //https://nvd.nist.gov/vuln/detail/CVE-2020-10683 (dom4j 2.1.3 version dependency) AND https://nvd.nist.gov/vuln/detail/CVE-2019-14900 @@ -99,6 +99,12 @@ dependencies { compile 'org.apache.jclouds.provider:aws-s3:2.5.0' implementation 'org.apache.jclouds.api:filesystem:2.5.0' + // add lombok support + compileOnly "org.projectlombok:lombok:${lombokVersion}" + annotationProcessor "org.projectlombok:lombok:${lombokVersion}" + testCompileOnly "org.projectlombok:lombok:${lombokVersion}" + testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}" + testCompile 'org.springframework.boot:spring-boot-starter-test' testCompile 'org.flywaydb.flyway-test-extensions:flyway-spring-test:6.1.0' diff --git a/gradle.properties b/gradle.properties index 24cce7a9a..4b30a6367 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,2 @@ version=5.10.0 +lombokVersion=1.18.30 diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/CriteriaHolder.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/CriteriaHolder.java index 995026760..244d04424 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/CriteriaHolder.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/CriteriaHolder.java @@ -30,6 +30,7 @@ import com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum; import com.epam.ta.reportportal.jooq.enums.JStatusEnum; import com.epam.ta.reportportal.jooq.enums.JTestItemTypeEnum; +import com.epam.ta.reportportal.util.DateTimeUtils; import com.epam.ta.reportportal.ws.model.ErrorType; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; @@ -165,8 +166,7 @@ public Object castValue(String oneValue, ErrorType errorType) { } else { try { - Instant instant = Instant.parse(oneValue); - castedValue = LocalDateTime.ofInstant(instant, ZoneId.systemDefault()); + castedValue = DateTimeUtils.parseDateTimeWithOffset(oneValue); } catch (DateTimeParseException e) { throw new ReportPortalException(errorType, Suppliers.formattedSupplier("Cannot convert '{}' to valid date", oneValue).get() @@ -245,4 +245,4 @@ private Long parseLong(String value, ErrorType errorType) { } } -} \ No newline at end of file +} diff --git a/src/main/java/com/epam/ta/reportportal/entity/activity/Activity.java b/src/main/java/com/epam/ta/reportportal/entity/activity/Activity.java index 537d94658..2750da580 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/activity/Activity.java +++ b/src/main/java/com/epam/ta/reportportal/entity/activity/Activity.java @@ -28,14 +28,9 @@ import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Transient; -import org.hibernate.annotations.Type; -import org.hibernate.annotations.TypeDef; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; @@ -47,6 +42,9 @@ @Entity @Table(name = "activity", schema = "public") @TypeDef(name = "activityDetails", typeClass = ActivityDetails.class) +@Getter +@Setter +@ToString public class Activity implements Serializable { @Id @@ -108,125 +106,6 @@ public Activity() { this.isSavedEvent = true; } - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public LocalDateTime getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(LocalDateTime createdAt) { - this.createdAt = createdAt; - } - - public EventAction getAction() { - return action; - } - - public void setAction(EventAction action) { - this.action = action; - } - - public String getEventName() { - return eventName; - } - - public void setEventName(String eventName) { - this.eventName = eventName; - } - - public EventPriority getPriority() { - return priority; - } - - public void setPriority(EventPriority priority) { - this.priority = priority; - } - - public Long getObjectId() { - return objectId; - } - - public void setObjectId(Long objectId) { - this.objectId = objectId; - } - - public String getObjectName() { - return objectName; - } - - public void setObjectName(String objectName) { - this.objectName = objectName; - } - - public EventObject getObjectType() { - return objectType; - } - - public void setObjectType(EventObject objectType) { - this.objectType = objectType; - } - - public Long getProjectId() { - return projectId; - } - - public void setProjectId(Long projectId) { - this.projectId = projectId; - } - - public String getProjectName() { - return projectName; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public ActivityDetails getDetails() { - return details; - } - - public void setDetails(ActivityDetails details) { - this.details = details; - } - - public Long getSubjectId() { - return subjectId; - } - - public void setSubjectId(Long subjectId) { - this.subjectId = subjectId; - } - - public String getSubjectName() { - return subjectName; - } - - public void setSubjectName(String subjectName) { - this.subjectName = subjectName; - } - - public EventSubject getSubjectType() { - return subjectType; - } - - public void setSubjectType(EventSubject subjectType) { - this.subjectType = subjectType; - } - - public boolean isSavedEvent() { - return isSavedEvent; - } - - public void setSavedEvent(boolean savedEvent) { - isSavedEvent = savedEvent; - } @Override public boolean equals(Object o) { @@ -245,14 +124,4 @@ public int hashCode() { return Objects.hash(id); } - @Override - public String toString() { - return "Activity{" + "createdAt=" + createdAt - + ", action=" + action + ", eventName='" + eventName + '\'' - + ", priority=" + priority + ", objectId=" + objectId - + ", objectName='" + objectName + '\'' + ", objectType=" - + objectType + ", projectId=" + projectId + ", details=" - + details + ", subjectId=" + subjectId + ", subjectName='" - + subjectName + '\'' + ", subjectType=" + subjectType + '}'; - } } diff --git a/src/main/java/com/epam/ta/reportportal/util/DateTimeUtils.java b/src/main/java/com/epam/ta/reportportal/util/DateTimeUtils.java new file mode 100644 index 000000000..ce1be3e94 --- /dev/null +++ b/src/main/java/com/epam/ta/reportportal/util/DateTimeUtils.java @@ -0,0 +1,66 @@ +/* + * Copyright 2023 EPAM Systems + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.epam.ta.reportportal.util; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeFormatterBuilder; +import java.time.temporal.TemporalAccessor; +import java.time.temporal.TemporalQueries; + +/** + * Utility class for date and time handling. + * + * @author Siarhei Hrabko + */ +public final class DateTimeUtils { + + private DateTimeUtils() { + } + + /** + * Parses datetime string to LocalDateTime. + * + * @param timestamp timestamp in different formats for parsing + * @return localDateTime + */ + public static LocalDateTime parseDateTimeWithOffset(String timestamp) { + DateTimeFormatter formatter = new DateTimeFormatterBuilder() + .appendOptional(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssZ")) + .appendOptional(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ")) + .appendOptional(DateTimeFormatter.RFC_1123_DATE_TIME) + .appendOptional(DateTimeFormatter.ISO_OFFSET_DATE_TIME) + .appendOptional(DateTimeFormatter.ISO_LOCAL_DATE_TIME) + .toFormatter(); + + TemporalAccessor temporalAccessor = formatter.parse(timestamp); + if (isParsedTimeStampHasOffset(temporalAccessor)) { + return ZonedDateTime.from(temporalAccessor) + .withZoneSameInstant(ZoneId.systemDefault()) + .toLocalDateTime(); + } else { + return LocalDateTime.from(temporalAccessor); + } + } + + private static boolean isParsedTimeStampHasOffset(TemporalAccessor temporalAccessor) { + return temporalAccessor.query(TemporalQueries.offset()) != null; + } + +} From 6f11ff310a8f9996a6e273de9fa202cfd4bb87d5 Mon Sep 17 00:00:00 2001 From: PeeAyBee Date: Thu, 16 Nov 2023 20:50:59 +0300 Subject: [PATCH 099/110] EPMRPP-87613 || Add back compatibility with older plugins --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index bfb22a8ff..310a28fd1 100644 --- a/build.gradle +++ b/build.gradle @@ -62,8 +62,8 @@ dependencies { compile 'com.epam.reportportal:commons-model' } else { compile 'com.github.reportportal:commons:ce2166b5' - compile 'com.github.reportportal:commons-rules:e859db2' - compile 'com.github.reportportal:commons-model:508b9ef' + compile 'com.github.reportportal:commons-rules:29c30a1' + compile 'com.github.reportportal:commons-model:83f012f' } //https://nvd.nist.gov/vuln/detail/CVE-2020-10683 (dom4j 2.1.3 version dependency) AND https://nvd.nist.gov/vuln/detail/CVE-2019-14900 From cdf390126bad172e5e03660e7527e0a8ff052077 Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Fri, 17 Nov 2023 15:18:56 +0300 Subject: [PATCH 100/110] EPMRPP-87591 || Page crashes when logging into RP --- .../java/com/epam/ta/reportportal/entity/project/Project.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/entity/project/Project.java b/src/main/java/com/epam/ta/reportportal/entity/project/Project.java index 3029c1911..75041070d 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/project/Project.java +++ b/src/main/java/com/epam/ta/reportportal/entity/project/Project.java @@ -70,7 +70,7 @@ public class Project implements Serializable { private Set projectAttributes = Sets.newHashSet(); @OneToMany(mappedBy = "project", cascade = {CascadeType.PERSIST, - CascadeType.MERGE}, fetch = FetchType.LAZY) + CascadeType.MERGE, CascadeType.REMOVE}, fetch = FetchType.LAZY) @OrderBy(value = "issue_type_id") private Set projectIssueTypes = Sets.newHashSet(); From 5aa51a5f307bec486d8c5bd04ea5cb46fed54363 Mon Sep 17 00:00:00 2001 From: Ivan_Kustau Date: Mon, 20 Nov 2023 12:20:07 +0300 Subject: [PATCH 101/110] EPMRPP-86835 || Update releaseMode to use Maven instead of Github --- build.gradle | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 310a28fd1..0c3630d71 100644 --- a/build.gradle +++ b/build.gradle @@ -33,17 +33,8 @@ apply from: 'jooq.gradle' repositories { mavenCentral { url "https://repo1.maven.org/maven2" } - if (releaseMode) { - dependencyRepos.forEach { path -> - maven { - setUrl("https://maven.pkg.github.com/reportportal/${path}") - credentials { - username = findProperty("githubUserName") - password = findProperty("githubToken") - } - } - } - } else { + + if (!releaseMode) { maven { url 'https://jitpack.io' } } } From e61a43602e4760a393e06f93512cdba3a4d087f3 Mon Sep 17 00:00:00 2001 From: Ivan_Kustau Date: Mon, 20 Nov 2023 16:38:33 +0300 Subject: [PATCH 102/110] EPMRPP-86835 || Update libs version --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 0c3630d71..7066710e7 100644 --- a/build.gradle +++ b/build.gradle @@ -52,8 +52,8 @@ dependencies { compile 'com.epam.reportportal:commons-rules' compile 'com.epam.reportportal:commons-model' } else { - compile 'com.github.reportportal:commons:ce2166b5' - compile 'com.github.reportportal:commons-rules:29c30a1' + compile 'com.github.reportportal:commons:07566b8e' + compile 'com.github.reportportal:commons-rules:01ec4d17' compile 'com.github.reportportal:commons-model:83f012f' } From a24202c1541239be3a68a1ffaa5768845b19ec5e Mon Sep 17 00:00:00 2001 From: Siarhei Hrabko <45555481+grabsefx@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:29:44 +0300 Subject: [PATCH 103/110] EPMRPP-87692 set auto analyzer mode "All launches with the same name" by default (#954) --- .../epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java b/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java index 6db857de7..fc1634dd1 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java +++ b/src/main/java/com/epam/ta/reportportal/entity/enums/ProjectAttributeEnum.java @@ -45,7 +45,7 @@ public enum ProjectAttributeEnum { AUTO_PATTERN_ANALYZER_ENABLED(Prefix.ANALYZER + "isAutoPatternAnalyzerEnabled", String.valueOf(false)), AUTO_ANALYZER_ENABLED(Prefix.ANALYZER + "isAutoAnalyzerEnabled", String.valueOf(true)), - AUTO_ANALYZER_MODE(Prefix.ANALYZER + "autoAnalyzerMode", AnalyzeMode.BY_LAUNCH_NAME.getValue()), + AUTO_ANALYZER_MODE(Prefix.ANALYZER + "autoAnalyzerMode", AnalyzeMode.CURRENT_AND_THE_SAME_NAME.getValue()), ALL_MESSAGES_SHOULD_MATCH(Prefix.ANALYZER + "allMessagesShouldMatch", String.valueOf(false)), SEARCH_LOGS_MIN_SHOULD_MATCH(Prefix.ANALYZER + "searchLogsMinShouldMatch", String.valueOf(ProjectAnalyzerConfig.MIN_SHOULD_MATCH)), From 9f76a581e1b31ef49563bcd94e01203728bd03f3 Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Wed, 22 Nov 2023 16:15:51 +0300 Subject: [PATCH 104/110] EPMRPP-87813 || Send to the analyzer the id of previous launch --- .../reportportal/dao/LaunchRepositoryCustom.java | 2 ++ .../dao/LaunchRepositoryCustomImpl.java | 16 ++++++++++++++++ .../reportportal/dao/LaunchRepositoryTest.java | 13 +++++++++++++ 3 files changed, 31 insertions(+) diff --git a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustom.java b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustom.java index 6619164ff..c0716b215 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustom.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustom.java @@ -122,4 +122,6 @@ boolean hasItemsWithLogsWithLogLevel(Long launchId, Collection findPreviousLaunchByProjectIdAndNameAndAttributesForLaunchIdAndModeNot( Long projectId, String name, String[] attributes, Long launchId, JLaunchModeEnum mode ); + + Optional findPreviousLaunchId(Launch launch); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java index 962467be0..1c1f92b90 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/LaunchRepositoryCustomImpl.java @@ -68,6 +68,9 @@ import java.util.stream.Collectors; import org.jooq.DSLContext; import org.jooq.Field; +import org.jooq.Record; +import org.jooq.Record1; +import org.jooq.SelectSeekStep1; import org.jooq.SortField; import org.jooq.impl.DSL; import org.springframework.beans.factory.annotation.Autowired; @@ -404,4 +407,17 @@ public Optional findPreviousLaunchByProjectIdAndNameAndAttributesForLaun .limit(1) .fetchOptionalInto(Launch.class); } + + public Optional findPreviousLaunchId(Launch launch) { + return dsl + .select(LAUNCH.ID) + .from(LAUNCH) + .where(LAUNCH.ID.ne(launch.getId()) + .and(LAUNCH.NAME.eq(launch.getName())) + .and(LAUNCH.NUMBER.lt(launch.getNumber().intValue()) + .and(LAUNCH.PROJECT_ID.eq(launch.getProjectId())))) + .orderBy(LAUNCH.NUMBER.desc()) + .limit(1) + .fetchOptionalInto(Long.class); + } } diff --git a/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java index e4e71dd00..a38fd0f13 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java @@ -40,6 +40,7 @@ import com.epam.ta.reportportal.commons.querygen.FilterCondition; import com.epam.ta.reportportal.entity.enums.LaunchModeEnum; import com.epam.ta.reportportal.entity.enums.StatusEnum; +import com.epam.ta.reportportal.entity.item.TestItem; import com.epam.ta.reportportal.entity.launch.Launch; import com.epam.ta.reportportal.jooq.enums.JLaunchModeEnum; import com.epam.ta.reportportal.jooq.enums.JStatusEnum; @@ -445,6 +446,18 @@ void shouldNotFindLaunchesWithSystemAttributes() { assertTrue(launches.isEmpty()); } + @Test + void findPreviousLaunchId() { + Launch launch = new Launch(); + launch.setName("finished launch"); + launch.setId(100L); + launch.setProjectId(2L); + launch.setNumber(1L); + Optional previousLaunchId = launchRepository.findPreviousLaunchId(launch); + + assertEquals(200L, previousLaunchId.orElse(0L)); + } + private Filter buildDefaultFilter(Long projectId) { List conditionList = Lists.newArrayList( new FilterCondition(Condition.EQUALS, From 0adf10f8f698f436fea8fda9f80d72cc66071c8a Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Wed, 22 Nov 2023 16:23:08 +0300 Subject: [PATCH 105/110] EPMRPP-87813 || Send to the analyzer the id of previous launch --- .../com/epam/ta/reportportal/dao/LaunchRepositoryTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java b/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java index a38fd0f13..462a1ffdd 100644 --- a/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java +++ b/src/test/java/com/epam/ta/reportportal/dao/LaunchRepositoryTest.java @@ -450,9 +450,9 @@ void shouldNotFindLaunchesWithSystemAttributes() { void findPreviousLaunchId() { Launch launch = new Launch(); launch.setName("finished launch"); - launch.setId(100L); + launch.setId(300L); launch.setProjectId(2L); - launch.setNumber(1L); + launch.setNumber(3L); Optional previousLaunchId = launchRepository.findPreviousLaunchId(launch); assertEquals(200L, previousLaunchId.orElse(0L)); From ae1098e4df81454e4bdbe6a451f9b2b86a5299b8 Mon Sep 17 00:00:00 2001 From: Andrei Piankouski Date: Wed, 22 Nov 2023 16:42:15 +0300 Subject: [PATCH 106/110] EPMRPP-87813 || Remove space --- src/main/java/com/epam/ta/reportportal/entity/AnalyzeMode.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/epam/ta/reportportal/entity/AnalyzeMode.java b/src/main/java/com/epam/ta/reportportal/entity/AnalyzeMode.java index 722392f76..1ba7584c1 100644 --- a/src/main/java/com/epam/ta/reportportal/entity/AnalyzeMode.java +++ b/src/main/java/com/epam/ta/reportportal/entity/AnalyzeMode.java @@ -28,7 +28,6 @@ public enum AnalyzeMode { BY_LAUNCH_NAME("LAUNCH_NAME"), CURRENT_LAUNCH("CURRENT_LAUNCH"), PREVIOUS_LAUNCH("PREVIOUS_LAUNCH"), - CURRENT_AND_THE_SAME_NAME("CURRENT_AND_THE_SAME_NAME"); private String value; From 2df0dba03bae7f0aee59f1b549be7b93fb3d8b6f Mon Sep 17 00:00:00 2001 From: PeeAyBee Date: Mon, 27 Nov 2023 16:17:38 +0300 Subject: [PATCH 107/110] EPMRPP-87433 || Add missed filename for attachment record mapper (#956) * EPMRPP-80519 || Add methods for removing buckets and files * EPMRPP-80519 || Remove attachments by project id * EPMRPP-86363 exclude system attributes in launches table widget (#932) * EPMRPP-86363 exclude system attributes in launches table widget * EPMRPP-86363 fixed check-style comments * EPMRPP-87433 || Add missed filename to the attachment record mapper --------- Co-authored-by: Ivan_Kustau Co-authored-by: Ivan Kustau <86599591+IvanKustau@users.noreply.github.com> Co-authored-by: Siarhei Hrabko <45555481+grabsefx@users.noreply.github.com> Co-authored-by: Pavel Bortnik --- .../reportportal/dao/util/RecordMappers.java | 85 ++++++++++--------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java index 67106e201..265eba6c9 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java +++ b/src/main/java/com/epam/ta/reportportal/dao/util/RecordMappers.java @@ -129,7 +129,7 @@ */ public class RecordMappers { - private static final ObjectMapper objectMapper; + private static final ObjectMapper objectMapper; static { objectMapper = new ObjectMapper(); @@ -220,6 +220,7 @@ public class RecordMappers { attachment.setProjectId(r.get(ATTACHMENT.PROJECT_ID)); attachment.setLaunchId(r.get(ATTACHMENT.LAUNCH_ID)); attachment.setItemId(r.get(ATTACHMENT.ITEM_ID)); + attachment.setFileName(r.get(ATTACHMENT.FILE_NAME)); return attachment; }).orElse(null); @@ -323,8 +324,8 @@ public class RecordMappers { ); /** - * Maps record into {@link PatternTemplate} object (only {@link PatternTemplate#id} and - * {@link PatternTemplate#name} fields) + * Maps record into {@link PatternTemplate} object (only {@link PatternTemplate#id} and {@link + * PatternTemplate#name} fields) */ public static final Function> PATTERN_TEMPLATE_NAME_RECORD_MAPPER = r -> ofNullable( r.get( @@ -409,45 +410,45 @@ public class RecordMappers { return new ReportPortalUser.ProjectDetails(projectId, projectName, projectRole); }; - public static final RecordMapper ACTIVITY_MAPPER = r -> { - Activity activity = new Activity(); - activity.setId(r.get(ACTIVITY.ID)); - activity.setCreatedAt(r.get(ACTIVITY.CREATED_AT, LocalDateTime.class)); - activity.setAction(EventAction.valueOf(r.get(ACTIVITY.ACTION))); - activity.setEventName(r.get(ACTIVITY.EVENT_NAME)); - activity.setPriority(EventPriority.valueOf(r.get(ACTIVITY.PRIORITY))); - activity.setObjectId(r.get(ACTIVITY.OBJECT_ID)); - activity.setObjectName(r.get(ACTIVITY.OBJECT_NAME)); - activity.setObjectType(EventObject.valueOf(r.get(ACTIVITY.OBJECT_TYPE))); - activity.setProjectId(r.get(ACTIVITY.PROJECT_ID)); - activity.setProjectName(r.get(PROJECT.NAME)); - String detailsJson = r.get(ACTIVITY.DETAILS, String.class); - ofNullable(detailsJson).ifPresent(s -> { - try { - ActivityDetails details = objectMapper.readValue(s, ActivityDetails.class); - activity.setDetails(details); - } catch (IOException e) { - throw new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR); - } - }); - activity.setSubjectId(r.get(ACTIVITY.SUBJECT_ID)); - activity.setSubjectName(ofNullable(r.get(USERS.LOGIN)).orElse(r.get(ACTIVITY.SUBJECT_NAME))); - activity.setSubjectType(EventSubject.valueOf(r.get(ACTIVITY.SUBJECT_TYPE))); - return activity; - }; - - public static final RecordMapper OWNED_ENTITY_RECORD_MAPPER = r -> r.into( - OwnedEntity.class); - - private static final BiConsumer WIDGET_USER_FILTER_MAPPER = (widget, res) -> ofNullable( - res.get(FILTER.ID)).ifPresent( - id -> { - Set filters = ofNullable(widget.getFilters()).orElseGet(Sets::newLinkedHashSet); - UserFilter filter = new UserFilter(); - filter.setId(id); - filters.add(filter); - widget.setFilters(filters); - }); + public static final RecordMapper ACTIVITY_MAPPER = r -> { + Activity activity = new Activity(); + activity.setId(r.get(ACTIVITY.ID)); + activity.setCreatedAt(r.get(ACTIVITY.CREATED_AT, LocalDateTime.class)); + activity.setAction(EventAction.valueOf(r.get(ACTIVITY.ACTION))); + activity.setEventName(r.get(ACTIVITY.EVENT_NAME)); + activity.setPriority(EventPriority.valueOf(r.get(ACTIVITY.PRIORITY))); + activity.setObjectId(r.get(ACTIVITY.OBJECT_ID)); + activity.setObjectName(r.get(ACTIVITY.OBJECT_NAME)); + activity.setObjectType(EventObject.valueOf(r.get(ACTIVITY.OBJECT_TYPE))); + activity.setProjectId(r.get(ACTIVITY.PROJECT_ID)); + activity.setProjectName(r.get(PROJECT.NAME)); + String detailsJson = r.get(ACTIVITY.DETAILS, String.class); + ofNullable(detailsJson).ifPresent(s -> { + try { + ActivityDetails details = objectMapper.readValue(s, ActivityDetails.class); + activity.setDetails(details); + } catch (IOException e) { + throw new ReportPortalException(ErrorType.UNCLASSIFIED_REPORT_PORTAL_ERROR); + } + }); + activity.setSubjectId(r.get(ACTIVITY.SUBJECT_ID)); + activity.setSubjectName(ofNullable(r.get(USERS.LOGIN)).orElse(r.get(ACTIVITY.SUBJECT_NAME))); + activity.setSubjectType(EventSubject.valueOf(r.get(ACTIVITY.SUBJECT_TYPE))); + return activity; + }; + + public static final RecordMapper OWNED_ENTITY_RECORD_MAPPER = r -> r.into( + OwnedEntity.class); + + private static final BiConsumer WIDGET_USER_FILTER_MAPPER = (widget, res) -> ofNullable( + res.get(FILTER.ID)).ifPresent( + id -> { + Set filters = ofNullable(widget.getFilters()).orElseGet(Sets::newLinkedHashSet); + UserFilter filter = new UserFilter(); + filter.setId(id); + filters.add(filter); + widget.setFilters(filters); + }); private static final BiConsumer WIDGET_OPTIONS_MAPPER = (widget, res) -> { ofNullable(res.get(WIDGET.WIDGET_OPTIONS, String.class)).ifPresent(wo -> { From 126ee2ed792e3d7a484b053be2a88bf9185cf505 Mon Sep 17 00:00:00 2001 From: PeeAyBee Date: Mon, 27 Nov 2023 17:59:28 +0300 Subject: [PATCH 108/110] EPMRPP-87433 || Add missed attachment file name fetch (#957) --- .../ta/reportportal/commons/querygen/FilterTarget.java | 3 ++- .../reportportal/dao/AttachmentRepositoryCustomImpl.java | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java index d9f820c62..935f1f703 100644 --- a/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java +++ b/src/main/java/com/epam/ta/reportportal/commons/querygen/FilterTarget.java @@ -1080,7 +1080,8 @@ protected Collection selectFields() { ATTACHMENT.FILE_SIZE, ATTACHMENT.PROJECT_ID, ATTACHMENT.LAUNCH_ID, - ATTACHMENT.ITEM_ID + ATTACHMENT.ITEM_ID, + ATTACHMENT.FILE_NAME ); } diff --git a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepositoryCustomImpl.java b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepositoryCustomImpl.java index 2223e5309..8db42fa94 100644 --- a/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepositoryCustomImpl.java +++ b/src/main/java/com/epam/ta/reportportal/dao/AttachmentRepositoryCustomImpl.java @@ -150,7 +150,8 @@ public List findByItemIdsAndLogTimeBefore(Collection itemIds, ATTACHMENT.FILE_SIZE, ATTACHMENT.ITEM_ID, ATTACHMENT.LAUNCH_ID, - ATTACHMENT.PROJECT_ID + ATTACHMENT.PROJECT_ID, + ATTACHMENT.FILE_NAME ) .from(ATTACHMENT) .join(LOG) @@ -173,7 +174,8 @@ public List findByLaunchIdsAndLogTimeBefore(Collection launchI ATTACHMENT.FILE_SIZE, ATTACHMENT.ITEM_ID, ATTACHMENT.LAUNCH_ID, - ATTACHMENT.PROJECT_ID + ATTACHMENT.PROJECT_ID, + ATTACHMENT.FILE_NAME ) .from(ATTACHMENT) .join(LOG) @@ -194,7 +196,8 @@ public List findByProjectIdsAndLogTimeBefore(Long projectId, LocalDa ATTACHMENT.FILE_SIZE, ATTACHMENT.ITEM_ID, ATTACHMENT.LAUNCH_ID, - ATTACHMENT.PROJECT_ID + ATTACHMENT.PROJECT_ID, + ATTACHMENT.FILE_NAME ) .from(ATTACHMENT) .join(LOG) From 516ace351e02a0bbf5c192c106a97144552e1d6d Mon Sep 17 00:00:00 2001 From: Ivan Kustau <86599591+IvanKustau@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:15:49 +0300 Subject: [PATCH 109/110] EPMRPP-88755 || Add prefix and postfix for filesystem (#963) * Add ability to use prefix and postfix in filesystem * Remove redundant code * Remove prefix and postfix for plugins bucket * Fix tests * Fix CommonDataStoreServiceTest * Test commit * Test commit * Change logback-test.xml * Change asserts * Make tests OS independent * Fix failed tests --- .../config/DataStoreConfiguration.java | 8 +++- .../filesystem/LocalDataStore.java | 41 ++++++++++++------- .../distributed/s3/S3DataStore.java | 2 +- .../impl/AttachmentDataStoreServiceTest.java | 33 ++++++++++----- .../impl/CommonDataStoreServiceTest.java | 38 ++++++++++++----- .../binary/impl/UserDataStoreServiceTest.java | 30 ++++++++++---- .../filesystem/LocalDataStoreTest.java | 29 +++++++++---- .../distributed/s3/S3DataStoreTest.java | 32 +++++++++------ src/test/resources/logback-test.xml | 5 +-- .../resources/test-application.properties | 3 ++ 10 files changed, 150 insertions(+), 71 deletions(-) diff --git a/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java b/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java index fe0ad3293..e4b2d1203 100644 --- a/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java +++ b/src/main/java/com/epam/ta/reportportal/config/DataStoreConfiguration.java @@ -155,8 +155,12 @@ public BlobStore filesystemBlobStore( @Bean @ConditionalOnProperty(name = "datastore.type", havingValue = "filesystem") public DataStore localDataStore(@Autowired BlobStore blobStore, - FeatureFlagHandler featureFlagHandler) { - return new LocalDataStore(blobStore, featureFlagHandler); + FeatureFlagHandler featureFlagHandler, + @Value("${datastore.bucketPrefix}") String bucketPrefix, + @Value("${datastore.bucketPostfix}") String bucketPostfix, + @Value("${datastore.defaultBucketName}") String defaultBucketName) { + return new LocalDataStore( + blobStore, featureFlagHandler, bucketPrefix, bucketPostfix, defaultBucketName); } /** diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java index 0a3617022..5b2ea84a0 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/LocalDataStore.java @@ -26,6 +26,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; +import java.util.Objects; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.domain.Blob; import org.slf4j.Logger; @@ -41,13 +42,19 @@ public class LocalDataStore implements DataStore { private final FeatureFlagHandler featureFlagHandler; - private static final String SINGLE_BUCKET_NAME = "store"; + private final String bucketPrefix; - private static final String PLUGINS = "plugins"; + private final String bucketPostfix; - public LocalDataStore(BlobStore blobStore, FeatureFlagHandler featureFlagHandler) { + private final String defaultBucketName; + + public LocalDataStore(BlobStore blobStore, FeatureFlagHandler featureFlagHandler, + String bucketPrefix, String bucketPostfix, String defaultBucketName) { this.blobStore = blobStore; this.featureFlagHandler = featureFlagHandler; + this.bucketPrefix = bucketPrefix; + this.bucketPostfix = Objects.requireNonNullElse(bucketPostfix, ""); + this.defaultBucketName = defaultBucketName; } @Override @@ -117,9 +124,9 @@ public void delete(String filePath) { @Override public void deleteAll(List filePaths, String bucketName) { if (!featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { - blobStore.removeBlobs(bucketName, filePaths); + blobStore.removeBlobs(bucketPrefix + bucketName + bucketPostfix, filePaths); } else { - blobStore.removeBlobs(SINGLE_BUCKET_NAME, filePaths); + blobStore.removeBlobs(bucketName, filePaths); } } @@ -129,19 +136,23 @@ public void deleteContainer(String bucketName) { } private StoredFile getStoredFile(String filePath) { - Path targetPath = Paths.get(filePath); if (featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)) { - return new StoredFile(SINGLE_BUCKET_NAME, filePath); + return new StoredFile(defaultBucketName, filePath); + } + Path targetPath = Paths.get(filePath); + int nameCount = targetPath.getNameCount(); + String bucketName; + if (nameCount > 1) { + bucketName = bucketPrefix + retrievePath(targetPath, 0, 1) + bucketPostfix; + return new StoredFile(bucketName, retrievePath(targetPath, 1, nameCount)); } else { - int nameCount = targetPath.getNameCount(); - if (nameCount > 1) { - String bucketName = targetPath.getName(0).toString(); - String newFilePath = targetPath.subpath(1, nameCount).toString(); - return new StoredFile(bucketName, newFilePath); - } else { - return new StoredFile(PLUGINS, filePath); - } + bucketName = defaultBucketName; + return new StoredFile(bucketName, retrievePath(targetPath, 0, 1)); } } + + private String retrievePath(Path path, int beginIndex, int endIndex) { + return String.valueOf(path.subpath(beginIndex, endIndex)); + } } diff --git a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java index 17ab82a47..159197246 100644 --- a/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java +++ b/src/main/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStore.java @@ -175,7 +175,7 @@ private StoredFile getStoredFile(String filePath) { bucketName = bucketPrefix + retrievePath(targetPath, 0, 1) + bucketPostfix; return new StoredFile(bucketName, retrievePath(targetPath, 1, nameCount)); } else { - bucketName = bucketPrefix + defaultBucketName + bucketPostfix; + bucketName = defaultBucketName; return new StoredFile(bucketName, retrievePath(targetPath, 0, 1)); } } diff --git a/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java b/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java index ae1ef69b6..52f46af89 100644 --- a/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java +++ b/src/test/java/com/epam/ta/reportportal/binary/impl/AttachmentDataStoreServiceTest.java @@ -45,6 +45,12 @@ class AttachmentDataStoreServiceTest extends BaseTest { @Value("${datastore.path:/data/store}") private String storageRootPath; + @Value("${datastore.bucketPrefix:prj-}") + private String bucketPrefix; + + @Value("${datastore.bucketPostfix:}") + private String bucketPostfix; + private static final String BUCKET_NAME = "bucket"; private static Random random = new Random(); @@ -53,6 +59,8 @@ class AttachmentDataStoreServiceTest extends BaseTest { void saveLoadAndDeleteTest() throws IOException { InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); + String bucketPath = bucketPrefix + BUCKET_NAME + bucketPostfix; + String fileId = attachmentDataStoreService.save(BUCKET_NAME + "/" + random.nextLong() + "meh.jpg", inputStream @@ -62,8 +70,9 @@ void saveLoadAndDeleteTest() throws IOException { assertTrue(loadedData.isPresent()); try (InputStream ignored = loadedData.get()) { - assertTrue(Files.exists( - Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(fileId)))); + String decodedPath = attachmentDataStoreService.dataEncoder.decode(fileId); + decodedPath = decodedPath.replace(BUCKET_NAME, bucketPath); + assertTrue(Files.exists(Paths.get(storageRootPath, decodedPath))); } attachmentDataStoreService.delete(fileId); @@ -71,23 +80,26 @@ void saveLoadAndDeleteTest() throws IOException { ReportPortalException exception = assertThrows(ReportPortalException.class, () -> attachmentDataStoreService.load(fileId)); assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); - assertFalse(Files.exists( - Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(fileId)))); + String decodedPath = attachmentDataStoreService.dataEncoder.decode(fileId); + decodedPath = decodedPath.replace(BUCKET_NAME, bucketPath); + assertFalse(Files.exists(Paths.get(storageRootPath, decodedPath))); } @Test void saveLoadAndDeleteThumbnailTest() throws IOException { try (InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream()) { + String bucketPath = bucketPrefix + BUCKET_NAME + bucketPostfix; + String thumbnailId = attachmentDataStoreService.saveThumbnail( BUCKET_NAME + "/" + random.nextLong() + "thumbnail.jpg", inputStream); Optional loadedData = attachmentDataStoreService.load(thumbnailId); assertTrue(loadedData.isPresent()); - try (InputStream is = loadedData.get()) { - assertTrue(Files.exists(Paths.get(storageRootPath, - attachmentDataStoreService.dataEncoder.decode(thumbnailId) - ))); + try (InputStream ignored = loadedData.get()) { + String decodedPath = attachmentDataStoreService.dataEncoder.decode(thumbnailId); + decodedPath = decodedPath.replace(BUCKET_NAME, bucketPath); + assertTrue(Files.exists(Paths.get(storageRootPath, decodedPath))); } attachmentDataStoreService.delete(thumbnailId); @@ -97,8 +109,9 @@ void saveLoadAndDeleteThumbnailTest() throws IOException { ); assertEquals( "Unable to load binary data by id 'Unable to find file'", exception.getMessage()); - assertFalse(Files.exists( - Paths.get(storageRootPath, attachmentDataStoreService.dataEncoder.decode(thumbnailId)))); + String decodedPath = attachmentDataStoreService.dataEncoder.decode(thumbnailId); + decodedPath = decodedPath.replace(BUCKET_NAME, bucketPath); + assertFalse(Files.exists(Paths.get(storageRootPath, decodedPath))); } } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java b/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java index 050db9a70..a6cafb7db 100644 --- a/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java +++ b/src/test/java/com/epam/ta/reportportal/binary/impl/CommonDataStoreServiceTest.java @@ -28,6 +28,7 @@ import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.Optional; import java.util.Random; @@ -35,6 +36,8 @@ import org.apache.commons.fileupload.disk.DiskFileItem; import org.apache.commons.io.IOUtils; import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; @@ -56,28 +59,43 @@ class CommonDataStoreServiceTest extends BaseTest { @Value("${datastore.path:/data/store}") private String storageRootPath; + @Value("${datastore.bucketPrefix:prj-}") + private String bucketPrefix; + + @Value("${datastore.bucketPostfix:}") + private String bucketPostfix; private static final String BUCKET_NAME = "bucket"; + private String getModifiedPath(String originalPath) { + String bucketPath = bucketPrefix + BUCKET_NAME + bucketPostfix; + return originalPath.replace(BUCKET_NAME, bucketPath); + } + @Test void saveTest() throws IOException { CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); - String fileId = dataStoreService.save(BUCKET_NAME + "/" + multipartFile.getOriginalFilename(), - multipartFile.getInputStream() - ); + String fileId = + dataStoreService.save(BUCKET_NAME + File.separator + multipartFile.getOriginalFilename(), + multipartFile.getInputStream() + ); assertNotNull(fileId); - assertTrue(Files.exists(Paths.get(storageRootPath, dataEncoder.decode(fileId)))); + String decodedPath = getModifiedPath(dataEncoder.decode(fileId)); + Path filePath = Paths.get(storageRootPath, decodedPath); + assertTrue(filePath.toFile().exists(), "File " + filePath + " does not exist"); dataStoreService.delete(fileId); } @Test void saveThumbnailTest() throws IOException { CommonsMultipartFile multipartFile = getMultipartFile("meh.jpg"); - String fileId = - dataStoreService.saveThumbnail(BUCKET_NAME + "/" + multipartFile.getOriginalFilename(), - multipartFile.getInputStream() - ); + String fileId = dataStoreService.saveThumbnail( + BUCKET_NAME + File.separator + multipartFile.getOriginalFilename(), + multipartFile.getInputStream() + ); assertNotNull(fileId); - assertTrue(Files.exists(Paths.get(storageRootPath, dataEncoder.decode(fileId)))); + String decodedPath = getModifiedPath(dataEncoder.decode(fileId)); + Path filePath = Paths.get(storageRootPath, decodedPath); + assertTrue(filePath.toFile().exists(), "File " + filePath + " does not exist"); dataStoreService.delete(fileId); } @@ -106,7 +124,7 @@ void saveAndDeleteTest() throws IOException { dataStoreService.delete(fileId); - assertFalse(Files.exists(Paths.get(dataEncoder.decode(fileId)))); + assertFalse(Files.exists(Paths.get(dataEncoder.decode(getModifiedPath(fileId))))); } public static CommonsMultipartFile getMultipartFile(String path) throws IOException { diff --git a/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java b/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java index fd634c346..141678b78 100644 --- a/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java +++ b/src/test/java/com/epam/ta/reportportal/binary/impl/UserDataStoreServiceTest.java @@ -45,6 +45,12 @@ class UserDataStoreServiceTest extends BaseTest { @Value("${datastore.path:/data/store}") private String storageRootPath; + @Value("${datastore.bucketPrefix:prj-}") + private String bucketPrefix; + + @Value("${datastore.bucketPostfix:}") + private String bucketPostfix; + private static final String BUCKET_NAME = "bucket"; private static Random random = new Random(); @@ -53,6 +59,8 @@ class UserDataStoreServiceTest extends BaseTest { void saveLoadAndDeleteTest() throws IOException { InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); + String bucketPath = bucketPrefix + BUCKET_NAME + bucketPostfix; + String fileId = userDataStoreService.save(BUCKET_NAME + "/" + random.nextLong() + "meh.jpg", inputStream); @@ -60,8 +68,9 @@ void saveLoadAndDeleteTest() throws IOException { assertTrue(loadedData.isPresent()); try (InputStream ignored = loadedData.get()) { - assertTrue(Files.exists( - Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(fileId)))); + String decodedPath = userDataStoreService.dataEncoder.decode(fileId); + decodedPath = decodedPath.replace(BUCKET_NAME, bucketPath); + assertTrue(Files.exists(Paths.get(storageRootPath, decodedPath))); } userDataStoreService.delete(fileId); @@ -69,14 +78,17 @@ void saveLoadAndDeleteTest() throws IOException { ReportPortalException exception = assertThrows(ReportPortalException.class, () -> userDataStoreService.load(fileId)); assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); - assertFalse( - Files.exists(Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(fileId)))); + String decodedPath = userDataStoreService.dataEncoder.decode(fileId); + decodedPath = decodedPath.replace(BUCKET_NAME, bucketPath); + assertFalse(Files.exists(Paths.get(storageRootPath, decodedPath))); } @Test void saveLoadAndDeleteThumbnailTest() throws IOException { InputStream inputStream = new ClassPathResource("meh.jpg").getInputStream(); + String bucketPath = bucketPrefix + BUCKET_NAME + bucketPostfix; + String thumbnailId = userDataStoreService.saveThumbnail(BUCKET_NAME + "/" + random.nextLong() + "thmbnail.jpg", inputStream @@ -86,8 +98,9 @@ void saveLoadAndDeleteThumbnailTest() throws IOException { assertTrue(loadedData.isPresent()); try (InputStream ignored = loadedData.get()) { - assertTrue(Files.exists( - Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(thumbnailId)))); + String decodedPath = userDataStoreService.dataEncoder.decode(thumbnailId); + decodedPath = decodedPath.replace(BUCKET_NAME, bucketPath); + assertTrue(Files.exists(Paths.get(storageRootPath, decodedPath))); } userDataStoreService.delete(thumbnailId); @@ -95,7 +108,8 @@ void saveLoadAndDeleteThumbnailTest() throws IOException { ReportPortalException exception = assertThrows(ReportPortalException.class, () -> userDataStoreService.load(thumbnailId)); assertEquals("Unable to load binary data by id 'Unable to find file'", exception.getMessage()); - assertFalse(Files.exists( - Paths.get(storageRootPath, userDataStoreService.dataEncoder.decode(thumbnailId)))); + String decodedPath = userDataStoreService.dataEncoder.decode(thumbnailId); + decodedPath = decodedPath.replace(BUCKET_NAME, bucketPath); + assertFalse(Files.exists(Paths.get(storageRootPath, decodedPath))); } } \ No newline at end of file diff --git a/src/test/java/com/epam/ta/reportportal/filesystem/LocalDataStoreTest.java b/src/test/java/com/epam/ta/reportportal/filesystem/LocalDataStoreTest.java index b38ea634a..d11771157 100644 --- a/src/test/java/com/epam/ta/reportportal/filesystem/LocalDataStoreTest.java +++ b/src/test/java/com/epam/ta/reportportal/filesystem/LocalDataStoreTest.java @@ -45,12 +45,16 @@ class LocalDataStoreTest { private static final int ZERO = 0; - private static final String SINGLE_BUCKET_NAME = "store"; - private static final String FILE_PATH = "someFile.txt"; private static final String MULTI_BUCKET_NAME = "multiBucket"; + private static final String BUCKET_PREFIX = "prj-"; + + private static final String BUCKET_POSTFIX = "-tiest"; + + private static final String DEFAULT_BUCKET_NAME = "rp-bucket"; + private static final String MULTI_FILE_PATH = MULTI_BUCKET_NAME + "/" + FILE_PATH; @BeforeEach @@ -60,7 +64,10 @@ void setUp() { featureFlagHandler = Mockito.mock(FeatureFlagHandler.class); - localDataStore = new LocalDataStore(blobStore, featureFlagHandler); + localDataStore = + new LocalDataStore(blobStore, featureFlagHandler, BUCKET_PREFIX, BUCKET_POSTFIX, + DEFAULT_BUCKET_NAME + ); } @Test @@ -82,7 +89,7 @@ void whenSave_andSingleBucketIsEnabled_thenSaveToSingleBucket() throws Exception localDataStore.save(FILE_PATH, inputStream); - verify(blobStore, times(1)).putBlob(SINGLE_BUCKET_NAME, blobMock); + verify(blobStore, times(1)).putBlob(DEFAULT_BUCKET_NAME, blobMock); } @Test @@ -95,7 +102,7 @@ void whenLoad_andSingleBucketIsEnabled_thenReturnFromSingleBucket() throws Excep when(mockBlob.getPayload()).thenReturn(mockPayload); when(featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)).thenReturn(true); - when(blobStore.getBlob(SINGLE_BUCKET_NAME, FILE_PATH)).thenReturn(mockBlob); + when(blobStore.getBlob(DEFAULT_BUCKET_NAME, FILE_PATH)).thenReturn(mockBlob); InputStream loaded = localDataStore.load(FILE_PATH); Assertions.assertEquals(inputStream, loaded); @@ -108,7 +115,7 @@ void whenDelete_andSingleBucketIsEnabled_thenDeleteFromSingleBucket() throws Exc localDataStore.delete(FILE_PATH); - verify(blobStore, times(1)).removeBlob(SINGLE_BUCKET_NAME, FILE_PATH); + verify(blobStore, times(1)).removeBlob(DEFAULT_BUCKET_NAME, FILE_PATH); } @Test @@ -130,7 +137,8 @@ void whenSave_andSingleBucketIsDisabled_andBucketInName_thenSaveToThisBucket() t localDataStore.save(MULTI_FILE_PATH, inputStream); - verify(blobStore, times(1)).putBlob(MULTI_BUCKET_NAME, blobMock); + verify(blobStore, times(1)).putBlob( + BUCKET_PREFIX + MULTI_BUCKET_NAME + BUCKET_POSTFIX, blobMock); } @Test @@ -144,7 +152,9 @@ void whenLoad_andSingleBucketIsDisabled_andBucketInName_thenReturnFromThisBucket when(mockBlob.getPayload()).thenReturn(mockPayload); when(featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)).thenReturn(false); - when(blobStore.getBlob(MULTI_BUCKET_NAME, FILE_PATH)).thenReturn(mockBlob); + when(blobStore.getBlob(BUCKET_PREFIX + MULTI_BUCKET_NAME + BUCKET_POSTFIX, + FILE_PATH + )).thenReturn(mockBlob); InputStream loaded = localDataStore.load(MULTI_FILE_PATH); Assertions.assertEquals(inputStream, loaded); @@ -158,6 +168,7 @@ void whenDelete_andSingleBucketIsDisabled_andBucketInName_thenReturnFromThisBuck localDataStore.delete(MULTI_FILE_PATH); - verify(blobStore, times(1)).removeBlob(MULTI_BUCKET_NAME, FILE_PATH); + verify(blobStore, times(1)).removeBlob( + BUCKET_PREFIX + MULTI_BUCKET_NAME + BUCKET_POSTFIX, FILE_PATH); } } diff --git a/src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java b/src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java index 23f4cdc3d..e58278f19 100644 --- a/src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java +++ b/src/test/java/com/epam/ta/reportportal/filesystem/distributed/s3/S3DataStoreTest.java @@ -37,7 +37,7 @@ */ class S3DataStoreTest { - private static final String FILE_PATH = "someFile"; + private static final String FILE_NAME = "someFile"; private static final String BUCKET_PREFIX = "prj-"; private static final String BUCKET_POSTFIX = "-postfix"; private static final String DEFAULT_BUCKET_NAME = "rp-bucket"; @@ -51,7 +51,8 @@ class S3DataStoreTest { private final S3DataStore s3DataStore = new S3DataStore(blobStore, BUCKET_PREFIX, BUCKET_POSTFIX, DEFAULT_BUCKET_NAME, REGION, - featureFlagHandler); + featureFlagHandler + ); @Test void save() throws Exception { @@ -61,21 +62,23 @@ void save() throws Exception { mock(BlobBuilder.PayloadBlobBuilder.class); Blob blobMock = mock(Blob.class); + String filePath = DEFAULT_BUCKET_NAME + "/" + FILE_NAME; + when(inputStream.available()).thenReturn(ZERO); - when(payloadBlobBuilderMock.contentDisposition(FILE_PATH)).thenReturn(payloadBlobBuilderMock); + when(payloadBlobBuilderMock.contentDisposition(FILE_NAME)).thenReturn(payloadBlobBuilderMock); when(payloadBlobBuilderMock.contentLength(ZERO)).thenReturn(payloadBlobBuilderMock); when(payloadBlobBuilderMock.build()).thenReturn(blobMock); when(blobBuilderMock.payload(inputStream)).thenReturn(payloadBlobBuilderMock); when(blobStore.containerExists(any(String.class))).thenReturn(true); - when(blobStore.blobBuilder(FILE_PATH)).thenReturn(blobBuilderMock); + when(blobStore.blobBuilder(FILE_NAME)).thenReturn(blobBuilderMock); when(featureFlagHandler.isEnabled(FeatureFlag.SINGLE_BUCKET)).thenReturn(false); - s3DataStore.save(FILE_PATH, inputStream); + s3DataStore.save(filePath, inputStream); - verify(blobStore, times(1)) - .putBlob(BUCKET_PREFIX + DEFAULT_BUCKET_NAME + BUCKET_POSTFIX, blobMock); + verify(blobStore, times(1)).putBlob( + BUCKET_PREFIX + DEFAULT_BUCKET_NAME + BUCKET_POSTFIX, blobMock); } @Test @@ -84,12 +87,15 @@ void load() throws Exception { Blob mockBlob = mock(Blob.class); Payload mockPayload = mock(Payload.class); + String filePath = DEFAULT_BUCKET_NAME + "/" + FILE_NAME; + when(mockPayload.openStream()).thenReturn(inputStream); when(mockBlob.getPayload()).thenReturn(mockPayload); when(blobStore.getBlob(BUCKET_PREFIX + DEFAULT_BUCKET_NAME + BUCKET_POSTFIX, - FILE_PATH)).thenReturn(mockBlob); - InputStream loaded = s3DataStore.load(FILE_PATH); + FILE_NAME + )).thenReturn(mockBlob); + InputStream loaded = s3DataStore.load(filePath); Assertions.assertEquals(inputStream, loaded); } @@ -97,9 +103,11 @@ void load() throws Exception { @Test void delete() throws Exception { - s3DataStore.delete(FILE_PATH); + String filePath = DEFAULT_BUCKET_NAME + "/" + FILE_NAME; + + s3DataStore.delete(filePath); - verify(blobStore, times(1)) - .removeBlob(BUCKET_PREFIX + DEFAULT_BUCKET_NAME + BUCKET_POSTFIX, FILE_PATH); + verify(blobStore, times(1)).removeBlob( + BUCKET_PREFIX + DEFAULT_BUCKET_NAME + BUCKET_POSTFIX, FILE_NAME); } } \ No newline at end of file diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index fa7189aa9..c4d877240 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -8,10 +8,7 @@ - - - - + \ No newline at end of file diff --git a/src/test/resources/test-application.properties b/src/test/resources/test-application.properties index 730f4eb11..74875f2bc 100644 --- a/src/test/resources/test-application.properties +++ b/src/test/resources/test-application.properties @@ -20,6 +20,9 @@ rp.binarystore.path=${java.io.tmpdir}/reportportal/datastore rp.feature.flags= datastore.path=${rp.binarystore.path:/data/storage} +datastore.bucketPrefix=prj- +datastore.defaultBucketName=rp-bucket +datastore.bucketPostfix= datastore.seaweed.master.host=${rp.binarystore.master.host:localhost} datastore.seaweed.master.port=${rp.binarystore.master.port:9333} datastore.s3.endpoint=${rp.binarystore.s3.endpoint:https://play.min.io} From eafb46ffe652d9cd0a30e5fe7cd1b8e9b69c7f0a Mon Sep 17 00:00:00 2001 From: Pavel Bortnik Date: Fri, 15 Dec 2023 18:41:50 +0300 Subject: [PATCH 110/110] rc/5.11.0 || Update versions --- .github/workflows/release.yml | 6 +++--- gradle.properties | 2 +- project-properties.gradle | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8448c970e..5821cfd85 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,9 +12,9 @@ on: env: GH_USER_NAME: github.actor SCRIPTS_VERSION: 5.10.0 - BOM_VERSION: 5.10.0 - MIGRATIONS_VERSION: 5.10.0 - RELEASE_VERSION: 5.10.0 + BOM_VERSION: 5.11.0 + MIGRATIONS_VERSION: 5.11.0 + RELEASE_VERSION: 5.11.0 jobs: release: diff --git a/gradle.properties b/gradle.properties index 4b30a6367..f77043e9a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -version=5.10.0 +version=5.11.0 lombokVersion=1.18.30 diff --git a/project-properties.gradle b/project-properties.gradle index f67d3868e..8327ee0ce 100755 --- a/project-properties.gradle +++ b/project-properties.gradle @@ -9,7 +9,7 @@ project.ext { dependencyRepos = ["commons", "commons-rules", "commons-model", "commons-bom"] releaseMode = project.hasProperty("releaseMode") scriptsUrl = commonScriptsUrl + (releaseMode ? getProperty('scripts.version') : 'master') - migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'feature/settings') + migrationsUrl = migrationsScriptsUrl + (releaseMode ? getProperty('migrations.version') : 'develop') //TODO refactor with archive download testScriptsSrc = [ (migrationsUrl + '/migrations/0_extensions.up.sql') : 'V001__extensions.sql',