Skip to main content
summaryrefslogtreecommitdiffstats
blob: 59cebce3f4d3b0a3f62d62f34e639ac190450bcd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*******************************************************************************
 * Copyright (c) 2010, 2012 Oracle. All rights reserved.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0, which accompanies this distribution
 * and is available at http://www.eclipse.org/legal/epl-v10.html.
 * 
 * Contributors:
 *     Oracle - initial API and implementation
 ******************************************************************************/
package org.eclipse.jpt.jpa.core.jpa2.context;

import org.eclipse.jdt.core.IType;
import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
import org.eclipse.jpt.jpa.core.context.CollectionMapping;
import org.eclipse.jpt.jpa.core.context.Column;
import org.eclipse.jpt.jpa.core.context.JoinColumn;
import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;

/**
 * JPA 2.0 collection mapping (e.g. 1:m, m:m, element collection)
 * <p>
 * Provisional API: This interface is part of an interim API that is still
 * under development and expected to change significantly before reaching
 * stability. It is available at this early stage to solicit feedback from
 * pioneering adopters on the understanding that any code that uses this API
 * will almost certainly be broken (repeatedly) as the API evolves.
 * 
 * @version 3.2
 * @since 2.3
 */
public interface CollectionMapping2_0
	extends CollectionMapping, AttributeMapping2_0, ConvertibleKeyMapping2_0
{
	// ********** map key class **********
	
	String getMapKeyClass();

	String getSpecifiedMapKeyClass();
	void setSpecifiedMapKeyClass(String value);
		String SPECIFIED_MAP_KEY_CLASS_PROPERTY = "specifiedMapKeyClass"; //$NON-NLS-1$

	String getDefaultMapKeyClass();
		String DEFAULT_MAP_KEY_CLASS_PROPERTY = "defaultMapKeyClass"; //$NON-NLS-1$

	/**
	 * Return the character to be used for browsing or creating the map key
	 * class {@link IType}.
	 * @see org.eclipse.jdt.core.IType#getFullyQualifiedName(char)
	 */
	char getMapKeyClassEnclosingTypeSeparator();

	/**
	 * If the map key class is specified, this will return it fully qualified.
	 * If not specified, it returns the default map key class, which is always
	 * fully qualified.
	 */
	String getFullyQualifiedMapKeyClass();
		String FULLY_QUALIFIED_MAP_KEY_CLASS_PROPERTY = "fullyQualifiedMapKeyClass"; //$NON-NLS-1$


	// ********** map key column **********

	/**
	 * Return the map key column for this collection mapping.
	 */
	Column getMapKeyColumn();

	AttributeOverrideContainer getMapKeyAttributeOverrideContainer();

	// ********** map key join columns **********

	/**
	 * Return the map key join columns whether specified or default.
	 */
	ListIterable<? extends ReadOnlyJoinColumn> getMapKeyJoinColumns();

	/**
	 * Return the number of map key join columns, whether specified and default.
	 */
	int getMapKeyJoinColumnsSize();


	// ********** specified map key join columns **********

	/**
	 * Change notification identifier for "specifiedMapKeyJoinColumns" list
	 */
	String SPECIFIED_MAP_KEY_JOIN_COLUMNS_LIST = "specifiedMapKeyJoinColumns"; //$NON-NLS-1$

	/**
	 * Return the specified map key join columns.
	 */
	ListIterable<? extends JoinColumn> getSpecifiedMapKeyJoinColumns();

	/**
	 * Return the number of specified join columns.
	 */
	int getSpecifiedMapKeyJoinColumnsSize();

	/**
	 * Return whether the mapping has any specified map key join columns.
	 * (Equivalent to {@link #getSpecifiedMapKeyJoinColumnsSize()} != 0.)
	 */
	boolean hasSpecifiedMapKeyJoinColumns();

	/**
	 * Return the specified map key join column at the specified index.
	 */
	JoinColumn getSpecifiedMapKeyJoinColumn(int index);

	/**
	 * Add a specified map key join column to the relationship.
	 */
	JoinColumn addSpecifiedMapKeyJoinColumn();

	/**
	 * Add a specified map key join column to the relationship.
	 */
	JoinColumn addSpecifiedMapKeyJoinColumn(int index);

	/**
	 * Remove the specified map key join column.
	 */
	void removeSpecifiedMapKeyJoinColumn(int index);

	/**
	 * Remove the specified map key join column.
	 */
	void removeSpecifiedMapKeyJoinColumn(JoinColumn joinColumn);

	/**
	 * Move the specified map key join column from the source index to the target index.
	 */
	void moveSpecifiedMapKeyJoinColumn(int targetIndex, int sourceIndex);


	// ********** default map key join column **********

	/**
	 * Change notification identifier for "defaultMapKeyJoinColumn" property
	 */
	String DEFAULT_MAP_KEY_JOIN_COLUMN_PROPERTY = "defaultMapKeyJoinColumn"; //$NON-NLS-1$

	/**
	 * Return the default map key join column. If there are specified map key join
	 * columns, there is no default join column. There are also
	 * times that there may be no default map key join column even if there are no
	 * specified map key join columns.
	 */
	JoinColumn getDefaultMapKeyJoinColumn();

}

Back to the top