mirror of https://github.com/apache/openjpa.git
OPENJPA-967: remove duplicate column in the associate
table when MapKey is specified. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@754773 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2860368801
commit
44ffbd2f79
|
@ -25,7 +25,6 @@ import org.apache.openjpa.enhance.PersistenceCapable;
|
|||
import org.apache.openjpa.enhance.Reflection;
|
||||
import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
|
||||
import org.apache.openjpa.jdbc.kernel.JDBCStore;
|
||||
import org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy;
|
||||
import org.apache.openjpa.jdbc.meta.strats.NoneFieldStrategy;
|
||||
import org.apache.openjpa.jdbc.meta.strats.PrimitiveFieldStrategy;
|
||||
import org.apache.openjpa.jdbc.schema.Column;
|
||||
|
@ -53,7 +52,6 @@ import org.apache.openjpa.util.ApplicationIds;
|
|||
import org.apache.openjpa.util.InternalException;
|
||||
import org.apache.openjpa.util.MetaDataException;
|
||||
import org.apache.openjpa.util.ObjectId;
|
||||
import org.apache.openjpa.util.OpenJPAId;
|
||||
|
||||
/**
|
||||
* Specialization of metadata for relational databases.
|
||||
|
@ -160,6 +158,14 @@ public class FieldMapping
|
|||
if (meta != null)
|
||||
return meta.getTable();
|
||||
}
|
||||
|
||||
ValueMappingImpl vm = (ValueMappingImpl)getDefiningMapping().
|
||||
getEmbeddingMetaData();
|
||||
if (vm != null && vm.getValueMappedBy() != null) {
|
||||
return vm.getFieldMapping().getElementMapping().
|
||||
getDeclaredTypeMapping().getTable();
|
||||
}
|
||||
|
||||
return getDefiningMapping().getTable();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue