Open asarkar opened 6 years ago
Yep, for idiomatic Kotlin, we'd most likely want them to be val
, however for that to work we need 'persistence constructors', which has just been added to OGM/SDN, hence issue #2.
I saw issue 2, but found no reference to persistence constructors. Would appreciate if you can post a link here.
That said, what's the problem with val
without persistence constructors?
The problem with val
defined attributes is that they end up as final
in terms of java code.
And this makes them not taken into account by OGM as valid attributes because of some current limitations. Details here
Like https://github.com/neo4j-examples/movies-kotlin-spring-data-neo4j/blob/master/src/main/java/movies/spring/data/neo4j/domain/model/persistent/entities/Movie.kt#L10
I've come to realize that declaring the properties as
val
makes queries not find previously saved entities, although I've not figured out why. Saving seems to work, but not loading.