001// license-header java merge-point
002//
003// Attention: generated code (by Metafacade.vsl) - do not modify!
004//
005package org.andromda.metafacades.uml;
006
007import java.util.Collection;
008
009/**
010 * Represents a persistent entity.
011 *
012 * Metafacade interface to be used by AndroMDA cartridges.
013 */
014public interface Entity
015    extends ClassifierFacade
016{
017    /**
018     * Indicates the metafacade type (used for metafacade mappings).
019     *
020     * @return boolean always <code>true</code>
021     */
022    public boolean isEntityMetaType();
023
024    /**
025     * Returns a collection of all entities this entity and its ancestors have a relation to.
026     * @return Collection<DependencyFacade>
027     */
028    public Collection<DependencyFacade> getAllEntityReferences();
029
030    /**
031     * Gets a comma separated list of attribute names.  If 'follow' is true, will travel up the
032     * inheritance hiearchy to include attributes in parent entities as well.  If 'withIdentifiers'
033     * is true, will include identifiers.
034     * @param follow boolean
035     * @param withIdentifiers boolean
036     * @return String
037     */
038    public String getAttributeNameList(boolean follow, boolean withIdentifiers);
039
040    /**
041     * Gets a comma separated list of attribute names.  If 'follow' is true, will travel up the
042     * inheritance hiearchy to include attributes in parent entities as well.  If 'withIdentifiers'
043     * is true, will include identifiers  and  if 'withDerived' is set to true, will include derived
044     * attributes.
045     * @param follow boolean
046     * @param withIdentifiers boolean
047     * @param withDerived boolean
048     * @return String
049     */
050    public String getAttributeNameList(boolean follow, boolean withIdentifiers, boolean withDerived);
051
052    /**
053     * Gets a comma separated list of attribute types.  If 'follow' is true, will travel up the
054     * inheritance hierarchy to include attributes in parent entities as well.  If 'withIdentifiers'
055     * is true, will include identifiers.
056     * @param follow boolean
057     * @param withIdentifiers boolean
058     * @return String
059     */
060    public String getAttributeTypeList(boolean follow, boolean withIdentifiers);
061
062    /**
063     * Gets all attributes of the entity, and optionally retieves the super entities attributes as
064     * well as excludes the entity's identifiers if 'withIdentifiers' is set to false.
065     * @param follow boolean
066     * @param withIdentifiers boolean
067     * @return Collection<AttributeFacade>
068     */
069    public Collection<AttributeFacade> getAttributes(boolean follow, boolean withIdentifiers);
070
071    /**
072     * Gets all attributes of the entity, and optionally retieves the super entities attributes as
073     * well as excludes the entity's identifiers if 'withIdentifiers' is set to false and exclude
074     * derived attributes if 'withDerived' is set to false.
075     * @param follow boolean
076     * @param withIdentifiers boolean
077     * @param withDerived boolean
078     * @return Collection<AttributeFacade>
079     */
080    public Collection<AttributeFacade> getAttributes(boolean follow, boolean withIdentifiers, boolean withDerived);
081
082    /**
083     * All business operations of the entity, these include any operations that aren't queries.
084     * @return Collection<OperationFacade>
085     */
086    public Collection<OperationFacade> getBusinessOperations();
087
088    /**
089     * Gets any children association ends (i.e. entity association ends that are participants in an
090     * association with this entity and this entity has composite aggregation defined for those
091     * associations).
092     * @return Collection<EntityAssociationEnd>
093     */
094    public Collection<EntityAssociationEnd> getChildEnds();
095
096    /**
097     * The embedded values belonging to this entity.
098     * @return Collection<AttributeFacade>
099     */
100    public Collection<AttributeFacade> getEmbeddedValues();
101
102    /**
103     * All entities referenced by this entity.
104     * @return Collection<DependencyFacade>
105     */
106    public Collection<DependencyFacade> getEntityReferences();
107
108    /**
109     * The full name of the type of the identifier. If composite identifier add the PK sufix to the
110     * class name. If not, retorns the fully qualified name of the identifier.
111     * @return String
112     */
113    public String getFullyQualifiedIdentifierTypeName();
114
115    /**
116     * Gets all the associationEnds of this entity marked with the identifiers stereotype.
117     * @return Collection<AssociationEndFacade>
118     */
119    public Collection<AssociationEndFacade> getIdentifierAssociationEnds();
120
121    /**
122     * The getter name of the identifier.
123     * @return String
124     */
125    public String getIdentifierGetterName();
126
127    /**
128     * The name of the identifier. If composite identifier add the Pk suffix. If not composite
129     * returns the attribute name of the identifier.
130     * @return String
131     */
132    public String getIdentifierName();
133
134    /**
135     * The setter name of the identifier.
136     * @return String
137     */
138    public String getIdentifierSetterName();
139
140    /**
141     * The name of the type of the identifier. If composite identifier add the PK suffix to the
142     * class name. If not, returns the name of the identifier.
143     * @return String
144     */
145    public String getIdentifierTypeName();
146
147    /**
148     * All the attributes of the entity which make up its identifier (primary key).  Will search any
149     * super classes as well.  If no identifiers exist, a default identifier will be created if the
150     * allowDefaultIdentifiers property is set to true.
151     * @return Collection<ModelElementFacade>
152     */
153    public Collection<ModelElementFacade> getIdentifiers();
154
155    /**
156     * Gets all identifiers for an entity. If 'follow' is true, and if no identifiers can be found
157     * on the entity, a search up the inheritance chain will be performed, and the identifiers from
158     * the first super class having them will be used.   If no identifiers exist, a default
159     * identifier will be created if the allowDefaultIdentifiers property is set to true.
160     * Identifiers can be on attributes or associations (composite primary key).
161     * @param follow boolean
162     * @return Collection<ModelElementFacade>
163     */
164    public Collection<ModelElementFacade> getIdentifiers(boolean follow);
165
166    /**
167     * The maximum length a SQL name may be.
168     * @return short
169     */
170    public short getMaxSqlNameLength();
171
172    /**
173     * Gets the attributes as a list within an operation call, optionally including the type names
174     * and the identifier attributes.
175     * @param withIdentifiers boolean
176     * @return String
177     */
178    public String getOperationCallFromAttributes(boolean withIdentifiers);
179
180    /**
181     * Gets the attributes as a list within an operation call.  If 'withTypeNames' is true, it will
182     * include the type names, if 'withIdentifiers' is true it will include the identifiers.  If
183     * 'follow' is true it will follow the inheritance hierarchy and get the attributes of the super
184     * class as well.
185     * @param withIdentifiers boolean
186     * @param follow boolean
187     * @return String
188     */
189    public String getOperationCallFromAttributes(boolean withIdentifiers, boolean follow);
190
191    /**
192     * Returns the parent association end of this entity if its a child entity.  The parent is the
193     * entity that is the participant the association that has composite aggregation defined.  Will
194     * return null if the entity has no parent.
195     * @return EntityAssociationEnd
196     */
197    public EntityAssociationEnd getParentEnd();
198
199    /**
200     * Gets all properties of this entity, this includes the attributes and navigable association
201     * ends of the entity.  The 'follow' flag indcates whether or not the inheritance hierarchy
202     * should be followed when getting all the properties.  The 'withIdentifiers' flag indicates
203     * whether or not identifiers should be included in the collection of properties.
204     * @param follow boolean
205     * @param withIdentifiers boolean
206     * @return Collection<ModelElementFacade>
207     */
208    public Collection<ModelElementFacade> getProperties(boolean follow, boolean withIdentifiers);
209
210    /**
211     * Returns all the operations that can perform queries on the entity.
212     * @return Collection<EntityQueryOperation>
213     */
214    public Collection<EntityQueryOperation> getQueryOperations();
215
216    /**
217     * Gets all query operations for an entity. If 'follow' is true, and if no query operations can
218     * be found on the entity, a search up the inheritance chain will be performed, and the
219     * identifiers from the first super class having them will be used.   If no identifiers exist, a
220     * default identifier will be created if the allowDefaultIdentifiers property is set to true.
221     * @param follow boolean
222     * @return Collection<OperationFacade>
223     */
224    public Collection<OperationFacade> getQueryOperations(boolean follow);
225
226    /**
227     * Gets a comma separated list of required attribute names.  If 'follow' is true, will travel up
228     * the inheritance hierarchy to include attributes in parent entities as well.  If
229     * 'withIdentifiers' is true, will include identifiers.
230     * @param follow boolean
231     * @param withIdentifiers boolean
232     * @return String
233     */
234    public String getRequiredAttributeNameList(boolean follow, boolean withIdentifiers);
235
236    /**
237     * Gets a comma separated list of attribute types with are required.  If 'follow' is true, will
238     * travel up the inheritance hierarchy to include attributes in parent entities as well.  If
239     * 'withIdentifiers' is true, will include identifiers.
240     * @param follow boolean
241     * @param withIdentifiers boolean
242     * @return String
243     */
244    public String getRequiredAttributeTypeList(boolean follow, boolean withIdentifiers);
245
246    /**
247     * Returns all attributes that are specified as 'required' in the model.  If 'follow' is true,
248     * then required attributes in super classes will also be returned, if false, just the ones
249     * directly on the entity will be returned.  If 'withIdentifiers' is true, the identifiers will
250     * be include, if false, no identifiers will be included.
251     * @param follow boolean
252     * @param withIdentifiers boolean
253     * @return Collection<AttributeFacade>
254     */
255    public Collection<AttributeFacade> getRequiredAttributes(boolean follow, boolean withIdentifiers);
256
257    /**
258     * Gets all required properties for this entity.  These consist of any required attributes as
259     * well as navigable associations that are marked as 'required'.  If 'follow' is true, then the
260     * inheritance hierchy will be followed and all required properties from super classes will be
261     * included as well.
262     * If 'withIdentifiers' is true, the identifiers will be include, if false, no identifiers will
263     * be included.
264     * @param follow boolean
265     * @param withIdentifiers boolean
266     * @return Collection<ModelElementFacade>
267     */
268    public Collection<ModelElementFacade> getRequiredProperties(boolean follow, boolean withIdentifiers);
269
270    /**
271     * Creates a comma separated list of the required property names.
272     * @param follow boolean
273     * @param withIdentifiers boolean
274     * @return String
275     */
276    public String getRequiredPropertyNameList(boolean follow, boolean withIdentifiers);
277
278    /**
279     * A comma separated list of the required property types.
280     * @param follow boolean
281     * @param withIdentifiers boolean
282     * @return String
283     */
284    public String getRequiredPropertyTypeList(boolean follow, boolean withIdentifiers);
285
286    /**
287     * The name of the schema that contains the database table
288     * @return String
289     */
290    public String getSchema();
291
292    /**
293     * The name of the database table to which this entity is persisted.
294     * @return String
295     */
296    public String getTableName();
297
298    /**
299     * Returns true/false depending on whether or not this entity represetns a child in an
300     * association (this occurs when this entity is on the opposite end of an assocation end defined
301     * as composite).
302     * @return boolean
303     */
304    public boolean isChild();
305
306    /**
307     * True if this entity identifier is a composite (consists of multiple key columns, typically
308     * abstracted into an external composite identifier class)
309     * @return boolean
310     */
311    public boolean isCompositeIdentifier();
312
313    /**
314     * True if the entity has its identifiers dynamically added, false otherwise.
315     * @return boolean
316     */
317    public boolean isDynamicIdentifiersPresent();
318
319    /**
320     * True if the entity has any identifiers defined, false otherwise.
321     * @return boolean
322     */
323    public boolean isIdentifiersPresent();
324
325    /**
326     * Indiciates if this entity is using an assigned identifier or not.
327     * @return boolean
328     */
329    public boolean isUsingAssignedIdentifier();
330
331    /**
332     * Indicates whether or not this entity is using a foreign identifier as its identifiers.  That
333     * is: the foreignIdentifier flag was set on an incoming association end and the entity is
334     * therefore using the related foreign parent entity's identifier.
335     * @return boolean
336     */
337    public boolean isUsingForeignIdentifier();
338}