{"id":10335,"date":"2025-09-06T10:02:26","date_gmt":"2025-09-06T17:02:26","guid":{"rendered":"https:\/\/www.couchbase.com\/developers\/tutorials\/quickstart-java-springdata\/"},"modified":"2025-09-06T10:02:26","modified_gmt":"2025-09-06T17:02:26","slug":"quickstart-java-springdata","status":"publish","type":"tutorials","link":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/quickstart-java-springdata\/","title":{"rendered":"Quickstart in Couchbase with Java and Spring Data"},"content":{"rendered":"\n<h3 id=\"h-getting-started\" class=\"wp-block-heading\">Getting Started<\/h3>\n\n\n\n<h4 id=\"h-prerequisites\" class=\"wp-block-heading\">Prerequisites<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">To run this prebuilt project, you will need:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.couchbase.com\/products\/capella\/\">Couchbase Capella<\/a> cluster with <a href=\"https:\/\/docs.couchbase.com\/dotnet-sdk\/current\/ref\/travel-app-data-model.html\">travel-sample<\/a> bucket loaded.\n<ul>\n<li>To run this tutorial using a self managed Couchbase cluster, please refer to the <a href=\"#running-self-managed-couchbase-cluster\">appendix<\/a>.<\/li>\n<\/ul>\n<\/li>\n\n\n<li><a href=\"https:\/\/git-scm.com\/book\/en\/v2\/Getting-Started-Installing-Git\">Git<\/a><\/li>\n\n\n<li>Code Editor or an Integrated Development Environment (e.g., <a href=\"https:\/\/www.eclipse.org\/ide\/\">Eclipse<\/a>)<\/li>\n\n\n<li>Java SDK 17 or higher installed<\/li>\n\n\n<li><a href=\"https:\/\/gradle.org\/install\/\">Gradle Build Tool<\/a><\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-source-code\" class=\"wp-block-heading\">Source Code<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The sample source code used in this tutorial is <a href=\"https:\/\/github.com\/couchbase-examples\/java-springdata-quickstart\">published on GitHub<\/a>.\nTo obtain it, clone the git repository with your IDE or execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code language-shell\"><code>git clone https:\/\/github.com\/couchbase-examples\/java-springdata-quickstart.git\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-install-dependencies\" class=\"wp-block-heading\">Install Dependencies<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Gradle dependencies:<\/p>\n\n\n\n<pre class=\"wp-block-code language-gradle\"><code>implementation &#039;org.springframework.boot:spring-boot-starter-web&#039;\n\/\/ spring data couchbase connector\nimplementation &#039;org.springframework.boot:spring-boot-starter-data-couchbase&#039;\n\/\/ swagger ui\nimplementation &#039;org.springdoc:springdoc-openapi-ui:1.6.6&#039;\n<\/code><\/pre>\n\n\n\n<h5 id=\"h-useful-links\" class=\"wp-block-heading\">Useful Links<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/docs.spring.io\/spring-data\/couchbase\/docs\/current\/reference\/html\/\">Spring Data Couchbase &#8211; Reference Documentation<\/a><\/li>\n\n\n<li><a href=\"https:\/\/docs.spring.io\/spring-data\/couchbase\/docs\/current\/api\/\">Spring Data Couchbase &#8211; JavaDoc<\/a><\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-database-server-configuration\" class=\"wp-block-heading\">Database Server Configuration<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Spring Data Couchbase connector can be configured by providing a <code>@Configuration<\/code> <a href=\"https:\/\/docs.spring.io\/spring-framework\/docs\/current\/reference\/html\/core.html#beans-definition\">bean<\/a> that extends <a href=\"https:\/\/docs.spring.io\/spring-data\/couchbase\/docs\/current\/api\/org\/springframework\/data\/couchbase\/config\/AbstractCouchbaseConfiguration.html\"><code>AbstractCouchbaseConfiguration<\/code><\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The sample application provides a modernized configuration bean with improved error handling and environment variable support:<\/p>\n\n\n\n<pre class=\"wp-block-code language-java\"><code>@Slf4j\n@Configuration\n@EnableCouchbaseRepositories\npublic class CouchbaseConfiguration extends AbstractCouchbaseConfiguration {\n\n  @Value(&quot;#{systemEnvironment[&#039;DB_CONN_STR&#039;] ?: &#039;${spring.couchbase.bootstrap-hosts:localhost}&#039;}&quot;)\n  private String host;\n\n  @Value(&quot;#{systemEnvironment[&#039;DB_USERNAME&#039;] ?: &#039;${spring.couchbase.bucket.user:Administrator}&#039;}&quot;)\n  private String username;\n\n  @Value(&quot;#{systemEnvironment[&#039;DB_PASSWORD&#039;] ?: &#039;${spring.couchbase.bucket.password:password}&#039;}&quot;)\n  private String password;\n\n  @Value(&quot;${spring.couchbase.bucket.name:travel-sample}&quot;)\n  private String bucketName;\n\n  @Override\n  public String getConnectionString() {\n    return host;\n  }\n\n  @Override\n  public String getUserName() {\n    return username;\n  }\n\n  @Override\n  public String getPassword() {\n    return password;\n  }\n\n  @Override\n  public String getBucketName() {\n    return bucketName;\n  }\n\n  @Override\n  public String typeKey() {\n    return &quot;type&quot;;\n  }\n\n  @Override\n  @Bean(destroyMethod = &quot;disconnect&quot;)\n  public Cluster couchbaseCluster(ClusterEnvironment couchbaseClusterEnvironment) {\n    try {\n      log.debug(&quot;Connecting to Couchbase cluster at &quot; + host);\n      return Cluster.connect(getConnectionString(), getUserName(), getPassword());\n    } catch (Exception e) {\n      log.error(&quot;Error connecting to Couchbase cluster&quot;, e);\n      throw e;\n    }\n  }\n\n  @Bean\n  public Bucket getCouchbaseBucket(Cluster cluster) {\n    try {\n      if (!cluster.buckets().getAllBuckets().containsKey(getBucketName())) {\n        log.error(&quot;Bucket with name {} does not exist. Creating it now&quot;, getBucketName());\n        throw new BucketNotFoundException(bucketName);\n      }\n      return cluster.bucket(getBucketName());\n    } catch (Exception e) {\n      log.error(&quot;Error getting bucket&quot;, e);\n      throw e;\n    }\n  }\n\n}\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>from config\/CouchbaseConfiguration.java<\/em><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">These methods are used to configure and retrieve a Couchbase Cluster and a specific Bucket within that cluster in a Spring application.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p><code>couchbaseCluster(ClusterEnvironment couchbaseClusterEnvironment)<\/code>: This method configures and returns a Cluster instance using the provided ClusterEnvironment. It logs a debug message indicating the connection attempt to the Couchbase cluster. If an error occurs during the connection attempt, it logs an error message and rethrows the exception.<\/p>\n<\/li>\n\n\n<li>\n<p><code>getCouchbaseBucket(Cluster cluster)<\/code>: This method retrieves a specific Bucket from the given Cluster. It first checks if the bucket exists in the cluster by calling cluster.buckets().getAllBuckets().containsKey(getBucketName()). If the bucket does not exist, it logs an error message, throws a BucketNotFoundException, and stops the application startup. Otherwise, it returns the Bucket instance.<\/p>\n<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This default configuration assumes that you have a locally running Couchbae server and uses standard administrative login and password for demonstration purpose.\nApplications deployed to production or staging environments should use less privileged credentials created using <a href=\"https:\/\/docs.couchbase.com\/go-sdk\/current\/concept-docs\/rbac.html\">Role-Based Access Control<\/a>.\nPlease refer to <a href=\"https:\/\/docs.couchbase.com\/java-sdk\/current\/howtos\/managing-connections.html\">Managing Connections using the Java SDK with Couchbase Server<\/a> for more information on Capella and local cluster connections.<\/p>\n\n\n\n<h4 id=\"h-application-properties\" class=\"wp-block-heading\">Application Properties<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">You need to configure the connection details to your Couchbase Server in the application.properties file located in the src\/main\/resources directory.s<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Modern Spring Boot 3.5+ Configuration:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code language-properties\"><code># Modern Couchbase configuration \nspring.couchbase.connection-string=${DB_CONN_STR}\nspring.couchbase.username=${DB_USERNAME}\nspring.couchbase.password=${DB_PASSWORD}\nspring.couchbase.bucket.name=travel-sample\n\n# Connection optimizations\nspring.couchbase.env.timeouts.query=30000ms\nspring.couchbase.env.timeouts.key-value=5000ms\nspring.couchbase.env.timeouts.connect=10000ms\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-environment-variables-setup\" class=\"wp-block-heading\">Environment Variables Setup<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">For security, use a <code>.env<\/code> file in your project root:<\/p>\n\n\n\n<pre class=\"wp-block-code language-properties\"><code>DB_CONN_STR=couchbases:\/\/xyz.cloud.couchbase.com\nDB_USERNAME=your_username\nDB_PASSWORD=your_password\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The connection string formats:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Couchbase Capella<\/strong>: <code>couchbases:\/\/xyz.cloud.couchbase.com<\/code> (secure)<\/li>\n\n\n<li><strong>Local Couchbase<\/strong>: <code>couchbase:\/\/localhost<\/code> (non-secure)<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>couchbases:\/\/<\/code> protocol is used for secure TLS connections (required for Couchbase Capella). The <code>couchbase:\/\/<\/code> protocol is for non-secure local connections.<\/p>\n\n\n\n<h3 id=\"h-running-the-application\" class=\"wp-block-heading\">Running the Application<\/h3>\n\n\n\n<h4 id=\"h-directly-on-machine\" class=\"wp-block-heading\">Directly on Machine<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">At this point, we have installed the dependencies, loaded the travel-sample data and configured the application with the credentials. The application is now ready and you can run it.<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>.\/gradlew bootRun\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note: If you&#8217;re using Windows, you can run the application using the Gradle wrapper batch file:<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>.gradlew.bat bootRun\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-using-docker\" class=\"wp-block-heading\">Using Docker<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Build the Docker image<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>docker build -t java-springdata-quickstart .\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run the Docker image<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>docker run -d --name springdata-container -p 8080:8080 java-springdata-quickstart\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note: The <code>application.properties<\/code> file has the connection information to connect to your Capella cluster. You can also pass the connection information as environment variables to the Docker container.\nIf you choose not to pass the environment variables, you can update the <code>application.properties<\/code> file in the <code>src\/main\/resources<\/code> folder.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the application is running, you can see the logs in the console. You should see the following log message indicating that the application has started successfully:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\".\/app-startup-spring-data.png\" alt=\"Spring Data Application\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the site is up and running, you can launch your browser and go to the <a href=\"http:\/\/localhost:8080\/swagger-ui\/\">Swagger Start Page<\/a> to test the APIs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\".\/swagger-documentation-spring-data.png\" alt=\"Swagger UI\"><\/p>\n\n\n\n<h3 id=\"h-data-model\" class=\"wp-block-heading\">Data Model<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For this tutorial, we use three collections, <code>airport<\/code>, <code>airline<\/code> and <code>route<\/code> that contain sample airports, airlines and airline routes respectively. The route collection connects the airports and airlines as seen in the figure below. We use these connections in the quickstart to generate airports that are directly connected and airlines connecting to a destination airport. Note that these are just examples to highlight how you can use SQL++ queries to join the collections.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><img decoding=\"async\" src=\".\/travel_sample_data_model.png\" alt=\"Data Model\"><\/p>\n\n\n\n<h3 id=\"h-airline-document-structure\" class=\"wp-block-heading\">Airline Document Structure<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We will be setting up a REST API to manage some airline documents. Our airline document will have a structure similar to the following:<\/p>\n\n\n\n<pre class=\"wp-block-code language-json\"><code>{\n  &quot;name&quot;: &quot;Couchbase Airways&quot;,\n  &quot;callsign&quot;: &quot;Couchbase&quot;,\n  &quot;iata&quot;: &quot;CB&quot;,\n  &quot;icao&quot;: &quot;CBA&quot;,\n  &quot;country&quot;: &quot;United States&quot;\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>name<\/code> field is the name of the airline. The <code>callsign<\/code> field is the callsign of the airline. The <code>iata<\/code> field is the IATA code of the airline. The <code>icao<\/code> field is the ICAO code of the airline. The <code>country<\/code> field is the country of the airline.<\/p>\n\n\n\n<h3 id=\"h-let-s-review-the-code\" class=\"wp-block-heading\">Let&#8217;s Review the Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To begin clone the repo and open it up in the IDE of your choice to learn about how to create, read, update and delete documents in your Couchbase Server.<\/p>\n\n\n\n<h4 id=\"h-code-organization\" class=\"wp-block-heading\">Code Organization<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>src\/test\/java<\/code>: Contains integration tests.<\/li>\n\n\n<li><code>src\/main\/java\/org\/couchbase\/quickstart\/springdata\/repository<\/code>: Contains the repository implementation.<\/li>\n\n\n<li><code>src\/main\/java\/org\/couchbase\/quickstart\/springdata\/model<\/code>: Contains the data model.<\/li>\n\n\n<li><code>src\/main\/java\/org\/couchbase\/quickstart\/springdata\/controller<\/code>: Contains the RESTful API controllers.<\/li>\n\n\n<li><code>src\/main\/java\/org\/couchbase\/quickstart\/springdata\/service<\/code>: Contains the service classes.<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-repository\" class=\"wp-block-heading\">Repository<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>AirlineRepository.java<\/code>\nThis interface extends the <code>CouchbaseRepository<\/code> interface and provides methods for CRUD operations.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p><code>@Scope(\"...\"):<\/code> Specifies the scope of the repository, which helps organize and manage documents within a Couchbase bucket.<\/p>\n<\/li>\n\n\n<li>\n<p><code>@Collection(\"...\"):<\/code> Specifies the collection within the bucket where the documents are stored.<\/p>\n<\/li>\n\n\n<li>\n<p><code>@Repository:<\/code> Marks the interface as a repository component in the Spring application context.<\/p>\n<\/li>\n\n\n<li>\n<p><code>@ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS)<\/code>: Specifies the scan consistency level for queries executed by methods in this repository, ensuring strong consistency for read operations.<\/p>\n<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-model\" class=\"wp-block-heading\">Model<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Airline.java<\/code>\nThis class represents an airline document. The <code>@Document<\/code> annotation indicates that this class is a Couchbase document. The <code>@Field<\/code> annotation indicates that the following fields are Couchbase document fields: <code>name<\/code>, <code>callsign<\/code>, <code>iata<\/code>, <code>icao<\/code>, <code>country<\/code>.<\/p>\n\n\n\n<h4 id=\"h-controller\" class=\"wp-block-heading\">Controller<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>AirlineController.java<\/code>\nThis class contains the REST API endpoints for CRUD operations. The <code>@RestController<\/code> annotation indicates that this class is a REST controller. The <code>@RequestMapping<\/code> annotation specifies the base URL for the REST API. The <code>@Autowired<\/code> annotation is used to autowire the <code>AirlineService<\/code> object. The <code>@GetMapping<\/code>, <code>@PostMapping<\/code>, <code>@PutMapping<\/code>, and <code>@DeleteMapping<\/code> annotations are used to map HTTP GET, POST, PUT, and DELETE requests respectively to their corresponding methods.<\/p>\n\n\n\n<h4 id=\"h-service\" class=\"wp-block-heading\">Service<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>AirlineService.java<\/code>\nThis class contains the business logic for the REST API. The <code>@Autowired<\/code> annotation is used to autowire the <code>AirlineRepository<\/code> object.<\/p>\n\n\n\n<h3 id=\"h-mapping-workflow\" class=\"wp-block-heading\">Mapping Workflow<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Mapping workflows describe how the HTTP methods (GET, POST, PUT, DELETE) interact with the <code>AirlineService<\/code> and the underlying database through the <code>AirlineRepository<\/code> to perform various operations on airline data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A simple REST API using Spring Boot and the <code>Couchbase SDK version 3.x<\/code> with the following endpoints:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#get-mapping-workflow\">Retrieve airlines by ID<\/a>.<\/li>\n\n\n<li><a href=\"#post-mapping-workflow\">Create new airlines with essential information<\/a>.<\/li>\n\n\n<li><a href=\"#put-mapping-workflow\">Update airline details<\/a>.<\/li>\n\n\n<li><a href=\"#delete-mapping-workflow\">Delete airlines<\/a>.<\/li>\n\n\n<li><a href=\"#get-mapping-workflow\">List all airlines with pagination<\/a>.<\/li>\n\n\n<li><a href=\"#get-mapping-workflow\">List airlines by country<\/a>.<\/li>\n\n\n<li><a href=\"#get-mapping-workflow\">List airlines by destination airport<\/a>.<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-get-mapping-workflow\" class=\"wp-block-heading\">GET Mapping Workflow<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The client initiates a GET request to <code>\/api\/v1\/airline\/{id}<\/code>, providing the unique identifier (<code>{id}<\/code>) of the airline they want to retrieve.<\/li>\n\n\n<li>The <code>AirlineController<\/code> receives the request and invokes the <code>getAirlineById(id)<\/code> method in the <code>AirlineService<\/code>. This function internally calls the <a href=\"https:\/\/docs.spring.io\/spring-data\/commons\/docs\/current\/api\/org\/springframework\/data\/repository\/CrudRepository.html#findById(ID)\">findById<\/a> method of the <code>AirlineRepository<\/code>(which extends <code>CouchbaseRepository<\/code>) to retrieve the airline information from the Couchbase database.<\/li>\n\n\n<li>Inside the <code>AirlineService<\/code>, the request is processed. The service interacts with the <code>AirlineRepository<\/code>.<\/li>\n\n\n<li>The <code>AirlineRepository<\/code> executes a query against the Couchbase database to retrieve the airline information based on the provided ID.<\/li>\n\n\n<li>If the airline is found, the <code>AirlineService<\/code> returns the retrieved information to the <code>AirlineController<\/code>.<\/li>\n\n\n<li>The <code>AirlineController<\/code> sends an HTTP response with an HTTP status code of <code>200<\/code> (OK) and includes the airline information in the response body.<\/li>\n\n\n<li>If the airline is not found in the database, the <code>AirlineService<\/code> returns <code>null<\/code>.<\/li>\n\n\n<li>The <code>AirlineController<\/code> responds with an HTTP status code of <code>404<\/code> (Not Found) if the airline is not found.<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-post-mapping-workflow\" class=\"wp-block-heading\">POST Mapping Workflow<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The client initiates a POST request to <code>\/api\/v1\/airline\/{id}<\/code> with a JSON payload containing the airline&#8217;s information, including a unique ID.<\/li>\n\n\n<li>The <code>AirlineController<\/code> receives the request and invokes the <code>createAirline(airline)<\/code> method in the <code>AirlineService<\/code>. The <code>createAirline<\/code> method internally calls the <a href=\"https:\/\/docs.spring.io\/spring-data\/commons\/docs\/current\/api\/org\/springframework\/data\/repository\/CrudRepository.html#save(S)\">save<\/a> method of the <code>AirlineRepository<\/code> to save the airline information to the Couchbase database.<\/li>\n\n\n<li>Inside the <code>AirlineService<\/code>, the incoming data is validated to ensure it meets the required criteria.<\/li>\n\n\n<li>The <code>AirlineService<\/code> creates a new <code>Airline<\/code> object and saves it to the Couchbase database using the <code>AirlineRepository<\/code>.<\/li>\n\n\n<li>If the airline is successfully created, the <code>AirlineService<\/code> returns the newly created airline object.<\/li>\n\n\n<li>The <code>AirlineController<\/code> sends an HTTP response with an HTTP status code of <code>201<\/code> (Created), including the newly created airline information in the response body.<\/li>\n\n\n<li>If the airline already exists in the database, a <code>DocumentExistsException<\/code> may be thrown.<\/li>\n\n\n<li>In case of a conflict, the <code>AirlineController<\/code> responds with an HTTP status code of <code>409<\/code> (Conflict).<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-put-mapping-workflow\" class=\"wp-block-heading\">PUT Mapping Workflow<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The client initiates a PUT request to <code>\/api\/v1\/airline\/{id}<\/code> with a JSON payload containing the updated airline information and the unique ID of the airline to be updated.<\/li>\n\n\n<li>The <code>AirlineController<\/code> receives the request and invokes the <code>updateAirline(id, airline)<\/code> method in the <code>AirlineService<\/code>. The <code>updateAirline<\/code> method internally calls the <a href=\"https:\/\/docs.spring.io\/spring-data\/commons\/docs\/current\/api\/org\/springframework\/data\/repository\/CrudRepository.html#save(S)\">save<\/a> method of the <code>AirlineRepository<\/code> to update the airline information in the Couchbase database.<\/li>\n\n\n<li>Inside the <code>AirlineService<\/code>, the incoming data is validated to ensure it meets the required criteria.<\/li>\n\n\n<li>The <code>AirlineService<\/code> updates the airline record in the Couchbase database using the <code>AirlineRepository<\/code>.<\/li>\n\n\n<li>If the airline is found and updated successfully, the <code>AirlineService<\/code> returns the updated airline object.<\/li>\n\n\n<li>The <code>AirlineController<\/code> sends an HTTP response with an HTTP status code of <code>200<\/code> (OK), including the updated airline information in the response body.<\/li>\n\n\n<li>If the airline is not found in the database, the <code>AirlineService<\/code> returns <code>null<\/code>.<\/li>\n\n\n<li>In case of an update to a non-existent airline, the <code>AirlineController<\/code> responds with an HTTP status code of <code>404<\/code> (Not Found).<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-delete-mapping-workflow\" class=\"wp-block-heading\">DELETE Mapping Workflow<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The client initiates a DELETE request to <code>\/api\/v1\/airline\/{id}<\/code>, specifying the unique identifier (<code>{id}<\/code>) of the airline to be deleted.<\/li>\n\n\n<li>The <code>AirlineController<\/code> receives the request and invokes the <code>deleteAirline(id)<\/code> method in the <code>AirlineService<\/code>. The <code>deleteAirline<\/code> method internally calls the <a href=\"https:\/\/docs.spring.io\/spring-data\/commons\/docs\/current\/api\/org\/springframework\/data\/repository\/CrudRepository.html#deleteById(ID)\">deleteById<\/a> method of the <code>AirlineRepository<\/code> to delete the airline from the Couchbase database.<\/li>\n\n\n<li>Inside the <code>AirlineService<\/code>, the service attempts to find and delete the airline record from the Couchbase database using the <code>AirlineRepository<\/code>.<\/li>\n\n\n<li>If the airline is found and successfully deleted, the <code>AirlineService<\/code> completes the operation.<\/li>\n\n\n<li>The <code>AirlineController<\/code> responds with an HTTP status code of <code>204<\/code> (No Content) to indicate a successful deletion.<\/li>\n\n\n<li>If the airline is not found in the database, the <code>AirlineService<\/code> may throw a <code>DocumentNotFoundException<\/code>.<\/li>\n\n\n<li>In case the airline is not found, the <code>AirlineController<\/code> responds with an HTTP status code of <code>404<\/code> (Not Found).<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">These detailed workflows provide a comprehensive understanding of how each mapping is handled by the controller, service, and repository components in your Spring Data project.<\/p>\n\n\n\n<h3 id=\"h-custom-sql-queries\" class=\"wp-block-heading\">Custom SQL++ Queries<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>AirlineRepository<\/code> interface contains a <code>@Query<\/code> annotation that allows us to create custom N1QL queries. The <code>@ScanConsistency<\/code> annotation allows us to specify the scan consistency for the query. The <code>@Param<\/code> annotation allows us to specify parameters for the query.<\/p>\n\n\n\n<pre class=\"wp-block-code language-java\"><code>@Query(&quot;#{#n1ql.selectEntity} WHERE #{#n1ql.filter} AND country = $country&quot;)\n@ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS)\nList&lt;Airline&gt; findByCountry(@Param(&quot;country&quot;) String country);\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>from repository\/AirlineRepository.java<\/em><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>findByCountry<\/code> method returns a list of airlines by country. It uses the <code>@Query<\/code> annotation to create a custom N1QL query. The <code>@Param<\/code> annotation is used to specify the <code>country<\/code> parameter for the query. The <code>@ScanConsistency<\/code> annotation is used to specify the scan consistency for the query.<\/p>\n\n\n\n<pre class=\"wp-block-code language-java\"><code>@Query(&quot;#{#n1ql.selectEntity} WHERE #{#n1ql.filter} AND ANY destination IN routes SATISFIES destination = $airport END&quot;)\n@ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS)\nList&lt;Airline&gt; findByDestinationAirport(@Param(&quot;airport&quot;) String airport);\n<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><em>from repository\/AirlineRepository.java<\/em><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>findByDestinationAirport<\/code> method returns a list of airlines by destination airport. It uses the <code>@Query<\/code> annotation to create a custom N1QL query. The <code>@Param<\/code> annotation is used to specify the <code>airport<\/code> parameter for the query. The <code>@ScanConsistency<\/code> annotation is used to specify the scan consistency for the query.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For more information, see the <a href=\"https:\/\/docs.couchbase.com\/java-sdk\/current\/howtos\/n1ql-queries-with-sdk.html\">Couchbase Java SDK documentation<\/a>.<\/p>\n\n\n\n<h3 id=\"h-running-the-tests\" class=\"wp-block-heading\">Running The Tests<\/h3>\n\n\n\n<h4 id=\"h-integration-tests\" class=\"wp-block-heading\">Integration Tests<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">This project uses Gradle with comprehensive integration test setup. The tests connect to a real Couchbase instance:<\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>.\/gradlew test\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Windows users:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code language-sh\"><code>.gradlew.bat test\n<\/code><\/pre>\n\n\n\n<h4 id=\"h-test-reliability\" class=\"wp-block-heading\">Test Reliability<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">This project was modernized to ensure reliable test execution:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Tests properly connect to Couchbase and validate real data<\/li>\n\n\n<li>Integration tests are included in the standard test run<\/li>\n\n\n<li>Test logging provides clear visibility into execution<\/li>\n\n<\/ul>\n\n\n\n<h3 id=\"h-continuous-integration\" class=\"wp-block-heading\">Continuous Integration<\/h3>\n\n\n\n<h4 id=\"h-github-actions\" class=\"wp-block-heading\">GitHub Actions<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The project includes a modern GitHub Actions workflow with:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Multi-Version Testing<\/strong>: Java 17 and 21 support<\/li>\n\n\n<li><strong>Manual Triggering<\/strong>: <code>workflow_dispatch<\/code> for on-demand runs<\/li>\n\n\n<li><strong>Enhanced Reliability<\/strong>: 15-minute timeouts, non-blocking failure handling<\/li>\n\n\n<li><strong>Test Artifacts<\/strong>: Automatic test report uploads<\/li>\n\n\n<li><strong>Optimized Commands<\/strong>: Uses <code>.\/gradlew clean test --stacktrace<\/code><\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-cicd-features\" class=\"wp-block-heading\">CI\/CD Features<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The workflow provides:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Temurin JDK setup with Gradle caching<\/li>\n\n\n<li>Real integration test execution against Couchbase<\/li>\n\n\n<li>Test result artifact collection for debugging<\/li>\n\n\n<li>Slack notification integration (configurable)<\/li>\n\n<\/ol>\n\n\n\n<h3 id=\"h-project-setup-notes\" class=\"wp-block-heading\">Project Setup Notes<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This project was created using the <a href=\"https:\/\/start.spring.io\/\">Spring Initializr<\/a> and modernized with:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Project<\/strong>: Gradle Project with Wrapper<\/li>\n\n\n<li><strong>Language<\/strong>: Java<\/li>\n\n\n<li><strong>Spring Boot<\/strong>: 3.5.5 (upgraded from 2.7.18)<\/li>\n\n\n<li><strong>Packaging<\/strong>: Jar<\/li>\n\n\n<li><strong>Java Version<\/strong>: 17+ (upgraded from Java 8)<\/li>\n\n\n<li><strong>Key Dependencies<\/strong>:\n<ul>\n<li>Spring Boot Starter Web<\/li>\n<li>Spring Boot Starter Data Couchbase<\/li>\n<li>SpringDoc OpenAPI Starter WebMVC UI<\/li>\n<li>Spring Boot Starter Validation<\/li>\n<li>Project Lombok<\/li>\n<li>JUnit 5 (Jupiter)<\/li>\n<\/ul>\n<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Performance Optimizations<\/strong>: The project uses <code>Slice<\/code> instead of <code>Page<\/code> for better memory efficiency and eliminates expensive <code>COUNT<\/code> queries in pagination scenarios.<\/p>\n\n\n\n<h3 id=\"h-contributing\" class=\"wp-block-heading\">Contributing<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Contributions are welcome! If you&#8217;d like to contribute to this project, please fork the repository and create a pull request.<\/p>\n\n\n\n<h3 id=\"h-appendix\" class=\"wp-block-heading\">Appendix<\/h3>\n\n\n\n<h4 id=\"h-extending-api-by-adding-new-entity\" class=\"wp-block-heading\">Extending API by Adding New Entity<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">If you would like to add another entity to the APIs, these are the steps to follow:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create the new entity (collection) in the Couchbase bucket. You can create the collection using the <a href=\"https:\/\/docs.couchbase.com\/java-sdk\/current\/howtos\/provisioning-cluster-resources.html#collection-management\">SDK<\/a> or via the <a href=\"https:\/\/docs.couchbase.com\/cloud\/n1ql\/n1ql-language-reference\/createcollection.html\">Couchbase Server interface<\/a>.<\/li>\n\n\n<li>Define the mappings in a new file in the <code>controllers<\/code> folder similar to the existing mappings like <code>AirportController.java<\/code>.<\/li>\n\n\n<li>Define the service in a new file in the <code>services<\/code> folder similar to the existing services like <code>AirportService.java<\/code>.<\/li>\n\n\n<li>Define the repository in a new file in the <code>repositories<\/code> folder similar to the existing repositories like <code>AirportRepository.java<\/code>.<\/li>\n\n\n<li>For integration tests, create a new class in the <code>controllers<\/code> package similar to the existing tests like <code>AirportIntegrationTest.java<\/code>.<\/li>\n\n<\/ul>\n\n\n\n<h4 id=\"h-running-self-managed-couchbase-cluster\" class=\"wp-block-heading\">Running Self Managed Couchbase Cluster<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">If you are running this quickstart with a self managed Couchbase cluster, you need to <a href=\"https:\/\/docs.couchbase.com\/server\/current\/manage\/manage-settings\/install-sample-buckets.html\">load<\/a> the travel-sample data bucket in your cluster and generate the credentials for the bucket.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You need to update the connection string and the credentials in the <a href=\"https:\/\/github.com\/couchbase-examples\/java-springdata-quickstart\/blob\/main\/src\/main\/resources\/application.properties\"><code>src\/main\/resources\/application.properties<\/code><\/a> file.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>NOTE:<\/strong> Couchbase must be installed and running prior to running the Spring Boot app.<\/p>\n<\/blockquote>\n\n\n\n<h4 id=\"h-swagger-documentation\" class=\"wp-block-heading\">Swagger Documentation<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Swagger documentation provides a clear view of the API including endpoints, HTTP methods, request parameters, and response objects.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Click on an individual endpoint to expand it and see detailed information. This includes the endpoint&#8217;s description, possible response status codes, and the request parameters it accepts.<\/p>\n\n\n\n<h5 id=\"h-trying-out-the-api\" class=\"wp-block-heading\">Trying Out the API<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">You can try out an API by clicking on the &#8220;Try it out&#8221; button next to the endpoints.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<p>Parameters: If an endpoint requires parameters, Swagger UI provides input boxes for you to fill in. This could include path parameters, query strings, headers, or the body of a POST\/PUT request.<\/p>\n<\/li>\n\n\n<li>\n<p>Execution: Once you&#8217;ve inputted all the necessary parameters, you can click the &#8220;Execute&#8221; button to make a live API call. Swagger UI will send the request to the API and display the response directly in the documentation. This includes the response code, response headers, and response body.<\/p>\n<\/li>\n\n<\/ul>\n\n\n\n<h5 id=\"h-models\" class=\"wp-block-heading\">Models<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Swagger documents the structure of request and response bodies using models. These models define the expected data structure using JSON schema and are extremely helpful in understanding what data to send and expect.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting Started Prerequisites To run this prebuilt project, you will need: Source Code The sample source code used in this tutorial is published on GitHub. To obtain it, clone the git repository with your IDE or execute the following command: Install Dependencies Gradle dependencies: Useful Links Database Server Configuration Spring Data Couchbase connector can be [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"_acf":"","footnotes":""},"tutorial-languages":[636],"tutorial-tags":[546,638],"tutorial-technologies":[548,549],"tutorial-types":[550],"class_list":["post-10335","tutorials","type-tutorials","status-publish","hentry","tutorial-languages-java","tutorial-tags-rest-api","tutorial-tags-spring-data","tutorial-technologies-kv","tutorial-technologies-query","tutorial-types-quickstart"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.8 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Quickstart in Couchbase with Java and Spring Data - Couchbase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/quickstart-java-springdata\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Quickstart in Couchbase with Java and Spring Data\" \/>\n<meta property=\"og:description\" content=\"Getting Started Prerequisites To run this prebuilt project, you will need: Source Code The sample source code used in this tutorial is published on GitHub. To obtain it, clone the git repository with your IDE or execute the following command: Install Dependencies Gradle dependencies: Useful Links Database Server Configuration Spring Data Couchbase connector can be [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/quickstart-java-springdata\/\" \/>\n<meta property=\"og:site_name\" content=\"Couchbase\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Couchbase\/\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2548\" \/>\n\t<meta property=\"og:image:height\" content=\"1171\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@couchbase\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"14 minuti\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/quickstart-java-springdata\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/quickstart-java-springdata\\\/\",\"name\":\"Quickstart in Couchbase with Java and Spring Data - Couchbase\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#website\"},\"datePublished\":\"2025-09-06T17:02:26+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/quickstart-java-springdata\\\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/quickstart-java-springdata\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/developers\\\/tutorials\\\/quickstart-java-springdata\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quickstart in Couchbase with Java and Spring Data\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/\",\"name\":\"Couchbase\",\"description\":\"The Operational Data Platform for AI\u2122\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#organization\"},\"alternateName\":\"Couchbase, Inc.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#organization\",\"name\":\"Couchbase\",\"alternateName\":\"Couchbase, Inc.\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/Couchbase_Logo_Couchbase_Token_Red-1.png\",\"width\":1129,\"height\":1129,\"caption\":\"Couchbase\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/it\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Couchbase\\\/\",\"https:\\\/\\\/x.com\\\/couchbase\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/CouchbaseServer\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/couchbase\\\/\",\"https:\\\/\\\/github.com\\\/couchbase\\\/\",\"https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Couchbase,_Inc.\"],\"description\":\"Couchbase is a database software company headquartered in San Jose, California, providing an operational data platform for AI used by hundreds of global enterprises.\",\"legalName\":\"Couchbase, Inc.\",\"foundingDate\":\"2011-01-01\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Quickstart in Couchbase with Java and Spring Data - Couchbase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/quickstart-java-springdata\/","og_locale":"it_IT","og_type":"article","og_title":"Quickstart in Couchbase with Java and Spring Data","og_description":"Getting Started Prerequisites To run this prebuilt project, you will need: Source Code The sample source code used in this tutorial is published on GitHub. To obtain it, clone the git repository with your IDE or execute the following command: Install Dependencies Gradle dependencies: Useful Links Database Server Configuration Spring Data Couchbase connector can be [&hellip;]","og_url":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/quickstart-java-springdata\/","og_site_name":"Couchbase","article_publisher":"https:\/\/www.facebook.com\/Couchbase\/","og_image":[{"width":2548,"height":1171,"url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/10\/Cloud-2.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@couchbase","twitter_misc":{"Est. reading time":"14 minuti"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/quickstart-java-springdata\/","url":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/quickstart-java-springdata\/","name":"Quickstart in Couchbase with Java and Spring Data - Couchbase","isPartOf":{"@id":"https:\/\/www.couchbase.com\/it\/#website"},"datePublished":"2025-09-06T17:02:26+00:00","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/quickstart-java-springdata\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/it\/developers\/tutorials\/quickstart-java-springdata\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/it\/developers\/tutorials\/quickstart-java-springdata\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/"},{"@type":"ListItem","position":2,"name":"Quickstart in Couchbase with Java and Spring Data"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/it\/#website","url":"https:\/\/www.couchbase.com\/it\/","name":"Couchbase","description":"The Operational Data Platform for AI\u2122","publisher":{"@id":"https:\/\/www.couchbase.com\/it\/#organization"},"alternateName":"Couchbase, Inc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/it\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/it\/#organization","name":"Couchbase","alternateName":"Couchbase, Inc.","url":"https:\/\/www.couchbase.com\/it\/","logo":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/www.couchbase.com\/it\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","contentUrl":"https:\/\/www.couchbase.com\/wp-content\/uploads\/2026\/11\/Couchbase_Logo_Couchbase_Token_Red-1.png","width":1129,"height":1129,"caption":"Couchbase"},"image":{"@id":"https:\/\/www.couchbase.com\/it\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Couchbase\/","https:\/\/x.com\/couchbase","https:\/\/www.youtube.com\/c\/CouchbaseServer","https:\/\/www.linkedin.com\/company\/couchbase\/","https:\/\/github.com\/couchbase\/","https:\/\/en.wikipedia.org\/wiki\/Couchbase,_Inc."],"description":"Couchbase \u00e8 una societ\u00e0 di software per database con sede a San Jose, in California, che fornisce una piattaforma operativa per i dati utilizzata da centinaia di aziende globali.","legalName":"Couchbase, Inc.","foundingDate":"2011-01-01"}]}},"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorials\/10335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorials"}],"about":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/types\/tutorials"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorials\/10335\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/media?parent=10335"}],"wp:term":[{"taxonomy":"tutorial-languages","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-languages?post=10335"},{"taxonomy":"tutorial-tags","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-tags?post=10335"},{"taxonomy":"tutorial-technologies","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-technologies?post=10335"},{"taxonomy":"tutorial-types","embeddable":true,"href":"https:\/\/www.couchbase.com\/it\/wp-json\/wp\/v2\/tutorial-types?post=10335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}