3333import static com .epam .reportportal .base .infrastructure .persistence .dao .constant .WidgetContentRepositoryConstants .ITEMS ;
3434import static com .epam .reportportal .base .infrastructure .persistence .dao .constant .WidgetContentRepositoryConstants .LAUNCHES ;
3535import static com .epam .reportportal .base .infrastructure .persistence .dao .constant .WidgetRepositoryConstants .ID ;
36+ import static com .epam .reportportal .base .infrastructure .persistence .dao .util .JooqFieldNameTransformer .castToText ;
3637import static com .epam .reportportal .base .infrastructure .persistence .dao .util .JooqFieldNameTransformer .fieldName ;
3738import static com .epam .reportportal .base .infrastructure .persistence .dao .util .QueryUtils .collectJoinFields ;
3839import static com .epam .reportportal .base .infrastructure .persistence .dao .util .RecordMappers .INDEX_TEST_ITEM_RECORD_MAPPER ;
@@ -921,10 +922,10 @@ public List<Long> selectIdsByAnalyzedWithLevelGteExcludingIssueTypes(boolean aut
921922 .andNot (nestedItemTable .HAS_STATS )
922923 .and (LOG .LOG_LEVEL .greaterOrEqual (logLevel ))
923924 .and (LOG .LOG_LEVEL .lessOrEqual (LogLevel .UNKNOWN_INT ))
924- .and (nestedItemTable .PATH .cast ( String . class )
925- .eq (outerItemTable .PATH .cast ( String . class ))
926- .or (nestedItemTable .PATH .cast ( String . class )
927- .like (outerItemTable .PATH .cast ( String . class ).concat (".%" ))))
925+ .and (castToText ( fieldName ( nestedItemTable .getName (), TEST_ITEM . PATH .getName ()) )
926+ .eq (castToText ( fieldName ( outerItemTable .getName (), TEST_ITEM . PATH .getName ()) ))
927+ .or (castToText ( fieldName ( nestedItemTable .getName (), TEST_ITEM . PATH .getName ()) )
928+ .like (castToText ( fieldName ( outerItemTable .getName (), TEST_ITEM . PATH .getName ()) ).concat (".%" ))))
928929 )
929930 )
930931 .unionAll (DSL .selectDistinct (TEST_ITEM .ITEM_ID .as (ID ))
@@ -1056,8 +1057,8 @@ public List<Long> selectIdsUnderByStringLogMessage(Long launchId, Collection<Lon
10561057 return dsl .selectDistinct (TEST_ITEM .ITEM_ID )
10571058 .from (TEST_ITEM )
10581059 .join (child )
1059- .on (child .PATH .cast ( String . class )
1060- .like (TEST_ITEM .PATH .cast ( String . class ).concat (".%" )))
1060+ .on (castToText ( fieldName ( child .getName (), TEST_ITEM . PATH .getName ()) )
1061+ .like (castToText ( fieldName ( TEST_ITEM .getName (), TEST_ITEM . PATH .getName ()) ).concat (".%" )))
10611062 .and (TEST_ITEM .ITEM_ID .notEqual (child .ITEM_ID ))
10621063 .join (LOG )
10631064 .on (child .ITEM_ID .eq (LOG .ITEM_ID ))
@@ -1078,8 +1079,8 @@ public List<Long> selectLogIdsUnderWithLogLevelCondition(Long launchId, Collecti
10781079 return dsl .selectDistinct (LOG .ID )
10791080 .from (TEST_ITEM )
10801081 .join (child )
1081- .on (child .PATH .cast ( String . class )
1082- .like (TEST_ITEM .PATH .cast ( String . class ).concat (".%" )))
1082+ .on (castToText ( fieldName ( child .getName (), TEST_ITEM . PATH .getName ()) )
1083+ .like (castToText ( fieldName ( TEST_ITEM .getName (), TEST_ITEM . PATH .getName ()) ).concat (".%" )))
10831084 .and (TEST_ITEM .ITEM_ID .notEqual (child .ITEM_ID ))
10841085 .join (LOG )
10851086 .on (child .ITEM_ID .eq (LOG .ITEM_ID ))
@@ -1098,8 +1099,8 @@ public List<Long> selectIdsUnderByRegexLogMessage(Long launchId, Collection<Long
10981099 return dsl .selectDistinct (TEST_ITEM .ITEM_ID )
10991100 .from (TEST_ITEM )
11001101 .join (child )
1101- .on (child .PATH .cast ( String . class )
1102- .like (TEST_ITEM .PATH .cast ( String . class ).concat (".%" )))
1102+ .on (castToText ( fieldName ( child .getName (), TEST_ITEM . PATH .getName ()) )
1103+ .like (castToText ( fieldName ( TEST_ITEM .getName (), TEST_ITEM . PATH .getName ()) ).concat (".%" )))
11031104 .and (TEST_ITEM .ITEM_ID .notEqual (child .ITEM_ID ))
11041105 .join (LOG )
11051106 .on (child .ITEM_ID .eq (LOG .ITEM_ID ))
@@ -1170,10 +1171,10 @@ public List<NestedStep> findAllNestedStepsByIds(Collection<Long> ids, Queryable
11701171 .join (ATTACHMENT )
11711172 .on (LOG .ATTACHMENT_ID .eq (ATTACHMENT .ID ))
11721173 .where (nested .HAS_STATS .isFalse ()
1173- .and (fieldName (NESTED , TEST_ITEM .PATH .getName ()). cast ( String . class )
1174- .eq (TEST_ITEM .PATH .cast ( String . class ))
1175- .or (fieldName (NESTED , TEST_ITEM .PATH .getName ()). cast ( String . class )
1176- .like (TEST_ITEM .PATH .cast ( String . class ).concat (".%" )))
1174+ .and (castToText ( fieldName (NESTED , TEST_ITEM .PATH .getName ()))
1175+ .eq (castToText ( fieldName ( TEST_ITEM .getName (), TEST_ITEM . PATH .getName ()) ))
1176+ .or (castToText ( fieldName (NESTED , TEST_ITEM .PATH .getName ()))
1177+ .like (castToText ( fieldName ( TEST_ITEM .getName (), TEST_ITEM . PATH .getName ()) ).concat (".%" )))
11771178 )
11781179 )
11791180 )
0 commit comments