Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save namila007/40be53ad64c437df586113827202e866 to your computer and use it in GitHub Desktop.
Save namila007/40be53ad64c437df586113827202e866 to your computer and use it in GitHub Desktop.
Services
public interface MainService <T>
{
Page<T> getAll( Pageable pageable);
T add( T o);
T update (T o, int id);
T getById( int id );
T deleteById(int id);
}
public abstract class AuthorService implements MainService<Author>
{
public abstract List<Book> getBooksById( int id );
}
public abstract class BookService implements MainService<Book>
{
}
public abstract class PublisherService implements MainService<Publisher>
{
public abstract List<Book> getBooksById( int id );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment