1 package org.andromda.cartridges.hibernate.metafacades;
2
3 /**
4 * Stores Globals specific to the Hibernate cartridge.
5 *
6 * @author Chad Brandon
7 * @author Wouter Zoons
8 */
9 public class HibernateGlobals
10 {
11 /**
12 * Denotes whether or not subclasses require their own mapping file.
13 */
14 static public final String HIBERNATE_MAPPING_STRATEGY = "hibernateMappingStrategy";
15
16 /**
17 * A mapping file per subclass.
18 */
19 static public final String HIBERNATE_MAPPING_STRATEGY_SUBCLASS = "subclass";
20
21 /**
22 * A mapping file per hierarchy.
23 */
24 static public final String HIBERNATE_MAPPING_STRATEGY_HIERARCHY = "hierarchy";
25
26 /**
27 * A mapping file per hierarchy.
28 */
29 static public final String HIBERNATE_MAPPING_STRATEGY_CONCRETE = "concrete";
30
31 /**
32 * Indicates if "XML Persistence" code generation is enabled. Requires Hibernate 3.
33 */
34 static public final String HIBERNATE_XML_PERSISTENCE = "hibernateXMLPersistence";
35
36 /**
37 * Determines if the identifier attribute on an entity is generated as an attribute
38 * or as a separate element.
39 */
40 static final String HIBERNATE_XML_PERSISTENCE_ID_AS_ATTRIBUTE = "hibernateXMLPersistIDAsAttribute";
41
42 /**
43 * Hibernate version to use.
44 */
45 static public final String HIBERNATE_VERSION = "hibernateVersion";
46
47 /**
48 * The version for Hibernate 2.
49 */
50 public static final String HIBERNATE_VERSION_2 = "2";
51
52 /**
53 * The version for Hibernate 3.
54 */
55 public static final String HIBERNATE_VERSION_3 = "3";
56
57 /**
58 * The version for Hibernate 4.
59 */
60 public static final String HIBERNATE_VERSION_4 = "4";
61
62 /**
63 * EJB implementation class suffix.
64 */
65 static final String EJB_IMPLEMENTATION_SUFFIX = "Bean";
66
67 /**
68 * Represents the hibernate <code>delete</code> cascade option.
69 */
70 static final String HIBERNATE_CASCADE_DELETE = "delete";
71
72 /**
73 * Represents the hibernate <code>all-delete-orphan</code> cascade option.
74 */
75 static final String HIBERNATE_CASCADE_ALL_DELETE_ORPHAN = "all-delete-orphan";
76
77 /**
78 * Represents the hibernate <code>save-update</code> cascade option.
79 */
80 static final String HIBERNATE_CASCADE_SAVE_UPDATE = "save-update";
81
82 /**
83 * Represents the hibernate <code>all</code> cascade option.
84 */
85 static final String HIBERNATE_CASCADE_ALL = "all";
86
87 /**
88 * Represents the hibernate <code>none</code> cascade option.
89 */
90 static final String HIBERNATE_CASCADE_NONE = "none";
91
92 /**
93 * The property used to specify the implementation operation name prefix (on
94 * services).
95 */
96 static final String PROPERTY_IMPLEMENTATION_OPERATION_NAME_PREFIX = "implementationOperationNamePrefix";
97
98 /**
99 * The namespace property storing default ehCache maxElementsInMemory
100 * parameter
101 */
102 static final String HIBERNATE_EHCACHE_MAX_ELEMENTS = "ehCacheMaxElementsInMemory";
103
104 /**
105 * The namespace property storing default ehCache eternal parameter
106 */
107 static final String HIBERNATE_EHCACHE_ETERNAL = "ehCacheEternal";
108
109 /**
110 * The namespace property storing default ehCache eternal parameter
111 */
112 static final String HIBERNATE_EHCACHE_TIME_TO_IDLE = "ehCacheTimeToIdleSeconds";
113
114 /**
115 * The namespace property storing default ehCache eternal parameter
116 */
117 static final String HIBERNATE_EHCACHE_TIME_TO_LIVE = "ehCacheTimeToLiveSeconds";
118
119 /**
120 * The namespace property storing default ehCache eternal parameter
121 */
122 static final String HIBERNATE_EHCACHE_OVERFLOW_TO_DISK = "ehCacheOverflowToDisk";
123
124 /**
125 * The namespace property storing whether distributed caching is turned on at all.
126 */
127 static final String HIBERNATE_ENTITYCACHE_DISTRIBUTED = "hibernateEnableDistributedCache";
128
129 /**
130 * The namespace property storing default dynamic-insert parameter
131 */
132 static final String HIBERNATE_ENTITY_DYNAMIC_INSERT = "hibernateEntityDynamicInsert";
133
134 /**
135 * The namespace property storing default dynamic-update parameter
136 */
137 static final String HIBERNATE_ENTITY_DYNAMIC_UPDATE = "hibernateEntityDynamicUpdate";
138
139 /**
140 * The namespace property storing default collection type for associations
141 */
142 static final String HIBERNATE_ASSOCIATION_COLLECTION_TYPE = "hibernateAssociationCollectionType";
143
144 /**
145 * The namespace property storing default sort method for collections
146 */
147 static final String HIBERNATE_ASSOCIATION_SORT_TYPE = "hibernateAssociationSortType";
148
149 /**
150 * The namespace property to specify the pattern for determining the entity
151 * name.
152 */
153 static final String ENTITY_NAME_PATTERN = "entityNamePattern";
154
155 /**
156 * The property which stores the pattern defining the entity implementation
157 * name.
158 */
159 static final String ENTITY_IMPLEMENTATION_NAME_PATTERN = "entityImplementationNamePattern";
160
161 /**
162 * The property which stores the pattern defining the embedded value
163 * implementation name.
164 */
165 static final String EMBEDDED_VALUE_IMPLEMENTATION_NAME_PATTERN = "embeddedValueImplementationNamePattern";
166
167 /**
168 * The property which defines a default value for hibernate entities
169 * versioning.
170 */
171 static final String HIBERNATE_VERSION_PROPERTY = "versionProperty";
172
173 /**
174 * The 'list' type implementation to use.
175 */
176 static final String LIST_TYPE_IMPLEMENTATION = "listTypeImplementation";
177
178 /**
179 * The 'set' type implementation to use.
180 */
181 static final String SET_TYPE_IMPLEMENTATION = "setTypeImplementation";
182
183 /**
184 * The 'map' type implementation to use.
185 */
186 static final String MAP_TYPE_IMPLEMENTATION = "mapTypeImplementation";
187
188 /**
189 * The 'bag' type implementation to use.
190 */
191 static final String BAG_TYPE_IMPLEMENTATION = "bagTypeImplementation";
192
193 /**
194 * A flag indicating whether or not specific (java.util.Set, java.util.List,
195 * etc) collection interfaces should be used in association mutators and
196 * accessors or whether the generic java.util.Collection interface should be
197 * used.
198 */
199 static final String SPECIFIC_COLLECTION_INTERFACES = "specificCollectionInterfaces";
200
201 /**
202 * The property that defines the default collection interface, this is the
203 * interface used if the property defined by
204 * {@link #SPECIFIC_COLLECTION_INTERFACES} is true.
205 */
206 static final String DEFAULT_COLLECTION_INTERFACE = "defaultCollectionInterface";
207
208 /**
209 * The default Hibernate discriminator column name
210 */
211 static final String ENTITY_DISCRIMINATOR_COLUMN = "defaultEntityDiscriminatorColumn";
212
213 /**
214 * The default Hibernate discriminator column type
215 */
216 static final String ENTITY_DISCRIMINATOR_TYPE = "defaultEntityDiscriminatorType";
217
218 /**
219 * Optional definition of the package name where all Hibernate enumeration types are
220 * to be generated. This will overrride the default model package name where the
221 * enumeration class itself will still be placed.
222 */
223 static final String ENUM_TYPES_PACKAGE = "enumTypesPackage";
224 }