remove ilo run command file
[yosql.git] / yosql-website / content / configuration / annotations / classMembers.md
blobc8ff096b1f8ea98bd075fd80eee5a09b9c09eb11
1 ---
2 title: classMembers
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   - classes
12 ---
14 Controls which `@Generated` annotation members should be added to generated classes. 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 `classMembers` 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 @Generated(
28     value = "YoSQL",
29     comments = "DO NOT MODIFY - automatically generated by YoSQL"
31 public class SomeRepository {
33     // ... rest of generated code
36 ```
38 ### Option: 'ALL'
40 Changing the `classMembers` configuration option to `ALL` outputs all annotation members.
42 ```java
43 package com.example.persistence;
45 import javax.annotation.processing.Generated;
47 @Generated(
48     value = "YoSQL",
49     date = "<current_timestamp>",
50     comments = "DO NOT MODIFY - automatically generated by YoSQL"
52 public class SomeRepository {
54   // ... rest of generated code (same as above)
57 ```
59 ### Option: 'NONE'
61 Changing the `classMembers` configuration option to `NONE` outputs no annotation members.
63 ```java
64 package com.example.persistence;
66 import javax.annotation.processing.Generated;
68 @Generated
69 public class SomeRepository {
71     // ... rest of generated code (same as above)
74 ```
76 ### Option: 'VALUE'
78 Changing the `classMembers` configuration option to `VALUE` outputs only the `value` member.
80 ```java
81 package com.example.persistence;
83 import javax.annotation.processing.Generated;
85 @Generated(
86     value = "YoSQL"
88 public class SomeRepository {
90   // ... rest of generated code (same as above)
93 ```
95 ### Option: 'DATE'
97 Changing the `classMembers` configuration option to `DATE` outputs only the `date` member.
99 ```java
100 package com.example.persistence;
102 import javax.annotation.processing.Generated;
104 @Generated(
105     date = "<current_timestamp>"
107 public class SomeRepository {
109   // ... rest of generated code (same as above)
114 ### Option: 'COMMENT'
116 Changing the `classMembers` configuration option to `COMMENT` outputs only the `comment` member.
118 ```java
119 package com.example.persistence;
121 import javax.annotation.processing.Generated;
123 @Generated(
124     comment = "DO NOT MODIFY - automatically generated by YoSQL"
126 public class SomeRepository {
128   // ... rest of generated code (same as above)
133 ## Related Options
135 - [annotateClasses](../annotateclasses/): Controls whether the `@Generated` annotation should be added at all.
136 - [classComment](../classcomment/): Controls the comment used in the `@Generated` annotation.
137 - [generatorName](../generatorname/): Controls the value used in the `@Generated` annotation.
139 ## Tooling
141 ### Maven
143 In order to use `YoSQL` together with [Maven](https://maven.apache.org/), take a look at the tooling [documentation
144 for Maven](/tooling/maven/).
146 {{< maven/config/annotations/classMembers >}}
148 ### Gradle
150 In order to use `YoSQL` together with [Gradle](https://gradle.org/), take a look at the tooling [documentation for Gradle](/tooling/gradle/).
152 ```groovy
153 plugins {
154   id("wtf.metio.yosql")
157 yosql {
158   annotations {
159     classMembers = ALL
160   }
164 ### Bazel
166 In order to use `YoSQL` together with [Bazel](https://bazel.build/), take a look at the tooling [documentation for
167 Bazel](/tooling/bazel/).
169 ### CLI
171 In order to use YoSQL on the command line, take a look at the tooling [documentation for CLI](/tooling/cli/).
173 ```shell
174 $ yosql --annotations-class-members=ALL
177 The shorter form is available as well:
179 ```shell
180 $ yosql --class-members=ALL