You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CODE_OF_CONDUCT.adoc
+11-31
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,7 @@
2
2
3
3
== Our Pledge
4
4
5
-
In the interest of fostering an open and welcoming environment, we as
6
-
contributors and maintainers pledge to making participation in our project and
7
-
our community a harassment-free experience for everyone, regardless of age, body
8
-
size, disability, ethnicity, gender identity and expression, level of experience,
9
-
nationality, personal appearance, race, religion, or sexual identity and
10
-
orientation.
5
+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
11
6
12
7
== Our Standards
13
8
@@ -33,40 +28,25 @@ Examples of unacceptable behavior by participants include:
33
28
34
29
== Our Responsibilities
35
30
36
-
Project maintainers are responsible for clarifying the standards of acceptable
37
-
behavior and are expected to take appropriate and fair corrective action in
38
-
response to any instances of unacceptable behavior.
31
+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
39
32
40
-
Project maintainers have the right and responsibility to remove, edit, or
41
-
reject comments, commits, code, wiki edits, issues, and other contributions
42
-
that are not aligned to this Code of Conduct, or to ban temporarily or
43
-
permanently any contributor for other behaviors that they deem inappropriate,
44
-
threatening, offensive, or harmful.
33
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
45
34
46
35
== Scope
47
36
48
-
This Code of Conduct applies both within project spaces and in public spaces
49
-
when an individual is representing the project or its community. Examples of
50
-
representing a project or community include using an official project e-mail
51
-
address, posting via an official social media account, or acting as an appointed
52
-
representative at an online or offline event. Representation of a project may be
53
-
further defined and clarified by project maintainers.
37
+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
38
+
Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
Representation of a project may be further defined and clarified by project maintainers.
54
40
55
41
== Enforcement
56
42
57
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
-
reported by contacting the project team. All
59
-
complaints will be reviewed and investigated and will result in a response that
60
-
is deemed necessary and appropriate to the circumstances. The project team is
61
-
obligated to maintain confidentiality with regard to the reporter of an incident.
43
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team.
44
+
All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances.
45
+
The project team is obligated to maintain confidentiality with regard to the reporter of an incident.
62
46
Further details of specific enforcement policies may be posted separately.
63
47
64
-
Project maintainers who do not follow or enforce the Code of Conduct in good
65
-
faith may face temporary or permanent repercussions as determined by other
66
-
members of the project's leadership.
48
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
67
49
68
50
== Attribution
69
51
70
-
This Code of Conduct is adapted from the https://www.contributor-covenant.org[Contributor
71
-
Covenant], version 1.4,
72
-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
52
+
This Code of Conduct is adapted from the https://www.contributor-covenant.org[Contributor Covenant], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
The directory src/eclipse has two files for use with code formatting, `eclipse-code-formatter.xml`
4
-
for the majority of the code formatting rules and `eclipse.importorder` to order the import
5
-
statements.
3
+
The directory src/eclipse has two files for use with code formatting, `eclipse-code-formatter.xml` for the majority of the code formatting rules and `eclipse.importorder` to order the import statements.
6
4
7
5
== Eclipse
8
6
Import these files by navigating `Windows -> Preferences` and then the menu items
Install the plugin `Eclipse Code Formatter`. You can find it by searching in "Browse Repositories",
14
-
under `Settings > Plugins` within IDEA (Once installed, you will need to reboot IDEA for it to take
15
-
effect).
11
+
Install the plugin `Eclipse Code Formatter`.
12
+
You can find it by searching in "Browse Repositories", under `Settings > Plugins` within IDEA (Once installed, you will need to reboot IDEA for it to take effect).
16
13
17
-
Then navigate to `Settings > Other Settings` (this might be under `Preferences` on Mac) and select
18
-
the Eclipse Code Formatter.
19
-
Select the `eclipse-code-formatter.xml` file for the field `Eclipse Java Formatter config file` and
20
-
the file `eclipse.importorder` for the field `Import order`.
21
-
Enable the `Eclipse code formatter` by clicking `Use the Eclipse code formatter` radio button at the
22
-
top of the page, then click the *OK* button.
14
+
Then navigate to `Settings > Other Settings` (this might be under `Preferences` on Mac) and select the Eclipse Code Formatter.
15
+
Select the `eclipse-code-formatter.xml` file for the field `Eclipse Java Formatter config file` and the file `eclipse.importorder` for the field `Import order`.
16
+
Enable the `Eclipse code formatter` by clicking `Use the Eclipse code formatter` radio button at the top of the page, then click the *OK* button.
23
17
24
-
* NOTE: If you configure the `Eclipse Code Formatter` from `File > Other Settings > Default
25
-
Settings`, it will set this policy across all of your IDEA projects.
18
+
* NOTE: If you configure the `Eclipse Code Formatter` from `File > Other Settings > Default Settings`, it will set this policy across all of your IDEA projects.
26
19
27
-
* IDEA's "Optimize imports on the fly" option turned on interferes with the Eclipse code formatter
28
-
import optimization. Consider disabling the option if optimization does not yield the expected
29
-
results.
20
+
* IDEA's "Optimize imports on the fly" option turned on interferes with the Eclipse code formatter import optimization.
21
+
Consider disabling the option if optimization does not yield the expected results.
30
22
31
23
= Contributing a patch
32
24
@@ -45,4 +37,5 @@ Guide]
45
37
46
38
6. Ensure your code has an appropriate set of unit tests which all pass
47
39
48
-
7. Submit a pull request. It will be approved and merged by a committer
Copy file name to clipboardexpand all lines: docs/src/main/asciidoc/config.adoc
+3-1
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ NOTE: Core properties, as described in <<spring-cloud-gcp-core,Spring Cloud GCP
53
53
In other words, if `spring.application.name` is `myapp` and `spring.profiles.active` is `prod`, the configuration should be called `myapp_prod`.
54
54
+
55
55
In order to do that, you should have the https://cloud.google.com/sdk/[Google Cloud SDK] installed, own a Google Cloud Project and run the following command:
56
-
+
56
+
[source]
57
57
----
58
58
gcloud init # if this is your first Google Cloud SDK run.
Copy file name to clipboardexpand all lines: docs/src/main/asciidoc/core.adoc
+3-3
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ It uses the `spring.cloud.gcp.credentials.location` property to locate the OAuth
68
68
Keep in mind this property is a Spring Resource, so the credentials file can be obtained from a number of https://docs.spring.io/spring/docs/current/spring-framework-reference/html/resources.html#resources-implementations[different locations] such as the file system, classpath, URL, etc.
69
69
The next example specifies the credentials location property in the file system.
@@ -109,14 +109,14 @@ To do that, specify a comma-delimited list of https://developers.google.com/iden
109
109
110
110
`spring.cloud.gcp.credentials.scopes` is a comma-delimited list of https://developers.google.com/identity/protocols/googlescopes[Google OAuth2 scopes] for Google Cloud Platform services that the credentials returned by the provided `CredentialsProvider` support.
Copy file name to clipboardexpand all lines: docs/src/main/asciidoc/datastore.adoc
+26-24
Original file line number
Diff line number
Diff line change
@@ -64,8 +64,7 @@ The following configuration options are available:
64
64
|===
65
65
| Name | Description | Required | Default value
66
66
| `spring.cloud.gcp.datastore.enabled` | Enables the Cloud Datastore client | No | `true`
67
-
| `spring.cloud.gcp.datastore.project-id` | GCP project ID where the Google Cloud Datastore API
68
-
is hosted, if different from the one in the <<spring-cloud-gcp-core,Spring Cloud GCP Core Module>>
67
+
| `spring.cloud.gcp.datastore.project-id` | GCP project ID where the Google Cloud Datastore API is hosted, if different from the one in the <<spring-cloud-gcp-core,Spring Cloud GCP Core Module>>
69
68
| No |
70
69
| `spring.cloud.gcp.datastore.credentials.location` | OAuth2 credentials for authenticating with the
71
70
Google Cloud Datastore API, if different from the ones in the
@@ -116,7 +115,8 @@ public class Trader {
116
115
}
117
116
----
118
117
119
-
Spring Data Cloud Datastore will ignore any property annotated with `@Transient`. These properties will not be written to or read from Cloud Datastore.
118
+
Spring Data Cloud Datastore will ignore any property annotated with `@Transient`.
119
+
These properties will not be written to or read from Cloud Datastore.
120
120
121
121
==== Constructors
122
122
@@ -220,13 +220,11 @@ In addition, all types that can be converted to the ones listed in the table by
220
220
221
221
Custom converters can be used extending the type support for user defined types.
222
222
223
-
. Converters need to implement the `org.springframework.core.convert.converter.Converter` interface in
224
-
both directions.
223
+
. Converters need to implement the `org.springframework.core.convert.converter.Converter` interface in both directions.
225
224
226
225
. The user defined type needs to be mapped to one of the basic types supported by Cloud Datastore.
227
226
228
-
. An instance of both Converters (read and write) needs to be passed to the `DatastoreCustomConversions` constructor,
229
-
which then has to be made available as a `@Bean` for `DatastoreCustomConversions`.
227
+
. An instance of both Converters (read and write) needs to be passed to the `DatastoreCustomConversions` constructor, which then has to be made available as a `@Bean` for `DatastoreCustomConversions`.
230
228
231
229
For example:
232
230
@@ -306,17 +304,15 @@ Elements are converted to Cloud Datastore supported types individually. `byte[]`
306
304
307
305
==== Custom Converter for collections
308
306
Users can provide converters from `List<?>` to the custom collection type.
309
-
Only read converter is necessary, the Collection API is used on the write side to convert a collection to
310
-
the internal list type.
307
+
Only read converter is necessary, the Collection API is used on the write side to convert a collection to the internal list type.
311
308
312
309
Collection converters need to implement the `org.springframework.core.convert.converter.Converter` interface.
313
310
314
311
315
312
Example:
316
313
317
314
Let's improve the Singer class from the previous example.
318
-
Instead of a field of type `Album`,
319
-
we would like to have a field of type `ImmutableSet<Album>`:
315
+
Instead of a field of type `Album`, we would like to have a field of type `ImmutableSet<Album>`:
320
316
321
317
[source, java]
322
318
----
@@ -703,7 +699,8 @@ In the example above the first two reads utilize keys, while the third is execut
703
699
704
700
===== Indexes
705
701
706
-
By default, all fields are indexed. To disable indexing on a particular field, `@Unindexed` annotation can be used.
702
+
By default, all fields are indexed.
703
+
To disable indexing on a particular field, `@Unindexed` annotation can be used.
// work with transactionDatastoreOperations here. It is also a DatastoreOperations object.
763
+
// Work with transactionDatastoreOperations here.
764
+
// It is also a DatastoreOperations object.
767
765
768
766
return "transaction completed";
769
767
}
770
768
);
771
769
}
772
770
----
773
771
774
-
The `performTransaction` method accepts a `Function` that is provided an instance of a `DatastoreOperations` object. The final returned value and type of the function is determined by the user.
772
+
The `performTransaction` method accepts a `Function` that is provided an instance of a `DatastoreOperations` object.
773
+
The final returned value and type of the function is determined by the user.
775
774
You can use this object just as you would a regular `DatastoreOperations` with an exception:
776
775
777
776
- It cannot perform sub-transactions.
@@ -861,7 +860,7 @@ Filtering parameters can be of types supported by your configured custom convert
861
860
[source, java]
862
861
----
863
862
public interface TradeRepository extends DatastoreRepository<Trade, String[]> {
864
-
List<Trader> findByAction(String action);
863
+
List<Trader> findByAction(String action);
865
864
866
865
int countByAction(String action);
867
866
@@ -892,7 +891,8 @@ Cloud Datastore only supports filter components joined by AND, and the following
892
891
After writing a custom repository interface specifying just the signatures of these methods, implementations are generated for you and can be used with an auto-wired instance of the repository.
893
892
Because of Cloud Datastore's requirement that explicitly selected fields must all appear in a composite index together, `find` name-based query methods are run as `SELECT *`.
894
893
895
-
Delete queries are also supported. For example, query methods such as `deleteByAction` or `removeByAction` delete entities found by `findByAction`.
894
+
Delete queries are also supported.
895
+
For example, query methods such as `deleteByAction` or `removeByAction` delete entities found by `findByAction`.
896
896
Delete queries are executed as separate read and delete operations instead of as a single transaction because Cloud Datastore cannot query in transactions unless ancestors for queries are specified.
897
897
As a result, `removeBy` and `deleteBy` name-convention query methods cannot be used inside transactions via either `performInTransaction` or `@Transactional` annotation.
898
898
@@ -902,13 +902,11 @@ Delete queries can have the following return types:
902
902
* A collection of entities that were deleted
903
903
* 'void'
904
904
905
-
Methods can have `org.springframework.data.domain.Pageable` parameter to control pagination and sorting,
906
-
or `org.springframework.data.domain.Sort` parameter to control sorting only.
905
+
Methods can have `org.springframework.data.domain.Pageable` parameter to control pagination and sorting, or `org.springframework.data.domain.Sort` parameter to control sorting only.
907
906
See https://docs.spring.io/spring-data/data-commons/docs/current/reference/html/#repositories.query-methods[Spring Data documentation] for details.
908
907
909
908
For returning multiple items in a repository method, we support Java collections as well as `org.springframework.data.domain.Page` and `org.springframework.data.domain.Slice`.
910
-
If a method's return type is `org.springframework.data.domain.Page`, the returned object will include current page,
911
-
total number of results and total number of pages.
909
+
If a method's return type is `org.springframework.data.domain.Page`, the returned object will include current page, total number of results and total number of pages.
912
910
913
911
NOTE: Methods that return `Page` execute an additional query to compute total number of pages.
914
912
Methods that return `Slice`, on the other hand, don't execute any additional queries and therefore are much more efficient.
@@ -948,14 +946,16 @@ The following parameter types are supported:
948
946
* `java.lang.Double`
949
947
* `java.lang.Long`
950
948
* `java.lang.String`
951
-
* `enum` values. These are queried as `String` values.
949
+
* `enum` values.
950
+
These are queried as `String` values.
952
951
953
952
With the exception of `Cursor`, array forms of each of the types are also supported.
954
953
955
954
If you would like to obtain the count of items of a query or if there are any items returned by the query, set the `count = true` or `exists = true` properties of the `@Query` annotation, respectively.
956
955
The return type of the query method in these cases should be an integer type or a boolean type.
957
956
958
-
Cloud Datastore provides provides the `SELECT __key__ FROM ...` special column for all kinds that retrieves the `Key`s of each row. Selecting this special `__key__` column is especially useful and efficient for `count` and `exists` queries.
957
+
Cloud Datastore provides provides the `SELECT __key__ FROM ...` special column for all kinds that retrieves the `Key`s of each row.
958
+
Selecting this special `__key__` column is especially useful and efficient for `count` and `exists` queries.
959
959
960
960
You can also query for non-entity types:
961
961
@@ -1034,7 +1034,8 @@ DatastoreRepository myRepo;
1034
1034
public String doWorkInsideTransaction() {
1035
1035
return myRepo.performTransaction(
1036
1036
transactionDatastoreRepo -> {
1037
-
// work with the single-transaction transactionDatastoreRepo here. This is a DatastoreRepository object.
1037
+
// Work with the single-transaction transactionDatastoreRepo here.
1038
+
// This is a DatastoreRepository object.
1038
1039
1039
1040
return "transaction completed";
1040
1041
}
@@ -1044,7 +1045,8 @@ public String doWorkInsideTransaction() {
1044
1045
1045
1046
==== Projections
1046
1047
1047
-
Spring Data Cloud Datastore supports {spring-data-commons-ref}/#projections[projections]. You can define projection interfaces based on domain types and add query methods that return them in your repository:
1048
+
Spring Data Cloud Datastore supports {spring-data-commons-ref}/#projections[projections].
1049
+
You can define projection interfaces based on domain types and add query methods that return them in your repository:
0 commit comments