1
2
3
4 package org.andromda.metafacades.uml;
5
6 /***
7 * <p>
8 * Represents a persistent entity.
9 * </p>
10 *
11 * Metafacade interface to be used by AndroMDA cartridges.
12 */
13 public interface Entity
14 extends org.andromda.metafacades.uml.ClassifierFacade
15 {
16
17 /***
18 * Indicates the metafacade type (used for metafacade mappings).
19 *
20 * @return always <code>true</code>
21 */
22 public boolean isEntityMetaType();
23
24 /***
25 * <p>
26 * Gets a comma seperated list of attribute names. If 'follow' is
27 * true, will travel up the inheritance hiearchy to include
28 * attributes in parent entities as well. If 'withIdentifiers' is
29 * true, will include identifiers.
30 * </p>
31 */
32 public java.lang.String getAttributeNameList(boolean follow, boolean withIdentifiers);
33
34 /***
35 * <p>
36 * Gets a comma seperated list of attribute types. If 'follow' is
37 * true, will travel up the inheritance hiearchy to include
38 * attributes in parent entities as well. If 'withIdentifiers' is
39 * true, will include identifiers.
40 * </p>
41 */
42 public java.lang.String getAttributeTypeList(boolean follow, boolean withIdentifiers);
43
44 /***
45 * <p>
46 * Gets all attributes of the entity, and optionally retieves the
47 * super entities attributes as well as excludes the entity's
48 * identifiers if 'withIdentifiers' is set to false.
49 * </p>
50 */
51 public java.util.Collection getAttributes(boolean follow, boolean withIdentifiers);
52
53 /***
54 * <p>
55 * All business operations of the entity, these include any
56 * operations that aren't queries.
57 * </p>
58 */
59 public java.util.Collection getBusinessOperations();
60
61 /***
62 * <p>
63 * Gets any children association ends (i.e. entity association ends
64 * that are participants in an association with this entity and
65 * this entity has composite aggregation defined for those
66 * associations).
67 * </p>
68 */
69 public java.util.Collection getChildEnds();
70
71 /***
72 * <p>
73 * All entities referenced by this entity.
74 * </p>
75 */
76 public java.util.Collection getEntityReferences();
77
78 /***
79 * <p>
80 * Gets all the associationEnds of this entity marked with the
81 * identifiers stereotype.
82 * </p>
83 */
84 public java.util.Collection getIdentifierAssociationEnds();
85
86 /***
87 * <p>
88 * All the attributes of the entity which make up its identifier
89 * (primary key). Will search any super classes as well. If no
90 * identifiers exist, a default identifier will be created if the
91 * allowDefaultIdentifiers property is set to true.
92 * </p>
93 */
94 public java.util.Collection getIdentifiers();
95
96 /***
97 * <p>
98 * Gets all identifiers for an entity. If 'follow' is true, and if
99 * no identifiers can be found on the entity, a search up the
100 * inheritance chain will be performed, and the identifiers from
101 * the first super class having them will be used. If no
102 * identifiers exist, a default identifier will be created if the
103 * allowDefaultIdentifiers property is set to true.
104 * </p>
105 */
106 public java.util.Collection getIdentifiers(boolean follow);
107
108 /***
109 * <p>
110 * The maximum length a SQL name may be.
111 * </p>
112 */
113 public java.lang.Short getMaxSqlNameLength();
114
115 /***
116 * <p>
117 * Gets the attributes as a list within an operation call,
118 * optionally including the type names and the identifier
119 * attributes.
120 * </p>
121 */
122 public java.lang.String getOperationCallFromAttributes(boolean withIdentifiers);
123
124 /***
125 * <p>
126 * Gets the attributes as a list within an operation call. If
127 * 'withTypeNames' is true, it will include the type names, if
128 * 'withIdentifiers' is true it will include the identifiers. If
129 * 'follow' is true it will follow the inheritance hierarchy and
130 * get the attributes of the super class as well.
131 * </p>
132 */
133 public java.lang.String getOperationCallFromAttributes(boolean withIdentifiers, boolean follow);
134
135 /***
136 * <p>
137 * Returns the parent association end of this entity if its a child
138 * entity. The parent is the entity that is the participant the
139 * association that has composite aggregation defined. Will return
140 * null if the entity has no parent.
141 * </p>
142 */
143 public org.andromda.metafacades.uml.EntityAssociationEnd getParentEnd();
144
145 /***
146 * <p>
147 * Gets all properties of this entity, this includes the attributes
148 * and navigable association ends of the entity. The 'follow' flag
149 * indcates whether or not the inheritance hierachy should be
150 * followed when getting all the properties. The 'withIdentifiers'
151 * flag indicates whether or not identifiers should be included in
152 * the collection of properties.
153 * </p>
154 */
155 public java.util.Collection getProperties(boolean follow, boolean withIdentifiers);
156
157 /***
158 * <p>
159 * Gets all query operations for an entity. If 'follow' is true,
160 * and if no query operations can be found on the entity, a search
161 * up the inheritance chain will be performed, and the identifiers
162 * from the first super class having them will be used. If no
163 * identifiers exist, a default identifier will be created if the
164 * allowDefaultIdentifiers property is set to true.
165 * </p>
166 */
167 public java.util.Collection getQueryOperations(boolean follow);
168
169 /***
170 * <p>
171 * Returns all the operations that can perform queries on the
172 * entity.
173 * </p>
174 */
175 public java.util.Collection getQueryOperations();
176
177 /***
178 * <p>
179 * Gets a comma seperated list of required attribute names. If
180 * 'follow' is true, will travel up the inheritance hiearchy to
181 * include attributes in parent entities as well. If
182 * 'withIdentifiers' is true, will include identifiers.
183 * </p>
184 */
185 public java.lang.String getRequiredAttributeNameList(boolean follow, boolean withIdentifiers);
186
187 /***
188 * <p>
189 * Gets a comma seperated list of attribute types with are
190 * required. If 'follow' is true, will travel up the inheritance
191 * hiearchy to include attributes in parent entities as well. If
192 * 'withIdentifiers' is true, will include identifiers.
193 * </p>
194 */
195 public java.lang.String getRequiredAttributeTypeList(boolean follow, boolean withIdentifiers);
196
197 /***
198 * <p>
199 * Returns all attributes that are specified as 'required' in the
200 * model. If 'follow' is true, then required attributes in super
201 * classes will also be returned, if false, just the ones directly
202 * on the entity will be returned. If 'withIdentifiers' is true,
203 * the identifiers will be include, if false, no identifiers will
204 * be included.
205 * </p>
206 */
207 public java.util.Collection getRequiredAttributes(boolean follow, boolean withIdentifiers);
208
209 /***
210 * <p>
211 * Gets all required properties for this entity. These consist of
212 * any required attributes as well as navigable associations that
213 * are marked as 'required'. If 'follow' is true, then the
214 * inheritance hierchy will be followed and all required properties
215 * from super classes will be included as well.
216 * </p>
217 * <p>
218 * If 'withIdentifiers' is true, the identifiers will be include,
219 * if false, no identifiers will be included.
220 * </p>
221 */
222 public java.util.Collection getRequiredProperties(boolean follow, boolean withIdentifiers);
223
224 /***
225 * <p>
226 * Creates a comma seperated list of the required property names.
227 * </p>
228 */
229 public java.lang.String getRequiredPropertyNameList(boolean follow, boolean withIdentifiers);
230
231 /***
232 * <p>
233 * A comma seperated list of the required property types.
234 * </p>
235 */
236 public java.lang.String getRequiredPropertyTypeList(boolean follow, boolean withIdentifiers);
237
238 /***
239 * <p>
240 * The name of the schema that contains the database table
241 * </p>
242 */
243 public java.lang.String getSchema();
244
245 /***
246 * <p>
247 * The name of the database table to which this entity is
248 * persisted.
249 * </p>
250 */
251 public java.lang.String getTableName();
252
253 /***
254 * <p>
255 * Returns true/false depending on whether or not this entity
256 * represetns a child in an association (this occurs when this
257 * entity is on the opposite end of an assocation end defined as
258 * composite).
259 * </p>
260 */
261 public boolean isChild();
262
263 /***
264 *
265 */
266 public boolean isCompositeIdentifier();
267
268 /***
269 * <p>
270 * True if the entity has its identifiers dynamically added, false
271 * otherwise.
272 * </p>
273 */
274 public boolean isDynamicIdentifiersPresent();
275
276 /***
277 * <p>
278 * True if the entity has any identifiers defined, false otherwise.
279 * </p>
280 */
281 public boolean isIdentifiersPresent();
282
283 /***
284 * <p>
285 * Indiciates if this entity is using an assigned identifier or
286 * not.
287 * </p>
288 */
289 public boolean isUsingAssignedIdentifier();
290
291 /***
292 * <p>
293 * Indicates whether or not this entity is using a foreign
294 * identifier as its identifiers. That is: the foreignIdentifier
295 * flag was set on an incoming association end and the entity is
296 * therefore using the related foreign parent entity's identifier.
297 * </p>
298 */
299 public boolean isUsingForeignIdentifier();
300
301 }