TAILIEUCHUNG - Building Java Enterprise Applications Volume I: Architecture phần 7

Tham khảo tài liệu 'building java enterprise applications volume i: architecture phần 7', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Building Java Enterprise Applications Volume I Architecture public float getBalance int accountId throws RemoteException return getAccount accountId .getBalance private Account getAccount int id try Get an InitialContext Context context new InitialContext Look up the Account bean AccountHome accountHome AccountHome java comp env ejb AccountHome Account account new Integer id return account catch Exception e Any problems - just return null return null This is all basic EJB material and shouldn t cause you any problems. You ll notice that this class also uses a new finder method on the Account bean public Collection findByUserId Integer userId throws FinderException RemoteException The accompanying query element in the Account bean s entry in the descriptor would look like this query query-method method-name findByUserId method-name method-params method-param method-param method-params query-method ejb-ql CDATA WHERE 1 ejb-ql query To deploy the AccountManager bean you would use this additional XML entry in your deployment descriptor session description This AccountManager bean allows administration of Forethought accounts. description ejb-name AccountManagerBean ejb-name home home remote remote ejb-class ejb-class session-type Stateful session-type transaction-type Container transaction-type 157 Building Java Enterprise Applications Volume I Architecture ejb-ref ejb-ref-name ejb AccountHome ejb-ref-name ejb-ref-type Entity ejb-ref-type home home remote remote ejb-link AccountBean ejb-link ejb-ref session Additions to your application server s vendor-specific descriptors should be equally simple. With this bean in stateful form ready for use it s time to see .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.