Академический Документы
Профессиональный Документы
Культура Документы
July 2008
Oracle WebLogic Server Programming WebLogic Enterprise JavaBeans, 10g Release 3 (10.1.3) Copyright 2007, 2008, Oracle and/or its affiliates. All rights reserved. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this software or related documentation is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065. This software is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. This software and documentation may provide access to or information on content, products and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.
Contents
iii
Performance-Enhancing Features for WebLogic Server EJBs . . . . . . . . . . . . . . . . 2-11 CMP Beans Increase Developer Productivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14 Reliability and Availability Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14 Securing EJBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
iv
Clustered Versus Local EJB Timer Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15 Using Java Programming Interfaces to Program Timer Objects . . . . . . . . . . . . . . . 4-16 Timer Deployment Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20 Configuring Clustered EJB Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20 Declare Web Service References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21 Compile Java Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-22 Generate Deployment Descriptors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-22 Edit Deployment Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-22 Security Elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23 Resource Mapping Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24 Persistence Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25 Clustering Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26 Data Consistency Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28 Container-Managed Transactions Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-29 Performance Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33 Network Communications Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-36 Generate EJB Wrapper Classes, and Stub and Skeleton Files. . . . . . . . . . . . . . . . . . . . . 4-37 appc and Generated Class Name Collisions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-38 Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-39 Packaging Considerations for EJBs with Clients in Other Applications . . . . . . . . . 4-39 Deploy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-39 Solving Problems During Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-40 Adding Line Numbers to Class Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-40 Monitoring Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-40 Creating Debug Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-40 WebLogic Server Tools for Developing EJBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-40 Administration Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-41 javac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-41
Programming WebLogic Enterprise JavaBeans v
EJBGen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-42 weblogic.Deployer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-42 appc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-42 DDConverter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-42 Comparison of EJB Tool Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-43
5. Session EJBs
Comparing Stateless and Stateful Session Beans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1 Pooling for Stateless Session EJBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 Caching and Passivating Stateful Session EJBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 Stateful Session EJB Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5 Stateful Session EJB Passivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6 Specifying the Persistent Store Directory for Passivated Beans . . . . . . . . . . . . . . . . 5-7 Configuring Concurrent Access to Stateful Session Beans . . . . . . . . . . . . . . . . . . . . 5-8 Design Decisions for Session Beans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8 Choosing Between Stateless and Stateful Beans . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8 Choosing the Optimal Free Pool Setting for Stateless Session Beans . . . . . . . . . . . . 5-8 Implementing Session Beans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9 WebLogic-Specific Configurable Behaviors for Session Beans . . . . . . . . . . . . . . . . 5-9
6. Entity EJBs
Managing Entity Bean Pooling and Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1 Understanding Entity Pooling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 Understanding Entity Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 Understanding ejbLoad() and ejbStore() Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5 Controlling the Behavior of ejbLoad() and ejbStore(). . . . . . . . . . . . . . . . . . . . . . . . 6-6 Disabling Cache Flushing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6 Configuring Application-Level Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
vi
Using Primary Keys. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8 Specifying Primary Keys and Primary Key Classes . . . . . . . . . . . . . . . . . . . . . . . . . 6-8 Guidelines for Primary Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9 Automatically Generating Primary Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10 String-Valued CMP Field Trimming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-13 Configuring Entity EJBs for Database Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14 Configuring Table Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14 Automatic Table Creation (Development Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16 Delaying Database Inserts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17 Limiting Database Reads with cache-between-transactions (Long-Term Caching) 6-19 Updating the Database Before Transaction Ends . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-20 Dynamic Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-20 Enabling BLOB and CLOB Column Support for Oracle or DB2 . . . . . . . . . . . . . . 6-21 Optimized CLOB Column Insertion on Oracle 10g. . . . . . . . . . . . . . . . . . . . . . . . . 6-22 Specifying Field Groups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-23 Ordering and Batching Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-24 Using Query Caching (Read-Only Entity Beans) . . . . . . . . . . . . . . . . . . . . . . . . . . 6-25 Using SQL in Entity Beans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26 Using Container-Managed Relationships (CMRs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26 CMR Requirements and Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-27 CMR Cardinality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-27 CMR Direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-27 Removing CMRs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-28 Defining Container-Managed Relationships (CMRs) . . . . . . . . . . . . . . . . . . . . . . . 6-28 Using Cascade Delete for Entities in CMRs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-35 Relationship Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-36 Choosing a Concurrency Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-38 Exclusive Concurrency. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-38
Programming WebLogic Enterprise JavaBeans vii
Database Concurrency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-39 Optimistic Concurrency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-39 Read Only Concurrency. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-42 Concurrency Strategy Trade-Offs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-43 Configuring Concurrency Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-44 Using the Read-Mostly Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-45 Invalidating Entity EJBs Explicitly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-46 CMP Entity Bean Descriptors Element by Feature. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-47 Container-Managed Relationship Elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-48 Primary Key Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-49
7. Message-Driven EJBs
Message-Driven EJB Life Cycle and the Free Pool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 MDBs and the Free Pool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 MDBs and Concurrent Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4 MDBs and Messaging Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4 Point-to-Point (Queue) Model: One Message Per Listener . . . . . . . . . . . . . . . . . . . . 7-5 Publish/Subscribe (Topic) Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-5 Exactly-Once Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-6 JCA-Based MDBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7 MDB Deployment Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7 Destination and MDBs: Collocated vs. Not Collocated . . . . . . . . . . . . . . . . . . . . . . 7-7 JMS Distributed Destinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9 Programming and Configuring MDBs: Main Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10 Required JMS Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10 Create MDB Class and Configure Deployment Elements. . . . . . . . . . . . . . . . . . . . 7-11 Programming and Configuring MDBs: Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13 Configuring EJBs to Use Logical Message Destinations . . . . . . . . . . . . . . . . . . . . 7-14
viii
Configuring Destination Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16 Configuring Transaction Management Strategy for an MDB . . . . . . . . . . . . . . . . . 7-16 Configuring Suspension of Message Delivery During JMS Resource Outages . . . 7-17 Configuring the Number of Seconds to Suspend a JMS Connection. . . . . . . . . . . . 7-17 Manually Suspending and Resuming Message Delivery . . . . . . . . . . . . . . . . . . . . . 7-18 Configuring MDBs for Destinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-18 Configuring Durable Topic Subscriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-24 Configuring Message Handling Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26 Using the Message-Driven Bean Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-29 Configuring a Security Identity for a Message-Driven Bean. . . . . . . . . . . . . . . . . . 7-29 Using MDBs With Cross Domain Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-30 Migration and Recovery for Clustered MDBs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-31 Transaction Batching of MDBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-32 Configuring MDB Transaction Batching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-33 How MDB Transaction Batching Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-33 Nutshell Summary: Deployment Elements for MDBs . . . . . . . . . . . . . . . . . . . . . . . . . . 7-34
ix
Understanding Warning Messages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5 Disabling EJB Deployment Warning Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
D. appc Reference
appc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1 Advantages of Using appc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-1 appc Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-2 Designating Alternative Deployment Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . D-2 appc Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-3 appc and EJBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D-5
E. EJBGen Reference
Running EJBGen. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-1
x Programming WebLogic Enterprise JavaBeans
EJBGen Distribution and Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-2 Invoking EJBGen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-2 Using Key EJBGen Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-7 Examples of EJBGen Tag Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-10 Mapping an Entity Bean to Several Tables with EJBGen . . . . . . . . . . . . . . . . . . . . E-11 Specifying Relationship Caching with EJBGen Tags . . . . . . . . . . . . . . . . . . . . . . . E-11 Specifying Relationships with EJBGen Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-12 Enum Attribute Constant Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-13 Constants.Bool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-13 Constants.TransactionAttribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-13 Constants.IsolationLevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-13 Constants.RefType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-14 Constants.HomeLoadAlgorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-14 Constants.Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-14 Constants.ConcurrencyStrategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-14 EJBGen Annotation Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-15 EJB Container Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-17 weblogic.ejbgen.ActivationConfigProperties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-18 weblogic.ejbgen.ActivationConfigProperty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-18 weblogic.ejbgen.AutomaticKeyGeneration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-19 weblogic.ejbgen.CmpField. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-19 weblogic.ejbgen.CmrField . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-21 weblogic.ejbgen.Compatibility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-22 weblogic.ejbgen.CreateDefaultDbmsTables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-23 weblogic.ejbgen.CreateDefaultRdbmsTables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-24 weblogic.ejbgen.DBSpecificSQL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-24 weblogic.ejbgen.EjbClientJar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-24 weblogic.ejbgen.EjbInterface (deprecated) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-24
Programming WebLogic Enterprise JavaBeans xi
weblogic.ejbgen.EjbLocalRef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-25 weblogic.ejbgen.EjbLocalRefs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-25 weblogic.ejbgen.EjbRef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-26 weblogic.ejbgen.EjbRefs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-26 weblogic.ejbgen.Entity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-27 weblogic.ejbgen.EntityCacheRef. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-35 weblogic.ejbgen.EnvEntries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-36 weblogic.ejbgen.EnvEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-36 weblogic.ejbgen.FileGeneration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-37 weblogic.ejbgen.Finder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-39 weblogic.ejbgen.Finders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-42 weblogic.ejbgen.ForeignJmsProvider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-42 weblogic.ejbgen.JarSettings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-42 weblogic.ejbgen.JndiName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-43 weblogic.ejbgen.LocalHomeMethod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-44 weblogic.ejbgen.LocalMethod. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-45 weblogic.ejbgen.MessageDestination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-46 weblogic.ejbgen.MessageDestinationRef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-47 weblogic.ejbgen.MessageDestinationRefs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-48 weblogic.ejbgen.MessageDestinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-48 weblogic.ejbgen.MessageDriven . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-48 weblogic.ejbgen.MethodIsolationLevelPattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-52 weblogic.ejbgen.MethodIsolationLevelPatterns . . . . . . . . . . . . . . . . . . . . . . . . . . . E-53 weblogic.ejbgen.MethodPermissionPattern. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-53 weblogic.ejbgen.MethodPermissionPatterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-54 weblogic.ejbgen.PrimKeyField . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-54 weblogic.ejbgen.Relation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-54 weblogic.ejbgen.Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-56
xii Programming WebLogic Enterprise JavaBeans
weblogic.ejbgen.RelationshipCachingElement . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-56 weblogic.ejbgen.RelationshipCachingElements . . . . . . . . . . . . . . . . . . . . . . . . . . . E-57 weblogic.ejbgen.RemoteHomeMethod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-57 weblogic.ejbgen.RemoteMethod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-59 weblogic.ejbgen.ResourceEnvRef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-60 weblogic.ejbgen.ResourceEnvRefs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-60 weblogic.ejbgen.ResourceRef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-61 weblogic.ejbgen.ResourceRefs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-61 weblogic.ejbgen.RoleMapping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-62 weblogic.ejbgen.RoleMappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-62 weblogic.ejbgen.SecurityRoleRef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-63 weblogic.ejbgen.SecurityRoleRefs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-63 weblogic.ejbgen.Select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-63 weblogic.ejbgen.ServiceEndpointMethod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-65 weblogic.ejbgen.ServiceRef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-66 weblogic.ejbgen.ServiceRefs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-66 weblogic.ejbgen.Session. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-67 weblogic.ejbgen.SqlFinder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-72 weblogic.ejbgen.SqlFinders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-74 weblogic.ejbgen.SqlShape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-74 weblogic.ejbgen.SqlShapeTable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-75 weblogic.ejbgen.SqlShapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-76 weblogic.ejbgen.ValueObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-76 weblogic.ejbgen.ValueObjectField. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-76
xiii
upper and lower Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-2 Using ORDER BY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-3 Using Subqueries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-3 Using Arithmetic Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-9 Using Aggregate Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-9 Using Queries that Return ResultSets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-11 Using Oracle SELECT HINTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-14 get and set Method Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-14 Properties-Based Methods of the Query Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-14 Migrating from WLQL to EJB QL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-15 Known Issue with Implied Cross Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-16 EJB QL Error-Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-16 Visual Indicator of Error in Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-16 Multiple Errors Reported after a Single Compilation . . . . . . . . . . . . . . . . . . . . . . . F-17
xiv
5.1 weblogic-ejb-jar.xml Deployment Descriptor File Structure . . . . . . . . . . . . . . . . . . . G-9 5.1 weblogic-ejb-jar.xml Deployment Descriptor Elements . . . . . . . . . . . . . . . . . . . . . . . G-9 caching-descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-9 persistence-descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-11 clustering-descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-14 transaction-descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-16 reference-descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-16 transaction-isolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-18 security-role-assignment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-21 1.1 weblogic-cmp-jar.xml Deployment Descriptor File Structure . . . . . . . . . . . . . . . . . G-21 1.1 weblogic-cmp-jar.xml Deployment Descriptor Elements . . . . . . . . . . . . . . . . . . . . . G-22 RDBMS Definition Elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-22 EJB Field-Mapping Elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-23 Finder Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-24
xv
xvi
CHAPTER
This section describes the contents and organization of this guideProgramming WebLogic Enterprise Java Beans.