package <%=packageName%>.web.rest;

import com.codahale.metrics.annotation.Timed;
import <%=packageName%>.domain.<%= entityClass %>;
import <%=packageName%>.repository.<%= entityClass %>Repository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import javax.inject.Inject;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * REST controller for managing <%= entityClass %>.
 */
@RestController
@RequestMapping("/app")
public class <%= entityClass %>Resource {

    private final Logger log = LoggerFactory.getLogger(<%= entityClass %>Resource.class);

    @Inject
    private <%= entityClass %>Repository <%= entityInstance %>Repository;

    /**
     * POST  /rest/<%= entityInstance %>s -> Create a new <%= entityInstance %>.
     */
    @RequestMapping(value = "/rest/<%= entityInstance %>s",
            method = RequestMethod.POST,
            produces = "application/json")
    @Timed
    public void create(@RequestBody <%= entityClass %> <%= entityInstance %>) {
        <%= entityInstance %>Repository.save(<%= entityInstance %>);
    }

    /**
     * GET  /rest/<%= entityInstance %>s -> get all the <%= entityInstance %>s.
     */
    @RequestMapping(value = "/rest/<%= entityInstance %>s",
            method = RequestMethod.GET,
            produces = "application/json")
    @Timed
    public List<<%= entityClass %>> getAll() {
        return <%= entityInstance %>Repository.findAll();
    }

    /**
     * GET  /rest/<%= entityInstance %>s/:id -> get the "id" <%= entityInstance %>.
     */
    @RequestMapping(value = "/rest/<%= entityInstance %>s/{id}",
            method = RequestMethod.GET,
            produces = "application/json")
    @Timed
    public <%= entityClass %> get(@PathVariable Long id, HttpServletResponse response) {
        log.debug("REST request to get <%= entityClass %> : {}", id);
        <%= entityClass %> <%= entityInstance %> = <%= entityInstance %>Repository.findOne(id);
        if (<%= entityInstance %> == null) {
            response.setStatus(HttpServletResponse.SC_NOT_FOUND);
        }
        return <%= entityInstance %>;
    }

    /**
     * DELETE  /rest/<%= entityInstance %>s/:id -> delete the "id" <%= entityInstance %>.
     */
    @RequestMapping(value = "/rest/<%= entityInstance %>s/{id}",
            method = RequestMethod.DELETE,
            produces = "application/json")
    @Timed
    public void delete(@PathVariable Long id, HttpServletResponse response) {
        <%= entityInstance %>Repository.delete(id);
    }
}

@@ -1047,24 +1047,114 @@
 tance %25%3E) %7B%0A
+        log.debug(%22REST request to save %3C%25= entityClass %25%3E : %7B%7D%22, %3C%25= entityInstance %25%3E);%0A
         %3C%25= 
@@ -1510,24 +1510,90 @@
  getAll() %7B%0A
+        log.debug(%22REST request to get all %3C%25= entityClass %25%3Es%22);%0A
         retu
@@ -2663,32 +2663,105 @@
 nse response) %7B%0A
+        log.debug(%22REST request to delete %3C%25= entityClass %25%3E : %7B%7D%22, id);%0A
         %3C%25= enti

Update _EntityResource.java