Skip to content

Commit

Permalink
add prefix to technical accessors, just like we used to in odb (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpollmeier authored Jun 27, 2024
1 parent cacc7f4 commit d5a3d18
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ class DomainClassesGenerator(schema: Schema) {
val neighborContexts = adjacentNodes.map { adjacentNode =>
val scaladoc = s"""/** ${adjacentNode.customStepDoc.getOrElse("")}
| * Traverse to ${adjacentNode.neighbor.name} via ${edge.name} $direction edge. */""".stripMargin
val defaultMethodName = camelCase(s"${adjacentNode.neighbor.name}_Via_${edge.name}_$direction")
val defaultMethodName = "_" + camelCase(s"${adjacentNode.neighbor.name}_Via_${edge.name}_$direction")
NeighborContext(adjacentNode, scaladoc, defaultMethodName, adjacentNode.customStepName)
}
NeighborContextsByEdge(direction, edge, neighborContexts)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ final class AccessNeighborsForNodeA(val node: nodes.NodeA) extends AnyVal {

/** Traverse to node_a via connected_to IN edge.
*/
def nodeAViaConnectedToIn: Iterator[nodes.NodeA] = connectedToIn.collectAll[nodes.NodeA]
def _nodeAViaConnectedToIn: Iterator[nodes.NodeA] = connectedToIn.collectAll[nodes.NodeA]

/** Connected neighbor node Traverse to node_a via connected_to OUT edge.
*/
@deprecated("please use connectedTo instead")
def nodeAViaConnectedToOut: Iterator[nodes.NodeA] = connectedTo
def _nodeAViaConnectedToOut: Iterator[nodes.NodeA] = connectedTo

/** Connected neighbor node Traverse to node_a via connected_to OUT edge.
*/
Expand All @@ -27,7 +27,7 @@ final class AccessNeighborsForNodeATraversal(val traversal: Iterator[nodes.NodeA

/** Traverse to node_a via connected_to IN edge.
*/
def nodeAViaConnectedToIn: Iterator[nodes.NodeA] = traversal.flatMap(_.nodeAViaConnectedToIn)
def _nodeAViaConnectedToIn: Iterator[nodes.NodeA] = traversal.flatMap(_._nodeAViaConnectedToIn)

/** Connected neighbor node Traverse to node_a via connected_to OUT edge.
*/
Expand All @@ -36,7 +36,7 @@ final class AccessNeighborsForNodeATraversal(val traversal: Iterator[nodes.NodeA
/** Connected neighbor node Traverse to node_a via connected_to OUT edge.
*/
@deprecated("please use connectedTo instead")
def nodeAViaConnectedToOut: Iterator[nodes.NodeA] = traversal.flatMap(_.nodeAViaConnectedToOut)
def _nodeAViaConnectedToOut: Iterator[nodes.NodeA] = traversal.flatMap(_._nodeAViaConnectedToOut)

def connectedToIn: Iterator[nodes.NodeA] = traversal.flatMap(_.connectedToIn)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ final class AccessNeighborsForArtist(val node: nodes.Artist) extends AnyVal {
/** Traverse to song via sungBy IN edge.
*/
@deprecated("please use sang instead")
def songViaSungbyIn: Iterator[nodes.Song] = sang
def _songViaSungbyIn: Iterator[nodes.Song] = sang

/** Traverse to song via sungBy IN edge.
*/
Expand All @@ -17,7 +17,7 @@ final class AccessNeighborsForArtist(val node: nodes.Artist) extends AnyVal {
/** Traverse to song via writtenBy IN edge.
*/
@deprecated("please use wrote instead")
def songViaWrittenbyIn: Iterator[nodes.Song] = wrote
def _songViaWrittenbyIn: Iterator[nodes.Song] = wrote

/** Traverse to song via writtenBy IN edge.
*/
Expand All @@ -37,7 +37,7 @@ final class AccessNeighborsForArtistTraversal(val traversal: Iterator[nodes.Arti
/** Traverse to song via sungBy IN edge.
*/
@deprecated("please use sang instead")
def songViaSungbyIn: Iterator[nodes.Song] = traversal.flatMap(_.songViaSungbyIn)
def _songViaSungbyIn: Iterator[nodes.Song] = traversal.flatMap(_._songViaSungbyIn)

/** Traverse to song via writtenBy IN edge.
*/
Expand All @@ -46,7 +46,7 @@ final class AccessNeighborsForArtistTraversal(val traversal: Iterator[nodes.Arti
/** Traverse to song via writtenBy IN edge.
*/
@deprecated("please use wrote instead")
def songViaWrittenbyIn: Iterator[nodes.Song] = traversal.flatMap(_.songViaWrittenbyIn)
def _songViaWrittenbyIn: Iterator[nodes.Song] = traversal.flatMap(_._songViaWrittenbyIn)

def sungbyIn: Iterator[nodes.Song] = traversal.flatMap(_.sungbyIn)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ final class AccessNeighborsForSong(val node: nodes.Song) extends AnyVal {
/** Traverse to artist via sungBy OUT edge.
*/
@deprecated("please use sungBy instead")
def artistViaSungbyOut: Iterator[nodes.Artist] = sungBy
def _artistViaSungbyOut: Iterator[nodes.Artist] = sungBy

/** Traverse to artist via sungBy OUT edge.
*/
Expand All @@ -17,20 +17,20 @@ final class AccessNeighborsForSong(val node: nodes.Song) extends AnyVal {
/** Traverse to artist via writtenBy OUT edge.
*/
@deprecated("please use writtenBy instead")
def artistViaWrittenbyOut: Iterator[nodes.Artist] = writtenBy
def _artistViaWrittenbyOut: Iterator[nodes.Artist] = writtenBy

/** Traverse to artist via writtenBy OUT edge.
*/
def writtenBy: Iterator[nodes.Artist] = writtenbyOut.collectAll[nodes.Artist]

/** Traverse to song via followedBy IN edge.
*/
def songViaFollowedbyIn: Iterator[nodes.Song] = followedbyIn.collectAll[nodes.Song]
def _songViaFollowedbyIn: Iterator[nodes.Song] = followedbyIn.collectAll[nodes.Song]

/** Traverse to song via followedBy OUT edge.
*/
@deprecated("please use followedBy instead")
def songViaFollowedbyOut: Iterator[nodes.Song] = followedBy
def _songViaFollowedbyOut: Iterator[nodes.Song] = followedBy

/** Traverse to song via followedBy OUT edge.
*/
Expand All @@ -54,7 +54,7 @@ final class AccessNeighborsForSongTraversal(val traversal: Iterator[nodes.Song])
/** Traverse to artist via sungBy OUT edge.
*/
@deprecated("please use sungBy instead")
def artistViaSungbyOut: Iterator[nodes.Artist] = traversal.flatMap(_.artistViaSungbyOut)
def _artistViaSungbyOut: Iterator[nodes.Artist] = traversal.flatMap(_._artistViaSungbyOut)

/** Traverse to artist via writtenBy OUT edge.
*/
Expand All @@ -63,11 +63,11 @@ final class AccessNeighborsForSongTraversal(val traversal: Iterator[nodes.Song])
/** Traverse to artist via writtenBy OUT edge.
*/
@deprecated("please use writtenBy instead")
def artistViaWrittenbyOut: Iterator[nodes.Artist] = traversal.flatMap(_.artistViaWrittenbyOut)
def _artistViaWrittenbyOut: Iterator[nodes.Artist] = traversal.flatMap(_._artistViaWrittenbyOut)

/** Traverse to song via followedBy IN edge.
*/
def songViaFollowedbyIn: Iterator[nodes.Song] = traversal.flatMap(_.songViaFollowedbyIn)
def _songViaFollowedbyIn: Iterator[nodes.Song] = traversal.flatMap(_._songViaFollowedbyIn)

/** Traverse to song via followedBy OUT edge.
*/
Expand All @@ -76,7 +76,7 @@ final class AccessNeighborsForSongTraversal(val traversal: Iterator[nodes.Song])
/** Traverse to song via followedBy OUT edge.
*/
@deprecated("please use followedBy instead")
def songViaFollowedbyOut: Iterator[nodes.Song] = traversal.flatMap(_.songViaFollowedbyOut)
def _songViaFollowedbyOut: Iterator[nodes.Song] = traversal.flatMap(_._songViaFollowedbyOut)

def followedbyIn: Iterator[nodes.Song] = traversal.flatMap(_.followedbyIn)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ final class AccessNeighborsForBaseNode(val node: nodes.BaseNode) extends AnyVal

/** Traverse to base_node via connected_to IN edge.
*/
def baseNodeViaConnectedToIn: Iterator[nodes.BaseNode] = connectedToIn.collectAll[nodes.BaseNode]
def _baseNodeViaConnectedToIn: Iterator[nodes.BaseNode] = connectedToIn.collectAll[nodes.BaseNode]

/** Traverse to base_node via connected_to OUT edge.
*/
@deprecated("please use connectedTo instead")
def baseNodeViaConnectedToOut: Iterator[nodes.BaseNode] = connectedTo
def _baseNodeViaConnectedToOut: Iterator[nodes.BaseNode] = connectedTo

/** Traverse to base_node via connected_to OUT edge.
*/
Expand All @@ -27,7 +27,7 @@ final class AccessNeighborsForBaseNodeTraversal(val traversal: Iterator[nodes.Ba

/** Traverse to base_node via connected_to IN edge.
*/
def baseNodeViaConnectedToIn: Iterator[nodes.BaseNode] = traversal.flatMap(_.baseNodeViaConnectedToIn)
def _baseNodeViaConnectedToIn: Iterator[nodes.BaseNode] = traversal.flatMap(_._baseNodeViaConnectedToIn)

/** Traverse to base_node via connected_to OUT edge.
*/
Expand All @@ -36,7 +36,7 @@ final class AccessNeighborsForBaseNodeTraversal(val traversal: Iterator[nodes.Ba
/** Traverse to base_node via connected_to OUT edge.
*/
@deprecated("please use connectedTo instead")
def baseNodeViaConnectedToOut: Iterator[nodes.BaseNode] = traversal.flatMap(_.baseNodeViaConnectedToOut)
def _baseNodeViaConnectedToOut: Iterator[nodes.BaseNode] = traversal.flatMap(_._baseNodeViaConnectedToOut)

def connectedToIn: Iterator[nodes.BaseNode] = traversal.flatMap(_.connectedToIn)

Expand Down

0 comments on commit d5a3d18

Please sign in to comment.