Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/PersistenceOptions.java')
-rwxr-xr-xcore/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/PersistenceOptions.java585
1 files changed, 238 insertions, 347 deletions
diff --git a/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/PersistenceOptions.java b/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/PersistenceOptions.java
index ffc1cda0d..350748485 100755
--- a/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/PersistenceOptions.java
+++ b/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/PersistenceOptions.java
@@ -54,6 +54,13 @@ public class PersistenceOptions implements ExtensionPoint {
/** The logger */
private static Log log = LogFactory.getLog(PersistenceOptions.class);
+ // START: ++++++++++++++++++++++ AUDITING Naming related Options
+ // ++++++++++++++++++++++++++++++++++++
+
+ public static final String ENABLE_AUDITING = NAMING_PREFIX + "auditing.enable";
+ public static final String AUDITING_ENTITY_PREFIX = NAMING_PREFIX + "auditing.entity.prefix";
+ public static final String AUDITING_ENTITY_POSTFIX = NAMING_PREFIX + "auditing.entity.postfix";
+
// START: ++++++++++++++++++++++ SQL Naming related Options
// ++++++++++++++++++++++++++++++++++++
@@ -80,91 +87,78 @@ public class PersistenceOptions implements ExtensionPoint {
+ "join_table_naming_strategy";
/**
- * Join column naming strategy, two values: unique and simple. unique is the
- * default and results in guaranteed unique naming for the join columns
- * simple will always try to use minimal name lengths and will most of the
- * time just use the efeaturename.
+ * Join column naming strategy, two values: unique and simple. unique is the default and results
+ * in guaranteed unique naming for the join columns simple will always try to use minimal name
+ * lengths and will most of the time just use the efeaturename.
*/
public static final String JOIN_COLUMN_NAMING_STRATEGY = NAMING_PREFIX
+ "join_column_naming_strategy";
/** The column name of the id column in the idbag, default is id */
- public static final String IDBAG_ID_COLUMN_NAME = NAMING_PREFIX
- + "idbag_id_column_name";
+ public static final String IDBAG_ID_COLUMN_NAME = NAMING_PREFIX + "idbag_id_column_name";
/** Name of version column, default value is e_version */
- public static final String VERSION_COLUMN_NAME = NAMING_PREFIX
- + "version_column";
+ public static final String VERSION_COLUMN_NAME = NAMING_PREFIX + "version_column";
/** Name of id column, default value is e_id */
- public static final String ID_COLUMN_NAME = NAMING_PREFIX
- + "default_id_column";
+ public static final String ID_COLUMN_NAME = NAMING_PREFIX + "default_id_column";
/**
- * Truncate the column name if the length is larger than this property. In
- * case of concatenating property names for foreign keys
+ * Truncate the column name if the length is larger than this property. In case of concatenating
+ * property names for foreign keys
*/
- public static final String MAXIMUM_SQL_NAME_LENGTH = NAMING_PREFIX
- + "max_sql_name_length";
+ public static final String MAXIMUM_SQL_NAME_LENGTH = NAMING_PREFIX + "max_sql_name_length";
/**
- * The option which determines the casing of columns and table names,
- * lowercase will result in lowercase letters, uppercase in uppercase, none
- * will just work as it did until now
+ * The option which determines the casing of columns and table names, lowercase will result in
+ * lowercase letters, uppercase in uppercase, none will just work as it did until now
*/
public static final String SQL_CASE_STRATEGY = NAMING_PREFIX + "strategy";
/**
- * If set then the system will generate readable foreign key names. The
- * default is true. Set to false for backward compatibility. Note that
- * before the default value of this property was false.
+ * If set then the system will generate readable foreign key names. The default is true. Set to
+ * false for backward compatibility. Note that before the default value of this property was
+ * false.
*/
- public static final String SET_FOREIGN_KEY_NAME = NAMING_PREFIX
- + "set_foreign_key_name";
+ public static final String SET_FOREIGN_KEY_NAME = NAMING_PREFIX + "set_foreign_key_name";
/**
- * The escape character to use when escaping table and column names.
- * Standard Hibernate uses the ` (backtick). This is the default value.
+ * The escape character to use when escaping table and column names. Standard Hibernate uses the `
+ * (backtick). This is the default value.
*/
public static final String SQL_NAME_ESCAPE_CHARACTER = MAPPING_PREFIX
+ "sql_name_escape_character";
/**
- * The sql name strategy, if not set then the ClassicSQLNameStrategy is
- * used.
+ * The sql name strategy, if not set then the ClassicSQLNameStrategy is used.
*
* @Deprecated use the extensionManager concept
*/
- public static final String SQL_NAME_STRATEGY = NAMING_PREFIX
- + "sql_name_strategy";
+ public static final String SQL_NAME_STRATEGY = NAMING_PREFIX + "sql_name_strategy";
/**
* The Table name prefix, as a default set to "".
*/
- public static final String SQL_TABLE_NAME_PREFIX = NAMING_PREFIX
- + "sql_table_name_prefix";
+ public static final String SQL_TABLE_NAME_PREFIX = NAMING_PREFIX + "sql_table_name_prefix";
/**
* The Column name prefix, as a default set to "".
*/
- public static final String SQL_COLUMN_NAME_PREFIX = NAMING_PREFIX
- + "sql_column_name_prefix";
+ public static final String SQL_COLUMN_NAME_PREFIX = NAMING_PREFIX + "sql_column_name_prefix";
/**
* The FK name prefix, as a default set to "".
*/
- public static final String SQL_FOREIGN_KEY_NAME_PREFIX = NAMING_PREFIX
- + "sql_fk_name_prefix";
+ public static final String SQL_FOREIGN_KEY_NAME_PREFIX = NAMING_PREFIX + "sql_fk_name_prefix";
/**
* The Index name prefix, as a default set to "".
*/
- public static final String SQL_INDEX_KEY_NAME_PREFIX = NAMING_PREFIX
- + "sql_index_name_prefix";
+ public static final String SQL_INDEX_KEY_NAME_PREFIX = NAMING_PREFIX + "sql_index_name_prefix";
/**
- * Controls if manually set sql names (table name, column names) should also
- * be truncated or cased. Default is true for backward compatability.
+ * Controls if manually set sql names (table name, column names) should also be truncated or
+ * cased. Default is true for backward compatability.
*/
public static final String AUTO_ADAPT_MANUAL_SET_SQL_NAMES = NAMING_PREFIX
+ "auto_adapt_manual_set_sql_names";
@@ -173,8 +167,8 @@ public class PersistenceOptions implements ExtensionPoint {
// ++++++++++++++++++++++++++++++++++++
/**
- * Controls if non-mutable eclasses should have a discriminator or version
- * column. Default is false.
+ * Controls if non-mutable eclasses should have a discriminator or version column. Default is
+ * false.
*
* @Deprecated use the extensionManager concept
*/
@@ -182,8 +176,8 @@ public class PersistenceOptions implements ExtensionPoint {
+ "sql_discriminator_version_immutable_eclass";
/**
- * Controls how the econtainer feature id is persisted. There are three
- * values: featureid or featurename
+ * Controls how the econtainer feature id is persisted. There are three values: featureid or
+ * featurename
*
* @Deprecated use the extensionManager concept
*/
@@ -191,40 +185,33 @@ public class PersistenceOptions implements ExtensionPoint {
+ "econtainer_feature_persistence_strategy";
/**
- * see bugzilla 227673, option can be used to set the hibernate usertype
- * used for xsd date and xsd date time fields.
+ * see bugzilla 227673, option can be used to set the hibernate usertype used for xsd date and xsd
+ * date time fields.
*/
- public static final String USER_XSDDATE_TYPE = MAPPING_PREFIX
- + "UserDateType";
- public static final String USER_XSDDATETIME_TYPE = MAPPING_PREFIX
- + "UserDateTimeType";
- public static final String USER_XSDTIME_TYPE = MAPPING_PREFIX
- + "UserTimeType";
+ public static final String USER_XSDDATE_TYPE = MAPPING_PREFIX + "UserDateType";
+ public static final String USER_XSDDATETIME_TYPE = MAPPING_PREFIX + "UserDateTimeType";
+ public static final String USER_XSDTIME_TYPE = MAPPING_PREFIX + "UserTimeType";
/**
- * This option can be used to control the actual xsd date class used, as a
- * default the javax.xml.datatype.XMLGregorianCalendar class is used.
+ * This option can be used to control the actual xsd date class used, as a default the
+ * javax.xml.datatype.XMLGregorianCalendar class is used.
*/
public static final String XSDDATE_CLASS = MAPPING_PREFIX + "XSDDateClass";
/**
- * The default length of a varchar column. Normally hibernate will choose to
- * set this to 255.
+ * The default length of a varchar column. Normally hibernate will choose to set this to 255.
*/
- public static final String DEFAULT_VARCHAR_LENGTH = MAPPING_PREFIX
- + "default_varchar_length";
+ public static final String DEFAULT_VARCHAR_LENGTH = MAPPING_PREFIX + "default_varchar_length";
/**
- * The maximum length of the comments which are copied from the model to the
- * mapping file. The default is zero which means no comments are copied from
- * the model to the mapping.
+ * The maximum length of the comments which are copied from the model to the mapping file. The
+ * default is zero which means no comments are copied from the model to the mapping.
*/
- public static final String MAX_COMMENT_LENGTH = MAPPING_PREFIX
- + "max_comment_length";
+ public static final String MAX_COMMENT_LENGTH = MAPPING_PREFIX + "max_comment_length";
/**
- * EClass marked with Embeddable is always embedded, default is false. If
- * this is set to true then it is not required anymore to set a
+ * EClass marked with Embeddable is always embedded, default is false. If this is set to true then
+ * it is not required anymore to set a
*
* @Embedded annotation on an ereference,
* @Embeddable on the EClass is then sufficient.
@@ -233,21 +220,17 @@ public class PersistenceOptions implements ExtensionPoint {
+ "map_embeddable_as_embedded";
/** Optimistic locking */
- public static final String OPTIMISTIC = MAPPING_PREFIX
- + "optimistic_locking";
+ public static final String OPTIMISTIC = MAPPING_PREFIX + "optimistic_locking";
/**
- * Add an index for each foreign key mapping. Some databases do not add an
- * index for a foreign key automatically. Setting this to true will
- * automatically add an index field to each foreign key.
+ * Add an index for each foreign key mapping. Some databases do not add an index for a foreign key
+ * automatically. Setting this to true will automatically add an index field to each foreign key.
*/
- public static final String ADD_INDEX_FOR_FOREIGN_KEY = MAPPING_PREFIX
- + "add_index_for_fk";
+ public static final String ADD_INDEX_FOR_FOREIGN_KEY = MAPPING_PREFIX + "add_index_for_fk";
/**
- * Set or not set the cascade attribute on a mto, mtm or otm non-containment
- * relation. The backward compatible value is true. The better performing
- * value is false. The default is false.
+ * Set or not set the cascade attribute on a mto, mtm or otm non-containment relation. The
+ * backward compatible value is true. The better performing value is false. The default is false.
*
* @Deprecated use CASCADE_POLICY_ON_NON_CONTAINMENT
*/
@@ -255,13 +238,11 @@ public class PersistenceOptions implements ExtensionPoint {
+ "set_default_cascade_on_non_containment";
/** Inheritance mapping */
- public static final String INHERITANCE_MAPPING = MAPPING_PREFIX
- + "inheritance";
+ public static final String INHERITANCE_MAPPING = MAPPING_PREFIX + "inheritance";
/**
- * Can be set to force an update of the schema when the application starts.
- * Note this option is only meaningfull for jpox, for hibernate use the
- * hibernate property: hibernate.hbm2ddl_auto
+ * Can be set to force an update of the schema when the application starts. Note this option is
+ * only meaningfull for jpox, for hibernate use the hibernate property: hibernate.hbm2ddl_auto
*/
public static final String UPDATE_SCHEMA = RUNTIME_PREFIX + "update_schema";
@@ -270,10 +251,9 @@ public class PersistenceOptions implements ExtensionPoint {
+ "fetch_containment_eagerly";
/**
- * Force all associations to be extra lazy loaded See here
- * http://sites.google
- * .com/a/pintailconsultingllc.com/java/hibernate-extra-lazy
- * -collection-fetching for some information.
+ * Force all associations to be extra lazy loaded See here http://sites.google
+ * .com/a/pintailconsultingllc.com/java/hibernate-extra-lazy -collection-fetching for some
+ * information.
*
* Default is false.
*/
@@ -290,8 +270,8 @@ public class PersistenceOptions implements ExtensionPoint {
/**
* Can be used to set custom cascade policy for containment : <br>
- * <code>ALL</code> or a combination of (<code>REMOVE</code>,
- * <code>REFRESH</code>, <code>PERSIST</code>, <code>MERGE</code>) <br>
+ * <code>ALL</code> or a combination of (<code>REMOVE</code>, <code>REFRESH</code>,
+ * <code>PERSIST</code>, <code>MERGE</code>) <br>
* e.g. : REMOVE,PERSIST,MERGE <br>
* Warning : ALL != REMOVE,REFRESH,PERSIST,MERGE <br>
* but ALL == REMOVE with delete Orphan, REFRESH,PERSIST,MERGE
@@ -301,44 +281,37 @@ public class PersistenceOptions implements ExtensionPoint {
/**
* Can be used to set custom cascade policy for non containment : <br>
- * a combination of (<code>REFRESH</code>,<code>PERSIST</code>,
- * <code>MERGE</code>) e.g. : PERSIST,MERGE
+ * a combination of (<code>REFRESH</code>,<code>PERSIST</code>, <code>MERGE</code>) e.g. :
+ * PERSIST,MERGE
*/
public static final String CASCADE_POLICY_ON_NON_CONTAINMENT = MAPPING_PREFIX
+ "cascade_policy_on_non_containment";
/**
- * Can be used to control if the entity ann. should be added automatically
- * to the model elements or that the default annotator should work according
- * to the ejb3 spec.
+ * Can be used to control if the entity ann. should be added automatically to the model elements
+ * or that the default annotator should work according to the ejb3 spec.
*/
- public static final String SET_ENTITY_AUTOMATICALLY = MAPPING_PREFIX
- + "set_entity_automatically";
+ public static final String SET_ENTITY_AUTOMATICALLY = MAPPING_PREFIX + "set_entity_automatically";
/**
- * Map all lists as a bag to the db (does not map the list index to the db),
- * default is false
+ * Map all lists as a bag to the db (does not map the list index to the db), default is false
*/
- public static final String ALWAYS_MAP_LIST_AS_BAG = MAPPING_PREFIX
- + "always_map_list_as_bag";
+ public static final String ALWAYS_MAP_LIST_AS_BAG = MAPPING_PREFIX + "always_map_list_as_bag";
/**
- * Map all lists as a hibernate idbag to the db (does not map the list index
- * to the db), default is false
+ * Map all lists as a hibernate idbag to the db (does not map the list index to the db), default
+ * is false
*/
- public static final String MAP_ALL_LISTS_AS_IDBAG = MAPPING_PREFIX
- + "map_all_lists_as_idbag";
+ public static final String MAP_ALL_LISTS_AS_IDBAG = MAPPING_PREFIX + "map_all_lists_as_idbag";
/** Use static hibernate mapping file */
- public static final String USE_MAPPING_FILE = MAPPING_PREFIX
- + "hibernate_mapping_file";
+ public static final String USE_MAPPING_FILE = MAPPING_PREFIX + "hibernate_mapping_file";
/**
- * The complete resource path to the mapping file, can be used instead of
- * the USE_MAPPING_FILE option
+ * The complete resource path to the mapping file, can be used instead of the USE_MAPPING_FILE
+ * option
*/
- public static final String MAPPING_FILE_PATH = MAPPING_PREFIX
- + "mapping_file_name";
+ public static final String MAPPING_FILE_PATH = MAPPING_PREFIX + "mapping_file_name";
/**
* Automatically add @Id to ID feature
@@ -362,145 +335,122 @@ public class PersistenceOptions implements ExtensionPoint {
*
* @id annotation
*/
- public static final String DEFAULT_ID_FEATURE_NAME = NAMING_PREFIX
- + "default_id_feature";
+ public static final String DEFAULT_ID_FEATURE_NAME = NAMING_PREFIX + "default_id_feature";
/**
* The path of the persistence XML file.
*/
- public static final String PERSISTENCE_XML = MAPPING_PREFIX
- + "persistence_xml";
+ public static final String PERSISTENCE_XML = MAPPING_PREFIX + "persistence_xml";
/**
- * Ignore mapping EAnnotations. Primarily meant for test cases that use
- * Persistence XML mapping, so that they can reuse the same sample models.
+ * Ignore mapping EAnnotations. Primarily meant for test cases that use Persistence XML mapping,
+ * so that they can reuse the same sample models.
*/
- public static final String IGNORE_EANNOTATIONS = MAPPING_PREFIX
- + "ignore_eannotations";
+ public static final String IGNORE_EANNOTATIONS = MAPPING_PREFIX + "ignore_eannotations";
/**
- * Map all emaps as true hibernate maps, default is true. In EMF an EMap is
- * in fact an EList with Map entries. Originally Teneo maps this as a
- * hibernate list. In the new behavior hibernate can map the emap as a real
- * map. The default is true.
+ * Map all emaps as true hibernate maps, default is true. In EMF an EMap is in fact an EList with
+ * Map entries. Originally Teneo maps this as a hibernate list. In the new behavior hibernate can
+ * map the emap as a real map. The default is true.
*/
- public static final String EMAP_AS_TRUE_MAP = MAPPING_PREFIX
- + "emap_as_true_map";
+ public static final String EMAP_AS_TRUE_MAP = MAPPING_PREFIX + "emap_as_true_map";
/**
- * This option controls if in case of hibernate also a name attribute should
- * be added to the class/subclass tag. By adding this a class is mapped as
- * an entity as well as a normal class. Also mapping as a normal class has
- * the advantage that proxies can be used and that queries can use actual
- * class names and interface names. This option is really there for backward
- * compatibility. There are no apparent dis-advantages of adding a name
- * attribute so the default of this option is true. Note that an eclass must
- * have an implementation class otherwise this option has no effect.
- * Interfaces are for example always mapped as an entity.
+ * This option controls if in case of hibernate also a name attribute should be added to the
+ * class/subclass tag. By adding this a class is mapped as an entity as well as a normal class.
+ * Also mapping as a normal class has the advantage that proxies can be used and that queries can
+ * use actual class names and interface names. This option is really there for backward
+ * compatibility. There are no apparent dis-advantages of adding a name attribute so the default
+ * of this option is true. Note that an eclass must have an implementation class otherwise this
+ * option has no effect. Interfaces are for example always mapped as an entity.
*/
- public static final String ALSO_MAP_AS_CLASS = MAPPING_PREFIX
- + "also_map_as_class";
+ public static final String ALSO_MAP_AS_CLASS = MAPPING_PREFIX + "also_map_as_class";
/**
- * This option controls if as a default all classes should be proxied (for
- * hibernate). This means that you don't need to add a
+ * This option controls if as a default all classes should be proxied (for hibernate). This means
+ * that you don't need to add a
*
- * @Proxy annotation to each eclass. As a default Teneo will use the eclass
- * interface as the proxy class. When this is set to true then the
- * option ALSO_MAP_AS_CLASS should also be true.
+ * @Proxy annotation to each eclass. As a default Teneo will use the eclass interface as the proxy
+ * class. When this is set to true then the option ALSO_MAP_AS_CLASS should also be true.
*/
public static final String SET_PROXY = MAPPING_PREFIX + "set_proxy";
/**
- * This option forces lazy=true without the proxy attribute in the hibernate
- * mapping.
+ * This option forces lazy=true without the proxy attribute in the hibernate mapping.
*/
public static final String FORCE_LAZY = MAPPING_PREFIX + "force_lazy";
/**
* Disable EContainer mapping.
*/
- public static final String DISABLE_ECONTAINER_MAPPING = MAPPING_PREFIX
- + "disable_econtainer";
+ public static final String DISABLE_ECONTAINER_MAPPING = MAPPING_PREFIX + "disable_econtainer";
/**
- * Option to specify that for non-contained one-to-many always a join table
- * is used, default is true
+ * Option to specify that for non-contained one-to-many always a join table is used, default is
+ * true
*/
public static final String JOIN_TABLE_FOR_NON_CONTAINED_ASSOCIATIONS = MAPPING_PREFIX
+ "join_table_for_non_contained_associations";
/**
- * Determines whether to always include a version mapping even if one is not
- * specified. Defaults to "true"
+ * Determines whether to always include a version mapping even if one is not specified. Defaults
+ * to "true"
*/
- public static final String ALWAYS_VERSION = MAPPING_PREFIX
- + "always_version";
+ public static final String ALWAYS_VERSION = MAPPING_PREFIX + "always_version";
/**
- * The default cache strategy, can be one of: NONE, READ_ONLY,
- * NONSTRICT_READ_ONLY, READ_WRITE, TRANSACTIONAl. If different than NONE
- * (=default) then for Hibernate every class will be second-level cached!
+ * The default cache strategy, can be one of: NONE, READ_ONLY, NONSTRICT_READ_ONLY, READ_WRITE,
+ * TRANSACTIONAl. If different than NONE (=default) then for Hibernate every class will be
+ * second-level cached!
*/
- public static final String DEFAULT_CACHE_STRATEGY = MAPPING_PREFIX
- + "default_cache_strategy";
+ public static final String DEFAULT_CACHE_STRATEGY = MAPPING_PREFIX + "default_cache_strategy";
/** The default time/date type used */
- public static final String DEFAULT_TEMPORAL_VALUE = MAPPING_PREFIX
- + "default_temporal";
+ public static final String DEFAULT_TEMPORAL_VALUE = MAPPING_PREFIX + "default_temporal";
/**
- * If true then EAttributes which are not set are stored as null in the
- * database, if false then the default values is stored in the database.
+ * If true then EAttributes which are not set are stored as null in the database, if false then
+ * the default values is stored in the database.
*/
- public static final String HANDLE_UNSET_AS_NULL = RUNTIME_PREFIX
- + "handle_unset_as_null";
+ public static final String HANDLE_UNSET_AS_NULL = RUNTIME_PREFIX + "handle_unset_as_null";
/**
- * When an unset feature is persisted, the database will get a null value,
- * default is false.
+ * When an unset feature is persisted, the database will get a null value, default is false.
*/
- public static final String CONVERT_UNSET_TO_NULL = RUNTIME_PREFIX
- + "convert_unset_to_null";
+ public static final String CONVERT_UNSET_TO_NULL = RUNTIME_PREFIX + "convert_unset_to_null";
/**
* If set to true then the document root is also mapped.
*/
- public static final String MAP_DOCUMENT_ROOT = MAPPING_PREFIX
- + "map_document_root";
+ public static final String MAP_DOCUMENT_ROOT = MAPPING_PREFIX + "map_document_root";
/**
- * If set to true then the system will automatically add referenced
- * epackages
+ * If set to true then the system will automatically add referenced epackages
*/
public static final String AUTO_ADD_REFERENCED_EPACKAGES = MAPPING_PREFIX
+ "auto_add_referenced_epackages";
/**
- * If set to true then the system will map all eclasses as an EAV mapping.
- * See http://www.elver.org/hibernate/eav_mapping.html
+ * If set to true then the system will map all eclasses as an EAV mapping. See
+ * http://www.elver.org/hibernate/eav_mapping.html
*/
public static final String EAV_MAPPING = MAPPING_PREFIX + "eav_mapping";
/**
- * If set then the eav mapping file is read from the location defined by
- * this property.
+ * If set then the eav mapping file is read from the location defined by this property.
*/
- public static final String EAV_MAPPING_FILE = MAPPING_PREFIX
- + "eav_location";
+ public static final String EAV_MAPPING_FILE = MAPPING_PREFIX + "eav_location";
/**
* Map the FeatureMap as a component entity
*/
- public static final String FEATUREMAP_AS_COMPONENT = MAPPING_PREFIX
- + "featuremap_as_component";
+ public static final String FEATUREMAP_AS_COMPONENT = MAPPING_PREFIX + "featuremap_as_component";
/**
- * Additional sources which are taken into account parsing model
- * annotations. The value can be a comma delimited list of source values.
+ * Additional sources which are taken into account parsing model annotations. The value can be a
+ * comma delimited list of source values.
*/
- public static final String EXTRA_ANNOTATION_SOURCES = MAPPING_PREFIX
- + "extra_annotation_sources";
+ public static final String EXTRA_ANNOTATION_SOURCES = MAPPING_PREFIX + "extra_annotation_sources";
public final static String ECONTAINER_CLASS_COLUMN = "econtainer_class_column";
public final static String ECONTAINER_COLUMN = "e_container_column";
@@ -509,6 +459,11 @@ public class PersistenceOptions implements ExtensionPoint {
/** Returns the default properties used in the system */
public static Properties getDefaultProperties() {
final Properties props = new Properties();
+
+ props.setProperty(ENABLE_AUDITING, "false");
+ props.setProperty(AUDITING_ENTITY_PREFIX, "");
+ props.setProperty(AUDITING_ENTITY_POSTFIX, "Auditing");
+
props.setProperty(HANDLE_UNSET_AS_NULL, "false");
props.setProperty(CONVERT_UNSET_TO_NULL, "false");
props.setProperty(JOIN_TABLE_FOR_NON_CONTAINED_ASSOCIATIONS, "true");
@@ -553,17 +508,12 @@ public class PersistenceOptions implements ExtensionPoint {
props.setProperty(MAX_COMMENT_LENGTH, "0");
props.setProperty(DEFAULT_VARCHAR_LENGTH, "-1");
props.setProperty(SQL_NAME_ESCAPE_CHARACTER, "`");
- props.setProperty(USER_XSDDATE_TYPE,
- "org.eclipse.emf.teneo.hibernate.mapping.XSDDate");
- props.setProperty(USER_XSDDATETIME_TYPE,
- "org.eclipse.emf.teneo.hibernate.mapping.XSDDateTime");
- props.setProperty(USER_XSDTIME_TYPE,
- "org.eclipse.emf.teneo.hibernate.mapping.XSDDateTime");
- props.setProperty(XSDDATE_CLASS,
- "javax.xml.datatype.XMLGregorianCalendar");
+ props.setProperty(USER_XSDDATE_TYPE, "org.eclipse.emf.teneo.hibernate.mapping.XSDDate");
+ props.setProperty(USER_XSDDATETIME_TYPE, "org.eclipse.emf.teneo.hibernate.mapping.XSDDateTime");
+ props.setProperty(USER_XSDTIME_TYPE, "org.eclipse.emf.teneo.hibernate.mapping.XSDDateTime");
+ props.setProperty(XSDDATE_CLASS, "javax.xml.datatype.XMLGregorianCalendar");
props.setProperty(SQL_DISCRIMINATOR_VERSION_IMMUTABLE_ECLASS, "true");
- props.setProperty(ECONTAINER_FEATURE_PERSISTENCE_STRATEGY,
- "FEATURENAME");
+ props.setProperty(ECONTAINER_FEATURE_PERSISTENCE_STRATEGY, "FEATURENAME");
props.setProperty(SQL_TABLE_NAME_PREFIX, "");
props.setProperty(SQL_COLUMN_NAME_PREFIX, "");
props.setProperty(SQL_FOREIGN_KEY_NAME_PREFIX, "");
@@ -571,11 +521,9 @@ public class PersistenceOptions implements ExtensionPoint {
props.setProperty(MAP_DOCUMENT_ROOT, "false");
props.setProperty(EAV_MAPPING, "false");
props.setProperty(AUTO_ADD_REFERENCED_EPACKAGES, "false");
- props.setProperty(ECONTAINER_CLASS_COLUMN,
- Constants.COLUMN_ECONTAINER_CLASS);
+ props.setProperty(ECONTAINER_CLASS_COLUMN, Constants.COLUMN_ECONTAINER_CLASS);
props.setProperty(ECONTAINER_COLUMN, Constants.COLUMN_ECONTAINER);
- props.setProperty(ECONTAINER_FEATURE_NAME_COLUMN,
- Constants.COLUMN_ECONTAINER_FEATURE_NAME);
+ props.setProperty(ECONTAINER_FEATURE_NAME_COLUMN, Constants.COLUMN_ECONTAINER_FEATURE_NAME);
props.setProperty(FEATUREMAP_AS_COMPONENT, "false");
props.setProperty(EXTRA_ANNOTATION_SOURCES, "");
props.setProperty(AUTO_ADAPT_MANUAL_SET_SQL_NAMES, "true");
@@ -589,6 +537,27 @@ public class PersistenceOptions implements ExtensionPoint {
private final Properties properties;
/**
+ * @return value of {@link #ENABLE_AUDITING}
+ */
+ public boolean isEnableAuditing() {
+ return Boolean.valueOf(properties.getProperty(ENABLE_AUDITING)).booleanValue();
+ }
+
+ /**
+ * @return value of {@link #AUDITING_ENTITY_PREFIX}
+ */
+ public String getAuditingEntityPrefix() {
+ return properties.getProperty(AUDITING_ENTITY_PREFIX);
+ }
+
+ /**
+ * @return value of {@link #AUDITING_ENTITY_POSTFIX}
+ */
+ public String getAuditingEntityPostfix() {
+ return properties.getProperty(AUDITING_ENTITY_POSTFIX);
+ }
+
+ /**
* @return value of {@link #DISCRIMINATOR_COLUMN_NAME}
*/
public String getDiscriminatorColumnName() {
@@ -606,17 +575,14 @@ public class PersistenceOptions implements ExtensionPoint {
* @return value of {@link #FEATUREMAP_AS_COMPONENT}
*/
public boolean isMapFeatureMapAsComponent() {
- return Boolean.valueOf(properties.getProperty(FEATUREMAP_AS_COMPONENT))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(FEATUREMAP_AS_COMPONENT)).booleanValue();
}
/**
* @return value of {@link AUTO_ADAPT_MANUAL_SET_SQL_NAMES}
*/
public boolean isAutoAdaptManualSQLNames() {
- return Boolean.valueOf(
- properties.getProperty(AUTO_ADAPT_MANUAL_SET_SQL_NAMES))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(AUTO_ADAPT_MANUAL_SET_SQL_NAMES)).booleanValue();
}
/**
@@ -644,8 +610,7 @@ public class PersistenceOptions implements ExtensionPoint {
* @return value of {@link #EAV_MAPPING}
*/
public boolean isEAVMapping() {
- return Boolean.valueOf(properties.getProperty(EAV_MAPPING))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(EAV_MAPPING)).booleanValue();
}
/**
@@ -659,33 +624,28 @@ public class PersistenceOptions implements ExtensionPoint {
* @return value of {@link #AUTO_ADD_REFERENCED_EPACKAGES}
*/
public boolean isAutoAddReferencedEPackages() {
- return Boolean.valueOf(
- properties.getProperty(AUTO_ADD_REFERENCED_EPACKAGES))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(AUTO_ADD_REFERENCED_EPACKAGES)).booleanValue();
}
/**
* @return value of {@link #MAP_DOCUMENT_ROOT}
*/
public boolean isMapDocumentRoot() {
- return Boolean.valueOf(properties.getProperty(MAP_DOCUMENT_ROOT))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(MAP_DOCUMENT_ROOT)).booleanValue();
}
/**
* @return value of the {@link #HANDLE_UNSET_AS_NULL} option
*/
public boolean getHandleUnsetAsNull() {
- return Boolean.valueOf(properties.getProperty(HANDLE_UNSET_AS_NULL))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(HANDLE_UNSET_AS_NULL)).booleanValue();
}
/**
* @return value of the {@link #CONVERT_UNSET_TO_NULL} option
*/
public boolean getConvertUnsetToNull() {
- return Boolean.valueOf(properties.getProperty(CONVERT_UNSET_TO_NULL))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(CONVERT_UNSET_TO_NULL)).booleanValue();
}
/**
@@ -702,8 +662,8 @@ public class PersistenceOptions implements ExtensionPoint {
}
/**
- * Constructs a new instance by loading properties from
- * "/elver-persistence.properties" at the root of the classpath.
+ * Constructs a new instance by loading properties from "/elver-persistence.properties" at the
+ * root of the classpath.
*/
public PersistenceOptions() {
this.properties = getDefaultProperties();
@@ -711,19 +671,17 @@ public class PersistenceOptions implements ExtensionPoint {
final Properties props = new Properties();
InputStream in = null;
try {
- in = this.getClass()
- .getResourceAsStream(DEFAULT_CLASSPATH_FILENAME);
+ in = this.getClass().getResourceAsStream(DEFAULT_CLASSPATH_FILENAME);
if (in != null) {
if (log.isDebugEnabled()) {
- log.debug("Loading persistence options from classpath \""
- + DEFAULT_CLASSPATH_FILENAME + "\".");
+ log.debug("Loading persistence options from classpath \"" + DEFAULT_CLASSPATH_FILENAME
+ + "\".");
}
props.load(in);
}
} catch (IOException e) {
- throw new RuntimeException("Error loading \""
- + DEFAULT_CLASSPATH_FILENAME + "\" from classpath:"
- + e.getMessage(), e);
+ throw new RuntimeException("Error loading \"" + DEFAULT_CLASSPATH_FILENAME
+ + "\" from classpath:" + e.getMessage(), e);
} finally {
try {
if (in != null) {
@@ -772,35 +730,29 @@ public class PersistenceOptions implements ExtensionPoint {
/** Return the IDBAG_ID_COLUMN_NAME */
public String getIDBagIDColumnName() {
- return getSQLColumnNamePrefix()
- + properties.getProperty(IDBAG_ID_COLUMN_NAME);
+ return getSQLColumnNamePrefix() + properties.getProperty(IDBAG_ID_COLUMN_NAME);
}
/**
* Returns the value of the EMAP_AS_TRUE_MAP option, default is false
*/
public boolean isMapEMapAsTrueMap() {
- return Boolean.valueOf(properties.getProperty(EMAP_AS_TRUE_MAP))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(EMAP_AS_TRUE_MAP)).booleanValue();
}
/**
- * Returns the value of the SET_DEFAULT_CASCADE_ON_MTO_MTM option, default
- * is false
+ * Returns the value of the SET_DEFAULT_CASCADE_ON_MTO_MTM option, default is false
*/
public boolean isSetDefaultCascadeOnNonContainment() {
- String property = properties
- .getProperty(SET_DEFAULT_CASCADE_ON_NON_CONTAINMENT);
+ String property = properties.getProperty(SET_DEFAULT_CASCADE_ON_NON_CONTAINMENT);
if (!property.equals("")) {
return Boolean.valueOf(property).booleanValue();
}
- return !properties.getProperty(CASCADE_POLICY_ON_NON_CONTAINMENT)
- .equals("");
+ return !properties.getProperty(CASCADE_POLICY_ON_NON_CONTAINMENT).equals("");
}
public boolean isSetCascadePolicyForNonContainment() {
- return !properties.getProperty(CASCADE_POLICY_ON_NON_CONTAINMENT)
- .equals("");
+ return !properties.getProperty(CASCADE_POLICY_ON_NON_CONTAINMENT).equals("");
}
public String getCascadePolicyForContainment() {
@@ -812,121 +764,100 @@ public class PersistenceOptions implements ExtensionPoint {
}
/**
- * Returns true if the CASCADE_POLICY_ON_NON_CONTAINMENT property contains
- * the merge cascade type
+ * Returns true if the CASCADE_POLICY_ON_NON_CONTAINMENT property contains the merge cascade type
*/
public boolean isSetCascadeMergeOnNonContainment() {
return isSetCascadeOnNonContainement(CascadeType.MERGE.getName());
}
/**
- * Returns true if the CASCADE_POLICY_ON_NON_CONTAINMENT property contains
- * the persist cascade type
+ * Returns true if the CASCADE_POLICY_ON_NON_CONTAINMENT property contains the persist cascade
+ * type
*/
public boolean isSetCascadePersistOnNonContainment() {
return isSetCascadeOnNonContainement(CascadeType.PERSIST.getName());
}
/**
- * Returns true if the CASCADE_POLICY_ON_NON_CONTAINMENT property contains
- * the refresh cascade type
+ * Returns true if the CASCADE_POLICY_ON_NON_CONTAINMENT property contains the refresh cascade
+ * type
*/
public boolean isSetCascadeRefreshOnNonContainment() {
return isSetCascadeOnNonContainement(CascadeType.REFRESH.getName());
}
/**
- * Returns true if the CASCADE_POLICY_ON_NON_CONTAINMENT property contains
- * the given cascade type
+ * Returns true if the CASCADE_POLICY_ON_NON_CONTAINMENT property contains the given cascade type
*/
private boolean isSetCascadeOnNonContainement(String cascadeType) {
- return isSetCascade(
- properties.getProperty(CASCADE_POLICY_ON_NON_CONTAINMENT),
- cascadeType);
+ return isSetCascade(properties.getProperty(CASCADE_POLICY_ON_NON_CONTAINMENT), cascadeType);
}
/**
* Returns the value of the SET_FOREIGN_KEY_NAME option, default is true
*/
public boolean isSetForeignKeyNames() {
- return Boolean.valueOf(properties.getProperty(SET_FOREIGN_KEY_NAME))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(SET_FOREIGN_KEY_NAME)).booleanValue();
}
/**
* Returns the value of the ALSO_MAP_AS_CLASS option, default is false
*/
public boolean isAlsoMapAsClass() {
- return Boolean.valueOf(properties.getProperty(ALSO_MAP_AS_CLASS))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(ALSO_MAP_AS_CLASS)).booleanValue();
}
/**
- * Returns the value of the MAP_EMBEDDABLE_AS_EMBEDDED option, default is
- * false
+ * Returns the value of the MAP_EMBEDDABLE_AS_EMBEDDED option, default is false
*/
public boolean isMapEmbeddableAsEmbedded() {
- return Boolean.valueOf(
- properties.getProperty(MAP_EMBEDDABLE_AS_EMBEDDED))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(MAP_EMBEDDABLE_AS_EMBEDDED)).booleanValue();
}
/**
* Returns true if the proxy annotation should be added automatically
*/
public boolean isSetProxy() {
- return Boolean.valueOf(properties.getProperty(SET_PROXY))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(SET_PROXY)).booleanValue();
}
/**
- * Returns true if the lazy attribute should be forced to true in the hbm
- * mapping.
+ * Returns true if the lazy attribute should be forced to true in the hbm mapping.
*/
public boolean isForceLazy() {
- return Boolean.valueOf(properties.getProperty(FORCE_LAZY))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(FORCE_LAZY)).booleanValue();
}
/**
* Returns the value of the ALWAYS_MAP_LIST_AS_BAG option, default is false
*/
public boolean alwaysMapListAsBag() {
- return Boolean.valueOf(properties.getProperty(ALWAYS_MAP_LIST_AS_BAG))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(ALWAYS_MAP_LIST_AS_BAG)).booleanValue();
}
/**
* Returns the value of the MAP_ALL_LISTS_AS_IDBAG option, default is false
*/
public boolean alwaysMapListAsIdBag() {
- return Boolean.valueOf(properties.getProperty(MAP_ALL_LISTS_AS_IDBAG))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(MAP_ALL_LISTS_AS_IDBAG)).booleanValue();
}
/** Returns the value of the ADD_INDEX_FOR_FOREIGN_KEY option */
public boolean isAddIndexForForeignKey() {
- return Boolean.valueOf(
- properties.getProperty(ADD_INDEX_FOR_FOREIGN_KEY))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(ADD_INDEX_FOR_FOREIGN_KEY)).booleanValue();
}
/**
- * Returns the value of the UseJoinTableForNonContainedAssociations option,
- * default is false
+ * Returns the value of the UseJoinTableForNonContainedAssociations option, default is false
*/
public boolean isJoinTableForNonContainedAssociations() {
- return Boolean
- .valueOf(
- properties
- .getProperty(JOIN_TABLE_FOR_NON_CONTAINED_ASSOCIATIONS))
+ return Boolean.valueOf(properties.getProperty(JOIN_TABLE_FOR_NON_CONTAINED_ASSOCIATIONS))
.booleanValue();
}
/** Returns the value of the UseMappingFile option, default is false */
public boolean isUseMappingFile() {
- return Boolean.valueOf(properties.getProperty(USE_MAPPING_FILE))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(USE_MAPPING_FILE)).booleanValue();
}
/** Returns the value of the MAPPING_FILE_PATH option, default is "" */
@@ -936,107 +867,86 @@ public class PersistenceOptions implements ExtensionPoint {
/** Returns the value of the id feature as primary key */
public boolean isIDFeatureAsPrimaryKey() {
- return Boolean.valueOf(
- properties.getProperty(ID_FEATURE_AS_PRIMARY_KEY))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(ID_FEATURE_AS_PRIMARY_KEY)).booleanValue();
}
/** Returns the value of the SET_GENERATED_VALUE_ON_ID_FEATURE option */
public boolean isSetGeneratedValueOnIDFeature() {
- return Boolean.valueOf(
- properties.getProperty(SET_GENERATED_VALUE_ON_ID_FEATURE))
+ return Boolean.valueOf(properties.getProperty(SET_GENERATED_VALUE_ON_ID_FEATURE))
.booleanValue();
}
/** Returns the value of the orphan delete on containment, default is true */
public boolean isSetCascadeAllOnContainment() {
if (!properties.getProperty(SET_CASCADE_ALL_ON_CONTAINMENT).equals("")) {
- return Boolean.valueOf(
- properties.getProperty(SET_CASCADE_ALL_ON_CONTAINMENT))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(SET_CASCADE_ALL_ON_CONTAINMENT)).booleanValue();
}
return isSetCascadeOnContainement(CascadeType.ALL.getName());
}
/**
- * Returns true if CASCADE_POLICY_ON_CONTAINMENT property contains the MERGE
- * cascade type
+ * Returns true if CASCADE_POLICY_ON_CONTAINMENT property contains the MERGE cascade type
*/
public boolean isSetCascadeMergeOnContainment() {
return isSetCascadeOnContainement(CascadeType.MERGE.getName());
}
/**
- * Returns true if CASCADE_POLICY_ON_CONTAINMENT property contains the
- * PERSIST cascade type
+ * Returns true if CASCADE_POLICY_ON_CONTAINMENT property contains the PERSIST cascade type
*/
public boolean isSetCascadePersistOnContainment() {
return isSetCascadeOnContainement(CascadeType.PERSIST.getName());
}
/**
- * Returns true if CASCADE_POLICY_ON_CONTAINMENT property contains the
- * REMOVE cascade type
+ * Returns true if CASCADE_POLICY_ON_CONTAINMENT property contains the REMOVE cascade type
*/
public boolean isSetCascadeRemoveOnContainment() {
return isSetCascadeOnContainement(CascadeType.REMOVE.getName());
}
/**
- * Returns true if CASCADE_POLICY_ON_CONTAINMENT property contains the
- * REFRESH cascade type
+ * Returns true if CASCADE_POLICY_ON_CONTAINMENT property contains the REFRESH cascade type
*/
public boolean isSetCascadeRefreshOnContainment() {
return isSetCascadeOnContainement(CascadeType.REFRESH.getName());
}
/**
- * Returns true if CASCADE_POLICY_ON_CONTAINMENT property contains the given
- * cascade type
+ * Returns true if CASCADE_POLICY_ON_CONTAINMENT property contains the given cascade type
*/
private boolean isSetCascadeOnContainement(String cascadeType) {
- return isSetCascade(
- properties.getProperty(CASCADE_POLICY_ON_CONTAINMENT),
- cascadeType);
+ return isSetCascade(properties.getProperty(CASCADE_POLICY_ON_CONTAINMENT), cascadeType);
}
/** Returns true if property contains the given cascade type */
private boolean isSetCascade(String property, String cascadeType) {
- return Pattern.matches(".*\\b" + cascadeType.toUpperCase() + "\\b.*",
- property.toUpperCase());
+ return Pattern.matches(".*\\b" + cascadeType.toUpperCase() + "\\b.*", property.toUpperCase());
}
/** Returns the value of the Optimistic option, default is true */
public boolean isUseOptimisticLocking() {
- return Boolean.valueOf(properties.getProperty(OPTIMISTIC))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(OPTIMISTIC)).booleanValue();
}
/** Returns the value of the UpdateSchema option, default is true */
public boolean isUpdateSchema() {
- return Boolean.valueOf(properties.getProperty(UPDATE_SCHEMA))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(UPDATE_SCHEMA)).booleanValue();
}
/** Returns the value of the fetch containment eagerly, default is false */
public boolean isFetchContainmentEagerly() {
- return Boolean.valueOf(
- properties.getProperty(FETCH_CONTAINMENT_EAGERLY))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(FETCH_CONTAINMENT_EAGERLY)).booleanValue();
}
/** Returns the value of the fetch extra lazy option, default is false */
public boolean isFetchAssociationExtraLazy() {
- return Boolean.valueOf(
- properties.getProperty(FETCH_ASSOCIATION_EXTRA_LAZY))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(FETCH_ASSOCIATION_EXTRA_LAZY)).booleanValue();
}
/** Is set entity automatically, default is true */
public boolean isSetEntityAutomatically() {
- return Boolean
- .valueOf(properties.getProperty(SET_ENTITY_AUTOMATICALLY))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(SET_ENTITY_AUTOMATICALLY)).booleanValue();
}
/** Returns the inheritance mapping strategy, can be null */
@@ -1046,8 +956,7 @@ public class PersistenceOptions implements ExtensionPoint {
/** Returns the value of the version column option, returns null if not set */
public String getVersionColumnName() {
- return getSQLColumnNamePrefix()
- + properties.getProperty(VERSION_COLUMN_NAME);
+ return getSQLColumnNamePrefix() + properties.getProperty(VERSION_COLUMN_NAME);
}
/** Returns the value of the naming strategy, default is lower case */
@@ -1057,8 +966,7 @@ public class PersistenceOptions implements ExtensionPoint {
/** Returns the value of the id column option, returns null if not set */
public String getIdColumnName() {
- return getSQLColumnNamePrefix()
- + properties.getProperty(ID_COLUMN_NAME);
+ return getSQLColumnNamePrefix() + properties.getProperty(ID_COLUMN_NAME);
}
/** Returns the value of the default id property */
@@ -1074,8 +982,7 @@ public class PersistenceOptions implements ExtensionPoint {
/** Returns the value of the join table naming strategy */
public String getJoinTableNamingStrategy() {
if (properties.get(JOIN_TABLE_NAMING_STRATEGY_OLD) != null) {
- log.warn("The option " + JOIN_TABLE_NAMING_STRATEGY_OLD
- + " is deprecated, please use: "
+ log.warn("The option " + JOIN_TABLE_NAMING_STRATEGY_OLD + " is deprecated, please use: "
+ JOIN_TABLE_NAMING_STRATEGY);
return properties.getProperty(JOIN_TABLE_NAMING_STRATEGY);
}
@@ -1088,8 +995,8 @@ public class PersistenceOptions implements ExtensionPoint {
}
/**
- * Returns the default second level caching strategy, default value is NONE
- * (no second level caching).
+ * Returns the default second level caching strategy, default value is NONE (no second level
+ * caching).
*/
public String getDefaultCacheStrategy() {
return properties.getProperty(DEFAULT_CACHE_STRATEGY);
@@ -1102,9 +1009,7 @@ public class PersistenceOptions implements ExtensionPoint {
/** Are econtainer mappings (hibernate) disabled */
public boolean isDisableEContainerMapping() {
- return Boolean.valueOf(
- properties.getProperty(DISABLE_ECONTAINER_MAPPING))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(DISABLE_ECONTAINER_MAPPING)).booleanValue();
}
/** Return the value of the MAX_COMMENT_LENGTH */
@@ -1114,8 +1019,7 @@ public class PersistenceOptions implements ExtensionPoint {
final int maxLength = Integer.parseInt(colLength);
return maxLength;
} catch (NumberFormatException e) {
- log.error("Property " + MAXIMUM_SQL_NAME_LENGTH
- + " as a non-integer value: " + colLength
+ log.error("Property " + MAXIMUM_SQL_NAME_LENGTH + " as a non-integer value: " + colLength
+ " value is ignored");
return 0;
}
@@ -1123,44 +1027,37 @@ public class PersistenceOptions implements ExtensionPoint {
/** Return the max. sql name length, or -1 if not set or illegal */
public int getMaximumSqlNameLength() {
- final String colLength = properties
- .getProperty(MAXIMUM_SQL_NAME_LENGTH);
+ final String colLength = properties.getProperty(MAXIMUM_SQL_NAME_LENGTH);
try {
final int maxLength = Integer.parseInt(colLength);
if (maxLength == 0) {
- throw new TeneoException(
- "The option MAXIMUM_SQL_NAME_LENGTH has a value of zero. "
- + "This will result in empty column and table names in the mapping! "
- + "Please change this option to a more usable value.");
+ throw new TeneoException("The option MAXIMUM_SQL_NAME_LENGTH has a value of zero. "
+ + "This will result in empty column and table names in the mapping! "
+ + "Please change this option to a more usable value.");
}
if (maxLength < 4 && maxLength > -1) {
- log.warn("The option MAXIMUM_SQL_NAME_LENGTH has a low value: "
- + maxLength + ". Are you sure this is correct?");
+ log.warn("The option MAXIMUM_SQL_NAME_LENGTH has a low value: " + maxLength
+ + ". Are you sure this is correct?");
}
return maxLength;
} catch (NumberFormatException e) {
- log.error("Property " + MAXIMUM_SQL_NAME_LENGTH
- + " as a non-integer value: " + colLength
+ log.error("Property " + MAXIMUM_SQL_NAME_LENGTH + " as a non-integer value: " + colLength
+ " value is ignored");
return -1;
}
}
/**
- * Returns the value of the SQL_DISCRIMINATOR_VERSION_IMMUTABLE_ECLASS
- * option.
+ * Returns the value of the SQL_DISCRIMINATOR_VERSION_IMMUTABLE_ECLASS option.
*/
public Boolean isDiscriminatorVersionOnImmutableEClass() {
- return Boolean
- .valueOf(
- properties
- .getProperty(SQL_DISCRIMINATOR_VERSION_IMMUTABLE_ECLASS))
+ return Boolean.valueOf(properties.getProperty(SQL_DISCRIMINATOR_VERSION_IMMUTABLE_ECLASS))
.booleanValue();
}
/**
- * Returns the path of the XML persistence mapping file or null if the
- * property has not been defined.
+ * Returns the path of the XML persistence mapping file or null if the property has not been
+ * defined.
*/
public String getPersistenceXmlPath() {
return properties.getProperty(PERSISTENCE_XML);
@@ -1170,8 +1067,7 @@ public class PersistenceOptions implements ExtensionPoint {
* Returns a boolean indication whether to ignore mapping EAnnotations.
*/
public boolean isIgnoreEAnnotations() {
- return Boolean.valueOf(properties.getProperty(IGNORE_EANNOTATIONS))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(IGNORE_EANNOTATIONS)).booleanValue();
}
/**
@@ -1183,8 +1079,7 @@ public class PersistenceOptions implements ExtensionPoint {
final List<String> names = new ArrayList<String>();
for (Field field : PersistenceOptions.class.getFields()) {
try {
- if ((field.getModifiers() & Modifier.STATIC) > 0
- & field.getType().equals(String.class)) {
+ if ((field.getModifiers() & Modifier.STATIC) > 0 & field.getType().equals(String.class)) {
final String value = (String) field.get(null);
if (value.startsWith("teneo.")) {
names.add(value);
@@ -1198,8 +1093,7 @@ public class PersistenceOptions implements ExtensionPoint {
}
public boolean getAlwaysVersion() {
- return Boolean.valueOf(properties.getProperty(ALWAYS_VERSION))
- .booleanValue();
+ return Boolean.valueOf(properties.getProperty(ALWAYS_VERSION)).booleanValue();
}
/**
@@ -1235,8 +1129,7 @@ public class PersistenceOptions implements ExtensionPoint {
}
public EContainerFeaturePersistenceStrategy getEContainerFeaturePersistenceStrategy() {
- String strategy = properties
- .getProperty(ECONTAINER_FEATURE_PERSISTENCE_STRATEGY);
+ String strategy = properties.getProperty(ECONTAINER_FEATURE_PERSISTENCE_STRATEGY);
if (strategy == null) {
throw new TeneoException(
"Option ECONTAINER_FEATURE_PERSISTENCE_STRATEGY not set, please set it to one of: featureid, featurename, both");
@@ -1244,10 +1137,8 @@ public class PersistenceOptions implements ExtensionPoint {
EContainerFeaturePersistenceStrategy result = EContainerFeaturePersistenceStrategy
.valueOf(strategy.toUpperCase());
if (result == null) {
- throw new TeneoException(
- "Option ECONTAINER_FEATURE_PERSISTENCE_STRATEGY not set correctly ("
- + strategy
- + "), please set it to one of: featureid, featurename, both");
+ throw new TeneoException("Option ECONTAINER_FEATURE_PERSISTENCE_STRATEGY not set correctly ("
+ + strategy + "), please set it to one of: featureid, featurename, both");
}
return result;
}

Back to the top