@Repository public class MemberRepository { @PersistenceContext private EntityManager em; public Long save(Member member){ em.persist(member); return member.getId(); } public Member findOne(Long id){ return em.find(Member.class, id); } public List findAll(){ return em.createQuery("select m from Member m", Member.class) .getResultList(); } public List findByName(String username){ return em.create..