1.0.0-SNAPSHOT

This commit is contained in:
insanity 2017-05-26 19:00:36 +09:00
parent 3026327557
commit 8757f203c1
2 changed files with 9 additions and 5 deletions

View File

@ -3,11 +3,17 @@ package com.loafle.overflow.member.dao;
import com.loafle.overflow.commons.dao.JPABaseDAO;
import com.loafle.overflow.member.model.Member;
import java.util.List;
import javax.persistence.Query;
/**
* Created by insanity on 17. 5. 25.
*/
public class JPAMemberDAO extends JPABaseDAO<Member> implements MemberDAO{
public Member findByEmail(Member member) {
Query query = getEntityManager().createNativeQuery("SELECT m.* FROM MEMBER m WHERE m.email = :email", Member.class);
query.setParameter("email", member.getEmail());
return (Member)query.getSingleResult();
}
}

View File

@ -3,11 +3,9 @@ package com.loafle.overflow.member.dao;
import com.loafle.overflow.commons.dao.BaseDAO;
import com.loafle.overflow.member.model.Member;
import javax.persistence.Inheritance;
import java.util.List;
/**
* Created by insanity on 17. 5. 25.
*/
public interface MemberDAO extends BaseDAO<Member> {
public Member findByEmail(Member member);
}