At a Glance
360 Pages
22.96 x 18.14 x 2.39
Paperback
RRP $76.00
$29.25
62%OFF
or 4 interest-free payments of $7.31 with
Aims to ship in 15 to 25 business days
"Java Data Objects" aims to revolutionize the way Java developers interact with databases and other datastores. It allows you to store and retrieve objects in a way that's natural toJava programmers. Instead of working with JDBC or EJB's container-managed persistence, you work directly with your Java objects. You don't have to copy data to and from database tables or issue SELECTs to perform queries: your JDO implementation takes care of persistence behind-the-scenes, and you make queries based on the fields of your Java objects, using normal Java syntax. The result is software that is truly object-oriented: not code that is partially object-oriented, with a large database-shaped lump on the back end. JDO lets you save plain, ordinary Java objects, and does not force you to use different data models and types for dealing with storage. As a result, your code becomes easier to maintain, easier to re-use, and easier to test. And you're not tied to a specific database vendor: your JDO code is entirely database-independent. You don't even need to know whether the datastore is a relational database, an object database, or just a set of files. The book offers a thorough introduction to JDO, starting with a simple application that demonstrates many of JDO's capabilities. It shows you how to make classes persistent, how JDO maps persistent classes to the database, how to configure JDO at runtime, how to perform transactions, and how to make queries. More advanced chapters cover optional features such as nontransactional access and optimistic transactions. The book concludes by discussing the use of JDO in web applications and J2EE environments.
Foreword | p. xv |
Preface | p. xvii |
An Initial Tour | p. 1 |
Defining a Persistent Object Model | p. 2 |
The Classes to Persist | p. 3 |
Declaring Classes to Be Persistent | p. 7 |
Project Build Environment | p. 8 |
Jars Needed to Use the JDO Reference Implementation | p. 9 |
Project Directory Structure | p. 10 |
Enhancing Classes for Persistence | p. 10 |
Establish a Datastore Connection and Transaction | p. 11 |
Acquiring a PersistenceManager | p. 11 |
Creating a FOStore Datastore | p. 12 |
Operations on Instances | p. 14 |
Making Instances Persistent | p. 15 |
Accessing Instances | p. 18 |
Modifying an Instance | p. 22 |
Deleting Instances | p. 26 |
Summary | p. 27 |
An Overview of JDO Interfaces | p. 28 |
The javax.jdo Package | p. 28 |
JDO Exception Classes | p. 31 |
The javax.jdo.spi Package | p. 34 |
Optional Features | p. 35 |
Identity Options | p. 36 |
Optional Collections | p. 36 |
Transaction-Related Optional Features | p. 37 |
JDO Architectures | p. 38 |
Architecture Within Application JVM | p. 40 |
Single PersistenceManager | p. 40 |
Multiple PersistenceManagers Accessing the Same Datastore | p. 41 |
Multiple PersistenceManagers Accessing Different Datastores | p. 43 |
Shared Implementation Cache | p. 44 |
Datastore Access | p. 46 |
Direct Access of Filesystem or Local Datastore | p. 46 |
Remote Access of a JDO Server | p. 46 |
Remote Access of a SQL Datastore | p. 46 |
System Architectures with a JDO Application | p. 48 |
JDO Rich Client with Local Datastore | p. 48 |
JDO Applications in a Web Server | p. 48 |
JDO Applications as Web Services | p. 48 |
Rich Client Connecting to Application Server with EJB Components | p. 49 |
Web Server with EJB Server | p. 50 |
EJB Session Beans Using Session Bean Facades | p. 50 |
JDO Providing Container-Managed Persistence | p. 51 |
Defining Persistent Classes | p. 52 |
Kinds of Classes and Instances | p. 52 |
Kinds of Classes | p. 53 |
Kinds of Instances | p. 53 |
Java Classes and Metadata | p. 54 |
JDO Metadata | p. 55 |
Inheritance | p. 58 |
The Media Mania Object Model | p. 60 |
Fields | p. 63 |
Supported Types | p. 64 |
Persistence of Fields | p. 66 |
Complete Metadata for the Media Mania Model | p. 68 |
Datastore Mappings | p. 70 |
Mapping Approaches | p. 71 |
Relational Modeling Constructs | p. 72 |
SQL 99 | p. 73 |
Modeling Constructs in Java and Relational Models | p. 74 |
Mapping Classes to Tables | p. 75 |
Mapping a Single-Valued Field to a Column | p. 76 |
Name-Mapping | p. 76 |
Type-Mapping | p. 77 |
Indexes | p. 78 |
Identity | p. 78 |
Inheritance | p. 80 |
References | p. 82 |
Collections and Relationships | p. 83 |
Using a Foreign Key | p. 83 |
Using a Join Table | p. 89 |
One-to-One Relationships | p. 90 |
Representing Lists and Maps | p. 92 |
Class Enhancement | p. 94 |
Enhancement Approaches | p. 95 |
Reference Enhancer | p. 96 |
Vendor-Specific Enhancement | p. 96 |
Binary Compatibility | p. 97 |
Enhancement Effects on Your Code | p. 98 |
Changes Made by the Enhancer | p. 98 |
Metadata | p. 99 |
Instance-Level Data | p. 100 |
Field Mediation | p. 101 |
Establishing a JDO Runtime Environment | p. 104 |
Configuring a PersistenceManagerFactory | p. 105 |
Connection Properties | p. 108 |
Optional Feature Properties | p. 110 |
Flags | p. 111 |
Flags Settings in Multiple Interfaces | p. 111 |
Determining the Optional Features and Default Flag Settings | p. 112 |
Vendor-Specific Properties | p. 115 |
Nonconfigurable Properties | p. 115 |
Acquiring a PersistenceManager | p. 115 |
User Object | p. 116 |
Closing a PersistenceManager | p. 116 |
Closing a PersistenceManagerFactory | p. 117 |
Transactions | p. 117 |
Properties of Transactions | p. 118 |
Transactions and Locking in the Datastore | p. 118 |
Types of Transactions in JDO | p. 121 |
Acquiring a Transaction | p. 121 |
Setting the Transaction Type | p. 122 |
Transaction Demarcation | p. 122 |
Restoring Values on Rollback | p. 125 |
Determining Whether a Transaction Is Active | p. 126 |
Multiple PersistenceManagers | p. 126 |
Multithreading | p. 126 |
Instance Management | p. 128 |
Persistence of Instances | p. 129 |
Explicit Persistence | p. 129 |
Persistence-by-Reachability | p. 131 |
Extent Access | p. 136 |
Accessing an Extent | p. 137 |
Extent Iteration | p. 137 |
Ignoring the Cache | p. 139 |
Accessing and Updating Instances | p. 139 |
Explicit Marking of Modified Instances | p. 141 |
Deleting Instances | p. 142 |
Delete Propagation | p. 143 |
The JDO Query Language | p. 145 |
Query Components | p. 146 |
Creating and Initializing a Query | p. 149 |
Changes in the Cache | p. 152 |
Query Namespaces | p. 153 |
Type Names | p. 153 |
Field, Parameter, and Variable Names | p. 154 |
Keywords | p. 154 |
Literals | p. 155 |
Query Execution | p. 155 |
Parameter Declarations | p. 155 |
Executing a Query | p. 156 |
Compiling a Query | p. 159 |
The Query Filter | p. 160 |
General Characteristics of Expressions | p. 161 |
Query Operators | p. 161 |
References | p. 166 |
Collections | p. 168 |
Ordering Query Results | p. 171 |
Closing a Query | p. 173 |
Identity | p. 174 |
Overview | p. 175 |
JDO Identity Types | p. 175 |
Metadata | p. 176 |
Identity Class | p. 177 |
Datastore Identity | p. 178 |
Application Identity | p. 179 |
Primary-Key Fields | p. 179 |
Persistent Class equals() and hashCode() Methods | p. 180 |
The Application-Identity Class | p. 180 |
A Single-Field Primary Key | p. 181 |
A Compound Primary Key | p. 184 |
A Compound Primary Key That Contains a Foreign Key | p. 187 |
Application Identity in an Inheritance Hierarchy | p. 190 |
Nondurable Identity | p. 195 |
Identity Methods | p. 196 |
Get the Identity Class | p. 197 |
Get the Identity of an Instance | p. 198 |
Getting an Instance via Its Identity | p. 200 |
Changing the Application Identity of an Instance | p. 202 |
Get the Current Application Identity of an Instance | p. 202 |
The String Representation of Identity | p. 203 |
Advanced Topics | p. 203 |
Choosing an Identity Type | p. 204 |
Using Identity Versus a Query | p. 204 |
Identity Across PersistenceManagers | p. 204 |
Lifecycle States and Transitions | p. 206 |
Lifecycle States | p. 206 |
Transient | p. 207 |
Persistent-New | p. 207 |
Hollow | p. 208 |
Persistent-Clean | p. 210 |
Persistent-Dirty | p. 210 |
Persistent-Deleted | p. 210 |
Persistent-New-Deleted | p. 210 |
State Interrogation | p. 211 |
State Transitions | p. 212 |
State Transitions During a Datastore Transaction | p. 212 |
State Transitions When a Transaction Completes | p. 213 |
States Between Transactions | p. 214 |
Field Management | p. 215 |
Transactional Fields | p. 215 |
Null Values | p. 215 |
Retrieval of Fields | p. 216 |
Default Fetch Group | p. 216 |
Retrieving All Fields | p. 217 |
The Management of Fields | p. 219 |
Serialization | p. 219 |
Managing Fields During Lifecycle Events | p. 220 |
First- and Second-Class Objects | p. 221 |
Specifying a Second-Class Object | p. 224 |
Embedding Collection Elements | p. 225 |
Persistent Classes as Second-Class Objects | p. 226 |
Sharing of Instances | p. 226 |
Cache Management | p. 228 |
Explicit Management of Instances in the Cache | p. 228 |
Refreshing Instances | p. 229 |
Evicting Instances | p. 229 |
Cloning | p. 230 |
Transient-Transactional Instances | p. 231 |
Transient-Transactional Lifecycle States | p. 231 |
State Interrogation | p. 232 |
State Transitions | p. 232 |
Making a Persistent Instance Transient | p. 233 |
Nontransactional Access | p. 235 |
Nontransactional Features | p. 235 |
Reading Outside a Transaction | p. 238 |
Persistent-Nontransactional State | p. 239 |
Retaining Values at Transaction Commit | p. 241 |
Restoring Values at Transaction Rollback | p. 242 |
Before Image | p. 243 |
Restoring Persistent Instances | p. 244 |
Restoring Persistent-New Instances | p. 244 |
Modifying Persistent Instances Outside a Transaction | p. 245 |
Hot Cache Example | p. 246 |
Optimistic Transactions | p. 251 |
Verification at Commit | p. 252 |
Recovery from a Failed Transaction | p. 253 |
Setting Optimistic Transaction Behavior | p. 254 |
Optimistic Example | p. 254 |
Optimistic Transaction State Transitions | p. 256 |
Deleting Instances | p. 257 |
Making Instances Transactional | p. 257 |
Modifying Instances | p. 257 |
Commit | p. 258 |
Rollback | p. 258 |
The Web-Server Environment | p. 259 |
Web Servers | p. 259 |
Accessing the PersistenceManagerFactory | p. 261 |
Servicing Requests | p. 263 |
PersistenceManager per Request | p. 264 |
PersistenceManager per Application | p. 264 |
PersistenceManager per Transactional Request | p. 265 |
PersistenceManager per Session | p. 265 |
Transactions | p. 265 |
JavaServer Pages | p. 266 |
Struts with JDO | p. 267 |
J2EE Application Servers | p. 272 |
Enterprise JavaBeans Architecture | p. 273 |
Stateless Session Beans | p. 274 |
Configuring the PersistenceManagerFactory | p. 275 |
Stateless Session Beans with Container-Managed Transactions | p. 278 |
Stateful Session Beans with Container-Managed Transactions | p. 280 |
Bean-Managed Transactions | p. 281 |
javax.transaction.UserTransaction | p. 282 |
javax.jdo.Transaction | p. 282 |
Stateless Session Beans with Bean-Managed Transactions | p. 283 |
Stateful Session Beans with Bean-Managed Transactions | p. 283 |
Message-Driven Beans | p. 283 |
Persistent Entities and JDO | p. 284 |
Local Persistent Storage | p. 284 |
Remote Persistent Storage | p. 286 |
Lifecycle States and Transitions | p. 293 |
JDO Metadata DTD | p. 296 |
JDO Interfaces and Exception Classes | p. 298 |
JDO Query Language BNF | p. 308 |
Source Code for Examples | p. 313 |
Index | p. 345 |
Table of Contents provided by Rittenhouse. All Rights Reserved. |
ISBN: 9780596002763
ISBN-10: 0596002769
Series: Java Ser.
Published: 9th May 2003
Format: Paperback
Language: English
Number of Pages: 360
Audience: Professional and Scholarly
Publisher: O'Reilly Media, Inc, USA
Country of Publication: US
Dimensions (cm): 22.96 x 18.14 x 2.39
Weight (kg): 0.61
Shipping
Standard Shipping | Express Shipping | |
---|---|---|
Metro postcodes: | $9.99 | $14.95 |
Regional postcodes: | $9.99 | $14.95 |
Rural postcodes: | $9.99 | $14.95 |
How to return your order
At Booktopia, we offer hassle-free returns in accordance with our returns policy. If you wish to return an item, please get in touch with Booktopia Customer Care.
Additional postage charges may be applicable.
Defective items
If there is a problem with any of the items received for your order then the Booktopia Customer Care team is ready to assist you.
For more info please visit our Help Centre.
You Can Find This Book In
Architecture Patterns with Python
Enabling Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices
Paperback
RRP $100.75
$45.50
OFF
Learn Python 3 the Hard Way
A Very Simple Introduction to the Terrifyingly Beautiful World of Computers and Code
Paperback
RRP $60.95
$45.80
OFF
Intro to Python for Computer Science and Data Science
Learning to Program with AI, Big Data and The Cloud, Global Edition
Paperback
RRP $153.95
$89.25
OFF