View Javadoc
1   // license-header java merge-point
2   //
3   // Attention: generated code (by Metafacade.vsl) - do not modify!
4   //
5   package org.andromda.metafacades.uml;
6   
7   import java.util.Collection;
8   
9   /**
10   * Represents a persistent entity.
11   *
12   * Metafacade interface to be used by AndroMDA cartridges.
13   */
14  public interface Entity
15      extends ClassifierFacade
16  {
17      /**
18       * Indicates the metafacade type (used for metafacade mappings).
19       *
20       * @return boolean always <code>true</code>
21       */
22      public boolean isEntityMetaType();
23  
24      /**
25       * Returns a collection of all entities this entity and its ancestors have a relation to.
26       * @return Collection<DependencyFacade>
27       */
28      public Collection<DependencyFacade> getAllEntityReferences();
29  
30      /**
31       * Gets a comma separated list of attribute names.  If 'follow' is true, will travel up the
32       * inheritance hiearchy to include attributes in parent entities as well.  If 'withIdentifiers'
33       * is true, will include identifiers.
34       * @param follow boolean
35       * @param withIdentifiers boolean
36       * @return String
37       */
38      public String getAttributeNameList(boolean follow, boolean withIdentifiers);
39  
40      /**
41       * Gets a comma separated list of attribute names.  If 'follow' is true, will travel up the
42       * inheritance hiearchy to include attributes in parent entities as well.  If 'withIdentifiers'
43       * is true, will include identifiers  and  if 'withDerived' is set to true, will include derived
44       * attributes.
45       * @param follow boolean
46       * @param withIdentifiers boolean
47       * @param withDerived boolean
48       * @return String
49       */
50      public String getAttributeNameList(boolean follow, boolean withIdentifiers, boolean withDerived);
51  
52      /**
53       * Gets a comma separated list of attribute types.  If 'follow' is true, will travel up the
54       * inheritance hierarchy to include attributes in parent entities as well.  If 'withIdentifiers'
55       * is true, will include identifiers.
56       * @param follow boolean
57       * @param withIdentifiers boolean
58       * @return String
59       */
60      public String getAttributeTypeList(boolean follow, boolean withIdentifiers);
61  
62      /**
63       * Gets all attributes of the entity, and optionally retieves the super entities attributes as
64       * well as excludes the entity's identifiers if 'withIdentifiers' is set to false.
65       * @param follow boolean
66       * @param withIdentifiers boolean
67       * @return Collection<AttributeFacade>
68       */
69      public Collection<AttributeFacade> getAttributes(boolean follow, boolean withIdentifiers);
70  
71      /**
72       * Gets all attributes of the entity, and optionally retieves the super entities attributes as
73       * well as excludes the entity's identifiers if 'withIdentifiers' is set to false and exclude
74       * derived attributes if 'withDerived' is set to false.
75       * @param follow boolean
76       * @param withIdentifiers boolean
77       * @param withDerived boolean
78       * @return Collection<AttributeFacade>
79       */
80      public Collection<AttributeFacade> getAttributes(boolean follow, boolean withIdentifiers, boolean withDerived);
81  
82      /**
83       * All business operations of the entity, these include any operations that aren't queries.
84       * @return Collection<OperationFacade>
85       */
86      public Collection<OperationFacade> getBusinessOperations();
87  
88      /**
89       * Gets any children association ends (i.e. entity association ends that are participants in an
90       * association with this entity and this entity has composite aggregation defined for those
91       * associations).
92       * @return Collection<EntityAssociationEnd>
93       */
94      public Collection<EntityAssociationEnd> getChildEnds();
95  
96      /**
97       * The embedded values belonging to this entity.
98       * @return Collection<AttributeFacade>
99       */
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 }