Update cookies preferences

E-book: Beginning Hibernate: For Hibernate 5

  • Format: PDF+DRM
  • Pub. Date: 10-Nov-2016
  • Publisher: APress
  • Language: eng
  • ISBN-13: 9781484223192
  • Format - PDF+DRM
  • Price: 67,91 €*
  • * the price is final i.e. no additional discount will apply
  • Add to basket
  • Add to Wishlist
  • This ebook is for personal use only. E-Books are non-refundable.
  • Format: PDF+DRM
  • Pub. Date: 10-Nov-2016
  • Publisher: APress
  • Language: eng
  • ISBN-13: 9781484223192

DRM restrictions

  • Copying (copy/paste):

    not allowed

  • Printing:

    not allowed

  • Usage:

    Digital Rights Management (DRM)
    The publisher has supplied this book in encrypted form, which means that you need to install free software in order to unlock and read it.  To read this e-book you have to create Adobe ID More info here. Ebook can be read and downloaded up to 6 devices (single user with the same Adobe ID).

    Required software
    To read this ebook on a mobile device (phone or tablet) you'll need to install this free app: PocketBook Reader (iOS / Android)

    To download and read this eBook on a PC or Mac you need Adobe Digital Editions (This is a free app specially developed for eBooks. It's not the same as Adobe Reader, which you probably already have on your computer.)

    You can't read this ebook with Amazon Kindle

This updated edition includes the new Hibernate 5.0 framework as well as coverage of NoSQL, MongoDB and related from applications to big data. It is ideal if you’re experienced in Java with databases (the traditional, or "connected," approach), but new to open-source, lightweight Hibernate, a leading object-relational mapping (ORM) and database-oriented persistence application development framework.

Beginning Hibernate packs in information about the release of the Hibernate 5 persistence layer and provides a clear introduction to the current standard for object-relational persistence in Java. And since the book keeps its focus on Hibernate without wasting time on nonessential third-party tools, 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. The authors also present material in a lively, example-based manner—not a dry, theoretical, hard-to-read fashion.

What you’ll learn

  • How to build enterprise Java-based transaction-type applications that access complex data with Hibernate
  • How to work with Hibernate 5
  • Where to integrate into the persistence life cycle
  • How to map using annotations, Hibernate XML files, and more
  • How to search and query with the new version of Hibernate
  • How to integrate with MongoDB using NoSQL


Who this book is for

Primary audiences are experienced Java developers interested in learning how to use and apply object-relational persistence in Java and who are new to the Hibernate persistence framework.

About the Authors xv
About the Technical Reviewer xvii
Acknowledgments xix
Introduction xxi
Chapter 1 An Introduction to Hibernate 5
1(8)
Plain Old Java Objects (POJOs)
1(2)
Origins of Hibernate and Object/Relational Mapping
3(1)
Hibernate as a Persistence Solution
4(1)
A Hibernate Hello World Example
5(1)
Mappings
6(1)
Persisting an Object
7(1)
Summary
7(2)
Chapter 2 Integrating and Configuring Hibernate
9(10)
The Steps Needed to Integrate and Configure Hibernate
9(1)
Understanding Where Hibernate Fits into Your Java Application
10(1)
Deploying Hibernate
10(7)
Installing Maven
11(6)
Connection Pooling
17(1)
Summary
18(1)
Chapter 3 Building a Simple Application
19(22)
A Simple Application
19(21)
A First Attempt
20(1)
Writing Data
21(3)
Reading Data
24(3)
Updating Data
27(1)
Persistence Contexts
28(1)
Removing Data
28(1)
A Note on Transactions
29(1)
Writing Our Sample Application
29(11)
Summary
40(1)
Chapter 4 The Persistence Life Cycle
41(26)
Introducing the Life Cycle
41(1)
Entities, Classes, and Names
42(1)
Identifiers
43(1)
Entities and Associations
44(7)
Saving Entities
51(3)
Object Equality and Identity
54(2)
Loading Entities
56(2)
Merging Entities
58(1)
Refreshing Entities
59(1)
Updating Entities
60(1)
Deleting Entities
61(1)
Cascading Operations
62(3)
Lazy Loading, Proxies, and Collection Wrappers
65(1)
Querying Objects
66(1)
Summary
66(1)
Chapter 5 An Overview of Mapping
67(12)
Why Mapping Cannot Easily Be Automated
68(1)
Primary Keys
69(2)
Lazy Loading
71(1)
Associations
72(5)
The One-to-One Association
73(2)
The One-to-Many and Many-to-One Association
75(1)
The Many-to-Many Association
76(1)
Applying Mappings to Associations
77(1)
Other Supported Features
77(1)
Specification of (Database) Column Types and Sizes
77(1)
The Mapping of Inheritance Relationships to the Database
77(1)
Primary Key
78(1)
The Use of SQL Formula-Based Properties
78(1)
Mandatory and Unique Constraints
78(1)
Summary
78(1)
Chapter 6 Mapping with Annotations
79(36)
Creating Hibernate Mappings with Annotations
79(2)
The Cons of Annotations
79(1)
The Pros of Annotations
80(1)
Choosing Which to Use
81(1)
JPA 2 Persistence Annotations
81(25)
Entity Beans with @Entity
82(1)
Primary Keys with @ld and @GeneratedValue
83(3)
Compound Primary Keys with @ld, #IdClass, or @Embeddedid
86(5)
Database Table Mapping with @Table and @SecondaryTable
91(1)
Persisting Basic Types with @Basic
92(1)
Omitting Persistence with @Transient
93(1)
Mapping Properties and Fields with @Column
93(1)
Modeling Entity Relationships
94(6)
Inheritance
100(3)
Other JPA 2 Persistence Annotations
103(2)
Ordering Collections with @OrderColumn
105(1)
Configuring the Annotated Classes
106(2)
Hibernate-Specific Persistence Annotations
108(5)
@Immutable
108(1)
Natural IDs
108(5)
Summary
113(2)
Chapter 7 JPA Integration and Lifecycle Events
115(20)
The Java Persistence Architecture
115(7)
The Project Object Model
116(1)
The JPASessionUtil Class
117(1)
Testing JPASessionUtil
118(4)
Lifecycle Events
122(3)
External Entity Listeners
125(2)
Data Validation
127(6)
Summary
133(2)
Chapter 8 Using the Session
135(12)
Sessions
135(3)
Transactions and Locking
138(4)
Transactions
138(1)
Locking
139(1)
Deadlocks
140(2)
Caching
142(3)
Threads
145(1)
Summary
146(1)
Chapter 9 Searches and Queries
147(18)
Hibernate Query Language (HQL)
147(1)
Syntax Basics
148(2)
Update
148(1)
Delete
148(1)
Insert
149(1)
Select
149(1)
Named Queries
150(3)
Logging and Commenting the Underlying SQL
153(1)
Logging the SQL
153(1)
Commenting the Generated SQL
154(1)
The from Clause and Aliases
154(1)
The select Clause and Projection
155(1)
Using Restrictions with HQL
155(1)
Using Named Parameters
156(1)
Paging Through the Result Set
157(1)
Obtaining a Unique Result
158(1)
Sorting Results with the order by Clause
158(1)
Associations
159(1)
Aggregate Methods
160(1)
Bulk Updates and Deletes with HQL
160(1)
Using Native SQL
161(2)
Summary
163(2)
Chapter 10 Advanced Queries Using Criteria
165(16)
Using the Criteria API
165(12)
Using Restrictions with Criteria
168(7)
Paging Through the Result Set
175(1)
Obtaining a Unique Result
176(1)
Sorting the Query's Results
177(1)
Associations
177(2)
Projections and Aggregates
179(1)
Should You Use the Criteria API?
180(1)
Summary
180(1)
Chapter 11 Filtering the Results of Searches
181(10)
When to Use Filters
181(1)
Defining and Attaching Filters
182(1)
Filters with Annotations
182(1)
Filters with XML Mapping Documents
183(1)
Using Filters in Your Application
183(1)
A Basic Filtering Example
184(5)
Summary
189(2)
Chapter 12 Leaving the Relational Database Behind: NoSQL
191(18)
Where Is Hibernate When It Comes to NoSQL?
192(1)
First Warning: NoSQL Is Not Relational, and Hibernate Is an ORM
192(1)
Hibernate Is not Perfect, or "Finished"
192(1)
Basic CRUD Operations
193(10)
The Tests
197(1)
Testing Create and Read
198(1)
Testing Updates
199(1)
Testing Removal
200(1)
Querying in OGM
200(3)
MongoDB
203(1)
What the Hibernate Native API for OGM Looks Like
204(3)
Summary
207(2)
Chapter 13 Hibernate Envers
209(10)
Making Envers Available to Your Project
209(2)
Storing a User Object
211(2)
Updating the User
213(1)
Accessing Envers Information
214(1)
Querying Audited Data
215(1)
Applying Audit Data
216(1)
Summary
217(2)
Index 219
Dave Minter has adored computers since he was small enough to play in the boxes they came in. He built his first PC from discarded, faulty, and obsolete components, and considers that to be the foundation of his career as an integration consultant. Dave is based in London, where he helps large and small companies build systems that "just work." He co-authored Building Portals with the Java Portlet API and Pro Hibernate 3. Joseph Ottinger is an expert software developer, coder and programmer. He has also served as technology evangelist GigaSpaces and a principle engineer at Red Hat. He was Editor in Chief of TheServerSide-dot-com. He is the author of Hibernate Recipes and Beginning Hibernate for Apress and has authored other books as well as articles.

Jeff Linwood has been involved in software programming since he had a 286 in high school. He got caught up with the Internet when he got access to a UNIX shell account, and it has been downhill ever since. Jeff has published articles on several Jakarta Apache open source projects in Dr. Dobb's Journal, CNET's Builder.com, and JavaWorld. Jeff has a bachelor's degree in chemical engineering from Carnegie Mellon University. He currently works for the Gossamer Group in Austin, Texas, on content management and web application syndication systems. He gets to play with all the latest open source projects there. Jeff also co-authored Professional Struts Applications, Building Portals with the Java Portlet API, and Pro Hibernate 3. He was a technical reviewer for Enterprise Java Development on a Budget and Extreme Programming with Ant.