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 — java-docs-samples/spanner/spring-data at main · tpryan/java-docs-samples

Expand file tree

/

spring-data

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

spring-data

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src/main
src/main
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

README.md

Outline

Spring Data Cloud Spanner Sample

An example that demonstrates read, write, and administrative operations using Spring Data Cloud Spanner.

This sample requires Java and Maven for building the application.

This sample includes 3 classes that demonstrate how to use Spring Data Cloud Spanner to perform read, write, and database admin operations.

  • SpannerSchemaToolsSample - create and drop interleaved tables based on a root Java entity class.
  • SpannerTemplateSample - perform read and write operations with Java entities.
  • SpannerRepositorySample - perform operations and queries by defining their operations in an interface.

Build and Run

  1. Follow the set-up instructions in the documentation.

  2. Enable APIs for your project. Click here to visit Cloud Platform Console and enable the Google Cloud Spanner API.

  3. Create a Cloud Spanner instance and database via the Cloud Plaform Console's Cloud Spanner section.

  4. Enable application default credentials by running the command gcloud auth application-default login.

  5. Supply your instance and database name in src/main/resources/application.properties

  6. Run the following Maven command to run QuickStartSample, which runs table creation, write, and read operations:

    mvn clean spring-boot:run
    
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.