Sha256: 9a28a1ef77a9f4be7a46984785537df4ad99237ae5a3e4b5a5488e79c01dee14

Contents?: true

Size: 1.29 KB

Versions: 8

Compression:

Stored size: 1.29 KB

Contents

module Neo4j::Embedded
  class EmbeddedRelationship
    class << self
      # This method is used to extend a Java Neo4j class so that it includes the same mixins as this class.
      def extend_java_class(java_clazz)
        java_clazz.class_eval do
          include Neo4j::Embedded::Property
          include Neo4j::EntityEquality
          include Neo4j::Relationship::Wrapper
          extend Neo4j::Core::TxMethods

          alias_method :_other_node, :getOtherNode

          def exist?
            !!graph_database.get_relationship_by_id(neo_id)
          rescue Java::OrgNeo4jGraphdb.NotFoundException
            nil
          end
          tx_methods :exist?

          def start_node
            _start_node.wrapper
          end
          tx_methods :start_node

          def _start_node
            getStartNode
          end

          def del
            delete
          end
          tx_methods :del

          def other_node(n)
            _other_node(n.neo4j_obj).wrapper
          end
          tx_methods :other_node

          def end_node
            _end_node.wrapper
          end
          tx_methods :end_node

          def _end_node
            getEndNode
          end

        end
      end
    end

    extend_java_class(Java::OrgNeo4jKernelImplCore::RelationshipProxy)

  end


end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
neo4j-core-3.0.0.alpha.13 lib/neo4j-embedded/embedded_relationship.rb
neo4j-core-3.0.0.alpha.12 lib/neo4j-embedded/embedded_relationship.rb
neo4j-core-3.0.0.alpha.11 lib/neo4j-embedded/embedded_relationship.rb
neo4j-core-3.0.0.alpha.10 lib/neo4j-embedded/embedded_relationship.rb
neo4j-core-3.0.0.alpha.9 lib/neo4j-embedded/embedded_relationship.rb
neo4j-core-3.0.0.alpha.8 lib/neo4j-embedded/embedded_relationship.rb
neo4j-core-3.0.0.alpha.7 lib/neo4j-embedded/embedded_relationship.rb
neo4j-core-3.0.0.alpha.6 lib/neo4j-embedded/embedded_relationship.rb