Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 876 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
876
Dung lượng
10,33 MB
Nội dung
[...]... definitive book on Hibernate, but also as the definitive work on object/relational mapping In the intervening time, the persistence landscape has changed with the release of the JavaPersistence API, the new standard for object/relational mapping for Java EE and Java SE which was developed under the Java Community Process as part of the Enterprise JavaBeans 3.0 Specification In developing the Java Persistence. .. you started with your first Hibernate,Java Persistence, or EJB 3.0 project We look at Java application design for domain models and at the options for creating object/relational mapping metadata Mapping Java classes and properties to SQL tables and columns is the focus of part 2 We explore all basic and advanced mapping options in Hibernate and Java Persistence, with XML mapping files and Java annotations... 480 Propagation with JTA 482 Propagation with EJBs 483 ■ ■ ■ 11.2 Conversations with Hibernate 485 Providing conversational guarantees 485 Conversations with detached objects 486 Extending a Session for a conversation 489 ■ ■ 11.3 Conversations with JPA 497 Persistence context propagation in Java SE 498 Merging detached objects in conversations 499 Extending the persistence context in Java SE 501 11.4... Conversations with EJB 3.0 506 Context propagation with EJBs 506 Extended persistence contexts with EJBs 11.5 12 Summary 510 515 Modifying objects efficiently 517 12.1 Transitive persistence 518 Persistence by reachability 519 Applying cascading to associations 520 Working with transitive state 524 Transitive associations with JPA 531 ■ ■ xiii xiv CONTENTS 12.2 Bulk and batch operations 532 Bulk statements with. .. use Hibernate like any JavaPersistence provider, with or without other EJB 3.0 components and Java EE 5.0 services This deep integration of Hibernate with such a rich programming model enables you to design and implement application functionality that was difficult to create by hand before We wrote this book to give you a complete and accurate guide to both Hibernate and JavaPersistence (and also... new JavaPersistence standard This new industry standard is a major step forward for the Java developer community It defines a lightweight and simplified programming model and powerful object/relational persistence Many of the key concepts of the new standard were modeled after Hibernate and other successful object/relational persistence solutions The latest Hibernate version implements the Java Persistence. .. conversations; and xix xx FOREWORD TO THE REVISED EDITION integration with Seam, the new framework for web application development with JSF and EJB 3.0 Java Persistence with Hibernate is therefore considerably more than simply a second edition to Hibernate in Action It provides a comprehensive overview of all the capabilities of the Java Persistence API in addition to those of Hibernate 3, as well as a... technology Java Persistence with Hibernate thus reaches out to a wide range of developers— from newcomers to object/relational mapping to experienced developers—seeking to learn more about cutting-edge technological innovations in the Java community that have occurred and are continuing to emerge as a result of this work LINDA DEMICHIEL Specification Lead Enterprise JavaBeans 3.0 and Java Persistence. .. Working with objects 383 9.1 The persistence lifecycle Object states 385 9.2 ■ 384 The persistence context 388 Object identity and equality 391 Introducing conversations 391 The scope of object identity 393 The identity of detached objects 394 Extending a persistence context 400 ■ ■ 9.3 The Hibernate interfaces 401 Storing and loading objects 402 Working with detached objects 408 Managing the persistence. .. Hibernate and Java Persistence functionality Usually, books are either tutorials or reference guides, so this stretch comes at a price If you’re new to Hibernate, we suggest that you start reading the book from the start, with the tutorials in chapters 1 and 2 If you have used an older version of Hibernate, you should read the first two chapters quickly to get an overview and then jump into the middle with . context 414
9.4 The Java Persistence API 417
Storing and loading objects 417
■
Working with detached
entity instances 423
9.5 Using Java Persistence in EJB. Conversations with JPA 497
Persistence context propagation in Java SE 498
Merging detached objects in conversations 499
Extending the persistence context in Java