Class Refactoring.RelationReversing

  • Enclosing class:
    Refactoring

    @OpenApiAll
    public static class Refactoring.RelationReversing
    extends java.lang.Object
    Reverses direction of a relationship. Switches relation source with target. An example how to reverse a relationship:
     // We have an arbitrary element which represents a relationship.
     Element element = ...;
    
     // Relationship reversing should be wrapped with session create/close calls.
     SessionManager sessionManager = SessionManager.getInstance();
     sessionManager.createSession("Reverse relation");
    
     // Reverse the relationship.
     Refactoring.RelationReversing.reverseRelationDirection(element);
    
     // Close the session.
     sessionManager.closeSession();
     
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void reverseRelationDirection​(Element relation)
      Reverses direction of a relationship.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RelationReversing

        public RelationReversing()
    • Method Detail

      • reverseRelationDirection

        public static void reverseRelationDirection​(Element relation)
        Reverses direction of a relationship. Switches relation source with target.
        Parameters:
        relation - element which represents a relation element.