/*- * See the file LICENSE for redistribution information. * * Copyright (c) 2000, 2010 Oracle and/or its affiliates. All rights reserved. * */ package com.sleepycat.bind.tuple; import com.sleepycat.db.DatabaseEntry; import com.sleepycat.db.ForeignKeyNullifier; import com.sleepycat.db.SecondaryDatabase; import com.sleepycat.db.SecondaryKeyCreator; /** * An abstract key creator that uses a tuple key and a tuple data entry. This * class takes care of converting the key and data entry to/from {@link * TupleInput} and {@link TupleOutput} objects. * The following abstract method must be implemented by a concrete subclass * to create the index key using these objects *
If {@link com.sleepycat.db.ForeignKeyDeleteAction#NULLIFY} was * specified when opening the secondary database, the following method must be * overridden to nullify the foreign index key. If NULLIFY was not specified, * this method need not be overridden.
*If {@link com.sleepycat.db.ForeignKeyDeleteAction#NULLIFY} was * specified when creating the secondary, this method is called when the * entity for this foreign key is deleted. If NULLIFY was not specified, * this method will not be called and may always return false.
* * @author Mark Hayes */ public abstract class TupleTupleKeyCreatorThe secondary key should be output or removed by this method such * that {@link #createSecondaryKey} will return false. Other fields in the * data object should remain unchanged.
* * @param dataInput is the {@link TupleInput} for the data entry. * * @param dataOutput is the destination {@link TupleOutput}. * * @return true if the key was cleared, or false to indicate that the key * is not present and no change is necessary. */ public boolean nullifyForeignKey(TupleInput dataInput, TupleOutput dataOutput) { return false; } }