dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17544
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7013: disable importing compulsoryDataElementOperands for now in the importer, since cascade=all-delete...
------------------------------------------------------------
revno: 7013
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-05-23 13:12:18 +0200
message:
disable importing compulsoryDataElementOperands for now in the importer, since cascade=all-delete-orphan causes issues
modified:
dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2012-05-22 16:20:33 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2012-05-23 11:12:18 +0000
@@ -236,7 +236,7 @@
newAttributeValues( object, attributeValues );
newExpression( object, "leftSide", leftSide );
newExpression( object, "rightSide", rightSide );
- newDataElementOperands( object, "compulsoryDataElementOperands", compulsoryDataElementOperands );
+ // newDataElementOperands( object, "compulsoryDataElementOperands", compulsoryDataElementOperands );
newDataElementOperands( object, "greyedFields", greyedFields );
sessionFactory.getCurrentSession().flush();
@@ -271,10 +271,12 @@
if ( ReflectionUtils.findGetterMethod( field, object ) != null )
{
- dataElementOperands = ReflectionUtils.invokeGetterMethod( field, object );
+ Set<DataElementOperand> detachedDataElementOperands = ReflectionUtils.invokeGetterMethod( field, object );
+ dataElementOperands = new HashSet<DataElementOperand>( detachedDataElementOperands );
- if ( dataElementOperands.size() > 0 )
+ if ( detachedDataElementOperands.size() > 0 )
{
+ detachedDataElementOperands.clear();
ReflectionUtils.invokeSetterMethod( field, object, new HashSet<DataElementOperand>() );
}
}
@@ -325,7 +327,6 @@
dataElementOperand.setId( 0 );
dataElementOperandService.addDataElementOperand( dataElementOperand );
- sessionFactory.getCurrentSession().flush();
}
ReflectionUtils.invokeSetterMethod( field, object, dataElementOperands );