Skip to main content
summaryrefslogtreecommitdiffstats
blob: 772e7e9cbbd5a6816b2edf97483b79dae7edd7e7 (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
/*******************************************************************************
 *  Copyright (c) 2010  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.core.context;

import org.eclipse.jpt.core.JpaNode;
import org.eclipse.jpt.core.context.java.JavaPersistentType;

/**
 * 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.
 */
public interface IdClassReference
	extends JpaNode, PersistentType.Owner
{
	/**
	 * Property string associated with changes to the {@link IdClassHolder}'s specified id class name
	 */
	String SPECIFIED_ID_CLASS_NAME_PROPERTY = "specifiedIdClassName"; //$NON-NLS-1$
	
	/**
	 * Return the specified name of the id class, null if none is specified in the resource model
	 */
	String getSpecifiedIdClassName();
	
	/**
	 * Set the specified name of the id class.
	 * Use null to remove the id class specification from the resource model
	 */
	void setSpecifiedIdClassName(String value);
	
	/**
	 * Property string associated with changes to the {@link IdClassHolder}'s default id class name
	 */
	String DEFAULT_ID_CLASS_NAME_PROPERTY = "defaultIdClassName"; //$NON-NLS-1$
	
	/**
	 * Return the default name of the id class, null if there is none
	 */
	String getDefaultIdClassName();
	
	/**
	 * Return the name of the id class, taking into consideration the default value if applicable
	 */
	String getIdClassName();
	
	/**
	 * Return whether the id class has been specified.
	 * Generally, this simply means that the id class name has been set, although if a default
	 * applies, this should also return true.
	 */
	boolean isSpecified();
	
	/**
	 * Property string associated with changes to the {@link IdClassHolder}'s id class.
	 * This will change (potentially) if the id class name changes, or if other changes result
	 * in changes in the id class' resolution.
	 */
	String ID_CLASS_PROPERTY = "idClass"; //$NON-NLS-1$
	
	/**
	 * Return the {@link JavaPersistentType} that is resolved from the id class name.
	 * This will be null if the id class name is null or if the class cannot be resolved from that 
	 * name.
	 */
	JavaPersistentType getIdClass();
	
	/**
	 * Return the char to be used for browsing or creating the id class IType.
	 * @see org.eclipse.jdt.core.IType#getFullyQualifiedName(char)
	 */
	char getIdClassEnclosingTypeSeparator();
}

Back to the top