com.coherentlogic.fred.client.db.integration.services.ObservationsService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fred-client-db-int Show documentation
Show all versions of fred-client-db-int Show documentation
Integration of the FRED Client with the h2 database for
testing purposes.
package com.coherentlogic.fred.client.db.integration.services;
import java.util.List;
import java.util.Optional;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.coherentlogic.fred.client.core.domain.Observations;
import com.coherentlogic.fred.client.db.integration.dao.ObservationsRepository;
@Repository(ObservationsService.BEAN_NAME)
@Transactional
public class ObservationsService {
public static final String BEAN_NAME = "observationsService";
@PersistenceContext
private EntityManager entityManager;
@Autowired
private ObservationsRepository observationsRepository;
protected EntityManager getEntityManager() {
return entityManager;
}
protected void setEntityManager(EntityManager entityManager) {
this.entityManager = entityManager;
}
public ObservationsRepository getObservationsRepository() {
return observationsRepository;
}
void setObservationsRepository(ObservationsRepository observationsRepository) {
this.observationsRepository = observationsRepository;
}
public long count() {
return observationsRepository.count();
}
public long count(Example arg0) {
return observationsRepository.count(arg0);
}
public void delete(Long arg0) {
observationsRepository.deleteById(arg0);
}
public void delete(Observations arg0) {
observationsRepository.delete(arg0);
}
public void delete(Iterable extends Observations> arg0) {
observationsRepository.deleteAll(arg0);
}
public void deleteAll() {
observationsRepository.deleteAll();
}
public boolean exists(Long arg0) {
return observationsRepository.existsById(arg0);
}
public boolean exists(Example arg0) {
return observationsRepository.exists(arg0);
}
public List findAll() {
return observationsRepository.findAll();
}
public List findAll(Sort sort) {
return observationsRepository.findAll(sort);
}
public List findAll(Iterable ids) {
return observationsRepository.findAllById(ids);
}
public Page findAll(Pageable arg0) {
return observationsRepository.findAll(arg0);
}
public Page findAll(Example arg0, Pageable arg1) {
return observationsRepository.findAll(arg0, arg1);
}
public List save(Iterable entities) {
return observationsRepository.saveAll(entities);
}
public void flush() {
observationsRepository.flush();
}
public S saveAndFlush(S entity) {
return observationsRepository.saveAndFlush(entity);
}
public void deleteInBatch(Iterable entities) {
observationsRepository.deleteInBatch(entities);
}
public void deleteAllInBatch() {
observationsRepository.deleteAllInBatch();
}
public Observations getOne(Long id) {
return observationsRepository.getOne(id);
}
public List findAll(Example example) {
return observationsRepository.findAll(example);
}
public List findAll(Example example, Sort sort) {
return observationsRepository.findAll(example, sort);
}
public Optional findOne(Long arg0) {
return observationsRepository.findById(arg0);
}
public Optional findOne(Example arg0) {
return observationsRepository.findOne(arg0);
}
public S save(S arg0) {
return observationsRepository.save(arg0);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy