Git Product home page Git Product logo

jooq-plus's Introduction

jOOQ Plus

Several classes to enhance JOOQ and boost CRUD.

Background

Mybatis

Honestly, most Java programmers in China should have used Mybatis 3 and its enhanced libraries: Mybatis Plus or tk.mybatis.mapper . These two enhanced libraries provide a layer of encapsulation on top of mybatis, using proxies to provide single-table CRUD methods without maintaining the SQL templates (both in the form of Java annotations and XML form). Users only need to inherit the base class , complete the development of single-table CRUD (Create, Retrieve, Update, Delete and list, exists, count, etc.).

jOOQ

jOOQ and Mybatis are not essentially the same class of things: (Different use cases and the technical difference and between MyBatis and jOOQ, SQL Templating with jOOQ or MyBatis). I will not introduce the advantages and disadvantages of JOOQ here, nor will I say why you should use this and not use that. There is a lot of relevant information on the Internet.

Despite all the documentation and Lukas Eder(main maintainer of JOOQ community ) himself saying that JOOQ can work alone from the code generator, after practicing in several companies, this would give us an inch. Even a requirement like getting the self-incrementing ID of the inserted data would be difficult to satisfy. If you are interested in JOOQ, I highly recommend that you use jOOQ's code generator in conjunction with a database DDL maintenance tool such as Flyway so that you can use 100% of JOOQ's capabilities. I will show it in the test how to practice.

jOOQ Plus

Although no matter what library is used, CRUD Boy's job is still the same. We need to get CRUD done F A S T and focus on the actual business. When you use jOOQ, you will find:

  1. jOOQ's Dao lacks some necessary logic and is too simple. Dao also cannot return the incremental ID of the new data: jOOQ/jOOQ#13806. jOOQ's record has a CRUD-related API, but essentially the same as Dao: https://www.jooq.org/doc/latest/manual/sql-execution/crud-with-updatablerecords/simple-crud/.
  2. You need to maintain things from a bunch of SQL (whatever Java and Annotation or XML) to a bunch of Java fluent API code, but they're still the same CRUD code.

Essentially, we're just too lazy to maintain these code.You just have to write the code, you have to test them.It's tedious and boring.

Overview

jOOQ Plus is very very very simple. It is made up of a few interface and abstract implementation, designed to be similar to the Spring Data JPA CrudRepository(there it is: BaseCrudRepository) and PagingAndSortingRepository(traced by #5 and will be done recently).

In the implementation, I will make maximum use of Java generics and the code generated by the jOOQ code generator, rather than using proxies and reflection.

RoadMap

jooq-plus's People

Contributors

spencercjh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jooq-plus's Issues

Support multi-tables query

I have some closed-source cross-table query implementations that need to be desensitized and extracted here.

Welcome more ideas and implementation demo.

Add CI/CD

Execute the following jobs:

  • lint(check)
  • test
  • publish to GitHub Packages

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.