Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtaal2006-09-22 01:21:48 -0400
committermtaal2006-09-22 01:21:48 -0400
commit1ed9ad45bc5cb2a37e6a0a53dbacd0e412a83d0a (patch)
treed36e3c0db18fab6e3ee5b134e305b2532e53e3f9
parentac6b62e6716a5c00bfe652a55abbc0d4cf3a242b (diff)
downloadorg.eclipse.emf.teneo-1ed9ad45bc5cb2a37e6a0a53dbacd0e412a83d0a.tar.gz
org.eclipse.emf.teneo-1ed9ad45bc5cb2a37e6a0a53dbacd0e412a83d0a.tar.xz
org.eclipse.emf.teneo-1ed9ad45bc5cb2a37e6a0a53dbacd0e412a83d0a.zip
Solved issue with lazy handling in current cvs version (issue occured because of other changes in DefaultAnnotator).
-rw-r--r--plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/AbstractAssociationMapper.java3
-rw-r--r--plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/BasicMapper.java3
-rw-r--r--plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/ManyToOneMapper.java8
-rw-r--r--plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/OneToManyMapper.java3
-rw-r--r--plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/OneToOneMapper.java6
5 files changed, 15 insertions, 8 deletions
diff --git a/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/AbstractAssociationMapper.java b/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/AbstractAssociationMapper.java
index 8c9d48509..1f9f4351d 100644
--- a/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/AbstractAssociationMapper.java
+++ b/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/AbstractAssociationMapper.java
@@ -11,7 +11,7 @@
* Martin Taal
* </copyright>
*
- * $Id: AbstractAssociationMapper.java,v 1.4 2006/09/06 21:59:33 mtaal Exp $
+ * $Id: AbstractAssociationMapper.java,v 1.5 2006/09/22 05:21:48 mtaal Exp $
*/
package org.eclipse.emf.teneo.hibernate.mapper;
@@ -179,6 +179,7 @@ abstract class AbstractAssociationMapper extends AbstractMapper {
* Sets the lazy attribute of the associationElement based on the fetchtype.
*/
protected void addFetchType(Element associationElement, FetchType fetch) {
+ // TODO: when proxies are supported the below should be changed!
associationElement.addAttribute("lazy", FetchType.LAZY_LITERAL.equals(fetch) ? "true" : "false");
}
diff --git a/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/BasicMapper.java b/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/BasicMapper.java
index dd79bc043..e6c771009 100644
--- a/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/BasicMapper.java
+++ b/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/BasicMapper.java
@@ -12,7 +12,7 @@
* Davide Marchignoli
* </copyright>
*
- * $Id: BasicMapper.java,v 1.6 2006/09/08 04:26:47 mtaal Exp $
+ * $Id: BasicMapper.java,v 1.7 2006/09/22 05:21:48 mtaal Exp $
*/
package org.eclipse.emf.teneo.hibernate.mapper;
@@ -122,6 +122,7 @@ class BasicMapper extends AbstractPropertyMapper implements BasicProcessor, Tran
basic = PannotationFactory.eINSTANCE.createBasic();
}
+ // Buildtime enhancement not supported
propElement.addAttribute("lazy", FetchType.LAZY_LITERAL.equals(basic.getFetch()) ? "true" : "false");
addColumn(propElement, eAttribute.getName(), getColumn(paAttribute), getHbmContext()
.isCurrentElementFeatureMap(), false);
diff --git a/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/ManyToOneMapper.java b/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/ManyToOneMapper.java
index b1e66e256..53d67f27e 100644
--- a/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/ManyToOneMapper.java
+++ b/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/ManyToOneMapper.java
@@ -12,7 +12,7 @@
* Davide Marchignoli
* </copyright>
*
- * $Id: ManyToOneMapper.java,v 1.1 2006/07/05 22:29:30 mtaal Exp $
+ * $Id: ManyToOneMapper.java,v 1.2 2006/09/22 05:21:48 mtaal Exp $
*/
package org.eclipse.emf.teneo.hibernate.mapper;
@@ -23,6 +23,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.emf.teneo.annotations.pamodel.PAnnotatedEReference;
import org.eclipse.emf.teneo.annotations.pamodel.PAnnotatedEStructuralFeature;
+import org.eclipse.emf.teneo.annotations.pannotation.FetchType;
import org.eclipse.emf.teneo.annotations.pannotation.ManyToOne;
import org.eclipse.emf.teneo.annotations.processing.ManyToOneProcessor;
import org.eclipse.emf.teneo.annotations.processing.ProcessingException;
@@ -75,7 +76,10 @@ class ManyToOneMapper extends AbstractAssociationMapper implements ManyToOneProc
// associationElement.addAttribute("access", "org.eclipse.emf.teneo.hibernate.mapping.EFeatureAccessor");
addCascadesForSingle(associationElement, mto.getCascade());
- addFetchType(associationElement, mto.getFetch());
+ // todo default false until proxies are supported
+ associationElement.addAttribute("lazy", "false");
+ //addFetchType(associationElement, mto.getFetch());
+
addJoinColumns(associationElement, jcs, mto.isOptional() || getHbmContext().isCurrentElementFeatureMap());
associationElement.addAttribute("not-null",
diff --git a/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/OneToManyMapper.java b/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/OneToManyMapper.java
index 266d9ac08..6a5a7219e 100644
--- a/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/OneToManyMapper.java
+++ b/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/OneToManyMapper.java
@@ -12,7 +12,7 @@
* Davide Marchignoli
* </copyright>
*
- * $Id: OneToManyMapper.java,v 1.5 2006/09/06 17:26:44 mtaal Exp $
+ * $Id: OneToManyMapper.java,v 1.6 2006/09/22 05:21:48 mtaal Exp $
*/
package org.eclipse.emf.teneo.hibernate.mapper;
@@ -115,7 +115,6 @@ class OneToManyMapper extends AbstractAssociationMapper implements OneToManyProc
final List hbCascadeList = (null == hbCascade) ? Collections.EMPTY_LIST : hbCascade.getValue();
// TODO OneToMany and CollectionOfElements are mutually exclusive. Should throw exception if both there?
-
addFetchType(collElement, (null != coe) ? coe.getFetch() : otm.getFetch());
addCascadesForMany(collElement, (null != coe) ? hbCascadeList : otm.getCascade());
List inverseJoinColumns = jt != null && jt.getInverseJoinColumns() != null ? (List) jt.getInverseJoinColumns()
diff --git a/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/OneToOneMapper.java b/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/OneToOneMapper.java
index 5ee8d873b..577fb86a0 100644
--- a/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/OneToOneMapper.java
+++ b/plugins/org.eclipse.emf.teneo.hibernate/src/org/eclipse/emf/teneo/hibernate/mapper/OneToOneMapper.java
@@ -12,7 +12,7 @@
* Davide Marchignoli
* </copyright>
*
- * $Id: OneToOneMapper.java,v 1.2 2006/09/04 15:42:32 mtaal Exp $
+ * $Id: OneToOneMapper.java,v 1.3 2006/09/22 05:21:48 mtaal Exp $
*/
package org.eclipse.emf.teneo.hibernate.mapper;
@@ -101,7 +101,9 @@ class OneToOneMapper extends AbstractAssociationMapper implements OneToOneProces
paReference.getAnnotatedEReference().getEReferenceType())));
addCascadesForSingle(associationElement, oto.getCascade());
- addFetchType(associationElement, oto.getFetch());
+ // todo default false until proxies are supported
+ associationElement.addAttribute("lazy", "false");
+ //addFetchType(associationElement, oto.getFetch());
final List joinColumns = getJoinColumns(paReference);
final boolean forceNullable = (oto.isOptional() || getHbmContext().isCurrentElementFeatureMap());
addJoinColumns(associationElement, joinColumns, forceNullable);

Back to the top