rent-now

Rent More, Save More! Use code: ECRENTAL

5% off 1 book, 7% off 2 books, 10% off 3+ books

9781590596937

Beginning Hibernate: From Novice to Professional

by
  • ISBN13:

    9781590596937

  • ISBN10:

    1590596935

  • Format: Paperback
  • Copyright: 2006-08-28
  • Publisher: Springer-Verlag New York Inc
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $39.99

Summary

Beginning Hibernateis ideal if youre experienced in Java with databases (the traditional, or "connected," approach), but are new to open source lightweight Hibernatethe most popular de facto object-relational mapping and database-oriented application development framework. This book packs in brand new information about the latest release of the Hibernate 3.2.x persistence layer and provides a clear introduction to the current standard for object-relational persistence in Java.Experienced author Dave Minter and contributor Jeff Linwood provide more in-depth examples than any other books for Hibernate beginners. The authors also present material in a lively, example-based mannernot in a dry, theoretical, hard-to-read fashion. And since the book keeps its focus on Hibernate without wasting time on nonessential third-party tools, youll be able to immediately start building transaction-based engines and applications.

Table of Contents

About the Authors xiii
About the Technical Reviewer xv
Acknowledgments xvii
Introduction xix
CHAPTER 1 An Introduction to Hibernate 3 1(10)
Plain Old Java Objects (POJOs)
1(2)
Origins of Hibernate and Object-Relational Mapping
3(3)
EJBs As a Persistence Solution
4(1)
Hibernate As a Persistence Solution
5(1)
A Thin Solution?
6(1)
A Hibernate Hello World Example
6(1)
Mappings
7(1)
Database Generation
8(1)
The Relationship of Hibernate 3 with EJB 3.0
8(1)
Summary
9(2)
CHAPTER 2 Integrating and Configuring Hibernate 11(16)
The Steps Needed to Integrate and Configure Hibernate
11(1)
Understanding Where Hibernate Fits in Your Java Application
12(1)
Deploying Hibernate
13(1)
Required Libraries for Running Hibernate 3
13(1)
Annotations and Enterprise JavaBeans 3
14(1)
JMX and Hibernate
14(1)
Hibernate Configuration
14(9)
Hibernate Properties
16(3)
XML Configuration
19(1)
Mapping Documents
20(1)
Naming Strategy
21(1)
Using a Container-Managed Data Source
22(1)
The Session Factory
23(1)
SQL Dialects
24(1)
Summary
25(2)
CHAPTER 3 Building a Simple Application 27(36)
Installing the Tools
27(6)
Hibernate and Hibernate Tools
27(1)
HSQLDB 1.8 0
28(1)
Ant 1.6.5
28(4)
The Ant Tasks
32(1)
Enabling Logging
32(1)
Creating a Hibernate Configuration File
33(2)
Running the Message Example
35(3)
Persisting Multiple Objects
38(1)
Creating Persistence Classes
38(4)
Creating the Object Mappings
42(3)
Creating the Tables
45(2)
Sessions
47(5)
The Session and Related Objects
48(2)
Using the Session
50(2)
Building DAOs
52(4)
The Example Client
56(5)
Summary
61(2)
CHAPTER 4 The Persistence Life Cycle 63(16)
Introduction to the Life Cycle
63(1)
Entities, Classes, and Names
64(1)
Identifiers
65(1)
Entities and Associations
65(4)
Saving Entities
69(1)
Object Equality and Identity
70(1)
Loading Entities
71(1)
Refreshing Entities
72(1)
Updating Entities
73(1)
Deleting Entities
74(1)
Cascading Operations
74(2)
Lazy Loading, Proxies, and Collection Wrappers
76(1)
Querying Objects
77(1)
Summary
77(2)
CHAPTER 5 An Overview of Mapping 79(14)
Why Mapping Cannot Be Automated
80(2)
Primary Keys
82(1)
Lazy Loading
83(1)
Associations
84(5)
The One-to-One Association
85(2)
The One-to-Many and Many-to-One Association
87(1)
The Many-to-Many Association
88(1)
Applying Mappings to Associations
89(1)
Types of Mapping
89(1)
Other Information Represented in Mappings
90(1)
Specification of (Database) Column Types and Sizes
90(1)
The Mapping of Inheritance Relationships to the Database
90(1)
Primary Key
91(1)
The Use of SQL Formula–Based Properties
91(1)
Mandatory and Unique Constraints
91(1)
Cascading of Operations
91(1)
Summary
91(2)
CHAPTER 6 Mapping with Annotations 93(46)
Java 5 Features
93(1)
Creating Hibernate Mappings with Annotations
93(32)
Cons of Annotations
94(1)
Pros of Annotations
94(1)
Choosing Which to Use
95(1)
Using Annotations in Your Application
96(1)
EJB 3 Persistence Annotations
96(5)
Entity Beans with @Entity
101(1)
Primary Keys with @Id and @Generated Value
101(2)
Generating Primary Key Values with @SequenceGenerator
103(1)
Generating Primary Key Values with @TableGenerator
104(1)
Compound Primary Keys with @Id, @IdClass, or @Embeddedld
105(5)
Database Table Mapping with @Table and @SecondaryTable
110(1)
Persisting Basic Types with @Basic
111(1)
Omitting Persistence with @Transient
112(1)
Mapping Properties and Fields with @Column
112(1)
Modeling Entity Relationships
113(7)
Inheritance
120(2)
Other EJB 3 Persistence Annotations
122(3)
Configuring the Annotated Classes
125(1)
Hibernate 3–Specific Persistence Annotations
126(5)
@Entity
128(1)
Sorting Collections with @Sort
129(1)
Ordering Collections with @IndexColumn
129(1)
Applying Indexes with @Table and @Index
130(1)
Restricting Collections with @Where
130(1)
Alternative Key Generation Strategies with @GenericGenerator
130(1)
Using Ant with Annotation-Based Mappings
131(1)
Code Listings
132(5)
Summary
137(2)
CHAPTER 7 Creating Mappings with Hibernate XML Files 139(40)
Hibernate Types
139(2)
Entities
139(1)
Components
140(1)
Values
140(1)
The Anatomy of a Mapping File
141(21)
The [hibernate-mapping> Element 141
The [class> Element 143
The [id> Element 146
The [property> Element 148
The [component> Element 150
The [one-to-one> Element 151
The [many-to-one> Element 153
The Collection Elements
155(7)
Mapping Simple Classes
162(2)
Mapping Composition
164(3)
Mapping Other Associations
167(3)
Mapping Collections
170(2)
Mapping Inheritance Relationships
172(4)
One Table per Concrete Class
173(1)
One Table per Subclass
174(1)
One Table per Class Hierarchy
175(1)
More Exotic Mappings
176(2)
The any Tag
177(1)
The array Tag
177(1)
The [dynamic-component> Element 177
Summary
178(1)
CHAPTER 8 Using the Session 179(14)
Sessions
179(3)
Transactions and Locking
182(8)
Transactions
182(3)
Locking
185(1)
Deadlocks
186(4)
Caching
190(2)
Threads
192(1)
Summary
192(1)
CHAPTER 9 Searches and Queries 193(20)
HQL
193(1)
Syntax Basics
194(2)
UPDATE
194(1)
DELETE
194(1)
INSERT
195(1)
SELECT
195(1)
The First Example with HQL
196(4)
Logging the Underlying SQL
200(1)
Commenting the Generated SQL
200(1)
The from Clause and Aliases
201(1)
The select Clause and Projection
201(1)
Using Restrictions with HQL
202(1)
Using Named Parameters
203(1)
Paging Through the Result Set
204(1)
Obtaining a Unique Result
205(1)
Sorting Results with the order by Clause
205(1)
Associations
205(2)
Aggregate Methods
206(1)
Bulk Updates and Deletes with HQL
207(1)
Named Queries for HQL and SQL
208(2)
Using Native SQL
210(1)
Summary
211(2)
CHAPTER 10 Advanced Queries Using Criteria 213(12)
Using the Criteria API
213(10)
Using Restrictions with Criteria
214(3)
Paging Through the Result Set
217(1)
Obtaining a Unique Result
217(1)
Sorting the Query's Results
218(1)
Associations
218(1)
Distinct Results
219(1)
Projections and Aggregates
219(2)
Query By Example (QBE)
221(2)
Summary
223(2)
CHAPTER 11 Filtering the Results of Searches 225(8)
When to Use Filters
225(1)
Defining Filters
226(1)
Using Filters in Your Application
227(1)
A Basic Filtering Example
227(5)
Summary
232(1)
APPENDIX A More Advanced Features 233(32)
EJB 3 and the EntityManager
233(3)
Managed Versioning and Optimistic Locking
236(2)
XML Relational Persistence
238(5)
Adding Node Information to Mappings
238(2)
Exporting XML Entities
240(2)
Importing XML Entities
242(1)
Other Considerations When Using XML Entities
243(1)
Maps
243(2)
Limitations of Hibernate
245(1)
Hand-Rolled SQL
245(6)
Using a Direct Mapping
245(2)
Using a View
247(1)
Putting SQL into a Mapping
248(3)
Invoking Stored Procedures
251(1)
Events
252(3)
An Example Event Listener
254(1)
Interceptors
255(8)
An Example Interceptor
257(6)
Overriding the Default Constructor
263(1)
Summary
264(1)
APPENDIX B Hibernate Tools 265(34)
The Eclipse Plug-In
265(19)
Installing the Plug-In
266(2)
The Boilerplate Project Configuration
268(3)
Using the Hibernate Console
271(13)
The Ant Tasks
284(13)
How the Ant Tasks Work
285(6)
Reverse Engineering
291(3)
Templates
294(2)
Configuring the Classpath
296(1)
Summary
297(2)
APPENDIX C Hibernate and Spring 299(14)
Spring Libraries
299(1)
Configuring Hibernate from a Spring Application
300(3)
Using Hibernate in Your Spring Beans
303(3)
Declarative Transaction Management
306(2)
Managing the Session
308(1)
The Sample Configuration File
309(3)
Summary
312(1)
APPENDIX D Upgrading from Hibernate 2 313(6)
Package and DTD Changes
313(2)
New Features and Support for Old Ones
315(1)
Changes and Deprecated Features
315(1)
Additions
316(1)
Changes to Tools and Libraries
316(1)
Changes with Java 5
317(1)
Summary
317(2)
INDEX 319

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program