@ Programmatic public NotableLink findByNotableAndCalendarName ( final Object notable , final String calendarName ) { if ( notable == null ) { return null ; } if ( calendarName == null ) { return null ; } final Bookmark bookmark = bookmarkService . bookmarkFor ( notable ) ; if ( bookmark == null ) { return null ; } final String notableStr = bookmark . toString ( ) ; return repositoryService . firstMatch ( new QueryDefault <> ( NotableLink . class , "findByNotableAndCalendarName" , "notableStr" , notableStr , "calendarName" , calendarName ) ) ; }
Each notable can only have one note per calendar thus this method returns a single object rather than a list .