chapter 06 Entity Bean BMP Entity Bean Entity
chapter 06 : Entity. Bean ( BMP )
학습목표 Entity. Bean 개요 Entity. Bean 종류 BMP 처리 방법 Architecture
Entity. Bean 개요 데이터베이스의 Table의 record 작업 INSERT , SELECT , UPDATE , DELETE 빈 삭제 , 빈 생성 , 빈 수정 , 빈 검색 종류 BMP ( Bean Managed Persistence ) § 빈 제공자가 직접 작성한 SQL 문을 이용하여 Entity. Bean을 작성한다. CMP ( Container Managed Persistence ) § EJB Container 에서 작성된 SQL 문을 이용하여 Entity. Bean을 작성한다.
소스 파일 작성 <<EJBHome>> : 빈의 생성 , 검색 , 삭제 관련 작업 <<Home Interface>> <<EJBObject>> : 빈의 비즈니스 로직 관련 작업 <<Component Interface>> <<Entity. Bean>> User. Bean : Home Interface 메소드 구현. Component Interface 메소드 구현. Session. Bean Interface 메소드 구현.
빈 생성 실습 예제 Architecture EJB Container App. User. Home create( args) Client PK PK App. User Pool App. User. EJB : 생성자 호출 set. Entity. Context 호출 ejb. Create( args) ejb. Post. Create( args) INSERT JNDI DB
빈 삭제 실습 예제 Architecture EJB Container App. User. Home create( args) PK Client remove() Pool PK App. User. EJB : 생성자 호출 set. Entity. Context 호출 ejb. Create( args) ejb. Post. Create( args) JNDI ejb. Remove( ) DELETE DB
빈 Activation 실습 예제
빈 검색 실습 예제 spec Home Interface 에서 find. XXX( args ) 이용한다. single finder 검색 결과가 하나의 레코드인 경우 예> find. By. Primary. Key( pk ) multiple finder 검색 결과가 여러 개의 레코드인 경우 예> find. By. All() , find. By. Name( name ) , find. By. All. Name()
빈 검색 실습 예제 single finder Architecture EJB Container App. User. Home find. By. Primary. Key( args) PK Pool : 생성자 호출 set. Entity. Context 호출 Client PK App. User. EJB ejb. Find. By. Primary. Key( args) JNDI DB
빈 검색 실습 예제 multiple finder Architecture EJB Container App. User. Home find. By. All() PKs Pool : 생성자 호출 set. Entity. Context 호출 Client PK App. User. EJB PK App. User ejb. Find. By. All() JNDI DB
공부한 내용 Entity. Bean 개요 BMP 각 작업에 따른 Architecture
- Slides: 46