protected Edge buildPotential11Edge(Vertex vertex1, Vertex vertex2, boolean fkToRef)
    {
        ModificationState state1 = vertex1.getEnvelope().getModificationState();
        ModificationState state2 = vertex2.getEnvelope().getModificationState();
        if (state1.needsUpdate() || state1.needsDelete())
        {
            if (state2.needsDelete())
            {
                // old version of (1) might point to (2)
                return new Edge(vertex1, vertex2, fkToRef ? POTENTIAL_EDGE_WEIGHT_WITH_FK : POTENTIAL_EDGE_WEIGHT);
            }
        }
        return null;
    }
protected Edge buildPotential11Edge ( Vertex vertex1 , Vertex vertex2 , boolean fkToRef ) { ModificationState state1 = vertex1 . getEnvelope ( ) . getModificationState ( ) ; ModificationState state2 = vertex2 . getEnvelope ( ) . getModificationState ( ) ; if ( state1 . needsUpdate ( ) || state1 . needsDelete ( ) ) { if ( state2 . needsDelete ( ) ) { return new Edge ( vertex1 , vertex2 , fkToRef ? POTENTIAL_EDGE_WEIGHT_WITH_FK : POTENTIAL_EDGE_WEIGHT ) ; } } return null ; }
Checks if the database operations associated with two object envelopes
that might have been related via an 1:1 (or n:1) reference before
the current transaction needs to be performed
in a particular order and if so builds and returns a corresponding
directed edge weighted with <code>POTENTIAL_EDGE_WEIGHT</code>.
The following cases are considered (* means object needs update, + means
object needs insert, - means object needs to be deleted):
<table>
<tr><td>(1)* -(1:1)-&gt; (2)*</td><td>no edge</td></tr>
<tr><td>(1)* -(1:1)-&gt; (2)+</td><td>no edge</td></tr>
<tr><td>(1)* -(1:1)-&gt; (2)-</td><td>(1)-&gt;(2) edge</td></tr>
<tr><td>(1)+ -(1:1)-&gt; (2)*</td><td>no edge</td></tr>
<tr><td>(1)+ -(1:1)-&gt; (2)+</td><td>no edge</td></tr>
<tr><td>(1)+ -(1:1)-&gt; (2)-</td><td>no edge</td></tr>
<tr><td>(1)- -(1:1)-&gt; (2)*</td><td>no edge</td></tr>
<tr><td>(1)- -(1:1)-&gt; (2)+</td><td>no edge</td></tr>
<tr><td>(1)- -(1:1)-&gt; (2)-</td><td>(1)-&gt;(2) edge</td></tr>
<table>
@param vertex1 object envelope vertex of the object that might have
hold the reference
@param vertex2 object envelope vertex of the potentially referenced
object
@return an Edge object or null if the two database operations can
be performed in any order