Beginning Hibernate 6 : Java Persistence From Beginner to Pro
معرفی کتاب «Beginning Hibernate 6 : Java Persistence From Beginner to Pro» نوشتهٔ [美] 罗伯特·T·清崎(Robert T. Kiyosaki)، 莎伦·L·莱希特(Sharon L. Lechter) و Joseph B. Ottinger, Jeff Linwood, Dave Minter، منتشرشده توسط نشر Apress Apress در سال 2021. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.
Get started with Hibernate, an open source Java persistence layer and gain a clear introduction to the current standard for object-relational persistence in Java. This updated edition includes the new Hibernate 6.0 framework which covers new configuration, new object relational mapping changes, and enhanced integration with the more general Spring, Boot and Quarkus and other Java frameworks. The book keeps its focus on Hibernate without wasting time on nonessential third-party tools, so you’ll be able to immediately start building transaction-based engines and applications. Experienced authors Joseph Ottinger with Dave Minter and Jeff Linwood provide more in-depth examples than any other book for Hibernate beginners. They present their material in a lively, example-based manner―not a dry, theoretical, hard-to-read fashion.**What You'll Learn** * Build enterprise Java-based transaction-type applications that access complex data with Hibernate * Work with Hibernate 6 using a present-day build process * Integrate into the persistence life cycle * Search and query with the new version of Hibernate * Keep track of versioned data with Hibernate Envers **Who This Book Is For** Programmers experienced in Java with databases (the traditional, or connected, approach), but new to open-source, lightweight Hibernate. Table of Contents 4 About the Authors 11 About the Technical Reviewer 13 Acknowledgments 14 Introduction 15 Chapter 1: An Introduction to Hibernate 6 19 Plain Old Java Objects (POJOs) 20 Building a Project 22 Hibernate As a Persistence Solution 35 Summary 43 Chapter 2: Integrating and Configuring Hibernate 44 The Steps Needed to Integrate and Configure Hibernate 45 Understanding Where Hibernate Fits into Your Java Application 46 Deploying Hibernate 47 Installing Maven 48 Connection Pooling 58 Using JNDI 59 Summary 60 Chapter 3: Building a Simple Application 61 A Simple Application 61 Relationships and Cardinality 62 A First Attempt 63 Writing Data 66 Rounding Out the Data Model 69 Reading Data 73 Updating Data 77 Persistence Contexts 80 Removing Data 80 A Note on Transactions 82 The Full Test for Rankings 83 Writing Our Sample Application 90 Add a Ranking 94 Update a Ranking 98 Remove a Ranking 101 Find Average Ranking for a Subject’s Skill 103 Find All Rankings for a Subject 104 Find the Highest-Ranked Subject for a Skill 107 Putting It All Together 111 Summary 119 Chapter 4: The Persistence LifeCycle 120 Introducing the Lifecycle 120 Entities, Classes, and Names 122 Identifiers 123 Entities and Associations 125 Saving Entities 138 Object Equality and Identity 145 Loading Entities 147 Merging Entities 151 Refreshing Entities 153 Updating Entities 155 Deleting Entities 156 Cascading Operations 157 Lazy Loading, Proxies, and Collection Wrappers 165 Querying Objects 167 Summary 167 Chapter 5: An Overview of Mapping 168 Why Mapping Cannot Easily Be Automated 169 Primary Keys 171 Lazy Loading 174 Associations 175 The One-to-One Association 177 The One-to-Many and Many-to-One Associations 179 The Many-to-Many Association 180 Applying Mappings to Associations 181 Other Supported Features 182 Specification of (Database) Column Types and Sizes 182 The Mapping of Inheritance Relationships to the Database 183 Primary Key 183 The Use of SQL Formula–Based Properties 183 Mandatory and Unique Constraints 184 Summary 184 Chapter 6: Mapping with Annotations 185 Creating Hibernate Mappings with Annotations 185 The Drawbacks of Annotations 185 The Benefits of Annotations 186 Choosing Which Mapping Mechanism to Use 188 JPA 2 Persistence Annotations 188 Entity Beans with @Entity 190 Primary Keys with @Id and @GeneratedValue 191 Generating Primary Key Values with @SequenceGenerator 194 Generating Primary Key Values with @TableGenerator 195 Compound Primary Keys with @Id, @IdClass, or @EmbeddedId 197 Database Table Mapping with @Table and @SecondaryTable 205 Persisting Basic Types with @Basic 207 Omitting Persistence with @Transient 209 Mapping Properties and Fields with @Column 209 Modeling Entity Relationships 212 Mapping an Embedded (Component) One-to-One Association 212 Mapping a Conventional One-to-One Association 213 Mapping a Many-to-One or One-to-Many Association 215 Mapping a Many-to-Many Association 217 Cascading Operations 218 Collection Ordering 220 Inheritance 220 Single Table 221 Joined Table 222 Table per Class 224 Choosing Between Inheritance Types When Modeling Inheritance 225 Other JPA 2 Persistence Annotations 226 Temporal Data 226 Element Collections 227 Large Objects 231 Mapped Superclasses 231 Ordering Collections with @OrderColumn 234 Named Queries (HQL or JPQL) 235 Named Native Queries (SQL) 236 Configuring the Annotated Classes 237 Hibernate-Specific Persistence Annotations 239 @Immutable 240 Natural IDs 241 Summary 250 Chapter 7: JPA Integration and Lifecycle Events 251 The Java Persistence API 251 The Project Object Model 253 Introducing Lombok 254 The JPASessionUtil Class 257 Testing JPASessionUtil 258 Lifecycle Events 264 External Entity Listeners 269 Data Validation 271 Summary 285 Chapter 8: Using the Session 286 Sessions 286 Transactions and Locking 291 Transactions 291 The ACID Tests 292 Locking 294 Deadlocks 295 Caching 302 Threads 309 Summary 310 Chapter 9: Searches and Queries 311 Hibernate Query Language (HQL) 311 Syntax Basics 312 UPDATE 312 DELETE 313 INSERT 314 SELECT 315 Named Queries 316 Logging and Commenting the Underlying SQL 326 Logging the SQL 326 Commenting the Generated SQL 327 The from Clause and Aliases 328 The select Clause and Projection 329 Using Restrictions with HQL 331 Using Named Parameters 332 Paging Through the Result Set 335 Obtaining a Unique Result 337 Sorting Results with the order by Clause 338 Associations and Joins 338 Aggregate Methods 341 Bulk Updates and Deletes with HQL 343 Using Native SQL 344 Summary 346 Chapter 10: Filtering the Results of Searches 348 When to Use Filters 349 Getting Started 350 Defining and Attaching Filters 351 Filters with Annotations 351 Filters with XML Mapping Documents 353 Using Filters in Your Application 354 A Basic Filtering Example 355 Summary 365 Chapter 11: Integration into the Web 366 Setting the Stage 366 The Plan 368 The Application 369 The Project Model 369 The Data Model 371 Building Our First Servlet Test 378 Our First (Wrong) Servlet: Adding a User 390 The AddUserServlet, Corrected 395 Where DTOs Shine 401 Rounding Out the Application 402 Creating a Post 402 A Better “Get Posts” Servlet 412 Rounding Out the “Application” 418 Summary 428 Chapter 12: Integrating Hibernate 429 Spring 430 Spring Data with Spring Boot 444 ActiveJ 449 Quarkus 457 Summary 464 Chapter 13: Hibernate Envers 465 What Does a “Version” Mean? 465 Creating a Simple Project 466 Looking for Revisions with Specific Data 482 An Example Reverting Data 484 Summary 486 Index 487 Get started with Hibernate, an open source Java persistence layer and gain a clear introduction to the current standard for object-relational persistence in Java. This updated edition includes the new Hibernate 6.0 framework which covers new configuration, new object relational mapping changes, and enhanced integration with the more general Spring, Boot and Quarkus and other Java frameworks. The book keeps its focus on Hibernate without wasting time on nonessential third-party tools, so you’ll be able to immediately start building transaction-based engines and applications. Experienced authors Joseph Ottinger with Dave Minter and Jeff Linwood provide more in-depth examples than any other book for Hibernate beginners. They present their material in a lively, example-based manner―not a dry, theoretical, hard-to-read fashion. What You'll Learn Build enterprise Java-based transaction-type applications that access complex data with Hibernate Work with Hibernate 6 using a present-day build process Integrate into the persistence life cycle Search and query with the new version of Hibernate Keep track of versioned data with Hibernate Envers Who This Book Is For Programmers experienced in Java with databases (the traditional, or connected, approach), but new to open-source, lightweight Hibernate. Get started with Hibernate, an open source Java persistence layer and gain a clear introduction to the current standard for object-relational persistence in Java. This updated edition includes the new Hibernate 6.0 framework which covers new configuration, new object relational mapping changes, and enhanced integration with the more general Spring, Boot and Quarkus and other Java frameworks. The book keeps its focus on Hibernate without wasting time on nonessential third-party tools, so youll be able to immediately start building transaction-based engines and applications. Experienced authors Joseph Ottinger with Dave Minter and Jeff Linwood provide more in-depth examples than any other book for Hibernate beginners. They present their material in a lively, example-based mannernot a dry, theoretical, hard-to-read fashion. You will: Build enterprise Java-based transaction-type applications that access complex data with Hibernate Work with Hibernate 6 using a present-day build process Integrate into the persistence life cycle Search and query with the new version of Hibernate Keep track of versioned data with Hibernate Envers
دانلود کتاب Beginning Hibernate 6 : Java Persistence From Beginner to Pro