01: /*
02: * Copyright 2004 (C) TJDO.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the TJDO License version 1.0.
06: * See the terms of the TJDO License in the documentation provided with this software.
07: *
08: * $Id: SCO.java,v 1.3 2004/01/18 03:01:05 jackknifebarber Exp $
09: */
10:
11: package com.triactive.jdo;
12:
13: /**
14: * A mutable second-class object.
15: *
16: * @author <a href="mailto:mmartin5@austin.rr.com">Mike Martin</a>
17: * @version $Revision: 1.3 $
18: */
19:
20: public interface SCO {
21: /**
22: * Returns the owner object of the SCO instance.
23: *
24: * @return The owner object or <code>null</code> if currently unowned.
25: */
26: Object getOwner();
27:
28: /**
29: * Returns the field name in the owner object.
30: *
31: * @return The field name or <code>null</code> if currently unowned.
32: */
33: String getFieldName();
34:
35: /**
36: * Marks this object dirty.
37: * If the SCO is currently owned this method should mark the corresponding
38: * field in the owning object as dirty.
39: */
40: void makeDirty();
41:
42: /**
43: * Called to indicate that the owning object is being made persistent,
44: * or that the persistent state of this field is being updated.
45: */
46: void applyUpdates();
47:
48: /**
49: * Disconnects this object from its owner.
50: */
51: void unsetOwner();
52:
53: /**
54: * Returns a clone of this SCO instance.
55: * The returned object is unowned.
56: */
57: Object clone();
58: }
|