@Test publicvoidstartJPQL(){ // member1 을 찾아라 MemberfindByJPQL= em.createQuery("select m from Member m where m.username = :username", Member.class) .setParameter("username", "member1") .getSingleResult();
Querydsl 은 기본적으로 parameter binding 시 preparedStatement 의 parameter binding 을 사용해 SQL injection 공격으로부터 안전하다.
select member0_.member_id as member_i1_1_, member0_.age as age2_1_, member0_.team_id as team_id4_1_, member0_.username as username3_1_ from member member0_ where member0_.username=?