Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtaal2007-01-24 18:29:28 -0500
committermtaal2007-01-24 18:29:28 -0500
commita39d05effd83f4a4801123456237b6aae5bf57ce (patch)
treec6796d3b0a3eab352f2ad95143f7ffb18a98251c
parent01737d465cbf55a0bdb4e0e24e4983977e4a5ae9 (diff)
downloadorg.eclipse.emf.teneo-a39d05effd83f4a4801123456237b6aae5bf57ce.tar.gz
org.eclipse.emf.teneo-a39d05effd83f4a4801123456237b6aae5bf57ce.tar.xz
org.eclipse.emf.teneo-a39d05effd83f4a4801123456237b6aae5bf57ce.zip
[170217]
-rw-r--r--plugins/org.eclipse.emf.teneo.jpox/src/org/eclipse/emf/teneo/jpox/JpoxHelper.java6
-rw-r--r--plugins/org.eclipse.emf.teneo.jpox/src/org/eclipse/emf/teneo/jpox/mapper/property/IdMapper.java27
2 files changed, 24 insertions, 9 deletions
diff --git a/plugins/org.eclipse.emf.teneo.jpox/src/org/eclipse/emf/teneo/jpox/JpoxHelper.java b/plugins/org.eclipse.emf.teneo.jpox/src/org/eclipse/emf/teneo/jpox/JpoxHelper.java
index cb035ae76..7586b5929 100644
--- a/plugins/org.eclipse.emf.teneo.jpox/src/org/eclipse/emf/teneo/jpox/JpoxHelper.java
+++ b/plugins/org.eclipse.emf.teneo.jpox/src/org/eclipse/emf/teneo/jpox/JpoxHelper.java
@@ -11,7 +11,7 @@
* Martin Taal
* </copyright>
*
- * $Id: JpoxHelper.java,v 1.2 2006/09/21 00:56:36 mtaal Exp $
+ * $Id: JpoxHelper.java,v 1.3 2007/01/24 23:29:28 mtaal Exp $
*/
package org.eclipse.emf.teneo.jpox;
@@ -36,7 +36,7 @@ import org.eclipse.emf.teneo.jpox.resource.JPOXResourceFactory;
* Is the main entry point for 'outside' users to create persistence manager factories and register EMF Data Stores.
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class JpoxHelper {
/** The logger */
@@ -63,7 +63,7 @@ public class JpoxHelper {
// support old way
Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap().put("jpoxdao", new JPOXResourceFactory());
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("jpoxdao", new JPOXResourceFactory());
- Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("ejdo", new JPOXResourceFactory());
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(JpoxConstants.EJDO_EXTENSION, new JPOXResourceFactory());
System.setProperty("org.jpox.cache.level1.type", "org.eclipse.emf.teneo.jpox.cache.EMFWeakRefCache");
}
diff --git a/plugins/org.eclipse.emf.teneo.jpox/src/org/eclipse/emf/teneo/jpox/mapper/property/IdMapper.java b/plugins/org.eclipse.emf.teneo.jpox/src/org/eclipse/emf/teneo/jpox/mapper/property/IdMapper.java
index 1eff9cee3..256c88fa4 100644
--- a/plugins/org.eclipse.emf.teneo.jpox/src/org/eclipse/emf/teneo/jpox/mapper/property/IdMapper.java
+++ b/plugins/org.eclipse.emf.teneo.jpox/src/org/eclipse/emf/teneo/jpox/mapper/property/IdMapper.java
@@ -11,7 +11,7 @@
* Martin Taal
* </copyright>
*
- * $Id: IdMapper.java,v 1.3 2006/09/13 10:39:52 mtaal Exp $
+ * $Id: IdMapper.java,v 1.4 2007/01/24 23:29:29 mtaal Exp $
*/
package org.eclipse.emf.teneo.jpox.mapper.property;
@@ -25,6 +25,7 @@ import org.eclipse.emf.teneo.annotations.pannotation.Column;
import org.eclipse.emf.teneo.annotations.pannotation.GeneratedValue;
import org.eclipse.emf.teneo.annotations.pannotation.GenerationType;
import org.eclipse.emf.teneo.annotations.pannotation.SequenceGenerator;
+import org.eclipse.emf.teneo.annotations.pannotation.TableGenerator;
import org.eclipse.emf.teneo.jpox.mapper.AbstractMapper;
import org.eclipse.emf.teneo.jpox.mapper.MappingContext;
import org.eclipse.emf.teneo.simpledom.Element;
@@ -33,7 +34,7 @@ import org.eclipse.emf.teneo.simpledom.Element;
* The abstract class for different mappers.
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class IdMapper extends AbstractMapper {
@@ -90,11 +91,25 @@ public class IdMapper extends AbstractMapper {
// get the sequence from the global generator
if (gv.getGenerator() != null) {
- final SequenceGenerator sg = aAttribute.getPaModel().getSequenceGenerator(aAttribute.getAnnotatedEAttribute(),
- gv.getGenerator());
- fieldElement.addAttribute("sequence", sg.getSequenceName());
+ if (GenerationType.TABLE_LITERAL.equals(gv.getStrategy())) {
+ fieldElement.addAttribute("strategy", "increment");
+ final TableGenerator tg = aAttribute.getPaModel().getTableGenerator(aAttribute.getAnnotatedEAttribute(),
+ gv.getGenerator());
+ if (tg.getTable() != null) {
+ fieldElement.addAttribute("sequence-table-name", tg.getTable());
+ }
+ if (tg.getPkColumnName() != null) {
+ fieldElement.addAttribute("sequence-name-column-name", tg.getPkColumnName());
+ }
+ if (tg.getValueColumnName() != null) {
+ fieldElement.addAttribute("sequence-nextval-column-name", tg.getValueColumnName());
+ }
+ } else {
+ final SequenceGenerator sg = aAttribute.getPaModel().getSequenceGenerator(aAttribute.getAnnotatedEAttribute(),
+ gv.getGenerator());
+ fieldElement.addAttribute("sequence", sg.getSequenceName());
+ }
}
}
}
-
} \ No newline at end of file

Back to the top