SqlgVertex putVertexIfAbsent ( SqlgGraph sqlgGraph , String schema , String table , Long id ) { RecordId recordId = RecordId . from ( SchemaTable . of ( schema , table ) , id ) ; SqlgVertex sqlgVertex ; if ( this . cacheVertices ) { sqlgVertex = this . vertexCache . get ( recordId ) ; if ( sqlgVertex == null ) { sqlgVertex = new SqlgVertex ( sqlgGraph , id , schema , table ) ; this . vertexCache . put ( recordId , sqlgVertex ) ; return sqlgVertex ; } } else { sqlgVertex = new SqlgVertex ( sqlgGraph , id , schema , table ) ; } return sqlgVertex ; }
The recordId is not referenced in the SqlgVertex . It is important that the value of the WeakHashMap does not reference the key .