KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > changesets > ObjectChangeSet


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, 2005, Oracle. All rights reserved.
22
package oracle.toplink.essentials.changesets;
23
24 import java.util.Vector JavaDoc;
25 import oracle.toplink.essentials.sessions.Session;
26
27 /**
28  * <p>
29  * <b>Purpose</b>: Provides API to the Class that holds all changes made to a particular Object.
30  * <p>
31  * <b>Description</b>: The ObjectChangeSet class represents a single Object registered in the UnitOfWork.
32  * It is owned by the larger UnitOfWorkChangeSet.
33  * <p>
34  */

35 public interface ObjectChangeSet {
36     boolean equals(ObjectChangeSet objectChange);
37
38     /**
39      * ADVANCED:
40      * This method will return a collection of the fieldnames of attributes changed in an object.
41      */

42     Vector JavaDoc getChangedAttributeNames();
43
44     /**
45      * ADVANCED:
46      * This method returns a reference to the collection of changes within this changeSet.
47      */

48     Vector JavaDoc getChanges();
49
50     /**
51      * ADVANCE:
52      * This method returns the class type that this changeSet Represents.
53      */

54     Class JavaDoc getClassType(Session session);
55
56     /**
57      * ADVANCE:
58      * This method returns the class Name that this changeSet Represents.
59      */

60     String JavaDoc getClassName();
61
62     /**
63      * ADVANCED:
64      * This method returns the key value that this object was stored under in it's respective Map.
65      * This is old relevant for collection mappings that use a Map.
66      */

67     Object JavaDoc getOldKey();
68
69     /**
70      * ADVANCED:
71      * This method returns the key value that this object will be stored under in it's respective Map.
72      * This is old relevant for collection mappings that use a Map.
73      */

74     Object JavaDoc getNewKey();
75
76     /**
77      * ADVANCED:
78      * This method returns the primary keys for the object that this change set represents.
79      */

80     Vector JavaDoc getPrimaryKeys();
81
82     /**
83      * ADVANCED:
84      * This method is used to return the parent ChangeSet.
85      */

86     UnitOfWorkChangeSet getUOWChangeSet();
87
88     /**
89      * ADVANCED:
90      * This method is used to return the lock value of the object this changeSet represents.
91      */

92     Object JavaDoc getWriteLockValue();
93     
94     /**
95      * ADVANCED:
96      * Returns the change record for the specified attribute name.
97      */

98     ChangeRecord getChangesForAttributeNamed(String JavaDoc attributeName);
99     
100     /**
101      * ADVANCED:
102      * This method will return true if the specified attributue has been changed..
103      * @param String the name of the attribute to search for.
104      */

105     boolean hasChangeFor(String JavaDoc attributeName);
106
107     /**
108      * ADVANCED:
109      * Returns true if this particular changeSet has changes.
110      */

111     boolean hasChanges();
112
113     /**
114      * ADVANCED:
115      * Returns true if this ObjectChangeSet represents a new object.
116      */

117     boolean isNew();
118 }
119
Popular Tags