#**### multi
#**##if ( $targetMulti.ContainerObject.equals($source) )
#*   *##if ( $targetMulti.Type == 2 )## DIRECT
#*      *##set( $mparam = $targetMulti.SourceObject.ObjectName )
#*      *##set( $multi = "NextOf" )
#*   *##elseif ( $targetMulti.Type == 3 )## INDEX
#*      *##set( $mparam = "$targetMulti.SourceObject.ObjectName" )
#*      *##set( $mIndex = "$targetMulti.Index" )
#*      *##set( $multi = "NextOf" )
#*   *##elseif ( $targetMulti.Type == 4 )## INDIRECT
#*      *##set( $mparamTarget = "$targetMulti.TargetObject.ObjectName")
#*      *##set( $mparamSource = "$targetMulti.SourceObject.ObjectName" )
#*      *##set( $indmulti = "isAfterOf" )
#*   *##end
#**##elseif ( $sourceMulti.ContainerObject.equals($source) )
#*   *##if ( $sourceMulti.Type == 2 )## DIRECT
#*      *##set( $mparam = $sourceMulti.TargetObject.ObjectName )
#*      *##set( $multi = "PreviousOf" )
#*   *##elseif ( $sourceMulti.Type == 3 )## INDEX
#*      *##set( $mparam = "$sourceMulti.TargetObject.ObjectName" )
#*      *##set ( $mIndex = "$sourceMulti.Index" )
#*      *##set( $multi = "PreviousOf" )
#*   *##elseif ( $sourceMulti.Type == 4 )## INDIRECT
#*      *##set( $mparamSource = "$sourceMulti.SourceObject.ObjectName")
#*      *##set ($mparamTarget = "$sourceMulti.TargetObject.ObjectName" )
#*      *##set( $indmulti = "isBeforeOf" )
#*   *##end	
#**##end
#**### copied from check.vm
#**##set( $linkNegative = $link.isNegative() )
#**#// check multi link
#**##if($toOne || $multi || $indmulti)
#**#fujaba_index = #if($ref)${getX}#else${getX1}"${getXparameter}"${getX2}#end.indexOf(#if($indmulti)$mparamTarget#else$mparam#end);
#**##end
#**#JavaSDM.ensure ( ##
#**##if ( $linkNegative )!(#end
#**##if ( $toOne || $multi )
#*   *##if($mIndex)
#*   *#${targetName}.equals (((fujaba_index >= 0) && (0 < $mIndex) && ($mIndex < #if($ref)${getX}#else${getX1}"${getXparameter}"${getX2}#end.size()- fujaba_index)) ? #if($ref)${getX}#else${getX1}"${getXparameter}"${getX2}#end.get(fujaba_index + $mIndex) : null)##
#*   *##else
#*   *#${targetName}.equals ((fujaba_index >= 0 && fujaba_index < #if($ref)${getX}#else${getX1}"${getXparameter}"${getX2}#end.size()-1) ? #if($ref)${getX}#else${getX1}"${getXparameter}"${getX2}#end.get(fujaba_index + 1) : null)##
#*   *##end
#**##elseif ( $indmulti )
#**#fujaba_index#if($indmulti == "isAfterOf") > #else < #end#if($ref)${getX}#else${getX1}"${getXparameter}"${getX2}#end.indexOf($mparamSource)##
#**##else
#**##if($ref)${getX}#else${getX1}"${getXparameter}"${getX2}#end.contains(#if($range)$range, #end
#*   *#$targetName)##
#**##end
#**##if ( $targetNegative ))#end
#**# );
#**# 