jy3022.log
로그인
jy3022.log
로그인
JPA_ 예제 풀이 (전체 조회 ①)
김지영
·
2024년 3월 20일
팔로우
0
jpa
목록 보기
5/18
코딩순서
모델 -> 레파지토리 -> 서비스 -> 컨트롤 -> jsp
1) Emp, EmpRepository, EmpService, EmpController, emp_all.jsp / 함수 : 전체 조회 : 페이징 없이 : findAll()
model -> basic -> Emp
sql 테이블 복사하여 작성하면 편리
인텔리제이 대문자 -> 소문자 변환 : ctrl + shift + u
테이블 자료형과 꼭 똑같이 만들어줘야함!
어노테이션 달아줌
@SequenceGenerator 와 @GeneratedValue 명은 같게 만들어 줌!
repository -> basic -> EmpRepository
사원 레포지토리 : 사원 CRUD 함수있는 인터페이스
sevice -> basic -> EmpService
사원 서비스 : DB JPA CRUD 함수이용 업무로직 만드는 곳
전체조회 함수 (페이징 없음)
controller -> EmpController
emp_all.jsp
전체조회 가능
화면출력
2)
empRepository에 findAllByEnameContaining()
like 검색 함수 제작/
empService 에 findAllByEnameContaining() 함수 제작 /empController 의 getEmpAll() 함수에 페이징 처리 로직 추가
emp_all.jsp 페이징 화면 추가(테이블로 출력)
김지영
그냥 졍이라구하자
팔로우
이전 포스트
JPA_ Page findAll(Pageable pageable) 함수
다음 포스트
JPA_ 검색어 입력상자
0개의 댓글
댓글 작성