Skip to content

martinellich/jooq-spring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jOOQ Spring Integration

jooq-spring is a small open-source library that provides integration of jOOQ with the Spring Framework.

Dependency

Add a dependency to the current version:

<dependency>
    <groupId>ch.martinelli.oss</groupId>
    <artifactId>jooq-spring</artifactId>
    <version>0.4.0</version>
</dependency>

Components

JooqDAO

The JooqDAO follows the DAO pattern and not the Repository pattern because the Repository is a pattern from Domain Driven Design (DDD).

Usage

@Component
public class AthleteDAO extends JooqDAO<Athlete, AthleteRecord, Long> {

    public AthleteDAO(DSLContext dslContext) {
        super(dslContext, ATHLETE);
    }
}

Methods

Return Type Method Description
Optional<R> findById(ID id) Finds a record by its primary key.
List<R> findAll(int offset, int limit, List<org.jooq.OrderField<?>> orderBy) Retrieves a list of records from the database with pagination and sorting.
List<R> findAll(org.jooq.Condition condition, int offset, int limit, List<org.jooq.OrderField<?>> orderBy) Retrieves a list of records from the database with filtering, pagination, and sorting.
List<R> findAll(org.jooq.Condition condition, List<org.jooq.OrderField<?>> orderBy) Retrieves a list of records from the database with filtering, and sorting.
List<R> findAll(org.jooq.Condition condition) Retrieves a list of records from the database with filtering.
int count() Counts the total number of records in the associated table.
int count(org.jooq.Condition condition) Counts the number of records in the associated table that match the given condition.
int save(R record) Saves the given record to the database.
int[] saveAll(List<R> record) Saves a list of records to the database using batch store operations.
int merge(R record) Merges the given record into the database.
int deleteById(ID id) Deletes a record from the database identified by its primary key.
int delete(R record) Deletes the specified record from the database.
int delete(org.jooq.Condition condition) Deletes records from the database that match the given condition.

Check out the code documentation for further information JooqDAO.

License

jooq-spring is open and free software under Apache License, Version 2: http://www.apache.org/licenses/LICENSE-2.0.html

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages