1 /*
2  * Copyright (c) 2008, 2019 Oracle and/or its affiliates. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v. 2.0 which is available at
6  * http://www.eclipse.org/legal/epl-2.0,
7  * or the Eclipse Distribution License v. 1.0 which is available at
8  * http://www.eclipse.org/org/documents/edl-v10.php.
9  *
10  * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
11  */

12
13 // Contributors:
14 //     Linda DeMichiel - 2.1
15 //     Linda DeMichiel - 2.0
16
17 package javax.persistence.metamodel;
18
19 /**
20  * Instances of the type <code>PluralAttribute</code> represent 
21  * persistent collection-valued attributes.
22  *
23  * @param <X> The type the represented collection belongs to
24  * @param <C> The type of the represented collection
25  * @param <E> The element type of the represented collection
26  *
27  * @since 2.0
28  */

29 public interface PluralAttribute<X, C, E> 
30         extends Attribute<X, C>, Bindable<E> {
31     
32     public static enum CollectionType {
33
34         /** Collection-valued attribute */
35         COLLECTION, 
36
37         /** Set-valued attribute */
38         SET, 
39
40         /** List-valued attribute */
41         LIST, 
42
43         /** Map-valued attribute */
44         MAP
45     }
46         
47     /**
48      * Return the collection type.
49      * @return collection type
50      */

51     CollectionType getCollectionType();
52
53     /**
54      * Return the type representing the element type of the 
55      * collection.
56      * @return element type
57      */

58     Type<E> getElementType();
59 }
60