Beginning Database-Driven Application Development in Java EE using GlassFish [Vasiliev 2008-09-23].pdf
(
2706 KB
)
Pobierz
Beginning Database-Driven
Application Development
in Java EE
™
Using GlassFish
™
Yuli Vasiliev
Beginning Database-Driven Application Development in Java
™
EE: Using GlassFish
™
Copyright © 2008 by Yuli Vasiliev
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (paperback): 978-1-4302-0963-8
ISBN-13 (electronic): 978-1-4302-0964-5
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence
of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc., in the
United States and other countries. Apress, Inc., is not affiliated with Sun Microsystems, Inc., and this book
was written without endorsement from Sun Microsystems, Inc.
Lead Editor: Steve Anglin
Developmental Editor: Tom Welsh
Technical Reviewer: Gordon Yorke
Editorial Board: Clay Andres, Steve Anglin, Ewan Buckingham, Tony Campbell, Gary Cornell,
Jonathan Gennick, Matthew Moodie, Joseph Ottinger, Jeffrey Pepper, Frank Pohlmann,
Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh
Project Manager: Tracy Brown Collins
Copy Editor: Kim Wimpsett
Associate Production Director: Kari Brooks-Copony
Production Editor: Ellie Fountain
Compositor: Dina Quan
Proofreader: Linda Seifert
Indexer: Carol Burbo
Artist: Kinetic Publishing Services, LLC
Cover Designer: Kurt Krames
Manufacturing Director: Tom Debolski
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail
orders-ny@springer-sbm.com,
or
visit
http://www.springeronline.com.
For information on translations, please contact Apress directly at 2855 Telegraph Avenue, Suite 600,
Berkeley, CA 94705. Phone 510-549-5930, fax 510-549-5939, e-mail
info@apress.com,
or visit
http://www.apress.com.
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use.
eBook versions and licenses are also available for most titles. For more information, reference our Special
Bulk Sales–eBook Licensing web page at
http://www.apress.com/info/bulksales.
The information in this book is distributed on an “as is” basis, without warranty. Although every precau-
tion has been taken in the preparation of this work, neither the author(s) nor Apress shall have any
liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly
or indirectly by the information contained in this work.
The source code for this book is available to readers at
http://www.apress.com.
To my father.
Contents at a Glance
About the Author
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
About the Technical Reviewer
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Introduction
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
PART 1
■■■
Introduction
■
CHAPTER 1
■
CHAPTER 2
■
CHAPTER 3
Setting Up Your Working Environment
. . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Getting Started with GlassFish
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Introducing EJB 3 and the Java Persistence API
. . . . . . . . . . . . . . . . 49
PART 2
■■■
Planning the Application
■
CHAPTER 4
■
CHAPTER 5
Planning a Java EE Application
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Planning the Underlying Database
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
PART 3
■■■
Building the Database Tier
■
CHAPTER 6
■
CHAPTER 7
Implementing the Database Tier
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Setting Up the Data Source
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
PART 4
■
CHAPTER
■
CHAPTER
■
CHAPTER
■
CHAPTER
■■■
8
9
10
11
Building the Persistence Tier
Designing JPA Entities
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Object/Relational Mapping
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Using EntityManager
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
Using Java Persistence Query Language (JPQL)
. . . . . . . . . . . . . . . 283
PART 5
■■■
Building the Business Logic Tier
■
CHAPTER 12
Designing Session Beans
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
■
CHAPTER 13
Managing Transactions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
iv
Plik z chomika:
musli_com
Inne pliki z tego folderu:
Big Java Late Objects [Horstmann 2012-02-01].pdf
(167477 KB)
Data Structures_ Abstraction and Design using Java (2nd ed.) [Koffman & Wolfgang 2010-01-26].pdf
(190252 KB)
Big Java Early Objects (5th ed.) [Horstmann 2013-01-04].pdf
(145099 KB)
Data Abstraction and Problem Solving with Java_ Walls and Mirrors (3rd ed.) [Prichard & Carrano 2010-10-30] (photocopier quality).pdf
(110506 KB)
A Little Java, a Few Patterns [Felleisen & Friedman 1997-12-19].pdf
(14847 KB)
Inne foldery tego chomika:
3D Design - Programming
ActionScript
Actionscript - Flash - Flex - Air
Ada
ADO
Zgłoś jeśli
naruszono regulamin