1/*- 2 * See the file LICENSE for redistribution information. 3 * 4 * Copyright (c) 2002-2009 Oracle. All rights reserved. 5 * 6 * $Id$ 7 */ 8 9package com.sleepycat.persist.model; 10 11import com.sleepycat.db.DatabaseException; 12 13/** 14 * Specifies the action to take when a related entity is deleted having a 15 * primary key value that exists as a secondary key value for this entity. 16 * This can be specified using a {@link SecondaryKey#onRelatedEntityDelete} 17 * annotation. 18 * 19 * @author Mark Hayes 20 */ 21public enum DeleteAction { 22 23 /** 24 * The default action, {@code ABORT}, means that a {@link 25 * DatabaseException} is thrown in order to abort the current transaction. 26 */ 27 ABORT, 28 29 /** 30 * If {@code CASCADE} is specified, then this entity will be deleted also, 31 * which could in turn trigger further deletions, causing a cascading 32 * effect. 33 */ 34 CASCADE, 35 36 /** 37 * If {@code NULLIFY} is specified, then the secondary key in this entity 38 * is set to null and this entity is updated. For a secondary key field 39 * that has an array or collection type, the array or collection element 40 * will be removed by this action. The secondary key field must have a 41 * reference (not a primitive) type in order to specify this action. 42 */ 43 NULLIFY; 44} 45