SCO.java :  » Database-ORM » TJDO » com » triactive » jdo » Java Open Source

Java Open Source » Database ORM » TJDO 
TJDO » com » triactive » jdo » SCO.java
/*
 * Copyright 2004 (C) TJDO.
 * All rights reserved.
 *
 * This software is distributed under the terms of the TJDO License version 1.0.
 * See the terms of the TJDO License in the documentation provided with this software.
 *
 * $Id: SCO.java,v 1.3 2004/01/18 03:01:05 jackknifebarber Exp $
 */

package com.triactive.jdo;


/**
 * A mutable second-class object.
 *
 * @author <a href="mailto:mmartin5@austin.rr.com">Mike Martin</a>
 * @version $Revision: 1.3 $
 */

public interface SCO
{
    /**
     * Returns the owner object of the SCO instance.
     * 
     * @return The owner object or <code>null</code> if currently unowned.
     */
    Object getOwner();

    /**
     * Returns the field name in the owner object.
     * 
     * @return The field name or <code>null</code> if currently unowned.
     */
    String getFieldName();

    /**
     * Marks this object dirty.
     * If the SCO is currently owned this method should mark the corresponding
     * field in the owning object as dirty.
     */
    void makeDirty();

    /**
     * Called to indicate that the owning object is being made persistent,
     * or that the persistent state of this field is being updated.
     */
    void applyUpdates();

    /**
     * Disconnects this object from its owner.
     */
    void unsetOwner();

    /**
     * Returns a clone of this SCO instance.
     * The returned object is unowned.
     */
    Object clone();
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.