Skip to content
Spring Data Module for Yugabyte DB.
Java Other
  1. Java 99.9%
  2. Other 0.1%
Branch: master
Clone or download

readme.adoc

Spring Data YugabyteDB

Spring Data YugabyteDB is the Spring data module for YugabyteDB database based on Spring Data JPA.

Getting Started

Maven configuration

Add the Maven dependency:

<dependency>
  <groupId>com.yugabyte</groupId>
  <artifactId>spring-data-yugabytedb</artifactId>
  <version>2.1.10-yb-1</version>
</dependency>

Data source configuration

To enable the YugabyteDB configuration create configuration class:

@Configuration
public class DatabaseConfiguration extends AbstractYugabyteConfiguration {
  // Here you can override the dataSource() method to configure the DataSource in code.
}

Configure your application.properties. For instance:

spring.yugabyte.initialHost=localhost
spring.yugabyte.port=5433
spring.yugabyte.database=yugabyte
spring.yugabyte.user=yugabyte
spring.yugabyte.password=yugabyte
spring.yugabyte.maxPoolSizePerNode=8
spring.yugabyte.connectionTimeoutMs=10000
spring.yugabyte.generate-ddl=true
spring.yugabyte.packages-to-scan=com.example.spring.jpa.springdatajpaexample.domain

See also the spring-data-yugabytedb-example app.

You can’t perform that action at this time.