TAILIEUCHUNG - Java Persistence with Hibernate phần

Chương này giải thích tất cả các tùy chọn truy vấn mà bạn có thể xem xét tùy chọn nâng cao hoặc. Bạn sẽ cần các đối tượng đầu tiên của chương này, các truy vấn Tiêu chuẩn giao diện, bất cứ khi nào bạn tạo ra các truy vấn phức tạp hơn chương trình. | Advanced query options This chapter covers Querying with Criteria and Example APIs Embedding native SQL queries Collection filters The optional query result cache 663 664 CHAPTER 15 Advanced query options This chapter explains all query options that you may consider optional or advanced. You ll need the first subject of this chapter the Criteria query interface whenever you create more complex queries programmatically. This API is much more convenient and elegant than programmatic generation of query strings for HQL and JPA QL. Unfortunately it s also only available as a native Hibernate API Java Persistence doesn t yet standardize a programmatic query interface. Both Hibernate and Java Persistence support queries written in native SQL. You can embed SQL and stored procedure calls in your Java source code or externalize them to mapping metadata. Hibernate can execute your SQL and convert the resultset into more convenient objects depending on your mapping. Filtering of collections is a simple convenience feature of Hibernate you won t use it often. It helps you to replace a more elaborate query with a simple API call and a query fragment for example if you want to obtain a subset of the objects in a collection. Finally we ll discuss the optional query result cache we ve already mentioned that it s not useful in all situations so we ll take a closer look at the benefits of caching results of a query and when you d ideally enable this feature. Let s start with query by criteria and query by example. Querying with criteria and example The Criteria and Example APIs are available in Hibernate only Java Persistence doesn t standardize these interfaces. As mentioned earlier it seems likely that other vendors not only Hibernate support a similar extension interface and that a future version of the standard will include this functionality. Querying with programmatically generated criteria and example objects is often the preferred solution when queries get more .

TỪ KHÓA LIÊN QUAN
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.