]
Brian Carothers resolved DNA-448.
---------------------------------
Resolution: Done
Assignee: Brian Carothers
Resolving the defect based on the prior patch and the incorporation of said patch into the
new graph/session cache code.
The 'createIfMissing()' methods should be removed from the
Graph API
--------------------------------------------------------------------
Key: DNA-448
URL:
https://jira.jboss.org/jira/browse/DNA-448
Project: DNA
Issue Type: Bug
Components: API, Graph
Affects Versions: 0.4
Reporter: Randall Hauch
Assignee: Brian Carothers
Fix For: 0.6
Attachments: DNA-448.patch
This issue stemmed from DNA-443. The existence of the "createIfMissing()"
methods that exist only on the Graph interface (and not the Graph.Batch interface) mask
the existence of newer, more powerful methods that can do the same thing on Graph and
Graph.Batch:
graph.create(path).ifAbsent()...
or
batch.create(path).ifAbsent()...
In fact, this style makes available several other methods than "ifAbsent()",
such as "orUpdate()", "byAppending()", and "orReplace()".
These correspond to the different NodeConflictBehavior options.
Unfortunately, the 'create()' methods just return the Conjunction interface,
while the 'createIfMissing()' methods return the "GetNodeConjunction"
interface (which extends Conjunction and adds the "andReturn():Node" method).
And there is at least one place where 'createIfMissing(...).andReturn()' is being
called. Looking at this now, I'm not sure why the Graph.create(...) methods can't
return the GetNodeConjunction interface. This would allow the existing uses of the
'createIfMissing(...).andReturn()' to replace them with
'create(...).ifAbsent().andReturn()' calls, and enable the removal of the
'createIfMissing(...)' methods.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: