KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > internal > sessions > DirectToFieldChangeRecord


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.internal.sessions;
23
24
25 /**
26  * <p>
27  * <b>Purpose</b>: To record the changes for attributes that can be represented as DirectToField
28  * <p>
29  * @see RelatedClasses prototype.changeset.CollectionChangeRecord,prototype.changeset.SingleObjectChangeRecord
30  */

31 public class DirectToFieldChangeRecord extends ChangeRecord implements oracle.toplink.essentials.changesets.DirectToFieldChangeRecord {
32     protected Object JavaDoc newValue;
33
34     /**
35      * This default constructor is reference internally by SDK XML project to mapp this class
36      */

37     public DirectToFieldChangeRecord() {
38         super();
39     }
40
41     /**
42      * This constructor returns a changeRecord representing the DirectToField mapping
43      * @param owner prototype.changeset.ObjectChangeSet that ObjectChangeSet that uses this record
44      */

45     public DirectToFieldChangeRecord(ObjectChangeSet owner) {
46         this.owner = owner;
47     }
48
49     /**
50      * ADVANCED:
51      * Returns the new value assigned during the change
52      * @return java.lang.Object
53      */

54     public Object JavaDoc getNewValue() {
55         return newValue;
56     }
57
58     /**
59      * INTERNAL:
60      * This method will be used to merge one record into another
61      */

62     public void mergeRecord(ChangeRecord mergeFromRecord, UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet) {
63         this.newValue = ((DirectToFieldChangeRecord)mergeFromRecord).getNewValue();
64     }
65
66     /**
67      * ADVANCED:
68      * Sets the new value assigned during the change
69      * @param newValue java.lang.Object
70      */

71     public void setNewValue(Object JavaDoc newValue) {
72         this.newValue = newValue;
73     }
74
75     /**
76      * INTERNAL:
77      * used by the record to update the new value ignores the value in the default implementation
78      */

79     public void updateChangeRecordWithNewValue(Object JavaDoc newValue) {
80         setNewValue(newValue);
81     }
82
83     /**
84      * INTERNAL:
85      * This method will be used to update the objectsChangeSets references
86      */

87     public void updateReferences(UnitOfWorkChangeSet mergeToChangeSet, UnitOfWorkChangeSet mergeFromChangeSet) {
88     }
89 }
90
Popular Tags