GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add App Engine Datastore raw APIs sample. by tswast · Pull Request #171 · GoogleCloudPlatform/java-docs-samples

Conversation

@tswast

@tswast tswast commented Apr 21, 2016

Copy link
Copy Markdown
Contributor

These samples are pulled from the projection query and structuring for strong consistency pages.

I will add additional code to this sample as I convert the other pages.

@lesv PTAL.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tswast tswast assigned lesv Apr 21, 2016
tmatsuo
tmatsuo reviewed Apr 21, 2016
View reviewed changes
Comment thread appengine/datastore/src/main/java/com/example/appengine/GuestbookStrong.java Outdated

GuestbookStrong(
String guestbookName,
DatastoreService datastore,

@tmatsuo tmatsuo Apr 21, 2016

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have DatastoreService and UserService as parameters to the constructor. Is it because you wanted them to be injectable? Generally it's an easy and readable DI mechanism and great for simple samples like ours, but actually it is not needed for App Engine services. The test helper will replace the stubs for you, so you can just create the service object from the factory in the user land code. I may miss some other reasons though.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tswast tswast Apr 21, 2016

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's to be injectable. I also have DatastoreService as a parameter for some functions so that when I include the code the reader will see that the variable datastore is a DatastoreService type.

It wasn't clear to me if the DatastoreService created by the factory would connect to the same or a different in-memory datastore if it is called more than once. With injection, it's clear that we are definitely connecting to the same datastore in the test and in the code we are trying to test.

Plus, this is the way we always did it internally at Google. (Actually, we injected into the Servlet classes, as well, using Guice to do URL routing, but personally I find that super confusing and inappropriate for a sample)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tmatsuo tmatsuo Apr 21, 2016

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure that the services will use the same database, but it allows you to re-use the service object, and I think that's a fair reason. I just wanted to point out that with the App Engine test helper, you don't have to have DI container solely for testing purpose, at least for the services provided by App Engine.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tswast tswast Apr 21, 2016

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I just did a test with no injection and it does seem to use the same database.

To get the sharing with less boilerplate, I moved the factory call to the AbstractGuestbook class. That way the constructor doesn't need to get these passed in, but we still have object sharing.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lesv

lesv commented Apr 21, 2016

Copy link
Copy Markdown
Contributor

Consider Takashi's comments and mine. Ok to merge after that.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tmatsuo

tmatsuo commented Apr 21, 2016

Copy link
Copy Markdown
Contributor

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tswast
Add App Engine Datastore raw APIs sample.
c2091ae
These samples are pulled from the "projection query"
https://cloud.google.com/appengine/docs/java/datastore/projectionqueries
and "structuring for strong consistency"
https://cloud.google.com/appengine/docs/java/datastore/structuring_for_strong_consistency
pages.

I will add additional code to this sample as I convert the other pages,
as well.
@tswast
tswast force-pushed the datastore branch from f68a34b to c2091ae Compare April 21, 2016 17:27
@tswast
tswast merged commit 0dd0927 into master Apr 21, 2016
@tswast
tswast deleted the datastore branch April 21, 2016 17:43
minherz pushed a commit that referenced this pull request Nov 9, 2022
@renovate-bot
chore(deps): update dependency com.google.cloud:libraries-bom to v6 (#…
2c55196
…171)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | major | `5.7.0` -> `6.0.0` |

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/java-errorreporting).
minherz pushed a commit that referenced this pull request Nov 10, 2022
@renovate-bot @minherz
chore(deps): update dependency com.google.cloud:libraries-bom to v6 (#…
9600670
…171)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | major | `5.7.0` -> `6.0.0` |

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/java-errorreporting).
minherz pushed a commit that referenced this pull request Nov 10, 2022
@renovate-bot @minherz
chore(deps): update dependency com.google.cloud:libraries-bom to v6 (#…
e3f60c8
…171)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | major | `5.7.0` -> `6.0.0` |

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/java-errorreporting).
olivi-eh pushed a commit that referenced this pull request Nov 11, 2022
@renovate-bot
chore(deps): update dependency com.google.cloud:libraries-bom to v5.2…
f44ab35
….0 (#171)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | minor | `5.1.0` -> `5.2.0` |

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/java-dataproc).
@olivi-eh olivi-eh mentioned this pull request Nov 11, 2022
migrate code from googleapis/java-dataproc #7407
Merged
9 tasks
Shabirmean pushed a commit that referenced this pull request Nov 11, 2022
@renovate-bot
deps: update dependency com.google.cloud:google-cloud-pubsub to v1.11…
2707324
…5.1 (#171)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-pubsub](https://togithub.com/googleapis/java-pubsub) | `1.115.0` -> `1.115.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-pubsub/1.115.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-pubsub/1.115.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-pubsub/1.115.1/compatibility-slim/1.115.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-pubsub/1.115.1/confidence-slim/1.115.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-pubsub</summary>

### [`v1.115.1`](https://togithub.com/googleapis/java-pubsub/blob/HEAD/CHANGELOG.md#&#8203;11151-httpswwwgithubcomgoogleapisjava-pubsubcomparev11150v11151-2022-01-07)

[Compare Source](https://togithub.com/googleapis/java-pubsub/compare/v1.115.0...v1.115.1)

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-contact-center-insights).
@Shabirmean Shabirmean mentioned this pull request Nov 11, 2022
samples: migrate code from googleapis/java-contact-center-insights #7411
Merged
9 tasks
Shabirmean pushed a commit that referenced this pull request Nov 11, 2022
@renovate-bot @Shabirmean
deps: update dependency com.google.cloud:google-cloud-pubsub to v1.11…
761cca1
…5.1 (#171)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-pubsub](https://togithub.com/googleapis/java-pubsub) | `1.115.0` -> `1.115.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-pubsub/1.115.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-pubsub/1.115.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-pubsub/1.115.1/compatibility-slim/1.115.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-pubsub/1.115.1/confidence-slim/1.115.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-pubsub</summary>

### [`v1.115.1`](https://togithub.com/googleapis/java-pubsub/blob/HEAD/CHANGELOG.md#&#8203;11151-httpswwwgithubcomgoogleapisjava-pubsubcomparev11150v11151-2022-01-07)

[Compare Source](https://togithub.com/googleapis/java-pubsub/compare/v1.115.0...v1.115.1)

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-contact-center-insights).
Shabirmean pushed a commit that referenced this pull request Nov 17, 2022
@renovate-bot
chore(deps): update dependency com.google.cloud:libraries-bom to v6 (#…
d780878
…171)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | major | `5.7.0` -> `6.0.0` |

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/java-language).
@Shabirmean Shabirmean mentioned this pull request Nov 17, 2022
samples: migrate code from googleapis/java-language #7436
Merged
9 tasks
Shabirmean pushed a commit that referenced this pull request Nov 17, 2022
@renovate-bot @Shabirmean
chore(deps): update dependency com.google.cloud:libraries-bom to v6 (#…
ad17aab
…171)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | major | `5.7.0` -> `6.0.0` |

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

:no_bell: **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/java-language).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@lesv lesv

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@tswast @lesv @tmatsuo
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.