| 1 |
/*- |
| 2 |
* See the file LICENSE for redistribution information. |
| 3 |
* |
| 4 |
* Copyright (c) 2002, 2013 Oracle and/or its affiliates. All rights reserved. |
| 5 |
* |
| 6 |
*/ |
| 7 |
|
| 8 |
package com.sleepycat.persist.model; |
| 9 |
|
| 10 |
/** |
| 11 |
* Defines the relationship between instances of the entity class and the |
| 12 |
* secondary keys. This can be specified using a {@link SecondaryKey#relate} |
| 13 |
* annotation. |
| 14 |
* |
| 15 |
* @author Mark Hayes |
| 16 |
*/ |
| 17 |
public enum Relationship { |
| 18 |
|
| 19 |
/** |
| 20 |
* Relates many entities to one secondary key. |
| 21 |
* |
| 22 |
* <p>The secondary index will have non-unique keys; in other words, |
| 23 |
* duplicates will be allowed.</p> |
| 24 |
* |
| 25 |
* <p>The secondary key field is singular, in other words, it may not be an |
| 26 |
* array or collection type.</p> |
| 27 |
*/ |
| 28 |
MANY_TO_ONE, |
| 29 |
|
| 30 |
/** |
| 31 |
* Relates one entity to many secondary keys. |
| 32 |
* |
| 33 |
* <p>The secondary index will have unique keys, in other words, duplicates |
| 34 |
* will not be allowed.</p> |
| 35 |
* |
| 36 |
* <p>The secondary key field must be an array or collection type.</p> |
| 37 |
*/ |
| 38 |
ONE_TO_MANY, |
| 39 |
|
| 40 |
/** |
| 41 |
* Relates many entities to many secondary keys. |
| 42 |
* |
| 43 |
* <p>The secondary index will have non-unique keys, in other words, |
| 44 |
* duplicates will be allowed.</p> |
| 45 |
* |
| 46 |
* <p>The secondary key field must be an array or collection type.</p> |
| 47 |
*/ |
| 48 |
MANY_TO_MANY, |
| 49 |
|
| 50 |
/** |
| 51 |
* Relates one entity to one secondary key. |
| 52 |
* |
| 53 |
* <p>The secondary index will have unique keys, in other words, duplicates |
| 54 |
* will not be allowed.</p> |
| 55 |
* |
| 56 |
* <p>The secondary key field is singular, in other words, it may not be an |
| 57 |
* array or collection type.</p> |
| 58 |
*/ |
| 59 |
ONE_TO_ONE; |
| 60 |
} |