001// license-header java merge-point 002// 003// Attention: generated code (by Metafacade.vsl) - do not modify! 004// 005package org.andromda.cartridges.ejb3.metafacades; 006 007import java.util.Collection; 008import java.util.List; 009import org.andromda.metafacades.uml.AttributeFacade; 010import org.andromda.metafacades.uml.DependencyFacade; 011import org.andromda.metafacades.uml.Entity; 012import org.andromda.metafacades.uml.ModelElementFacade; 013import org.andromda.metafacades.uml.Role; 014 015/** 016 * Represents an entity EJB. 017 * 018 * Metafacade interface to be used by AndroMDA cartridges. 019 */ 020public interface EJB3EntityFacade 021 extends Entity 022{ 023 /** 024 * Indicates the metafacade type (used for metafacade mappings). 025 * 026 * @return boolean always <code>true</code> 027 */ 028 public boolean isEJB3EntityFacadeMetaType(); 029 030 /** 031 * Find all associations that define relations to other entities. 032 * This method returns the source association ends for all associations that define 033 * a container managed relation. The returned collection includes both 034 * direct relations and inherited relations. A direct relation is an association with some other 035 * class matching the following criteria: 1) The class at the other side of the association is 036 * stereotyped <<Entity>> 2) The association is navigable from to the other side. 037 * An inherited relation is an association from an abstract super type matching the following 038 * criteria: 1) The inheritance path to this abstract super type, including this super type 039 * itself, consists only of abstract classes with stereotype <<Entity>> 2) The class at the 040 * other side of the association is stereotyped <<Entity>>. 3) The association is navigable from 041 * this abstract super type to the other side. 042 * Relations must match the following integrity constraint: 043 * - The <<Entity>> at the target end is not abstract. 044 * The integrity constraint is necessary because the target of a container managed relation in 045 * the EJB framework must be a concrete entity bean; there is no such thing as an 046 * "abstract entity bean" in the EJB specification. It is possible, however, to generate and 047 * compile code for this case, an error will only show up at deploy time. In order to catch 048 * this kind of error at the earliest possible stage, this method checks the integrity 049 * constraint and throws an exception if it is violated. 050 * @return Collection 051 */ 052 public Collection getAllEntityRelations(); 053 054 /** 055 * All instanceAttributes for this entity. The list includes the instanceAttributes that are 056 * inherited from super classes. The list contains the inherited instanceAttributes first, 057 * followed by the instanceAttributes defined in this class. 058 * @return List 059 */ 060 public List getAllInstanceAttributes(); 061 062 /** 063 * Returns all value object references (this includes all those that are inherited from any 064 * parent entities) 065 * @return Collection<DependencyFacade> 066 */ 067 public Collection<DependencyFacade> getAllValueObjectReferences(); 068 069 /** 070 * Create a comma separated list of attributes. This method can be used to generate argument 071 * lists for constructors, method calls etc. It will not return attributes tagged to be 072 * optimistic lock values. It will consider LOB attributes where the LOB type has been 073 * overridden using the @androma.persistence.lob.type tagged value. 074 * @param attributes Collection 075 * @param includeTypes boolean 076 * @param includeNames boolean 077 * @param includeAutoIdentifiers boolean 078 * @return String 079 */ 080 public String getAttributesAsList(Collection attributes, boolean includeTypes, boolean includeNames, boolean includeAutoIdentifiers); 081 082 /** 083 * Provides the cache policy for the entity. 084 * Posible values are NONE, READ_WRITE, NONSTRICT_READ_WRITE, READ_ONLY, TRANSACTIONAL. 085 * @return String 086 */ 087 public String getCacheType(); 088 089 /** 090 * Gets all constants for this entity. Constants are defined as static read-only attributes 091 * which do NOT have the <<EnvEntry>> stereotype. If 'follow' is true, then the inheritance 092 * hierarchy will be followed and we'll retrieve all constants from any super types as well. 093 * @param follow boolean 094 * @return Collection 095 */ 096 public Collection getConstants(boolean follow); 097 098 /** 099 * Gets create methods for the entity. If 'follow'l is set to true, create methods from any 100 * super types will also be retrieved by following up the inheritance chain. 101 * @param follow boolean 102 * @return Collection 103 */ 104 public Collection getCreateMethods(boolean follow); 105 106 /** 107 * The DAO base class name. This is the abstract DAO that containsCRUD operations as well as 108 * any generated finders defined on an entity. 109 * @return String 110 */ 111 public String getDaoBaseName(); 112 113 /** 114 * The business operations modeled on the entity that will be generated on the DAO (Data Access 115 * Object). 116 * @return Collection<EJB3OperationFacade> 117 */ 118 public Collection<EJB3OperationFacade> getDaoBusinessOperations(); 119 120 /** 121 * Returns the default DAO exception name. 122 * @return String 123 */ 124 public String getDaoDefaultExceptionName(); 125 126 /** 127 * The DAO implementation class name. 128 * @return String 129 */ 130 public String getDaoImplementationName(); 131 132 /** 133 * The name of the DAO for the specified entity. 134 * @return String 135 */ 136 public String getDaoName(); 137 138 /** 139 * The constant name denoting no transformation is to be applied. 140 * @return String 141 */ 142 public String getDaoNoTransformationConstantName(); 143 144 /** 145 * Returns the default entity cascadable property attribute looked up in the namespace 146 * descriptor. 147 * @return String 148 */ 149 public String getDefaultCascadeType(); 150 151 /** 152 * Returns the default persistence context unit name for the injected EntityManger for the 153 * DAO/Manageable service beans. It is derived from the persistenceContextUnitName namespace 154 * property. 155 * @return String 156 */ 157 public String getDefaultPersistenceContextUnitName(); 158 159 /** 160 * The name of the discriminator column. Default is TYPE if this is missing. 161 * @return String 162 */ 163 public String getDiscriminatorColumn(); 164 165 /** 166 * The SQL used when generating the DDL for the discriminator column. 167 * @return String 168 */ 169 public String getDiscriminatorColumnDefinition(); 170 171 /** 172 * The standard length of a discriminator value. Default is 10. 173 * @return int 174 */ 175 public int getDiscriminatorLength(); 176 177 /** 178 * The type of the entity discriminator column. Default is STRING. 179 * @return String 180 */ 181 public String getDiscriminatorType(); 182 183 /** 184 * The value indicating the row in an entity of the annotated entity type. 185 * @return String 186 */ 187 public String getDiscriminatorValue(); 188 189 /** 190 * Entity composite primary key class name for this entity. 191 * @return String 192 */ 193 public String getEntityCompositePrimaryKeyName(); 194 195 /** 196 * Entity embeddable super class name this entity inherits from. 197 * @return String 198 */ 199 public String getEntityEmbeddableName(); 200 201 /** 202 * The name of the implementation class. 203 * @return String 204 */ 205 public String getEntityImplementationName(); 206 207 /** 208 * Entity listener class name for callback methods. 209 * @return String 210 */ 211 public String getEntityListenerName(); 212 213 /** 214 * The named used for the EJB3 entity. 215 * @return String 216 */ 217 public String getEntityName(); 218 219 /** 220 * Entity classes that are association relationships from this entity. 221 * @return Collection 222 */ 223 public Collection getEntityRelations(); 224 225 /** 226 * Gets all env-entries for the specified entity EJB. Env-entries are stored as static 227 * attributes on the entity and stereotyped as <<EnvEntry>>. If 'follow' is true, then the 228 * inheritance hierarchy will be followed and we'll retrieve all env-entries from any super 229 * types as well. 230 * @param follow boolean 231 * @return Collection 232 */ 233 public Collection getEnvironmentEntries(boolean follow); 234 235 /** 236 * The fully qualified name of the base DAO. 237 * @return String 238 */ 239 public String getFullyQualifiedDaoBaseName(); 240 241 /** 242 * Returns the fully qualified default DAO exception name. 243 * @return String 244 */ 245 public String getFullyQualifiedDaoDefaultExceptionName(); 246 247 /** 248 * The fully qualified name of the DAO implemetation. 249 * @return String 250 */ 251 public String getFullyQualifiedDaoImplementationName(); 252 253 /** 254 * The fully qualified name of the DAO. 255 * @return String 256 */ 257 public String getFullyQualifiedDaoName(); 258 259 /** 260 * The fully qualified name of the composite primary key class of this entity. 261 * @return String 262 */ 263 public String getFullyQualifiedEntityCompositePrimaryKeyName(); 264 265 /** 266 * The fully qualified name of the embeddable super class of this entity. 267 * @return String 268 */ 269 public String getFullyQualifiedEntityEmbeddableName(); 270 271 /** 272 * Fully qualified name of the Entity implementation class. 273 * @return String 274 */ 275 public String getFullyQualifiedEntityImplementationName(); 276 277 /** 278 * Fully qualified name of the Entity listner class holding entity callback methods. 279 * @return String 280 */ 281 public String getFullyQualifiedEntityListenerName(); 282 283 /** 284 * The fully qualified name of the EJB3 entity. 285 * @return String 286 */ 287 public String getFullyQualifiedEntityName(); 288 289 /** 290 * A String representing the name of a home interface for this entity EJB. 291 * @return String 292 */ 293 public String getHomeInterfaceName(); 294 295 /** 296 * Returns the identifier, which can be an attribute or an association. For an association, the 297 * target primary key is used as part of the embedded identifier. 298 * @return ModelElementFacade 299 */ 300 public ModelElementFacade getIdentifier(); 301 302 /** 303 * Return the value of the andromda_persistence_inheritance tagged value which is an enumeration 304 * containing SINGLE_TABLE, TABLE_PER_CLASS or JOINED. 305 * @return String 306 */ 307 public String getInheritanceStrategy(); 308 309 /** 310 * All inherited instanceAttributes this class. The instanceAttributes are grouped by the class 311 * that defines the instanceAttributes, with instanceAttributes from the most removed super 312 * class first. 313 * @return List 314 */ 315 public List getInheritedInstanceAttributes(); 316 317 /** 318 * Gets a comma separated list of instance attribute names. If 'follow' is true, will travel up 319 * the inheritance hierarchy to include instance attributes in parent entities as well. If 320 * 'withIdentifiers' is true, will include identifiers. 321 * @param follow boolean 322 * @param withIdentifiers boolean 323 * @return String 324 */ 325 public String getInstanceAttributeNameList(boolean follow, boolean withIdentifiers); 326 327 /** 328 * Gets a comma separated list of instance attribute types. If 'follow' is true, will travel up 329 * the inheritance hierarchy to include instance attribute types in parent entities as well. If 330 * 'withIdentifiers' is true, will include identifiers. 331 * @param follow boolean 332 * @param withIdentifiers boolean 333 * @return String 334 */ 335 public String getInstanceAttributeTypeList(boolean follow, boolean withIdentifiers); 336 337 /** 338 * Gets all instance attributes of the entity, and optionally retieves the super entities 339 * instance attributes as well as excludes the entity's identifiers if 'withIdentifiers' is set 340 * to false. 341 * @param follow boolean 342 * @param withIdentifiers boolean 343 * @return Collection 344 */ 345 public Collection getInstanceAttributes(boolean follow, boolean withIdentifiers); 346 347 /** 348 * jndiNamePrefix/ejb/this.getFullyQualifiedName() 349 * @return String 350 */ 351 public String getJndiName(); 352 353 /** 354 * Find the attribute with 'andromda_manageable_table_displayname' 355 * @return AttributeFacade 356 */ 357 public AttributeFacade getManageableDisplayAttribute(); 358 359 /** 360 * Return all dependent Roles with the stereotype 'RunAs' 361 * @return Collection<Role> 362 */ 363 public Collection<Role> getNonRunAsRoles(); 364 365 /** 366 * Returns the comma separated list of roles allowd to execute DAO operations. This is defined 367 * by actor dependencies on the entity. 368 * @return String 369 */ 370 public String getRolesAllowed(); 371 372 /** 373 * Travels up the inheritance hierarchy and retrieves the root of this entity. If the root is 374 * the entity itself then just the entity is returned. 375 * @return EJB3EntityFacade 376 */ 377 public EJB3EntityFacade getRoot(); 378 379 /** 380 * Returns the Seam component name for the class. 381 * @return String 382 */ 383 public String getSeamComponentName(); 384 385 /** 386 * Returns the seam component scope type if one is specified. 387 * @return String 388 */ 389 public String getSeamComponentScopeType(); 390 391 /** 392 * Returns the security domain value. Specified using the securityRealm namespace property or 393 * overridden in the andromda.ejb.security.realm tagged value. 394 * @return String 395 */ 396 public String getSecurityRealm(); 397 398 /** 399 * Gets select methods for the entity, if all is set to 'true' then ALL select methods will be 400 * retrieved (including those inherited from any superclasses). 401 * @param follow boolean 402 * @return Collection 403 */ 404 public Collection getSelectMethods(boolean follow); 405 406 /** 407 * Gets the SQL Mappings from the SQLMappings URI 408 * @return String 409 */ 410 public String getSqlType(); 411 412 /** 413 * ValueObject dependency references from this Entity 414 * @return Collection 415 */ 416 public Collection getValueDependencies(); 417 418 /** 419 * Retrieves the value object dependencies for this entity without inherited object references. 420 * @return Collection<DependencyFacade> 421 */ 422 public Collection<DependencyFacade> getValueObjectReferences(); 423 424 /** 425 * Retrieves the values object references for this entity. If <code>follow</code> is true, then 426 * all value object references (including those that were inherited) will be retrieved. 427 * @param follow boolean 428 * @return Collection 429 */ 430 public Collection getValueObjectReferences(boolean follow); 431 432 /** 433 * A string indicating whether the Bean is a local or remotely accessable bean. 434 * @return String 435 */ 436 public String getViewType(); 437 438 /** 439 * If the attribute att is present 440 * @param att String 441 * @return boolean 442 */ 443 public boolean isAttributePresent(String att); 444 445 /** 446 * Returns true if caching has been enabled via namespace property hibernateEnableCache. 447 * @return boolean 448 */ 449 public boolean isCacheEnabled(); 450 451 /** 452 * Returns true if a composite primary key exists for this entity bean. A composite primary key 453 * consists of 2 or more entity identifiers. 454 * @return boolean 455 */ 456 public boolean isCompositePrimaryKeyPresent(); 457 458 /** 459 * Indicates whether or not any business DAO operations are present. 460 * @return boolean 461 */ 462 public boolean isDaoBusinessOperationsPresent(); 463 464 /** 465 * True if an implementation is required for the dao class, this is the case when there are 466 * business operations or value-object transformation. 467 * @return boolean 468 */ 469 public boolean isDaoImplementationRequired(); 470 471 /** 472 * Determines if this entity is an mapped/embeddable super class. 473 * @return boolean 474 */ 475 public boolean isEmbeddableSuperclass(); 476 477 /** 478 * Returns true if this entity is a subclass of an mapped/embeddable super class. You cannot 479 * have more than 1 level of inheritance using mapped/embeddable super class. To achieve 480 * multiple levels, use one of the inheritance mapping strategies like single table, table per 481 * class or joined table strategies. 482 * @return boolean 483 */ 484 public boolean isEmbeddableSuperclassGeneralizationExists(); 485 486 /** 487 * True if an entity implementation is required for the entity class, this is the case when 488 * there are business operations. 489 * @return boolean 490 */ 491 public boolean isEntityImplementationRequired(); 492 493 /** 494 * Returns true if the findAll finder method (specified as a query method) has been modelled. 495 * @return boolean 496 */ 497 public boolean isFinderFindAllExists(); 498 499 /** 500 * Returns true if the finder findByPrimaryKey has been modelled. 501 * @return boolean 502 */ 503 public boolean isFinderFindByPrimaryKeyExists(); 504 505 /** 506 * Returns true if the generic finder property is true. This will create generic finder static 507 * methods in the entity POJO like findByPrimaryKey and findAll. 508 * @return boolean 509 */ 510 public boolean isGenericFinders(); 511 512 /** 513 * If the identifier id is present 514 * @param id String 515 * @return boolean 516 */ 517 public boolean isIdentifierPresent(String id); 518 519 /** 520 * Return true if the entity inheritance strategy as specified by the tagged value 521 * andromda_persistence_inheritance is defined as JOINED. 522 * @return boolean 523 */ 524 public boolean isInheritanceJoined(); 525 526 /** 527 * Return true if the entity inheritance strategy as specified by the tagged value 528 * andromda_persistence_inheritance is defined as SINGLE_TABLE. 529 * @return boolean 530 */ 531 public boolean isInheritanceSingleTable(); 532 533 /** 534 * Return true if the entity inheritance strategy as specified by the tagged value 535 * andromda_persistence_inheritance is defined as TABLE_PER_CLASS. 536 * @return boolean 537 */ 538 public boolean isInheritanceTablePerClass(); 539 540 /** 541 * Returns true if this entity bean has the stereotype Listener. False otherwise. 542 * @return boolean 543 */ 544 public boolean isListenerEnabled(); 545 546 /** 547 * Returns true if this entity is assigned the Manageable stereotype. False otherwise. 548 * @return boolean 549 */ 550 public boolean isManageable(); 551 552 /** 553 * If the operation op is present 554 * @param op String 555 * @return boolean 556 */ 557 public boolean isOperationPresent(String op); 558 559 /** 560 * Returns true if the entity requires generalization mapping. The Inheritance annotation is 561 * required for child entities for all inheritance strategies. 562 * @return boolean 563 */ 564 public boolean isRequiresGeneralizationMapping(); 565 566 /** 567 * Returns true if the entity requires specialization mapping. The Inheritance annotation is 568 * required for parent entities for all inheritance strategies. 569 * @return boolean 570 */ 571 public boolean isRequiresSpecializationMapping(); 572 573 /** 574 * Returns true if this entity has the <<Seam>> stereotype modelled indicating it is a Seam 575 * entity component. 576 * @return boolean 577 */ 578 public boolean isSeamComponent(); 579 580 /** 581 * Returns true if the security realm is specified. This will generate the security setting for 582 * the DAO components. 583 * @return boolean 584 */ 585 public boolean isSecurityEnabled(); 586 587 /** 588 * Whether or not to allow a synthetic (auto generated) create method. 589 * @return boolean 590 */ 591 public boolean isSyntheticCreateMethodAllowed(); 592 593 /** 594 * Return true if a unique cache region is NOT required for entities and queries. This means we 595 * use the default cache region specified by the container. Specified via the 596 * useDefaultCacheRegion namepsace property. 597 * @return boolean 598 */ 599 public boolean isUseDefaultCacheRegion(); 600 601 /** 602 * Returns true if the application wide namespace property hibernateUseQueryCache is enabled. 603 * This is used for generic finder methods i.e. findAll. 604 * @return boolean 605 */ 606 public boolean isUseQueryCache(); 607}