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

Was it helpful?

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

See also Using a Java library with Scala reserved words

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top