Atjaunināt sīkdatņu piekrišanu

E-grāmata: Java Persistence with Spring Data and Hibernate

4.44/5 (34 ratings by Goodreads)
  • Formāts: 616 pages
  • Izdošanas datums: 18-Apr-2023
  • Izdevniecība: Manning Publications
  • Valoda: eng
  • ISBN-13: 9781638351856
  • Formāts - EPUB+DRM
  • Cena: 49,74 €*
  • * ši ir gala cena, t.i., netiek piemērotas nekādas papildus atlaides
  • Ielikt grozā
  • Pievienot vēlmju sarakstam
  • Šī e-grāmata paredzēta tikai personīgai lietošanai. E-grāmatas nav iespējams atgriezt un nauda par iegādātajām e-grāmatām netiek atmaksāta.
  • Formāts: 616 pages
  • Izdošanas datums: 18-Apr-2023
  • Izdevniecība: Manning Publications
  • Valoda: eng
  • ISBN-13: 9781638351856

DRM restrictions

  • Kopēšana (kopēt/ievietot):

    nav atļauts

  • Drukāšana:

    nav atļauts

  • Lietošana:

    Digitālo tiesību pārvaldība (Digital Rights Management (DRM))
    Izdevējs ir piegādājis šo grāmatu šifrētā veidā, kas nozīmē, ka jums ir jāinstalē bezmaksas programmatūra, lai to atbloķētu un lasītu. Lai lasītu šo e-grāmatu, jums ir jāizveido Adobe ID. Vairāk informācijas šeit. E-grāmatu var lasīt un lejupielādēt līdz 6 ierīcēm (vienam lietotājam ar vienu un to pašu Adobe ID).

    Nepieciešamā programmatūra
    Lai lasītu šo e-grāmatu mobilajā ierīcē (tālrunī vai planšetdatorā), jums būs jāinstalē šī bezmaksas lietotne: PocketBook Reader (iOS / Android)

    Lai lejupielādētu un lasītu šo e-grāmatu datorā vai Mac datorā, jums ir nepieciešamid Adobe Digital Editions (šī ir bezmaksas lietotne, kas īpaši izstrādāta e-grāmatām. Tā nav tas pats, kas Adobe Reader, kas, iespējams, jau ir jūsu datorā.)

    Jūs nevarat lasīt šo e-grāmatu, izmantojot Amazon Kindle.

Master Java persistence using the industry-leading tools Spring Data and Hibernate.

In   Java Persistence with Spring Data and Hibernate  you will learn:







Mapping persistent classes, value types, and inheritance Mapping collections and entity associations Processing transactions with Spring Data and Hibernate Creating fetch plans, strategies, and profiles Filtering data Building Spring Data REST projects Using Java persistence with non-relational databases Querying JPA with QueryDSL Testing Java persistence applications



Java Persistence with Spring Data and Hibernate  teaches you the ins-and-outs of Java persistence with hands-on examples using Spring Data, JPA and Hibernate. The book carefully analyzes the capabilities of the major Java persistence tools, and guides you through the most common use cases. You'll learn how to make and utilize mapping strategies, and efficiently test Java persistence applications. The practical techniques are demonstrated with both relational and non-relational databases. about the technology Persistence enables an application's data to exist for the long term, even after a program is stopped or terminated. Whether you're saving state from session to session or maintaining long-term records, Java persistence tools like Spring Data, JPA, and Hibernate help deliver the object relational mapping that connects code's objects with your database. about the book Java Persistence with Spring Data and Hibernate  explores persistence with the most popular available tools. You'll benefit from detailed coverage of Spring Data JPA, Spring Data JDBC, Spring Data REST, JPA, and Hibernate, comparing and contrasting the alternatives so you can pick what's best for your code.

Begin with a hands-on introduction to object-relational mapping (ORM), then dive into mapping strategies for linking up objects and your database. You'll learn about the different approach to transactions for both Hibernate and Spring Data, and even how to deliver Java persistence with non-relational databases. Finally, you'll explore testing strategies for persistent applications to keep your code clean and bug free.

Recenzijas

"Want to learn Java persistence without having to dig through the reference documentation? Read it and you'll know what to do (and what to avoid)." Marcus Geselle

"This book is crucial not only for newbies but also for any senior developers working with JVM Persistence." Özay Duman

"This book gives a great foundation for working with JPA and Hibernate. If I were to teach the subject, I would not hesitate to use this book." Kim Kjęrsulf

