public class TrainingRepositoryJpa extends JpaRepository<Training,java.lang.Long> implements TrainingRepository
DEFAULT_PAGE_SIZE, LOGGER
Constructor and Description |
---|
TrainingRepositoryJpa() |
Modifier and Type | Method and Description |
---|---|
int |
deleteTrainingsAffectedBy(AlgorithmProvider provider)
Delete all rows that have this provider
|
java.util.List<Training> |
findAllTrainingWithProvider(AlgorithmProvider provider)
Obtain a list of trainings by a given provider
|
java.util.List<Training> |
findByLocalization(Localization localization)
Obtain a list of trainings by a given a localization
|
java.util.Optional<Training> |
findTrainingByLocalizationAlgorithmAndProviderId(Localization localization,
Algorithm algorithm,
AlgorithmProvider provider)
Obtain training for their localization.
|
protected java.lang.String |
persistenceUnitName()
Derived classes should implement this method to return the name of the
persistence unit
|
add, all, close, create, delete, deleteById, entityManager, entityManagerFactory, findById, first, first, iterator, iterator, last, page, pageWithFiltering, read, save, size, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected java.lang.String persistenceUnitName()
persistenceUnitName
in class JpaRepository<Training,java.lang.Long>
public java.util.List<Training> findByLocalization(Localization localization)
findByLocalization
in interface TrainingRepository
localization
- See Localization
public java.util.List<Training> findAllTrainingWithProvider(AlgorithmProvider provider)
findAllTrainingWithProvider
in interface TrainingRepository
provider
- See AlgorithmProvider
public java.util.Optional<Training> findTrainingByLocalizationAlgorithmAndProviderId(Localization localization, Algorithm algorithm, AlgorithmProvider provider)
Cannot exists more than one training for the same localization that have the same algorithm and same provider.
findTrainingByLocalizationAlgorithmAndProviderId
in interface TrainingRepository
localization
- See Localization
algorithm
- See Algorithm
provider
- See AlgorithmProvider
public int deleteTrainingsAffectedBy(AlgorithmProvider provider)
deleteTrainingsAffectedBy
in interface TrainingRepository
provider
- See AlgorithmProvider