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 org.andromda.metafacades.uml.EntityAssociationEnd; 008 009/** 010 * Represents an EJB association end. 011 * 012 * Metafacade interface to be used by AndroMDA cartridges. 013 */ 014public interface EJB3AssociationEndFacade 015 extends EntityAssociationEnd 016{ 017 /** 018 * Indicates the metafacade type (used for metafacade mappings). 019 * 020 * @return boolean always <code>true</code> 021 */ 022 public boolean isEJB3AssociationEndFacadeMetaType(); 023 024 /** 025 * Returns the default cascade property specified for UML aggregation. 026 * @return String 027 */ 028 public String getAggregationCascadeType(); 029 030 /** 031 * Provides the cache policy for the entity association Collection. 032 * Posible values are NONE, READ_WRITE, NONSTRICT_READ_WRITE, READ_ONLY, TRANSACTIONAL. 033 * @return String 034 */ 035 public String getCacheType(); 036 037 /** 038 * Return the cascade type attributes as an array of this association end or null if no relevant 039 * cascade attribute is found. 040 * @return String 041 */ 042 public String getCascadeType(); 043 044 /** 045 * Returns the association end collection index name. 046 * @return String 047 */ 048 public String getCollectionIndexName(); 049 050 /** 051 * this will only apply for Maps; it will return the type of the attribute specified on the 052 * CollectionIndexName tagged value 053 * @return String 054 */ 055 public String getCollectionIndexType(); 056 057 /** 058 * Returns the collection type defined on this association end using the 059 * andromda_persistence_collection_type tagged value. 060 * If undefined use the following strategy: 061 * - If ordered collection type: return a list 062 * - Otherwise, return the default association collection type. 063 * @return String 064 */ 065 public String getCollectionType(); 066 067 /** 068 * The fully qualified class name of the collection implementation type. 069 * @return String 070 */ 071 public String getCollectionTypeImplemenationClass(); 072 073 /** 074 * The actual implementation of the collection type. 075 * @return String 076 */ 077 public String getCollectionTypeImplementation(); 078 079 /** 080 * The actual implementation of the collection type. 081 * @param arg String 082 * @return String 083 */ 084 public String getCollectionTypeImplementation(String arg); 085 086 /** 087 * Defines the column definition DDL used when creating table schema - use to override default 088 * container DDL. 089 * @return String 090 */ 091 public String getColumnDefinition(); 092 093 /** 094 * Returns the default cascade property specified for UML composition. 095 * @return String 096 */ 097 public String getCompositionCascadeType(); 098 099 /** 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}