1 // license-header java merge-point 2 // 3 // Attention: generated code (by Metafacade.vsl) - do not modify! 4 // 5 package org.andromda.cartridges.ejb3.metafacades; 6 7 import org.andromda.metafacades.uml.EntityAssociationEnd; 8 9 /** 10 * Represents an EJB association end. 11 * 12 * Metafacade interface to be used by AndroMDA cartridges. 13 */ 14 public interface EJB3AssociationEndFacade 15 extends EntityAssociationEnd 16 { 17 /** 18 * Indicates the metafacade type (used for metafacade mappings). 19 * 20 * @return boolean always <code>true</code> 21 */ 22 public boolean isEJB3AssociationEndFacadeMetaType(); 23 24 /** 25 * Returns the default cascade property specified for UML aggregation. 26 * @return String 27 */ 28 public String getAggregationCascadeType(); 29 30 /** 31 * Provides the cache policy for the entity association Collection. 32 * Posible values are NONE, READ_WRITE, NONSTRICT_READ_WRITE, READ_ONLY, TRANSACTIONAL. 33 * @return String 34 */ 35 public String getCacheType(); 36 37 /** 38 * Return the cascade type attributes as an array of this association end or null if no relevant 39 * cascade attribute is found. 40 * @return String 41 */ 42 public String getCascadeType(); 43 44 /** 45 * Returns the association end collection index name. 46 * @return String 47 */ 48 public String getCollectionIndexName(); 49 50 /** 51 * this will only apply for Maps; it will return the type of the attribute specified on the 52 * CollectionIndexName tagged value 53 * @return String 54 */ 55 public String getCollectionIndexType(); 56 57 /** 58 * Returns the collection type defined on this association end using the 59 * andromda_persistence_collection_type tagged value. 60 * If undefined use the following strategy: 61 * - If ordered collection type: return a list 62 * - Otherwise, return the default association collection type. 63 * @return String 64 */ 65 public String getCollectionType(); 66 67 /** 68 * The fully qualified class name of the collection implementation type. 69 * @return String 70 */ 71 public String getCollectionTypeImplemenationClass(); 72 73 /** 74 * The actual implementation of the collection type. 75 * @return String 76 */ 77 public String getCollectionTypeImplementation(); 78 79 /** 80 * The actual implementation of the collection type. 81 * @param arg String 82 * @return String 83 */ 84 public String getCollectionTypeImplementation(String arg); 85 86 /** 87 * Defines the column definition DDL used when creating table schema - use to override default 88 * container DDL. 89 * @return String 90 */ 91 public String getColumnDefinition(); 92 93 /** 94 * Returns the default cascade property specified for UML composition. 95 * @return String 96 */ 97 public String getCompositionCascadeType(); 98 99 /** 100 * Returns the default collection interface from namespace descriptor. 101 * @return String 102 */ 103 public String getDefaultCollectionInterface(); 104 105 /** 106 * Get the fetch type for this association end(CMR). 107 * If no fetch type tagged value is specified and COMPOSITION_DEFINES_EAGER_LOADING is enabled, 108 * then: 109 * <ul><li>aggregation: lazy-loaded</li><li>composition: eager-loaded</li></ul> 110 * Otherwise, the default fetch type for CMR of type One2Many and Many2Many is LAZY. 111 * Default fetch type for CMR of type Many2One and One2One is EAGER. 112 * This will return either EAGER or LAZY. 113 * @return String 114 */ 115 public String getFetchType(); 116 117 /** 118 * Returns the name of the foreign key constraint to use for name property of 119 * org.hibernate.annotations.ForeignKey annotation used for Many-To-One, 120 * One-To-One and Many-To-Many relationships. 121 * @param suffix String 122 * @return String 123 */ 124 public String getForeignKeyConstraintName(String suffix); 125 126 /** 127 * Returns the name of the foreign key to use for name property of JoinColumn/InverseJoinColumn 128 * used in JoinTable for One-To-Many and Many-To-Many relationships. 129 * @param suffix String 130 * @return String 131 */ 132 public String getForeignKeyName(String suffix); 133 134 /** 135 * Returns the getter name for the label name of the display attribute of the manageable entity. 136 * @return String 137 */ 138 public String getGetterLabelName(); 139 140 /** 141 * Returns the Hibernate cascade attribute of this association end. 142 * @return String 143 */ 144 public String getHibernateCascadeType(); 145 146 /** 147 * Returns the label name for the association end used as the display attribute for manageable 148 * entities. 149 * @return String 150 */ 151 public String getLabelName(); 152 153 /** 154 * The order by clause set to order the returning Collection object on the many side of an 155 * association. 156 * @return String 157 */ 158 public String getOrderByClause(); 159 160 /** 161 * Returns the setter name for the label name of the display attribute of the manageable entity. 162 * @return String 163 */ 164 public String getSetterLabelName(); 165 166 /** 167 * Returns true if the tagged value with the specified name exists for the association end. 168 * @param name String 169 * @return boolean 170 */ 171 public boolean hasTaggedValue(String name); 172 173 /** 174 * Returns true if association caching has been enabled via namespace property 175 * hibernateEnableAssociationCache. 176 * @return boolean 177 */ 178 public boolean isAssociationCacheEnabled(); 179 180 /** 181 * Returns true if the collection type is a collection. This will only be the case if the 182 * association end multiplicity is defined as ordered. 183 * @return boolean 184 */ 185 public boolean isCollection(); 186 187 /** 188 * Returns true if the collection interface for this association end is java.util.SortedSet. 189 * @return boolean 190 */ 191 public boolean isCollectionInterfaceSortedSet(); 192 193 /** 194 * Whether the column can be nullable. False for identifier and unique fields. If 195 * andromda_persistence_column_nullable tag is set, the tagged value is used. Otherwise, 196 * determine if this attribute is required from the multiplicity set on the attribute. 197 * @return boolean 198 */ 199 public boolean isColumnNullable(); 200 201 /** 202 * Determine if the fetch type for this entity relationship end is eager loading. 203 * @return boolean 204 */ 205 public boolean isEager(); 206 207 /** 208 * Returns true if a foreign key constraint has been defined explicitly by the user. Otherwise 209 * returns false. This will determine if the ForeignKey annotation will be rendered. We 210 * require this because there is no clean way of defining the constraint name for all 211 * constraints as there may be a chance that two constraints may have the same name. This 212 * vilates the database integrity. 213 * @return boolean 214 */ 215 public boolean isForeignKeyConstraintDefined(); 216 217 /** 218 * Returns true if a Hibernate cascade attribute is defined for this association end. 219 * @return boolean 220 */ 221 public boolean isHibernateCascadeExists(); 222 223 /** 224 * Determine if the fetch type for this entity relationship end is lazy loading. 225 * @return boolean 226 */ 227 public boolean isLazy(); 228 229 /** 230 * Returns true if the collection type is a list. This will only be the case if the association 231 * end multiplicity is defined as ordered. 232 * @return boolean 233 */ 234 public boolean isList(); 235 236 /** 237 * Returns true if the collection type is a map. This will only be the case if the association 238 * end multiplicity is defined as unordered. 239 * @return boolean 240 */ 241 public boolean isMap(); 242 243 /** 244 * Sets the optional attribute on the annotation to determine if a null value is allowed. If 245 * set to false, non-null relationships must always exist. If the andromda_persistence_optional 246 * tag is set, then use the tagged value, otherwise determine if null value is allowed by way of 247 * multiplicity on the association end. 248 * @return boolean 249 */ 250 public boolean isOptional(); 251 252 /** 253 * Determines if this association end if the owning side. Used in one-to-one and many-to-many 254 * relationships. 255 * @return boolean 256 */ 257 public boolean isOwning(); 258 259 /** 260 * Returns true if the collection type is a set. This will only be the case if the association 261 * end multiplicity is defined as unordered. 262 * @return boolean 263 */ 264 public boolean isSet(); 265 }