2

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

Steve Nester
  • 105
  • 8

1 Answers1

1

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 = _

See also Using a Java library with Scala reserved words

Community
  • 1
  • 1
drstevens
  • 2,903
  • 1
  • 21
  • 30