remove ilo run command file
[yosql.git] / yosql-website / content / configuration / annotations / fieldMembers.md
blobaa9b418475017c287e1ac509665fdcec58e36827
1 ---
2 title: fieldMembers
3 date: 2019-09-27T18:51:08+02:00
4 menu:
5   main:
6     parent: Annotations
7 categories:
8   - Configuration
9 tags:
10   - annotations
11   - fields
12 ---
14 Controls which `@Generated` annotation members should be added to generated fields. Defaults to `WITHOUT_DATE` which uses all members except `date` in order to support reproducible builds (otherwise the generated classes would change on each generation).
16 ## Configuration Options
18 ### Option: 'WITHOUT_DATE'
20 The default value of the `fieldMembers` configuration option is `WITHOUT_DATE`. Setting the option to `WITHOUT_DATE` therefore produces the same code generated as the default configuration.
22 ```java
23 package com.example.persistence;
25 import javax.annotation.processing.Generated;
27 public class SomeRepository {
29     @Generated(
30         value = "YoSQL",
31         comments = "DO NOT MODIFY - automatically generated by YoSQL"
32     )
33     private Object someField;
34     
35     // ... rest of generated code
38 ```
40 ### Option: 'ALL'
42 Changing the `fieldMembers` configuration option to `ALL` outputs all annotation members.
44 ```java
45 package com.example.persistence;
47 import javax.annotation.processing.Generated;
49 public class SomeRepository {
51     @Generated(
52         value = "YoSQL",
53         date = "<current_timestamp>",
54         comments = "DO NOT MODIFY - automatically generated by YoSQL"
55     )
56     private Object someField;
57   
58     // ... rest of generated code
61 ```
63 ### Option: 'NONE'
65 Changing the `fieldMembers` configuration option to `NONE` outputs no annotation members.
67 ```java
68 package com.example.persistence;
70 import javax.annotation.processing.Generated;
72 public class SomeRepository {
74   @Generated
75   private Object someField;
77   // ... rest of generated code
80 ```
82 ### Option: 'VALUE'
84 Changing the `fieldMembers` configuration option to `VALUE` outputs only the `value` member.
86 ```java
87 package com.example.persistence;
89 import javax.annotation.processing.Generated;
91 public class SomeRepository {
93   @Generated(
94       value = "YoSQL"
95   )
96   private Object someField;
98   // ... rest of generated code
103 ### Option: 'DATE'
105 Changing the `fieldMembers` configuration option to `DATE` outputs only the `date` member.
107 ```java
108 package com.example.persistence;
110 import javax.annotation.processing.Generated;
112 public class SomeRepository {
114   @Generated(
115       date = "<current_timestamp>"
116   )
117   private Object someField;
119   // ... rest of generated code
124 ### Option: 'COMMENT'
126 Changing the `fieldMembers` configuration option to `COMMENT` outputs only the `comment` member.
128 ```java
129 package com.example.persistence;
131 import javax.annotation.processing.Generated;
133 public class SomeRepository {
135   @Generated(
136       comments = "DO NOT MODIFY - automatically generated by YoSQL"
137   )
138   private Object someField;
140   // ... rest of generated code
145 ## Related Options
147 - [annotateFields](../annotatefields/): Controls whether the `@Generated` annotation should be added at all.
148 - [fieldComment](../fieldcomment/): Controls the comment used in the `@Generated` annotation.
149 - [generatorName](../generatorname/): Controls the value used in the `@Generated` annotation.
151 ## Tooling
153 ### Maven
155 In order to use `YoSQL` together with [Maven](https://maven.apache.org/), take a look at the tooling [documentation
156 for Maven](/tooling/maven/).
158 {{< maven/config/annotations/fieldMembers >}}
160 ### Gradle
162 In order to use `YoSQL` together with [Gradle](https://gradle.org/), take a look at the tooling [documentation for Gradle](/tooling/gradle/).
164 ```groovy
165 plugins {
166   id("wtf.metio.yosql")
169 yosql {
170   annotations {
171     fieldMembers = ALL
172   }
176 ### Bazel
178 In order to use `YoSQL` together with [Bazel](https://bazel.build/), take a look at the tooling [documentation for
179 Bazel](/tooling/bazel/).
181 ### CLI
183 In order to use YoSQL on the command line, take a look at the tooling [documentation for CLI](/tooling/cli/).
185 ```shell
186 $ yosql --annotations-field-members=ALL
189 The shorter form is available as well:
191 ```shell
192 $ yosql --field-members=ALL