"Excellent introduction to how Java persistence is handled in the real world." Daniel Carl

Forewords xiv
Preface xvii
Acknowledgments xix
About this book xxi
About the author xxiv
Authors of Java Persistence with Hibernate, Second Edition xxv
About the cover illustration xxvi
Part 1 Getting started with ORM
1(102)
1 Understanding object/relational persistence
3(18)
1.1 What is persistence?
4(4)
Relational databases
4(1)
Understanding SQL
5(1)
Using SQL in Java
6(2)
1.2 The paradigm mismatch
8(9)
The problem of granularity
9(2)
The problem of inheritance
11(1)
The problem of identity
12(1)
The problem of associations
13(2)
The problem of data navigation
15(2)
1.3 ORM, JPA, Hibernate, and Spring Data
17(4)
2 Starting a project
21(25)
2.1 Introducing Hibernate
22(1)
2.2 Introducing Spring Data
23(1)
2.3 "Hello World" with JPA
23(7)
Configuring a persistence unit
25(1)
Writing a persistent class
26(2)
Storing and loading messages
28(2)
2.4 Native Hibernate configuration
30(4)
2.5 Switching between JPA and Hibernate
34(2)
2.6 "Hello World" with Spring Data JPA
36(4)
2.7 Comparing the approaches of persisting entities
40(6)
3 Domain models and metadata
46(57)
3.1 The example CaveatEmptor application
47(5)
A layered architecture
47(2)
Analyzing the business domain
49(1)
The CaveatEmptor domain model
50(2)
3.2 Implementing the domain model
52(10)
Addressing leakage of concerns
52(1)
Transparent and automated persistence
53(1)
Writing persistence-capable classes
54(3)
Implementing POJO associations
57(5)
3.3 Domain model metadata
62(13)
Annotation-based metadata
62(3)
Applying constraints to Java objects
65(2)
Externalizing metadata with XML files
67(2)
Accessing metadata at runtime
69(5)
Working with Spring Data JPA
74(1)
4.1 Introducing Spring Data JPA
75(1)
4.2 Starting a new Spring Data JPA project
75(3)
4.3 First steps for configuring a Spring Data JPA project
78(4)
4.4 Defining query methods with Spring Data JPA
82(5)
4.5 Limiting query results, sorting, and paging
87(2)
4.6 Streaming results
89(1)
4.7 The @Query annotation
90(2)
4.8 Projections
92(4)
4.9 Modifying queries
96(2)
4.10 Query by Example
98(5)
Part 2 Mapping strategies
103(164)
5 Mapping persistent classes
105(23)
5.1 Understanding entities and value types
106(4)
Fine-grained domain models
107(1)
Defining application concepts
107(2)
Distinguishing entities and value types
109(1)
5.2 Mapping entities with identity
110(11)
Understanding Java identity and equality
110(1)
A first entity class and mapping
111(1)
Selecting a primary key
112(2)
Configuring key generators
114(4)
Identifier generator strategies
118(3)
5.3 Entity-mapping options
121(7)
Controlling names
121(3)
Dynamic SQL generation
124(1)
Making an entity immutable
125(1)
Mapping an entity to a subselect
125(3)
6 Mapping value types
128(42)
6.1 Mapping basic properties
129(8)
Overriding basic property defaults
130(1)
Customizing property access
131(2)
Using derived properties
133(1)
Transforming column values
134(1)
Generated and default property values
135(1)
The @Temporal annotation
136(1)
Mapping enumerations
136(1)
6.2 Mapping embeddable components
137(10)
The database schema
137(1)
Making classes embeddable
138(3)
Overriding embedded attributes
141(4)
Mapping nested embedded components
145(2)
6.3 Mapping Java and SQL types with converters
147(23)
Built-in types
147(6)
Creating customJPA converters
153(9)
Extending Hibernate with User Types
162(8)
7 Mapping inheritance
170(26)
7.1 Table per concrete class with implicit polymorphism
171(6)
7.2 Table per concrete class with unions
177(3)
7.3 Table per class hierarchy
180(3)
7.4 Table per subclass with joins
183(4)
7.5 Mixing inheritance strategies
187(2)
7.6 Inheritance of embeddable classes
189(2)
7.7 Choosing a strategy
191(2)
7.8 Polymorphic associations
193(3)
Polymorphic many-to-one associations
193(1)
Polymorphic collections
194(2)
8 Mapping collections and entity associations
196(36)
8.1 Sets, bags, lists, and maps of value types
197(13)
The database schema
197(1)
Creating and mapping a collection property
198(1)
Selecting a collection interface
199(2)
Mapping a set
201(2)
Mapping an identifier bag
203(2)
Mapping a list
205(1)
Mapping a map
206(1)
Sorted and ordered collections
207(3)
8.2 Collections of components
210(10)
Equality of component instances
211(1)
Set of components
212(3)
Bag of components
215(1)
Map of component values
216(1)
Components as map keys
217(2)
Collection in an embeddable component
219(1)
8.3 Mapping entity associations
220(12)
The simplest possible association
221(1)
Making it bidirectional
222(2)
Cascading state
224(8)
9 Advanced entity association mappings
232(35)
9.1 One-to-one associations
233(11)
Sharing a primary key
233(5)
The foreign primary key generator
238(2)
Using a foreign key join column
240(2)
Using a join table
242(2)
9.2 One-to-many associations
244(9)
Considering one-to-many bags
244(2)
Unidirectional and bidirectional list mappings
246(2)
Optional one-to-many with a join table
248(2)
One-to-many association in an embeddable class
250(3)
9.3 Many-to-many and ternary associations
253(9)
Unidirectional and bidirectional many-to-many associations
253(2)
Many-to-many with an intermediate entity
255(4)
Ternary associations with components
259(3)
9.4 Entity associations with maps
262(5)
One-to-many with a property key
262(1)
Key/value ternary relationship
263(4)
Part 3 Transactional data processing
267(120)
10 Managing data
269(25)
10.1 The persistence lifecycle
270(4)
Entity instance states
271(1)
The persistence context
272(2)
10.2 The EntityManager interface
274(11)
The canonical unit of work
274(2)
Making data persistent
276(1)
Retrieving and modifying persistent data
277(2)
Getting a reference
279(1)
Making data transient
280(1)
Refreshing data
281(1)
Replicating data
282(1)
Caching in the persistence context
283(1)
Flushing the persistence context
284(1)
10.3 Working with detached state
285(9)
The identity of detached instances
286(2)
Implementing equality methods
288(3)
Detaching entity instances
291(1)
Merging entity instances
291(3)
11 Transactions and concurrency
294(37)
11.1 Transaction essentials
295(1)
ACID attributes
295(1)
Database and system transactions
296(1)
11.2 Controlling concurrent access
296(19)
Understanding database-level concurrency
297(5)
Optimistic concurrency control
302(8)
Explicit pessimistic locking
310(3)
Avoiding deadlocks
313(2)
11.3 Non-transactional data access
315(4)
Reading data in auto-commit mode
315(2)
Queuing modifications
317(2)
11.4 Managing transactions with Spring and Spring Data
319(12)
Transaction propagation
320(1)
Transaction rollback
321(1)
Transaction properties
322(1)
Programmatic transaction definition
322(1)
Transactional development with Spring and Spring Data
323(8)
12 Fetch plans, strategies, and profiles
331(27)
12.1 Lazy and eager loading
332(9)
Understanding entity proxies
333(4)
Lazy persistent collections
337(2)
Eager loading of associations and collections
339(2)
12.2 Selecting a fetch strategy
341(10)
The n+1 selects problem
341(1)
The Cartesian product problem
342(3)
Prefetching data in batches
345(2)
Prefetching collections with subsekcts
347(1)
Eager fetching with multiple SELECTs
348(1)
Dynamic eager fetching
349(2)
12.3 Using fetch profiles
351(7)
Declaring Hibernate fetch profiles
352(1)
Working with entity graphs
353(5)
13 Filtering data
358(29)
13.1 Cascading state transitions
359(7)
Available cascading options
360(1)
Transitive detachment and merging
360(3)
Cascading refresh
363(2)
Cascading replication
365(1)
13.2 Listening to and intercepting events
366(8)
JPA event listeners and callbacks
366(3)
Implementing Hibernate interceptors
369(4)
The core event system
373(1)
13.3 Auditing and versioning with Hibernate Envers
374(7)
Enabling audit logging
375(1)
Creating an audit trail
376(1)
Finding revisions
377(2)
Accessing historical data
379(2)
13.4 Dynamic data filters
381(6)
Defining dynamic filters
381(1)
Applying a dynamic filter
382(1)
Enabling a dynamic filter
382(2)
Filtering collection access
384(3)
Part 4 Building Java persistence applications with Spring
387(76)
14 Integrating JPA and Hibernate with Spring
389(52)
14.1 Spring Framework and dependency injection
390(1)
14.2 JPA application using Spring and the DAO pattern
391(10)
14.3 Generifying aJPA application that uses Spring and DAO
401(4)
14.4 Hibernate application using Spring and the DAO pattern
405(4)
14.5 Generifying a Hibernate application that uses Spring and DAO
409(6)
Working with Spring Data JDBC
414(1)
15.1 Creating a Spring Data JDBC project
415(6)
15.2 Working with queries in Spring Data JDBC
421(9)
Defining query methods with Spring Data JDBC
421(4)
Limiting query results, sorting, and paging
425(2)
Streaming results
427(1)
The @Query annotation
428(1)
Modifying queries
429(1)
15.3 Modeling relationships with Spring Data JDBC
430(11)
Modeling a one-to-one relationship with Spring Data JDBC
430(2)
Modeling embedded entities with Spring Data JDBC
432(2)
Modeling a one-to-many relationship with Spring Data JDBC
434(2)
Modeling a many-to-many relationship with Spring Data JDBC
436(5)
16 Working with Spring Data REST
441(22)
16.1 Introducing REST applications
442(1)
16.2 Creating a Spring Data REST application
443(6)
16.3 Using ETags for conditional requests
449(4)
16.4 Limiting access to repositories, methods, and fields
453(2)
16.5 Working with REST events
455(4)
Writing an AnnotatedHandler
456(1)
Writing an ApplicationListener
457(2)
16.6 Using projections and excerpts
459(4)
Part 5 Building Java persistence applications with Spring
463(42)
17 Working urith Spring Data MongoDB
465(26)
17.1 Introducing MongoDB
465(3)
17.2 Introducing Spring Data MongoDB
468(4)
17.3 Using MongoRepository to access a database
472(9)
Defining query methods with Spring Data MongoDB
472(5)
Limiting query results, sorting, and paging
477(2)
Streaming results
479(1)
The @Query annotation
480(1)
17.4 Query by Example
481(2)
17.5 Referencing other MongoDB documents
483(2)
17.6 Using MongoTemplate to access a database
485(6)
Configuring access to the database through MongoTemplate
485(1)
Executing CRUD operations using MongoTemplate
486(5)
18 Working with Hibernate OGM
491(14)
18.1 Introducing Hibernate OGM
491(1)
18.2 Building a simple MongoDB Hibernate OGM application
492(10)
Configuring the Hibernate OGM application
492(2)
Creating the entities
494(2)
Using the application with MongoDB
496(6)
18.3 Switching to the Neo4j NoSQL database
502(3)
Part 6 Writing queries and testing Java persistence application
505(48)
19 Querying JPA with Querydsl
507(20)
19.1 Introducing Querydsl
507(1)
19.2 Creating a Querydsl application
508(6)
Configuring the Querydsl application
508(3)
Creating the entities
511(1)
Creating the test data to query
512(2)
19.3 Querying a database with Querydsl
514(13)
Filtering data
516(2)
Ordering data
518(1)
Grouping data and working with aggregates
519(1)
Working with subqueries and joins
520(3)
Updating entities
523(1)
Deleting entities
524(3)
20 Testing Java persistence applications
527(26)
20.1 Introducing the test pyramid
528(1)
20.2 Creating the persistence application to test
529(4)
20.3 Using the Spring TestContext Framework
533(2)
20.4 The @DirtiesContext annotation
535(2)
20.5 @Transactional execution
537(5)
20.6 The @BeforeTransaction and @AfterTransaction annotations
542(1)
20.7 Working with Spring profiles
543(4)
20.8 Working with test execution listeners
547(6)
Appendix A Maven 553(7)
Appendix B Spring Data JPA keyword usage 560(2)
Appendix C Spring Data JDBC keyword usage 562(2)
Appendix D Spring Data MongoDB keyword usage 564(3)
References 567(1)
Index 568
about the author Ctlin Tudose  has more than 20 years experience in the Java area and is currently acting as Java and web technologies expert at Luxoft Romania. He has taught more than 2,000 hours of courses and applications as a teaching assistant and professor at the Faculty of Automation and Computers in Bucharest. He authored 6 courses at Pluralsight on Java topics, including Java persistence and he holds a PhD in computer science.

Christian Bauer ,  Gavin King , and  Gary Gregory  are the authors of  Java Persistence with Hibernate, Second Edition , on which this book is based.