• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/db-4.8.30/java/src/com/sleepycat/persist/model/
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
11/**
12 * Defines the relationship between instances of the entity class and the
13 * secondary keys.  This can be specified using a {@link SecondaryKey#relate}
14 * annotation.
15 *
16 * @author Mark Hayes
17 */
18public enum Relationship {
19
20    /**
21     * Relates many entities to one secondary key.
22     *
23     * <p>The secondary index will have non-unique keys; in other words,
24     * duplicates will be allowed.</p>
25     *
26     * <p>The secondary key field is singular, in other words, it may not be an
27     * array or collection type.</p>
28     */
29    MANY_TO_ONE,
30
31    /**
32     * Relates one entity to many secondary keys.
33     *
34     * <p>The secondary index will have unique keys, in other words, duplicates
35     * will not be allowed.</p>
36     *
37     * <p>The secondary key field must be an array or collection type.</p>
38     */
39    ONE_TO_MANY,
40
41    /**
42     * Relates many entities to many secondary keys.
43     *
44     * <p>The secondary index will have non-unique keys, in other words,
45     * duplicates will be allowed.</p>
46     *
47     * <p>The secondary key field must be an array or collection type.</p>
48     */
49    MANY_TO_MANY,
50
51    /**
52     * Relates one entity to one secondary key.
53     *
54     * <p>The secondary index will have unique keys, in other words, duplicates
55     * will not be allowed.</p>
56     *
57     * <p>The secondary key field is singular, in other words, it may not be an
58     * array or collection type.</p>
59     */
60    ONE_TO_ONE;
61}
62