Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-29-2018 01:15 PM
I noticed that my String
@Properties were mapping fine, but not a FloatArray
. In fact, only first two strings get mapped – even if the third property is a String, it isn't mapped. However, this object also contains a FloatArray
, so I suspect that once the enumeration gets tripped up, it gives up entirely.
The root of the problem seems to start way down in how Java enumerates annotations with getDeclaredAnnotations
. Here's a simple class that exhibits the problem:
@NodeEntity
data class Point(@Id @GeneratedValue(strategy = UuidStrategy::class) val uuid: String? = null,
@Property(name = "name") val name: String? = null,
@Property(name = "vector") val vector: FloatArray? = null
uuid
and name
get properly mapped, vector
is always null. If I instead define Point
as a java class, everything works as expected. I also tried replacing FloatArray
with java.util.List<java.lang.Float>
, to no avail. Any ideas?
Thanks in advance, ya'll!
Solved! Go to Solution.
08-31-2018 02:11 PM
Derp, this was due to inadvertently declaring some as val
versus var
, and not an issue with K-types.
Solved.
08-31-2018 02:11 PM
Derp, this was due to inadvertently declaring some as val
versus var
, and not an issue with K-types.
Solved.
09-06-2018 06:12 AM
If you're using OGM with SDN, you can keep your standard attributes final and construct stuff via constructor with SDN 5.1 (Lovelace) and OGM 3.1.x. Not supported for relationships (collection attributes).
03-26-2019 01:05 AM
Does the same apply when you use OGM 3.1.x without SDN?
04-05-2019 03:52 AM
The constructor support only exists in Spring Data Neo4j right now.
04-10-2019 03:19 PM
That's a shame. Are there any plans for porting this functionality to OGM itself? If so, is there an issue/ticket where I can keep track of the progress?
All the sessions of the conference are now available online