Example usage for javax.xml.registry.infomodel Concept addAssociation

List of usage examples for javax.xml.registry.infomodel Concept addAssociation

Introduction

In this page you can find the example usage for javax.xml.registry.infomodel Concept addAssociation.

Prototype

void addAssociation(Association association) throws JAXRException;

Source Link

Document

Adds specified Association to use this object as source.

Usage

From source file:it.cnr.icar.eric.client.xml.registry.LifeCycleManagerImpl.java

/**
 * Create a semantic equivalence between the two specified Concepts. This is
 * a convenience method to create an Association with sourceObject as
 * concept1 and targetObject as concept2 and associationType as
 * EquivalentTo.//from   w  ww  .  j a v  a2s  . c o  m
 * 
 * <p>
 * <DL>
 * <DT><B>Capability Level: 0 </B>
 * </DL>
 * 
 */
public void createConceptEquivalence(Concept concept1, Concept concept2) throws JAXRException {
    BusinessQueryManagerImpl bqm = (BusinessQueryManagerImpl) regService.getBusinessQueryManager();
    Concept eqConcept = bqm.findConceptByPath(
            "/" + BindingUtility.CANONICAL_CLASSIFICATION_SCHEME_LID_AssociationType + "/" + "EquivalentTo");
    Association assoc = createAssociation(concept2, eqConcept);
    concept1.addAssociation(assoc);

    // ??eeg save assoc to Registry or is an attribute of the Connection??
}