@Path(value="/comments") public class CommentBean extends AbstractBean<Comment>
| Constructor and Description |
|---|
CommentBean() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
countREST() |
void |
create(Comment entity)
Creates a comment.
|
void |
edit(Comment entity)
Updates a Comment.
|
Comment |
find(java.lang.Long id)
Retrieves a Comment.
|
java.util.List<Comment> |
findAll()
Retrieve all instances of the entity.
|
java.util.List<Comment> |
findRange(java.lang.Integer from,
java.lang.Integer to) |
protected javax.persistence.EntityManager |
getEntityManager()
Returns the Entity manager.
|
void |
remove(java.lang.Long id)
Removes a comment.
|
count, findRange, removeprotected javax.persistence.EntityManager getEntityManager()
AbstractBeangetEntityManager in class AbstractBean<Comment>@POST
@Consumes(value={"application/xml","application/json"})
public void create(Comment entity)
create in class AbstractBean<Comment>entity - comment@PUT
@Consumes(value={"application/xml","application/json"})
public void edit(Comment entity)
edit in class AbstractBean<Comment>entity - Comment@DELETE
@Path(value="{id}")
public void remove(@PathParam(value="id")
java.lang.Long id)
id - unique identifier for the comment, present in the url.@GET
@Path(value="{id}")
@Produces(value={"application/xml","application/json"})
public Comment find(@PathParam(value="id")
java.lang.Long id)
find in class AbstractBean<Comment>id - unique identifier for the comment, present in the url.javax.ws.rs.WebApplicationException - with status Response.Status.NOT_FOUND if
comment with that id does not exist (any more).@GET
@Produces(value={"application/xml","application/json"})
public java.util.List<Comment> findAll()
AbstractBeanfindAll in class AbstractBean<Comment>@GET
@Path(value="{from}/{to}")
@Produces(value={"application/xml","application/json"})
public java.util.List<Comment> findRange(@PathParam(value="from")
java.lang.Integer from,
@PathParam(value="to")
java.lang.Integer to)
@GET
@Path(value="count")
@Produces(value={"application/xml","application/json"})
public java.lang.String countREST()