Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtaal2007-07-18 12:11:21 -0400
committermtaal2007-07-18 12:11:21 -0400
commit129234e0e3f9435a55297750604a32c143818603 (patch)
tree9ca32ca107eb209031f472d6448df33338fe3703
parent4559e426efcfeeaebd93385b477b893f983c6958 (diff)
downloadorg.eclipse.emf.teneo-129234e0e3f9435a55297750604a32c143818603.tar.gz
org.eclipse.emf.teneo-129234e0e3f9435a55297750604a32c143818603.tar.xz
org.eclipse.emf.teneo-129234e0e3f9435a55297750604a32c143818603.zip
[196951]
[196839]
-rw-r--r--doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/extensions.html270
-rw-r--r--doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/gmftutorial/teneo.mindmap2
-rw-r--r--doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/options.html8
-rw-r--r--doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/resource_utility.xml2
-rw-r--r--doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/samples/Dynamic.java4
-rw-r--r--doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/samples/QuickStart.java4
-rw-r--r--doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/samples/Tutorial1.java4
-rw-r--r--doc/org.eclipse.emf.teneo.doc/tutorials/jpox/extensions.html214
-rw-r--r--doc/org.eclipse.emf.teneo.doc/tutorials/jpox/tutorial1/Tutorial1.java4
-rw-r--r--doc/org.eclipse.emf.teneo.doc/tutorials/skin/inst.css2
-rw-r--r--doc/org.eclipse.emf.teneo.doc/tutorials/skin/ns4_only.css2
-rw-r--r--doc/org.eclipse.emf.teneo.doc/tutorials/skin/print.css2
-rw-r--r--doc/org.eclipse.emf.teneo.doc/tutorials/skin/tigris.css2
13 files changed, 369 insertions, 151 deletions
diff --git a/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/extensions.html b/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/extensions.html
index 624693052..1a8bd8fa8 100644
--- a/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/extensions.html
+++ b/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/extensions.html
@@ -292,10 +292,24 @@
</a>
</li>
<li>
-<a href="#SqlNameStrategy+ExtensionPoint+%28org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy%29">SqlNameStrategy ExtensionPoint (org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy)</a>
+<a href="#SqlNameStrategy+ExtensionPoint%0A%09%09%09%09%28org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy%29">
+ SqlNameStrategy ExtensionPoint
+ (org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy)
+ </a>
+<ul class="minitoc">
+<li>
+<a href="#ClassicSQLNameStrategy">ClassicSQLNameStrategy</a>
+</li>
+<li>
+<a href="#TeneoSQLNameStrategy+%28default%29">TeneoSQLNameStrategy (default)</a>
+</li>
+</ul>
</li>
<li>
-<a href="#ClassLoaderStrategy+ExtensionPoint+%28org.eclipse.emf.teneo.classloader.ClassLoaderStrategy%29">ClassLoaderStrategy ExtensionPoint (org.eclipse.emf.teneo.classloader.ClassLoaderStrategy)</a>
+<a href="#ClassLoaderStrategy+ExtensionPoint%0A%09%09%09%09%28org.eclipse.emf.teneo.classloader.ClassLoaderStrategy%29">
+ ClassLoaderStrategy ExtensionPoint
+ (org.eclipse.emf.teneo.classloader.ClassLoaderStrategy)
+ </a>
</li>
<li>
<a href="#Future+Enhancements">Future Enhancements</a>
@@ -368,11 +382,22 @@
</li>
<li>
- org.eclipse.emf.teneo.hibernate.mapper.*: these ExensionsPoints take care of
+ org.eclipse.emf.teneo.hibernate.mapper.*: these ExensionPoints take care of
creating the hibernate mapping file from the jpa annotated model.
</li>
<li>
+ org.eclipse.emf.teneo.hibernate.mapping.*: these ExtensionPoints are mostly
+ implementations of the hibernate accessor and hibernate getter and setter
+ interfaces. These propertyhandlers are used to access the EObject properties.
+ </li>
+
+<li>
+ org.eclipse.emf.teneo.hibernate.mapping.elist.*: these ExtensionPoints are the
+ EList and FeatureMap implementations used by Teneo.
+ </li>
+
+<li>
org.eclipse.emf.teneo.jpox.mapper.*: ExtensionPoints which take care of creating
the jpox/jdo mapping file.
</li>
@@ -381,7 +406,7 @@
</div>
-<a name="N10040"></a><a name="ExtensionManager"></a>
+<a name="N10046"></a><a name="ExtensionManager"></a>
<div class="h3">
<h3>ExtensionManager</h3>
@@ -430,14 +455,18 @@ final EntityNameStrategy ens = extensionManager.getExtension(EntityNameStrategy.
</ul>
<p>
-<em>Teneo creates an ExtensionManager always through the ExtensionManagerFactory.getInstance(). You
- can set your own ExtensionManagerFactory by calling ExtensionManagerFactory.setInstance(...).</em>
+
+<em>
+ Teneo creates an ExtensionManager always through the
+ ExtensionManagerFactory.getInstance(). You can set your own
+ ExtensionManagerFactory by calling ExtensionManagerFactory.setInstance(...).
+ </em>
</p>
</div>
-<a name="N10066"></a><a name="ExtensionManagerAware%2C+ExtensionInitializable"></a>
+<a name="N1006D"></a><a name="ExtensionManagerAware%2C+ExtensionInitializable"></a>
<div class="h3">
<h3>ExtensionManagerAware, ExtensionInitializable</h3>
@@ -466,7 +495,7 @@ final EntityNameStrategy ens = extensionManager.getExtension(EntityNameStrategy.
</div>
-<a name="N10079"></a><a name="EntityNameStrategy+ExtensionPoint%0A%09%09%09%09%28org.eclipse.emf.teneo.mapping.strategy.EntityNameStrategy%29"></a>
+<a name="N10080"></a><a name="EntityNameStrategy+ExtensionPoint%0A%09%09%09%09%28org.eclipse.emf.teneo.mapping.strategy.EntityNameStrategy%29"></a>
<div class="h3">
<h3>
EntityNameStrategy ExtensionPoint
@@ -508,116 +537,205 @@ final EntityNameStrategy ens = extensionManager.getExtension(EntityNameStrategy.
</div>
-<a name="N10092"></a><a name="SqlNameStrategy+ExtensionPoint+%28org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy%29"></a>
+<a name="N10099"></a><a name="SqlNameStrategy+ExtensionPoint%0A%09%09%09%09%28org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy%29"></a>
<div class="h3">
-<h3>SqlNameStrategy ExtensionPoint (org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy)</h3>
+<h3>
+ SqlNameStrategy ExtensionPoint
+ (org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy)
+ </h3>
<p>
The sql naming strategy is an important strategy because a trade-off needs to be
- made between short and understandable names and long and unique names. Currently Teneo
- only has one naming strategy which is aimed at backward compatibility. This strategy is
- described in more detail below. In future releases of Teneo new naming strategies
- will be added to separately support the short-understandable and long-unique naming
- strategies.
+ made between short and understandable names and long and unique names. Currently
+ Teneo only has two naming strategies:
</p>
+<ul>
+
+<li>ClassicSQLNameStrategy: which is aimed at backward compatibility.</li>
+
+<li>
+ TeneoSQLNameStrategy (
+ <strong>default</strong>
+ ): is very similar to ClassicSQLNameStrategy but has better handling of
+ table/column names which are too long.
+ </li>
+
+</ul>
+
<p>
- Using the ExtensionPoint mechanism the current sql naming strategy can be replaced
- by a custom strategy.
+ In future releases of Teneo new naming strategies will be added to separately
+ support the short-understandable and long-unique naming strategies.
</p>
<p>
- Teneo currently has one sql name strategy implementation:
- org.eclipse.emf.teneo.mapping.strategy.impl.ClassicSQLNameStrategy. This strategy
- has the following naming behavior:
+ Using the ExtensionPoint mechanism the current sql naming strategy can be replaced
+ by a custom strategy.
</p>
+<a name="N100B4"></a><a name="ClassicSQLNameStrategy"></a>
+<div class="h4">
+<h4>ClassicSQLNameStrategy</h4>
+<p>
+ Is implemented by the Extension:
+ org.eclipse.emf.teneo.mapping.strategy.impl.ClassicSQLNameStrategy. This
+ strategy has the following naming behavior:
+ </p>
<ul>
-
+
<li>
- PrimaryKeyJoinColumn: the name of the join columns from the joined-subclass
- table to the parent class table. The join column name is the concatenation of
- the super entity name and the id feature name of the super entity.
- </li>
-
+ PrimaryKeyJoinColumn: the name of the join columns from the joined-subclass
+ table to the parent class table. The join column name is the concatenation
+ of the super entity name and the id feature name of the super entity.
+ </li>
+
<li>
- SecondaryTablePrimaryKeyJoinColumn: the name of the primary key from the
- secondary table to the main table. Is the name of the id feature of the main
- type.
- </li>
-
+ SecondaryTablePrimaryKeyJoinColumn: the name of the primary key from the
+ secondary table to the main table. Is the name of the id feature of the main
+ type.
+ </li>
+
<li>Table name: the entity name.</li>
-
+
<li>Column name: the name for a 'simple' column: the efeature name.</li>
-
+
<li>
- Foreign Key name: the name of the foreign key created for an EReference, the
- concatenation of the entity name, '_' and the EReference name.
- </li>
-
+ Foreign Key name: the name of the foreign key created for an EReference, the
+ concatenation of the entity name, '_' and the EReference name.
+ </li>
+
<li>
- ManyToOneJoinColumn: the join column name created for a single EReference,
- depends on the option JOIN_COLUMN_NAMING_STRATEGY.
- </li>
-
+ ManyToOneJoinColumn: the join column name created for a single EReference,
+ depends on the option JOIN_COLUMN_NAMING_STRATEGY.
+ </li>
+
<li>
- OneToMany join column for EAttribute: the join columns used for a many
- eattribute (list of primitive types). Depends on the JOIN_COLUMN_NAMING_STRATEGY
- setting.
- </li>
-
+ OneToMany join column for EAttribute: the join columns used for a many
+ eattribute (list of primitive types). Depends on the
+ JOIN_COLUMN_NAMING_STRATEGY setting.
+ </li>
+
<li>
- OneToMany join column for EReference: the join columns used for a many
- ereference. Depends on the JOIN_COLUMN_NAMING_STRATEGY setting.
- </li>
-
+ OneToMany join column for EReference: the join columns used for a many
+ ereference. Depends on the JOIN_COLUMN_NAMING_STRATEGY setting.
+ </li>
+
<li>
- Join table join columns: the join columns used in the join table for a
- many-to-many relation or a one-to-many with a join table. Depends on the
- JOIN_COLUMN_NAMING_STRATEGY option.
- </li>
-
+ Join table join columns: the join columns used in the join table for a
+ many-to-many relation or a one-to-many with a join table. Depends on the
+ JOIN_COLUMN_NAMING_STRATEGY option.
+ </li>
+
<li>
- Join Table Name for many EAttribute: the name of the join table, is the
- concatenation of the entity name and the EAttribute name.
- </li>
-
+ Join Table Name for many EAttribute: the name of the join table, is the
+ concatenation of the entity name and the EAttribute name.
+ </li>
+
<li>
- Join Table Name for many EReference: the name of the join table, depends on the
- JOIN_TABLE_NAMING_STRATEGY option.
- </li>
-
+ Join Table Name for many EReference: the name of the join table, depends on
+ the JOIN_TABLE_NAMING_STRATEGY option.
+ </li>
+
<li>
- Version, Discriminator, IdBagId, Synthetic ID column names: are all option
- controlled.
- </li>
+ Version, Discriminator, IdBagId, Synthetic ID column names: are all option
+ controlled.
+ </li>
+
+</ul>
+</div>
+<a name="N100E5"></a><a name="TeneoSQLNameStrategy+%28default%29"></a>
+<div class="h4">
+<h4>TeneoSQLNameStrategy (default)</h4>
+<p>
+ Is implemented by the Extension:
+ org.eclipse.emf.teneo.mapping.strategy.impl.TeneoSQLNameStrategy. This strategy
+ has for the most part the same behavior as the ClassicSQLNameStrategy. Currently
+ for the following function it has a different behavior:
+ </p>
+<ul>
+
+<li>
+ Truncation of long sql names: it is possible to set the maximum length of
+ sql names using the MAXIMUM_SQL_NAME_LENGTH option. Sql names are derived
+ from model names, for model names it is guaranteed that certain names are
+ unique. However if a unique name has to be truncated because of length
+ constraints then name clashes can occur.
+ <p>
+ For example assume an ECLass Child which has an efeature parent (which
+ can be many=true). The logical name for the join table for this efeature
+ would be 'child_parent' and for the Child EClass the table would be
+ 'child'. However assume now that a sql name length constraint applies of
+ 4 then the join table name will become 'chil', and the table name of the
+ Child EClass would also become 'chil'. This results in a name clash.
+ </p>
+
+<p>
+ This sql name strategy performs truncation of long names in a different
+ way. It splits up the name in separate parts using the _ (underscore) as
+ the separator. Using the underscore is logical because it is often used
+ to create join table names. Then in a number of iterations it truncates
+ the different parts by first truncating the part with the maximum
+ length. In this way it tries to retain the unique name. In this example
+ the resulting join table name will become c_pa, this is not very readable
+ but at least probably more unique.
+ </p>
+
+<p>Other examples:</p>
+
+<ul>
+
+<li>child_parent (max length: 3) will be converted to c_p</li>
+
+<li>child_father_mother (max length: 1) will be converted to c_f_m</li>
+
+<li>child_parent (max length: 7) will be converted to chi_par</li>
+
+<li>child (max length: 4) will be converted to chil</li>
+
+<li>
+ child.parent.id (max length: 14) will be converted to child_paren_id
+ </li>
+
+</ul>
+
+</li>
+
</ul>
+</div>
</div>
-<a name="N100C9"></a><a name="ClassLoaderStrategy+ExtensionPoint+%28org.eclipse.emf.teneo.classloader.ClassLoaderStrategy%29"></a>
+<a name="N10111"></a><a name="ClassLoaderStrategy+ExtensionPoint%0A%09%09%09%09%28org.eclipse.emf.teneo.classloader.ClassLoaderStrategy%29"></a>
<div class="h3">
-<h3>ClassLoaderStrategy ExtensionPoint (org.eclipse.emf.teneo.classloader.ClassLoaderStrategy)</h3>
+<h3>
+ ClassLoaderStrategy ExtensionPoint
+ (org.eclipse.emf.teneo.classloader.ClassLoaderStrategy)
+ </h3>
-<p>The default extension manager will load all the extensions using the classloader strategy registered
- for the ClassLoaderStrategy ExtensionPoint. The ClassLoaderStrategy extension itself is loaded
- through the ClassLoaderStrategy set in the org.eclipse.emf.teneo.classloader.ClassLoaderResolver.</p>
+<p>
+ The default extension manager will load all the extensions using the classloader
+ strategy registered for the ClassLoaderStrategy ExtensionPoint. The
+ ClassLoaderStrategy extension itself is loaded through the ClassLoaderStrategy set
+ in the org.eclipse.emf.teneo.classloader.ClassLoaderResolver.
+ </p>
-<p>The default class loading strategy of Teneo is the ContextClassLoaderStrategy (see <a href="hibernate_details.html#Classloader">here</a>).</p>
+<p>
+ The default class loading strategy of Teneo is the ContextClassLoaderStrategy (see
+ <a href="hibernate_details.html#Classloader">here</a>
+ ).
+ </p>
</div>
-<a name="N100DA"></a><a name="Future+Enhancements"></a>
+<a name="N10122"></a><a name="Future+Enhancements"></a>
<div class="h3">
<h3>Future Enhancements</h3>
-<p>
- The following future enhancements are considered:
- </p>
+<p>The following future enhancements are considered:</p>
<ul>
diff --git a/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/gmftutorial/teneo.mindmap b/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/gmftutorial/teneo.mindmap
index 96331581c..752651bb6 100644
--- a/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/gmftutorial/teneo.mindmap
+++ b/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/gmftutorial/teneo.mindmap
@@ -7,7 +7,7 @@
#
# @author <a href="mtaal@elver.org">Martin Taal</a>
-# @version $Revision: 1.9 $ $Date: 2007/07/12 19:04:34 $
+# @version $Revision: 1.10 $ $Date: 2007/07/18 16:11:21 $
# name: the name under which this information is used to register a EMFDataStore/Session Factory. Must be
# unique. IMPORTANT: this should be the same name as used in the calls to HibernateHelper
diff --git a/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/options.html b/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/options.html
index 299813683..96c339952 100644
--- a/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/options.html
+++ b/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/options.html
@@ -573,6 +573,14 @@
also.
</li>
+
+<li>
+
+<strong>PersistenceOptions.MAPPING_FILE_PATH</strong>
+ : with this option you can specify a resource path (incl. filename) to a mapping
+ file. Instead of generating a mapping Teneo will then use the mapping file found
+ through this path.
+ </li>
<li>
diff --git a/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/resource_utility.xml b/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/resource_utility.xml
index 9af167f1a..8ea1b9c33 100644
--- a/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/resource_utility.xml
+++ b/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/resource_utility.xml
@@ -6,7 +6,7 @@
http://www.eclipse.org/legal/epl-v10.html
--><!--
@author <a href="mtaal@elver.org">Martin Taal</a>
- @version $Revision: 1.14 $ $Date: 2007/07/12 19:04:33 $
+ @version $Revision: 1.15 $ $Date: 2007/07/18 16:11:21 $
--><!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "document-v13.dtd">
<document>
&#9;<header>
diff --git a/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/samples/Dynamic.java b/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/samples/Dynamic.java
index a4dc1f49b..14ef95c95 100644
--- a/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/samples/Dynamic.java
+++ b/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/samples/Dynamic.java
@@ -11,7 +11,7 @@
* Martin Taal
* </copyright>
*
- * $Id: Dynamic.java,v 1.15 2007/07/12 19:04:33 mtaal Exp $
+ * $Id: Dynamic.java,v 1.16 2007/07/18 16:11:21 mtaal Exp $
*/
package hbtutorial;
@@ -41,7 +41,7 @@ import org.hibernate.Transaction;
* Dynamic Tutorial
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.15 $
+ * @version $Revision: 1.16 $
*/
public class Dynamic {
diff --git a/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/samples/QuickStart.java b/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/samples/QuickStart.java
index 07cf1725f..50489e174 100644
--- a/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/samples/QuickStart.java
+++ b/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/samples/QuickStart.java
@@ -11,7 +11,7 @@
* Martin Taal
* </copyright>
*
- * $Id: QuickStart.java,v 1.15 2007/07/12 19:04:33 mtaal Exp $
+ * $Id: QuickStart.java,v 1.16 2007/07/18 16:11:21 mtaal Exp $
*/
package hbtutorial;
@@ -33,7 +33,7 @@ import org.hibernate.Transaction;
* Quick Start Tutorial
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.15 $
+ * @version $Revision: 1.16 $
*/
public class QuickStart {
diff --git a/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/samples/Tutorial1.java b/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/samples/Tutorial1.java
index 1f464a97b..886fa1e72 100644
--- a/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/samples/Tutorial1.java
+++ b/doc/org.eclipse.emf.teneo.doc/tutorials/hibernate/samples/Tutorial1.java
@@ -11,7 +11,7 @@
* Martin Taal
* </copyright>
*
- * $Id: Tutorial1.java,v 1.15 2007/07/12 19:04:34 mtaal Exp $
+ * $Id: Tutorial1.java,v 1.16 2007/07/18 16:11:21 mtaal Exp $
*/
package hbtutorial;
@@ -43,7 +43,7 @@ import org.hibernate.SessionFactory;
* Quick Start Tutorial
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.15 $
+ * @version $Revision: 1.16 $
*/
public class Tutorial1 {
diff --git a/doc/org.eclipse.emf.teneo.doc/tutorials/jpox/extensions.html b/doc/org.eclipse.emf.teneo.doc/tutorials/jpox/extensions.html
index 307010bdd..8dcbc6db0 100644
--- a/doc/org.eclipse.emf.teneo.doc/tutorials/jpox/extensions.html
+++ b/doc/org.eclipse.emf.teneo.doc/tutorials/jpox/extensions.html
@@ -274,7 +274,18 @@
</a>
</li>
<li>
-<a href="#SqlNameStrategy+ExtensionPoint+%28org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy%29">SqlNameStrategy ExtensionPoint (org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy)</a>
+<a href="#SqlNameStrategy+ExtensionPoint%0A%09%09%09%09%28org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy%29">
+ SqlNameStrategy ExtensionPoint
+ (org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy)
+ </a>
+<ul class="minitoc">
+<li>
+<a href="#ClassicSQLNameStrategy">ClassicSQLNameStrategy</a>
+</li>
+<li>
+<a href="#TeneoSQLNameStrategy+%28default%29">TeneoSQLNameStrategy (default)</a>
+</li>
+</ul>
</li>
<li>
<a href="#ClassLoaderStrategy+ExtensionPoint+%28org.eclipse.emf.teneo.classloader.ClassLoaderStrategy%29">ClassLoaderStrategy ExtensionPoint (org.eclipse.emf.teneo.classloader.ClassLoaderStrategy)</a>
@@ -490,96 +501,177 @@ final EntityNameStrategy ens = extensionManager.getExtension(EntityNameStrategy.
</div>
-<a name="N10092"></a><a name="SqlNameStrategy+ExtensionPoint+%28org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy%29"></a>
+<a name="N10092"></a><a name="SqlNameStrategy+ExtensionPoint%0A%09%09%09%09%28org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy%29"></a>
<div class="h3">
-<h3>SqlNameStrategy ExtensionPoint (org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy)</h3>
+<h3>
+ SqlNameStrategy ExtensionPoint
+ (org.eclipse.emf.teneo.mapping.strategy.SQLNameStrategy)
+ </h3>
<p>
The sql naming strategy is an important strategy because a trade-off needs to be
- made between short and understandable names and long and unique names. Currently Teneo
- only has one naming strategy which is aimed at backward compatibility. This strategy is
- described in more detail below. In future releases of Teneo new naming strategies
- will be added to separately support the short-understandable and long-unique naming
- strategies.
+ made between short and understandable names and long and unique names. Currently
+ Teneo only has two naming strategies:
</p>
+<ul>
+
+<li>ClassicSQLNameStrategy: which is aimed at backward compatibility.</li>
+
+<li>
+ TeneoSQLNameStrategy (
+ <strong>default</strong>
+ ): is very similar to ClassicSQLNameStrategy but has better handling of
+ table/column names which are too long.
+ </li>
+
+</ul>
+
<p>
- Using the ExtensionPoint mechanism the current sql naming strategy can be replaced
- by a custom strategy.
+ In future releases of Teneo new naming strategies will be added to separately
+ support the short-understandable and long-unique naming strategies.
</p>
<p>
- Teneo currently has one sql name strategy implementation:
- org.eclipse.emf.teneo.mapping.strategy.impl.ClassicSQLNameStrategy. This strategy
- has the following naming behavior:
+ Using the ExtensionPoint mechanism the current sql naming strategy can be replaced
+ by a custom strategy.
</p>
+<a name="N100AD"></a><a name="ClassicSQLNameStrategy"></a>
+<div class="h4">
+<h4>ClassicSQLNameStrategy</h4>
+<p>
+ Is implemented by the Extension:
+ org.eclipse.emf.teneo.mapping.strategy.impl.ClassicSQLNameStrategy. This
+ strategy has the following naming behavior:
+ </p>
<ul>
-
+
<li>
- PrimaryKeyJoinColumn: the name of the join columns from the joined-subclass
- table to the parent class table. The join column name is the concatenation of
- the super entity name and the id feature name of the super entity.
- </li>
-
+ PrimaryKeyJoinColumn: the name of the join columns from the joined-subclass
+ table to the parent class table. The join column name is the concatenation
+ of the super entity name and the id feature name of the super entity.
+ </li>
+
<li>
- SecondaryTablePrimaryKeyJoinColumn: the name of the primary key from the
- secondary table to the main table. Is the name of the id feature of the main
- type.
- </li>
-
+ SecondaryTablePrimaryKeyJoinColumn: the name of the primary key from the
+ secondary table to the main table. Is the name of the id feature of the main
+ type.
+ </li>
+
<li>Table name: the entity name.</li>
-
+
<li>Column name: the name for a 'simple' column: the efeature name.</li>
-
+
<li>
- Foreign Key name: the name of the foreign key created for an EReference, the
- concatenation of the entity name, '_' and the EReference name.
- </li>
-
+ Foreign Key name: the name of the foreign key created for an EReference, the
+ concatenation of the entity name, '_' and the EReference name.
+ </li>
+
<li>
- ManyToOneJoinColumn: the join column name created for a single EReference,
- depends on the option JOIN_COLUMN_NAMING_STRATEGY.
- </li>
-
+ ManyToOneJoinColumn: the join column name created for a single EReference,
+ depends on the option JOIN_COLUMN_NAMING_STRATEGY.
+ </li>
+
<li>
- OneToMany join column for EAttribute: the join columns used for a many
- eattribute (list of primitive types). Depends on the JOIN_COLUMN_NAMING_STRATEGY
- setting.
- </li>
-
+ OneToMany join column for EAttribute: the join columns used for a many
+ eattribute (list of primitive types). Depends on the
+ JOIN_COLUMN_NAMING_STRATEGY setting.
+ </li>
+
<li>
- OneToMany join column for EReference: the join columns used for a many
- ereference. Depends on the JOIN_COLUMN_NAMING_STRATEGY setting.
- </li>
-
+ OneToMany join column for EReference: the join columns used for a many
+ ereference. Depends on the JOIN_COLUMN_NAMING_STRATEGY setting.
+ </li>
+
<li>
- Join table join columns: the join columns used in the join table for a
- many-to-many relation or a one-to-many with a join table. Depends on the
- JOIN_COLUMN_NAMING_STRATEGY option.
- </li>
-
+ Join table join columns: the join columns used in the join table for a
+ many-to-many relation or a one-to-many with a join table. Depends on the
+ JOIN_COLUMN_NAMING_STRATEGY option.
+ </li>
+
<li>
- Join Table Name for many EAttribute: the name of the join table, is the
- concatenation of the entity name and the EAttribute name.
- </li>
-
+ Join Table Name for many EAttribute: the name of the join table, is the
+ concatenation of the entity name and the EAttribute name.
+ </li>
+
<li>
- Join Table Name for many EReference: the name of the join table, depends on the
- JOIN_TABLE_NAMING_STRATEGY option.
- </li>
-
+ Join Table Name for many EReference: the name of the join table, depends on
+ the JOIN_TABLE_NAMING_STRATEGY option.
+ </li>
+
<li>
- Version, Discriminator, IdBagId, Synthetic ID column names: are all option
- controlled.
- </li>
+ Version, Discriminator, IdBagId, Synthetic ID column names: are all option
+ controlled.
+ </li>
+
+</ul>
+</div>
+<a name="N100DE"></a><a name="TeneoSQLNameStrategy+%28default%29"></a>
+<div class="h4">
+<h4>TeneoSQLNameStrategy (default)</h4>
+<p>
+ Is implemented by the Extension:
+ org.eclipse.emf.teneo.mapping.strategy.impl.TeneoSQLNameStrategy. This strategy
+ has for the most part the same behavior as the ClassicSQLNameStrategy. Currently
+ for the following function it has a different behavior:
+ </p>
+<ul>
+
+<li>
+ Truncation of long sql names: it is possible to set the maximum length of
+ sql names using the MAXIMUM_SQL_NAME_LENGTH option. Sql names are derived
+ from model names, for model names it is guaranteed that certain names are
+ unique. However if a unique name has to be truncated because of length
+ constraints then name clashes can occur.
+ <p>
+ For example assume an ECLass Child which has an efeature parent (which
+ can be many=true). The logical name for the join table for this efeature
+ would be 'child_parent' and for the Child EClass the table would be
+ 'child'. However assume now that a sql name length constraint applies of
+ 4 then the join table name will become 'chil', and the table name of the
+ Child EClass would also become 'chil'. This results in a name clash.
+ </p>
+
+<p>
+ This sql name strategy performs truncation of long names in a different
+ way. It splits up the name in separate parts using the _ (underscore) as
+ the separator. Using the underscore is logical because it is often used
+ to create join table names. Then in a number of iterations it truncates
+ the different parts by first truncating the part with the maximum
+ length. In this way it tries to retain the unique name. In this example
+ the resulting join table name will become c_pa, this is not very readable
+ but at least probably more unique.
+ </p>
+
+<p>Other examples:</p>
+
+<ul>
+
+<li>child_parent (max length: 3) will be converted to c_p</li>
+
+<li>child_father_mother (max length: 1) will be converted to c_f_m</li>
+
+<li>child_parent (max length: 7) will be converted to chi_par</li>
+
+<li>child (max length: 4) will be converted to chil</li>
+
+<li>
+ child.parent.id (max length: 14) will be converted to child_paren_id
+ </li>
+
</ul>
+
+</li>
+
+</ul>
+</div>
</div>
-<a name="N100C9"></a><a name="ClassLoaderStrategy+ExtensionPoint+%28org.eclipse.emf.teneo.classloader.ClassLoaderStrategy%29"></a>
+<a name="N1010A"></a><a name="ClassLoaderStrategy+ExtensionPoint+%28org.eclipse.emf.teneo.classloader.ClassLoaderStrategy%29"></a>
<div class="h3">
<h3>ClassLoaderStrategy ExtensionPoint (org.eclipse.emf.teneo.classloader.ClassLoaderStrategy)</h3>
@@ -592,7 +684,7 @@ final EntityNameStrategy ens = extensionManager.getExtension(EntityNameStrategy.
</div>
-<a name="N100DA"></a><a name="Future+Enhancements"></a>
+<a name="N1011B"></a><a name="Future+Enhancements"></a>
<div class="h3">
<h3>Future Enhancements</h3>
diff --git a/doc/org.eclipse.emf.teneo.doc/tutorials/jpox/tutorial1/Tutorial1.java b/doc/org.eclipse.emf.teneo.doc/tutorials/jpox/tutorial1/Tutorial1.java
index acc475215..8b369329d 100644
--- a/doc/org.eclipse.emf.teneo.doc/tutorials/jpox/tutorial1/Tutorial1.java
+++ b/doc/org.eclipse.emf.teneo.doc/tutorials/jpox/tutorial1/Tutorial1.java
@@ -11,7 +11,7 @@
* Martin Taal
* </copyright>
*
- * $Id: Tutorial1.java,v 1.15 2007/07/12 19:04:34 mtaal Exp $
+ * $Id: Tutorial1.java,v 1.16 2007/07/18 16:11:21 mtaal Exp $
*/
package jpoxtutorial;
@@ -50,7 +50,7 @@ import org.jpox.PMFConfiguration;
* Tutorial
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.15 $
+ * @version $Revision: 1.16 $
*/
public class Tutorial1 {
diff --git a/doc/org.eclipse.emf.teneo.doc/tutorials/skin/inst.css b/doc/org.eclipse.emf.teneo.doc/tutorials/skin/inst.css
index 04b63817e..748d485de 100644
--- a/doc/org.eclipse.emf.teneo.doc/tutorials/skin/inst.css
+++ b/doc/org.eclipse.emf.teneo.doc/tutorials/skin/inst.css
@@ -1,4 +1,4 @@
-/* $Id: inst.css,v 1.13 2007/07/12 19:04:33 mtaal Exp $
+/* $Id: inst.css,v 1.14 2007/07/18 16:11:21 mtaal Exp $
This file contains rules that extend or override the more basic formatting defined in tigris.css. Edit it to customize the look of applications using tigris.css (instances). You are responsible for maintaining your own set of (optional) deltas from tigris.css defaults; this file is intended as an example.
diff --git a/doc/org.eclipse.emf.teneo.doc/tutorials/skin/ns4_only.css b/doc/org.eclipse.emf.teneo.doc/tutorials/skin/ns4_only.css
index 54bd92f4d..2846e129a 100644
--- a/doc/org.eclipse.emf.teneo.doc/tutorials/skin/ns4_only.css
+++ b/doc/org.eclipse.emf.teneo.doc/tutorials/skin/ns4_only.css
@@ -1,4 +1,4 @@
-/* $Id: ns4_only.css,v 1.13 2007/07/12 19:04:33 mtaal Exp $
+/* $Id: ns4_only.css,v 1.14 2007/07/18 16:11:21 mtaal Exp $
simple rules suitable for Netscape 4.x only; richer rules are in tigris.css. see <http://style.tigris.org/> */
diff --git a/doc/org.eclipse.emf.teneo.doc/tutorials/skin/print.css b/doc/org.eclipse.emf.teneo.doc/tutorials/skin/print.css
index f9149771a..eade37e6f 100644
--- a/doc/org.eclipse.emf.teneo.doc/tutorials/skin/print.css
+++ b/doc/org.eclipse.emf.teneo.doc/tutorials/skin/print.css
@@ -1,4 +1,4 @@
-/* $Id: print.css,v 1.13 2007/07/12 19:04:33 mtaal Exp $ */
+/* $Id: print.css,v 1.14 2007/07/18 16:11:21 mtaal Exp $ */
#banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks {
display: none;
diff --git a/doc/org.eclipse.emf.teneo.doc/tutorials/skin/tigris.css b/doc/org.eclipse.emf.teneo.doc/tutorials/skin/tigris.css
index 22af991a6..3248d933e 100644
--- a/doc/org.eclipse.emf.teneo.doc/tutorials/skin/tigris.css
+++ b/doc/org.eclipse.emf.teneo.doc/tutorials/skin/tigris.css
@@ -1,4 +1,4 @@
-/* $Id: tigris.css,v 1.13 2007/07/12 19:04:33 mtaal Exp $
+/* $Id: tigris.css,v 1.14 2007/07/18 16:11:21 mtaal Exp $
This file defines basic default formatting for HTML conforming to Tigris application style. To extend or override these rules for your instance, edit inst.css instead of this file. */

Back to the top