1.0.0-SNAPSHOT
This commit is contained in:
parent
3026327557
commit
8757f203c1
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user