File tree 1 file changed +38
-0
lines changed
documentation/src/main/asciidoc/reference
1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -576,6 +576,44 @@ If you have very particular requirements, you can check out the Javadoc of
576
576
`ReactiveIdentifierGenerator` for information on how to implement your own
577
577
custom reactive identifier generator.
578
578
579
+ === JSON Mapping
580
+
581
+ :orm-json-basic-mapping: https://docs.jboss.org/hibernate/orm/6.6/userguide/html_single/Hibernate_User_Guide.html#basic-mapping-json
582
+ :orm-json-embeddable-mapping: https://docs.jboss.org/hibernate/orm/6.6/userguide/html_single/Hibernate_User_Guide.html#_jsonxml_aggregate_embeddable_mapping
583
+ :string-to-json-converter: https://github.com/hibernate/hibernate-reactive/blob/main/hibernate-reactive-core/src/test/java/org/hibernate/reactive/types/StringToJsonConverter.java
584
+
585
+ Like in Hibernate ORM, it's possible to map a JSON field using the {orm-json-basic-mapping}[SqlTypes.JSON]
586
+ or {orm-json-embeddable-mapping}[an embeddable].
587
+
588
+ IMPORTANT: Supports for JSON is limited to PostgreSQL and MySQL.
589
+ Only PostgreSQL supports mapping a JSON using an embeddable
590
+
591
+ Hibernate Reactive will recognize fields of type `io.vertx.core.json.JsonObject`
592
+ as JSON columns:
593
+
594
+ [source,java]
595
+ ----
596
+ @Entity
597
+ class Example {
598
+
599
+ JsonObject jsonField;
600
+ }
601
+ ----
602
+
603
+ Finally, the {string-to-json-converter}[org.hibernate.reactive.StringToJsonConverter] converter is available
604
+ for mapping a string to a JSON column:
605
+
606
+ [source,java]
607
+ ----
608
+ @Entity
609
+ class Example {
610
+
611
+ @Convert(converter = StringToJsonConverter.class)
612
+ String json;
613
+
614
+ }
615
+ ----
616
+
579
617
=== Custom types
580
618
581
619
Hibernate custom types based on the `UserType` interface are targeted toward
You can’t perform that action at this time.
0 commit comments