package devopsdistilled.operp.server.data.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;

import devopsdistilled.operp.server.data.service.AbstractService;

public class AbstractServiceImpl<T, ID extends Serializable> implements
		AbstractService<T, ID> {

	private static final long serialVersionUID = 4892118695516828793L;

	protected JpaRepository<T, ID> repo;

	@Override
	public List<T> findAll() {
		return repo.findAll();
	}

	@Override
	public List<T> findAll(Sort sort) {
		return repo.findAll(sort);
	}

	@Override
	public <S extends T> List<S> save(Iterable<S> entities) {
		return repo.save(entities);
	}

	@Override
	public void flush() {
		repo.flush();
	}

	@Override
	public T saveAndFlush(T entity) {
		return repo.saveAndFlush(entity);
	}

	@Override
	public void deleteInBatch(Iterable<T> entities) {
		repo.deleteInBatch(entities);
	}

	@Override
	public void deleteAllInBatch() {
		repo.deleteAllInBatch();
	}

	@Override
	public Page<T> findAll(Pageable pageable) {
		return findAll(pageable);
	}

	@Override
	public <S extends T> S save(S entity) {
		return repo.save(entity);
	}

	@Override
	public T findOne(ID id) {
		return repo.findOne(id);
	}

	@Override
	public boolean exists(ID id) {
		return repo.exists(id);
	}

	@Override
	public long count() {
		return repo.count();
	}

	@Override
	public void delete(ID id) {
		repo.delete(id);
	}

	@Override
	public void delete(T entity) {
		repo.delete(entity);
	}

	@Override
	public void delete(Iterable<? extends T> entities) {
		repo.delete(entities);
	}

	@Override
	public void deleteAll() {
		repo.deleteAll();
	}

	@Override
	public Iterable<T> findAll(Iterable<ID> ids) {
		return repo.findAll(ids);
	}
}

@@ -379,16 +379,25 @@
 %0Apublic 
+abstract 
 class Ab
@@ -441,17 +441,19 @@
 lizable%3E
- 
+%0A%09%09
 implemen
@@ -454,19 +454,17 @@
 plements
-%0A%09%09
+ 
 Abstract
@@ -561,16 +561,25 @@
 otected 
+abstract 
 JpaRepos
@@ -591,20 +591,25 @@
 %3CT, ID%3E 
-r
+getR
 epo
+()
 ;%0A%0A%09@Ove
@@ -643,36 +643,41 @@
 ll() %7B%0A%09%09return 
-r
+getR
 epo
+()
 .findAll();%0A%09%7D%0A%0A
@@ -725,36 +725,41 @@
 ort) %7B%0A%09%09return 
-r
+getR
 epo
+()
 .findAll(sort);%0A
@@ -833,36 +833,41 @@
 ies) %7B%0A%09%09return 
-r
+getR
 epo
+()
 .save(entities);
@@ -907,20 +907,25 @@
 h() %7B%0A%09%09
-r
+getR
 epo
+()
 .flush()
@@ -981,28 +981,33 @@
  %7B%0A%09%09return 
-r
+getR
 epo
+()
 .saveAndFlus
@@ -1081,28 +1081,33 @@
 tities) %7B%0A%09%09
-r
+getR
 epo
+()
 .deleteInBat
@@ -1167,28 +1167,33 @@
 Batch() %7B%0A%09%09
-r
+getR
 epo
+()
 .deleteAllIn
@@ -1270,16 +1270,26 @@
 %09return 
+getRepo().
 findAll(
@@ -1364,20 +1364,25 @@
 %09return 
-r
+getR
 epo
+()
 .save(en
@@ -1435,28 +1435,33 @@
  %7B%0A%09%09return 
-r
+getR
 epo
+()
 .findOne(id)
@@ -1518,20 +1518,25 @@
 %09return 
-r
+getR
 epo
+()
 .exists(
@@ -1587,20 +1587,25 @@
 %09return 
-r
+getR
 epo
+()
 .count()
@@ -1648,28 +1648,33 @@
 (ID id) %7B%0A%09%09
-r
+getR
 epo
+()
 .delete(id);
@@ -1719,28 +1719,33 @@
 entity) %7B%0A%09%09
-r
+getR
 epo
+()
 .delete(enti
@@ -1816,28 +1816,33 @@
 tities) %7B%0A%09%09
-r
+getR
 epo
+()
 .delete(enti
@@ -1892,20 +1892,25 @@
 l() %7B%0A%09%09
-r
+getR
 epo
+()
 .deleteA
@@ -1987,20 +1987,25 @@
 %09return 
-r
+getR
 epo
+()
 .findAll

Add getRepo() to get subclass repo