Search in sources :

Example 1 with VersionDocument

use of com.b2international.snowowl.core.version.VersionDocument in project snow-owl by b2ihealthcare.

the class RepositoryTransactionContext method add.

@Override
public String add(Object o) {
    if (o instanceof VersionDocument) {
        final VersionDocument version = (VersionDocument) o;
        staging.stageNew(version.getId(), version);
        resolvedObjectsById.put(createComponentKey(version.getId(), version.getClass()), version);
        return version.getId();
    } else if (o instanceof Revision) {
        Revision rev = (Revision) o;
        staging.stageNew(rev);
        resolvedObjectsById.put(createComponentKey(rev.getId(), rev.getClass()), rev);
        return rev.getId();
    } else {
        throw new UnsupportedOperationException("Unrecognized objects cannot be added to this repository: " + o);
    }
}
Also used : VersionDocument(com.b2international.snowowl.core.version.VersionDocument)

Aggregations

VersionDocument (com.b2international.snowowl.core.version.VersionDocument)1