Skip to content

Commit

Permalink
Added comments to NameConverter
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Feb 1, 2023
1 parent a4d268e commit a3e6ad9
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,18 @@ class NameConverter : CompositeAttributeConverter<Name> {

override fun toGraphProperties(value: Name): MutableMap<String, *> {
val map = mutableMapOf<String, String>()
map[FIELD_NAME] = value.toString()
// The full name of the node
map[FIELD_FULL_NAME] = value.toString()

// The local name of the node
map[FIELD_LOCAL_NAME] = value.localName

// The delimiter
map[FIELD_NAME_DELIMITER] = value.delimiter

// For reasons such as backwards compatibility and the fact that Neo4J likes to display nodes in the UI with a "name" field as default, we also persist the full name (aka the toString() representation) as "name"
map[FIELD_NAME] = value.toString()

return map
}

Expand Down

0 comments on commit a3e6ad9

Please sign in to comment.