Class AbstractServiceable<T extends io.easywalk.simply.specification.serviceable.annotations.SimplyEntity,​ID>

  • All Implemented Interfaces:
    io.easywalk.simply.specification.SimplySpec<T,​ID>

    public abstract class AbstractServiceable<T extends io.easywalk.simply.specification.serviceable.annotations.SimplyEntity,​ID>
    extends java.lang.Object
    implements io.easywalk.simply.specification.SimplySpec<T,​ID>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.springframework.data.jpa.repository.JpaRepository<T,​ID> repository  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractServiceable​(org.springframework.data.jpa.repository.JpaRepository<T,​ID> repository)  
    • Field Detail

      • repository

        protected final org.springframework.data.jpa.repository.JpaRepository<T extends io.easywalk.simply.specification.serviceable.annotations.SimplyEntity,​ID> repository
    • Constructor Detail

      • AbstractServiceable

        protected AbstractServiceable​(org.springframework.data.jpa.repository.JpaRepository<T,​ID> repository)
    • Method Detail

      • create

        public T create​(T entity)
                 throws javax.persistence.EntityExistsException,
                        org.springframework.dao.DataIntegrityViolationException
        Specified by:
        create in interface io.easywalk.simply.specification.SimplySpec<T extends io.easywalk.simply.specification.serviceable.annotations.SimplyEntity,​ID>
        Throws:
        javax.persistence.EntityExistsException
        org.springframework.dao.DataIntegrityViolationException
      • get

        public T get​(ID id)
              throws java.util.NoSuchElementException
        Specified by:
        get in interface io.easywalk.simply.specification.SimplySpec<T extends io.easywalk.simply.specification.serviceable.annotations.SimplyEntity,​ID>
        Throws:
        java.util.NoSuchElementException
      • updateById

        public T updateById​(ID id,
                            java.util.Map<java.lang.String,​java.lang.Object> fields)
                     throws java.lang.Throwable
        Specified by:
        updateById in interface io.easywalk.simply.specification.SimplySpec<T extends io.easywalk.simply.specification.serviceable.annotations.SimplyEntity,​ID>
        Throws:
        java.lang.Throwable
      • deleteById

        public void deleteById​(ID id)
        Specified by:
        deleteById in interface io.easywalk.simply.specification.SimplySpec<T extends io.easywalk.simply.specification.serviceable.annotations.SimplyEntity,​ID>
      • delete

        public void delete​(T entity)
        Specified by:
        delete in interface io.easywalk.simply.specification.SimplySpec<T extends io.easywalk.simply.specification.serviceable.annotations.SimplyEntity,​ID>
      • replaceById

        public T replaceById​(ID id,
                             T replace)
                      throws javax.persistence.EntityNotFoundException
        Specified by:
        replaceById in interface io.easywalk.simply.specification.SimplySpec<T extends io.easywalk.simply.specification.serviceable.annotations.SimplyEntity,​ID>
        Throws:
        javax.persistence.EntityNotFoundException
      • getAll

        public java.util.List<T> getAll()
        Specified by:
        getAll in interface io.easywalk.simply.specification.SimplySpec<T extends io.easywalk.simply.specification.serviceable.annotations.SimplyEntity,​ID>