
org.umlg.runtime.adaptor.UmlgTransactionEventHandlerImpl Maven / Gradle / Ivy
The newest version!
package org.umlg.runtime.adaptor;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.umlg.runtime.collection.UmlgCollection;
import org.umlg.runtime.domain.AssociationClassNode;
import org.umlg.runtime.domain.UmlgNode;
import org.umlg.runtime.notification.ChangeHolder;
import org.umlg.runtime.notification.NotificationListener;
import org.umlg.runtime.validation.UmlgConstraintViolation;
import org.umlg.runtime.validation.UmlgConstraintViolationException;
import java.util.List;
import java.util.Map;
/**
* This class validates what is being committed.
* On every UmlgNode is calls validateMultiplicities.
* futher it validates that a non root class has one and only one composite parent
*/
public class UmlgTransactionEventHandlerImpl implements UmlgTransactionEventHandler {
public UmlgTransactionEventHandlerImpl() {
super();
}
@Override
public void beforeCommit() {
try {
if (!TransactionThreadBypassValidationVar.get() && UMLG.get() != null && !UMLG.get().isInBatchMode()) {
// ((UmlgAdminGraph) UMLG.get()).incrementTransactionCount();
List entities = TransactionThreadEntityVar.get();
for (UmlgNode umlgNode : entities) {
if (umlgNode instanceof AssociationClassNode) {
VertexProperty
© 2015 - 2025 Weber Informatics LLC | Privacy Policy