Class AbstractRestController<E extends PersistentObject,​D extends GenericHibernateDao<E,​Integer>,​S extends AbstractCrudService<E,​D>>

    • Field Detail

      • objectMapper

        @Autowired
        protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
    • Constructor Detail

      • AbstractRestController

        protected AbstractRestController​(Class<E> entityClass)
        Constructor that sets the concrete entity class for the controller. Subclasses MUST call this constructor.
    • Method Detail

      • findAll

        @RequestMapping(method=GET,
                        produces="application/json;charset=UTF-8")
        public org.springframework.http.ResponseEntity<List<E>> findAll​(@RequestParam
                                                                        org.springframework.util.MultiValueMap<String,​String> requestParams)
        Find all entities.
      • findBySimpleFilter

        @RequestMapping(value="/filter",
                        method=GET,
                        produces="application/json;charset=UTF-8")
        public org.springframework.http.ResponseEntity<List<E>> findBySimpleFilter​(@RequestParam
                                                                                   org.springframework.util.MultiValueMap<String,​String> requestParams)
        Find all entities that match the conditions from the query string.

        The requestParams MultiValueMap contains all information from the query String @see RequestParam

      • findById

        @RequestMapping(value="/{id}",
                        method=GET,
                        produces="application/json;charset=UTF-8")
        public org.springframework.http.ResponseEntity<E> findById​(@PathVariable
                                                                   Integer id)
        Get an entity by id.
        Parameters:
        id -
      • save

        @RequestMapping(method=POST,
                        produces="application/json;charset=UTF-8")
        public org.springframework.http.ResponseEntity<E> save​(javax.servlet.http.HttpServletRequest request)
        Create/save an entity.
      • update

        @RequestMapping(value="/{id}",
                        method=PUT,
                        produces="application/json;charset=UTF-8")
        public org.springframework.http.ResponseEntity<E> update​(@PathVariable
                                                                 int id,
                                                                 javax.servlet.http.HttpServletRequest request)
        Updates an entity by id.
        Parameters:
        id -
      • delete

        @RequestMapping(value="/{id}",
                        method=DELETE)
        public org.springframework.http.ResponseEntity<E> delete​(@PathVariable
                                                                 int id)
        Deletes an entity by id.
        Parameters:
        id -