Package org.neo4j.support.versioning

Examples of org.neo4j.support.versioning.Range


    private static void processCreatedNodes( long version, Iterable<Node> createdNodes )
    {
        for ( Node node : createdNodes )
        {
            Range range = Range.range( version );
            setVersion( node, range );
        }
    }
View Full Code Here


    private static void processCreatedRelationships( long version, Iterable<Relationship> createdRelationships )
    {
        for ( Relationship relationship : createdRelationships )
        {
            Range range = range( version );
            setVersion( relationship, range );
        }
    }
View Full Code Here

        return new VersionedNode( node, this );
    }

    public boolean hasValidVersion( PropertyContainer propertyContainer )
    {
        Range range = VersionContext.getVersion( propertyContainer );
        System.out.println("range: " + range);
        return range != null && range.contains( version );
    }
View Full Code Here

        Object to = propertyContainer.getProperty( VALID_TO_PROPERTY, null );
        if ( from == null || to == null )
        {
            return null;
        }
        return new Range( (Long) from, (Long) to );
    }
View Full Code Here

        return new Range( (Long) from, (Long) to );
    }

    private static Node getPropHolderNodeForVersion( Node node, long version )
    {
        Range range = getVersion( node );
        System.out.println("Seeking prop holder for: " + node);
        if ( !range.contains( version ) )
        {
            Relationship prevVersionRel = node.getSingleRelationship( PREV_VERSION_REL_TYPE, Direction.OUTGOING );
            if ( prevVersionRel == null )
            {
                throw new NotFoundException( "Version [" + version + "] not found." );
View Full Code Here

    }

    @Test
    public void intersectShouldGiveIdentityForSameRange()
    {
        Range range = range( 1, 3 );
        assertEquals( range, range.intersect( range ) );
    }
View Full Code Here

    ////// union ///////

    @Test
    public void unionShouldGiveIdentityForSameRange()
    {
        Range range = range( 1, 3 );
        assertEquals( asSet( range ), range.union( range ) );
    }
View Full Code Here

TOP

Related Classes of org.neo4j.support.versioning.Range

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.