protected ApplicationSettingJdo doFind(final String key) { return repositoryService.firstMatch( new QueryDefault<>(ApplicationSettingJdo.class, "findByKey", "key", key)); }
protected UserSettingJdo doFind(final String user, final String key) { return repositoryService.firstMatch( new QueryDefault<>(UserSettingJdo.class, "findByUserAndKey", "user",user, "key", key)); } //endregion
/** * Returns the document template, if any for the specified {@link DocumentType} and exact application tenancy, and exact date. */ @Programmatic public DocumentTemplate findByTypeAndAtPathAndDate(final DocumentType documentType, final String atPath, final LocalDate date) { return repositoryService.firstMatch( new QueryDefault<>(DocumentTemplate.class, "findByTypeAndAtPathAndDate", "type", documentType, "atPath", atPath, "date", date)); }
/** * Returns the document template, if any for the specified {@link DocumentType} and exact application tenancy, and exact date. */ @Programmatic public DocumentTemplate findByTypeAndAtPathAndDate(final DocumentType documentType, final String atPath, final LocalDate date) { return repositoryService.firstMatch( new QueryDefault<>(DocumentTemplate.class, "findByTypeAndAtPathAndDate", "type", documentType, "atPath", atPath, "date", date)); }
@Programmatic public DocumentType findByReference( final String reference) { return queryResultsCache.execute( () -> repositoryService.firstMatch( new QueryDefault<>(DocumentType.class, "findByReference", "reference", reference)), DocumentTypeRepository.class, "findByReference", reference); } //endregion
@Programmatic public DocumentType findByReference( final String reference) { return queryResultsCache.execute( () -> repositoryService.firstMatch( new QueryDefault<>(DocumentType.class, "findByReference", "reference", reference)), DocumentTypeRepository.class, "findByReference", reference); } //endregion
@Programmatic public Paperclip findByDocumentAndAttachedToAndRoleName( final DocumentAbstract<?> document, final Object attachedTo, final String roleName) { if(document == null) { return null; } if(attachedTo == null) { return null; } if(roleName == null) { return null; } final Bookmark bookmark = bookmarkService.bookmarkFor(attachedTo); if(bookmark == null) { return null; } final String attachedToStr = bookmark.toString(); return repositoryService.firstMatch( new QueryDefault<>(Paperclip.class, "findByDocumentAndAttachedToAndRoleName", "document", document, "attachedToStr", attachedToStr, "roleName", roleName)); } //endregion
@Programmatic public Paperclip findByDocumentAndAttachedToAndRoleName( final DocumentAbstract<?> document, final Object attachedTo, final String roleName) { if(document == null) { return null; } if(attachedTo == null) { return null; } if(roleName == null) { return null; } final Bookmark bookmark = bookmarkService.bookmarkFor(attachedTo); if(bookmark == null) { return null; } final String attachedToStr = bookmark.toString(); return repositoryService.firstMatch( new QueryDefault<>(Paperclip.class, "findByDocumentAndAttachedToAndRoleName", "document", document, "attachedToStr", attachedToStr, "roleName", roleName)); } //endregion