Skip to content

Commit e4e12f0

Browse files
committed
docs: mention nested properties in the README
1 parent a0c9ca2 commit e4e12f0

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,10 +668,22 @@ for (var object : result.objects()) {
668668
}
669669
```
670670

671+
When _ingetsting_ data, Java records can be used to represent nested object properties:
672+
673+
```java
674+
record MusicVideo(@Property("link") String url, long runtimeSeconds) {}
675+
676+
songs.data.insert(Map.of(
677+
"title", "Billie Jean",
678+
"musicVideo", new MusicVideo("https://youtube.com/billijean", 294L),
679+
));
680+
```
681+
671682
We want to stress that this ORM's focus is on improving type-safety around object properties and simplifying serialization/deserialization. It is intentionally kept minimal and as such has the following limitations:
672683
673684
- **Does not support BLOB properties.** On the wire, blob properties are represented as base64-encoded strings, and both logically map to the Java's `String`. Presently there isn't a good way for the client to deduce which property type should be created, so it always maps `Sting -> TEXT`.
674685
- **Limited configuration options.** Vector indices, replication, multi-tenancy, and such need to be configured via a tucked builder in `.create(..., here -> here)`.
686+
- **Cannot include nested objects.** Java records can be used as nested properties in a `Map`, but cannot include nested properties themselves.
675687
- **Does not support cross-references.** Properties and Cross-References are conceptually and "physically" separated in Weaviate' client libraries, so doing something like in the snippet below is not supported.
676688

677689
```java

0 commit comments

Comments
 (0)