@@ -539,7 +539,7 @@ class CodeGen(schema: Schema) {
539
539
val entireNodeHierarchy : Set [AbstractNodeType ] = neighbor.subtypes(schema.allNodeTypes.toSet) ++ (neighbor.extendzRecursively :+ neighbor)
540
540
entireNodeHierarchy.map { neighbor =>
541
541
val accessorName = adjacentNode.customStepName.getOrElse(
542
- s " _ ${camelCase(neighbor.name)}Via ${edge.className.capitalize}${camelCaseCaps(direction.toString)}"
542
+ s " ${camelCase(neighbor.name)}Via ${edge.className.capitalize}${camelCaseCaps(direction.toString)}"
543
543
)
544
544
val accessorImpl0 = s " $edgeAccessorName.collectAll[ ${neighbor.className}] "
545
545
val cardinality = adjacentNode.cardinality
@@ -558,6 +558,10 @@ class CodeGen(schema: Schema) {
558
558
| */ ${docAnnotationMaybe(adjacentNode.customStepDoc)}
559
559
|def $accessorName: ${fullScalaType(neighbor, cardinality)} =
560
560
| $accessorImpl1
561
+ |
562
+ |@deprecated("please use ` $accessorName`", "June 2024")
563
+ |def _ $accessorName = $accessorName
564
+ |
561
565
| """ .stripMargin
562
566
}
563
567
}.distinct.mkString(lineSeparator)
@@ -1013,9 +1017,14 @@ class CodeGen(schema: Schema) {
1013
1017
s """ /** ${neighborNodeInfo.customStepDoc.getOrElse(" " )}
1014
1018
| * Traverse to ${neighborNodeInfo.neighborNode.name} via ${neighborNodeInfo.edge.name} $direction edge.
1015
1019
| */ ${docAnnotationMaybe(neighborNodeInfo.customStepDoc)}
1016
- |def $accessorNameForNode: ${neighborNodeInfo.returnType} = get(). $accessorNameForNode""" .stripMargin
1020
+ |def $accessorNameForNode: ${neighborNodeInfo.returnType} = get(). $accessorNameForNode
1021
+ |
1022
+ |@deprecated("please use ` $accessorNameForNode`", "June 2024")
1023
+ |def _ $accessorNameForNode = $accessorNameForNode
1024
+ | """ .stripMargin
1017
1025
}.mkString(lineSeparator)
1018
1026
1027
+
1019
1028
val neighborNodeClass = neighborInfo.deriveNeighborNodeType.getOrElse(schema.anyNode).className
1020
1029
s """ def $edgeAccessorName: Iterator[ $neighborNodeClass] = get(). $edgeAccessorName
1021
1030
|override def _ $edgeAccessorName = get()._ $edgeAccessorName
@@ -1090,11 +1099,16 @@ class CodeGen(schema: Schema) {
1090
1099
case EdgeType .Cardinality .ZeroOrOne => s " $accessorImpl0.nextOption() "
1091
1100
case _ => accessorImpl0
1092
1101
}
1093
- s " def ${accessorName(neighborNodeInfo)}: ${neighborNodeInfo.returnType} = $accessorImpl1"
1102
+ val accessorNameForNode = accessorName(neighborNodeInfo)
1103
+ s """ @deprecated("please use ` $accessorNameForNode`", "June 2024")
1104
+ |def _ $accessorNameForNode = $accessorNameForNode
1105
+ |
1106
+ |def $accessorNameForNode: ${neighborNodeInfo.returnType} = $accessorImpl1""" .stripMargin
1094
1107
}.mkString(lineSeparator)
1095
1108
1096
1109
s """ def $edgeAccessorName: Iterator[ $neighborType] = createAdjacentNodeScalaIteratorByOffSet[ $neighborType]( $offsetPosition)
1097
1110
|override def _ $edgeAccessorName = createAdjacentNodeScalaIteratorByOffSet[StoredNode]( $offsetPosition)
1111
+ |
1098
1112
| $nodeAccessors
1099
1113
| """ .stripMargin
1100
1114
}.mkString(lineSeparator)
0 commit comments