package tenten0213.todo;

import javax.enterprise.context.RequestScoped;
import javax.transaction.Transactional;

@RequestScoped
@Transactional
public class TodoService {
}

@@ -19,16 +19,54 @@
 .todo;%0A%0A
+import tenten0213.entity.TodoEntity;%0A%0A
 import j
@@ -104,16 +104,138 @@
 Scoped;%0A
+import javax.persistence.EntityManager;%0Aimport javax.persistence.PersistenceContext;%0Aimport javax.persistence.TypedQuery;%0A
 import j
@@ -265,16 +265,39 @@
 ctional;
+%0Aimport java.util.List;
 %0A%0A@Reque
@@ -320,16 +320,16 @@
 ctional%0A
-
 public c
@@ -346,11 +346,519 @@
 ervice %7B
+%0A%0A    @PersistenceContext%0A    private EntityManager em;%0A%0A    public TodoEntity save(TodoEntity entity) %7B%0A        em.persist(entity);%0A        return entity;%0A    %7D%0A%0A    public List%3CTodoEntity%3E findAll() %7B%0A        TypedQuery%3CTodoEntity%3E query = em.createNamedQuery(%22todo_findAll%22, TodoEntity.class);%0A        query.setMaxResults(10);%0A        return query.getResultList();%0A    %7D%0A%0A    public void delete(Long todoId) %7B%0A        TodoEntity entity = em.find(TodoEntity.class, todoId);%0A        em.remove(entity);%0A    %7D
 %0A%7D%0A

add service methods