01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: DeleteAction.java,v 1.6.2.2 2008/01/07 15:14:20 cwl Exp $
07: */
08:
09: package com.sleepycat.persist.model;
10:
11: import com.sleepycat.je.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: */
21: public 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: }
|