@Override public Optional<IT0185> findOneByCompositeKey(Long pernr, String subty, Date endda, Date begda) { if (pernr == null || StringUtils.isBlank(subty) || endda == null || begda == null) { return Optional.empty(); } return Optional.ofNullable( it0185Repository.findOneByCompositeKey( pernr, SAPInfoType.PERSONAL_ID.infoType(), subty, endda, begda)); }
@Override public Collection<IT0185> findByPernr(Long pernr) { if (pernr == null) { return Collections.emptyList(); } Optional<Collection<IT0185>> bunchOfIT0185 = Optional.ofNullable( it0185Repository.findByPernr(pernr, SAPInfoType.PERSONAL_ID.infoType())); return (bunchOfIT0185.isPresent() ? bunchOfIT0185.get().stream().collect(Collectors.toList()) : Collections.emptyList()); }
@Override public Collection<IT0185> findByPernrAndSubty(Long pernr, String subty) { if (pernr == null) { return Collections.emptyList(); } if (StringUtils.isBlank(subty)) { subty = "01"; // default to subtype '01' (i.e. Identity Card) } Optional<Collection<IT0185>> bunchOfIT0185 = Optional.ofNullable( it0185Repository.findByPernrAndSubty(pernr, SAPInfoType.PERSONAL_ID.infoType(), subty)); return (bunchOfIT0185.isPresent() ? bunchOfIT0185.get().stream().collect(Collectors.toList()) : Collections.emptyList()); }