@RequestMapping(value="/rest") public abstract class AbstractRestController<E extends de.terrestris.shogun2.model.PersistentObject,D extends de.terrestris.shogun2.dao.GenericHibernateDao<E,Integer>,S extends AbstractCrudService<E,D>> extends AbstractWebController<E,D,S>
| Modifier and Type | Field and Description |
|---|---|
protected com.fasterxml.jackson.databind.ObjectMapper |
objectMapper |
LOG, service| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRestController(Class<E> entityClass)
Constructor that sets the concrete entity class for the controller.
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.ResponseEntity<E> |
delete(int id)
Deletes an entity by id.
|
org.springframework.http.ResponseEntity<List<E>> |
findAll()
Find all entities.
|
org.springframework.http.ResponseEntity<E> |
findById(Integer id)
Get an entity by id.
|
org.springframework.http.ResponseEntity<E> |
save(E entity)
Create/save an entity.
|
org.springframework.http.ResponseEntity<E> |
update(int id,
javax.servlet.http.HttpServletRequest request)
Updates an entity by id.
|
getEntityClass, getService, setService@Autowired protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
@RequestMapping(method=GET) public org.springframework.http.ResponseEntity<List<E>> findAll()
@RequestMapping(value="/{id}",
method=GET)
public org.springframework.http.ResponseEntity<E> findById(@PathVariable
Integer id)
id - @RequestMapping(method=POST) public org.springframework.http.ResponseEntity<E> save(@RequestBody E entity)
entity - @RequestMapping(value="/{id}",
method=PUT)
public org.springframework.http.ResponseEntity<E> update(@PathVariable
int id,
javax.servlet.http.HttpServletRequest request)
id - entity - @RequestMapping(value="/{id}",
method=DELETE)
public org.springframework.http.ResponseEntity<E> delete(@PathVariable
int id)
id - Copyright © 2016 terrestris GmbH & Co. KG. All rights reserved.