Using @RelatedTo with Spring Data Neo4j and Scala - annotation arg is Scala reserved word
-
20-12-2019 - |
Question
I am using Spring Data for Neo4j with Scala and have the following dilemma. I'm trying to use the @RelatedTo annotation as specified:
@RelatedTo(type = "in") var state: String = _
but of course this doesn't compile because type is a Scala reserved word.
Are there any workarounds or do I just have to write a Scala wrapper for @RelatedTo with a different parameter name or something similar?
Thanks! Steve Nester
Solution
I don't really know anything about those libraries/frameworks, but you should be able to use backticks. Try this:
@RelatedTo(`type` = "in") var state: String = _
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow