From 5ae39281f3e1eeccb84817d0cd9ea570892be968 Mon Sep 17 00:00:00 2001 From: Maximillian Arruda Date: Sat, 10 Jun 2023 03:35:45 -0300 Subject: [PATCH] docs: enhance `@Column` section Signed-off-by: Maximillian Arruda --- .../asciidoc/chapters/api/annotations.adoc | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/spec/src/main/asciidoc/chapters/api/annotations.adoc b/spec/src/main/asciidoc/chapters/api/annotations.adoc index 86a613bf7..87256cb00 100644 --- a/spec/src/main/asciidoc/chapters/api/annotations.adoc +++ b/spec/src/main/asciidoc/chapters/api/annotations.adoc @@ -91,7 +91,27 @@ The serialization method may differ depending on the NoSQL vendor. ==== @Column -This annotation defines which fields that belong to an Entity will be persisted. There is a single attribute that specifies that name in Database with a default value that is the field name as declared in the class. +This annotation defines which fields that belong to an Entity will be persisted. The field name specifies the column name by default. + +[source,java] +---- +@Entity +public class Person { + @Column + private String nickname; + + @Column + private String name; + + @Column + private List phones; + + // ignored for Jakarta NoSQL + private String address; +} +---- + +If any customization is needed, it just set the single attribute of the annotation to specify the desired name: [source,java] ----