private <T extends NodeInterface> void importRelationshipListData(final SecurityContext context, final Class type, final List<Map<String, Object>> data) throws FrameworkException {

		final App app = StructrApp.getInstance(context);

		try (final Tx tx = app.tx()) {

			tx.disableChangelog();

			for (final Map<String, Object> entry : data) {

				final String sourceId = (String) entry.get("sourceId");
				final String targetId = (String) entry.get("targetId");

				final NodeInterface sourceNode = app.getNodeById(sourceId);
				final NodeInterface targetNode = app.getNodeById(targetId);

				if (sourceNode == null) {

					logger.error("Unable to import relationship of type {}. Source node not found! {}", type.getSimpleName(), entry);

				} else if (targetNode == null) {

					logger.error("Unable to import relationship of type {}. Target node not found! {}", type.getSimpleName(), entry);

				} else {

					final RelationshipInterface r = app.create(sourceNode, targetNode, type);

					correctNumberFormats(context, entry, type);

					final PropertyContainer pc = r.getPropertyContainer();
					pc.setProperties(entry);
				}
			}

			tx.success();

		} catch (FrameworkException fex) {

			logger.error("Unable to import {}, aborting with {}", type.getSimpleName(), fex.getMessage());
			fex.printStackTrace();

			throw fex;
		}
	}
private < T extends NodeInterface > void importRelationshipListData ( final SecurityContext context , final Class type , final List < Map < String , Object > > data ) throws FrameworkException { final App app = StructrApp . getInstance ( context ) ; try ( final Tx tx = app . tx ( ) ) { tx . disableChangelog ( ) ; for ( final Map < String , Object > entry : data ) { final String sourceId = ( String ) entry . get ( "sourceId" ) ; final String targetId = ( String ) entry . get ( "targetId" ) ; final NodeInterface sourceNode = app . getNodeById ( sourceId ) ; final NodeInterface targetNode = app . getNodeById ( targetId ) ; if ( sourceNode == null ) { logger . error ( "Unable to import relationship of type {}. Source node not found! {}" , type . getSimpleName ( ) , entry ) ; } else if ( targetNode == null ) { logger . error ( "Unable to import relationship of type {}. Target node not found! {}" , type . getSimpleName ( ) , entry ) ; } else { final RelationshipInterface r = app . create ( sourceNode , targetNode , type ) ; correctNumberFormats ( context , entry , type ) ; final PropertyContainer pc = r . getPropertyContainer ( ) ; pc . setProperties ( entry ) ; } } tx . success ( ) ; } catch ( FrameworkException fex ) { logger . error ( "Unable to import {}, aborting with {}" , type . getSimpleName ( ) , fex . getMessage ( ) ) ; fex . printStackTrace ( ) ; throw fex ; } }
}