static JpaTarget updateTargetInfo(@NotNull final JpaTarget target,@NotNull final TargetUpdateStatus status,final boolean setInstalledDate,final TargetInfoRepository targetInfoRepository,final EntityManager entityManager){
  final JpaTargetInfo ts=(JpaTargetInfo)target.getTargetInfo();
  ts.setUpdateStatus(status);
  if (setInstalledDate) {
    ts.setInstallationDate(System.currentTimeMillis());
  }
  targetInfoRepository.save(ts);
  return entityManager.merge(target);
}

static JpaTarget updateTargetInfo ( @ NotNull final JpaTarget target , @ NotNull final TargetUpdateStatus status , final boolean setInstalledDate , final TargetInfoRepository targetInfoRepository , final EntityManager entityManager ) { final JpaTargetInfo ts = ( JpaTargetInfo ) target . getTargetInfo ( ) ; ts . setUpdateStatus ( status ) ; if ( setInstalledDate ) { ts . setInstallationDate ( System . currentTimeMillis ( ) ) ; } targetInfoRepository . save ( ts ) ; return entityManager . merge ( target ) ; }
internal helper method used only inside service level . as a result is no additional security necessary .
