com.coherentlogic.fred.client.db.integration.services.SeriessService 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.Seriess;
import com.coherentlogic.fred.client.db.integration.dao.SeriessRepository;
@Repository(SeriessService.BEAN_NAME)
@Transactional
public class SeriessService {
public static final String BEAN_NAME = "seriessService";
@PersistenceContext
private EntityManager entityManager;
@Autowired
private SeriessRepository seriessRepository;
protected EntityManager getEntityManager() {
return entityManager;
}
protected void setEntityManager(EntityManager entityManager) {
this.entityManager = entityManager;
}
public SeriessRepository getSeriessRepository() {
return seriessRepository;
}
void setSeriessRepository(SeriessRepository seriessRepository) {
this.seriessRepository = seriessRepository;
}
public long count() {
return seriessRepository.count();
}
public long count(Example arg0) {
return seriessRepository.count(arg0);
}
public void delete(Long arg0) {
seriessRepository.deleteById(arg0);
}
public void delete(Seriess arg0) {
seriessRepository.delete(arg0);
}
public void delete(Iterable extends Seriess> arg0) {
seriessRepository.deleteAll(arg0);
}
public void deleteAll() {
seriessRepository.deleteAll();
}
public boolean exists(Long arg0) {
return seriessRepository.existsById(arg0);
}
public boolean exists(Example arg0) {
return seriessRepository.exists(arg0);
}
public List findAll() {
return seriessRepository.findAll();
}
public List findAll(Sort sort) {
return seriessRepository.findAll(sort);
}
public List findAll(Iterable ids) {
return seriessRepository.findAllById(ids);
}
public Page findAll(Pageable arg0) {
return seriessRepository.findAll(arg0);
}
public Page findAll(Example arg0, Pageable arg1) {
return seriessRepository.findAll(arg0, arg1);
}
public List save(Iterable entities) {
return seriessRepository.saveAll(entities);
}
public void flush() {
seriessRepository.flush();
}
public S saveAndFlush(S entity) {
return seriessRepository.saveAndFlush(entity);
}
public void deleteInBatch(Iterable entities) {
seriessRepository.deleteInBatch(entities);
}
public void deleteAllInBatch() {
seriessRepository.deleteAllInBatch();
}
public Seriess getOne(Long id) {
return seriessRepository.getOne(id);
}
public List findAll(Example example) {
return seriessRepository.findAll(example);
}
public List findAll(Example example, Sort sort) {
return seriessRepository.findAll(example, sort);
}
public Optional findOne(Long arg0) {
return seriessRepository.findById(arg0);
}
public Optional findOne(Example arg0) {
return seriessRepository.findOne(arg0);
}
public S save(S arg0) {
return seriessRepository.save(arg0);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy