/** * @return the associations */ public List<Association> getAssociations() { if ( associations == null ) { List<OMElement> associationElements = adapter.getElements( adapter.getRootElement(), new XPath( "./rim:RegistryObjectList/rim:Association", ns ) ); associations = new ArrayList<Association>(); for ( OMElement associationElem : associationElements ) { associations.add( new Association( associationElem ) ); } } return associations; }
private void insertAssociation( Association association, int regPackId, Connection conn ) throws SQLException { InsertRow ir = new InsertRow( new TableName( Table.idxtb_association.name() ), null ); addRegistryObject( ir, association ); ir.addPreparedArgument( new SQLIdentifier( "sourceObject" ), association.getSourceObject() ); ir.addPreparedArgument( new SQLIdentifier( "targetObject" ), association.getTargetObject() ); ir.addPreparedArgument( new SQLIdentifier( "associationType" ), association.getAssociationType() ); ir.addPreparedArgument( new SQLIdentifier( "data" ), getAsByteArray( association.getElement() ) ); ir.addPreparedArgument( new SQLIdentifier( "fk_registrypackage" ), regPackId ); ir.performInsert( conn ); }
return new AdhocQuery( rootEl ); case Association: return new Association( rootEl ); case Classification: return new Classification( rootEl );