summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMartin Taal2013-01-15 12:03:01 (EST)
committer Martin Taal2013-01-15 12:03:01 (EST)
commitf15b729492f33fc7bea8e5c99e8bdebbb1a9c920 (patch)
treea2b724701e46858b7429145730f49f06e54fac3c
parenta6fb8402efe9ce72048b84ac28ba4e90981bf6f3 (diff)
downloadorg.eclipse.emf.teneo-f15b729492f33fc7bea8e5c99e8bdebbb1a9c920.zip
org.eclipse.emf.teneo-f15b729492f33fc7bea8e5c99e8bdebbb1a9c920.tar.gz
org.eclipse.emf.teneo-f15b729492f33fc7bea8e5c99e8bdebbb1a9c920.tar.bz2
Fixes issue [ 398148] - [Hibernate] teneo.mapping.auditing.database.schema does not create all needed auditing tables
-rwxr-xr-xcore/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/BidirectionalManyToManyAnnotator.java7
-rwxr-xr-xcore/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/OneToManyAttributeAnnotator.java7
-rwxr-xr-xcore/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/OneToManyReferenceAnnotator.java5
-rwxr-xr-xcore/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/UnidirectionalManyToManyAnnotator.java6
4 files changed, 25 insertions, 0 deletions
diff --git a/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/BidirectionalManyToManyAnnotator.java b/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/BidirectionalManyToManyAnnotator.java
index 3f1d2bf..a8e40ff 100755
--- a/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/BidirectionalManyToManyAnnotator.java
+++ b/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/BidirectionalManyToManyAnnotator.java
@@ -25,6 +25,7 @@ import org.eclipse.emf.teneo.annotations.pamodel.PAnnotatedEReference;
import org.eclipse.emf.teneo.annotations.pannotation.JoinTable;
import org.eclipse.emf.teneo.annotations.pannotation.ManyToMany;
import org.eclipse.emf.teneo.extension.ExtensionPoint;
+import org.eclipse.emf.teneo.util.StoreUtil;
/**
* Annotates a bidirectional many-to-many ereference.
@@ -102,6 +103,12 @@ public class BidirectionalManyToManyAnnotator extends BaseEFeatureAnnotator impl
if (joinTable == null) {
joinTable = getFactory().createJoinTable();
aReference.setJoinTable(joinTable);
+ if (StoreUtil
+ .isAuditEntryEClass(aReference.getModelEReference().getEContainingClass())
+ && getPersistenceOptions().getAuditingDBSchema() != null
+ && getPersistenceOptions().getAuditingDBSchema().length() > 0) {
+ joinTable.setSchema(getPersistenceOptions().getAuditingDBSchema());
+ }
}
joinTable.setEModelElement(eReference);
diff --git a/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/OneToManyAttributeAnnotator.java b/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/OneToManyAttributeAnnotator.java
index 970bfc4..6d860e4 100755
--- a/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/OneToManyAttributeAnnotator.java
+++ b/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/OneToManyAttributeAnnotator.java
@@ -33,6 +33,7 @@ import org.eclipse.emf.teneo.annotations.pannotation.JoinTable;
import org.eclipse.emf.teneo.annotations.pannotation.OneToMany;
import org.eclipse.emf.teneo.annotations.pannotation.TemporalType;
import org.eclipse.emf.teneo.extension.ExtensionPoint;
+import org.eclipse.emf.teneo.util.StoreUtil;
/**
* Annotates a one-to-many attribute (an eattribute with ismany=true), an example is a list of
@@ -109,6 +110,12 @@ public class OneToManyAttributeAnnotator extends BaseEFeatureAnnotator implement
final JoinTable jt = getFactory().createJoinTable();
jt.setName(getSqlNameStrategy().getJoinTableName(aAttribute));
aAttribute.setJoinTable(jt);
+ if (StoreUtil.isAuditEntryEClass(aAttribute.getModelEAttribute().getEContainingClass())
+ && getPersistenceOptions().getAuditingDBSchema() != null
+ && getPersistenceOptions().getAuditingDBSchema().length() > 0) {
+ jt.setSchema(getPersistenceOptions().getAuditingDBSchema());
+ }
+
}
if (aAttribute.getJoinColumns().size() == 0) {
diff --git a/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/OneToManyReferenceAnnotator.java b/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/OneToManyReferenceAnnotator.java
index 2acbb6e..dcab0b9 100755
--- a/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/OneToManyReferenceAnnotator.java
+++ b/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/OneToManyReferenceAnnotator.java
@@ -199,6 +199,11 @@ public class OneToManyReferenceAnnotator extends BaseEFeatureAnnotator implement
if (joinTable == null) {
joinTable = getFactory().createJoinTable();
aReference.setJoinTable(joinTable);
+ if (StoreUtil.isAuditEntryEClass(aReference.getModelEReference().getEContainingClass())
+ && getPersistenceOptions().getAuditingDBSchema() != null
+ && getPersistenceOptions().getAuditingDBSchema().length() > 0) {
+ joinTable.setSchema(getPersistenceOptions().getAuditingDBSchema());
+ }
}
joinTable.setEModelElement(eReference);
diff --git a/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/UnidirectionalManyToManyAnnotator.java b/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/UnidirectionalManyToManyAnnotator.java
index d062e0e..9d72b13 100755
--- a/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/UnidirectionalManyToManyAnnotator.java
+++ b/core/org.eclipse.emf.teneo/src/org/eclipse/emf/teneo/annotations/mapper/UnidirectionalManyToManyAnnotator.java
@@ -25,6 +25,7 @@ import org.eclipse.emf.teneo.annotations.pamodel.PAnnotatedEReference;
import org.eclipse.emf.teneo.annotations.pannotation.JoinTable;
import org.eclipse.emf.teneo.annotations.pannotation.ManyToMany;
import org.eclipse.emf.teneo.extension.ExtensionPoint;
+import org.eclipse.emf.teneo.util.StoreUtil;
/**
* Annotates a many-to-many which is handled from one side.
@@ -74,6 +75,11 @@ public class UnidirectionalManyToManyAnnotator extends BaseEFeatureAnnotator imp
if (joinTable == null) {
joinTable = getFactory().createJoinTable();
aReference.setJoinTable(joinTable);
+ if (StoreUtil.isAuditEntryEClass(aReference.getModelEReference().getEContainingClass())
+ && getPersistenceOptions().getAuditingDBSchema() != null
+ && getPersistenceOptions().getAuditingDBSchema().length() > 0) {
+ joinTable.setSchema(getPersistenceOptions().getAuditingDBSchema());
+ }
}
joinTable.setEModelElement(eReference);