Skip to content

Commit

Permalink
docs: enhance @Column section
Browse files Browse the repository at this point in the history
Signed-off-by: Maximillian Arruda <dearrudam@gmail.com>
  • Loading branch information
dearrudam committed Jun 10, 2023
1 parent 946e74f commit 5ae3928
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion spec/src/main/asciidoc/chapters/api/annotations.adoc
Expand Up @@ -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<String> 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]
----
Expand Down

0 comments on commit 5ae3928

Please sign in to comment.