Giter Club home page Giter Club logo

jooqtest's Introduction

JooqTest

This is a simple example of JOOQ application.

JOOQ allows to create Java Models from any SQL database to persist data, hence it is almost instantly possible to manipulate and persist data from java code to any SQL database. Follow the procedure described below and explore the different hand written and generated files to understand why JOOQ is probably far better than hibernate.

Just Open it as a Maven project in Eclipse or whatever. the Test folder is the Maven root folder The MYSQL Database is running on a Raspberry pi 2, so it can sometimes be offline (if internet or electricity is down :/)

What to do

  1. Load the project
  2. Run Maven install
  3. Run GenerateJOOQ.java from the Jooq.Test package -> This will generate the model from an online database thanks to an xml file described here (the library.xml used in the project is modified but quite identical): http://www.jooq.org/doc/3.8/manual/getting-started/tutorials/jooq-in-7-steps/jooq-in-7-steps-step3/

Instead of generating files from command line, I just launch it from a simple java class. It's more logical in a maven environment.

  1. Open the AuthorRecord.java file from the test.generated.tables.records package and remove the @override annotations that generate errors (if there are errors, otherwise don't do that)

  2. Run App.java from the Jooq.Test package -> It shows simple extraction and insertion in a database.

Don't hesitate to modify the insertions and so on

Bibliography

Everything comes from here :

http://www.jooq.org/doc/3.8/manual/getting-started/tutorials/jooq-in-7-steps/jooq-in-7-steps-step1/ http://www.jooq.org/doc/2.5/manual/sql-building/sql-statements/insert-statement/

jooqtest's People

Contributors

tritbool avatar

Watchers

James Cloos avatar  avatar

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.