Package de.terrestris.shoguncore.rest
Class AbstractRestController<E extends PersistentObject,D extends GenericHibernateDao<E,java.lang.Integer>,S extends AbstractCrudService<E,D>>
- java.lang.Object
-
- de.terrestris.shoguncore.web.AbstractWebController<E,D,S>
-
- de.terrestris.shoguncore.rest.AbstractRestController<E,D,S>
-
- Direct Known Subclasses:
ApplicationRestController,ButtonRestController,ExtentRestController,ImageFileRestController,LayerAppearanceRestController,LayerDataSourceRestController,LayerRestController,LayoutRestController,MapConfigRestController,MapControlRestController,ModuleRestController,PluginRestController,RoleRestController,TileGridRestController,TreeNodeRestController,UserGroupRestController,UserRestController,WpsParameterRestController,WpsProcessExecuteRestController
@RequestMapping("/rest") public abstract class AbstractRestController<E extends PersistentObject,D extends GenericHibernateDao<E,java.lang.Integer>,S extends AbstractCrudService<E,D>> extends AbstractWebController<E,D,S>- Author:
- Kai Volland, Daniel Koch, Nils Bühner
-
-
Field Summary
Fields Modifier and Type Field Description protected com.fasterxml.jackson.databind.ObjectMapperobjectMapper-
Fields inherited from class de.terrestris.shoguncore.web.AbstractWebController
logger, service
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRestController(java.lang.Class<E> entityClass)Constructor that sets the concrete entity class for the controller.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.http.ResponseEntity<E>delete(int id)Deletes an entity by id.org.springframework.http.ResponseEntity<java.util.List<E>>findAll(org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> requestParams)Find all entities.org.springframework.http.ResponseEntity<E>findById(java.lang.Integer id)Get an entity by id.org.springframework.http.ResponseEntity<java.util.List<E>>findBySimpleFilter(org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> requestParams)Find all entities that match the conditions from the query string.org.springframework.http.ResponseEntity<E>save(javax.servlet.http.HttpServletRequest request)Create/save an entity.org.springframework.http.ResponseEntity<E>update(int id, javax.servlet.http.HttpServletRequest request)Updates an entity by id.-
Methods inherited from class de.terrestris.shoguncore.web.AbstractWebController
getEntityClass, getService, setService
-
-
-
-
Constructor Detail
-
AbstractRestController
protected AbstractRestController(java.lang.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<java.util.List<E>> findAll(@RequestParam org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> requestParams)Find all entities.
-
findBySimpleFilter
@RequestMapping(value="/filter", method=GET, produces="application/json;charset=UTF-8") public org.springframework.http.ResponseEntity<java.util.List<E>> findBySimpleFilter(@RequestParam org.springframework.util.MultiValueMap<java.lang.String,java.lang.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 java.lang.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-
-
-