KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > ejb > cmp3 > EntityManager


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2006, Oracle. All rights reserved.
22
package oracle.toplink.essentials.ejb.cmp3;
23
24 import oracle.toplink.essentials.sessions.*;
25 import oracle.toplink.essentials.expressions.Expression;
26 import oracle.toplink.essentials.threetier.ServerSession;
27
28 /**
29  * <p>
30  * <b>Purpose</b>: Defines the Interface for TopLink extensions to the EntityManager
31  * <p>
32  * @see javax.persistence.EntityManager
33  */

34 /*
35  * @author Gordon Yorke
36  */

37
38 public interface EntityManager extends javax.persistence.EntityManager {
39
40     /**
41      * This method returns the current session to the requestor. The current session
42      * will be a the active UnitOfWork within a transaction and will be a 'scrap'
43      * UnitOfWork outside of a transaction. The caller is conserned about the results
44      * then the getSession() or getUnitOfWork() API should be called.
45      */

46     public Session getActiveSession();
47     
48     /**
49      * Return the underlying server session
50      */

51     public ServerSession getServerSession();
52     
53     /**
54      * This method will return the transactional UnitOfWork during the transaction and null
55      * outside of the transaction.
56      */

57     public UnitOfWork getUnitOfWork();
58     
59     /**
60      * This method will return a Session outside of a transaction and null within a transaction.
61      */

62     public Session getSession();
63     
64     /**
65      * This method is used to create a query using a Toplink Expression and the return type.
66      */

67     public javax.persistence.Query createQuery(Expression expression, Class JavaDoc resultType);
68     
69     
70 }
71
Popular Tags