budaidev commented on code in PR #4570:
URL: https://github.com/apache/fineract/pull/4570#discussion_r2040743574
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarInstanceRepository.java:
##########
@@ -45,24 +52,27 @@ public interface CalendarInstanceRepository extends
JpaRepository<CalendarInstan
* {@link CalendarType}
* @return
*/
+ @Cacheable(key = "T(java.util.Objects).hash(#entityId, #entityTypeId,
#calendarTypeId)")
CalendarInstance findByEntityIdAndEntityTypeIdAndCalendarTypeId(Long
entityId, Integer entityTypeId, Integer calendarTypeId);
Review Comment:
> Btw isn't this the same as the first method?
In the calendarInstance entity there are 3 columns: calendar_id, entity_id,
entity_type_enum
The calendar entity which is connected with the calendarInstance have many
fields, including the typeId.
Now in the test I see that the entity_type_enum is not the same as
calendar_type_enum, so they might have probably different purpose
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/calendar/domain/CalendarInstanceRepository.java:
##########
@@ -45,24 +52,27 @@ public interface CalendarInstanceRepository extends
JpaRepository<CalendarInstan
* {@link CalendarType}
* @return
*/
+ @Cacheable(key = "T(java.util.Objects).hash(#entityId, #entityTypeId,
#calendarTypeId)")
CalendarInstance findByEntityIdAndEntityTypeIdAndCalendarTypeId(Long
entityId, Integer entityTypeId, Integer calendarTypeId);
+ @Cacheable(key = "T(java.util.Objects).hash(#entityId, #entityTypeId)")
@Query("select ci from CalendarInstance ci where ci.entityId = :entityId
and ci.entityTypeId = :entityTypeId")
CalendarInstance findCalendarInstaneByEntityId(@Param("entityId") Long
entityId, @Param("entityTypeId") Integer entityTypeId);
Review Comment:
> Isn't this also the same as the second method?
Same for here, calanderType <> entityType
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]