8000 GitHub - mswatosh/data: Data-API
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mswatosh/data

 
 

Repository files navigation

Jakarta Data

Introduction

The Jakarta Data specification provides an API for easier data access to various database types, such as relational and NoSQL. A Java developer can access those repositories in several ways, including composing custom query methods on a Repository interface.

Jakarta Data’s goal is to provide a familiar and consistent, Jakarta-based programming model for data access while still retaining the particular traits and strengths of the underlying data store.

Repository

A repository abstraction designed to significantly reduce the boilerplate code required to implement data access layers for various types of persistent stores.

@Repository
public interface CarRepository extends CrudRepository<Car, Long> {

  List<Car> findByType(CarType type);

  Optional<Car> findByName(String name);

}
@Inject
CarRepository repository;
...
Car ferrari = Car.id(10L).name("Ferrari").type(CarType.SPORT);
repository.save(ferrari);

Pagination

Jakarta Data also supports parameters to define pagination and sorting.

@Repository
public interface ProductRepository extends PageableRepository<Product, Long> {

 Page<Car> findByTypeOrderByName(CarType type, Pageable pageable);

}

Maven

To start to use Jakarta Dara, add the API as a Maven dependency:

<dependency>
    <groupId>jakarta.data</groupId>
    <artifactId>jakarta-data-api</artifactId>
    <version>1.0.0-b2</version>
</dependency>

Testing Guideline

This project has a testing guideline that will help you understand Jakarta Data’s testing practices. Please take a look at the TESTING-GUIDELINE file.

Code of Conduct

This project is governed by the Eclipse Foundation Community Code of Conduct. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to codeofconduct@eclipse.org.

Getting Help

Having trouble with Jakarta Data? We’d love to help!

Report Jakarta Data bugs at https://github.com/jakartaee/data/issues.

Building from Source

You don’t need to build from source to use the project, but you can do so with Maven and Java 17 or higher.

mvn clean install

Meetings

Releases

No releases published

Packages

No packages published

Languages

  • Java 96.0%
  • Standard ML 3.9%
  • Shell 0.1%
0