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