relationship = relCache.get( relId );
if ( relationship != null )
{
return new RelationshipProxy( relId, this );
}
RelationshipData data = persistenceManager.loadLightRelationship(
relId );
if ( data == null )
{
throw new NotFoundException( "Relationship[" + relId + "]" );
}
int typeId = data.relationshipType();
RelationshipType type = getRelationshipTypeById( typeId );
if ( type == null )
{
throw new NotFoundException( "Relationship[" + data.getId()
+ "] exist but relationship type[" + typeId
+ "] not found." );
}
final long startNodeId = data.firstNode();
final long endNodeId = data.secondNode();
relationship = new RelationshipImpl( relId, startNodeId, endNodeId, type, false );
relCache.put( relId, relationship );
return new RelationshipProxy( relId, this );
}
finally