All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.coherentlogic.fred.client.db.integration.services.SourcesService Maven / Gradle / Ivy

There is a newer version: 2.0.3-RELEASE
Show newest version
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.Sources;
import com.coherentlogic.fred.client.db.integration.dao.SourcesRepository;

@Repository(SourcesService.BEAN_NAME)
@Transactional
public class SourcesService {

    public static final String BEAN_NAME = "sourcesService";

    @PersistenceContext
    private EntityManager entityManager;

    @Autowired
    private SourcesRepository sourcesRepository;

    protected EntityManager getEntityManager() {
        return entityManager;
    }

    protected void setEntityManager(EntityManager entityManager) {
        this.entityManager = entityManager;
    }

    public SourcesRepository getSourcesRepository() {
        return sourcesRepository;
    }

    public void setSourcesRepository(SourcesRepository sourcesRepository) {
        this.sourcesRepository = sourcesRepository;
    }

    public long count() {
        return sourcesRepository.count();
    }

    public  long count(Example arg0) {
        return sourcesRepository.count(arg0);
    }

    public void delete(Long arg0) {
        sourcesRepository.deleteById(arg0);
    }

    public void delete(Sources arg0) {
        sourcesRepository.delete(arg0);
    }

    public void delete(Iterable arg0) {
        sourcesRepository.deleteAll(arg0);
    }

    public void deleteAll() {
        sourcesRepository.deleteAll();
    }

    public boolean exists(Long arg0) {
        return sourcesRepository.existsById(arg0);
    }

    public  boolean exists(Example arg0) {
        return sourcesRepository.exists(arg0);
    }

    public List findAll() {
        return sourcesRepository.findAll();
    }

    public List findAll(Sort sort) {
        return sourcesRepository.findAll(sort);
    }

    public List findAll(Iterable ids) {
        return sourcesRepository.findAllById(ids);
    }

    public Page findAll(Pageable arg0) {
        return sourcesRepository.findAll(arg0);
    }

    public  Page findAll(Example arg0, Pageable arg1) {
        return sourcesRepository.findAll(arg0, arg1);
    }

    public  List save(Iterable entities) {
        return sourcesRepository.saveAll(entities);
    }

    public void flush() {
        sourcesRepository.flush();
    }

    public  S saveAndFlush(S entity) {
        return sourcesRepository.saveAndFlush(entity);
    }

    public void deleteInBatch(Iterable entities) {
        sourcesRepository.deleteInBatch(entities);
    }

    public void deleteAllInBatch() {
        sourcesRepository.deleteAllInBatch();
    }

    public Sources getOne(Long id) {
        return sourcesRepository.getOne(id);
    }

    public  List findAll(Example example) {
        return sourcesRepository.findAll(example);
    }

    public  List findAll(Example example, Sort sort) {
        return sourcesRepository.findAll(example, sort);
    }

    public Optional findOne(Long arg0) {
        return sourcesRepository.findById(arg0);
    }

    public  Optional findOne(Example arg0) {
        return sourcesRepository.findOne(arg0);
    }

    public  S save(S arg0) {
        return sourcesRepository.save(arg0);
    }
}