You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit combines Spring Data Commons' Vector type
with the Neo4j vector functionality.
Fields defined as Spring Data Commons `Vector` will get
persisted through the `setNodeVectorProperty` procedure.
Closes#3003
Signed-off-by: Gerrit Meier <[email protected]>
Copy file name to clipboardExpand all lines: src/main/antora/modules/ROOT/pages/appendix/conversions.adoc
+15
Original file line number
Diff line number
Diff line change
@@ -188,6 +188,10 @@ If you require the time zone, use a type that supports it (i.e. `ZoneDateTime`)
188
188
|Point with CRS 4326 and x/y corresponding to lat/long
189
189
|
190
190
191
+
|`org.springframework.data.domain.Vector`
192
+
|persisted through `setNodeVectorProperty`
193
+
|
194
+
191
195
|Instances of `Enum`
192
196
|String (The name value of the enum)
193
197
|
@@ -210,6 +214,17 @@ If you require the time zone, use a type that supports it (i.e. `ZoneDateTime`)
210
214
211
215
|===
212
216
217
+
[[build-in.conversions.vector]]
218
+
=== Vector type
219
+
Spring Data has its own type for vector representation `org.springframework.data.domain.Vector`.
220
+
While this can be used as a wrapper around a `float` or `double` array, Spring Data Neo4j supports only the `double` variant right now.
221
+
From a user perspective, it is possible to only define the `Vector` interface on the property definition and use either `double` or `float`.
222
+
Neo4j will store both `double` and `float` variants as a 64-bit Cypher `FLOAT` value, which is consistent with values persisted through Cypher and the dedicated `setNodeVectorProperty` function that Spring Data Neo4j uses to persist the property.
223
+
224
+
NOTE: Spring Data Neo4j only allows one `Vector` property to be present in an entity definition.
225
+
226
+
NOTE: Please be aware that a persisted `float` value differs from a read back value due to the nature of floating numbers.
0 commit comments