mirror of https://github.com/apache/openjpa.git
OPENJPA-146 : When copying an OID superclass field for re-mapping, revert type
to PC. It will re-resolve to OID on its own when the field's metadata is resolved, and in the meantime it will ensure we use the same path for metadata resolution as non-copied fields. git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@509632 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4f102a7c77
commit
1b446958f5
|
@ -888,7 +888,8 @@ public class MappingTool
|
|||
* <ul>
|
||||
* <li>Refresh the mappings for given package, without dropping any
|
||||
* schema components:<br />
|
||||
* <code>java org.apache.openjpa.jdbc.meta.MappingTool mypackage.jdo</code></li>
|
||||
* <code>java org.apache.openjpa.jdbc.meta.MappingTool
|
||||
* mypackage.jdo</code></li>
|
||||
* <li>Refresh the mappings for all persistent classes in the classpath,
|
||||
* dropping any unused columns and even tables:<br />
|
||||
* <code>java org.apache.openjpa.jdbc.meta.MappingTool -sa refresh
|
||||
|
|
|
@ -201,8 +201,8 @@ public class ValueMetaDataImpl
|
|||
|
||||
switch (_delete) {
|
||||
case CASCADE_NONE:
|
||||
// if the user marks the owning field dependent and we externalize
|
||||
// to a pc type, then become dependent
|
||||
// if the user marks the owning field dependent and we
|
||||
// externalize to a pc type, then become dependent
|
||||
if (this != _owner.getValue() && isTypePC()
|
||||
&& ((ValueMetaDataImpl) _owner.getValue())._delete
|
||||
== CASCADE_AUTO)
|
||||
|
@ -432,8 +432,13 @@ public class ValueMetaDataImpl
|
|||
}
|
||||
|
||||
public void copy(ValueMetaData vmd) {
|
||||
// copy declared types, but if OID revert to PC until we resolve
|
||||
// to OID ourselves
|
||||
_decType = vmd.getDeclaredType();
|
||||
_decCode = vmd.getDeclaredTypeCode();
|
||||
if (_decCode == JavaTypes.OID)
|
||||
_decCode = JavaTypes.PC;
|
||||
|
||||
_delete = vmd.getCascadeDelete();
|
||||
_persist = vmd.getCascadePersist();
|
||||
_attach = vmd.getCascadeAttach();
|
||||
|
|
Loading…
Reference in New Issue