Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtaal2007-02-05 10:35:37 -0500
committermtaal2007-02-05 10:35:37 -0500
commitc294b29b67ec5c61d2eff4eb3f95e2993316a419 (patch)
treeeeffc363cbbd997ff5bc4db4982f31d5e48bfa0c
parentad94d24831344c2fd5ae99d78c783fec020e01a4 (diff)
downloadorg.eclipse.emf.teneo-c294b29b67ec5c61d2eff4eb3f95e2993316a419.tar.gz
org.eclipse.emf.teneo-c294b29b67ec5c61d2eff4eb3f95e2993316a419.tar.xz
org.eclipse.emf.teneo-c294b29b67ec5c61d2eff4eb3f95e2993316a419.zip
[172755]
-rw-r--r--plugins/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/mapper/DefaultAnnotator.java24
1 files changed, 13 insertions, 11 deletions
diff --git a/plugins/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/mapper/DefaultAnnotator.java b/plugins/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/mapper/DefaultAnnotator.java
index b8b8c5d3f..356337445 100644
--- a/plugins/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/mapper/DefaultAnnotator.java
+++ b/plugins/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/mapper/DefaultAnnotator.java
@@ -11,7 +11,7 @@
* Martin Taal
* </copyright>
*
- * $Id: DefaultAnnotator.java,v 1.24 2007/02/05 14:37:57 mtaal Exp $
+ * $Id: DefaultAnnotator.java,v 1.25 2007/02/05 15:35:37 mtaal Exp $
*/
package org.eclipse.emf.teneo.annotations.mapper;
@@ -80,7 +80,7 @@ import org.eclipse.emf.teneo.util.StoreUtil;
* information. It sets the default annotations according to the ejb3 spec.
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.24 $
+ * @version $Revision: 1.25 $
*/
public class DefaultAnnotator {
@@ -1364,21 +1364,23 @@ public class DefaultAnnotator {
}
/** Utilit method to truncate a column name */
- private String trunc(String name, boolean truncSuffix) {
+ private String trunc(String truncName, boolean truncSuffix) {
+ final String correctedName = truncName.replace('.', '_');
+
if (optionMaximumSqlLength == -1)
- return optionSQLCaseStrategy.convert(name);
- if (name.length() < optionMaximumSqlLength)
- return optionSQLCaseStrategy.convert(name);
+ return optionSQLCaseStrategy.convert(correctedName);
+ if (correctedName.length() < optionMaximumSqlLength)
+ return optionSQLCaseStrategy.convert(correctedName);
// truncate the part before the last _ because this is often the suffix
- final int underscore = name.lastIndexOf('_');
+ final int underscore = correctedName.lastIndexOf('_');
if (truncSuffix && underscore != -1 && underscore > 0) {
- final String usStr = name.substring(underscore);
+ final String usStr = correctedName.substring(underscore);
if ((optionMaximumSqlLength - usStr.length()) < 0)
- return optionSQLCaseStrategy.convert(name);
- return optionSQLCaseStrategy.convert(name.substring(0, optionMaximumSqlLength - usStr.length()) + usStr);
+ return optionSQLCaseStrategy.convert(correctedName);
+ return optionSQLCaseStrategy.convert(correctedName.substring(0, optionMaximumSqlLength - usStr.length()) + usStr);
}
- return optionSQLCaseStrategy.convert(name.substring(0, optionMaximumSqlLength));
+ return optionSQLCaseStrategy.convert(correctedName.substring(0, optionMaximumSqlLength));
}
} \ No newline at end of file

Back to the top